Repository navigation
fix(agents): back-to-back edit proposals rebase instead of clobbering; newest replaces older (v0.496.0) - #963
Merged
Merged
Conversation
…; newest replaces older (v0.496.0) A cross-agent edit card stored the target's whole resolved CLAUDE.md, so approving two cards in a row made the second silently revert the first. Patch cards now keep the patch and are re-applied to the current prompt on approval (conflict = refused, never guessed); a full replacement keeps the existing stale warning. A proposer's newer card for the same target supersedes its older open one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
An
agent_propose_updatecard stored the target's whole resolved CLAUDE.md, even for a patch. Approve card A, then card B → B writes a prompt that predates A, and A silently disappears (warned only after the fact).Fix
claudeMdEdits/claudeMdAppend) also store the patch; approval re-applies it to the current prompt (rebaseProposal). Different sections → both survive. Anchor changed → refused asconflict(nothing written, re-propose). FullclaudeMdreplacement on a moved prompt → unchanged stale warning. Review list shows each card as it would apply now ("updated to current prompt" / "no longer applies" with Approve disabled / "out of date").superseded(audited, reply tells the agent; inbox chip "replaced by a newer one"; approving it → 409). Other agents' cards untouched; identical re-proposal still refused; 10-cap counts other targets only.Verification
scripts/agent-edit-guard-test.cjs: new §2c (pure rebase) + §5 (end to end: two patches both survive, same-line conflict refused, full rewrite still warns, supersede) — 86 passedscripts/proposal-surfacing-test.cjs§4 updated: it pinned the old clobber as expected behaviournpm run test:governance: 153 suites passed;webbuild clean🤖 Generated with Claude Code