Skip to content

docs(executor): record Phase 3b turn-boundary rollback as resolved by PR #139 - #141

Merged
dahai80 merged 1 commit into
mainfrom
docs/executor-phase3b-resolved-by-pr139
Aug 26, 2026
Merged

dahai80 merged 1 commit into
mainfrom
docs/executor-phase3b-resolved-by-pr139

Conversation

@dahai80

@dahai80 dahai80 commented Aug 26, 2026

Copy link
Copy Markdown
Owner

Summary

Records the Phase 3b turn-boundary snapshot/rollback (PRD line 160) defer item as resolved by PR #139, not as pending backlog.

Context

PRD line 160 specifies: "调用 fusion-executor 前生成 Git/内存快照,若重试 3 次仍然失败,自动触发 executor.rollback()" — snapshot before executor call, rollback on failure.

PR #139 already satisfies this intent via in-band per-command auto-rollback:

  • buildRequest sends auto_rollback_policy (opt-in FUSION_CODE_EXECUTOR_AUTO_ROLLBACK, default off)
  • executor snapshots at call-start, rolls back on exit_code != 0 + file-damage diff > 0
  • sets auto_rolled_back = true; model sees <note>Working tree auto-reverted…</note>

The file-damage diff guard is safer than PRD's blind retry-3x — it only reverts when files were damaged, not on a legit edit-test-fail loop, preserving the model's valid edits.

Why not the whole-turn variant

The deferred client-orchestrated whole-turn revert (explicit executor.snapshot_create / executor.rollback RPC + turn-lifecycle wiring) is architecturally inferior, not merely large:

  1. Loses good edits — whole-turn revert discards the model's successful edits; PR feat(executor): Phase 2 diagnostics slicing + Phase 3 git snapshot/rollback #139's per-command file-damage guard does not.
  2. Needs a new failure counter in query.ts — no consecutive-tool-failure counter exists in the loop State; only consecutiveFailures (compaction) and mlxModelOomCount (MLX OOM).
  3. No terminal-reason capture path — the REPL query loop for await (const event of query({...})) (REPL.tsx:3841) consumes the generator but discards the terminal return value; surfacing reason into REPL needs new plumbing.
  4. PRD retry-3x is Python HealingSession pseudocode (fixed counter) — fusion-code's loop is model-driven (the model itself retries), so a fixed counter does not map.
  5. Explicit RPC with zero callers = speculative dead code — violates simplicity.

Change

Doc-only update to docs/model-providers.md § "Scope-creep(显式 defer)": rewrites the Phase 3b bullet from "pending large PR" to an explicit resolved-by-PR #139 decision with the rationale above.

Verification

Doc-only change; no code, build, or test impact.

Co-Authored-By: Claude Fable 5 [email protected]

… PR #139

PRD line 160 intent ("snapshot before executor call, rollback on failure")
is already satisfied by PR #139's in-band per-command auto-rollback
(buildRequest sends auto_rollback_policy; executor snapshots at call-start,
rolls back on exit!=0 + file-damage diff>0). The file-damage guard is safer
than PRD's blind retry-3x (only reverts when files are damaged, not on
legit edit-test-fail). The client-orchestrated whole-turn variant
(explicit snapshot_create/rollback RPC + turn lifecycle wiring) is
architecturally inferior: loses the model's good edits, needs a new
failure counter in query.ts, and the REPL query loop discards the terminal
return value (no capture path). Recording this as an explicit decision,
not backlog.

Co-Authored-By: Claude Fable 5 <[email protected]>
@dahai80
dahai80 merged commit 37cb441 into main Aug 26, 2026
1 check passed
@dahai80
dahai80 deleted the docs/executor-phase3b-resolved-by-pr139 branch August 26, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant