[CLAUDE] Infra: W2 GOP-1-COMMIT - San-1 gate + PA-2a + roster 12->14 (2 monitor H24) + h24_cadence + counter + STATUS 2 row

Wave adap-6-broadcast W2 = 1 OWNER / 1 COMMIT co chu dich. Cac manh phu-thuoc nhau, tach ra la vo
duong dang chay (R2-C3): gate o W2 ma co o W3 => moi /fable-clone >=3 lane THROW ngay truoc khi W3 kip va.

(1) hmw.js - 1 EDIT, 4 viec
    - SAN-1 GATE co-khi-hoa: taskList>=3 && !args.run => THROW STOP-HARD.
      Truoc S121 san nay chi la CHU trong doc ("script no-fs KHONG tu ep") => phu thuoc lead NHO.
      Do that @S119: git grep args.run .claude/commands/ = 0 hit => 4/4 wrapper KHONG co => san danh-nghia.
      Vi sao >=3: chet giua run dai ma khong co runs/<run-id>/ => per-turn returns mat theo phien,
      CHI file tren dia song sot => /tiep §4 khong co vat-lieu cat-got => chay lai TU DAU (S118
      raw-Agent 7-spawn => 0 run-folder). THROW chu khong fail-soft (fail-soft = dut am-tham).
    - VALID_ROLES 12->14 (+lead-view-auditor +lead-omission-auditor).
    - PA-2a: TIER2_EXPECTED_FULL_ID = 'claude-opus-4-8'. La HANG-SO KHAI-BAO, KHONG phai co-che neo
      (neo-tai-spawn bat-kha-thi: param chi nhan alias; SE 0 full-id vi H8 all-inherit). Doc boi
      scripts/spawn-model-audit.ps1 (W1b) - thieu hang-so => script FAIL-LOUD.
    - H23 note CHUA-VERIFY giu nguyen nac: precedence spawn-param vs frontmatter khi CA HAI hien-dien
      = CHUA TUNG TEST; phan-biet duoc CHI o phien lead=Fable => DEFER, khong ban qua nac. + fix#8a chua thu.

(2) 4 co wrapper CUNG COMMIT voi gate (San-1 (c))
    fable-clone.md / fable-real.md / ultra-on.md => args.run: 0 -> 3 hit.
    Wrapper thu 4 = raw-invoke em-main: KHONG co file de gan co => duoc GATE chan truc tiep
    (chinh cu fault-inject duoi day di duong do). Khai that: gate chi phu hmw.js; nguong "hoac uoc
    >5 phut" KHONG co-khi-hoa duoc (script khong do truoc thoi-luong) => van la ky-luat lead;
    raw Workflow/Agent tool = ke CON-LAI khong gate duoc.
    + go so roster stale (view-stale-role-desc): "roster 12"/"12 sub"/"8-agent"/"9-agent" -> tro
    canonical docs/STATUS.md §Sub-agents (B1). session-start.md con "roster 12" = W3 so-huu, KHONG dung.

(3) 2 vai MOI - H24 §2(1), cookie-cutter frontmatter monitor san
    lead-view-auditor  = view LECH source (5 class view-*)
    lead-omission-auditor = cai BI THIEU (5 class gap-*)
    model:inherit / memory:project / maxTurns:18 / 8 tool read-only / NO Write-Edit / propose-only.
    KHONG gop vao tooling-auditor(H1)/harvest-curator(H2): H24 "gop la mat tieu-diem; can cap mat
    CHI danh cho lead". Tu-vung view/omission chon tranh va-cham (detectors:15 da so-huu
    derived-staleness; GAP qua-tai). 2 file 0-CR + block-scalar (giu ': ' N/A).

(4) memory-budget.json - single-source H24 §2(3)
    h24_cadence { light_every:6, deep_every:15, jump_on_class_repeat:3 } (anh chot Q2).
    lead_self_audit.flag_classes = enum DONG 10 class (5 view-* + 5 gap-*) - vai CAM tu che class
    (v2 M4: enum song trong dau 1 lane => worker khong bao gio thay => tu che => loang thong-ke).
    Honest-caveat giu de bao hub: hub dan "dung chep 3 con-so nay"; SE chon trung 6/15/3 = anh chot
    CO CHU-DICH lam khoi-diem, KHONG phai chep vo-thuc; re-tune sau chu-ky-2.

