[CLAUDE] Docs: S125 adap tien-de-vong4 — relabel token CAN-TREN + hash-verify byte-safe + dinh-chinh hub + fable-real review/invest checklist

- adap broadcast phuong-phap-dem-token (type:new): negative-control tai lap 3-probe (notice-N = heuristic char-dem, KHONG phai token that) -> relabel STATUS:41 + HANDOFF:5 x2 + do-token report ADDENDUM (dai [31K byte/4 - 70,9K notice] => lead-share [8,2-18,7]%)
- false-TAMPER RCA: PS5.1 Get-Content -Raw doc UTF-8-no-BOM bang ANSI -> va check-email/send-email byte-safe + verifier-suspect-first; stamp hub verify OK bang stamp_verify.py (exit-0)
- email dinh-chinh hub (58f5afd8, selftest exit-0 x2) + adap-report + adap-request hash-verify-byte-safe-decode + FYI 2 broadcast no-stamp
- STAGE-2: git mv 7 broadcast processed -> inbox/ai_infra/ (root sach)
- fable-real review+invest (vai compound reviewer+inv-cb): run-trace + spec 3-muc + checklist A-D cho hmw @Opus 4.8 MAX; va stale all-inherit fable-real.md:37 + fable-clone.md:43
- hook-curate inv-cb MEMORY 23,9->16,9KB moved-not-cut (14 dong + 2 digest -> archive/2026-07.md)
- h18 memory +sibling-test-2-chieu; monitor self-compact S125-start + counter tick=4

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-07-16 13:29:43 +07:00
parent 3aacdf9d1c
commit 010d12c5f8
29 changed files with 261 additions and 41 deletions

View File

