Why: Q1 WP4/WP6/WP7 - run persistence goes through a Store port
(FileStore carries the current layout), superstep boundaries write
tiered snapshots with a graph fingerprint for recovery continuity,
and the four hardcoded stop conditions move behind one Termination
registry with And/Or composition.
Evidence: go vet clean; full suite ok including new checkpoint,
continuity-rejection, termination-primitive, grant-cap and the
Q23-updated leader closeout tests; cmd module green with
SweepExpired wired into the sweeper loop.
Impact: runState saves via Store (FileStore unchanged by default);
advance writes sync/async/on_exit checkpoints and Resume rejects
graph-shape changes from the crash window; leader turn cap now
degrades through finalize instead of a bare failure (Q23); manual
repair grants are bounded (Q26); wakeup cap and step timeout read
from the same registry; the dead SweepExpired is now called (Q6).
Refs: Documents proposal 2026-10-07-agent-stack-n1q1i1-plans.md Q1 WP4/WP6/WP7
weichen
merged commit 1c3995beaa into main2026-10-07 10:02:01 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Q1 增量三:Store 端口 + 三档检查点 + Termination 收编(WP4/WP6/WP7)
按 Documents 提案
2026-10-07-agent-stack-n1q1i1-plans.md§3.2 落地 Q1 的 WP4/WP6/WP7。改动
WP4 Store 端口与三档检查点
squad/runstore.go:Store端口(SaveRun/LoadRun/SaveGate/LoadGate/SaveCheckpoint/LoadLatestCheckpoint),FileStore收编现状文件态(低层落盘语义逐字不变);runState 与 engineDeps 携带端口(缺省 FileStore),构造与全部加载点改道端口。Checkpoint:superstep 序号 + 图结构指纹(fnv)+ 全量步骤快照,落checkpoints/NN.json+latest.json。三档(RunOptions.CheckpointMode):sync(默认,边界立即写)、async(单 goroutine 串行写、退出前 flush)、on_exit(只写最终快照)。WP6 Termination 收编
squad/termination.go:Termination(leader 轮次/修复预算/唤醒次数/步骤超时集中,DefaultTermination与现网取值一致,terminationOf让引擎选项覆盖)+ And/Or 组合原语(含 MaxTurns/RepairBudget/Wakeups/Deadline 条件)。leaderFail改为按现有产出走 finalize 降级收口(质检/汇总路径与正常收口一致);Q26 人工 retry 累计追加有界(RepairBudgetGranted落盘,上限=预算×2,超限拒绝而不是永动);唤醒上限与步骤超时改引注册点。WP7 interrupt/resume 形态对齐 + Q6
SweepExpired(此前是死代码)接进 serve 的周期扫描循环,与SweepWakeups并列——事件唤醒与过期合成是同一对 interrupt/resume 原语的两条恢复路径。验证
TestLeaderModeTurnCapGuard按 Q23 语义改述(不再是裸失败);既有恢复/leader/engine 套件原样通过。主任务:Dev 仓
feature/agent-stack-q1。