pingqiuandClaude Opus 4.7 39cfe1ce84 docs(recovery): mirror Tier-1 §IV.2.1 / FS-1 / Gate G0 anchors
Annotation-only pass on the three Tier-1 completion-authority sites
in core/recovery, mirroring the architect's pass on the seaweedfs
weed/storage/blockvol + weed/server side. No logic change — every
predicate remains exactly as before; only doc comments added that
point future migrators at:

  sw-block/design/recover-semantics-adjustment-plan.md §1 (the migration plan)
  sw-block/design/learn/2026-05-01-recover-target-audit.md Tier 1 (the audit)
  v3-recovery-algorithm-consensus.md §IV.2.1 (the new PrimaryWalLegOk contract)
  consensus §I P8 (recover(a) vs recover(a,b) distinction)

Sites annotated:

  core/recovery/rebuild_session.go:192
    TryComplete predicate `walApplied < targetLSN` — historic
    recover(a,b) gate; migration target = baseDone ∧
    ReplicaWalWitness ∧ coordinator-explicit PrimaryWalLegOk OR
    barrier state machine phase.

  core/recovery/peer_ship_coordinator.go:273
    CanEmitSessionComplete `achievedLSN >= targetLSN` — historic
    recover(a,b) gate; migration target = PrimaryWalLegOk(P) under
    serializer lock + ReplicaWalWitness reporting at the
    BarrierHandshake cut.

  core/recovery/sender.go:480-484
    Run's CanEmitSessionComplete check + FailureContract on
    achieved<target — historic recover(a,b) Run-success predicate;
    migration target = baseDone (replica) ∧ PrimaryWalLegOk(P)
    (primary WalShipper) ∧ BarrierHandshake; FailureContract
    rebound to "lifecycle contract violation" rather than "did
    not reach Y".

Build + tests clean (recovery + transport). Tier-1 behavior edits
remain blocked on Gate G0 (T2 predicate name + witness channel
pinning) per recover-semantics-adjustment-plan.md §0.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 02:49:01 -07:00
Languages
Go 84.5%
Rust 7.9%
Shell 2.7%
templ 1.6%
Java 1%
Other 2%