Preserve reviewed document edits when reconciliation inputs change

Merged
BI
8d ago
+188-28

After an agent edits a merge candidate and acknowledges it with --resolved, a later source or draft change could silently omit those reviewed edits from the exported proposal. Reconciliation now retains hash-checked input snapshots and carries the existing candidate forward. Source reverts remain meaningful; when both inputs move, export requires explicit review of the retained versions. Older workspaces without usable snapshots fail closed.

The guide documents recovery and the updated helper hash. All 25 focused tests pass locally, including regressions that failed on the old helper for lost reviewed edits, overlapping changes, source reverts, ambiguous two-input changes, altered snapshots and review-state persistence. Independent source review found no concrete scoped defect. Originals remain read-only; application code, data access and integration authority are unchanged. Hosted CI remains pending until observed.


Summary by cubic

Fixes reviewed document edits being silently dropped from exported proposals when a source or draft changes after an agent acknowledges a candidate with --resolved.

Reconciliation now records hash-checked snapshots of both inputs and rebases the acknowledged candidate through later changes. A source revert alone behaves as before and needs no new review; when both source and draft move, export requires explicit review of the retained candidate even without conflict markers. Older workspaces lacking usable snapshots fail closed on export.

  • Adds source and draft input snapshots to reconciliation records and verifies them before rebasing.
  • Blocks export when both inputs changed without explicit --resolved review.
  • Updates docs/agents/document-drafts.md with recovery steps and the new helper hash.
  • Adds regression tests for lost reviewed edits, source reverts, overlapping changes, two-input changes, altered snapshots, and review-state persistence.