Files
solution-erp/.claude/governance/.session-counter.json

44 lines
6.7 KiB
JSON

{
"_note": "Harness-24 (S121, 2026-07-15, wave adap-6-broadcast W2) session counter for lead-self-audit cadence. THIS FILE HOLDS STATE ONLY - every cadence NUMBER lives in .claude/agent-memory/memory-budget.json -> h24_cadence (single-source, H24 section 2(3)). Never copy the digits here.",
"_why_content_based_not_blind_increment": "Owner-decisions-15-07-2026 Q2, trap found by lane E: the Stop-hook .claude/hooks/wal-flush.ps1 auto-commits on EVERY turn-boundary. A blind counter++ would therefore tick many times per real session and the cadence would be meaningless. So a tick is CONTENT-ADDRESSED: it is keyed on the repo HEAD sha at tick time. Ticking twice on the same HEAD is a NO-OP, which is what makes running /session-start twice in a row safe (acceptance: 2x /session-start on the same HEAD => +1, not +2).",
"_why_this_path": "Deliberately .claude/governance/ and NOT .claude/agent-memory/. The hook covers exactly 3 paths (.claude/WAL.md, agent-memory/, workflows/runs/); .claude/governance/ is OUTSIDE all three, so this file is never swept into a 'wal:' commit as a side effect. Compare .claude/agent-memory/.mfe-state.json, which IS inside the hook's reach - a counter must not live there.",
"_contract": {
"tick": "tick(session, head): if head == last_ticked_head OR session == last_ticked_session -> NO-OP (idempotent per HEAD AND per session-label). The Stop-hook wal-flush.ps1 moves HEAD mid-session (auto-commit every turn-boundary), so the head-clause alone would let a single real session tick more than once; the session-label clause pins ONE session-label to exactly +1, not +2. This closes the +2/cycle trap: a /pause commit changes HEAD, but the same session-label still NO-OPs. Else counter = counter + 1, last_ticked_session = session, last_ticked_head = head, last_ticked_at = date.",
"fail_loud_on_regress": "If an incoming counter is LOWER than the stored counter, or last_ticked_head names a commit not reachable from HEAD, DO NOT silently reset: report to owner. A counter that moves backwards means the state file was rolled back or hand-edited, and a silent reset would hide the cadence gap.",
"overdue": "OVERDUE(light) when (counter - last_audit.light_at_counter) >= h24_cadence.light_every. Same shape for deep_every. Skipping sessions does NOT lose the debt - the gap is measured from the counter, not from wall-clock, so a missed session surfaces as OVERDUE rather than vanishing.",
"jump": "jump_on_class_repeat (h24_cadence): if ONE flag class from lead_self_audit.flag_classes repeats N times, pull the next audit forward regardless of the counter.",
"writer": "Lead is single-writer. Wired at /session-start (W3 owns the ritual; W2 owns this file + its shape)."
},
"_seed_honesty": "Seeded UNTICKED on purpose. counter=0 and last_ticked_* = null mean 'no tick has ever happened', which is the truth at S121 - the ritual that performs the tick lands in W3. Seeding a fake first tick here would make the very first cadence reading a lie, and H24 exists to catch exactly that kind of invented number.",
"counter": 11,
"last_ticked_session": "S137",
"last_ticked_head": "467c28e0463c7a6baf155f0e6ba9217e29d9b5ee",
"last_ticked_at": "2026-07-17",
"last_audit": {
"light_at_counter": 11,
"deep_at_counter": 3,
"_note": "Counter value at which the last light/deep self-audit actually ran. S137 (2026-07-17): light-audit #2 at counter=11 (paid OVERDUE 8/6; owner consent at /tiep entry - first consent-gate exercise post-wire). 2-vai coverage, 0-garble. lead-view: 2 FLAG view-stale-status (STATUS roster H24 cell 'CHUA verified-runtime' vs source da chung S122/S124/S137; HANDOFF '2 de-xuat S131 CHO GAT' da actioned ca hai) - CA HAI FIXED cung phien + 2 INFORM. lead-omission: 1 FLAG MED gap-decision-sunk repeat-2 (dangling-head candidate-fix song 8-10 phien CHI trong history file nay, chua tung thanh carry named; resolve = closeout S137 tach [carry:dangling-head] hoac anh/hub chot dut) + 2 INFORM (cum 7-carry dong-tuoi S117/S118 de anh close-sweep; closeout re-stamp carry tu HANDOFF-S134 khong tu WAL line). Prior: S124 (2026-07-15) FIRST-EVER run of both vai at counter=3, credited BOTH light+deep. Next deep ~ counter 18."
},
"class_repeat": {
"_note": "Rolling tally per flag class from lead_self_audit.flag_classes (memory-budget.json). Key = class name, value = consecutive-audit repeat count. S124 first audit = SEED (fired-once), not repeats yet (per lead-view-auditor honest-note). jump_on_class_repeat=3.",
"counts": { "view-residual-asym": 0, "view-stale-count": 0, "gap-carry-dropped": 0, "gap-decision-sunk": 2, "view-stale-status": 1 }
},
"history": [
{
"at": "2026-07-16",
"session": "S127",
"event": "ancestor-check FAIL-LOUD (dung contract): last_ticked_head f9fa77d6 la dangling commit - object ton tai (cat-file -t = commit) nhung 0 nhanh chua no. Root-cause: closeout S126 SQUASH cac wal:-commit (session-end squash->count->push) nen head luc tick bi squash khoi lich su. KHONG phai tamper: counter khong lui, file khong sua tay. Xu ly: tick tiep 5->6 CO VET (entry nay) + bao anh trong turn S127. KE THIET KE ghi nhan: moi phien dau-sau-closeout-squash se fail ancestor-check gia; candidate fix = chap nhan dangling-object-exists lam bang-chung yeu khi counter khong lui (cho anh/hub quyet, chua doi contract)."
},
{
"at": "2026-07-17",
"session": "S133",
"event": "ancestor-check FAIL-LOUD lan 2 (cung class S127, dung contract): last_ticked_head 882e0d7 (tick @S131) la dangling commit - object ton tai (cat-file -t = commit) nhung khong reachable tu HEAD. Root-cause: closeout S131-S132 SQUASH wal:-commit (squash->count->push) nen head luc tick bi squash khoi lich su. KHONG phai tamper: counter khong lui (7), file khong sua tay. Xu ly: tick tiep 7->8 CO VET (entry nay) + bao anh trong turn S133. Candidate fix VAN treo cho anh/hub quyet (chua doi contract): chap nhan dangling-object-exists lam bang-chung yeu khi counter khong lui."
},
{
"at": "2026-07-17",
"session": "S137",
"event": "light-audit #2 RAN at counter=11 (OVERDUE 8/6 paid; consent-gate DP-3 exercised lan dau post-wire: probe in OVERDUE:light ngay cua /tiep -> anh gat -> cap H24 spawn nen). Verdicts 0-garble; evidence runs/2026-07-17-S137-h24-light-audit/. lead-view 2 FLAG view-stale-status (STATUS roster-cell H24 + HANDOFF de-xuat S131) - ca hai FIXED cung phien. lead-omission 1 FLAG MED gap-decision-sunk repeat-2 (dangling-head candidate-fix chi song trong history file nay, chua thanh carry named -> closeout S137 tach [carry:dangling-head]) + INFORM cum 7-carry dong-tuoi + INFORM closeout re-stamp tu HANDOFF-S134. class_repeat: gap-decision-sunk 1->2 (jump@3 chua cham), view-stale-status seed 1, 3 class S124 khong tai-hien -> reset 0 (consecutive semantics)."
}
]
}