(5) .claude/governance/.session-counter.json (NEW) - seed UNTICKED trung thuc
    Content-based (idempotent-key = HEAD sha), KHONG blind-increment: hook wal-flush auto-commit
    agent-memory/ MOI TURN => dem mu se vo nghia. Dat o .claude/governance/ CO CHU-DICH = ngoai
    3 path hook (.claude/WAL.md, agent-memory/, workflows/runs/) => khong bi quet vao commit wal:.
    counter=0 + last_ticked_*=null = SU THAT tai S121 (nghi-thuc tick land o W3); seed tick gia
    se lam phep do cadence dau tien noi doi - dung thu H24 sinh ra de bat.

(6) STATUS.md 2 row - CUNG LANDING roster (R3-M2: lech => detector BAO tren chinh thay doi cua H24)
    | Sub-agents | 12 -> 14 |
    | Policies | 216 | ROW MOI - GAP-3 can no de resolve token 'policy'.
    216 GROUND TU MA NGUON, khong chep tu spec: |MenuKeys.All| x |MenuKeys.Actions| = 54 x 4
    (Program.cs:82-89 AddPolicy loop; MenuKeys.cs:167 Actions=[Read,Create,Update,Delete]).
    => Policies la DERIVED = Menu keys x 4 => 2 row BUOC doi cung nhau (ghi thang vao row).

VERIFY LEAD TU DO (khong tin return):
  14/14/14 (roster / VALID_ROLES / agents-*.md tru README) = acceptance ② EOL.
  Glob tho = 15 => xac nhan R2-C1: acceptance CU "ls agents/*.md = 14" se FAIL tren impl DUNG.
  Hop-dong cheo W1<->W2 khep CA HAI chieu, do bang chinh script W1:
    detector H24-2: "h24_cadence missing" -> "M = h24_cadence.light_every = 6 (read from config)"
    spawn-model-audit: "expected constant missing" -> "[OK] expected = claude-opus-4-8 = owner-ratified"
    GAP-3 policy: MISSING -> 216, va BAT NGAY permission-matrix/SKILL.md:3 "writes 240 policy but
      canonical=216" (+:81 "writes 48") => TOTAL 49->50 (-1 fail-loud cadence, +2 policy) = so cong khop.
  eol-check tu nhan 2 vai moi: scoped 37->39 (dem bang glob, khong hardcode).
  FAULT-INJECT SAN-1 2 CHIEU (bai hoc W0.3: chi test 1 chieu thi dieu-kien viet nham van PASS):
    (b) 3 task + KHONG args.run -> THROW, agent_count=0, subagent_tokens=0, 14ms (chan TRUOC spawn)
    (a) 2 task + KHONG args.run -> gate IM, workflow launch binh thuong => khong over-fire, nguong
        dung la >=3. Neu viet nham `if (!wave)` thieu nguong thi /fable-real 1-lane se chet oan.

CHUA VERIFY (khai that, KHONG gia vo):
  14/14 spawn-probe SONG = PHAI chay SAU RESTART (registry = anh-chup khoi-phien; S120+S121 da do
  2 lan xac nhan KHONG hot-reload agent MOI). Static-check KHONG du (broadcast ④d).
  => 2 vai moi hom nay moi chi TON TAI tren dia + trong VALID_ROLES, chua chung duoc SPAWN duoc.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-07-15 13:04:21 +07:00
