[CLAUDE] Docs: S125 adap tien-de-vong4 — relabel token CAN-TREN + hash-verify byte-safe + dinh-chinh hub + fable-real review/invest checklist

- adap broadcast phuong-phap-dem-token (type:new): negative-control tai lap 3-probe (notice-N = heuristic char-dem, KHONG phai token that) -> relabel STATUS:41 + HANDOFF:5 x2 + do-token report ADDENDUM (dai [31K byte/4 - 70,9K notice] => lead-share [8,2-18,7]%)
- false-TAMPER RCA: PS5.1 Get-Content -Raw doc UTF-8-no-BOM bang ANSI -> va check-email/send-email byte-safe + verifier-suspect-first; stamp hub verify OK bang stamp_verify.py (exit-0)
- email dinh-chinh hub (58f5afd8, selftest exit-0 x2) + adap-report + adap-request hash-verify-byte-safe-decode + FYI 2 broadcast no-stamp
- STAGE-2: git mv 7 broadcast processed -> inbox/ai_infra/ (root sach)
- fable-real review+invest (vai compound reviewer+inv-cb): run-trace + spec 3-muc + checklist A-D cho hmw @Opus 4.8 MAX; va stale all-inherit fable-real.md:37 + fable-clone.md:43
- hook-curate inv-cb MEMORY 23,9->16,9KB moved-not-cut (14 dong + 2 digest -> archive/2026-07.md)
- h18 memory +sibling-test-2-chieu; monitor self-compact S125-start + counter tick=4

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-07-16 13:29:43 +07:00
parent 3aacdf9d1c
commit 010d12c5f8
29 changed files with 261 additions and 41 deletions

View File

