wal: pause
This commit is contained in:
@ -1,22 +1,24 @@
|
||||
# WAL — auto-generated, không sửa tay
|
||||
updated: 2026-07-17 15:4x (S135 adap-wave ĐANG CHẠY) | session: S135 | branch: main
|
||||
goal: Adap wave 7-item AI_INFRA 17-07 (2 reply hub + khung-nhịp-năm-vòng CHUẨN + checklist-5-vòng-8-phép + giấc-ngủ-4-vai + non-JSON-args + notify-kênh-hỏi-đáp) — pipeline anh gõ: check-email → adap-apply → fable-real invest + review → plan-chi-tiết-checklist → hmw Opus 4.8 MAX. Run-folder: runs/2026-07-17-S135-adap-khung-nhip-nam-vong/
|
||||
updated: 2026-07-17 16:55 (pause @S135 — GIỮA wave adap, hmw 3-lane còn chạy nền lúc pause) | session: S135 | branch: main
|
||||
goal: Adap wave 7-item AI_INFRA 17-07 (2 reply hub + khung-nhịp-năm-vòng + checklist-5-vòng + giấc-ngủ + non-JSON-args + notify) — pipeline anh: check-email → adap-apply → fable-real invest+review → spec v2 → hmw Opus 4.8 MAX → pre-commit → adap-reports + email hub + STAGE-2. Run: runs/2026-07-17-S135-adap-khung-nhip-nam-vong/
|
||||
|
||||
chain:
|
||||
[x] 1. /tiep re-verify S134 — 4/4 PASS (test 8/8 · bundle BVCukFP5 · prod Mig 20260717032812 · origin sync) + sửa lệch 2 evidence-pointer (WAL S134 items 5/7 + errata run.md/close-synthesis + tick hồi-tố /pause)
|
||||
[x] 2. check-email AI_INFRA STAGE-1 — 7 file copy verbatim + verify 2-tuyến (whole-file + body-canonical stamp_verify.py) 7/7 OK + _index 7 row pending + commit 55ef8f6
|
||||
[x] 3. fable-real invest — COMPLETE 48.6KB/17-section (return #53-garble lần ×3, sub-file CỨU) · ⭐ lật tiền-đề T7: residual hub mis-site (ps1 sạch, 2 site thật = budget:65/:90) · baseline phép-1 FAIL (+3 tick/9 nhãn/7 pause) · evidence: sub-investigator-codebase-0.md
|
||||
[x] 4. lead verify V1-V8 8/8 KHỚP đĩa + chốt 6 DP default (⚑ anh flip được) + ghi spec v1 + tự-bắt file-collision LANE-A/C session-start.md → ownership trọn LANE-A · evidence: spec-adap-khung-nhip-17-07-2026.md
|
||||
[x] 5. fable-real review — GO_WITH_FIXES 0C/11M/10n CLEAN-return · 8 spot-check tự re-run khớp · lead áp TRỌN 21 fix → spec v2 · evidence: sub-reviewer-0.md 29.4KB
|
||||
[!] 6. wf: hmw implement `wf_d5b91490-a0f` 3-lane role-less tier:'opus' [A commands-contract ‖ B scripts-detectors ‖ C residual-doc-sleep] — DP-4 dogfood pointer-prompt · args.run RUN-TRACE · sub-task-{0,1,2}.md · BACKGROUND
|
||||
[ ] 7. reviewer pre-commit → commit/push (CI có thể trigger vì scripts/*.ps1 — cicd verify nếu chạy)
|
||||
[ ] 8. adap-reports ×5 + report email hub (nấc + số đo + run-id) + STAGE-2 move 7 file → inbox/ai_infra/ + _index processed
|
||||
[x] 1. /tiep re-verify S134 — 4/4 PASS + sửa 2 evidence-pointer rot · evidence: Errata trong runs/2026-07-17-S134-pe-luyke-tam-tinh/{run,close-synthesis}.md
|
||||
[x] 2. check-email AI_INFRA STAGE-1 — 7 file verify 2-tuyến 7/7 OK + _index 7 row pending · evidence: commit 55ef8f6
|
||||
[x] 3. fable-real invest COMPLETE (#53-garble ×3 — sub-file cứu) — 13 trục + baseline 8-phép (phép-1 FAIL +3tick/9nhãn/7pause · phép-3 3/3 union · phép-4 14/14) + T7 lật tiền-đề: residual hub mis-site (ps1 sạch — site thật budget:65/:90) · evidence: sub-investigator-codebase-0.md 48.6KB STATUS:COMPLETE
|
||||
[x] 4. lead verify V1-V8 8/8 KHỚP + chốt 6 DP default + spec v1 + tự-bắt file-collision LANE-A/C · evidence: spec-adap-khung-nhip-17-07-2026.md
|
||||
[x] 5. fable-real review GO_WITH_FIXES 0C/11M/10n (CLEAN-return) → lead áp TRỌN 21 fix → spec v2 · evidence: sub-reviewer-0.md 29.4KB VERDICT-dòng-159
|
||||
[!] 6. wf:hmw-implement-3-lane run=.claude/workflows/runs/2026-07-17-S135-adap-khung-nhip-nam-vong runId=wf_d5b91490-a0f args=spec-pointer-v2+3-lane-role-less-tier-opus(full-snapshot=run.md §taskList-implement) done=0/3-returned harvested=no · đĩa lúc pause: LANE-A landed (4 cmd .md + counter OR-guard :6) + LANE-C landed (budget.json/fable-real/sleep-cmd/hmw.js/adap-report + sub-task-2.md 1274B) + LANE-B CHƯA (0 probe, 0 detector H25) · 🔴 CHƯA lane nào return / CHƯA AC nào được lead chạy lại — landed ≠ verified
|
||||
[ ] 7. lead git-diff audit + chạy lại AC-A/B/C theo spec v2 §③ + reviewer pre-commit → commit đích-danh (M-7 add-list: 6 cmd .md + 2 scripts + hmw.js + counter + budget.json + adap-report + run-folder) → RESTART Claude Code (cmd .md no-hot-reload) → phiên kế đo phép 7 + phép 1
|
||||
[ ] 8. adap-reports ×5 + email hub (nấc + số baseline + carve-out DP-3 + errata mis-site + việc-2 done @S131) + STAGE-2 move 7 file → inbox/ai_infra/ + _index processed
|
||||
|
||||
next: chờ invest return (background) → item 4 lead verify + ghi spec
|
||||
carry (S134, của ANH — đừng rớt): UAT 2 script (S134 lũy-kế 3-bước + S133 freeze-NS 3-bước, incognito #77, HANDOFF NEXT-anh) + gật/đổi ⚑D1 (nháp list-only KHÔNG cộng tiền)
|
||||
next: /tiep → §4 nhánh wf: — đọc run.md §taskList-implement + spec v2 §③ + git-diff lane-files + sub-task-*.md → harvest-hồi-tố phần đã land (partial-honest) → relaunch CẮT-GỌT: chắc-chắn LANE-B (0 file); LANE-A/C = verify-AC-trước-tin rồi chỉ giao phần thiếu
|
||||
carry (S134, của ANH): UAT 2 script (S134 lũy-kế 3-bước + S133 freeze-NS 3-bước, incognito #77, HANDOFF NEXT-anh) + gật/đổi ⚑D1 · carry S135 mới: 6 ⚑DP spec v2 §② (anh flip được) · tick S135 ĐÃ CHẠY @pause bước 3.5 (counter 8→9, lần đầu tick-tại-pause — chính wave này wire): light-audit 6/6 = OVERDUE → fire phiên kế qua consent-gate
|
||||
|
||||
verify:
|
||||
- git log --oneline -2 # 55ef8f6 check-email (trên 99fc373 + 2 wal:)
|
||||
- ls broadcasts/inbox/*.md | grep -c 2026 # 7 pending
|
||||
- ls .claude/workflows/runs/2026-07-17-S135-adap-khung-nhip-nam-vong/ # run.md (+ sub-investigator-codebase-0.md khi invest chạy)
|
||||
- grep -c "pending" broadcasts/_index.md # ≥7
|
||||
- git log --oneline -2 # wal: pause trên cùng
|
||||
- ls .claude/workflows/runs/2026-07-17-S135-adap-khung-nhip-nam-vong/ # run.md + spec v2 + sub-investigator/reviewer + sub-task-*.md (lane land thêm SAU pause → hiện thêm)
|
||||
- ls scripts/nhip-no-probe.ps1 2>/dev/null || echo THIEU # THIEU = LANE-B vẫn chưa land
|
||||
- grep -c "H25" scripts/governance-detectors.ps1 # 0 = detector chưa; ≥2 = landed
|
||||
- grep -n "\"counter\": 9" .claude/governance/.session-counter.json # tick S135 đã ghi + committed trong wal: pause
|
||||
- git log --format=%s -1 --grep "wal: pause" --name-only | grep session-counter # M-7: counter nằm TRONG commit pause
|
||||
|
||||
@ -26,17 +26,22 @@ Thực-hiện **tuần-tự 5 bước** sau; trong lúc chạy **KHÔNG nhận v
|
||||
- **`verify:`** — **ít nhất một lệnh CHẠY ĐƯỢC cho từng mục `[!]`**, để `/tiep` chạy được và đối-chứng.
|
||||
- 🔴 WAL **ghi-đè toàn-file** (KHÔNG append), **cứng ≤ 40 dòng**. **CẤM secret** (WAL sẽ được commit): không key, không token, không credential.
|
||||
|
||||
## 3.5 TICK counter (H24 — TRƯỚC commit bước 4; Item 1(c) S135)
|
||||
- Tick `.claude/governance/.session-counter.json` **theo contract** (idempotent — NO-OP nếu cùng nhãn-phiên/cùng HEAD) — 🔴 **CON-TRỎ `session-start.md §2.1.8`, CẤM chép logic tick** (B1 canonical).
|
||||
- 🔴 **TRƯỚC commit bước 4** ⇒ delta counter được gộp vào commit `wal: pause` (file NGOÀI hook-3-path nên PHẢI add đích-danh ở bước 4).
|
||||
|
||||
## 4. Commit ĐÍCH-DANH — message `wal: pause`
|
||||
- `git add` **đích-danh** đúng các path: **WAL + path persist** (agent-memory / run-folder) **+ file dở**, rồi `git commit -m "wal: pause"`.
|
||||
- `git add` **đích-danh** đúng các path: **WAL + path persist** (agent-memory / run-folder) **+ `.claude/governance/.session-counter.json`** (🔴 M-7: tick bước 3.5 nằm TRONG commit `wal: pause` — file ngoài hook-3-path nên PHẢI add đích-danh; thiếu dòng này thì claim "tick nằm trong wal: pause" SAI) **+ file dở**, rồi `git commit -m "wal: pause"`.
|
||||
- 🔴 **TUYỆT ĐỐI KHÔNG `git add -A`** — chỉ add đúng path cần chốt, tránh nuốt file rác / secret ngoài ý-muốn.
|
||||
- **KHÔNG push.** (Repo trong Dropbox → thư-mục `.git` được cloud-sync, nên commit local vẫn **durable** qua tắt-máy / đổi-acc.)
|
||||
|
||||
## 5. Báo-cáo ngắn rồi DỪNG HẲN
|
||||
Báo đúng bốn ý:
|
||||
Báo đúng năm ý:
|
||||
1. **goal** — mạch việc đang dở là gì.
|
||||
2. **mục `[!]` đầu-tiên** — bước dở gần nhất.
|
||||
3. **workflow bỏ lại** (nếu có) — dòng `wf:` đã ghi.
|
||||
4. "**an-toàn để thoát, đổi acc, hoặc tắt máy**".
|
||||
5. **dòng-nợ (Item 2 S135):** gọi `powershell.exe -ExecutionPolicy Bypass -File scripts/nhip-no-probe.ps1` in dòng-nợ 3-vế (nhịp-kiểm đọc post-tick bước 3.5). 🔴 **probe KHÔNG chặn điểm dừng**: lỗi → in `probe-loi (khong chan)` → đi tiếp, VẪN tuyên-bố "an-toàn để thoát".
|
||||
|
||||
Rồi **DỪNG HẲN**, KHÔNG nhận việc mới.
|
||||
|
||||
|
||||
@ -53,7 +53,13 @@ Em main PHẢI echo **TOÀN BỘ nội dung command body này** (đầy đủ Ph
|
||||
> 🔸 *Nhãn cũ ghi "8-step" trong khi thân đã có (a)→(i) = 9 — `view-stale-count` điển-hình, vá @S122 khi thêm (j). Từ nay **KHÔNG chép số** vào nhãn: đếm từ thân (B1).*
|
||||
- **(a) summary-index** += 1 dòng/session vào `STATUS.md` Recently Done (pointer, KHÔNG full-log).
|
||||
- **(b) Active-Guards** (error-ledger): promote guard **2-strike** (episodic→procedural) · mark `verified` nếu held qua session · retire theo **net-effect** (hại>lợi → gỡ).
|
||||
- **(c) chore-flag:** agent L1 >~30KB → archive L2 · error-ledger open-entry quá ngưỡng · **0-byte memory check (AS-8)** · **🌙 sleep-check (Harness-10b, S72):** `last_sleep_at` null hoặc ≥7d (`memory-budget.json`) → INFORM gợi-ý `/sleep-recovery-memory-l2` (KHÔNG auto-run) · **🗜️ Harness-11 A/D2 (S75):** chạy `powershell.exe -ExecutionPolicy Bypass -File scripts/memory-archive-gate.ps1` (DRY-RUN) → đề-xuất dồn-archive sub over-cap (A4 hysteresis 0.85 + A5 keep-floor 5 + A6 2-strike) + A7 NO-API L1-eval (pointer-resolve + byte-0-loss). Engine → [`docs/governance/harness-11-engine.md`](../../docs/governance/harness-11-engine.md). DRY-RUN báo kế-hoạch; MOVE thật do em-main (D5 AUTO semantic-null sau khi xem). · **📊 Hot-feed %-print CUỐI phiên (Harness-15-v2 §G.4, S82):** in composition Tầng-1 theo **%/4-bucket** SAU khi đã nạp/tăng trong phiên + **Headroom còn-trống** so cap role (`token_governor.tier1_hotfeed_tokens`). Đối-xứng `session-start §2.1.6` (đầu phiên). Mục-đích: anh thấy Tầng-1 phình/teo ra sao + còn trống bao nhiêu → quyết chỉnh cap. 🔴 con-số = quyền anh (chủ-dự-án); em-main chỉ báo-%, KHÔNG tự-chỉnh. · **📊 Bảng-số ngân-sách + run-loop 2-tầng (M.B/M.C — Harness-20 adap S103, [`engine §M`](../../docs/governance/harness-11-engine.md)):** chạy `powershell.exe -ExecutionPolicy Bypass -File scripts/crystallized-backfill.ps1` → in BẢNG số THẬT (cap/hotload-bytes/tok-RANGE/headroom/target/backfill, live 0-hardcode) cạnh %-print. **Tầng-1 ĐO** (deterministic scripts) mỗi end = khối-số tươi (chống "khai-chạy-mà-không-chạy"); **Tầng-2 TINH-CHỈNH on-signal** (gap-mới/drift-vs-last/orphan-TĂNG/coverage-tụt → **cảnh-báo ĐỎ** + refine-in-session HOẶC carry-hi-prio nếu đứt-phiên) — KHÔNG nuốt tín-hiệu; weekly full-refine backstop. backfill default 0=OFF (owner). 🟡 M.C largely-already-met (H17-loop + %-print đã có ở dưới), khối-số = formalize. · **🧪 MFE retention opt-in (Harness-16 §H):** lệnh kèm `eval` → chạy `scripts/mfe-eval.ps1` cuối-phiên (retention; chênh vs baseline §2.1.6 = rot trong-phiên) → quyết-định 2-ca: **thiếu-chỗ→TĂNG budget** (anh quyết) / **rot→SẮP-XẾP-LẠI** (ưu-tiên-giá-trị). READS budget, KHÔNG ghi/auto-tune. · **🔁 H17 loop-REFINE (§I, S95 — [`harness-11-engine.md §I`](../../docs/governance/harness-11-engine.md)):** lệnh kèm `eval` → chạy thêm `scripts/memory-selfimprove-audit.ps1` (spec-audit CRITERIA+GAP) → áp bảng B1 **tín-hiệu→hành-động**: floor-rot→**reinject-verbatim** (ghi [`reinject-ledger.md`](../governance/reinject-ledger.md) CG-1 ≤1/N=3; đo-lại vẫn thiếu→**escalate anh** KHÔNG tự-reinject-lần-2) · repeat≥2→promote · old+valueless→archive-gate · raw→distill (`/sleep-recovery-memory-l2`). Phân-loại B3 (build-gap vs floor-rot) TRƯỚC reinject. em-main single-writer D9; loop CHỈ đề-xuất (D6). Light→skip.
|
||||
- **(c) chore-flag:** agent L1 >~30KB → archive L2 · error-ledger open-entry quá ngưỡng · **0-byte memory check (AS-8)** · **🌙 sleep-check (Harness-10b, S72):** `last_sleep_at` null hoặc ≥7d (`memory-budget.json`) → INFORM gợi-ý `/sleep-recovery-memory-l2` (KHÔNG auto-run) **+ byte-display (Item 8/M-10 S135):** khi INFORM fire → in kèm **tổng byte `agent-memory/*/archive/<period>.md` CHƯA có `.gist.md`** (match PREFIX kỳ, đo TƯƠI `(Get-Item).Length` — 🔴 CẤM `Get-Content`-đếm, bẫy encoding E-010; baseline 17-07 kỳ `2026-07` ≈183KB/5 file) → anh đặt ngưỡng byte sau, 🔴 **KHÔNG bịa số** (giữ INFORM 7-ngày — DP-5 quyền owner cục-bộ) · **🗜️ Harness-11 A/D2 (S75):** chạy `powershell.exe -ExecutionPolicy Bypass -File scripts/memory-archive-gate.ps1` (DRY-RUN) → đề-xuất dồn-archive sub over-cap (A4 hysteresis 0.85 + A5 keep-floor 5 + A6 2-strike) + A7 NO-API L1-eval (pointer-resolve + byte-0-loss). Engine → [`docs/governance/harness-11-engine.md`](../../docs/governance/harness-11-engine.md). DRY-RUN báo kế-hoạch; MOVE thật do em-main (D5 AUTO semantic-null sau khi xem). · **📊 Hot-feed %-print CUỐI phiên (Harness-15-v2 §G.4, S82):** in composition Tầng-1 theo **%/4-bucket** SAU khi đã nạp/tăng trong phiên + **Headroom còn-trống** so cap role (`token_governor.tier1_hotfeed_tokens`). Đối-xứng `session-start §2.1.6` (đầu phiên). Mục-đích: anh thấy Tầng-1 phình/teo ra sao + còn trống bao nhiêu → quyết chỉnh cap. 🔴 con-số = quyền anh (chủ-dự-án); em-main chỉ báo-%, KHÔNG tự-chỉnh. · **📊 Bảng-số ngân-sách + run-loop 2-tầng (M.B/M.C — Harness-20 adap S103, [`engine §M`](../../docs/governance/harness-11-engine.md)):** chạy `powershell.exe -ExecutionPolicy Bypass -File scripts/crystallized-backfill.ps1` → in BẢNG số THẬT (cap/hotload-bytes/tok-RANGE/headroom/target/backfill, live 0-hardcode) cạnh %-print. **Tầng-1 ĐO** (deterministic scripts) mỗi end = khối-số tươi (chống "khai-chạy-mà-không-chạy"); **Tầng-2 TINH-CHỈNH on-signal** (gap-mới/drift-vs-last/orphan-TĂNG/coverage-tụt → **cảnh-báo ĐỎ** + refine-in-session HOẶC carry-hi-prio nếu đứt-phiên) — KHÔNG nuốt tín-hiệu; weekly full-refine backstop. backfill default 0=OFF (owner). 🟡 M.C largely-already-met (H17-loop + %-print đã có ở dưới), khối-số = formalize. · **🧪 MFE retention opt-in (Harness-16 §H):** lệnh kèm `eval` → chạy `scripts/mfe-eval.ps1` cuối-phiên (retention; chênh vs baseline §2.1.6 = rot trong-phiên) → quyết-định 2-ca: **thiếu-chỗ→TĂNG budget** (anh quyết) / **rot→SẮP-XẾP-LẠI** (ưu-tiên-giá-trị). READS budget, KHÔNG ghi/auto-tune. · **🔁 H17 loop-REFINE (§I, S95 — [`harness-11-engine.md §I`](../../docs/governance/harness-11-engine.md)):** lệnh kèm `eval` → chạy thêm `scripts/memory-selfimprove-audit.ps1` (spec-audit CRITERIA+GAP) → áp bảng B1 **tín-hiệu→hành-động**: floor-rot→**reinject-verbatim** (ghi [`reinject-ledger.md`](../governance/reinject-ledger.md) CG-1 ≤1/N=3; đo-lại vẫn thiếu→**escalate anh** KHÔNG tự-reinject-lần-2) · repeat≥2→promote · old+valueless→archive-gate · raw→distill (`/sleep-recovery-memory-l2`). Phân-loại B3 (build-gap vs floor-rot) TRƯỚC reinject. em-main single-writer D9; loop CHỈ đề-xuất (D6). Light→skip.
|
||||
- **🧬 memory-triple artifact (Item 3-bis S135 — B2 vòng-3 lên CHỨC-NĂNG; 0 vai mới, 0 script mới):** khi chạy khối (c) memory-maintenance ở trên, ghi **3 dòng artifact tuần-tự** (prefix `memory-triple`) vào session-log (`docs/changelog/sessions/`) — run-record 3-stage đo→đề-xuất→kiểm:
|
||||
```
|
||||
memory-triple: do=<scripts/measure-agent-memory.ps1 · exit N>
|
||||
memory-triple: de-xuat=<scripts/memory-archive-gate.ps1 DRY · exit N>
|
||||
memory-triple: kiem=<scripts/mfe-eval.ps1 | reviewer · verdict>
|
||||
```
|
||||
- **(d) flush agent-memory** mỗi sub đã spawn session này — **spawn-record 4-field** `{agent · task · nấc(agreed/executed/verified) · evidence}`. (0 sub spawn → "n-a".) → **⬜ harvest-curator (H2) HỖ TRỢ:** spawn → propose spawn-record cho mọi sub đã chạy → em main single-writer VERIFY → APPEND (B3 no-overwrite-unverified).
|
||||
- **(e) pending-request audit:** request anh CHƯA-thực-thi đã log SPECIFICS chưa (KHÔNG placeholder).
|
||||
- **(f) 🌾 harvest-integrity GATE (⬜ harvest-curator H2 — 5-trục, Harness 1+2):** verify spawn-record (d) đủ+đúng mọi sub TRƯỚC khi đóng — **Coverage** (0 silent-miss) · **Completeness** (đủ 4-field) · **Placement** (delta đúng `agent-memory/X`) · **Corruption** (moved-not-cut, no-mojibake/shell-baked) · **Fidelity-FLAG** (nghi bịa/on-behalf → escalate 🟥 reviewer, KHÔNG tự phán). + **🌊 close-gate C5 Layer3 (Harness-10, thay B5 wave-gom):** với MỌI `runs/<run-id>/` của session → **VERIFY per-turn harvest đã xong** (em-main đã viết `runs/<run-id>/<stage>-synthesis.md` phẳng h10-refine — run cũ S71: `harvest/*.md` — NGAY sau mỗi fan-out turn = C4 Layer1) + mọi `runs/<run-id>/` của session có `*-synthesis.md` present (folder-scan — 🧊 tiêu-chí ledger CLOSE-beat retired H18-B S100). 🔴 **IDEMPOTENT — close-gate chỉ VERIFY, KHÔNG re-APPEND** (per-turn đã APPEND rồi → re-APPEND = DUPLICATE-HARVEST). 5-trục GATE giữ làm **backstop**. GATE = run còn **thiếu bản-ghi-kết-quả** (theo **DUAL-ACCEPT**, xem dưới) HOẶC chưa đủ 5-trục thì CHƯA đóng.
|
||||
@ -90,13 +96,15 @@ Em main PHẢI echo **TOÀN BỘ nội dung command body này** (đầy đủ Ph
|
||||
**Acceptance:** chênh-lệch **0**, HOẶC in được danh-sách lệch. 🔸 *Sàn-5 là **informational** — chính vì thế nó **an-toàn để sai**, và cái sai đó đã trả giá bằng việc tự lộ 2 bug ở lần chạy đầu. Nếu nó là cổng-chặn thì 9 dương-giả kia đã chặn cả phiên.*
|
||||
|
||||
- **(j) 🔷🔶 H24 lead-self-audit — counter + spawn theo NHỊP (adopt S122; đối-xứng `session-start §2.1.8`):**
|
||||
- **(i) Đọc** `.claude/governance/.session-counter.json` + `h24_cadence` (`memory-budget.json`) → in **1 dòng**: `counter=<n> · light <a>/<light_every> · deep <b>/<deep_every> · OVERDUE: <none|light|deep>`. 🔴 **Nhịp ĐỌC từ config, CẤM hardcode ở đây** (detector `governance-detectors.ps1` H24-2 **fail-loud** nếu key thiếu — **không** giả-định default).
|
||||
- **(i) BÁO dòng-nợ 3-vế (nâng dòng H24 cũ — Item 2 S135):** gọi `powershell.exe -ExecutionPolicy Bypass -File scripts/nhip-no-probe.ps1` → in **1 dòng** `NHIP-NO: kiem light a/e deep b/f <ok|OVERDUE:…> | tran-bo-nho x over-cap | run-chua-gom y` (vế-1 nhịp-kiểm THAY dòng `counter=… light … deep … OVERDUE` cũ, đọc `.session-counter.json` + `h24_cadence`). 🔴 **probe KHÔNG chặn**: lỗi → in `probe-loi (khong chan)` → đi tiếp. 🔴 **Nhịp ĐỌC từ config, CẤM hardcode ở đây** (detector `governance-detectors.ps1` H24-2 **fail-loud** nếu key thiếu — **không** giả-định default).
|
||||
- **(ii) OVERDUE** → **INFORM anh** + đề-xuất spawn vai H24 tương-ứng. 🔴 **KHÔNG auto-run** (anh consent mới chạy, giống sleep-check (c)). Chạy xong → cập-nhật `last_audit.{light,deep}_at_counter` = counter hiện-tại. **Lead = single-writer.**
|
||||
- **(iii) Flag → class:** mỗi FLAG của 2 vai **PHẢI** thuộc **enum ĐÓNG** `lead_self_audit.flag_classes`. Vai **KHÔNG tự chế class** — finding không phân-loại được ⇒ báo **verbatim** + **escalate anh** để mở rộng enum. Cập-nhật `class_repeat.counts`; class nào lặp **≥ `jump_on_class_repeat`** ⇒ **kéo audit tới sớm**.
|
||||
- **(iv) 🔴 Nghi-thức RE-STAMP carry (GAP THẬT, vá @S122):** khi ghi segment `HANDOFF` mới, **ĐÓNG DẤU LẠI `[carry:<slug>]` cho MỌI carry còn mở** — không chỉ lần đầu.
|
||||
**Vì sao bắt buộc:** carry-age detector đo **streak** = số segment LIÊN-TỤC mang cùng slug. Đo thật @S121: **45 logic-segment nhưng `carry-lines=1`** ⇒ streak **luôn ≡ 1** ⇒ **0 fire VĨNH VIỄN, kể cả sau W2**. Bằng-chứng: `tra-bui-relogin` chỉ đóng dấu **seg#0 (S119)**, trong khi **seg#2 (S118)** nhắc **đúng việc đó** mà **không có dấu** ⇒ **tuổi thật ≥2, máy đọc 1**. ⇒ detector **vacuous về CẤU-TRÚC**, không phải sai ngưỡng.
|
||||
🔴 **Không retrofit dấu vào segment CŨ** (§Q3 no-retrofit) ⇒ **đường DUY NHẤT còn lại** = re-stamp từ nay về sau; tuổi sẽ đo đúng **từ S122 trở đi**, và **khai thẳng** rằng carry mở trước S122 có tuổi **đo-thiếu**.
|
||||
**Định-nghĩa "dòng-carry" (owner O3):** = **đoạn LOGIC** `NEXT anh` / `NEXT em` trong mega-line — KHÔNG phải dòng vật-lý. ⚠️ Bẫy đếm: `grep -c` đếm **DÒNG** (=1 trên mega-line), `grep -o | wc -l` đếm **occurrence** (=n). Dùng đúng cái thứ hai.
|
||||
- **(v) 🔷 TICK-at-close (Item 1(d) S135 — idempotent):** tick `.claude/governance/.session-counter.json` **theo contract** — 🔴 **CON-TRỎ `session-start §2.1.8`, CẤM chép logic tick** (B1). Idempotent: cùng nhãn-phiên phiên này ⇒ **NO-OP** (nếu `/session-start` hoặc `/tiep` đã tick nhãn này). Có delta → **§5.1 add đích-danh counter-file** (file ngoài hook-3-path; bằng-chứng sống: tick S133 nằm uncommitted qua 2 closeout liên tiếp — M-7).
|
||||
- **(vi) 🔥 Force-fire bù khi closeout gộp sổ (Item 3 S135 — floor B1 §3.2):** đếm `P` = số `wal: pause` gộp vào closeout này: `P=$(git log --format=%s "<closeout-liền-trước>..HEAD" | grep -c '^wal: pause' || true)` — `<closeout-liền-trước>` = commit gần nhất match **regex closeout DÙNG CHUNG Item 4** `^\[CLAUDE\] Docs: S\d+.*(closeout|session-end)` (1 regex, đừng chép 2 bản). 🔴 **so-sánh SỐ, KHÔNG dùng exit-code** (`grep -c` trả exit 1 khi đếm 0 — §5.0 (a)): `[ "$P" -ge 1 ]`. Nếu **`P >= 1` HOẶC** nhãn đóng dạng `S<a>-S<b>` (closeout gộp nhiều phiên) ⇒ coi như **`OVERDUE(light)` bất-kể counter** → in dòng-nợ (qua (i)) + **INFORM-BẮT-BUỘC** anh + **đề-xuất spawn cặp H24 (`lead-view-auditor` + `lead-omission-auditor`) NGAY closeout này**. 🔴 **DP-3 consent-gate GIỮ** (luật owner-era §L.b(j)(ii) + `session-start §2.1.8(e)` "KHÔNG auto-run — anh consent" + hẹn hub "light-run owner-triggered"): force-fire = INFORM-bắt-buộc + đề-xuất-chạy mặc-định, **anh gật mới chạy trong closeout**. Báo hub SELF-CHECK ô3 = **"PASS-với-carve-out (consent)"**, KHÔNG PASS trần.
|
||||
- **(g) 🔌 tooling-freshness CHỐT (🟫 tooling-auditor H1 — Harness 1):** spawn → chốt 4-mặt (skill·sub-role·plugin·docs) đổi gì session này + **new-alloc audit** (skill/plugin MỚI chưa phân-bổ → đề-xuất gán em main + sub phù-hợp vai) + flag doc-drift/roster-lệch/count-stale. Propose → em main APPEND/sửa doc (single-writer). 🔴 G-015: 2 monitor = propose-only, em main VERIFY trước APPEND (Bash residual → KHÔNG "read-only enforced").
|
||||
- **(h) 🔏 User-Mark CHỐT cuối phiên (H-12/13 canonical §P/P7, S79 — `harness-11-engine.md §E`):** đọc [`.claude/governance/ACTIVE-MARKS.md`](../governance/ACTIVE-MARKS.md) → (i) **hiển-thị** status-filtered (Active-High/Active hiện · Medium tóm-tắt · Disable ẩn) cho anh đọc lại (đối-xứng `session-start §2.1.4`); (ii) nếu session này có **quyết-định cấp-governance MỚI** (scope-check P6: đổi CANONICAL §-rule/authority) → chạy `/user-mark-<cấp>` DACI: adjust-gov → double-check → **report-trước-đóng-dấu 3-7 tiêu-chí khách-quan (P4)** → anh confirm → stamp `RC-pqhuy1987-dd-mm-yyyy-hh-mm-ss`; (iii) supersede/disable mark cũ (P5) → con-trỏ-xuôi + Active-High cần anh-confirm RIÊNG. 🔴 **KHÔNG tự đóng dấu / đổi cấp trước khi báo (P4/P8).** 0 quyết-định-mới → "n-a, chỉ hiển-thị".
|
||||
- **(i) 🎯 H18-D(a) outcome spot-check (S100 — [`harness-11-engine.md §J`](../../docs/governance/harness-11-engine.md)):** session governance/review-heavy → chọn **3–5 artifact đã tự-động-qua-cổng** trước đó (cicd GO verdict · detector verdict · monitor verdict · adap-report claim) → **kiểm-lại TƯƠI bằng ground-truth** (tính lại giá-trị đối-chứng · mở định-nghĩa gốc xem claim có thật-cover · đối-chiếu nguyên-văn nguồn). Gấp vào review sẵn có (chi-phí ~0). Sàn-vai trượt-THẬT khỏi nhật-ký → reinject-on-real-miss qua [`reinject-ledger.md`](../governance/reinject-ledger.md) CG-1 (≤1 lần/N=3 phiên, vẫn trượt → escalate anh — REUSE H17 §I B2, KHÔNG sổ mới). Light/hỏi-đáp → skip. (Nấc honest: dogfood n=1 S100 = mẫu hiệu-chỉnh, CHƯA "proven" — caveat 1 broadcast H18.)
|
||||
@ -181,6 +189,7 @@ K=0; while read -r s; do case "$s" in wal:*) K=$((K+1));; *) break;; esac
|
||||
|
||||
### 5.1 Release + commit
|
||||
- Kiểm tra release, commit task vừa hoàn thành. ⚠️ Update `SolutionErp.slnx` nếu có `.cs/.csproj` mới.
|
||||
- 🔴 **M-7 — add đích-danh `.claude/governance/.session-counter.json` khi tick-at-close (§L.b(j)(v)) tạo delta:** file NGOÀI hook-3-path ⇒ KHÔNG tự vào `wal:` commit ⇒ PHẢI `git add` đích-danh ở commit closeout, nếu không counter-delta nằm uncommitted (bằng-chứng sống: tick S133 uncommitted qua 2 closeout liên tiếp).
|
||||
- Format: `[CLAUDE] <scope>: <imperative message>` + `Co-Authored-By: <lead model hiện tại> <noreply@anthropic.com>` (model = lead runtime phiên hiện-tại per BƯỚC 0.6 probe — KHÔNG hardcode; flip-chain canonical → `docs/STATUS.md` §Sub-agents)
|
||||
- Scope: `Contract · PurchaseEvaluation · Budget · Form · Workflow · Supplier · Auth · Admin · Api · App · Domain · Infra · FE-Admin · FE-User · Tests · Docs · CICD · Scripts · Skill`
|
||||
|
||||
|
||||
@ -128,7 +128,7 @@ Em main đọc `.claude/WAL.md` (sổ mạch-việc-dở H22 — ghi-đè ≤40
|
||||
|
||||
> Read-side "vật-chất-tối": archive `agent-memory/<sub>/archive/*.md` KHÔNG vào RAG. Inject **mục-lục** (`archive/_INDEX.md`), nội dung verbatim + `.gist.md` đọc-theo-nhu-cầu. "Inject tấm bản-đồ, KHÔNG inject lãnh-thổ."
|
||||
|
||||
- **🌙 Sleep-check (Harness-10b, S72):** trong lúc đọc `memory-budget.json` (cùng file budget-audit), lấy `last_sleep_at` → nếu `null` HOẶC `today − last_sleep_at ≥ 7 ngày` → **INFORM gợi-ý** chạy `/sleep-recovery-memory-l2 <agent|all>` (nén L2 verbatim→gist additive). 🔴 **KHÔNG auto-run** — anh consent mới chạy.
|
||||
- **🌙 Sleep-check (Harness-10b, S72):** trong lúc đọc `memory-budget.json` (cùng file budget-audit), lấy `last_sleep_at` → nếu `null` HOẶC `today − last_sleep_at ≥ 7 ngày` → **INFORM gợi-ý** chạy `/sleep-recovery-memory-l2 <agent|all>` (nén L2 verbatim→gist additive). 🔴 **KHÔNG auto-run** — anh consent mới chạy. **+ Byte-display (Item 8/M-10 S135):** khi INFORM fire → in kèm **tổng byte `agent-memory/*/archive/<period>.md` CHƯA có `.gist.md`** (match PREFIX kỳ; đo TƯƠI `(Get-Item).Length` — 🔴 CẤM `Get-Content`-đếm, bẫy encoding E-010; baseline 17-07 kỳ `2026-07` ≈183KB/5 file) → anh nhìn số rồi **tự ĐẶT ngưỡng byte** nếu muốn chuyển hẳn sang trigger-theo-byte; 🔴 **KHÔNG bịa số** (giữ INFORM 7-ngày — DP-5 quyền owner cục-bộ B1 §3.4).
|
||||
|
||||
- Đọc `.claude/agent-memory/memory-budget.json` → so kích-thước THẬT `_INDEX.md` mỗi sub vs cap. Nếu cắt-cho-vừa-ngân-sách đang rớt dấu-mốc quan trọng → **bump budget** (chốt-chặn chống "quên chỉnh ngân sách"). Đo lại bằng `scripts/measure-agent-memory.ps1` (seed-by-measure — KHÔNG đặt cap bằng số tưởng tượng).
|
||||
- L1 over-cap → curate L1→L2 (byte-exact additive) + build/refresh `_INDEX.md` (con-trỏ **substring** sha-keyed, fallback Ctrl-F) + `<period>.gist.md` (nén 4-field, `distill-gen` counter, verbatim FROZEN). Rollout đầu: 4 over-cap sub (S70).
|
||||
@ -185,11 +185,12 @@ Em main đọc `.claude/WAL.md` (sổ mạch-việc-dở H22 — ghi-đè ≤40
|
||||
**(a) TICK — content-addressed, KHÔNG blind-increment:**
|
||||
```
|
||||
head = git rev-parse HEAD
|
||||
nếu head == last_ticked_head → NO-OP (idempotent)
|
||||
nếu head == last_ticked_head HOẶC session == last_ticked_session → NO-OP (idempotent per HEAD + per nhãn-phiên)
|
||||
ngược lại → counter += 1 ; last_ticked_session = S<nn> ; last_ticked_head = head ; last_ticked_at = <date>
|
||||
```
|
||||
🔴 **Vì sao content-addressed:** Stop-hook `wal-flush.ps1` auto-commit ở **MỌI turn-boundary** ⇒ `counter++` mù sẽ tick **nhiều lần trong một phiên thật** ⇒ nhịp thành vô-nghĩa. Neo vào HEAD làm 2 lần `/session-start` **cùng HEAD** = **+1, KHÔNG +2**.
|
||||
> 🔸 **Khai thật giới-hạn:** counter đếm **"phiên có làm HEAD đổi"**, không phải "phiên". Hai phiên liên-tiếp mà **không commit gì** (Q&A thuần, không chạm WAL) ⇒ cùng HEAD ⇒ **chỉ 1 tick**. Thực-tế hook chạm WAL gần như mọi phiên nên hiếm; nhưng **đừng đọc counter thành "số phiên tuyệt-đối"**.
|
||||
🔴 **Vì sao OR-guard (content-addressed + session-label):** Stop-hook `wal-flush.ps1` auto-commit ở **MỌI turn-boundary** ⇒ HEAD dời **giữa phiên thật** ⇒ head-guard ĐƠN sẽ để tick fire **nhiều lần trong một phiên** (mỗi điểm tick sau khi HEAD dời lại +1) ⇒ nhịp vô-nghĩa. **Session-clause** (`session == last_ticked_session`) giữ **mỗi nhãn-phiên = đúng +1**: 2 lần `/session-start` cùng HEAD, HOẶC session-start rồi `/pause` (HEAD đã dời do hook) — đều NO-OP sau lần đầu. Đây là bẫy **+2/cycle** mà OR-guard vá (`/pause` commit dời HEAD; thiếu session-guard thì pause+tiep = +2).
|
||||
🔴 **Label-convention (PIN THÀNH LUẬT — S135):** mỗi conversation MỚI = một **nhãn-phiên `S<nn>` MỚI**, **kể cả khi vào bằng `/tiep`** (nối qua phiên/đổi acc — `tiep.md:130` "session: khác phiên hiện-tại là BÌNH-THƯỜNG" = use-case chuẩn; thực-hành S134/S135). 🔴 **CẤM reuse nhãn cũ khi nối** — thiếu luật này thì session-clause khớp nhãn cũ ⇒ OR-guard NO-OP nhầm ngay cửa `/tiep` ⇒ tiep KHÔNG tick ⇒ **phép-7 `+0`**.
|
||||
> 🔸 **Đơn-vị đếm + khai thật giới-hạn (reconcile gốc "đếm phiên-có-làm-HEAD-đổi"):** counter đếm **nhãn-phiên `S<nn>`** — phiên thường (SE chưa adopt session-logic `9234a7aa`; khi adopt thì đọc lại = **phiên-LOGIC**, caveat B1 §7). OR-guard cho **mỗi nhãn-phiên +1** ở điểm tick ĐẦU. 🔸 **Ca hiếm giữ khai:** một nhãn-phiên MỚI mà **không commit gì** (Q&A thuần, không chạm WAL) ⇒ HEAD trùng `last_ticked_head` ⇒ head-clause NO-OP ⇒ **+0** (đúng gốc "phiên-có-làm-HEAD-đổi", giữ khai). Thực-tế hook chạm WAL gần như mọi phiên nên hiếm; **đừng đọc counter thành "số phiên tuyệt-đối"**.
|
||||
|
||||
**(b) FAIL-LOUD, CẤM tự chữa:** counter đến **THẤP HƠN** giá-trị đã lưu, HOẶC `last_ticked_head` trỏ commit **không reachable từ HEAD** → 🔴 **BÁO ANH**, **KHÔNG silent-reset**. Counter lùi = file bị rollback/sửa tay; reset lặng sẽ **giấu mất khoảng nhịp đã trôi**.
|
||||
|
||||
@ -200,10 +201,10 @@ ngược lại → counter += 1 ; last_ticked_session = S<nn> ; last_ticked_head
|
||||
|
||||
**(d) JUMP:** một class trong `lead_self_audit.flag_classes` lặp **≥ `jump_on_class_repeat`** lần → **kéo audit tới sớm**, bất-kể counter.
|
||||
|
||||
**(e) BÁO:** in **1 dòng** `counter=<n> · light <a>/<light_every> · deep <b>/<deep_every> · OVERDUE: <none|light|deep>`. OVERDUE → **INFORM anh** + đề-xuất spawn vai H24 tương-ứng. 🔴 **KHÔNG auto-run** — anh consent mới chạy (giống sleep-check §2.1.2).
|
||||
**(e) BÁO dòng-nợ 3-vế (nâng dòng H24 cũ — Item 2 S135):** gọi `powershell.exe -ExecutionPolicy Bypass -File scripts/nhip-no-probe.ps1` → in **1 dòng** `NHIP-NO: kiem light a/e deep b/f <ok|OVERDUE:…> | tran-bo-nho x over-cap | run-chua-gom y` (vế-1 nhịp-kiểm = `counter/light/deep/OVERDUE` thay dòng H24 cũ). 🔴 **probe KHÔNG chặn**: lỗi → in `probe-loi (khong chan)` → đi tiếp. OVERDUE(light|deep) → **INFORM anh** + đề-xuất spawn vai H24 tương-ứng. 🔴 **KHÔNG auto-run** — anh consent mới chạy (giống sleep-check §2.1.2).
|
||||
|
||||
🔴 **Số nhịp = quyền anh.** Bước này **ĐỌC** `h24_cadence`, **KHÔNG** ghi. **CẤM hardcode nhịp ở đây** — copy số vào doc dẫn-xuất chính là drift mà single-source sinh ra để chặn (detector `governance-detectors.ps1` H24-2 **fail-loud** nếu key thiếu, **không** giả-định default).
|
||||
> 🟡 **Honest-caveat mang theo khi báo hub:** hub nói rõ *"số của các em = config của các em; ĐỪNG chép 3 số này"*. SE chọn **cùng 6/15/3** là **điểm khởi-đầu anh CỐ Ý chọn**, KHÔNG phải chép vô-thức. **Chỉnh lại sau chu-kỳ-2 CỦA SE** (deep-audit lần 2, xem .session-counter.json last_audit). Hub đã GỠ counter (bookend 07-15, sha 85bf89ca) → ví-dụ 6/15/3 "ở nguồn" = lịch-sử, KHÔNG còn mốc hub để so; delta hub hứa từ run-2 KHÔNG BAO GIỜ có (hub gỡ trước run-2) — **chưa ai được bán câu "đã chứng minh hiệu-quả"**.
|
||||
> 🟡 **Honest-caveat mang theo khi báo hub:** hub nói rõ *"số của các em = config của các em; ĐỪNG chép 3 số này"*. SE chọn **cùng 6/15/3** là **điểm khởi-đầu anh CỐ Ý chọn**, KHÔNG phải chép vô-thức. **Chỉnh lại sau chu-kỳ-2 CỦA SE** (deep-audit lần 2, xem .session-counter.json last_audit). Hub đã GỠ counter (bookend 07-15, sha 85bf89ca) → ví-dụ 6/15/3 "ở nguồn" = lịch-sử, KHÔNG còn mốc hub để so; delta hub hứa từ run-2 KHÔNG BAO GIỜ có (hub gỡ trước run-2) — **chưa ai được bán câu "đã chứng minh hiệu-quả"**. ✅ **Ratified 2026-07-17:** anh mark cổng reply `e50a4bd0` (2026-07-16-ai_infra-to-se-reply-adap); canonical = `memory-budget.json → h24_cadence._owner_ratified` (B1 — wording sống ở đó, đừng chép lại đây).
|
||||
|
||||
### 2.2 Skill registry (6 skill)
|
||||
- Liệt kê: `contract-workflow` · `form-engine` · `permission-matrix` · `dependency-audit-erp` · `ef-core-migration` · `iis-deploy-runbook`
|
||||
|
||||
@ -107,6 +107,10 @@ Tín-hiệu **YẾU NHẤT**, dùng cuối. 🔴 **`porcelain` rỗng KHÔNG ph
|
||||
- VÀ đọc thêm `git status` + disk **run-folder liên-quan** — **per-turn ≠ per-task (N9):** các *return* của agent có thể mất khi phiên chết, NHƯNG file **per-agent trên đĩa vẫn còn**; nên đọc đĩa, đừng chỉ tin returns.
|
||||
- So kết-quả thực-tế với `chain:`.
|
||||
|
||||
## 2.5 TICK counter + dòng-nợ (H24 — TICK TRƯỚC, dòng-nợ SAU; Item 1(b)+2 S135)
|
||||
- **TICK** `.claude/governance/.session-counter.json` **theo contract** (idempotent — NO-OP nếu cùng nhãn-phiên/cùng HEAD) — 🔴 **CON-TRỎ `session-start.md §2.1.8`, CẤM chép logic tick** (B1 canonical). Nhãn `/tiep` = **nhãn-phiên MỚI** (label-convention §2.1.8) ⇒ tick fire NGAY cửa vào, OVERDUE @9 hiện tại đây thay vì đợi cuối phiên.
|
||||
- **Dòng-nợ (SAU tick — n-3):** gọi `powershell.exe -ExecutionPolicy Bypass -File scripts/nhip-no-probe.ps1` in dòng-nợ 3-vế (vế-1 nhịp-kiểm đọc post-tick). 🔴 **probe KHÔNG chặn điểm dừng**: lỗi → in `probe-loi (khong chan)` → đi tiếp.
|
||||
|
||||
## 3. Ground-truth thắng WAL
|
||||
- **LỆCH** (kết-quả `verify:` / `git status` mâu-thuẫn `chain:`) → **TIN GROUND-TRUTH**: sửa WAL cho khớp thực-tế, **báo chỗ lệch** cho user, RỒI MỚI chạy tiếp. KHÔNG mù-quáng chạy theo chain sai.
|
||||
- **KHỚP** → thực-thi từ **`next:`**, nối chain theo thứ-tự các mục còn `[!]` / `[ ]`.
|
||||
|
||||
@ -3,16 +3,16 @@
|
||||
"_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 -> NO-OP (idempotent, same HEAD = same real session state). Else counter = counter + 1, last_ticked_session = session, last_ticked_head = head, last_ticked_at = date.",
|
||||
"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": 7,
|
||||
"last_ticked_session": "S131",
|
||||
"last_ticked_head": "882e0d783878b074be2fd944e9f5e4e4a1a7cd3d",
|
||||
"counter": 9,
|
||||
"last_ticked_session": "S135",
|
||||
"last_ticked_head": "a4ac81a7718e7b8841aa2f35282dc7856dfadd69",
|
||||
"last_ticked_at": "2026-07-17",
|
||||
"last_audit": {
|
||||
"light_at_counter": 3,
|
||||
@ -28,6 +28,11 @@
|
||||
"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."
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@ -0,0 +1,14 @@
|
||||
# sub-task-2 — LANE-C (residual + doc + sleep-cmd) — S135 adap khung-nhip-nam-vong
|
||||
|
||||
> Worker: hmw LANE-C (role-less, opus 4.8 MAX). SPEC canonical = `spec-adap-khung-nhip-17-07-2026.md` (Read TRUOC KHI LAM, DONE).
|
||||
> Items: 6 (residual do-token + `_owner_ratified`) + 7 (non-JSON-args luat) + 8-phan-cmd (sleep-recovery khuon).
|
||||
> FILE DUOC SUA (CHI 5): `.claude/agent-memory/memory-budget.json` · `docs/governance/adap-reports/2026-07-16-...san-su-that-nhan-da-do.md` · `.claude/workflows/hmw.js` · `.claude/commands/fable-real.md` · `.claude/commands/sleep-recovery-memory-l2.md`.
|
||||
> ISOLATION: 0 file trung LANE-A/B. KHONG dung `session-start.md:206` (LANE-A) · `scripts/crystallized-backfill.ps1` (NO-CHANGE) · byte-display RUNTIME wire (LANE-A 2 site).
|
||||
|
||||
## BASELINE (do 17-07 truoc khi sua, Grep tool)
|
||||
|
||||
- `grep "draft 2026-07-15"` NGOAI exclusion-set {runs/, broadcasts/, adap-reports:19, .claude/agent-memory/**-diary} = **2 site song**: `memory-budget.json:65` + `memory-budget.json:90` (+ 1 diary-mention `investigator-codebase/MEMORY.md:23` = EXCLUDED, CAM sua).
|
||||
- `grep -c "e0bb5bbf" memory-budget.json` = **0** (post-wave phai = 2).
|
||||
- adap-report san-su-that = 84 dong (§1-§5), append CUOI FILE additive.
|
||||
|
||||
## TRACE — se cap nhat sau moi edit ben duoi.
|
||||
Reference in New Issue
Block a user