From 53765b0de341220154757a2167ec436b9baf0ce8 Mon Sep 17 00:00:00 2001 From: pqhuy1987 Date: Wed, 15 Jul 2026 14:59:36 +0700 Subject: [PATCH] [CLAUDE] Infra: W3 file 4-9 - TRI-ACCEPT authority + GAP#6 tier:opus + roster sweep + ACTIVE-MARKS chu-thich MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit FILE 4 fable-clone.md -- GAP#6: lane ensemble PHAI mang tier:'opus'. Thieu => inherit lead => lead=Fable thanh N x Fable = dot quota gap N lan VA pha dung ly-do lenh ton tai (ensemble RE de THAY 1 luot Fable dat). lead=Opus thi tier:'opus' ≡ inherit => loi VO HINH, chi lo khi Fable UP (dung loi reviewer bat @S108). + khai CHUA VERIFY precedence spawn-param vs frontmatter (H23 §2(2)) => DEFER phien lead=Fable. + grep tier:'opus' = DIEU-KIEN CAN, KHONG DU (do CHU trong file, Goodhart-able 100%). FILE 5 agents/README.md -- bo SO khoi 8 cho (khong doi so: doi thi roster ke lai stale). File nay chinh la VI-DU minh-hoa cho class view-stale-role-desc trong lead-view-auditor.md:47. + canh-bao bay glob: `ls .claude/agents/*.md` bat LUON README.md => thua 1 (R2-C1). + khai: doi roster = doi 2 BE-MAT DOC-LAP (agents/*.md -> registry | VALID_ROLES -> agentType). FILE 6 fable-real-runbook.md -- 14 hit (lead bao 8 = SAI, xem duoi). + hmw.js:22-30 -> :22-36 (stale line-ref). FILE 7 sleep-recovery-memory-l2.md -- `all` tu hardcode 9 -> DAN-XUAT TU DIA (do ra 10). Danh-sach cung 9 da ROT office-document (them S107) suot tu do. Tro-treu: chinh doc do da ghi "luon quet dia that" cho con-so 4/9 ngay duoi, nhung hardcode roster phia tren. FILE 8 workflows/README.md -- TRI-ACCEPT vao ORPHAN-AUTHORITY (:19-20) + B1 pointer. FILE 9 ACTIVE-MARKS.md -- chu-thich cho mark RC-...20-42-01 (anh CHOT: giu ban ky nguyen ven, them chu-thich; P4/P8). "roster 12" trong than mark = anh chup luc ky, KHONG phai gioi-han. + STATUS.md:25 -- STALE THAT trong chinh file CANONICAL: row ghi | Sub-agents | 14 | nhung narrative CUNG DONG ghi "ca 12 sub model: inherit" (W2 sua row, bo sot narrative). Bay mega-line TAI HIEN: grep -c = 1 vs grep -o|wc -l = 2. + spec v3-PATCH -- SUA ACCEPTANCE FIX#6 (ban goc BAT-KHA-THI, tien-le WAL:29): "0 hit song" do CA phan CO Y khop => implementation DUNG van truot. Lan thu BA cung ho R2-C1 (ls=14) + R3-M3 (TOTAL>=46). Acceptance moi = disposition TUNG DONG theo 6 nhom. Sweep that sau W3: 14 hit song, 0 cai la stale-can-va (vi-du co chu-dich / trich lich-su / ban da ky / so tam / W5 chua toi luot / canonical history-delta). LEAD TU BAT 2 LOI DEM (deu o truc dem-ve-viec-minh, -> adap-report): (a) bao "fable-real-runbook 8 hit" -- that la 14; lay output `head -40` DA BI CAT lam so tong. (b) bao "do lai tai-hien CHINH XAC du-bao FIX#4" roi lay trung-khop lam cho dua, trong khi CA FIX#4 LAN LEAD deu dang do TEN FILE. Con-so dung, huong do sai. => khop feedback_meta_count_selfcoverage_blindspot: lead DO tot, lead DEM VE MINH thi sai. Co-Authored-By: Claude Opus 4.8 --- .claude/agents/README.md | 23 +++++++++------ .claude/commands/fable-clone.md | 22 +++++++++++++++ .claude/commands/sleep-recovery-memory-l2.md | 15 +++++++--- .claude/governance/ACTIVE-MARKS.md | 6 ++++ .claude/workflows/README.md | 15 ++++++++-- ...ec-adap-6-broadcast-15-07-2026-v3-PATCH.md | 25 ++++++++++++++++- docs/STATUS.md | 2 +- docs/governance/fable-real-runbook.md | 28 +++++++++---------- 8 files changed, 105 insertions(+), 31 deletions(-) diff --git a/.claude/agents/README.md b/.claude/agents/README.md index a7ad737..25ddfa3 100644 --- a/.claude/agents/README.md +++ b/.claude/agents/README.md @@ -1,6 +1,9 @@ -# Multi-agent SOLUTION_ERP — Master Coordination Guide (12-agent) +# Multi-agent SOLUTION_ERP — Master Coordination Guide -> **Architecture:** 12 sub-agents **all-inherit top-tier (Harness-8 2026-06-16 — thay thế two-tier Harness-4)** + em main **Fable 5 (1M) Max** coordinator — **10 product/quality** (7 core + frontend-designer pink S47 + database-agent read-advisory S52 + 📄 office-document S107) + **2 monitor INFORM-only** (`tooling-auditor` H1 + `harvest-curator` H2, 2026-06-07 Harness 1). Tier: **toàn bộ 12 sub `model: inherit`** (ăn top-tier model của lead — **runtime = per-session (Fable ↔ Opus, outage-driven; Fable DOWN → H5-fallback Opus tự-kích revert-free KHÔNG sửa frontmatter, Fable UP → tự về); lịch-sử flip-chain đầy-đủ (S98→nay) = canonical [`docs/STATUS.md` §Sub-agents]** (🔴 S106 gộp 1-chain per anh-confirm — reader này KHÔNG enumerate/cập-nhật mỗi flip; BƯỚC 0.6 probe mỗi phiên xác-định runtime SỐNG, per-session KHÔNG steady-state) · effort **Max** (env machine-wide). SE KHÔNG có lớp helper/gopher rẻ (cả 12 đều substantive memory-bearing → cả 12 lên inherit). *(Trước H8: 4 promote inherit + 7 demote pin `claude-opus-4-8` — lịch sử ở Upgrade 2026-06-10 + S66 dưới.)* +> 🔴 **Số vai canonical → [`docs/STATUS.md`](../../docs/STATUS.md) §Sub-agents. KHÔNG chép số vào file này** (B1 derived-trỏ-canonical). *Bản trước S122 cứng-hoá "12-agent" ở **8 chỗ** trong khi roster đã 14 — đó chính là class `view-stale-role-desc`, và `agents/README` bị lấy làm **ví-dụ minh-hoạ** cho class đó trong [`lead-view-auditor.md`](lead-view-auditor.md). Vá @S122 bằng cách **bỏ số**, không phải bằng cách **đổi số** — đổi số thì roster kế lại stale.* + +> **Architecture:** sub-agents **all-inherit top-tier (Harness-8 2026-06-16 — thay thế two-tier Harness-4)** + em main **lead frontier-class (anh chọn per-session)** coordinator — **10 product/quality** (7 core + frontend-designer pink S47 + database-agent read-advisory S52 + 📄 office-document S107) + **4 monitor INFORM-only** (`tooling-auditor` H1 + `harvest-curator` H2, 2026-06-07 Harness 1 · `lead-view-auditor` + `lead-omission-auditor` H24, **S121 W2**). Tier: **TOÀN BỘ sub `model: inherit`** (ăn top-tier model của lead — **runtime = per-session (Fable ↔ Opus, outage-driven; Fable DOWN → H5-fallback Opus tự-kích revert-free KHÔNG sửa frontmatter, Fable UP → tự về); lịch-sử flip-chain đầy-đủ (S98→nay) = canonical [`docs/STATUS.md` §Sub-agents]** (🔴 S106 gộp 1-chain per anh-confirm — reader này KHÔNG enumerate/cập-nhật mỗi flip; BƯỚC 0.6 probe mỗi phiên xác-định runtime SỐNG, per-session KHÔNG steady-state) · effort **Max** (env machine-wide). SE KHÔNG có lớp helper/gopher rẻ (**mọi sub đều substantive memory-bearing → tất cả lên inherit**). *(Trước H8: 4 promote inherit + 7 demote pin `claude-opus-4-8` — lịch sử ở Upgrade 2026-06-10 + S66 dưới.)* +> 🔍 **Đếm roster = ĐO ĐĨA, đừng tin số trong doc:** `ls -1 .claude/agents/*.md | grep -v README | wc -l`. ⚠️ **Glob thô `ls .claude/agents/*.md` bắt LUÔN `README.md`** ⇒ ra **thừa 1** — đây là bẫy số-học thật (R2-C1: acceptance cũ `=14` **FAIL trên implementation ĐÚNG**, và ép "sửa" bằng cách **xoá `README.md`** = catastrophic-Goodhart). > **Upgrade S52 (2026-06-08 — AI_INFRA broadcast `2026-06-08-Agent-database-codebase-agents`):** **+database-agent (read-advisory DB specialist, floor DB1–DB11)** — schema/query/migration-design-review/perf/concurrency (DB11 RowVersion vá lost-update S43). Tailor READ-tier (implementer-backend vẫn author) · color OMIT (8 standard hết) · `store_memory` strip. `codebase-agent` = **SKIP n-a** (investigator-codebase đã cover grep/audit + `csharp-lsp` Windows no-op). ✅ **verified-runtime** — spawned OK S53 (first real spawn, caught Mig 46 committed-but-unapplied-local drift) + S56 2× (pre-golive-verify schema-stream + golive-harden design+review). DB11 lost-update fix landed S56 (atomic ExecuteUpdate + Serializable tx, gotcha #58). > Pattern: Anthropic Building Effective Agents orchestrator-workers + Cognition "writes single-threaded" hybrid + post-deploy automated watchdog. > **Upgrade S39 (2026-05-29):** 4→7 agent (split investigator + implementer, +test-specialist) + budget +50% + 5 RAG MCP per agent. Reference BVAAU 7-agent config (adapted, NOT copied — SOLUTION_ERP 2-FE-app fit + 6 skill proven battle-test 38 session). Prior: S20t12 initial 3 + S21t1 +cicd-monitor. @@ -19,20 +22,20 @@ --- -## 🎯 Architecture (12 agent) +## 🎯 Architecture -> ⓘ **Diagram dưới = 7 core lane (pre-S47 snapshot).** Roster THẬT = **12 sub**: 7 core (diagram) + 🩷 frontend-designer (S47) + 🔵 database-agent (S52) + 📄 office-document (S107) + 🟫 tooling-auditor H1 + ⬜ harvest-curator H2 (2026-06-07 Harness 1) — xem skill matrix + decision tree + tool grant dưới. (Cosmetic ASCII chưa vẽ lại — tooling-auditor H1 sẽ flag drift này @session-start.) +> ⓘ **Diagram dưới = 7 core lane (pre-S47 snapshot) — KHÔNG phải roster hiện-hành.** Roster THẬT = 7 core (diagram) + 🩷 frontend-designer (S47) + 🔵 database-agent (S52) + 📄 office-document (S107) + 🟫 tooling-auditor H1 + ⬜ harvest-curator H2 (2026-06-07 Harness 1) + 🔷 lead-view-auditor + 🔶 lead-omission-auditor (**H24, S121 W2**) — xem skill matrix + decision tree + tool grant dưới. Số vai canonical → [`docs/STATUS.md`](../../docs/STATUS.md) §Sub-agents. (Cosmetic ASCII chưa vẽ lại — H1 tooling-auditor flag drift này @session-start.) ``` ┌──────────────────────────────────────────────────────────────┐ -│ EM (Main) — Fable 5 (1M) Max │ +│ EM (Main) — lead frontier-class (anh chọn per-session, 1M Max)│ │ • Reasoning + write code (single-threaded principle) │ │ • Schema/UX/architecture decision + cross-stack tight coupling│ -│ • Coordinate 12 sub-agents via spawn + SendMessage │ +│ • Coordinate TOÀN roster sub-agent via spawn + SendMessage │ │ • Synthesize cross-agent findings + commit/push (em main only)│ │ • Fallback solo nếu spawn fail (gotcha #53 truncate / 529) │ └──────────────────────────────────────────────────────────────┘ - ↓ spawn + keep-alive (Harness-8 all-inherit: cả 12 sub `model: inherit` = top-tier lead — Max; per-task tier:'opus' escape-hatch giữ) + ↓ spawn + keep-alive (Harness-8 all-inherit: MỌI sub `model: inherit` = top-tier lead — Max; per-task tier:'opus' escape-hatch giữ) ── RESEARCH (READ) ────────── ── IMPLEMENT (WRITE) ──────────── ── QUALITY ────────── ┌──────────────────┐ ┌───────┐ ┌─────────────────┐ ┌──────────┐ ┌────────┐ ┌─────────┐ ┌────────┐ │investigator- │ │invest-│ │implementer- │ │implement-│ │test- │ │reviewer │ │cicd- │ @@ -168,7 +171,7 @@ ## 🔧 Tool grant (S39 — +3 RAG MCP per agent) -All 12 agent có **4 RAG-READ MCP**: `search_memory` + `search_code` (BM25, prefer over Read full file — tiết kiệm token) + `cross_project_search` + `list_projects`. Base tools per role (READ: Read/Grep/Glob/Bash [+WebFetch/Search cho api] · WRITE: +Edit/Write/Skill). +MỌI agent trong roster có **4 RAG-READ MCP**: `search_memory` + `search_code` (BM25, prefer over Read full file — tiết kiệm token) + `cross_project_search` + `list_projects`. Base tools per role (READ: Read/Grep/Glob/Bash [+WebFetch/Search cho api] · WRITE: +Edit/Write/Skill). > **2 monitor sub (tooling-auditor H1 + harvest-curator H2 — 2026-06-07):** read-only toolset = `[Read, Grep, Glob, Bash, +4 RAG-read]`, **NO `store_memory`, NO Write/Edit** (mirror investigator read-set). INFORM-only — propose → em main single-writer VERIFY→APPEND (B3). 🔴 **G-015 accuracy (Harness-10 run-trace model, `runs/README.md §Containment` — 🧊 `_ledger.md` retired H18-B S100):** run-folder `runs//` được git **TRACKED** → mọi write HIỆN trong git-diff = audit trực-tiếp. Containment: tracked-change NGOÀI `runs//` VÀ NGOÀI code-disjoint đã giao = vi-phạm (thay model Harness-2 B6 "mọi tracked-change = vi-phạm"). G-015 no-overclaim: TRACKED ≠ read-only-enforced — sub vẫn giữ `Bash` (write-channel mở qua shell/curl) → containment THẬT = em main single-writer + git-diff(in-repo) + chunk-count (RAG), KHÔNG allowlist đơn-độc. @@ -205,7 +208,9 @@ All 12 agent có **4 RAG-READ MCP**: `search_memory` + `search_code` (BM25, pref - **Keyword = QUYỀN, KHÔNG lệnh (T4):** "workflow"/"ultracode" mở quyền hỏi, KHÔNG auto-run. Mode-OFF + "chạy workflow" → TỪ CHỐI + nhắc `/ultra-on`. CẤM native `/effort ultracode`. *(Bài học 515K-token false-trigger.)* - **Scope (S1):** Workflow fan-out CHỈ repo SOLUTION_ERP — KHÔNG fan-out repo/corpus khác. - **Checkpoint (S2):** `hmw.js` **throw** nếu `checkpointApproved≠true` (mechanized tripwire anti-accidental). Em main BÁO {số agent·vai·task} @inform → set cờ → fan-out (KHÔNG chờ confirm từng lần; marker-ON=consent). Sub KHÔNG spawn sub (S3). -- **VALID_ROLES (12 — whitelist `hmw.js`, đủ roster):** `investigator-codebase` · `investigator-api` · `implementer-backend` · `implementer-frontend` · `test-specialist` · `reviewer` · `cicd-monitor` · `frontend-designer` · `database-agent` (+S57 — S56 đã dùng 3× qua fail-soft WARN) · `office-document` (+S107 — Office WRITE OD1–OD10) · `tooling-auditor` + `harvest-curator` (+S110 anh-directed — H21 roster-parity lệnh-B; monitor vẫn INFORM-only, lane RETURN-only). Role lạ ∉ VALID_ROLES → `hmw.js` THROW (STOP-HARD) + báo owner (S4c, DIRECTED REC-3 2026-07-13); role-less null → inherit lead. +- **VALID_ROLES (whitelist `hmw.js` — ĐỦ roster; số vai canonical → [`docs/STATUS.md`](../../docs/STATUS.md) §Sub-agents, B1 KHÔNG chép số):** `investigator-codebase` · `investigator-api` · `implementer-backend` · `implementer-frontend` · `test-specialist` · `reviewer` · `cicd-monitor` · `frontend-designer` · `database-agent` (+S57 — S56 đã dùng 3× qua fail-soft WARN) · `office-document` (+S107 — Office WRITE OD1–OD10) · `tooling-auditor` + `harvest-curator` (+S110 anh-directed — H21 roster-parity lệnh-B) · **`lead-view-auditor` + `lead-omission-auditor` (+S121 W2 — H24 lead-self-audit)**. 🔸 **Cả 4 monitor vẫn INFORM-only, lane RETURN-only** (propose-only, KHÔNG Write/Edit). Role lạ ∉ VALID_ROLES → `hmw.js` **THROW (STOP-HARD)** + báo owner (S4c, DIRECTED REC-3 2026-07-13); role-less null → inherit lead. + - 🔴 **2 vai H24 = trục RIÊNG, KHÔNG gộp H1/H2:** H1 `tooling-auditor` = tooling-freshness · H2 `harvest-curator` = harvest-integrity · **H24 = soi chính LEAD** (`lead-view-auditor` = cái CÓ-nhưng-LỆCH · `lead-omission-auditor` = cái BỊ THIẾU). Class-flag lấy từ **enum ĐÓNG** `lead_self_audit.flag_classes` (`.claude/agent-memory/memory-budget.json`) — **vai KHÔNG tự chế class**; nhịp = `h24_cadence` (cùng file), chạy **theo NHỊP** không phải mỗi phiên (`session-start §2.1.8` · `session-end §L.b(j)`). + - ⚠️ **Đổi roster = đổi 2 BỀ-MẶT ĐỘC-LẬP:** (1) file `.md` trong `.claude/agents/` → **Agent-tool registry** · (2) hằng `VALID_ROLES` trong `hmw.js` → **workflow `agentType`**. Sửa 1 quên 1 = vai **spawn được tay nhưng THROW trong workflow** (hoặc ngược lại). 🔴 **Registry = ảnh-chụp lúc khởi phiên, KHÔNG hot-reload** ⇒ vai mới cần **RESTART + spawn-probe THẬT** (`session-start §0.6b`) — `ls` + grep VALID_ROLES là **điều-kiện CẦN, KHÔNG ĐỦ**. - **Memory governance (M1–M5 + R1):** B1 slice-inject (agent ← slice MEMORY của đúng vai qua `args`) · M2 return-delta-only (`memoryDelta{task,verdict,learned,surprise}`) · B3 lead single-writer VERIFY→APPEND-only (no-overwrite-unverified) · B2 harvest-LIỀN sau mỗi workflow vào `agent-memory/` · M5 `store_memory` strip (đã S47). **Containment = defense-in-depth** (git-diff + Qdrant chunk-count post-P2), KHÔNG allowlist đơn-độc (G-015: sub vẫn giữ Bash/Write — KHÔNG "read-only"). > Floor T/S/M/R đầy đủ → `.claude/commands/ultra-on.md`. adap-report → `docs/governance/adap-reports/2026-06-03-Agent-ultracode-hmw-mem-governance.md`. diff --git a/.claude/commands/fable-clone.md b/.claude/commands/fable-clone.md index 657c677..506a662 100644 --- a/.claude/commands/fable-clone.md +++ b/.claude/commands/fable-clone.md @@ -44,6 +44,28 @@ Trước khi gọi Workflow `hmw`, lead **PHẢI** @P1: - **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). +## 🔴 GAP#6 — lane ensemble PHẢI mang `tier:'opus'` (KHÔNG để inherit) + +🔴 **Lệnh này tự định-nghĩa mình là "ENSEMBLE **tier-2**" ⇒ lane BUỘC phải chạy tier-2, KHÔNG phải tier của lead.** + +```js +taskList: [ { role:'', tier:'opus', label:'lens-1', prompt:'…' }, + { role:'', tier:'opus', label:'lens-2', prompt:'…' }, … ] +``` + +**Vì sao BẮT BUỘC** (`hmw.js:63-64` `resolveModel()`: `if (tier==='fable'||tier==='opus') return tier`): +- **Thiếu `tier`** ⇒ role-có-frontmatter → `model: inherit` → lane ăn **model của LEAD**. +- ⇒ **lead = Fable** thì ensemble thành **N× Fable** — **vừa đốt quota top-model gấp N lần, vừa phá đúng lý-do lệnh tồn-tại** (ensemble tier-2 RẺ để **thay** 1 lượt Fable đắt; cặp `/fable-real` mới là đường single-top-model). +- ⇒ **lead = Opus** thì `tier:'opus'` ≡ inherit ⇒ **KHÔNG phân-biệt được** ⇒ lỗi này **vô-hình** ở phiên lead=Opus và **chỉ lộ khi Fable UP**. Đúng lỗi 🟥 reviewer bắt @S108. + +### 🔴 CHƯA VERIFY — precedence spawn-param ⟂ frontmatter (H23 §2(2), khai bắt-buộc) + +**Ở SE cả hai ĐANG cùng hiện-diện:** `hmw.js` trả alias vào `agent(…, {model:…})` **TRONG KHI** frontmatter **toàn roster** = `inherit`. **Chưa ai test bên nào THẮNG** (`hmw.js:46-49` mang cùng ghi-chú này). +🔴 **Nếu frontmatter thắng ⇒ TOÀN BỘ fix GAP#6 = NO-OP** ⇒ floor-2 vẫn thủng khi Fable UP. +**Phép thử phân-biệt được (H23 §6 #3):** chạy 1 lane `tier:'opus'` **KHI lead=Fable** → đọc model **THỰC-TẾ resolve** → lệch ⇒ báo anh. ⚠️ **DEFER tới phiên lead=Fable** — lead=Opus thì 2 nhánh ra **cùng kết-quả**. 🔴 Khai thẳng: **CHƯA test**, đừng bán quá nấc. +**Đang có (PA-2, anh chốt O1) = 2 lớp GIÁN-TIẾP, KHÔNG thay được phép thử trên:** PA-2a hằng-số `TIER2_EXPECTED_FULL_ID = 'claude-opus-4-8'` (`hmw.js:50`) + PA-2b `scripts/spawn-model-audit.ps1` so resolved-vs-expected. 🔸 Neo-tại-spawn = **bất-khả-thi** (param chỉ nhận enum alias) — và **chính mệnh-đề đó cũng CHƯA thử** truyền full-id xem có bị từ-chối không (fix#8a). +> ⚠️ **Grep `tier:'opus'` ≥1 hit = ĐIỀU-KIỆN CẦN, KHÔNG ĐỦ** — nó chỉ đo **CHỮ trong file**, không đo runtime ⇒ **Goodhart-able 100%**. + ## 🔴 Floor model-tier v3 + lead-discipline - **Lead = frontier-class do ANH chọn per-session** {Fable 5 | Opus 4.8 — **1M MAX**}; **CẤM Sonnet/Haiku-class ghế lead**. Engine-đắt per-invocation = đường DUY NHẤT nâng 1 vai lên hạng-nhất. - ⚠️ **Lead KHÔNG tự ý gọi engine-đắt** — **kể cả khi HMW-mode ON**; chỉ chạy khi anh gõ lệnh. diff --git a/.claude/commands/sleep-recovery-memory-l2.md b/.claude/commands/sleep-recovery-memory-l2.md index d5843d6..1bbc3d7 100644 --- a/.claude/commands/sleep-recovery-memory-l2.md +++ b/.claude/commands/sleep-recovery-memory-l2.md @@ -31,11 +31,18 @@ Nén **verbatim L2 cũ** thành **gist súc-tích** mà KHÔNG mất signal-quan ## 👥 SE roster — target hợp-lệ -`all` = **9 sub có-ký-ức** của SE: -`investigator-codebase · investigator-api · implementer-backend · implementer-frontend · test-specialist · reviewer · cicd-monitor · frontend-designer · database-agent`. +🔴 **`all` = MỌI sub product/quality có-ký-ức — DẪN-XUẤT TỪ ĐĨA, KHÔNG hardcode danh-sách** (B1; roster canonical → [`docs/STATUS.md`](../../docs/STATUS.md) §Sub-agents): -> 🟡 **harvest-curator + tooling-auditor = INFORM-only monitor** (KHÔNG vào `all` mặc-định). CHỈ xử-lý nếu chúng **thật-sự có** `archive/.md` verbatim (Phase 0.2 phát-hiện) — gọi tay đích-danh tên. -> ℹ️ Thực-tế hiện-tại (đo S71, `memory-budget.json`): chỉ **4/9** sub có archive-content — `cicd-monitor · implementer-backend · investigator-codebase · reviewer`. 5 sub còn-lại archive rỗng/chưa-có → `all` tự skip (Phase 0.2 guard-rỗng). Con-số này = báo-cáo runtime, KHÔNG hardcode: luôn quét đĩa thật. +```bash +ls -1d .claude/agent-memory/*/ | xargs -n1 basename | grep -vE '^(tooling-auditor|harvest-curator|lead-view-auditor|lead-omission-auditor)$' +``` + +Hiện-hành = `investigator-codebase · investigator-api · implementer-backend · implementer-frontend · test-specialist · reviewer · cicd-monitor · frontend-designer · database-agent · office-document`. + +> 🟡 **4 monitor INFORM-only KHÔNG vào `all` mặc-định** — `tooling-auditor` (H1) · `harvest-curator` (H2) · `lead-view-auditor` (H24) · `lead-omission-auditor` (H24). CHỈ xử-lý nếu chúng **thật-sự có** `archive/.md` verbatim (Phase 0.2 phát-hiện) — **gọi tay đích-danh tên**. +> ⚠️ **Vá @S122 — danh-sách này TỪNG STALE:** nó cứng-hoá "9 sub" và **rớt `office-document`** (vai thêm **S107**, có ký-ức thật, là product/quality **chứ không phải monitor**) suốt từ đó. Trớ-trêu: chính doc này đã ghi *"luôn quét đĩa thật"* cho con-số `4/9` ngay dưới, nhưng lại **hardcode danh-sách roster** phía trên ⇒ nay **quét cả hai**. +> ℹ️ **Số sub CÓ archive-content = báo-cáo RUNTIME, luôn quét đĩa** (đo S71: 4 — `cicd-monitor · implementer-backend · investigator-codebase · reviewer`; số còn-lại archive rỗng/chưa-có → `all` tự skip qua Phase 0.2 guard-rỗng). **KHÔNG chép con-số này thành hằng-số.** +> 🧹 **Ghi-chú S122:** trước đó `agent-memory/` còn **2 dir RỖNG** `_crlf-probe` + `_lf-probe` (tàn-dư probe W0.6) ⇒ lệnh quét trên **đếm 16 thay vì 14**. Đã `rmdir`. Bài học: **git MÙ với thư-mục rỗng** ⇒ `git status` sạch **KHÔNG** chứng-minh đĩa sạch. Con-số này = báo-cáo runtime, KHÔNG hardcode: luôn quét đĩa thật. ## Trigger (2 đường) diff --git a/.claude/governance/ACTIVE-MARKS.md b/.claude/governance/ACTIVE-MARKS.md index 88dabd7..d7265a5 100644 --- a/.claude/governance/ACTIVE-MARKS.md +++ b/.claude/governance/ACTIVE-MARKS.md @@ -19,6 +19,12 @@ | `RC-pqhuy1987-11-07-2026-20-42-01` | `harness-11-engine.md §K.E` + `.claude/commands/fable-{real,clone}.md` + `session-start BƯỚC 0.5b/0.6` (≙ AI_INFRA H-21 + model-tier-v3) | **H-21 engine-đắt PER-INVOCATION + spec-file kết-tinh + MTv3 lead owner-choice** (supersede-partial H19). **Sàn:** (1) engine-đắt CHỈ chạy trong lượt anh gõ `/fable-real\|/fable-clone <đề-bài>` — vai anh gán đích-danh ∈ roster 12, thiếu/sai → hỏi anh, lead KHÔNG tự ý (kể cả HMW-ON) · (2) mỗi run sinh **spec-file 3-mục** (engine propose → lead verify → LEAD ghi → worker hạng-hai thực thi theo spec, kể cả run chấm/verify) · (3) lead = **frontier-class do anh chọn per-session** {Fable 5 \| Opus 4.8 — 1M MAX}, CẤM Sonnet/Haiku-class ghế lead; owner-chọn-hạng-hai ≠ outage (0 caveat/0 revert-nghĩa-vụ), outage đóng → hỏi anh ĐÚNG 1 dòng · (4) 4 ghi-chú trung-thực a-d giữ nguyên nấc (owner-gated + kỷ-luật, KHÔNG code-enforced). K.C 3 GAP-guard + định-nghĩa 2 engine GIỮ từ H19 | **pain:** "quyết-theo-từng-tác-vụ dễ quên hạ-tầng" (kế thừa H19) + cách-làm bay hơi trong prompt → spec-file kết tinh git-tracked (sự-cố thật hub) + flip-chain dán nhãn outage khi thật ra owner-choice · **volume:** mọi lượt engine-đắt × 12 vai × 2 lệnh + BƯỚC 0.6 mỗi phiên + worker-pipeline theo spec · **quality:** audit-trail spec qua git + owner-gated chống auto-elevate + reviewer-Fable dogfood run-1 bắt 5 Major thật (M1 worker-đổi-fact · M2 boundary-gap → VALID_ROLES 12) | `RC-pqhuy1987-03-07-2026-17-46-35` (partial — floor-point 1/2 + marker-toggle; K.C + 2-engine GIỮ) | 🔖 **Active-High** (anh-confirm S110 via AskUserQuestion "Stamp mark MỚI thay mark cũ" · P4 report-before-stamp: `/check-email`→invest-Fable→spec→WF `wf_0c3b307f-a64`→reviewer-Fable PASS_WITH_FIXES→fix→present→confirm→stamp) | | `RC-pqhuy1987-12-07-2026-11-43-45` | `engine PHẦN N` + `.claude/hooks/wal-flush.ps1` + `.claude/settings.json hooks` + `session-start BƯỚC 0.7` / `session-end §5.0+§6.4` + `commands/pause·tiep` + `workflows/README FLIP-policy` (≙ AI_INFRA H-22 CANONICAL §I4 + §H1) | **H-22 WAL session-continuity.** **Sàn:** (1) sổ `.claude/WAL.md` ≤40 dòng ghi-đè-không-append (chain-bằng-chứng + next + verify-trước-next, ground-truth thắng, cấm secret; detector C5 bắt >40) · (2) hai tầng ghi: lead single-writer nội-dung ⟂ Stop-hook `wal-flush.ps1` persist-only (per-path+CAND+exit-0; ĐƯỢC add+commit 3-path `wal:` / KHÔNG content·push·block·path-ngoài) · (3) MỘT đường recovery `/tiep` (+`/pause` chốt dừng; CẤM transcript; wf: = relaunch-cắt-gọt + pack-re-derive; resume-run-id = same-session-only) · (4) delta mở/đóng: BƯỚC 0.7 WAL-check (ngoại-lệ CHỜ duy-nhất) + §5.0 squash `wal:`-trailing chưa-push (KHÔNG rewrite đã-push) + §6.4 reset cuối · (5) run ≥3-task HOẶC >5' = BẮT BUỘC RUN-TRACE per-agent-file + taskList-snapshot + dòng `wf:` 5-trường. Commit `wal:` = ngoại-lệ DUY-NHẤT format `[CLAUDE]` (rules §5.2) | **pain:** phiên chết giữa mạch = mất trí-nhớ chưa-ghi + đốt-lại token (sự-cố thật SE: WF2 S101 MẤT theo CLI-restart phải re-run · diary transcript-lost ×2 S110 · W3 return-truncate NGAY run adopt này — per-agent-file cứu) · **volume:** MỌI phiên (BƯỚC 0.7 + §5.0/§6.4) × mọi workflow ≥3-task × 3-path memory/run trên đĩa · **quality:** hook-FIRE VERIFIED-RUNTIME ×2 (`12071c5`/`67be443` — reviewer refute 3-hướng forensics NTFS×git đều GÃY) + fault-inject 2-ca PASS + persist deterministic thay kỷ-luật-nhớ-tay (vá đúng root-cause sổ-tay-chết); ENV-DEPENDENT hot-reload khai đúng nấc, STAGED-until-verified giữ làm nguyên-tắc hook tương-lai | null (additive) | 🔖 **Active-High** (anh-confirm S111 via AskUserQuestion "Stamp Active-High" · P4 report-before-stamp: `/check-email`→invest-Fable READY_WITH_NUANCES 14N→spec lead-3-chỉnh→WF `wf_5ba3daf6-fe0` 3-Opus RUN-TRACE→reviewer-Fable PASS_WITH_FIXES 0C·1M·7m→fix 8/8→present→confirm→stamp; D10 paths-ignore anh-directed cùng lượt) | +> 🔄 **CHÚ-THÍCH S122 (2026-07-15) cho mark `RC-pqhuy1987-11-07-2026-20-42-01` — BẢN KÝ GIỮ NGUYÊN, KHÔNG SỬA MỘT CHỮ (P4/P8).** +> **Vấn-đề:** thân mark ghi *"vai anh gán đích-danh **∈ roster 12**"*. Đó là **con-số của thời-điểm ký (2026-07-11)** — một **ảnh chụp**, KHÔNG phải giới-hạn. Roster đã đổi (S121 W2 +2 monitor H24) ⇒ đọc mark theo **nghĩa đen** thì `/fable-real lead-view-auditor …` **nằm ngoài phạm-vi luật** = **hậu-quả THẬT**, không phải lỗi chính-tả. +> **Anh CHỐT @S122** (AskUserQuestion): **ý-định điều-khoản = "∈ roster"** — bất-kỳ vai nào trong **roster HIỆN-HÀNH** (số vai canonical → [`docs/STATUS.md`](../../docs/STATUS.md) §Sub-agents, B1) ⇒ **2 lệnh engine-đắt hợp-lệ với TOÀN roster**. +> **Vì sao chú-thích thay vì sửa:** mark = **bản đã ký**; lead **KHÔNG tự sửa** (P4/P8). Chú-thích **cộng thêm** giữ được **cả hai**: chữ-ký toàn-vẹn **và** luật đọc ra đúng hiện-tại. *(3 lựa-chọn đã cân: giữ-ký+chú-thích **[anh chọn]** · sửa-thân-thành-B1-trỏ · coi-là-history-frozen-không-đụng — cái cuối bị loại vì P7 hiển-thị mark MỖI phiên **như luật hiện-hành**, không phải như sử-liệu.)* +> 🔸 **Nấc chung rút ra:** thân mark **KHÔNG nên chép con-số dẫn-xuất** (roster/count) — đó chính là class `view-stale-count`/`view-stale-role-desc` mà **2 vai H24 vừa được ký trong chính wave này** sinh ra để soi. Mark tương-lai: **trỏ canonical**, đừng chép số. + ## 🟢 ACTIVE (follow + nhắc-lại xuyên-suốt — HIỆN @session) _(trống)_ diff --git a/.claude/workflows/README.md b/.claude/workflows/README.md index 1eafbc8..41cbdcc 100644 --- a/.claude/workflows/README.md +++ b/.claude/workflows/README.md @@ -17,7 +17,18 @@ Mỗi lần chạy workflow fan-out (RUN-TRACE mode) → **1 thư mục run** gi └── -synthesis.md ← gom/VERIFIED (suffix `-synthesis.md`) — EM MAIN ghi NGAY sau mỗi fan-out turn (C4 per-turn primary) ``` Phân biệt RAW (prefix `sub-`) vs VERIFIED (suffix `-synthesis.md`) bằng **TÊN file**, KHÔNG subfolder. **C8:** 5 run cũ S71 (`h10-invest`…`h910-curate`) giữ `sub-md/`+`harvest/` (đừng rewrite history); close-gate chấp nhận CẢ HAI dạng. -- `runs/_ledger.md` — 🧊 **RETIRED H18-B S100** (sổ 2-nhịp nghỉ-hưu — đo bắt-thật: true-orphan-catch 0/15 lifetime + mode-A coverage 0/8 workflow từ S93; 15 row lịch-sử GIỮ NGUYÊN, đảo-ngược = gỡ marker). **Orphan-authority = folder-scan:** `runs//` có `run.md` mà `*-synthesis.md` VẮNG/0-byte. Chi-tiết `runs/README.md`. + +🔴 **TRI-ACCEPT (S122) — close-gate nhận BA dạng, KHÔNG phải hai.** Định-nghĩa CANONICAL + block quét = [`.claude/commands/tiep.md`](../commands/tiep.md) **§0** (KHÔNG chép logic sang đây — B1): +| dạng | hình-dạng | tư-cách | +|---|---|---| +| **1** | `-synthesis.md` **phẳng** | ✅ **hiện-hành — run MỚI BẮT BUỘC dùng dạng này** | +| **2** | `harvest/-synthesis.md` | 🧊 legacy C8 (5 run S71) — nhận, **cấm viết mới** | +| **3** | heading `## synthesis` trong **THÂN `run.md`** | 🧊 legacy S112–S114 — nhận, **cấm viết mới** | + +**Vì sao phải nhận dạng-3 (đây là sửa ĐÚNG, không phải nới lỏng):** gate hỏi *"đã harvest chưa"* — câu hỏi về **NỘI DUNG** — nhưng lại đo **TÊN FILE**. Đo thật @S122: **8 dương-giả / 25 run = 32%**; folder **ghi chép đầy-đủ NHẤT** (`pe-negative-quote`: có cicd PASS + bundle-hash + smoke 200 + 6 stage `[x]`) **vẫn** bị xếp orphan. Bồi: commit `8fa2fcc` khoe *"close-review run.md synthesis [H2 gate]"* mà `git show --stat` **không chạm folder** ⇒ H2 **đã soi + coi ĐÓNG**, chỉ lệch tên file. +🔴 **Nhận ≠ cho phép** (đúng khuôn C8: *tha di-sản, cấm viết mới kiểu cũ*). Dạng-3 **phá chính thiết-kế "tên file mang nghĩa"** ở dòng trên. **KHÔNG phải convention của một thời-kỳ:** cùng ngày **07-12**, `h22-wal-adopt` ghi dạng-1 còn `S112-*` ghi dạng-3 ⇒ **thói-quen không nhất-quán**. Run mới ghi dạng-3 ⇒ **NÊU (drift)**. +🔸 **Kẽ CÒN LẠI — dạng-4** (kết-quả rải dưới heading tuỳ-ý, vd `## Stages` + `## wf run-id`): **KHÔNG máy nào bắt được** — nhận nó = phải nhận "bất-kỳ run.md nào có vẻ nói về kết-quả" ⇒ quá lỏng, vô-nghĩa ⇒ **để người phán**. Đây **KHÔNG phải chuyện đã xử**. +- `runs/_ledger.md` — 🧊 **RETIRED H18-B S100** (sổ 2-nhịp nghỉ-hưu — đo bắt-thật: true-orphan-catch 0/15 lifetime + mode-A coverage 0/8 workflow từ S93; 15 row lịch-sử GIỮ NGUYÊN, đảo-ngược = gỡ marker). **Orphan-authority = folder-scan:** `runs//` có `run.md` mà **KHÔNG thoả bất-kỳ dạng nào trong TRI-ACCEPT** (dạng-1 phẳng · dạng-2 `harvest/` · dạng-3 `## synthesis` trong run.md) — mỗi dạng đều đòi **khác 0-byte**. 🔴 Block quét canonical + 9/9 fault-inject → [`tiep.md`](../commands/tiep.md) **§0** (⚠️ bản trước S122 chỉ nhận dạng-1 ⇒ **32% dương-giả**). Chi-tiết `runs/README.md`. ## 2 MODE memory (anh 06-07, KHÔNG thay return-delta) @@ -33,7 +44,7 @@ Phân biệt RAW (prefix `sub-`) vs VERIFIED (suffix `-synthesis.md`) bằng **T ## Quy trình RUN-TRACE (B1–B6) 1. **B3 SCAFFOLD TRƯỚC (em main @P1):** tạo `runs//` + `run.md` (FLAT — KHÔNG cần `sub-md/`/`harvest/` subfolder hay `.gitkeep`; file `sub-*`/`*-synthesis.md` sinh phẳng cùng cấp khi fan-out chạy). *(🧊 bước "ghi OPEN-beat vào `runs/_ledger.md`" retired H18-B S100 — orphan-authority = folder-scan.)* ⚠️ `hmw.js` chạy JS-sandbox **no-filesystem** → KHÔNG tự tạo folder; **em main Write @P1** TRƯỚC khi invoke Workflow. (Đây là fragile-point — quên scaffold = run mất dấu-vết âm-thầm; xem `runs/README.md` §C7.) -2. **B1 spawn-from-real-sub:** mỗi task `role ∈ VALID_ROLES` (12 sub — đủ roster từ S110, +2 monitor anh-directed) → workflow-agent = sub THẬT (`agentType` inherit memory-pack slice + skill identity), KHÔNG agent vô-danh. +2. **B1 spawn-from-real-sub:** mỗi task `role ∈ VALID_ROLES` (**roster ĐẦY-ĐỦ** — số vai canonical → [`docs/STATUS.md`](../../docs/STATUS.md) §Sub-agents, B1 KHÔNG chép số ở đây) → workflow-agent = sub THẬT (`agentType` inherit memory-pack slice + skill identity), KHÔNG agent vô-danh. 3. **B4 phân-quyền TOOL-AWARE:** `hmw.js` inject vào prompt mỗi sub đường-dẫn `runs//sub--.md` (phẳng) + lệnh ghi ĐÚNG file đó. - **Write sub (CÓ Write/Edit):** implementer-backend · implementer-frontend · test-specialist · frontend-designer → ghi-direct sub-MD via Write/Edit. - **Read-only sub (CHỉ Bash):** investigator-codebase · investigator-api · reviewer · cicd-monitor → 🔴 KHÔNG Bash-write MD (mojibake) → full-detail vào `findings` + `subMdPath` → **em main scribe @P3** (single-writer). diff --git a/.claude/workflows/runs/2026-07-15-S119-adap-6-broadcast/spec-adap-6-broadcast-15-07-2026-v3-PATCH.md b/.claude/workflows/runs/2026-07-15-S119-adap-6-broadcast/spec-adap-6-broadcast-15-07-2026-v3-PATCH.md index 87764a6..1752390 100644 --- a/.claude/workflows/runs/2026-07-15-S119-adap-6-broadcast/spec-adap-6-broadcast-15-07-2026-v3-PATCH.md +++ b/.claude/workflows/runs/2026-07-15-S119-adap-6-broadcast/spec-adap-6-broadcast-15-07-2026-v3-PATCH.md @@ -153,7 +153,30 @@ if (A.taskList.length >= 3 && !w) throw new Error('H22 Sàn-1: run ≥3 task PH - **Vào W2 (1-EDIT):** `hmw.js:9` meta + `ultra-on.md:24` danh-sách VALID_ROLES 12→14 (**routing-doc ⇒ CÙNG COMMIT**) - **Vào W3:** `fable-real.md` + `fable-real-runbook.md` -**Acceptance:** sau W3, pattern trên = **0 hit sống** (ngoài lịch-sử/archive). +**Acceptance:** ~~sau W3, pattern trên = **0 hit sống** (ngoài lịch-sử/archive).~~ + +## 🔴 ACCEPTANCE FIX#6 — SỬA @S122 (bản gốc BẤT-KHẢ-THI; tiền-lệ WAL:29 lead sửa acceptance cơ-học rồi báo) + +**Lỗi:** *"0 hit sống"* đo **TOÀN BỘ** bề mặt khớp pattern — **kể cả phần CỐ Ý khớp**. Một implementation **ĐÚNG** vẫn trượt. **Cùng họ R2-C1 (`ls=14` sai số-học) + R3-M3 (`TOTAL≥46` bất-khả)** — lần thứ **BA** trong cùng spec: **acceptance viết bằng LITERAL thì đo cái TRÔNG GIỐNG, không đo cái ĐÁNG ĐỔI.** + +**Bằng-chứng (sweep thật sau W3):** 14 hit còn sống, **0 cái là stale-cần-vá**: +| Nhóm | Hit | Vì sao KHÔNG được "vá" | +|---|---|---| +| **Ví-dụ CÓ CHỦ-ĐÍCH** | `lead-view-auditor.md:47` | Nó **minh-hoạ** class `view-stale-role-desc` bằng đúng chuỗi đó. Vá = **phá tài-liệu của chính vai đi bắt stale** | +| **Trích lịch-sử** | `agents/README:3` · `sleep-recovery-memory-l2:43` · `ACTIVE-MARKS:23` | Do W3 **vừa viết** để **giải-thích** cái đã vá | +| **Bản ĐÃ KÝ** | `ACTIVE-MARKS:19` | **Anh chốt @S122: giữ nguyên** (P4/P8) + chú-thích | +| **Sổ tạm** | `WAL:15/:29/:38` | Nhật-ký làm-việc, không phải doc | +| **Chưa tới lượt** | `harness-11-engine.md:269/:322/:332/:345` | = **W5**, KHÔNG phải W3 | +| **Canonical + history-delta** | `STATUS.md:25` `VALID_ROLES 12→14` | Mô-tả **đúng** sự thay-đổi | + +**⇒ Acceptance MỚI (đo cái ĐÁNG ĐỔI, không đo cái TRÔNG GIỐNG):** +> Sau W3, **mọi hit sống của pattern PHẢI rơi vào đúng 1 trong 6 nhóm trên** — **0 hit** thuộc nhóm *"doc dẫn-xuất đang khai số roster SAI như thể đó là sự-thật hiện-hành"*. Nhóm *"chưa tới lượt"* **PHẢI rỗng sau W5**. +> **Cách kiểm = disposition TỪNG DÒNG** (không phải 1 con-số tổng — bài học §0: *con-số tổng đóng vai "đã phủ hết"*). + +**🔴 3 điều tự-bắt trong lúc chạy acceptance này (→ adap-report):** +1. **`STATUS.md:25` có stale THẬT** mà pattern **suýt bỏ sót**: row canonical ghi `| Sub-agents | **14** |` nhưng **narrative CÙNG DÒNG** ghi ``cả 12 sub `model: inherit` `` ⇒ **mâu-thuẫn nội-tại NGAY TRONG nguồn chuẩn** (W2 sửa row, bỏ sót narrative). Vá @S122 bằng cách **bỏ số khỏi narrative**, không phải đổi số. +2. **Bẫy mega-line TÁI HIỆN ĐƯỢC:** `STATUS.md:25` — `grep -c` = **1**, `grep -o | wc -l` = **2**. Ai dùng `grep -c` sẽ vá 1 chỗ rồi tưởng xong. (WAL:13 đã ghi bẫy này; nó **vẫn suýt ăn** lần nữa.) +3. **Lead ĐẾM SAI ×2 trong cùng phiên** — cả hai đều ở trục *đếm-về-việc-mình*: (a) báo *"`fable-real-runbook.md` **8 hit**"* — thật là **14** (lấy output `head -40` **đã bị cắt** làm số tổng); (b) báo *"đo lại tái-hiện CHÍNH XÁC dự-báo FIX#4"* rồi lấy trùng-khớp làm chỗ dựa, trong khi **cả FIX#4 lẫn lead đều đang đo TÊN FILE**. Khớp `feedback_meta_count_selfcoverage_blindspot`: **lead ĐO tốt, lead ĐẾM VỀ MÌNH thì sai.** --- diff --git a/docs/STATUS.md b/docs/STATUS.md index 3799b17..decaa77 100644 --- a/docs/STATUS.md +++ b/docs/STATUS.md @@ -22,7 +22,7 @@ | Gotchas | **82** | +1 S118 (**#82** menu-flag grant ≠ quyền API thật: display-layer [Permission `CanRead`→`GetMyMenuTree` FE-menu] ⟂ API-authz-layer [controller `[Authorize(Policy=)]`] = 2 tầng ĐỘC-LẬP; grant `Suppliers` R+C+U cho PRO nhưng `PUT/DELETE /suppliers` gate `[Authorize(Roles="Admin,CatalogManager")]` → PRO vẫn 403 sửa/xóa NCC [chỉ Publish/Import theo `Suppliers.Update` là ăn]; ngược lại `ReportsController` `[Authorize]` trần → mọi authed-user đọc `dashboard` tài-chính-HĐ ngược S92; fix gate `[Authorize(Policy="Reports.Read")]` per-method + grep controller authz TRƯỚC khi tin hiệu-lực grant; reviewer adversarial bắt, em-main-solo tin menu-flag=quyền thì sót; liên-quan #44). +1 S114 (**#81** derived-invariant re-derive ở write/select NHƯNG SÓT DELETE writer [DeleteQuote/DeleteDetail cascade] → xóa quote-selected cuối của NCC → `Supplier.IsWinner` kẹt stale [Any(IsSelected)=false] → `CreateContract Where(IsWinner)` gom NCC phantom → **HĐ giaTri=0**; fix helper `PeWinnerInvariant.ReSyncAfterQuoteRemovalAsync` gọi sau SaveChanges 2 handler; **enumeration-writer-trong-spec KHÔNG đáng tin** → grep MỌI `.Remove(`/`.Add(`/`=field` chạm entity chứa field-nguồn; chỉ **verify-adversarial-refute** bắt [invest/review/implement đều sót]; cardinality S87/S88 lên tầng mutation-path). +1 S113 (**#80** null-forgiving `!` che NRE trên external-parsed data: `SupplierExcelImportService.NewSupplier` gán `Code = r.Code!.Trim()` → NullReferenceException khi parser trả `null` cho ô cột-4 rỗng [ĐÚNG path R4 "thiếu Mã NCC → nháp"] → confirm nổ 500 CẢ batch dù preview classify New-draft KHÔNG lỗi; sibling `IsPublic=!IsNullOrWhiteSpace(row.Code)` null-safe nhưng NewSupplier thì KHÔNG; empty-string `""` chạy OK nhưng FE round-trip blank→JSON `null` → nổ. Fix `(r.Code ?? "").Trim()`. **Build 0/0 KHÔNG bắt** [`!` tắt nullable-warning]; chỉ test-before-critical bắt. Lesson: `!` null-forgiving trên dữ-liệu-parse-ngoài = mìn, dùng `?? default`). +1 S97 (**#79** backfill soi NHẦM bảng — transition-marker "[Duyệt KẾT THÚC]" nằm ở `PurchaseEvaluationChangelogs.ContextNote` KHÔNG phải `PurchaseEvaluationApprovals` → Mig 60 backfill match 0, phiếu finalize-CCM giữ flag=0 hiện sai "Đã được CEO duyệt"; fix Mig 61 query đúng bảng. PE 2 bảng lịch-sử tách vai [Approvals=ai-duyệt record :745 · Changelogs=chuyển-phase+marker LogTransition :1073]; verify marker-count prod trước khi tin backfill). +1 S97 (**#78** display-flag suy CONFIG thay RUNTIME → nói dối khi instance lệch config: `endsBeforeCeo` từ "workflow CÓ cấp finalize" thay "phiếu NÀY finalize" → phiếu lên CEO báo sai "không qua CEO"; nặng sau S97 default-flip opt-in; fix field runtime `EndedByLevelFinalize` Mig 60. Flag = "instance ĐÃ làm-gì" KHÔNG "config CÓ THỂ"). +1 S96 (**#77** SPA deploy bundle cache-lag: team thấy UI CŨ dù đã deploy + Ctrl+F5 — index.html no-cache ĐÚNG-chuẩn + JS hash-immutable nhưng browser giữ tab-SPA-mở/cache-local → verify bundle prod **BYTE-LEVEL** (curl + grep string-fix trong `/assets/index-.js`) phân-biệt cache-vs-deploy; **incognito = golden-test**; no-service-worker nên clear-site-data đủ). +2 S91 (**#76** deploy render config từ `.example` KHÔNG phải file-gitignored → prod thiếu setting tới khi điền tay · **#75** seed ungated per-code RESURRECT data đã-wipe mỗi restart → gate sau env-flag `DemoSeed:Disabled` + verify-by-restart-thật). +1 S90 (**#74** Chrome-MCP screenshot kẹt SPA-SignalR `document_idle` → PowerShell `CopyFromScreen` + Win32 lọc-process-`chrome.exe`). +2 S85 (**#72** lệch giờ +7h — DateTime lưu UTC nhưng serialize thiếu 'Z' → FE `new Date()`=local → `UtcDateTimeJsonConverter` global ép UTC-with-Z · **#73** UpdateDraft absolute-set CLEAR field SÓT khỏi pattern null-safe = bug-class S42 → guard `if (request.X is not null)`). +1 S78 **#71** (thêm enum value vào entity DÙNG-CHUNG → pollute UI/guard phân-loại theo PROXY-predicate `supplierId===null` thay vì enum tường minh; file-khi-duyệt purpose=5 lẫn "Bảng so sánh" + false-pass submit-guard → grep mọi field-proxy predicate loại value mới + build-verify TỪNG app; em-main grep no-leak bắt trước deploy). +1 S76 **#70** (FE absolute-set echo field anh-em từ server-snapshot + `invalidate()` fire-and-forget → cửa-sổ stale-echo mất-dữ-liệu khi lưu 2 ô liên-tiếp; guard `useIsFetching` gate nút Lưu tới khi refetch land; reviewer workflow bắt, impl self-review sót). +1 S72 **#69** FE bundle-hash non-deterministic + `deploy.yml` rebuild-FE-unconditional → bundle rotate kể cả commit governance (SPA-fallback-200 trap; cicd Run #312). +2 S69: **#67** Tailwind v4 accent palette thiếu stop (teal/violet/amberx/greenx chỉ 50/100/500/600/700; dùng -300 → teal/violet rơi DEFAULT Tailwind sai-hệ, amberx/greenx drop hẳn — build PASS, phải soi dist CSS) · **#68** IDE TS diagnostic giữa background-agent/workflow = snapshot dở-dang (TS server bắn mỗi save), chỉ tin build SẠCH sau-cùng (2× session này: re-skin + PE-FE đều false-alarm). Prev +1 S68 **#66** Tailwind v4 rule element thô `h1-h4{color:#0b1220}` viết NGOÀI `@layer` thắng utility `text-white` → heading render đen; fix ĐIỂM `text-white!` (important, grep dist confirm), KHÔNG move `@layer` (load-bearing ~30+ heading toàn app). Prev +1 S65 **#65** build csproj con (vd `SolutionErp.Api.csproj`) ≠ `dotnet build SolutionErp.slnx` (gồm tests) → miss test-compile khi đổi chữ ký record command (CreateDepartmentCommand +ParentId) → CI CS7036 FAIL-gated Run #291 (deploy chặn, prod nguyên — test-gate làm đúng việc). Fix: build full slnx trước push BE signature-change. Prev +2 S61: **#63** EF scaffold tự sinh `RenameColumn` SAI-semantics khi drop+add cùng type (test xanh không bắt — SQLite EnsureCreated không replay migration) · **#64** `dotnet ef database update` áp Design-DB 0-rows ≠ Dev-DB → data-migrate `Sql()` chạy thật lần đầu trên prod. Prev +2 S59 (#61 sqlcmd `-f 65001` · #62 rename natural-key UPDATE trước deploy) | | User memory | **31** | +S84 `feedback_derived_flush_execution` (derived→canonical flush = em-main execution KHÔNG gate user-confirm; monitor INFORM-only ≠ cần-anh-duyệt; chỉ ĐỔI-con-số/policy = quyền anh). +S79 `feedback_canonical_spec_over_broadcast` (adap pull canonical-command/§P đừng phỏng-theo broadcast + report-before-stamp dogfood + residual own-diary OK). +S75 `feedback_harness11_engine` (engine governance tự-bảo-trì + gotcha #30-via-Edit + multi-workflow-verify + git-add-specific lesson). re-ground S71 (H1 disk-count: 25 `feedback_*` + 3 `project_*`; STATUS "21" stale từ S64). +S71 `feedback_harness10_run_trace` (run-trace + 3 lesson). Prev +1 S64 `feedback_harness7_outward_writing_quality`; re-grounded S54 base 19 | | Skills | 6 | 3 domain + 3 ops | -| Sub-agents | **14** | **+S121 👁 `lead-view-auditor` + `lead-omission-auditor` (13th+14th sub — H24 lead-self-audit, adopt broadcast `2026-07-14-Governance-harness-24`, anh chốt S119 `owner-decisions-15-07-2026`, land S121 wave-W2 `hmw.js` VALID_ROLES 12→14 CÙNG COMMIT roster+STATUS [R3-M2: lệch landing ⇒ C2/B3 flag mọi derived ghi "14" là stale-vs-12 ⇒ detector BÃO trên chính thay đổi của H24]). 2 monitor INFORM-only propose-only, cookie-cutter frontmatter monitor sẵn (`model: inherit` · `memory: project` · `maxTurns: 18` · 8 tool read-only, **NO Write/Edit**). Trục: `lead-view-auditor` = **view LỆCH source** (5 class `view-*`) ⟂ `lead-omission-auditor` = **cái BỊ THIẾU** (5 class `gap-*`) — 🔴 **KHÔNG gộp** vào tooling-auditor(H1 tooling-freshness)/harvest-curator(H2 harvest-integrity): H24 §2(1) *"gộp là mất tiêu-điểm; cái ta cần là cặp mắt CHỈ dành cho lead"*. Class-flag = **enum ĐÓNG** `lead_self_audit.flag_classes` ở `.claude/agent-memory/memory-budget.json` (10 class = 5+5, vai CẤM tự chế). Nhịp = `h24_cadence` {light 6/deep 15/jump 3} cùng file (single-source H24 §2(3) — doc TRỎ key, KHÔNG chép số); counter `.claude/governance/.session-counter.json` (content-based `last_ticked_head`, KHÔNG blind-increment — hook `wal-flush.ps1` auto-commit `agent-memory/` mỗi turn sẽ làm hỏng đếm mù; đặt ngoài 3 path hook CÓ CHỦ-ĐÍCH). ⚠️ **CHƯA verified-runtime** — registry = ảnh-chụp khởi-phiên (S120/S121 đo lại, xác nhận nhánh KHÔNG hot-reload agent MỚI) ⇒ 14/14 spawn-probe **PHẢI chạy SAU RESTART** (static-check KHÔNG đủ — broadcast ④d). 🔸 Từ-vựng "view"/"omission" chọn có chủ-đích tránh va-chạm: `governance-detectors.ps1:15` đã sở-hữu `derived-staleness`, và "GAP" quá-tải (`session-end` build-gap · `memory-selfimprove-audit.ps1` CRITERIA+GAP).** **+S107 📄 `office-document` (12th sub — Office document WRITE specialist: docx·xlsx·pptx·pdf + form-engine; floor OD1–OD10; VALID_ROLES hmw.js 9→10; anh giao trực tiếp S107 "Sub chính" Office; ✅ **verified-runtime S107 CÙNG PHIÊN** — registry hot-reload agent MỚI giữa phiên [S27 lesson thu hẹp còn EDIT-agent/command] + spawn-test PASS OD1/OD4/OD5 template thật, model self-report `claude-fable-5` [data-point #5 flip-8]; finding: 2 template `wwwroot/templates` 0-placeholder mẫu-blank).** **all-inherit top-tier (Harness-8 S66 06-16 — thay thế two-tier H4):** em main Fable 5 (1M) Max (✅ **Fable RESTORED S98 2026-07-02** — lead self-report `claude-fable-5` + settings `claude-fable-5[1m]`; fallback-Opus H5 S62→S97 kết thúc, H5.6 hoàn tất) ⚠️ **S101 2026-07-03: runtime lead = Opus 4.8** (lead + 2 monitor + WF2 reviewer inherit đều self-report `claude-opus-4-8`; settings vẫn pin `claude-fable-5[1m]` → **Fable unavailable phiên này → H5-fallback tự-kích, revert-free, KHÔNG sửa frontmatter**; "Fable RESTORED S98" = point-in-time KHÔNG phải steady-state — inherit-chain resolve theo availability runtime; ✅ **S102 2026-07-06: Fable VỀ LẠI runtime** — lead + 2 monitor inherit self-report `claude-fable-5` → H5-fallback S101 kết thúc, pattern availability per-session xác nhận [S98 Fable → S101 Opus → S102 Fable → **S103 Opus** → **S104 Opus** (2026-07-06 Fable outage tiếp — S104 lead + 2 monitor spawn self-report `claude-opus-4-8` ×3, H5-fallback revert-free) → ✅ **S105 Fable** (2026-07-07 Fable VỀ lần 3 — lead + 2 monitor self-report `claude-fable-5` ×3, runtime-verified) → ⚠️ **S106 Opus** (2026-07-07 Fable outage lại — lead runtime self-report `claude-opus-4-8`, H5-fallback revert-free; flip-7) → ✅ **S107 Fable** (2026-07-10 Fable VỀ lần 4 — lead + 2 monitor self-report `claude-fable-5` ×3, runtime-verified; flip-8)], BƯỚC 0.6 probe mỗi phiên; per-session KHÔNG steady-state. 🔴 **[§Sub-agents = CANONICAL single-owner flip-chain — S106 gộp per anh-confirm; derived `agents/README:3` · `session-start:37` · `session-end:113` trỏ về đây, KHÔNG tự enumerate mỗi flip → chống churn 4-file/flip]**) · **cả 12 sub `model: inherit`** (7 demoted `claude-opus-4-8` flip S66; SE không có helper/gopher rẻ → cả 12 lên top-tier; office-document S107 inherit-born) · effort Max. 10 product/quality + 2 monitor INFORM-only. Nấc H8 = **runtime-verified S98 (2026-07-02)** — spawn-test inherit-chain ×2 monitor self-report `claude-fable-5` (cả đội tự lên Fable khi lead restore, 0 sửa frontmatter — đúng thiết kế all-inherit). Prev two-tier H4 runtime-verified S57bis (spawn-test 2 chiều). | +| Sub-agents | **14** | **+S121 👁 `lead-view-auditor` + `lead-omission-auditor` (13th+14th sub — H24 lead-self-audit, adopt broadcast `2026-07-14-Governance-harness-24`, anh chốt S119 `owner-decisions-15-07-2026`, land S121 wave-W2 `hmw.js` VALID_ROLES 12→14 CÙNG COMMIT roster+STATUS [R3-M2: lệch landing ⇒ C2/B3 flag mọi derived ghi "14" là stale-vs-12 ⇒ detector BÃO trên chính thay đổi của H24]). 2 monitor INFORM-only propose-only, cookie-cutter frontmatter monitor sẵn (`model: inherit` · `memory: project` · `maxTurns: 18` · 8 tool read-only, **NO Write/Edit**). Trục: `lead-view-auditor` = **view LỆCH source** (5 class `view-*`) ⟂ `lead-omission-auditor` = **cái BỊ THIẾU** (5 class `gap-*`) — 🔴 **KHÔNG gộp** vào tooling-auditor(H1 tooling-freshness)/harvest-curator(H2 harvest-integrity): H24 §2(1) *"gộp là mất tiêu-điểm; cái ta cần là cặp mắt CHỈ dành cho lead"*. Class-flag = **enum ĐÓNG** `lead_self_audit.flag_classes` ở `.claude/agent-memory/memory-budget.json` (10 class = 5+5, vai CẤM tự chế). Nhịp = `h24_cadence` {light 6/deep 15/jump 3} cùng file (single-source H24 §2(3) — doc TRỎ key, KHÔNG chép số); counter `.claude/governance/.session-counter.json` (content-based `last_ticked_head`, KHÔNG blind-increment — hook `wal-flush.ps1` auto-commit `agent-memory/` mỗi turn sẽ làm hỏng đếm mù; đặt ngoài 3 path hook CÓ CHỦ-ĐÍCH). ⚠️ **CHƯA verified-runtime** — registry = ảnh-chụp khởi-phiên (S120/S121 đo lại, xác nhận nhánh KHÔNG hot-reload agent MỚI) ⇒ 14/14 spawn-probe **PHẢI chạy SAU RESTART** (static-check KHÔNG đủ — broadcast ④d). 🔸 Từ-vựng "view"/"omission" chọn có chủ-đích tránh va-chạm: `governance-detectors.ps1:15` đã sở-hữu `derived-staleness`, và "GAP" quá-tải (`session-end` build-gap · `memory-selfimprove-audit.ps1` CRITERIA+GAP).** **+S107 📄 `office-document` (12th sub — Office document WRITE specialist: docx·xlsx·pptx·pdf + form-engine; floor OD1–OD10; VALID_ROLES hmw.js 9→10; anh giao trực tiếp S107 "Sub chính" Office; ✅ **verified-runtime S107 CÙNG PHIÊN** — registry hot-reload agent MỚI giữa phiên [S27 lesson thu hẹp còn EDIT-agent/command] + spawn-test PASS OD1/OD4/OD5 template thật, model self-report `claude-fable-5` [data-point #5 flip-8]; finding: 2 template `wwwroot/templates` 0-placeholder mẫu-blank).** **all-inherit top-tier (Harness-8 S66 06-16 — thay thế two-tier H4):** em main Fable 5 (1M) Max (✅ **Fable RESTORED S98 2026-07-02** — lead self-report `claude-fable-5` + settings `claude-fable-5[1m]`; fallback-Opus H5 S62→S97 kết thúc, H5.6 hoàn tất) ⚠️ **S101 2026-07-03: runtime lead = Opus 4.8** (lead + 2 monitor + WF2 reviewer inherit đều self-report `claude-opus-4-8`; settings vẫn pin `claude-fable-5[1m]` → **Fable unavailable phiên này → H5-fallback tự-kích, revert-free, KHÔNG sửa frontmatter**; "Fable RESTORED S98" = point-in-time KHÔNG phải steady-state — inherit-chain resolve theo availability runtime; ✅ **S102 2026-07-06: Fable VỀ LẠI runtime** — lead + 2 monitor inherit self-report `claude-fable-5` → H5-fallback S101 kết thúc, pattern availability per-session xác nhận [S98 Fable → S101 Opus → S102 Fable → **S103 Opus** → **S104 Opus** (2026-07-06 Fable outage tiếp — S104 lead + 2 monitor spawn self-report `claude-opus-4-8` ×3, H5-fallback revert-free) → ✅ **S105 Fable** (2026-07-07 Fable VỀ lần 3 — lead + 2 monitor self-report `claude-fable-5` ×3, runtime-verified) → ⚠️ **S106 Opus** (2026-07-07 Fable outage lại — lead runtime self-report `claude-opus-4-8`, H5-fallback revert-free; flip-7) → ✅ **S107 Fable** (2026-07-10 Fable VỀ lần 4 — lead + 2 monitor self-report `claude-fable-5` ×3, runtime-verified; flip-8)], BƯỚC 0.6 probe mỗi phiên; per-session KHÔNG steady-state. 🔴 **[§Sub-agents = CANONICAL single-owner flip-chain — S106 gộp per anh-confirm; derived `agents/README:3` · `session-start:37` · `session-end:113` trỏ về đây, KHÔNG tự enumerate mỗi flip → chống churn 4-file/flip]**) · **TOÀN roster `model: inherit`** (số vai = cột giữa của chính row này — KHÔNG chép lại vào narrative, đó là cách row-14 và narrative-12 lệch nhau từ S121 tới S122; 7 demoted `claude-opus-4-8` flip S66; SE không có helper/gopher rẻ → cả 12 lên top-tier; office-document S107 inherit-born) · effort Max. 10 product/quality + 2 monitor INFORM-only. Nấc H8 = **runtime-verified S98 (2026-07-02)** — spawn-test inherit-chain ×2 monitor self-report `claude-fable-5` (cả đội tự lên Fable khi lead restore, 0 sửa frontmatter — đúng thiết kế all-inherit). Prev two-tier H4 runtime-verified S57bis (spawn-test 2 chiều). | | RAG chunks | **2429** | re-verify S80 (`list_projects` — alive, +6 vs S63's 2423). Stale `last_indexed 05-29` (S42-S62 via store_memory stopgap; full re-index = AI_INFRA op cần VOYAGE_API_KEY). | **Bundle hash live (prod):** admin **`cFI7ih4a`** · user **`MxgooVZw`** (S117 — **`316a82f`** PE endsBeforeCeo pointer-aware [display-fix BE-only, phiếu chờ CEO hết báo "Kết thúc" sai] + duyệt-theo-khoảng Min–Max [Mig 66 + FE 2-app ProMinMax radio thứ 5]; **Run #387** PASS 5m36s rotate ×2 admin `Dd55jBpj`→`cFI7ih4a` / user `DVDr1UQ4`→`MxgooVZw` CSS-frozen [logic-only fingerprint]; **byte-verify #77** `ProMinMax`/`duyệt theo khoảng`/`cả Min và Max`/`Min–Max` PRESENT [bundle-cũ=0]; Mig 66 prod col decimal(18,2) + `__EFMigrationsHistory`-top + sys.tables **89**; smoke 200×3 · PE 401-secured; **#53-garble ×2** [invest-lane-1 + cicd-monitor] → SendMessage-resume + em-main curl cross-verify khớp). **Prev S116** — admin **`Dd55jBpj`** · user **`DVDr1UQ4`** (S116 — **`88368fd`** PE cho nhập giá ÂM ô báo giá [FE 2-app nút ± toggle + submit-gate `>0`→`!==0` + helper `hasRealSelectedQuote` 2-mirror `:201`/`:235`; BE submit-guard `:206` `Sum()<=0`→`All(==0)`; +9 test 486→495; **NO migration**]; **Run 386** PASS 5m28s rotate ×2 admin `D51OYyGV`→`Dd55jBpj` / user `BVdssm5S`→`DVDr1UQ4` CSS-frozen [logic-only fingerprint]; **byte-verify #77** `Đã nhập giá chào thầu`/`hoàn tiền NCC`/`phát sinh giảm`/`Đơn vị được chọn chưa có giá chào thầu` PRESENT [bundle-cũ=0]; smoke 200×3 · PE 401-secured · 89 bảng; cicd bắt bẫy snapshot-while-CI-running→poll-success TRƯỚC re-snapshot). **Prev S114** — admin **`D51OYyGV`** · user **`BVdssm5S`** (S114 — **`d436af2`** PE multi-NCC per hạng mục [Mig 65 backfill 2-chiều + BE re-key 5 financial→IsSelected + FE per-cell grid Detail×NCC 2-app SHA `ae3788e9`]; bundle rotate ×2 admin `acprMqfB`→`D51OYyGV` / user `Ck3BTDdA`→`BVdssm5S`; **byte-verify** `detailId`+`select-winner`+`hạng mục` PRESENT [bundle 1.65MB real-size]; smoke health/admin/eoffice 3/3 200 + endpoint POST select-winner bogus-401-live; **cicd garble #53 ×5 → em-main-solo curl-verify**; mig applied [API-healthy=migrations-ran-startup]). **Prev S113** — admin **`acprMqfB`** · user **`Ck3BTDdA`** (S113 — **Run #497** `5fa11b5` Supplier import v2 [Mig 64 publish/draft + dedup-MST + template + file mẫu] FE 2-app real-src rotate; JS admin `Cixlt_MA`→`acprMqfB` / user `BhBOG1dn`→`Ck3BTDdA` + CSS admin `Ds-E5neu`→`CfunQHbd` / user `Beb0Bb1h`→`DGqqHQXS`; ship-proof real-size 1.66/1.56MB + LM-in-window + **byte-verify** `Tải file mẫu`×1/`Đã công bố`×3/`Nháp (ẩn)`×4/`import/template`×1/`published`×5 PRESENT; Mig 64 prod 37/37-backfill sys.tables **89**; smoke health/admin/eoffice 200 + `import/template`-401-live + `suppliers?published=true`-401-live bogus-404-control). **Prev S112** — admin **`Cixlt_MA`** · user **`BhBOG1dn`** (S112 — **Run #496** `e100ef0` Supplier Excel-import Phase B FE 2-app [`SupplierImportDialog` NEW cả fe-admin+fe-user] + PE sign-off code-only; **real fe-src rotate — kết thúc #489→#495 non-determinism-freeze**; JS admin `BVyH-FY7`→`Cixlt_MA` / user `EDsZebvn`→`BhBOG1dn` + CSS admin `Bbtesa6B`→`Ds-E5neu` / user `BmuPz_Dy`→`Beb0Bb1h`; ship-proof real-size + Last-Modified-in-window + `"Database NCC"` marker PRESENT ×1; Mig 63 prod 2/2-col sys.tables **89**; smoke health/admin/eoffice 200 + PE-endpoint 200 + import-route preview-415/confirm-401-live bogus-404). **Prev S107** — admin **`BVyH-FY7`** · user **`EDsZebvn`** (S107 — **Run #489** `21387cd` +office-document 12th sub governance-only; **rotate benign #69-two-mode** [0 fe-src — Vite non-determinism], CSS frozen `Bbtesa6B`/`BmuPz_Dy`, real-size 1.64/1.55MB + Last-Modified-in-window 09:32/09:33 = ship-proof, Mig 62/89 frozen, smoke 200×3; hoist @S107-closeout per H1 flag D-BUNDLE-lặp — ⚠️ closeout-push kế có non-md sẽ rotate tiếp → Run #490 record nằm ở cicd MEMORY [authoritative], hoist ở bundle đầu phiên sau per precedent S99-#485). **Prev S104** — admin **`ChSNAJBK`** · user **`Bn2w1znH`** (S104 — **Run #488** `778fc98` Mig 62 Supplier expand 30-field; real-src-rotate FE 2-app SHA-mirror [form 4-section + Status select + `PathLink` 3 NAS-link], **sys.tables 89 pre==post no-new-table**, prod-verified marker grep-HIT, smoke 200×3; S104-shipped nhưng dòng-live `:27` lag tới S106 → hoist per H1 flag D-BUNDLE). **Prev S97** — admin **`mEGqlNWc`** · user **`Dnrp4PU1`** (S97 — **Run #484** `fb2dfa9` Mig 61 data-fix backfill; bundle rebuild **#69-benign** [0 FE-src change, review-workflow cicd re-snapshot LIVE → `CeTA7Z82`/`CGaAyXen` #483 đã bị #484 rebuild rotate]; backfill A/005/A/008 flag 0→1 prod-verified). **Prev #483** — admin **`CeTA7Z82`** · user **`CGaAyXen`** (S97 — **Run #483** `9e12e80` badge "✅ Đã được CEO duyệt" phiếu đi-hết-lên-CEO [PeFinalizeChip single-source + 6 call-site 2-app, đối xứng chip "⚑ Kết thúc·X"]; FE-only tận-dụng endsBeforeCeo runtime, no BE/mig; JS rotate CSS-frozen #69; byte-#77 "Đã được CEO duyệt" PRESENT cả 2 app + prev-badge additive no-regression; Mig 60 frozen; smoke 200×3 + PE-list 200). **Prev #482** — admin **`DR9q2VUy`** · user **`Bgz8u4E5`** (S97 — **Run #482** `8037fa0` endsBeforeCeo config→RUNTIME [Mig 60 `EndedByLevelFinalize`]: **Mig 60 applied prod** (history-top + col-default-0 EXISTS + backfill=0 UAT-no-marker + sys.tables **89** pre==post); **EF-ternary SQL-Server LIVE-confirmed** GET /purchase-evaluations 200 items=9 + PE-detail `31faef0d` 200 **endsBeforeCeo=False phase=7** = runtime-path chạy = **bug fixed LIVE** (NOT 500); JS rotate 2-app PeWorkflowPanel gate-diff, CSS frozen #69-REFINE; byte-#77 `endsBeforeCeo` PRESENT in-bundle; smoke 200×3. reviewer PASS 0-issue + test 440. **Prev #481** — admin **`Cf0o8dx8`** · user **`x8rppRAK`** (S97 — **Run #481** `1c8fb6a` PE finalize 2-fix [badge "không trình tới"→"Kết thúc tại {cấp}" + đảo default checkbox opt-in]; JS rotate real-FE 2-app `PeWorkflowPanel` diff, CSS frozen `Bbtesa6B`/`BmuPz_Dy` #69-REFINE logic-only; **byte-level #77** NEW `Kết thúc tại`+helper PRESENT / OLD `không trình tới`+`Đã BỎ tick` ABSENT; real-size 1.64/1.54MB; Mig 59/88-table frozen; smoke 200×3. FE-only mirror SHA `bcf812fd`, 0 BE/mig/test). **Prev S96** — admin **`COYAX-yQ`** · user **`0MU-kb4N`** (S96 — **Run #480** `0c2f9f6` price-lock; chuỗi 3 PE deploy #478 `e657faa` checkbox-opt-out → #479 `36cbf8b` chuông-stale-clear (BE-only) → #480 `0c2f9f6` khóa-giá-sau-duyệt, cicd PASS each ~5m; **FE JS rotate THẬT** (PeWorkflowPanel #478 + PeDetailTabs #480, 2-app) real-size 1.64/1.54MB vs 919b SPA-trap, CSS frozen #69-REFINE; Mig 59 frozen 0-mig; +Run #477 `ba4b8e0` NCC seed no-mig prod 21 NCC. **Verify byte-level:** prod `0MU-kb4N` CHỨA checkbox-fix ("BỎ tick"/"Đã BỎ tick") + "✅-static" cũ MẤT → checkbox "ko-được" = browser-cache KHÔNG deploy-fail). **Prev S95** — admin **`0T6vVJST`** · user **`BGXEVZO6`** (S95 — **Run #476** `18a17f5` H17 governance-only deploy; bundle rotate benign #69 CSS-frozen, prod 200×3, Mig 59 unchanged; cicd re-snapshot LIVE — pre-deploy `CkZ1MjC1`/`_-gpX7_Y`, mega-line S93 `CDn40vpV`/`CoPmPBg7` đã bị deploy trung-gian rotate từ S94). **Prev S85** — admin **`aKuNip19`** · user **`BUsL0HeQ`** (S85 — **Run #341** `49ac086` lệch-giờ TZ serialize UTC-with-Z; FE frozen #339+#341 BE-only. Chuỗi ~10 deploy #334→#341 buổi UAT anh Kiệt CV PRO: #334 `5a61254` batch CV PRO 6-fix → #335-#338 6 vòng UAT → #339 `1263c0d` workflow-preserve bug-class S42 → #341 `49ac086` TZ; #342 `d4f6021` docs+cicd BE-frozen, bundle giữ-nguyên gotcha #69-REFINE). **Prev S78** — admin **`CsJetgZH`** · user **`BVS0ApIm`** (S78 — **Run #330** `7886fd0` PE attach-file khi duyệt; bundle ROTATE từ S77 `BqKD3Y23`/`Cn-i349D` dù NO migration enum-only — gotcha #69 non-determ rebuild; cicd ship-proof byte-stable + fake-hash control). **Prev S77** — admin **`BqKD3Y23`** · user **`Cn-i349D`** (S77 — **Run #329** `e823694` banner Trả-lại; cuối chuỗi 10 deploy #320→#329 cùng ngày, cicd PASS each: #320 pill `DsSg6RRz`-era → #321 focus → #322 revert → #323 Mig57+notes `CPm4LTqm`/`BWJUAqEI` → #324 số-âm-đỏ `C6fx-0ea`/`N3sW4Div` → #325 indent `BhnNMucS`/`B1VebpXc` → #326 cờ-gấp-asymmetric `DwXqn37C`/`COXMCv7E` → #327 decouple `B0gboSAg`/`DbDg7pM-` → #328 notify (BE-only, FE frozen) → #329 banner **`BqKD3Y23`**/**`Cn-i349D`**). **Prev S76** — admin **`jOqxW4-p`** · user **`DbsznVvR`** (S76 — **Run #319** `21d1f4e` bảng lưới `` ngân sách viền-ô; chuỗi S76 cùng ngày: #318 `e33481e` feature ma-trận-3-cột + badge quyền-NS `BhFDF9IJ`/`BAkuRl3C` → #319 **`jOqxW4-p`**/**`DbsznVvR`**, cicd PASS each, smoke 3×200, Mig 56 applied prod #318). **Prev S74** — admin **`BYF5vIMJ`** · user **`CB-tiRxd`** (S74 — **Run #315** `8655ebf` Mig 55 CcmNote, cicd PASS ~4m54s: Mig 55 applied prod CcmNote nvarchar(1000) nullable · sys.tables 88 · smoke 4×200 · 0 regression). **Prev S73** — admin **`Bv3jUCNo`** · user **`BWlMBQz6`** (Run #314 `6aa4dcb` FE empty-candidates guard fix; chuỗi 2 deploy: #313 `1d86abc` feature `OlNyG9OD`/`DSzSLVtL` → #314 **`Bv3jUCNo`**/**`BWlMBQz6`**, cicd PASS each). **Prev S72** — admin **`fc_xkNpJ`** · user **`DP-tBcg0`** (Run #312 governance commit `18fced6`; bundle ROTATE do **non-deterministic hash + deploy rebuild-FE-unconditional** (gotcha #69) — 0 FE source change, prod state/DB GIỮ NGUYÊN). **Prev S69** — admin **`BgNCjwsG`** · user **`CBvh0vtf`** (Run #308 PE cờ gấp + ngưỡng CCM; chuỗi 4 deploy session: #305 Văn phòng số foundation → #306 re-skin 10 page → #307 Office golive (BE-only) `Wt54PHYl`/`B99fMU6X` → #308 **`BgNCjwsG`**/**`CBvh0vtf`**). **Prev S68** — admin **`CNUv1jxY`** · user **`CpOskeS1`** (S68 — Run #304 `37752eb` fix tên đen→trắng; chuỗi #303 `6983609` `D532XZKG`/`CuFaBoWt` → #304 **`CNUv1jxY`**/**`CpOskeS1`**, cicd PASS each). **Prev S67** — admin `CcrZqfht`/user `DniDFUB_` (S67 — 6 deploy Run #297→#302; admin rotate chuỗi #298`xkSz9BfE`→#300`PxiZQkaw`→#301`I1fpLeYw`→#302**`CcrZqfht`** · user #297`BumgrwCJ`→#300`B36hGoKd`→#301`DrQYkzh0`→#302**`DniDFUB_`**; #299 tests BE-only cả 2 frozen, cicd PASS each). **Prev S65** — admin `BDwV5d0X`/user `DbVv6rsf` (Run #293-295). Prev S62 admin `0xKYGhhf`/user `C81ZdG9G` (Run #286). **Prev S59:** admin `B1DtNT9C` · user `D6uF3Mln` (Run **#282** `792c030` FINAL — bỏ nút Thêm hạng mục; ships kèm `80b64dd` gỡ Điều khoản TT, #281 cancelled-benign ancestor-verified). Chuỗi S59 cùng ngày: #280 `69997da` (`BKy_8OO9`/`XcZ6PRyA`, ships kèm `f21c55d` table-fixed #279-cancelled) · #278 `9c330d2` self-approve+quick-add-NCC (`BSh2fG2X`/`D22KfpPc`, authz probe 4/4) · #277 `faed59f` SearchableSelect (`ex7Tc92G`/`DzUeSk96`) · #276 `c869d26` rename 71 PMH (`BBA0KSWu`/`DzdTI18G`) · #275 `bbd1554` dọn demo WorkItems (FROZEN BE-only) · #274 `0eafcd3` tree 4 tầng (`DuU7OTym`/`DWyeTzf3`) · #273 `56882ac` wipe + tree v1 (`R9uGRxvw`/`DikfX1RD`). Prev S58: Run #386 `3ebaf84` admin `DMm9rtNA`/user `BUkOMn_Y` (chi tiết session log S58). diff --git a/docs/governance/fable-real-runbook.md b/docs/governance/fable-real-runbook.md index d69f030..f7cd2b1 100644 --- a/docs/governance/fable-real-runbook.md +++ b/docs/governance/fable-real-runbook.md @@ -71,7 +71,7 @@ Rule gitignore neo tại **`.gitignore:92`** (`.claude/fable-real-mode.on`), đ 1. **Anh gõ lệnh** kèm vai + đề-bài: `/fable-real <đề-bài>` (single top-model) HOẶC `/fable-clone <đề-bài>` (ensemble tier-2). 2. **Parse** `{lệnh, vai, đề-bài}` từ `$ARGUMENTS` lượt đó — KHÔNG suy từ note/marker phiên trước. -3. **Vai ∉ roster 12 HOẶC thiếu vai/đề-bài** → **hỏi anh ĐÚNG 1 dòng, KHÔNG tự chọn vai** (owner-gated tầng lệnh + kỷ-luật lead — **KHÔNG code-enforced**). +3. **Vai ∉ roster HOẶC thiếu vai/đề-bài** → **hỏi anh ĐÚNG 1 dòng, KHÔNG tự chọn vai** (owner-gated tầng lệnh + kỷ-luật lead — **KHÔNG code-enforced**). 4. **Chạy engine-đắt ĐÚNG 1 lượt** — lead KHÔNG tự gọi ngoài lượt-lệnh (kể cả HMW-mode ON, kể cả "thấy cần" — AP-4-mới §5.6). 5. **Engine propose → LEAD verify → LEAD tự ghi spec-file 3-mục** [① Tính-năng/đề-bài · ② Cách implement · ③ Checklist vai+deliverable+acceptance đo-được] — **engine KHÔNG tự ghi**. 6. **Worker (model thường MAX) thực-thi THEO spec** bơm qua args. @@ -91,12 +91,12 @@ Rule gitignore neo tại **`.gitignore:92`** (`.claude/fable-real-mode.on`), đ | 3 | **tier** (per-task) | `'fable' \| 'opus' \| undefined` | `hmw.js:18` (field taskList) + `resolveModel hmw.js:38` | `undefined`=inherit top-tier (clone mặc-định) · `'opus'`=pin tier-2 sweep/cost · `'fable'`=nâng lead-tier **CHỈ trong lượt lệnh engine-đắt anh gõ** (H21 — lead KHÔNG tự ý) | | 4 | **checkpointApproved** | boolean | `hmw.js:77-79` (THROW nếu ≠true) | em-main set `true` SAU khi BÁO {số agent·vai·task} @inform → fan-out | | 5 | **taskList[]** | `Array<{role,label,prompt,tier?}>` | `hmw.js:18` + `:71-72` (bắt buộc, non-empty) | mảng lane; **clone = N item CÙNG 1 role** | -| 6 | **role / agentType** | `VALID_ROLES \| undefined` | `hmw.js:22-30` (whitelist) + filter + `agentType` | vai engine-đắt = **anh gán** (H21, mọi vai roster 12; §3/§4 template = `reviewer` · `investigator-codebase`); VALID_ROLES = 12 đủ roster (+2 monitor S110) | +| 6 | **role / agentType** | `VALID_ROLES \| undefined` | `hmw.js:22-36` (whitelist) + filter + `agentType` | vai engine-đắt = **anh gán** (H21, mọi vai roster; §3/§4 template = `reviewer` · `investigator-codebase`); VALID_ROLES = **ĐỦ roster** (số canonical → [`docs/STATUS.md`](../STATUS.md) §Sub-agents; +2 monitor S110, **+2 monitor H24 S121 W2**) | | 7 | **memoryPack** | `Record` | `hmw.js:15,85,103,125` | SLICE `MEMORY.md` của đúng vai (KHÔNG full) → inject prompt | | 8 | **spec** | string | `hmw.js:16,86,126` | acceptance chung mọi lane | | 9 | **run** (alias `wave`) | `{name,dir} \| null` | `hmw.js:19,92-93` | `null`=return-delta-only (mặc-định) · set=RUN-TRACE (sub ghi `sub--.md`) | | 10 | **SCHEMA.memoryDelta** | `{task,verdict,learned,surprise}` 4-field required | `hmw.js:54-64` (required `:57`) | **RETURN-only**; agent KHÔNG tự ghi ký-ức → em-main harvest @P3 | -| 11 | **VALID_ROLES** | `const string[12]` | `hmw.js:22-30` | 8 core + `database-agent`(S57) + `office-document`(S107) + `tooling-auditor`/`harvest-curator`(S110 anh-directed) | +| 11 | **VALID_ROLES** | `const string[]` (ĐỦ roster — **KHÔNG chép độ-dài vào đây**, B1) | `hmw.js:22-36` | 8 core + `database-agent`(S57) + `office-document`(S107) + `tooling-auditor`/`harvest-curator`(S110 anh-directed) + **`lead-view-auditor`/`lead-omission-auditor`(S121 W2, H24)** | | 12 | **engine-label** | string (em-main stamp — KHÔNG có field trong SCHEMA) | `§K.C GAP-2` `harness-11:329` | em-main @P3 gắn nhãn engine đã dùng (xem 2.4) | **resolveModel logic thật (`hmw.js:37-45`) — trích:** @@ -145,7 +145,7 @@ Nguồn: `harness-11-engine.md §K.C:327-330`. Pin để stamp CÓ NGHĨA (khôn **🔴 GAP-1 — scope-creep guard (RULE):** Ảo-run **BẮT BUỘC = N lane CÙNG 1 vai phán-quyết** (multi-lens), **CẤM mixed-roster fan-out**. - Lý-do: `hmw.js` VALID_ROLES nhận đủ vai KHÔNG gate → all-inherit **CHE** leak (mọi vai top-tier nên roster-trộn "trông ổn"; Fable về + phân-tầng thì rò top-tier ensemble sang vai ngoài 2 vị-trí). -- Evidence-form: `taskList[*].role` phải đồng-nhất = ĐÚNG vai anh gán trong lệnh (grep taskList trước fan-out; §3/§4 template = `reviewer`/`investigator-codebase`). Ghi-chú: engine `§K.C:332` đã cập-nhật "cả 12 vai (9 S101; +office-document S107; +2 monitor S110)" khớp `hmw.js:22-30` — luật "no-gate → em-main tự-gác" KHÔNG đổi. +- Evidence-form: `taskList[*].role` phải đồng-nhất = ĐÚNG vai anh gán trong lệnh (grep taskList trước fan-out; §3/§4 template = `reviewer`/`investigator-codebase`). Ghi-chú: engine `§K.C` khai "**TOÀN roster**" khớp `hmw.js:22-36` (lịch-sử: 9 S101 → +`office-document` S107 → +2 monitor H1/H2 S110 → **+2 monitor H24 S121 W2**) — luật "no-gate → em-main tự-gác" KHÔNG đổi. 🔴 **KHÔNG chép số vai vào đây** (B1 → [`docs/STATUS.md`](../STATUS.md) §Sub-agents). - Nấc: **convention** (hmw.js không gate vai; kỷ-luật em-main gác). **🔴 GAP-2 — engine-label stamp (RULE):** `hmw.js` SCHEMA `memoryDelta{task,verdict,learned,surprise}` **KHÔNG có field engine** → em-main **stamp nhãn engine @P3 harvest** (single-writer B3) khi ghi MEMORY entry. @@ -172,7 +172,7 @@ Nguồn: `harness-11-engine.md §K.C:327-330`. Pin để stamp CÓ NGHĨA (khôn | Tình huống | Engine | Cơ-chế thực-thi | |---|---|---| -| anh gõ `/fable-clone <đề-bài>` | 🟢 **lệnh-B ensemble** | `hmw.js parallel` N lane same-role + em-main synthesize (2.3 JSON) — VALID_ROLES 12 đủ roster (S110) | +| anh gõ `/fable-clone <đề-bài>` | 🟢 **lệnh-B ensemble** | `hmw.js parallel` N lane same-role + em-main synthesize (2.3 JSON) — VALID_ROLES **ĐỦ roster** (S110 +2 monitor · S121 W2 +2 monitor H24). 🔴 lane PHẢI mang `tier:'opus'` (GAP#6 — thiếu ⇒ inherit lead ⇒ lead=Fable thành N× Fable = phá đúng mục-đích lệnh; xem `fable-clone.md`) | | anh gõ `/fable-real <đề-bài>` | 🔴 **lệnh-A single** | Agent-tool spawn LẺ 1 agent, deep pass | | anh KHÔNG gõ lệnh engine-đắt | — | mặc-định (sub thường / workflow chuẩn; em-main có thể ĐỀ XUẤT anh gõ khi heavy-judgment) | | việc NHẸ (không trivial) | — | single spawn thường 1 con (KHÔNG ensemble, KHÔNG deep-pass nghi-thức) | @@ -188,7 +188,7 @@ Nguồn: `harness-11-engine.md §K.C:327-330`. Pin để stamp CÓ NGHĨA (khôn > ⚠️ **VACUOUS-hay-THẬT tùy runtime** (`§K.D:332` viết lúc Fable-outage): KHI Fable DOWN → real vs clone hội-tụ Opus-1M = 0 runtime-delta (vacuously-inert đúng nguyên-văn). KHI **Fable UP** (vd S108) → **phân-tầng THẬT bén**: real = single-Fable deep ⟂ clone pin `tier:'opus'` = ensemble tier-2 đúng nghĩa §K.B — cost-lever SỐNG, và **S108 = lần đầu** (dogfood §5.5). **☑ Checklist decision (mỗi mục tick + evidence):** -- [ ] Vai ANH GÁN ∈ roster 12 — evidence: quote nguyên văn lệnh anh (H21; 2 monitor × lệnh-B → limitation K.E) *(🧊 H19: "việc ∈ {reviewer, investigator-codebase}")* +- [ ] Vai ANH GÁN ∈ roster — evidence: quote nguyên văn lệnh anh (H21; 2 monitor × lệnh-B → limitation K.E) *(🧊 H19: "việc ∈ {reviewer, investigator-codebase}")* - [ ] INVOCATION{lệnh, vai, đề-bài} parse đúng từ lượt lệnh — evidence: quote lệnh *(🧊 H19: "đọc marker BƯỚC 0.5b")* - [ ] BƯỚC 0.6 probe lead-runtime — evidence: "lead=Fable" | "lead=Opus-1M(H5)" - [ ] Clone: `taskList[*].role` đồng-nhất (GAP-1) — evidence: grep taskList @@ -197,7 +197,7 @@ Nguồn: `harness-11-engine.md §K.C:327-330`. Pin để stamp CÓ NGHĨA (khôn ## 3. LANE INVESTIGATOR-CODEBASE (ground-truth — xác minh sự thật) -> **Vị-trí (b) của H19** — "Ground-truth / xác-minh sự-thật" = `investigator-codebase` (truy bằng-chứng gốc `file:line` + `sqlcmd` + `git`, chống bịa + RCA). `investigator-api` và `database-agent` **EXCLUDED** khỏi 2 vị-trí phán-quyết (`harness-11-engine.md:320`, K.A.b). *(H21: section này = **template tham-chiếu** cho vai hay-gán-nhất; vai thực-tế do ANH GÁN trong lệnh — mọi vai roster 12 hợp-lệ, "EXCLUDED" = ngữ-cảnh 2-vị-trí H19 cũ.)* +> **Vị-trí (b) của H19** — "Ground-truth / xác-minh sự-thật" = `investigator-codebase` (truy bằng-chứng gốc `file:line` + `sqlcmd` + `git`, chống bịa + RCA). `investigator-api` và `database-agent` **EXCLUDED** khỏi 2 vị-trí phán-quyết (`harness-11-engine.md:320`, K.A.b). *(H21: section này = **template tham-chiếu** cho vai hay-gán-nhất; vai thực-tế do ANH GÁN trong lệnh — mọi vai roster hợp-lệ, "EXCLUDED" = ngữ-cảnh 2-vị-trí H19 cũ.)* > **Luật ở đâu, nút ở đâu:** ngữ-nghĩa 2 mode + 3 GAP-guard + 3 floor-point = **engine §K** (`harness-11-engine.md:322-334`) — KHÔNG lặp lại ở đây. Section này = **cách bấm nút**: biến vào lane, tham-số spawn, checklist tick-được, fallback. ### 3.1 Bảng BIẾN đầu vào lane @@ -311,7 +311,7 @@ Ghi-chú shape: Tick mỗi lần chạy lane (cả 2 mode trừ khi ghi `[clone]`/`[real]`): -- [ ] **1. INVOCATION xác-định đúng** — {lệnh, vai, đề-bài} từ lượt lệnh anh; vai ∈ roster 12 (§2.1-bis, H21) — *evidence:* quote nguyên-văn lệnh anh gõ (🧊 cũ: `$mode` từ Test-Path marker) +- [ ] **1. INVOCATION xác-định đúng** — {lệnh, vai, đề-bài} từ lượt lệnh anh; vai ∈ roster (§2.1-bis, H21) — *evidence:* quote nguyên-văn lệnh anh gõ (🧊 cũ: `$mode` từ Test-Path marker) - [ ] **2. Mỗi claim ∈ `$claimsList` có verdict** TRUE/FALSE/PARTIAL/UNCERTAIN — *evidence:* block `CLAIMS:` đủ N dòng = `len($claimsList)` - [ ] **3. Mỗi verdict neo `file:line` MỞ-ĐƯỢC** — *evidence:* re-open `Read :` / `Grep -n` khớp nội-dung (persona `:43-48`) - [ ] **4. Fabricate-guard** — thiếu chứng → "uncertain + lý-do", KHÔNG đoán — *evidence:* grep return có `uncertain|không tìm thấy` ở claim thiếu chứng (persona `:93`) @@ -441,13 +441,13 @@ args = { | GAP | Rủi-ro (engine) | Cách bấm | Nguồn | |---|---|---|---| -| **GAP-1 scope-creep** | `hmw.js` VALID_ROLES nhận cả 12 vai KHÔNG gate → all-inherit CHE leak | CLONE `taskList` MỌI `role:'reviewer'` (N-lane CÙNG vai, KHÔNG mixed-roster) | `§K.C:328` · `hmw.js:22-30` | +| **GAP-1 scope-creep** | `hmw.js` VALID_ROLES nhận **TOÀN roster** KHÔNG gate → all-inherit CHE leak | CLONE `taskList` MỌI `role:'reviewer'` (N-lane CÙNG vai, KHÔNG mixed-roster) | `§K.C:328` · `hmw.js:22-36` | | **GAP-2 engine-label** | SCHEMA `memoryDelta` KHÔNG field engine | em-main **stamp nhãn engine @P3 harvest** (`real\|clone--Sxxx`) = convention | `§K.C:329` · `hmw.js:54-64` | | **GAP-3 AS-10 fragment** | N lane giữ Bash (fails-open) → phân-mảnh trí-nhớ | N lane **RETURN-only** → em-main ghi **1 entry / vai** (+ nhãn) | `§K.C:330` · `fable-real.md:26` | ### 4.5 — CHECKLIST thi-hành (tick-được, mỗi mục có evidence-form) -- [ ] **1. INVOCATION xác-định đúng** — {lệnh, vai, đề-bài} từ lượt lệnh anh; vai ∈ roster 12 (§2.1-bis, H21). *Evidence:* quote nguyên-văn lệnh anh gõ. 🧊 *(cũ H19: Mode resolved từ Test-Path marker + BƯỚC 0.5b.)* +- [ ] **1. INVOCATION xác-định đúng** — {lệnh, vai, đề-bài} từ lượt lệnh anh; vai ∈ roster (§2.1-bis, H21). *Evidence:* quote nguyên-văn lệnh anh gõ. 🧊 *(cũ H19: Mode resolved từ Test-Path marker + BƯỚC 0.5b.)* - [ ] **2. Runtime tier probed** — BƯỚC 0.6 xác-định `inherit`=Fable\|Opus. *Evidence:* probe self-report `"claude-fable-5"`\|`"opus"` (`session-start.md:35-37`). - [ ] **3. `$reviewTarget` chốt** — diff-range/file-set cụ-thể. *Evidence:* `git diff --stat base..head` (số file, +Y/-Z LOC). - [ ] **4. 6-category áp đủ** (Cat-6 CHỈ khi `$outwardFlag=Y`). *Evidence:* bảng 6-dòng PASS/FAIL trong `$verdictForm` (`reviewer.md:210-217`). @@ -498,15 +498,15 @@ args = { | 🧊 `MODE` (H19 retired) | enum `{real, clone}` | derive: `MARKER_PRESENT` → `real`; VẮNG → `clone` (mặc-định). Semantic INVERSE hmw (`harness-11-engine.md:325`) | | `LEAD_MODEL` | string | `session-start.md:35-37` BƯỚC 0.6 probe → `claude-fable-5[1m]` HOẶC `claude-opus-4-8[1m]` (model-tier-v3: anh chọn per-session; outage-fallback H5) | | 🧊 `ANH_CONSENT_REAL` (H19 retired) | bool | anh đã gõ `/fable-real` trong transcript phiên (lệnh đó Write marker) — K.D point-2 (`harness-11-engine.md:332`) | -| 🧊 `POSITION` (H19 retired — thay bằng `INVOCATION.vai`) | enum `{reviewer, investigator-codebase}` | §K.A (`harness-11-engine.md:320`) — "CHỈ 2 vai" = ngữ-cảnh H19; H21: vai anh gán ∈ roster 12 | +| 🧊 `POSITION` (H19 retired — thay bằng `INVOCATION.vai`) | enum `{reviewer, investigator-codebase}` | §K.A (`harness-11-engine.md:320`) — "CHỈ 2 vai" = ngữ-cảnh H19; H21: vai anh gán ∈ roster | | **`INVOCATION`** (H21) | struct `{lệnh, vai, đề-bài}` | parse từ lượt lệnh anh gõ (`/fable-real`\|`/fable-clone <đề-bài>`) — KHÔNG file-state, 0 persist (§2.1-bis) | -| **`ROLE_VALID`** (H21) | bool | `INVOCATION.vai ∈ roster 12`? (investigator-codebase · investigator-api · implementer-backend · implementer-frontend · frontend-designer · database-agent · office-document · test-specialist · reviewer · cicd-monitor · tooling-auditor · harvest-curator) — thiếu/lạ → hỏi anh 1 dòng, KHÔNG tự chọn vai | +| **`ROLE_VALID`** (H21) | bool | `INVOCATION.vai ∈ roster`? (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/lạ → hỏi anh 1 dòng, KHÔNG tự chọn vai. 🔴 Danh-sách này là **BẢN SAO** — nguồn thật = `hmw.js` VALID_ROLES `:22-36`; lệch ⇒ tin `hmw.js` | | **`SPEC_PATH`** (H21) | path | spec-file 3-mục [đề-bài · cách-impl · checklist vai+deliverable+acceptance] LEAD ghi SAU verify (engine propose → lead verify+ghi, engine KHÔNG tự ghi) | **Checklist (tick từng mục · evidence bên phải):** - [ ] 🧊 **P0 (H19 retired) — marker-state đọc THẬT** (KHÔNG đoán từ note phiên trước) → `Test-Path .claude/fable-real-mode.on`. *Evidence:* in ra `MARKER_PRESENT=` + `mtime` marker. -- [ ] **P0-mới (H21) — INVOCATION đọc THẬT từ lượt lệnh** (quote nguyên-văn lệnh anh làm evidence — **KHÔNG đoán**). *Evidence:* dòng lệnh `/fable-real`\|`/fable-clone <đề-bài>` anh gõ lượt này; parse `{lệnh, vai, đề-bài}` + check `ROLE_VALID` (vai ∈ roster 12) — thiếu → hỏi anh 1 dòng, KHÔNG tự chọn vai. +- [ ] **P0-mới (H21) — INVOCATION đọc THẬT từ lượt lệnh** (quote nguyên-văn lệnh anh làm evidence — **KHÔNG đoán**). *Evidence:* dòng lệnh `/fable-real`\|`/fable-clone <đề-bài>` anh gõ lượt này; parse `{lệnh, vai, đề-bài}` + check `ROLE_VALID` (vai ∈ roster) — thiếu → hỏi anh 1 dòng, KHÔNG tự chọn vai. - [ ] 🧊 *(H19 retired)* **P1 — MODE xác-định** từ P0. *Evidence:* `MODE=real` (marker CÓ) hoặc `MODE=clone` (VẮNG, mặc-định). - [ ] **P1-mới (H21) — `$engine` xác-định từ `INVOCATION.lệnh`.** *Evidence:* `/fable-real` → `real-single` · `/fable-clone` → `clone-ensemble` (quote lệnh). - [ ] **P2 — lead-runtime probe (Fable/Opus)** = BƯỚC 0.6 (`session-start.md:35-37`), per-session KHÔNG tin note cũ. *Evidence:* `LEAD_MODEL=`. ⚠️ **H5 per-run fallback:** Fable DOWN → lệnh-A chạy `single-Opus-1M` **theo TỪNG lần** trong CHÍNH lượt lệnh (`fable-real.md:16`, `harness-11-engine.md:323`; 🧊 H19 wording "không đổi MODE toàn-cục"). @@ -517,7 +517,7 @@ args = { - `clone` = **N-lane ensemble tier-2** (multi-lens; để dành quota top-model cho lead — `fable-clone.md:8`). - ⚠️ **Cost-delta tùy runtime:** Fable DOWN → real vs clone 0 tier-delta (chỉ khác N-lane count). **Fable UP** → real=Fable-deep (đắt nhất/lần) ⟂ clone `tier:'opus'`=tier-2 (giữ quota Fable cho lead). Ghi honest theo probe (`harness-11-engine.md:332,334`). - [ ] 🧊 *(H19 retired)* **P5 cũ — scope-lock 2 vai** (`POSITION ∈ {reviewer, investigator-codebase}`, vai khác EXCLUDED). -- [ ] **P5-mới (H21) — scope-lock = `ROLE_VALID`**: `INVOCATION.vai ∈ roster 12` do ANH gán (thiếu/lạ → hỏi anh, KHÔNG tự chọn); ⚠️ 2 monitor ĐÃ vào VALID_ROLES=12 (S110) → hết limitation; vai-INVALID nay = STOP-HARD throw (REC-3 2026-07-13, KHÔNG fail-soft). Ngoài lượt lệnh: mọi vai giữ model roster (H8 all-inherit), lead KHÔNG tự elevate (K.D mới). *Evidence:* vai lượt này + quote lệnh. +- [ ] **P5-mới (H21) — scope-lock = `ROLE_VALID`**: `INVOCATION.vai ∈ roster` do ANH gán (thiếu/lạ → hỏi anh, KHÔNG tự chọn); ⚠️ 2 monitor H1/H2 ĐÃ vào VALID_ROLES (S110) + **2 monitor H24 vào S121 W2** → hết limitation; vai-INVALID nay = STOP-HARD throw (REC-3 2026-07-13, KHÔNG fail-soft). Ngoài lượt lệnh: mọi vai giữ model roster (H8 all-inherit), lead KHÔNG tự elevate (K.D mới). *Evidence:* vai lượt này + quote lệnh. ---