[CLAUDE] Docs: adopt Harness-17 memory self-improvement loop (Đo→Tinh-chỉnh→Kiểm) — 2-workflow, 0 prod code
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m8s

- engine §I codify 10 red-floor: A1 HCV/A2 load-fid/B1 signal→action/B2 CG-1 termination/B3 build-gap-vs-floor-rot/C1 spec-audit/C2 spot-check/C3 single-writer/C4 provenance/CG-2 age-exempt
- REUSE-cite (no rebuild): A2=§H MFE · C3=D9 · CG-2=§G.2b value_protect · archive=§A
- new mechanized: scripts/memory-selfimprove-audit.ps1 (C1 spec-audit NO-API exit-0, runtime-verified — bắt frontend-designer over-cap GAP thật)
- new: .claude/governance/reinject-ledger.md (B2 CG-1 git-tracked append-only N=3, tách khỏi budget.json)
- wire session-start §2.1.7 (loop-DÒ) + session-end §L.b(c) (loop-REFINE)
- vocab: HCV alias no-seed (coverage 3-way) + governance-detectors C3-comment; cap-fix 220K→380K-pointer
- 2-workflow (Harness-9): WF1 wf_f085d7c4-d78 (ground-truth) + WF2 wf_8e73c1d6-ee6 (3-lane PASS 0-blocking)
- adap-report + checklist-pointer + email AI_INFRA (hash 54789e19, hash-verified self-consistent)
- dogfood: WF1 agent self-write MEMORY.md reverted (D9/AS-10 containment; archive missing → saved 8.5KB)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-07-01 09:11:46 +07:00
parent 707b632a64
commit 18a17f5498
10 changed files with 577 additions and 2 deletions

View File

@ -0,0 +1,15 @@
---
broadcast: 2026-06-30-Governance-checklist-harness-17
from: ai_infra
project: se (SOLUTION_ERP)
date_applied: 2026-07-01 (S95)
status: COVERED-BY main report (pointer for /adap-audit dedup)
---
# Adap-report — Checklist Harness-17 → SOLUTION_ERP (pointer)
Checklist-harness-17 = companion tự-rà-soát của broadcast Harness-17 (cùng ngày). Áp-dụng + 10-mục-🔴 completeness-gate được xử-lý TRỌN trong report chính:
→ [`2026-06-30-Governance-harness-17-memory-self-improvement.md`](2026-06-30-Governance-harness-17-memory-self-improvement.md)
**Completeness-gate (checklist meta):** 10/10 mục 🔴 ĐẠT (WF2-L2 verified) — A (2 sàn-đo) + B (3: signal→action, CG-1 termination, build-gap-vs-floor-rot) + C (5: spec-audit, 3-spot-check, single-writer, provenance-2way, CG-2). Phát-biểu chủ-động "đã phủ đủ 10 mục sàn". 🟡 phần tùy-chỉnh (hình-thức phép-đo, tổ-chức bảng ánh-xạ, nơi lưu sổ chốt-dừng) = áp tinh-thần, form SE-specific (xem report chính "Tailored").

View File

