[CLAUDE] Docs: vá 9 finding audit S143 + mở enum gap-incident-unrecorded
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m26s

Audit 3 lane (reviewer FAIL 1C/4M/4m/1nit + 2 vai H24 = 6 FLAG), lead tự
re-đo từng finding trước khi vá.

CRITICAL/MAJOR:
- Re-anchor 5 adap-report: sha wal: tiền-closeout (1a0fa59/a458102/96ab2679)
  dangling sau squash -> hub clone không resolve nổi. Đổi sang 2757e41.
  LUẬT: cite outward = commit SẼ SỐNG sau squash, không bao giờ wal:.
- Đính chính claim OK-reachable: phép đo tự huỷ trong cùng phiên (squash lật
  sang squash-benign). Sự thật mạnh hơn: cả 2 nhánh lành đã chạy runtime.
- TRIPLE 17/17/17 chọn enum dễ: README:225 (tự xưng "ĐỦ roster") còn 14 +
  "4 monitor"; README:27 ("Roster THẬT") còn 14. Cả 2 vá -> 17/7.
- TOTAL 46 "== baseline" sai: baseline ghi trong repo là 45. Tách claim-DELTA
  (bền) khỏi claim-TUYỆT-ĐỐI (phải neo commit+thời-điểm).

FLAG view-residual-asym: STATUS:450 + README:190 còn khai "NO Write/Edit" như
cơ-chế chặn -> sửa thành tuyên-bố ý-định (runtime vẫn cấp, 9/9 vai; nhân-chứng
reviewer đã Write+Edit thật).

FLAG gap-carry-dropped: HANDOFF carry 13 -> 14, trả [carry:session-model-adopt].
FLAG gap-decision-sunk: 3 mục "Chờ-anh" chìm 2 nhãn phiên -> lên NEXT anh (10)(11)(12).

Enum flag_classes 10 -> 11: +gap-incident-unrecorded (anh duyệt). Vai
lead-omission từ chối tự chế class và escalate đúng luật CLOSED-enum.

Bài học acceptance: AC4 grep theo SỐ nên 2 site liệt-kê-TÊN lọt lưới.
Lần sau đếm PHẦN TỬ rồi so canonical, đừng so hình-dạng chuỗi.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-07-22 13:40:49 +07:00
parent 3f4310f681
commit 36cefcca62
21 changed files with 653 additions and 54 deletions

View File

@ -24,7 +24,8 @@
## 🎯 Architecture
> ⓘ **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.)
> ⓘ **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**) + 🧪 harness-eval + 🧪 harness-refine + 🧪 harness-audit (**trio-memory, S141**) — 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.)
> 🔴 **Bài S143 — enumeration TÊN cũng lão-hoá, và grep-theo-SỐ không bắt được:** sweep roster wave S141S142 đặt acceptance là `grep "roster 14|14/14|14 folder|14 vai"` → 0 hit ⇒ tuyên bố sạch. Nhưng đúng 2 dòng tự xưng là bản gốc về roster — dòng NÀY ("Roster THẬT") và `:225` ("VALID_ROLES … ĐỦ roster") — **liệt kê TÊN, không chứa con số nào** ⇒ lọt lưới, giữ 14 vai qua cả wave. **Acceptance cho lần sau: ĐẾM PHẦN TỬ trong mọi enumeration rồi so canonical, đừng so hình-dạng chuỗi.**
```
┌──────────────────────────────────────────────────────────────┐
@ -187,7 +188,7 @@
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/<run-id>/` được git **TRACKED** → mọi write HIỆN trong git-diff = audit trực-tiếp. Containment: tracked-change NGOÀI `runs/<run-id>/` 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.
> **2 monitor sub (tooling-auditor H1 + harvest-curator H2 — 2026-06-07):** read-only toolset **KHAI TRONG frontmatter** = `[Read, Grep, Glob, Bash, +4 RAG-read]`, **NO `store_memory`, NO Write/Edit** (mirror investigator read-set). 🔴 **Đây là điều KHAI, KHÔNG phải điều ĐƯỢC CẤP — đo S143 trên 9 vai read-only (2 monitor này + 2×H24 + 3×trio + reviewer + investigator-codebase): runtime APPEND `Write`+`Edit` vào cuối tool-list bất kể frontmatter.** Nhân-chứng: `reviewer` (frontmatter 0 Write/Edit) đã Write+Edit thật. ⇒ mọi câu "read-only" dưới đây đọc là **ý-định**, không phải enforcement. 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/<run-id>/` được git **TRACKED** → mọi write HIỆN trong git-diff = audit trực-tiếp. Containment: tracked-change NGOÀI `runs/<run-id>/` 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.
> ⚠️ **`store_memory` GỠ khỏi MỌI sub (2026-06-02 — AI_INFRA broadcast `Memory-store-memory-strip-global`, adap-report cùng id).** → **lead (em main) = sole RAG-writer** (mechanized failure-safe: sub vật-lý không gọi được `store_memory`). Sub tìm thấy finding/pattern mới → ghi **MEMORY.md** (file); lead + re-index đưa vào RAG. *Accuracy (G-015): đây KHÔNG = sub "read-only" — sub vẫn giữ `Bash` (+ vai write giữ `Write/Edit`); containment thật = defense-in-depth git-diff + Qdrant chunk-count, chưa phải allowlist đơn độc.*
@ -222,7 +223,7 @@ MỌI agent trong roster có **4 RAG-READ MCP**: `search_memory` + `search_code`
- **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 (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 OD1OD10) · `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.
- **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 OD1OD10) · `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)** · **`harness-eval` + `harness-refine` + `harness-audit` (+S141 — trio-memory)**. 🔸 **Cả 7 monitor đều INFORM-only, lane RETURN-only** (propose-only). 🔴 **KHÔNG đọc "KHÔNG Write/Edit" thành cơ-chế chặn — đo S143:** frontmatter 9 vai read-only **không khai** `Write/Edit`, nhưng **runtime VẪN cấp**, nối ở cuối tool-list (nhân-chứng trực-tiếp: `reviewer` đã Write+Edit thật trong `runs/2026-07-22-S143-closeout-audit/`). Whitelist = **tuyên-bố ý-định**; containment THẬT = em main single-writer + git-diff commit-gate. 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 (M1M5 + 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/<role>` · 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").