parent d07bbb98c5
commit 00a1c67e55
9 changed files with 296 additions and 14 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 12> <đề-bài phán-quyết> — vd "reviewer rà commit X" · "investigator-codebase truy bug Y"
argument-hint: <vai roster 14> <đề-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 12> <đề-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 12 (H21 ②)
`investigator-codebase` · `investigator-api` · `implementer-backend` · `implementer-frontend` · `frontend-designer` · `database-agent` · `office-document` · `test-specialist` · `reviewer` · `cicd-monitor` · `tooling-auditor` · `harvest-curator`.
## 🔴 Vai BẮT BUỘC ∈ roster 14 (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`.
- **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 12 (S110 anh-directed):** 2 monitor `tooling-auditor` · `harvest-curator` đã bổ sung vào `hmw.js` VALID_ROLES (10→12) — lệnh-B dùng được trọn roster. *(🧊 limitation cũ 10-vai + H6-design "monitor ngoài workflow" superseded điểm này; monitor vẫn INFORM-only, lane RETURN-only.)*
-**VALID_ROLES đủ roster 14** — 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`)**. *(🧊 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 ①)
@ -30,8 +30,17 @@ Mỗi lần chạy engine-đắt PHẢI kết-tinh 1 spec theo pipeline **propos
- 🔒 **Honest-note (c):** file spec do **LEAD ghi SAU khi verify** — engine KHÔNG tự ghi.
- 🔒 **Honest-note (d):** run **chấm/verify CŨNG sinh spec-file** (kế-hoạch xử issue = "cách làm" cần kết-tinh).
## 🔴 Cờ `args.run` — RUN-TRACE BẮT BUỘC khi ≥3 lane (Sàn-1 H22, cơ-khí-hoá S121 W2)
🔴 **`/fable-clone` ensemble hầu như LUÔN ≥3 lane** (run S119 = 5 lane) ⇒ **cờ này gần như LUÔN bắt buộc**.
Trước khi gọi Workflow `hmw`, lead **PHẢI** @P1:
1. Scaffold `.claude/workflows/runs/<run-id>/` (TRACKED) + `run.md` kèm **`## taskList snapshot`**.
2. Truyền `args.run = { name:'<run-id>', dir:'.claude/workflows/runs/<run-id>' }`.
**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.
## 🔴 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 = **12 vai** đủ roster từ S110; KHÔNG gate vai — all-inherit **che** leak tới khi Fable về + phân-tầng).
- **ả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 — all-inherit **che** leak tới khi Fable về + phân-tầng).
- **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).
- **Một vai = một trí-nhớ** dù N lane (chống AS-10 fragment N-lane).

View File