@ -0,0 +1,32 @@
# run — 2026-07-16-S125-fable-real-adap-review
> Engine-đắt **/fable-real** (H21 lệnh-A, owner-invoked trong đề-bài S125). **Vai compound anh gõ: "review và invest" = reviewer + investigator-codebase** (khớp tiền lệ hub run `2026-07-11-s87 invest-review`; KHÔNG phải em tự chọn — honest-note H21(a)). Lead phiên = Fable 5 ⇒ deep-pass chạy INLINE bởi chính lead (single-context; propose/verify/ghi collapse — mitigation: MỌI finding đều có evidence đĩa/lệnh, không finding nào đứng bằng self-trust).
## taskList snapshot
1 lane single deep-pass (review đối-kháng wave adap S125 + invest trạng-thái repo) → spec-file + checklist cho hmw @Opus 4.8 MAX. (`taskList.length=1 < 3` ⇒ gate hmw.js không cắn — cờ/folder vẫn tạo per §H21① artifact-trace.)
## Bối cảnh wave adap S125 (việc được review)
- `/check-email AI_INFRA`: directed 14/14 đã nhận từ trước, 0 mail mới; fan-out `outbox/all` 65 file → 64 có adap-report, **1 mới**: `phuong-phap-dem-token-tien-de-vong4`.
- `/adap-apply` broadcast mới (type:new NOT-adopt): negative-control tái lập + relabel mislabel-as-real S124 + vá tooling hash-verify + adap-report/-request + email đính chính hub.
- STAGE-2 hygiene: 7 broadcast processed move root→`inbox/ai_infra/`.
## Ground-truth đã verify (evidence từng dòng)
1. **Hash broadcast:** false-TAMPER ban đầu do **verifier SE hỏng** (PS 5.1 `Get-Content -Raw` decode UTF-8-no-BOM bằng ANSI → mojibake `Phương-pháp…``07238c8d…` ≠ declared) — chẩn bằng: sibling known-good CŨNG fail (loại file-specific) + git hub 1-commit/worktree-sạch (loại tamper-sau-publish) + chạy chính `AI_INFRA\scripts\stamp_verify.py`**OK canonical `e0bb5bbf…` exit-0**. Byte-safe re-hash: reply-wave-s122 `7fca0deb…` MATCH + 3 outbound SE 3/3 MATCH (stamping SE lành, chỉ verify-path hỏng).
2. **Negative-control (3 probe scratchpad 150.000 chars):** `'a'`-lặp → notice "150,006 tokens" ~1,0/char · `'x'`-lặp → **150,006 Y HỆT** (content-independent) · mixed-ASCII → 143,251 ~0,955/char ⇒ notice-N = **heuristic họ-đếm-ký-tự = CẬN-TRÊN**, không phải tokenizer (tokenizer thật nén lặp ≪0,1/char). Caveat: ASCII-only n=3; offset +6 chưa truy nguồn.
3. **Relabel:** STATUS:41 · HANDOFF:5 ×2 · do-token report +ADDENDUM · reviewer MEMORY +correction. Math re-verify: 124.503/4=31.126 ✓ · 31.126/380K=8,2% ✓ · 70.892/380K=18,7% ✓ · tổng [46K103K]=[12,227,1]% ✓ · 70.892/124.503=0,569≈0,57/byte ✓. Sweep cùng-lớp: KHÔNG còn floor-sống "token thật/real-token/đo được" gắn notice-count ngoài context đã-sửa (17 hit còn lại = frozen evidence/quote-corrected/generic-VN "đo được" acceptance-wording).
4. **2 command vá:** `check-email.md:17` + `send-email.md:28` → byte-safe formula + CẤM `Get-Content -Raw` + verifier-suspect-first. Verify hiển thị `` escape (3 lần Edit đầu FAIL vì pipeline sinh-chữ render escape→ký-tự-BOM-thật; fix build-from-codepoint `[char]0x5C`+'uFEFF' — bẫy tooling đáng nhớ).
5. **Email hub `2026-07-16-…dinh-chinh-token-label-hash-verify`:** stamp `6f5f7937…`**EDIT chính-xác-hoá nguồn** (near-miss tự bắt: suýt claim "snippet hub dùng Get-Content -Raw" — mở hub `check-email.md:18` thì snippet **để HỞ decode** (`$txt` không định nghĩa) + hub **ĐÃ CÓ** script-verify s76 `check_email_pull.py`:31 — sửa cả email + adap-request sang khung "pin-decode fallback + nhân tuyến script sẵn-có", KHÔNG nhận vơ) → **RE-STAMP `58f5afd8…`** + `_index` sync + selftest `stamp_verify.py` **exit-0 ×2** (trước & sau edit — không để stamp-then-edit sống).
6. **FYI hub:** `do-token` + `h17-cadence-bookend` publish **thiếu content_sha256** (script hub: NO-DECLARED-SHA) — trái adap-broadcast bước 5 / G-024/E-025.
7. **STAGE-2:** `git mv` 7 file → `inbox/ai_infra/`; root còn `README.md` (backlog audit sạch). 7/7 có adap-report (dedup-key check từng cái).
## Invest — trạng-thái repo (probe S125)
- **auto-memory:** 50 file TRACKED + 0 porcelain ⇒ **R6 git-track ĐẠT** (carry usermem thu hẹp còn: runtime-WRITE-path verify sau restart).
- **Agent pin:** 15 file `.claude/agents/` = 14 role (`model: opus` 14/14 + `effort: max` 14/14) + README.md (không frontmatter — benign).
- **6 product carries owner-held:** uat-s117 · pe-phanquyen · bvaau · binh-le · tra-bui · account-trung — **6/6 CÒN trong HANDOFF** (0 rớt).
- **H24:** counter=4 (tick S125 content-addressed HEAD `3aacdf9`), last light+deep@3, cadence 6/15/3 ⇒ **chưa tới nhịp**, 0 class repeat ≥3.
- **all-inherit residue:** `fable-real.md:37` floor-sống STALE (file KHÔNG nằm trong sync-list S124 = gap thật) + `fable-clone.md:43` residual-asym trong-file (:57 đã update, :43 sót) → **CẢ 2 VÁ S125**. `session-start.md:52` + `hmw.js` comments = lineage/so-sánh hợp lệ (GIỮ). Sweep repo-rộng còn lại → giao Opus (spec B1).
- **Stop-hook wal-flush:** KHÔNG fire per-turn phiên này (HEAD đứng `3aacdf9` suốt phiên) — dirt 22 rows đợi commit chủ-động.
- **Dirt phân loại:** 5 pre-session (self-compact monitor S125-start: harvest-curator/tooling-auditor MEMORY+archive + counter tick) + 17 session-work (relabel/report/request/email/move/vá) — TẤT CẢ thuộc commit S125, 0 lạ.
## Verdict
**PASS-WITH-SELF-FIXES** — 2 near-miss tự bắt trong lượt (false-tamper→verifier-RCA · source-claim→mở-file-nguồn), cả 2 sửa TRƯỚC khi ra ngoài. 0 finding tồn chưa xử ở phần đã làm; phần còn lại = spec checklist (restart-dependent + owner-gated + fan-out) → `spec-adap-review-s125-16-07-2026.md`.

