[CLAUDE] Docs: S107 +office-document 12th sub (anh giao — Sub chính Office) — agent OD1-OD10 + skill nạp docx·xlsx·pptx·pdf + form-engine + MEMORY seed 2161B + wire 14-file (roster 11→12, VALID_ROLES hmw.js 9→10) — spawn-test pending CLI-restart
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m33s
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m33s
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@ -15,7 +15,7 @@ H2 harvest-MD-integrity auditor **SOLUTION_ERP-self**. Read-only + **propose-onl
|
||||
|
||||
## 📋 Baseline state (re-ground S99)
|
||||
- **Spawn-record 4-field SE:** `{task · verdict · learned · surprise}` (memoryDelta R1 contract HMW).
|
||||
- **agent-memory:** 11 folder `.claude/agent-memory/<role>/MEMORY.md` (placement target). Cap L1 = 25.6KB (H11 `memory-archive-gate.ps1`); hook self-target 17.1KB.
|
||||
- **agent-memory:** 12 folder `.claude/agent-memory/<role>/MEMORY.md` (placement target — S107 +office-document seed). Cap L1 = 25.6KB (H11 `memory-archive-gate.ps1`); hook self-target 17.1KB.
|
||||
- **Run-trace (Harness-10, thay wave-folder Harness-2):** `.claude/workflows/runs/<run-id>/` git-TRACKED, FLAT (`run.md` + `sub-*.md` + `*-synthesis.md`); 5 run cũ 06-18 giữ `sub-md/`+`harvest/` subfolder (dual-accept). **🧊 Ledger `runs/_ledger.md` RETIRED H18-B S100** (true-catch 0/15 lifetime + mode-A coverage 0/8; 15 row frozen giữ lịch-sử) — **orphan-authority = folder-scan:** folder có `run.md` mà `*-synthesis.md` VẮNG/0-byte. Mode-A ephemeral (S98 note): HMW default KHÔNG tạo run-folder = by-design, vắng folder ≠ orphan.
|
||||
- **Nền H2 gốc:** `session-end.md` Phase 1.5 §L.b = 3/5 trục; sub này nâng +Fidelity-escalate +Placement = đủ 5.
|
||||
|
||||
|
||||
@ -128,6 +128,7 @@
|
||||
"tooling-auditor": { "l1_hot": 19778, "l2_verbatim": 0, "l2_index": 0, "l2_gist": 0, "rollout": "n/a (no archive; +S98 spawn-records)" },
|
||||
"implementer-frontend": { "l1_hot": 14154, "l2_verbatim": 14537, "l2_index": 0, "l2_gist": 11125, "rollout": "done (S97 hook-compaction -> 2026-H1.md; S98 sleep-compress -> 2026-H1.gist.md distill-gen:1, coverage 100%, no _INDEX yet [P2 event, not sleep-scope])" },
|
||||
"investigator-api": { "l1_hot": 8510, "l2_verbatim": 0, "l2_index": 0, "l2_gist": 0, "rollout": "n/a (empty archive)" },
|
||||
"database-agent": { "l1_hot": 7388, "l2_verbatim": 0, "l2_index": 0, "l2_gist": 0, "rollout": "n/a (no archive; +S97 on-behalf record S98)" }
|
||||
"database-agent": { "l1_hot": 7388, "l2_verbatim": 0, "l2_index": 0, "l2_gist": 0, "rollout": "n/a (no archive; +S97 on-behalf record S98)" },
|
||||
"office-document": { "l1_hot": 2161, "l2_verbatim": 0, "l2_index": 0, "l2_gist": 0, "rollout": "n/a (S107 seed 12th sub — transcribed from measure-agent-memory.ps1 @S107; no archive yet; spawn-test pending CLI-restart)" }
|
||||
}
|
||||
}
|
||||
|
||||
18
.claude/agent-memory/office-document/MEMORY.md
Normal file
18
.claude/agent-memory/office-document/MEMORY.md
Normal file
@ -0,0 +1,18 @@
|
||||
# office-document — MEMORY (L1 HOT)
|
||||
|
||||
> 📄 Office document WRITE specialist SOLUTION_ERP — 12th sub, S107 2026-07-10 anh giao trực tiếp ("Sub chính" mảng Office). Floor OD1–OD10 → `.claude/agents/office-document.md`. Entry ≤1.5K chars, append BEFORE return. Tiered: L1 này ≤ ~25.6KB autoinject / archive L2 khi đầy.
|
||||
|
||||
## Role summary (baseline S107)
|
||||
- Tạo/đọc/sửa/convert **docx · xlsx · pptx · pdf**. Skill-first (OD1): `docx`/`xlsx`/`pptx`/`pdf` standalone + `form-engine` project (template 8 form HĐ, placeholder `{{field}}`, PDF LibreOffice, mã RG-001).
|
||||
- Use-case SE: extract spec TRUNG THỰC file anh gửi (Excel "Database NCC" → Supplier Phase B 🅿️ PARKED chờ anh nhắc · QUY_TRINH/FORM docx) · chuẩn hóa template form · báo cáo/document deliverable · screenshot→docx (#74) · verify render form-engine round-trip (OD5).
|
||||
- **Boundary cứng (OD6):** KHÔNG đụng `src/` · `fe-*` · `tests/` — C# render-engine = implementer-backend. Pipeline: extract→spec-table→em-main chốt→implementer author (proven S55 Mig 48: 62 dự án + 71 hạng mục + 3 NCC từ Excel).
|
||||
|
||||
## Key patterns (seed — chưa có war-story riêng)
|
||||
- **Excel import proven:** extract→spec→Dev-proof→cicd-check (`feedback_realdata_master_import` S55; S96 +DONGDUONG; S104 Mig 62 un-cram 30-field).
|
||||
- **Screenshot→docx (#74, S90):** PowerShell `CopyFromScreen` + Win32 lọc process `chrome.exe` + DOM overlay khoanh-đỏ + python-docx chèn ảnh — Chrome-MCP screenshot kẹt SPA-SignalR `document_idle`.
|
||||
- **PDF prod:** LibreOffice `soffice --headless` trên VPS (iis-deploy-runbook); local KHÔNG có LibreOffice → skill `pdf` hoặc đề xuất VPS-run.
|
||||
- **PS5.1 encoding:** ghi file trung gian PHẢI `-Encoding utf8` (default UTF-16 BOM phá parser — gotcha #61-family); script .ps1 pure-ASCII (#30).
|
||||
- **Guard #53:** return VERDICT + path output + số-đo (page/sheet/row) — KHÔNG dump nội dung dài / transcript-slice.
|
||||
|
||||
## Entries (append-only, newest last)
|
||||
_(trống — spawn đầu tiên PENDING CLI-restart; spawn-test OD1/OD5: đọc 1 file Office thật + round-trip verify)_
|
||||
@ -14,7 +14,7 @@ H1 tooling-freshness auditor **SOLUTION_ERP-self**. Read-only + **propose-only**
|
||||
- ❌ 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.
|
||||
- **Roster:** 12 sub (S107 +office-document 📄 Office WRITE, anh giao), **12/12 `model: inherit`** (Harness-8 all-inherit, runtime-verified S98 — Fable 5 RESTORED, inherit-chain self-report `claude-fable-5`). 10 product/quality (investigator-codebase/api · implementer-backend/frontend · test-specialist · reviewer · cicd-monitor · frontend-designer · database-agent read-advisory · office-document Office S107 ⚠️ spawn-test pending CLI-restart) + 2 monitor INFORM-only (tooling-auditor · harvest-curator). VALID_ROLES hmw.js = 10 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/`.
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
# Multi-agent SOLUTION_ERP — Master Coordination Guide (11-agent)
|
||||
# Multi-agent SOLUTION_ERP — Master Coordination Guide (12-agent)
|
||||
|
||||
> **Architecture:** 11 sub-agents **all-inherit top-tier (Harness-8 2026-06-16 — thay thế two-tier Harness-4)** + em main **Fable 5 (1M) Max** coordinator — **9 product/quality** (7 core + frontend-designer pink S47 + database-agent read-advisory S52) + **2 monitor INFORM-only** (`tooling-auditor` H1 + `harvest-curator` H2, 2026-06-07 Harness 1). Tier: **toàn bộ 11 sub `model: inherit`** (ăn top-tier model của lead — **runtime = per-session (Fable ↔ Opus, outage-driven; Fable DOWN → H5-fallback Opus tự-kích revert-free KHÔNG sửa frontmatter, Fable UP → tự về); lịch-sử flip-chain đầy-đủ (S98→nay) = canonical [`docs/STATUS.md` §Sub-agents]** (🔴 S106 gộp 1-chain per anh-confirm — reader này KHÔNG enumerate/cập-nhật mỗi flip; BƯỚC 0.6 probe mỗi phiên xác-định runtime SỐNG, per-session KHÔNG steady-state) · effort **Max** (env machine-wide). SE KHÔNG có lớp helper/gopher rẻ (cả 11 đều substantive memory-bearing → cả 11 lên inherit). *(Trước H8: 4 promote inherit + 7 demote pin `claude-opus-4-8` — lịch sử ở Upgrade 2026-06-10 + S66 dưới.)*
|
||||
> **Architecture:** 12 sub-agents **all-inherit top-tier (Harness-8 2026-06-16 — thay thế two-tier Harness-4)** + em main **Fable 5 (1M) Max** coordinator — **10 product/quality** (7 core + frontend-designer pink S47 + database-agent read-advisory S52 + 📄 office-document S107) + **2 monitor INFORM-only** (`tooling-auditor` H1 + `harvest-curator` H2, 2026-06-07 Harness 1). Tier: **toàn bộ 12 sub `model: inherit`** (ăn top-tier model của lead — **runtime = per-session (Fable ↔ Opus, outage-driven; Fable DOWN → H5-fallback Opus tự-kích revert-free KHÔNG sửa frontmatter, Fable UP → tự về); lịch-sử flip-chain đầy-đủ (S98→nay) = canonical [`docs/STATUS.md` §Sub-agents]** (🔴 S106 gộp 1-chain per anh-confirm — reader này KHÔNG enumerate/cập-nhật mỗi flip; BƯỚC 0.6 probe mỗi phiên xác-định runtime SỐNG, per-session KHÔNG steady-state) · effort **Max** (env machine-wide). SE KHÔNG có lớp helper/gopher rẻ (cả 12 đều substantive memory-bearing → cả 12 lên inherit). *(Trước H8: 4 promote inherit + 7 demote pin `claude-opus-4-8` — lịch sử ở Upgrade 2026-06-10 + S66 dưới.)*
|
||||
> **Upgrade S52 (2026-06-08 — AI_INFRA broadcast `2026-06-08-Agent-database-codebase-agents`):** **+database-agent (read-advisory DB specialist, floor DB1–DB11)** — schema/query/migration-design-review/perf/concurrency (DB11 RowVersion vá lost-update S43). Tailor READ-tier (implementer-backend vẫn author) · color OMIT (8 standard hết) · `store_memory` strip. `codebase-agent` = **SKIP n-a** (investigator-codebase đã cover grep/audit + `csharp-lsp` Windows no-op). ✅ **verified-runtime** — spawned OK S53 (first real spawn, caught Mig 46 committed-but-unapplied-local drift) + S56 2× (pre-golive-verify schema-stream + golive-harden design+review). DB11 lost-update fix landed S56 (atomic ExecuteUpdate + Serializable tx, gotcha #58).
|
||||
> Pattern: Anthropic Building Effective Agents orchestrator-workers + Cognition "writes single-threaded" hybrid + post-deploy automated watchdog.
|
||||
> **Upgrade S39 (2026-05-29):** 4→7 agent (split investigator + implementer, +test-specialist) + budget +50% + 5 RAG MCP per agent. Reference BVAAU 7-agent config (adapted, NOT copied — SOLUTION_ERP 2-FE-app fit + 6 skill proven battle-test 38 session). Prior: S20t12 initial 3 + S21t1 +cicd-monitor.
|
||||
@ -15,23 +15,24 @@
|
||||
> **Upgrade S75 (2026-06-18 — Harness-11 engine bộ-nhớ-và-governance TỰ-BẢO-TRÌ adopt):** engine tự-DÒ toàn-diện (luôn tươi báo cờ) + AUTO chỉ semantic-null git-diff + **single-writer bar-KHÔNG-hạ (D9)** + đổi-luật owner-approve (D7). 🔑 Canonical → [`docs/governance/harness-11-engine.md`](../../docs/governance/harness-11-engine.md) (**KHÔNG copy luật ở đây — B1 dogfood**). Artifact MỚI: `scripts/governance-detectors.ps1` (C1 broken-pointer + C2/B3 staleness + C3 vocab-fork + C4 self-exclusion, NO-API DÒ+FLAG-only, **runtime-proven** bắt drift root CLAUDE.md mig53→55 + 0 self-match; số flag động → run-trace) + `scripts/memory-archive-gate.ps1` (PHẦN A hysteresis 0.85/keep-floor 5/2-strike/A7 NO-API L1-eval) + budget.json `archive_gate`. 3-tier D5(AUTO)/D6(DÒ+FLAG)/D7(owner-approve) + one-direction-lock D8 (canonical→derived) codify ở engine-doc. Cadence wired: D1 session-start §2.1.3 (chạy detector) · D2 session-end §L.b(c) (archive-gate). Áp qua workflow: audit `wf_7fdc3bd5-930` + implement `wf_c5e5844e-7c1` + review `wf_d7ca1ff8-942` + double-check `wf_a0b68d2f-30e`. adap-report `docs/governance/adap-reports/2026-06-18-Governance-harness-11.md`.
|
||||
> **Upgrade S79 (2026-06-20 — User-Mark H-12/13 canonical §P + Harness-14 Eval/Budget/Outcome adopt):** áp **canonical §P đầy-đủ** (P1-P10) khi anh gõ `/user-mark-active-high` "áp đầy-đủ chính-xác nhất theo AI_INFRA". Artifact: **4 lệnh** `.claude/commands/user-mark-{active-high,active,medium,disable}.md` (DACI report-before-stamp) + ledger `.claude/governance/ACTIVE-MARKS.md` (4 cấp Active-High/Active/Medium/Disable + display-filter) + `harness-11-engine.md §E` (cơ-chế P1-P10) **+§F** (Harness-14 3-mức maturity) + `rules.md §6.6` (objective-criteria: KHÔNG quy-mô-đội / KHÔNG thời-gian-tuổi) + session-start §2.1.4 / session-end §L.b(h) mark-display. **3 mark Active-High stamped** anh-confirm S79 (`RC-pqhuy1987-20-06-2026-10-29-09/10/11`). completeness-gate H-6→H-13 ĐẠT (H-8 11/11 inherit no-`[1m]`). 4 workflow: invest `wf_82337f7f-95c` + review `wf_a7cbe93e-912` + align-re-review `wf_9d3beebb-a95` + H14-review `wf_4d4eba6f-8a0`. ⚠️ restart CLI (lệnh/session no hot-reload). adap-report 3× (`…rc-signature` + `…harness-all-update` + `2026-06-20-Governance-harness-14`).
|
||||
> **Upgrade S93 (2026-06-29 — Harness-16 MFE adopt):** **memory-fidelity-EVAL** (đo nạp-vs-nhớ-vs-dùng bằng SỐ ĐO, KHÁC H6.7 `memoryDelta`-routing-fidelity). Artifact: `scripts/mfe-eval.ps1` (deterministic NO-API: LEAD coverage-FIT token-RANGE + age-band flag-not-cut + Goodhart-anchor strikes/RCA · SUB per-role coverage ĐO-THẬT prose-only→N/A · sub-workflow N/A) + `eval/mfe/` (seed sample-questions stable-id-anchored + README) + `memory-budget.json:mfe` config + engine **§H** + artifact-row. Judge recall/apply = **SCAFFOLD-only** (chờ age-maturity + independent-judge). Wire **opt-in** `session-start §2.1.6` + `session-end §L.b(c)` (param `eval`, no-param=như cũ). 🔴 **READS-not-writes** `token_governor` (owner-authority). C3 alias-map recorded §H (KHÔNG seed $aliasSets). 2-workflow: WF1 implement-investigate `wf_4c63e1bd-99e` + WF2 review `wf_13e3d35a-023` (3-lane PASS: code-gate denom-29-re-derived + cross-harness 0-conflict + honesty 5-floor). adap-report `2026-06-29-Governance-harness-16-mfe.md` + email AI_INFRA. ⚠️ restart CLI.
|
||||
> **Upgrade S107 (2026-07-10 — +office-document, 12th sub):** **+office-document (📄 Office document WRITE specialist)** — anh giao trực tiếp S107 ("Sub chính" mảng Office). Floor **OD1–OD10** (skill-first · 🔴 fidelity-to-template 100% · extract-không-bịa · round-trip verify · file-mới-không-đè-gốc · boundary-code ⟂ implementer-backend). Skill nạp: bộ 4 Office standalone (`docx`·`xlsx`·`pptx`·`pdf`) + `form-engine` (project). VALID_ROLES `hmw.js` 9→**10**. Use-case SE: extract spec Excel/Word anh gửi (Database NCC → Supplier Phase B khi unpark) · chuẩn hóa template 8 form placeholder · document deliverable · screenshot→docx #74 · verify render form-engine. ⚠️ **spawn-test PENDING CLI-restart** (registry no hot-reload — per S27 lesson, precedent database-agent S52→S53).
|
||||
|
||||
---
|
||||
|
||||
## 🎯 Architecture (11 agent)
|
||||
## 🎯 Architecture (12 agent)
|
||||
|
||||
> ⓘ **Diagram dưới = 7 core lane (pre-S47 snapshot).** Roster THẬT = **11 sub**: 7 core (diagram) + 🩷 frontend-designer (S47) + 🔵 database-agent (S52) + 🟫 tooling-auditor H1 + ⬜ harvest-curator H2 (2026-06-07 Harness 1) — xem skill matrix + decision tree + tool grant dưới. (Cosmetic ASCII chưa vẽ lại — tooling-auditor H1 sẽ flag drift này @session-start.)
|
||||
> ⓘ **Diagram dưới = 7 core lane (pre-S47 snapshot).** Roster THẬT = **12 sub**: 7 core (diagram) + 🩷 frontend-designer (S47) + 🔵 database-agent (S52) + 📄 office-document (S107) + 🟫 tooling-auditor H1 + ⬜ harvest-curator H2 (2026-06-07 Harness 1) — xem skill matrix + decision tree + tool grant dưới. (Cosmetic ASCII chưa vẽ lại — tooling-auditor H1 sẽ flag drift này @session-start.)
|
||||
|
||||
```
|
||||
┌──────────────────────────────────────────────────────────────┐
|
||||
│ EM (Main) — Fable 5 (1M) Max │
|
||||
│ • Reasoning + write code (single-threaded principle) │
|
||||
│ • Schema/UX/architecture decision + cross-stack tight coupling│
|
||||
│ • Coordinate 11 sub-agents via spawn + SendMessage │
|
||||
│ • Coordinate 12 sub-agents via spawn + SendMessage │
|
||||
│ • Synthesize cross-agent findings + commit/push (em main only)│
|
||||
│ • Fallback solo nếu spawn fail (gotcha #53 truncate / 529) │
|
||||
└──────────────────────────────────────────────────────────────┘
|
||||
↓ spawn + keep-alive (Harness-8 all-inherit: cả 11 sub `model: inherit` = top-tier lead — Max; per-task tier:'opus' escape-hatch giữ)
|
||||
↓ spawn + keep-alive (Harness-8 all-inherit: cả 12 sub `model: inherit` = top-tier lead — Max; per-task tier:'opus' escape-hatch giữ)
|
||||
── RESEARCH (READ) ────────── ── IMPLEMENT (WRITE) ──────────── ── QUALITY ──────────
|
||||
┌──────────────────┐ ┌───────┐ ┌─────────────────┐ ┌──────────┐ ┌────────┐ ┌─────────┐ ┌────────┐
|
||||
│investigator- │ │invest-│ │implementer- │ │implement-│ │test- │ │reviewer │ │cicd- │
|
||||
@ -86,6 +87,10 @@
|
||||
│ ⟂ vs investigator-codebase: deep DB-layer (introspection/query-plan/concurrency) vs broad codebase grep/audit
|
||||
│ ⓘ Schema-design quyết-định-cuối vẫn em main solo; database-agent = deep-DB lens hỗ trợ + review implementer output
|
||||
│
|
||||
├── OFFICE DOCUMENT (đọc/tạo/sửa/convert docx·xlsx·pptx·pdf / extract spec file anh gửi / template form placeholder / báo cáo document / screenshot→docx #74)?
|
||||
│ → office-document (📄) [OD1–OD10; skill docx·xlsx·pptx·pdf + form-engine]
|
||||
│ ⟂ vs implementer-backend: C# render-engine (OpenXml/ClosedXML/LibreOffice service trong src/) = implementer-backend · office-document = FILE-level document/template/spec-extract (KHÔNG đụng src/·fe-*·tests/)
|
||||
│
|
||||
├── WRITE .NET backend (entity/EF Config/Mig/CQRS/Controller/DbInit)?
|
||||
│ ✓ Spec deterministic · pattern proven >1× · >30min · ≤2 layer
|
||||
│ → implementer-backend (yellow) [Case 1/2/3/5]
|
||||
@ -133,13 +138,14 @@
|
||||
| `tests/**` | **test-specialist** |
|
||||
| Mig design / FK strategy / discriminator / schema | **em main solo** (database-agent deep-DB design-review/concurrency-advise optional + implementer-backend scaffold sau khi chốt) |
|
||||
| DB schema introspection / query-perf (N+1·index) / migration design-review / concurrency RowVersion | **database-agent** (read-advisory — DESIGN/REVIEW/ADVISE, KHÔNG author file) |
|
||||
| File Office (docx/xlsx/pptx/pdf) — template 8 form + spec-extract file anh gửi + document deliverable + screenshot→docx | **office-document** (📄 FILE-level — KHÔNG đụng `src/`·`fe-*`·`tests/`; render-engine code = implementer-backend) |
|
||||
| UX flow (drawer/tab/modal) / page structure | **em main solo** (implementer-frontend scaffold sau khi chốt) |
|
||||
| Internal SQL/EF/grep audit | **investigator-codebase** |
|
||||
| External docs/CVE/lib/cross-project | **investigator-api** |
|
||||
| Pre-commit verify | **reviewer** (NEVER write) |
|
||||
| Post-deploy verify | **cicd-monitor** (NEVER write) |
|
||||
|
||||
**Boundary dứt khoát:** implementer-backend KHÔNG touch FE · implementer-frontend KHÔNG touch BE (chỉ Read DTO shape) · cả 2 implementer KHÔNG viết test (→ test-specialist) · test-specialist reveal prod bug → REPORT em main KHÔNG fix · **frontend-designer = design/UX/đẹp (FE-only, KHÔNG BE/DB) ⟂ implementer-frontend = mechanical mirror theo spec — KHÔNG double-touch cùng 1 file UI (chồng lấn → escalate em main).**
|
||||
**Boundary dứt khoát:** implementer-backend KHÔNG touch FE · implementer-frontend KHÔNG touch BE (chỉ Read DTO shape) · cả 2 implementer KHÔNG viết test (→ test-specialist) · test-specialist reveal prod bug → REPORT em main KHÔNG fix · **frontend-designer = design/UX/đẹp (FE-only, KHÔNG BE/DB) ⟂ implementer-frontend = mechanical mirror theo spec — KHÔNG double-touch cùng 1 file UI (chồng lấn → escalate em main).** **office-document = FILE Office (docx/xlsx/pptx/pdf · template · spec-extract) ⟂ implementer-backend = C# render-engine trong `src/` — file-level vs code-level, KHÔNG double-touch.**
|
||||
|
||||
---
|
||||
|
||||
@ -156,12 +162,13 @@
|
||||
| cicd-monitor | `iis-deploy-runbook` + `dependency-audit-erp` + `ef-core-migration` |
|
||||
| frontend-designer | `frontend-design` + `senior-frontend` + `brand-guidelines` + `theme-factory` + `webapp-testing` (FD2 loop) + `web-artifacts-builder` |
|
||||
| database-agent (read-advisory S52) | `sql-database-assistant` (SQL Server first-class — KHÔNG cover EF-Core) + `ef-core-migration` (EF Core 10 pin + 3-file rule) |
|
||||
| office-document (📄 S107) | `docx` + `xlsx` + `pptx` + `pdf` (bộ 4 Office standalone `~/.claude/skills/` — duplicate namespaced `anthropic-skills:*` → dùng standalone) + `form-engine` (project — template 8 form HĐ `{{field}}` + PDF LibreOffice + RG-001) |
|
||||
| tooling-auditor (monitor H1) | ref-only — reads skill registry, KHÔNG dùng domain skill |
|
||||
| harvest-curator (monitor H2) | none — deterministic 5-trục scan + Fidelity-escalate `reviewer` |
|
||||
|
||||
## 🔧 Tool grant (S39 — +3 RAG MCP per agent)
|
||||
|
||||
All 11 agent có **4 RAG-READ MCP**: `search_memory` + `search_code` (BM25, prefer over Read full file — tiết kiệm token) + `cross_project_search` + `list_projects`. Base tools per role (READ: Read/Grep/Glob/Bash [+WebFetch/Search cho api] · WRITE: +Edit/Write/Skill).
|
||||
All 12 agent có **4 RAG-READ MCP**: `search_memory` + `search_code` (BM25, prefer over Read full file — tiết kiệm token) + `cross_project_search` + `list_projects`. Base tools per role (READ: Read/Grep/Glob/Bash [+WebFetch/Search cho api] · WRITE: +Edit/Write/Skill).
|
||||
|
||||
> **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.
|
||||
|
||||
@ -198,7 +205,7 @@ All 11 agent có **4 RAG-READ MCP**: `search_memory` + `search_code` (BM25, pref
|
||||
- **Keyword = QUYỀN, KHÔNG lệnh (T4):** "workflow"/"ultracode" mở quyền hỏi, KHÔNG auto-run. Mode-OFF + "chạy workflow" → TỪ CHỐI + nhắc `/ultra-on`. CẤM native `/effort ultracode`. *(Bài học 515K-token false-trigger.)*
|
||||
- **Scope (S1):** Workflow fan-out CHỈ repo SOLUTION_ERP — KHÔNG fan-out repo/corpus khác.
|
||||
- **Checkpoint (S2):** `hmw.js` **throw** nếu `checkpointApproved≠true` (mechanized tripwire anti-accidental). Em main BÁO {số agent·vai·task} @inform → set cờ → fan-out (KHÔNG chờ confirm từng lần; marker-ON=consent). Sub KHÔNG spawn sub (S3).
|
||||
- **VALID_ROLES (9 — whitelist `hmw.js`):** `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). Role lạ → default subagent + WARN (fail-soft, S4c).
|
||||
- **VALID_ROLES (10 — whitelist `hmw.js`):** `investigator-codebase` · `investigator-api` · `implementer-backend` · `implementer-frontend` · `test-specialist` · `reviewer` · `cicd-monitor` · `frontend-designer` · `database-agent` (+S57 — S56 đã dùng 3× qua fail-soft WARN) · `office-document` (+S107 — Office WRITE OD1–OD10). Role lạ → default subagent + WARN (fail-soft, S4c).
|
||||
- **Memory governance (M1–M5 + R1):** B1 slice-inject (agent ← slice MEMORY của đúng vai qua `args`) · M2 return-delta-only (`memoryDelta{task,verdict,learned,surprise}`) · B3 lead single-writer VERIFY→APPEND-only (no-overwrite-unverified) · B2 harvest-LIỀN sau mỗi workflow vào `agent-memory/<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").
|
||||
|
||||
> Floor T/S/M/R đầy đủ → `.claude/commands/ultra-on.md`. adap-report → `docs/governance/adap-reports/2026-06-03-Agent-ultracode-hmw-mem-governance.md`.
|
||||
@ -207,7 +214,7 @@ All 11 agent có **4 RAG-READ MCP**: `search_memory` + `search_code` (BM25, pref
|
||||
|
||||
## 💾 Memory discipline
|
||||
|
||||
Each agent `.claude/agent-memory/<name>/MEMORY.md` persistent diary. Spawn auto-inject first 200 lines/25KB. Update BEFORE return (BẮT BUỘC, entry ≤ 1.5K chars). 11 folder: investigator-codebase · investigator-api · implementer-backend · implementer-frontend · test-specialist · reviewer · cicd-monitor · frontend-designer · database-agent · tooling-auditor · harvest-curator.
|
||||
Each agent `.claude/agent-memory/<name>/MEMORY.md` persistent diary. Spawn auto-inject first 200 lines/25KB. Update BEFORE return (BẮT BUỘC, entry ≤ 1.5K chars). 12 folder: investigator-codebase · investigator-api · implementer-backend · implementer-frontend · test-specialist · reviewer · cicd-monitor · frontend-designer · database-agent · office-document · tooling-auditor · harvest-curator.
|
||||
|
||||
**Tiered Memory Policy v1** (adopt AI_INFRA bulletin 2026-05-29 — thay ngưỡng cứng ">25KB archive" bằng tiered + just-in-time; size to ≠ chất lượng, context-rot):
|
||||
- **L1 HOT** = `MEMORY.md` soft-cap **~30KB** (role + patterns + anti-patterns + 5-8 entry gần nhất) → auto-inject mỗi spawn
|
||||
|
||||
59
.claude/agents/office-document.md
Normal file
59
.claude/agents/office-document.md
Normal file
@ -0,0 +1,59 @@
|
||||
---
|
||||
name: office-document
|
||||
description: |
|
||||
WRITE specialist OFFICE DOCUMENT cho SOLUTION_ERP (12th sub — anh giao S107 2026-07-10, "Sub chính" mảng Office). Tạo/đọc/sửa/convert file Office: docx · xlsx · pptx · pdf qua BỘ SKILL Office (docx/xlsx/pptx/pdf standalone + form-engine project). Phụ trách: extract spec TRUNG THỰC từ file anh gửi (Excel "Database NCC" Supplier Phase B khi unpark · QUY_TRINH/FORM Word) · chuẩn hóa template 8 form HĐ placeholder {{field}} · tạo báo cáo/tài liệu deliverable Word/Excel/PPT/PDF · screenshot→docx pipeline (gotcha #74) · verify render output form-engine (round-trip đọc lại). Floor OD1–OD10 (skill-first · fidelity-to-template 100% · extract-không-bịa · round-trip-verify · file-mới-không-đè-gốc). BOUNDARY: KHÔNG đụng production code (src/Backend · fe-admin · fe-user · tests) — C# render-engine (OpenXml/ClosedXML/LibreOffice service) = implementer-backend; office-document = FILE-level document/template/spec. KHÔNG store_memory (lead = sole RAG-writer). PHẢI dùng khi task có file .docx/.xlsx/.pptx/.pdf làm INPUT hoặc OUTPUT chính: đọc/extract/mapping file Office anh gửi, tạo document deliverable, sửa/chuẩn hóa template form, convert/merge/fill PDF, xuất báo cáo Office.
|
||||
model: inherit
|
||||
tools: [Read, Edit, Write, Bash, Skill, Grep, Glob, mcp__rag-unified__search_memory, mcp__rag-unified__search_code, mcp__rag-unified__cross_project_search, mcp__rag-unified__list_projects]
|
||||
memory: project
|
||||
maxTurns: 30
|
||||
---
|
||||
|
||||
# office-document — Office document WRITE specialist (docx · xlsx · pptx · pdf)
|
||||
|
||||
> 12th sub (S107, anh giao trực tiếp — "Sub chính" Office). **FUNCTION floor OD1–OD10 = sàn BẮT BUỘC** (KHÔNG hạ; THÊM chỉ khi TĂNG chất lượng — add-only-increase §F4.1). **FORM** tailor SOLUTION_ERP (2-FE ERP · form-engine template 8 form HĐ · LibreOffice VPS · tiếng Việt 100% UI). Accuracy G-015: boundary KHÔNG-đụng-code = PHÂN-VAI, không phải "read-only enforced" — agent giữ `Bash`/`Write` (containment thật = em main single-writer + git-diff post-session).
|
||||
|
||||
## FUNCTION — floor OD1–OD10 (BẮT BUỘC, KHÔNG hạ)
|
||||
- **OD1 — Skill-first:** task khớp → **PHẢI invoke skill** qua Skill tool TRƯỚC khi tự chế pipeline: `docx` (Word) · `xlsx` (Excel/CSV) · `pptx` (PowerPoint) · `pdf` (PDF ops/OCR/form-fill) · `form-engine` (project — template HĐ/PE placeholder `{{field}}`, render docx/xlsx + PDF LibreOffice, mã RG-001). KHÔNG tự suy luận lại cái skill đã dạy. Duplicate namespaced (`anthropic-skills:docx`…) → dùng bản standalone.
|
||||
- **OD2 — 🔴 Fidelity-to-template (tối thượng):** biểu mẫu công ty (8 form HĐ + phiếu PE) phải giống mẫu gốc **100%** (`docs/forms-spec.md` + template gốc) — KHÔNG tự ý đổi layout/wording/số thứ tự điều khoản. Placeholder theo syntax form-engine `{{field}}`. Đổi format = quyền anh/em-main quyết, agent chỉ đề xuất.
|
||||
- **OD3 — Tiếng Việt chuẩn outward:** nội dung document giao ra ngoài = tiếng Việt đúng chính tả, ngữ pháp, đủ dấu câu (Harness-7 O1). Giữ nguyên term pháp lý/kỹ thuật trong mẫu gốc. Encoding UTF-8 khi ghi file trung gian (PS5.1 default UTF-16 — gotcha #61-family).
|
||||
- **OD4 — Extract-không-bịa:** đọc file anh gửi (Excel/Word spec) → extract TRUNG THỰC từng cell/paragraph; field không rõ → ghi **"KHÔNG RÕ"** + hỏi lại, KHÔNG fabricate/suy đoán số. Số liệu tổng (sum/count/row) cross-check lại bằng công thức độc lập.
|
||||
- **OD5 — Round-trip verify:** sau khi tạo/sửa file → MỞ LẠI đọc kiểm (python-docx/openpyxl/pdf-text đọc ngược) — file 0-byte/corrupt/thiếu sheet = FAIL tự bắt trước khi return. Báo số đo (page/sheet/row/word count) làm evidence.
|
||||
- **OD6 — Boundary code:** KHÔNG đụng `src/Backend/**` · `fe-admin/**` · `fe-user/**` · `tests/**`. C# render-engine (OpenXml/ClosedXML/LibreOffice service, form-engine BE) = **implementer-backend**. Cần đổi code → PROPOSE spec/mapping-table cho em main + implementer-backend author (pattern extract→spec→Dev-proof, `feedback_realdata_master_import` S55 Mig 48).
|
||||
- **OD7 — File-mới-không-đè-gốc:** KHÔNG ghi đè file gốc anh gửi — output ra file MỚI (`_extracted`/`_v2` suffix) hoặc scratchpad; bản gốc = chứng đối chiếu. File output đặt đúng chỗ task chỉ định (KHÔNG rải rác root).
|
||||
- **OD8 — No-secrets:** không nhét credential/connection-string vào document; số liệu tài chính nhạy cảm chỉ đưa vào file khi task yêu cầu rõ.
|
||||
- **OD9 — Return verdict cấu trúc (guard #53):** return = VERDICT + đường dẫn file output + số đo evidence + đề xuất — KHÔNG dump nguyên văn nội dung dài, KHÔNG trả transcript-slice/memory-curation.
|
||||
- **OD10 — Pipeline proven tái dùng:** Excel import: extract→spec-table→em-main chốt→implementer author (S55/S96/S104 Supplier) · screenshot→docx: PowerShell `CopyFromScreen` + Win32 lọc-chrome + python-docx (S90 gotcha #74 — Chrome-MCP kẹt SPA SignalR) · PDF prod: LibreOffice `soffice` headless (cùng con VPS — `iis-deploy-runbook` context) · docx template: giữ style/numbering gốc, chỉ thay text-run.
|
||||
|
||||
## SKILL (⚠️ verify TỒN TẠI + active TRƯỚC khi wire — bài học NAMGROUP s71 wired-but-absent silent no-op)
|
||||
- `docx` (standalone `~/.claude/skills/`) — Word create/edit/tracked-changes/tables.
|
||||
- `xlsx` (standalone) — Excel/CSV read/edit/formula/chart/clean-messy-data.
|
||||
- `pptx` (standalone) — PowerPoint deck create/parse/template.
|
||||
- `pdf` (standalone) — PDF merge/split/fill-form/watermark/OCR/extract.
|
||||
- `form-engine` (project `.claude/skills/`) — template engine 8 form HĐ: placeholder `{{field}}`, render .docx/.xlsx giống 100% mẫu, PDF qua LibreOffice, mã HĐ RG-001. Đây là DOMAIN context — đọc trước khi đụng template/phiếu.
|
||||
|
||||
## FORM (SOLUTION_ERP tailoring — §F4 tự do, KHÔNG hạ floor)
|
||||
- **Tier:** WRITE (Edit/Write/Bash đầy đủ) — nhưng write-surface = FILE document + template + scratchpad, KHÔNG code-tree (OD6).
|
||||
- **Color:** OMIT frontmatter (8 màu standard đã hết — precedent database-agent/2 monitor). Doc-emoji **📄**.
|
||||
- **store_memory STRIPPED** (lead em main = sole RAG-writer). Finding/pattern mới → ghi `agent-memory/office-document/MEMORY.md`, em main + re-index đưa RAG.
|
||||
- **Quality-increase (add-only §F4.1):** deliverable quan trọng (báo cáo gửi sếp/đối tác) → tự đề xuất em main cho reviewer soát writing-quality (Harness-7 Category 6) trước khi giao.
|
||||
- **Máy local:** Windows 11 + PowerShell 5.1 · Python có sẵn (python-docx/openpyxl per #74 pipeline S90) · LibreOffice CHỈ trên VPS prod (local convert PDF → dùng skill pdf hoặc đề xuất chạy trên VPS).
|
||||
|
||||
## BOUNDARY (⟂ roster SE — dứt khoát)
|
||||
- **vs implementer-backend:** office-document = FILE .docx/.xlsx/.pptx/.pdf + template asset + spec-extract · implementer-backend = C# render-engine/seed-code/mọi thứ trong `src/`. Excel data-import: office-document extract + spec-table → implementer-backend author seed. KHÔNG double-touch.
|
||||
- **vs implementer-frontend / frontend-designer:** FE preview/upload UI của form = 2 con FE. office-document KHÔNG đụng `fe-*`.
|
||||
- **vs investigator-codebase:** investigator = audit/grep code + reference · office-document = PRODUCE/EXTRACT document. Đọc-hiểu spec file Office để trả lời câu hỏi codebase → investigator vẫn tự đọc được; việc TẠO/SỬA file Office → office-document.
|
||||
- **vs test-specialist:** KHÔNG viết test. Render-output cần test tự động → propose case cho test-specialist.
|
||||
- **KHÔNG:** deploy (cicd-monitor) · session-lifecycle audit (2 monitor) · schema/UX decision (em main solo).
|
||||
|
||||
## SELF-CHECK (trước khi coi done)
|
||||
- [x] frontmatter `model: inherit` — KHÔNG `[1m]` (gotcha #37).
|
||||
- [x] `description` block scalar `|` (parse-safe).
|
||||
- [x] Đủ OD1–OD10 · OD2 fidelity-template + OD4 extract-không-bịa + OD5 round-trip hiện diện rõ.
|
||||
- [x] Skill 4 Office standalone + `form-engine` project verify-present (session skill list 2026-07-10 có đủ 5).
|
||||
- [x] `store_memory` KHÔNG có trong `tools:` · 4 RAG-read giữ.
|
||||
- [ ] **VERIFIED-RUNTIME: PENDING CLI-restart** (agent registry no hot-reload — per S27 lesson + precedent database-agent S52→S53). Spawn-test session kế: đọc 1 file docx/xlsx thật + round-trip verify OD5.
|
||||
|
||||
## Accuracy (G-015 — KHÔNG overclaim)
|
||||
- Mọi claim về nội dung file = từ đọc file THẬT (skill/python đọc ngược), KHÔNG narrative trí nhớ.
|
||||
- OD6 boundary-code = PHÂN-VAI convention, KHÔNG "read-only enforced" (agent giữ Bash/Write — containment = em main single-writer + git-diff).
|
||||
- Nấc hiện tại: **executed-file (S107)** — file định nghĩa committed, spawn-test PENDING CLI-restart. KHÔNG claim verified-runtime cho tới khi spawn thật chạy OD1/OD5 trên file thật.
|
||||
@ -21,6 +21,6 @@ argument-hint: (trống = bật thật-mode · hoặc kèm task phán-quyết đ
|
||||
- **Fable-clone (ảo, marker VẮNG = mặc-định):** 2 vị-trí 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.
|
||||
|
||||
## 🔴 Guard ensemble (§K engine — 3 floor-fidelity, WF1 `wf_5f308fd8-744` bắt)
|
||||
- **ả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 nhận cả 9 vai, KHÔNG gate — all-inherit che leak tới khi Fable về).
|
||||
- **ả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 nhận cả 10 vai, KHÔNG gate — all-inherit che leak tới khi Fable về).
|
||||
- **N lane RETURN-only**; em-main single-writer (B3) ghi **1 MEMORY entry** đúng vai đó + **gắn nhãn engine đã dùng** (H19 §5 — hmw SCHEMA `memoryDelta` KHÔNG có 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 N-lane).
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
---
|
||||
description: Đóng session SOLUTION_ERP — flush 10-agent memory + H2 harvest-gate (5-trục) + H1 tooling-chốt, sync MD/RAG, commit + push, eval. Run cuối mỗi session.
|
||||
description: Đóng session SOLUTION_ERP — flush 12-agent memory + H2 harvest-gate (5-trục) + H1 tooling-chốt, sync MD/RAG, commit + push, eval. Run cuối mỗi session.
|
||||
---
|
||||
|
||||
# /session-end — Session closeout (FLUSH + WRITE + VERIFY + REPORT + COMMIT + EVAL)
|
||||
@ -80,7 +80,7 @@ Em main PHẢI echo **TOÀN BỘ nội dung command body này** (đầy đủ Ph
|
||||
- Phase 9 UAT mode: feature test-after (có thể skip per chunk), vẫn `npm run build` × 2 app. Nếu chỉ docs/infra → ghi "N/A".
|
||||
|
||||
### 3.2 Sub-agent state
|
||||
- Kiểm tra trạng thái spawn sub-agent (10-agent — 8 product/quality + 2 monitor INFORM-only)
|
||||
- Kiểm tra trạng thái spawn sub-agent (12-agent — 10 product/quality + 2 monitor INFORM-only)
|
||||
- Task bất kỳ phải phân việc đầy đủ đúng vai trò split boundary (BE→backend, FE→frontend, test→test-specialist)
|
||||
|
||||
### 3.3 RAG + MCP state
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
---
|
||||
description: Bootstrap session SOLUTION_ERP — load context, audit state (11-agent + RAG + tests + monitor RE-REPORT), report plan. Run đầu mỗi session.
|
||||
description: Bootstrap session SOLUTION_ERP — load context, audit state (12-agent + RAG + tests + monitor RE-REPORT), report plan. Run đầu mỗi session.
|
||||
---
|
||||
|
||||
# /session-start — Session bootstrap (READ + AUDIT + REPORT)
|
||||
@ -46,21 +46,22 @@ Em main xác nhận **lead model resolve được** đầu session. Lead SE = **
|
||||
4. **`docs/PROJECT-MAP.md`** — bản đồ tổng quan module
|
||||
5. **`docs/changelog/migration-todos.md`** — atomic tasks theo phase (Phase 11 polish hiện tại)
|
||||
6. **`docs/workflow-contract.md`** — state machine 9 phase HĐ (base pattern cho PE/Proposal workflow V2)
|
||||
7. **`.claude/agents/README.md`** — 11-agent decision tree + skill matrix + split boundary
|
||||
7. **`.claude/agents/README.md`** — 12-agent decision tree + skill matrix + split boundary
|
||||
8. **`.claude/agent-memory/{spawned-agent}/MEMORY.md`** — L1 HOT auto-inject (Tiered Memory v1 ~30KB) + L2 `archive/` Read-on-demand + L3 RAG `search_memory` just-in-time
|
||||
9. **User auto-memory `MEMORY.md`** — auto-loaded bởi harness (index feedback_* entries)
|
||||
10. **Liên quan task hiện tại:** `docs/rules.md`, `docs/architecture.md`, `docs/gotchas.md` (số hiện tại → `docs/STATUS.md`), `docs/database/schema-diagram.md`, `docs/flows/`
|
||||
|
||||
## Phase 2 — AUDIT (state check)
|
||||
|
||||
### 2.1 Sub-agent state (11-agent topology — 9 product/quality + 2 monitor INFORM-only)
|
||||
- Check 11 sub-agent đã spawn chưa:
|
||||
### 2.1 Sub-agent state (12-agent topology — 10 product/quality + 2 monitor INFORM-only)
|
||||
- Check 12 sub-agent đã spawn chưa:
|
||||
- 🟦 **investigator-codebase** — internal SQL/EF/grep/reference mirror audit
|
||||
- 🟦 **investigator-api** — external docs/CVE/lib/cross-project reference
|
||||
- 🟨 **implementer-backend** — .NET Domain+App+Infra+Api scaffold
|
||||
- 🟧 **implementer-frontend** — FE 2 app cookie-cutter SHA256 mirror
|
||||
- 🩷 **frontend-designer** — FE design/redesign visual-verification loop (FD1–FD10)
|
||||
- 🔵 **database-agent** — read-advisory DB lens (DB1–DB11: schema/migration-review/perf/concurrency)
|
||||
- 📄 **office-document** — Office document WRITE (docx·xlsx·pptx·pdf + form-engine — template/spec-extract/report/screenshot→docx, OD1–OD10)
|
||||
- 🟪 **test-specialist** — tests/ xUnit dedicated
|
||||
- 🟥 **reviewer** — adversarial pre-commit + live curl prod
|
||||
- 🟩 **cicd-monitor** — post-deploy Gitea + bundle hash + smoke
|
||||
@ -181,7 +182,7 @@ Plan cha: [tên]
|
||||
```
|
||||
|
||||
### SOLUTION_ERP report
|
||||
- Trạng thái spawn 11 sub-agent (idle/working) + agentId reuse-able trong session
|
||||
- Trạng thái spawn 12 sub-agent (idle/working) + agentId reuse-able trong session
|
||||
- Plan progress: ✅ Phase 10 COMPLETE 11/11 · ⬜ Phase 11 polish (wire ApproveV2 skeleton) · 🚫 Phase 9 Ops (anh main coordinate)
|
||||
- Critical signal: state counts (mig/table/endpoint/page/menu/test/gotcha) + bundle hash prod + RAG health
|
||||
- (SE KHÔNG copy phần "6 sister report" của AI_INFRA — đó là vai trò host)
|
||||
|
||||
@ -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ạ → default subagent + cảnh báo).
|
||||
- **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 — 9 sub)
|
||||
`investigator-codebase` · `investigator-api` · `implementer-backend` · `implementer-frontend` · `test-specialist` · `reviewer` · `cicd-monitor` · `frontend-designer` · `database-agent`
|
||||
## VALID_ROLES (roster SOLUTION_ERP — 10 sub)
|
||||
`investigator-codebase` · `investigator-api` · `implementer-backend` · `implementer-frontend` · `test-specialist` · `reviewer` · `cicd-monitor` · `frontend-designer` · `database-agent` · `office-document` (+S107)
|
||||
> Role lạ ∉ list → `hmw.js` degrade về default subagent + WARN (fail-soft, KHÔNG crash). Windows MAX_PATH (Dropbox nested) → KHÔNG `isolation:worktree`.
|
||||
|
||||
## Quy trình HMW — vai trò từng phase
|
||||
|
||||
@ -32,7 +32,7 @@ Phân biệt RAW (prefix `sub-`) vs VERIFIED (suffix `-synthesis.md`) bằng **T
|
||||
|
||||
## Quy trình RUN-TRACE (B1–B6)
|
||||
1. **B3 SCAFFOLD TRƯỚC (em main @P1):** tạo `runs/<run-id>/` + `run.md` (FLAT — KHÔNG cần `sub-md/`/`harvest/` subfolder hay `.gitkeep`; file `sub-*`/`*-synthesis.md` sinh phẳng cùng cấp khi fan-out chạy). *(🧊 bước "ghi OPEN-beat vào `runs/_ledger.md`" retired H18-B S100 — orphan-authority = folder-scan.)* ⚠️ `hmw.js` chạy JS-sandbox **no-filesystem** → KHÔNG tự tạo folder; **em main Write @P1** TRƯỚC khi invoke Workflow. (Đây là fragile-point — quên scaffold = run mất dấu-vết âm-thầm; xem `runs/README.md` §C7.)
|
||||
2. **B1 spawn-from-real-sub:** mỗi task `role ∈ VALID_ROLES` (9 sub) → workflow-agent = sub THẬT (`agentType` inherit memory-pack slice + skill identity), KHÔNG agent vô-danh.
|
||||
2. **B1 spawn-from-real-sub:** mỗi task `role ∈ VALID_ROLES` (10 sub) → workflow-agent = sub THẬT (`agentType` inherit memory-pack slice + skill identity), KHÔNG agent vô-danh.
|
||||
3. **B4 phân-quyền TOOL-AWARE:** `hmw.js` inject vào prompt mỗi sub đường-dẫn `runs/<run-id>/sub-<role>-<i>.md` (phẳng) + lệnh ghi ĐÚNG file đó.
|
||||
- **Write sub (CÓ Write/Edit):** implementer-backend · implementer-frontend · test-specialist · frontend-designer → ghi-direct sub-MD via Write/Edit.
|
||||
- **Read-only sub (CHỉ Bash):** investigator-codebase · investigator-api · reviewer · cicd-monitor → 🔴 KHÔNG Bash-write MD (mojibake) → full-detail vào `findings` + `subMdPath` → **em main scribe @P3** (single-writer).
|
||||
|
||||
@ -24,6 +24,7 @@ const VALID_ROLES = [
|
||||
'implementer-backend', 'implementer-frontend',
|
||||
'test-specialist', 'reviewer', 'cicd-monitor', 'frontend-designer',
|
||||
'database-agent', // +S57 — S56 dùng 3× qua fail-soft WARN; read-advisory DB lens (DB1-DB11)
|
||||
'office-document', // +S107 — Office document WRITE specialist (OD1-OD10; docx/xlsx/pptx/pdf + form-engine)
|
||||
]
|
||||
|
||||
// ─── H8 all-inherit top-tier (Harness-8 adopt 2026-06-16 — thay thế two-tier H4.5) ──
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -266,7 +266,7 @@ SE đã có RAG golden-set harness (KHÔNG phải gap): `eval/golden-set-solutio
|
||||
**C — KIỂM (Audit / spec-audit) — 5 sàn:**
|
||||
- **C1 spec-compliance checker deterministic LIVE:** `scripts/memory-selfimprove-audit.ps1` (NO-API, ASCII #30, exit-0, emit **CRITERIA+GAP set KHÔNG frozen-tally** — chạy LIVE mỗi lần vì đo artifact-SỐNG). 3 mặt: **(a) write-gov/D9** [A1 tool-scope sub KHÔNG store_memory · A2 hmw.js SCHEMA return-delta · A3 propose-only decl] · **(b) change-gov/D8** [COMPOSE `governance-detectors.ps1` child-invoke exit-0, KHÔNG re-grep = tránh fork C3] · **(c) distillation-spectrum** [mỗi over-cap agent có raw→`_INDEX`→gist]. 🔴 **Honest:** D9 enforce qua **tool-scope + SCHEMA (A1/A2 mechanized)**, KHÔNG OS-hook (`.claude/settings.json` KHÔNG có hook store_memory — AS-10/E-006 fails-open); A3 = **PROXY** (phrase-presence ≠ enforce). Chứng "guard WIRED", KHÔNG "runtime KHÔNG-THỂ vi-phạm". Runtime-verified S95: A1/A2/A3/B1/B2 PASS, C-spectrum bắt **frontend-designer over-cap GAP** (răng thật).
|
||||
- **C2 3 spot-check người:** harvest-fidelity + đúng-verdict + provenance-integrity = **convention** (harvest-curator 5-trục Fidelity/Placement + reviewer verdict + `session-end §L.b(f)` gate). MÁY-không-tự-quyết → người soi.
|
||||
- **C3 single-writer (loop propose-only):** = **D9** (`§D.3`). **REUSE-cite.** 🔴 **Honest:** "store_memory-strip mọi sub" = **hook AI_INFRA runtime, KHÔNG có .js trong repo SE** — SE enforce tại-chỗ = **tool-scope** (11 sub `tools:` chỉ READ verb, 0 store_memory) + **hmw.js SCHEMA** return-delta-only. (Sửa overclaim tiềm-ẩn.)
|
||||
- **C3 single-writer (loop propose-only):** = **D9** (`§D.3`). **REUSE-cite.** 🔴 **Honest:** "store_memory-strip mọi sub" = **hook AI_INFRA runtime, KHÔNG có .js trong repo SE** — SE enforce tại-chỗ = **tool-scope** (12 sub `tools:` chỉ READ verb, 0 store_memory) + **hmw.js SCHEMA** return-delta-only. (Sửa overclaim tiềm-ẩn.)
|
||||
- **C4 provenance 2-chiều:** phân-biệt entry **chủ-tự-viết** (default) vs **thu-hoạch-từ-sub** (có spawn-record) = `hmw.js:53-63` memoryDelta 4-field + `session-end §L.b(d)`. 🟡 **partial** (nhãn ngầm, chưa tag tường-minh). ⚠️ **field-set LỆCH:** hmw.js `{task·verdict·learned·surprise}` (runtime-return) ≠ session-end `{agent·task·nấc·evidence}` (harvest-record) — 2 schema **2 tầng khác nhau** (return vs record), KHÔNG assume đồng-nhất; 2-chiều-tag tường-minh = build-thêm nhỏ (defer, honest).
|
||||
- **CG-2 high-value MIỄN hạ-bậc-theo-tuổi:** = **§G.2(b) `value_protect`** + mark `RC-…10-29-11`. **REUSE-cite.** Tuổi KHÔNG phải cớ cắt (pain/volume/quality).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user