Skip to content

Proposing the same write again withdraws the older held copy - #48

Merged
Ermag merged 3 commits into
mainfrom
fix/supersede-held-duplicates
Nov 7, 2026
Merged

Ermag merged 3 commits into
mainfrom
fix/supersede-held-duplicates

Conversation

@Ermag

@Ermag Ermag commented Nov 7, 2026

Copy link
Copy Markdown
Owner

What happened

In the demo, the review page had two held copies of UPDATE orders SET status = 'cancelled' WHERE status = 'pending': #2, left over from a run on Oct 31, and #4, the one the agent had just proposed. The page lists held changes oldest first, so the approval went to #2. It applied (1,284 rows), while #4, the change the agent was watching, correctly stayed held. Approving #4 afterwards failed with "drift since preview", because the rows were already cancelled.

Change status was never stale; the person approved a stale duplicate.

Fix

When an agent proposes a statement that, after normalizing, is the same as one of its own still-held changes on the same database, Rowbit withdraws the older copy on the agent's behalf (the agent is the only actor allowed to withdraw) and logs a Superseded note naming the new change. A blocked re-proposal leaves the older copy alone. The review page then shows one copy, the one the agent is waiting for.

  • Engine::supersede in rowbit-engine, called from propose after the new change is decided.
  • Test: proposing_again_withdraws_the_older_held_copy (MariaDB and MySQL), including a differently spelled copy and an unrelated held change that stays held.
  • attacks.rs self_approval now expects one held change after re-proposing.
  • Spec (change-lifecycle.md) and CHANGELOG.

rowbit-cli demo::never_writes_into_a_directory_of_yours fails locally only because the demo is running on :8080.

Signed-off-by: Ermag <ermag.bg@gmail.com>
@Ermag Ermag added the fix Bug fix; release notes: Fixes label Nov 7, 2026
Ermag added 2 commits November 7, 2026 23:04
…oposal, link the new copy

Signed-off-by: Ermag <ermag.bg@gmail.com>
…plicates

Signed-off-by: Ermag <ermag.bg@gmail.com>

# Conflicts:
#	crates/rowbit-web/dist/assets/app.js
@Ermag
Ermag merged commit ce503d4 into main Nov 7, 2026
14 checks passed
@Ermag
Ermag deleted the fix/supersede-held-duplicates branch November 7, 2026 22:07
@Ermag Ermag mentioned this pull request Nov 7, 2026
2 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix; release notes: Fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant