chore(wolf): sync anatomy/cerebrum/memory/hooks/token-ledger bookkeeping

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AgYRU3zDTqNGV5Jk8aiKLg
This commit is contained in:
Rongsong Shen 2026-08-25 16:11:54 +00:00
parent ac46bfa649
commit a16776bdbd
No known key found for this signature in database
GPG key ID: 5BCDAAE0123E9FE2
5 changed files with 3228 additions and 18 deletions

View file

@ -4113,3 +4113,18 @@
| 07:39 | Edited src/controller/persist.c | 4→5 lines | ~78 |
| 07:45 | Edited src/controller/persist.c | 5→4 lines | ~57 |
| 14:51 | xce-audit-invariants dim1 fix: checkpoint_task_fn (delaymgr thread) blocked on real persist_checkpoint() I/O -- no offload existed at all, unlike every sibling (snapshot-send/config-push/reconnect). Investigated apply_pump_lock lock-order risk first: ruled OUT vtask pool (persist_apply_pump_run holds the same lock and is ITSELF dispatched onto that pool via VTASK_LIVE_BLOCK -- would starve it), used the SLOW LANE instead (slowlane_submit), matching snapshot-send's already-proven-safe precedent (persist_checkpoint already runs there today via ha_snapshot_do_send). New flag g_persist_checkpoint_offload defaults ON (not flagged off like catchup/demotion -- verified no test-fixture-hang precedent applies, checkpoint's trigger is fire-and-forget). bug-1694 logged. RED (probe forced pre-fix inline path, GREEN test hung, kill -9'd, confirmed real detection) then GREEN (reverted, rebuilt) both verified via full synchronous `/xce-build controller asan build-asan --incremental` runs | src/controller/persist.c, src/include/persist.h, src/controller/testsuite/test_persist_checkpoint_offload.c (new), src/controller/testsuite/controller_test.c, src/controller/meson.build, .wolf/buglog.json | 1184 Tests 2 pre-existing Failures (bug-1561, unrelated) 0 Ignored, 0 NEW failures, 3/3 new tests PASS | ~145k |
| 07:56 | Session end: 199 writes across 44 files (persistence.md, SKILL.md, plugin.h, plugin.c, driver.c) | 89 reads | ~901908 tok |
| 08:06 | Session end: 199 writes across 44 files (persistence.md, SKILL.md, plugin.h, plugin.c, driver.c) | 90 reads | ~908195 tok |
| 08:15 | Edited src/controller/myapp.c | added 3 condition(s) | ~1610 |
| 08:15 | Edited src/controller/myapp.c | expanded (+13 lines) | ~310 |
| 08:15 | Edited src/controller/myapp.c | modified if() | ~208 |
| 08:15 | Edited src/controller/testsuite/test_ha_startup.c | expanded (+6 lines) | ~175 |
| 08:17 | Edited src/controller/testsuite/test_ha_startup.c | modified test_bug1695_stale_restored_term_does_not_skip_election() | ~2196 |
| 08:17 | Edited src/controller/testsuite/test_ha_startup.c | expanded (+11 lines) | ~222 |
| 08:20 | Edited src/controller/myapp.c | removed 116 lines | ~68 |
| 08:21 | Edited src/controller/myapp.c | expanded (+7 lines) | ~181 |
| 08:21 | Edited src/controller/startup_validation.c | expanded (+8 lines) | ~258 |
| 08:21 | Edited src/controller/startup_validation.c | added 3 condition(s) | ~1616 |
| 08:26 | Edited src/controller/startup_validation.c | CURRENT() → term() | ~86 |
| 16:05 | bug-1695 FIXED: myapp_run's "leader already known" bootstrap check now requires raft.term to advance past a term_at_boot snapshot (not merely >0) — extracted to myapp_leader_already_known() in startup_validation.c (links into controller_unit_test, myapp.c doesn't) so it's unit-testable; RED/GREEN with 7 new tests in test_ha_startup.c; full suite 1191 tests, 0 new failures (2 pre-existing bug-1561); live A/B 6-round --chaotic soak (fixed vs git-stashed baseline) proved the fix: baseline term frozen at 4 forever, 6/6 "NO new primary", ctrl-2/ctrl-3 show zero election activity ever; fixed run shows term progressing 1->2->3->4->7 and ctrl-2 winning a real logged CTRL_PRIMARY via PreVote — direct proof a new node can now take over. Residual, honestly-flagged finding: fixed run's chaotic verdict showed committed_job_loss=6 (baseline=0) but committed_divergence=0 in both; waldump-traced the one lost jobid to the cluster's very first cold-boot config-bootstrap window (pre-round-1), not present in ANY node's WAL — resembles already-documented bug-1487's apply-pump-lag false-positive class, newly exposed because this fix is the first thing that lets the chaotic driver's overlapping kills exercise genuine repeated elections at all. Updated buglog.json bug-1695 (fixed, occurrences=2), cerebrum.md (3 Key Learnings, 1 Do-Not-Repeat, 1 Decision Log entry) | src/controller/myapp.c, src/controller/startup_validation.c, src/controller/testsuite/test_ha_startup.c, .wolf/buglog.json | fixed+verified, 1 residual follow-up flagged | ~large |
| 09:05 | Edited src/controller/myapp.c | expanded (+8 lines) | ~256 |