@ -1,6 +1,6 @@
---
description: /fable-real <vai> <đề-bài> — ENGINE-ĐẮT LỆNH-A per-invocation (H21): vai anh GÁN chạy 1 LẦN SINGLE top-model THẬT (Fable 5; outage → single-Opus-1M/run) deep-pass cho ĐÚNG đề-bài đó, hiệu-lực CHỈ lượt đó — 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-clone.
argument-hint: <vai roster 12> <đề-bài phán-quyết> — vd "reviewer rà-soát commit X" · "investigator-codebase truy nguồn bug Y"
argument-hint: <vai roster 14> <đề-bài phán-quyết> — vd "reviewer rà-soát commit X" · "investigator-codebase truy nguồn bug Y"
---
# /fable-real — ENGINE-ĐẮT LỆNH-A: 1 vai × SINGLE top-model deep-pass (per-invocation, H21)
@ -16,8 +16,9 @@ argument-hint: <vai ∈ roster 12> <đề-bài phán-quyết> — vd "reviewer r
- **`/fable-real <vai> <đề-bài>`** = vai anh gán chạy **1 LẦN top-model THẬT** (sâu nhất, đắt nhất) cho ĐÚNG đề-bài đó. Fable up = single-Fable; Fable **outage** (H5, lỗi `"Model isn't available"`) = single-**Opus-1M** fallback **theo từng lần chạy** (KHÔNG mode toàn-cục).
- **Hiệu-lực CHỈ lượt đó** — hết lượt là hết. KHÔNG marker, KHÔNG persist. Lượt sau muốn engine-đắt = gõ lại lệnh.
## 🔴 Vai BẮT BUỘC ∈ roster 12 (H21 ②)
`investigator-codebase` · `investigator-api` · `implementer-backend` · `implementer-frontend` · `frontend-designer` · `database-agent` · `office-document` · `test-specialist` · `reviewer` · `cicd-monitor` · `tooling-auditor` · `harvest-curator`.
## 🔴 Vai BẮT BUỘC ∈ roster 14 (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`.
> Số vai canonical → [`docs/STATUS.md`](../../docs/STATUS.md) §Sub-agents (B1 derived-trỏ-canonical). +2 @S121 W2 = 2 monitor H24 lead-self-audit.
- **Thiếu `<vai>` HOẶC vai ngoài roster** → em main **hỏi lại anh 1 dòng** ("engine-đắt cần vai đích-danh — vai nào?"), **KHÔNG tự chọn vai**.
- 🔒 **Honest-note (a):** "không tự chọn vai" = tầng **KỶ-LUẬT owner-gated** (anh phải gõ vai) — **KHÔNG claim code-enforced**.
- 🔒 **Honest-note (b):** lệnh/alias = cách anh **GÁN VAI NHANH**, vẫn phải anh gõ — hệ **KHÔNG tự chọn vai**.
@ -33,9 +34,13 @@ Mỗi lần chạy engine-đắt PHẢI kết-tinh 1 spec theo pipeline **propos
## 🔴 Floor model-tier v3 (broadcast 2026-07-11)
- **Lead = frontier-class do ANH chọn per-session** {Fable 5 | Opus 4.8 — cả hai **1M MAX**}. **CẤM lớp model thấp (Sonnet/Haiku-class) ngồi ghế lead.**
- **Engine-đắt per-invocation = đường DUY NHẤT nâng 1 vai lên hạng-nhất**, chỉ trong lượt lệnh anh gõ. Ngoài lệnh, mọi vai giữ model roster mặc-định (**H8 all-inherit** — cả 12 sub `model: inherit` theo lead).
- **Engine-đắt per-invocation = đường DUY NHẤT nâng 1 vai lên hạng-nhất**, chỉ trong lượt lệnh anh gõ. Ngoài lệnh, mọi vai giữ model roster mặc-định (**H8 all-inherit** — **toàn roster** `model: inherit` theo lead; số vai canonical → [`docs/STATUS.md`](../../docs/STATUS.md) §Sub-agents, B1 KHÔNG chép số ở đây).
- ⚠️ **Lead KHÔNG tự ý gọi engine-đắt****kể cả khi HMW-mode ON**. Engine-đắt chỉ chạy khi anh gõ `/fable-real|/fable-clone <vai> <đề-bài>`.
## 🔴 Cờ `args.run` — RUN-TRACE (Sàn-1 H22, cơ-khí-hoá S121 W2)
Lead **PHẢI** @P1 scaffold `.claude/workflows/runs/<run-id>/` (TRACKED, kèm `run.md` + `## taskList snapshot`) rồi truyền `args.run = { name:'<run-id>', dir:'.claude/workflows/runs/<run-id>' }` khi gọi Workflow `hmw`.
🔸 **Khai thật — ở lệnh NÀY gate hiếm khi cắn:** `/fable-real` = **single deep-pass 1 lane**`taskList.length = 1` < 3 `hmw.js` **KHÔNG throw**. Nhưng cờ vẫn **PHẢI** truyền, §H21 buộc run này **kết-tinh spec-file** vào `runs/<run-id>/` cần run-folder làm **dấu-vết artifact** cho `/tiep` + harvest; nếu lúc lệnh này fan-out 3 thì gate cắn ngay. Đừng đọc "gate không cắn" thành "khỏi cần cờ".
## 🔴 Guard (§K engine — bất-biến)
- **Single deep-pass 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).
- **Một vai = một trí-nhớ** chạy thật/ảo/engine nào (chống AS-10 fragment). Guard ensemble N-lane đầy-đủ (khi cặp `/fable-clone` chạy) §K.

View File

