diff --git a/.claude/WAL.md b/.claude/WAL.md index 445050f..b5f32a8 100644 --- a/.claude/WAL.md +++ b/.claude/WAL.md @@ -7,7 +7,8 @@ chain: [x] Giai đoạn A — fable-real reviewer #1 (engine: fable-real-single·Fable-S127, spec 3-mục H21): VERDICT GO-ADAP, BÁC claim thư hub "bản 2 duy nhất" bằng rag.json:26 contextual_retrieval=true override ACTIVE; V1 lead spot-check 3/3 khớp; AC 8/8; harvest 1-entry (bằng chứng: .claude/workflows/runs/2026-07-16-S127-adap-dot-16-07/sub-reviewer-1-verdict.md + agent-memory/reviewer/MEMORY.md entry S127) [x] H24 tick 5→6 (head c1b9566) light 3/6 deep 3/15 OVERDUE-none + fail-loud ancestor-check → root-cause dangling-by-squash-S126, ghi event history KHÔNG silent-reset (bằng chứng: .claude/governance/.session-counter.json history[0]) [x] Giai đoạn B — draft 6/6 việc XONG trên đĩa (return garble #53 nhưng ghi-đĩa-trong-lúc-làm cứu trọn); V1 lead 5/5; LỆCH-1 rag.json TRONG repo SE; lead chốt spec-execute-dot-16-07.md 3-wave + 3 owner-gated (bằng chứng: runs/.../sub-investigator-2-spec-draft.md + spec-execute-dot-16-07.md) -[~] Giai đoạn C — ĐANG CHẠY NỀN (S128): fable-real reviewer #2 re-review `spec-execute-dot-16-07.md` + draft (consent lệnh 3 S127). Sub ghi verdict tăng-dần `sub-reviewer-3-verdict.md` — đứt thì vớt đĩa. Xong → lead fold fixes → D — HMW execute workers Opus-MAX (RUN-TRACE folder này) + HMW review RIÊNG (Harness-9 2-workflow) → E — adap-reports ×5 + _index STAGE-2 move (pending→ai_infra) + email hub gộp +[x] Giai đoạn C — GO-WITH-FIXES (4 SHOULD-FIX + 7 NIT, 0 BLOCKER); lead fold F1-F11 vào spec-execute + ghi owner-gated-proposals-dot-16-07.md 4 mục (i-iv); harvest reviewer S128 (bằng chứng: sub-reviewer-3-verdict.md + spec-execute-dot-16-07.md bản fold) +[~] wf: Giai đoạn D wave-1 ĐANG CHẠY (hmw run-id wf_a965db21-e87, 5 lane role-less tier:opus): ①rag.json flip ②backfill hạ-nhãn ③reviewer.md cửa-duyệt ④bookend:8 ⑤session-start:206. Spec = spec-execute-dot-16-07.md ĐÃ FOLD F1-F11. Đứt giữa → /tiep §4: grep run-id log-phiên + đọc sub-task-*.md folder này, harvest-hồi-tố, relaunch CẮT-GỌT phần còn lại. Sau w1 verify: RENAME sub-task-*.md→sub-w1-task-*.md (tránh w2 đè index) → wave-2 5 reports → wave-3 email+move (1 worker tuần-tự) → HMW review RIÊNG → commit [ ] 🔒 CHỜ ANH (3 quyết-định cũ S126, giữ nguyên): B3 mega-line giữ/tách/re-tier + B4 diff 1-dòng memory-budget.json:74 (đề-xuất: runs/2026-07-16-S126-adap-spec-execute/b3-b4-owner-gated-proposals.md) + mark S123 (ACTIVE-MARKS.md:33) [ ] CHỜ HUB (thu hẹp còn 1): ask do-token reply/re-stamp (errata batch hub đang soạn). Ask #2 bookend-NO-DECLARED-SHA ĐÃ RESOLVE S127 (bản published sha 85bf89ca nằm trong inbox) diff --git a/.claude/agent-memory/reviewer/MEMORY.md b/.claude/agent-memory/reviewer/MEMORY.md index 148ff5a..510b4c5 100644 --- a/.claude/agent-memory/reviewer/MEMORY.md +++ b/.claude/agent-memory/reviewer/MEMORY.md @@ -99,6 +99,7 @@ Adversarial pre-commit reviewer SOLUTION_ERP. Read-only verify + live curl prod - **S110 H21+MTv3 — PWF (0C/5M):** doc "VALID_ROLES 12" code=10 → claim-về-code grep lại kể cả reword; supersede trỏ adap-report chưa tạo = dangling. → `archive/2026-07.md`. - **S112 fable-real-single close-reviews+FINAL — GO 0-must:** Import btn reuses sibling-menu guard but endpoint=Admin ⇒ derive guard from ENDPOINT authz; EDGE-5 gác FROM-state ở ĐỈNH method KHÔNG per-branch; self-flip token-test = internal NOT external-accept. → [topic](project_s112_supplier_import_review.md). - **S126 (2026-07-16) A1-H23-probe + email-H23-gate [opus ×2, em-main VERIFY+APPEND] — gate FAIL bắt 3 lỗi thật trước stamp:** (1) 🎯 "Audit 2/2/0" NON-REPRODUCIBLE — audit COUNTS = **session-cumulative**, chính 2 lane review đẩy 2→4. **Lesson: số AGGREGATE cumulative KHÔNG vào outward artifact mời-reproduce — evidence bền = per-lane theo run-id.** (2) "Ba việc nêu ở thư" thực = **2 ASK** — MỞ thư đếm ask thật, đừng gộp courtesy-expectation. (3) "hub 17/17" = SE-self-obs R1-open → hedge+quy-thuộc. Lõi verified độc-lập: lead=Fable **116/116** records · A1 fable · A2 opus. Fixed → stamp `945cf3ad` selftest+stamp_verify+_index CÙNG lượt. Evidence: `runs/2026-07-16-S126-adap-spec-execute/`. +- **S128 (2026-07-16) fable-real #2 re-review spec-execute adap 16-07 [fable-real-single · ~168K tok · 0-garble · ghi-đĩa-tăng-dần; em-main VERIFY (F1/F3/F4 tự xác-nhận từ context sẵn, F2 = live-test bytes của lane) + APPEND] — GO-WITH-FIXES 4 SHOULD-FIX (0 BLOCKER, 7 NIT), cả 4 = lỗi verify-lệnh/scope-rơi, KHÔNG phải lỗi điều-tra:** F1 count-0-quên-README (WAL:20 tự đếm "7=README+6") · F2 so sha `_index` bằng `Get-FileHash` = SAI-LOẠI-HASH (cột = body-sha canonical; đo thật `181a6d19` body ≠ `f29247cf` whole-file) → false-tamper giữa wave · F3 bước NÉN draft→spec làm RƠI item gated budget:65 ở CẢ 2 lane · F4 report ghi "STAGE-2 done" trước khi move chạy = future-claim lớp S108. **Lesson:** (1) lệnh verify trong spec cũng là CODE — chạy thử trên máy trước khi worker bám (2/4 lệnh draft sai thật); (2) ranh-giới bệnh encoding S125 nằm ở CMDLET không ở shell-version: `Select-String -Path` đọc UTF-8-no-BOM ĐÚNG trên PS 5.1 (bệnh ANSI thuộc `Get-Content`) — nghi-án encoding phải ĐO trên đúng cmdlet thay vì suy từ lớp bệnh cũ; (3) fold draft→spec phải đối-chiếu bảng-lane TỪNG DÒNG (S119 disposition-per-row). Full: `runs/2026-07-16-S127-adap-dot-16-07/sub-reviewer-3-verdict.md`. - **S127 (2026-07-16) fable-real #1 gate đầu-vào adap đợt 16-07 [engine: fable-real-single · Fable-S127 · ~62K tok · 0-garble; em-main VERIFY 3/3 spot-check + APPEND] — GO-ADAP, BÁC 1 claim thư điều-phối hub:** "bản 2 = adopt thực chất DUY NHẤT" sai — `rag.json:26 contextual_retrieval: true` override ACTIVE ⇒ bản 5 có việc config THẬT (+ bản 3 ≥2 hằng-số sống bằng nhãn: crystallized-backfill.ps1:117-119 "calibrated" /4.0 /3.0 no-phản-chứng · memory-budget.json:89 measured_token_estimate). **Lesson:** (1) hedge broadcast ("chưa override thì đúng sẵn") phải test bằng MỞ config THẬT — SE là ca override mà thư điều-phối không thấy; (2) "already-aligned" tinh-thần ≠ luật — kiểm-kê vẫn lòi ứng viên; (3) SE GIỮ counter hub vừa gỡ = ĐÚNG (điều-kiện gỡ 1-phiên/ngày + trả-mọi-lượt đo được KHÔNG áp SE: 3 tick/2 ngày `.session-counter.json`). Full verdict + AC 8/8: `runs/2026-07-16-S127-adap-dot-16-07/sub-reviewer-1-verdict.md`. --- diff --git a/.claude/workflows/runs/2026-07-16-S127-adap-dot-16-07/owner-gated-proposals-dot-16-07.md b/.claude/workflows/runs/2026-07-16-S127-adap-dot-16-07/owner-gated-proposals-dot-16-07.md new file mode 100644 index 0000000..c6290a8 --- /dev/null +++ b/.claude/workflows/runs/2026-07-16-S127-adap-dot-16-07/owner-gated-proposals-dot-16-07.md @@ -0,0 +1,31 @@ +# OWNER-GATED PROPOSALS — adap đợt 16-07 (chờ anh, khuôn S126 b3-b4) + +> 4 mục dưới đây KHÔNG chạy trong wave D (nguyên tắc: không đụng vùng owner-ratified khi anh vắng). Diff soạn sẵn — anh trả lời 1 lần là apply được ngay lượt sau. Nguồn chi-tiết: `sub-investigator-2-spec-draft.md` (V1 lead 5/5) + `sub-reviewer-3-verdict.md` (C: GO-WITH-FIXES). + +## (i) `_owner_ratified` — memory-budget.json:123 — re-tune câu neo (SỐ 6/15/3 GIỮ NGUYÊN) + +- **Vì sao:** câu hiện tại neo "Re-tune after cycle-2… n=1 at the hub is mocc-0" — hub ĐÃ GỠ counter (bookend 07-15, sha 85bf89ca) ⇒ run-2 CỦA HUB không bao giờ có; mốc so-sánh phải chuyển về cycle-2 CỦA SE. Đây là lời-chốt của anh nên wording đổi cần anh OK. +- **Diff đề-xuất (ASCII-safe giữ style file):** thay value :123 bằng: + `"owner-decisions-15-07-2026 Q2 -- anh chot 6/15/3 (dat thoi diem do hub CUNG dung 6/15/3; hub GO counter 2026-07-15 bookend 85bf89ca -> vi-du 'o nguon' nay la LICH-SU, khong con moc hub). HONEST-CAVEAT khi bao hub: SE chon 6/15/3 = DELIBERATE STARTING POINT cua owner, NOT copy vo-thuc. Re-tune after cycle-2 CUA SE (deep-audit lan 2 tinh tu .session-counter.json last_audit; delta hub hua tu run-2 khong bao gio co - hub go truoc run-2), nobody may sell 'proven effective' yet."` +- **F10 (C):** anh OK (i) ⇒ re-sync `session-start.md:206` CÙNG LƯỢT (2 chỗ kể cùng câu chuyện neo — :206 wave-D đã re-tune theo hướng này, chỉ cần soát khớp). + +## (ii) C2 — memory-budget.json:89 `measured_token_estimate: 55000` — chọn 1 trong 2 lối-thoát (sàn-sự-thật 190c11ba) + +- **Vì sao:** TÊN field nói "measured" nhưng value = honest MID-ESTIMATE (19K đo + ~36K ước) — nhãn sống bằng uy-tín. 0 consumer tự-động (đã verify). +- **Option-iii (rename, sạch nhất):** `measured_token_estimate` → `token_floor_estimate`. Tiên-quyết khi apply: grep toàn repo mọi ref update cùng commit. +- **Option-ii (exemption-note, ít-chạm):** giữ tên, thêm sibling field `"_measured_label_exemption": "NAME says measured but value = honest MID-ESTIMATE (19K byte-measured + ~36K harness-injected-est) -- exemption per san-su-that 190c11ba; phep kiem lam no truot = re-run _s112_remeasure procedure"`. +- **Lead nghiêng option-iii** (tên đúng > chú-thích chữa tên), nhưng cả 2 hợp lệ — anh chọn. + +## (iii) Seal-verify sau move (curate L1→L2) — codify hay defer? + +- **Vì sao:** inventory 3-câu-hỏi (Việc 3) xác nhận GAP thật ở 2 vòng CÓ MOVE (archive-gate + curate): byte-preserve hiện là kỷ-luật TAY, chưa có niêm-phong máy sau move. +- **Đề-xuất codify (mức NGHI-THỨC/doc-checklist, KHÔNG viết tool — đúng mandate bản 2):** thêm bước vào nghi-thức curate: sau move, (a) md5 khối-dời trước/sau, (b) `Select-String -SimpleMatch` câu đầu + câu cuối khối-dời trong file archive (substring-containment). +- **Hoặc defer** — ghi backlog, làm khi curate lần tới chạm. + +## (iv) budget:65 — tail-note nguồn hằng-số /3.0 (F3 — C bắt spec bản đầu làm rơi; gộp cùng (i) vì cùng file) + +- **Vì sao:** `:65` "VN-diacritic hot-memory ~3.0-3.5 byte/tok" là NGUỒN của divisor /3.0 trong backfill (C1 wave-D đã hạ nhãn "calibrated"→"heuristic") — nguồn cũng cần khai không-provenance để class-fix TRỌN (bài S122: vá 1 lớp = vá đủ site cùng-lớp). +- **Diff đề-xuất:** thêm đuôi vào value :65: ` (convention -- chua do tokenizer that tai SE; dinh-chinh 58f5afd8)`. + +--- +**1 câu trả lời gộp đủ:** (i) OK/sửa? · (ii) iii hay ii? · (iii) codify hay defer? · (iv) OK? — em apply 1 lượt + re-sync F10. diff --git a/.claude/workflows/runs/2026-07-16-S127-adap-dot-16-07/run.md b/.claude/workflows/runs/2026-07-16-S127-adap-dot-16-07/run.md index 5fed6f4..92e4b60 100644 --- a/.claude/workflows/runs/2026-07-16-S127-adap-dot-16-07/run.md +++ b/.claude/workflows/runs/2026-07-16-S127-adap-dot-16-07/run.md @@ -17,7 +17,7 @@ ## Giai đoạn - [x] **A** — fable-real reviewer #1: **GO-ADAP** (verdict + AC 8/8 → `sub-reviewer-1-verdict.md`; V1 lead spot-check 3/3 khớp; harvest 1-entry reviewer MEMORY S127 [engine: fable-real-single · Fable-S127]) - [x] **B** — fable-real investigator-codebase (S128, spec `spec-invest-cach-lam-16-07-2026.md`): draft 6/6 việc HOÀN TẤT trên đĩa `sub-investigator-2-spec-draft.md` (~218K tok · 48 tool-use · ~16 phút). ⚠️ RETURN GARBLE #53 (dòng mô-tả-hành-động thay VERDICT-header) — ghi-đĩa-trong-lúc-làm CỨU TRỌN, 0 mất, không re-run. V1 lead 5/5 anchor PASS. **LỆCH-1:** config flip nằm TRONG repo SE (`.claude/rag.json:26` — projects.py walk-up + setdefault) ⇒ Việc 1 = in-repo edit, KHÔNG cross-repo. Lead chốt `spec-execute-dot-16-07.md` (3 wave + 3 owner-gated proposals). memoryDelta: lead ghi on-behalf sau verify-đĩa. -- [ ] **C** — fable-real reviewer #2: re-review spec execute → GO/NO-GO + fixes fold +- [x] **C** — fable-real reviewer #2 (S128): **GO-WITH-FIXES** — 4 SHOULD-FIX (F1 README-count · F2 sai-loại-hash body-sha≠whole-file · F3 budget:65 rơi khỏi cả 2 lane · F4 STAGE-2 future-claim) + 7 NIT, 0 BLOCKER; 4 live-test + 11 spot-check độc-lập; return SẠCH 0-garble + verdict ghi-đĩa `sub-reviewer-3-verdict.md`. Lead fold F1-F11 vào spec-execute (7 edit) + ghi `owner-gated-proposals-dot-16-07.md` (4 mục i-iv). Harvest reviewer MEMORY S128 ✓. - [ ] **D** — HMW execute (workers opus max, RUN-TRACE này) + HMW review riêng (Harness-9 2-workflow) - [ ] **E** — adap-reports ×5 + _index STAGE-2 move + email hub + closeout diff --git a/.claude/workflows/runs/2026-07-16-S127-adap-dot-16-07/spec-execute-dot-16-07.md b/.claude/workflows/runs/2026-07-16-S127-adap-dot-16-07/spec-execute-dot-16-07.md index 9546e79..a8ed92f 100644 --- a/.claude/workflows/runs/2026-07-16-S127-adap-dot-16-07/spec-execute-dot-16-07.md +++ b/.claude/workflows/runs/2026-07-16-S127-adap-dot-16-07/spec-execute-dot-16-07.md @@ -10,30 +10,33 @@ Execute 6 việc adap đợt broadcast 16-07 theo draft, chia 3 wave + 1 nhóm o **Wave-1 — diff nhỏ độc-lập (workers song-song được):** 1. Việc 1: flip `.claude/rag.json:26` true→false + rationale :31 (diff ở draft §VIỆC-1; LỆCH-1: file TRONG repo SE, KHÔNG đụng AI_INFRA). Verify: python parse in `False`. -2. 4a: hạ-nhãn C1 `scripts/crystallized-backfill.ps1:25,:117` calibrated→heuristic (comment-only; pure-ASCII #30 — ⚠️ wording draft :134 có chữ Việt-có-dấu, worker PHẢI chuyển ASCII-safe khi apply vào .ps1). +2. 4a: hạ-nhãn C1 `scripts/crystallized-backfill.ps1:25,:117` calibrated→heuristic (comment-only, :118-119 code GIỮ; pure-ASCII #30 — ⚠️ F6: non-ASCII duy nhất trong after-text draft:134 là em-dash "—", thay bằng "--" khi apply; chữ đã ASCII-stripped sẵn). Verify: chạy script exit-0 + output giữ dòng `tok RANGE [low..high]` (baseline C đo: `[118424 .. 157898]`). 3. 4c: câu cửa-duyệt measured-label vào `.claude/agents/reviewer.md` sau §"Apply 5-category checklist" (nấc verified-pending — agent .md không hot-reload). -4. 2a: bookend adap-report dòng 8 "7 khoản cũ SAI"→"5 sai/sai-một-nửa + 2 chỉ đổi-cách-đọc" (+2 note ngoặc, giữ enumeration). -5. 2b-file1: `session-start.md:206` re-tune neo cycle-2 CỦA SE (wording draft §2b; giữ vế đầu nguyên). +4. 2a: bookend adap-report dòng 8 "7 khoản cũ SAI"→"5 sai/sai-một-nửa + 2 chỉ đổi-cách-đọc" (+2 note ngoặc, giữ enumeration; F9: giữ backtick quanh `>=` ×2 như dòng gốc — exact-edit, không transcribe từ draft:64 vốn đánh rơi backtick). +5. 2b-file1: `session-start.md:206` re-tune neo cycle-2 CỦA SE (wording draft §2b; giữ vế đầu nguyên; C xác nhận before-text exact-match 1/1 + block :185-206 không mâu-thuẫn). + +*F5 (mọi verify VN-pattern):* giữ NGUYÊN dạng `Select-String -Path` như draft — C đo thật PS 5.1 match đúng trên UTF-8-no-BOM. CẤM worker "cải tiến" sang `Get-Content | Select-String` (bệnh ANSI-decode S125 nằm ở Get-Content). VN-pattern KHÔNG nhét vào file .ps1 (#30). **Wave-2 — 5 adap-reports (REPORT-FORMAT LOCK 5 trường, khuôn `adap-report.md:13-19`):** -6. Bản 2 NEW: transcribe bảng 7×3 + kết-luận q1/q2/q3 từ draft §VIỆC-3 (KHÔNG tự điều-tra lại) + đề-xuất seal-verify = CHỜ-ANH. -7. Bản 3 NEW (4d): kiểm-kê + C1 executed + C2 chờ-anh + positive-exemplars. +6. Bản 2 NEW: transcribe bảng 7×3 + kết-luận q1/q2/q3 từ draft §VIỆC-3 (KHÔNG tự điều-tra lại) + đề-xuất seal-verify = CHỜ-ANH. F7: verify 5-trường dùng pattern `"G-011"` (KHÔNG dùng alternative "nac G-011" — report thật viết "nấc (G-011)" có dấu+ngoặc, 0-hit vĩnh viễn). +7. Bản 3 NEW (4d): kiểm-kê + C1 executed + C2 chờ-anh + positive-exemplars. F11: honest-caveat thêm ½ dòng "câu cửa-duyệt 4c CHỨA chính các nhãn nó săn = mention-not-use; cần exemption nếu mai sau port máy-quét tự-động (gen-2 citation-trap S123)". 8. Bản 4 NEW: nấc `agreed` nắm-hướng, trích hub §7 "chưa build, chưa dùng thử", 0 câu "SE sẽ áp mục 2". 9. Bản 5 NEW: nấc `executed`, evidence diff Việc-1 + verify-output; caveat re-bootstrap = AI_INFRA-op. -10. Bản 1 UPDATE: mục "Re-verify nhịp S127-S128" (4 sàn nguyên · counter GIỮ 3→6/2-ngày · 2 citation: 1 re-tuned + 1 owner-gated · STAGE-2 done-ở-wave-3). +10. Bản 1 UPDATE: mục "Re-verify nhịp S127-S128" (4 sàn nguyên · counter GIỮ 3→6/2-ngày · 2 citation: 1 re-tuned + 1 owner-gated · F4: viết "STAGE-2: chạy ở wave-3" — CẤM viết "done" trước khi 2d chạy [future-claim lớp S108]; worker wave-3 SAU KHI move xong quay lại update dòng này thành done + evidence [adap-report.md:33 idempotent]). **Wave-3 — chốt tuần-tự (1 worker, thứ-tự CỨNG):** 11. Email hub GỘP 1 thư (khuôn draft §VIỆC-6; full-grammar VN outward; selftest-stamp 6c NGAY sau Write + `_index` bước 7 CÙNG LƯỢT; ask do-token GIỮ pending). -12. 2d STAGE-2: move 6 file inbox→`inbox/ai_infra/` + flip 6 row `_index` (hash-verify byte-preserve trước+sau move). Chạy CUỐI vì reports đọc file gốc. +12. 2d STAGE-2: move 6 file inbox→`inbox/ai_infra/` + flip 6 row `_index` (sha cột GIỮ). Chạy CUỐI vì reports đọc file gốc. **F1:** `README.md` Ở LẠI root — expected sau move: `(Get-ChildItem broadcasts\inbox\*.md -File).Count` = **1** (chỉ README), KHÔNG phải 0; move đúng 6 file đích-danh, CẤM wildcard-move. **F2:** byte-preserve = `Get-FileHash` từng file TRƯỚC move == SAU move (cùng loại hash); CẤM so Get-FileHash với sha `_index` (cột đó là body-sha canonical check-email.md:17b — whole-file hash LUÔN lệch → false-tamper). Sau move: quay lại update dòng STAGE-2 report bản-1 (F4). **Owner-gated — KHÔNG chạy wave này, ghi `owner-gated-proposals-dot-16-07.md` (khuôn S126 b3-b4) chờ anh:** -- (i) 2b-file2 `_owner_ratified` budget:123 wording mới (số 6/15/3 GIỮ). +- (i) 2b-file2 `_owner_ratified` budget:123 wording mới (số 6/15/3 GIỮ). F10: anh đổi wording (i) ⇒ re-sync `session-start.md:206` cùng lượt (2 chỗ kể cùng câu chuyện neo). - (ii) 4b C2: option-iii rename `measured_token_estimate`→`token_floor_estimate` vs option-ii exemption-note sibling. - (iii) Việc-3 seal-verify sau move: codify doc-checklist vào nghi-thức curate hay defer. +- (iv) **F3 (C bắt rơi):** `memory-budget.json:65` thêm đuôi nguồn hằng-số `(convention -- chua do tokenizer that tai SE; dinh-chinh 58f5afd8)` — draft:135 định "gộp gate với 2b", spec bản đầu làm RƠI ở cả 2 lane. Gộp cùng câu hỏi (i) — cùng file, 1 lần anh trả lời. - *Điều-chỉnh lead vs draft:* draft cho "anh OK rồi worker apply trong D" — em chốt AN-TOÀN hơn: proposals-file only, apply lượt sau khi anh trả lời (mạch D không block, không đụng vùng owner-ratified khi anh vắng). ## ③ Acceptance D (tổng) - Per việc: chạy đúng lệnh verify trong draft (expected output ghi sẵn) — worker PASTE output thật vào sub-file mình. -- Tổng: `git status` sạch ngoài diff dự-kiến · JSON parse OK 2 file sửa (.claude/rag.json + không đụng memory-budget.json) · backfill.ps1 chạy exit-0 · 5 reports đủ 5-trường (grep) · email stamp PASS + `_index` OUTBOUND +1 · 6 file moved hash-khớp · commit scope `[CLAUDE] Docs/Governance/Scripts` theo convention. +- Tổng: `git status` sạch ngoài diff dự-kiến · F8: JSON parse OK — `.claude/rag.json` (đã sửa) + `memory-budget.json` (xác-nhận KHÔNG đụng trong D) · backfill.ps1 chạy exit-0 · 5 reports đủ 5-trường (grep `"G-011"` — F7) · email stamp PASS + `_index` OUTBOUND +1 · 6 file moved Get-FileHash trước==sau (F2) + root còn đúng README.md (F1) · commit scope `[CLAUDE] Docs/Governance/Scripts` theo convention. - Post-D: HMW-review riêng (Harness-9) trước commit-push; commit đụng `scripts/*.ps1` + `rag.json` → KHÔNG phải docs-only → CI chạy → cicd-monitor verify sau push. diff --git a/.claude/workflows/runs/2026-07-16-S127-adap-dot-16-07/sub-reviewer-3-verdict.md b/.claude/workflows/runs/2026-07-16-S127-adap-dot-16-07/sub-reviewer-3-verdict.md new file mode 100644 index 0000000..11a8f29 --- /dev/null +++ b/.claude/workflows/runs/2026-07-16-S127-adap-dot-16-07/sub-reviewer-3-verdict.md @@ -0,0 +1,66 @@ +# sub-reviewer-3 — fable-real #2 verdict (Giai đoạn C, re-review spec-execute) — HOÀN TẤT + +- **engine:** fable-real-single · reviewer · 2026-07-16 · run S127-adap-dot-16-07 · ghi TĂNG-DẦN (chống #53) +- **đối tượng:** `spec-execute-dot-16-07.md` (lead chốt 3 wave + 3 owner-gated) + `sub-investigator-2-spec-draft.md` (canonical detail) +- **phương pháp:** soi-để-phá 5 trọng-tâm + 4 live-test chạy thật + 11 spot-check độc-lập (anchor lead CHƯA check) + +## VERDICT: GO-WITH-FIXES — 4 SHOULD-FIX fold trước D (0 BLOCKER, 7 NIT) + +Chất spec + draft ĐỨNG VỮNG: 3-wave order đúng ràng-buộc thật, owner-gate lane đúng (2b-file1 = derived-doc thật), LỆCH-1 confirmed tận cơ-chế (projects.py:54-55 setdefault), diff không phá gì (JSON-safe, ASCII-hoá không mất nghĩa, :206 tự-đứng). 4 fix đều là lỗi verify-lệnh/scope-rơi — fold được bằng sửa spec-execute + owner-gated-proposals, KHÔNG cần re-investigate. + +## Bảng finding + +| # | Mức | Chỗ | Vì sao | Fix đề-xuất | +|---|---|---|---|---| +| F1 | **SHOULD-FIX (cao)** | draft §2d verify (draft:80) + spec ③ "6 file moved" | Verify `(Get-ChildItem broadcasts\inbox\*.md).Count → 0` SAI: `README.md` cũng ở root và KHÔNG được move — chính `WAL.md:20` đếm "7 (README + 6 pending)". Sau move đúng → count = **1**. Worker mechanical bám acceptance "0" có rủi-ro move luôn README.md = misfile phá khuôn inbox | Expected → `1` (chỉ README.md) hoặc lệnh `Get-ChildItem broadcasts\inbox\*.md -File \| Where-Object Name -ne 'README.md'` → 0. Ghi rõ "README.md Ở LẠI root" | +| F2 | **SHOULD-FIX (cao)** | draft §2d verify (draft:80) "Get-FileHash … == sha-prefix trong _index" | `_index` cột sha256(12) = **SHA256(body) canonical** (LIVE-TEST T3: body-sha thư-0 = `181a6d195468` == _index; whole-file Get-FileHash = `f29247cfc33e` ≠) → so Get-FileHash với _index chắc chắn LỆCH → false-tamper giữa wave-3 (đúng lớp S125 verifier-bệnh) | Byte-preserve = `Get-FileHash` TRƯỚC move == SAU move (tuyến (a) check-email.md:17). Muốn so _index → recompute **body-sha** theo công-thức check-email.md:17(b) | +| F3 | **SHOULD-FIX** | spec §Owner-gated (3 mục) vs draft:135 | Draft 4a có mục thứ 4: `memory-budget.json:65` thêm đuôi "(convention -- chua do tokenizer that tai SE; dinh-chinh 58f5afd8)" — "gộp gate với 2b". Spec-execute RƠI mục này ở CẢ wave-1 lẫn owner-gated list → class-fix C1 thiếu đúng NGUỒN hằng-số /3.0 (bài S122/S123: vá 1 lớp = vá đủ matcher cùng-lớp trong diff) | Thêm mục (iv) vào `owner-gated-proposals-dot-16-07.md`: budget:65 tail-note, gộp cùng câu hỏi (i) | +| F4 | **SHOULD-FIX** | spec wave-2 item 10 "STAGE-2 done-ở-wave-3" | Report bản-1 UPDATE viết ở **wave-2**, move 2d chạy **wave-3 CUỐI** → report ghi "done" = **future-claim** (lớp S108: "đã làm X" phải verify X trước khi ghi). Move fail ⇒ claim sai nằm trên đĩa, email đã stamp trước đó | Wave-2 wording = "STAGE-2: chạy ở wave-3" HOẶC wave-3 worker sau move xong update lại dòng đó (adap-report.md:33 idempotent). Email giữ như draft (không claim move done) | +| F5 | NIT (hạ mức sau T2) | verify pattern tiếng Việt qua `Select-String` (draft:65/:71/:110/:148) | Nghi false-match theo lớp S125/gotcha #30 — **ĐO THẬT thì KHÔNG bệnh**: PS 5.1 `Select-String -Path` đọc file StreamReader UTF-8-default → match đúng cả trên UTF-8-no-BOM + ACP Windows-1252 (T2: "7 khoản cũ SAI"=1 · "n=1 ở hub"=1). Bệnh S125 nằm ở `Get-Content`(-Raw) ANSI-default | Giữ nguyên dạng lệnh `Select-String -Path` như draft; CẤM worker "cải tiến" sang `Get-Content \| Select-String` không -Encoding; VN-pattern KHÔNG được nhét vào .ps1 file (gotcha #30) | +| F6 | NIT | spec wave-1 item 2 "wording draft :134 có chữ Việt-có-dấu" | Non-ASCII duy nhất ở draft:134 = **em-dash "—"** (chữ đã ASCII-stripped sẵn "CHUA do... that tai SE"). Chỉ dẫn đúng, mô tả sai loại | Đổi thành "ký tự non-ASCII (em-dash)" — worker khỏi tìm dấu tiếng Việt không tồn tại | +| F7 | NIT | draft Việc-3 verify (draft:110) `"nac G-011\|…"` | Report thật dùng "**nấc** (G-011)" (bookend:4 — dấu + ngoặc) → alternative "nac G-011" 0-hit vĩnh viễn; grep 4-alternative không chứng "đủ 5 trường" (thiếu id-broadcast) | Pattern → `"G-011"`; kiểm 5 trường bằng 5 label thật hoặc để HMW-review đọc mắt | +| F8 | NIT | spec ③ "JSON parse OK 2 file sửa (… + không đụng memory-budget.json)" | Tự mâu-thuẫn: "2 file sửa" nhưng file 2 là xác-nhận-KHÔNG-đụng | "JSON parse OK: rag.json (đã sửa) + memory-budget.json (xác-nhận không đụng trong D)" | +| F9 | NIT | draft 2a after-text (draft:64) | Dòng 8 gốc có backtick quanh `>=` ×2; after-text transcribe đánh rơi. Draft tự dặn "GIỮ nguyên enumeration" | Worker exact-edit giữ backtick, chỉ chèn 2 note ngoặc + đổi câu phân-loại | +| F10 | NIT | 2b-file1 (worker) ⟂ (i) owner-gated — cùng câu chuyện neo | :206 = derived-doc thật (số 6/15/3 + policy giữ; block :185-206 không mâu-thuẫn) → lane worker ĐÚNG. Nhưng nếu anh đổi wording (i) thì :206 phải kể theo | Thêm 1 dòng vào owner-gated-proposals: "anh đổi wording (i) ⇒ re-sync session-start.md:206 cùng lượt" | +| F11 | NIT | 4c câu cửa-duyệt (draft:146) | Câu cửa-duyệt CHỨA chính các nhãn nó săn ("measured/calibrated/đã-đo") = mention-not-use. Nay SE 0 máy-quét tự-động (hub sweeper KHÔNG port) → vô hại; mai sau port sweeper thì dòng này false-positive (gen-2 citation-trap S123) | ½ dòng vào honest-caveat bản 3 (4d): "câu cửa-duyệt = mention; exemption nếu port máy-quét" | + +## Soi theo 5 trọng-tâm đề bài + +1. **Diff có phá gì không — KHÔNG:** + - (a) rag.json:31 rationale mới **JSON-safe** ✓: 0 double-quote chưa escape (nháy đơn 'Evaluate trial week 3'), non-ASCII hợp lệ UTF-8 JSON và file ĐÃ chứa sẵn ("→" ở :31 hiện tại, tiếng Việt ở :3). Claim "chunking.py 0 API-call" có quy-thuộc "broadcast f5ce2778:" và MIRROR đúng comment hub tự viết ở `projects.py:39` (đối chiếu tận nơi) ✓. T1 chứng parse-lệnh chạy đúng. + - (b) backfill.ps1: :25 after pure-ASCII ✓; :117 after còn 1 em-dash — spec đã bắt ASCII-hoá (F6). ASCII-hoá KHÔNG mất nghĩa ("CHUA do tokenizer that tai SE" giữ trọn ý). `grep -i calibrat` scripts/ → đúng 2 site :25/:117 file này (khớp draft "2 chỗ"); selfimprove-audit:283/:304/:322 "calibration-interim" = miễn-trừ visible sẵn (khớp draft:124). Comment-only, :118-119 code giữ nguyên. T4: script exit-0 + output có dòng literal `tok RANGE [low..high] : [118424 .. 157898]` — acceptance "giữ dòng tok RANGE" đo được ✓. + - (c) session-start.md:206 — before-text draft khớp đĩa **exact** (đuôi dòng 206); "Chỉnh lại sau chu-kỳ-2" duy nhất 1 chỗ trong file → exact-replace an toàn; block :185-206 đọc lại: :205 "số nhịp = quyền anh" + (c) OVERDUE đọc-từ-config vẫn đứng, wording mới chỉ đổi MỐC so-sánh hub→SE, vế đầu owner-intent giữ nguyên → tự-đứng, 0 mâu-thuẫn ✓. +2. **Thứ-tự wave — ĐÚNG ràng-buộc thật:** mọi consumer file-gốc (5 reports wave-2, email wave-3 item 11) đứng TRƯỚC move 2d (item 12 CUỐI); không việc nào sau move cần file ở root. Sót duy nhất = F4 (report bản-1 nhắc "STAGE-2 done" trước khi nó chạy). +3. **Owner-gate — đúng lane, thiếu 1 mục:** (i)(ii)(iii) đúng; 2b-file1 :206 = derived-doc thật → worker lane ĐÚNG (kèm F10); RƠI mục budget:65 = F3. Điều-chỉnh lead "proposals-file only, apply lượt sau" AN-TOÀN hơn draft — tán thành (không đụng vùng owner-ratified khi anh vắng). +4. **Acceptance đo được — có, sau khi vá F1/F2:** 4 live-test bên dưới; 2/4 lệnh verify draft có lỗi thật (F1 count-0-quên-README, F2 so-sai-loại-hash) — còn lại chạy đúng nguyên văn trên máy này. +5. **Email khuôn §VIỆC-6 vs send-email.md thật — KHỚP đủ:** id :27 ✓ · sha canonical :28 (strip \r + strip-1-leading-newline + CẤM `Get-Content -Raw`) ✓ · 6c selftest-stamp NGAY sau Write :32 ✓ · bước 7 log `_index` :33 cùng lượt ✓ · to=ai_infra ⇒ 6b CC không bắt ✓ · reviewer-gate outward :37 phủ bằng HMW-review Harness-9 ✓ · WAL:12 ask do-token pending khớp đĩa — email GIỮ pending đúng ✓. + +## [LIVE-TESTS] — 4 lệnh chạy thật trên máy này (PS 5.1.26100.8875 · pwsh KHÔNG có · ACP Windows-1252) + +| T | Lệnh (nguồn draft) | Kết quả | Kết luận | +|---|---|---|---| +| T1 | `python -c "import json; …print(c['contextual_retrieval'])"` (draft:39) | in `True` (pre-flip) | Lệnh chạy đúng nguyên văn; post-flip sẽ in `False` như acceptance ✓ | +| T2 | `Select-String -Path -Pattern '7 khoản cũ SAI'` (draft:65) + `-Pattern 'n=1 ở hub'` trên session-start (draft:71) | **1 hit + 1 hit** (file no-BOM: bytes đầu `23 20 61`/`2D 2D 2D`) | VN-pattern qua `Select-String -Path` HOẠT ĐỘNG trên PS 5.1 → F5 hạ NIT; bệnh S125 thuộc `Get-Content` ANSI-default, không thuộc Select-String | +| T3 | `Get-FileHash` thư-0 vs body-sha canonical (check-email.md:17b) vs `_index` | whole-file `f29247cfc33e` ≠ _index `181a6d195468` = body-sha ✓ | `_index` cột = body-sha → draft 2d verify so Get-FileHash với _index SAI LOẠI HASH → F2 confirmed | +| T4 | `powershell.exe -ExecutionPolicy Bypass -File scripts\crystallized-backfill.ps1` (draft:136) | exit-0 + output `tok RANGE [low..high] : [118424 .. 157898]` | Acceptance 4a đo được, baseline sạch ✓ | + +## [SPOT-CHECKS độc-lập] — 11 anchor lead CHƯA check (lead đã check: rag.json:26/:31 · budget:123 · backfill:25/:117-119 · budget:89/:92 · bookend:8) + +1. `broadcasts/_index.md:11` khuôn pending→processed + `:33-38` đúng 6 row pending/(root), sha khớp run.md ✓ +2. `session-start.md:206` before-text exact + block :185-206 không mâu-thuẫn + uniqueness 1/1 (grep) ✓ +3. `adap-report.md:13-19` LOCK 5 trường + `:33` idempotent-update + `:43` Write-tool-only — draft trích đúng cả 3 ✓ +4. `send-email.md:24-34` id/sha-canonical/6c/bước-7 + `:37` reviewer-gate — draft §VIỆC-6 khớp đủ ✓ +5. `.claude/agents/reviewer.md:35` = `### 2. Apply 5-category checklist` exact; section kết ở :44 → điểm chèn 4c không mơ hồ ✓ +6. `scripts/mfe-eval.ps1:166-167` `/4.0`·`/3.0` + `:179-180` RANGE-honest, 0 nhãn calibrated — claim "cùng-lớp giữ nguyên" của draft ĐÚNG ✓ +7. `memory-budget.json:65` nguồn hằng-số "~3.0-3.5 byte/tok" đúng như draft tả (→ lòi F3 khi so spec) ✓ +8. `WAL.md:12` ask do-token pending ✓ + `WAL.md:20` "7 = README + 6" (→ bằng chứng F1) ✓ +9. `AI_INFRA\claude-rag\lib\projects.py:39` `False # OWNER-FINAL 2026-07-16 (s100)` + `:46-55` walk-up + `setdefault` merge-missing-only → **LỆCH-1 mechanism CONFIRMED tận gốc**: SE override `true` thắng default → worker in-repo edit = lane đúng ✓ +10. Glob inbox root = ĐÚNG 6 broadcast + README (khớp danh sách 2d) + `inbox/ai_infra/` tồn tại (25 file) → `git mv` target sẵn ✓ +11. `grep -i calibrat` toàn scripts/ = 2 site backfill + 3 "calibration-interim" selfimprove-audit (miễn-trừ visible) — sweep draft chính xác ✓ + +## memoryDelta + +- **task:** Giai đoạn C — adversarial re-review `spec-execute-dot-16-07.md` + draft canonical trước khi HMW workers (D) chạy; 4 live-test + 11 spot-check độc-lập. +- **verdict:** GO-WITH-FIXES — 4 SHOULD-FIX fold trước D (F1 README-count · F2 sai-loại-hash vs _index · F3 budget:65 rơi khỏi owner-gated · F4 STAGE-2 future-claim) + 7 NIT; 0 BLOCKER. +- **learned:** (1) Lệnh verify trong spec cũng là CODE — phải chạy thử trên máy trước khi worker bám: 2/4 lệnh draft sai thật (count quên README; so body-sha bằng whole-file-hash). (2) Tinh-chỉnh lớp S125: PS 5.1 `Select-String -Path` đọc UTF-8-no-BOM ĐÚNG (StreamReader UTF-8-default) — bệnh ANSI-decode thuộc `Get-Content`(-Raw); ranh giới bệnh nằm ở CMDLET, không ở shell version. (3) Bước nén draft→spec-execute là chỗ RƠI item thật (budget:65 gated-edit biến mất cả 2 lane) → fold spec phải đối-chiếu bảng-lane draft từng dòng. +- **surprise:** VN-diacritic pattern match NGON trên PS 5.1 + no-BOM + ACP Windows-1252 — ngược trực-giác gotcha #30/S125; nghi-án encoding phải ĐO trên đúng cmdlet thay vì suy từ lớp bệnh cũ (đúng bài fault-injection: happy-path + negative đều chạy thật).