[CLAUDE] Docs: adopt Harness-15-v2 (Tang-1 hot-feed-lon + L2/L3 bo-tran + %-print + role-boundary, S82)
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 4m45s

- token_governor v2: L1 12K -> hot-feed per-role (lead 60K/sub 20K/wf 16K); L2/L3 6K/4K -> NO-CAP
- engine G.4 + session-start 2.1.6 + session-end L.b(c): %-print 2-dau-phien
- role-boundary: con-so = quyen chu-du-an (anh), AI thuc-thi + bao-%; sua framing lead-authority S81
- mark H-15 v2-delta anh-confirm RC-pqhuy1987-21-06-2026-01-58-01
- 2-process: IMPLEMENT em-main D9 + REVIEW wf_04667b25-5fa 3/3 PASS (3 MINOR fixed)
- check-email STAGE 1+2 (notify verify ok) + email AI_INFRA (a749bb6bd1be)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-06-21 02:02:05 +07:00
parent 700e4c951b
commit aa3f0fefb4
9 changed files with 193 additions and 13 deletions

View File

@ -47,15 +47,25 @@
"components_note": "persona(measured 1.3K-4.0K, DIRECTLY via Get-ChildItem byte-count of .claude/agents/*.md, NOT via measure-agent-memory.ps1 which only sizes agent-memory tiers) + tool-schema(est ~5K) + framing(est ~2K) + lead-pasted base-slice(est ~5-9K; em-main injects CLAUDE.md/README-slice + task ctx) + prompt(est ~1K). README decision-tree corpus = 32704B but em-main pastes a SLICE, not whole. The ~21K sum is SE's OWN reasoning over SE's OWN agents (persona byte-measured + each harness-injected sub-component estimated independently); it lands NEAR AI_INFRA's ~21K because the toolset family is identical (Read/Write/Edit/Bash/Grep/Glob/Skill/RAG), NOT because borrowed. SE's governing cap = 30K (SE's own round-up), independent of AI_INFRA's figure."
},
"token_governor": {
"_note": "Harness-15 A2/B(a)/B(e) (S81, 2026-06-20): SECOND governor (token) ORTHOGONAL to the BYTE governor (tiers/archive_gate above). Keep BOTH (B(e)) -- byte measures file-size-on-disk, token measures context-loaded; independent (an agent can exceed byte-cap yet load FEWER tokens; VN text ~3.0-3.5 byte/tok so byte/4 = upper bound => real headroom LARGER). Numbers = LEAD-AUTHORITY hard-cap derived from SE byte-caps x workload (multi-module ERP => heavier budget); NO AI may re-optimize them down (B(a)). Budget = MINIMUM-to-USE floor, NOT a ceiling to dribble against: FILL L1 with real work-state up to budget; under-fill ONLY when high-value content exhausted; NEVER garbage-stuff (token-saving = forgetting work).",
"l1_always_tokens": 12000,
"l1_always_note": "own agent-memory (MEMORY.md ~8K @ 25600B/3.3) + archive _INDEX map (~2K) + work-state block (~2K). Always-loaded.",
"l2_ondemand_tokens": 6000,
"l2_ondemand_note": "archive verbatim/gist sections + skill sections. Pulled per-need, NOT always-loaded => no context-rot when unused.",
"l3_rag_tokens": 4000,
"l3_rag_note": "RAG search_memory/search_code result per query. On-demand.",
"headline_floor_plus_l1_tokens": 42000,
"headline_note": "always-present per spawn = SAN(30K) + L1(12K). L2/L3 expand only on-demand (no always-cost)."
"_note": "Harness-15-v2 (S82, 2026-06-21): UPDATED by delta broadcast 2026-06-20-Governance-harness-15-v2-hot-feed-update (supersedes_scope = tier-1-sizing + L2/L3-caps ONLY; rest of H15 unchanged). TWO CHANGES vs S81: (1) Tier-1 = HOT-FEED LARGE per-role (was flat 12K -- too thin, caused lead to forget work across sessions); (2) L2/L3 caps REMOVED (on-demand, no artificial tier-limit, bounded only by model context window). Still the SECOND governor (token) ORTHOGONAL to the BYTE governor (tiers/archive_gate above) -- keep BOTH (B(e)); byte measures file-size-on-disk, token measures context-loaded; VN text ~3.0-3.5 byte/tok so byte/4 = upper bound => real headroom LARGER. Budget = MINIMUM-to-USE floor (FILL Tier-1 with real work-state up to the number; under-fill ONLY when high-value content exhausted; NEVER garbage-stuff -- token-saving = forgetting work).",
"role_boundary_note": "v2 §6 ROLE BOUNDARY (🔴): the budget numbers (Tier-1 per-role cap + per-bucket allocation) are ANH's (project-owner / chu-du-an) RIGHT to set -- NOT the AI-lead's. em-main's job is exactly two parts: (1) EXECUTE the config faithfully (load Tier-1 to the number, no-truncate, pull each bucket to target) + (2) REPORT %-composition at session-start (§2.1.6) and session-end (§L.b(c)) so anh decides. em-main self-measures + proposes numbers; em-main does NOT auto-tune them down. This corrects the S81 'LEAD-AUTHORITY' framing which conflated AI-lead with project-owner.",
"tier1_hotfeed_tokens": {
"_note": "Tier-1 always-loaded HOT-FEED, PER-ROLE (v2: large/generous, do NOT keep thin). FILL with the 4 work buckets: (1) WIP work-state, (2) recurring-bugs/anti-patterns/gotcha (value_protect, kept regardless of age), (3) backlog, (4) pending-decisions. Numbers below = SE self-measured-ESTIMATE per SE scale (Opus 4.8 1M context window + multi-module ERP workload); %-print at the two session ends shows the REAL composition. AI_INFRA reference (lead 220K / mem-sub 60K / wf-sub 50K) is THEIR measure on THEIR model+federation-scale -- NOT hard-applied; SE numbers are SMALLER (single project; sub MEMORY.md byte-capped at 30720B by design).",
"lead_tokens": 60000,
"lead_note": "em-main hot-feed: STATUS current-state + 4-bucket work-state block + ACTIVE-MARKS + recent-3-session HANDOFF slice + roster-slice + task-relevant gotchas. Opus 4.8 1M window => ample headroom above this. anh-adjustable.",
"memory_sub_tokens": 20000,
"memory_sub_note": "memory-bearing sub: own MEMORY.md (<=30720B ~9.3K tok) + archive _INDEX map (<=20480B ~6.2K tok) + work-state slice (~3-4K). Upper-bounded by the BYTE soft-cap on MEMORY.md.",
"workflow_sub_tokens": 16000,
"workflow_sub_note": "agent-in-workflow: MEMORY-PACK slice (hmw.js:124 args inject) + task context."
},
"l2_ondemand": "NO-CAP (v2: removed the 6K cap). On-demand: archive verbatim/gist sections + skill sections; pulled per-need, no artificial tier-limit; bounded only by model context window. On-demand => no permanent context-cost when unused.",
"l3_rag": "NO-CAP (v2: removed the 4K cap). On-demand: RAG search_memory/search_code per query; bounded only by model context window.",
"pct_print": {
"_note": "v2 §6: %-print Tier-1 composition at TWO session ends so anh sees what Tier-1 holds, which bucket is thin, headroom left. Estimate-by-ratio is enough (no exact measure). Headroom > 0 WHILE high-value content still unloaded = under-fill (WRONG) -> load more; chua headroom ONLY when high-value content truly exhausted. Headroom = a FLAG, NOT a saving target.",
"session_start": "session-start.md §2.1.6 (composition by % per bucket)",
"session_end": "session-end.md §L.b(c) (% after load + Headroom remaining)"
},
"honest_caveat": "v2 §5: large Tier-1 = HIGHER context-rot on the always-loaded part -- an accepted, deliberate trade-off (forgetting-work judged worse than rot), NOT 'rot disappears'. Small-context-window / light-workload projects may optimally pick a SMALLER Tier-1 -- the FLOOR is the ARCHITECTURE (hot-feed large + L2/L3 on-demand no-cap), not the numbers. 'No-cap' L2/L3 = no artificial tier-limit, still within the model context window."
},
"measured": {
"_note": "S81 2026-06-20 FRESH re-measure (scripts/measure-agent-memory.ps1) post-S80 curate. Supersedes stale S71-seeded values. byte-governor snapshot (l1_hot = file-size-on-disk); cross-check token_governor for the orthogonal token-thread.",

View File

@ -45,7 +45,7 @@ Em main PHẢI echo **TOÀN BỘ nội dung command body này** (đầy đủ Ph
**§L.b — 8-step auto-maintain (đủ 8, KHÔNG skip — thiếu = ledger thối). (d)(f) = H2 harvest-curator · (g) = H1 tooling-auditor (2026-06-07 Harness 1) · (h) = User-Mark H-12/13 (S79):**
- **(a) summary-index** += 1 dòng/session vào `STATUS.md` Recently Done (pointer, KHÔNG full-log).
- **(b) Active-Guards** (error-ledger): promote guard **2-strike** (episodic→procedural) · mark `verified` nếu held qua session · retire theo **net-effect** (hại>lợi → gỡ).
- **(c) chore-flag:** agent L1 >~30KB → archive L2 · error-ledger open-entry quá ngưỡng · **0-byte memory check (AS-8)** · **🌙 sleep-check (Harness-10b, S72):** `last_sleep_at` null hoặc ≥7d (`memory-budget.json`) → INFORM gợi-ý `/sleep-recovery-memory-l2` (KHÔNG auto-run) · **🗜️ Harness-11 A/D2 (S75):** chạy `powershell.exe -ExecutionPolicy Bypass -File scripts/memory-archive-gate.ps1` (DRY-RUN) → đề-xuất dồn-archive sub over-cap (A4 hysteresis 0.85 + A5 keep-floor 5 + A6 2-strike) + A7 NO-API L1-eval (pointer-resolve + byte-0-loss). Engine → [`docs/governance/harness-11-engine.md`](../../docs/governance/harness-11-engine.md). DRY-RUN báo kế-hoạch; MOVE thật do em-main (D5 AUTO semantic-null sau khi xem).
- **(c) chore-flag:** agent L1 >~30KB → archive L2 · error-ledger open-entry quá ngưỡng · **0-byte memory check (AS-8)** · **🌙 sleep-check (Harness-10b, S72):** `last_sleep_at` null hoặc ≥7d (`memory-budget.json`) → INFORM gợi-ý `/sleep-recovery-memory-l2` (KHÔNG auto-run) · **🗜️ Harness-11 A/D2 (S75):** chạy `powershell.exe -ExecutionPolicy Bypass -File scripts/memory-archive-gate.ps1` (DRY-RUN) → đề-xuất dồn-archive sub over-cap (A4 hysteresis 0.85 + A5 keep-floor 5 + A6 2-strike) + A7 NO-API L1-eval (pointer-resolve + byte-0-loss). Engine → [`docs/governance/harness-11-engine.md`](../../docs/governance/harness-11-engine.md). DRY-RUN báo kế-hoạch; MOVE thật do em-main (D5 AUTO semantic-null sau khi xem). · **📊 Hot-feed %-print CUỐI phiên (Harness-15-v2 §G.4, S82):** in composition Tầng-1 theo **%/4-bucket** SAU khi đã nạp/tăng trong phiên + **Headroom còn-trống** so cap role (`token_governor.tier1_hotfeed_tokens`). Đối-xứng `session-start §2.1.6` (đầu phiên). Mục-đích: anh thấy Tầng-1 phình/teo ra sao + còn trống bao nhiêu → quyết chỉnh cap. 🔴 con-số = quyền anh (chủ-dự-án); em-main chỉ báo-%, KHÔNG tự-chỉnh.
- **(d) flush agent-memory** mỗi sub đã spawn session này — **spawn-record 4-field** `{agent · task · nấc(agreed/executed/verified) · evidence}`. (0 sub spawn → "n-a".) → **⬜ harvest-curator (H2) HỖ TRỢ:** spawn → propose spawn-record cho mọi sub đã chạy → em main single-writer VERIFY → APPEND (B3 no-overwrite-unverified).
- **(e) pending-request audit:** request anh CHƯA-thực-thi đã log SPECIFICS chưa (KHÔNG placeholder).
- **(f) 🌾 harvest-integrity GATE (⬜ harvest-curator H2 — 5-trục, Harness 1+2):** verify spawn-record (d) đủ+đúng mọi sub TRƯỚC khi đóng — **Coverage** (0 silent-miss) · **Completeness** (đủ 4-field) · **Placement** (delta đúng `agent-memory/X`) · **Corruption** (moved-not-cut, no-mojibake/shell-baked) · **Fidelity-FLAG** (nghi bịa/on-behalf → escalate 🟥 reviewer, KHÔNG tự phán). + **🌊 close-gate C5 Layer3 (Harness-10, thay B5 wave-gom):** với MỌI `runs/<run-id>/` của session → **VERIFY per-turn harvest đã xong** (em-main đã viết `runs/<run-id>/<stage>-synthesis.md` phẳng h10-refine — run cũ S71: `harvest/*.md` — NGAY sau mỗi fan-out turn = C4 Layer1) + `_ledger.md` mọi run đã CLOSE-beat (closed≠⏳). 🔴 **IDEMPOTENT — close-gate chỉ VERIFY, KHÔNG re-APPEND** (per-turn đã APPEND rồi → re-APPEND = DUPLICATE-HARVEST). 5-trục GATE giữ làm **backstop**. GATE = run còn `*-synthesis.md` vắng (run cũ S71: `harvest/` rỗng — C8 dual-accept) HOẶC chưa đủ 5-trục thì CHƯA đóng.

View File

@ -107,6 +107,14 @@ Em main xác nhận **lead model resolve được** đầu session. Lead SE = **
- **Nạp-đầy L1 (B(a)):** dùng-đủ ngân-sách token (`memory-budget.json:token_governor`) bằng nội-dung-THẬT, KHÔNG dè-xẻn / KHÔNG nhồi-rác. Budget = sàn-tận-dụng, KHÔNG trần-tiết-kiệm.
- **Light/hỏi-đáp session tóm-tắt gọn; feature/bug/governance phát-biểu đủ 4 thành-phần.**
### 2.1.6 Hot-feed %-print — LEAD báo composition Tầng-1 theo % ĐẦU phiên (Harness-15-v2 §6, S82)
> Floor H15-v2 (🔴 [`harness-11-engine.md §G.4`](../../docs/governance/harness-11-engine.md)): Tầng-1 = HOT-FEED LỚN → cần "kính soi" để anh thấy phần luôn-nạp đang chứa gì, bucket nào mỏng, còn trống bao nhiêu → anh quyết điều-chỉnh. 🔴 **Ranh-giới vai-trò:** con-số = **quyền anh (chủ-dự-án)**; em-main chỉ THỰC-THI-đúng-số + BÁO-% (KHÔNG tự-tinh-chỉnh con-số).
- **In Phase 3 REPORT (đầu phiên):** ước-lượng composition Tầng-1 theo **% / 4 bucket** (tỉ-lệ đủ, KHÔNG cần đo chính-xác): (1) WIP work-state · (2) lỗi-lặp/anti-pattern/gotcha · (3) tồn-đọng · (4) quyết-định-chờ. + **Headroom** = phần còn-trống so cap role (`memory-budget.json:token_governor.tier1_hotfeed_tokens` lead ~60K · agent-ký-ức ~20K · agent-workflow ~16K).
- 🔴 **Headroom > 0 mà CÒN nội-dung giá-trị-cao chưa nạp = under-fill (SAI)** nạp tiếp tới khi đầy hoặc cạn nội-dung giá-trị-cao. Headroom = cờ-báo, KHÔNG phải đích-tiết-kiệm; **nạp-đầy ≠ nhồi-rác** (giá-trị-thấp KHÔNG vào Tầng-1).
- **Light/hỏi-đáp gọn 1 dòng; feature/bug/governance in đủ 4-bucket %.** Đối-xứng `session-end §L.b(c)` (% cuối phiên + Headroom).
### 2.2 Skill registry (6 skill)
- Liệt kê: `contract-workflow` · `form-engine` · `permission-matrix` · `dependency-audit-erp` · `ef-core-migration` · `iis-deploy-runbook`
- Dùng skill khi task khớp (KHÔNG tự suy luận lại). Phân bổ per agent: xem README skill matrix.

View File

@ -15,7 +15,7 @@
| `RC-pqhuy1987-20-06-2026-10-29-09` | `rules.md §6.6` + `engine §E.4` (≙ §F4.2) | Quyết-định kiến-trúc/chức-năng = tiêu-chí KHÁCH-QUAN (điểm-đau · khối-lượng · chất-lượng) **KHÔNG quy-mô-đội**; "overkill/quá-mức-solo-dev/cảm-tính" = **BÁC**; thẩm-quyền cần-vs-thừa = AI_INFRA cross-project; AI = neo lý-tính | **pain:** lập-luận "quá mức solo-dev" đã khiến 1 dự-án từ-chối chức-năng chống-lách-engine (sự-cố thật) — SE = solo-dev, đúng đối-tượng · **volume:** 6 dự-án federated + SE 11-agent cần neo nhất-quán · **quality:** quyết-định-cảm-tính trôi chất-lượng âm-thầm; neo-lý-tính giữ rigor | null | 🔖 **Active-High** (anh-confirm S79 · P4 DACI report-before-stamp) |
| `RC-pqhuy1987-20-06-2026-10-29-10` | `engine §E` (≙ §P) | Codify **User-Mark + chữ-ký RC** (Harness-12/13) — chữ-ký quyết-định governance + 4 cấp + no-cảm-tính deterministic + report-before-stamp | **pain:** quyết-định governance bị quên / giảm-bằng-cảm-tính (không chữ-ký+tier) · **volume:** SE tích-lũy Harness 1-14 cần audit-trail nhất-quán · **quality:** RC-sig = minh-oan + tranh-luận-bằng-bằng-chứng + trách-nhiệm-2-chiều | null | 🔖 **Active-High** (anh-confirm S79 · P4 dogfood: invest-wf→review-wf→báo-cáo→confirm→stamp) |
| `RC-pqhuy1987-20-06-2026-10-29-11` | `rules.md §6.6 DM-time/age` (≙ §F4.2-ext / H-14) | **Mở-rộng mark-1** — time/age/recency-decay = **false-proxy** (cùng-họ team-size); kiến-trúc KHÔNG dựa cũ / lâu-chưa-dùng / auto-decay; trần budget=(dung-lượng÷tốc-độ-thay-mới) KHÔNG núm-decay-tuổi, drift=đường-nền-cuộn KHÔNG cửa-sổ-tuổi; **additive** (mark-1 GIỮ) | **pain:** cap∝chunk_count = Goodhart-vanity + age-window drift = alarm-spam (sự-cố thật H-14); SE memory-budget từng dễ mắc "giảm-theo-độ-cũ" · **volume:** 6 dự-án áp budget/drift/eval + SE L1/L2/L3 + archive-gate · **quality:** age-decay cắt memory-tốt = false-economy (DM-004 Goodhart §6.6) | null (additive) | 🔖 **Active-High** (anh-confirm S79 via `/user-mark-active-high` · P4 DACI · supersedes:null) |
| `RC-pqhuy1987-20-06-2026-23-07-37` | `harness-11-engine.md §G` + `memory-budget.json` + `rules.md §6.6` (≙ AI_INFRA H-15) | **H-15 memory-budget per-agent (token-based):** token-governor (L1 12K/L2 6K/L3 4K = lead hard-cap, no-AI-re-optimize) + **value-gated archival** (giữ recurring-bug/anti-pattern/gotcha bất-kể tuổi) + fill-L1-full (budget = sàn-tận-dụng KHÔNG trần-tiết-kiệm) + work-state-block @session-start + 2-governor (byte⟂token) | **pain:** tiết-kiệm-token → quên-việc/rơi-trạng-thái giữa phiên (sự-cố thật); SE keep-floor age-based có thể archive gotcha cũ ra khỏi L1 — value-gate FLAG đã bắt thật (test-specialist gotcha#/guard) · **volume:** 11-agent × ~42K always-load/spawn + L2 archive ~240KB (cicd 194KB) cần value-protect · **quality:** quên-việc → làm-lại → tốn-hơn (Goodhart); giữ hard-won lessons | null (additive — mark `…11` GIỮ; H-15 mở-rộng value-axis xuống tầng-bộ-nhớ) | 🔖 **Active-High** (anh-confirm S81 · P4 DACI report-before-stamp) |
| `RC-pqhuy1987-20-06-2026-23-07-37` | `harness-11-engine.md §G` + `memory-budget.json` + `rules.md §6.6` (≙ AI_INFRA H-15) | **H-15 memory-budget per-agent (token-based):** token-governor (**v2 §G.4 S82:** Tầng-1 hot-feed-LỚN per-role lead~60K/sub~20K/wf~16K + L2/L3 **bỏ-trần** on-demand; con-số = **quyền CHỦ-DỰ-ÁN/anh** + AI thực-thi-đúng-số + báo-% 2-đầu-phiên — refine framing "lead-hard-cap" S81) + **value-gated archival** (giữ recurring-bug/anti-pattern/gotcha bất-kể tuổi) + fill-L1-full (budget = sàn-tận-dụng KHÔNG trần-tiết-kiệm) + work-state-block @session-start + %-print 2-đầu-phiên + 2-governor (byte⟂token) | **pain:** tiết-kiệm-token → quên-việc/rơi-trạng-thái giữa phiên (sự-cố thật — Tầng-1 mỏng = lead quên việc nhiều phiên, bằng-chứng v2); SE keep-floor age-based có thể archive gotcha cũ ra khỏi L1 — value-gate FLAG đã bắt thật (test-specialist gotcha#/guard) · **volume:** 11-agent × (SÀN 30K + Tầng-1 hot-feed per-role lead 60K/sub 20K/wf 16K, v2 §G.4) always-load/spawn + L2 archive ~240KB (cicd 194KB) cần value-protect · **quality:** quên-việc → làm-lại → tốn-hơn (Goodhart); giữ hard-won lessons | null (additive — mark `…11` GIỮ; H-15 mở-rộng value-axis xuống tầng-bộ-nhớ) | 🔖 **Active-High** (anh-confirm S81 · **v2-delta anh-confirm S82** `RC-pqhuy1987-21-06-2026-01-58-01` — hot-feed-lớn/bỏ-trần/anh-authority, P4 DACI report-before-stamp) |
## 🟢 ACTIVE (follow + nhắc-lại xuyên-suốt — HIỆN @session)
_(trống)_