@ -1,5 +1,5 @@
---
description: BẬT HMW-mode SOLUTION_ERP — task LỚN chạy Workflow fan-out (8-agent roster) + sub giữ ký ức slice + verify-before-memory-write (no-overwrite-unverified) + harvest LIỀN sau mỗi workflow. /ultra-off để tắt. Gõ = anh CONSENT chạy Workflow (deliberate on-ramp).
description: BẬT HMW-mode SOLUTION_ERP — task LỚN chạy Workflow fan-out (roster ĐẦY-ĐỦ — số vai canonical ở docs/STATUS.md §Sub-agents, KHÔNG chép số) + sub giữ ký ức slice + verify-before-memory-write (no-overwrite-unverified) + harvest LIỀN sau mỗi workflow. /ultra-off để tắt. Gõ = anh CONSENT chạy Workflow (deliberate on-ramp).
argument-hint: (trống = bật mode · hoặc kèm task lớn đầu tiên)
---
@ -21,8 +21,8 @@ argument-hint: (trống = bật mode · hoặc kèm task lớn đầu tiên)
- **HMW (LỚN):** fan-out nhiều file/nguồn — sweep · audit · cross-stack review · mass migration · multi-source research. Số task THOẢI MÁI (harness queue theo slot, KHÔNG cap cứng) · spawn **ĐÚNG VAI** (`agentType` ∈ VALID_ROLES; role lạ ∉ VALID_ROLES → `hmw.js` THROW STOP-HARD + báo owner (REC-3 2026-07-13); role-less null → inherit lead).
- **Thường (nhỏ):** <30min · 12 file · hỏi-đáp Agent-tool spawn lẻ / solo theo `.claude/agents/README.md` decision-tree, KHÔNG HMW.
## VALID_ROLES (roster SOLUTION_ERP — 12 sub, đủ roster từ S110)
`investigator-codebase` · `investigator-api` · `implementer-backend` · `implementer-frontend` · `test-specialist` · `reviewer` · `cicd-monitor` · `frontend-designer` · `database-agent` · `office-document` (+S107) · `tooling-auditor` · `harvest-curator` (+S110 anh-directed monitor vẫn INFORM-only, lane RETURN-only)
## VALID_ROLES (roster SOLUTION_ERP — số vai canonical → [`docs/STATUS.md`](../../docs/STATUS.md) §Sub-agents, B1 KHÔNG chép số ở đây)
`investigator-codebase` · `investigator-api` · `implementer-backend` · `implementer-frontend` · `test-specialist` · `reviewer` · `cicd-monitor` · `frontend-designer` · `database-agent` · `office-document` (+S107) · `tooling-auditor` · `harvest-curator` (+S110 anh-directed monitor vẫn INFORM-only, lane RETURN-only) · `lead-view-auditor` · `lead-omission-auditor` (**+S121 W2** 2 monitor H24 lead-self-audit, INFORM-only propose-only; class-flag = enum ĐÓNG `lead_self_audit.flag_classes` `.claude/agent-memory/memory-budget.json`, nhịp = `h24_cadence` cùng file)
> Role lạ ∉ VALID_ROLES → `hmw.js` **THROW (STOP-HARD)** + báo owner thêm vai (REC-3 2026-07-13; fail-soft cũ "đứt âm-thầm" đã bỏ); role-less null → inherit lead. Windows MAX_PATH (Dropbox nested) → KHÔNG `isolation:worktree`.
## Quy trình HMW — vai trò từng phase
@ -30,6 +30,7 @@ argument-hint: (trống = bật mode · hoặc kèm task lớn đầu tiên)
|---|---|---|
| **P0** prep | 👤 em main | đọc MEMORY sub liên quan **memory-pack SLICE/vai** (KHÔNG full) + `taskList` + chụp **chunk-count Qdrant baseline** + git status sạch |
| **P1** decide | sub liên quan (full memory) | recommend approach + **acceptance-checklist** em main chốt plan |
| 🔴 **P1-run** scaffold | 👤 em main | **BẮT BUỘC khi `taskList.length ≥ 3`** (Sàn-1 H22, cơ-khí-hoá S121 W2): scaffold `.claude/workflows/runs/<run-id>/` (TRACKED) + `run.md` kèm **`## taskList snapshot`** truyền `args.run = { name, dir }`. **Thiếu cờ + ≥3 task ⇒ `hmw.js` THROW STOP-HARD.** Script chạy JS-sandbox **KHÔNG filesystem** tự không tạo folder được đây lý-do gate nằm em-main chứ không script. Bỏ qua chết giữa run **mất trace** (per-turn returns chết theo phiên; **chỉ file trên đĩa sống sót**) `/tiep` §4 phải chạy lại TỪ ĐẦU thay cắt-gọt. 🔸 Ngưỡng *"hoặc ước >5 phút"* KHÔNG cơ-khí-hoá được phần đó kỷ-luật lead. 🔸 raw `Workflow`/`Agent` tool = **kẽ CÒN-LẠI** không gate được từ đây |
| **checkpoint** (inform) | 👤 em main | BÁO `{số agent · vai · task}` @inform set `args.checkpointApproved=true` fan-out NGAY (marker-ON=consent; anh interrupt nếu sai KHÔNG chờ confirm từng lần) |
| **P2** execute | Workflow `hmw` | fan-out agent: **memory-pack injected** qua `args` + `agentType` + schema. DEFAULT read/analyze; write = file-disjoint. **H8 all-inherit** (S66): role-có-frontmatter inherit top-tier lead · per-task `tier:'opus'` escape-hatch (`tier:'fable'` CHỈ trong lượt lệnh engine-đắt anh H21 S110) |
| **P3** harvest | 👤 em main (single-writer) | **NGAY sau P2** VERIFY delta + APPEND-only vào MEMORY.md **mọi agent tham gia** (B3) |