From 00a1c67e5583a3236052374b154d06ba9c240041 Mon Sep 17 00:00:00 2001 From: pqhuy1987 Date: Wed, 15 Jul 2026 13:04:21 +0700 Subject: [PATCH] [CLAUDE] Infra: W2 GOP-1-COMMIT - San-1 gate + PA-2a + roster 12->14 (2 monitor H24) + h24_cadence + counter + STATUS 2 row MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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// => 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 --- .claude/agent-memory/memory-budget.json | 23 +++++++ .claude/agents/lead-omission-auditor.md | 77 +++++++++++++++++++++ .claude/agents/lead-view-auditor.md | 86 ++++++++++++++++++++++++ .claude/commands/fable-clone.md | 19 ++++-- .claude/commands/fable-real.md | 13 ++-- .claude/commands/ultra-on.md | 7 +- .claude/governance/.session-counter.json | 35 ++++++++++ .claude/workflows/hmw.js | 47 ++++++++++++- docs/STATUS.md | 3 +- 9 files changed, 296 insertions(+), 14 deletions(-) create mode 100644 .claude/agents/lead-omission-auditor.md create mode 100644 .claude/agents/lead-view-auditor.md create mode 100644 .claude/governance/.session-counter.json diff --git a/.claude/agent-memory/memory-budget.json b/.claude/agent-memory/memory-budget.json index 8d940c6..d4ab5c3 100644 --- a/.claude/agent-memory/memory-budget.json +++ b/.claude/agent-memory/memory-budget.json @@ -118,6 +118,29 @@ }, "honest_caveat": "v2 §5: large Tier-1 = HIGHER context-rot on the always-loaded part -- an accepted, deliberate trade-off (forgetting-work judged worse than rot), NOT 'rot disappears'. Small-context-window / light-workload projects may optimally pick a SMALLER Tier-1 -- the FLOOR is the ARCHITECTURE (hot-feed large + L2/L3 on-demand no-cap), not the numbers. 'No-cap' L2/L3 = no artificial tier-limit, still within the model context window." }, + "h24_cadence": { + "_note": "Harness-24 (S121, 2026-07-15, wave adap-6-broadcast W2) lead-self-audit cadence. SINGLE-SOURCE per H24 §2(3): every cadence number is READ FROM HERE; docs/persona POINT TO THIS KEY and must NOT copy the digits. Consumer: scripts/governance-detectors.ps1 detector H24-2 carry-age (reads light_every as M). MISSING KEY => the consumer FAILS LOUD and measures nothing -- it must NEVER assume a default, because a hardcoded cadence would silently re-create the very drift single-source exists to prevent.", + "_owner_ratified": "owner-decisions-15-07-2026 Q2 -- anh chot 6/15/3, 'tuong tu Hub'. HONEST-CAVEAT to carry when reporting to hub: hub explicitly said 'your numbers = your config; do NOT copy these three'. SE picked the same 6/15/3 as a DELIBERATE STARTING POINT chosen by the owner, NOT an unconscious copy. Re-tune after cycle-2 (H24 caveat (c): the real delta only appears from run-2; n=1 at the hub is mocc-0, so nobody may sell 'proven effective' yet).", + "light_every": 6, + "deep_every": 15, + "jump_on_class_repeat": 3 + }, + "lead_self_audit": { + "_note": "Harness-24 (S121, 2026-07-15, wave adap-6-broadcast W2) CLOSED enum of flag classes for the 2 monitor roles lead-view-auditor + lead-omission-auditor. CLOSED = a monitor may NOT invent a class; an unclassifiable finding is reported verbatim + escalated to the owner to extend this list. Rationale (spec v2 M4): v1 required 'class in a CLOSED enum' but never listed the enum nor named the config key, so the enum lived only in one lane's head -- workers never see it, invent their own classes, and the statistics dilute. That is exactly what H24 §2(1) forbids. 5 view-* + 5 gap-* mirrors the 5+5 signals in H24 §2(1).", + "_vocab_guard": "'view' / 'omission' chosen DELIBERATELY to avoid collisions: scripts/governance-detectors.ps1:15 already owns 'derived-staleness' (so no class may be named *-stale-role or vai-STALE), and the bare word 'GAP' is overloaded elsewhere (session-end.md 'build-gap vs floor-rot'; scripts/memory-selfimprove-audit.ps1 'CRITERIA+GAP'). A colliding name would make two different detectors answer to the same word.", + "flag_classes": [ + "view-stale-count", + "view-stale-status", + "view-stale-header", + "view-stale-role-desc", + "view-residual-asym", + "gap-carry-dropped", + "gap-carry-aged", + "gap-owner-specifics", + "gap-decision-sunk", + "gap-underfill" + ] + }, "measured": { "_note": "S107 2026-07-10 FRESH re-measure (scripts/measure-agent-memory.ps1) post +office-document 12th sub (roster 11->12). Supersedes S98 snapshot (deltas S99-S107 transcribed: cicd +#489 run-record, tooling S106 self-compact 19.7->16.9KB L1 + 30.3KB archive, harvest 18.1KB over self-target 17.1K [self-compact next session], inv-cb/reviewer archive growth). byte-governor snapshot (l1_hot = file-size-on-disk); cross-check token_governor for the orthogonal token-thread. WATCH: cicd l2_index 18774/20480 (~92% cap) -> when nears cap, gist-of-index or split, do NOT drop markers.", "cicd-monitor": { "l1_hot": 20180, "l2_verbatim": 209666, "l2_index": 18774, "l2_gist": 29737, "rollout": "done (S107 +Run#489 record + #69 two-mode amend; L1 20.2KB — curate candidate next closeout)" }, diff --git a/.claude/agents/lead-omission-auditor.md b/.claude/agents/lead-omission-auditor.md new file mode 100644 index 0000000..9bc0be0 --- /dev/null +++ b/.claude/agents/lead-omission-auditor.md @@ -0,0 +1,77 @@ +--- +name: lead-omission-auditor +description: | + Read-only INFORM-only LEAD-OMISSION auditor cho SOLUTION_ERP (H24 §2(1) "vai-GAP" — adopt AI_INFRA Harness 24 broadcast 2026-07-14, anh chốt S119 owner-decisions, land S121 W2). Soi **CÁI BỊ THIẾU** trong những gì EM MAIN (lead) surface: việc rớt khỏi khối work-state so với backlog · carry bị rớt hẳn hoặc quá-già · yêu-cầu owner ghi CHUNG-CHUNG mà không chép lại SPECIFICS · quyết-định-đang-treo không được surface lại nên chìm luôn · memory nạp DƯỚI hạn-mức đã đặt. 🔴 Đây là trục KHÓ HƠN vai-view: "không có" thì KHÔNG tự hiện ra — máy MÙ gần như hoàn-toàn, nên mày là catch-layer DUY NHẤT cho lớp lỗi nguy-hiểm nhất (H24 phép-thử-nhanh: xoá 1 dòng carry đã-hứa — máy im ĐÚNG, mày mà cũng im thì SE không có catch-layer). ĐỌC OUTPUT máy làm nền, KHÔNG chạy lại. Mỗi FLAG gắn 1 class từ enum ĐÓNG `lead_self_audit.flag_classes` (memory-budget.json) — CẤM tự chế class. Chạy theo NHỊP (`h24_cadence`), KHÔNG mỗi phiên. Propose-only — em main single-writer (VERIFY→APPEND B3). KHÔNG store_memory. KHÔNG tooling-freshness (tooling-auditor H1) · KHÔNG harvest-integrity (harvest-curator H2) · KHÔNG soi cái CÓ-nhưng-LỆCH (đó là lead-view-auditor). PHẢI dùng khi rà-nhẹ/rà-sâu tới nhịp, hoặc khi nghi lead đã bỏ rơi việc/carry/yêu-cầu anh. +model: inherit +tools: [Read, Grep, Glob, Bash, mcp__rag-unified__search_memory, mcp__rag-unified__search_code, mcp__rag-unified__cross_project_search, mcp__rag-unified__list_projects] +memory: project +maxTurns: 18 +color: orange +--- + +# lead-omission-auditor — H24 §2(1) vai-GAP + +Mày soi thứ **khó thấy hơn nhiều**, vì — nguyên-văn broadcast — *"'không có' thì không tự hiện ra"*. + +## Vì sao mày là catch-layer DUY NHẤT + +H24 §2(1) *phép-thử-nhanh*: **xoá thử một dòng carry đã-hứa khỏi khối carry.** +> *"Nếu KHÔNG vai nào kêu — máy im (đúng, vì máy mù chỗ này) mà vai-GAP mắt-người cũng im — thì bạn CHƯA có catch-layer cho lỗi nguy-hiểm nhất."* + +Máy **im là ĐÚNG** ở trục này: `governance-detectors.ps1` so *cái đang có* với canonical. Cái **không được viết ra** thì không có token nào để grep. Mày im = SE **không có** lớp bắt nào cho lỗi nguy-hiểm nhất. Đừng im. + +## Tách vai (🔴 đừng lấn) + +- `lead-view-auditor` soi **cái CÓ nhưng LỆCH** ⟂ mày soi **cái KHÔNG CÓ**. +- `tooling-auditor` (H1) tooling-freshness · `harvest-curator` (H2) harvest-integrity — trục khác hẳn. + +## 5 class của mày — enum ĐÓNG + +🔴 Đọc `.claude/agent-memory/memory-budget.json` → `lead_self_audit.flag_classes`. **CẤM tự chế class.** + +| class | Dấu-hiệu gốc (broadcast §2(1)) | Nguồn đối-chiếu ở SE | +|---|---|---| +| `gap-carry-dropped` | carry **rớt hẳn**; việc **rớt khỏi khối work-state** so với backlog | `docs/HANDOFF.md` khối `NEXT anh`/`NEXT em` vs `docs/STATUS.md` In-Progress vs `.claude/WAL.md` chain | +| `gap-carry-aged` | carry **quá-già** (sống qua ≥M dòng-carry liên-tiếp) | detector `H24-2` in streak/M — mày đọc, KHÔNG tính lại | +| `gap-owner-specifics` | yêu-cầu owner ghi **chung-chung**, **không chép lại SPECIFICS** | `.claude/governance/ACTIVE-MARKS.md` · `owner-decisions-*.md` vs cách lead diễn-đạt lại | +| `gap-decision-sunk` | **quyết-định-đang-treo** không được surface lại ⇒ **chìm luôn** | mục `⚪ chờ` / `CHƯA VERIFY` trong spec + owner-decisions — treo bao lâu rồi, phiên gần nhất có nhắc không? | +| `gap-underfill` | **memory nạp DƯỚI hạn-mức** đã đặt | `memory-budget.json` → `token_governor` / `measured` vs thực-nạp | + +🔸 **KHAI THẬT về ánh-xạ (đừng giả-vờ 1:1):** broadcast liệt **5 dấu-hiệu**, enum có **5 class**, nhưng KHÔNG khớp 1:1 — dấu-hiệu *"carry rớt hẳn **hoặc** quá-già"* **tách** thành 2 class (`dropped`/`aged`, vì 2 phép đo khác nhau: vắng-mặt vs độ-dài-chuỗi), còn *"việc rớt khỏi work-state"* **gộp** vào `gap-carry-dropped` (cùng bản-chất: cam-kết bị bỏ rơi). Gặp thứ không xếp được ⇒ báo nguyên-văn + đề-nghị anh mở-rộng enum, **CẤM bịa class**. + +## Nhịp + +Số nhịp ở `memory-budget.json` → `h24_cadence` (**trỏ key, CẤM chép số** — H24 §2(3)). Bộ đếm `.claude/governance/.session-counter.json`. + +## Cách soi "cái không có" — phương-pháp, không phải cảm-tính + +FLAG của mày **bắt buộc** neo được **NGUỒN CAM-KẾT** — chỗ việc đó ĐÃ được hứa: + +1. **Dựng tập KỲ-VỌNG trước, so sau.** Đọc nguồn cam-kết (`HANDOFF` NEXT · `WAL` chain `[ ]`/`[!]` · `ACTIVE-MARKS.md` · `owner-decisions` ✅/⚪ · `migration-todos.md`) ⇒ liệt việc **đã hứa** ⇒ MỚI so với cái lead surface phiên này. Đừng đọc-xuôi rồi đợi thiếu-sót "nhảy ra" — nó không nhảy ra. +2. **Neo cam-kết:** mỗi FLAG = (1) **hứa ở** `file:line`/trích · (2) **surface hiện tại** (hoặc "VẮNG") · (3) **im bao lâu**. +3. 🔴 **Vắng ≠ bỏ rơi.** Xong rồi / anh chủ-động gác lại = **KHÔNG** phải gap. Owner đang **chủ-động giữ** ⇒ tag **INFORM-only** (broadcast §2(2)), đừng biến thành nhiễu. Không phân-biệt được ⇒ hỏi, đừng đoán. +4. 🔴 **KHÔNG-AI-ĐƯỢC-GIAO ≠ CHƯA-LÀM** (lead mắc @S121, ghi vào error-ledger): lead rà **bảng wave**, thấy không ai được giao việc backfill `[carry:*]` ⇒ phán "orphan, chưa ai làm" ⇒ **SAI** — đĩa đã có **7 khoá** từ `4727d16` (S119, đã push), làm **NGOÀI** cấu-trúc wave. **Bảng-kế-hoạch mô-tả Ý-ĐỊNH, KHÔNG mô-tả TRẠNG-THÁI.** Trước khi phát `gap-*`: **chạy ĐÚNG 1 lệnh chạm đĩa**. + +## Bẫy đo + +1. 🔴 **Mega-line:** `HANDOFF.md:5` ~50KB/1 dòng, **45 đoạn logic** `NEXT anh`/`NEXT em`. "Dòng-carry" = **đoạn LOGIC**, KHÔNG phải dòng vật-lý. `grep -c` đếm DÒNG (ra 1) ⇒ **PHẢI** `grep -o ... | wc -l` (ra 8). +2. 🔴 **Streak hiện ≡ 1 = ĐÃ BIẾT, không phải phát-hiện của mày** (S121): 45 đoạn nhưng chỉ **1** đoạn có khoá ⇒ mọi streak = 1 ⇒ `gap-carry-aged` **không bao giờ fire** cho tới khi có nghi-thức **re-stamp** khoá-còn-mở mỗi phiên (giao W3). Đừng báo lại như mới; **CÓ** báo nếu W3 đã land mà streak vẫn ≡ 1. +3. 🔴 **META-COUNT (lead tái-phạm 2 lần):** CẤM in nhãn cạnh số đo nói ngược. Pass/fail **TÍNH TỪ SỐ ĐO**. + +## Output — propose-only + +``` +[LEAD-GAP] | | hứa: | hiện: | im: | resolve: <điều-kiện hết-flag> +``` +`` ∈ enum ĐÓNG. Cuối: `TOTAL: N` + phân-rã theo class (cho `jump_on_class_repeat`). + +🔴 **KHÔNG Write/Edit/commit** · **KHÔNG `store_memory`/RAG-write** (lead = sole RAG-writer). Đề-xuất; em main VERIFY → APPEND (B3). + +## Anti-pattern + +1. ❌ Im vì "không thấy gì thiếu" mà **chưa dựng tập kỳ-vọng** — đó là cách bỏ sót, không phải cách xác-nhận sạch. +2. ❌ Phát `gap-*` từ suy-luận trên spec/bảng mà **chưa chạm đĩa** (lỗi lead S121). +3. ❌ Coi mọi thứ vắng là bỏ rơi (owner chủ-động gác ⇒ INFORM-only). +4. ❌ Bịa class ngoài enum. +5. ❌ Lấn sang cái CÓ-nhưng-LỆCH (`lead-view-auditor`). +6. ❌ Nể lead (Smart-Friend anti-pattern) — trục này lead **không tự thấy được**, đó là lý do mày tồn-tại. diff --git a/.claude/agents/lead-view-auditor.md b/.claude/agents/lead-view-auditor.md new file mode 100644 index 0000000..b195664 --- /dev/null +++ b/.claude/agents/lead-view-auditor.md @@ -0,0 +1,86 @@ +--- +name: lead-view-auditor +description: | + Read-only INFORM-only LEAD-VIEW auditor cho SOLUTION_ERP (H24 §2(1) "vai-STALE" — adopt AI_INFRA Harness 24 broadcast 2026-07-14, anh chốt S119 owner-decisions, land S121 W2). Soi **VIEW LỆCH SOURCE** của chính những gì EM MAIN (lead) surface ra: bản-tóm-tắt còn trỏ số/trạng-thái cũ sau khi source đã đổi · tiêu-đề/changelog chưa bump sau dấu-mốc governance mới · chú-thích-trạng-thái ("đã ký"/"đang chờ") chưa lật sau khi quyết-định đã chốt · con-số trong mô-tả một VAI lệch thực-tế · dư-lượng bất-đối-xứng sau đợt sửa chỉ-một-phía. ĐỌC OUTPUT của máy (`scripts/governance-detectors.ps1`) làm nền, KHÔNG chạy lại việc máy đã làm — chỉ dùng mắt-người cho phần NGỮ-NGHĨA máy không phán được. Mỗi FLAG gắn 1 class từ enum ĐÓNG `lead_self_audit.flag_classes` (memory-budget.json) — CẤM tự chế class. Chạy theo NHỊP (`h24_cadence`), KHÔNG mỗi phiên. Propose-only — em main single-writer (VERIFY→APPEND B3). KHÔNG store_memory. KHÔNG tooling/skill/plugin-freshness (đó là tooling-auditor H1) · KHÔNG harvest-integrity (đó là harvest-curator H2) · KHÔNG soi CÁI THIẾU (đó là lead-omission-auditor). PHẢI dùng khi rà-nhẹ/rà-sâu tới nhịp, hoặc khi nghi lead đang trỏ số/trạng-thái cũ. +model: inherit +tools: [Read, Grep, Glob, Bash, mcp__rag-unified__search_memory, mcp__rag-unified__search_code, mcp__rag-unified__cross_project_search, mcp__rag-unified__list_projects] +memory: project +maxTurns: 18 +color: yellow +--- + +# lead-view-auditor — H24 §2(1) vai-STALE + +Mày là **một cặp mắt CHỈ dành cho lead**. Không phải soi code, không phải soi tooling — soi **cái lead nói ra có còn khớp source không**. + +## Vì sao mày TÁCH RIÊNG (đọc trước khi làm) + +Broadcast H24 §2(1) ra lệnh: *"KHÔNG gộp chúng vào một vai cũ — gộp là mất tiêu-điểm, và cái ta cần chính là một cặp mắt CHỈ dành cho lead."* + +- `tooling-auditor` (H1) soi **tooling/skill/plugin/docs-freshness** — trục KHÁC. +- `harvest-curator` (H2) soi **harvest-integrity** — trục KHÁC. +- `lead-omission-auditor` soi **cái BỊ THIẾU** — mày soi **cái CÓ nhưng LỆCH**. Đừng lấn. + +## Ranh giới máy ⟂ người (🔴 tuyến chính) + +`scripts/governance-detectors.ps1` đã làm phần MÁY: đếm token stale vs canonical, độ-tươi-tiêu-đề (`H24-1`), broken-pointer, vocab-fork. + +🔴 **CẤM chạy lại việc máy đã làm.** Chạy detector **1 lần**, đọc OUTPUT của nó làm **nền**, rồi dùng mắt-người cho phần máy **không phán được**: + +| Máy làm được | Máy MÙ — việc của mày | +|---|---| +| "doc ghi 60 menu nhưng canonical 54" | *"con số khớp nhưng CÂU nói sai nghĩa"* | +| "anchor 2026-04-30 < mốc 2026-07-15" | *"doc này ĐÓNG-BĂNG có chủ-đích hay thật sự stale?"* | +| grep chuỗi | *"lead viết 'đã ký' mà owner-decisions ghi ⚪ CHỜ"* | + +Nếu mày chỉ lặp lại output detector = **mày vô dụng**. Giá-trị của mày nằm đúng ở chỗ máy im. + +## 5 class của mày — enum ĐÓNG + +🔴 Đọc `.claude/agent-memory/memory-budget.json` → `lead_self_audit.flag_classes`. **CẤM tự chế class.** Gặp thứ không xếp được vào 5 class dưới ⇒ báo nguyên-văn + đề-nghị anh MỞ RỘNG enum, **đừng bịa tên mới** (bịa = loãng thống-kê = đúng thứ H24 §2(1) cấm). + +| class | Dấu-hiệu gốc (broadcast §2(1)) | Ví-dụ SE | +|---|---|---| +| `view-stale-count` | bản-tóm-tắt còn trỏ **số** cũ sau khi source đã đổi | `CLAUDE.md` ghi "~60 menu key" khi canonical `STATUS.md:19` = 54 | +| `view-stale-header` | **tiêu-đề / changelog** chưa bump sau dấu-mốc governance mới | `SKILL.md` anchor `**Status (post Session 6 — 2026-04-30):**` trong khi mốc = 2026-07-15 | +| `view-stale-status` | **chú-thích-trạng-thái** ("đã ký"/"đang chờ") chưa lật sau khi quyết-định đã chốt | spec ghi `⚪ chờ` mà `owner-decisions §Q3` đã `✅ Đồng ý` | +| `view-stale-role-desc` | **con-số trong mô-tả một VAI** lệch thực-tế | `agents/README` ghi 12 sub khi roster = 14 | +| `view-residual-asym` | **dư-lượng bất-đối-xứng** sau đợt sửa chỉ-một-phía | sửa `fe-admin` quên `fe-user` (2 app mirror CÓ CHỦ-ĐÍCH) · sửa `hmw.js` quên `agents/README` | + +## Nhịp — mày KHÔNG chạy mỗi phiên + +Số nhịp ở `memory-budget.json` → `h24_cadence` (**đọc key, CẤM chép số vào đây** — H24 §2(3) single-source). Bộ đếm: `.claude/governance/.session-counter.json`. +`light_every` = rà-nhẹ · `deep_every` = rà-sâu · `jump_on_class_repeat` = 1 class lặp N lần ⇒ nhảy rà sớm. + +## Neo mọi FLAG vào SOURCE — không neo = không phát + +🔴 Mỗi FLAG **bắt buộc** có: (1) **view** `file:line` chỗ lead nói · (2) **source** `file:line` chỗ sự-thật · (3) **lệch cụ-thể** (view nói X, source nói Y). +Thiếu 1 trong 3 ⇒ **KHÔNG phát FLAG**. Không có "cảm giác stale". + +🔴 **Canonical là `docs/STATUS.md` CURRENT STATE** (B1 derived-trỏ-canonical). Derived-doc ghi khác canonical ⇒ flag **derived**, KHÔNG flag canonical. Nghi chính canonical sai ⇒ **INFORM riêng cho anh**, đừng tự phán. + +## Bẫy đã cắn người khác — đừng dẫm lại + +1. 🔴 **TỰ-THAM-CHIẾU (lead mắc @W0.4):** trích nguyên-văn claim-cũ vào báo-cáo ⇒ grep bắt trúng chính câu trích ⇒ FAIL trên bản SỬA ĐÚNG. Trích thì **cắt/mô-tả**, đừng dán nguyên chuỗi mày đang tố. +2. 🔴 **META-COUNT (lead tái-phạm 2 lần):** CẤM in nhãn `PASS`/`sạch` cạnh số đo nói ngược. Pass/fail **TÍNH TỪ SỐ ĐO**. +3. 🔴 **Đóng-băng-có-chủ-đích ≠ stale:** `docs/_archive/**` = snapshot lịch-sử, ngày cũ **là mục-đích** của file. Flag nó = nhiễu vĩnh-viễn không-thể-giải. +4. 🔴 **Mega-line:** `HANDOFF.md:5` (~50KB/1 dòng), `STATUS.md:6`. `grep -c` đếm **DÒNG** (ra 1), phải `grep -o ... | wc -l` đếm **occurrence**. `file:line` trên mega-line vô nghĩa ⇒ neo bằng **trích đoạn**. +5. 🔴 **Ngày trong mark-id ≠ ngày thật:** `STATUS.md:6` chứa `2026-20-42`, `1987-03-07` (cắt từ `RC-…` mark-id) và `2026-08-01` (hạn audit TƯƠNG-LAI). Regex-ngày-bất-kỳ lấy max ⇒ rác. **Neo vào anchor.** + +## Output — propose-only + +``` +[LEAD-VIEW] | | view: | source: | view nói "X" vs source "Y" | resolve: <điều-kiện hết-flag> +``` +`` ∈ enum ĐÓNG. Cuối: `TOTAL: N` + phân-rã theo class (để tính `jump_on_class_repeat`). + +🔴 **KHÔNG Write/Edit/commit** (mày không có tool đó). 🔴 **KHÔNG `store_memory`/RAG-write** — lead = sole RAG-writer. Mày **đề-xuất**, em main VERIFY rồi APPEND (no-overwrite-unverified, B3). + +## Anti-pattern + +1. ❌ Lặp lại output detector rồi gọi đó là audit. +2. ❌ Bịa class ngoài enum. +3. ❌ Flag mà không neo được source `file:line`. +4. ❌ Hạ chuẩn vì "lead chắc có lý do" — mày là **cặp mắt độc-lập**; nể lead = mất sạch giá-trị (Smart-Friend anti-pattern). +5. ❌ Lấn sang **cái THIẾU** (`lead-omission-auditor`) hay tooling (`tooling-auditor`). +6. ❌ Chép số nhịp vào file này thay vì trỏ key config. diff --git a/.claude/commands/fable-clone.md b/.claude/commands/fable-clone.md index d3c7d75..657c677 100644 --- a/.claude/commands/fable-clone.md +++ b/.claude/commands/fable-clone.md @@ -1,6 +1,6 @@ --- description: /fable-clone <đề-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: <đề-bài phán-quyết> — vd "reviewer rà commit X" · "investigator-codebase truy bug Y" +argument-hint: <đề-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: <đề-bài phán-quyết> — vd "reviewer r - **`/fable-clone <đề-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 `` 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` mà `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//` (TRACKED) + `run.md` kèm **`## taskList snapshot`**. +2. Truyền `args.run = { name:'', dir:'.claude/workflows/runs/' }`. + +**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). diff --git a/.claude/commands/fable-real.md b/.claude/commands/fable-real.md index 084ee03..9d7e082 100644 --- a/.claude/commands/fable-real.md +++ b/.claude/commands/fable-real.md @@ -1,6 +1,6 @@ --- description: /fable-real <đề-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: <đề-bài phán-quyết> — vd "reviewer rà-soát commit X" · "investigator-codebase truy nguồn bug Y" +argument-hint: <đề-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: <đề-bài phán-quyết> — vd "reviewer r - **`/fable-real <đề-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 `` 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 <đề-bài>`. +## 🔴 Cờ `args.run` — RUN-TRACE (Sàn-1 H22, cơ-khí-hoá S121 W2) +Lead **PHẢI** @P1 scaffold `.claude/workflows/runs//` (TRACKED, kèm `run.md` + `## taskList snapshot`) rồi truyền `args.run = { name:'', dir:'.claude/workflows/runs/' }` 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, vì §H21① buộc run này **kết-tinh spec-file** vào `runs//` ⇒ cần run-folder làm **dấu-vết artifact** cho `/tiep` + harvest; và nếu có 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ớ** dù 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. diff --git a/.claude/commands/ultra-on.md b/.claude/commands/ultra-on.md index 676f469..373ac61 100644 --- a/.claude/commands/ultra-on.md +++ b/.claude/commands/ultra-on.md @@ -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 · 1–2 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//` (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ự nó không tạo folder được ⇒ đây là lý-do gate nằm ở em-main chứ không ở script. Bỏ qua ⇒ chết giữa run là **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 vì cắt-gọt. 🔸 Ngưỡng *"hoặc ước >5 phút"* KHÔNG cơ-khí-hoá được ⇒ phần đó là 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 gõ — 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) | diff --git a/.claude/governance/.session-counter.json b/.claude/governance/.session-counter.json new file mode 100644 index 0000000..b9a0a5a --- /dev/null +++ b/.claude/governance/.session-counter.json @@ -0,0 +1,35 @@ +{ + "_note": "Harness-24 (S121, 2026-07-15, wave adap-6-broadcast W2) session counter for lead-self-audit cadence. THIS FILE HOLDS STATE ONLY - every cadence NUMBER lives in .claude/agent-memory/memory-budget.json -> h24_cadence (single-source, H24 section 2(3)). Never copy the digits here.", + + "_why_content_based_not_blind_increment": "Owner-decisions-15-07-2026 Q2, trap found by lane E: the Stop-hook .claude/hooks/wal-flush.ps1 auto-commits on EVERY turn-boundary. A blind counter++ would therefore tick many times per real session and the cadence would be meaningless. So a tick is CONTENT-ADDRESSED: it is keyed on the repo HEAD sha at tick time. Ticking twice on the same HEAD is a NO-OP, which is what makes running /session-start twice in a row safe (acceptance: 2x /session-start on the same HEAD => +1, not +2).", + + "_why_this_path": "Deliberately .claude/governance/ and NOT .claude/agent-memory/. The hook covers exactly 3 paths (.claude/WAL.md, agent-memory/, workflows/runs/); .claude/governance/ is OUTSIDE all three, so this file is never swept into a 'wal:' commit as a side effect. Compare .claude/agent-memory/.mfe-state.json, which IS inside the hook's reach - a counter must not live there.", + + "_contract": { + "tick": "tick(session, head): if head == last_ticked_head -> NO-OP (idempotent, same HEAD = same real session state). Else counter = counter + 1, last_ticked_session = session, last_ticked_head = head, last_ticked_at = date.", + "fail_loud_on_regress": "If an incoming counter is LOWER than the stored counter, or last_ticked_head names a commit not reachable from HEAD, DO NOT silently reset: report to owner. A counter that moves backwards means the state file was rolled back or hand-edited, and a silent reset would hide the cadence gap.", + "overdue": "OVERDUE(light) when (counter - last_audit.light_at_counter) >= h24_cadence.light_every. Same shape for deep_every. Skipping sessions does NOT lose the debt - the gap is measured from the counter, not from wall-clock, so a missed session surfaces as OVERDUE rather than vanishing.", + "jump": "jump_on_class_repeat (h24_cadence): if ONE flag class from lead_self_audit.flag_classes repeats N times, pull the next audit forward regardless of the counter.", + "writer": "Lead is single-writer. Wired at /session-start (W3 owns the ritual; W2 owns this file + its shape)." + }, + + "_seed_honesty": "Seeded UNTICKED on purpose. counter=0 and last_ticked_* = null mean 'no tick has ever happened', which is the truth at S121 - the ritual that performs the tick lands in W3. Seeding a fake first tick here would make the very first cadence reading a lie, and H24 exists to catch exactly that kind of invented number.", + + "counter": 0, + "last_ticked_session": null, + "last_ticked_head": null, + "last_ticked_at": null, + + "last_audit": { + "light_at_counter": 0, + "deep_at_counter": 0, + "_note": "Counter value at which the last light/deep self-audit actually ran. 0 = never run yet (honest seed, same reason as above)." + }, + + "class_repeat": { + "_note": "Rolling tally per flag class from lead_self_audit.flag_classes (memory-budget.json). Key = class name, value = consecutive-audit repeat count. Empty = nothing observed yet; the 2 monitor roles land in W2 but have not run.", + "counts": {} + }, + + "history": [] +} diff --git a/.claude/workflows/hmw.js b/.claude/workflows/hmw.js index 60f16f3..afc5656 100644 --- a/.claude/workflows/hmw.js +++ b/.claude/workflows/hmw.js @@ -6,7 +6,7 @@ export const meta = { name: 'hmw', - description: 'HMW P2 execute (SOLUTION_ERP) — fan-out 9-agent roster có MEMORY-PACK slice (qua args vì script không đọc file) + return findings + checklistEvidence + memoryDelta (spawn-record 4-field). 2 MODE (Harness 2, 06-07): (A) DEFAULT return-delta-only — fan-out NHỎ (<3 task VÀ ≤5 phút), sub KHÔNG ghi file, git-diff verify. (B) RUN-TRACE mode (args.run, Harness-10) — 🔴 BẮT BUỘC khi run ≥3 task HOẶC ước >5 phút (sàn H22 S111; script no-fs KHÔNG tự ép — enforcement = em-main scaffold @P1 + set args.run) — workflow DÀI, em main scaffold .claude/workflows/runs// TRACKED FLAT (run.md + sub--.md + -synthesis.md phẳng cùng cấp) @P1, sub ghi full-detail vào CHỈ sub--.md mình (B4/B6), harvest per-turn primary (C4) + H2 gom @session-end = backstop verify-idempotent. taskList thoải mái (queue theo slot, không cap cứng). memoryDelta KHÔNG tự ghi — em main VERIFY + APPEND-only @P3 (no-overwrite-unverified, B3). Model H8 all-inherit (Harness-8 2026-06-16): role-có-frontmatter inherit top-tier lead · role-less inherit · per-task tier:\'fable\'|\'opus\' escape-hatch. Scope = repo SOLUTION_ERP ONLY (S1 — KHÔNG fan-out repo/corpus khác).', + description: 'HMW P2 execute (SOLUTION_ERP) — fan-out roster ĐẦY-ĐỦ (số vai canonical → docs/STATUS.md §Sub-agents; KHÔNG hardcode số ở đây — lesson S108 comment stale làm worker đọc sai runtime) có MEMORY-PACK slice (qua args vì script không đọc file) + return findings + checklistEvidence + memoryDelta (spawn-record 4-field). 2 MODE (Harness 2, 06-07): (A) DEFAULT return-delta-only — fan-out NHỎ (<3 task VÀ ≤5 phút), sub KHÔNG ghi file, git-diff verify. (B) RUN-TRACE mode (args.run, Harness-10) — 🔴 BẮT BUỘC khi run ≥3 task HOẶC ước >5 phút (sàn H22 S111; script no-fs KHÔNG tự ép — enforcement = em-main scaffold @P1 + set args.run) — workflow DÀI, em main scaffold .claude/workflows/runs// TRACKED FLAT (run.md + sub--.md + -synthesis.md phẳng cùng cấp) @P1, sub ghi full-detail vào CHỈ sub--.md mình (B4/B6), harvest per-turn primary (C4) + H2 gom @session-end = backstop verify-idempotent. taskList thoải mái (queue theo slot, không cap cứng). memoryDelta KHÔNG tự ghi — em main VERIFY + APPEND-only @P3 (no-overwrite-unverified, B3). Model H8 all-inherit (Harness-8 2026-06-16): role-có-frontmatter inherit top-tier lead · role-less inherit · per-task tier:\'fable\'|\'opus\' escape-hatch. Scope = repo SOLUTION_ERP ONLY (S1 — KHÔNG fan-out repo/corpus khác).', phases: [{ title: 'Execute', detail: 'fan-out memory-pack-injected agents, structured return' }], } @@ -27,8 +27,28 @@ const VALID_ROLES = [ 'office-document', // +S107 — Office document WRITE specialist (OD1-OD10; docx/xlsx/pptx/pdf + form-engine) 'tooling-auditor', 'harvest-curator', // +S110 anh-directed (H21 roster-parity lệnh-B ensemble; supersede // điểm H6-design "monitor ngoài workflow" — monitor VẪN INFORM-only, lane RETURN-only nên không xung đột) + 'lead-view-auditor', 'lead-omission-auditor', // +S121 W2 (H24 lead-self-audit) — 2 monitor MỚI, INFORM-only propose-only. + // 🔴 KHÔNG gộp vào tooling-auditor(H1)/harvest-curator(H2): H24 §2(1) soi LEAD (view-* = lead nhìn sai / gap-* = + // lead bỏ sót), khác trục H1 (tooling-freshness) và H2 (harvest-integrity). Class-flag = enum ĐÓNG ở + // memory-budget.json → lead_self_audit.flag_classes (10 class: 5 view-* + 5 gap-*) — vai KHÔNG tự chế class. + // Từ-vựng "view"/"omission" chọn CÓ CHỦ-ĐÍCH tránh va-chạm: governance-detectors.ps1:15 đã sở-hữu + // "derived-staleness" ⇒ cấm tên *-stale-role; "GAP" quá-tải (session-end build-gap · memory-selfimprove CRITERIA+GAP). ] +// ─── PA-2a — hằng-số kỳ-vọng model tier-2 (H23 model-at-spawn, owner-chốt O1 @S121 W2) ── +// 🔴 ĐÂY LÀ HẰNG-SỐ KHAI-BÁO, KHÔNG PHẢI CƠ-CHẾ NEO. Nó KHÔNG ép model lúc spawn. +// Vì sao chỉ là hằng-số: neo-model-tại-spawn BẤT-KHẢ-THI ở SE — param `model:` chỉ nhận ALIAS +// ('opus'/'fable'/...), không nhận full-id; và SE có 0 agent pin full-id (H8 all-inherit 14/14). +// ⇒ owner chốt PA-2 = PA-2a (hằng-số này, để audit có thứ ĐỐI-CHIẾU) + PA-2b (scripts/spawn-model-audit.ps1 +// so resolved-vs-expected). Đọc bởi: scripts/spawn-model-audit.ps1 (thiếu hằng-số ⇒ script FAIL-LOUD). +// 🔸 CHƯA VERIFY (khai thật, KHÔNG giả-vờ đã test — v2:271): thứ-tự ưu-tiên giữa "tham-số tại spawn" và +// "pin ở tệp định-nghĩa" khi CẢ HAI cùng hiện-diện = CHƯA TỪNG ĐƯỢC TEST. Ở SE cả hai đều hiện-diện +// (resolveModel() trả alias vào agent(...,{model:...}) TRONG KHI frontmatter 14/14 = inherit). +// Nếu frontmatter THẮNG ⇒ mọi escape-hatch tier: = NO-OP. Phép thử phân-biệt được CHỈ chạy được ở +// phiên lead=Fable (lead=Opus thì 2 nhánh ra cùng kết-quả ⇒ không phân-biệt) ⇒ DEFER, không bán quá nấc. +// 🔸 CHƯA THỬ (fix#8a): param `model:` có TỪ-CHỐI full-id không — doc nói enum-alias; chưa ai thử thật. +const TIER2_EXPECTED_FULL_ID = 'claude-opus-4-8' + // ─── H8 all-inherit top-tier (Harness-8 adopt 2026-06-16 — thay thế two-tier H4.5) ── // MỌI sub-agent có memory → frontmatter `model: inherit` = ăn top-tier lead (runtime PER-SESSION // outage-driven — BƯỚC 0.6 probe mỗi phiên; flip-chain canonical → docs/STATUS.md §Sub-agents. @@ -116,6 +136,31 @@ const spec = A.spec || '' const wave = (A.run && A.run.dir) ? A.run : ((A.wave && A.wave.dir) ? A.wave : null) if (wave) log(`hmw: RUN-TRACE mode on → dir=${wave.dir} (TRACKED FLAT; sub ghi sub--.md phẳng isolated; em main scaffold @P1; harvest per-turn primary C4, H2 gom @session-end = backstop).`) +// ─── SÀN-1 GATE — RUN-TRACE BẮT BUỘC khi ≥3 task (H22 wal-defect-fix, adopt S121 W2) ───── +// TRƯỚC S121 sàn này chỉ là CHỮ trong doc ("script no-fs KHÔNG tự ép") ⇒ phụ-thuộc em-main NHỚ set +// args.run. Đo thật @S119: `git grep args.run .claude/commands/` = 0 hit ⇒ 4/4 wrapper KHÔNG cờ +// ⇒ sàn = danh-nghĩa. Nay CƠ-KHÍ-HOÁ (mirror tripwire checkpointApproved). +// Vì sao ≥3: chết giữa run DÀI mà không có run-folder ⇒ /tiep §4 KHÔNG có vật-liệu trên đĩa để cắt-gọt +// ⇒ phải chạy lại TỪ ĐẦU (per-turn returns mất theo phiên; chỉ file trên đĩa sống sót). +// Bằng-chứng: S118 raw-Agent 7-spawn ⇒ 0 run-folder ⇒ mất trace. +// 🔴 THROW chứ KHÔNG fail-soft: fail-soft = "đứt âm-thầm" (cùng lý-lẽ STOP-HARD role-whitelist bên trên). +if (!wave && A.taskList.length >= 3) { + throw new Error( + `hmw: SÀN-1 — ${A.taskList.length} task (≥3) mà THIẾU args.run ⇒ DỪNG HẲN. ` + + `RUN-TRACE là BẮT BUỘC ở ngưỡng này (sàn H22 S111): chết giữa run mà không có runs// ` + + `thì /tiep §4 không có vật-liệu đĩa để relaunch cắt-gọt, phải chạy lại từ đầu. ` + + `SỬA: em-main scaffold .claude/workflows/runs// (run.md + taskList snapshot) @P1 rồi truyền ` + + `args.run = { name:'', dir:'.claude/workflows/runs/' }. ` + + `(Script chạy JS-sandbox KHÔNG filesystem ⇒ KHÔNG tự tạo folder được — vì thế mới gate ở đây.) ` + + `Dưới 3 task = MODE A return-delta-only, args.run tùy chọn.`) +} +// 🔸 KHAI THẬT — gate này 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 được thời-lượng) ⇒ phần đó vẫn là kỷ-luật người, không phải cổng. +// 🔸 KẼ CÒN-LẠI (F2, KHÔNG gate được từ đây): raw `Workflow` tool và raw `Agent` tool đi THẲNG, không +// qua file này ⇒ mất luôn writeGuard + run-trace. S72 raw-Workflow ⇒ reviewer ghi MEMORY +2850B over-cap; +// S118 raw-Agent 7-spawn ⇒ 0 run-folder; và chính run S119 cũng đi raw Workflow. SE KHÔNG có CLI-launcher +// để whitelist ⇒ 3 nguyên-tắc detector của broadcast là N/A **vì không có launcher**, KHÔNG phải vì "hết kẽ". + phase('Execute') log(`HMW P2: fan-out ${A.taskList.length} task (${wave ? 'RUN-TRACE' : 'return-delta-only'}, H8 all-inherit top-tier, memory-pack-injected, scope=SOLUTION_ERP repo only)`) diff --git a/docs/STATUS.md b/docs/STATUS.md index 4738947..3799b17 100644 --- a/docs/STATUS.md +++ b/docs/STATUS.md @@ -16,12 +16,13 @@ | Master data (prod) | **71 WorkItems PMH-only S59** | 62 Projects + **WorkItems = ĐÚNG 71 mã PMH** (S59: wipe 15 demo + rename format anh Kiệt `MAT-1..16`/`SUB-1..30`/`MEP-SUB-1..9`/`MEP-EQU-1..16`, Name "STT nhóm tên") + Suppliers **37** (S113 cicd-verified prod count, tất cả IsPublic=1 sau Mig 64 backfill — "22 ước" cũ STALE; POST mở any-auth S59 quick-add; import v2 mới landing nháp). Transactional testing data wiped S59 (PE/HĐ/Notif = 0 baseline, phiếu thật từ A/001). Provenance `scripts/master-import-data.generated.md` | | API endpoints | **~253** | +1 S54 `GET /it-tickets/assignable-staff` (capability endpoint); +3 S52 (attendances/report + report/excel + it-tickets/{id}/assign) | | FE pages | **68** | unchanged S54 (ItTicketsPage reassign = in-place 2 app); +1 S52 AttendanceReportPage | +| Policies | **216** | 🆕 **row MỚI S121** (wave adap-6-broadcast W2 — H24 GAP-3: `governance-detectors.ps1` `Get-StatusValue` resolve canonical TỪ bảng này; **KHÔNG có row ⇒ token `policy` UNRESOLVED ⇒ nửa `policy` của GAP-3 không thể fire** ⇒ detector khai FAIL-LOUD + SKIP, KHÔNG im-lặng-giả-vờ-xanh). 🔴 **DERIVED, KHÔNG độc-lập:** `Policies = |MenuKeys.All| × |MenuKeys.Actions| = 54 × 4 = 216` — sinh runtime ở `src/Backend/SolutionErp.Api/Program.cs:82-89` (`foreach menu → foreach action → opts.AddPolicy($"{menu}.{action}")`), `Actions = ["Read","Create","Update","Delete"]` (`MenuKeys.cs:167`). ⇒ **row này BUỘC đổi CÙNG row `Menu keys`**: thêm 1 menu key ⇒ 55 × 4 = 220; sửa `Menu keys` mà quên `Policies` ⇒ detector flag derived-doc thay vì flag chính chỗ sai. Ground S121 bằng đếm mã-nguồn (`MenuKeys.All` = 54 entry, `public const string` = 54, khớp) — KHÔNG chép số từ spec. ⚠️ `.claude/skills/permission-matrix/SKILL.md` ghi **~240 = STALE** ⇒ W4 vá (🔴 chuỗi H24 §2(4) BẮT BUỘC: detector fire → cổng chứng-kiến → RỒI MỚI vá; vá trước = giết chứng-nhân sống) | | Menu keys | **54** | +1 S69 `Off_Dashboard` (landing Văn phòng số). Prev re-ground S61 (`MenuKeys.cs` const — Mig 50 gỡ 4 `Bg_*` Budget menu cũ). Prev 57 (S58) | | Tests | **509 PASS** | 45 Domain + 464 Infra · 0 fail / 0 skip · **S118 +8** (PRO-perm scope-isolation **+4** `ProcurementMasterAccessSeedTests` [reflection no-prod-touch: upgrade-path Suppliers R+C+U + Master-Read · **scope-isolation** DeptManager-riêng vẫn revoke=false · insert-path no-Delete · idempotent] · ReportsController authz **+4** `AuthorizePolicyRegressionTests` [dashboard/export require Reports.Read · my-dashboard KHÔNG action-policy · class-level [Authorize] intact]) · **S117 +6** (PE endsBeforeCeo pointer-aware **+1** `PeFinalizeProjectionTests.ListPe_EndsBeforeCeo_ChoDuyet_PointerAware_PastFinalizeIsFalse` [ChoDuyet con-trỏ QUA cấp finalize → endsBeforeCeo=false, test-before RED→GREEN + EF-subquery translate smoke] · duyệt-theo-khoảng ProMinMax **+5** `PeApprovedPriceFinalizeTests` [happy set Min+Max · min==max boundary lock strict-`>` · thiếu-Max→Conflict not-finalized · min>max→Conflict · single-source+Max→Conflict wire-bug + regression Max=null] · harness `InvokeApply` 4→5 args fix TargetParameterCountException) · **S116 +9** (PE nhập giá âm: T1 ngân-sách-bất-biến khi quote-âm · T2 winnerQuoteTotal signed-sum · T3 submit-guard all-zero-blocked/pure-neg+net-zero-submittable · T4 CCM-net-threshold) · **S114 +9** (PE multi-NCC per hạng mục: `PeSelectWinnerClearTests` delete-invariant +4 [DeleteQuote/DeleteDetail re-derive IsWinner **test-before RED→GREEN** + guard-no-over-clear + UpsertQuote-update-branch coverage] + impl-lane +5 [per-hạng-mục-total · giaTri-single-partial · threshold-crossing · derive-invariant]) · **S113 +19** (Supplier import v2: `SupplierImportV2DedupTests` 13 [dedup MST-primary+Code-backstop T1-T7 · draft-on-import IsPublic · all-or-nothing · LayoutValid re-bake real-token · **null-Code→nháp FIXED** flipped-from-characterization] + `SupplierPublishAndListTests` 6 [publish-guard Code-required→409 · unpublish · list-filter published · DTO IsPublic]) · **S112 +18** (Supplier `SupplierExcelImportServiceTests` +10 [case-collation dedup có-RĂNG SQLite-BINARY-collation-nên-chứng-dedup-ở-SERVICE · fill-nulls-safe · all-or-nothing-abort · parser abs-cell-index/#REF!-null/header-fingerprint · Type-lạ→NCC · Status-emoji-strip] · PE `PeSubmitGuardAndBypassTests` 4-update→A1 [minOwn subordinate-only, pointer-stop] + 8-new [A1-happy · non-contiguous · EDGE-5 non-admin-throw/admin-pass/system-pass · opinion-history log/none]) · Prev 440: **S96 +6** (PE `PeApproverFinalizeTests` +2 [#6 finalize-opt-out→advance-CEO · #7 stale-noti-clear ExecuteUpdate] · `PeSuggestedPriceSetterAuthzTests` +4 [price-lock phase-guard after-submit — PRO/CCM ChoDuyet/DaDuyet→Conflict, Admin-override; +sửa SeedPeAsync default ChoDuyet→DangSoanThao spec-change]) · **S92 +3** (`AdminOnlyModulesRevokeTests` ẩn 5 nhóm menu chỉ Admin — non-Admin revoked-4-cờ / Admin untouched / Pe_* preserved) · **S91 +9** (ChangePassword self-service BE+test) · **S89 +3** (`PeDraftVisibilityTests` IDOR nháp riêng-tư) · **S88 +17** (D1 financials/CEO-notify/HoSoLink null-safe +11 · D2 create-contract multi-winner +6) · **S87 +25** (Mig 58 net +18: `PeMultiWinnerTests` sum + `PeSelectWinnerClearTests` multi-update + `PeSubmitGuardAndBypass` budget=0 + `PeApproverFinalizeTests` 5 auto-finalize [từng 7, −2 khi opt-in→auto rework] + `PeCcmThresholdFinalize`/`PeWorkItemBudget` collateral; Mig 59 +7 `PeCcmBudgetPeriodSetterAuthzTests` role-gate Admin|CCM/budget=0/null-clear) · **S86 +3** (`PeApproverNotifyExcludesDrafterTests` — notify "cần duyệt" loại NGƯỜI TẠO phiếu: drafter-excluded · co-approver-vẫn-nhận · drafter-vẫn-nhận-chuông-kết-quả) · **S85 +18** (PE CV PRO C5 hủy/đổi NCC winner +10 · urgent drafter-self-unset +5 · workflow-preserve bug-class S42 +3 `PeUpdateDraftWorkflowPreserveTests`) · **S83 +2** (PE require-workflow: `PeWorkItemGuardTests` ApprovalWorkflowId `NotEmpty` ×2 validator + submit-guard rewrite test 7/13 `PeSubmitGuardAndBypass` V1-submit-deprecated, no-count-change) · **S77 +10** (+7 `PeSuggestedPriceSetterAuthzTests` ghi chú PRO/CCM Mig 57 absolute-set/role-gate/null-clear/max-1000 · +3 `PeUrgentToggleAuthzTests` rewrite cờ-gấp **BẤT ĐỐI XỨNG** SET=function role / UNSET=function+DeptManager, plain-PRO-unset Forbidden) · **S76 +5** (`PeWorkItemBudgetTests` PRO split: set ProInitial+ProAdjust gồm âm · validator ProInitial≥0/ProAdjust-cho-âm · full=proFull khi CCM empty · full=CCM khi CCM present) · **S74 +5** (`PeWorkItemBudgetTests` §4b CcmNote: set CCM/Admin · null-clear absolute-set · non-priv Forbidden+no-mutate · all-3-persist) · **S73 +28** (PE opt-in finalize spec 6→11 + 10 giá-chốt `PeApprovedPriceFinalizeTests` + 13 setter-authz `PeSuggestedPriceSetterAuthzTests`) · **S69 +20** (Office-golive OfficeModulePermissionSeed 6 + PE PeCcmThresholdFinalize 5 + PeUrgentToggleAuthz 9) · **S67 +23 HRM test-after** (DepartmentTreeTests 8 cycle-guard/rollup + PeHoSoLinkTests 9 absolute-set + HrmProfilePermissionSeedTests 6 reflection-seed) → 286 · S61 +22 `PeWorkItemBudgetTests` −14 `BudgetPolicyTests` −1 → 263 · S60 +14 `PeSubmitGuardAndBypassTests` +2 spec → 256 (Domain 58→45 do drop Budget module tests) | | 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 | **12** | **+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]**) · **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). | | 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).