Contracts

reconciliation-gate-contract.md

Contract: Reconciliation Gate Behavior

Executable contract for the four facets. Each row is a real-CLI scenario a red-first repro pins.

Squash strategy (verify_reachability=False) — content axis

#ScenarioBefore (bug)After (contract)Facet
S1Canceled WP deletes a pre-existing product file no approved lane re-authors; carrier-lane squashPASS (exit 0) — file silently removed from targetFAIL + CAS-revert; divergence names the unattributable deletion#5022
S2Approved lane's first-parent spine deletes path P; squash(deletion skipped) PASSPASS — P ∈ authored_deletions#5022
S3Deletion of a mission-bookkeeping path under anchored prefixesPASSPASS — bookkeeping, not content#5022
S4Add/modify path with no approved authorshipFAILFAIL (unchanged)#5013 (regression guard)

Merge / rebase strategy (verify_reachability=True) — excluded axis

#ScenarioBefore (bug)After (contract)Facet
M1Mixed write-scope lane (approved survivor + canceled sibling); survivor's first-parent commits landedFAIL (survivor commits marked reachable-excluded) + revert + exit 1PASS — survivor commits attributed as authored, not excluded#5018
M2Canceled code smuggled via a carrier merge's 2nd parent, reachable from targetFAILFAIL (unchanged — not on any approved first-parent spine)#5018 / #4977
M3Cherry-picked / re-lettered canceled copyFAIL (patch-id)FAIL (unchanged)#5018
M4Fully-canceled lane (no approved WP)FAIL if reachableFAIL (unchanged)#5018

Resume path

#ScenarioBefore (bug)After (contract)Facet
R1Squash merge interrupted AFTER target advanced + reconciliation PASSed, DURING coord teardown; merge --resumeFAIL (content axis re-run vs partial/post-teardown claim) → revertcompletes teardown, exit 0#5021 r1
R2Genuinely incomplete merge (target not advanced) on --resumefull gatefull gate (no tolerance leak)#5021 r1 (guard)

Squash bookkeeping-projection proof

#ScenarioBefore (bug)After (contract)Facet
P1Clean single-approved-lane squash; a coord-partition bookkeeping path the target legitimately does not carryREFUSE ("projected coordination bookkeeping content did not land"); --resume dead-ends on TARGET_BRANCH_CONTENT_CONFLICTDeferred → #5038 — ships as xfail(strict=True), NOT green-washed. The clean-single-lane trigger did not reproduce (WP02 T009); the only reproducer is the 3-way coord-partition divergence, which converges with X1. FR-007 recorded Deferred → #5038.#5038
P2Approved content path genuinely failed to land on targetREFUSEREFUSE (unchanged — divergence detection preserved)#5038 (guard)

Out of scope — kept honest

#ScenarioStatusFacet
X13-way merge-resolution: target blob equals neither parentremains xfail(strict=True) — documented tracked follow-up, NOT green-washed#5021 r2

Universal invariants (all rows)

  • The gate never weakens toward a false-PASS to unblock a false-FAIL (C-001).
  • Every fix pairs a "legitimate case now PASSes" test with an "unsafe case still FAILs/REFUSEs" adversarial test.
  • Every repro drives the REAL spec-kitty merge CLI (no _run_git/subprocess mocking) and is issue-pinned + RED-first.