View File

@ -0,0 +1,40 @@
# spec — adap-review S125 → hmw @Opus 4.8 MAX (16-07-2026)
> H21 spec-file 3-mục. Engine `/fable-real` vai compound anh gõ (reviewer + investigator-codebase) propose → lead verify → lead ghi (phiên này lead=Fable=engine, single-context — honest-note run.md). **Worker phiên sau thực-thi THEO spec này — bơm QUA args/prompt, worker KHÔNG tự Read file** (H21 ④).
## ① Tính-năng / đề-bài
Xử lý phần còn lại của mạch adap-wave S125 (đã xong: adap `phuong-phap-dem-token` + relabel cận-trên + vá hash-verify byte-safe + email đính chính hub + STAGE-2 hygiene — evidence: `run.md` cùng folder). Phần còn lại chia 3 lớp: **(A) runtime-verify chỉ làm được SAU RESTART** (frontmatter/settings mới ăn), **(B) fan-out + closeout** phiên Opus 4.8 MAX làm, **(C/D) owner-gated + deferred** — surface, KHÔNG tự làm.
## ② Cách implement
Phiên kế: anh restart Claude Code → `/model` Opus 4.8 MAX (lead owner-choice, floor mtv3) → `/tiep` (đọc WAL → verify ground-truth → nối mạch — đây CHÍNH LÀ pilot H22 resume đổi-model, ghi kết quả D5). Chạy **NHÓM A trước** (A1 độc lập, quyết định /fable-real còn sống không), rồi **hmw fan-out NHÓM B** (scaffold `runs/<id>/` @P1 + `args.run` — ≥3 task ⇒ run-trace BẮT BUỘC sàn H22; spec này bơm qua args). C/D chỉ surface trong báo cáo cuối + closeout.
## ③ Checklist (vai · deliverable · acceptance ĐO ĐƯỢC)
### NHÓM A — restart-runtime verify (làm ĐẦU phiên, trước fan-out lớn)
- [ ] **A1 · H23-precedence test** `[carry:h23-fable-test-postrestart]` · vai: em-main + 1 spawn hmw `tier:'fable'` · deliverable: dòng model THỰC-TẾ resolve (`scripts/spawn-model-audit.ps1` per `session-start.md:52`) ghi vào run-folder · acceptance: **1 trong 2 chữ**: `fable` (spawn thắng ⇒ `/fable-real` SỐNG) hoặc `opus` (frontmatter thắng ⇒ `/fable-real` NO-OP → surface anh re-pin) + **báo hub** (đã hứa s124-report §3).
- [ ] **A2 · worker-tier-pin runtime** · vai: em-main · deliverable: spawn-model-audit ≥1 worker KHÔNG tier override · acceptance: resolve = `opus` (pin ăn thật, không còn inherit-lead).
- [ ] **A3 · autoMemoryDirectory WRITE-path** · vai: em-main · deliverable: 1 memory write mới sau restart · acceptance: file mới xuất hiện dưới `.claude/auto-memory/` (git-track ĐÃ ĐẠT S125: 50 tracked/0 dirty — chỉ còn WRITE-path).
### NHÓM B — hmw fan-out @Opus MAX + closeout
- [ ] **B1 · Sweep "all-inherit" floor-sống repo-rộng** · vai: investigator-codebase (quét) + em-main (vá) · deliverable: bảng hit → phân loại floor-sống/lineage (S125 đã vá `fable-real.md:37` + `fable-clone.md:43`; đã xác minh lineage-OK: `session-start.md:52`, `hmw.js` comments) · acceptance: grep `all-inherit` trên tracked .md (TRỪ frozen: `runs/` · `sessions/` · `outbox/` · `inbox/` · `archive/` · adap-reports lịch-sử) → **0 floor-sống**; lineage GIỮ nguyên.
- [ ] **B2 · Verify memory `project_harness4` body** · vai: em-main · deliverable: đọc body file memory · acceptance: body khớp worker-tier-pin S124 (index ĐÃ đúng; carry (c) HANDOFF đóng được nếu khớp).
- [ ] **B3 · Retier-megaline** `[carry:retier-megaline]` 🔒 OWNER · vai: em-main soạn · deliverable: 1 trang phương án tách/re-tier mega-line STATUS/HANDOFF dùng số DẢI mới ([1227]% CẬN-TRÊN — KHÔNG "27% đo được") + trade-off · acceptance: anh chọn 1 (giữ/tách/re-tier); **KHÔNG tự đổi**.
- [ ] **B4 · memory-budget.json:74 wording** 🔒 OWNER · vai: em-main · deliverable: diff 1-dòng `"real-token headroom"``"cận-trên (heuristic notice) headroom"` · acceptance: anh gật mới apply (config anh ký mark `…01-58-01`).
- [ ] **B5 · Closeout GỘP S125+S126** · vai: em-main + monitor H1/H2 · deliverable: STATUS Recently-Done + HANDOFF brief (tiering giữ 2-3 session) + session-log `2026-07-16-S125-S126-…` + memory-flush roster + harvest-gate 5-trục + re-stamp **đủ 8 carry anh** (6 product + 2 governance) · acceptance: session-end checklist PASS + porcelain 0 sau commit.
- [ ] **B6 · Hub follow-up** · vai: em-main · deliverable: `/check-email AI_INFRA` — xử reply đính-chính + kiểm 2 broadcast được re-stamp chưa (`stamp_verify.py` hết NO-DECLARED-SHA?) + README §32/fallback-snippet fix chưa · acceptance: adap-report/-request update theo thực-tế trả lời (KHÔNG stamp trước khi hub làm).
### NHÓM C — product carries (owner-held — CHỈ re-stamp visibility, anh quyết chạy cái nào)
- [ ] **C1C6:** `uat-s117` · `pe-phanquyen` · `bvaau` · `binh-le-decision` · `tra-bui-relogin` · `account-trung` — S125 verified **6/6 còn trong HANDOFF** · acceptance closeout: đủ 6 sau re-stamp, 0 rớt. (+ Export PDF pending — chờ anh xếp lịch.)
### NHÓM D — deferred / notes
- [ ] **D1** Monthly drift audit — hạn kế **2026-08-01** (chưa tới; S96 chạy 07-01).
- [ ] **D2** H24 cadence — light kế @counter 9 (hiện 4) · deep @18 · jump nếu 1 class repeat ≥3 (hiện max 1). Không nợ.
- [ ] **D3** (optional, đợi hub reply) port pattern `check_email_pull.py` s76 SE-side.
- [ ] **D4** (nice-to-have) probe VN-text 150K chars → datapoint #2 gửi hub (đóng caveat ASCII-only).
- [ ] **D5** Ghi kết quả **pilot H22 resume đổi-model** (/pause Fable → /tiep Opus) vào memory `project_h22` + adap H22 (pilot "kill/đổi-acc" pending từ S111).
- [ ] **D6** agent-memory L1 gần trần đọc 24,4KB — ứng viên hook-curate kế (moved-not-cut như S125 inv-cb 23,9→16,9KB): frontend-designer 21,5KB · cicd-monitor 20,9KB · reviewer 19,9KB · test-specialist 19,1KB.
### Điều-kiện dừng / an-toàn
- KHÔNG đổi budget-SỐ, KHÔNG store_memory từ sub, single-writer B3 giữ nguyên. Mọi item 🔒 OWNER = surface + chờ, không execute. Sau NHÓM B: `/pause` (đúng đề-bài anh S125).