pingqiuandClaude Opus 4.7 40da4c8738 feat(recovery): A-class wave — Tier-1 predicate replacement (§IV.2.1)
Replaces the recover(a,b) sole completion gate (`walApplied >=
TargetLSN`) at both Tier-1 sites with the §IV.2.1 realizable conjunct
synthesized from existing observables (ProbeBarrierEligibility witness
+ baseDone + barrier round-trip). Per recover-semantics-adjustment-plan
§1, "session semantically complete" claim moves from replica-side
verdict to coordinator-owned authority on the primary.

Tier-1 sites updated:

  RebuildSession.TryComplete (replica, layer-1):
    baseDone ∧ walApplied >= targetLSN ∧ barrierWitnessed
  PeerShipCoordinator.CanEmitSessionComplete (primary, system close):
    phase != Idle ∧ baseDone ∧ achieved >= targetLSN
                  ∧ (walLegOkWitnessed → walLegOkAtBarrier)

Mechanics:

  - Receiver latches RebuildSession.WitnessBarrier() on frameBarrierReq
    arrival, BEFORE TryComplete. BarrierReq arrival = primary attests
    PrimaryWalLegOk under shipMu (§IV.2.1 disjunction).
  - Sender records PrimaryWalLegOk witness via
    Coordinator.RecordBarrierWalLegOk(walLegOk) immediately after the
    ProbeBarrierEligibility snapshot, BEFORE writing frameBarrierReq.
  - Bridging-sink path (no probe) leaves walLegOkWitnessed=false; the
    conjunct collapses to legacy (back-compat preserved while §IV.2.1
    probe wiring is dual-lane-only). Test coverage in
    TestRecoverA_BridgingSinkPath_LegacyCollapse pins this.

A-class conformance stubs unskipped (recover_a_conformance_test.go):

  A1 TestRecoverA_DebtZeroPath_BarrierEligible       SKIP→GREEN
  A2 TestRecoverA_LiveTailPath_BarrierEligible…      SKIP→GREEN
  A3 TestRecoverA_Disjunction_EitherPathSuffices     SKIP→GREEN
  A4 TestRecoverA_NeitherPath_NotEligible            SKIP→GREEN
   + TestRecoverA_BridgingSinkPath_LegacyCollapse    GREEN (new)

A4 binding: walLegOk=false witness → CanEmit refuses → sender returns
FailureContract on close. Wire-level emission gating (§IV.2.2 stronger
"MUST NOT be emitted") is the B-class barrierEmitFreeze wave — out of
scope. A-class pins the binding at the close gate.

C-class still SKIP (CheckpointCutSeq on wire, achieved-as-cut-witness).
Y kept as comparator pre-C-class (`achieved >= targetLSN` retained;
"Y as enumerator only" defers to C-class wave).

Whole-tree go test ./... -count=1 green.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 16:49:14 -07:00
Languages
Go 84.7%
Rust 7.7%
Shell 2.7%
templ 1.5%
Java 1%
Other 2.1%