Skip to content

fix(agents): back-to-back edit proposals rebase instead of clobbering; newest replaces older (v0.496.0) - #963

Merged
vikasprogrammer merged 1 commit into
mainfrom
feat/proposal-rebase
Dec 2, 2026
Merged

vikasprogrammer merged 1 commit into
mainfrom
feat/proposal-rebase

Conversation

@vikasprogrammer

Copy link
Copy Markdown
Owner

Problem

An agent_propose_update card 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

  1. Rebase on approval. Patch cards (claudeMdEdits/claudeMdAppend) also store the patch; approval re-applies it to the current prompt (rebaseProposal). Different sections → both survive. Anchor changed → refused as conflict (nothing written, re-propose). Full claudeMd replacement 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").
  2. Newest replaces older. A proposer's new card for the same target marks its older open card 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 passed
  • scripts/proposal-surfacing-test.cjs §4 updated: it pinned the old clobber as expected behaviour
  • npm run test:governance: 153 suites passed; web build clean

🤖 Generated with Claude Code

…; 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>
@vikasprogrammer
vikasprogrammer merged commit 5aff4da into main Dec 2, 2026
1 check passed
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