--- distill-gen: 1 period: 2026-07 (S93→S129-era, 10 nhóm entry) source-verbatim: archive/2026-07.md (10 nhóm entry, 30.966B, gen-0) pointer-style: substring (Ctrl-F) back-resolve vào archive/2026-07.md; mỗi cụm kết → substring:"" (12 anchor chính máy-verify =1 @S140) fields-per-line: VIỆC · KẾT-LUẬN(+file:line/commit) · BÀI-HỌC · BẤT-NGỜ · [confidence] --- # Gist 2026-07 — investigator-codebase (distilled S140 sleep-compress) ## TỔNG-HỢP (5 ý — mọi số/mốc truy được về CỤM dưới) 1. **Kỳ 07 = PE-feature-heavy (5/10 CỤM).** Invariant kiến-trúc xuyên mọi feature PE mới (âm/multi-winner/range): `winnerQuoteTotal = SUM(Quote.ThanhTien WHERE IsSelected)` DERIVED, KHÔNG mutate `PeWorkItemBudgets` (budget chỉ role-gated PRO/CCM ghi). → CỤM 3/4/5. 2. **Supplier Excel-import 30-field land TRỌN** qua Mig62→64→65 (S104→S114): entity-lean-9-prop → +18-nullable → IsPublic-fail-closed → multi-NCC; prod NCC 20→37; enum thiếu "Cả hai" genuinely-needed. → CỤM 6. 3. **Bài học meta cho harvest (S122):** orphan-authority đo TÊN-FILE ⇒ 8 dương-giả/25 run = 32% (thật mất 0/7) ⇒ nền chuyển folder-scan-by-content. → CỤM 7. 4. **Harness invests (H16→H22) hầu hết PASS/SOUND** nhưng runtime-value thấp dưới all-inherit+Fable (VACUOUS-MET); catch đáng giữ = ghost-wire config-key-defined-but-unread + ledger true-orphan 0/15 lifetime + regex-heuristic-miss. → CỤM 1. 5. **#53 return-garble dai dẳng** (cicd 5/6; structural root = MEMORY LIVE 17.5KB vượt self-target ~17.1K → curate-at-return); recover = diary-trước + SendMessage-resume + em-main-scribe. → CỤM 2. ## CỤM 1 [vừa] — Harness governance adoption invests (H16/H18/H19/H21/H22 + model-tier) **VIỆC:** ground-truth 5 broadcast harness-adopt + landing-map recon. **KẾT-LUẬN:** đa số PASS/SOUND. H19 mapping: reviewer=final-gate `reviewer.md:268-276`, inv-cb=ground-truth-lane `investigator-codebase.md:23-26`; model-tier 12-pt SE-meets-all (11/11 inherit, 0 `[1m]`). H18 measurer 3/3 GLOB-LIVE 0-hardcode; ledger true-orphan-catch 0/15 lifetime. H22 WAL READY_WITH_NUANCES — settings chưa tồn tại → hook CREATE-mới STAGED; engine:402 no-OS-hook = MÔ-TẢ không phải LUẬT. H16 MFE denom dedup-AS-xref=29, codified `mfe-eval.ps1`. **BÀI-HỌC:** (1) phân MÔ-TẢ vs LUẬT trước khi đòi carve-out; (2) ghost-wire 2 class: cron-monthly CronList=0 + config-key defined-but-unread (`memory-budget.json:54-55` script re-hardcode TRÙNG → 0 flag; catch = grep key-name); (3) regex-self-check 0-hit nhưng "lead LUÔN top-model" bắt 5 ACTIVE = regex-heuristic-miss. **BẤT-NGỜ:** VACUOUS-MET — dưới all-inherit+Fable, H19 §4 thêm 0 runtime-delta; value = toggle depth + Fable-outage multi-Opus>single-Opus. [vừa] → substring:"VACUOUS-MET nuance TRUE" · "config-key defined-but-unread" · "READY_WITH_NUANCES" · "regex-heuristic-miss class" · "dedup-by-AS-cross-reference" ## CỤM 2 [vừa] — Session-end verify-lane + feedback-audit **VIỆC:** verify-lane V2 post-flush detector-count (S98) + capture-readiness pre-close (S97). **KẾT-LUẬN:** detector 28→25 (derived-stale 11→8); 8 còn = 100% FP-class count-token soft-net, 0 genuine drift vs canonical 61/89/440/79. Capture CLEAN: #77/#78/#79 present `gotchas.md:1301/1317/1325`; #53-garble ×6 (cicd 5/6); Mig60 wrong-table (query Approvals `:29-31` LIKE) → Mig61 fix Changelogs, đủ 3-file-rule. **BÀI-HỌC:** grep exact-phrase MISS biến-thể ("Fable RESTORED" vs "Fable-restore"); count-token FP nhận diện = so canonical-anchor. **BẤT-NGỜ:** #53 cicd = STRUCTURAL root — MEMORY self-target ~17.5KB → curate-at-return → thinking-step=message-cuối=return-value; fix = archive-cicd-sớm KHÔNG phải instruction. [vừa] → substring:"count-token soft-net" · "cicd MEMORY LIVE=17.5KB" ## CỤM 3 [cao] — PE negative-quote (âm=khoản-trừ, FE-only blocker) **VIỆC:** lens Budget-consumers + edge/precedent/test cho nhập báo-giá ÂM (hội tụ S116). **KẾT-LUẬN:** FE-ONLY blocker — BE/DB nhận âm sẵn. Quote KHÔNG mutate `PeWorkItemBudgets` (chỉ UpdatePeBudgetPro/Ccm role-gated `PeWorkItemBudgetFeatures.cs:105-107/175-177`). 5 consumer đọc SUM(WHERE IsSelected): winnerQuoteTotal `PeFeatures.cs:1188-1191` no-clamp · CCM-threshold `PeWorkflowService.cs:884-893` · giaTri CreateContract per-winner (CÓ THỂ ÂM, BYPASS `GiaTri>=0` `ContractFeatures.cs:46` manual-path-only) · block-B `:904-947` · submit-guard `:196-209` `Sum()<=0` = GUARD DUY NHẤT REJECT (net>0 OK). NO quote-validator (grep⌀) · NO DB CHECK (grep⌀; decimal(18,2) config:131). FE chặn: `parseVnd PeDetailTabs.tsx:51` strip minus · `formatVndInput:52` n>0 · gate `:2226`. **BÀI-HỌC:** quote sống `details[].quotes` KHÔNG `suppliers[].quotes`; precedent OMIT-validator = ExpectedRemainingAmount `PeFeatures.cs:348` + LeaveBalance; sign-aware `VndInlineEdit:1003` tái dùng. **BẤT-NGỜ:** giaTri-âm BYPASS validator (manual-path-only); #81 orthogonal (bool≠sign → no phantom). [cao] → substring:"GUARD DUY NHẤT REJECT" · "details[].quotes" · "NO DB CHECK" · "budget-not-mutated-by-quote" ## CỤM 4 [cao] — PE winner/quote cardinality (multi-winner per-hạng-mục) **VIỆC:** truy 3 trục cardinality winner + multi-winner per-hạng-mục (S114) + BE-consumer-audit + PE-recon (S69→S76). **KẾT-LUẬN:** 3 trục — `SelectedSupplierId` single legacy · Mig58 `IsWinner` WHOLE-SUPPLIER liên-danh · `Quote.IsSelected` per hạng-mục×NCC (S114 LIVE qua Mig65 re-key = CARDINALITY-CHANGE #2, latent-hook Mig12 nay bật). 5 money-consumers keyed off IsSelected (winnerQuoteTotal/submit-guard/ccm-threshold/giaTri/block-B), ~6 test-file. Budget-gate = PURE ROLE no-phase (`canEditPro/Ccm :800-801`); V2-routing IGNORES roles (=ApproverUserId) 100% LINEAR; submission-count-lock NEXISTS. **BÀI-HỌC:** đổi cardinality = grep MỌI money-consumer (sửa write-site sót read-site → vỡ feature). Open: N-win 1 hạng-mục split khối-lượng hay full-price (schema thiếu per-winner volume). **BẤT-NGỜ:** re-key = cardinality-change thứ-2 (Mig12 latent 12-Mig cũ nay bật). [cao] → substring:"CARDINALITY-CHANGE #2" · "5 money consumers keyed off IsSelected" · "100% LINEAR" ## CỤM 5 [cao] — PE finalize mechanism + lũy-kế RCA + approved-price-range **VIỆC:** 3 cơ chế finalize + display-lie #78 + ApprovedPrice-range (S117) + lũy-kế RCA + FROZEN-Mig59 patchwork (S87→S89). **KẾT-LUẬN:** ApprovedPrice WRITE = 1-site `ApplyApprovedPriceOnFinalize` (`PurchaseEvaluationWorkflowService.cs:951-966`, allow-list `:950`) gọi 3 nhánh DaDuyet (:858/:896/:928); skipToFinal `:820` chỉ dời pointer. HĐ-gen KHÔNG đọc ApprovedPrice (GiaTri=SUM IsSelected `CreateContractFromEvaluationFeatures.cs:88-100`) → range 0-impact. Lũy-kế RCA: A/018 KHÔNG DaDuyet (không tick opt-in, default UNCHECKED `PeWorkflowPanel.tsx:57`) → advance CEO; filter `Phase==DaDuyet` `PeFeatures.cs:906` ĐÚNG. 3 cơ chế chồng: AllowApproverFinalize (Mig58) ≠ finalizeByCcmDelegation (Mig53/54) ≠ skipToFinal (Mig31). **BÀI-HỌC:** KHÔNG nới filter lũy-kế; fix = pointer-aware endsBeforeCeo. FROZEN AREA-4: LATENT #73-class HoSoLink absolute-set `PurchaseEvaluationFeatures.cs:280` + PeHeaderForm PUT OMITS → 2-PUT mutually-destructive, no preserve-test. **BẤT-NGỜ:** DISPLAY-LIE nửa-còn-lại #78 — non-DaDuyet endsBeforeCeo=config TRUE bất chấp pointer (detail `:1152-1154` · list `:647-651`) → chip "Kết thúc·CCM" khi phiếu ở inbox CEO. [cao] → substring:"ApplyApprovedPriceOnFinalize" · "DISPLAY-LIE nửa-còn-lại" · "coexist AUTO-first" ## CỤM 6 [cao] — Supplier Excel-import 30-field (Mig62→65) **VIỆC:** audit GAP Excel-30-col → schema-invest → import v1/v2 → multi-NCC (S104→S114, WF `wf_5ac2cdb0`). **KẾT-LUẬN:** entity CỰC LEAN 9 domain-prop (`Supplier.cs:5-16`); GAP 30 = 6✅/7⚠️/17❌; seed crams NĐD/bank vào Note (proof thiếu home; UNGATED :128 vs demo GATED :117 #75). Land: Mig62 +18 nullable (27/27 bijective SHIPPED S112) → Mig64 IsPublic fail-closed → Mig65 multi-NCC; ClosedXML 0.105.0; dedup Code CI-collation normalize-TRƯỚC-store; 3 SELECTION-consumers ALL hit `GET /suppliers` (SuppliersPage:83/PeDetailTabs:2222/ContractCreatePage:321); write-guard backstop `ContractFeatures.cs:64`+`PurchaseEvaluationSupplierFeatures.cs:49`; ExpectedHeaderTokens 30-token baked `SupplierExcelImportService.cs:35-68`. Prod 20→37 NCC. **BÀI-HỌC:** reuse-existing-cols > parallel-table; blind-set `UpdateSupplierCommand.cs:49-57` = latent#73; DISPLAY-joins by SupplierId MUST NOT filter (chỉ SELECTION filter IsPublic); NAS-precedent = HoSoLink Mig52. **BẤT-NGỜ:** enum `SupplierType.cs:3-10` thiếu "Cả hai" genuinely-needed; import authz-mismatch BE Roles vs FE open. [cao] → substring:"Entity CỰC LEAN 9 domain-prop" · "ClosedXML 0.105.0" · "27/27 bijective" · "Prod 37 NCC" · "30-token baked" · "3 SELECTION consumers ALL hit" ## CỤM 7 [cao] — S122 retro-harvest: false-orphan-by-naming (meta) **VIỆC:** đọc 7 run-folder "orphan" + đối chiếu git run ĐỊNH-làm vs THẬT-land (`wf_5ce007c4-980`, 7/7 done, 1 RỖNG schema-fail). **KẾT-LUẬN:** 0/7 việc mất — 7/7 ĐÃ XONG, chỉ ghi synthesis SAI CHỖ. 6/6 lane neo SHA thật 0-garble: `a829d0d` · `e100ef0`+Mig63 · `5fa11b5`+Mig64 · `d436af2`+Mig65 · `88368fd` (S116 KHÔNG phải S113). Orphan-authority đo TÊN FILE ⇒ 8 dương-giả/25 = 32%. `8fa2fcc` khoe "[H2 gate]" mà `--stat` KHÔNG chạm folder. **BÀI-HỌC:** (a) đo ordinal migration bằng sorted-listing KHÔNG tin nhãn doc; (b) phân hash-lệch vs invariant-vỡ (`git diff --no-index` exit=0 = 2 app identical dù SHA evolve `3e16dba5`→`617b0aa0`); (c) truy owner-decision VÀO CODE. **BẤT-NGỜ:** tiền-đề trong memoryPack CÓ THỂ SAI (lead bơm "S113" sai, thật S116) — lane tự truy git không bị dắt; lane RỖNG ≠ mất (per-turn≠per-task). [cao] → substring:"orphan-authority đo TÊN FILE" · "1 RỖNG schema-fail" · "đo ordinal migration bằng sorted-listing" · "tiền-đề trong memoryPack CÓ THỂ SAI" ## CỤM 8 [thấp — GIỮ vì mang #66] — Office/HRM recon (S65→S69) **VIỆC:** recon Office/HRM. **KẾT-LUẬN:** 21 `Off_*` keys; 10 office pages SHA-mirror (exc 2 admin-only); golive-flip = remove `RevokeTemporarilyHiddenModulesAsync` `DbInitializer.cs:2040`; Dept FLAT pre-Mig51; NamGroup PURO = UI-skin. **BÀI-HỌC:** golive-flip là 1-điểm. **BẤT-NGỜ:** gotcha #66 — `index.css h1-4{color}` OUTSIDE @layer → TW-v4 unlayered wins → heading MUST `text-white!`. [thấp] → substring:"RevokeTemporarilyHiddenModulesAsync" ## CỤM 9 [vừa] — S105 BVAAU cross-repo auth RCA **VIỆC:** RCA auth BVAAU. **KẾT-LUẬN:** Q1 root = FE Home MÙ session (bundle relative `/api` trên site TĨNH `web.config` loại `^/api/` → 404 → anonymous); fix API_BASE-absolute `51c69fb` LIVE. Q2 CRM-gate hở 2 tầng (FE soft + API `enforceCrmGate:false`) → flip `AUTH_ENFORCE_CRM_GATE=true`. Q3 Zalo "User_ID" KHÔNG UI. **BÀI-HỌC:** class "hub+site-tĩnh relative-/api chết im prod"; #53-garble-7 → SendMessage-resume recover. **BẤT-NGỜ:** gate hở 2 tầng ĐỘC-LẬP — vá 1 tầng không đủ. [vừa] → substring:"chết im prod" ## CỤM 11 [vừa — BỔ SUNG theo Fidelity-gate S140] — Governance recon 06-20 + S71 run-trace recon **VIỆC:** 2 recon-cluster nền governance (verbatim :28 + :31 — gate bắt sót ở draft đầu). **KẾT-LUẬN:** (a) landing-map 06-20: `harness-11-engine.md` = CANONICAL engine (D5/6/7 safety-tier + D8 one-dir-lock + D9 single-writer + D10 Bash-residual + CAVEAT no-OS-hook); `error-ledger.md` = §L.a AS-1..13 + §L.b 7-step; rules §6.6 = objective-criteria; report-before-stamp ⊂ D7 (extend not duplicate → C3 vocab-fork). (b) Harness-14 = age/recency-decay KHÔNG căn-cứ cắt feature; `memory-budget.json` 0 decay, `keep_floor=5` = newest-protect drains-OLDEST; EVAL `golden-set-solution_erp.jsonl` 14q recall@5≥0.7 weekly-manual. (c) S71: H8 all-inherit FULLY adopted 2 layer (12/12 frontmatter + hmw.js resolveModel); **run-trace "TRACKED" = 2-level** (`git check-ignore` eligible vs `git ls-files` committed — model chỉ hoạt động post `git add`); G-015 containment shift (H2 "mọi tracked=vi-phạm" → H10 "tracked NGOÀI run-folder+code-disjoint=vi-phạm"); path-trap: bare `runs/` từ repo-root = 0 → thật `.claude/workflows/runs/` (22 tracked). **BÀI-HỌC:** engine canonical + ledger AS-class + age≠proxy là NỀN đọc trước mọi adopt; TRACKED phải hỏi "level nào". **BẤT-NGỜ:** anti-downgrade generic rule grep 0 (H8 PARTIAL ở tầng luật). [vừa] → substring:"run-trace \"TRACKED\" = 2-level" · "G-015 containment shift" · "keep_floor=5" · "golden-set-solution_erp.jsonl" ## CỤM 10 [vừa] — S129 adap errata EOL 3-lane **VIỆC:** adap 2 errata EOL sweep 3-lane (`wf_3fccd7d1`). **KẾT-LUẬN:** SE 0 defect-site (counter `agent-frontmatter-eol-check.ps1` byte-level pre-satisfy); filter erratum thiếu docx/xlsx = 13 dương-giả trên SE (tailor-per-class); drift thật duy nhất `mfe-eval.ps1:204` Set-Content UTF8 = BOM+CRLF; nấc thật = 4 gated + 3 discipline (đừng kê "7/7" phẳng). **BÀI-HỌC:** `git log -- |tail -1` = FIRST-touch KHÔNG phải policy-landing (`08c7036` vs `92de58f`); #53 WRITE-lane 2/3 → journal cứu trọn. **BẤT-NGỜ:** story "40 = +1 agent mới" BỊA — số scoped=39, delta = skills/README ngoài glob (meta-count class). [vừa] → substring:"byte-level pre-satisfy" ## COVERAGE-TOKENS (per-file đóng-kín — nguồn: archive/2026-07.md của investigator-codebase) **Gotcha:** #53(×6, cicd 5/6 + S105-7 + S110 + S129 2/3) · #57 · #66 · #70 · #73-class (HoSoLink 2-PUT · blind-set UpdateSupplierCommand) · #75 · #77/#78/#79 (`gotchas.md:1301/1317/1325`) · #78 DISPLAY-LIE · #81 orthogonal. **SHA:** `a829d0d` `e100ef0` `5fa11b5` `d436af2` `88368fd` `8fa2fcc` `3e16dba5`→`617b0aa0` `51c69fb` `08c7036` `92de58f` · bundle `mEGqlNWc`/`Dnrp4PU1`(#484) `CeTA7Z82`(#483). **Mig:** 12(latent→LIVE) 15 31 47 52 53/54 58/59 60→61(wrong-table) 62(+18) 63 64 65(re-key) 66(ordinal 65/66). **Guard:** submit-guard `Sum()<=0` `:196-209/:206` · CCM-threshold `:884-893` · GiaTri>=0 manual-only `ContractFeatures.cs:46` · ApprovedPrice allow-list `:950` · NO-quote-validator⌀ · NO-DB-CHECK⌀ · write-guard `ContractFeatures.cs:64`+`PurchaseEvaluationSupplierFeatures.cs:49` · Code UNIQUE-filtered `SupplierConfiguration.cs:24` · 30-token baked `:35-68` · Smart-Friend `reviewer.md:268-276` · byte-counter eol-check. **Root-cause:** Mig60-wrong-table · lũy-kế-A/018-non-DaDuyet-default-UNCHECKED `PeWorkflowPanel.tsx:57` · BVAAU-relative-api-static-site · cicd-#53-structural-17.5KB · ghost-wire-config-key `memory-budget.json:54-55` · cron-CronList=0. **Key anchors:** `PeFeatures.cs:1188-1191/:904-947/:906/:800-801/:348` · `PeWorkflowService.cs:196-209/:884-893` · `PurchaseEvaluationWorkflowService.cs:951-966/:950/:858/:896/:928/:820` · `PurchaseEvaluationFeatures.cs:280/:1152-1154/:647-651` · `PeWorkflowPanel.tsx:57` · `PeDetailTabs.tsx:51/:52/:2226/:2222` · `CreateContractFromEvaluationFeatures.cs:88-100` · `Supplier.cs:5-16` · `SupplierType.cs:3-10` · `SupplierExcelImportService.cs:35-68` · `UpdateSupplierCommand.cs:49-57` · `DbInitializer.cs:2768-2787/:128/:117/:2040` · `investigator-codebase.md:23-26` · `hmw.js:38/:97` · `mfe-eval.ps1:204` · `engine:402`. **WF-ID:** wf_50a817ce-a69 · wf_4c63e1bd · wf_5ce007c4-980 · wf_3fccd7d1 · wf_5ac2cdb0. **Facts:** prod 20→37 NCC · canonical 61/89/440/79 (S98-era) · MFE denom=29 · ledger 0/15 lifetime · 8 dương-giả/25=32% · 13 dương-giả EOL · scoped=39. **+CỤM 11 tokens:** `harness-11-engine.md` D5-D10 · `error-ledger` AS-1..13 · `keep_floor=5` · `golden-set-solution_erp.jsonl` 14q · G-015 · TRACKED-2-level · path-trap 22-tracked · `PeSuggestedPriceFeatures.cs:153-199` (AREA-2 anchor — gate bổ). **Drop `thấp`:** 0 cụm — nhưng khai lịch-sử trung thực: draft đầu SÓT 2 recon-cluster (:28/:31), Fidelity-gate S140 bắt (FAIL) → CỤM 11 bổ đủ; "0 drop" chỉ đúng từ bản này.