Commit Graph
2 Commits
Author SHA1 Message Date
wzcheng99andClaude Opus 4.7 a837a67ec6 P14 S6: convergence institution (bounded wait + stuck evidence)
Turns controller desired assignments into a bounded-fate closure:
confirmed, retried (passively), superseded, or surfaced as stuck
evidence — without minting new authority.

- DesiredAssignment: +ProposedBasis/DesiredAt/LastRetryAt/Stuck.
- TopologyControllerConfig: +RetryWindow (default 5s).
- convergence.go: ConvergenceStuckEvidence (distinct map from
  UnsupportedEvidence), supersedeDesiredLocked (case 1 only:
  publisher epoch > ProposedBasis AND different target — case 2
  dropped because it misclassified every in-flight Reassign),
  evaluateStuckLocked (passive; does NOT re-emit).
- controller.go: unified processSupportedVolumeLocked; confirm
  routes through clearDesiredLocked so late post-Stuck
  confirmations drop stuck evidence; supported-recovery clears
  prior UnsupportedEvidence.

L0 (convergence_test.go): 15 targeted proofs — confirmation
(both-sources, stale-observation guard), stuck (after window,
no Reassign churn, clears on late confirm), supersede
(publisher moved elsewhere, normal-lag is NOT supersede,
decision-table differs), pending/unsupported clearing,
per-volume isolation, supported-recovery evidence cleanup.

L1 (convergence_route_test.go): 3 component-route proofs through
ObservationHost -> TopologyController -> Publisher ->
VolumeBridge -> Consumer: observation-fed failover confirms,
publish-but-not-observed reaches Stuck with no duplicate
bridge delivery, supersede drops stale desired.

No engine/adapter/transport changes. S2 non-forgeability and
S5 store-write guards still pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 21:33:42 -07:00
wzcheng99andClaude Opus 4.7 60c5ff5db4 P14 S4: observation institution + multi-volume topology controller
Lands two related pieces that make late-Phase-14 observation-to-
authority truth system-owned:

1. Multi-volume TopologyController (accepted P14 topology set:
   per-volume three-slot on distinct servers). This was the
   "consumer baseline" staged earlier as full-topology
   scaffolding and is committed here as the foundation S4 feeds.

2. Observation institution: heartbeat / inventory -> stable
   ClusterSnapshot producer, per the S4 assignment
   (sw-block/design/v3-phase-14-s4-assignment.md and
   v3-phase-14-s4-sketch.md).

Load-bearing boundary held across both pieces:

  * observation institution may withhold supportability, but it
    may NOT mint authority (sketch §3)
  * Publisher stays the sole minter of Epoch/EndpointVersion
  * adapter.OnAssignment stays the one and only consumer ingress
  * no new engine event, command, or projection field

Observation-side deliverables (core/authority/):

  * observation_types.go — Observation, ServerFact, SlotFact,
    LocalRoleClaim, FreshnessConfig, Supportability enum
    (pending / supported / unsupported kept VISIBLY distinct per
    architect execution note), AcceptedTopology, six reason
    constants.
  * observation_store.go — push-ingest latest-wins per ServerID,
    derived ServerFreshness (never-observed / bootstrapping /
    missing / fresh / expired), immutable storeSnapshot for
    builder input, configurable GC.
  * observation_wire.go — V2 heartbeat wire shape port
    (block_heartbeat / block_heartbeat_proto /
    block_heartbeat_loop analogues) as mechanism only.
    HeartbeatToObservation is a pure field-shape copy.
  * unsupported_evidence.go — per-volume VolumeUnsupportedEvidence
    (latest-wins per VolumeID), separate VolumePendingStatus,
    SupportabilityReport with Pending + Unsupported as distinct
    maps, BuildResult.
  * snapshot_builder.go — pure BuildSnapshot(store, topology,
    reader) -> BuildResult. Reads publisher's current per-volume
    line via the read-only AuthorityBasisReader and stamps it in
    VolumeTopologySnapshot.Authority for supported volumes, so
    the controller's stale-resistance check can match on
    subsequent feeds. Observation never mints authority.
  * observation_host.go — owns store lifecycle, push-ingest
    entry points, reactive rebuild (build-on-change + coalescing
    wake), GC sweep honoring configured retain window,
    ControllerSink atomic submission (snapshot + report
    together so supportability transitions propagate even when
    supported volumes drop to zero).

Controller-side intake (core/authority/controller.go):

  * SubmitClusterSnapshot kept as the test-scaffolding entry.
  * NEW SubmitObservedState(snap, report) — the observation-fed
    intake. Mirrors SubmitClusterSnapshot's convergence
    discipline line-for-line (stale-basis preserves desired,
    no-emit clears desired, same-ask dedupe prevents authority
    churn) and adds pending/unsupported transition handling.
    Under this intake, the controller hears every supportability
    transition, including "zero supported volumes now", which
    clears stale desired state.

V2 muscles ported (mechanism only):

  * block_heartbeat / block_heartbeat_proto field layout
    (observation_wire.go)
  * block_heartbeat_loop shape concept (host owns the loop)

Explicitly NOT ported (per assignment denylist):

  * weed/storage/blockvol/promotion.go
  * old HandleAssignment / promote / demote ownership
  * master_block_plan / master_block_failover / master_block_registry /
    master_block_assignment_queue (reference only for S5/S6)
  * any V2 path where heartbeat timing or local status becomes
    failover truth

Proof matrix (observation_test.go — 35 tests covering all sketch
§16 rows + architect-round regressions):

  Authoring:
    - PartialInventory_PendingThenUnsupported
    - MissingServerObservation_NeverOrdinaryIneligible
    - EndToEnd_SystemFedSnapshotReachesController
    - ConflictingPrimaryClaim_Unsupported
    - ConflictingPrimaryClaim_NoWinnerEverChosen
    - ExpiredFact_SemanticallyIneligible
    - ExpiredDoesNotReachController
    - BadVolumeDoesNotBlockHealthyVolume_Isolation
    - VolumeUnsupportedEvidence_IsolatedPerVolume
    - DuplicateServerTopology_UnsupportedAndEvidenceRecorded
    - DuplicateServerTopology_NotControllerInput

  Host-level:
    - IngestMutation_TriggersSnapshotRebuild
    - FreshnessWindowHonored_NotTickMultiples
    - GCRetainWindow_Honored

  Boundary (AST-based, sketch §16a):
    - NeverMintsAuthority_BoundaryGuard
    - SupportabilityDoesNotReadClusterSnapshotOutput

  Architect round-2 regressions:
    - BuilderStampsAuthorityFromReader
    - SupportabilityCollapsePropagatesToController
    - SupportabilityCollapseClearsControllerDesired
    - UnknownObservedVolume_ProducesUnsupportedEvidence

  Architect round-3 regressions:
    - IdenticalSupportedSnapshots_NoDuplicateAsks
    - VolumeRecovers_ClearsStaleDesired

No changes to engine, adapter, transport, ops, storage, or
sparrow. 91 authority tests pass. Full module: 12 packages pass.

Design docs in sw-block/design/ external repo:
  * v3-phase-14-s4-assignment.md
  * v3-phase-14-s4-observation-institution.md
  * v3-phase-14-s4-sketch.md
  * v3-phase-14-s4-closure-gaps.md (architect-round boundary notes)
  * v3-phase-14-full-topology-design.md
  * v3-phase-14-placement-rebalance-policy.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 16:36:17 -07:00