Repository navigation
fix(refs): name the settled diff in the plain-ref refusal and issue its replacement refs - #5037
Conversation
…ts replacement refs After `fill @e3 … --settle; press @e4` with @E4 taken from the earlier full snapshot, the plain-ref refusal offered nothing: the agent could not tell that a settled diff replaced the frame and paid a full `snapshot -i` every time (callstack#4571, the most common agent-blocking error in the dogfood data). The frame value now records which publication minted it. `RefFrameOrigin` (`complete` | `settle-diff` | `partial`) is set at issuance through the same factories; every partial publication flows through one choke point (`markSessionPartialRefsIssued`), and only the settle path (`issueSettleRefs`) passes `settle-diff`, so find, audit, replay divergence, and ambiguity issuances keep their refusal shape unchanged. Origin is diagnostic only: no admission decision and no ref lifetime changes — whether refs a diff left unchanged stay valid stays open for maintainers on callstack#4571. When the refusing frame is settle-diff and the refused plain ref is not one of its issued refs, the refusal: - names the settled diff as the replacement in the message (and says when the diff issued no refs), - carries `details.replacedBy: "settle-diff"` and `details.replacementRefs`, each issued ref pinned to the frame epoch in the ready-to-copy `@eN~s<epoch>` form (callstack#4853 paste-ready standard; the frame already authorized exactly these bodies, so printing them issues nothing new), - offers the same refs in the hint with the fresh-snapshot escape. The exact-emitted-ref suggestion keeps precedence when the refused body is itself in scope. ADR 0014 amended (dated subsection beside the refusal contract it extends). Co-Authored-By: Claude Code <noreply@anthropic.com>
03426a6 to
5d948cc
Compare
|
Thanks for the clear fix. The PR is ready at 5d948cc: the change reads correctly and the 16 passing checks cover it. The only check that did not pass is Body rules, which was cancelled with no output. It lints PR title and body metadata, which this diff does not touch, so please re-run it before merge. No conflicts. Not verified here: unit tests, typecheck and layering were not re-run locally, and the Body rules job could not be inspected. No device run is needed, since the change alters refusal text and frame provenance, not dispatch, capture or admission. Not blocking, and fine to take or leave: (1) a plain-ref read after a settle, such as |
Summary
The #4571 follow-up slice: when a plain ref is refused because a
--settlediff replaced the ref frame, the refusal names the settled diff as the replacement and issues replacement refs from the settle-diff frame (#4853's "replacement ref, ready to copy" standard). Explicit non-goal: ref-lifetime semantics — whether refs the diff left unchanged stay valid stays open on the issue. Command-surface change: new refusal text and additive error details; ADR 0014 amended. The frame value now records a bounded issuance origin; only the settle path passessettle-diff, so find, audit, replay divergence, and ambiguity refusals keep their shape. No heuristics: the list is exactly the settle frame's issued scope, pinned to the frame epoch; origin is diagnostic only — no admission or ref-lifetime change.Before / after
fill @e3 … --settle; press @e4,@e4from the earlier snapshot, settle frame scope{e34, e7}, epoch s531735 — real strings from the new tests:A no-ref settle frame keeps the recapture guidance; a refused body in scope keeps the existing
suggestedRefrefusal verbatim.Validation
Head 5d948cc on upstream main 0d38f89.
unit-core: 35 passed; broader daemon core/execution/sessions: 2,865 passed; command-output + kernel: 560 passed.pnpm tsc -b,pnpm format: pass.pnpm check:affected --run: format, lint, typecheck pass; the local layering stage fails on pre-existing drift — detach control at the pinned base gives byte-identical violation lists, zero PR-introduced findings; eager-closure budgets fail identically at head and base, the known upstream-branch false positive.Refs #4571
🤖 Generated with Claude Code