[CLAUDE] Docs: S146 closeout — session-model 3 owner-decision + hook 4-path + H24 auto
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m25s

Ap spec-apply-hub-s145-v2 (5 axis, governance-only: 0 prod-code, 0 migration).
Workflow S145 chet giua chung -> /tiep §4 relaunch-cat-gon wf_3d803740-41d 3/3 DONE.

Owner-decision @S146:
- session_ctx_kb = 64 TUONG-MINH (giu nguyen caveat ghost-wire: 0 reader)
- session-model: scaffold IDEMPOTENT (tach cap-SO vs tao-THU-MUC) · closed.md WIRE
  (session-end §6.3-bis) · V2 AUTO (go cong NGUOI, GIU cong NHIP 6/15/3)

Landed: C7 §N.8 predicate 4-ve · hook wal-flush.ps1 4 path (+.claude/sessions/)
· San-3 tin-hieu ⑤ + ORPHAN-L · D2 KIEM end-only · §L.c completeness-gate co RANG.
LIVE-VERIFY hook 4-path PASS repo THAT (da7ee8a). Session-model chay TRON VONG dau
tien: pause-S146 -> resume-S146 -> ORPHAN-L can so.

H24 force-fire (P=8 pause >= 1, luat auto moi): 2 vai + h24-audit -> 7 FLAG, va het:
- sweep-consent sot 6 site (h24-audit.md:4 = frontmatter description)
- closed.md wired-but-declared-unwired (ghost-wire CHIEU NGUOC)
- owner-decision [7] BI GHI DE do tai-dung slot-index -> mat uy-quyen push
3/3 vai lane-H24 garble #53: ghi-dia-SOM cuu tron, ghi-MUON mat trang.

So: orphan run-folder 3->0 · carry 14->20 (co tag [carry:*]) · +E-013 +E-014
error-ledger · +memory feedback_absence_looks_like_clean · .gitignore +lock file.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-07-23 00:16:37 +07:00
parent a1e2416f37
commit 8b6df0a396
86 changed files with 5683 additions and 113 deletions

View File

