docs(specs): gap-analysis validation pass across all 9 HA-family specs

Appended "Gap Analysis — Validation Pass (2026-06-09)" to each spec's
research.md with requirement-to-asset maps, status tags, and effort/risk.

Key outcomes:
- ha-repl-hardening: REOPENED with task series 7.1-7.7 — replication
  payload data plane is missing (snapshot chunks and WAL catch-up ship
  header-only; standbys converge on LSN without holding entity state)
- worker-join-refactor, resval-id-decoupling: marked implemented
  (all criteria re-verified, full test suite green)
- buglog: 335/336 (scheduler dequeue, open), 337/338/339 (fixed in
  previous commit); cerebrum Decision Log corrected (term-only vote
  deny was recorded as intentional but was a regression)
This commit is contained in:
Rongsong Shen 2026-06-10 01:26:08 +00:00
parent 9821ec4f3c
commit cdd446fc17
21 changed files with 3955 additions and 288 deletions

View file

@ -2,7 +2,9 @@
> Chronological action log. Hooks and AI append to this file automatically.
> Old sessions are consolidated by the daemon weekly.
| 09:45 | Fixed election liveness: (1) raft.c step-4 deny is now term-only (same-candidate idempotent re-grant preserved); (2) ha.c vote gate also term-only; (3) myapp.c skip-election guard adds voted_for_name!="self" + voted_for_term==term; (4) watchdog armed after skip_election | raft.c, ha.c, myapp.c | FIXED | ~200 |
| 09:12 | Task 6.6 residual fix: removed double-free in ha_disarm_heartbeat_timeout_vtask (line 3424 free(ctx) removed); deferred free now handled solely by liveness_poll_fn; build+tests GREEN | ha.c | FIXED | ~80 |
| 09:45 | Fix test_proto_B5_idempotent_same_candidate: modified raft_on_vote_request Step 4 to allow idempotent re-grant when same candidate re-requests vote in same term; different candidate still denied; all tests GREEN | lib/raft/raft.c | FIXED | ~60 |
| 21:20 | Updated cluster-config-split-analysis.md: added decisions to drop port fallback and remove candidates from ClusterConfig; detailed per-file impact table; revised implementation phases (Phase 1 = immediate removal, Phases 2-5 = split/migration) | src/docs/cluster-config-split-analysis.md | DONE | ~120 |
| 07:46 | Task 6.6 (ha-repl-hardening): integration test for snapshot transfer on lagging standby; found and fixed 2 ASAN bugs: double-free in ha_connect_to_peer (bug-006) and heap-UAF in liveness_poll_fn on ctx re-arm (bug-007); confirmed snapshot trigger path (oldest_wal_lsn=1 > applied_lsn=0 → requesting snapshot transfer, checkpoint_lsn=0, size=16) fires correctly after standby kill+restart; all 3 nodes stable, no ASAN errors; standby-side apply blocked by known capnp payload deferral limitation | ha.c | GREEN (trigger confirmed, apply deferred by design) | ~800 |
| 06:30 | Task 6.4 (ha-repl-hardening): audited snapshot chunk transfer tests; tests 2+3 already covered (reconnect discards snap.part, lsn<oldest_wal triggers snapshot); added test_snapshot_recv_128kb_two_chunks (131072-byte receive path, 2×65536 chunks, verifies total_size/rename/applied_lsn=checkpoint_lsn); registered in dispatch; 1/1 controller test OK ASAN | test_config_repl.c | GREEN | ~400 |
@ -695,3 +697,88 @@
| 01:35 | Edited src/docs/cluster-config-split-analysis.md | added 1 condition(s) | ~577 |
| 01:36 | Edited src/docs/cluster-config-split-analysis.md | 6→7 lines | ~154 |
| 01:36 | Session end: 4 writes across 1 files (cluster-config-split-analysis.md) | 8 reads | ~61375 tok |
## Session: 2026-06-09 01:59
| Time | Action | File(s) | Outcome | ~Tokens |
|------|--------|---------|---------|--------|
## Session: 2026-06-09 02:09
| Time | Action | File(s) | Outcome | ~Tokens |
|------|--------|---------|---------|--------|
| 02:27 | Edited src/lib/raft/raft.c | modified if() | ~129 |
| 02:27 | Edited src/controller/ha.c | strcmp() → deny() | ~60 |
| 02:28 | Edited src/controller/myapp.c | modified if() | ~497 |
| 02:28 | Edited src/controller/myapp.c | modified if() | ~281 |
| 02:41 | Edited src/lib/raft/raft.c | voted() → grant() | ~210 |
| 02:46 | Session end: 5 writes across 3 files (raft.c, ha.c, myapp.c) | 5 reads | ~72268 tok |
| 03:17 | Edited src/controller/ha.c | added 3 condition(s) | ~497 |
| 03:22 | Edited src/controller/ha.h | expanded (+15 lines) | ~199 |
| 03:22 | Edited src/controller/ha.c | added 2 condition(s) | ~530 |
| 03:23 | Edited src/controller/ha.c | removed 41 lines | ~43 |
| 03:23 | Edited src/controller/ha.c | removed 33 lines | ~2 |
| 03:23 | Edited src/controller/myapp.c | 5→10 lines | ~121 |
| 03:26 | Session end: 11 writes across 4 files (raft.c, ha.c, myapp.c, ha.h) | 8 reads | ~84261 tok |
| 04:02 | Session end: 11 writes across 4 files (raft.c, ha.c, myapp.c, ha.h) | 9 reads | ~84766 tok |
| 05:56 | Edited src/controller/ha.c | 2→3 lines | ~47 |
| 06:00 | Session end: 12 writes across 4 files (raft.c, ha.c, myapp.c, ha.h) | 10 reads | ~84423 tok |
| 06:02 | Session end: 12 writes across 4 files (raft.c, ha.c, myapp.c, ha.h) | 10 reads | ~84423 tok |
| 06:06 | Edited src/lib/raft/raft.c | modified if() | ~178 |
| 06:10 | Session end: 13 writes across 4 files (raft.c, ha.c, myapp.c, ha.h) | 11 reads | ~84614 tok |
## Session: 2026-06-09 16:49
| Time | Action | File(s) | Outcome | ~Tokens |
|------|--------|---------|---------|--------|
## Session: 2026-06-09 16:51
| Time | Action | File(s) | Outcome | ~Tokens |
|------|--------|---------|---------|--------|
## Session: 2026-06-09 16:52
| Time | Action | File(s) | Outcome | ~Tokens |
|------|--------|---------|---------|--------|
| 14:xx | Validation-pass gap analysis appended for worker-join-refactor | .kiro/specs/worker-join-refactor/research.md | implemented, only 5.4 test-run unverified | ~9k |
| 16:59 | Edited .kiro/specs/resval-id-decoupling/research.md | modified and() | ~2232 |
| 00:02 | Validation-pass gap analysis appended for scheduler-controller-msg-gap (found G-1 resvals idx-0 bug, G-2 resource EEXIST, leaks, test debt) | .kiro/specs/scheduler-controller-msg-gap/research.md | partial, not 100% | ~12k |
| 00:02 | Gap analysis validation pass for ha-heartbeat-liveness; found dead last_heartbeat field feeding vote gate | .kiro/specs/ha-heartbeat-liveness/research.md, .wolf/buglog.json | appended analysis + bug entry | ~25k |
| 00:03 | Gap analysis validation pass for ha-config-bootstrap spec (50 ACs verified against on-disk code) | .kiro/specs/ha-config-bootstrap/research.md | appended analysis: ~40/50 implemented, 7 partial, 3 pivoted | ~45k |
| 16:55 | Gap analysis validation pass for ha-peer-connection-reuse (18/19 reqs Implemented, 5.5 Partial: ASAN leaks); ran controller_unit_test (769 PASS/0 FAIL) | .kiro/specs/ha-peer-connection-reuse/research.md | appended analysis | ~30k |
| 00:13 | gap-analysis validation pass: election-iomgr-refactor — found 2 failing unit tests from uncommitted ha.c vote changes | .kiro/specs/election-iomgr-refactor/research.md | appended analysis + buglog entry | ~30k |
| 00:13 | Ran /kiro-validate-gap across all 9 specs via 9 parallel agents; appended Gap Analysis Validation Pass to each research.md | .kiro/specs/*/research.md | found 1 critical (repl data plane), 4 bugs logged (335-338) | ~1130k |
| 17:14 | Created ../../../../../claude/.claude/projects/-home-rshen-projects-xce-xce/memory/project_ha_bootstrap_progress.md | — | ~576 |
| 17:14 | Edited ../../../../../claude/.claude/projects/-home-rshen-projects-xce-xce/memory/MEMORY.md | inline fix | ~54 |
| 17:15 | Session end: 3 writes across 3 files (research.md, project_ha_bootstrap_progress.md, MEMORY.md) | 50 reads | ~194368 tok |
## Session: 2026-06-10 17:19
| Time | Action | File(s) | Outcome | ~Tokens |
|------|--------|---------|---------|--------|
## Session: 2026-06-10 17:19
| Time | Action | File(s) | Outcome | ~Tokens |
|------|--------|---------|---------|--------|
## Session: 2026-06-10 17:20
| Time | Action | File(s) | Outcome | ~Tokens |
|------|--------|---------|---------|--------|
| 17:22 | Edited src/lib/testsuite/test_raft.c | 7→10 lines | ~106 |
| 17:22 | Edited src/lib/testsuite/test_raft.c | modified test_proto_H6_restored_vote_blocks_second_vote() | ~488 |
| 17:22 | Edited src/lib/testsuite/test_raft.c | 1→2 lines | ~34 |
| 17:23 | Edited src/lib/raft/raft.c | 4→8 lines | ~135 |
| 17:23 | Edited src/controller/ha.c | added 1 condition(s) | ~243 |
| 17:23 | Edited src/controller/ha.c | 5→8 lines | ~113 |
| 17:23 | Edited src/controller/ha.h | 4→4 lines | ~79 |
| 17:23 | Edited src/controller/ha.h | inline fix | ~26 |
| 17:24 | Edited src/controller/testsuite/test_ha_vote_gate.c | set_last_heartbeat_age() → set_last_activity_age() | ~114 |
| 17:24 | Edited src/controller/testsuite/test_ha_vote_gate.c | 2→7 lines | ~102 |
| 17:24 | Edited src/controller/testsuite/test_ha_vote_gate.c | set_last_heartbeat_age() → set_last_activity_age() | ~59 |
| 17:24 | Edited src/controller/myapp.c | 13→17 lines | ~241 |
| 17:45 | Fixed bug-337 (freshness→last_activity), bug-338 (same-candidate re-grant + myapp self check), bug-339 (raft_init voted_for_term restore); full build+tests green; reopened ha-repl-hardening tasks 7.1-7.7; marked worker-join-refactor + resval-id-decoupling implemented | ha.c ha.h myapp.c raft.c test_raft.c test_ha_vote_gate.c tasks.md spec.json | all tests pass, 0 FAIL | ~80k |
| 17:32 | Edited ../../../../../claude/.claude/projects/-home-rshen-projects-xce-xce/memory/project_ha_bootstrap_progress.md | 3→3 lines | ~138 |
| 17:32 | Session end: 13 writes across 7 files (test_raft.c, raft.c, ha.c, ha.h, test_ha_vote_gate.c) | 2 reads | ~37627 tok |