Files
solution-erp/docs/changelog/sessions/2026-06-07-S49-harness-1-2-3-adopt.md
pqhuy1987 e27d877172 [CLAUDE] Infra: adopt AI_INFRA Harness 1/2/3 — monitor subs (roster 8->10) + wave-folder isolation + email channel (S49)
Harness 1 (Self-observability): NEW tooling-auditor (H1 tooling/docs-freshness 4-faceted) + harvest-curator (H2 harvest-integrity 5-axis) INFORM-only monitor subs, TACH BIET per anh-mandate -> roster 8->10. Wire session-start Phase 2.1.1 RE-REPORT + session-end L.b 6->7-step (H2 5-axis GATE + H1 chot + B5 wave-gom). H3 plugin/skill = gop-vai doc, 0 new agent.

Harness 2 (wave-folder isolation): hmw.js WAVE-MODE (subMdPath + tool-aware writeGuard) + .gitignore wave-*/ + agent-teams/ (B6 git-check-ignore verified) + NEW workflows/README convention. Harness 3 (email channel): broadcasts/ (6+6 folder + 13 .gitkeep + _index + inbox/README, committed) + send/check-email cmd (self=se) + adap-apply base-path fix outbox/all/.

HMW-mode ON: recon fan-out 4 read-only agent -> em main single-writer WRITE -> reviewer PASS all 3. Containment: git-diff 1 benign self-MEMORY + chunk-count 2414=2414 (0 RAG-write). Nac executed-file, verified-runtime PENDING CLI restart. 3 adap-reports + session log. Test 181 unchanged (no product code). CI runs (hmw.js/.gitignore/.gitkeep not path-ignored) but no bundle/migration change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-07 23:18:43 +07:00

