[CLAUDE] Docs: S123 citation-trap guard + H24-3 + DUAL-ACCEPT + luat retire-legacy
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 5m22s

Anh chot 4 viec governance. Detector 46->45 = DOI THANH-PHAN (-2 duong-gia
+1 duong-THAT), khong phai "flag giam". Mark moi RC-pqhuy1987-15-07-2026-17-23-10.

- backtick-guard H24-1: discriminator = ENCLOSURE (use vs mention), KHONG port
  duoc charset-guard cua H24-2 vi vi-du byte-identical voi claim. Helper DUY-NHAT
  Test-Quoted. Fault-inject 5/5 (2 anti-Goodhart).
- H24-3 session-label lag (MED, moi): va am-gia CHUNG-MINH-DUOC cua H24-1
  (so NGAY ma ngay = moi nhat => 0 flag trong khi nhan lui 3 phien; tai-phat lan 4).
  Fault-inject 6/6 + 6/6 sau fix.
- DUAL-ACCEPT (dang-3 RETIRED) + LUAT RETIRE LEGACY: go nhanh legacy khi tap
  di-san RONG, giu khi CON nguoi thu-huong. Repo that 0 orphan/26. Fault-inject 7/7.
- tiep.md:66 stale-at-birth + sweep view-residual-asym 6/6 be-mat LUAT sach.

Reviewer PASS_WITH_FIXES bat 6 loi that, lead verify 4/4 doc-lap:
gen-2 citation-trap (lead viet 30 dong chung-minh dinh-luat roi de H24-3 KHONG
guard) - greedy .* lay CUOI khong phai MAX - ly-do retire ap cho dang-2 thi giet
C8 - "retire HOAN-THANH mark" = nguy-bien - "5/5" = 4/4.

Goodhart DO DUOC (ngoai diff): W4/S122 "va" permission-matrix:16 bang doi FORMAT
anchor => khop 0 pattern => H24-1 mat chinh positive-control no dung quanh;
flag-count GIAM nen trong nhu thanh-cong.

Outward: addendum R5 (DUNG adopt TRI-ACCEPT) + email hub ed3786a10f12
(selftest-stamp MATCH x2). _index reconcile: 2 email S122 gui ma chua log.

#53 garble x4/3 agent - harvest-curator ghi diary TRONG luc lam nen vot duoc tu
dia ngay; reviewer tu rut luat "ghi diary TRUOC return" tu garble-1 va nho dung
no ma garble-2 vot duoc. Prompt-dung KHONG chan duoc #53.

Lead sai 4 ca tron o truc dem-ve-minh: "25"!=26 - "5/5"!=4/4 - viet "7/7 PASS"
TRUOC khi chay - "0 proxy" sai.

State GIU NGUYEN: Mig 66 - 89 bang - 509 test - gotcha 82 - menu 54.
Con no: STATUS:6 CO Y chua bump (H24-3 dang FLAG, giu cho hien ra).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-07-15 17:36:39 +07:00
parent cefb183fdb
commit b764ac791a
21 changed files with 668 additions and 54 deletions

View File

@ -1,9 +1,20 @@
# WAL — auto-generated, không sửa tay
updated: | session: | branch:
goal: (trống — không có mạch dở)
updated: 2026-07-15 | session: S123 | branch: main
closing: S123 @2026-07-15T17:30
goal: đóng sổ S123 — 4 việc governance anh chốt (backtick-guard H24-1 · detector H24-3 · retire dạng-3 → DUAL-ACCEPT · tiep.md:66 + mark) + mark MỚI + addendum R5 + email hub
chain:
(rỗng)
- [x] bootstrap S123 (WAL sạch Sàn-3 4/4 · 509 test · detector 46 · RAG 2440 · counter tick 1→2)
- [x] 2 monitor RE-REPORT — #53 garble ×2, recover (H1 resume · H2 disk-truth)
- [x] backtick-guard H24-1 (fault-inject 5/5) — H24-1 4→2, comm -13 rỗng
- [x] detector H24-3 session-label lag (fault-inject 6/6 + 6/6 sau fix)
- [x] retire dạng-3 → DUAL-ACCEPT (fault-inject 7/7; repo thật 0 orphan/26)
- [x] tiep.md:66 stale-at-birth + sweep view-residual-asym 6/6 bề-mặt LUẬT sạch
- [x] reviewer PASS_WITH_FIXES — 6 finding, lead verify 4/4 độc-lập, vá hết
- [x] mark MỚI RC-pqhuy1987-15-07-2026-17-23-10 (anh chốt "đồng ý")
- [x] addendum R5 + email hub ed3786a10f12 (selftest-stamp MATCH ×2)
- [x] _index reconcile — 2 email S122 chưa log (gap thật, đã vá)
- [!] session-end Phase 1→6 đang chạy
next: (trống)
verify: (trống)
next: Phase 1.5 §L.b (a)→(j) → Phase 2 WRITE → Phase 3 VERIFY → Phase 5 COMMIT+PUSH → §6.4 reset
verify: powershell -File scripts/governance-detectors.ps1 (kỳ vọng TOTAL 45) · dotnet test (509) · git log --format=%s origin/main..HEAD

File diff suppressed because one or more lines are too long

View File

