myxce/.kiro/specs/controller-status
Rongsong Shen 808396618c
fix(controller-status): gate electedTerm/electedAt on elected_at_ms, not primaryName
Live 3-node E2E validation (task 7.6) found that cmd_ctrlstatus's
electedTerm/electedAt lines (task 7.5) gated on NULLSTR(primaryName),
which is unconditionally empty on every non-primary responder in this
build (ctrlstatus_fill only self-reports the primary's own name --
ha->primary_host is vestigial, a pre-existing Req 2 behavior). This made
electedTerm/electedAt print "unknown" on every standby, forever, even
though elected_at_ms was correctly, non-zero, and convergently populated
the whole time (term/committedLsn/appliedLsn, sourced the same
unconditional way, DID correctly display and converge on the same query).

Fix: gate on status->elected_at_ms == 0 instead -- the field stays
exactly 0 until a real promotion stamps it (either road) or a heartbeat
carries a learned value from an actual primary, unlike term (which can
legitimately bump from mere vote/candidacy activity before any primary
is elected). ctrlstatus_fill itself is untouched; this is purely a
cmd_ctrlstatus display-layer correction.

Also corrects design.md's "Design Delta -- Requirement 12" Locked
Decision 3 (and its dependent traceability/service-contract text) to
document this live-E2E finding, mirroring the spec's existing delta
convention (Req 10/11's own live-E2E correction).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RLSNJhNoULvVcUhXEFafQC
2026-09-16 08:56:55 +00:00
..
design.md fix(controller-status): gate electedTerm/electedAt on elected_at_ms, not primaryName 2026-09-16 08:56:55 +00:00
requirements.md docs(controller-status): add Requirement 12 delta (primary election term/time) 2026-09-16 03:47:45 +00:00
research.md docs(controller-status): add Requirement 12 delta (primary election term/time) 2026-09-16 03:47:45 +00:00
spec.json docs(controller-status): add Requirement 12 delta (primary election term/time) 2026-09-16 03:47:45 +00:00
tasks.md feat(controller-status): render election term/time in ctrlstatus CLI (task 7.5) 2026-09-16 07:54:04 +00:00