48 lines
17 KiB
Markdown
48 lines
17 KiB
Markdown
# Tooling-Auditor Agent — Persistent Memory
|
||
|
||
> **Persistent diary cross-session.** Auto-injected first ~200 lines at spawn (L1 HOT).
|
||
> Update BEFORE every stop. Tiered Memory v1: L1 HOT (hook hard-limit <17KB) · L2 `archive/2026-06.md` verbatim on-demand · L3 RAG `search_memory`. Keep entry ≤ 1.5K chars.
|
||
> **NEW agent 2026-06-07** (adopt AI_INFRA Harness 1 — H1 tooling-freshness; TÁCH khỏi harvest-curator H2 per anh-mandate "H1/H2 hay quên+nhầm → riêng-biệt"). Compacted S99 2026-07-02 (19.6KB→~9KB, 12 entry 06-xx → archive NGUYÊN VĂN) · S105 2026-07-07 (19.4→~16KB, S98-S100 → `archive/2026-07.md`).
|
||
|
||
---
|
||
|
||
## 🎯 Role baseline
|
||
H1 tooling-freshness auditor **SOLUTION_ERP-self**. Read-only + **propose-only** (em main = single-writer; NGOẠI LỆ duy nhất: diary/archive của chính mình). Tools: Read/Grep/Glob/Bash + 4 RAG-read. NO `store_memory`. Audit **4-mặt** mỗi session: skill · sub-role · plugin · docs — đầy-đủ + kịp-thời. @session-start báo state + diff-vs-last; @session-end chốt + new-alloc audit. 🔴 Final message = VERDICT trực tiếp, KHÔNG narrative memory-curation (#53 return-garble ×4).
|
||
|
||
## 🚫 Split boundary
|
||
- ✅ MINE: tooling/docs freshness (4-mặt) + roster-drift + skill/plugin new-alloc — SOLUTION_ERP-self
|
||
- ❌ NOT: harvest-memory/5-trục → **harvest-curator** (H2) · corpus/RAG/deploy → cicd-monitor · code/SQL audit → investigator-codebase · write/decide → em main
|
||
|
||
## 📋 Baseline state (re-ground 2026-07-02 S99 — VERIFY mỗi session, đừng tin số cũ)
|
||
- **Roster:** 11 sub, **11/11 `model: inherit`** (Harness-8 all-inherit, runtime-verified S98 — Fable 5 RESTORED, inherit-chain self-report `claude-fable-5`). 9 product/quality (investigator-codebase/api · implementer-backend/frontend · test-specialist · reviewer · cicd-monitor · frontend-designer · database-agent read-advisory) + 2 monitor INFORM-only (tooling-auditor · harvest-curator). VALID_ROLES hmw.js = 9 product-only by-design.
|
||
- **Skills:** 6 project (`.claude/skills/`) + 23 standalone (`~/.claude/skills/`) + 14 command-file (`.claude/commands/` — hmw = script `workflows/hmw.js`, KHÔNG phải slash-command).
|
||
- **Plugins:** 18 registered (15 enabled / 3 disabled: pr-review-toolkit · code-modernization · hookify) user-global `~/.claude/settings.json:17-35` · marketplace 35 · settings `model: claude-fable-5[1m]` + `effortLevel: xhigh`.
|
||
- **Docs canonical:** `CLAUDE.md` (root+docs) · `docs/STATUS.md` (số canonical B1) · `docs/HANDOFF.md` · `.claude/agents/README.md` · `docs/governance/`.
|
||
|
||
## ⚠️ Anti-patterns
|
||
❌ Tự sửa config/doc/enable-plugin (propose-only) · ❌ conflate plugin "enabled"="used" (installed≠enabled≠assigned≠used) · ❌ tick-checkbox no-evidence · ❌ đụng harvest-memory (harvest-curator) · ❌ G-015 overclaim "read-only enforced" (Bash residual = write-channel mở).
|
||
|
||
## 🧭 Method distilled (S50-S98 — chi tiết verbatim `archive/2026-06.md`)
|
||
- **Ground-truth MỌI count từ disk:** `settings.json enabledPlugins` = authoritative plugin# · `skills/README.md` ≠ SKILL.md frontmatter (drift độc lập) · Migrations ở `Infrastructure/Persistence/Migrations` (KHÔNG `Infrastructure/Migrations`).
|
||
- **Test count:** KHÔNG attr-count `[Fact]/[Theory]` (Theory expand runtime) — tin session-log/test-run/STATUS.
|
||
- **Bundle-hash:** KHÔNG tin 1-source — triangulate (cicd-MEMORY = provenance giàu nhất Run#+sha+rotate); anh-cite chưa verify được → flag "unverified", KHÔNG copy.
|
||
- **gotcha format:** entry = `### N.` KHÔNG `#N` — verify format trước khi claim missing.
|
||
- **commands/*.md + ultra-on.md = trong radar:** roster-grep (S57 catch) + count-grep (S99 catch "(68)") — lớp file hay bị monthly-audit bỏ sót; index/README files cũng vậy (S50).
|
||
- **Drift born-SAU-monthly-CÙNG-NGÀY** = lớp riêng (S97/S98) — per-session monitor bù lớp monthly không thấy.
|
||
- **system-reminder claudeMd header = pre-session snapshot** → re-Read line thật trên disk, KHÔNG tin context-injection. Brief "chưa flush" cũng = snapshot lúc spawn → re-ground disk hiện tại (S58).
|
||
- **Backlog/coords trong HANDOFF phải re-verify** trước khi tin (stale-contradiction S57-resume).
|
||
- **Model spawn-test:** frontmatter no hot-reload — pin/inherit ăn SAU restart CLI; self-report nguyên văn = bằng chứng runtime (H4 S57bis · H8 S98).
|
||
- **Tool-gotchas:** Bash nuốt `$` PS-inline → `powershell -NoProfile -Command` escape `\$` · PS `Get-Content -Raw`+`-TotalCount` mutually exclusive → dùng Grep tool `^model:`.
|
||
- **Return-cut giữa emit** (S58) = finding chính vẫn salvageable từ partial return; emit finding chính SỚM trong report.
|
||
|
||
## 📅 Recent activity (FIFO — older → `archive/2026-06.md` verbatim)
|
||
- **2026-06 (12 entry S50→S66 → archive):** CREATED+first-run verified-runtime (S50 3-drift: plugin 15→18 · ef-core 31→43 · gotcha 49→57) · S51 new-alloc database-agent STRONG-FIT/codebase-agent SKIP · S57×2 (ultra-on+session-start roster catch; VALID_ROLES 9) · H4 demote spawn-test ×2 (pin ăn post-restart, demote-watch #1 OK) · post-S57bis count-drift top-5 · S58 return-cut-partial · S59×2 ALL-FRESH (bundle triangulate 4-src; SearchableSelect=code KHÔNG skill) · S63 H5 opus-collapse confirm + ef-residual · S66 H8 all-inherit flip (7 pin→inherit). → `archive/2026-06.md`.
|
||
- **2026-07-02 (3 entry S98/S99/S100 → `archive/2026-07.md` verbatim, compact S105):** S98 Fable-restore-evidence + ef-core stuck-59 + post-audit-drift (archive giữ bản verbatim-superset pre-curate) · S99 F1 s98-flip-miss + F2 SendMessage-stale + F3 command-count-catch "(68)" · S100 ALL-PASS F1/F3 fixed-verified + method `git log -- .claude/skills/` last-touch shortcut.
|
||
- **2026-07-03 (S101 @start RE-REPORT — ALL-4 PASS + MODEL-DRIFT, on-behalf em-main APPEND B3):** HEAD `5ee32c0`, tree 1-dirty (cicd MEMORY M #486 pre-existing). ①SKILL PASS 6+23+14 (2 detector-flag ef-core/contract-workflow = FP module-local, numbers MATCH canonical). ②ROSTER PASS 11=11=11, 11/11 inherit, ASCII-diagram cosmetic-drift known-debt. ③PLUGIN PASS 18/15/3 + marketplace 35 + xhigh + `claude-fable-5[1m]`:11 identical, 0 new-alloc. ④DOCS PASS (S100 closeout clean; F2 SendMessage + F3 count both fixed-verified). 🔴 **MODEL-DRIFT (inherit-chain data-point #4 = DIVERGENT):** this spawn + lead + WF2-reviewer all self-report **`claude-opus-4-8`** (NOT `claude-fable-5` S98/S99) while `settings.json:11` still pins `claude-fable-5[1m]` → **Fable unavailable S101 → H5-fallback tự-kích** (revert-free, no frontmatter change). "Fable RESTORED S98" = point-in-time NOT steady-state → em-main reconciled STATUS:24 + agents/README:3 with S101-runtime caveat. Lesson: **inherit-chain self-report = runtime availability probe — verify each session, don't trust last-session model claim.** Tag `[s101-start, 4-mat, all-pass, model-drift-opus, h5-fallback-reactivated]`.
|
||
- **2026-07-03 (S101 @closeout → `archive/2026-07.md` verbatim, compact S105):** command **14→16** (+fable-real/clone H19 = COMMAND-tier ≠ skill, đừng conflate; 0 catalog-drift) · data-point #5 Opus DIVERGENT · new-alloc 0 · F-H19a LOW DEFER (note khi Fable-về) · F-H19b em-main fixed.
|
||
- **2026-07-06 (S102 @start RE-REPORT — ALL-4 PASS + FABLE VỀ LẠI, inherit-chain data-point #6):** HEAD `3e2c18b` (=S101 closeout), tree CLEAN, 0 commit sau S101 → disk S102-pre == S101-end. **Model: spawn này self-report `claude-fable-5`** = Fable RESTORE lần 2 (chuỗi S98 Fable → S101 Opus → S102 Fable — availability per-session, đúng lesson S101). ①SKILL PASS 6+23; ef-core `:3`/`:19` B1-pointer + Mig 61 khớp disk-61 (`ls` Migrations = 61). ②ROSTER PASS 11 file = 11 kỳ-vọng, 11/11 `model: inherit` line-5; S101-window: harvest-curator.md + agents/README.md M-only, 0 agent THÊM/XÓA. ③PLUGIN PASS 18/15/3 (settings:17-35) + marketplace 35 + xhigh:37 + `claude-fable-5[1m]`:11 identical, 0 new-alloc. ④DOCS PASS: (a) BƯỚC 0.5b hiện diện session-start:27-33; (b) fable-real/clone semantics inverse ĐÚNG (real=tạo marker :10 / clone=xóa :8), registry loaded = restart đã xảy ra; (c) **model-note S101-Opus cần S102-reconcile 3 vị-trí: STATUS:24 · agents/README:3 · session-start:37 (BƯỚC 0.6)** — đề xuất APPEND data-point giữ S101 làm history; (d) marker KHÔNG tồn tại + gitignore:92 + not-tracked. **Trigger-met: BƯỚC 0.5b:33 "nhắc anh khi Fable về + phân-tầng"** → em-main nhắc anh H19 tiering. Command 16 (brief "~20" = overestimate; 16 = đúng đủ, hmw ≠ command-file). Counts khớp: Mig 61 · gotcha 79 (grep) · test 440 · 89 bảng. F-H19a defer-condition "khi Fable-về" cũng MET → em-main cân nhắc note. Tag `[s102-start, 4-mat, all-pass, fable-restore-2nd, model-note-reconcile-3]`.
|
||
- **2026-07-06 (S103 @start RE-REPORT — ①②③ PASS, ④ 1-FLAG model-note per-session flip, inherit-chain data-point #7 DIVERGENT):** HEAD `62cff38` (=S102 closeout), tree CLEAN, 0 commit sau S102 → disk S103-pre == S102-end. Project `.claude/settings.json` KHÔNG tồn tại → model resolve user-global. **Model: spawn này self-report `claude-opus-4-8`** (env-confirmed) = Fable UNAVAILABLE lại (chuỗi **S98 Fable → S101 Opus → S102 Fable → S103 Opus**, flip lần 4 — availability per-session KHẲNG-ĐỊNH lại). ①SKILL PASS 6+23+16 (last-touch skills/ = `4263d63` S98, 0 đổi); ef-core `:3`/`:19`/`:83` Mig 61 + `:85` 89-bảng khớp disk (`ls` Migrations = 61, last=`...142752_BackfillEndedByLevelFinalizeFromChangelog.cs`) + khớp STATUS:14/:15; skills/README:20 "Updated S98"/:90 #79 fresh. ②ROSTER PASS 11=11=11, 11/11 `model: inherit`; ASCII-diagram cosmetic-drift known-debt (KHÔNG mới); last-touch agents/ = `62cff38` S102 M-only 0 agent THÊM/XÓA; VALID_ROLES 9 product-by-design. ③PLUGIN PASS 18/15/3 (3 disabled: pr-review-toolkit/code-modernization/hookify) + marketplace 35 + xhigh + `claude-fable-5[1m]`:11 identical, 0 new-alloc. ④DOCS canonical 7-count khớp disk (Mig61/89/440/gotcha79/menu54/11sub/6skill). 🔴 **FLAG-M (LOW, on-behalf APPEND đề xuất):** 3 model-note (STATUS:24 · agents/README:3 · session-start:37 BƯỚC 0.6) carry **S102-Fable "VỀ LẠI"** — KHÔNG drift-sai (đúng-tại-S102 + đã ghi "per-session, không tin note phiên trước") chỉ thiếu **data-point S103-Opus**. Đề xuất em-main APPEND caveat S103-Opus vào 3 vị-trí (giữ history, KHÔNG frontmatter/con-số), **SAU khi em-main tự-xác-nhận lead-runtime S103** (report này = 1-spawn probe, G-015 honesty — chưa xác nhận lead + sub khác). Marker fable-real KHÔNG tồn tại → Fable-clone default (đúng). Carry-debt: schema-diagram §16+ ERD · monthly count-grep +commands/*.md. Method-shortcut tái-dùng: `git log -- .claude/skills/` last-touch confirm no-change nhanh hơn re-read. Tag `[s103-start, 4-mat, model-note-flip-opus, data-point-7-divergent, flag-m-low, on-behalf]`.
|
||
- **2026-07-06 (S104 @start RE-REPORT — ①②③ PASS, ④ DOCS 1-HIGH + 1-SKILL-drift từ Mig-62 ship — inherit-chain data-point #8 DIVERGENT):** HEAD `778fc98` `[CLAUDE] Supplier: Mig 62 expand 30-field` (hôm nay 16:06, NGAY sau S103 closeout `6d217f7` 14:13), tree 3-dirty pre-existing (cicd MEMORY+archive+_INDEX M). **Model: spawn self-report `claude-opus-4-8`** (env) = Fable OUTAGE tiếp (chuỗi **S98 Fable → S101 Opus → S102 Fable → S103 Opus → S104 Opus**, flip lần 5, per-session tái-xác-nhận). ①SKILL PASS 6+23; last-touch skills/ = `4263d63` **S98** (KHÔNG đổi qua Mig 62 — Supplier commit KHÔNG touch skills). ②ROSTER PASS 11=11=11 (12 file −README), 11/11 `model: inherit`; agents/ window S103→now = docs-commit only, 0 agent THÊM/XÓA. ③PLUGIN PASS 18/15/3 (3 disabled pr-review-toolkit/code-modernization/hookify, settings:17-35) + marketplace 35 + xhigh:37 + `claude-fable-5[1m]`:11 identical, 0 new-alloc. ④DOCS — **NEW real-drift từ Mig 62 ship (product commit chưa reconcile docs, ĐÚNG như anh brief):** 🔴 **(D1 HIGH)** `docs/STATUS.md:14` Migrations row = **61** nhưng disk = **62** (`ls Migrations *.cs -Designer -Snapshot | wc = 62`, last=`20260706084342_ExpandSupplierFields.cs`) — detector confirm HIGH "canonical-itself-stale". → em-main patch STATUS:14 **61→62** + thêm Mig 62 blurb. 🔴 **(D2 skill LOW-real)** ef-core SKILL `:3`+`:19` header "mới nhất Mig 61" + KHÔNG có row Mig 62 (table dừng `:83`=Mig 61) — cần thêm row 62 + header→62 (giống S96/S98 pattern skill-lag-sau-mig). 🟡 **(D3 MED)** STATUS:6 In-Progress header + HANDOFF:5 Last-updated KẸT **S103**; **KHÔNG có Recently-Done entry + KHÔNG có In-Progress row** cho Supplier/Mig62 (STATUS:34 In-Progress vẫn 3 row S103; :56-58 Recently-Done ref S98/S97/S96/S95 mega-line) → em-main add S104 closeout blurb. 🟢 **(D4 LOW)** migration-todos KHÔNG có tick Supplier-30-field (S96 backlog "15-18 field note-lại-từ-từ" giờ đã ship Mig 62 — nên tick/annotate). ⚠️ **table-count KHÔNG đổi: Mig 62 = 18 AddColumn + 18 DropColumn, 0 CreateTable/DropTable → 89 bảng GIỮ NGUYÊN** (STATUS:15 đúng, ĐỪNG sửa; verify bằng grep ops trong .cs). Counts khác khớp disk: gotcha 79 (commit không touch gotchas.md) · test 440 (commit "test-after UAT-mode" 0 test-file) · menu 54. **KNOWN-BENIGN xác nhận KHÔNG re-flag:** 3 vocab-fork MED (wave-folder/Dự-trù-PRO/two-tier) alias-mapped S96 + 4 ef-core LOW `:94/:95/:162/:179` = FP module-local ("PE 2 migration tách"/"Contract 1 GỘP"/"Revert 1"/"1 migration→latest" = procedural-history KHÔNG canonical-count, H18-A ratio-band-FP class) — ĐỪNG patch. Detector TOTAL 37 (1 HIGH + 4 LOW-FP + 3 MED-alias). Carry-debt: schema-diagram "§16+ Mig 32-61 pending" (root CLAUDE:131 + docs/CLAUDE:70) nên nới→Mig 62 nhưng = known-ERD-debt KHÔNG new. **FLAG-M carry (S103):** 3 model-note vẫn S102-Fable "về lại", thiếu data-point S103+S104-Opus — em-main APPEND SAU tự-xác-nhận lead-runtime. Method: `git show --stat <commit>` = xác-nhận-nhanh commit touch gì (Supplier chỉ Supplier-BE/FE/Mig, 0 docs-reconcile) → chốt "product-shipped-docs-lag" pattern. Tag `[s104-start, 4-mat, mig62-docs-drift, d1-high-status61, d2-skill-efcore-lag, table-89-unchanged, model-drift-8-opus]`.
|
||
- **2026-07-07 (S105 @start RE-REPORT — ①②③ PASS, ④ 2-flag LOW; FABLE VỀ lần 3, inherit-chain data-point #9):** HEAD `95f5555`, tree CLEAN, 0 commit sau S104-closeout → disk S105-pre == S104-end. **Model: spawn self-report `claude-fable-5`** (chuỗi S98F→S101O→S102F→S103O→S104O→**S105F**, flip 6, per-session probe). ①SKILL: 6+23+16 identical; ef-core S104-fix VERIFIED (`:3`/`:19` "Mig 62 ExpandSupplierFields S104" + `:84` row-62 + `:86` "Mig 51-62"/§16+ 27-62); 🔴 **skills/README:20 STALE "mới nhất Mig 61"+"✅ Updated S98"** — `af5f9d3` chỉ sửa SKILL.md, sót index-README (class "README≠SKILL drift độc-lập" S50) → propose :20 61→62 + status-cột→S104. ②ROSTER PASS 11=11=11, 11/11 inherit, agents/ last-touch `f0874dd` S103 docs-only. ③PLUGIN PASS 18/15/3 + m35 + xhigh:37 + fable[1m]:11 identical, 0 new-alloc. ④DOCS: D1/D3 FIXED-verified (STATUS:14=**62** + :6/:38 S104-done + HANDOFF:5 S104+PhaseB-PARKED `95f5555`); D4 resolved-elsewhere (backlog thật = STATUS:85 annotated Phase-A-shipped/Phase-B-parked; migration-todos 0-hit — KHÔNG re-flag); counts khớp disk Mig62/79/89/440/54. 🔴 **FLAG-M residual: data-point S104-Opus CHỈ vào STATUS:24+:6; agents/README:3 + session-start:37 grep "S104"=0 (chain kẹt S103-Opus)** → 2 vị-trí cần +2 data-point (S104-O + S105-F) SAU em-main confirm lead-runtime (G-015, 1-spawn probe). ERD-range root CLAUDE:131 "32-61" + docs/CLAUDE:70 "27-61" chưa nới→62 (SKILL:86 đã) = known-debt LOW. Marker fable-real absent = clone-default; F-H19a defer-condition "Fable-về" MET lần 2. L1 compact 19.4→~16KB (S99/S100/S101@closeout→archive/2026-07 verbatim — 3 entry, H2 byte-verified md5×2+cmp; S98-L1-variant drop, superset frozen sẵn). Tag `[s105-start, 4-mat, fable-restore-3rd, skills-readme-mig61-stale, model-note-2of3-lag]`.
|
||
- **2026-07-07 (S105 @closeout CHỐT — ALL-4 PASS, 0 sót):** 4 patch em-main LANDED verify direct-Read (skills/README:20 Mig62/S104 · agents/README:3 + session-start:37 chain→**S105-Fable** flip-6 · session-end:113 trailer Fable 5). Residual-sweep skills+commands+agents: 3 hit = valid-history (SKILL:82 xref "xem Mig 61" · ss:123/se:48 "adap S103" provenance), 0 stale. **FLAG-M CLOSED 3/3** (STATUS:24 +S105 grep-hit). ②11=11=11 inherit ③18/15/3+m35+cmd16 identical, new-alloc 0. ④STATUS/HANDOFF dirty mid-audit = em-main flush S105 concurrent (HEAD vẫn `95f5555`; STATUS:34 In-Progress S105 · HANDOFF:5 S105-Fable). 🔴 **Method-gotcha: Grep tool brace-glob `{a,b}/**` trên setup này match 0-FILE → sweep VOID tưởng clean** — re-run per-dir path; luôn phân-biệt "0-match" vs "0-file-searched". ERD root/docs CLAUDE "…-61" known-debt giữ (SKILL:86 đã 62). Tag `[s105-end, all-pass, flag-m-closed, brace-glob-void]`.
|