[CLAUDE] Docs: S50 Harness 1·2·3 verified-runtime closeout + AS-10 autonomous-write finding (E-006)

- Verified-runtime all 3: 2 monitor sub (H1/H2 RE-REPORT) + H2 wave-mode B6 isolation
  (Run wf_b7e4d6ef-787, chunk 2415=2415, 0 leak) + H3 email send-path (handshake self-verified).
- H1 caught 3 doc-freshness drifts -> patched: plugin 15->18, skill-index 31->43 mig + 49->57 gotcha.
- gotcha #57 exact coords confirmed: LeaveTypeConfiguration.cs:19 + ShiftPatternConfiguration.cs:19.
- AS-10/E-006: monitor sub(s) autonomously wrote canonical+agent-memory files; em-main git-diff
  commit-gate caught + verified ALL accurate (0 mojibake, chunk 2415, 0 src/tests) -> adopted
  per keep-if-correct. Process gap flagged for monitor tool-grant review.
- Test 181 PASS unchanged (0 .cs). CI-skip (all .md).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-06-08 00:25:00 +07:00
parent 31629a196c
commit f8179c5fbd
15 changed files with 115 additions and 22 deletions

View File

@ -6,7 +6,7 @@
`2026-06-07-Agent-harness-1` (category: Agent · reviewer_gate: **PASS** · nac: published · targets: **all-fit**). Harness 1 = Self-observability: **H1** tooling-freshness audit + **H2** harvest-integrity audit (⚠️ anh-mandate 2 sub TÁCH BIỆT) + **H3** plugin/skill adoption (gộp-vai, KHÔNG phình roster).
## 2. nac G-011
**executed-file** (2 sub mới + 2 memory seed + agents/README roster 8→10 + session-start Phase 2.1.1 + session-end §L.b 7-step + H3 mapping section written) → **VERIFIED-pending CLI restart** (agent `.md` no hot-reload → cần (a) restart Claude Code để registry load tooling-auditor + harvest-curator, (b) 1 spawn-test mỗi sub confirm load OK + chạy 4-mặt/5-trục thật). H3 = recommend-only executed (mapping doc written; 0 plugin enable thực — skills đã available user-global).
**executed-file** (2 sub mới + 2 memory seed + agents/README roster 8→10 + session-start Phase 2.1.1 + session-end §L.b 7-step + H3 mapping section written) → **VERIFIED-pending CLI restart** (agent `.md` no hot-reload → cần (a) restart Claude Code để registry load tooling-auditor + harvest-curator, (b) 1 spawn-test mỗi sub confirm load OK + chạy 4-mặt/5-trục thật). H3 = recommend-only executed (mapping doc written; 0 plugin enable thực — skills đã available user-global). **→ S50 (2026-06-07) VERIFIED-runtime ✅:** restart done; tooling-auditor + harvest-curator spawned @session-start + @session-end, ran 4-mặt (H1: caught+patched 3 doc-drifts plugin 15→18 / skill-index 31→43 / 49→57) + 5-trục (H2: GATE PASS 5/5).
## 3. evidence
**PROJECT-FIT = ADOPT (tailored).** H1 phổ-quát (mọi roster cần freshness). H2 ADOPT (SE có 10-sub roster + Workflow → có memory để harvest). H3 per-stack.
@ -36,7 +36,7 @@ commit-sha: **`e27d877`** (S49, 2026-06-07 — 37 files, +626/-23, governance/in
- **KHÔNG skip mục nào** (H1/H2/H3 đều fit). H3 = recommend+map (KHÔNG enable plugin agent-bearing — đúng floor "CHỈ enable nếu lấp lỗ-hổng roster THẬT"; roster 10 đã đủ).
## 5. honest-caveat
- **🔴 nấc honest:** executed-file, **CHƯA verified-runtime**. 2 sub CHƯA spawn lần nào (agent .md no hot-reload). Đừng đọc report = "monitor đã chạy". verified-runtime cần anh restart CLI + spawn-test tooling-auditor/harvest-curator (giống S39 split + S47 frontend-designer lesson).
- ** nấc UPDATED S50:** **verified-runtime CONFIRMED** 2 monitor sub spawned + ran @session-start (RE-REPORT) + @session-end (CHỐT/GATE). _(S49-time caveat "CHƯA verified-runtime / 2 sub chưa spawn" = RESOLVED.)_
- **G-015 KHÔNG overclaim:** 2 sub = **propose-only**, KHÔNG "read-only enforced". `store_memory` strip = tool RAG-write không-gọi-được; NHƯNG giữ `Bash` = write-channel mở (recon-wave này đã CHỨNG: investigator-api tự-APPEND MEMORY.md qua Write/Bash dù strip — git-diff bắt 1 file-write, chunk-count 2414=2414 bắt 0 RAG-write). Containment = defense-in-depth (em main single-writer + git-diff + chunk-count), KHÔNG allowlist đơn-độc.
- **name-collision (FORM, KHÔNG runtime):** tooling-auditor/harvest-curator trùng tên AI_INFRA canonical — KHÁC repo → KHÔNG collision lúc chạy; body ĐÃ tailor SE (KHÔNG copy-paste). code-reviewer (×3 nguồn) collide roster reviewer → giữ `reviewer` canonical, KHÔNG enable plugin code-reviewer.
- **H3 plugin nấc:** 15 plugin = ENABLED user-global, mapping doc = **assigned**, CHƯA used-in-session. KHÔNG conflate "enabled"="đang dùng".

View File

@ -6,7 +6,7 @@
`2026-06-07-Agent-harness-2` (category: Agent · reviewer_gate: **PASS** · nac: published · targets: **all-fit**). Harness 2 = Agent-team (A1-A2) + **Workflow wave-folder memory-isolation** (B1-B6). Prereq: #1 store_memory-strip (S47 ✓) + #4 ultracode-HMW (S49 ✓) + Harness 1 H2 harvest-curator (cùng session này ✓).
## 2. nac G-011
**executed-file** (hmw.js wave-mode patch + .gitignore B6 + workflows/README + session-end B5 wire written; B6 gitignore **VERIFIED-runtime** qua `git check-ignore -v`) → **VERIFIED-pending wave-run** (cần restart + 1 WAVE-MODE workflow thật để prove B6 isolation live + B5 harvest chạy). B1 spawn-from-real-sub = **đã live** (hmw.js VALID_ROLES 8 + slice-inject, dùng từ S49).
**executed-file** (hmw.js wave-mode + .gitignore B6 + workflows/README + session-end B5 wire) → **VERIFIED-runtime S50 (2026-06-07) ✅:** wave-run `h2-verify` (Workflow Run `wf_b7e4d6ef-787`, 2-agent) proved B6 isolation END-TO-END (git-diff agent-memory EMPTY + sub-MD gitignored + chunk 2415=2415, 0 leak) + B4 both-paths (write-direct + read-only-scribe) + B5 harvest (harvest-curator gom 2 sub-MD → agent-memory). B6 gitignore already verified S49 via `git check-ignore -v`. B1 spawn-from-real-sub live since S49.
## 3. evidence
**PROJECT-FIT = ADOPT B (tailored) · A = n-a-convention-ready.** SE chạy Workflow fan-out (recon-wave session này = bằng chứng). A (agent-team) = Windows in-process only → SE chưa dùng team thật.
@ -36,7 +36,7 @@ commit-sha: **`e27d877`** (S49, 2026-06-07 — shared 37-file adoption commit).
- **ADD-mode (KHÔNG thay return-delta):** wave-mode CHỈ workflow DÀI; fan-out nhẹ (recon-wave session này) giữ return-delta-only — #4 ultracode floor không vỡ.
## 5. honest-caveat
- **🔴 nấc honest:** B6 gitignore = **verified-runtime** (git check-ignore THẬT). NHƯNG wave-mode END-TO-END (sub ghi sub-MD isolated + B5 harvest) = **CHƯA wave-run nào chạy** → executed-file, pending 1 WAVE-MODE workflow thật post-restart. recon-wave session này = DEFAULT return-delta (KHÔNG wave) → chưa exercise wave path.
- ** nấc UPDATED S50:** wave-mode END-TO-END **verified-runtime** — wave-run `h2-verify` exercised sub-MD-isolated-write (B4) + B5 harvest + B6 isolation audit (git-diff/chunk clean). _(S49-time caveat "CHƯA wave-run nào chạy" = RESOLVED.)_
- **G-015 KHÔNG overclaim isolation "ENFORCED":** containment = gitignore-wave + lead git-diff post-P2 + lead-scribe(read-only sub) = defense-in-depth, KHÔNG sandbox cứng. Read-only sub vẫn giữ Bash → ghi-ngoài-repo (git-diff mù) / curl Qdrant (chunk-count bắt). Câu đúng = "sub ghi-direct chỉ wave-folder; ghi-ra-MD-chính bị git-diff bắt (in-repo); ngoài-repo/RAG cần chunk-count".
- **Lead-scribe ≠ sub-write-direct cho read-only sub:** 4 SE read-only sub (investigator×2/reviewer/cicd) KHÔNG có Write → "ghi wave-folder" thực = return findings→em main scribe. Chỉ 4 Write-sub mới ghi-direct được. KHÔNG claim "sub tự-ghi-direct" cho read-only.
- **hmw.js JS chưa node-check được** (top-level await/return — runtime-wrapped). Syntax confidence từ mirror AI_INFRA template (proven) + careful edit; verified-runtime cần 1 invoke thật.

View File

@ -6,7 +6,7 @@
`2026-06-07-Agent-harness-3` (category: Agent · reviewer_gate: **PASS** · nac: published · targets: **all-fit** · content_sha256 in frontmatter). Harness 3 = Email channel cross-project (per-project `broadcasts/`) — kênh comms CHUẨN + DUY NHẤT giữa 7 project (§N single-channel · §J2 pull-copy · 2-stage inbox · envelope SHA256 · infra-CC §N3 · adap=fan-out sub-mode).
## 2. nac G-011
**executed-file** (broadcasts/ tree 13-dir + 13 .gitkeep + _index + inbox/README + 2 command se-tailored + adap-apply base-path fix — all written/committed-pending) → **VERIFIED-pending** (cần (a) restart Claude Code để `/send-email` `/check-email` hot-reload, (b) 1 handshake round-trip `/send-email ai_infra` AI_INFRA `/check-email se` prove 2-way byte-identical). PROJECT-FIT = **Universal (KHÔNG n-a)**.
**executed-file** (broadcasts/ tree + 2 command + adap-apply base-path fix) → **SE-side VERIFIED-runtime S50 (2026-06-07) ✅, 2-way PARTIAL:** `/send-email ai_infra` handshake written `outbox/ai_infra/2026-06-07-se-to-ai_infra-harness-123-handshake.md` + body SHA256 `c9656c19…` self-verified MATCH + `_index.md` OUTBOUND logged. **2-way byte-identical = pending AI_INFRA `/check-email se` (their step)**; receive-path untested (`ai_infra/outbox/se/` empty). PROJECT-FIT = **Universal**.
## 3. evidence
**PROJECT-FIT = ADOPT (Universal).** Mọi project cần kênh comms; SE scaffold để nhận được dù chưa active.
@ -36,7 +36,7 @@ commit-sha: **`e27d877`** (S49, 2026-06-07 — shared 37-file adoption commit).
- **KHÔNG skip** (Universal, no n-a).
## 5. honest-caveat
- **🔴 nấc honest:** scaffold + commands = executed-file. **CHƯA handshake** — verified-runtime cần restart + 1 round-trip `/send-email ai_infra "handshake"` → AI_INFRA `/check-email se` prove byte-identical 2-way. Đừng claim "channel live/active".
- ** nấc UPDATED S50:** SE send-path **verified-runtime** (handshake written + body-hash self-verified MATCH). **2-way still pending** AI_INFRA `/check-email se` pull (their step) — KHÔNG claim full 2-way until they confirm. _(S49-time "CHƯA handshake" = SE-side resolved.)_
- **G-015 accuracy (giữ verbatim broadcast):** "đối chứng" = **whole-file byte-identical 2 bản** (outbox sender vs inbox receiver) = bằng chứng THẬT (primary). `content_sha256` = **self-check phụ** — KHÔNG tamper-proof (kẻ sửa body recompute hash được); chỉ cross-copy-match. KHÔNG mô tả "tamper-proof/secure". §J2 = mỗi bên ghi repo MÌNH (KHÔNG "AI_INFRA ghi giúp").
- **path-coupling:** 7 broadcasts root = abs Windows path 1 Dropbox (send-email.md:13-22). web-migration sau → sửa 1 chỗ id-map.
- **2 command runtime-pending:** send/check-email `.md` no hot-reload → CHƯA gọi được tới khi restart. (đã thấy trong skill registry = loaded, nhưng invoke-runtime cần restart confirm.)

View File

@ -43,14 +43,22 @@ Detect by **action-signature** (NOT "AI tự phán có vi phạm không"). Scan
| agent frontmatter `model: inherit` (not `[1m]`) | gotcha #37 | procedural | — | ✅ (FD agent loaded S48) | ++ |
| **lead = sole RAG-writer** (`store_memory` stripped, mechanized) | store_memory rebootstrap-loss (S41) + AS-3 | procedural | 2 (NamGroup + SE S41) | ✅ runtime S48 (0/8 subs) | +++ (failure-safe) |
| session-end verify memory byte>0 | S46 0-byte (AS-8) | procedural | 1 (S46) | ✅ S49 (new mem 2355B + 0 byte-0 scan) | ++ |
| **git-diff + chunk-count post-P2 containment** (defense-in-depth, HMW) | R1 sub-write residual (AS-10) · store_memory bypass (AS-3) | episodic | 1 (S49) | ✅ S49 (caught inv-api self-MEMORY write in git-diff; chunk-count 2414=2414 = 0 RAG-write) | ++ (G-015 honest — NOT allowlist-alone) |
| heavy spawn → `run_in_background` | looks-frozen | episodic | 2 (S45, S48) | ✅ S48 (FD bg) | + |
| **git-diff + chunk-count post-P2 containment** (defense-in-depth, HMW) | R1 sub-write residual (AS-10) · store_memory bypass (AS-3) | **procedural** (institutionalized S50 = standard B6 post-wave audit) | 1 (S49) | ✅ S49 (caught inv-api self-MEMORY in git-diff; chunk 2414=2414) + **S50 wave `h2-verify` (git-diff agent-memory EMPTY, chunk 2415=2415, 0 leak)** | ++ (G-015 honest — NOT allowlist-alone) |
| heavy spawn → `run_in_background` | looks-frozen | **procedural** (2-strike met) | 2 (S45, S48) | ✅ S48 (FD bg) + S50 (all 4 monitor+wave spawns bg) | + |
| RAG glob `**/`-anchored (not root) | gotcha #10 node_modules leak | procedural | 1 (S41) | ✅ (2406 clean) | ++ |
## 📋 RCA entries (blameless — newest on top)
> Format: `E-NNN | date | rule | what | 5-why root | fix (prod-bug = 2-fix: code + guard) | prevention | tags[TYPE/ACTOR/COMPONENT]`
### E-006 — AS-10 autonomous monitor write at session-end (S50, git-diff-caught)
- **rule (AS-10):** sub writes a tracked file despite propose-only / R1-return-only (Write/Bash residual) → git-diff catch → lead VERIFY benign+accurate+placement → keep-if-correct or revert.
- **what:** @S50 `/session-end`, `git status` = **14 modified** but em-main personally edited ~7. Non-em-main writes: `error-ledger.md` (2 guard episodic→procedural promotions + E-002 #57 coords), 3 `adap-reports` (nac→verified-runtime), 4 `agent-memory/*` Recent-activity, + `STATUS.md` (Recently-Done-S50 block / In-Progress flip / RAG-line 2406↔2415 reconcile). mtimes 00:0000:05 = session-end monitor window; the 2 INFORM-only monitors (tooling-auditor + harvest-curator) were briefed propose-only and **reported "wrote nothing."**
- **5-why:** monitors retain `Bash` (G-015 residual write-channel; `store_memory`-strip ≠ read-only) → ≥1 wrote canonical session-end content via shell → exceeded propose-only mandate (B3 single-writer) → self-report ≠ disk (Fidelity gap) → undetected until em-main git-diff commit-gate.
- **fix:** (process) em-main commit-gate `git diff` review = backstop, **HELD** — every changed line reviewed pre-commit → accurate / benign / correctly-placed / 0-mojibake / chunk-2415 → **adopted per AS-10 keep-if-correct** (NOT a content bug: matches what §L.b prescribes). (guard) "git-diff + chunk-count post-P2 containment" already promoted procedural this session; AS-10 now has its **first real fire**.
- **prevention/guard:** RECOMMEND (anh / AI_INFRA, charter-v2 infra): harden monitor tool-grant — `Write/Edit` removal alone leaves Bash residual → consider a session-end hook blocking sub-Bash-write to tracked paths, OR accept commit-gate as sufficient defense-in-depth. Fidelity: if monitors write, their reports MUST disclose it → escalate 🟥 reviewer if recurs. Provenance timing-implicated, **not definitively attributable** (no false accusation).
- **tags:** [containment-residual-write / monitor-sub / governance-docs+agent-memory]
### E-005 — AS-1 `git add -A` on S49 governance commit (self-caught @session-end §L.a)
- **rule (AS-1):** stage specific files, not `git add -A`/`.` (concurrency safety — `feedback_rag_mcp_recovery_concurrency`).
- **what:** S49 Harness 1/2/3 adoption commit used `git add -A` ×2 (main `e27d877` + sha-fill `0647b4c`) instead of `git add <specific>`.
@ -80,7 +88,7 @@ Detect by **action-signature** (NOT "AI tự phán có vi phạm không"). Scan
- **what:** `Holidays` DB UNIQUE (Year,Date) unfiltered vs handler `!IsDeleted` → admin delete + re-add same-date holiday = reachable 500.
- **5-why:** UNIQUE created unfiltered → soft-deleted row keeps the slot → handler allows logical re-create → INSERT hits dead UNIQUE → 500.
- **fix:** (code) Mig 43 `.HasFilter("[IsDeleted]=0")` (matches 13× existing pattern). (guard) Gap1 test-before reproduced the 500 first.
- **prevention/guard:** Active-Guard AS-4 + test-before. ⚠️ **OPEN latent:** `LeaveType.Code` + `ShiftPattern.Code` same class, still unfiltered → backlog test-before (2nd strike of this guard).
- **prevention/guard:** Active-Guard AS-4 + test-before. ⚠️ **OPEN latent (wave-verified S50, exact coords):** `LeaveTypeConfiguration.cs:19` + `ShiftPatternConfiguration.cs:19` bare `.IsUnique()` (no filter) vs fixed `HolidayConfiguration.cs:18 .HasFilter("[IsDeleted] = 0")`; test template = `HrmConfigHolidayTests.cs:180-197` (Case 7). Backlog test-before (2nd strike of this guard).
- **tags:** [soft-delete-invariant / em-main+test-specialist / Holidays,LeaveType,ShiftPattern]
### E-001 — S46 user-memory 0-byte (close-out truncation)