pingqiuandClaude Opus 5.5 774dee5403 volume, master: bind watchdog readiness to the watched epoch, G1 first; derive health events from the accepted ingest
codex01's AMEND on #134 (three P2s; the disarm policy is unchanged):

1. Only a ready fact for the watched primary epoch clears or disarms
   the watchdog. The full promotion fact is passed and its epoch is
   compared with the watched epoch under the watchdog lock, so an
   engine still ready at an older epoch (its new assignment refused at
   admission) cannot disarm the new assignment, and an assignment that
   advances while the fact is read is not cleared by it.
2. The G1 role-admission latch of a primary-assigned replica is checked
   before readiness: it reports role_admission_failed for as long as it
   holds, whatever an older engine-ready fact says.
3. Health events come from the accepted store mutation itself:
   ObservationStore.IngestWithHealthTransitions returns, under the
   store lock, each slot whose unhealthy reason the accepted report
   changed against the same server's previously stored fact. A refused
   report yields none and expiry never fabricates a clear. The master
   ingests and records those events under healthMu, so events follow
   accepted order across concurrent heartbeats.

Lock order: healthMu -> store.mu (released inside ingest) -> event
ring; nothing else takes healthMu, and neither the store nor the ring
calls back into the host. The watchdog keeps its own mutex and calls
nothing while holding it.

Refs #128

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 13:39:10 -08:00
Languages
Go 84.6%
Rust 7.8%
Shell 2.7%
templ 1.6%
Java 1%
Other 2%