@ -56,7 +56,7 @@ Bearer từ `POST api.solutions.com.vn/api/auth/login` → status matrix expecte
- **DB:** Dev `SolutionErp_Dev` · Design `SolutionErp_Design` (distinct) · Prod `.\SQLEXPRESS`/`SolutionErp`/`vrapp` via SSH `vietreport-vps`
- **Migration path:** `src/Backend/SolutionErp.Infrastructure/Persistence/Migrations/*.cs` (⚠️ NOT root `/Migrations/`). **57 mig**, last `AddPeSuggestedPriceNotes`.
- **Counts S80 (canonical docs/STATUS.md):** 57 mig · **88 SQL tables** (count `.ToTable()` ModelSnapshot NOT DbSet) · ~253 endpoints · 68 FE pages · **54 menu keys** (BE `MenuKeys` const) · **354 test** (45 Domain + 309 Infra) · **71 gotchas** (format `### N.`) · 30 user-memory · 6 skills · **11 sub-agents** (all-inherit H8)
- **Counts S80 (canonical docs/STATUS.md):** 57 mig · **88 SQL tables** (count `.ToTable()` ModelSnapshot NOT DbSet) · ~253 endpoints · 68 FE pages · **54 menu keys** (BE `MenuKeys` const) · **354 test** (45 Domain + 309 Infra) · **71 gotchas** (format `### N.`) · 30 user-memory · 6 skills · **11 sub-agents** (S80-snapshot — roster nay 14 vai + worker-tier-pin S124; số sống đọc STATUS.md)
- **Tech:** .NET 10 Clean Arch (Api→Application←Domain + Infra) + CQRS MediatR + EF Core 10 + 2 React 19 Vite 8 TS 6 (fe-admin :8082 + fe-user :8080) + SQL Server + Gitea CI + IIS
- **Prod:** api/admin/eoffice.solutions.com.vn · Gitea `git.baocaogiaoduc.vn/vietreport-admin/solution-erp` (Actions API `/api/v1/repos/.../actions/tasks` NOT `/runs` 404, cache stale ~2min gotcha #46 — cross-check VPS mtime). Bundle live admin `CsJetgZH`/user `BVS0ApIm` (Run #330).
- **Auth:** `admin@solutions.com.vn/Admin@123456` (full) / `nv.test@solutions.com.vn/TestUser@123456` (Drafter). Response `accessToken`+`refreshToken`+`user`. Password ≥12 chars.
@ -75,21 +75,22 @@ Bearer từ `POST api.solutions.com.vn/api/auth/login` → status matrix expecte
## 📅 Recent activity (compressed — full verbatim → `archive/2026-06.md` via `archive/_INDEX.md`)
- **S125 (2026-07-16) adap-review invest-lens [engine:fable-real single deep-pass · vai compound anh gán reviewer+inv-cb · chạy inline-lead]:** probes: auto-memory **50 tracked/0 porcelain** (R6 git-track ĐẠT — còn WRITE-path post-restart) · agents **14/14 `model:opus`+`effort:max`** (file 15=README benign) · 6/6 product-carry còn HANDOFF · H24 counter=4 tick-S125 content-addressed (light@9/deep@18, 0 class-repeat≥3) · Stop-hook wal-flush KHÔNG fire per-turn phiên này (HEAD đứng `3aacdf9` suốt) · residue `all-inherit` floor-sống chỉ 2: `fable-real.md:37` (gap thật — file NGOÀI sync-list S124) + `fable-clone.md:43` (asym trong-file, :57 updated :43 sót) — CẢ 2 vá S125; `session-start.md:52`+`hmw.js` comments = lineage GIỮ. Hub-side: outbox/all=65, `stamp_verify.py` 3-OK / 2-NO-DECLARED-SHA (do-token·h17-bookend) · hub ĐÃ CÓ script-verify s76 `check_email_pull.py` (hub check-email.md:31) — bootstrap-copy sister CHƯA mang. Tag `[s125, adap-review, verifier-suspect-first, worker-tier-pin-residue]`.
- **[→ archive/2026-07.md] 2026-07-13 PE negative-quote 2× LENS (Budget-consumers + edge/precedent/test)** — key giữ: budget-not-mutated-by-quote (architectural) · submit-guard `Sum()<=0` `:206` duy-nhất reject · no-quote-validator · parseVnd strip-minus · giaTri-âm bypass validator · gotcha #81 orthogonal-dấu. Executed S116; anchors sống trong S116/S117 entries.
- **[→ git 07-12 · superseded by S115 entry above] PE per-HANGMUC multi-winner LENS BE-consumer-audit:** 3 cardinality axes — `SelectedSupplierId` single (legacy) · Mig58 `IsWinner`=WHOLE-SUPPLIER liên-danh · `Quote.IsSelected` per hangmuc×supplier (S114 made LIVE). 5 money consumers keyed off IsSelected now (winnerQuoteTotal/submit-guard/ccm-threshold/giaTri/budget-block-B). ~6 test files. Tag `[pe-multiwinner, per-hangmuc, quote-isselected, cardinality]`.
- **[→ git 07-12] Supplier-import-v2 LENS-3 FE-dialog-UX:** SupplierImportDialog+SuppliersPage SHA-identical 2-app; dialog 2-step preview→confirm round-trips `preview.rows` → per-row edit feasible; `ExpectedHeaderTokens` 30-token baked `SupplierExcelImportService.cs:35-68` = template single-source; Mã NCC=Code; import authz-mismatch BE `[Roles=Admin,CatalogManager]` vs FE `Suppliers/Create` open. Tag `[s112, supplier-import-v2, fe-lens3, import-authz-mismatch]`.
- **[→ git+session-log 07-07] S105 BVAAU cross-repo auth RCA:** Q1 root-cause = FE Home MÙ session (bundle cũ relative `/api` trên site TĨNH `web.config` loại `^/api/` `/api/auth/me` 404 → anonymous); fix API_BASE-absolute `51c69fb` LIVE. Q2 CRM1 hở 2 tầng (FE soft + API `enforceCrmGate:false`) → flip `AUTH_ENFORCE_CRM_GATE=true`. Q3 Zalo "User_ID" KHÔNG có UI. Class **"hub+site-tĩnh relative-`/api` chết im prod"**; #53-garble-7 → SendMessage-resume recover. *(verbatim → archive/2026-07.md)*
- **[→ 07-12 LENS-3 entry above + git 07-06] S104 Supplier 30-field 🅰️ schema-invest WF `wf_5ac2cdb0`:** SUPERSEDED anchors giữ: ClosedXML 0.105.0 = Excel-standard (KHÔNG OpenXml-raw, `csproj:8`); reuse-existing-cols>parallel; `UpdateSupplierCommand.cs:49-57` blind-set=latent#73; seed fill-nulls-if-exists (`DbInitializer.cs:2781`); `SupplierDto` hand-projected 2-site (`GetSupplierQuery.cs:21`+`ListSuppliersQuery.cs:48-50`); `Dialog.tsx:48` max-h-70vh; extract `ui/PathLink.tsx`. Chốt Mig 62 +18 nullable. *(verbatim → archive/2026-07.md)*
- **[→ archive/2026-07.md verbatim + digest @S125] S105 BVAAU auth RCA:** class **"hub+site-tĩnh relative-`/api` chết im prod"** (web.config loại `^/api/` → 404 → anonymous); fix API_BASE-absolute `51c69fb`.
- **[→ archive/2026-07.md verbatim + digest @S125] S104 Supplier 30-field schema-invest:** ClosedXML 0.105.0 chuẩn (KHÔNG OpenXml-raw) · `UpdateSupplierCommand.cs:49-57` blind-set=latent#73 · SupplierDto hand-projected 2-site · chốt Mig 62 +18 nullable.
- **[→ git+session-log 07-03 + adap-reports] S101 H19-adopt Lane-2:** map reviewer=review-gate / investigator=ground-truth-lane; 12-pt tier-checklist ALL✅ (11/11 inherit, C3 no-`[1m]`-in-frontmatter); toggle-marker MUST copy `.gitignore:87` last-match placement; VACUOUS-MET all-inherit+Fable. *(verbatim → archive/2026-07.md)*
- **[→ git+session-log 07-02 + adap-reports] S100 H18-adopt WF1:** ⭐ ghost-wire-class **config-key-defined-but-unread** (`budget.json:54-55` script re-hardcode same-value→no-flag; catch=grep-key-across-scripts); cron=ghost-wire (CronList=0); `_ledger` orphan-catch 0/15-lifetime. *(verbatim → archive/2026-07.md)*
- **[→ git 07-12 · Mig64 IsPublic shipped since] Supplier import-v2 LENS-4 public/visibility recon:** 3 SELECTION consumers ALL hit `GET /suppliers` ListSuppliersQuery (SuppliersPage:83 · PeDetailTabs:2222 · ContractCreatePage:321); DISPLAY-of-existing joins by stored SupplierId MUST NOT filter (ContractFeatures/PeFeatures/Dashboard); write-guard backstops `ContractFeatures.cs:64`+`PurchaseEvaluationSupplierFeatures.cs:49`. Rec fail-closed default + stored `IsPublic bit`. Tag `[s112b, supplier-visibility, fail-closed-default]`.
- **[all verbatim → archive/2026-07.md] S98 verify-lane (detector 28→25, 8 derived-stale=FP vs canonical 61/89/440/79; grep exact misses README variant) · S97 feedback-audit (#77/#78/#79 `gotchas.md:1301/1317/1325`; #53-garble×6=cicd MEMORY-self-target ~17.5KB; Mig60 wrong-table Approvals→Mig61 Changelogs) · 07-01 Supplier-predecessor SUPERSEDED by 07-06 · S93 MFE denom=marks/AS/guards dedup-AS-xref=29, coverage exact-id OR ≥2-content-word.**
- **PE FROZEN-Mig59 patchwork + go-live recon cluster (S87→S89, 8 entries verbatim → `archive/2026-06.md`):** key catches — AREA-4 **LATENT #73-class BUG** HoSoLink absolute-set `PurchaseEvaluationFeatures.cs:280` but PeHeaderForm PUT OMITS→clears (2 PUT mutually destructive, no preserve-test) · AREA-3 AllowApproverFinalize AUTO(Mig58)+finalizeByCcmDelegation OPT-IN(Mig54) coexist AUTO-first, ApplyApprovedPrice allow-list {Ncc,ProMin,ProMax,Ccm} · AREA-2 budget-matrix band-aid `PeSuggestedPriceFeatures.cs:153-199` PRO=drafter vs CCM=role authz-asymm · AREA-6 FE all 6-comp+3-pages SHA-mirror 2-app, #70 stale-echo · S89 AllowApproverFinalize-NOTE **GAP BE-field-MỚI** (flag only `currentLevelOptions`, DTO no-carry→expose EndsBeforeCeo) · 06-24 winner=SINGLE `SelectedSupplierId` derived-3-site, terminal=per-Level bool · 06-23 urgent authz asymmetric, PE-create dropdown `PeWorkspaceCreateView.tsx:94`.
- **2026-06-20 governance recon (both → archive/_INDEX):** (a) landing-map — `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.md §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; detectors canonical-anchor-vs-STATUS+disk 0 age-window; EVAL `golden-set-solution_erp.jsonl` 14q recall@5≥0.7 weekly-manual; anti-downgrade=H8 all-inherit PARTIAL (no generic rule grep 0).
- **PE recon cluster (S69→S76, verbatim → _INDEX):** "Giá chào thầu" mục-c=`WinnerQuoteTotal`=SUM(Quote.ThanhTien WHERE supplier==Selected) DERIVED 3-site; Budget gate=PURE ROLE no-phase (`canEditPro/Ccm` `PurchaseEvaluationFeatures.cs:800-801`); submission-count-lock NEXISTS (grep 0); Value-threshold HOOK B=`ApproveV2Async :816-845`; PRO/CCM/CEO=`Procurement/CostControl/Director` shorthand; V2 routing IGNORES roles (=ApproverUserId) 100% LINEAR.
- **Office/HRM recon cluster (S65→S69, verbatim → _INDEX):** 21 `Off_*` keys, 10 office pages `{fe-admin,fe-user}/src/pages/office/` SHA-mirror (exc MyAttendance+AttendanceReport admin-only); golive-flip=remove `RevokeTemporarilyHiddenModulesAsync` `DbInitializer.cs:2040`; Employee master-detail EXISTS, Dept FLAT pre-Mig51; NamGroup PURO=UI-skin hardcoded-navTree; **gotcha #66** `index.css h1-4{color}` OUTSIDE @layer→TW-v4 unlayered wins→heading MUST `text-white!`.
- **Governance/Harness recon cluster (S71, → _INDEX):** H8 all-inherit FULLY adopted both layers (12/12 frontmatter + hmw.js resolveModel); **run-trace "TRACKED" = 2-level** (`git check-ignore` eligible vs `git ls-files` committed — model works only post `git add`); G-015 containment shift (Harness-2 "mọi tracked=vi-phạm" → H10 "tracked NGOÀI run-folder+code-disjoint=vi-phạm"). **path-trap:** bare `runs/` from repo-root = 0 → actual `.claude/workflows/runs/` (22 tracked). detector refine(b) = `.claude/hooks`/`.claude/scripts` not-exist (now S75 has `scripts/governance-detectors.ps1`).
- **[→ archive/2026-07.md @S125 + archive/2026-06.md] PE FROZEN-Mig59 + go-live recon (S87→S89):** giữ nóng ⭐ LATENT #73-class HoSoLink PUT-clears (`PurchaseEvaluationFeatures.cs:280` vs PeHeaderForm PUT omits, no preserve-test) · 3 cơ-chế finalize coexist AUTO-first · budget-matrix authz-asymm PRO=drafter/CCM=role (`PeSuggestedPriceFeatures.cs:153-199`).
- **[→ archive/2026-07.md @S125 + _INDEX] 2026-06-20 governance recon:** `harness-11-engine.md`=CANONICAL (D5-D10) · `error-ledger.md` §L.a/§L.b · H14 age-decay KHÔNG căn-cứ cắt feature · EVAL golden-set 14q weekly-manual.
- **[→ archive/2026-07.md @S125 + _INDEX] PE recon (S69→S76):** WinnerQuoteTotal DERIVED 3-site · Budget gate PURE-ROLE (`PurchaseEvaluationFeatures.cs:800-801`) · V2 routing IGNORES roles (=ApproverUserId) 100% LINEAR.
- **[→ archive/2026-07.md @S125 + _INDEX] Office/HRM recon (S65→S69):** 21 `Off_*` keys · 10 office pages SHA-mirror · golive-flip=remove `RevokeTemporarilyHiddenModulesAsync` (`DbInitializer.cs:2040`) · **gotcha #66** `index.css` ngoài @layer → heading cần `text-white!`.
- **[→ archive/2026-07.md @S125 + _INDEX] Governance/Harness recon (S71):** run-trace TRACKED = 2-level (`check-ignore` eligible vs `ls-files` committed) · path-trap `.claude/workflows/runs/` (bare `runs/`=0) · G-015 containment H10.
- **[→ git pre-S60]** S60 recon#2 V2-engine-map (ApproveV2Async:446-634 guard+UPSERT+advance; skipToFinal F2:561-602 precedent) · S60 PE Section-3 submit-guard ROLE-only. Full text git.
- **[→ archive/2026-06.md + git]** S52 P11-D/E/F 6-gap recon · S50 HrmConfigs add-kind 11-spot · S51 gotcha #57 EXT reachability (curated S59).
- **[→ archive/2026-05-q4.md + git d2f52ba]** S29-S37: clean-room > NamGroup-port verified 4× · Pattern 12-bis cross-module mirror · FK+freetext dual-write.
@ -101,22 +102,16 @@ Bearer từ `POST api.solutions.com.vn/api/auth/login` → status matrix expecte
---
## S117 PE giá-chốt RANGE Min+Max invest (fable-real single, 07-14)
- ApprovedPrice WRITE = 1 site duy nhất `ApplyApprovedPriceOnFinalize` (`PurchaseEvaluationWorkflowService.cs:951-966`, allow-list :950) gọi tại 3 nhánh DaDuyet :858 level-finalize / :896 ccm-delegation / :928 all-steps-done (skipToFinal :820 chỉ dời pointer, KHÔNG finalize-site thứ 4). READ prod = detail-DTO ONLY (`PurchaseEvaluationFeatures.cs:1230``PurchaseEvaluationDtos.cs:285`) + FE display `PeDetailTabs.tsx:1712/:1850-1863`. ⭐ **HĐ-gen KHÔNG đọc ApprovedPrice** — GiaTri=SUM Quote.IsSelected per-winner (`CreateContractFromEvaluationFeatures.cs:88-100` LOCKED A1/D4) → range 0-impact contract/lũy-kế/list. Rec model A: +1 col nullable `ApprovedPriceMaxAmount` + source token `ProMinMax` = radio thứ-5 (chỉ khi cả Min+Max present), no backfill, phiếu cũ nguyên. PRO-entry đã enforce Min≤Max (`PeSuggestedPriceFeatures.cs:38-40`). Panel+DetailTabs SHA-mirror 2-app NHƯNG `types/purchaseEvaluation.ts` KHÔNG mirror (SHA differ) — edit riêng từng app. Latent edge: winnerQuoteTotal subset-selected có thể ÂM (S116) vs validator `ApprovedPriceAmount>=0` `:501` → transition reject khó hiểu. WIP S117 uncommitted CÙNG file PurchaseEvaluationFeatures.cs (endsBeforeCeo pointer-aware :642/:768/:1157) — vùng khác, merge-safe. `[s117, pe-approved-price-range, prominmax]`
## S117 — PE lũy-kế "không bắt sau duyệt" RCA (fable-real single deep-pass)
- **2026-07-14** VERDICT: phiếu nguồn A/018 KHÔNG hề DaDuyet — Chương (Bước2 Cấp2 `AllowApproverFinalize`, badge "Duyệt thay CEO" = CONFIG-display `PeWorkflowPanel.tsx:364`) duyệt KHÔNG tick ô OPT-IN "Cấp này KẾT THÚC" (S97 Part1 đảo default UNCHECKED `PeWorkflowPanel.tsx:57` useState(false); FE gửi tường minh :203) → advance thường lên Bước3 CEO, Phase=10 ChoDuyet. Prod ground-truth: StepIdx=2 LvlOrd=1 EndedFin=0; changelog 13/07 12:23Z "Hoàn tất Bước 2/3, sang Bước 3 (Cấp 1)" no-finalize-marker; IsWinner=1 SelQ=1 (749.564M) → RC-2 refuted. Lũy-kế Row2 filter `Phase==DaDuyet` (`PeFeatures.cs:906`) ĐÚNG nguyên tắc Kenny "duyệt rồi mới bắc"; tính LIVE :886-918 no-store → xóa+tạo-lại phiếu-XEM vô ích. ⭐ Residual = DISPLAY-LIE nửa-còn-lại gotcha #78: non-DaDuyet `endsBeforeCeo`=config TRUE bất chấp pointer (detail `:1152-1154` literal `: true`; list `:647-651` subquery `.Any()`) → Bước3 mờ "Kết thúc tại Cấp 2" + chip list "⚑ Kết thúc·CCM" NGAY KHI phiếu nằm inbox CEO → user tưởng xong. 3 cơ chế chồng phân biệt: AllowApproverFinalize (Mig58 + opt-in S97) ≠ finalizeByCcmDelegation (Mig53/54 threshold — v04 CeoThresh=NULL không dùng) ≠ skipToFinal (Mig31 pointer-jump giữ ChoDuyet). Fix rec: vận-hành CEO-duyệt hoặc trả-lại→Chương tick; code = pointer-aware endsBeforeCeo (detail in-memory trivial, list EF-subquery kềnh), KHÔNG nới filter lũy kế. `[engine: fable-real-single · Fable-S117]`
- **[→ archive/2026-07.md @S125 · Mig 66 SHIPPED] S117 PE giá-chốt RANGE Min+Max invest [fable-real-single]:** ApprovedPrice WRITE 1-site `ApplyApprovedPriceOnFinalize` (3 nhánh DaDuyet; skipToFinal chỉ dời pointer) · ⭐ HĐ-gen KHÔNG đọc ApprovedPrice (GiaTri=SUM IsSelected `CreateContractFromEvaluationFeatures.cs:88-100`) · `types/purchaseEvaluation.ts` KHÔNG SHA-mirror 2-app (edit riêng) · latent: winnerQuoteTotal subset ÂM vs validator `>=0 :501`. `[s117, prominmax]`
- **[→ archive/2026-07.md @S125] S117 PE lũy-kế RCA [fable-real-single]:** phiếu A/018 KHÔNG DaDuyet (opt-in finalize UNCHECKED S97 `PeWorkflowPanel.tsx:57`) · ⭐ residual DISPLAY-LIE #78 nửa-còn-lại: `endsBeforeCeo`=config-TRUE bất chấp pointer (detail `:1152-1154` · list `:647-651`) · 3 cơ-chế finalize phân biệt Mig58-optin ≠ Mig53/54-threshold ≠ Mig31-pointer · fix-rec pointer-aware, KHÔNG nới filter lũy-kế `PeFeatures.cs:906`. `[fable-S117]`
## S116 — PE negative-quote invest (fable-clone ensemble, 07-13)
- Hội-tụ **FE-ONLY**: BE/DB nhận âm sẵn (no validator/CHECK); NS giữ-nguyên architectural; 3 chốt FE parseVnd/format/gate; sign-aware `VndInlineEdit:1003` tái dùng; chỉ submit-guard `:206` hard-reject. ⚠️ Lesson: quote sống `details[].quotes` KHÔNG `suppliers[].quotes`. **Detail:** `.claude/workflows/runs/2026-07-13-pe-negative-quote/` + session-log S116 + archive/2026-07.md 2×LENS. `[Opus-S116]`
- **2026-07-15 (S122 retro-harvest 7 orphan, 7 lane read-only qua `/hmw` RUN-TRACE `wf_5ce007c4-980`; 7/7 done · 0 error · 1 RỖNG schema-fail · 526s · 836K tok):** Task: đọc 7 run-folder "orphan" + truy `git log` → đối-chiếu run ĐỊNH-làm vs THẬT-land, neo bằng `file:line`/SHA THẬT; **CẤM bịa sha, CẤM suy "chắc xong rồi" từ việc folder tồn-tại**. Nấc: **executed + lead verify từng cái**. Evidence: 6/6 lane có return **neo SHA thật, 0 garble**`a829d0d` (PE A1+EDGE-5, 2 file +513/148) · `e100ef0`+**Mig 63** (Supplier Excel-import Phase B, 20 file +8268/14) · `5fa11b5`+**Mig 64** (import v2, 28 file +7659/105) · `d436af2`+**Mig 65** (multi-NCC, 18 file +7272/425) · `88368fd` (PE giá-ÂM, spec-match 7/7, **S116 KHÔNG phải S113**).
🔴 **KẾT-QUẢ LẬT TIỀN-ĐỀ CỦA CHÍNH RUN — 0/7 là việc mất; 7/7 ĐÃ XONG, chỉ ghi synthesis SAI CHỖ.** 6 folder có `## synthesis` trong THÂN `run.md` (dạng-3) · `pe-negative-quote` rải trong `## Stages`+`## wf run-id` (dạng-4, `run.md:19` ghi thẳng *"PIPELINE COMPLETE — shipped + live-verified"* + cicd PASS + bundle-hash + smoke 200) ⇒ **thực-địa ≥4 dạng, doc thừa-nhận 2****orphan-authority đo TÊN FILE, không đo NỘI DUNG****8 dương-giả / 25 run = 32%**. Bồi: `8fa2fcc` khoe *"[H2 gate]"*`git show --stat` **KHÔNG chạm folder** ⇒ H2 đã soi + coi ĐÓNG, chỉ lệch tên. **KHÔNG phải convention-cũ:** 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**.
🟢 **3 kỹ-thuật lane đáng tái-dùng:** (a) **đo ordinal migration bằng sorted-listing** (`Mig 65` = vị-trí **65/66**) thay vì tin nhãn `CLAUDE.md` — doc là **DẪN-XUẤT**, phải neo vào file migration thật · (b) **phân-biệt hash-lệch vs invariant-vỡ**: session-log ghi FE-mirror SHA `3e16dba5` @S116 vs đĩa nay `617b0aa0`**KHÔNG mâu-thuẫn** (file tiến-hoá sau S116; invariant thật = *"2 app identical với NHAU"* **vẫn nguyên**, `git diff --no-index` exit=0) — checker so-literal-hash sẽ kêu oan đúng chỗ này · (c) **truy owner-decision VÀO TRONG CODE**: cả 5 decision của `supplier-excel-import` neo được ở code, `:376` **cite thẳng số decision** (`// unknown → default (decision 5, không reject)`).
🔸 **Lane RỖNG ≠ mất dữ-liệu:** `parallel[3]` schema-fail 0 return — nhưng synthesis nằm **trên đĩa** (`run.md:8`) ⇒ lead lấy lại nguyên vẹn + neo chéo từ 2 lane khác. Đúng `/tiep §2`: **per-turn ≠ per-task — return mất theo phiên, file trên đĩa còn.** File synthesis của folder đó **tự khai nấc bằng-chứng THẤP HƠN** 6 cái kia.
🔴 **Lead-error lane cần biết:** memoryPack lead bơm ghi *"S113/pe-negative-quote"***SAI, là S116**. Lane **KHÔNG bị dắt** (tự truy git ra `Mon Jul 13 17:08:34 2026`). ⇒ **tiền-đề trong memoryPack CÓ THỂ SAI ⇒ luôn tự truy git, đừng tin brief.** Tag `[s122-retro-harvest, false-orphan-by-naming, 0-of-7-lost, ordinal-measured-not-labeled, lane-empty-disk-survives, brief-premise-wrong]`.
- **[→ archive/2026-07.md @S125 verbatim] S122 retro-harvest 7 orphan (`wf_5ce007c4-980`, 836K tok, 6/6 lane neo-SHA-thật 0-garble):** 🔴 LẬT tiền-đề — **0/7 mất, 7/7 ĐÃ XONG chỉ synthesis SAI CHỖ** ⇒ orphan-authority đo TÊN không đo NỘI-DUNG (8 dương-giả/25 run = 32%) · 🟢 tái-dùng: (a) ordinal-mig = sorted-listing, KHÔNG tin nhãn doc (doc = DẪN-XUẤT) · (b) hash-lệch ≠ invariant-vỡ (`git diff --no-index` 2-app exit-0 = mirror còn) · (c) owner-decision truy VÀO code (`:376` cite số decision) · 🔸 lane-RỖNG ≠ mất (synthesis trên đĩa `run.md:8` — per-turn ≠ per-task) · 🔴 memoryPack premise CÓ THỂ SAI (S113→thật S116), lane tự truy git đừng tin brief. Tag `[s122-retro-harvest, false-orphan-by-naming]`.
## 🔄 Curate trigger
- >~30KB → archive recent → L2 `archive/<period>.md` (byte-exact append) + `_INDEX.md` substring pointer. Stale >3mo → remove.
- **Last curate: 2026-07-06 (em-main single-writer, hook-triggered @21.4KB)** — 6 stale governance/superseded entries (S93/S97/S98/S100/S101 + 07-01 Supplier-predecessor) verbatim → `archive/2026-07.md`, replaced with pointer-stubs. L1 back under target.
- **Last curate: 2026-07-16 S125 (em-main single-writer, hook-triggered @23.9KB)** — 14 dòng ≈9.5KB (5 cluster digest S87-89/06-20/S69-76/S65-69/S71 + 2 section S117 + block S122 retro-harvest) verbatim byte-exact → `archive/2026-07.md`, thay stub giữ anchor nóng. L1 ~15KB.
- **Prev curate: 2026-07-06 (em-main single-writer, hook-triggered @21.4KB)** — 6 stale governance/superseded entries (S93/S97/S98/S100/S101 + 07-01 Supplier-predecessor) verbatim → `archive/2026-07.md`, replaced with pointer-stubs. L1 back under target.
- **Prev curate: 2026-06-18 S71** (29.8→23.2KB FIFO-trim 3 + gist gen:2). **Prev S70** (47.0→24.1KB dark-matter recovery + built _INDEX/gist). **Prev S40** (35.7→~20KB).

View File

@ -21,3 +21,25 @@
- **2026-07-12 (S111 H22 WAL deep-pass) `[engine: fable-real-single · Fable-S111]`:** H22 WAL adopt → READY_WITH_NUANCES + spec 3-mục (em-main gov/settings · w1 pause+tiep · w2 start/end delta · w3 hook+README). Chốt: (1) `.claude/settings*.json` KHÔNG tồn tại → hooks-entry CREATE mới; hook = STAGED-until-verified (S100 ghost-wire, chỉ claim khi thấy `wal:` commit phiên mới). (2) engine`:402` no-OS-hook = MÔ-TẢ (CAVEAT) không phải luật cấm; `:116` E.3 "hook fails-open ≠ gate" → persist-only TƯƠNG THÍCH, update :402; ACTIVE-MARKS 0 mark cấm-hook; H5 start`:41` chỉ cấm hook-switch MODEL. (3) AS-6 KHÔNG tăng: 2 runtime .json gitignored (`.gitignore:124-125`), hook commit LOCAL — push-set ≡ hôm nay. (4) cmd-PATH Git Bash trước WSL, bash 5.2.26 OK. (5) `.gitattributes` exists broadcasts-scoped → append `*.sh`; repo 0 .sh = zero churn. (6) 16 command 0 trùng pause/tiep. (7) Stop-hook fire chỉ TURN-boundary → chết giữa workflow-turn = vật-liệu DISK uncommitted, /tiep đọc cả git status/disk. (8) run.md thiếu taskList snapshot. Learned: "luật cấm hook" phải phân MÔ-TẢ vs LUẬT trước khi đòi carve-out. L1@19.8KB → suggest em-main curate.
- **2026-07-11 (S110 H21+MTv3 deep-pass) `[engine: fable-real-single · Fable-S110]`:** Task ground-truth 2 broadcast (H21 spec-file+per-invocation · MTv3 owner-choice) + inventory TOKEN toàn repo + SPEC 3-mục. Verdict **PASS**: (1) **12 persona file SẠCH 0-hit** fable/engine-token (grep 2 vòng cả `engine-đắt|top-model|ensemble`) — NGƯỢC hub vòng-1 bắt persona-phụ lỗi; (2) MTv3 self-check regex §5 chính-thức **0-hit** nhưng extended "lead LUÔN top-model" bắt 5 ACTIVE (engine:332 K.D · runbook:140/:455 · fable-real.md:17 · mark ACTIVE-MARKS:19) = **regex-heuristic-miss class** — sister diễn-đạt khác cụm regex; (3) **hmw.js:38 comment "tier:'fable' khi hệ-trọng" = xung-đột MTv3 §1.3/H21 §3** (đường nâng hạng-nhất DUY NHẤT = owner gõ; comment cho lead-discretion) — comment-only fix; (4) hmw-mode.on = HỆ KHÁC (consent fan-out T3 `ultracode-hmw-mem-governance`, content tự khai /ultra-on) — ngoài scope H21; (5) mega-line "VẪN ON" class = **standing-imperative-trong-history-blurb** (S109-header + HANDOFF NEXT-anh = ACTIVE cần sửa; blurb-body = snapshot giữ). Bẫy fidelity lớn nhất: MTv3 §1.2/1.3 "sub gán cứng hạng-hai" đọc như floor → tưởng phá H8 all-inherit; triage-reply S2 CÙNG NGÀY waive đích-danh ("không đổi gì với form all-inherit"). ⚠️ #53 garble lượt return đầu (trả status-line giữa-chừng thay verdict) → coordinator SendMessage re-emit trong-session = recover OK, diary ghi trước re-emit.
## S125 hook-curate @23.9KB (em-main single-writer, moved-not-cut byte-exact tu MEMORY.md L1) - 2026-07-16
- **PE FROZEN-Mig59 patchwork + go-live recon cluster (S87→S89, 8 entries verbatim → `archive/2026-06.md`):** key catches — AREA-4 **LATENT #73-class BUG** HoSoLink absolute-set `PurchaseEvaluationFeatures.cs:280` but PeHeaderForm PUT OMITS→clears (2 PUT mutually destructive, no preserve-test) · AREA-3 AllowApproverFinalize AUTO(Mig58)+finalizeByCcmDelegation OPT-IN(Mig54) coexist AUTO-first, ApplyApprovedPrice allow-list {Ncc,ProMin,ProMax,Ccm} · AREA-2 budget-matrix band-aid `PeSuggestedPriceFeatures.cs:153-199` PRO=drafter vs CCM=role authz-asymm · AREA-6 FE all 6-comp+3-pages SHA-mirror 2-app, #70 stale-echo · S89 AllowApproverFinalize-NOTE **GAP BE-field-MỚI** (flag only `currentLevelOptions`, DTO no-carry→expose EndsBeforeCeo) · 06-24 winner=SINGLE `SelectedSupplierId` derived-3-site, terminal=per-Level bool · 06-23 urgent authz asymmetric, PE-create dropdown `PeWorkspaceCreateView.tsx:94`.
- **2026-06-20 governance recon (both → archive/_INDEX):** (a) landing-map — `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.md §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; detectors canonical-anchor-vs-STATUS+disk 0 age-window; EVAL `golden-set-solution_erp.jsonl` 14q recall@5≥0.7 weekly-manual; anti-downgrade=H8 all-inherit PARTIAL (no generic rule grep 0).
- **PE recon cluster (S69→S76, verbatim → _INDEX):** "Giá chào thầu" mục-c=`WinnerQuoteTotal`=SUM(Quote.ThanhTien WHERE supplier==Selected) DERIVED 3-site; Budget gate=PURE ROLE no-phase (`canEditPro/Ccm` `PurchaseEvaluationFeatures.cs:800-801`); submission-count-lock NEXISTS (grep 0); Value-threshold HOOK B=`ApproveV2Async :816-845`; PRO/CCM/CEO=`Procurement/CostControl/Director` shorthand; V2 routing IGNORES roles (=ApproverUserId) 100% LINEAR.
- **Office/HRM recon cluster (S65→S69, verbatim → _INDEX):** 21 `Off_*` keys, 10 office pages `{fe-admin,fe-user}/src/pages/office/` SHA-mirror (exc MyAttendance+AttendanceReport admin-only); golive-flip=remove `RevokeTemporarilyHiddenModulesAsync` `DbInitializer.cs:2040`; Employee master-detail EXISTS, Dept FLAT pre-Mig51; NamGroup PURO=UI-skin hardcoded-navTree; **gotcha #66** `index.css h1-4{color}` OUTSIDE @layer→TW-v4 unlayered wins→heading MUST `text-white!`.
- **Governance/Harness recon cluster (S71, → _INDEX):** H8 all-inherit FULLY adopted both layers (12/12 frontmatter + hmw.js resolveModel); **run-trace "TRACKED" = 2-level** (`git check-ignore` eligible vs `git ls-files` committed — model works only post `git add`); G-015 containment shift (Harness-2 "mọi tracked=vi-phạm" → H10 "tracked NGOÀI run-folder+code-disjoint=vi-phạm"). **path-trap:** bare `runs/` from repo-root = 0 → actual `.claude/workflows/runs/` (22 tracked). detector refine(b) = `.claude/hooks`/`.claude/scripts` not-exist (now S75 has `scripts/governance-detectors.ps1`).
## S117 — PE giá-chốt RANGE Min+Max invest (fable-real single, 07-14)
- ApprovedPrice WRITE = 1 site duy nhất `ApplyApprovedPriceOnFinalize` (`PurchaseEvaluationWorkflowService.cs:951-966`, allow-list :950) gọi tại 3 nhánh DaDuyet :858 level-finalize / :896 ccm-delegation / :928 all-steps-done (skipToFinal :820 chỉ dời pointer, KHÔNG finalize-site thứ 4). READ prod = detail-DTO ONLY (`PurchaseEvaluationFeatures.cs:1230``PurchaseEvaluationDtos.cs:285`) + FE display `PeDetailTabs.tsx:1712/:1850-1863`. ⭐ **HĐ-gen KHÔNG đọc ApprovedPrice** — GiaTri=SUM Quote.IsSelected per-winner (`CreateContractFromEvaluationFeatures.cs:88-100` LOCKED A1/D4) → range 0-impact contract/lũy-kế/list. Rec model A: +1 col nullable `ApprovedPriceMaxAmount` + source token `ProMinMax` = radio thứ-5 (chỉ khi cả Min+Max present), no backfill, phiếu cũ nguyên. PRO-entry đã enforce Min≤Max (`PeSuggestedPriceFeatures.cs:38-40`). Panel+DetailTabs SHA-mirror 2-app NHƯNG `types/purchaseEvaluation.ts` KHÔNG mirror (SHA differ) — edit riêng từng app. Latent edge: winnerQuoteTotal subset-selected có thể ÂM (S116) vs validator `ApprovedPriceAmount>=0` `:501` → transition reject khó hiểu. WIP S117 uncommitted CÙNG file PurchaseEvaluationFeatures.cs (endsBeforeCeo pointer-aware :642/:768/:1157) — vùng khác, merge-safe. `[s117, pe-approved-price-range, prominmax]`
## S117 — PE lũy-kế "không bắt sau duyệt" RCA (fable-real single deep-pass)
- **2026-07-14** VERDICT: phiếu nguồn A/018 KHÔNG hề DaDuyet — Chương (Bước2 Cấp2 `AllowApproverFinalize`, badge "Duyệt thay CEO" = CONFIG-display `PeWorkflowPanel.tsx:364`) duyệt KHÔNG tick ô OPT-IN "Cấp này KẾT THÚC" (S97 Part1 đảo default UNCHECKED `PeWorkflowPanel.tsx:57` useState(false); FE gửi tường minh :203) → advance thường lên Bước3 CEO, Phase=10 ChoDuyet. Prod ground-truth: StepIdx=2 LvlOrd=1 EndedFin=0; changelog 13/07 12:23Z "Hoàn tất Bước 2/3, sang Bước 3 (Cấp 1)" no-finalize-marker; IsWinner=1 SelQ=1 (749.564M) → RC-2 refuted. Lũy-kế Row2 filter `Phase==DaDuyet` (`PeFeatures.cs:906`) ĐÚNG nguyên tắc Kenny "duyệt rồi mới bắc"; tính LIVE :886-918 no-store → xóa+tạo-lại phiếu-XEM vô ích. ⭐ Residual = DISPLAY-LIE nửa-còn-lại gotcha #78: non-DaDuyet `endsBeforeCeo`=config TRUE bất chấp pointer (detail `:1152-1154` literal `: true`; list `:647-651` subquery `.Any()`) → Bước3 mờ "Kết thúc tại Cấp 2" + chip list "⚑ Kết thúc·CCM" NGAY KHI phiếu nằm inbox CEO → user tưởng xong. 3 cơ chế chồng phân biệt: AllowApproverFinalize (Mig58 + opt-in S97) ≠ finalizeByCcmDelegation (Mig53/54 threshold — v04 CeoThresh=NULL không dùng) ≠ skipToFinal (Mig31 pointer-jump giữ ChoDuyet). Fix rec: vận-hành CEO-duyệt hoặc trả-lại→Chương tick; code = pointer-aware endsBeforeCeo (detail in-memory trivial, list EF-subquery kềnh), KHÔNG nới filter lũy kế. `[engine: fable-real-single · Fable-S117]`
- **2026-07-15 (S122 — retro-harvest 7 orphan, 7 lane read-only qua `/hmw` RUN-TRACE `wf_5ce007c4-980`; 7/7 done · 0 error · 1 RỖNG schema-fail · 526s · 836K tok):** Task: đọc 7 run-folder "orphan" + truy `git log` → đối-chiếu run ĐỊNH-làm vs THẬT-land, neo bằng `file:line`/SHA THẬT; **CẤM bịa sha, CẤM suy "chắc xong rồi" từ việc folder tồn-tại**. Nấc: **executed + lead verify từng cái**. Evidence: 6/6 lane có return **neo SHA thật, 0 garble**`a829d0d` (PE A1+EDGE-5, 2 file +513/148) · `e100ef0`+**Mig 63** (Supplier Excel-import Phase B, 20 file +8268/14) · `5fa11b5`+**Mig 64** (import v2, 28 file +7659/105) · `d436af2`+**Mig 65** (multi-NCC, 18 file +7272/425) · `88368fd` (PE giá-ÂM, spec-match 7/7, **S116 KHÔNG phải S113**).
🔴 **KẾT-QUẢ LẬT TIỀN-ĐỀ CỦA CHÍNH RUN — 0/7 là việc mất; 7/7 ĐÃ XONG, chỉ ghi synthesis SAI CHỖ.** 6 folder có `## synthesis` trong THÂN `run.md` (dạng-3) · `pe-negative-quote` rải trong `## Stages`+`## wf run-id` (dạng-4, `run.md:19` ghi thẳng *"PIPELINE COMPLETE — shipped + live-verified"* + cicd PASS + bundle-hash + smoke 200) ⇒ **thực-địa ≥4 dạng, doc thừa-nhận 2****orphan-authority đo TÊN FILE, không đo NỘI DUNG****8 dương-giả / 25 run = 32%**. Bồi: `8fa2fcc` khoe *"[H2 gate]"*`git show --stat` **KHÔNG chạm folder** ⇒ H2 đã soi + coi ĐÓNG, chỉ lệch tên. **KHÔNG phải convention-cũ:** 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**.
🟢 **3 kỹ-thuật lane đáng tái-dùng:** (a) **đo ordinal migration bằng sorted-listing** (`Mig 65` = vị-trí **65/66**) thay vì tin nhãn `CLAUDE.md` — doc là **DẪN-XUẤT**, phải neo vào file migration thật · (b) **phân-biệt hash-lệch vs invariant-vỡ**: session-log ghi FE-mirror SHA `3e16dba5` @S116 vs đĩa nay `617b0aa0`**KHÔNG mâu-thuẫn** (file tiến-hoá sau S116; invariant thật = *"2 app identical với NHAU"* **vẫn nguyên**, `git diff --no-index` exit=0) — checker so-literal-hash sẽ kêu oan đúng chỗ này · (c) **truy owner-decision VÀO TRONG CODE**: cả 5 decision của `supplier-excel-import` neo được ở code, `:376` **cite thẳng số decision** (`// unknown → default (decision 5, không reject)`).
🔸 **Lane RỖNG ≠ mất dữ-liệu:** `parallel[3]` schema-fail 0 return — nhưng synthesis nằm **trên đĩa** (`run.md:8`) ⇒ lead lấy lại nguyên vẹn + neo chéo từ 2 lane khác. Đúng `/tiep §2`: **per-turn ≠ per-task — return mất theo phiên, file trên đĩa còn.** File synthesis của folder đó **tự khai nấc bằng-chứng THẤP HƠN** 6 cái kia.
🔴 **Lead-error lane cần biết:** memoryPack lead bơm ghi *"S113/pe-negative-quote"***SAI, là S116**. Lane **KHÔNG bị dắt** (tự truy git ra `Mon Jul 13 17:08:34 2026`). ⇒ **tiền-đề trong memoryPack CÓ THỂ SAI ⇒ luôn tự truy git, đừng tin brief.** Tag `[s122-retro-harvest, false-orphan-by-naming, 0-of-7-lost, ordinal-measured-not-labeled, lane-empty-disk-survives, brief-premise-wrong]`.
### S125 hook-curate bo-sung (2 digest S105/S104 moved-not-cut)
- **[→ git+session-log 07-07] S105 BVAAU cross-repo auth RCA:** Q1 root-cause = FE Home MÙ session (bundle cũ relative `/api` trên site TĨNH `web.config` loại `^/api/``/api/auth/me` 404 → anonymous); fix API_BASE-absolute `51c69fb` LIVE. Q2 CRM1 hở 2 tầng (FE soft + API `enforceCrmGate:false`) → flip `AUTH_ENFORCE_CRM_GATE=true`. Q3 Zalo "User_ID" KHÔNG có UI. Class **"hub+site-tĩnh relative-`/api` chết im prod"**; #53-garble-7 → SendMessage-resume recover. *(verbatim → archive/2026-07.md)*
- **[→ 07-12 LENS-3 entry above + git 07-06] S104 Supplier 30-field 🅰️ schema-invest WF `wf_5ac2cdb0`:** SUPERSEDED anchors giữ: ClosedXML 0.105.0 = Excel-standard (KHÔNG OpenXml-raw, `csproj:8`); reuse-existing-cols>parallel; `UpdateSupplierCommand.cs:49-57` blind-set=latent#73; seed fill-nulls-if-exists (`DbInitializer.cs:2781`); `SupplierDto` hand-projected 2-site (`GetSupplierQuery.cs:21`+`ListSuppliersQuery.cs:48-50`); `Dialog.tsx:48` max-h-70vh; extract `ui/PathLink.tsx`. Chốt Mig 62 +18 nullable. *(verbatim → archive/2026-07.md)*