@ -1,6 +1,6 @@
---
description: /fable-clone <vai> <đề-bài> — ENGINE-ĐẮT LỆNH-B per-invocation (H21): vai anh GÁN chạy ENSEMBLE tier-2-mạnh-nhất (N lane đa-lăng-kính CÙNG 1 VAI qua hmw.js parallel + em-main refute+synthesize) cho đề-bài đó — KHÔNG marker, KHÔNG mode persist. Thiếu/sai vai → em main hỏi lại anh 1 dòng, KHÔNG tự chọn. Cặp /fable-real.
argument-hint: <vai roster 17> <đề-bài phán-quyết> — vd "reviewer rà commit X" · "investigator-codebase truy bug Y"
argument-hint: <vai roster> <đề-bài phán-quyết> — vd "reviewer rà commit X" · "investigator-codebase truy bug Y"
---
# /fable-clone — ENGINE-ĐẮT LỆNH-B: 1 vai × ENSEMBLE tier-2 (per-invocation, H21)
@ -15,10 +15,10 @@ argument-hint: <vai ∈ roster 17> <đề-bài phán-quyết> — vd "reviewer r
- **`/fable-clone <vai> <đề-bài>`** = vai anh gán chạy **ENSEMBLE tier-2-mạnh-nhất** = **N lane đa-lăng-kính CÙNG 1 VAI** (qua HMW `parallel`) + em-main **refute + synthesize** (P3/P4) = "bản sao Fable". Rẻ quota top-model, giữ tầng phản-biện chống-đồng-thuận-sai.
- **Hiệu-lực CHỈ lượt đó** — **KHÔNG còn "về mặc-định"**, KHÔNG marker, KHÔNG persist (H19 mode thật/ảo đã retired H21). Lượt sau muốn ensemble = gõ lại lệnh.
## 🔴 Vai BẮT BUỘC ∈ roster 17 (H21 ②)
`investigator-codebase` · `investigator-api` · `implementer-backend` · `implementer-frontend` · `frontend-designer` · `database-agent` · `office-document` · `test-specialist` · `reviewer` · `cicd-monitor` · `tooling-auditor` · `harvest-curator` · `lead-view-auditor` · `lead-omission-auditor` · **`harness-eval` · `harness-refine` · `harness-audit`**.
## 🔴 Vai BẮT BUỘC ∈ roster (canonical → STATUS §Sub-agents; B1 — KHÔNG hardcode số) (H21 ②)
`investigator-codebase` · `investigator-api` · `implementer-backend` · `implementer-frontend` · `frontend-designer` · `database-agent` · `office-document` · `test-specialist` · `reviewer` · `cicd-monitor` · `tooling-auditor` · `harvest-curator` · `lead-view-auditor` · `lead-omission-auditor` · **`harness-eval` · `harness-refine` · `harness-audit`** · **`tooling-harvest-audit` · `h24-audit` · `sleep-audit`** (round-KIỂM ×3 S145).
- **Thiếu `<vai>` HOẶC vai ngoài roster** → em main **hỏi lại anh 1 dòng**, **KHÔNG tự chọn vai**.
-**VALID_ROLES đủ roster** — canonical đếm ở [`docs/STATUS.md`](../../docs/STATUS.md) §Sub-agents (B1 derived-trỏ-canonical; **KHÔNG chép số ở đây khi roster đổi** — đó chính là class `view-stale-role-desc``lead-view-auditor` soi). Lịch-sử: 10→12 (S110, +2 monitor `tooling-auditor`/`harvest-curator`) → 12→14 (S121 W2, +2 monitor H24 `lead-view-auditor`/`lead-omission-auditor`) → **14→17 (S141, +3 trio-memory `harness-eval`/`harness-refine`/`harness-audit` — read-only INFORM-only, TUẦN TỰ eval→refine→audit)**. *(🧊 limitation cũ 10-vai + H6-design "monitor ngoài workflow" superseded; monitor vẫn INFORM-only, lane RETURN-only.)*
-**VALID_ROLES đủ roster** — canonical đếm ở [`docs/STATUS.md`](../../docs/STATUS.md) §Sub-agents (B1 derived-trỏ-canonical; **KHÔNG chép số ở đây khi roster đổi** — đó chính là class `view-stale-role-desc``lead-view-auditor` soi). Lịch-sử: 10→12 (S110, +2 monitor `tooling-auditor`/`harvest-curator`) → 12→14 (S121 W2, +2 monitor H24 `lead-view-auditor`/`lead-omission-auditor`) → **14→17 (S141, +3 trio-memory `harness-eval`/`harness-refine`/`harness-audit` — read-only INFORM-only, TUẦN TỰ eval→refine→audit)****17→20 (S145, +3 round-KIỂM `tooling-harvest-audit`/`h24-audit`/`sleep-audit` — C4/C4b TÁCH mỗi-vòng-1-con, AUTO fire-after-measure)**. *(🧊 limitation cũ 10-vai + H6-design "monitor ngoài workflow" superseded; monitor vẫn INFORM-only, lane RETURN-only.)*
- 🔒 **Honest-note (a/b):** bảo-đảm = **owner-gated tầng lệnh + kỷ-luật lead**, **KHÔNG code-enforced**; lệnh/alias = cách anh **gán vai nhanh**, hệ **KHÔNG tự chọn vai**.
## 🔴 Spec-file 3-mục BẮT BUỘC mỗi run (H21 ①)
@ -39,6 +39,45 @@ Trước khi gọi Workflow `hmw`, lead **PHẢI** @P1:
**Thiếu cờ + ≥3 task ⇒ `hmw.js` THROW (STOP-HARD), KHÔNG fail-soft.** Vì sao gate: script chạy JS-sandbox **KHÔNG filesystem** ⇒ tự nó không tạo được folder ⇒ trước S121 sàn này chỉ là **kỷ-luật người** (đo thật @S119: `git grep args.run .claude/commands/` = **0 hit** ⇒ 4/4 wrapper KHÔNG cờ ⇒ sàn danh-nghĩa). Hậu-quả thật khi thiếu: chết giữa run ⇒ **per-turn returns mất theo phiên, chỉ file trên đĩa sống sót**`/tiep` §4 không có vật-liệu cắt-gọt ⇒ chạy lại TỪ ĐẦU (S118 raw-Agent 7-spawn ⇒ 0 run-folder).
🔸 **Khai thật:** gate chỉ phủ đường `hmw.js`. Ngưỡng *"hoặc ước >5 phút"* **KHÔNG cơ-khí-hoá được** (script không đo trước thời-lượng) ⇒ phần đó vẫn là kỷ-luật lead. **raw `Workflow`/`Agent` tool = kẽ CÒN-LẠI**, đi thẳng không qua file này ⇒ mất writeGuard + run-trace.
## 🔴 ĐÓNG GÓI LANE THEO TRẦN LƯỢT (C2 — adap đợt-11 S144, có repro)
**Sự cố gốc `wf_491c05a8-6dc` (2026-07-22):** 5 lane `investigator-codebase` (`maxTurns: 20`) — **3 CHẾT, ~490K token đốt, 0 sản phẩm**.
Đo từ transcript: lane **sống** dùng 21/23 tool-use · lane **chết** dùng 28/34/35 ⇒ cháy lượt **khi vẫn đang đọc**, chưa tới bước ghi.
🔴 **Cơ chế phạt NGƯỢC ĐỜI:** lane càng cẩn thận càng chắc chết. Lỗi ở **LỆNH của lead**, không ở lane — lead giao lane-5 **mười file** với trần 20 lượt.
**3 luật đóng gói (áp mọi `/fable-clone` từ nay):**
1. **≤3 file/lane.** Lane phải đọc nhiều hơn ⇒ **tách lane**, đừng nới việc.
🔸 Số 3 = **AI tự đặt, đảo được** (không phải số owner).
2. 🔴 **ÉP GHI KHUNG RỖNG Ở LƯỢT 1-2** — trước khi đọc bất cứ gì. Rồi append dần.
*Vì sao "dặn ghi sớm" KHÔNG đủ:* prompt run-hỏng **đã** ghi *"ghi NGAY khi tìm ra từng cái"*, lane vẫn tự xếp việc ghi **sau** việc đọc ⇒ "ngay" của lead rơi **sau** vạch chết.
**Bằng chứng đối chứng:** run review `wf_301d3943-144` đổi đúng chỗ này (ép khung rỗng lượt 1-2, `maxTurns: 25`) ⇒ **3/3 lane sạch, 0 chết**. Cùng harness, cùng model, khác **thứ tự ghi**.
3. **Nêu trần lượt NGAY ĐẦU prompt** + phân bổ gợi ý (đọc → verify → chốt), để lane tự lượng sức.
**Acceptance (đã siết theo R3 — bỏ đếm-chữ):**
-**KHÔNG** dùng `grep -c 'trần lượt'` làm tiêu chí (gõ đúng cụm chữ là đạt = Goodhart thuần).
- ✅ Đo ở **run KẾ**: 0 lane chết.
- 🔸 **Khai hạn chế thật:** `hmw.js` C1 chỉ biết lane trả `null`, **KHÔNG phân biệt được NGUYÊN NHÂN** ⇒ mệnh đề *"chết vì cháy lượt"* hiện **chưa đo được bằng máy**, phải mở transcript đếm tool-use.
## 🔴 KHUÔN LABEL 4 THÀNH-PHẦN (C3 — `spawn-label:22-27`, BINDING)
Mọi spawn (Agent-tool `description` · `hmw` `label` · monitor · cổng review) mang đủ **4 thành-phần**:
```
{nhóm|Vòng-N|Core|Gate|WF} {vai} {pha/wave} s{N}
```
Ví dụ đang chạy: `Gate reviewer anchor s144` (24 ký tự) · `Vòng-3 harness-eval w1 @start s144`.
- **Vừa panel** ~≤40 ký tự; xung đột thì **đủ-thành-phần thắng ngắn-gọn** (`:25`).
- **Một khuôn duy nhất** toàn repo (`:26`).
- **Áp từ phiên kế** (`:51`) — spawn trước đó **giữ nguyên làm vết, KHÔNG sửa lùi** (khuôn hub `:43`).
**Acceptance (siết theo R3 — thêm control + neo artifact):**
-**Negative-control**: cắm 1 label thiếu {pha·phiên} → phép đọc-lại **PHẢI TRƯỢT**. Không trượt = thước mù.
-**Neo artifact**: label phải xuất hiện trong `runs/<id>/run.md` — panel là **ephemeral**, `grep` không truy được ⇒ không neo thì không tái lập, không audit được.
- ❌ Bỏ tiêu chí "chọn 3 task nói được {ai·gì·nhịp·phiên}" **đứng một mình** — đó là **tự chấm chính label mình vừa viết**, n=3, không artifact.
## 🔴 Guard ensemble (§K engine — 3 floor-fidelity)
- **ảo-ensemble = N lane CÙNG 1 vai phán-quyết** (multi-lens trên 1 vai), **KHÔNG** mixed-roster fan-out (`hmw.js` VALID_ROLES = **roster đầy-đủ**, canonical → [`docs/STATUS.md`](../../docs/STATUS.md) §Sub-agents; KHÔNG gate vai — worker-tier-pin S124 **che** leak qua frontmatter `opus` (xem :57), hết thời all-inherit ăn-theo-lead).
- **N lane RETURN-only**; em-main **single-writer** (B3) ghi **1 MEMORY entry** đúng vai đó + **gắn nhãn engine đã dùng** (hmw SCHEMA `memoryDelta` KHÔNG field engine → em-main stamp @P3 harvest).