53 lines
5.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Session 49 — 2026-06-07 — AI_INFRA Harness 1·2·3 adopt (HMW-mode ON)
> Governance/infra adoption — **no product code** (0 .cs/.tsx), test 181 unchanged, CI-skip (all .md/.js/.gitignore/broadcasts). User: `/ultra-on` + `/adap-apply harness 1·2·3`.
## Bối cảnh
AI_INFRA broadcast 3 file harness (2026-06-07, reviewer_gate PASS, targets all-fit) trong `outbox/all/`. User BẬT HMW-mode (`/ultra-on`) = consent Workflow fan-out, rồi adopt cả 3 qua `/adap-apply`.
## HMW flow (8-agent governance)
- **P0 prep (em main):** dedup check (0 report harness-* → all chưa-applied) · audit current infra (roster 8, hmw.js có, broadcasts/ chưa) · đọc 2 investigator memory-slice (B1) · baseline Qdrant 2414 · git clean.
- **P2 recon fan-out (Workflow `harness-recon`, 4 read-only agent, return-delta):** 3× investigator-codebase (H1 roster/session-wiring gap · H2 wave/hmw.js gap · H3 email scaffold spec) + 1× investigator-api (plugin/skill marketplace audit). 367K tok · 67 tool-use · ~4m46s · 4/4 returned.
- **Containment audit post-P2 (defense-in-depth):** `git diff` = 1 file-write (investigator-api tự-APPEND MEMORY.md qua Write/Bash dù store_memory strip — benign, đúng chỗ, verified) · 3 inv-codebase = 0 write (return-only đúng R1). `chunk-count 2414=2414` (0 RAG-write). → G-015 chứng: containment = git-diff + chunk-count, KHÔNG allowlist đơn-độc (sub giữ Bash/Write).
- **P3 harvest (em main single-writer):** APPEND delta 3-slice → investigator-codebase/MEMORY.md; investigator-api self-append giữ (verified).
- **WRITE (em main single-writer governance, ~25 file):** 3 harness (chi tiết dưới).
- **P4 reviewer (full memory, adversarial):** PASS all 3 — no blocker.
## 3 corrections recon caught (vs giả định ban đầu)
1. **Harness 3 id = `se`** (KHÔNG `solution_erp`); 6 others short-id `{ai_infra,vipix,dyd,namgroup,ashico,bvaau}` — authoritative `AI_INFRA/broadcasts/sister-commands/send-email.md:13-22` (folder name = 2nd source-of-truth).
2. **adap-apply.md base-path STALE** `outbox\*.md` → cần `outbox\all\*.md` (latent bug, đóng luôn).
3. **H3 plugin: 0 agent mới** — sql-database-assistant/frontend-design đã là standalone skill; code-modernization/pr-review-toolkit agent-bearing → KHÔNG enable (trùng vai); code-reviewer ×3 collision → giữ roster `reviewer`.
## Harness 1 — Self-observability (roster 8→10)
- NEW `.claude/agents/tooling-auditor.md` (H1 tooling/docs-freshness 4-mặt skill·sub-role·plugin·docs) + `.claude/agents/harvest-curator.md` (H2 harvest-integrity 5-trục) — **TÁCH BIỆT** (anh-mandate H1≠H2 "hay quên+nhầm"). INFORM-only, tools `[Read,Grep,Glob,Bash+4 RAG-read]`, NO store_memory/Write. + 2 memory seed.
- `.claude/agents/README.md`: title 7→**10-agent** + architecture note + upgrade-note + skill matrix +2 + tool grant G-015 note + decision tree +2 nhánh + §H3 external skill/plugin mapping. (+ fixed pre-existing diagram drift line 11/18.)
- `session-start.md` Phase **2.1.1** Monitor RE-REPORT (H1 diff + H2 harvest-mới). `session-end.md` §L.b **6→7-step** ((d)(f)=H2 5-trục GATE + B5 wave-gom · (g)=H1 chốt+new-alloc).
- **Tailor SE (KHÔNG copy AI_INFRA):** 4 RAG-read thay 2 · model:inherit thay effort:max · bỏ agent-ops-monitor/sister · omit color (8 màu hết) · Fidelity→SE reviewer.
## Harness 2 — wave-folder memory-isolation (B1-B6)
- `.claude/workflows/hmw.js` +WAVE-MODE: `subMdPath` schema · `wave` block · tool-aware `writeGuard` (Write-sub ghi-direct / read-only-sub return→lead-scribe) · B6 isolation prompt. Mirror AI_INFRA, tailor 8-role (read-only sub = investigator-codebase/api, reviewer, cicd-monitor).
- `.gitignore` +`.claude/workflows/wave-*/` +`.claude/agent-teams/` (AFTER `!.claude/**` last-match-wins). **B6 VERIFIED** `git check-ignore -v`: wave/agent-teams ignored · hmw.js/README tracked.
- NEW `.claude/workflows/README.md` (2-MODE table · wave structure · B1-B6 · agent-team n-a · guard).
- B5 harvest wired session-end §L.b(f). A agent-team = n-a (Windows in-process, convention-ready). ADD-mode (chỉ workflow DÀI).
## Harness 3 — email channel cross-project (`broadcasts/`)
- NEW `broadcasts/` tree: `outbox/{ai_infra,vipix,dyd,namgroup,ashico,bvaau,all}/` + `inbox/{6 others}/` + `_index.md` + `inbox/README.md` + **13 .gitkeep** (committed, NOT gitignored).
- NEW `.claude/commands/send-email.md` + `check-email.md` (self=`se`, validate to≠se, 2-stage MOVE, **canonical content_sha256 formula EXACT**, infra-CC §N3).
- `.claude/commands/adap-apply.md` base-path → `outbox\all\*.md`.
## reviewer verdict (P4) — PASS all 3, no blocker
- H1: 2 sub scope-disjoint + tools correct (no store_memory/Write) + genuinely tailored (not copy-paste) + 4-mặt/5-trục đủ.
- H2: hmw.js valid mirror + VALID_ROLES 8 + B6 git-check-ignore verified + G-015 honest.
- H3: self=se complete + SHA256 formula byte-identical send==check + 13 .gitkeep (floor "12" undercount, em đúng 13) + adap-apply fixed.
- honest nấc PASS (executed-file/verified-runtime-pending). G-015 scan 6 hits ALL negating = correct. mojibake false-pos "ĐÃ" clean.
- **1 MINOR (non-block, fixed):** README:11/18 "7-agent" diagram = PRE-EXISTING (git diff proved work này chỉ touch load-bearing) → em fixed header + line 18 + note.
## Nấc honest + NEXT
- **executed-file** toàn bộ; **verified-runtime PENDING anh restart CLI** (agent/cmd `.md` no hot-reload).
- 🔴 NEXT: restart → `/session-start` smoke-test 2 monitor sub load + RE-REPORT · optional wave-run kiểm B6/B5 · optional `/send-email ai_infra handshake` → AI_INFRA `/check-email se` 2-way.
## Artifacts
- 3 adap-report `docs/governance/adap-reports/2026-06-07-Agent-harness-{1,2,3}.md` (5-field LOCK).
- user-memory `feedback_harness_123_adoption.md` (project).
- Commit: [pending — fill sha post-commit].