myxce/.kiro/specs
Rongsong Shen d3da3ca8bd fix(raft-apply-decoupling): prevent apply-divergence fence from being live-cleared (task 5.3)
Add explicit test coverage for the DIVERGENT fence's stay-alive and
restart-only-clear guarantees (task 5.3), which surfaced a critical,
pre-existing safety gap: the sticky recovery_unrecoverable flag is
trigger-agnostic, and two pre-existing live call sites in ha.c
(promotion_fence_timeout_fn's periodic timer, and
raft_cb_become_leader's promotion-eligibility gate) clear it based
purely on structural conditions, never checking the apply verdict.

A node whose local apply dispatch diverges from the committed log,
but whose WAL bytes are otherwise structurally healthy, would have
its fence silently released by the live timer, then be eligible for
promotion to primary on a later election -- serving genuinely
divergent state.

Fix: gate both clear-call-sites on persist_apply_verdict(&c->persist)
!= APPLY_DIVERGENT in addition to their existing structural checks.
An apply-divergence-triggered fence can now only clear via a fresh
process restart's clean persist_recover() replay.

New tests: test_promotion_fence_apply_divergent_survives_structural_catchup
(test_commit_durability.c) covers the timer site; and
test_promotion_refused_when_apply_divergent_even_if_eligible
(test_convergence_verification.c) covers the promotion-gate site,
structurally isolated so it cannot pass for the wrong reason.

Closes out task-group 5 (restart apply-correctness verification).
2026-07-04 13:33:03 +00:00
..
config-upgrade-snapshot docs(specs): gap re-validation 2026-06-24 (5 HA/raft specs) 2026-06-24 10:04:06 +00:00
controller-status docs: close ha-commit-durability Phase 6 (bug-795) + live-validate 4 specs 2026-07-03 02:41:28 +00:00
election-iomgr-refactor checkpoint: bug-851 root cause + raft TLA+ conformance spec family 2026-06-21 14:02:15 +00:00
ha-commit-barrier-rollout checkpoint: bug-851 root cause + raft TLA+ conformance spec family 2026-06-21 14:02:15 +00:00
ha-commit-durability docs: close ha-commit-durability Phase 6 (bug-795) + live-validate 4 specs 2026-07-03 02:41:28 +00:00
ha-commit-engine checkpoint: bug-851 root cause + raft TLA+ conformance spec family 2026-06-21 14:02:15 +00:00
ha-config-bootstrap checkpoint: bug-851 root cause + raft TLA+ conformance spec family 2026-06-21 14:02:15 +00:00
ha-consistency-invariants docs: close ha-consistency-invariants umbrella spec 2026-07-03 03:23:53 +00:00
ha-convergence-recovery docs: close ha-consistency-invariants umbrella spec 2026-07-03 03:23:53 +00:00
ha-elect-ctx-lifecycle checkpoint: bug-851 root cause + raft TLA+ conformance spec family 2026-06-21 14:02:15 +00:00
ha-entity-snapshots fix(raft-ha-core-safety): close 5.10a — WAL segment rotation + endpoint UAF blocking real snapshot catch-up 2026-07-02 04:11:20 +00:00
ha-heartbeat-committed-propagation docs: close ha-commit-durability Phase 6 (bug-795) + live-validate 4 specs 2026-07-03 02:41:28 +00:00
ha-heartbeat-liveness checkpoint: bug-851 root cause + raft TLA+ conformance spec family 2026-06-21 14:02:15 +00:00
ha-peer-connection-reuse checkpoint: bug-851 root cause + raft TLA+ conformance spec family 2026-06-21 14:02:15 +00:00
ha-prevote checkpoint: bug-851 root cause + raft TLA+ conformance spec family 2026-06-21 14:02:15 +00:00
ha-repl-hardening docs(specs): gap re-validation 2026-06-24 (5 HA/raft specs) 2026-06-24 10:04:06 +00:00
ha-single-leader-role docs: close ha-consistency-invariants umbrella spec 2026-07-03 03:23:53 +00:00
ha-term-safety chore(ha-term-safety): mark tasks 5.2/5.4/5.5 complete — live verification done 2026-06-29 08:19:14 +00:00
ha-wal-replication docs: close ha-commit-durability Phase 6 (bug-795) + live-validate 4 specs 2026-07-03 02:41:28 +00:00
job-array-single-wal-record docs: promote raft-apply-decoupling spec family from /kiro-discovery 2026-07-03 02:41:11 +00:00
libxce-failover docs: close ha-commit-durability Phase 6 (bug-795) + live-validate 4 specs 2026-07-03 02:41:28 +00:00
raft-apply-decoupling fix(raft-apply-decoupling): prevent apply-divergence fence from being live-cleared (task 5.3) 2026-07-04 13:33:03 +00:00
raft-commit-safety docs: promote raft-apply-decoupling spec family from /kiro-discovery 2026-07-03 02:41:11 +00:00
raft-drive-async docs: promote raft-apply-decoupling spec family from /kiro-discovery 2026-07-03 02:41:11 +00:00
raft-ha-core-safety fix(raft-ha-core-safety): close 5.10a — WAL segment rotation + endpoint UAF blocking real snapshot catch-up 2026-07-02 04:11:20 +00:00
raft-library checkpoint: bug-851 root cause + raft TLA+ conformance spec family 2026-06-21 14:02:15 +00:00
raft-log-replication docs: promote raft-apply-decoupling spec family from /kiro-discovery 2026-07-03 02:41:11 +00:00
raft-sim-conformance feat(raft-sim-conformance): optional TLC-consumable trace export, default-off (task 8.1) 2026-06-24 16:49:36 +00:00
resval-id-decoupling checkpoint: bug-851 root cause + raft TLA+ conformance spec family 2026-06-21 14:02:15 +00:00
scheduler-controller-msg-gap checkpoint: bug-851 root cause + raft TLA+ conformance spec family 2026-06-21 14:02:15 +00:00
worker-join-refactor checkpoint: bug-851 root cause + raft TLA+ conformance spec family 2026-06-21 14:02:15 +00:00
xce-test-e2e-primitives checkpoint: bug-851 root cause + raft TLA+ conformance spec family 2026-06-21 14:02:15 +00:00
.gitignore chore: baseline snapshot — prior-session work + ha-consistency-invariants spec family 2026-06-11 13:21:50 +00:00