fix(goal): durable boundary gate stops crash-recovery turn inflation - #289
Merged
Conversation
issue #285 — after a crash, the boot scan could re-judge the exact boundary the crashed process already judged and committed: evaluatedRevisions is process-local, so both dedup gates let the stale boundary through, and updateAfterJudge inflated turns_used and dispatched a duplicate continuation. - GoalState.Info gains last_judged_msg; updateAfterJudge(judged) persists the judged assistant message id on every continue commit (same transition, atomic) - afterIdle scan path: while the session window still ends on last_judged_msg, no new progress has landed — skip re-evaluation. Live idle events are never gated: each dispatched continuation produces a fresh assistant message, so the live path always judges a new boundary; resume/subgoal edits re-drive through live turns, not the scan. - crash between continue commit and continuation dispatch: the gate skips (avoids inflation + duplicate); recovering the lost dispatch remains the separate explicit design noted in goal CONTEXT.md. Tests (red-first): unchanged-boundary scan commits nothing (turns stay 1, judge 0 calls); advanced-boundary scan proceeds (turns 2, continuation dispatched).
This was referenced Aug 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修复 issue #285(F3:崩溃重启后启动扫描重复评估同一边界 → turns_used 通胀 + 重复续派)。
Fix
GoalState.Info新增last_judged_msg;updateAfterJudge(judged)在 continue 提交时持久化被判定的 assistant 消息 id(同一 transition,原子)afterIdle扫描路径 durable 门:会话窗口仍终止于last_judged_msg时跳过再评估(崩溃前已判定+提交,无新进展)。live idle 永不触发此门——每次续派都会产生新 assistant 消息;resume/subgoal 编辑经 live 轮驱动,不走扫描Evidence(/tdd)
judged参数即编译红)→ 实现 → 绿test/goal105 pass / 0 fail;typecheck 干净;改动文件 lint 0 警告(净零增量)