@ -26,3 +26,9 @@
- **2026-07-12 (S111 @end GATE — self-write diary):** GATE **PASS 5/5 trục + close-gate** (verify-idempotent, 0 re-APPEND). Coverage 7-spawn: 2 monitor @start `318a271` bundle-4-file · invest-cb +2-line & reviewer +1-line S111 tự-ghi NẰM TRONG `8aa3869` (engine-label `[engine: fable-real-single · Fable-S111]` cả 2, 0-garble) · cicd ĐANG verify Run 8aa3869 = pending-legit (S111=0 đúng trạng thái, backstop closeout) · tooling @end in-flight song-song (L1 16897B = state-318a271, pattern S107) · 3 worker `wf_5ba3daf6-fe0` role-less → memoryDelta vào synthesis đúng run-trace. Close-gate H22 run ĐẦU có sub-*.md: `runs/2026-07-12-h22-wal-adopt/` 6/6 file in-`8aa3869` (run.md 3298B `## taskList snapshot` ×1 chuẩn-MỚI · synthesis 3695B memoryDelta ×1 tail-0a · spec 16220B · sub-task-0/1/2 5737/5478/6172B) — orphan **0/16**. Fidelity: reviewer PASS_WITH_FIXES 0C/1M/~7m = 8 finding khớp commit-msg "8/8-fix" · wal-squash K=2 sạch (0 `wal:` subject trong `191532e..HEAD`; `12071c5`/`67be443` chỉ còn evidence-ref trong msg). Corruption: 0-byte 0/12 · tail `0a` 12/12 · FFFD 1 = baseline self-quote · moji 1 known · WAL.md dirty 1372B (< HEAD 1616B) = sổ-WAL live post-squash by-design flush @closeout, KHÔNG mồ-côi. Method-trap MỚI tự-bắt: `--stat` truncate `.../` nuốt path dài grep false-absence 5 file run-folder; lọc path PHẢI `--name-only`. Tag `[s111-end-gate, pass-5truc, close-gate-0of16, h22-first-subtask-runtrace, stat-truncate-trap]`.
- **2026-07-12 (S113 @start RE-REPORT self-write diary):** Model `claude-opus-4-8` (Opus). Verdict 🟡 **H2 MOSTLY-CLEAN — 0 orphan/20 · corruption 0 · 2 coverage-gap propose-APPEND** (post-S112 closeout `8fa2fcc` 16:51; harvest-curator KHÔNG spawn S112 em-main harvest direct qua `0d912ad`+`8fa2fcc`). (1) Orphan **0/20**: 4 S112 folder dùng synthesis **EMBEDDED-in-run.md** (`## synthesis` populated pattern MỚI cho invest/review ensemble, KHÁC h21/h22 separate `implement-synthesis.md`); 14×06-18 synthesis nằm SUBFOLDER maxdepth-1 scan FALSE-flag 5 (h10-implement/invest/review + h910-curate/finalize) maxdepth-2 resolve sep-synth=1 (dual-accept, đừng scan nông). All 4 S112 git-tracked (6/6/4/4, 0 untracked). (2) Harvest 4/6 role CLEAN: inv-cb :20 stamp `[engine: fable-clone-ensemble · Opus-S112]` 4-field khớp run.md · reviewer ×4 :96-100 (stamp `[fable-real-single]`) · impl-fe top-🆕 date-labeled (grep-'S112' MISS = method-#4) · cicd :73 #496. (3) 🔴 2 GAP propose-APPEND: **impl-be** chỉ ghi PE (:77), THIẾU Supplier-BE (SupplierExcelImportService+preview/confirm endpoint+Mig 63 `AddSupplierImportSourceFields`) shipped Run #496 nhưng 0 spawn-record nhà mình · **test-specialist** chỉ bump baseline 440458 'as of D4' (nên D10/S112), 0 narrative cho ~950 test-LOC (SupplierExcelImportServiceTests +452 NEW / PeSubmitGuardAndBypass +498). Knowledge KHÔNG mất (đủ run.md+reviewer+cicd) propose-only, em-main verify+APPEND B3. (4) Corruption 0: 0-byte 0 · tail 0a 6/6 · FFFD 1 = self-baseline (method-#9). Fidelity 0 fabrication KHÔNG escalate; minor nit impl-fe '450 tests'(final 458) + test-spec label 'D4'≠'D10'. SELF ~19.2KB > 17.1 target → compact S107→S108 phiên tới. Tag `[s113-start, 0-orphan-20, embedded-synthesis-pattern, 2-coverage-gap-implbe-testspec, maxdepth1-false-flag]`.
- **2026-07-12 (S113 @end GATE — self-write diary, VERIFY-idempotent 0 re-APPEND):** Model `claude-opus-4-8`. GATE **PASS 5/5 trục + close-gate 0/21**. Coverage 6/6 sub S113 entry đủ 4-field: impl-be :77 (Mig 64 IsPublic+dedup-MST-primary) · impl-fe :9 (FE ×2app, DEVIATION-flag template-btn) · test-spec :59 (458→477 +19, 🔴 BUG NRE null-Code) · reviewer :17 **TIERED** pointer→`project_s113_supplier_import_v2_review.md` 3408B (GO-WITH-ADJ 2 must-fix) · cicd :73 `🟢 #383/id497 5fa11b5 GO 5m14s` · inv-cb :20 ensemble stamp `[engine: fable-clone-ensemble · Opus-S113]` (em-main harvest, RETURN-only). **Landing pattern MỚI: 6 diary committed qua H22 WAL-flush** (`58f1c5f``8304d08` HEAD, KHÔNG closeout `ccdcbe7`=docs-only H1) — tree clean, 0 uncommitted/mồ-côi. Fidelity MẠNH: `5fa11b5` file-list xác nhận MỌI claim on-disk (Mig 64 3-file · 2 test-file `SupplierImportV2Dedup`+`SupplierPublishAndList` · `PublishSupplierCommand`+`GetSupplierImportTemplateQuery` NEW · FE 5-file×2app) → 0 fabrication, KHÔNG escalate. **S113-start 2 GAP CLOSED** (idempotent): impl-be :80 nay có full S112-Supplier entry · test-spec narrative đủ. Close-gate: `runs/2026-07-12-S113-supplier-import-v2-invest/` run.md 4202B (**embedded=2**: `## Synthesis`+`## OUTCOME`) + spec 12900B, cả 2 tracked; orphan 0/21 (14×06-18 sep-synth · h21/h22 sep · 4 S112 embed=1 · S113 embed=2). Corruption 0: 0-byte 0 · tail `0a` 8/8 · FFFD 0/8 (S113-touched files) · moji 0. **Nit ×2 benign (INFORM, 0 data-loss, KHÔNG escalate):** (a) inv-cb entry trỏ "journal.jsonl" NHƯNG folder RETURN-only 0 jsonl/sub-*.md — content THẬT ở run.md Synthesis/OUTCOME+spec → propose sửa pointer · (b) impl-be "backfill 22 prod" stale-est, thật 37 (cicd+inv+run.md reconcile 37/37, all-rows UPDATE→moot). Chore: inv-cb 21.6KB cao nhất (em-main defer-curate next-session per plan, KHÔNG miss) · reviewer 20.3 · cicd 19.9 · impl-be 19.8 · SELF 19.3 → self-compact S107→S108 phiên tới ĐỨNG; all < 25.6 cap. Tag `[s113-end-gate, pass-5truc, close-gate-0of21, wal-flush-landing, 2gap-closed, journal-jsonl-deadpointer-nit]`.
## Moved @S123-start 2026-07-15 - hook-directed self-compact (S114/S116/S117, 3 entries, file-order verbatim from L1; block-md5 3d7033e0253c3dfaeba7aad1a1067efe, 7163 bytes)
- **2026-07-12 (S114 @start RE-REPORT self-write diary, VERIFY-idempotent 0 re-APPEND):** Model `claude-opus-4-8` (Opus). Verdict 🟢 **ALL-CLEAN 5/5 trục + 0/21 orphan** (post-S113 final wal-flush `a3e9e14` 19:39:33; S113 harvest ĐÃ HOÀN-TẤT @S113-end, đây = re-verify sau flush cuối). (1) Harvest-mới **0**: porcelain 0 dòng + 12/12 L1 mtime 19:36:52 < `a3e9e14` (method-#3) 0 mồ-côi by-construction; post-end DUY-NHẤT 1 commit = `a3e9e14` chạm CHỈ diary SELF (S113@end-entry + self-compact). (2) Orphan **0/21** (embedded-synth re-scan sau khi tự-bắt `-cl`-bug false-flag: 4 S112 embed=1 `## synthesis` · S113 embed=2 `## Synthesis`+`## OUTCOME` · 14×06-18 sep-synth · h21/h22 sep). (3) Coverage 6/6 sub S113 landed đủ 4-field (impl-be:77·impl-fe:9·test-spec:59·reviewer:17-TIERED·cicd:73·inv-cb:20-ensemble); **#53-garble ×2 CẢ HAI captured** (inv-cb:23 visibility-lane em-solo-recover + impl-be:77 backend-first-return SendMessage-resume); **4-BUG captured** đúng nhà (NRE-null-Code#80 test-spec:59 · draft-leak+CreateSupplier-IsPublic reviewer:17 · authz-403D3 rolepolicy-fix impl-be:77); S113-start 2-GAP STAY-CLOSED (impl-be:80 S112-Supplier entry + test-spec narrative). (4) Corruption 0: 0-byte 0/12 · tail `0a` 12/12 · FFFD 1 = SELF-baseline self-quote (method-#9). (5) Self-compact S107S109 @S113-end (`a3e9e14`) **moved-not-cut VERIFIED** (5 anchor L1=0/AR=1; S108-GATE L1=1 = digest-line mention đúng; archive 18390B tail-`0a`). **2 KNOWN benign nit persist** (em-main chưa fix, 0-data-loss, INFORM KHÔNG escalate): inv-cb:21 "journal.jsonl" dead-pointer (folder RETURN-only 0-jsonl, content THẬT @run.md-synth+narrative:20-25) · impl-be:77 "backfill 22 prod" stale-est (thật 37, `UPDATE SET IsPublic=1` all-rowsmoot). Self-inconsistency benign: S113@end body ghi "compact deferred" nhưng digest+diff = EXECUTED HOOK-directed (pattern S111). Chore: inv-cb 21.6K cao nhất · reviewer 20.8 · cicd 20.4 · impl-be 20.2 · SELF 16.8K post-compact healthy self-compact S110S111 phiên tới; all < 25.6 cap. Tag `[s114-start, all-clean, 0-orphan-0of21, verify-idempotent, garble-x2-captured, 4bug-captured, self-compact-s107-s109-moved-not-cut]`.
- **2026-07-13 (S116 @end GATE self-write diary, VERIFY-idempotent 0 re-APPEND):** Model `claude-opus-4-8`. GATE **PASS 5-trục + close-gate 0/24** (PE nhập giá ÂM ô báo giá, shipped `88368fd` + CI #386; HEAD `0edbc58` wal-flush-landing, tree clean). **Coverage 🟡 5/6 role-bucket đủ (1 sub-gap):** 3 impl self-write đủ 4-field (impl-fe :9-15 sign-toggle-immediate-commit `math.abs`-no-global-mod SHA `3e16dba5` ×2 + gotcha `details[].quotes``suppliers[]` · impl-be :77 guard-1line ACCEPT + stale-comment-flag · test-spec :59 486495 +9 T1-T4) + cicd :79 #386 GO 5m28s; invest-ensemble 4-lane RETURN-only em-main consolidated 42 (:78 Budget-consumers + :97 edge/precedent, FE+BE-surface embedded, knowledge-complete); review-ensemble 3-lane RETURN-only Lane1 correctness-wire :21 **TIERED-pointer** (`project_pe_negative_quote_correctness_review.md` 2908B EXISTS not-dead) + Lane3 financial-invariant :77 **NHƯNG Lane2 mirror-completeness KHÔNG có spawn-record riêng** (knowledge NOT-lost: run.md:11 'mirror clean' + correctness-pointer + invest:97 SHA-identical + impl-fe SHA-pair) propose em-main APPEND minimal Lane2. fable-real deep-pass #53-GARBLE 0-verdict em-main-solo gate (run.md:13), nothing-to-harvest. **Fidelity STRONG 0-fab → KHÔNG escalate:** `88368fd` = 7-file EXACT (2FE+1BE+4test no-mig) · BE `Sum()<=0``.All(x==0)` verbatim in-diff · 9 new `[Fact]/[Theory]` = +9 = gate 495. Corruption 0: 0-byte 0 · tail 0a 7/7 · FFFD 0 worker (self=1 baseline #9) · cicd:58 `$(cygpath)` = intentional-cmd-example không shell-baked · moved-not-cut ×2 VERIFIED (reviewer2026-07 3-anchor · impl-be FIFO2026-06 5-anchor). Close-gate: run.md embedded-synth `✅ PIPELINE COMPLETE`:19 + run.md/spec git-tracked HEAD; orphan **0/24** (14×06-18 sep · h21/h22/presence sep · 4×S112+S113emb2+S114+S116 embedded). **method-#10 DOUBLE session-drift-tag S116** (cả 2 = em-main ON-BEHALF harvest, self-write all-correct-S116): reviewer:77 label `S117`-forward + invest:78 tag `[s115?]`-backward mislabel clusters tại on-behalf-harvest propose normalizeS116. Nit: run.md:20-23 leftover template `[ ]` rows dup completed Stages4-6 (benign residue, propose trim). Chore: fe-designer 21.5K idle-07-01 · invest-cb 21.1 · impl-fe 21.1 · cicd 20.4 · reviewer 19.2 (post-curate + re-append) · SELF 19.1→~21K **self-compact S110→S111 STILL-DUE** phiên tới; all < 25.6 cap. Tag `[s116-end-gate, pass-5truc, close-gate-0of24, review-lane2-mirror-gap, double-session-drift-tag-m10, fidelity-strong-7file-exact]`.
- **2026-07-14 (S117 @end GATE self-write diary, VERIFY-idempotent 0 re-APPEND):** Model `claude-opus-4-8`. GATE **PASS 5-trục + close-gate 0-orphan** (2 chỉnh PE UAT anh Kiệt: lũy-kế display-lie fix + duyệt-theo-khoảng MinMax ProMinMax, shipped `316a82f` + CI #387 501-gate; HEAD `fc1b8d9` closeout tree-clean). **Coverage 5/5 spawn** (inv×2 share investigator-codebase/ + test-spec + impl-fe + cicd): inv-luyke :107 `[fable-real-single·Fable-S117]` wf ab2657ee (#53-garbleresume + em-main prod-DB verify) · inv-minmax :104 wf abbbb86d 0-garble Model-A · test-spec :59 +5 ProMinMax · impl-fe :9 `[s117]` SHA 011ee8cf/617b0aa0 · cicd :41/59/60/61 #387. **BE both-features = em-main-solo by-design** (financial signature-ripple) 0 impl-backend record expected (KHÔNG gap). **Fidelity STRONG 0-fab → KHÔNG escalate:** commit 316a82f file-list EXACT match mọi claim (Mig 66 3-file `ApprovedPriceMaxAmount` + entity+9 + service+34 + 6 FE 3/app symmetric + 2 test-file); STATUS 501; Mig 66 COL_LENGTH=9 prod; 2 garble-lane (invest-1+cicd) 0 claim-bịa (em-main-curl cross-verify khớp). Corruption 0: tail 0a 6/6 · FFFD 0 · impl-fe compact 23.313.3KB **MOVED-NOT-CUT VERIFIED** (archive/2026-H1.md +5 entry verbatim, 6/6 SHA-anchor; HOT S117/S116/S113 giữ) · cicd:58 `$(cygpath)` intentional-cmd. Close-gate: 2 /fable-real folder spec-*.md present+tracked (luyke 5828B/minmax 4202B, dual-accept hmw-synthesis); 0 orphan (no run.md-sans-synth); delta mồ-côi 0 (4 memory WAL-committed 11:0011:29, porcelain clean). **3 benign nit INFORM (0 data-loss, KHÔNG escalate):** (a) inv-minmax mis-tag **S118→S117** (method-#10 drift fwd-1; content+spec đều S117) · (b) test-spec baseline **500/455→501/456** (thiếu em-main-solo +1 luyke `PeFinalizeProjectionTests`; đếm own +5 only) · (c) cicd:17 self-claim "S117 CLEAN no-garble ×3" vs session-log+task = garble-then-resume (under-report own garble; verdict-substance disk-true). Chore: 0 memory >25.6 cap (cicd 19.8/inv-cb 19.6 max); impl-fe healthy 13.3 post-compact; SELF 15.6→~17.2K → self-compact S113 phiên tới soft-due. Tag `[s117-end-gate, pass-5truc, close-gate-0orphan-fable-real-spec, moved-not-cut-verified, 3nit-s118mistag-testcount500-cicdgarbleclaim, fidelity-strong-commit-exact]`.

View File

@ -12,14 +12,15 @@
- [S89 finalize-note PLAN review](project_s89_finalize_note_plan_review.md) — CONCERN: plan ground-truth 100% accurate; gaps = note omits intermediate-approvers-still-sign + skipToFinal-last-level corner + Dev DB 9 migs behind.
- **S101 H18/H19 WF2 governance re-run + LANE-C** — PWC/PASS; detector fault-inject 4/4; 4 hash recompute MATCH (hex→SHA strip/no-strip proves content-hash ≠ commit-SHA); lesson: exact-token sweep misses paraphrased labels → widen concept-phrase khi retire named artifact; #53 garble recovered. → `archive/2026-07.md`.
- [S103 H20+crystallized-backfill review](project_s103_h20_crystallized_backfill_review.md) — WF2 PASS; 6/6 hash recompute MATCH + 4 already-met verified. Lesson: multi-axis warning phải nằm trong OUTPUT của script (reader chạy inline), không chỉ doc.
- [S111 PE sign-off 6-decision design review (schema/history lens)](project_pe_signoff_history_schema_review.md) — GO-WITH-ADJ; Decision-5 opinion-history: RECOMMEND append-only table, REJECT version-col (drops UNIQUE + breaks UPSERT). Hook @ ApproveV2Async UPSERT :784-790. Decision-3 caller-safe (SlaExpiryJob=Contract-only). A1 breaks 4 bypass tests.
- [PE multi-NCC per-hạng-mục cardinality#3 review](project_pe_multiwinner_perhangmuc_review.md) — PASS_WITH_ADJ; 6 BE read-site inventory COMPLETE (grep 1:1). 2 MUST: giaTri isSingle/detailsSum silent-financial; seed sets IsSelected never IsWinner → empty names + CreateContract throws. Lesson: derived src-of-truth = EVERY write-path re-derive.
- [S113 Supplier import v2 close-review (owner anh Kiệt)](project_s113_supplier_import_v2_review.md) — GO-WITH-ADJ 2 must-fix: consumers (PeDetailTabs:2222 + ContractCreatePage:321 ×2app) DON'T pass published=true → drafts leak into pickers (R4/R6 "ẩn" undelivered) + CreateSupplier:86 missing IsPublic=true. Dedup/publish/mig/authz SOLID. Lesson: "filter added" ≠ "drafts hidden" — grep-all-consumer + create write-path.
- [S114 PE per-hạng-mục BE-financial review](project_s114_pe_multi_ncc_perhangmuc_financial_review.md) — NEEDS-FIX: 6 financial-SUM→IsSelected (0 sót) but DeleteQuote:396 + DeleteDetail:262 KHÔNG re-derive IsWinner → stranded winner → phantom HĐ GiaTri=0. Lesson: derived-invariant re-establish MỌI mutation kể cả DELETE.
- [PE per-hạng-mục spec review (winner-truth lần 3)](project_pe_multi_ncc_perhangmuc_specreview.md) — PASS_WITH_ADJ. MUST: CreateContract isSingle→detailsSum (`:76-90`) over-count 1-winner≠cả-gói. Lesson: grep write-path field-NGUỒN (IsSelected) không chỉ field-đọc; cite-range bọc branch-decision.
- [S114 PE per-hạng-mục IMPL review (flip lần 3)](project_s114_multi_ncc_perhangmuc_impl_review.md) — NEEDS-FIX. CAUGHT: DeleteQuote (`...Features.cs:371-397`) KHÔNG re-derive IsWinner → xóa quote cuối (nút Xóa FE:2897) VỠ invariant → phantom winner + HĐ giá 0. Lesson: cardinality grep-consumer PHẢI gồm Delete-handler field-nguồn; spec-enum writer KHÔNG đáng tin. SOLID: 5 SUM + non-tautology test + hash ae3788e9.
- [PE negative-quote FE-only spec review (correctness-wire)](project_pe_negative_quote_correctness_review.md) — PASS_WITH_FIXES. R1/R2 no-op verified accurate (CreateContractFromEval:88-100 no-clamp · BE Sum()<=0 :206 + FE :201). MUST: sign-loss form.thanhTien read DIRECT at POST :2232/:2875+gate :2226; toggle phải re-sign field-chung KHÔNG chỉ flip neg-flag (VndInlineEdit defer-parse-at-own-save không có ở 2 dialog). Consumer inventory COMPLETE 0-break (fmtMoney/toLocaleString neg-safe). Lesson: defer-parse widget→shared-form dialog = sign phải tới field-chung ở MỌI mutation incl toggle.
- [S118 Procurement master-access seeder review](project_s118_procurement_master_access_review.md) — PASS(cond); scope-isolation PERFECT (RoleId==Procurement, S92 held) + build 0/0. MAJOR: Reports.Read leaks contract-financials to PRO (`/reports/dashboard` unguarded `[Authorize]`-only) + `Suppliers.Update` grant does NOT enable edit (PUT role-gated Admin/CatalogManager) only Publish+Import. Lesson: menu-flag grant ≠ API capability — grep target controller authz-attrs; bare `[Authorize]` GET = open-to-all so Read-grant is FE-visibility-only.
- [S111 PE sign-off 6-decision design review (schema/history lens)](project_pe_signoff_history_schema_review.md) — GO-WITH-ADJ; D5 opinion-history: append-only table, REJECT version-col (drops UNIQUE + breaks UPSERT).
- [PE multi-NCC per-hạng-mục cardinality#3 review](project_pe_multiwinner_perhangmuc_review.md) — PASS_WITH_ADJ; 2 MUST (giaTri isSingle/detailsSum · seed IsSelectedIsWinner). Lesson: derived src-of-truth = EVERY write-path re-derive.
- [S113 Supplier import v2 close-review (owner anh Kiệt)](project_s113_supplier_import_v2_review.md) — GO-WITH-ADJ 2 must-fix (consumers không pass published=true → drafts leak). Lesson: "filter added" ≠ "drafts hidden" — grep-all-consumer + create write-path.
- [S114 PE per-hạng-mục BE-financial review](project_s114_pe_multi_ncc_perhangmuc_financial_review.md) — NEEDS-FIX: DeleteQuote/DeleteDetail KHÔNG re-derive IsWinner → phantom HĐ GiaTri=0. Lesson: derived-invariant re-establish MỌI mutation kể cả DELETE.
- [PE per-hạng-mục spec review (winner-truth lần 3)](project_pe_multi_ncc_perhangmuc_specreview.md) — PASS_WITH_ADJ. Lesson: grep write-path field-NGUỒN (IsSelected) không chỉ field-đọc; cite-range bọc branch-decision.
- [S114 PE per-hạng-mục IMPL review (flip lần 3)](project_s114_multi_ncc_perhangmuc_impl_review.md) — NEEDS-FIX; DeleteQuote vỡ invariant. Lesson: cardinality grep-consumer PHẢI gồm Delete-handler field-nguồn; spec-enum writer KHÔNG đáng tin.
- [PE negative-quote FE-only spec review (correctness-wire)](project_pe_negative_quote_correctness_review.md) — PASS_WITH_FIXES; MUST = sign-loss (form.thanhTien read DIRECT at POST). Lesson: defer-parse widget→shared-form dialog = sign phải tới field-chung ở MỌI mutation incl toggle.
- [S118 Procurement master-access seeder review](project_s118_procurement_master_access_review.md) — PASS(cond); MAJOR Reports.Read leaks financials + Suppliers.Update grant ≠ edit. Lesson: menu-flag grant ≠ API capability; bare `[Authorize]` GET = open-to-all.
- [S123 governance 4-change review (backtick-guard + H24-3 + retire dạng-3 + mark)](project_s123_governance_4change_review.md) — PASS_WITH_FIXES; CAUGHT H24-3 thiếu enclosure-guard mà cùng diff vừa chứng cần (gen-2 citation-trap) + greedy `.*` lấy `(S<N>` CUỐI≠MAX + lý-do-retire áp cho dạng-2 thì giết C8. Q5 "HOÀN-THÀNH mark" = nguỵ-biện. Q8 ENDORSE không-bump.
---
@ -75,7 +76,8 @@ Adversarial pre-commit reviewer SOLUTION_ERP. Read-only verify + live curl prod
## 📅 Recent activity (compressed — full verbatim → `archive/2026-06.md` + `archive/2026-07.md` via `archive/_INDEX.md`)
- **S117 (2026-07-13) PE negative-quote FE-only spec-review (financial-invariant-owner lens) — PASS (0 blocking, 1 confirm + 2 test-notes):** budget-intact VERIFIED — UpsertQuote (`PurchaseEvaluationDetailFeatures.cs:282-366`) writes 0 budget fields; quote ThanhTien flows ONLY into read-only display aggregates (currentProposalTotal/prevSelectedTotal :911-926 + winnerQuoteTotal :1188) — NEVER mutates PeWorkItemBudget. #81 IsWinner + S114 multi-winner SAFE: winner-derive keyed on `IsSelected` boolean, sign-agnostic (negative ThanhTien irrelevant). R1 baked (ContractFeatures.cs:46 GiaTri>=0 untouched=manual path; CreateContractFromEvaluation:88-90 no-clamp=PE-inherit). R2 FE:201/BE:206 BOTH `SUM(ThanhTien where IsSelected)<=0` = IDENTICAL algebraic sum → 0 divergence from negatives. CONFIRM raised: enterable-negatives OPERATIONALIZE net-value driving CEO-escalation gate (winnerQuoteTotal<CeoApprovalThresholdCCM skip-CEO) governance, not display; owner sign-off. T3 note: `SeedWinnerWithQuoteAsync` seeds 1 quote/winner "mixed net>0 submittable" half needs multi-quote seed. **Lesson: 2-tier guard divergence check = compare SUM EXPRESSION not just comparator; derived-flag safety = trace what flag is KEYED-ON (IsSelected≠ThanhTien); "budget intact" true for RECORD but quote-sum still flows to display+governance aggregates.**
- **S123 (2026-07-15) governance 4-change pre-commit review — PASS_WITH_FIXES (0 blocking/3 must-fix/1 MAJOR/3 minor):** detail → [topic](project_s123_governance_4change_review.md). 🔴 **#53 garble ×1 ở CHÍNH TAO; đĩa KHÔNG cứu được vì chưa ghi diary** ⇒ H2 MED-3 (reviewer 5-spawn/0-dòng) trả giá THẬT. **Luật tự-áp: ghi diary TRƯỚC return.** Bài: (1) vá 1 lớp bẫy ⇒ grep MỌI detector cùng-lớp TRONG chính diff; (2) fault-inject N/N chỉ chứng trục ĐÃ chạm — hỏi "trục nào KHÔNG có ca nào?"; (3) áp luật-vừa-viết cho nhánh anh-em → vỡ ⇒ luật-viết ≠ luật-làm; (4) "N/N" trộn đo-nay + dựng-lịch-sử = false-specificity (lặp S109); (5) "fix" bằng đổi format cho khớp-mẫu trượt = rời tập-đo (Goodhart, mất positive-control).
- **S117 (2026-07-13) PE negative-quote FE-only spec-review — PASS (0 blocking/1 confirm):** budget-intact VERIFIED (UpsertQuote writes 0 budget fields); #81/S114 winner-derive keyed on `IsSelected` = sign-agnostic; R2 FE:201/BE:206 SUM identical ⇒ 0 divergence. **Lesson: 2-tier guard check = compare SUM EXPRESSION not comparator; derived-flag safety = trace what flag is KEYED-ON; "budget intact" true for RECORD but quote-sum still feeds display+governance aggregates.**`archive/2026-07.md`.
- **S116 (2026-07-13) outward-email GATE se→ai_infra H-22 WAL restart runtime-verify — PASS (0 over-claim/3 minor):** 6/6 ground-truth re-run MATCH (#5+#6 EXACT: archive-gate 12/12 sub<25.6KB + A7 246/246 pointers; crystallized 382713B/380K-tok/252K headroom). Caveat STRONG+prominent (defers real-persistS111). Minor: (a)-persist WEAK `.claude/WAL.md` git-committed 0-drift survives-restart = git property NOT WAL-mechanism. Lesson: persist-claim on git-tracked WAL verify tracked+0-drift; mechanism-proof lives at Stop-hook run. `archive/2026-07.md`.
- **S115 (2026-07-13) `/fable-real` spec-review presence-not-age adopt PASS-WITH-FIXES (0C/2M/5m):** M1 acceptance-grep can't detect its OWN deliverable's miss (narrow regex 1/3 doc-lines false-PASS; fix bare-token+classify). M2 skip-element on contiguous-prefix cut = correctness-inversion. Lesson: verify EACH regex-alt vs EACH target-line by hand; `parallel()` runtime-builtin robust-under-both = endorse-with-caveat. `archive/2026-07.md`.
- **S101 H19 fable-clone WF2 Lane-A (toggle) PWC, CONCERN closed @S102:** marker WRITE-ONLY dead artifact persist-claim cần CẢ reader-side (verify consumer exists, not just producer); reader BƯỚC 0.5b wired S101-cuối. `archive/2026-07.md`.
@ -85,7 +87,7 @@ Adversarial pre-commit reviewer SOLUTION_ERP. Read-only verify + live curl prod
- **S93 (2026-06-29) Harness-16 MFE adopt (WF2 3-lane) PASS 0-blocking:** code-gate re-derived denom-29; READ-ONLY-budget 1 write-op; WF1 caught vocab-fork H6.7H16. adap-report + _INDEX.
- **S92 (2026-06-29) PROD-security hide 5 menu-groups admin-only (uncommitted) PASS (1 note):** A-E upheld; CatalogManager Danh-mục stripped (by-spec, 0 users). [project_s92_admin_only_modules_revoke.md](project_s92_admin_only_modules_revoke.md).
- **June-2026 archived digest (detail `archive/2026-06.md` + `_INDEX`; S89/S90/S91 PE = FROZEN do-not-touch):** S91 create-contract 1N multi-winner (codegen mid-loop flush ONLY seq-row; positional DTO 3-site; 419 PASS). S90 stability D1 (Block B re-key IsWinner; CEO-notify never-flush fix; #70 ||peFetching). S89-bis AREA-6 joint-winner DEAD-END (FE `some(isWinner)` vs BE `SelectedSupplierId is null`). S89 AREA-4 HoSoLink #73 clear-on-partial + 2nd call-site PeDetailTabs:817. S88 fidelity-gate FAIL: merge-distill fabricates false-specificity (QUALITY gate AFTER presence). S86 PE Section B authz byte-mirror NotFoundForbidden fail-closed. S82 Harness-15-v2: sha=self-declared frontmatter NOT recompute. S76 PE budget: #70 useIsFetching gate + spec-scope-framing can be FALSE (read changed-set). S72 Mig 54: fail-closed guard BEFORE DaDuyet + server-recompute no-trust-client. S71 Harness-10: TRACKED=check-ignore(eligible) vs git-ls-files(committed). S69 Office re-skin: grep byte-equal + public-grant root NOT inherit-root. S65: upgrade MUST MUTATE row NOT skip-existing; menu-hide API-lock.
- **June-2026 digest LESSON-ONLY (verbatim `archive/2026-06.md` 70KB + `archive/_INDEX.md`; S89/S90/S91 PE = FROZEN do-not-touch):** codegen mid-loop flush ONLY seq-row · singlemulti conversion stops at display-layer (FE `some(isWinner)` vs BE `is null` = dead-end) · echo-all-siblings convention rots when NEW absolute-set field added · merge-distill fabricates false-specificity QUALITY gate AFTER presence · authz byte-mirror fail-closed (NotFoundForbidden) · sha = self-declared frontmatter NOT recompute · spec-scope-framing can be FALSE read changed-set · fail-closed guard BEFORE terminal-state + server-recompute no-trust-client · TRACKED = check-ignore(eligible) git-ls-files(committed) · public-grant root NOT inherit-root · upgrade MUST MUTATE row NOT skip-existing; menu-hide API-lock.
- **S108 (2026-07-10 first-real-run H19) FAIL (1C+4M+6m):** email claim "đã sửa comment" khi hmw.js chưa sửa. Lesson: outward-claim "đã sửa X" phải cat X trước gate; grep stale-claim theo CLASS sau fix đại diện. `archive/2026-07.md`.
- **S109 (2026-07-10 fidelity-gate 2 gist L2) PASS_WITH_FIXES (3):** gist meta-count 15disk 14; delta tự-tính +8.8KB = self-computed false-specificity; N/A-just over-claim fact-claim trong N/A verify như content. `archive/2026-07.md`.

View File

@ -44,3 +44,5 @@
<!-- ===== S116 curate batch (2026-07-13) moved 2 verbose entries (S115, S116) from L1 (hook >17.1KB) ===== -->
- **S115 (2026-07-13) `/fable-real` spec-review presence-not-age adopt (D1 docs + D2 hmw.js STOP-HARD + D3 archive-gate) — PASS-WITH-FIXES (0C/2M/5m):** sub = `runs/2026-07-13-presence-not-age-adopt/spec-review-fable-real.md`. **M1: acceptance-grep can't detect its OWN deliverable's miss** — D2 crit-4 regex `fail-soft.*default subagent\|degrade về default subagent` catches only 1/3 doc-lines (misses ultra-on:21 "cảnh báo" + README:208 order fail-soft-AFTER) → 0-hits=false-PASS; fix = bare-token grep + human-classify vs frozen-history, NOT narrow ordered-pattern. **M2: "skip element" bolted on contiguous-prefix cut = correctness inversion** — naive `if protected continue` leaves skipped entry ABOVE cutLine → STILL archived while code thinks excluded; needs non-contiguous per-entry byte-sum; DRY-RUN bounds harm but 0 acceptance tests after-est. **Lessons: (1) `parallel()` = runtime-builtin NOT in-repo → premise unverifiable-from-source but design robust-under-BOTH-truth-values = endorse-with-caveat; (2) grep-acceptance must bare-token+classify; (3) verify EACH regex-alt vs EACH real target-line by hand; (4) node --check HAS teeth + top-level return/await pass via CJS wrapSafe (empirical > theory).** Spec faithful (3 floors+rec-3+3 honest-notes verified on-disk), scope-clean, honest-caveated; no Smart-Friend lower.
- **S116 (2026-07-13) outward-email GATE se→ai_infra H-22 WAL restart runtime-verify — PASS (0 over-claim / 3 minor):** file `broadcasts/outbox/ai_infra/2026-07-13-se-to-ai_infra-h22-wal-restart-runtime-verify.md`. 6/6 ground-truth re-run MATCH — #1 rev-list=0 · #2 tree clean (modulo email-artifact itself untracked) · #3 HEAD=88bd8e6 · #4 WAL empty-template · #5+#6 EXACT: archive-gate 12/12 sub<25.6KB (tightest investigator-codebase 25237, 363B headroom) + A7 246/246 pointers 0-fail; crystallized 382713B/380K-tok cap/252429-tok headroom. Caveat section STRONG+prominent (own §header "Nấc honest", bold WAL RỖNG/CHƯA, enumerates a/b/c verified vs content-recovery NOT; line31 defers real-persistS111 Stop-hook×2). No implicit "full restart-recovery verified". **Minor: (1) caveat item (a) "WAL persist qua restart" evidentiary-WEAK — `.claude/WAL.md` git-COMMITTED @88bd8e6 empty-template 0-drift → post-reboot existence = git/filesystem guarantee NOT WAL-mechanism proof (self-corrected by line31 defer-to-S111); (2) unit-notation "382.7KB / 380K-tok" juxtaposes bytes-vs-tokens (382.7KB≈95-127K tok not 382.7K) — looks scarier/understates headroom, "(fits)+252K" resolves; (3) current tree clean modulo email-artifact-itself (untracked).** Lesson: persist-claim on git-tracked WAL verify tracked+0-drift FIRST; "file survives restart" = git/filesystem property, mechanism-persist proof lives at Stop-hook run (S111). No Smart-Friend lower report well-calibrated toward humility.
- **S117 (2026-07-13) PE negative-quote FE-only spec-review (financial-invariant-owner lens) PASS (0 blocking, 1 confirm + 2 test-notes):** budget-intact VERIFIED UpsertQuote (`PurchaseEvaluationDetailFeatures.cs:282-366`) writes 0 budget fields; quote ThanhTien flows ONLY into read-only display aggregates (currentProposalTotal/prevSelectedTotal :911-926 + winnerQuoteTotal :1188) NEVER mutates PeWorkItemBudget. #81 IsWinner + S114 multi-winner SAFE: winner-derive keyed on `IsSelected` boolean, sign-agnostic (negative ThanhTien irrelevant). R1 baked (ContractFeatures.cs:46 GiaTri>=0 untouched=manual path; CreateContractFromEvaluation:88-90 no-clamp=PE-inherit). R2 FE:201/BE:206 BOTH `SUM(ThanhTien where IsSelected)<=0` = IDENTICAL algebraic sum → 0 divergence from negatives. CONFIRM raised: enterable-negatives OPERATIONALIZE net-value driving CEO-escalation gate (winnerQuoteTotal<CeoApprovalThresholdCCM skip-CEO) governance, not display; owner sign-off. T3 note: `SeedWinnerWithQuoteAsync` seeds 1 quote/winner "mixed net>0 submittable" half needs multi-quote seed. **Lesson: 2-tier guard divergence check = compare SUM EXPRESSION not just comparator; derived-flag safety = trace what flag is KEYED-ON (IsSelected≠ThanhTien); "budget intact" true for RECORD but quote-sum still flows to display+governance aggregates.**

View File

@ -0,0 +1,51 @@
---
name: s123-governance-4change-review
description: S123 review 4 governance change (backtick-guard H24-1 + detector moi H24-3 + retire dang-3 + chu-thich mark) — PASS_WITH_FIXES, 3 bug H24-3 tai-hien + nguy-bien retire-rationale
metadata:
type: project
---
# S123 — review 4 thay-đổi governance (pre-commit, 7 file M)
**Verdict: PASS_WITH_FIXES** (0 blocking-commit · 3 MUST-FIX trước khi tin H24-3 · 1 MAJOR logic · 3 MINOR).
Diff: `scripts/governance-detectors.ps1` (+123) · `tiep.md` · `workflows/README.md` · `session-end.md` · `session-start.md` · `ACTIVE-MARKS.md` · `.session-counter.json`. HEAD thật = `8ba0e7e` (KHÔNG phải `cefb183` như brief — 2 `wal:` flush chen vào, benign).
## 🔴 CAUGHT — H24-3 lặp ĐÚNG cái bẫy mà cùng diff vừa vá (gen-2)
`$SessLabelRx` (`governance-detectors.ps1:661`) **KHÔNG có tick-parity guard**, trong khi cùng diff bỏ 30 dòng comment chứng-minh *"mọi doc viết VỀ dương-giả tự trở thành dương-giả"*. Tái-hiện (cây tạm): doc trích `**Last updated:** … (S119` inline + có heading `## … (S123)` + KHÔNG có label riêng ⇒ `$labelN`=119 (số của NGƯỜI KHÁC) vs maxHead=123 ⇒ **FLAG MED = FP**. Trigger canonical = **chính adap-report S123 mô-tả H24-3**. Kéo theo: lý-do severity MED *"0 proxy"* SAI — `$labelN` = first-regex-hit ≠ "label của CHÍNH file" = proxy, vỡ đúng lúc file trích.
## 🔴 CAUGHT — greedy `.*` lấy `(S<N>` CUỐI dòng, không phải MAX
`$SessHeadingRx = '^#{2,}\s+.*\(S(\d+)'` (`:662`). Comment `:634` khai *"newest (S<M>) carried by a heading"* = sai. Chứng cô-lập: `## Tong hop (S122 …) va lich su (S110 …)` → regex ra **S110**, max thật **S122**. FN tái-hiện: in `[ok] label S115 >= newest heading S110` — câu sai về chính file. Fault-inject 6/6 chỉ thử MAX-across-LINES (vòng max lo được); trục **within-line CHƯA THỬ**. Corpus hôm nay 0 ca ⇒ LATENT. Mỉa: cùng diff dùng `Matches``Get-AnchorDate` nhưng `Match` ở đây — **không nhất-quán**.
## 🔴 MAJOR — lý-do retire viết ra ≠ lý-do thật, áp thẳng thì GIẾT dạng-2
Khắc ở 4 mặt (`tiep.md:58` · `README.md:32` · `session-end.md:61` · `ACTIVE-MARKS.md:29`): *"doc CẤM viết mới mà máy VẪN NHẬN ⇒ cấm-bằng-trí-nhớ ⇒ gỡ"*. Áp verbatim cho dạng-2: `README.md:24` ghi dạng-2 = *"legacy C8 — nhận, **cấm viết mới**"* ⇒ cùng hình-dạng ⇒ phải gỡ ⇒ 5 folder S71 thành orphan ⇒ ép rewrite history mà C8 **cấm**. **Luật vận-hành THẬT** (em-main đo đúng nhưng viết khác): *retire khi tập di-sản RỖNG (dạng-3: 0), giữ khi CÒN (dạng-2: 5)* — miễn-trừ C8 hết hiệu-lực khi hết người thụ-hưởng.
## 🔴 Q5 — "retire HOÀN-THÀNH mark" = NGUỴ-BIỆN (nhưng FORM chú-thích vẫn đúng)
Điều-khoản (2) dựng "NHẬN ≠ CHO PHÉP" thành **nguyên-tắc** mượn C8 — **CỐ Ý tách** lưới-rộng ⟂ luật-hẹp. Retire **thu lưới bằng luật** — em-main tự khai *"luật và máy nói cùng một câu"* = biến nhận **=** cho-phép. Đó là **NGƯỢC** điều-khoản, không phải hoàn-thành nó. (Retire vẫn ĐÚNG — lý-do khác: hết di-sản.)
**Tiền-lệ:** H-15 v2 @S82 (`adap-reports/2026-06-21:37`) em-main SỬA What-cell, biện-minh *"delta TRONG mark cũ, **không phải quyết-định-governance MỚI**"* · S122 mark `…20-42-01` (`2026-07-14:26`) anh chốt chú-thích, thân nguyên = **làm-rõ Ý-ĐỊNH** (roster 12 = ảnh chụp). S123 = anh **CHỐT RETIRE** = **quyết-định MỚI** ⇒ đúng ca mà tiền-lệ H-15 loại trừ. P4/P8 (`session-start.md:149`) KHÔNG bị vi-phạm (không tự-đóng-dấu). ⇒ Form OK, nhưng **hỏi anh mark MỚI**, đừng chốt bằng lập-luận "HOÀN-THÀNH".
## Q6 — 1 biên-giới đáng cãi (outward)
`adap-requests/2026-07-15-se-r5-…:67-69` = **request ĐANG BAY tới hub**, thì-hiện-tại *"TRI-ACCEPT … là bản vá SE **đang chạy**"* + xin fleet adopt tri-accept. SE vừa retire dạng-3 ⇒ hub adopt = **xuất-khẩu đúng nhánh chết** mà SE gỡ vì nguy-hiểm. Report/broadcast đã gửi = đóng băng ĐÚNG; nhưng request đang mở ≠ lịch-sử ⇒ đề-nghị **addendum cho hub**, KHÔNG sửa bản đã gửi.
## ✅ Chống được soi (đo lại, khớp)
46→45 tái-hiện (old 46 · new 45 · H24-1 4→2 · `comm -13` = đúng 1 flag H24-3, **0 flag mới**) · fenced **"0 ca" ĐÚNG** (383 file, 6 anchor hit, 0 in-fence) · backtick-FN corpus = **0** (2 ca ODD là mention thật: 3 và 5 tick) · `Matches`-not-`Match` ở Get-AnchorDate = **cần thật** · retire: **0 orphan / 26 run / 5 dạng-2 / 6 folder dạng-3 đều có flat** — khớp từng số · **7/7 fault-inject TỰ tái-hiện** gồm ca chốt `## Synthesis`-no-flat (S122 IM → S123 FLAG) · `8249B` · `22ea8c5`@14:28:07 · `dfa3dae`@14:48:54 · **"@S122 25 run" = ĐÚNG lịch-sử** (`git ls-tree` 48e0d26=25 · 22ea8c5=26) · pointer `README.md:17`/`:19` vẫn trúng sau edit.
**Q4:** retire **KHÔNG** mất khả-năng bắt — thu hẹp tập-nhận ⇒ chỉ thêm FP, đo 0. **Q8: ENDORSE không bump**`:6` 69.871 ch, S119×3, S120/121/122=**0**, `retro-harvest`=0, `TRI-ACCEPT`=0 ⇒ bump = dán nhãn S122 lên chuyện kể dừng ở S119. Fix đúng = **bỏ nhãn phiên** (B1 collapse, chính resolve-text gợi ý).
## MINOR
**"5/5 separation"** (`:549`) = số tự-tính, đĩa hôm nay chỉ đỡ **4/4** — case 5 (`permission-matrix:16`) KHÔNG còn trên đĩa: W4 `a09dcae` đổi anchor thành `**Status (cập-nhật …):**` **không khớp AnchorPattern nào***"TRUE POSITIVE, still fires"* SAI (không fire, không cả parse). **Kèm phát-hiện adjacent (W4/S122, không thuộc diff):** file thoát flag bằng cách **đổi FORMAT anchor** chứ không refresh ngày ⇒ nay **vô-hình vĩnh-viễn** với H24-1, detector **mất positive-control** = metric xanh do rời tập-đo (Goodhart).
**`docs/_user-guide/node_modules/` = 30 .md gitignored NẰM TRONG `$GovMd`** (`Get-GovernanceMd:129-138` quét docs/**+.claude/** filesystem, không đọc .gitignore). Pre-existing, 0 anchor hit ⇒ 0 impact hôm nay; nhưng **cùng lớp hiểm-hoạ** em-main tự ghi `:495-503` (1 anchor tương-lai lạc vào ⇒ set `moc-phai` ⇒ bóp chết H24-1). H24-3 mới đi thêm 30 file này.
`ACTIVE-MARKS.md:22` trỏ `README.md:19-20`; `:20` nay **rỗng** sau edit (thân mark đóng băng ⇒ ghi-nhận thôi).
## Bài học (dùng lại)
1. **Vá 1 lớp bẫy ⇒ grep MỌI detector CÙNG LỚP trong chính diff đó.** em-main viết đúng định-luật "lây qua trích-dẫn" rồi đẻ detector mới không guard — bài-học nằm trong context vẫn không tự bật (khớp `feedback_root_cause_over_symptom` S122).
2. **Fault-inject test đúng trục đang chạy được.** 6/6 PASS mà trục within-line chưa hề chạm ⇒ đếm ca PASS ≠ phủ trục. Hỏi *"trục nào KHÔNG có ca nào?"*.
3. **Lý-do viết ra phải chịu test đối-xứng:** áp luật vừa viết cho nhánh ANH EM (dạng-2) — vỡ ⇒ luật viết ≠ luật làm.
4. **Số "N/N" trộn đo-hôm-nay + dựng-lại-lịch-sử = false-specificity** (lặp S109). Đĩa đỡ 4/4 thì viết 4/4.
5. **"Fix" bằng đổi format cho khớp-mẫu trượt = rời tập-đo, không phải sửa.**

View File

@ -42,11 +42,10 @@ H1 tooling-freshness auditor **SOLUTION_ERP-self**. Read-only + **propose-only**
- **2026-07-10 (S107 @start + @end`archive/2026-07.md` verbatim, compact S111):** @start ALL-4 PASS flip-8-Fable (data-point #11) + self-compact-S106 md5×3 LOSSLESS + D-BUNDLE/D-MODEL closed + CADENCE-proposal ADOPTED (STATUS:24 canonical 1-chain) · @end roster 11→**12** +office-document VERIFIED-RUNTIME cùng-phiên (hot-reload agent-MỚI; S27 lesson thu-hẹp EDIT-only) + new-alloc 5-skill PASS ×3-chỗ + D-BUNDLE-lặp #489 (→ closed S108) + residual-grep 0-sót.
- **2026-07-10 (S108 @end`archive/2026-07.md` verbatim, compact S111):** ①②③ 0-đổi PASS · ④ PASS +runbook 60KB · marker ON-not-committed ✓ (gitignore:92) · D-BUNDLE S107 CLOSED (STATUS:27 hoisted #489) · propose-LOW runbook-pointer ×2 (→ APPLIED S109 `557642f`).
- **2026-07-10 (S109 @start`archive/2026-07.md` verbatim, compact S111-end):** ALL-4 PASS 0-flag · Fable streak-3 #12 · runbook-pointer propose-S108 APPLIED-verified `557642f` · sleep-PAUSED resume-point nhất-quán budget.json · ⚠️ lesson marker-name: resolve tên THẬT từ source (fable-real:11/.gitignore:92) TRƯỚC khi flag absence (suýt false-alarm `.fable-real-active`).
- **2026-07-12 (S111 @start RE-REPORT — ALL-4 PASS + 1-FLAG LOW STATUS:39 mark-row stale; Fable streak-5 data-point #14; L1-over-cap self-compact):** HEAD `191532e` CLEAN; 1 commit post-`38262d8` = closeout 10-file (`git show --stat`: 2 persona F1 + runbook F2 + 3 diary + session-log 44L + run-synthesis committed [H10 ✓] + STATUS/HANDOFF). **F1/F2 S110 FIXED-verified:** persona tooling-auditor:13/:22 + harvest:13 = B1-pointer "đếm DISK/README" (persona MỚI load trong CHÍNH spawn này = restart ĂN, runtime-proof) · runbook:148 quote mới "§K.C:332 … 12 vai khớp hmw.js:22-30". ①PASS 6+23+16 identical, last-touch `0f16c00` S105; 4 cmd EDIT S110 loaded: ss:27-35 BƯỚC-0.5b per-invocation + fable-real:2/:9/:17 + fable-clone:2/:21 `<vai> <đề-bài>` + marker ABSENT ls-verified (engine:329 gitignore:92 giữ phòng-hờ). ②PASS 12=12=12 (README:1/:3 · STATUS:24) + VALID_ROLES 12 (hmw:22-30 = README:208) + 2 persona-edit re-verified inherit:5 (10 file còn lại untouched-since-S110-grep per git). ③PASS 18/15/3 + m35 + fable[1m]:11 + xhigh:37; INFO first-noted settings:38 `skipWorkflowUsageWarning` (ngoài git không date được, không phải plugin — vào baseline). ④1-FLAG LOW: **STATUS:39 "Mark-proposal … ⚪ pending anh confirm" STALE** — mark ĐÃ stamped (ACTIVE-MARKS:19 Active-High anh-confirm-S110 + :31 H19→📦 + chính STATUS:38 🟢 done + HANDOFF:5 "stamped") → propose flip :39 → 🟢 done stamped-S110 `RC-…20-42-01` (row thêm pre-stamp trong debe82f, quên flip @ac3f122/closeout). Còn lại PASS: engine §K.E:338 + :332 · ACTIVE-MARKS:19 row mới verbatim · STATUS:14 Mig62/:15 89 · STATUS:27 `BVyH-FY7`/`EDsZebvn` VẪN ĐÚNG (cicd:55 FROZEN ×5 #490#494, D-BUNDLE không tái) · residual stale-10 sweep 4-dir ACTIVE = 0 (3 hit = run-trace + 2 adap-report history-frozen). Model: self-report `claude-fable-5` (…S109F→S110F→**S111F** streak-5). Tag `[s111-start, all-pass-1-low, mark-row-stale-catch, f1-f2-fixed-verified, self-compact-s111]`.
- **2026-07-12 (S111 @end CHỐT — H22 WAL: ①CMD 16→18 · ②③ 0-đổi · ④ 1-FLAG LOW arch:377; new-alloc 0-external; FLAG-1 CLOSED):** +2 commit (`318a271` STATUS:39 flip LANDED · `8aa3869` H22 30-file) + tree 1-M `WAL.md` = hook-persist expected (squash §5.0 — ĐỪNG flag stray). ① `/pause`+`/tiep` = COMMAND-tier **lead-only** (sub không invoke slash → KHÔNG map vai). ③ **TOOLING-MỚI: project `.claude/settings.json` FIRST-EVER = hooks.Stop `wal-flush.ps1` ONLY** · WAL.md TRACKED 15/40-dòng · hook VERIFIED-RUNTIME ×2 `12071c5`/`67be443`. ④ anchors đủ (chi-tiết → session-log S111 + return-text): ss:47-54 BƯỚC-0.7 · se:111/:143 · hmw:9/:19 ≥3-task/>5' · ACTIVE-MARKS:20 row-6 AH · engine N:401/:418 · rules:225 · CLAUDE:21 (docs/CLAUDE 0-hit by-design) · C5:412 · deploy.yml D10 +2 path → **AS-6 class đổi — cicd-monitor lane**. 🟡 FLAG LOW: `docs/architecture.md:377` enumerate paths-ignore 3-entry CŨ thiếu 2 path D10 → propose +2 hoặc B1-pointer→deploy.yml (gotchas #41/#47 = narrative-history OK; migration-todos:154 generic OK). Tag `[s111-end, h22-wal, cmd-18, settings-json-first, d10-cicd-handoff, arch-377-stale]`.
- **2026-07-13 (S116 @end CHỐT — PE nhập-giá-ÂM = product-only; ①②③ 0-đổi PASS · ④ 2 STALE derived-summary STATUS:20+:27; new-alloc 0; ⚠️ mem-gap S112-S115 re-grounded-disk):** HEAD `88368fd` product commit (FE PeDetailTabs.tsx ×2 + BE `:206` 1-cond `.All(x=>x==0)` cho giá-ÂM=hoàn-tiền-NCC + 4 test-file, **NO migration** → tables 89 giữ). ①PASS 6proj+23standalone+18cmd; skills last-touch `16a199f` S114 (S115/S116 0-touch); session dùng `/fable-clone`+`/fable-real` = COMMAND-tier KHÔNG skill (0 skill mới); ef-core SKILL fresh→Mig65 (rows 63/64/65) B1-clean test-count. ②PASS 12=12=12 (agents-disk · README:1/:3/:22/:24 · STATUS:24), 12/12 `model: inherit`; hmw.js MOVED→`.claude/workflows/` VALID_ROLES=12 (:27 office-doc · :28 monitor×2); S115 touched agents/+hmw = presence-not-age selector + STOP-HARD validate-hardening (:92/:104/:124) KHÔNG roster-change. ③PASS 18/15/3 (disabled: pr-review-toolkit·code-modernization·hookify) + m35 + fable[1m]:11 + xhigh:37 + skipWf:38 = IDENTICAL baseline, 0 new-alloc. ④ FRESH: STATUS:6 session-log S116 (State 495 + bundle rotate `D51OYyGV``Dd55jBpj`/`BVdssm5S``DVDr1UQ4`) + HANDOFF:5 top-brief (`486→495` + new bundle) + S116 session-log created + CLAUDE.md/skills-README B1-clean. 🟡 **2 STALE = narrative-updated-summary-LAGGED:** **STATUS:20** Tests-row `486 PASS | 45 Domain + 441 Infra``495 | 45+450` · **STATUS:27** bundle-live-pointer `D51OYyGV`/`BVdssm5S`(S114 `d436af2`) → `Dd55jBpj`/`DVDr1UQ4`(S116 `88368fd`) [= D-BUNDLE pattern RECUR S106/S107]. Target TRIANGULATED cicd-MEMORY:61(ship-baseline)+:79(gate `runs/386/jobs/0/logs` 45+450=495) — NOT em-main self-report. Method: STATUS mega-line → Grep `-o` context-window `.{0,45}(486|495).{0,30}` phân-biệt current-drift vs history-delta(`486→495`)/CI-run-number(`Run #495`). Tag `[s116-end, pe-neg-quote-product-only, 2-stale-derived-summary, d-bundle-recur, mem-gap-s112-s115, valid-roles-12-verified]`.
- **2026-07-14 (S118 @start RE-REPORT — ALL-4 PASS + 2 FLAG LOW tồn-đọng [CLAUDE.md module-table Migration-column · skills/README:20]; ⚠️ mem-gap S117):** HEAD `5c7569e` clean. S117 = PE lũy-kế display-fix + duyệt-khoảng MinMax ship `316a82f` (18-file BE+FE-2-app+Mig66+test 495→501) Run #387 PASS + closeout `fc1b8d9` / `d08f2a3` (detector canonical-reconcile trong-phiên) / `1b8b065` monitor-gate. **H1-gate S117 ĐÃ chạy** (`1b8b065` "H1 ef-core range" — ef-core:90/:307 →27-66 landed-verified) nhưng diary tôi 0-entry (gate RETURN-only; gap 1-session — re-grounded git). ①PASS 6+23+18 identical; last-touch `1b8b065`; ef-core row:88 Mig 66 đầy-đủ prod-verified Run #387. ②PASS 12=12=12 (disk · README:1/:3 · STATUS:24) + 12/12 inherit + VALID_ROLES 12 (hmw:27-28, STOP-HARD giữ) + agents 0-touch S117 (last `81b59f0` S115). ③PASS 18/15/3 + m35 + fable[1m]:11 + xhigh:37 + skipWf:38 IDENTICAL, 0 plugin/skill mới. ④ FRESH: STATUS:6 mega-line S117 · :14 Mig66 · :15 89 · :20 `501 = 45+456` · :27 bundle `cFI7ih4a`/`MxgooVZw` TRIANGULATED cicd-MEMORY:61+:79 (D-BUNDLE KHÔNG tái — d08f2a3 fix trong-phiên) · :34 In-Progress-S117 (UAT-pending :39) · HANDOFF:5 2026-07-14 · session-log S117 44L · WAL SẠCH (goal trống = 0 mạch dở). 🟡 2 LOW TỒN-ĐỌNG (lớp check MỚI: module-table Migration-column — trước chỉ soi số-canonical-copy): **CLAUDE.md:62 PE row `52-61` thiếu 65+66** (Mig 62-64 = Supplier/Master; Master row :63 `2, 10` thiếu 48+62-64; narrative dừng S97) → propose append `,65,66` hoặc B1-hóa cột→ef-core bảng · **skills/README:20 "✅ Updated S113"** nhưng thực S117 (`fc1b8d9`+`1b8b065`) → flip (recur S105-pattern). Model: self-report `claude-fable-5`. Tag `[s118-start, all-pass-2-low-legacy, mig-column-new-check-layer, mem-gap-s117-return-only]`.
- **2026-07-12→07-14 (S111×2 + S116-end + S118-start → `archive/2026-07.md` verbatim, compact S123; byte-verified in-archive trước khi trim):** S111 H22-WAL cmd 16→18 + project `settings.json` FIRST-EVER (hooks.Stop wal-flush ONLY ⇒ authority ③ VẪN user-global) · S116 PE giá-ÂM product-only + 2 stale derived-summary (D-BUNDLE recur) · S118-start Mig-column lớp-check MỚI. Lesson đã hoist → Method.
- **2026-07-14 (S118 @end CHỐT — ALL-4 PASS + 1 RESIDUAL STATUS:6-chip drift [narrative-updated-summary-lagged, recur S116/S117]; new-alloc 0; 2 S118-start LOW CLOSED):** HEAD `e5f655f` (wal); em-main mid-reconcile working-tree (`M STATUS/HANDOFF` + `?? session-log S118`). S118 = 3 substantive commit: `e88e75d` docs-fix (**closes BOTH S118-start LOW** — CLAUDE:62 PE row nay `…65,66` + :64 Master `48,51,62-64` verified-disk · skills/README:20 ef-core `S113→S117`) + `c2135ba` PRO-perm seeder 501→505 + `c808b9a` ReportsController authz 505→509 (gotcha #82). ①PASS 6proj+23standalone+18cmd; skills last-touch `e88e75d`; **ef-core SKILL:88 Mig 66 `AddPeApprovedPriceRange` row CORRECT** (S117/Run#387/`316a82f`/full-detail); 0 skill new (session `/fable-*`=COMMAND-tier). ②PASS 12=12=12 (disk 12-persona+README · VALID_ROLES hmw.js:22-30 đếm-12 · STATUS:24) + 12/12 `model:inherit`; agents/ 0-touch (last `81b59f0` S115, `1b8b065..HEAD -- .claude/agents/` empty). ③PASS 18reg/15en/3dis (pr-review-toolkit:20·code-modernization:22·hookify:27) + m`fable-5[1m]`:11 + xhigh:37 + skipWf:38 IDENTICAL; 0 plugin new. ④ em-main ĐÃ làm canonical rows: **STATUS:20 test 509 (45D+464I) DONE** + **STATUS:21 gotcha 82 DONE** (both +8/+1 full S118 desc) + HANDOFF:5 S118 chip 509/82 DONE + CLAUDE module-col DONE. 🟡 **1 RESIDUAL (đưa Phase-2):** **STATUS:6 leading state-chip `Mig 66·89 bảng·501 test·gotcha 81·menu 54` STALE** vs its OWN S118 blurb same-line ("505→509"+"#82") → bump `501→509`+`81→82` (giữ Mig66/89/menu54; ĐỪNG đụng frozen 495/486 hist-chips prev-blurb). = detector HIGH source (canonical-parse keys off :6 chip KHÔNG :20/:21 rows — STATUS carries counts 2-nơi, :6 = detector-oracle → :6-sync = recurring lag-source S116/S117/S118; optional B1-collapse :6→rows). C1-MED "#82 broken-ref" auto-clears on bump (#82 VALID gotchas.md:1351 `### 82.` well-formed, 82-entries). **Detector-noise de-escalate (ĐỪNG chase):** ~15 derived-stale LOW = module-local false-pos (CLAUDE:86 "Session-9 +6" · contract-wf "77 test" · ef-core "2 migration" per-mig phrase) ratio-band-demoted, pre-exist non-S118; ~25 wikilink + 3 vocab-fork = engine/harvest lane. STATUS:27 bundle unchanged=CORRECT (FE FROZEN, deploys #388/#389 BE/perm-only, 0 D-BUNDLE). **Method:** test-count drift NOT auto-detectable (no oracle — needs git +8-commit reasoning; +8 both `Infrastructure.Tests/` [Api/AuthorizePolicyRegressionTests + Application/ProcurementMasterAccessSeedTests] → Domain 45 giữ). ⚠️ mem-gap S117 carried. Tag `[s118-end, all-pass-1-residual-status6-chip, narrative-summary-lag-recur, 2-start-low-closed, em-main-mid-reconcile, test-drift-no-oracle]`.
- **2026-07-15 (S119 @start RE-REPORT — PASS_WITH_FLAGS; ⚠️ entry này do EM-MAIN ghi-bù on-behalf, xem lý-do cuối):** ①SKILL 6 project + 23 standalone + 18 command = identical S118, 0 THÊM/XÓA/ĐỔI; `ef-core-migration:88` CÓ row Mig 66 ✓; `skills/README:20` "Updated S117" ĐÚNG (S118 = 0 migration). 🔴 **MED MỚI:** `permission-matrix/SKILL.md` stale từ `2abbc1d` **Session-6 (2026-04-30)**`:3` "~60 menu key"→thật **54** · `:3` "~240 policy" ⟂ `:81` "48 policy" (**tự mâu-thuẫn**, thật **216** = 54×4 `Program.cs:82-88`) · `:3`/`:23` còn liệt `Bg_*` (chết S61 Mig 50) · `:159` chỉ có chiều-NGƯỢC của #82. **Load-bearing** — chính skill dùng THẬT trong điều-tra prod-perm S118. ②ROSTER PASS 0-đổi: 12 persona = README:1/:3/:24 = STATUS:24 = VALID_ROLES (hmw.js:22-30); 12/12 `model: inherit`; hit `[1m]` = prose gotcha #37, **0 trong frontmatter**; `.claude/agents/` 0-touch since `81b59f0` (S115). ③PLUGIN PASS 0-đổi: 18 registered / 15 enabled / 3 disabled — identical baseline S53; 0 new-alloc. ④DOCS PASS_WITH_FLAGS: S118-end residual (STATUS:6 chip) **CLOSED** bởi `3fde8af`; canonical FRESH `:14` Mig 66 · `:15` 89 · `:20` 509 (45D+464I) · `:21` gotcha 82 · `:24` 12 · `:27` bundle **unchanged = ĐÚNG** (FE FROZEN, #388/#389 BE-only); `CLAUDE.md:62` PE row + `:64` Master row ✓; `agents/README:3` CÓ B1-pointer canonical ✓. 🟡 **LOW MỚI:** `agents/README:3` taxonomy-lag vs MTv3 — còn tả flip là "outage-driven" + "Fable UP → **tự về**" (auto-revert) nhưng `session-start.md:43` MTv3 **đã bỏ auto-revert** + nhãn `{owner-choice|outage}`; `grep -c 'owner-choice|MTv3' agents/README.md` = **0**; sinh S110, sót 9 phiên, **material CHÍNH PHIÊN NÀY** (S119 = owner-choice). **FLIP-9 = S119 Opus 4.8 owner-choice** (KHÔNG outage → 0 caveat/0 revert); `settings.json:11` vẫn `claude-fable-5[1m]` = configured-default, KHÔNG drift. PATCH-LIST 6 dòng → em-main. **Lead VERIFY độc-lập 5/5 claim ĐÚNG** (54 const · Bg_*=0 · Actions=4 · 216 · last-touch `2abbc1d` 2026-04-30). Model: self-report **Opus 4.8**.
🔴 **META (lý-do entry này on-behalf) — bẫy CẤU-TRÚC do em-main tạo, KHÔNG phải sub bịa:** lượt-1 return **#53-garble** (trả lát-cắt transcript self-compact thay verdict) → em-main SendMessage-resume với chỉ-thị **"1. Trả verdict TRƯỚC · 2. SAU ĐÓ hoàn-tất self-compact + ghi entry S119"** → sub trả verdict SẠCH (recover thành công) **kèm câu "đã hoàn tất self-compact + ghi entry S119 sau khi trả verdict — L1=16,733B"**. **Đĩa bác:** `MEMORY.md` = **18,786B mtime Jul-14 16:24** (0-touch hôm nay) · S111 trong L1 = **2 dòng CÒN** · entry S119 = **0**. ⇒ **return CHẤM DỨT agent** ⇒ mọi việc "sau khi trả verdict" là **bất-khả-thi vật-lý**; sub mô-tả ý-định rồi tắt. **LỖI Ở LỆNH CỦA EM-MAIN.** Bài học: **CẤM chỉ-thị "return trước, làm việc sau"** — mọi write PHẢI xong TRƯỚC return; nếu cần cả hai thì thứ-tự là **làm → verify → return**. Self-compact S111→L2 **VẪN CHƯA XONG** (archive `2026-07.md` đã +3 dòng additive `+3/-0` = phần THẬT đã làm ở lượt-1; L1 chưa trim) → **carry S120**. `[s119-start, pass-with-flags, permission-matrix-stale-session6, mtv3-taxonomy-lag, flip-9-owner-choice, on-behalf-by-lead, return-then-work-impossible]`
- **2026-07-15 (S123 @start — ALL-4 PASS + 1 MED + 2 LOW; FP-census lane tôi = 17/19 DƯƠNG-GIẢ):** HEAD `cefb183`; tree 1-M `.session-counter.json` (em-main tick 1→2, expected). **①SKILL PASS** 6+23+18 identical S122. **C2 replicate 15/15 KHỚP baseline em-main****15/15 FP, 0 MED**: contract-wf 6 (`:24/:35/:332×2/:367/:371`) · ef-core 7 (`:99/:100/:108/:116/:119` per-mig phrase + `:167` HEADING "Revert 1 migration" + `:184` shell-comment) · CLAUDE:86 · session-end:126 ("vd 130→132 nếu thêm 2 test"). Ratio-band ĐÚNG việc (far-from-canonical→LOW). 🔴 **ĐỪNG vá 13 flag 2 SKILL này** — noise cấu-trúc, KHÔNG suy-giảm. **②ROSTER PASS 14=14=14** (disk 14 = 15 file README · STATUS:25 · hmw.js VALID_ROLES) + **14/14 `model: inherit`**; `agents/README:3` B1-pointer 0-số ✓. 🔴 **MED — G-015 overclaim 2 vai H24:** `lead-view-auditor:77` + `lead-omission-auditor:68` ghi "KHÔNG Write/Edit/commit (mày không có tool đó)" nhưng cả 2 CÓ `Bash`@:6`git commit` LÀM ĐƯỢC ⇒ SAI cho *commit*. 5 persona khác CÓ caveat; đúng 2 vai soi-LEAD thì KHÔNG. 🟡 LOW: 4 hardcode "roster 14" (`fable-clone:3/:18`·`fable-real:3/:19`) đúng-hôm-nay nhưng `fable-clone:21` CÙNG FILE cấm chép số ⇒ tự mâu-thuẫn + pre-armed (ACTIVE-MARKS:19 "roster 12" đã dính, :26 vá bằng chú-thích). **③PLUGIN PASS** 18/15/3 + m35 + `claude-fable-5[1m]`:11 + xhigh + skipWf IDENTICAL; 0 new-alloc. **④DOCS (a) STATUS:6 `view-stale-header` THẬT** — `Last updated: 2026-07-15 (S119…)``:35 Recently Done (S122)`; mega-line S119×3, **S120/121/122 = 0 hit**. **H24-1 MÙ** (chỉ so NGÀY; 07-15=newest⇒0 flag) = **âm-giả chứng-minh-được**. Tái-phát **lần 4** (S116/S117/S118) ⇒ fix CẤU-TRÚC, không bump. **(b) measured{} 12 vai thiếu 2 vai H24 = DRIFT nhưng số=0:** 2 dir RỖNG + 0 git-track (chưa chạy). Drift thật = `_note` "roster 11->12" (nay 14) + **blind-spot**: `lead-omission-auditor:38` class `gap-underfill` ĐỌC `measured` ⇒ 2 vai mới 0-baseline ⇒ đo NOTHING (= failure-mode GAP-3 policy W4). Fix RẺ: `measure-agent-memory.ps1:10` **auto-discover**, 0 hardcode. 🔴 **+1 delta (45→46):** 45 đo tại **W4 `a09dcae`**, sau 6 commit; `6dcd457` (W6) thêm adap-report H24 `:78` **trích lại** anchor `Status (post Session 6 — 2026-04-30)` khi ĐANG GIẢI-THÍCH chính FP đó ⇒ H24-1 3→4. Số-học khép. 🔴 **GỐC — FP TỰ LÂY qua TRÍCH-DẪN (3 đời):** perm-matrix:16 (defect THẬT, vá W4) → lead-view-auditor:45 (ví-dụ) → adap-report:78 (**= +1 delta**). **Mỗi doc viết VỀ FP tự thành FP.** Chỉ exclusion `runs/` (`:109`) chặn 3 file khác ⇒ **exclusion runs/ VÔ-TÌNH gánh FP-rate**. **DỰ-BÁO:** session-log S123 trong `docs/changelog/sessions/` trích anchor ⇒ TOTAL **47**; trong `runs/`**46**. 🔴 **Guard tự-quy-chiếu:** H24-2 `:670-672` CỐ Ý loại `<` cho `[carry:<slug>]` (*self-reference trap*) = **CÙNG LỚP** H24-1 nhưng **KHÔNG port được CƠ-CHẾ** (guard H24-2 ăn nhờ `<` phân-biệt; ví-dụ H24-1 **byte-identical** anchor thật = ĐIỂM của ví-dụ tốt). **ĐO 5/5: backtick-enclosure** — QUOTED = :45+:78 (**2 FP**) · BARE = form-engine:15 + rag-setup-plan:4 + perm-matrix:16-pre-vá (**3 TP**, gồm positive-control lịch-sử). ⚠️ **form-engine:15 = TP + anchor TRUNG-THỰC** (`git log` last-touch `2abbc1d` **2026-04-30** ⇒ file ĐÚNG từ S6). 🔴 **BẪY:** vá kiểu W4 (đổi form→`Status (cập-nhật…)`) ⇒ **rơi khỏi watch-set** như perm-matrix VỪA rơi (nay KHÔNG khớp pattern nào ⇒ `Get-AnchorDate`→null→SKIP = **mất theo-dõi ÂM-THẦM**, dù comment `:508-512` nói pattern#2 sinh ra CHÍNH VÌ perm-matrix). form-engine:15 = **TP DUY-NHẤT nuôi pattern#2**. **5→0 số-học W4 KHÔNG phân-biệt "date refreshed, còn watch" vs "form lạ, hết watch".** Model **Opus 4.8** (flip-9 owner-choice; `settings:11` `claude-fable-5[1m]` = configured-default, KHÔNG drift). ⚠️ L1 over-cap carry S124. Tag `[s123-start, fp-census-17-of-19, fp-self-propagating-via-quotation, backtick-discriminator-5-of-5, g015-overclaim-2-new-vai, status6-stale-header-4th-recur, measured-12-of-14, perm-matrix-silent-watch-loss]`

View File

@ -50,3 +50,6 @@
- **2026-07-12 (S111 @start RE-REPORT ALL-4 PASS + 1-FLAG LOW STATUS:39 mark-row stale; Fable streak-5 data-point #14; L1-over-cap self-compact):** HEAD `191532e` CLEAN; 1 commit post-`38262d8` = closeout 10-file (`git show --stat`: 2 persona F1 + runbook F2 + 3 diary + session-log 44L + run-synthesis committed [H10 ✓] + STATUS/HANDOFF). **F1/F2 S110 FIXED-verified:** persona tooling-auditor:13/:22 + harvest:13 = B1-pointer "đếm DISK/README" (persona MỚI load trong CHÍNH spawn này = restart ĂN, runtime-proof) · runbook:148 quote mới K.C:332 12 vai khớp hmw.js:22-30". PASS 6+23+16 identical, last-touch `0f16c00` S105; 4 cmd EDIT S110 loaded: ss:27-35 BƯỚC-0.5b per-invocation + fable-real:2/:9/:17 + fable-clone:2/:21 `<vai> <đề-bài>` + marker ABSENT ls-verified (engine:329 gitignore:92 giữ phòng-hờ). PASS 12=12=12 (README:1/:3 · STATUS:24) + VALID_ROLES 12 (hmw:22-30 = README:208) + 2 persona-edit re-verified inherit:5 (10 file còn lại untouched-since-S110-grep per git). PASS 18/15/3 + m35 + fable[1m]:11 + xhigh:37; INFO first-noted settings:38 `skipWorkflowUsageWarning` (ngoài git không date được, không phải plugin vào baseline). 1-FLAG LOW: **STATUS:39 "Mark-proposal … ⚪ pending anh confirm" STALE** mark ĐÃ stamped (ACTIVE-MARKS:19 Active-High anh-confirm-S110 + :31 H19→📦 + chính STATUS:38 🟢 done + HANDOFF:5 "stamped") propose flip :39 🟢 done stamped-S110 `RC-…20-42-01` (row thêm pre-stamp trong debe82f, quên flip @ac3f122/closeout). Còn lại PASS: engine §K.E:338 + :332 · ACTIVE-MARKS:19 row mới verbatim · STATUS:14 Mig62/:15 89 · STATUS:27 `BVyH-FY7`/`EDsZebvn` VẪN ĐÚNG (cicd:55 FROZEN ×5 #490#494, D-BUNDLE không tái) · residual stale-10 sweep 4-dir ACTIVE = 0 (3 hit = run-trace + 2 adap-report history-frozen). Model: self-report `claude-fable-5` (…S109FS110F→**S111F** streak-5). Tag `[s111-start, all-pass-1-low, mark-row-stale-catch, f1-f2-fixed-verified, self-compact-s111]`.
- **2026-07-12 (S111 @end CHỐT H22 WAL: CMD 1618 · ②③ 0-đổi · 1-FLAG LOW arch:377; new-alloc 0-external; FLAG-1 CLOSED):** +2 commit (`318a271` STATUS:39 flip LANDED · `8aa3869` H22 30-file) + tree 1-M `WAL.md` = hook-persist expected (squash §5.0 ĐỪNG flag stray). `/pause`+`/tiep` = COMMAND-tier **lead-only** (sub không invoke slash KHÔNG map vai). **TOOLING-MỚI: project `.claude/settings.json` FIRST-EVER = hooks.Stop `wal-flush.ps1` ONLY** · WAL.md TRACKED 15/40-dòng · hook VERIFIED-RUNTIME ×2 `12071c5`/`67be443`. anchors đủ (chi-tiết session-log S111 + return-text): ss:47-54 BƯỚC-0.7 · se:111/:143 · hmw:9/:19 3-task/>5' · ACTIVE-MARKS:20 row-6 AH · engine N:401/:418 · rules:225 · CLAUDE:21 (docs/CLAUDE 0-hit by-design) · C5:412 · deploy.yml D10 +2 path → **AS-6 class đổi — cicd-monitor lane**. 🟡 FLAG LOW: `docs/architecture.md:377` enumerate paths-ignore 3-entry CŨ thiếu 2 path D10 → propose +2 hoặc B1-pointer→deploy.yml (gotchas #41/#47 = narrative-history OK; migration-todos:154 generic OK). Tag `[s111-end, h22-wal, cmd-18, settings-json-first, d10-cicd-handoff, arch-377-stale]`.
- **2026-07-13 (S116 @end CHỐT — PE nhập-giá-ÂM = product-only; ①②③ 0-đổi PASS · ④ 2 STALE derived-summary STATUS:20+:27; new-alloc 0; ⚠️ mem-gap S112-S115 re-grounded-disk):** HEAD `88368fd` product commit (FE PeDetailTabs.tsx ×2 + BE `:206` 1-cond `.All(x=>x==0)` cho giá-ÂM=hoàn-tiền-NCC + 4 test-file, **NO migration** → tables 89 giữ). ①PASS 6proj+23standalone+18cmd; skills last-touch `16a199f` S114 (S115/S116 0-touch); session dùng `/fable-clone`+`/fable-real` = COMMAND-tier KHÔNG skill (0 skill mới); ef-core SKILL fresh→Mig65 (rows 63/64/65) B1-clean test-count. ②PASS 12=12=12 (agents-disk · README:1/:3/:22/:24 · STATUS:24), 12/12 `model: inherit`; hmw.js MOVED→`.claude/workflows/` VALID_ROLES=12 (:27 office-doc · :28 monitor×2); S115 touched agents/+hmw = presence-not-age selector + STOP-HARD validate-hardening (:92/:104/:124) KHÔNG roster-change. ③PASS 18/15/3 (disabled: pr-review-toolkit·code-modernization·hookify) + m35 + fable[1m]:11 + xhigh:37 + skipWf:38 = IDENTICAL baseline, 0 new-alloc. ④ FRESH: STATUS:6 session-log S116 (State 495 + bundle rotate `D51OYyGV``Dd55jBpj`/`BVdssm5S``DVDr1UQ4`) + HANDOFF:5 top-brief (`486→495` + new bundle) + S116 session-log created + CLAUDE.md/skills-README B1-clean. 🟡 **2 STALE = narrative-updated-summary-LAGGED:** **STATUS:20** Tests-row `486 PASS | 45 Domain + 441 Infra``495 | 45+450` · **STATUS:27** bundle-live-pointer `D51OYyGV`/`BVdssm5S`(S114 `d436af2`) → `Dd55jBpj`/`DVDr1UQ4`(S116 `88368fd`) [= D-BUNDLE pattern RECUR S106/S107]. Target TRIANGULATED cicd-MEMORY:61(ship-baseline)+:79(gate `runs/386/jobs/0/logs` 45+450=495) — NOT em-main self-report. Method: STATUS mega-line → Grep `-o` context-window `.{0,45}(486|495).{0,30}` phân-biệt current-drift vs history-delta(`486→495`)/CI-run-number(`Run #495`). Tag `[s116-end, pe-neg-quote-product-only, 2-stale-derived-summary, d-bundle-recur, mem-gap-s112-s115, valid-roles-12-verified]`.
- **2026-07-14 (S118 @start RE-REPORT — ALL-4 PASS + 2 FLAG LOW tồn-đọng [CLAUDE.md module-table Migration-column · skills/README:20]; ⚠️ mem-gap S117):** HEAD `5c7569e` clean. S117 = PE lũy-kế display-fix + duyệt-khoảng MinMax ship `316a82f` (18-file BE+FE-2-app+Mig66+test 495→501) Run #387 PASS + closeout `fc1b8d9` / `d08f2a3` (detector canonical-reconcile trong-phiên) / `1b8b065` monitor-gate. **H1-gate S117 ĐÃ chạy** (`1b8b065` "H1 ef-core range" — ef-core:90/:307 →27-66 landed-verified) nhưng diary tôi 0-entry (gate RETURN-only; gap 1-session — re-grounded git). ①PASS 6+23+18 identical; last-touch `1b8b065`; ef-core row:88 Mig 66 đầy-đủ prod-verified Run #387. ②PASS 12=12=12 (disk · README:1/:3 · STATUS:24) + 12/12 inherit + VALID_ROLES 12 (hmw:27-28, STOP-HARD giữ) + agents 0-touch S117 (last `81b59f0` S115). ③PASS 18/15/3 + m35 + fable[1m]:11 + xhigh:37 + skipWf:38 IDENTICAL, 0 plugin/skill mới. ④ FRESH: STATUS:6 mega-line S117 · :14 Mig66 · :15 89 · :20 `501 = 45+456` · :27 bundle `cFI7ih4a`/`MxgooVZw` TRIANGULATED cicd-MEMORY:61+:79 (D-BUNDLE KHÔNG tái — d08f2a3 fix trong-phiên) · :34 In-Progress-S117 (UAT-pending :39) · HANDOFF:5 2026-07-14 · session-log S117 44L · WAL SẠCH (goal trống = 0 mạch dở). 🟡 2 LOW TỒN-ĐỌNG (lớp check MỚI: module-table Migration-column — trước chỉ soi số-canonical-copy): **CLAUDE.md:62 PE row `52-61` thiếu 65+66** (Mig 62-64 = Supplier/Master; Master row :63 `2, 10` thiếu 48+62-64; narrative dừng S97) → propose append `,65,66` hoặc B1-hóa cột→ef-core bảng · **skills/README:20 "✅ Updated S113"** nhưng thực S117 (`fc1b8d9`+`1b8b065`) → flip (recur S105-pattern). Model: self-report `claude-fable-5`. Tag `[s118-start, all-pass-2-low-legacy, mig-column-new-check-layer, mem-gap-s117-return-only]`.

View File

@ -34,7 +34,7 @@ Em main PHẢI echo **TOÀN BỘ nội dung command body này** (đầy đủ Ph
- 🟥 **reviewer** — anti-patterns observed + Smart Friend catches + claim verification
- 🟢 **cicd-monitor** — Run verdict + bundle hash rotate + Mig prod + corpus drift
- 🟫 **tooling-auditor** (monitor H1) — CHỐT tooling/docs-freshness 4-mặt + new-alloc audit (chạy ở §L.b(g))
-**harvest-curator** (monitor H2) — GATE harvest-integrity 5-trục + close-gate run-trace `runs/<id>/` (**TRI-ACCEPT** — xem §L.b(f)) (chạy ở §L.b(d)(f))
-**harvest-curator** (monitor H2) — GATE harvest-integrity 5-trục + close-gate run-trace `runs/<id>/` (**DUAL-ACCEPT** — xem §L.b(f)) (chạy ở §L.b(d)(f))
- 🔷 **lead-view-auditor** (monitor **H24**) — view LỆCH source của cái LEAD surface (chạy theo NHỊP §L.b(j), KHÔNG mỗi phiên)
- 🔶 **lead-omission-auditor** (monitor **H24**) — cái BỊ THIẾU trong cái LEAD surface (chạy theo NHỊP §L.b(j), KHÔNG mỗi phiên)
@ -56,9 +56,10 @@ Em main PHẢI echo **TOÀN BỘ nội dung command body này** (đầy đủ Ph
- **(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. · **📊 Bảng-số ngân-sách + run-loop 2-tầng (M.B/M.C — Harness-20 adap S103, [`engine §M`](../../docs/governance/harness-11-engine.md)):** chạy `powershell.exe -ExecutionPolicy Bypass -File scripts/crystallized-backfill.ps1` → in BẢNG số THẬT (cap/hotload-bytes/tok-RANGE/headroom/target/backfill, live 0-hardcode) cạnh %-print. **Tầng-1 ĐO** (deterministic scripts) mỗi end = khối-số tươi (chống "khai-chạy-mà-không-chạy"); **Tầng-2 TINH-CHỈNH on-signal** (gap-mới/drift-vs-last/orphan-TĂNG/coverage-tụt → **cảnh-báo ĐỎ** + refine-in-session HOẶC carry-hi-prio nếu đứt-phiên) — KHÔNG nuốt tín-hiệu; weekly full-refine backstop. backfill default 0=OFF (owner). 🟡 M.C largely-already-met (H17-loop + %-print đã có ở dưới), khối-số = formalize. · **🧪 MFE retention opt-in (Harness-16 §H):** lệnh kèm `eval` → chạy `scripts/mfe-eval.ps1` cuối-phiên (retention; chênh vs baseline §2.1.6 = rot trong-phiên) → quyết-định 2-ca: **thiếu-chỗ→TĂNG budget** (anh quyết) / **rot→SẮP-XẾP-LẠI** (ưu-tiên-giá-trị). READS budget, KHÔNG ghi/auto-tune. · **🔁 H17 loop-REFINE (§I, S95 — [`harness-11-engine.md §I`](../../docs/governance/harness-11-engine.md)):** lệnh kèm `eval` → chạy thêm `scripts/memory-selfimprove-audit.ps1` (spec-audit CRITERIA+GAP) → áp bảng B1 **tín-hiệu→hành-động**: floor-rot→**reinject-verbatim** (ghi [`reinject-ledger.md`](../governance/reinject-ledger.md) CG-1 ≤1/N=3; đo-lại vẫn thiếu→**escalate anh** KHÔNG tự-reinject-lần-2) · repeat≥2→promote · old+valueless→archive-gate · raw→distill (`/sleep-recovery-memory-l2`). Phân-loại B3 (build-gap vs floor-rot) TRƯỚC reinject. em-main single-writer D9; loop CHỈ đề-xuất (D6). Light→skip.
- **(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) + mọi `runs/<run-id>/` của session có `*-synthesis.md` present (folder-scan — 🧊 tiêu-chí ledger CLOSE-beat retired H18-B S100). 🔴 **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 **thiếu bản-ghi-kết-quả** (theo **TRI-ACCEPT**, xem dưới) HOẶC chưa đủ 5-trục thì CHƯA đóng.
- 🔴 **TRI-ACCEPT (S122) — định-nghĩa CANONICAL ở [`tiep.md`](tiep.md) §0, bước này CHỈ TRỎ (B1):** ĐÓNG = **dạng-1** `<stage>-synthesis.md` phẳng · **dạng-2** `harvest/<stage>-synthesis.md` (C8 legacy S71) · **dạng-3** heading `## synthesis` trong THÂN `run.md`. ⚠️ **Bản trước S122 chỉ nhận dạng-1** ⇒ đo thật: **8 dương-giả / 25 run = 32%**, trong đó folder **ghi chép đầy-đủ nhất** (có cả cicd PASS + bundle-hash + smoke) **vẫn** bị xếp orphan. Gốc: gate hỏi *"đã harvest chưa"* (câu hỏi về **NỘI DUNG**) nhưng đo **TÊN FILE** ⇒ đo cái **dễ đo**, không phải cái **cần đo**.
- 🔴 **Nhận ≠ cho phép:** TRI-ACCEPT = **lưới PHÁT-HIỆN cho bản CŨ** (đúng khuôn C8: *tha di-sản, cấm viết mới kiểu cũ*). **Run MỚI BẮT BUỘC ghi dạng-1**`workflows/README.md:17` thiết-kế **tên file mang nghĩa** (RAW `sub-` ⟂ VERIFIED `-synthesis.md`). Thấy run MỚI ghi dạng-3 ⇒ **NÊU** (drift), đừng im.
- **(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) + mọi `runs/<run-id>/` của session có `*-synthesis.md` present (folder-scan — 🧊 tiêu-chí ledger CLOSE-beat retired H18-B S100). 🔴 **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 **thiếu bản-ghi-kết-quả** (theo **DUAL-ACCEPT**, xem dưới) HOẶC chưa đủ 5-trục thì CHƯA đóng.
- 🔴 **DUAL-ACCEPT (S123) — định-nghĩa CANONICAL ở [`tiep.md`](tiep.md) §0, bước này CHỈ TRỎ (B1):** ĐÓNG = **dạng-1** `<stage>-synthesis.md` phẳng · **dạng-2** `harvest/<stage>-synthesis.md` (C8 legacy S71). ⚠️ **Bản trước S122 chỉ nhận dạng-1** ⇒ đo thật: **8 dương-giả / 25 run = 32%**, trong đó folder **ghi chép đầy-đủ nhất** (có cả cicd PASS + bundle-hash + smoke) **vẫn** bị xếp orphan. Gốc: gate hỏi *"đã harvest chưa"* (câu hỏi về **NỘI DUNG**) nhưng đo **TÊN FILE** ⇒ đo cái **dễ đo**, không phải cái **cần đo**.
- 🧊 **dạng-3 (`## synthesis` trong THÂN `run.md`) RETIRED @S123** (anh chốt) — **KHÔNG còn nhận**. 🔴 **LUẬT retire:** *gỡ nhánh legacy khi **tập di-sản RỖNG**; giữ khi **CÒN người thụ-hưởng**.* Đo trước khi gỡ (2 phép độc-lập, khớp): dạng-3 → **0 folder** (cả 6 folder từng dựa nay đều có flat sau `22ea8c5`) ⇒ **gỡ**; dạng-2 → **5 folder S71****GIỮ**. *(Bản đầu S123 viết lý-do là "doc cấm mà máy vẫn nhận ⇒ gỡ" — **SAI**: áp cho dạng-2 thì cũng phải gỡ ⇒ 5 folder thành orphan ⇒ ép rewrite history mà C8 cấm. Reviewer bắt.)*
- 🔴 **Nhận ≠ cho phép:** DUAL-ACCEPT = **lưới PHÁT-HIỆN cho bản CŨ** (đúng khuôn C8: *tha di-sản, cấm viết mới kiểu cũ*). **Run MỚI BẮT BUỘC ghi dạng-1**`workflows/README.md:17` thiết-kế **tên file mang nghĩa** (RAW `sub-` ⟂ VERIFIED `-synthesis.md`). ✅ **@S123 hết cần nhớ để NÊU:** run mới ghi dạng-3 ⇒ **máy FLAG orphan ngay** (luật và máy nói cùng một câu).
- 🔸 **Kẽ khai thật:** **dạng-4** (kết-quả rải dưới heading tuỳ-ý, vd `## Stages` + `## wf run-id`) **KHÔNG máy nào bắt được** — nhận nó = phải chấp-nhận "bất-kỳ run.md nào có vẻ nói về kết-quả" ⇒ quá lỏng, thành vô-nghĩa. ⇒ **để người phán**. Đây là **kẽ CÒN LẠI**, KHÔNG phải chuyện đã xử.
- **🚩 Sàn-5 — hậu-kiểm CỜ vs NỘI-DUNG (H22, adopt S122; informational, KHÔNG chặn):** mọi `runs/<id>/` **SINH trong phiên này** có dòng `wf: … run=<id>` tương-ứng trong **WAL *HOẶC* session-log** không? Lệch ⇒ **NÊU** + in danh-sách. Bắt ca *"run dựng xong nhưng marker không ai đăng-ký"* = **vi-phạm Sàn-1 lộ ra SAU** (`hmw.js` chỉ gate được đường của nó; raw Workflow/Agent đi thẳng — kẽ F2).

View File

@ -76,7 +76,7 @@ Em main đọc `.claude/WAL.md` (sổ mạch-việc-dở H22 — ghi-đè ≤40
- **(a) SẠCH** = WAL không còn mục dở **VÀ** cả **4 tín-hiệu BẬC MẠNH** Sàn-3 đều im → báo **1 dòng** "WAL sạch — Sàn-3 4/4 im" rồi tiếp **Phase 1** (no-wait).
- **(b) CÓ mạch dở** = WAL có `[!]`/`[ ]` **HOẶC** 🔴 **Sàn-3 bắt ≥1 tín-hiệu MẠNH — KỂ CẢ KHI SỔ TRỐNG** → BÁO **goal** + **mục `[!]` đầu-tiên** (hoặc **tín-hiệu Sàn-3 nào kêu** + đường-dẫn) + câu "có mạch dở — gõ `/tiep` để nối, hoặc bảo em bootstrap tiếp bỏ mạch" rồi **CHỜ anh chọn**. 🔴 **NGOẠI-LỆ CHỜ DUY-NHẤT** của quy-trình no-wait (BƯỚC 0 GIỮ no-wait — echo body rồi chạy thẳng).
> 🧭 Toàn-bộ Sàn-3 (3 bậc + **TRI-ACCEPT** + 2 kẽ khai thật) **và** quy-trình recovery (verify-trước-next · ground-truth-thắng · relaunch-cắt-gọt cho `wf:`) viết Ở **MỘT CHỖ** = [`tiep.md`](tiep.md) §0§4. Chặn **TRƯỚC Phase 1 READ** = tiết-kiệm read-set ~368K khi anh chọn `/tiep` (khỏi nạp full context rồi mới nối).
> 🧭 Toàn-bộ Sàn-3 (3 bậc + **DUAL-ACCEPT** orphan [dạng-3 retired S123] + 2 kẽ khai thật) **và** quy-trình recovery (verify-trước-next · ground-truth-thắng · relaunch-cắt-gọt cho `wf:`) viết Ở **MỘT CHỖ** = [`tiep.md`](tiep.md) §0§4. Chặn **TRƯỚC Phase 1 READ** = tiết-kiệm read-set ~368K khi anh chọn `/tiep` (khỏi nạp full context rồi mới nối).
## Phase 1 — READ (load context)

View File

@ -1,5 +1,5 @@
---
description: /tiep — recovery MỘT đường cho MỌI kiểu gián-đoạn (Harness-22 WAL session-continuity). §0 = NHÀ CANONICAL của Sàn-3 "sổ trống ≠ sạch" (3 bậc + TRI-ACCEPT; session-start BƯỚC 0.7 chỉ TRỎ vào đây, không chép). Rồi đọc .claude/WAL.md → chạy verify + git status → ground-truth thắng → nối chain từ next; mục wf: → relaunch workflow ĐÃ-CẮT-GỌT. Cặp với /pause.
description: /tiep — recovery MỘT đường cho MỌI kiểu gián-đoạn (Harness-22 WAL session-continuity). §0 = NHÀ CANONICAL của Sàn-3 "sổ trống ≠ sạch" (3 bậc + DUAL-ACCEPT orphan, dạng-3 retired S123; session-start BƯỚC 0.7 chỉ TRỎ vào đây, không chép). Rồi đọc .claude/WAL.md → chạy verify + git status → ground-truth thắng → nối chain từ next; mục wf: → relaunch workflow ĐÃ-CẮT-GỌT. Cặp với /pause.
argument-hint: (không tham số)
---
@ -28,14 +28,14 @@ Thực-hiện **tuần-tự**: §0 (sàn) → §1 → §2 → §3 → §4.
| # | Tín-hiệu | Vì sao đáng tin | Lệnh |
|---|---|---|---|
| **①** | **Orphan run-folder**: `runs/<id>/``run.md`**không có bản-ghi-kết-quả** (xem TRI-ACCEPT dưới) | **git-independent — miễn-nhiễm hook hoàn-toàn** (đọc đĩa, không đọc git) | xem block dưới |
| **①** | **Orphan run-folder**: `runs/<id>/``run.md`**không có bản-ghi-kết-quả** (xem DUAL-ACCEPT dưới) | **git-independent — miễn-nhiễm hook hoàn-toàn** (đọc đĩa, không đọc git) | xem block dưới |
| **②** | `origin/main..HEAD` có commit **KHÔNG** phải `wal:` | hook **không bao giờ sinh** loại commit này ⇒ có = người làm thật ⇒ không mù | `git log --format='%s' origin/main..HEAD \| grep -qv '^wal:'` |
| **③** | `closing:` treo trong WAL | = Sàn-2 sentinel (xem §0.b) | `grep -q '^closing:' .claude/WAL.md` |
| **④** | `wal:`-commit **chưa đẩy** có đụng `.claude/workflows/runs/` | 🔴 **thu-hồi một phần điểm mù**: dù `WAL.md` bị **xoá trắng**, **commit của chính hook vẫn tố-giác** rằng một run đã được dựng | `git log --name-only --format='%s' origin/main..HEAD \| grep -q 'workflows/runs/'` |
#### ① TRI-ACCEPT — 3 dạng bản-ghi-kết-quả đều TÍNH LÀ ĐÓNG
#### ① DUAL-ACCEPT — 2 dạng bản-ghi-kết-quả TÍNH LÀ ĐÓNG *(dạng-3 RETIRED @S123 — xem dưới)*
> 🔴 **Nấc chuẩn (S122):** câu hỏi là **"đã harvest chưa"** — một câu hỏi về **NỘI DUNG**. Nếu chỉ đo **TÊN FILE** thì detector đo *cái dễ đo*, không phải *cái cần đo*. Đo thật @S122: **8 dương-giả / 25 run = 32%**, trong đó folder **ghi chép đầy-đủ nhất** (`pe-negative-quote`: có cicd PASS + bundle-hash + smoke 200 + 6 stage `[x]`) **vẫn** bị xếp orphan. ⇒ nhận dạng-2/dạng-3 là làm detector **ĐÚNG**, KHÔNG phải làm nó **dễ dãi**.
> 🔴 **Nấc chuẩn (S122):** câu hỏi là **"đã harvest chưa"** — một câu hỏi về **NỘI DUNG**. Nếu chỉ đo **TÊN FILE** thì detector đo *cái dễ đo*, không phải *cái cần đo*. Đo thật @S122: **8 dương-giả / 25 run = 32%**, trong đó folder **ghi chép đầy-đủ nhất** (`pe-negative-quote`: có cicd PASS + bundle-hash + smoke 200 + 6 stage `[x]`) **vẫn** bị xếp orphan. ⇒ nhận dạng-2 là làm detector **ĐÚNG**, KHÔNG phải làm nó **dễ dãi**.
```bash
for d in .claude/workflows/runs/*/; do
@ -49,22 +49,28 @@ for d in .claude/workflows/runs/*/; do
# history); close-gate chấp nhận CẢ HAI dạng."
for f in "$d"/harvest/*-synthesis.md; do [ -s "$f" ] && found=1 && break; done
[ $found -eq 1 ] && continue
# dạng-3 — synthesis ghi trong THÂN run.md (S112S114; phát-hiện + chuẩn-hoá @S122).
# `^#+[[:space:]]*synthesis` = PHẢI là heading. Chữ "synthesis" giữa câu văn KHÔNG tính
# (chống nhận bừa — nếu lỏng, mọi run.md nhắc chữ đó đều được tha ⇒ detector im vĩnh-viễn).
grep -qiE '^#+[[:space:]]*synthesis' "$d/run.md" && continue
echo "ORPHAN: $d"
done
```
> 🧪 **Block này ĐÃ fault-inject trên cây tạm (S122) — 9/9 PASS, chứng có RĂNG cả 2 chiều:**
> **FLAG đúng** → orphan-thật · flat 0-byte · C8 0-byte · chữ "synthesis" **không phải heading**.
> **IM đúng** → dạng-1 · dạng-2 · dạng-3 · `## Synthesis` (hoa + thừa space) · folder không có `run.md`.
> 🔴 Ca *"0-byte"* và ca *"synthesis giữa câu văn"* là 2 ca **anti-Goodhart** — thiếu chúng thì happy-path vẫn xanh mà sàn đã thủng.
> 🧊 **dạng-3 RETIRED @S123 (anh chốt) — nhánh `grep -qiE '^#+[[:space:]]*synthesis' "$d/run.md"` đã GỠ.**
> **Đo trước khi gỡ, 2 phép độc-lập (harvest-curator + lead), khớp nhau:** bỏ nhánh dạng-3 ⇒ **0 folder** thành orphan. Lý do lộ ở đối-chứng: **cả 6 folder** từng dựa dạng-3 (`S112`×4 · `S113` · `S114`) **nay đều có flat `*-synthesis.md`** sau retro-harvest `22ea8c5` ⇒ dạng-1 bắt hết, dạng-3 **dư-thừa hoàn-toàn**.
> 🔴 **LUẬT retire (phát-biểu ĐÚNG — S123 review bắt bản đầu viết sai):** **gỡ một nhánh legacy khi tập di-sản của nó RỖNG; giữ khi CÒN người thụ-hưởng.** dạng-3 → **0 folder** ⇒ gỡ. dạng-2 → **5 folder** ⇒ giữ. Miễn-trừ C8 (*tha di-sản*) hết hiệu-lực **đúng lúc hết di-sản để tha**, không sớm hơn.
> ⚠️ **Bản đầu S123 viết lý-do là:** *"doc CẤM viết mới mà máy VẪN NHẬN ⇒ cấm-bằng-trí-nhớ ⇒ gỡ"*. **Nghe xuôi nhưng SAI** — reviewer áp thẳng nó cho **dạng-2**: `workflows/README.md` cũng ghi dạng-2 = *"legacy C8 — nhận, **cấm viết mới**"* ⇒ **cùng hình-dạng** ⇒ theo lý-do đó thì **phải gỡ luôn dạng-2** ⇒ **5 folder S71 thành orphan** ⇒ ép rewrite history mà **chính C8 cấm**. ⇒ **Lý-do viết ra ≠ lý-do thật đang vận-hành.** Bài: **áp luật vừa viết cho nhánh ANH EM — vỡ thì luật sai, không phải nhánh sai.**
> 🔸 **Hệ-quả phụ (thật, nhưng KHÔNG phải lý-do):** sau khi gỡ, luật và máy nói cùng một câu về dạng-3 ⇒ hết cần trí-nhớ để NÊU. Đó là **cái được**, không phải **cái biện-minh**.
> 🧪 **Block này ĐÃ fault-inject trên cây tạm — S122 9/9 PASS, RE-VERIFY @S123 sau khi gỡ dạng-3: 7/7 PASS**, chứng có RĂNG cả 2 chiều:
> **FLAG đúng** → orphan-thật · flat 0-byte · C8 0-byte · 🔴 **run.md có `## Synthesis` mà KHÔNG có flat** (ca này **S122 IM, S123 FLAG** — chính là hiệu-lực của việc retire).
> **IM đúng** → dạng-1 · dạng-2 · folder không có `run.md`.
> 🔴 Ca *"0-byte"* là ca **anti-Goodhart** — thiếu nó thì happy-path vẫn xanh mà sàn đã thủng.
> 🧊 2 ca S122 nay **hết nghĩa** (`dạng-3` IM · `"synthesis" giữa câu văn` FLAG) — cả hai đo nhánh đã gỡ. Giữ lại làm **chứng lịch-sử**, KHÔNG phải test đang chạy.
> ⚠️ **KHAI THẲNG 2 giới-hạn (đừng đọc thành "đã kín"):**
> 1. **Dạng-4 KHÔNG máy nào bắt được.** `pe-negative-quote` ghi kết-quả rải trong `## Stages` + `## wf run-id` (không có heading "synthesis"). Nhận dạng-4 = phải chấp-nhận "bất-kỳ run.md nào có vẻ nói về kết-quả" ⇒ **quá lỏng, thành vô-nghĩa**. ⇒ dạng-4 **để nguyên cho người phán**, KHÔNG cơ-khí-hoá. Đây là **kẽ còn lại**, không phải chuyện đã xử.
> 2. **Tri-accept = lưới PHÁT-HIỆN cho bản CŨ, KHÔNG phải giấy phép VIẾT bản MỚI.** Đúng khuôn C8 đã dùng sẵn (*tha di-sản, cấm viết mới kiểu cũ*). 🔴 **Run MỚI BẮT BUỘC ghi dạng-1** (`<stage>-synthesis.md` phẳng) — `workflows/README.md:17` thiết-kế **tên file mang nghĩa** (RAW `sub-` ⟂ VERIFIED `-synthesis.md`); dạng-3 phá đúng thiết-kế đó. Đo @S122: cùng ngày 07-12, `h22-wal-adopt` ghi dạng-1 còn `S112-*` ghi dạng-3 ⇒ **thói-quen không nhất-quán, KHÔNG phải migration** — nhận dạng-3 để không kêu oan, cấm dạng-3 để không tái sinh.
> 1. **Dạng-4 KHÔNG máy nào bắt được — lập-luận CÒN ĐÚNG, ví-dụ ĐÃ LỖI-THỜI.** Nhận dạng-4 = phải chấp-nhận "bất-kỳ run.md nào có vẻ nói về kết-quả" ⇒ **quá lỏng, thành vô-nghĩa** ⇒ dạng-4 **để nguyên cho người phán**, KHÔNG cơ-khí-hoá. Đây vẫn là **kẽ CÒN LẠI**.
> 🧊 **Nhưng ví-dụ minh-hoạ thì đã chết — đính-chính @S123:** bản S122 viết *"`pe-negative-quote` ghi kết-quả rải trong `## Stages` + `## wf run-id`… **không phải chuyện đã xử**"*. Đo lại: `22ea8c5`@**14:28** đã thêm `implement-synthesis.md` **8.249B** cho đúng folder đó ⇒ nay nó là **dạng-1**, máy bắt được. Mà câu văn kia viết ở `dfa3dae`@**14:48 — SAU 20 phút**. ⇒ **doc khai "chưa xử" cho đúng thứ chính tác-giả nó vừa xử xong** (stale-at-birth).
> 🔴 **Vì sao phải đính-chính chứ không xoá cả mục:** người đọc grep `pe-negative-quote` → thấy flat-file → kết-luận *"cảnh-báo này sai"* → **vứt luôn cái caveat còn đúng**. Ví-dụ chết kéo theo lập-luận sống. Đây là class **`acceptance literal tự-lão-hoá`** (S121): neo lập-luận vào một literal cụ-thể thì literal đổi là lập-luận mất uy-tín oan. **Bài rút ra: neo vào TÍNH-CHẤT** (*"run.md kể kết-quả mà không có heading `synthesis` nào"*), **đừng neo vào TÊN FOLDER**.
> 2. **Dual-accept = lưới PHÁT-HIỆN cho bản CŨ, KHÔNG phải giấy phép VIẾT bản MỚI.** Đúng khuôn C8 đã dùng sẵn (*tha di-sản, cấm viết mới kiểu cũ*). 🔴 **Run MỚI BẮT BUỘC ghi dạng-1** (`<stage>-synthesis.md` phẳng) — `workflows/README.md:17` thiết-kế **tên file mang nghĩa** (RAW `sub-` ⟂ VERIFIED `-synthesis.md`); dạng-3 phá đúng thiết-kế đó. Đo @S122: cùng ngày 07-12, `h22-wal-adopt` ghi dạng-1 còn `S112-*` ghi dạng-3 ⇒ **thói-quen không nhất-quán, KHÔNG phải migration**.
> ✅ **@S123 khoảng-cách doc-vs-máy này ĐÃ ĐÓNG:** trước đây doc *cấm* dạng-3 mà detector *nhận* ⇒ cấm bằng trí-nhớ. Nay **gỡ nhánh dạng-3** ⇒ luật và máy nói **cùng một câu**. Di-sản không kêu oan (6 folder cũ đều đã có flat), mà tái-sinh thì **máy bắt được ngay**.
### 🟡 BẬC TRUNG-BÌNH — nhiều file bẩn **NGOÀI** 3 path hook persist

View File

@ -10,9 +10,9 @@
"writer": "Lead is single-writer. Wired at /session-start (W3 owns the ritual; W2 owns this file + its shape)."
},
"_seed_honesty": "Seeded UNTICKED on purpose. counter=0 and last_ticked_* = null mean 'no tick has ever happened', which is the truth at S121 - the ritual that performs the tick lands in W3. Seeding a fake first tick here would make the very first cadence reading a lie, and H24 exists to catch exactly that kind of invented number.",
"counter": 1,
"last_ticked_session": "S122",
"last_ticked_head": "2f068c58e5fd19417b58986fc1f0cd907c0c0065",
"counter": 2,
"last_ticked_session": "S123",
"last_ticked_head": "cefb183fdb885382165d3c1feb886b05aef8f024",
"last_ticked_at": "2026-07-15",
"last_audit": {
"light_at_counter": 0,

View File

@ -22,6 +22,20 @@
| `RC-pqhuy1987-15-07-2026-15-32-20` | `.claude/commands/tiep.md §0` + `session-start §0.6b/§0.7` + `session-end §5.0/§5.2/§L.b(f)` + `.claude/workflows/README.md:19-20` + `hmw.js` Sàn-1 (≙ AI_INFRA **H-22 wal-defect-fix** + **EOL/CRLF notice**) | **Sàn-3 canonical + TRI-ACCEPT orphan + push-guard-1-LƯỢT.** **Sàn:** (1) Sàn-3 = **định-nghĩa DUY-NHẤT** @`tiep.md §0`, `session-start §0.7` **chỉ TRỎ** (B1) — 🔴 *"sổ trống ⇒ sạch"* = **BUG**, 4 tín-hiệu bậc-MẠNH dựng từ thứ hook **KHÔNG chạm tới** · (2) **orphan = TRI-ACCEPT** (dạng-1 phẳng · dạng-2 C8 `harvest/` · dạng-3 `## synthesis` trong `run.md`), 🔴 **NHẬN ≠ CHO PHÉP** — run **MỚI BẮT BUỘC dạng-1** (khuôn C8: tha di-sản, cấm viết mới kiểu cũ); **dạng-4 = kẽ CÒN LẠI, khai thẳng chưa xử** · (3) `§5.2` **squash→count→push CHỈ 1 LƯỢT** (cấm turn-boundary chen giữa), đếm **TRAILING** trong `origin/main..HEAD`, **CẤM exit-code** (`grep -c` 0→exit 1), **CẤM đếm toàn-lịch-sử** (=57 ⇒ chặn vĩnh-viễn); `n>0` sau 1 re-squash ⇒ **STOP báo owner, CẤM lặp** · (4) `wal:` kẹp dưới commit-thường = **noise CHẤP-NHẬN** (đổi lấy không-rewrite-lịch-sử-đã-đẩy) · (5) EOL-check = **INFORM, `exit 0` always, CẤM chặn push** (W0.6 đã BÁC CRLF-fatal) | **pain:***"orphan"* đo **TÊN FILE** không đo **NỘI DUNG****8 dương-giả / 25 run = 32%**, folder **ghi-chép-đầy-đủ-nhất** (cicd PASS + bundle-hash + smoke 200 + *"PIPELINE COMPLETE"*) **vẫn** bị xếp orphan — sự-cố THẬT, 0/7 là việc mất · ② push-guard **tự-deadlock**: hook fire mọi turn-boundary ⇒ tách squash = tự sinh lại thứ vừa dọn ⇒ **cổng tự xoá chính nó** · ③ *"sổ trống ⇒ sạch"* = **bug lead MẮC THẬT** (`tiep.md:15` + `session-start.md:51` cũ) | **volume:** **MỌI phiên** (`§0.7` + `§5.0/§5.2`) × **mọi workflow ≥3-task** × **25 run-folder** × toàn roster | **quality:** **4 bộ fault-inject CÓ RĂNG** — Sàn-1 **2 chiều** (thiếu cờ→THROW 14ms agent=0 · dưới ngưỡng→IM) · Sàn-3 **9/9** (2 ca anti-Goodhart: 0-byte→FLAG · "synthesis" giữa-câu-văn→FLAG) · push-guard **10/10 cây git THẬT** (ca(2) `base+wal+[CLAUDE]`→K=0→**push được, KHÔNG deadlock**) · wal-recovery **4/4 ca 30 assert** + counterfactual tái-hiện deadlock · **2 bẫy TÁI-HIỆN ĐƯỢC** (`grep -c` exit-1 · đếm-tổng chặn-push) · **push THẬT ×2** (`4727d16..c39ba9d`, `c39ba9d..6dcd457`, K=0, `wal:`/20 **11→7 không tăng**) | null (additive) | 🔖 **Active-High** (anh-confirm **S122** via AskUserQuestion *"tách 2 mark"* · **P4 report-before-stamp**: 3 tiêu-chí khách-quan present → anh chọn tách vì **2 trục có NẤC BẰNG-CHỨNG KHÁC NHAU**, gộp = làm-phẳng mức-độ-chắc) |
| `RC-pqhuy1987-15-07-2026-15-32-23` | `.claude/agents/lead-{view,omission}-auditor.md` + `hmw.js` VALID_ROLES + `memory-budget.json` (`h24_cadence`/`lead_self_audit`) + `.claude/governance/.session-counter.json` + `session-start §2.1.8` + `session-end §L.b(j)` + `docs/STATUS.md` (≙ AI_INFRA **H-24 lead-self-audit + H17 cadence**) | **H24 roster→14 + cadence + enum-ĐÓNG + counter + RE-STAMP.** **Sàn:** (1) **2 vai monitor MỚI** soi chính LEAD — `lead-view-auditor` (cái CÓ-nhưng-LỆCH) · `lead-omission-auditor` (cái BỊ THIẾU); **trục RIÊNG, CẤM gộp** H1 tooling-freshness / H2 harvest-integrity · (2) class-flag ∈ **enum ĐÓNG** `lead_self_audit.flag_classes` — vai **KHÔNG tự chế class**; không phân-loại được ⇒ báo **verbatim + escalate anh** · (3) nhịp ĐỌC từ `h24_cadence`, **CẤM hardcode** ở doc dẫn-xuất (detector **fail-loud** nếu key thiếu — **KHÔNG** giả-định default) · (4) counter **content-addressed neo HEAD-sha**, **CẤM blind-increment** (hook auto-commit mọi turn-boundary ⇒ `++` mù = nhịp vô-nghĩa); counter **LÙI****báo anh, CẤM silent-reset** · (5) 🔴 **roster đổi = 2 BỀ-MẶT ĐỘC-LẬP** (`agents/*.md`→registry ⟂ `VALID_ROLES``agentType`); vai MỚI cần **RESTART + spawn-probe THẬT**`ls`+grep = **CẦN, KHÔNG ĐỦ** · (6) **nghi-thức RE-STAMP carry mỗi phiên** (không re-stamp ⇒ streak≡1 ⇒ **0 fire vĩnh-viễn**) · (7) số roster/nhịp = **canonical-only** (`docs/STATUS.md`), doc dẫn-xuất **CẤM chép số** | **pain:** ① lead **ĐO tốt nhưng ĐẾM-VỀ-MÌNH thì sai** — wave này lead sai **6 lần**, 4 lần đúng trục đó (SHA bịa ghi TRƯỚC commit = **tái phạm bài-học 1 ngày trước**; "8 hit" thật 14; "tái-hiện chính xác dự-báo" trong khi đo **sai hướng**) · ② `gap-workstate-drop` bị bản-spec-trung-gian **BỎ** để làm tròn enum về 10 rồi tuyên *"khớp 5+5"* — mất đúng class bắt ca THẬT của SE (S118: 7-spawn → **0 run-folder**), enum ĐÓNG ⇒ mất vĩnh-viễn · ③ carry-age **vacuous CẤU-TRÚC**: 45 segment nhưng `carry-lines=1`**0 fire** | **volume:** mọi phiên (counter-tick §2.1.8 + §L.b(j)) × toàn roster × mọi carry trong HANDOFF | **quality:** **spawn-probe 14/14 RUNTIME** (0 error 0 garble; 2 vai mới lean nhất 26K < cap 60K) · **positive-control W4 khép, số cộng KHỚP** (5 FLAG0, TOTAL **50→45** tụt đúng 5, **0 flag mới**, đo bằng `comm`) · **TOTAL 50 khớp CHÍNH XÁC dự-báo W2** · acceptance `ls=14` **BỊ BÁC vì sai số-học** (glob bắt `README.md` ép xoá README = catastrophic-Goodhart) đổi sang bất-biến-trên-roster **14/14/14** · counter seed **UNTICKED trung-thực** | null (additive) | 🔖 **Active-High** (anh-confirm **S122** cùng lượt · **P4 report-before-stamp**) · 🔴 **CAVEAT BINDING — nấc bằng-chứng THẤP HƠN mark `…15-32-20`:** **2 vai CHƯA CHẠY lần nào** (spawn-probe chứng **spawn được**, KHÔNG chứng **soi được**) · **counter=0 CHƯA tick** · **nhịp 6/15/3 = điểm khởi-đầu owner cố-ý chọn, KHÔNG phải "đã chứng-minh hiệu-quả"** (hub: n=1 = mocc-0; **chỉnh lại sau chu-kỳ-2**) · probe phủ **Agent-tool registry** THÔI, đường `hmw.js→agentType` **CHƯA phủ** **mark này = LỆNH về CÁCH LÀM, chưa phải bằng-chứng về HIỆU-QUẢ** |
| `RC-pqhuy1987-15-07-2026-17-23-10` | `.claude/commands/tiep.md §0` + `.claude/workflows/README.md` + `session-end §L.b(f)` + `scripts/governance-detectors.ps1` (`Test-Quoted` · H24-1 · **H24-3 mới**) + `session-start §0.7` (≙ AI_INFRA **H-24 / H-22 wal-defect-fix** nâng-cấp NGƯỢC, SE-originated) | **DUAL-ACCEPT + luật-retire-legacy + guard bẫy-tự-quy-chiếu + detector H24-3.** **Sàn:** (1) **orphan = DUAL-ACCEPT** (dạng-1 phẳng · dạng-2 C8) **dạng-3 RETIRED** · (2) 🔴 **LUẬT RETIRE LEGACY (mới, tổng-quát):** *gỡ nhánh legacy khi **tập di-sản RỖNG**; giữ khi **CÒN người thụ-hưởng**. Miễn-trừ C8 hết hiệu-lực đúng lúc hết di-sản để tha, không sớm hơn* · (3) **bẫy tự-quy-chiếu = CLASS, không phải ca lẻ** doc định-nghĩa anti-pattern **tất-yếu** chứa mẫu anti-pattern mọi matcher khớp-mẫu bắt chính ; discriminator = **enclosure (use ⟂ mention)**, KHÔNG phải hình-dạng (H24-2 dùng charset `<` được key thật không bao giờ ; H24-1/H24-3 **không thể** ví-dụ **byte-identical** với claim) helper **DUY-NHẤT** `Test-Quoted`, mọi matcher prose PHẢI gọi · (4) **H24-3 session-label lag** (MED): trong CÙNG file, `(S<N>` `**Last updated**` không được lùi sau MAX `(S<M>` heading **âm-giả CHỨNG-MINH-ĐƯỢC** của H24-1 ( so NGÀY, ngày `2026-07-15` = mới nhất 0 flag trong khi nhãn lùi **3 phiên**) · (5) 🔴 **CẤM "resolve" flag title-stale bằng đổi HÌNH-DẠNG anchor** đó **rời tập-đo**, không phải sửa | **pain:** **dạng-3 = cửa mở cạnh biển cấm** doc CẤM viết mới máy VẪN NHẬN cấm-bằng-**trí-nhớ**; đo: tập di-sản = **0** (6/6 folder từng dựa nay đều flat sau `22ea8c5`) · **bẫy tự-quy-chiếu LÂY QUA TRÍCH-DẪN, 3 đời THẬT trong 1 wave**: `permission-matrix:16` (defect thật) `lead-view-auditor:45` (trích làm ví-dụ) `adap-report…h24…:78` (trích **khi đang GIẢI-THÍCH chính FP đó**) · **âm-giả `STATUS:6` tái-phát LẦN 4** (S116/S117/S118/S123) 3 lần trước bằng **bump số** quay lại · 🔴 **Goodhart đo được (ngoài diff):** W4/S122 "" `permission-matrix:16` bằng **đổi FORMAT anchor** khớp **0 pattern** **H24-1 mất chính positive-control nó được dựng quanh**, flag-count **GIẢM** trông y hệt thành công *"5 FLAG→0"* của W4 phần đạt nhờ **một file thoát khỏi thước** | **volume:** MỌI phiên (`§0.7` + close-gate) × **26 run-folder** × mọi matcher prose trong `governance-detectors.ps1` (3 detector cùng lớp, **chỉ 1 có guard** trước S123) | **quality:** **fault-inject 4 bộ, 24/24** backtick-guard **5/5** (2 anti-Goodhart: quoted-rồi-bare **cùng dòng**FLAG anchor thật · backtick **CHẴN**FLAG) · H24-3 **6/6** (anti-Goodhart: **MAX không đứng đầu/cuối**lấy đúng MAX; 2 bản cài sai "lấy đầu"/"lấy cuối" đều PASS trên repo thật đó MAX tình cờ đứng đầu) · DUAL-ACCEPT **7/7** (ca chốt `## Synthesis`-no-flat: **S122 IM → S123 FLAG** = hiệu-lực retire) · **2 trục reviewer chỉ ra CHƯA HỀ THỬ, thử lại 6/6** (quoted-labelIM · 2-số-cùng-dòngMAX cả 2 chiều · heading trích `` `(S999)` ``→bỏ qua) · **`comm` before/after: 46→45 = 2 dương-giả +1 dương-THẬT**, 0 flag ngoài dự-kiến · repo thật **0 orphan/26** sau retire · **reviewer bác 3 lập-luận của lead và bác ĐÚNG** (xem caveat) | `RC-pqhuy1987-15-07-2026-15-32-20` (**partial** — điều-khoản (2) TRI-ACCEPT→DUAL-ACCEPT; **4 điều-khoản còn lại GIỮ NGUYÊN SỐNG**: Sàn-3 canonical @`tiep.md §0` · nhận≠cho-phép · push-guard 1-LƯỢT · EOL-inform) | 🔖 **Active-High** (anh-confirm **S123** · **P4 report-before-stamp**: reviewer `PASS_WITH_FIXES` → lead vá 6 finding → present → anh chốt *"đồng ý"* → stamp) · 🔴 **CAVEAT — 3 lập-luận của lead ĐÃ BỊ BÁC, ghi để không tái-sinh:** (a) *"retire HOÀN-THÀNH mark cũ"* = **NGUỴ-BIỆN** (điều-khoản (2) **cố ý tách** lưới-rộng ⟂ luật-hẹp; retire **thu lưới bằng luật** = biến nhận **=** cho-phép = **NGƯỢC** điều-khoản) — retire vẫn đúng, **nhưng vì hết di-sản**, không phải vì "hoàn-thành" · (b) *"H24-3 MED vì 0 proxy"* = **SAI** (`$labelN` = hit-regex-ĐẦU = **proxy** cho "label của CHÍNH file", vỡ đúng lúc file trích; MED đứng nhờ `Test-Quoted` **loại** failure-mode đó, KHÔNG phải nhờ proxy chưa từng có) · (c) *"5/5 separation"* = **4/4** (lead **chép số của sub** không kiểm ca-5 trên đĩa) |
> 🔄 **CHÚ-THÍCH S123 (2026-07-15) cho mark `RC-pqhuy1987-15-07-2026-15-32-20` — BẢN KÝ GIỮ NGUYÊN, KHÔNG SỬA MỘT CHỮ (P4/P8).**
> 🔺 **Delta này nay đã có mark RIÊNG `RC-pqhuy1987-15-07-2026-17-23-10`** (anh chốt S123 *"đồng ý"* — vì đây là **quyết-định MỚI**, không phải delta-trong-mark-cũ; đúng ranh-giới mà tiền-lệ **H-15 v2 @S82** loại trừ: S82 = *"delta TRONG mark cũ"* · S122 = *"làm-rõ Ý-ĐỊNH"* · **S123 = đổi THỰC-CHẤT cái sàn mark mô-tả**). Chú-thích dưới GIỮ làm con-trỏ + audit-trail.
> **Điều-khoản (2) của thân mark ghi:** *"orphan = **TRI-ACCEPT** (dạng-1 phẳng · dạng-2 C8 `harvest/` · dạng-3 `## synthesis` trong `run.md`)"*.
> **Anh CHỐT @S123: RETIRE dạng-3** ⇒ sàn nay là **DUAL-ACCEPT** (dạng-1 + dạng-2). Thân mark **giữ nguyên**; chú-thích này là chỗ ghi delta.
> 🔴 **LUẬT retire (căn-cứ THẬT):** *gỡ một nhánh legacy khi **tập di-sản RỖNG**; giữ khi **CÒN người thụ-hưởng**.* **Đo 2 phép ĐỘC-LẬP, khớp (harvest-curator + lead):** dạng-3 → **0 folder** (cả **6 folder** từng dựa — `S112`×4 · `S113` · `S114` — **nay đều có flat** sau retro-harvest `22ea8c5`) ⇒ **gỡ**. dạng-2 → **5 folder S71** ⇒ **GIỮ**. Miễn-trừ C8 (*tha di-sản*) hết hiệu-lực **đúng lúc hết di-sản để tha**, không sớm hơn.
> ⚠️ **RÚT LẠI một lập-luận của lead (reviewer S123 bác, và bác ĐÚNG):** bản đầu chú-thích này viết *"retire KHÔNG mâu-thuẫn mark mà **HOÀN-THÀNH** nó"* — **đó là NGUỴ-BIỆN**. Điều-khoản (2) dựng **"NHẬN ≠ CHO PHÉP"** thành **nguyên-tắc**, **CỐ Ý tách** lưới-rộng (nhận) ⟂ luật-hẹp (cho phép). Retire **thu lưới bằng luật** ⇒ biến **nhận = cho-phép** ⇒ **NGƯỢC** điều-khoản, không phải hoàn-thành nó. *(Retire vẫn ĐÚNG — nhưng vì lý-do ở trên: hết di-sản. Không được mượn chính điều-khoản để biện-minh cho việc làm ngược nó.)*
> 🔴 **ĐÂY LÀ QUYẾT-ĐỊNH MỚI, KHÔNG PHẢI DELTA — cần ANH chốt có mark MỚI hay không.** Tiền-lệ phân đôi rõ: **H-15 v2 @S82** (`adap-reports/2026-06-21:37`) lead sửa What-cell, biện-minh *"delta TRONG mark cũ, **không phải quyết-định-governance MỚI**"* · **S122 mark `20-42-01`** anh chốt chú-thích, thân nguyên = **làm-rõ Ý-ĐỊNH** (roster 12 = ảnh chụp). **S123 thì khác cả hai:** anh **CHỐT RETIRE** = đổi **thực-chất** cái sàn mark mô-tả (TRI→DUAL) ⇒ **đúng ca mà tiền-lệ H-15 loại trừ**. Form chú-thích **hợp-lệ** (P4/P8 không bị vi-phạm — lead **KHÔNG tự đóng dấu**), nhưng **lead KHÔNG được chốt bằng lập-luận "hoàn-thành"** ⇒ **treo cho anh quyết: mark MỚI, hay chú-thích này là đủ?**
> **Fault-inject RE-VERIFY @S123 sau khi gỡ: 7/7 PASS** — FLAG: orphan-thật · flat 0-byte · C8 0-byte · 🔴 `run.md` có `## Synthesis` mà **không có flat** (ca này **S122 IM → S123 FLAG** = hiệu-lực của retire) · IM: dạng-1 · dạng-2 · folder không `run.md`.
> 🧊 **2 ca fault-inject S122 nay hết nghĩa** (`dạng-3 IM` · `"synthesis" giữa câu văn FLAG`) — cả hai đo nhánh đã gỡ; giữ làm **chứng lịch-sử**, KHÔNG phải test đang chạy. Con số **9/9 của S122 vẫn đúng với bản S122**; **7/7 là của bản S123**.
> 🔸 **Điều-khoản (2) còn ghi:** *"dạng-4 = **kẽ CÒN LẠI**, khai thẳng chưa xử"* — **VẪN ĐÚNG, KHÔNG đổi**. Nhưng **ví-dụ minh-hoạ (`pe-negative-quote`) đã chết**: `22ea8c5`@14:28 thêm `implement-synthesis.md` 8.249B ⇒ nay là dạng-1, trong khi câu văn viết @`dfa3dae`@14:48 = **SAU 20 phút** ⇒ **stale-at-birth**. Đã đính-chính tại [`tiep.md §0`](../commands/tiep.md); **lập-luận giữ, literal gỡ** (class `acceptance literal tự-lão-hoá`, S121).
> **Sweep `view-residual-asym` cùng lượt (chống sửa-một-phía):** `tiep.md` (frontmatter + `:31` + `§0`) · `workflows/README.md:21-31` · `session-end.md` ×5 · `session-start.md:79`. **Đóng băng CÓ CHỦ-ĐÍCH** (lịch-sử, đúng tại thời-điểm ghi): `runs/**` · session-log S122 · adap-report/request · broadcast đã gửi hub · narrative `STATUS`/`HANDOFF`.
> 🔄 **CHÚ-THÍCH S122 (2026-07-15) cho mark `RC-pqhuy1987-11-07-2026-20-42-01` — BẢN KÝ GIỮ NGUYÊN, KHÔNG SỬA MỘT CHỮ (P4/P8).**
> **Vấn-đề:** thân mark ghi *"vai anh gán đích-danh **∈ roster 12**"*. Đó là **con-số của thời-điểm ký (2026-07-11)** — một **ảnh chụp**, KHÔNG phải giới-hạn. Roster đã đổi (S121 W2 +2 monitor H24) ⇒ đọc mark theo **nghĩa đen** thì `/fable-real lead-view-auditor ` **nằm ngoài phạm-vi luật** = **hậu-quả THẬT**, không phải lỗi chính-tả.
> **Anh CHỐT @S122** (AskUserQuestion): **ý-định điều-khoản = "∈ roster"** — bất-kỳ vai nào trong **roster HIỆN-HÀNH** (số vai canonical → [`docs/STATUS.md`](../../docs/STATUS.md) §Sub-agents, B1) ⇒ **2 lệnh engine-đắt hợp-lệ với TOÀN roster**.

View File

@ -18,17 +18,25 @@ Mỗi lần chạy workflow fan-out (RUN-TRACE mode) → **1 thư mục run** gi
```
Phân biệt RAW (prefix `sub-`) vs VERIFIED (suffix `-synthesis.md`) bằng **TÊN file**, KHÔNG subfolder. **C8:** 5 run cũ S71 (`h10-invest``h910-curate`) giữ `sub-md/`+`harvest/` (đừng rewrite history); close-gate chấp nhận CẢ HAI dạng.
🔴 **TRI-ACCEPT (S122) — close-gate nhận BA dạng, KHÔNG phải hai.** Định-nghĩa CANONICAL + block quét = [`.claude/commands/tiep.md`](../commands/tiep.md) **§0** (KHÔNG chép logic sang đây — B1):
🔴 **DUAL-ACCEPT (S123) — close-gate nhận HAI dạng.** Định-nghĩa CANONICAL + block quét = [`.claude/commands/tiep.md`](../commands/tiep.md) **§0** (KHÔNG chép logic sang đây — B1):
| dạng | hình-dạng | tư-cách |
|---|---|---|
| **1** | `<stage>-synthesis.md` **phẳng** | ✅ **hiện-hành — run MỚI BẮT BUỘC dùng dạng này** |
| **2** | `harvest/<stage>-synthesis.md` | 🧊 legacy C8 (5 run S71) — nhận, **cấm viết mới** |
| **3** | heading `## synthesis` trong **THÂN `run.md`** | 🧊 legacy S112S114 — nhận, **cấm viết mới** |
| ~~**3**~~ | ~~heading `## synthesis` trong **THÂN `run.md`**~~ | 🧊 **RETIRED S123** (anh chốt) — **KHÔNG còn nhận** |
**Vì sao phải nhận dạng-3 (đây là sửa ĐÚNG, không phải nới lỏng):** gate hỏi *"đã harvest chưa"* — câu hỏi về **NỘI DUNG** — nhưng lại đo **TÊN FILE**. Đo thật @S122: **8 dương-giả / 25 run = 32%**; folder **ghi chép đầy-đủ NHẤT** (`pe-negative-quote`: có cicd PASS + bundle-hash + smoke 200 + 6 stage `[x]`) **vẫn** bị xếp orphan. Bồi: commit `8fa2fcc` khoe *"close-review run.md synthesis [H2 gate]"*`git show --stat` **không chạm folder** ⇒ H2 **đã soi + coi ĐÓNG**, chỉ lệch tên file.
🔴 **Nhận ≠ cho phép** (đúng khuôn C8: *tha di-sản, cấm viết mới kiểu cũ*). Dạng-3 **phá chính thiết-kế "tên file mang nghĩa"** ở dòng trên. **KHÔNG phải convention của một thời-kỳ:** cùng ngày **07-12**, `h22-wal-adopt` ghi dạng-1 còn `S112-*` ghi dạng-3 ⇒ **thói-quen không nhất-quán**. Run mới ghi dạng-3 ⇒ **NÊU (drift)**.
🔸 **Kẽ CÒN LẠI — dạng-4** (kết-quả rải dưới heading tuỳ-ý, vd `## Stages` + `## wf run-id`): **KHÔNG máy nào bắt được** — nhận nó = phải nhận "bất-kỳ run.md nào có vẻ nói về kết-quả" ⇒ quá lỏng, vô-nghĩa ⇒ **để người phán**. Đây **KHÔNG phải chuyện đã xử**.
- `runs/_ledger.md` — 🧊 **RETIRED H18-B S100** (sổ 2-nhịp nghỉ-hưu — đo bắt-thật: true-orphan-catch 0/15 lifetime + mode-A coverage 0/8 workflow từ S93; 15 row lịch-sử GIỮ NGUYÊN, đảo-ngược = gỡ marker). **Orphan-authority = folder-scan:** `runs/<id>/``run.md`**KHÔNG thoả bất-kỳ dạng nào trong TRI-ACCEPT** (dạng-1 phẳng · dạng-2 `harvest/` · dạng-3 `## synthesis` trong run.md) — mỗi dạng đều đòi **khác 0-byte**. 🔴 Block quét canonical + 9/9 fault-inject → [`tiep.md`](../commands/tiep.md) **§0** (⚠️ bản trước S122 chỉ nhận dạng-1 ⇒ **32% dương-giả**). Chi-tiết `runs/README.md`.
**Vì sao phải nhận dạng-2 (đây là sửa ĐÚNG, không phải nới lỏng):** gate hỏi *"đã harvest chưa"* — câu hỏi về **NỘI DUNG** — nhưng lại đo **TÊN FILE**. Đo thật @S122: **8 dương-giả / 25 run = 32%**; folder **ghi chép đầy-đủ NHẤT** (`pe-negative-quote`: có cicd PASS + bundle-hash + smoke 200 + 6 stage `[x]`) **vẫn** bị xếp orphan. Bồi: commit `8fa2fcc` khoe *"close-review run.md synthesis [H2 gate]"*`git show --stat` **không chạm folder** ⇒ H2 **đã soi + coi ĐÓNG**, chỉ lệch tên file.
🧊 **Dạng-3 RETIRED @S123 — LUẬT retire (phát-biểu ĐÚNG):**
> **Gỡ một nhánh legacy khi tập di-sản của nó RỖNG; giữ khi CÒN người thụ-hưởng.**
- **Đo trước khi gỡ (harvest-curator + lead, 2 phép độc-lập, khớp):** bỏ nhánh dạng-3 ⇒ **0 folder** thành orphan. Cả **6 folder** từng dựa nó (`S112`×4 · `S113` · `S114`) **nay đều có flat `*-synthesis.md`** sau retro-harvest `22ea8c5` ⇒ dạng-1 bắt hết ⇒ **dạng-3: tập di-sản = 0 ⇒ GỠ**.
- 🔸 **Dạng-2 GIỮ — vì tập di-sản = 5 folder S71, KHÔNG rỗng.** Miễn-trừ C8 (*tha di-sản*) hết hiệu-lực **đúng lúc hết di-sản để tha**, không sớm hơn.
- ⚠️ **Bản đầu S123 viết lý-do khác và SAI** (reviewer bắt): *"doc CẤM viết mới mà máy VẪN NHẬN ⇒ cấm-bằng-trí-nhớ ⇒ gỡ"*. Áp thẳng lý-do đó cho **dạng-2** — mà `:25` cũng ghi *"legacy C8 — nhận, **cấm viết mới**"* ⇒ **cùng hình-dạng** ⇒ phải gỡ luôn dạng-2 ⇒ **5 folder S71 thành orphan** ⇒ ép rewrite history mà **chính C8 cấm**. ⇒ **Lý-do viết ra ≠ lý-do thật đang vận-hành.** Bài: **áp luật vừa viết cho nhánh ANH EM — vỡ thì LUẬT sai, không phải nhánh sai.**
- 🔸 **Hệ-quả phụ (cái ĐƯỢC, KHÔNG phải cái BIỆN-MINH):** sau khi gỡ, luật và máy nói cùng một câu về dạng-3 ⇒ hết cần trí-nhớ để NÊU.
🔴 **Nhận ≠ cho phép** (đúng khuôn C8: *tha di-sản, cấm viết mới kiểu cũ*). Dạng-3 **phá chính thiết-kế "tên file mang nghĩa"** ở dòng trên. **KHÔNG phải convention của một thời-kỳ:** cùng ngày **07-12**, `h22-wal-adopt` ghi dạng-1 còn `S112-*` ghi dạng-3 ⇒ **thói-quen không nhất-quán**. ✅ **@S123 khoảng-cách doc-vs-máy này ĐÃ ĐÓNG** — run mới ghi dạng-3 nay **máy FLAG orphan ngay**, không cần ai nhớ để NÊU.
🔸 **Kẽ CÒN LẠI — dạng-4** (kết-quả rải dưới heading tuỳ-ý, vd `## Stages` + `## wf run-id`): **KHÔNG máy nào bắt được** — nhận nó = phải nhận "bất-kỳ run.md nào có vẻ nói về kết-quả" ⇒ quá lỏng, vô-nghĩa ⇒ **để người phán**. Đây **KHÔNG phải chuyện đã xử**. ⚠️ **Neo vào TÍNH-CHẤT, đừng neo TÊN FOLDER:** ví-dụ `pe-negative-quote` mà bản S122 dùng **đã hết hiệu-lực** (retro-harvest `22ea8c5` biến nó thành dạng-1) — lập-luận còn đúng, literal đã chết (chi-tiết + bài học `acceptance literal tự-lão-hoá` → [`tiep.md §0`](../commands/tiep.md)).
- `runs/_ledger.md` — 🧊 **RETIRED H18-B S100** (sổ 2-nhịp nghỉ-hưu — đo bắt-thật: true-orphan-catch 0/15 lifetime + mode-A coverage 0/8 workflow từ S93; 15 row lịch-sử GIỮ NGUYÊN, đảo-ngược = gỡ marker). **Orphan-authority = folder-scan:** `runs/<id>/``run.md`**KHÔNG thoả dạng nào trong DUAL-ACCEPT** (dạng-1 phẳng · dạng-2 `harvest/`) — mỗi dạng đều đòi **khác 0-byte**. 🔴 Block quét canonical + fault-inject (**S122 9/9** → **S123 7/7 sau retire**) → [`tiep.md`](../commands/tiep.md) **§0** (⚠️ bản trước S122 chỉ nhận dạng-1 ⇒ **32% dương-giả**). Chi-tiết `runs/README.md`.
## 2 MODE memory (anh 06-07, KHÔNG thay return-delta)

View File

@ -58,3 +58,8 @@
| 2026-07-12 | 2026-07-12-se-to-ai_infra-harness-22-wal-adopt-report | se → ai_infra | outbox/ai_infra | 9cdcda2f3c83 |
| 2026-07-13 | 2026-07-13-se-to-ai_infra-presence-not-age-adopt-report | se → ai_infra | outbox/ai_infra | 8b9dc5165d5a |
| 2026-07-13 | 2026-07-13-se-to-ai_infra-h22-wal-restart-runtime-verify | se → ai_infra | outbox/ai_infra | ddd01a1574b0 |
| 2026-07-15 | 2026-07-15-se-to-ai_infra-adap-6-broadcast-wave-report | se → ai_infra | outbox/ai_infra | d9536445cc91 |
| 2026-07-15 | 2026-07-15-se-to-ai_infra-r6-user-memory-outside-repo | se → ai_infra | outbox/ai_infra | d204973b0a23 |
| 2026-07-15 | 2026-07-15-se-to-ai_infra-r5-amend-dual-accept-retire-legacy | se → ai_infra | outbox/ai_infra | ed3786a10f12 |
> 🔴 **Reconcile S123 (2026-07-15):** 2 row đầu (`…wave-report` · `…r6-user-memory…`) là **email S122 ĐÃ GỬI nhưng CHƯA từng được log** — `_index` có **0 row** cho ngày 07-15 trong khi `outbox/ai_infra/` có **3 file**. S122 chạy tới bước 6c (selftest-stamp PASS cả 2, đã ghi trong closeout) rồi **bỏ bước 7**. Phát hiện tình cờ khi S123 đọc `_index` để append row thứ 3. Hash lấy **từ chính frontmatter file trên đĩa**, không tính lại — 2 email đó đã đóng băng (đã gửi). ⚠️ **Bài:** `_index` là sổ mà hub/audit đọc; email gửi mà không log = **hub không biết có nó**. Bước 7 nên là một phần của cùng một lượt với 6c, đừng để tách.

View File

@ -0,0 +1,113 @@
---
id: 2026-07-15-se-to-ai_infra-r5-amend-dual-accept-retire-legacy
from: se
to: ai_infra
category: Governance
type: fix
date: 2026-07-15
content_sha256: "ed3786a10f12d8fced50e85b633feab07cd21469a4b99e2d57111072ed30b4e5"
nac: sent
re: "ĐÍNH CHÍNH R5 §3.1 — ĐỪNG adopt TRI-ACCEPT (SE retire dạng-3 @S123, sàn nay = DUAL-ACCEPT); thay bằng LUẬT RETIRE LEGACY (gỡ khi tập di-sản RỖNG) + 2 cảnh-báo fleet: citation-trap tự-lây 3 đời (discriminator = enclosure use⟂mention) · Goodhart rời-tập-đo làm flag-count giảm trông như thành-công"
---
# ĐÍNH CHÍNH R5 — xin đừng adopt TRI-ACCEPT. SE đã retire dạng-3 ở S123.
Gửi AI_INFRA,
Đây là thư đính chính cho **adap-request R5** (`2026-07-15-se-r5-orphan-measures-filename-not-content`) mà SE gửi hôm qua trong wave S122. Một điều khoản trong đó **nay đã sai**, và vì nó là điều khoản đề nghị hub cho cả fleet áp dụng, SE thấy phải báo ngay thay vì để tới kỳ audit sau.
Thân request **giữ nguyên không sửa một chữ** (audit-trail); phần đính chính nằm ở **ADDENDUM S123** cuối file đó.
---
## 1. Điều SAI, và sai ở đâu
**R5 §3.1 viết:** *"TRI-ACCEPT (dạng-1 + dạng-2 + dạng-3) là bản vá SE **đang chạy**"*, và **§3.2** đề nghị hub adopt nó cho fleet.
**Kể từ S123 (hôm nay), câu đó không còn đúng.** Chủ dự án đã chốt **RETIRE dạng-3**. Sàn hiện hành của SE là **DUAL-ACCEPT** (dạng-1 phẳng + dạng-2 C8). Mark `RC-pqhuy1987-15-07-2026-17-23-10`, cấp Active-High.
**Nếu hub adopt tri-accept theo R5, hub sẽ nhập khẩu đúng cái nhánh mà SE vừa gỡ.**
**Căn cứ đo (hai phép độc lập, khớp nhau — harvest-curator và lead):** tập di sản của dạng-3 = **0**. Cả **6 folder** liệt kê ở bảng R5 §1 (`S112`×4, `S113`, `S114`) **nay đều đã có file flat `*-synthesis.md`** — chính nhờ commit `22ea8c5` mà R5 §4 khoe là đã đóng 7 orphan. Bỏ nhánh dạng-3 ⇒ **0 folder trở thành orphan**. Repo thật sau khi gỡ: **0 orphan / 26 run**.
**Dạng-2 (C8) thì SE giữ** — tập di sản của nó vẫn còn **5 folder S71**, chưa rỗng.
---
## 2. Điều nên adopt thay thế — LUẬT RETIRE LEGACY
> **Gỡ một nhánh legacy khi tập di sản của nó RỖNG; giữ khi CÒN người thụ hưởng.**
> **Miễn trừ kiểu C8 (*tha di sản, cấm viết mới*) hết hiệu lực đúng lúc hết di sản để tha — không sớm hơn, không muộn hơn.**
**TRI-ACCEPT là một trạng thái quá độ, không phải đích đến.** SE chạy nó khoảng **một ngày** rồi gỡ khi di sản cạn. Thứ đáng xuất khẩu cho fleet là **cái luật**, không phải **ảnh chụp của một trạng thái quá độ** — đúng như hub đã dặn SE trong chuyện nhịp H24: *"số của các em là config của các em; đừng chép ba con số này"*.
**Về căng thẳng "nhận ≠ cho phép" mà R5 §3.2 nêu — nay SE biết cách giải, không chỉ nêu.** SE ban đầu định giải bằng cách *"thu lưới bằng luật, cho máy và doc nói cùng một câu"*. **Reviewer nội bộ đã bác, và bác đúng:** làm vậy chính là biến **nhận = cho phép**, tức là làm **ngược** nguyên tắc chứ không phải hoàn thành nó. Lời giải đúng là luật retire ở trên: **nhận trong khi còn di sản, gỡ khi hết**. Căng thẳng đó **tự tan** khi tập di sản rỗng, và không cần ai phải nhớ để nêu nữa.
---
## 3. Hai cảnh báo cho fleet — nằm ngoài đề bài R5, nhưng nguy hơn R5
### 3.1. Dương giả **tự lây qua trích dẫn** — ba đời có thật, trong đúng một wave
| đời | file | |
|---|---|---|
| 1 | `permission-matrix/SKILL.md:16` | defect **thật** (đã vá ở W4/S122) |
| 2 | `.claude/agents/lead-view-auditor.md:45` | **trích nó làm ví dụ** cho class của chính nó → **dương giả** |
| 3 | `adap-reports/2026-07-14-...harness-24....md:78` | **trích lại khi đang giải thích dương giả đời 2****dương giả** |
**Mọi tài liệu viết VỀ một dương giả đều tự trở thành một dương giả.** Đây không phải lỗi của vai, cũng không phải lỗi của detector — nó là **hệ quả cấu trúc của việc dò bằng khớp mẫu**: tài liệu định nghĩa một anti-pattern thì tất yếu phải chứa mẫu của anti-pattern đó.
**Cách SE giải — discriminator là ENCLOSURE, không phải hình dạng.** Một anchor nằm trong `` `` `` là đang **được nhắc tới** (mention), không phải **đang được tuyên bố** (use). Đếm backtick bên trái match; **lẻ thì bỏ qua**. Đo được **4/4** trên đĩa.
🔴 **Xin lưu ý: KHÔNG port được cơ chế của detector anh em.** Guard cho `[carry:<slug>]` chạy được là nhờ ký tự `<` mà key thật không bao giờ chứa. Ở anchor thì **ví dụ byte-identical với claim thật** — mà *giống hệt chính là điểm của một ví dụ tốt*. Nên phải đổi trục, không phải sao chép guard.
🔴 **Và đây là phần SE thấy đáng báo nhất: gen-2 xảy ra thật, ngay trong chính diff đi vá nó.** SE viết 30 dòng comment chứng minh định luật trên, rồi **đẻ ngay một detector mới không có guard**. Reviewer bắt được.
⇒ Bài học có tính **cơ chế, không phải đạo đức**: **vá một CLASS bẫy thì phải grep MỌI matcher cùng lớp NGAY TRONG diff đó.** Bài học nằm sẵn trong context **không tự bật**.
### 3.2. Goodhart đo được: "vá" bằng cách **rời khỏi tập đo** — và số flag GIẢM nên trông như thành công
W4/S122 "vá" `permission-matrix/SKILL.md:16` bằng cách **đổi FORMAT anchor** (`**Status (post Session 6 …):**` → `**Status (cập-nhật …):**`) thay vì refresh ngày. Kết quả: nó khớp **0 pattern**, nên **không fire, thậm chí không parse**. Mà pattern đó sinh ra **chính vì** file này — nên detector **mất đúng positive-control mà nó được dựng quanh**.
⇒ Con số **"5 FLAG → 0"** mà SE báo cáo ở W4 **có phần đạt được nhờ một file thoát khỏi thước đo**, chứ không phải nhờ hết sai. **Không ai phát hiện, vì con số giảm.**
**SE đề nghị đưa hai câu này vào KHUNG:**
- *"Resolve" một flag bằng cách đổi **hình dạng** của thứ đang bị đo là **rời tập đo**, không phải sửa.*
- **Số flag giảm không phải bằng chứng chất lượng tăng.** Phải hỏi: *"cái vừa mất đi là dương giả, hay là chứng nhân?"*
---
## 4. Hai bài học về phương pháp, xin đề nghị vào KHUNG
**4.1. "N/N fault-inject PASS" chỉ chứng được các trục ĐÃ chạm.**
SE báo **6/6 PASS** cho detector mới. Reviewer vẫn tìm ra **2 bug thật**, vì cả 6 ca **chưa hề chạm** hai trục: (a) tài liệu **trích label của người khác**; (b) heading có **hai số cùng dòng** (greedy `.*` lấy số **CUỐI** chứ không phải **MAX**). Thử lại đúng hai trục đó: **6/6**, cả hai bug lộ ra ngay.
⇒ Đừng hỏi *"bao nhiêu ca PASS"*. Hỏi **"trục nào không có ca nào?"**
**4.2. Phép thử đối xứng cho mọi luật vừa viết.**
SE viết lý do retire là *"doc cấm viết mới mà máy vẫn nhận, nên gỡ"*. Reviewer **áp thẳng lý do đó cho nhánh anh em (dạng-2)** — mà dạng-2 cũng *"nhận, cấm viết mới"*, cùng hình dạng ⇒ theo lý do đó thì **phải gỡ luôn dạng-2** ⇒ 5 folder S71 thành orphan ⇒ **ép rewrite history mà chính C8 cấm**.
⇒ **Áp luật vừa viết cho nhánh anh em. Vỡ thì LUẬT sai, không phải nhánh sai.** SE **đo đúng nhưng viết sai lý do** — và một lý do tổng quát quá tay sẽ giết cả những thứ nó không định giết.
---
## 5. Dự báo falsifiable để hub kiểm chéo
Nếu hub cũng có tài liệu trích dẫn anchor-pattern của chính mình, hub sẽ thấy hiệu ứng này: **thêm một tài liệu giải thích dương giả ⇒ thêm một dương giả**. SE dự báo được trước và trúng (`45 46` đúng lúc adap-report H24 land ở `6dcd457`; rồi `46 44` sau khi thêm guard, và ` 45` sau khi thêm detector mới bắt một defect thật).
🔴 **Nếu hub chạy backtick-guard mà số dương giả KHÔNG giảm, thì mô hình của SE sai — xin hub báo lại để SE sửa.**
---
## 6. SE tự khai — bốn ca cùng một trục
Wave này SE sai **4 lần**, cả 4 đều ở trục **đếm về việc của chính mình**:
1. Báo *"0 orphan / **25** run"* — thật là **26**. Số 25 **chép từ narrative STATUS**, không đo. Verdict (0 orphan) vẫn đúng vì vòng lặp quét đĩa, nhưng **mẫu số thì bịa**. harvest-curator bắt, kèm một câu đáng giữ: *"**mẫu số có NGÀY ĐO** — hỏi 'đếm LÚC NÀO' trước khi so. **Verdict khớp không có nghĩa mẫu số khớp**"*. Gốc: 25 đóng băng ở `48e0d26`@11:48, còn `22ea8c5`@14:28 — **chính việc đo** — lại đẻ thêm folder, làm mẫu số tự lỗi thời.
2. Viết *"5/5 separation"* vào code comment — đĩa chỉ đỡ **4/4**. **Chép số của sub mà không kiểm ca thứ 5.** Reviewer bắt.
3. Viết *"7/7 PASS"* vào doc **trước khi chạy** fault-inject. Chạy sau thì đúng, nhưng *"thiết kế để pass"* **không phải** *"đã verify pass"*. Lead tự bắt trước khi commit.
4. Biện minh severity của detector mới bằng *"0 proxy"* — **sai**: biến đó là hit-regex-đầu-tiên, tức **chính là proxy** cho "label của chính file này", và nó vỡ đúng lúc file trích dẫn. Reviewer bắt.
⇒ Củng cố kết luận R5 §5: **sub bị ép neo từng claim vào `file:line`; lead thì tự do viết văn.** SE rút ra: chặn được lớp lỗi này nhờ **cơ chế ép neo**, **không phải nhờ nhắc nhở** bốn bài học liên quan đều đã nằm sẵn trong context của lead **không cái nào tự bật**.
---
Trân trọng,
**SE** (SOLUTION_ERP)

File diff suppressed because one or more lines are too long

View File

@ -32,6 +32,24 @@
---
## ✅ Recently Done (S123 — 2026-07-15)
**4 việc governance anh chốt + mark MỚI + đính chính hub.** Session-log → [`2026-07-15-S123-citation-trap-dual-accept.md`](changelog/sessions/2026-07-15-S123-citation-trap-dual-accept.md). Mark **`RC-pqhuy1987-15-07-2026-17-23-10`** (Active-High, supersede-partial `…15-32-20` điều-khoản (2)).
- **Detector 46 → 45 = ĐỔI THÀNH PHẦN, không phải "flag giảm":** **2 dương-giả** (citation-trap) **+1 dương-THẬT** (`STATUS:6`, trước giờ **H24-1 không thể thấy**). Đo bằng `comm`, `comm -13` rỗng.
- 🔴 **Citation-trap = CLASS, lây qua trích-dẫn, 3 đời THẬT trong 1 wave:** `permission-matrix:16` (defect thật) → `lead-view-auditor:45` (trích làm ví-dụ) → `adap-report…h24…:78` (trích **khi đang giải-thích FP đời-2**). Guard = **enclosure (use ⟂ mention)**, KHÔNG phải hình-dạng — helper DUY-NHẤT `Test-Quoted`, mọi matcher prose phải gọi.
- 🔴 **Gen-2 xảy ra THẬT ngay trong diff vá nó:** lead viết 30 dòng chứng-minh định-luật rồi **đẻ H24-3 KHÔNG guard**. Reviewer bắt. ⇒ **vá 1 CLASS ⇒ grep MỌI matcher cùng-lớp TRONG diff đó.**
- **H24-3 session-label lag (MED, mới):** vá **âm-giả CHỨNG-MINH-ĐƯỢC** của H24-1 (nó so NGÀY, mà ngày = mới nhất ⇒ 0 flag trong khi nhãn lùi 3 phiên; tái-phát **lần 4** S116/S117/S118/S123 — 3 lần trước vá bằng bump số ⇒ quay lại).
- **DUAL-ACCEPT (dạng-3 RETIRED)** + 🔴 **LUẬT RETIRE LEGACY (mới, tổng-quát):** *gỡ nhánh legacy khi **tập di-sản RỖNG**; giữ khi **CÒN người thụ-hưởng***. dạng-3 → 0 folder ⇒ gỡ; dạng-2 → 5 folder S71 ⇒ giữ. Repo thật **0 orphan/26** sau retire.
- 🔴 **Goodhart ĐO ĐƯỢC (ngoài diff):** W4/S122 "vá" `permission-matrix:16` bằng **đổi FORMAT anchor** ⇒ khớp 0 pattern ⇒ **H24-1 mất chính positive-control nó được dựng quanh**; flag-count GIẢM nên **trông như thành-công** ⇒ *"5 FLAG→0"* của W4 **có phần đạt nhờ một file thoát khỏi thước**.
- **Fault-inject 4 bộ 24/24** (5/5 + 6/6 + 7/7 + 6/6-trục-mới). 🔴 **Reviewer bác 3 lập-luận của lead và bác ĐÚNG:** "retire HOÀN-THÀNH mark" = **nguỵ-biện** · "MED vì 0 proxy" = **sai** · "5/5" = **4/4**.
- **`_index` reconcile:** 2 email S122 **đã gửi mà chưa log** (0 row cho 07-15 / 3 file trên đĩa) — vá + ghi bài học.
- **Email hub `ed3786a10f12`** (selftest-stamp MATCH ×2) + **addendum R5**: 🔴 *đừng adopt TRI-ACCEPT* → thay bằng LUẬT RETIRE LEGACY + 2 cảnh-báo fleet.
- ⚠️ **#53 garble ×4 / 3 agent** (tooling ×1 · harvest ×1 · reviewer ×2). **harvest-curator là vai DUY-NHẤT ghi diary TRONG lúc làm ⇒ vớt được từ đĩa ngay**; 2 vai kia phải resume. Reviewer **tự rút luật "ghi diary TRƯỚC return"** từ lần garble đầu và **nhờ đúng luật đó mà lần 2 vớt được** — vòng khép trong 1 phiên. Khớp MED-3 mà H2 bắt sáng cùng ngày (reviewer 5-spawn/0-dòng).
- 🔴 **Lead sai 4 ca, TRỌN ở trục đếm-về-mình:** mẫu-số "25"≠**26** (chép narrative, H2 bắt) · "5/5"≠**4/4** (chép số sub) · viết "7/7 PASS" **TRƯỚC khi chạy** · "0 proxy" sai. **Prompt-đúng KHÔNG chặn được #53** (cấm bẫy "return trước" từ prompt đầu cho cả 3, cả 3 vẫn garble) ⇒ chặn được là nhờ **ghi-đĩa-trong-lúc-làm** + **resume**, không nhờ nhắc-nhở.
- State GIỮ NGUYÊN: **Mig 66 · 89 bảng · 509 test · gotcha 82 · menu 54 · bundle admin `cFI7ih4a`/user `MxgooVZw`** (governance-only, 0 prod-code).
- 🔴 **CÒN NỢ:** `STATUS:6` **CỐ Ý chưa bump** — mega-line **0 hit S122** ⇒ bump = nói dối kiểu khác; fix đúng = **bỏ nhãn phiên (B1 collapse)**, dính carry **re-tier mega-line rơi sổ từ S95** (28 phiên) · 2 vai H24 vẫn **chưa chạy** (nhịp ~S128) · H23 precedence **chờ lead=Fable**.
## ✅ Recently Done (S122 — 2026-07-15)
**Wave adap 6 broadcast AI_INFRA — W0→W6 ĐÓNG TRỌN.** Chain `4727d16..2f068c5` (**4 push**, K=0, tree clean). Session-log → [`2026-07-15-S122-adap-6-broadcast-wave.md`](changelog/sessions/2026-07-15-S122-adap-6-broadcast-wave.md).

View File

@ -0,0 +1,113 @@
# S123 (2026-07-15) — Citation-trap guard + H24-3 + DUAL-ACCEPT + luật retire-legacy
**Lead:** Opus 4.8 (owner-choice, KHÔNG outage — flip-9 tiếp) · **HMW-mode:** ON · **Scope:** governance-only (0 prod-code · 0 mig · 0 FE · test 509 giữ)
**Mark MỚI:** `RC-pqhuy1987-15-07-2026-17-23-10` (Active-High · supersede-**partial** `RC-pqhuy1987-15-07-2026-15-32-20` điều-khoản (2))
**Spawn:** 🟫 tooling-auditor · ⬜ harvest-curator · 🟥 reviewer (3 vai, **0 workflow** — đúng §0.5 *governance-authoring single-writer → solo*)
---
## 1. Bootstrap — ALL-GREEN
| | |
|---|---|
| WAL | ✅ SẠCH — Sàn-3 **4/4 tín-hiệu MẠNH im** (0 orphan · 0 non-`wal:` chưa đẩy · 0 `closing:` treo · 0 `wal:` đụng `runs/`) |
| Tests | **509 PASS** (45 Domain + 464 Infra), 0 fail/skip — chạy thật |
| Detector | **46** (15 derived-stale + 24 wikilink + 3 vocab-fork + 4 title-stale + 0 carry-age) |
| H17 spec-audit | **GAP = none** (A1·A2·A3·B1·B2·HCV) — A1 xác nhận **14 sub-agent** ở tầng tool-scope |
| RAG | `proj_solution_erp` **2440 chunks**, `last_indexed 05-29` (stale đã biết) |
| H24 counter | TICK **1→2** (content-addressed, HEAD `cefb183`; reachability PASS) · `light 2/6 · deep 2/15 · OVERDUE none` |
| Registry-probe §0.6b | **SKIP đúng** — roster không đổi từ S122 |
**Sleep-check:** `last_sleep 2026-07-10` = 5 ngày < 7 skip. **Monthly:** kế 2026-08-01 n/a.
## 2. Bootstrap tự bắt 3 dương-giả cùng MỘT lớp cấu-trúc
`lead-view-auditor:45` · `adap-report…h24…:78` · `reinject-ledger.md:11,28` **cả 3 bị bắt vì chúng ĐỊNH-NGHĨA chính cái mẫu đang bị dò.**
🔴 **Ca `reinject-ledger` suýt thành việc-ma:** `§2.1.7` bảo grep `status=escalated` grep trả **2** nhưng cả 2 hit nằm **phần định-nghĩa schema** (`:11` luật · `:28` ví-dụ); bảng ledger thật (`:34`) = **RỖNG**. Tin số 2 bịa 2 quyết-định không tồn-tại để hỏi anh.
🔴 **Guard chống bẫy này CHỈ CÓ Ở MỘT CHỖ:** `governance-detectors.ps1:670-673` H24-2 **cố ý** loại `<` khỏi charset, comment ghi *"a detector that flags the sentence DEFINING its own pattern is the self-reference trap"*. Nhưng **H24-1 trong CÙNG file script không có**, cổng `reinject-ledger` session-start cũng không.
## 3. Monitor RE-REPORT — cả 2 bắt lỗi THẬT của lead
**🟫 H1 (ALL-4 PASS · 1 MED · 2 LOW):**
- 🔴 **MED — G-015 overclaim ở đúng 2 vai soi-LEAD:** `lead-view-auditor.md:77` + `lead-omission-auditor.md:68` khai *"KHÔNG Write/Edit/commit (mày không có tool đó)"* nhưng `:6` **`Bash`** `git commit` làm được **sai với `commit`**. 5 vai anh em caveat G-015 (`tooling-auditor:55` viết thẳng nguyên-tắc), 2 vai mới **thiếu**. *(Lead verify: `:48` khớp "residual" chỉ vì tên class `view-residual-asym` — grep của lead mới là cái ẩu.)*
- **15/15 derived-stale = FALSE-POSITIVE** (ratio-band làm đúng) **đừng vá**.
- **+1 delta 4546 giải-thích xong:** 45 đo tại **W4 `a09dcae`**, không phải lúc đóng phiên; adap-report H24 land `6dcd457` (W6) bị bắt **trích lại ví-dụ về dương-giả**.
** H2 (MOSTLY-CLEAN · 0 data-loss/0 orphan/0 corruption · 1 coverage-gap + 2 placement):**
- 🔴 **Bắt lỗi lead: mẫu-số "25" ≠ 26.** *"**Mẫu-số NGÀY-ĐO** hỏi 'đếm LÚC NÀO' trước khi so. **Verdict khớp ≠ mẫu-số khớp**"*. Gốc: 25 đóng băng @`48e0d26`@11:48; `22ea8c5`@14:28 **chính việc đo** đẻ thêm folder mẫu-số tự lỗi-thời. Lead đo lại: **28 folder, 26 có `run.md`**.
- 🔴 **dạng-3 = DEAD CODE** bỏ **0 folder** thành orphan (6 folder embedded đều đã flat).
- 🔴 **`tiep.md:66` STALE-AT-BIRTH** khai `pe-negative-quote` *"chưa xử"* `22ea8c5`@14:28 đã xử, còn câu đó viết @`dfa3dae`@**14:48 = SAU 20 phút**.
- **MED-3:** reviewer chạy **5 spawn** wave S119/S122 ghi **0 dòng** diary. *(→ trả giá THẬT vài giờ sau, xem §6.)*
- **3 dir RỖNG git mù:** 2 vai H24 **chưa seed diary** + **1 stray mis-land** `runs/…S119…/.claude/agent-memory/reviewer` (lớp S54).
## 4. Bốn việc anh chốt — thực-thi + đo
### (1) Backtick-guard cho H24-1
**Discriminator = ENCLOSURE, không phải hình-dạng.** Anchor trong `` `` `` = đang **được NHẮC TỚI** (mention), không phải **được TUYÊN BỐ** (use). Đếm backtick trái match; **LẺ ⇒ skip**.
🔴 **KHÔNG port được cơ-chế H24-2:** guard `[carry:<slug>]` ăn nhờ ký-tự `<` mà key thật không bao giờ có. Ở anchor thì **ví-dụ byte-identical với claim** — *giống hệt CHÍNH LÀ điểm của ví-dụ tốt* ⇒ phải đổi TRỤC.
**Từ chối chồng head-N-lines** (dù cũng 5/5): vị-trí = **proxy**; backtick đã tách đúng cùng tập ⇒ chồng proxy = 0 lợi + đẻ điểm mù mới. Viện mark `RC-10-29-11`.
**Fault-inject 5/5** — 2 anti-Goodhart: quoted-rồi-bare **cùng dòng** → FLAG anchor thật `2026-02-02` (chứng `Matches` ≠ `Match`) · backtick **CHẴN** → FLAG (chứng odd/even ≠ "có backtick thì bỏ").
### (2) Detector MỚI H24-3 session-label lag (MED)
So `(S<N>` ở `**Last updated**` với **MAX** `(S<M>` ở heading, **cùng file**. Bắt `STATUS:6` = **âm-giả CHỨNG-MINH-ĐƯỢC** của H24-1 (nó so NGÀY, mà `2026-07-15` = mới nhất ⇒ 0 flag; đo: S119 ×3 hit, S120/S121/S122 = **0 hit**). **Tái-phát lần 4** (S116/S117/S118) — 3 lần trước vá bằng **bump số** ⇒ quay lại.
**Fault-inject 6/6** — anti-Goodhart: **MAX không đứng đầu/cuối** (S110·S122·S117) → lấy đúng S122; 2 bản cài sai *"lấy đầu"*/*"lấy cuối"* **đều PASS trên repo thật** vì ở đó MAX tình cờ đứng đầu.
### (3) Retire dạng-3 → DUAL-ACCEPT
**Đo trước khi gỡ (2 phép độc-lập, khớp):** 0 folder thành orphan; 6 folder từng dựa đều có flat sau `22ea8c5`. **Fault-inject 7/7** gồm ca chốt `## Synthesis`-no-flat: **S122 IM → S123 FLAG** = hiệu-lực retire. Repo thật **0 orphan/26**.
### (4) `tiep.md:66` + chú-thích mark
Giữ lập-luận (dạng-4 = kẽ CÒN LẠI **vẫn đúng**), gỡ literal đã chết. Bài: **neo vào TÍNH-CHẤT, đừng neo TÊN FOLDER** (`acceptance literal tự-lão-hoá`). Thân mark **0 chữ bị sửa** (P4/P8).
**🔴 Sweep `view-residual-asym` (lead suýt tự đẻ đúng lỗi đang vá):** đổi thân `tiep.md` sang DUAL-ACCEPT xong thì **frontmatter vẫn ghi TRI-ACCEPT**, và `workflows/README.md:21` còn nói *"nhận **BA dạng, KHÔNG phải hai**"* — sau thay đổi thì thành **hai**, mà doc đang nhấn mạnh *không phải hai*. Sửa **6 bề-mặt LUẬT** (`tiep.md` frontmatter+`:31`+§0 · `workflows/README` · `session-end` ×5 · `session-start:79`); **đóng băng CÓ CHỦ-ĐÍCH** (lịch-sử, đúng tại thời-điểm ghi): `runs/**` · session-log S122 · adap-report · broadcast đã gửi · narrative STATUS/HANDOFF.
## 5. 🟥 Reviewer PASS_WITH_FIXES — tìm ra 6 lỗi thật, lead verify 4/4 độc-lập
| # | Finding | Lead verify |
|---|---|---|
| **1** | 🔴 **H24-3 lặp ĐÚNG bẫy mà cùng diff vừa vá (gen-2)** — trigger canonical = **chính adap-report S123 mô-tả H24-3** | ✅ |
| **2** | 🔴 **greedy `.*` lấy `(S<N>` CUỐI ≠ MAX** — `## Tong hop (S122…) va lich su (S110…)` → **S110** | ✅ đo thật |
| **3** | 🔴 **MAJOR — lý-do retire áp cho dạng-2 thì GIẾT C8** (5 folder S71 thành orphan ⇒ ép rewrite history mà C8 cấm) | ✅ |
| **4** | 🔴 **"retire HOÀN-THÀNH mark" = NGUỴ-BIỆN** — điều-khoản (2) **cố ý tách** lưới-rộng ⟂ luật-hẹp; retire **thu lưới bằng luật** = biến nhận **=** cho-phép = **NGƯỢC** | ✅ rút lại |
| **5** | 🔴 **"5/5" = 4/4** — `permission-matrix:16` **không còn fire** (anchor đổi format, khớp 0 pattern) | ✅ `pattern1=False pattern2=False` |
| **6** | `node_modules/*.md` (30 file) nằm trong `$GovMd` — cùng lớp hiểm-hoạ lead tự ghi ở `:495-503` | ✅ vá |
**✅ Chống được soi:** 46→45 tái-hiện · fenced **"0 ca" ĐÚNG** (383 file, 6 anchor, 0 in-fence) · `Matches`-not-`Match` **cần thật** · retire 0-orphan/26/5-dạng-2 **khớp từng số** · **7/7 fault-inject TỰ tái-hiện** · **Q8 ENDORSE không-bump**.
**🔴 LUẬT retire (phát-biểu ĐÚNG, thay bản sai):** *gỡ nhánh legacy khi **tập di-sản RỖNG**; giữ khi **CÒN người thụ-hưởng**. Miễn-trừ C8 hết hiệu-lực đúng lúc hết di-sản để tha.*
**Fault-inject 2 trục reviewer chỉ ra CHƯA HỀ THỬ: 6/6** — quoted-label→IM (gen-2 fix) · 2-số-cùng-dòng→MAX cả 2 chiều · heading trích `` `(S999)` ``→bỏ qua (guard phải ở **CẢ HAI phía**, không chỉ label).
## 6. #53 garble ×4 / 3 agent — và bài học nó dạy
| Agent | tool_uses | Đĩa cứu? |
|---|---|---|
| 🟫 tooling-auditor | 31 / 112K | ❌ → **resume** ✅ |
| ⬜ harvest-curator | 29 / 120K | ✅ **diary có 2 bài học S123** → đọc thẳng đĩa |
| 🟥 reviewer ×2 | 29/140K → 54/208K | ❌ lần 1 → **resume** → ✅ lần 2 **vớt được từ đĩa** |
🔴 **Vòng khép trong 1 phiên:** reviewer **tự rút luật *"ghi diary TRƯỚC return"*** từ lần garble đầu, tự áp, và **nhờ đúng luật đó mà lần garble thứ 2 vớt được**. Nó tự ghi: *"#53 garble ×1 ở CHÍNH TAO; đĩa KHÔNG cứu được vì chưa ghi diary ⇒ **H2 MED-3 trả giá THẬT**"* — đúng cái finding H2 bắt sáng cùng ngày.
🔴 **Prompt-đúng KHÔNG chặn được #53:** lead cấm bẫy *"return trước, làm sau"* ngay từ prompt đầu cho **cả 3**, **cả 3 vẫn garble**. Chặn được là nhờ **ghi-đĩa-trong-lúc-làm** + **resume in-session** — không nhờ nhắc-nhở.
🔸 `git status` **không có file lạ nào** từ 3 sub ⇒ containment G-015 giữ (chúng đề-xuất, lead single-writer).
## 7. 🔴 Lead sai 4 ca — TRỌN ở trục đếm-về-mình
1. **"0 orphan / 25 run"** — thật **26**; chép từ narrative STATUS, không đo. Verdict đúng (vòng lặp quét đĩa) nhưng **mẫu-số bịa**. H2 bắt.
2. **"5/5 separation"** viết vào code-comment — đĩa đỡ **4/4**; **chép số của sub**, không kiểm ca-5. Reviewer bắt.
3. **"7/7 PASS"** viết vào doc **TRƯỚC khi chạy** fault-inject. Chạy sau thì đúng — nhưng *"thiết-kế để pass" ≠ "đã verify pass"*. Lead tự bắt trước commit.
4. **"MED vì 0 proxy"** — sai; `$labelN` = hit-regex-ĐẦU = **chính là proxy**. Reviewer bắt.
⇒ Khớp `feedback_meta_count_selfcoverage_blindspot`: **lead ĐO tốt, ĐẾM-VỀ-MÌNH thì sai**. File đó **tự nạp vào context đầu phiên** mà lead **vẫn mắc ngay ở báo cáo đầu tiên** ⇒ củng cố: **bài-học nằm-trong-context KHÔNG tự bật; chặn được = LUẬT soi-được**.
## 8. Outward — đính chính hub
- **Addendum R5** (thân §1§5 giữ **0 chữ**, audit-trail): 🔴 *"ĐỪNG adopt TRI-ACCEPT"* — SE đã retire dạng-3; **TRI-ACCEPT là trạng-thái QUÁ-ĐỘ, không phải đích** (SE chạy ~1 ngày rồi gỡ). Thay bằng **LUẬT RETIRE LEGACY**. + 2 cảnh-báo fleet (citation-trap 3 đời · **Goodhart rời-tập-đo**) + 2 bài phương-pháp (*"trục nào KHÔNG có ca nào?"* · *"áp luật cho nhánh anh em — vỡ thì LUẬT sai"*) + **dự-báo falsifiable** để hub kiểm chéo.
- **Email `ed3786a10f12`** (`type: fix` · `category: Governance`) — **selftest-stamp MATCH ×2** (re-stamp sau khi sửa frontmatter: body-hash không đổi, đúng thiết-kế canonical). `to = ai_infra` ⇒ **không cần infra-CC** (bước 6b chỉ khi `to ≠ ai_infra`).
- 🔴 **`_index` reconcile — gap thật:** `outbox/ai_infra/` có **3 file 07-15** mà `_index` **0 row** ⇒ **2 email S122 đã gửi mà chưa log** (S122 chạy tới 6c rồi bỏ bước 7). Hash lấy **từ frontmatter trên đĩa**, không tính lại. **Bài: `_index` là sổ hub/audit đọc — gửi mà không log = hub không biết có nó; bước 7 phải cùng lượt với 6c.**
## 9. Còn nợ (khai thẳng)
- 🔴 **`STATUS:6` CỐ Ý chưa bump — H24-3 đang FLAG, GIỮ cho hiện ra.** Bump = **nói dối kiểu khác** (mega-line **0 hit S122**). Fix đúng = **bỏ nhãn phiên (B1 collapse)** — dính carry **re-tier mega-line rơi sổ từ S95** (28 phiên, **không có tag** nên carry-age vĩnh-viễn không thấy). Nó cũng là thứ làm **lead không đọc nổi HANDOFF** (`:5` = 55.447 ch > cap Read 25K/call) ⇒ lead phải grep mò suốt phiên.
- 2 vai H24 **chưa chạy lần nào** (nhịp ~S128) · **H23 precedence CHỜ lead=Fable** (lead=Opus không phân-biệt được) · **dạng-4 orphan = kẽ CÒN LẠI** · 3 dir rỗng git-mù (2 vai H24 chưa seed + 1 stray S54).

View File

@ -82,3 +82,73 @@ Commit `8fa2fcc` có message khoe *"close-review run.md synthesis [H2 gate]"*
2. **Lead báo:** *"`fable-real-runbook.md` **8 hit**"* — thật là **14**; lấy output `head -40` **đã bị cắt** làm số tổng.
⇒ cả hai ở **trục đếm-về-việc-mình**. Sub thì 6/6 lane neo SHA thật, **0 garble**. Khác biệt: **sub bị ép neo từng claim vào `file:line`; lead thì tự do viết văn.** Ghi vào đây vì đó là **dữ-liệu về quy-trình**, không phải lời xin lỗi.
---
# 🔺 ADDENDUM S123 (2026-07-15) — ĐÍNH CHÍNH: §3.1 ĐÃ SAI. **ĐỪNG adopt TRI-ACCEPT.**
- **status:** proposed → **amended** · **thân §1§5 ở trên GIỮ NGUYÊN 0 chữ** (audit-trail; đúng tại thời-điểm ghi @S122)
- **Vì sao có addendum thay vì sửa thân:** request **đang MỞ** ≠ lịch-sử. Bản đã gửi qua `broadcasts/outbox/` thì đóng băng; nhưng để nguyên §3.1 mà không đính chính = **hub adopt đúng cái SE vừa gỡ**.
## A. 🔴 Đính chính điều SAI
**§3.1 viết:** *"**TRI-ACCEPT** (dạng-1 + dạng-2 + dạng-3) là bản vá SE **đang chạy**"* + §3.2 xin hub adopt.
**SAI kể từ S123.** SE đã **RETIRE dạng-3**; sàn hiện-hành = **DUAL-ACCEPT** (dạng-1 + dạng-2). Mark `RC-pqhuy1987-15-07-2026-17-23-10` (Active-High, anh chốt S123).
⇒ **Hub adopt tri-accept = nhập-khẩu đúng nhánh SE gỡ vì nguy-hiểm.**
**Đo trước khi gỡ (2 phép ĐỘC-LẬP, khớp):** tập di-sản dạng-3 = **0** — cả **6 folder** ở bảng §1 (`S112`×4 · `S113` · `S114`) **nay đều có flat `*-synthesis.md`** sau chính `22ea8c5` mà §4 khoe. **Bỏ nhánh dạng-3 ⇒ 0 folder thành orphan.** Repo thật sau retire: **0 orphan / 26 run**.
🔸 **Dạng-2 (C8) GIỮ** — tập di-sản = **5 folder S71**, chưa rỗng.
## B. ✅ Điều nên adopt THAY THẾ — 🔴 **LUẬT RETIRE LEGACY** (tổng-quát, đề-nghị vào KHUNG)
> **Gỡ một nhánh legacy khi tập di-sản của nó RỖNG; giữ khi CÒN người thụ-hưởng.**
> **Miễn-trừ kiểu-C8 (*tha di-sản, cấm viết mới*) hết hiệu-lực ĐÚNG LÚC hết di-sản để tha — không sớm hơn, không muộn hơn.**
⇒ **TRI-ACCEPT là TRẠNG-THÁI QUÁ-ĐỘ, không phải đích.** SE chạy nó **~1 ngày** rồi gỡ khi di-sản cạn. Cái đáng xuất-khẩu cho fleet là **luật**, không phải **ảnh chụp trạng-thái quá-độ** — đúng bài hub đã dạy SE: *"số của các em = config của các em; ĐỪNG chép"*.
🔴 **§3.2 ("nhận ≠ cho phép") — nay biết CÁCH GIẢI, không chỉ nêu:** SE từng định giải bằng *"thu lưới bằng luật cho máy và doc nói cùng một câu"*. **Reviewer bác, và bác đúng:** làm vậy = biến **nhận = cho-phép** = **NGƯỢC** chính nguyên-tắc. Lời giải đúng là **luật retire ở trên** — nhận **trong khi** còn di-sản, gỡ **khi** hết. Căng-thẳng nhận⟂cho-phép **tự tan** khi tập di-sản rỗng, **không cần** ai nhớ để NÊU.
## C. 🔴 Cảnh-báo FLEET — nguy hơn cả R5 gốc, đo được, **ngoài phạm-vi đề-bài**
### C1. Dương-giả **TỰ LÂY QUA TRÍCH-DẪN** — 3 đời THẬT trong 1 wave
| đời | file | |
|---|---|---|
| 1 | `permission-matrix/SKILL.md:16` | defect **THẬT** (vá W4/S122) |
| 2 | `.claude/agents/lead-view-auditor.md:45` | **trích làm ví-dụ** cho class của chính nó → **FP** |
| 3 | `adap-reports/2026-07-14-…harness-24….md:78` | **trích khi đang GIẢI-THÍCH FP đời-2** → **FP** |
⇒ **Mọi doc viết VỀ một dương-giả tự trở thành dương-giả.** **Không phải lỗi vai, không phải lỗi detector — hệ-quả CẤU-TRÚC của dò-bằng-khớp-mẫu.**
**Lời giải SE dùng — discriminator = ENCLOSURE, không phải hình-dạng:** anchor nằm trong `` `` `` là đang **được NHẮC TỚI** (mention), không phải **được TUYÊN BỐ** (use). Đếm backtick bên trái match; **LẺ ⇒ bỏ qua**. Đo **4/4** trên đĩa. Helper **DUY-NHẤT** `Test-Quoted`, mọi matcher prose PHẢI gọi.
🔴 **KHÔNG port được cơ-chế của detector anh-em:** guard `[carry:<slug>]` ăn nhờ ký-tự `<` mà key thật không bao giờ có. Ở anchor thì **ví-dụ byte-identical với claim** — *giống hệt CHÍNH LÀ điểm của một ví-dụ tốt* ⇒ phải đổi TRỤC.
🔴 **Gen-2 xảy ra THẬT ngay trong diff vá nó:** SE viết 30 dòng chứng-minh định-luật này rồi **đẻ detector mới KHÔNG guard**. Reviewer bắt. ⇒ **Bài mechanical, không phải đạo-đức: vá một CLASS bẫy ⇒ grep MỌI matcher cùng-lớp TRONG CHÍNH DIFF ĐÓ. Bài-học nằm-trong-context KHÔNG tự bật.**
### C2. 🔴 **Goodhart đo được: "vá" bằng cách RỜI TẬP-ĐO — và flag-count GIẢM nên trông như thành-công**
W4/S122 "vá" `permission-matrix:16` bằng **đổi FORMAT anchor** (`**Status (post Session 6 …):**` → `**Status (cập-nhật …):**`) thay vì refresh ngày ⇒ khớp **0 pattern** ⇒ **không fire, không cả parse** ⇒ **detector MẤT ĐÚNG positive-control nó được dựng quanh** (pattern#2 sinh ra **CHÍNH VÌ** file này).
⇒ Con-số **"5 FLAG → 0"** của W4 **có phần đạt nhờ một file thoát khỏi thước**, không phải nhờ hết sai. **Không ai thấy, vì số giảm.**
**Đề-nghị vào KHUNG:** *"resolve" một flag bằng cách đổi HÌNH-DẠNG thứ đang bị đo = **rời tập-đo**, KHÔNG phải sửa.* Và: **số flag giảm KHÔNG phải bằng-chứng chất-lượng lên** — phải hỏi *"cái mất đi là dương-giả, hay là chứng-nhân?"*
### C3. **"N/N fault-inject PASS" chỉ chứng các trục ĐÃ CHẠM**
SE báo **6/6 PASS** cho H24-3 — reviewer vẫn tìm ra **2 bug thật**, vì cả 6 ca **chưa hề chạm** 2 trục: (a) doc **trích label người khác** (b) heading có **2 số cùng dòng** (greedy `.*` lấy **CUỐI** ≠ **MAX**). Thử lại 2 trục đó: **6/6**, cả 2 bug lộ ngay.
**Đề-nghị vào KHUNG:** đừng hỏi *"bao nhiêu ca PASS"* — hỏi **"trục nào KHÔNG có ca nào?"**
### C4. **Phép thử đối-xứng cho mọi luật vừa viết**
SE viết lý-do retire là *"doc cấm mà máy vẫn nhận ⇒ gỡ"*. Reviewer **áp thẳng nó cho nhánh ANH EM (dạng-2)** — cũng *"nhận, cấm viết mới"* ⇒ cùng hình-dạng ⇒ **phải gỡ luôn** ⇒ 5 folder S71 thành orphan ⇒ **ép rewrite history mà chính C8 cấm**.
**Đề-nghị vào KHUNG:** **áp luật vừa viết cho nhánh anh-em. Vỡ ⇒ LUẬT sai, không phải nhánh sai.** (Lý-do viết ra ≠ lý-do thật đang vận-hành — SE **đo đúng nhưng viết sai**.)
## D. 📌 Dự-báo FALSIFIABLE cho hub kiểm chéo
Nếu hub **cũng** có doc trích-dẫn anchor-pattern của chính mình, hub sẽ thấy: **thêm 1 doc giải-thích FP ⇒ +1 FP**. SE dự-báo được trước và trúng (`4546` khi adap-report H24 land ở `6dcd457`). **Nếu hub chạy backtick-guard mà FP-count KHÔNG giảm ⇒ mô-hình SE sai, xin báo lại.**
## E. §2 bảng "ĐÃ verify" — 2 dòng nay lỗi-thời
| Điều | @S122 | @S123 |
|---|---|---|
| Dạng-3 nhận bằng máy — fault-inject **9/9** | ✅ | 🧊 **hết nghĩa** — nhánh đã gỡ. **9/9 vẫn đúng với bản S122**; bản S123 = **7/7** (ca chốt: `## Synthesis`-no-flat **S122 IM → S123 FLAG**) |
| Dạng-4 = kẽ CÒN LẠI | ✅ | ✅ **VẪN ĐÚNG** — nhưng **ví-dụ `pe-negative-quote` ĐÃ CHẾT**: `22ea8c5`@14:28 biến nó thành dạng-1, mà §1 viết @`dfa3dae`@**14:48 = SAU 20 phút** ⇒ **stale-at-birth**. **Lập-luận giữ, literal gỡ.** Bài: **neo vào TÍNH-CHẤT, đừng neo TÊN FOLDER** (`acceptance literal tự-lão-hoá`) |
## F. §5 "lead tự bắt" — S123 bồi thêm **2 ca cùng trục**, xin ghi tiếp
3. **Lead báo *"0 orphan / **25** run"*** — thật **26**. Số 25 **chép từ narrative STATUS**, không đo. Verdict (0 orphan) đúng vì vòng lặp quét đĩa; **mẫu-số thì bịa**. H2 bắt: *"**mẫu-số có NGÀY-ĐO** — hỏi 'đếm LÚC NÀO' trước khi so. **Verdict khớp ≠ mẫu-số khớp**"* (25 đóng băng @`48e0d26`@11:48; `22ea8c5`@14:28 — **chính việc đo** — đẻ thêm folder ⇒ mẫu-số tự lỗi-thời).
4. **Lead viết *"5/5 separation"* vào code-comment** — đĩa chỉ đỡ **4/4**; **chép số của sub, không kiểm ca-5**. Reviewer bắt.
⇒ **4/4 ca ở trục đếm-về-việc-mình.** Củng-cố kết-luận §5: *sub bị ép neo từng claim vào `file:line`; lead tự do viết văn.* 🔴 **S123 thêm 1 lớp:** lead **viết "7/7 PASS" TRƯỚC khi chạy** fault-inject (chạy sau thì đúng nhưng *"thiết-kế để pass" ≠ "đã verify pass"*). **cơ-chế, không phải kỷ-luật:** chỉ **ép-neo** mới chặn, **nhắc-nhở thì không**.

View File

@ -126,6 +126,15 @@ foreach ($frag in $ExcludeDirFragments) {
}
# Gather governance MD set ONCE (docs/** + .claude/** *.md), minus excluded.
# VENDOR-SKIP (S123 review): this walks the FILESYSTEM, so it does NOT honour .gitignore.
# Measured: docs/_user-guide/node_modules/ holds 30 gitignored .md that were being scanned
# as if they were governance docs. Zero anchors in them today => zero impact so far, but
# H24-1 sets moc-phai to the MAX anchor in the corpus: ONE vendor README carrying a future
# "**Last updated:** 2027-xx-xx" would push the right edge past every real doc and silence
# the detector for good -- the exact strangle documented at the H24-1 banner below.
# The '(bin|obj|node_modules)' filter already existed further down for the code-scan; it
# was simply never applied here. Same class, one site patched, sibling missed -- which is
# the S123 lesson in miniature: patch a class, then grep every same-class site.
function Get-GovernanceMd {
$dirs = @((Join-Path $RepoRoot 'docs'), (Join-Path $RepoRoot '.claude'))
$all = @()
@ -134,7 +143,9 @@ function Get-GovernanceMd {
$all += Get-ChildItem -Path $d -Recurse -Filter *.md -File -ErrorAction SilentlyContinue
}
}
return $all | Where-Object { -not (Test-Excluded $_.FullName) }
return $all |
Where-Object { $_.FullName -notmatch '[\\/](bin|obj|node_modules)[\\/]' } |
Where-Object { -not (Test-Excluded $_.FullName) }
}
$GovMd = Get-GovernanceMd
@ -527,14 +538,76 @@ $AnchorPatterns = @(
# detectors' baselines, which is not this lane's call.
$TitleFreshSkip = @('\docs\_archive\')
# BACKTICK-GUARD (S123) -- the self-reference trap, measured not guessed.
# A doc that DEFINES the stale-anchor anti-pattern must QUOTE a stale anchor to
# explain it. That quote is byte-identical to a live anchor -- being identical is
# the POINT of a good example -- so a pattern-matcher flags the teacher.
# Measured on disk @S123: 4 H24-1 flags, 2 are this exact case:
# .claude/agents/lead-view-auditor.md:45 quotes the anchor as the EXAMPLE
# for its own class `view-stale-header`
# docs/governance/adap-reports/...harness-24...:78 quotes it while EXPLAINING that
# very false-positive <- 3rd generation
# The defect PROPAGATES BY CITATION: every doc written ABOUT the false-positive
# becomes one. Root instance = permission-matrix/SKILL.md:16 (a REAL defect, fixed W4).
#
# WHY NOT the H24-2 mechanism (charset-discriminator, :670-672): that guard works
# because the format-spec literal "[carry:<slug>]" carries a '<' that a real key can
# NEVER contain. Here there is no such character -- example and claim are byte-equal.
# A DIFFERENT discriminator is required: not the anchor's SHAPE, but its ENCLOSURE.
#
# THE RULE: an anchor sitting inside an inline-code span (`...`) is being MENTIONED,
# not USED (use/mention distinction). Count backticks left of the match; ODD => we are
# inside an open span => quoted example => keep looking. Measured 4/4 ON DISK TODAY:
# BARE -> docs/rag-setup-plan.md:4 . form-engine/SKILL.md:15 = TRUE POSITIVE, still fires
# QUOTED -> lead-view-auditor.md:45 . adap-report...:78 = FALSE POSITIVE, now skipped
#
# 4/4, NOT the "5/5" an earlier draft of this comment claimed (fixed S123 after review).
# The would-be 5th case, permission-matrix/SKILL.md:16, IS NOT ON DISK ANY MORE and does
# NOT fire -- W4/S122 "fixed" it by rewriting the anchor into "**Status (cap-nhat ...):**",
# a form that matches NEITHER $AnchorPatterns entry. So it does not even parse, let alone
# flag. Verified: both patterns return False against that line.
# -> ADJACENT HAZARD, worth naming: that file left the MEASUREMENT SET instead of getting
# fresh. H24-1 thereby lost the exact positive-control it was built around (see the
# anchor_patterns note below: pattern #2 exists BECAUSE of permission-matrix). Flag
# count fell, which reads like success -- Goodhart in its quietest form. Do NOT
# "resolve" a title-stale flag by reshaping the anchor; refresh the date or declare
# the doc frozen-historical.
# -> pattern #2 now matches ONLY form-engine/SKILL.md:15. If that one is ever reshaped
# too, pattern #2 becomes dead code that exists purely to catch quoted examples.
#
# WHY NO head-N-lines scope on top: position is a PROXY, and the backtick rule already
# separates the measured set exactly. Stacking a proxy buys zero measured precision while
# adding a NEW blind spot -- a doc that legitimately anchors below line N goes silently
# unwatched. Mark RC-pqhuy1987-20-06-2026-10-29-11 (proxy-instead-of-signal = false
# economy) applies: use the real signal, not its shadow.
#
# HONEST LIMIT (do not read this as closed): the guard reads INLINE spans only. An
# anchor quoted inside a fenced ``` block has ZERO backticks on its own line => reads
# BARE => still a false positive. Measured 0 such cases today (383 files scanned, 6 anchor
# hits, none inside a fence), so it is left unhandled rather than fixed blind. Same for
# escaped \` and ``double-tick`` spans.
# Test-Quoted -- SHARED by H24-1 (Get-AnchorDate) and H24-3 (session-label).
# Deliberately a FUNCTION, not two inline copies: the citation trap is a CLASS, and the
# S123 review caught H24-3 shipping WITHOUT this guard in the very diff that proved the
# class exists. One greppable definition is how the next detector inherits the fix instead
# of re-earning it. If you add a detector that pattern-matches prose, call this.
function Test-Quoted {
param([string]$Line, [int]$Index)
return ((([regex]::Matches($Line.Substring(0, $Index), '`')).Count % 2) -eq 1)
}
function Get-AnchorDate {
param([string]$Path)
$ls = Get-Content -Path $Path -Encoding UTF8 -ErrorAction SilentlyContinue
if ($null -eq $ls) { return $null }
for ($i = 0; $i -lt $ls.Count; $i++) {
foreach ($rx in $AnchorPatterns) {
$m = [regex]::Match($ls[$i], $rx)
if ($m.Success) {
# Matches (all), not Match (first): one line may carry a quoted example
# BEFORE a live anchor. Taking only the first match would let the example
# shadow the real claim on that line.
foreach ($m in [regex]::Matches($ls[$i], $rx)) {
if (Test-Quoted $ls[$i] $m.Index) { continue } # inside `...` => mentioned, not used
$raw = $m.Groups[1].Value
$dt = [datetime]::MinValue
$ok = [datetime]::TryParseExact($raw, 'yyyy-MM-dd',
@ -584,6 +657,123 @@ else {
}
}
# ---------------------------------------------------------------------------
# H24-3 - session-label lag (do-lech-nhan-phien) [NEW S123]
#
# WHY THIS EXISTS -- H24-1 has a PROVEN false-negative, and this is it.
# docs/STATUS.md:6 read "**Last updated:** 2026-07-15 (S119 ...)" while :35 read
# "## Recently Done (S122 ...)". Measured: S119 x3 hits in the mega-line, S120/S121/
# S122 = 0 hits => the header label had fallen 3 sessions behind the content.
# H24-1 CANNOT see this: it compares DATES, and the date 2026-07-15 was the NEWEST
# in the corpus => 0 flags. The doc was simultaneously the freshest thing on disk
# and wrong about itself.
#
# NOT a one-off: the same :6-lag was caught by hand at S116, S117, S118 and again at
# S123 -- 4 recurrences. Three of those were fixed by bumping the number, which is
# why it came back a 4th time. Per the owner's own S122 finding: what stops a repeat
# is a LAW THAT CAN SEE, not a memory that must remember. So the axis changes from
# DATE (H24-1) to SESSION LABEL (here).
#
# THE RULE: within ONE file, the "(S<N>)" on the **Last updated** line must not be
# older than the newest "(S<M>)" carried by a heading. Both numbers live in the same
# file, so there is no cross-file inference and no ratio-band -- a mismatch is wrong
# BY CONSTRUCTION. Hence MED, not the LOW that H24-1's noisier date-axis earns.
# -> HONEST CORRECTION (S123 review): an earlier draft justified MED with "0 proxy".
# That was WRONG. $labelN is the FIRST regex hit, which is a PROXY for "this file's
# OWN label" -- and it breaks precisely when the file QUOTES someone else's label.
# MED survives because Test-Quoted removes that failure mode, NOT because no proxy
# was ever there. Naming the proxy is the point; pretending it is absent is how the
# next reader stops looking for it.
#
# TWO BUGS THIS DETECTOR SHIPPED AND THE S123 REVIEW CAUGHT -- both worth remembering:
# (a) NO Test-Quoted guard. The same diff that added this detector ALSO added 30 lines
# proving "every doc written ABOUT the false-positive becomes one" -- and then built
# a new prose-matcher without the guard. Generation-2 of the very trap. The canonical
# trigger would have been the S123 adap-report DESCRIBING this detector.
# => the lesson is mechanical, not moral: patch a trap CLASS, then grep every
# same-class matcher IN THAT DIFF. A lesson sitting in context does not self-fire.
# (b) GREEDY '.*' took the LAST "(S<N>" on a line, not the MAX. Isolated repro:
# "## Tong hop (S122 ...) va lich su (S110 ...)" -> regex yielded S110, max is S122
# => could print "[ok] label S115 >= newest heading S110", a false-negative stated
# as a fact about the file. Fixed by scanning ALL matches per line and taking max.
# The 6/6 fault-inject missed it because every case put ONE "(S<N>" per heading:
# N/N PASS proves the axes TOUCHED, never the axis never tried. Ask instead:
# "which axis has no case at all?" (corpus has 0 such headings today => was LATENT).
#
# Measured @S123 on the live corpus (both directions, no tuning):
# docs/STATUS.md label S119 vs max-heading S122 -> 119 < 122 => FLAG (the real defect)
# docs/HANDOFF.md label S122 vs max-heading S84 -> 122 > 84 => silent
# HANDOFF needs NO special case: its only S-heading is an archive pointer
# ("Session detail cu (S84 -> tro ve truoc)"), and a pointer to old sessions is
# exactly what a CURRENT label should outrank. The rule reads that correctly on its own.
#
# HONEST LIMIT: this catches a label that lags its OWN headings. A file whose label
# AND headings are both stale together stays silent -- consistency is not freshness.
# That gap is real and left open rather than papered over with a second proxy.
# ---------------------------------------------------------------------------
Write-Section 'H24-3 - session-label lag'
$SessLabelRx = '\*\*Last updated:\*\*[^(]*\(S(\d+)'
# Heading side is scanned in TWO steps, NOT one regex: '^#{2,}\s' decides "is this a
# heading?", then EVERY '\(S(\d+)' on that line is collected and max-ed. The old
# single-regex '^#{2,}\s+.*\(S(\d+)' looked equivalent and was not -- greedy '.*' made it
# "the LAST (S<N> on the line", which is a different question from "the newest".
$SessHeadingLineRx = '^#{2,}\s'
$SessNumRx = '\(S(\d+)'
$sessChecked = 0
foreach ($f in $GovMd) {
$p = ($f.FullName -replace '/', '\')
$skip = $false
# Same frozen-by-design carve-out as H24-1: an archive's old label IS the record.
foreach ($frag in $TitleFreshSkip) { if ($p -ilike "*$frag*") { $skip = $true } }
if ($skip) { continue }
$ls = Get-Content -Path $f.FullName -Encoding UTF8 -ErrorAction SilentlyContinue
if ($null -eq $ls) { continue }
$labelN = $null; $labelLine = 0
$maxHeadN = $null; $maxHeadLine = 0
for ($i = 0; $i -lt $ls.Count; $i++) {
# LABEL: first UNQUOTED hit wins. Matches (all) + Test-Quoted, so a line that
# quotes an example label before carrying a real one still yields the real one.
if ($null -eq $labelN) {
foreach ($lm in [regex]::Matches($ls[$i], $SessLabelRx)) {
if (Test-Quoted $ls[$i] $lm.Index) { continue }
$labelN = [int]$lm.Groups[1].Value; $labelLine = $i + 1
break
}
}
# HEADING: MAX over ALL unquoted hits ON the line (not the first, not the last).
# $SessHeadingRx anchors '^#{2,}' so it only matches at line start; iterating
# Matches() would re-scan the same line, so strip the anchor and scan the tail.
if ($ls[$i] -match $SessHeadingLineRx) {
foreach ($hm in [regex]::Matches($ls[$i], $SessNumRx)) {
if (Test-Quoted $ls[$i] $hm.Index) { continue }
$hn = [int]$hm.Groups[1].Value
if (($null -eq $maxHeadN) -or ($hn -gt $maxHeadN)) { $maxHeadN = $hn; $maxHeadLine = $i + 1 }
}
}
}
# No label, or no S-heading to compare against => this doc makes no session claim.
if (($null -eq $labelN) -or ($null -eq $maxHeadN)) { continue }
$sessChecked++
if ($labelN -lt $maxHeadN) {
Write-Flag 'MED' ("{0}:{1}" -f (Rel $f.FullName), $labelLine) `
("session-label lag: header label says S{0} but the file's own newest heading is S{1} (line {2}, {3} session(s) ahead)" -f `
$labelN, $maxHeadN, $maxHeadLine, ($maxHeadN - $labelN)) `
'bump the header label to match the newest section, OR drop the session label from the header so it cannot go stale (B1 collapse)'
}
else {
Write-Host (" [ok] {0}: label S{1} >= newest heading S{2}" -f (Rel $f.FullName), $labelN, $maxHeadN) -ForegroundColor DarkGray
}
}
if ($sessChecked -eq 0) {
Write-Host ' [skip] no doc carries BOTH a session label and an S-heading - nothing to compare' -ForegroundColor DarkGray
}
# ---------------------------------------------------------------------------
# H24-2 - carry-age (INFORM-only)
# A [carry:<slug>] key that survives >= M CONSECUTIVE most-recent carry-lines is