@ -0,0 +1,66 @@
---
broadcast: 2026-06-30-Governance-{harness-17-memory-self-improvement, checklist-harness-17}
from: ai_infra
project: se (SOLUTION_ERP)
date_applied: 2026-07-01 (S95)
status: EXECUTED + runtime-verified (spec-audit script) · VERIFIED-pending-restart (cadence command wire)
reviewer_gate: PASS (WF2 3-lane: code-gate + completeness/cross-harness + honesty, run-id wf_8e73c1d6-ee6)
hash_verify: MATCH both broadcasts (content_sha256 recompute = declared; PowerShell canonical)
---
# Adap-report — Harness-17 Vòng tự-cải-thiện bộ-nhớ (Đo → Tinh-chỉnh → Kiểm) → SOLUTION_ERP
## TL;DR (nấc honest)
Adopt **Harness-17 = memory self-improvement loop (Eval → Refine → Audit)** — đóng "vòng hở" của nhánh eval (§H MFE): trước chỉ ĐO fidelity rồi in số **rồi dừng**; H17 nối **Tinh-chỉnh** (tín-hiệu→hành-động có chốt-dừng) + **Kiểm** (spec-compliance audit). **10 mục 🔴 sàn ĐẠT** (WF2-L2 verified 10/10). Nhiều mục = **REUSE-cite** cơ-chế SE sẵn-có (A2=§H MFE · C3=D9 · CG-2=value_protect · archive=§A) — KHÔNG rebuild. Mục MỚI: **C1 spec-audit script** (`memory-selfimprove-audit.ps1`, mechanized, runtime-verified) + **B2 reinject-ledger** + **B1 signal→action map** + **B3 build-gap-vs-floor-rot test**. **2-workflow mandate ĐẠT** (WF1 implement `wf_f085d7c4-d78` + WF2 review `wf_8e73c1d6-ee6`). **0 production code** — governance-only. **Honest nấc: phần lớn B/C = CONVENTION** (đúng như checklist H17 tự nói); chỉ C1-checker + A2-MFE + strike-anchor + HCV-proxy = mechanized.
## Function-floor coverage (10 mục 🔴 — WF2-L2 verified 10/10)
| Floor | SE implementation | Nấc |
|---|---|---|
| **A1 HCV** (harvest-coverage, said-vs-kept) | harvest-curator H2 trục Coverage (convention) + §H MFE SUB per-role (mechanized) + **HCV proxy MỚI** trong `memory-selfimprove-audit.ps1` (run-trace sub-*.md có synthesis = file-exists). Đặt tên **HCV** tránh "coverage" 3-nghĩa (alias-map §I). | 🟡 **N/A-idle** (proxy sẵn-sàng, chưa có run-trace giữ sub-*.md để chấm; ratio = calibration-interim) |
| **A2 load-fidelity** (fit + %/tier) | = **§H MFE** (`mfe-eval.ps1` LEAD Coverage-FIT + SUB per-role). REUSE-cite. | ✅ (S93, runtime-smoke) |
| **B1 signal→action map** (4 loại) | bảng §I: floor-rot→reinject-verbatim · repeat≥2→promote · old+valueless→cold-archive · raw→distill (`/sleep-recovery-memory-l2`). Mỗi hàng map cơ-chế SE THẬT. | ✅ executed-file (detect=mechanized · action=convention) |
| **B2 CG-1 termination-ledger** | `.claude/governance/reinject-ledger.md` (git-tracked · append-only · N=3 · escalate-anh). TÁCH khỏi budget.json (§G.4(4) owner-authority). | ✅ executed-file (convention) |
| **B3 build-gap vs floor-rot** | phép-thử-ranh-giới §I: "item ĐÃ-từng-tồn-tại (git-history) ∩ CÒN-giá-trị ∩ RỚT-L1?" → floor-rot=reinject; chưa-dựng=build-gap. | ✅ executed-file (convention) |
| **C1 spec-audit LIVE** | `scripts/memory-selfimprove-audit.ps1` (NO-API, ASCII #30, exit-0, emit CRITERIA+GAP KHÔNG frozen-tally). 3 mặt: (a) write-gov [tool-scope+hmw.js schema+propose-only] · (b) change-gov [COMPOSE governance-detectors] · (c) distillation-spectrum [over-cap có _INDEX/gist]. | ✅ **executed + runtime-verified S95** (bắt frontend-designer over-cap GAP thật) |
| **C2 3 spot-check người** | harvest-fidelity + verdict + provenance = harvest-curator 5-trục + reviewer + session-end §L.b(f). | ✅ convention |
| **C3 single-writer** (loop propose-only) | = **D9** (§D.3). REUSE-cite. | ✅ (honest: xem §M) |
| **C4 provenance 2-chiều** | spawn-record `hmw.js:53-63` + session-end §L.b(d). | 🟡 **partial** (nhãn ngầm; field-set lệch — xem §M) |
| **CG-2 high-value miễn-tuổi** | = **§G.2(b) value_protect** + mark `RC-…10-29-11`. REUSE-cite. | ✅ convention |
## Tailored (form tự-quyết — SE-specific)
- **Vocab (C3 — WF1 Agent-D bắt):** "coverage" nay **3 nghĩa** (H2 harvest "Coverage" 0-silent-miss · H16 MFE SUB "coverage" role-floor-retention · H17 A1 "HCV" said-vs-kept). → đặt tên **HCV**, alias-map §I, **KHÔNG seed `$aliasSets`** (giống H16 memory-fidelity; 3-khái-niệm-1-từ seed sẽ false-flag). C3-comment `governance-detectors.ps1`. "audit"→"spec-audit". Từ mới `reinject`/`floor-rot`/`build-gap`/`signal→action` = grep 0-match → sạch. **vocab-fork giữ nguyên 27 flag** (WF2-L2 verified, KHÔNG tạo fork thứ 4).
- **N=3 (SE solo-dev):** reinject ≤1 lần/3 phiên (nhỏ hơn multi-dev vì solo = feedback-loop nhanh).
- **Cadence wire:** `session-start §2.1.7` (loop-DÒ INFORM-only) + `session-end §L.b(c)` (loop-REFINE propose). Opt-in `eval` (tương-thích-ngược).
- **0 hard-conflict** (WF1 Agent-D + WF2-L2): 3 placement-constraint tuân đủ — reinject-ledger tách budget.json · reinject=promote-COPY giữ D11 · loop=D6-under-D9 (CG-1 escalate ≙ E.2).
## 2-workflow mandate (Harness-9 / adap-apply §31) — ĐẠT
- **WF1 IMPLEMENT** `wf_f085d7c4-d78` (4-agent ground-truth: reuse-anchor + C1-audit-design + B1/B2/B3-draft + cross-harness-conflict) → em-main integrate single-writer. **Lesson dogfood:** WF1 Agent-A (investigator-codebase) tự-compact MEMORY.md giữa workflow (persona vượt return-only-prompt) = **AS-10/E-006 recurrence** → em-main git-diff bắt + **revert** (D9 single-writer). Bonus: `archive/2026-06.md` KHÔNG tồn-tại → compaction sẽ **mất 8.5KB** nếu giữ → **dogfood chính C3 floor đang adopt cứu data thật**.
- **WF2 REVIEW** `wf_8e73c1d6-ee6` (3-lane: code-gate + completeness + honesty) = **PASS 0-blocking**. **Anti-fiddle proof (L1):** spec-audit bỏ qua stale-json (`budget.measured.test-specialist=27723B`) chỉ flag live frontend-designer (26129B) → chứng đo **LIVE** `Get-Item.Length` KHÔNG tin config-cũ (S81 stale-config trap không tái diễn). L2: 10/10 floor + cite-accurate + 27-flag-unchanged. L3: 5/5 caveat + 0 overclaim.
## Honest caveats (broadcast §5 — 5 caveat giữ trong doc §I)
1. **"Vòng chạy thông" = walkthrough THỦ-CÔNG** người-điều-phối nối (đo→phân-loại→ghi), KHÔNG lệnh-tự-động-đơn-nhất (khối-đo exit-0 riêng-lẻ). KHÔNG claim "fully-autonomous".
2. **Judge recall/apply = STUB** (mfe-eval `-Judge` scaffold) — số nhớ/dùng CHƯA nghĩa tới khi sample-q chín-tuổi + trọng-tài độc-lập khác-phiên. Tự-chấm-cùng-phiên = vô-nghĩa.
3. **HCV threshold = calibration-interim** (cò-báo-đuôi, KHÔNG vạch-chất-lượng chốt). **HCV proxy hiện N/A-idle** (chưa run-trace giữ sub-*.md).
4. **Tự-soi (meta-blind-spot):** vòng đo agent-công-nhân, CHƯA đo chính các khâu-meta (đo/tinh-chỉnh/kiểm tự-nó).
5. **Cô-đặc = compress-only;** verify-trước-khi-giữ CHƯA dựng.
## Evidence
- Artifact MỚI: `scripts/memory-selfimprove-audit.ps1` (19KB, NO-API, exit-0, runtime-verified) · `.claude/governance/reinject-ledger.md` (4KB, B2).
- Modified: `docs/governance/harness-11-engine.md` §I (10-floor codify + artifact-map row + fix stale cap-comment 220K→380K-pointer) · `.claude/commands/session-start.md` §2.1.7 · `.claude/commands/session-end.md` §L.b(c) · `scripts/governance-detectors.ps1` C3-comment HCV-no-seed.
- Runtime: spec-audit exit-0, CRITERIA `A1 A2 A3 B1 B2 C-spectrum:frontend-designer`, GAP `C-spectrum:frontend-designer:MED` (răng thật). governance-detectors vẫn 27-flag (no vocab-fork thứ 4).
- **0 production code.** State THẬT GIỮ NGUYÊN (Mig 59 · 88 bảng · 434 test · gotcha 76 · bundle admin `CDn40vpV`/user `CoPmPBg7`).
- ⚠️ restart CLI (command `.md` no hot-reload → §2.1.7 + §L.b(c) wire runtime).
## Brutal-honest / phản-biện (§M)
- **C3 store_memory-strip honest-correction:** broadcast + D9 nói "store_memory strip mọi sub". WF1 Agent-A phát-hiện: **strip = hook AI_INFRA runtime, KHÔNG có file .js trong repo SE** — SE enforce tại-chỗ = **tool-scope** (11 sub `tools:` chỉ READ verb, spec-audit A1 verify) + **hmw.js SCHEMA** return-delta-only (A2 verify). Đã sửa overclaim tiềm-ẩn ở §I + spec-audit self-disclosure (D9 wired-not-hook; `.claude/settings.json` KHÔNG có hook → AS-10 fails-open).
- **C4 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, KHÔNG assume đồng-nhất. provenance-2way-tag tường-minh = build-thêm nhỏ (defer, honest — chưa làm).
- **A1 HCV nấc thật:** deterministic proxy = file-exists (run-trace synthesis); said-vs-kept RATIO = calibration-interim + **hiện N/A-idle** (chưa mẫu-chấm). KHÔNG claim "đã đo said-vs-kept".
- **Double-run minor (WF2-L1 note):** session governance chạy governance-detectors 2× (§2.1.3 direct + §2.1.7 spec-audit child-invoke). Đã disclosed caveat-1; detector = fast NO-API grep; redundancy cố-ý (composition). 0 correctness impact.
- **KHÔNG phản-biện function-floor:** H17 fit SE (SE có đủ eval-branch §H MFE + archive-gate §A + D9 + value_protect làm nền → đóng-vòng tự-nhiên). Broadcast honest-tier khớp SE honest-tier (phần lớn convention, mechanized rõ đâu).