F4: propose/accept diff flow — pending proposals, ✓/✗ review, seam-applied acceptance (Feature #12) #13

Merged
benstull merged 9 commits from feat/f4-propose-accept into main 2026-06-11 05:16:31 +00:00
Owner

Implements Feature #12 per the graduated Solution Design vscode-cowriting-plugin-content/specs/coauthoring-propose-accept.md (session 0012; plan archived at finalize).

What

  • Propose-by-default (INV-10): the edit-selection live turn now ends in a pending proposal — amber range tint + a cowriting.proposals comment thread with a fenced diff and ✓ Accept / ✗ Reject actions. The document never changes without the human's say-so.
  • Accept = fingerprint-guarded seam apply (INV-11/INV-9): accept re-resolves the anchor (exact text match) and applies via the unchanged applyAgentEdit seam, so accepted text lands Claude-attributed with zero new attribution code; stale/orphaned proposals are flagged, never applied by guess.
  • Git-native pending state (INV-13): proposals[] (typed, on the shared anchors/Provenance primitives, schemaVersion stays 1) persists at propose time, survives reload, re-anchors; store prune now counts proposal anchors.
  • Seam fix (plan AMENDMENT 1): PendingEditRegistry.matchEvent replaces per-hunk exact matching — the host word-diffs one applied WorkspaceEdit into several minimal hunks, which the F4 accept E2E exposed (seam edits fell through as fragmented human spans).

Gate

typecheck · 75/75 vitest · both bundles · 16+3 host E2E (incl. the new F4 suite: propose/accept/reject/persist/re-anchor/stale/coexist, no LLM in CI) · scripted live smoke green (run_8xPNs1QJ, 34.6s). In-editor propose→accept click-through documented in docs/MANUAL-SMOKE-F4.md.

Closes #12

🤖 Generated with Claude Code

Implements Feature #12 per the graduated Solution Design `vscode-cowriting-plugin-content/specs/coauthoring-propose-accept.md` (session 0012; plan archived at finalize). ## What - **Propose-by-default (INV-10):** the edit-selection live turn now ends in a pending **proposal** — amber range tint + a `cowriting.proposals` comment thread with a fenced diff and ✓ Accept / ✗ Reject actions. The document never changes without the human's say-so. - **Accept = fingerprint-guarded seam apply (INV-11/INV-9):** accept re-resolves the anchor (exact text match) and applies via the unchanged `applyAgentEdit` seam, so accepted text lands Claude-attributed with zero new attribution code; stale/orphaned proposals are flagged, never applied by guess. - **Git-native pending state (INV-13):** `proposals[]` (typed, on the shared `anchors`/`Provenance` primitives, `schemaVersion` stays 1) persists at propose time, survives reload, re-anchors; store prune now counts proposal anchors. - **Seam fix (plan AMENDMENT 1):** `PendingEditRegistry.matchEvent` replaces per-hunk exact matching — the host word-diffs one applied WorkspaceEdit into several minimal hunks, which the F4 accept E2E exposed (seam edits fell through as fragmented human spans). ## Gate typecheck · 75/75 vitest · both bundles · 16+3 host E2E (incl. the new F4 suite: propose/accept/reject/persist/re-anchor/stale/coexist, no LLM in CI) · scripted live smoke green (`run_8xPNs1QJ`, 34.6s). In-editor propose→accept click-through documented in `docs/MANUAL-SMOKE-F4.md`. Closes #12 🤖 Generated with [Claude Code](https://claude.com/claude-code)
benstull added 9 commits 2026-06-11 05:16:08 +00:00
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The accept E2E exposed a latent F3 limitation: VS Code word-diffs one
applied WorkspaceEdit into several minimal hunks when old/new share
interior tokens, so the registry's per-hunk exact match missed and seam
edits fell through as fragmented human spans. PendingEditRegistry.match
is replaced by matchEvent (all hunks inside the registered full range +
equal net delta — one applyEdit is one change event). Plan AMENDMENT 1.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
benstull merged commit 0ef70a0226 into main 2026-06-11 05:16:31 +00:00
Sign in to join this conversation.