INV-5 gap: rejecting a proposal after typing inside its pending range silently skips the revert #70
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Surfaced by session 0065's Task 9 review (native-surfaces migration, full-loop E2E).
Behavior (pre-existing F12 code,
src/proposalController.tsrevertInPlace):revertInPlace()only restoresproposal.originalwhen the anchorresolve()succeeds. When the writer has typed INSIDE the pending proposal's range first (which orphans the exact-substring anchor per INV-1/INV-11),revertInPlaceskips the WorkspaceEdit entirely, removes the proposal from the store, and still returnstrue— so ✗ Reject silently leaves the (edited) proposed text in the buffer instead of restoring the retained original. INV-5 ("Reject restores the retained original exactly") does not hold on this path, and the reported success masks it.Contrast: ✓ Keep after the same interior tweak is fine by design —
finalizeInPlacelooks up by id and bypasses resolution.Repro sketch (host E2E): propose → optimistic-apply → type inside the pending range →
rejectById→ buffer keeps the edited proposed text; command reports success.Fix directions to evaluate:
Found during: plan
2026-07-01-native-surfaces-migration.mdTask 9; the full-loop E2E deliberately rejects only an un-tweaked proposal because of this gap.