From 21387cd2c9194bca9b6b866e6b83b2de422b77e4 Mon Sep 17 00:00:00 2001 From: pqhuy1987 Date: Fri, 10 Jul 2026 09:28:00 +0700 Subject: [PATCH] =?UTF-8?q?[CLAUDE]=20Docs:=20S107=20+office-document=2012?= =?UTF-8?q?th=20sub=20(anh=20giao=20=E2=80=94=20Sub=20ch=C3=ADnh=20Office)?= =?UTF-8?q?=20=E2=80=94=20agent=20OD1-OD10=20+=20skill=20n=E1=BA=A1p=20doc?= =?UTF-8?q?x=C2=B7xlsx=C2=B7pptx=C2=B7pdf=20+=20form-engine=20+=20MEMORY?= =?UTF-8?q?=20seed=202161B=20+=20wire=2014-file=20(roster=2011=E2=86=9212,?= =?UTF-8?q?=20VALID=5FROLES=20hmw.js=209=E2=86=9210)=20=E2=80=94=20spawn-t?= =?UTF-8?q?est=20pending=20CLI-restart?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- .../agent-memory/harvest-curator/MEMORY.md | 2 +- .claude/agent-memory/memory-budget.json | 3 +- .../agent-memory/office-document/MEMORY.md | 18 ++++++ .../agent-memory/tooling-auditor/MEMORY.md | 2 +- .claude/agents/README.md | 27 +++++---- .claude/agents/office-document.md | 59 +++++++++++++++++++ .claude/commands/fable-real.md | 2 +- .claude/commands/session-end.md | 4 +- .claude/commands/session-start.md | 11 ++-- .claude/commands/ultra-on.md | 4 +- .claude/workflows/README.md | 2 +- .claude/workflows/hmw.js | 1 + docs/STATUS.md | 3 +- docs/governance/harness-11-engine.md | 2 +- 14 files changed, 114 insertions(+), 26 deletions(-) create mode 100644 .claude/agent-memory/office-document/MEMORY.md create mode 100644 .claude/agents/office-document.md diff --git a/.claude/agent-memory/harvest-curator/MEMORY.md b/.claude/agent-memory/harvest-curator/MEMORY.md index 10ee0a6..371a04b 100644 --- a/.claude/agent-memory/harvest-curator/MEMORY.md +++ b/.claude/agent-memory/harvest-curator/MEMORY.md @@ -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//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//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//` 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. diff --git a/.claude/agent-memory/memory-budget.json b/.claude/agent-memory/memory-budget.json index 3f7ba5d..f43a896 100644 --- a/.claude/agent-memory/memory-budget.json +++ b/.claude/agent-memory/memory-budget.json @@ -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)" } } } diff --git a/.claude/agent-memory/office-document/MEMORY.md b/.claude/agent-memory/office-document/MEMORY.md new file mode 100644 index 0000000..c99ba61 --- /dev/null +++ b/.claude/agent-memory/office-document/MEMORY.md @@ -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)_ diff --git a/.claude/agent-memory/tooling-auditor/MEMORY.md b/.claude/agent-memory/tooling-auditor/MEMORY.md index c862c3e..a6106ff 100644 --- a/.claude/agent-memory/tooling-auditor/MEMORY.md +++ b/.claude/agent-memory/tooling-auditor/MEMORY.md @@ -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/`. diff --git a/.claude/agents/README.md b/.claude/agents/README.md index f70f451..a722f09 100644 --- a/.claude/agents/README.md +++ b/.claude/agents/README.md @@ -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//` được git **TRACKED** → mọi write HIỆN trong git-diff = audit trực-tiếp. Containment: tracked-change NGOÀI `runs//` 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/` · 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//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//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 diff --git a/.claude/agents/office-document.md b/.claude/agents/office-document.md new file mode 100644 index 0000000..400cdf6 --- /dev/null +++ b/.claude/agents/office-document.md @@ -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. diff --git a/.claude/commands/fable-real.md b/.claude/commands/fable-real.md index 29390fd..b904977 100644 --- a/.claude/commands/fable-real.md +++ b/.claude/commands/fable-real.md @@ -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). diff --git a/.claude/commands/session-end.md b/.claude/commands/session-end.md index 79d4e80..fb955c9 100644 --- a/.claude/commands/session-end.md +++ b/.claude/commands/session-end.md @@ -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 diff --git a/.claude/commands/session-start.md b/.claude/commands/session-start.md index ac14f84..9eac7f5 100644 --- a/.claude/commands/session-start.md +++ b/.claude/commands/session-start.md @@ -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) diff --git a/.claude/commands/ultra-on.md b/.claude/commands/ultra-on.md index 5b39813..ebcc264 100644 --- a/.claude/commands/ultra-on.md +++ b/.claude/commands/ultra-on.md @@ -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 diff --git a/.claude/workflows/README.md b/.claude/workflows/README.md index 318c97b..ca8c0be 100644 --- a/.claude/workflows/README.md +++ b/.claude/workflows/README.md @@ -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.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//sub--.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). diff --git a/.claude/workflows/hmw.js b/.claude/workflows/hmw.js index eac915c..bca36ac 100644 --- a/.claude/workflows/hmw.js +++ b/.claude/workflows/hmw.js @@ -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) ── diff --git a/docs/STATUS.md b/docs/STATUS.md index 9051094..e00e6ec 100644 --- a/docs/STATUS.md +++ b/docs/STATUS.md @@ -21,7 +21,7 @@ | Gotchas | **79** | +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 | **11** | **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ả 11 sub `model: inherit`** (7 demoted `claude-opus-4-8` flip S66; SE không có helper/gopher rẻ → cả 11 lên top-tier) · effort Max. 9 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 | **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; ⚠️ spawn-test PENDING CLI-restart per S27 lesson).** **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 **`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). @@ -36,6 +36,7 @@ | Task | Owner | Status | |---|---|---| | ✅ **S107 session-start reconcile** — commit S106 leftover 7-file (gộp flip-chain 1-owner anh-confirm + tooling self-compact **md5-verified moved-not-cut 3/3**) + flip-8 S107-Fable canonical + ERD-range →62 ×2 (root CLAUDE:131 + docs/CLAUDE:70) + bootstrap all-green (**440 test** re-verified · detector 36-benign 0-HIGH · spec-audit 0-GAP · 2 monitor ALL-PASS/ALL-CLEAN · RAG 2434 rerank-OK) | 👤 em main | 🟢 done | +| ✅ **+office-document (12th sub — anh giao)** — agent .md OD1–OD10 + MEMORY seed + skill nạp (docx·xlsx·pptx·pdf + form-engine) + wire 12 điểm (README/2 session-cmd/hmw.js VALID_ROLES 9→10/ultra-on/fable-real/workflows-README/engine/2 monitor baseline/STATUS/budget.json) — ⚠️ **spawn-test PENDING CLI-restart** | 👤 em main | 🟢 done (authoring) | | **PE "lỗi phân quyền vào phiếu"** (anh Kiệt UAT) — chờ **số-phiếu + user** soi config workflow | 👤 em main | ⚪ pending (chờ anh specifics, carry S103) |
S105 In-Progress (đã đóng — chi tiết session log) diff --git a/docs/governance/harness-11-engine.md b/docs/governance/harness-11-engine.md index 602edcd..0393359 100644 --- a/docs/governance/harness-11-engine.md +++ b/docs/governance/harness-11-engine.md @@ -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).