From 99fc37361fdf6375db9200d281ce3475d1bf9aa4 Mon Sep 17 00:00:00 2001 From: pqhuy1987 Date: Fri, 17 Jul 2026 14:45:20 +0700 Subject: [PATCH] =?UTF-8?q?[CLAUDE]=20Docs:=20S134=20closeout=20=E2=80=94?= =?UTF-8?q?=20luy=20ke=20TAM=20TINH=20(STATUS=20528/bundle=20Run=20#399=20?= =?UTF-8?q?+=20HANDOFF=2010-carry=20UAT-script=20+=20session-log=20+=20syn?= =?UTF-8?q?thesis=20dong=20orphan=20+=20harvest=206=20vai)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- .claude/WAL.md | 17 ++++++---- .claude/agent-memory/cicd-monitor/MEMORY.md | 4 +++ .../investigator-codebase/MEMORY.md | 9 ++--- .claude/agent-memory/reviewer/MEMORY.md | 2 ++ .../agent-memory/test-specialist/MEMORY.md | 3 ++ .../close-synthesis.md | 23 +++++++++++++ .../2026-07-17-S134-pe-luyke-tam-tinh/run.md | 8 +++-- CLAUDE.md | 2 +- docs/HANDOFF.md | 6 +++- docs/STATUS.md | 18 ++++++++-- .../2026-07-17-S134-pe-luyke-tam-tinh.md | 34 +++++++++++++++++++ 11 files changed, 108 insertions(+), 18 deletions(-) create mode 100644 .claude/workflows/runs/2026-07-17-S134-pe-luyke-tam-tinh/close-synthesis.md create mode 100644 docs/changelog/sessions/2026-07-17-S134-pe-luyke-tam-tinh.md diff --git a/.claude/WAL.md b/.claude/WAL.md index 0a1badb..28f98b6 100644 --- a/.claude/WAL.md +++ b/.claude/WAL.md @@ -9,13 +9,16 @@ chain: [x] 4. hmw INV-2 wf_58302bd5-b9f [IMPL-A ‖ IMPL-B] — 2/2 done 0-garble · A: 4 file BE +ComputePendingAsync+DTO+D4 (build 0/0, ComputeAsync 0-diff, insertion-only) · B: 6 file FE (hash d28eaa16+bebc0ada ×2 IDENTICAL, npm ×2 PASS, M2 enum-gate) · lead re-verify độc-lập: scope 10 file + hash + grep D4/M2/N8 KHỚP · harvest C4 2 vai APPENDED · evidence: sub-implementer-backend-0.md + sub-implementer-frontend-1.md (hmw index GLOBAL theo taskList — hết collision S133) [x] 5a. re-verify build 0-err + filter PeBudgetFreeze 11/11 (INV-2 không vỡ freeze) [x] 5b. hmw INV-3 wf_97d6a582-b7e [TEST-C] — 1/1 done 0-garble · +8 test PePendingAccumulationTests C1-C8 (C6 complementary-no-double-count exact-numbers) · full 528/0 (45D+483I) · NO prod bug · evidence: sub-test-specialist-0.md -[!] 5c. reviewer pre-commit wf_8bb5abee-657 (ghi sub-reviewer-precommit.md) ‖ lead full-suite độc-lập (bg br7adpgua, kỳ vọng 528/0) — cả 2 đang chạy -[ ] 5. test full + npm ×2 + reviewer pre-commit → commit + push + cicd verify -[ ] 6. docs closeout +[x] 5c. reviewer pre-commit wf_8bb5abee-657 — **PASS 0C/0M/4-nice-to-have** (7/7 trục; tự chạy build+npm×2+filter 8/8; #81-indirect 5/5-qua-helper + seeder-safe; scope-drift 0%) ‖ lead full-suite độc-lập **exit-0 Infra 483/0** — CẢ 2 XANH · evidence: sub-reviewer-precommit.md +[x] 5d. squash §5.0 (reset --soft d4fbced, 9 wal: local TIÊU — 0 lọt origin) → 2 commit sạch e53a693 (docs S133) + **6664a61 (feature S134, 11 file code+test + run-folder + WAL + agent-memory ×3)** → PUSHED d4fbced..6664a61 +[x] 5e. cicd verify 6664a61 wf_f366f38d-498 — **GO 5/5 CLEAN**: Run #399 5m27s · gate 528-exact-log · Mig 67 frozen+89 · bundle ×2 BVCukFP5/CBzUlgOA + DoxyEOxh/BHsBUA8e (byte 3-marker PRESENT, control 0-hit) · smoke 4×200+PE-401 · lead spot-check độc-lập 4/4 khớp · evidence: sub-cicd-monitor-0.md +[x] 6. docs closeout — STATUS (528 · bundle mới · Recently-Done S134) + HANDOFF (10 carry re-stamp + UAT-script 3-bước + ⚑D1-nháp) + session-log 2026-07-17-S134-pe-luyke-tam-tinh.md + CLAUDE.md row-PE + close-synthesis.md (orphan ĐÓNG) + harvest 6 vai (engine-label GAP-2) · hook-cap ×3 (20.4-21.3K dưới-cap 25.6K → không-nén S122, carry) +[ ] 7. commit docs closeout + push (docs-only CI-skip) → /pause (anh dặn "xong thì /pause") -next: chờ return invest → verify claims (spot-check file:line) → ghi spec (mục 2) +next: mục 7 — commit + push + /pause verify: -- ls .claude/workflows/runs/2026-07-17-S134-pe-luyke-tam-tinh/ # run.md + sub-investigator-codebase-0.md (khi invest ghi) -- git log --oneline -1 # de64bf2 (docs S133) hoặc wal: mới hơn -- grep -n "TẠM TÍNH" .claude/workflows/runs/2026-07-17-S134-pe-luyke-tam-tinh/run.md # goal đúng mạch +- git log --oneline -2 # commit docs closeout S134 trên cùng (sau 6664a61 đã push) +- curl -s https://admin.solutions.com.vn/ | grep -o 'index-[^"]*js' | head -1 # index-BVCukFP5.js +- dotnet test SolutionErp.slnx --filter PePendingAccumulation --nologo # 8/8 +- ssh vietreport-vps 'sqlcmd -S .\SQLEXPRESS -d SolutionErp -U vrapp -Q "SELECT TOP 1 MigrationId FROM __EFMigrationsHistory ORDER BY MigrationId DESC"' # vẫn 20260717032812 (pass: appsettings.Production.json) diff --git a/.claude/agent-memory/cicd-monitor/MEMORY.md b/.claude/agent-memory/cicd-monitor/MEMORY.md index d514be2..8b2e0a4 100644 --- a/.claude/agent-memory/cicd-monitor/MEMORY.md +++ b/.claude/agent-memory/cicd-monitor/MEMORY.md @@ -1,5 +1,9 @@ # CI/CD Monitor Agent — Persistent Memory +- **S134 (07-17) verify 6664a61 PE lũy-kế tạm-tính [wf_f366f38d-498 · return CLEAN no-garble] `[engine: opus-worker]`:** VERDICT **GO 5/5** — Run **#399** (id=513) success 5m27s (14:27:29→14:32:56+07); gate **528 EXACT từ log** (45D+483I, +8 PePendingAccumulationTests); Mig 67 top FROZEN + sys.tables 89 (0-mig by-construction, `git diff -- *Migrations*` empty); bundle rotate ×2 admin js `3NCdyODe`→**`BVCukFP5`** css `B--dUHcm`→**`CBzUlgOA`** · eoffice js `CKsoiNCI`→**`DoxyEOxh`** css `BuntB63r`→**`BHsBUA8e`** (FE-src đổi 6 file ⇒ rotate expected; CSS = amber utilities benign #69), real-size 1.659.037/1.565.367B + LM in-window; **byte-verify #77 qua python urllib BYTES**: `pendingPriorPes`=2 + `Tạm tính`=3 + `phiếu trước cùng gói thầu CHƯA duyệt`=2 cả 2 js, control old-hash 900B **ct=text/html** 0-hit; smoke 4×200 + PE 401. Learned: (1) **urllib bytes + `body.count(marker.encode())` = bulletproof cp1252** cho marker tiếng Việt (khác subprocess text=True crash S133); (2) **ct=text/html là SPA-trap discriminator SẠCH HƠN size-919B** (shell size drift per build — 900B lượt này); (3) tasks-API có thể blip empty-200 transient → poll-loop absorb. Poll held-off verify khi running (iter 0-2) đúng bài #242. Tag `[s134, run-399, go-5-5, ct-html-discriminator, urllib-bytes-marker]` + +- **S133 (07-17) verify d4fbced PE budget-freeze [wf_4eadbcf6-c25, return sạch — verdict landed SAU khi lead /pause; harvest-liền lúc notification, lead CHƯA re-verify độc lập]:** VERDICT **GO 5/5** — Run **#398** success ~5.5m (gate **520** = 45D+475I, 0 fail/skip); Mig 67 prod: history-top + **11 cột ApprovedBudget\* exact** + backfill **18/18 phiếu DaDuyet chua=0** + sys.tables **89** no-new-table; bundle rotate ×2: admin js `yCkX-2Bp`→**`3NCdyODe`** css `CXD7q9xH`→**`B--dUHcm`** · eoffice js `DKSD4p9k`→**`CKsoiNCI`** css `CjwZwYJo`→**`BuntB63r`**, real-size 1.657.025/1.563.373B, LM 11:18:42/11:19:36+07 in-window; byte-verify #77: `budgetFrozen`=1 + `Ngân sách chốt tại thời điểm duyệt`=1 cả 2 js mới, old-hash control = 900B SPA-trap 0-hit; smoke 4×200 + PE 401-secured. **Surprise: CSS CŨNG rotate cả 2 app** (spec đoán "CSS có thể frozen") — PeDetailTabs badge sinh utility-class mới → content-hash đổi theo content, benign #69; phá streak bundle-FROZEN S129-S132. Lesson tool: python `capture_output text=True` crash cp1252 trên title CI tiếng Việt → dùng `text=False` bytes + `json.loads(bytes)`; foreground sleep bị chặn → `python time.sleep` poll-loop OK. Tag `[s133, run-398, go-5-5, css-rotate-benign, mig67-backfill-18]` + > **Persistent diary cross-session.** Auto-injected first ~200 lines at spawn (L1 HOT). > Update BEFORE every stop. Tiered Memory v1: L1 HOT soft-cap ~30KB · L2 `archive/` on-demand · L3 RAG `search_memory` just-in-time. Keep entry ≤ 1.5K chars (gotcha #53). > Full verbatim run history pre-S40 → git `d2f52ba` + `archive/2026-05-{runs,q2,q3,q4}.md` + `archive/2026-06.md` + `archive/2026-07.md`. 🗺️ **Lookup map: `archive/_INDEX.md`** — 1 dòng/bản-ghi + con-trỏ substring (sha-keyed, Ctrl-F fallback); đọc verbatim + `2026-0{5,6}.gist.md` theo nhu cầu. See 🔄 Curate-trigger log for archive-move history. diff --git a/.claude/agent-memory/investigator-codebase/MEMORY.md b/.claude/agent-memory/investigator-codebase/MEMORY.md index 8cb3552..64a0904 100644 --- a/.claude/agent-memory/investigator-codebase/MEMORY.md +++ b/.claude/agent-memory/investigator-codebase/MEMORY.md @@ -1,5 +1,7 @@ # Investigator-Codebase Agent — Persistent Memory +- **S134 (07-17) PE lũy-kế tạm-tính invest [fable-real Agent-lẻ · #53 return-garble → sub-file 8-phần 20.7KB CỨU TRỌN (lần 3 pattern thắng); entry on-behalf em-main] `[engine: fable-real-single]`:** ground-truth LẬT KHUNG đề bài — row1 "NS trình duyệt trước" ĐÃ gồm ChoDuyet sẵn (`PeBudgetAccumulator.cs:42-48`), gap thật = row2 "đã chọn thầu" (DaDuyet+IsWinner :50-60) + row5/6 dẫn xuất ⇒ spec thu hẹp **0-mig/0-endpoint/0-đụng-chính-xác**. Map 3-bản predicate: helper runtime DUY NHẤT + live `:962` + snapshot `:1018` đều GỌI CHUNG helper (không duplicate) + backfill Mig 67 one-time. Phase-set propose: PriorPes NOT IN {7,99} · delta2 NOT IN {1,7,99}+winner (GỒM ChoDuyet=gap) · delta1 NOT IN {1,7,10,99} (no-double-count); D1 nháp list-only (S89 riêng-tư `:893-898`). 2 errata lead bắt: path thiếu `Dtos/` + hash-value stale (`47c97df1` vs lead-đo `5534addb` — kết luận identical vẫn ĐÚNG). Learned: **đề bài UAT "X không được tính" phải đo predicate THẬT từng-row trước khi nhận khung** — row1 vs row2 khác semantics, gộp chung "lũy kế" là bẫy; PeWorkflowPanel `:510 shouldPickPrice` = predicate "đang duyệt CUỐI" tái dụng được. Tag `[s134, luyke-tam-tinh, invest-lat-khung, 53-garble-diskfile-lan3]` + > **Persistent diary cross-session.** Auto-injected first ~200 lines at spawn (L1 HOT). > Update BEFORE every stop. Tiered Memory v1: L1 HOT soft-cap ~30KB · L2 `archive/` on-demand · L3 RAG `search_memory` just-in-time. Keep entry ≤ 1.5K chars (gotcha #53). > Full verbatim history pre-S40 → git `d2f52ba` + `archive/2026-05-q1..q4.md` + `archive/2026-06.md`. 🗺️ **Lookup map: `archive/_INDEX.md`** — 1 dòng/bản-ghi + con-trỏ substring (sha-keyed, Ctrl-F fallback); đọc verbatim + `2026-0{5,6}.gist.md` theo nhu cầu. **S80 curate: moved 15 recon entries S65→S76 + 2× 06-20 → archive.** @@ -18,11 +20,10 @@ Read-only INTERNAL audit SOLUTION_ERP codebase. Tools: Read, Grep, Glob, Bash + --- ## 🆕 Recent invest (S112-S114 stubs — verbatim → git history + `archive/2026-07.md`) +- **S134 (07-17) PE lũy-kế TẠM-TÍNH invest+spec [fable-real-single; ghi-đĩa-trong-lúc-làm 8 phần → return sạch]:** ⭐ LỆCH-TIỀN-ĐỀ: "lũy kế chỉ bắt DaDuyet" SAI một nửa — `PeBudgetAccumulator.cs:42-48` PrevSubmitted (row1) ĐÃ gồm ChoDuyet=10 từ trước; DaDuyet-only CHỈ ở PrevSelected (row2, :50-60) ⇒ feature thu hẹp = delta row2/row6 (+row1 cho TraLai/nháp tuỳ tập). Predicate runtime 1 BẢN duy nhất (helper) — Features `:962` + WorkflowService `:1018` đều GỌI, Mig67 SQL = bản dịch one-time; "3-4 bản phải khớp" thực tế = 2 sống. FE matrix: row5=1+3 per-cột `PeDetailTabs:1325`, row6=2+4 `:1318`; PeDetailTabs+PeWorkflowPanel 2-app SHA IDENTICAL, types KHÁC (re-confirm S117). Final-approver predicate tái dụng được: `shouldPickPrice` PeWorkflowPanel:510. Dev DB còn phase legacy 3/6 SỐNG → predicate tạm-tính viết loại-trừ `NOT IN (7,99)`. Gotcha mới: SSH prod password extraction 2-step fail ×2 (ConvertFrom-Json null-method) — prod ground UNVERIFIED không chặn spec. Spec 3-mục + 5 decision-points (nháp S89-privacy list-only) → `runs/2026-07-17-S134-pe-luyke-tam-tinh/sub-investigator-codebase-0.md`. Tag `[s134, pe-luyke-tamtinh, lech-tien-de-row1, no-mig]` - **S133 (07-17) PE budget FREEZE-at-DaDuyet invest [engine: fable-real-single `wf_348f6155-167`; #53 return-fail (no StructuredOutput) → sub-file 22.5KB cứu trọn, lead ghi entry on-behalf sau verify-đĩa 7/7]:** retro-change 2 đường: BE detail-bundle load pair LIVE `PurchaseEvaluationFeatures.cs:911-912` (DTO :964 — 1 construction site duy nhất) + FE fallback `?? bs.proInitialAmount`/`?? bs.initialAmount` (`PeDetailTabs.tsx:1511/:1526` — draft cite :1288 lệch dòng = class cite-drift S108, bản chất đúng). Finalize = ĐÚNG 4 assignment DaDuyet ALL `PurchaseEvaluationWorkflowService.cs:861/:899/:931/:1053`; `ApplyApprovedPriceOnFinalize` (def :955 static) chỉ 3-call V2 — V1 :1053 KHÔNG gọi ⇒ choke-point = helper MỚI 4-call, KHÔNG tái dụng hook giá-chốt. Vector per-slip: `SetPeCcmBudgetPeriod` NO-phase-guard (:228-242) · `AdjustBudget` admin-bypass (:419-422). Lũy kế row1/2 peer-derived (:917-943) = drift-vector thứ 2 → chụp luôn. Design: 11 cột `ApprovedBudget*` trên PE + display-gate `BudgetFrozen` + 2 terminal-guard + backfill=live-now (Changelogs CÓ log value NHƯNG attribution-gap: log gắn phiếu-đang-mở-lúc-sửa → không tái dựng số lúc duyệt). PeDetailTabs 2-app hash IDENTICAL `931025f2` · types 2-app KHÁC (S117). Tag `[s133, pe-budget-freeze, fable-real, ghi-dia-cuu-2/2, attribution-gap-changelog]` -- **S129 (07-16 đêm) adap 2 errata EOL 3-lane `wf_3fccd7d1`:** T0 sweep = SE **0 defect-site** (counter duy-nhất `agent-frontmatter-eol-check.ps1` byte-level pre-satisfy fix①③; pattern hỏng chỉ ở mention-site). T1: 19 `i/-text` đều declared-binary 0-suspect — **filter mẫu erratum thiếu docx/xlsx = 13 dương-giả trên SE** (tailor-per-class!); generator-drift thật duy-nhất `mfe-eval.ps1:204` Set-Content UTF8 = **BOM+CRLF** (blob mang BOM 3-byte); W0.6 = EOL-only A/B, trục-quote UNDETERMINED — đừng over-read. T2: nấc thật = **4 gated + 3 discipline** (đừng kê "7/7" phẳng — R1 MAJOR). 2 bẫy tự-mắc đáng nhớ: `git log -- | tail -1` = **first-touch KHÔNG phải policy-landing** (.gitattributes 08c7036 06-15 vs 92de58f 07-15) · story "40 = +1 agent mới" BỊA — số scoped=39, delta=`skills/README.md` ngoài glob SKILL.md (meta-count class). #53 WRITE-lane 2/3 lane — journal cứu trọn, em-main scribe. Tag `[s129, adap-errata-eol, byte-counter-pre-satisfy, bom-in-blob, tail1-first-touch-trap]` -- **S114 (07-12) PE multi-winner PER-HANG-MUC (fable-clone):** Mig58/59 multi-winner = WHOLE-SUPPLIER (`PurchaseEvaluationSupplier.IsWinner`); `Quote.IsSelected` per hang-muc×NCC = latent-hook Mig12 nay LIVE (Mig65 backfill re-key winner-truth IsWinner→IsSelected = CARDINALITY-CHANGE #2). winnerQuoteTotal=SUM(Quote WHERE IsSelected) `PeFeatures.cs:1188`. #1 open: N-win 1 hang-muc split KHOI-LUONG hay full-price (schema thieu per-winner volume). Tag `[s114, pe-multiwinner-per-hangmuc, quote-isselected-live]`. -- **S113 (07-12) Supplier import v2 (5-lane ensemble):** selection consumers qua ListSuppliersQuery (`PeDetailTabs:2222`+`ContractCreatePage:321`+dashboard); chot IsPublic-bool + dedup-MST+Code + fail-closed default. Prod 37 NCC. 1 lane #53-garble→em-main recover. Tag `[s113, supplier-import-v2, ma-ncc=code]`. -- **S112 (07-12) Supplier Excel-import + PE sign-off (fable-clone):** Supplier 27/27 bijective (Mig62 SHIPPED prod); dedup Code CI-collation → normalize-case TRUOC store; PE bypass = go/gate `ApplyDrafterBypassOnSubmitAsync`; EDGE-5 drafter-forge-Reject REACHABLE. Tag `[s112, supplier-mapping, pe-bypass-a1, edge5-reachable]`. +- **[→ archive/2026-07.md @S134] S129 (07-16) adap errata EOL 3-lane:** key giữ — 13 dương-giả do filter erratum thiếu docx/xlsx (tailor-per-class) · `git log|tail -1`=first-touch KHÔNG phải policy-landing · BOM-in-blob `mfe-eval.ps1:204` · meta-count class "40=+1 agent" bịa. +- **[→ archive/2026-07.md @S134] S112/S113/S114 (07-12) Supplier-import-v2 + PE multi-winner per-hạng-mục:** key giữ — `Quote.IsSelected` per hạng-mục LIVE (Mig65, cardinality-change #2) · winnerQuoteTotal=SUM IsSelected `PeFeatures.cs:1188` · Mã NCC=Code · IsPublic fail-closed · PE bypass `ApplyDrafterBypassOnSubmitAsync`. ## 📋 Patterns proven (apply confidently) diff --git a/.claude/agent-memory/reviewer/MEMORY.md b/.claude/agent-memory/reviewer/MEMORY.md index a4a2dab..5d9b58d 100644 --- a/.claude/agent-memory/reviewer/MEMORY.md +++ b/.claude/agent-memory/reviewer/MEMORY.md @@ -1,5 +1,7 @@ # Reviewer Agent — Persistent Memory +- **S134b (07-17) pre-commit review lũy-kế tạm-tính [wf_8bb5abee-657 · ghi sub-reviewer-precommit.md — tên RIÊNG tránh đè sub-reviewer-0 của lượt fable-real] `[engine: opus-worker]`:** **PASS 0C/0M/4 nice-to-have** — 7/7 trục; diff +310/−25 (25 deletion = expand-chữ-ký tại chỗ, scope-drift 0%). Positive đáng nhớ: **bài #81 CỦA CHÍNH MÌNH (S133) được implementer áp đúng** — 5/5 finalize→DaDuyet qua helper (admin-override `:311` gate `targetPhase==DaDuyet` + comment cite #81), seeder `:1323` bypass CỐ Ý + set snapshot trực tiếp → 0 changelog D4 rác. Tự chạy lại build+npm×2+filter 8/8 (KHÔNG tin evidence cũ khi diff đổi). 4 nice-to-have = test-backlog: live-fill symmetric-C7 · admin-override D4-path · MaPhieu-null render · PendingSubmitted âm. Learned: (1) **"insertion-only + `grep '^-'`=0" đọc nhanh + chắc hơn diff-mắt** cho ràng-buộc bất-động; (2) D4-persist-path soi = trace TỪNG caller tới SaveChanges (5/5 có :301/:316), Add-không-save = row ma. Tag `[s134b, precommit-pass, 81-ap-dung, subfile-ten-rieng]` + - **[→ archive/2026-07.md @S134] S133 (07-17) pre-commit review pe-budget-freeze — PASS_WITH_FIXES 0MUST/2SHOULD:** ⭐ literal-grep 4-site enum PASS hết nhưng grep `.Phase = ` lòi 2 đường GIÁN TIẾP bypass helper (`WorkflowService:308` admin-override `= targetPhase` + `DbInitializer:1323` seeder). **Bài: RULE "mọi nhánh set X" grep CẢ assignment-qua-BIẾN — #81 lớp indirect-assignment.** Lead áp 2 SHOULD trong phiên → suite 520/0. Tag `[s133, indirect-assignment-grep, 81-class]` > **Persistent diary cross-session.** Auto-injected first ~200 lines at spawn (L1 HOT). diff --git a/.claude/agent-memory/test-specialist/MEMORY.md b/.claude/agent-memory/test-specialist/MEMORY.md index d82bb96..62f9144 100644 --- a/.claude/agent-memory/test-specialist/MEMORY.md +++ b/.claude/agent-memory/test-specialist/MEMORY.md @@ -1,5 +1,8 @@ # Test-Specialist Agent — Persistent Memory +- **S134 (07-17) PE lũy-kế TẠM TÍNH TEST-C [wf_97d6a582-b7e · return sạch 0-garble] `[engine: opus-worker]`:** +8 `PePendingAccumulationTests.cs` C1-C8 (file MỚI, mirror seed PeBudgetFreezeTests :277-336): C1 ChoDuyet+winner→delta2+PriorPes · C2 TuChoi/DaDuyet loại sạch · C3 nháp list-only/TraLai delta1 · C4 window CreatedAt · C5 delta âm signed · **C6 complementary-no-double-count: gọi CẢ ComputeAsync + ComputePendingAsync cùng seed, assert EXACT-NUMBERS 2 phía (PrevSelected 90tr/1 bất động ⟂ PendingSelected 50tr/1)** · C7 frozen→0/null qua query handler · C8 D4 changelog positive+contrast (filter `ContextNote.Contains("[S134 pending-prior]")` #48). Full **528/0** (45D+483I, +8). Learned: (1) **direct-call accumulator = synthetic curPeId + CreatedAt muộn, KHÔNG cần row phiếu-đang-xét** (chỉ filter Id!=/CreatedAt<); (2) regression "bất động" mạnh nhất = C6-style exact-numbers 2 hàm cùng seed; (3) FluentAssertions `ContainInOrder(params T[])` + because-string overload-clash khi T=Guid → bọc `new[]{...}` trước. Surprise: D4 no-SaveChanges-in-helper → row chỉ persist sau TransitionAsync. Tag `[s134, pependingaccumulation, c6-exact-numbers-complementary, 8-test]` + +- **S133 INV-C T1-T9 [wf_75c6bfd3-754 · #53 return-fail lần 3 → disk + lead tự chạy suite; entry on-behalf]:** +9 test vào PeBudgetFreezeTests (`:426` T1 đủ-11-cột · `:480` T2 CCM-threshold · `:524` T3 all-steps · `:555` T4 V1-legacy assert KHÔNG-ApprovedPrice · `:638` T5 guard CCM+Admin Conflict + ChoDuyet-allow · `:687` T6 AdjustBudget DaDuyet+TuChoi · `:730` T7 live-vs-frozen flags/editability · `:783` T8 null-safe no-WorkItem + no-pair · `:821` T9 overwrite + SnapshotAt refresh). FULL suite lead-verified exit-0: **Domain 45 + Infra 474 = 519, 0 fail** (464+10 khớp). ⚠️ Lesson mới: INV-C **ghi đè** `sub-test-specialist-0.md` của INV-A — cùng role + cùng task-index qua 2 invocation chung run-folder = sub-file collision; INV-A content sống nhờ journal + diary. Multi-invocation cùng run → cần label/index phân biệt (báo lead khi gặp lại). Tag `[s133, t1-t9, subfile-collision-multi-invocation]` - **S133 (07-17) PE budget-freeze T0 REPRODUCE [wf_d9639faa-97a INV-A, return sạch]:** RED thật `Failed 1/1` — expected ProInitial 100tr, found 999tr @`PeBudgetFreezeTests.cs:184`. Flow chuẩn: đưa phiếu tới DaDuyet QUA `svc.TransitionAsync` (V2 1-Bước-1-Cấp `AllowApproverFinalize=true` + giá chốt), KHÔNG seed thẳng Phase (post-fix snapshot CHỈ set qua transition); mutate pair qua UpdatePeBudgetPro/Ccm (2 handler KHÔNG phase-guard = đúng cơ chế bug); 2 sanity-assert chống vacuous (Phase==DaDuyet + liveRec đổi thật) TRƯỚC assert chính. Bắt được lỗi spec: query THẬT = `GetPurchaseEvaluationQuery` (bundle `.BudgetSummary`), spec ghi nhầm GetPurchaseEvaluationDetailQuery → lead sửa spec. Sau INV-B: T0 GREEN trong 44/44 filter. Tag `[s133, pe-budget-freeze, t0-red-green, anti-vacuous-sanity-assert]` > **Persistent diary cross-session.** Auto-injected first ~200 lines at spawn (L1 HOT). diff --git a/.claude/workflows/runs/2026-07-17-S134-pe-luyke-tam-tinh/close-synthesis.md b/.claude/workflows/runs/2026-07-17-S134-pe-luyke-tam-tinh/close-synthesis.md new file mode 100644 index 0000000..415fa5f --- /dev/null +++ b/.claude/workflows/runs/2026-07-17-S134-pe-luyke-tam-tinh/close-synthesis.md @@ -0,0 +1,23 @@ +# close-synthesis — 2026-07-17-S134-pe-luyke-tam-tinh (VERIFIED) + +> Lead-verified synthesis toàn run (dạng-1 flat — đóng orphan). Goal: PE lũy kế TẠM TÍNH vs CHÍNH XÁC (UAT anh Kiệt 15/07 chốt "Vậy em xử lý theo hướng này đi"). + +## Kết quả chốt (evidence-first) + +| Stage | wf | Kết quả VERIFIED | Evidence | +|---|---|---|---| +| 1. invest fable-real | Agent lẻ model=fable | map predicate 3-bản + phase-taxonomy + spec propose (⚠️ #53 return-garble → **sub-file 8-phần cứu**, lần 3) | `sub-investigator-codebase-0.md` 20.7KB COMPLETE · lead verify 7/7 claim + 2 errata | +| 2. spec 3-heading | — | D1-D5 chốt + tập predicate: PriorPes NOT IN {7,99} · delta2 NOT IN {1,7,99}+IsWinner · delta1 NOT IN {1,7,10,99} | `spec-pe-luyke-tam-tinh-17-07-2026.md` | +| 3. review fable-real | Agent lẻ model=fable | **GO_WITH_FIXES 0C/2M/9n** (M1 D4-shape · M2 banner-gate · D4-seeder CLEAR) → lead áp trọn → spec v2 (⚠️ #53 → sub-file cứu) | `sub-reviewer-0.md` 67 dòng | +| 4. hmw INV-2 [A‖B] | `wf_58302bd5-b9f` | **2/2 0-garble** — BE 4 file (+68/0 pure-add, ComputeAsync 0-diff, D4 insertion-only +30/0) · FE 6 file (`d28eaa16`+`bebc0ada` ×2 IDENTICAL, npm ×2) · lead re-verify scope/hash/grep + filter S133 11/11 | `sub-implementer-backend-0.md` + `sub-implementer-frontend-1.md` | +| 5. hmw INV-3 [TEST-C] | `wf_97d6a582-b7e` | **1/1 0-garble** — +8 `PePendingAccumulationTests` C1-C8 (C6 complementary exact-numbers) · full 528/0 · NO prod bug | `sub-test-specialist-0.md` · lead re-run exit-0 Infra 483/0 | +| 6. reviewer pre-commit | `wf_8bb5abee-657` | **PASS 0C/0M/4n** — 7/7 trục; tự chạy build+npm+filter; #81-indirect 5/5-qua-helper + seeder-safe; scope-drift 0% | `sub-reviewer-precommit.md` | +| 7. squash+push | — | §5.0 reset-soft → `e53a693` (docs S133) + `6664a61` (feature) → PUSHED `d4fbced..6664a61`, **0 wal: lọt origin** | `git log` | +| 8. cicd verify | `wf_f366f38d-498` | **GO 5/5 CLEAN-return** — Run **#399** 5m27s · gate **528 EXACT-từ-log** · Mig 67 frozen + 89 bảng · bundle rotate ×2 admin `BVCukFP5`/`CBzUlgOA` + eoffice `DoxyEOxh`/`BHsBUA8e` (LM-in-window, real-size, marker `pendingPriorPes`=2+`Tạm tính`=3+`phiếu trước…CHƯA duyệt`=2, control 900B text/html 0-hit) · smoke 4×200 + PE 401 · **lead spot-check độc-lập 4/4 hash + marker khớp** | `sub-cicd-monitor-0.md` | + +## Delta trí-nhớ đáng giữ (đã APPEND các nơi tương ứng) + +1. **hmw index sub-file GLOBAL theo taskList** (role khác nhau → hết collision S133; cùng-role re-invocation vẫn đặt tên riêng — đã áp `sub-reviewer-precommit.md`). +2. **Insertion-only diff = proof mạnh nhất "bất động"** (implementer-backend) · **`sub?: ReactNode` slot-prop** chèn sub-dòng N site không nhân bản markup (implementer-frontend) · **ct=text/html discriminator** SPA-trap (cicd) · **spec ràng-buộc "không đổi X" phải tự-kiểm nguyên-liệu việc-mới** (reviewer M1). +3. **#53 ×2 lượt fable-real (invest + review) — 0 mất việc** nhờ ghi-đĩa-trong-lúc-làm; 5/5 lane hmw + cicd return CLEAN (chuỗi dài sạch nhất từ trước tới nay). +4. ⚑ D1 (nháp list-only) chờ anh gật — đổi = 1 predicate + C3 flip. diff --git a/.claude/workflows/runs/2026-07-17-S134-pe-luyke-tam-tinh/run.md b/.claude/workflows/runs/2026-07-17-S134-pe-luyke-tam-tinh/run.md index eadbaa2..2a3f8f3 100644 --- a/.claude/workflows/runs/2026-07-17-S134-pe-luyke-tam-tinh/run.md +++ b/.claude/workflows/runs/2026-07-17-S134-pe-luyke-tam-tinh/run.md @@ -27,6 +27,8 @@ - [x] 1. invest fable-real — #53 garble return, **sub-file 8-phần cứu trọn** (157 dòng COMPLETE); phát hiện lật-khung: row1 ĐÃ gồm ChoDuyet, gap thật = row2 - [x] 2. lead verify 7/7 claim + 2 errata (path `Dtos/`, hash-value) + chốt D1-D5 → ghi spec 3-heading - [x] 3. fable-real reviewer — #53 garble return, sub-file cứu (lần 3) · **GO_WITH_FIXES 0C/2M/9n** (M1 changelog-shape đầy-đủ Action=Update né #49 · M2 banner gate phase===ChoDuyet; D4-seeder CLEAR — set trực tiếp không gọi helper) → lead áp TRỌN → spec v2 -- [!] 4. hmw implement Opus 4.8 MAX — INV-2 [A‖B] đang chạy (args.run RUN-TRACE) -- [ ] 5. INV-3 [TEST-C] + test full + npm ×2 + reviewer pre-commit → commit/push + cicd verify -- [ ] 6. docs closeout → /pause (anh dặn) +- [x] 4. hmw INV-2 `wf_58302bd5-b9f` [IMPL-A ‖ IMPL-B] — 2/2 done **0-garble**: A = 4 file BE (+68/0 accumulator pure-add · DTO 5-field append · live-fill/frozen-defaults · D4 insertion-only +30/0, 5 call-site 0-diff) · B = 6 file FE (types ×2 · PeDetailTabs `5534addb`→`d28eaa16` ×2 · PeWorkflowPanel `a83a58e1`→`bebc0ada` ×2 · npm ×2 PASS) · lead re-verify: scope 10-file + hash + grep M2-enum/N8/D4 + filter S133 11/11 +- [x] 5. INV-3 `wf_97d6a582-b7e` [TEST-C] 1/1 0-garble — +8 `PePendingAccumulationTests` (C6 complementary exact-numbers), full **528/0** (45D+483I) + lead re-run độc-lập exit-0 · reviewer pre-commit `wf_8bb5abee-657` **PASS 0C/0M/4n** (tự chạy build+npm+filter; sub-reviewer-precommit.md) · squash §5.0 → `e53a693`+**`6664a61`** PUSHED (0 wal: lọt origin) +- [x] 6. cicd verify 6664a61 `wf_f366f38d-498` — **GO 5/5 CLEAN-return**: Run #399 5m27s · gate 528 exact-từ-log · Mig 67 frozen + 89 · bundle ×2 `BVCukFP5`/`CBzUlgOA` + `DoxyEOxh`/`BHsBUA8e` byte-verify 3-marker + control-0-hit · smoke 4×200 + PE 401 · lead spot-check độc-lập 4/4 khớp +- [x] 7. docs closeout — STATUS (528/bundle/Recently-Done S134) + HANDOFF (10 carry + UAT script + ⚑D1) + session-log + CLAUDE.md row-PE + close-synthesis.md (orphan ĐÓNG) + harvest 6 vai (2 impl @INV-2 + inv-cb on-behalf/test-spec/cicd/reviewer-precommit) — hook-cap ×3 dưới-cap không-nén (carry) +- [ ] 8. /pause (anh dặn "xong thì /pause") diff --git a/CLAUDE.md b/CLAUDE.md index dec8a1c..415a0fd 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -59,7 +59,7 @@ Kiến trúc: **.NET 10 Clean Architecture + 2 React FE (admin + user) + SQL Ser | Module | Namespace | Migration | Trạng thái | |---|---|---|---| | Contract (HĐ) | `Domain/Contracts/` | 1-11 | Feature-complete (7 ContractType × 9 phase) | -| PurchaseEvaluation (Duyệt NCC tiền-HĐ) | `Domain/PurchaseEvaluations/` | 12,13,15,49,50,52-61,65-67 | Feature-complete — +Hạng mục (Mig 49) +ngân sách per-gói-thầu role PRO/CCM (Mig 50) +Link hồ sơ NAS (Mig 52) +cờ gấp PRO/CCM + CCM duyệt-final theo ngưỡng (Mig 53) +giá đề xuất PRO/CCM + CCM-note (Mig 54/55) +PRO-split + ghi-chú-giá (Mig 56/57) +multi-winner liên-danh + level-finalize + NS-kỳ-CCM (Mig 58/59) +**`EndedByLevelFinalize` runtime-flag + backfill-fix (Mig 60/61, S97 — gotcha #78/#79)** +multi-NCC per-hạng-mục (Mig 65, S114 — gotcha #81) +duyệt-khoảng giá Min–Max (Mig 66, S117) +**freeze NS phiếu DaDuyet snapshot 11-cột + display-gate `budgetFrozen` (Mig 67, S133 — gotcha #81-EXT indirect-assignment)**. Export PDF pending | +| PurchaseEvaluation (Duyệt NCC tiền-HĐ) | `Domain/PurchaseEvaluations/` | 12,13,15,49,50,52-61,65-67 | Feature-complete — +Hạng mục (Mig 49) +ngân sách per-gói-thầu role PRO/CCM (Mig 50) +Link hồ sơ NAS (Mig 52) +cờ gấp PRO/CCM + CCM duyệt-final theo ngưỡng (Mig 53) +giá đề xuất PRO/CCM + CCM-note (Mig 54/55) +PRO-split + ghi-chú-giá (Mig 56/57) +multi-winner liên-danh + level-finalize + NS-kỳ-CCM (Mig 58/59) +**`EndedByLevelFinalize` runtime-flag + backfill-fix (Mig 60/61, S97 — gotcha #78/#79)** +multi-NCC per-hạng-mục (Mig 65, S114 — gotcha #81) +duyệt-khoảng giá Min–Max (Mig 66, S117) +**freeze NS phiếu DaDuyet snapshot 11-cột + display-gate `budgetFrozen` (Mig 67, S133 — gotcha #81-EXT indirect-assignment)** +**lũy kế TẠM TÍNH vs CHÍNH XÁC (S134, 0-mig — `ComputePendingAsync` complementary [ChoDuyet-winner vào tạm-tính, nháp list-only] + sub-dòng amber matrix + banner màn duyệt + D4 audit-note changelog)**. Export PDF pending | | ~~Budget (Ngân sách dự án)~~ | — | 14 → **Mig 50 DROP** | ⚠️ **REMOVED S61** — module Budget cũ XÓA, thay bằng PE-budget-per-gói-thầu (`PeWorkItemBudgets`). FE pages/types/menu `Bg_*` gỡ hết | | Master (Supplier/Project/Department) | `Domain/Master/` | 2, 10, 48, 51, 62-64 | Feature-complete — +Project fields Year/Investor/Location/Package (Mig 48) +Department.ParentId org-tree (Mig 51) +Supplier expand 30-field/import/publish-state (Mig 62-64) | | Identity (User/Role/Permission/MenuItem) | `Domain/Identity/` | 1, 3, 11 | Feature-complete (30 demo user — 16 sample + 14 Solutions thật) | diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md index aa1f835..42be496 100644 --- a/docs/HANDOFF.md +++ b/docs/HANDOFF.md @@ -2,7 +2,11 @@ > **Tiering rule (S40):** giữ **2-3 session gần nhất**. Cũ hơn → `docs/changelog/sessions/`. Full brief history pre-S40 → `docs/_archive/HANDOFF-preS40-fullhistory.md`. -**Last updated:** 2026-07-17 (S133 + closeout @S134 `/tiep` — **PE freeze ngân sách phiếu DaDuyet SHIP PROD `d4fbced` (16 file +7831/−63), CI Run #398 VERDICT GO 5/5, bundle rotate ×2 admin `3NCdyODe`/user `CKsoiNCI`.** UAT anh Kiệt FDC 07-16: cập nhật NS gói thầu làm phiếu ĐÃ DUYỆT đổi số theo → R1 DaDuyet bất biến [Mig 67 snapshot 11 cột chốt tại finalize + site-5 admin-override + backfill 18/18 prod] · R2 phiếu chưa duyệt đọc live "bản cập nhật gần nhất" [display-gate `budgetFrozen` + badge 🔒 FE 2-app SHA-mirror `5534addb`] · R3 no new table [89 giữ]. Reviewer PASS_WITH_FIXES 2 SHOULD = **#81-EXT indirect-assignment** (2 site gán Phase thẳng bypass choke-point → FIXED + test site-5). Test **509→520** (+11 `PeBudgetFreezeTests` T0 RED→GREEN + T1-T9 + site-5), FULL 520/0. ⚠️ #53 ×3 + lesson **sub-file overwrite khi 2 invocation cùng role+index chung run** (INV-A bị INV-C đè — đánh tên riêng per-invocation). S133 `/pause` giữa chờ cicd → S134 `/tiep` nối: verdict GO harvest-liền được **re-verify độc-lập 4/4 KHỚP** [mig prod top `20260717032812` + health 200 + bundle-hash ×2 + filter 11/11] → docs closeout + synthesis đóng orphan run-folder.) +**Last updated:** 2026-07-17 (S134 — **PE lũy kế TẠM TÍNH vs CHÍNH XÁC SHIP PROD `6664a61` (11 file: 4 BE + 6 FE + 1 test, 0 MIG), CI Run #399 GO 5/5 gate 528-exact, bundle rotate ×2 admin `BVCukFP5`/user `DoxyEOxh`.** UAT anh Kiệt chat 15/07 chốt "Vậy em xử lý theo hướng này đi": vì cung đặc thù, chia 2 số — TẠM TÍNH (tất cả phiếu cùng gói, phần chưa-duyệt sub-dòng amber + danh sách mã+badge) ⟂ CHÍNH XÁC (chỉ DaDuyet, GIỮ NGUYÊN 100% — `ComputeAsync` 0-diff by-construction, C6 exact-numbers guard); banner màn duyệt + nhắc lại trong dialog duyệt (gate `phase===ChoDuyet`, KHÔNG hard-block); D4 audit-note changelog `[S134 pending-prior]` lúc finalize. Pipeline anh chỉ định chạy TRỌN: `/fable-real invest` [#53-garble → sub-file 8-phần cứu, lần 3] → lead verify 7/7 + spec 3-heading → `/fable-real review` [GO_WITH_FIXES 0C/2M/9n → áp trọn spec v2] → **hmw Opus 4.8 MAX 3 lane 0-garble** [INV-2 BE‖FE + INV-3 test +8 → 528/0] → reviewer pre-commit **PASS 0C/0M** → **squash §5.0 trước push (9 wal: tiêu, 0 lọt origin)** → cicd GO 5/5 CLEAN-return + lead spot-check 4/4 khớp. ⚑ **D1 flag anh:** phiếu NHÁP chỉ vào danh sách cảnh báo (mã+badge), KHÔNG cộng tiền tạm-tính — muốn cộng cả nháp ("tất cả lun" nghĩa đen) thì báo em đổi 1 predicate.) +**Carry MỞ re-stamp (10):** (1) carry-age design-question `[carry:carry-age-vacuous]` (2) hook-cap — S133 ×2 (inv-cb 19.7K · reviewer 20.4K) + **S134 ×3 (inv-cb 20.5K · test-spec 20.4K · cicd 21.3K)** — TẤT CẢ dưới cap anh 25.6K/30.7K, em không tự nén (S122); cụm D6 phình dần, anh chốt hướng `[carry:hook-vs-budget-cap]` (3) UAT S117 incognito `[carry:uat-s117]` (4) PE phân-quyền số-phiếu+user `[carry:pe-phanquyen]` (5) BVAAU `[carry:bvaau]` (6) quyết-định Bình/Lê `[carry:binh-le-decision]` (7) Trà/Bùi re-login `[carry:tra-bui-relogin]` (8) account trùng `[carry:account-trung]` (9) UAT freeze-NS S133 `[carry:uat-s133-budget-freeze]` (10) 🆕 **UAT lũy-kế tạm-tính S134** `[carry:uat-s134-luyke]`. +**🔴 NEXT anh:** (1) 🆕 **UAT script lũy-kế tạm-tính (3 bước, incognito #77):** (a) đặt 2 phiếu cùng Dự án × Hạng mục — phiếu A **Đã gửi duyệt** (đã chọn NCC + giá), mở phiếu B → bảng "Tổng hợp ngân sách trình ký" row 2 + row 6 hiện sub-dòng **amber "Tạm tính: … (+X từ 1 phiếu chưa duyệt)"** + dưới bảng danh sách "A/0xx (Đã gửi duyệt)"; **số chính xác giữ nguyên**; (b) mở phiếu B ở màn duyệt → **banner amber "⚠ 1 phiếu trước cùng gói thầu CHƯA duyệt…"** + bấm Duyệt → dialog NHẮC LẠI ngay trên ô chọn giá — nút Xác nhận **KHÔNG bị khóa**; (c) duyệt phiếu A xong → mở lại B: sub-dòng tạm-tính biến mất, row 2 chính-xác TĂNG đúng phần A; phiếu ĐÃ DUYỆT bất kỳ: bảng giữ nguyên (freeze S133) `[carry:uat-s134-luyke]`; (2) UAT script freeze-NS S133 (3 bước — segment Prev) `[carry:uat-s133-budget-freeze]`; (3) ⚑ D1 nháp-không-cộng-tiền — gật giữ hay đổi; (4) hook-cap `[carry:hook-vs-budget-cap]`; (5) 2 đề-xuất S131 CHỜ GẬT + CHỜ HUB reply-batch (segment cũ). +**NEXT em (phiên kế):** watch `broadcasts/inbox`; spawn-probe reviewer Measured-label gate (post-restart, H1 #3); monthly combined audit 2026-08-01; nếu anh đổi D1 → sửa predicate `ComputePendingAsync` (delta-tiền thêm phase 1) + test C3 flip + deploy. +**Prev S133 (+closeout @S134 `/tiep`):** 2026-07-17 (S133 — **PE freeze ngân sách phiếu DaDuyet SHIP PROD `d4fbced` (16 file +7831/−63), CI Run #398 VERDICT GO 5/5, bundle rotate ×2 admin `3NCdyODe`/user `CKsoiNCI`.** UAT anh Kiệt FDC 07-16: cập nhật NS gói thầu làm phiếu ĐÃ DUYỆT đổi số theo → R1 DaDuyet bất biến [Mig 67 snapshot 11 cột chốt tại finalize + site-5 admin-override + backfill 18/18 prod] · R2 phiếu chưa duyệt đọc live "bản cập nhật gần nhất" [display-gate `budgetFrozen` + badge 🔒 FE 2-app SHA-mirror `5534addb`] · R3 no new table [89 giữ]. Reviewer PASS_WITH_FIXES 2 SHOULD = **#81-EXT indirect-assignment** (2 site gán Phase thẳng bypass choke-point → FIXED + test site-5). Test **509→520** (+11 `PeBudgetFreezeTests` T0 RED→GREEN + T1-T9 + site-5), FULL 520/0. ⚠️ #53 ×3 + lesson **sub-file overwrite khi 2 invocation cùng role+index chung run** (INV-A bị INV-C đè — đánh tên riêng per-invocation). S133 `/pause` giữa chờ cicd → S134 `/tiep` nối: verdict GO harvest-liền được **re-verify độc-lập 4/4 KHỚP** [mig prod top `20260717032812` + health 200 + bundle-hash ×2 + filter 11/11] → docs closeout + synthesis đóng orphan run-folder.) **Carry MỞ re-stamp (9):** (1) carry-age design-question `[carry:carry-age-vacuous]` (2) **hook-cap 17.1K — S133 bắn ×2 MỚI: inv-cb 19.7KB + reviewer 20.4KB, đều DƯỚI cap anh 25.6K/30.7K ⇒ em KHÔNG tự nén (S122), chờ anh chốt hướng** `[carry:hook-vs-budget-cap]` (3) UAT S117 incognito `[carry:uat-s117]` (4) PE phân-quyền số-phiếu+user `[carry:pe-phanquyen]` (5) BVAAU `[carry:bvaau]` (6) quyết-định Bình/Lê `[carry:binh-le-decision]` (7) Trà/Bùi re-login `[carry:tra-bui-relogin]` (8) account trùng `[carry:account-trung]` (9) 🆕 **UAT freeze-NS S133** `[carry:uat-s133-budget-freeze]`. **🔴 NEXT anh:** (1) 🆕 **UAT script freeze-NS cho anh Kiệt (3 bước, incognito #77):** (a) mở phiếu **ĐÃ DUYỆT** → thấy badge **🔒 "Ngân sách chốt tại thời điểm duyệt"**, bảng TỔNG HỢP NGÂN SÁCH **giữ nguyên số** sau khi PRO/CCM cập nhật NS gói thầu (từ phiếu khác cùng gói); (b) phiếu **CHƯA duyệt** cùng gói → thấy số **MỚI** ("ngân sách cập nhật gần nhất"); (c) thử sửa "NS kỳ này (CCM)" / "Điều chỉnh ngân sách" trên phiếu đã duyệt → lỗi **"Phiếu đã kết thúc — ngân sách đã chốt tại thời điểm duyệt, không sửa được nữa."** (chặn cả Admin) `[carry:uat-s133-budget-freeze]`; (2) 🟡 **hook-cap bắn ×2 phiên S133** (inv-cb 19.7K · reviewer 20.4K — dưới cap, em không tự nén) — anh chốt hướng `[carry:hook-vs-budget-cap]`; (3) 2 đề-xuất S131 CHỜ GẬT (wire tick H24 vào `/tiep` + light-run owner-triggered); (4) CHỜ HUB reply-batch (i)/seal-verify/do-token/closure-cadence — khi land em `/check-email` verify hash + áp canonical. **NEXT em (phiên kế):** watch `broadcasts/inbox`; spawn-probe reviewer Measured-label gate `reviewer.md:46` runtime-active (post-restart, H1 #3); monthly combined audit 2026-08-01; session-end khi anh gõ (squash `wal:` local trước push — 4 commit local đang chờ). diff --git a/docs/STATUS.md b/docs/STATUS.md index c8694a9..5d48d74 100644 --- a/docs/STATUS.md +++ b/docs/STATUS.md @@ -443,20 +443,34 @@ monthly re-tier mega-line + ef-core SKILL Mig→59 + 3 vocab-fork (2026-07-01 du | FE pages | **68** | unchanged S54 (ItTicketsPage reassign = in-place 2 app); +1 S52 AttendanceReportPage | | Policies | **216** | 🆕 **row MỚI S121** (wave adap-6-broadcast W2 — H24 GAP-3: `governance-detectors.ps1` `Get-StatusValue` resolve canonical TỪ bảng này; **KHÔNG có row ⇒ token `policy` UNRESOLVED ⇒ nửa `policy` của GAP-3 không thể fire** ⇒ detector khai FAIL-LOUD + SKIP, KHÔNG im-lặng-giả-vờ-xanh). 🔴 **DERIVED, KHÔNG độc-lập:** `Policies = |MenuKeys.All| × |MenuKeys.Actions| = 54 × 4 = 216` — sinh runtime ở `src/Backend/SolutionErp.Api/Program.cs:82-89` (`foreach menu → foreach action → opts.AddPolicy($"{menu}.{action}")`), `Actions = ["Read","Create","Update","Delete"]` (`MenuKeys.cs:167`). ⇒ **row này BUỘC đổi CÙNG row `Menu keys`**: thêm 1 menu key ⇒ 55 × 4 = 220; sửa `Menu keys` mà quên `Policies` ⇒ detector flag derived-doc thay vì flag chính chỗ sai. Ground S121 bằng đếm mã-nguồn (`MenuKeys.All` = 54 entry, `public const string` = 54, khớp) — KHÔNG chép số từ spec. ⚠️ `.claude/skills/permission-matrix/SKILL.md` ghi **~240 = STALE** ⇒ W4 vá (🔴 chuỗi H24 §2(4) BẮT BUỘC: detector fire → cổng chứng-kiến → RỒI MỚI vá; vá trước = giết chứng-nhân sống) | | Menu keys | **54** | +1 S69 `Off_Dashboard` (landing Văn phòng số). Prev re-ground S61 (`MenuKeys.cs` const — Mig 50 gỡ 4 `Bg_*` Budget menu cũ). Prev 57 (S58) | -| Tests | **520 PASS** | 45 Domain + 475 Infra · 0 fail / 0 skip · **S133 +11** (`PeBudgetFreezeTests` freeze-NS-at-DaDuyet: **T0 repro test-before RED→GREEN** [phiếu DaDuyet phải giữ số cũ sau `UpdatePeBudgetPro` — RED bắt 999tr @:184 pre-fix, phiếu đưa tới DaDuyet QUA service finalize mirror `PeApproverFinalizeTests` KHÔNG seed thẳng Phase] + **T1-T9** spec-coverage [snapshot các nhánh finalize + display-gate + 2 terminal-guard chặn sửa NS phiếu đã kết thúc (cả Admin) + backfill] + **site-5 AdminOverride** [reviewer catch — override thẳng → DaDuyet cũng chốt snapshot]) · **S118 +8** (PRO-perm scope-isolation **+4** `ProcurementMasterAccessSeedTests` [reflection no-prod-touch: upgrade-path Suppliers R+C+U + Master-Read · **scope-isolation** DeptManager-riêng vẫn revoke=false · insert-path no-Delete · idempotent] · ReportsController authz **+4** `AuthorizePolicyRegressionTests` [dashboard/export require Reports.Read · my-dashboard KHÔNG action-policy · class-level [Authorize] intact]) · **S117 +6** (PE endsBeforeCeo pointer-aware **+1** `PeFinalizeProjectionTests.ListPe_EndsBeforeCeo_ChoDuyet_PointerAware_PastFinalizeIsFalse` [ChoDuyet con-trỏ QUA cấp finalize → endsBeforeCeo=false, test-before RED→GREEN + EF-subquery translate smoke] · duyệt-theo-khoảng ProMinMax **+5** `PeApprovedPriceFinalizeTests` [happy set Min+Max · min==max boundary lock strict-`>` · thiếu-Max→Conflict not-finalized · min>max→Conflict · single-source+Max→Conflict wire-bug + regression Max=null] · harness `InvokeApply` 4→5 args fix TargetParameterCountException) · **S116 +9** (PE nhập giá âm: T1 ngân-sách-bất-biến khi quote-âm · T2 winnerQuoteTotal signed-sum · T3 submit-guard all-zero-blocked/pure-neg+net-zero-submittable · T4 CCM-net-threshold) · **S114 +9** (PE multi-NCC per hạng mục: `PeSelectWinnerClearTests` delete-invariant +4 [DeleteQuote/DeleteDetail re-derive IsWinner **test-before RED→GREEN** + guard-no-over-clear + UpsertQuote-update-branch coverage] + impl-lane +5 [per-hạng-mục-total · giaTri-single-partial · threshold-crossing · derive-invariant]) · **S113 +19** (Supplier import v2: `SupplierImportV2DedupTests` 13 [dedup MST-primary+Code-backstop T1-T7 · draft-on-import IsPublic · all-or-nothing · LayoutValid re-bake real-token · **null-Code→nháp FIXED** flipped-from-characterization] + `SupplierPublishAndListTests` 6 [publish-guard Code-required→409 · unpublish · list-filter published · DTO IsPublic]) · **S112 +18** (Supplier `SupplierExcelImportServiceTests` +10 [case-collation dedup có-RĂNG SQLite-BINARY-collation-nên-chứng-dedup-ở-SERVICE · fill-nulls-safe · all-or-nothing-abort · parser abs-cell-index/#REF!-null/header-fingerprint · Type-lạ→NCC · Status-emoji-strip] · PE `PeSubmitGuardAndBypassTests` 4-update→A1 [minOwn subordinate-only, pointer-stop] + 8-new [A1-happy · non-contiguous · EDGE-5 non-admin-throw/admin-pass/system-pass · opinion-history log/none]) · Prev 440: **S96 +6** (PE `PeApproverFinalizeTests` +2 [#6 finalize-opt-out→advance-CEO · #7 stale-noti-clear ExecuteUpdate] · `PeSuggestedPriceSetterAuthzTests` +4 [price-lock phase-guard after-submit — PRO/CCM ChoDuyet/DaDuyet→Conflict, Admin-override; +sửa SeedPeAsync default ChoDuyet→DangSoanThao spec-change]) · **S92 +3** (`AdminOnlyModulesRevokeTests` ẩn 5 nhóm menu chỉ Admin — non-Admin revoked-4-cờ / Admin untouched / Pe_* preserved) · **S91 +9** (ChangePassword self-service BE+test) · **S89 +3** (`PeDraftVisibilityTests` IDOR nháp riêng-tư) · **S88 +17** (D1 financials/CEO-notify/HoSoLink null-safe +11 · D2 create-contract multi-winner +6) · **S87 +25** (Mig 58 net +18: `PeMultiWinnerTests` sum + `PeSelectWinnerClearTests` multi-update + `PeSubmitGuardAndBypass` budget=0 + `PeApproverFinalizeTests` 5 auto-finalize [từng 7, −2 khi opt-in→auto rework] + `PeCcmThresholdFinalize`/`PeWorkItemBudget` collateral; Mig 59 +7 `PeCcmBudgetPeriodSetterAuthzTests` role-gate Admin|CCM/budget=0/null-clear) · **S86 +3** (`PeApproverNotifyExcludesDrafterTests` — notify "cần duyệt" loại NGƯỜI TẠO phiếu: drafter-excluded · co-approver-vẫn-nhận · drafter-vẫn-nhận-chuông-kết-quả) · **S85 +18** (PE CV PRO C5 hủy/đổi NCC winner +10 · urgent drafter-self-unset +5 · workflow-preserve bug-class S42 +3 `PeUpdateDraftWorkflowPreserveTests`) · **S83 +2** (PE require-workflow: `PeWorkItemGuardTests` ApprovalWorkflowId `NotEmpty` ×2 validator + submit-guard rewrite test 7/13 `PeSubmitGuardAndBypass` V1-submit-deprecated, no-count-change) · **S77 +10** (+7 `PeSuggestedPriceSetterAuthzTests` ghi chú PRO/CCM Mig 57 absolute-set/role-gate/null-clear/max-1000 · +3 `PeUrgentToggleAuthzTests` rewrite cờ-gấp **BẤT ĐỐI XỨNG** SET=function role / UNSET=function+DeptManager, plain-PRO-unset Forbidden) · **S76 +5** (`PeWorkItemBudgetTests` PRO split: set ProInitial+ProAdjust gồm âm · validator ProInitial≥0/ProAdjust-cho-âm · full=proFull khi CCM empty · full=CCM khi CCM present) · **S74 +5** (`PeWorkItemBudgetTests` §4b CcmNote: set CCM/Admin · null-clear absolute-set · non-priv Forbidden+no-mutate · all-3-persist) · **S73 +28** (PE opt-in finalize spec 6→11 + 10 giá-chốt `PeApprovedPriceFinalizeTests` + 13 setter-authz `PeSuggestedPriceSetterAuthzTests`) · **S69 +20** (Office-golive OfficeModulePermissionSeed 6 + PE PeCcmThresholdFinalize 5 + PeUrgentToggleAuthz 9) · **S67 +23 HRM test-after** (DepartmentTreeTests 8 cycle-guard/rollup + PeHoSoLinkTests 9 absolute-set + HrmProfilePermissionSeedTests 6 reflection-seed) → 286 · S61 +22 `PeWorkItemBudgetTests` −14 `BudgetPolicyTests` −1 → 263 · S60 +14 `PeSubmitGuardAndBypassTests` +2 spec → 256 (Domain 58→45 do drop Budget module tests) | +| Tests | **528 PASS** | 45 Domain + 483 Infra · 0 fail / 0 skip · **S134 +8** (`PePendingAccumulationTests` C1-C8 lũy-kế-TẠM-TÍNH: C1 ChoDuyet+winner vào delta-selected + PriorPes · C2 TuChoi/DaDuyet loại sạch · C3 Nháp list-only KHÔNG cộng tiền [D1] + TraLai vào delta-submitted [D2] · C4 peer-window CreatedAt · C5 delta âm signed · **C6 complementary-no-double-count exact-numbers [ComputeAsync bất động khi thêm peer non-terminal]** · C7 frozen→pending 0/null · C8 D4 changelog `[S134 pending-prior]` positive+contrast) · **S133 +11** (`PeBudgetFreezeTests` freeze-NS-at-DaDuyet: **T0 repro test-before RED→GREEN** [phiếu DaDuyet phải giữ số cũ sau `UpdatePeBudgetPro` — RED bắt 999tr @:184 pre-fix, phiếu đưa tới DaDuyet QUA service finalize mirror `PeApproverFinalizeTests` KHÔNG seed thẳng Phase] + **T1-T9** spec-coverage [snapshot các nhánh finalize + display-gate + 2 terminal-guard chặn sửa NS phiếu đã kết thúc (cả Admin) + backfill] + **site-5 AdminOverride** [reviewer catch — override thẳng → DaDuyet cũng chốt snapshot]) · **S118 +8** (PRO-perm scope-isolation **+4** `ProcurementMasterAccessSeedTests` [reflection no-prod-touch: upgrade-path Suppliers R+C+U + Master-Read · **scope-isolation** DeptManager-riêng vẫn revoke=false · insert-path no-Delete · idempotent] · ReportsController authz **+4** `AuthorizePolicyRegressionTests` [dashboard/export require Reports.Read · my-dashboard KHÔNG action-policy · class-level [Authorize] intact]) · **S117 +6** (PE endsBeforeCeo pointer-aware **+1** `PeFinalizeProjectionTests.ListPe_EndsBeforeCeo_ChoDuyet_PointerAware_PastFinalizeIsFalse` [ChoDuyet con-trỏ QUA cấp finalize → endsBeforeCeo=false, test-before RED→GREEN + EF-subquery translate smoke] · duyệt-theo-khoảng ProMinMax **+5** `PeApprovedPriceFinalizeTests` [happy set Min+Max · min==max boundary lock strict-`>` · thiếu-Max→Conflict not-finalized · min>max→Conflict · single-source+Max→Conflict wire-bug + regression Max=null] · harness `InvokeApply` 4→5 args fix TargetParameterCountException) · **S116 +9** (PE nhập giá âm: T1 ngân-sách-bất-biến khi quote-âm · T2 winnerQuoteTotal signed-sum · T3 submit-guard all-zero-blocked/pure-neg+net-zero-submittable · T4 CCM-net-threshold) · **S114 +9** (PE multi-NCC per hạng mục: `PeSelectWinnerClearTests` delete-invariant +4 [DeleteQuote/DeleteDetail re-derive IsWinner **test-before RED→GREEN** + guard-no-over-clear + UpsertQuote-update-branch coverage] + impl-lane +5 [per-hạng-mục-total · giaTri-single-partial · threshold-crossing · derive-invariant]) · **S113 +19** (Supplier import v2: `SupplierImportV2DedupTests` 13 [dedup MST-primary+Code-backstop T1-T7 · draft-on-import IsPublic · all-or-nothing · LayoutValid re-bake real-token · **null-Code→nháp FIXED** flipped-from-characterization] + `SupplierPublishAndListTests` 6 [publish-guard Code-required→409 · unpublish · list-filter published · DTO IsPublic]) · **S112 +18** (Supplier `SupplierExcelImportServiceTests` +10 [case-collation dedup có-RĂNG SQLite-BINARY-collation-nên-chứng-dedup-ở-SERVICE · fill-nulls-safe · all-or-nothing-abort · parser abs-cell-index/#REF!-null/header-fingerprint · Type-lạ→NCC · Status-emoji-strip] · PE `PeSubmitGuardAndBypassTests` 4-update→A1 [minOwn subordinate-only, pointer-stop] + 8-new [A1-happy · non-contiguous · EDGE-5 non-admin-throw/admin-pass/system-pass · opinion-history log/none]) · Prev 440: **S96 +6** (PE `PeApproverFinalizeTests` +2 [#6 finalize-opt-out→advance-CEO · #7 stale-noti-clear ExecuteUpdate] · `PeSuggestedPriceSetterAuthzTests` +4 [price-lock phase-guard after-submit — PRO/CCM ChoDuyet/DaDuyet→Conflict, Admin-override; +sửa SeedPeAsync default ChoDuyet→DangSoanThao spec-change]) · **S92 +3** (`AdminOnlyModulesRevokeTests` ẩn 5 nhóm menu chỉ Admin — non-Admin revoked-4-cờ / Admin untouched / Pe_* preserved) · **S91 +9** (ChangePassword self-service BE+test) · **S89 +3** (`PeDraftVisibilityTests` IDOR nháp riêng-tư) · **S88 +17** (D1 financials/CEO-notify/HoSoLink null-safe +11 · D2 create-contract multi-winner +6) · **S87 +25** (Mig 58 net +18: `PeMultiWinnerTests` sum + `PeSelectWinnerClearTests` multi-update + `PeSubmitGuardAndBypass` budget=0 + `PeApproverFinalizeTests` 5 auto-finalize [từng 7, −2 khi opt-in→auto rework] + `PeCcmThresholdFinalize`/`PeWorkItemBudget` collateral; Mig 59 +7 `PeCcmBudgetPeriodSetterAuthzTests` role-gate Admin|CCM/budget=0/null-clear) · **S86 +3** (`PeApproverNotifyExcludesDrafterTests` — notify "cần duyệt" loại NGƯỜI TẠO phiếu: drafter-excluded · co-approver-vẫn-nhận · drafter-vẫn-nhận-chuông-kết-quả) · **S85 +18** (PE CV PRO C5 hủy/đổi NCC winner +10 · urgent drafter-self-unset +5 · workflow-preserve bug-class S42 +3 `PeUpdateDraftWorkflowPreserveTests`) · **S83 +2** (PE require-workflow: `PeWorkItemGuardTests` ApprovalWorkflowId `NotEmpty` ×2 validator + submit-guard rewrite test 7/13 `PeSubmitGuardAndBypass` V1-submit-deprecated, no-count-change) · **S77 +10** (+7 `PeSuggestedPriceSetterAuthzTests` ghi chú PRO/CCM Mig 57 absolute-set/role-gate/null-clear/max-1000 · +3 `PeUrgentToggleAuthzTests` rewrite cờ-gấp **BẤT ĐỐI XỨNG** SET=function role / UNSET=function+DeptManager, plain-PRO-unset Forbidden) · **S76 +5** (`PeWorkItemBudgetTests` PRO split: set ProInitial+ProAdjust gồm âm · validator ProInitial≥0/ProAdjust-cho-âm · full=proFull khi CCM empty · full=CCM khi CCM present) · **S74 +5** (`PeWorkItemBudgetTests` §4b CcmNote: set CCM/Admin · null-clear absolute-set · non-priv Forbidden+no-mutate · all-3-persist) · **S73 +28** (PE opt-in finalize spec 6→11 + 10 giá-chốt `PeApprovedPriceFinalizeTests` + 13 setter-authz `PeSuggestedPriceSetterAuthzTests`) · **S69 +20** (Office-golive OfficeModulePermissionSeed 6 + PE PeCcmThresholdFinalize 5 + PeUrgentToggleAuthz 9) · **S67 +23 HRM test-after** (DepartmentTreeTests 8 cycle-guard/rollup + PeHoSoLinkTests 9 absolute-set + HrmProfilePermissionSeedTests 6 reflection-seed) → 286 · S61 +22 `PeWorkItemBudgetTests` −14 `BudgetPolicyTests` −1 → 263 · S60 +14 `PeSubmitGuardAndBypassTests` +2 spec → 256 (Domain 58→45 do drop Budget module tests) | | Gotchas | **83** | **+S133 #81-EXT** (instance 2 indirect-assignment, KHÔNG số mới: snapshot-NS-at-DaDuyet hook đặt ở finalize choke-point NHƯNG 2 site gán Phase TRỰC TIẾP bypass — admin-override `PurchaseEvaluationWorkflowService.cs:308` `= targetPhase` + seeder `DbInitializer:1323` `= current` → phiếu vào DaDuyet qua 2 đường này KHÔNG snapshot [frozen=0, display rơi về live = đúng bug đang vá]; reviewer adversarial bắt pre-commit, em-main + 3 invocation implement đều sót — cùng bài enumeration-writer #81; meta: field-đích có hook/derive/snapshot ⇒ grep MỌI assignment-site kể cả override/seeder). +1 S126 (**#83** số AGGREGATE session-cumulative tự-lão-hoá — audit COUNTS đổi bởi CHÍNH spawn review sau đó [2/2/0→4/4/0]; outward mời-reproduce = bảng per-lane theo run-id, KHÔNG số tổng; reviewer-gate bắt, em-main-solo sót). +1 S118 (**#82** menu-flag grant ≠ quyền API thật: display-layer [Permission `CanRead`→`GetMyMenuTree` FE-menu] ⟂ API-authz-layer [controller `[Authorize(Policy=)]`] = 2 tầng ĐỘC-LẬP; grant `Suppliers` R+C+U cho PRO nhưng `PUT/DELETE /suppliers` gate `[Authorize(Roles="Admin,CatalogManager")]` → PRO vẫn 403 sửa/xóa NCC [chỉ Publish/Import theo `Suppliers.Update` là ăn]; ngược lại `ReportsController` `[Authorize]` trần → mọi authed-user đọc `dashboard` tài-chính-HĐ ngược S92; fix gate `[Authorize(Policy="Reports.Read")]` per-method + grep controller authz TRƯỚC khi tin hiệu-lực grant; reviewer adversarial bắt, em-main-solo tin menu-flag=quyền thì sót; liên-quan #44). +1 S114 (**#81** derived-invariant re-derive ở write/select NHƯNG SÓT DELETE writer [DeleteQuote/DeleteDetail cascade] → xóa quote-selected cuối của NCC → `Supplier.IsWinner` kẹt stale [Any(IsSelected)=false] → `CreateContract Where(IsWinner)` gom NCC phantom → **HĐ giaTri=0**; fix helper `PeWinnerInvariant.ReSyncAfterQuoteRemovalAsync` gọi sau SaveChanges 2 handler; **enumeration-writer-trong-spec KHÔNG đáng tin** → grep MỌI `.Remove(`/`.Add(`/`=field` chạm entity chứa field-nguồn; chỉ **verify-adversarial-refute** bắt [invest/review/implement đều sót]; cardinality S87/S88 lên tầng mutation-path). +1 S113 (**#80** null-forgiving `!` che NRE trên external-parsed data: `SupplierExcelImportService.NewSupplier` gán `Code = r.Code!.Trim()` → NullReferenceException khi parser trả `null` cho ô cột-4 rỗng [ĐÚNG path R4 "thiếu Mã NCC → nháp"] → confirm nổ 500 CẢ batch dù preview classify New-draft KHÔNG lỗi; sibling `IsPublic=!IsNullOrWhiteSpace(row.Code)` null-safe nhưng NewSupplier thì KHÔNG; empty-string `""` chạy OK nhưng FE round-trip blank→JSON `null` → nổ. Fix `(r.Code ?? "").Trim()`. **Build 0/0 KHÔNG bắt** [`!` tắt nullable-warning]; chỉ test-before-critical bắt. Lesson: `!` null-forgiving trên dữ-liệu-parse-ngoài = mìn, dùng `?? default`). +1 S97 (**#79** backfill soi NHẦM bảng — transition-marker "[Duyệt KẾT THÚC]" nằm ở `PurchaseEvaluationChangelogs.ContextNote` KHÔNG phải `PurchaseEvaluationApprovals` → Mig 60 backfill match 0, phiếu finalize-CCM giữ flag=0 hiện sai "Đã được CEO duyệt"; fix Mig 61 query đúng bảng. PE 2 bảng lịch-sử tách vai [Approvals=ai-duyệt record :745 · Changelogs=chuyển-phase+marker LogTransition :1073]; verify marker-count prod trước khi tin backfill). +1 S97 (**#78** display-flag suy CONFIG thay RUNTIME → nói dối khi instance lệch config: `endsBeforeCeo` từ "workflow CÓ cấp finalize" thay "phiếu NÀY finalize" → phiếu lên CEO báo sai "không qua CEO"; nặng sau S97 default-flip opt-in; fix field runtime `EndedByLevelFinalize` Mig 60. Flag = "instance ĐÃ làm-gì" KHÔNG "config CÓ THỂ"). +1 S96 (**#77** SPA deploy bundle cache-lag: team thấy UI CŨ dù đã deploy + Ctrl+F5 — index.html no-cache ĐÚNG-chuẩn + JS hash-immutable nhưng browser giữ tab-SPA-mở/cache-local → verify bundle prod **BYTE-LEVEL** (curl + grep string-fix trong `/assets/index-.js`) phân-biệt cache-vs-deploy; **incognito = golden-test**; no-service-worker nên clear-site-data đủ). +2 S91 (**#76** deploy render config từ `.example` KHÔNG phải file-gitignored → prod thiếu setting tới khi điền tay · **#75** seed ungated per-code RESURRECT data đã-wipe mỗi restart → gate sau env-flag `DemoSeed:Disabled` + verify-by-restart-thật). +1 S90 (**#74** Chrome-MCP screenshot kẹt SPA-SignalR `document_idle` → PowerShell `CopyFromScreen` + Win32 lọc-process-`chrome.exe`). +2 S85 (**#72** lệch giờ +7h — DateTime lưu UTC nhưng serialize thiếu 'Z' → FE `new Date()`=local → `UtcDateTimeJsonConverter` global ép UTC-with-Z · **#73** UpdateDraft absolute-set CLEAR field SÓT khỏi pattern null-safe = bug-class S42 → guard `if (request.X is not null)`). +1 S78 **#71** (thêm enum value vào entity DÙNG-CHUNG → pollute UI/guard phân-loại theo PROXY-predicate `supplierId===null` thay vì enum tường minh; file-khi-duyệt purpose=5 lẫn "Bảng so sánh" + false-pass submit-guard → grep mọi field-proxy predicate loại value mới + build-verify TỪNG app; em-main grep no-leak bắt trước deploy). +1 S76 **#70** (FE absolute-set echo field anh-em từ server-snapshot + `invalidate()` fire-and-forget → cửa-sổ stale-echo mất-dữ-liệu khi lưu 2 ô liên-tiếp; guard `useIsFetching` gate nút Lưu tới khi refetch land; reviewer workflow bắt, impl self-review sót). +1 S72 **#69** FE bundle-hash non-deterministic + `deploy.yml` rebuild-FE-unconditional → bundle rotate kể cả commit governance (SPA-fallback-200 trap; cicd Run #312). +2 S69: **#67** Tailwind v4 accent palette thiếu stop (teal/violet/amberx/greenx chỉ 50/100/500/600/700; dùng -300 → teal/violet rơi DEFAULT Tailwind sai-hệ, amberx/greenx drop hẳn — build PASS, phải soi dist CSS) · **#68** IDE TS diagnostic giữa background-agent/workflow = snapshot dở-dang (TS server bắn mỗi save), chỉ tin build SẠCH sau-cùng (2× session này: re-skin + PE-FE đều false-alarm). Prev +1 S68 **#66** Tailwind v4 rule element thô `h1-h4{color:#0b1220}` viết NGOÀI `@layer` thắng utility `text-white` → heading render đen; fix ĐIỂM `text-white!` (important, grep dist confirm), KHÔNG move `@layer` (load-bearing ~30+ heading toàn app). Prev +1 S65 **#65** build csproj con (vd `SolutionErp.Api.csproj`) ≠ `dotnet build SolutionErp.slnx` (gồm tests) → miss test-compile khi đổi chữ ký record command (CreateDepartmentCommand +ParentId) → CI CS7036 FAIL-gated Run #291 (deploy chặn, prod nguyên — test-gate làm đúng việc). Fix: build full slnx trước push BE signature-change. Prev +2 S61: **#63** EF scaffold tự sinh `RenameColumn` SAI-semantics khi drop+add cùng type (test xanh không bắt — SQLite EnsureCreated không replay migration) · **#64** `dotnet ef database update` áp Design-DB 0-rows ≠ Dev-DB → data-migrate `Sql()` chạy thật lần đầu trên prod. Prev +2 S59 (#61 sqlcmd `-f 65001` · #62 rename natural-key UPDATE trước deploy) | | User memory | **31** | +S84 `feedback_derived_flush_execution` (derived→canonical flush = em-main execution KHÔNG gate user-confirm; monitor INFORM-only ≠ cần-anh-duyệt; chỉ ĐỔI-con-số/policy = quyền anh). +S79 `feedback_canonical_spec_over_broadcast` (adap pull canonical-command/§P đừng phỏng-theo broadcast + report-before-stamp dogfood + residual own-diary OK). +S75 `feedback_harness11_engine` (engine governance tự-bảo-trì + gotcha #30-via-Edit + multi-workflow-verify + git-add-specific lesson). re-ground S71 (H1 disk-count: 25 `feedback_*` + 3 `project_*`; STATUS "21" stale từ S64). +S71 `feedback_harness10_run_trace` (run-trace + 3 lesson). Prev +1 S64 `feedback_harness7_outward_writing_quality`; re-grounded S54 base 19 | | Skills | 6 | 3 domain + 3 ops | | Sub-agents | **14** | **+S121 👁 `lead-view-auditor` + `lead-omission-auditor` (13th+14th sub — H24 lead-self-audit, adopt broadcast `2026-07-14-Governance-harness-24`, anh chốt S119 `owner-decisions-15-07-2026`, land S121 wave-W2 `hmw.js` VALID_ROLES 12→14 CÙNG COMMIT roster+STATUS [R3-M2: lệch landing ⇒ C2/B3 flag mọi derived ghi "14" là stale-vs-12 ⇒ detector BÃO trên chính thay đổi của H24]). 2 monitor INFORM-only propose-only, cookie-cutter frontmatter monitor sẵn (`model: inherit` lúc-land [S124 re-pin → `opus`+`effort:max` cùng toàn roster] · `memory: project` · `maxTurns: 18` · 8 tool read-only, **NO Write/Edit**). Trục: `lead-view-auditor` = **view LỆCH source** (5 class `view-*`) ⟂ `lead-omission-auditor` = **cái BỊ THIẾU** (5 class `gap-*`) — 🔴 **KHÔNG gộp** vào tooling-auditor(H1 tooling-freshness)/harvest-curator(H2 harvest-integrity): H24 §2(1) *"gộp là mất tiêu-điểm; cái ta cần là cặp mắt CHỈ dành cho lead"*. Class-flag = **enum ĐÓNG** `lead_self_audit.flag_classes` ở `.claude/agent-memory/memory-budget.json` (10 class = 5+5, vai CẤM tự chế). Nhịp = `h24_cadence` {light 6/deep 15/jump 3} cùng file (single-source H24 §2(3) — doc TRỎ key, KHÔNG chép số); counter `.claude/governance/.session-counter.json` (content-based `last_ticked_head`, KHÔNG blind-increment — hook `wal-flush.ps1` auto-commit `agent-memory/` mỗi turn sẽ làm hỏng đếm mù; đặt ngoài 3 path hook CÓ CHỦ-ĐÍCH). ⚠️ **CHƯA verified-runtime** — registry = ảnh-chụp khởi-phiên (S120/S121 đo lại, xác nhận nhánh KHÔNG hot-reload agent MỚI) ⇒ 14/14 spawn-probe **PHẢI chạy SAU RESTART** (static-check KHÔNG đủ — broadcast ④d). 🔸 Từ-vựng "view"/"omission" chọn có chủ-đích tránh va-chạm: `governance-detectors.ps1:15` đã sở-hữu `derived-staleness`, và "GAP" quá-tải (`session-end` build-gap · `memory-selfimprove-audit.ps1` CRITERIA+GAP).** **+S107 📄 `office-document` (12th sub — Office document WRITE specialist: docx·xlsx·pptx·pdf + form-engine; floor OD1–OD10; VALID_ROLES hmw.js 9→10; anh giao trực tiếp S107 "Sub chính" Office; ✅ **verified-runtime S107 CÙNG PHIÊN** — registry hot-reload agent MỚI giữa phiên [S27 lesson thu hẹp còn EDIT-agent/command] + spawn-test PASS OD1/OD4/OD5 template thật, model self-report `claude-fable-5` [data-point #5 flip-8]; finding: 2 template `wwwroot/templates` 0-placeholder mẫu-blank).** **worker-tier-pin (owner-decision S124 2026-07-15 — thay all-inherit H8 S66, trước nữa two-tier H4; sub 14/14 pin cứng KHÔNG theo lead; H23-precedence ĐO S126: spawn-param THẮNG hard-pin ⇒ `/fable-real` SỐNG). Lead = frontier-class owner-choice per-session:** em main Fable 5 (1M) Max (✅ **Fable RESTORED S98 2026-07-02** — lead self-report `claude-fable-5` + settings `claude-fable-5[1m]`; fallback-Opus H5 S62→S97 kết thúc, H5.6 hoàn tất) ⚠️ **S101 2026-07-03: runtime lead = Opus 4.8** (lead + 2 monitor + WF2 reviewer inherit đều self-report `claude-opus-4-8`; settings vẫn pin `claude-fable-5[1m]` → **Fable unavailable phiên này → H5-fallback tự-kích, revert-free, KHÔNG sửa frontmatter**; "Fable RESTORED S98" = point-in-time KHÔNG phải steady-state — inherit-chain resolve theo availability runtime; ✅ **S102 2026-07-06: Fable VỀ LẠI runtime** — lead + 2 monitor inherit self-report `claude-fable-5` → H5-fallback S101 kết thúc, pattern availability per-session xác nhận [S98 Fable → S101 Opus → S102 Fable → **S103 Opus** → **S104 Opus** (2026-07-06 Fable outage tiếp — S104 lead + 2 monitor spawn self-report `claude-opus-4-8` ×3, H5-fallback revert-free) → ✅ **S105 Fable** (2026-07-07 Fable VỀ lần 3 — lead + 2 monitor self-report `claude-fable-5` ×3, runtime-verified) → ⚠️ **S106 Opus** (2026-07-07 Fable outage lại — lead runtime self-report `claude-opus-4-8`, H5-fallback revert-free; flip-7) → ✅ **S107 Fable** (2026-07-10 Fable VỀ lần 4 — lead + 2 monitor self-report `claude-fable-5` ×3, runtime-verified; flip-8)], BƯỚC 0.6 probe mỗi phiên; per-session KHÔNG steady-state. 🔴 **[§Sub-agents = CANONICAL single-owner flip-chain — S106 gộp per anh-confirm; derived `agents/README:3` · `session-start:37` · `session-end:113` trỏ về đây, KHÔNG tự enumerate mỗi flip → chống churn 4-file/flip]**) · **TOÀN roster `model: opus` + `effort: max`** (worker-tier-pin S124; **A2 đo S126:** lane no-tier resolve `claude-opus-4-8` DÙ lead=Fable ⇒ pin ăn runtime, hết inherit-lead; số vai = cột giữa của chính row này — KHÔNG chép lại vào narrative, đó là cách row-14 và narrative-12 lệch nhau từ S121 tới S122; lineage: 7 demoted flip S66 → all-inherit S66–S123 [office-document S107 inherit-born] → pin S124) · effort Max. 10 product/quality + 4 monitor INFORM-only (H1·H2 + 2 H24 S121). Nấc H8 = **runtime-verified S98 (2026-07-02)** — spawn-test inherit-chain ×2 monitor self-report `claude-fable-5` (cả đội tự lên Fable khi lead restore, 0 sửa frontmatter — đúng thiết kế all-inherit). Prev two-tier H4 runtime-verified S57bis (spawn-test 2 chiều). | | RAG chunks | **2441** | re-verify S126 (`list_projects` — alive, +12 vs S80's 2429; rerank 0.92 top-hit check OK). Stale `last_indexed 05-29` (store_memory stopgap; full re-index = AI_INFRA op cần VOYAGE_API_KEY). | -**Bundle hash live (prod):** admin **`3NCdyODe`** · user **`CKsoiNCI`** (S133 — **`d4fbced`** PE freeze NS phiếu DaDuyet [Mig 67 snapshot 11 cột + backfill 18/18 + FE 2-app badge 🔒 SHA-mirror `5534addb` + display-gate `budgetFrozen`]; **Run #398** GO 5/5 gate-520 rotate ×2 admin →**`3NCdyODe`** [CSS `B--dUHcm`] / user →**`CKsoiNCI`** [CSS `BuntB63r`] — prev `yCkX-2Bp`/`DKSD4p9k` @Run #397 S131-S132 [dòng-live lag S117→S133, hoist per precedent S104/S107]; **CSS cũng rotate** = badge sinh utility-class mới, benign #69; **byte-verify #77** `budgetFrozen`=1 + VN-string 🔒=1 PRESENT [old-control 0]; Mig 67 prod history-top + 11 cột + backfill 18/18 chua=0 + sys.tables **89**; smoke 4×200 + PE 401; `/tiep` S134 re-verify độc-lập 4/4: mig-top + health-200 + bundle-hash ×2 + filter 11/11). **Prev S117** — admin **`cFI7ih4a`** · user **`MxgooVZw`** (S117 — **`316a82f`** PE endsBeforeCeo pointer-aware [display-fix BE-only, phiếu chờ CEO hết báo "Kết thúc" sai] + duyệt-theo-khoảng Min–Max [Mig 66 + FE 2-app ProMinMax radio thứ 5]; **Run #387** PASS 5m36s rotate ×2 admin `Dd55jBpj`→`cFI7ih4a` / user `DVDr1UQ4`→`MxgooVZw` CSS-frozen [logic-only fingerprint]; **byte-verify #77** `ProMinMax`/`duyệt theo khoảng`/`cả Min và Max`/`Min–Max` PRESENT [bundle-cũ=0]; Mig 66 prod col decimal(18,2) + `__EFMigrationsHistory`-top + sys.tables **89**; smoke 200×3 · PE 401-secured; **#53-garble ×2** [invest-lane-1 + cicd-monitor] → SendMessage-resume + em-main curl cross-verify khớp). **Prev S116** — admin **`Dd55jBpj`** · user **`DVDr1UQ4`** (S116 — **`88368fd`** PE cho nhập giá ÂM ô báo giá [FE 2-app nút ± toggle + submit-gate `>0`→`!==0` + helper `hasRealSelectedQuote` 2-mirror `:201`/`:235`; BE submit-guard `:206` `Sum()<=0`→`All(==0)`; +9 test 486→495; **NO migration**]; **Run 386** PASS 5m28s rotate ×2 admin `D51OYyGV`→`Dd55jBpj` / user `BVdssm5S`→`DVDr1UQ4` CSS-frozen [logic-only fingerprint]; **byte-verify #77** `Đã nhập giá chào thầu`/`hoàn tiền NCC`/`phát sinh giảm`/`Đơn vị được chọn chưa có giá chào thầu` PRESENT [bundle-cũ=0]; smoke 200×3 · PE 401-secured · 89 bảng; cicd bắt bẫy snapshot-while-CI-running→poll-success TRƯỚC re-snapshot). **Prev S114** — admin **`D51OYyGV`** · user **`BVdssm5S`** (S114 — **`d436af2`** PE multi-NCC per hạng mục [Mig 65 backfill 2-chiều + BE re-key 5 financial→IsSelected + FE per-cell grid Detail×NCC 2-app SHA `ae3788e9`]; bundle rotate ×2 admin `acprMqfB`→`D51OYyGV` / user `Ck3BTDdA`→`BVdssm5S`; **byte-verify** `detailId`+`select-winner`+`hạng mục` PRESENT [bundle 1.65MB real-size]; smoke health/admin/eoffice 3/3 200 + endpoint POST select-winner bogus-401-live; **cicd garble #53 ×5 → em-main-solo curl-verify**; mig applied [API-healthy=migrations-ran-startup]). **Prev S113** — admin **`acprMqfB`** · user **`Ck3BTDdA`** (S113 — **Run #497** `5fa11b5` Supplier import v2 [Mig 64 publish/draft + dedup-MST + template + file mẫu] FE 2-app real-src rotate; JS admin `Cixlt_MA`→`acprMqfB` / user `BhBOG1dn`→`Ck3BTDdA` + CSS admin `Ds-E5neu`→`CfunQHbd` / user `Beb0Bb1h`→`DGqqHQXS`; ship-proof real-size 1.66/1.56MB + LM-in-window + **byte-verify** `Tải file mẫu`×1/`Đã công bố`×3/`Nháp (ẩn)`×4/`import/template`×1/`published`×5 PRESENT; Mig 64 prod 37/37-backfill sys.tables **89**; smoke health/admin/eoffice 200 + `import/template`-401-live + `suppliers?published=true`-401-live bogus-404-control). **Prev S112** — admin **`Cixlt_MA`** · user **`BhBOG1dn`** (S112 — **Run #496** `e100ef0` Supplier Excel-import Phase B FE 2-app [`SupplierImportDialog` NEW cả fe-admin+fe-user] + PE sign-off code-only; **real fe-src rotate — kết thúc #489→#495 non-determinism-freeze**; JS admin `BVyH-FY7`→`Cixlt_MA` / user `EDsZebvn`→`BhBOG1dn` + CSS admin `Bbtesa6B`→`Ds-E5neu` / user `BmuPz_Dy`→`Beb0Bb1h`; ship-proof real-size + Last-Modified-in-window + `"Database NCC"` marker PRESENT ×1; Mig 63 prod 2/2-col sys.tables **89**; smoke health/admin/eoffice 200 + PE-endpoint 200 + import-route preview-415/confirm-401-live bogus-404). **Prev S107** — admin **`BVyH-FY7`** · user **`EDsZebvn`** (S107 — **Run #489** `21387cd` +office-document 12th sub governance-only; **rotate benign #69-two-mode** [0 fe-src — Vite non-determinism], CSS frozen `Bbtesa6B`/`BmuPz_Dy`, real-size 1.64/1.55MB + Last-Modified-in-window 09:32/09:33 = ship-proof, Mig 62/89 frozen, smoke 200×3; hoist @S107-closeout per H1 flag D-BUNDLE-lặp — ⚠️ closeout-push kế có non-md sẽ rotate tiếp → Run #490 record nằm ở cicd MEMORY [authoritative], hoist ở bundle đầu phiên sau per precedent S99-#485). **Prev S104** — admin **`ChSNAJBK`** · user **`Bn2w1znH`** (S104 — **Run #488** `778fc98` Mig 62 Supplier expand 30-field; real-src-rotate FE 2-app SHA-mirror [form 4-section + Status select + `PathLink` 3 NAS-link], **sys.tables 89 pre==post no-new-table**, prod-verified marker grep-HIT, smoke 200×3; S104-shipped nhưng dòng-live `:27` lag tới S106 → hoist per H1 flag D-BUNDLE). **Prev S97** — admin **`mEGqlNWc`** · user **`Dnrp4PU1`** (S97 — **Run #484** `fb2dfa9` Mig 61 data-fix backfill; bundle rebuild **#69-benign** [0 FE-src change, review-workflow cicd re-snapshot LIVE → `CeTA7Z82`/`CGaAyXen` #483 đã bị #484 rebuild rotate]; backfill A/005/A/008 flag 0→1 prod-verified). **Prev #483** — admin **`CeTA7Z82`** · user **`CGaAyXen`** (S97 — **Run #483** `9e12e80` badge "✅ Đã được CEO duyệt" phiếu đi-hết-lên-CEO [PeFinalizeChip single-source + 6 call-site 2-app, đối xứng chip "⚑ Kết thúc·X"]; FE-only tận-dụng endsBeforeCeo runtime, no BE/mig; JS rotate CSS-frozen #69; byte-#77 "Đã được CEO duyệt" PRESENT cả 2 app + prev-badge additive no-regression; Mig 60 frozen; smoke 200×3 + PE-list 200). **Prev #482** — admin **`DR9q2VUy`** · user **`Bgz8u4E5`** (S97 — **Run #482** `8037fa0` endsBeforeCeo config→RUNTIME [Mig 60 `EndedByLevelFinalize`]: **Mig 60 applied prod** (history-top + col-default-0 EXISTS + backfill=0 UAT-no-marker + sys.tables **89** pre==post); **EF-ternary SQL-Server LIVE-confirmed** GET /purchase-evaluations 200 items=9 + PE-detail `31faef0d` 200 **endsBeforeCeo=False phase=7** = runtime-path chạy = **bug fixed LIVE** (NOT 500); JS rotate 2-app PeWorkflowPanel gate-diff, CSS frozen #69-REFINE; byte-#77 `endsBeforeCeo` PRESENT in-bundle; smoke 200×3. reviewer PASS 0-issue + test 440. **Prev #481** — admin **`Cf0o8dx8`** · user **`x8rppRAK`** (S97 — **Run #481** `1c8fb6a` PE finalize 2-fix [badge "không trình tới"→"Kết thúc tại {cấp}" + đảo default checkbox opt-in]; JS rotate real-FE 2-app `PeWorkflowPanel` diff, CSS frozen `Bbtesa6B`/`BmuPz_Dy` #69-REFINE logic-only; **byte-level #77** NEW `Kết thúc tại`+helper PRESENT / OLD `không trình tới`+`Đã BỎ tick` ABSENT; real-size 1.64/1.54MB; Mig 59/88-table frozen; smoke 200×3. FE-only mirror SHA `bcf812fd`, 0 BE/mig/test). **Prev S96** — admin **`COYAX-yQ`** · user **`0MU-kb4N`** (S96 — **Run #480** `0c2f9f6` price-lock; chuỗi 3 PE deploy #478 `e657faa` checkbox-opt-out → #479 `36cbf8b` chuông-stale-clear (BE-only) → #480 `0c2f9f6` khóa-giá-sau-duyệt, cicd PASS each ~5m; **FE JS rotate THẬT** (PeWorkflowPanel #478 + PeDetailTabs #480, 2-app) real-size 1.64/1.54MB vs 919b SPA-trap, CSS frozen #69-REFINE; Mig 59 frozen 0-mig; +Run #477 `ba4b8e0` NCC seed no-mig prod 21 NCC. **Verify byte-level:** prod `0MU-kb4N` CHỨA checkbox-fix ("BỎ tick"/"Đã BỎ tick") + "✅-static" cũ MẤT → checkbox "ko-được" = browser-cache KHÔNG deploy-fail). **Prev S95** — admin **`0T6vVJST`** · user **`BGXEVZO6`** (S95 — **Run #476** `18a17f5` H17 governance-only deploy; bundle rotate benign #69 CSS-frozen, prod 200×3, Mig 59 unchanged; cicd re-snapshot LIVE — pre-deploy `CkZ1MjC1`/`_-gpX7_Y`, mega-line S93 `CDn40vpV`/`CoPmPBg7` đã bị deploy trung-gian rotate từ S94). **Prev S85** — admin **`aKuNip19`** · user **`BUsL0HeQ`** (S85 — **Run #341** `49ac086` lệch-giờ TZ serialize UTC-with-Z; FE frozen #339+#341 BE-only. Chuỗi ~10 deploy #334→#341 buổi UAT anh Kiệt CV PRO: #334 `5a61254` batch CV PRO 6-fix → #335-#338 6 vòng UAT → #339 `1263c0d` workflow-preserve bug-class S42 → #341 `49ac086` TZ; #342 `d4f6021` docs+cicd BE-frozen, bundle giữ-nguyên gotcha #69-REFINE). **Prev S78** — admin **`CsJetgZH`** · user **`BVS0ApIm`** (S78 — **Run #330** `7886fd0` PE attach-file khi duyệt; bundle ROTATE từ S77 `BqKD3Y23`/`Cn-i349D` dù NO migration enum-only — gotcha #69 non-determ rebuild; cicd ship-proof byte-stable + fake-hash control). **Prev S77** — admin **`BqKD3Y23`** · user **`Cn-i349D`** (S77 — **Run #329** `e823694` banner Trả-lại; cuối chuỗi 10 deploy #320→#329 cùng ngày, cicd PASS each: #320 pill `DsSg6RRz`-era → #321 focus → #322 revert → #323 Mig57+notes `CPm4LTqm`/`BWJUAqEI` → #324 số-âm-đỏ `C6fx-0ea`/`N3sW4Div` → #325 indent `BhnNMucS`/`B1VebpXc` → #326 cờ-gấp-asymmetric `DwXqn37C`/`COXMCv7E` → #327 decouple `B0gboSAg`/`DbDg7pM-` → #328 notify (BE-only, FE frozen) → #329 banner **`BqKD3Y23`**/**`Cn-i349D`**). **Prev S76** — admin **`jOqxW4-p`** · user **`DbsznVvR`** (S76 — **Run #319** `21d1f4e` bảng lưới `` ngân sách viền-ô; chuỗi S76 cùng ngày: #318 `e33481e` feature ma-trận-3-cột + badge quyền-NS `BhFDF9IJ`/`BAkuRl3C` → #319 **`jOqxW4-p`**/**`DbsznVvR`**, cicd PASS each, smoke 3×200, Mig 56 applied prod #318). **Prev S74** — admin **`BYF5vIMJ`** · user **`CB-tiRxd`** (S74 — **Run #315** `8655ebf` Mig 55 CcmNote, cicd PASS ~4m54s: Mig 55 applied prod CcmNote nvarchar(1000) nullable · sys.tables 88 · smoke 4×200 · 0 regression). **Prev S73** — admin **`Bv3jUCNo`** · user **`BWlMBQz6`** (Run #314 `6aa4dcb` FE empty-candidates guard fix; chuỗi 2 deploy: #313 `1d86abc` feature `OlNyG9OD`/`DSzSLVtL` → #314 **`Bv3jUCNo`**/**`BWlMBQz6`**, cicd PASS each). **Prev S72** — admin **`fc_xkNpJ`** · user **`DP-tBcg0`** (Run #312 governance commit `18fced6`; bundle ROTATE do **non-deterministic hash + deploy rebuild-FE-unconditional** (gotcha #69) — 0 FE source change, prod state/DB GIỮ NGUYÊN). **Prev S69** — admin **`BgNCjwsG`** · user **`CBvh0vtf`** (Run #308 PE cờ gấp + ngưỡng CCM; chuỗi 4 deploy session: #305 Văn phòng số foundation → #306 re-skin 10 page → #307 Office golive (BE-only) `Wt54PHYl`/`B99fMU6X` → #308 **`BgNCjwsG`**/**`CBvh0vtf`**). **Prev S68** — admin **`CNUv1jxY`** · user **`CpOskeS1`** (S68 — Run #304 `37752eb` fix tên đen→trắng; chuỗi #303 `6983609` `D532XZKG`/`CuFaBoWt` → #304 **`CNUv1jxY`**/**`CpOskeS1`**, cicd PASS each). **Prev S67** — admin `CcrZqfht`/user `DniDFUB_` (S67 — 6 deploy Run #297→#302; admin rotate chuỗi #298`xkSz9BfE`→#300`PxiZQkaw`→#301`I1fpLeYw`→#302**`CcrZqfht`** · user #297`BumgrwCJ`→#300`B36hGoKd`→#301`DrQYkzh0`→#302**`DniDFUB_`**; #299 tests BE-only cả 2 frozen, cicd PASS each). **Prev S65** — admin `BDwV5d0X`/user `DbVv6rsf` (Run #293-295). Prev S62 admin `0xKYGhhf`/user `C81ZdG9G` (Run #286). **Prev S59:** admin `B1DtNT9C` · user `D6uF3Mln` (Run **#282** `792c030` FINAL — bỏ nút Thêm hạng mục; ships kèm `80b64dd` gỡ Điều khoản TT, #281 cancelled-benign ancestor-verified). Chuỗi S59 cùng ngày: #280 `69997da` (`BKy_8OO9`/`XcZ6PRyA`, ships kèm `f21c55d` table-fixed #279-cancelled) · #278 `9c330d2` self-approve+quick-add-NCC (`BSh2fG2X`/`D22KfpPc`, authz probe 4/4) · #277 `faed59f` SearchableSelect (`ex7Tc92G`/`DzUeSk96`) · #276 `c869d26` rename 71 PMH (`BBA0KSWu`/`DzdTI18G`) · #275 `bbd1554` dọn demo WorkItems (FROZEN BE-only) · #274 `0eafcd3` tree 4 tầng (`DuU7OTym`/`DWyeTzf3`) · #273 `56882ac` wipe + tree v1 (`R9uGRxvw`/`DikfX1RD`). Prev S58: Run #386 `3ebaf84` admin `DMm9rtNA`/user `BUkOMn_Y` (chi tiết session log S58). +**Bundle hash live (prod):** admin **`BVCukFP5`** · user **`DoxyEOxh`** (S134 — **`6664a61`** PE lũy kế TẠM TÍNH vs CHÍNH XÁC [0 mig — `ComputePendingAsync` complementary + DTO 5-field + FE sub-dòng amber + banner màn duyệt + D4 audit-note]; **Run #399** GO 5/5 5m27s gate-**528**-EXACT-từ-log rotate ×2 admin js `3NCdyODe`→**`BVCukFP5`** css `B--dUHcm`→**`CBzUlgOA`** / eoffice js `CKsoiNCI`→**`DoxyEOxh`** css `BuntB63r`→**`BHsBUA8e`** [FE-src đổi thật 6 file ⇒ rotate expected; CSS rotate = amber badge utilities, benign #69]; real-size 1.659.037/1.565.367B + LM 14:31:34/14:32:28+07 in-window; **byte-verify #77** `pendingPriorPes`=2 + `Tạm tính`=3 + `phiếu trước cùng gói thầu CHƯA duyệt`=2 PRESENT cả 2 js [control old-hash 900B text/html 0-hit — ct=text/html là discriminator sạch hơn size-919b]; Mig 67 top FROZEN + 89 bảng [0-mig by-construction]; smoke 4×200 + PE 401; lead spot-check độc-lập post-verdict: 4/4 hash khớp + marker PRESENT). **Prev S133** — admin **`3NCdyODe`** · user **`CKsoiNCI`** (S133 — **`d4fbced`** PE freeze NS phiếu DaDuyet [Mig 67 snapshot 11 cột + backfill 18/18 + FE 2-app badge 🔒 SHA-mirror `5534addb` + display-gate `budgetFrozen`]; **Run #398** GO 5/5 gate-520 rotate ×2 admin →**`3NCdyODe`** [CSS `B--dUHcm`] / user →**`CKsoiNCI`** [CSS `BuntB63r`] — prev `yCkX-2Bp`/`DKSD4p9k` @Run #397 S131-S132 [dòng-live lag S117→S133, hoist per precedent S104/S107]; **CSS cũng rotate** = badge sinh utility-class mới, benign #69; **byte-verify #77** `budgetFrozen`=1 + VN-string 🔒=1 PRESENT [old-control 0]; Mig 67 prod history-top + 11 cột + backfill 18/18 chua=0 + sys.tables **89**; smoke 4×200 + PE 401; `/tiep` S134 re-verify độc-lập 4/4: mig-top + health-200 + bundle-hash ×2 + filter 11/11). **Prev S117** — admin **`cFI7ih4a`** · user **`MxgooVZw`** (S117 — **`316a82f`** PE endsBeforeCeo pointer-aware [display-fix BE-only, phiếu chờ CEO hết báo "Kết thúc" sai] + duyệt-theo-khoảng Min–Max [Mig 66 + FE 2-app ProMinMax radio thứ 5]; **Run #387** PASS 5m36s rotate ×2 admin `Dd55jBpj`→`cFI7ih4a` / user `DVDr1UQ4`→`MxgooVZw` CSS-frozen [logic-only fingerprint]; **byte-verify #77** `ProMinMax`/`duyệt theo khoảng`/`cả Min và Max`/`Min–Max` PRESENT [bundle-cũ=0]; Mig 66 prod col decimal(18,2) + `__EFMigrationsHistory`-top + sys.tables **89**; smoke 200×3 · PE 401-secured; **#53-garble ×2** [invest-lane-1 + cicd-monitor] → SendMessage-resume + em-main curl cross-verify khớp). **Prev S116** — admin **`Dd55jBpj`** · user **`DVDr1UQ4`** (S116 — **`88368fd`** PE cho nhập giá ÂM ô báo giá [FE 2-app nút ± toggle + submit-gate `>0`→`!==0` + helper `hasRealSelectedQuote` 2-mirror `:201`/`:235`; BE submit-guard `:206` `Sum()<=0`→`All(==0)`; +9 test 486→495; **NO migration**]; **Run 386** PASS 5m28s rotate ×2 admin `D51OYyGV`→`Dd55jBpj` / user `BVdssm5S`→`DVDr1UQ4` CSS-frozen [logic-only fingerprint]; **byte-verify #77** `Đã nhập giá chào thầu`/`hoàn tiền NCC`/`phát sinh giảm`/`Đơn vị được chọn chưa có giá chào thầu` PRESENT [bundle-cũ=0]; smoke 200×3 · PE 401-secured · 89 bảng; cicd bắt bẫy snapshot-while-CI-running→poll-success TRƯỚC re-snapshot). **Prev S114** — admin **`D51OYyGV`** · user **`BVdssm5S`** (S114 — **`d436af2`** PE multi-NCC per hạng mục [Mig 65 backfill 2-chiều + BE re-key 5 financial→IsSelected + FE per-cell grid Detail×NCC 2-app SHA `ae3788e9`]; bundle rotate ×2 admin `acprMqfB`→`D51OYyGV` / user `Ck3BTDdA`→`BVdssm5S`; **byte-verify** `detailId`+`select-winner`+`hạng mục` PRESENT [bundle 1.65MB real-size]; smoke health/admin/eoffice 3/3 200 + endpoint POST select-winner bogus-401-live; **cicd garble #53 ×5 → em-main-solo curl-verify**; mig applied [API-healthy=migrations-ran-startup]). **Prev S113** — admin **`acprMqfB`** · user **`Ck3BTDdA`** (S113 — **Run #497** `5fa11b5` Supplier import v2 [Mig 64 publish/draft + dedup-MST + template + file mẫu] FE 2-app real-src rotate; JS admin `Cixlt_MA`→`acprMqfB` / user `BhBOG1dn`→`Ck3BTDdA` + CSS admin `Ds-E5neu`→`CfunQHbd` / user `Beb0Bb1h`→`DGqqHQXS`; ship-proof real-size 1.66/1.56MB + LM-in-window + **byte-verify** `Tải file mẫu`×1/`Đã công bố`×3/`Nháp (ẩn)`×4/`import/template`×1/`published`×5 PRESENT; Mig 64 prod 37/37-backfill sys.tables **89**; smoke health/admin/eoffice 200 + `import/template`-401-live + `suppliers?published=true`-401-live bogus-404-control). **Prev S112** — admin **`Cixlt_MA`** · user **`BhBOG1dn`** (S112 — **Run #496** `e100ef0` Supplier Excel-import Phase B FE 2-app [`SupplierImportDialog` NEW cả fe-admin+fe-user] + PE sign-off code-only; **real fe-src rotate — kết thúc #489→#495 non-determinism-freeze**; JS admin `BVyH-FY7`→`Cixlt_MA` / user `EDsZebvn`→`BhBOG1dn` + CSS admin `Bbtesa6B`→`Ds-E5neu` / user `BmuPz_Dy`→`Beb0Bb1h`; ship-proof real-size + Last-Modified-in-window + `"Database NCC"` marker PRESENT ×1; Mig 63 prod 2/2-col sys.tables **89**; smoke health/admin/eoffice 200 + PE-endpoint 200 + import-route preview-415/confirm-401-live bogus-404). **Prev S107** — admin **`BVyH-FY7`** · user **`EDsZebvn`** (S107 — **Run #489** `21387cd` +office-document 12th sub governance-only; **rotate benign #69-two-mode** [0 fe-src — Vite non-determinism], CSS frozen `Bbtesa6B`/`BmuPz_Dy`, real-size 1.64/1.55MB + Last-Modified-in-window 09:32/09:33 = ship-proof, Mig 62/89 frozen, smoke 200×3; hoist @S107-closeout per H1 flag D-BUNDLE-lặp — ⚠️ closeout-push kế có non-md sẽ rotate tiếp → Run #490 record nằm ở cicd MEMORY [authoritative], hoist ở bundle đầu phiên sau per precedent S99-#485). **Prev S104** — admin **`ChSNAJBK`** · user **`Bn2w1znH`** (S104 — **Run #488** `778fc98` Mig 62 Supplier expand 30-field; real-src-rotate FE 2-app SHA-mirror [form 4-section + Status select + `PathLink` 3 NAS-link], **sys.tables 89 pre==post no-new-table**, prod-verified marker grep-HIT, smoke 200×3; S104-shipped nhưng dòng-live `:27` lag tới S106 → hoist per H1 flag D-BUNDLE). **Prev S97** — admin **`mEGqlNWc`** · user **`Dnrp4PU1`** (S97 — **Run #484** `fb2dfa9` Mig 61 data-fix backfill; bundle rebuild **#69-benign** [0 FE-src change, review-workflow cicd re-snapshot LIVE → `CeTA7Z82`/`CGaAyXen` #483 đã bị #484 rebuild rotate]; backfill A/005/A/008 flag 0→1 prod-verified). **Prev #483** — admin **`CeTA7Z82`** · user **`CGaAyXen`** (S97 — **Run #483** `9e12e80` badge "✅ Đã được CEO duyệt" phiếu đi-hết-lên-CEO [PeFinalizeChip single-source + 6 call-site 2-app, đối xứng chip "⚑ Kết thúc·X"]; FE-only tận-dụng endsBeforeCeo runtime, no BE/mig; JS rotate CSS-frozen #69; byte-#77 "Đã được CEO duyệt" PRESENT cả 2 app + prev-badge additive no-regression; Mig 60 frozen; smoke 200×3 + PE-list 200). **Prev #482** — admin **`DR9q2VUy`** · user **`Bgz8u4E5`** (S97 — **Run #482** `8037fa0` endsBeforeCeo config→RUNTIME [Mig 60 `EndedByLevelFinalize`]: **Mig 60 applied prod** (history-top + col-default-0 EXISTS + backfill=0 UAT-no-marker + sys.tables **89** pre==post); **EF-ternary SQL-Server LIVE-confirmed** GET /purchase-evaluations 200 items=9 + PE-detail `31faef0d` 200 **endsBeforeCeo=False phase=7** = runtime-path chạy = **bug fixed LIVE** (NOT 500); JS rotate 2-app PeWorkflowPanel gate-diff, CSS frozen #69-REFINE; byte-#77 `endsBeforeCeo` PRESENT in-bundle; smoke 200×3. reviewer PASS 0-issue + test 440. **Prev #481** — admin **`Cf0o8dx8`** · user **`x8rppRAK`** (S97 — **Run #481** `1c8fb6a` PE finalize 2-fix [badge "không trình tới"→"Kết thúc tại {cấp}" + đảo default checkbox opt-in]; JS rotate real-FE 2-app `PeWorkflowPanel` diff, CSS frozen `Bbtesa6B`/`BmuPz_Dy` #69-REFINE logic-only; **byte-level #77** NEW `Kết thúc tại`+helper PRESENT / OLD `không trình tới`+`Đã BỎ tick` ABSENT; real-size 1.64/1.54MB; Mig 59/88-table frozen; smoke 200×3. FE-only mirror SHA `bcf812fd`, 0 BE/mig/test). **Prev S96** — admin **`COYAX-yQ`** · user **`0MU-kb4N`** (S96 — **Run #480** `0c2f9f6` price-lock; chuỗi 3 PE deploy #478 `e657faa` checkbox-opt-out → #479 `36cbf8b` chuông-stale-clear (BE-only) → #480 `0c2f9f6` khóa-giá-sau-duyệt, cicd PASS each ~5m; **FE JS rotate THẬT** (PeWorkflowPanel #478 + PeDetailTabs #480, 2-app) real-size 1.64/1.54MB vs 919b SPA-trap, CSS frozen #69-REFINE; Mig 59 frozen 0-mig; +Run #477 `ba4b8e0` NCC seed no-mig prod 21 NCC. **Verify byte-level:** prod `0MU-kb4N` CHỨA checkbox-fix ("BỎ tick"/"Đã BỎ tick") + "✅-static" cũ MẤT → checkbox "ko-được" = browser-cache KHÔNG deploy-fail). **Prev S95** — admin **`0T6vVJST`** · user **`BGXEVZO6`** (S95 — **Run #476** `18a17f5` H17 governance-only deploy; bundle rotate benign #69 CSS-frozen, prod 200×3, Mig 59 unchanged; cicd re-snapshot LIVE — pre-deploy `CkZ1MjC1`/`_-gpX7_Y`, mega-line S93 `CDn40vpV`/`CoPmPBg7` đã bị deploy trung-gian rotate từ S94). **Prev S85** — admin **`aKuNip19`** · user **`BUsL0HeQ`** (S85 — **Run #341** `49ac086` lệch-giờ TZ serialize UTC-with-Z; FE frozen #339+#341 BE-only. Chuỗi ~10 deploy #334→#341 buổi UAT anh Kiệt CV PRO: #334 `5a61254` batch CV PRO 6-fix → #335-#338 6 vòng UAT → #339 `1263c0d` workflow-preserve bug-class S42 → #341 `49ac086` TZ; #342 `d4f6021` docs+cicd BE-frozen, bundle giữ-nguyên gotcha #69-REFINE). **Prev S78** — admin **`CsJetgZH`** · user **`BVS0ApIm`** (S78 — **Run #330** `7886fd0` PE attach-file khi duyệt; bundle ROTATE từ S77 `BqKD3Y23`/`Cn-i349D` dù NO migration enum-only — gotcha #69 non-determ rebuild; cicd ship-proof byte-stable + fake-hash control). **Prev S77** — admin **`BqKD3Y23`** · user **`Cn-i349D`** (S77 — **Run #329** `e823694` banner Trả-lại; cuối chuỗi 10 deploy #320→#329 cùng ngày, cicd PASS each: #320 pill `DsSg6RRz`-era → #321 focus → #322 revert → #323 Mig57+notes `CPm4LTqm`/`BWJUAqEI` → #324 số-âm-đỏ `C6fx-0ea`/`N3sW4Div` → #325 indent `BhnNMucS`/`B1VebpXc` → #326 cờ-gấp-asymmetric `DwXqn37C`/`COXMCv7E` → #327 decouple `B0gboSAg`/`DbDg7pM-` → #328 notify (BE-only, FE frozen) → #329 banner **`BqKD3Y23`**/**`Cn-i349D`**). **Prev S76** — admin **`jOqxW4-p`** · user **`DbsznVvR`** (S76 — **Run #319** `21d1f4e` bảng lưới `
` ngân sách viền-ô; chuỗi S76 cùng ngày: #318 `e33481e` feature ma-trận-3-cột + badge quyền-NS `BhFDF9IJ`/`BAkuRl3C` → #319 **`jOqxW4-p`**/**`DbsznVvR`**, cicd PASS each, smoke 3×200, Mig 56 applied prod #318). **Prev S74** — admin **`BYF5vIMJ`** · user **`CB-tiRxd`** (S74 — **Run #315** `8655ebf` Mig 55 CcmNote, cicd PASS ~4m54s: Mig 55 applied prod CcmNote nvarchar(1000) nullable · sys.tables 88 · smoke 4×200 · 0 regression). **Prev S73** — admin **`Bv3jUCNo`** · user **`BWlMBQz6`** (Run #314 `6aa4dcb` FE empty-candidates guard fix; chuỗi 2 deploy: #313 `1d86abc` feature `OlNyG9OD`/`DSzSLVtL` → #314 **`Bv3jUCNo`**/**`BWlMBQz6`**, cicd PASS each). **Prev S72** — admin **`fc_xkNpJ`** · user **`DP-tBcg0`** (Run #312 governance commit `18fced6`; bundle ROTATE do **non-deterministic hash + deploy rebuild-FE-unconditional** (gotcha #69) — 0 FE source change, prod state/DB GIỮ NGUYÊN). **Prev S69** — admin **`BgNCjwsG`** · user **`CBvh0vtf`** (Run #308 PE cờ gấp + ngưỡng CCM; chuỗi 4 deploy session: #305 Văn phòng số foundation → #306 re-skin 10 page → #307 Office golive (BE-only) `Wt54PHYl`/`B99fMU6X` → #308 **`BgNCjwsG`**/**`CBvh0vtf`**). **Prev S68** — admin **`CNUv1jxY`** · user **`CpOskeS1`** (S68 — Run #304 `37752eb` fix tên đen→trắng; chuỗi #303 `6983609` `D532XZKG`/`CuFaBoWt` → #304 **`CNUv1jxY`**/**`CpOskeS1`**, cicd PASS each). **Prev S67** — admin `CcrZqfht`/user `DniDFUB_` (S67 — 6 deploy Run #297→#302; admin rotate chuỗi #298`xkSz9BfE`→#300`PxiZQkaw`→#301`I1fpLeYw`→#302**`CcrZqfht`** · user #297`BumgrwCJ`→#300`B36hGoKd`→#301`DrQYkzh0`→#302**`DniDFUB_`**; #299 tests BE-only cả 2 frozen, cicd PASS each). **Prev S65** — admin `BDwV5d0X`/user `DbVv6rsf` (Run #293-295). Prev S62 admin `0xKYGhhf`/user `C81ZdG9G` (Run #286). **Prev S59:** admin `B1DtNT9C` · user `D6uF3Mln` (Run **#282** `792c030` FINAL — bỏ nút Thêm hạng mục; ships kèm `80b64dd` gỡ Điều khoản TT, #281 cancelled-benign ancestor-verified). Chuỗi S59 cùng ngày: #280 `69997da` (`BKy_8OO9`/`XcZ6PRyA`, ships kèm `f21c55d` table-fixed #279-cancelled) · #278 `9c330d2` self-approve+quick-add-NCC (`BSh2fG2X`/`D22KfpPc`, authz probe 4/4) · #277 `faed59f` SearchableSelect (`ex7Tc92G`/`DzUeSk96`) · #276 `c869d26` rename 71 PMH (`BBA0KSWu`/`DzdTI18G`) · #275 `bbd1554` dọn demo WorkItems (FROZEN BE-only) · #274 `0eafcd3` tree 4 tầng (`DuU7OTym`/`DWyeTzf3`) · #273 `56882ac` wipe + tree v1 (`R9uGRxvw`/`DikfX1RD`). Prev S58: Run #386 `3ebaf84` admin `DMm9rtNA`/user `BUkOMn_Y` (chi tiết session log S58). **Phase:** ✅ Phase 10 COMPLETE · ✅ **Phase 11 product backlog ĐÓNG TRỌN** · ✅ **Văn phòng số (E-Office) golive S69** (foundation PURO + re-skin 10 page + public read+create 16-key allow-list mọi role) prod-verified · ✅ **PE cờ gấp PRO/CCM + CCM duyệt-final theo ngưỡng (Mig 53 S69)** prod-verified · ✅ **PE ngân sách MA TRẬN 3 cột Dự án/PRO/CCM (bảng lưới `
`) + badge quyền-NS theo role trong Workflow Designer & flow Duyệt NCC (Mig 56 S76)** prod-verified · ✅ **PE UX batch S77 (10 deploy)** — cờ GẤP pill mọi danh sách+inbox · focus/inline+overlay decouple+"Xem mở rộng" · ô ghi chú giá đề xuất PRO/CCM (Mig 57) · số phân cách + số-âm-đỏ-ngoặc + indent mục con · cờ gấp GẮN=NV/GỠ=Trưởng phòng · chuông báo người duyệt · banner Trả-lại — prod-verified · ✅ **PE đính kèm file khi DUYỆT (S78, Run #330)** — người duyệt tải file lên lúc duyệt thay vì Trả lại; migration-free reuse-enum `ApprovalAttachment=5` — prod-verified · 🚫 Phase 9 Ops blocked (anh main coordinate — anh dừng). > ⚠️ **Count drift fixed S40:** endpoints ~223→**211**, FE pages 53→**65**, menu keys 85→**~53**. Tables **84 confirmed correct** (DbSet 77 + Identity 7). 3 số "khó fake" (mig/gotcha/git) luôn đúng. Cause: số "incremented mỗi session" over/under-count optimistic — re-ground định kỳ. --- +## ✅ Recently Done (S134 — 2026-07-17) + +**PE lũy kế TẠM TÍNH vs CHÍNH XÁC SHIP PROD (`6664a61`, CI Run #399 GO 5/5, bundle rotate ×2) — UAT anh Kiệt FDC (chat 15/07, chốt "Vậy em xử lý theo hướng này đi"): vì "cung đặc thù" phiếu sau trình khi phiếu trước cùng gói CHƯA duyệt → chia 2 số: lũy kế TẠM TÍNH (tất cả phiếu, phần chưa-duyệt note màu amber) ⟂ lũy kế CHÍNH XÁC (chỉ DaDuyet — semantics Kenny S117 GIỮ NGUYÊN 100%); người duyệt cuối THẤY danh sách "phiếu trước chưa duyệt" — informational, KHÔNG hard-block.** Session-log → `2026-07-17-S134-pe-luyke-tam-tinh.md`. Lead Fable 5, HMW-ON, pipeline anh chỉ định: `/fable-real invest` → spec → `/fable-real review` → hmw Opus 4.8 MAX ×2 invocation → reviewer pre-commit → cicd. **0 MIGRATION** (Mig 67 giữ top, 89 bảng). + +- **Ground-truth lật khung (invest Fable):** row 1 "NS trình duyệt trước" ĐÃ gồm ChoDuyet sẵn (`PeBudgetAccumulator.cs:42-48`) — gap thật = **row 2 "Kỳ trước đã chọn thầu"** (DaDuyet+IsWinner only) + row 5/6 dẫn xuất → spec gọn: thêm nhánh MỚI, KHÔNG đụng predicate cũ. +- **BE (4 file):** `ComputePendingAsync` + `PePendingAccumulation` (pure-add +68/0 — **ComputeAsync body 0-diff = chính-xác/snapshot/backfill bất động by-construction**); tập chốt: PriorPes = NOT IN {7,99} · delta-selected = NOT IN {1,7,99}+IsWinner (GỒM ChoDuyet = gap chính) · delta-submitted = NOT IN {1,7,10,99} (no-double-count); DTO append-cuối 5 field (2 construction site frozen-defaults/live-fill); **D4 audit-note** 1-chỗ-trong-helper (`Action=Update` KHÔNG Transition — né #49; signature giữ → 5 call-site 0-diff insertion-only). +- **FE 2-app (6 file):** types ×2 (+5 field) · PeDetailTabs `5534addb`→`d28eaa16` ×2 IDENTICAL (**`sub?: ReactNode` slot-prop** trên 2 cell-component → sub-dòng amber "Tạm tính" row 1/2/5/6, N8 count-đúng-delta; danh sách mã+badge `PurchaseEvaluationPhaseLabel`, N9 KHÔNG link tránh 403-S89) · PeWorkflowPanel `a83a58e1`→`bebc0ada` ×2 (banner gate M2 `!readOnly && phase===ChoDuyet` enum-constant + reminder TRONG dialog duyệt; nút Xác nhận 0-diff). +- **Pipeline chất lượng:** fable-real invest **#53-garble → sub-file 8-phần cứu** (lần 3 pattern thắng) + lead verify 7/7 claim + 2 errata · fable-real spec-review **GO_WITH_FIXES 0C/2M/9n** (M1 D4-shape đầy-đủ tránh hmw tự đổi signature vỡ A6; M2 banner-gate — edge-note "tự ẩn" SAI với predicate gốc; D4-seeder CLEAR set-trực-tiếp) → lead áp trọn → spec v2 · **hmw INV-2 [BE‖FE] + INV-3 [test] 3/3 lane 0-garble** (hmw index sub-file GLOBAL theo taskList → hết collision S133) · reviewer pre-commit **PASS 0C/0M/4-nice-to-have** (tự chạy build+npm+filter; xác nhận #81-indirect 5/5-qua-helper + seeder-bypass-cố-ý an toàn) · lead full-suite độc lập exit-0. +- **Test 520→528** (+8 `PePendingAccumulationTests` — C6 complementary exact-numbers là regression-guard chính-xác-bất-động). +- **Squash §5.0 TRƯỚC push:** reset --soft → 9 `wal:` local tiêu → 2 commit sạch (`e53a693` docs S133 + `6664a61` feature) → **0 wal: lọt origin** (bài 57× S119). +- **cicd Run #399 GO 5/5** (return CLEAN): gate 528 exact-từ-log · Mig 67 frozen + 89 · bundle ×2 byte-verify 3 marker PRESENT + control-0-hit (learned: **ct=text/html là SPA-trap discriminator sạch hơn size-heuristic**) · smoke 4×200 + PE 401 · lead spot-check độc-lập khớp 4/4 hash + marker. +- ⚑ **Flag anh (D1):** phiếu NHÁP vào danh sách cảnh báo (mã + badge) nhưng KHÔNG cộng tiền vào tạm-tính (S89 nháp riêng-tư + số chưa chốt) — lời chat "tất cả lun" nếu anh muốn cộng cả tiền nháp thì báo em đổi (1 predicate). +- State: **Mig 67 · 89 bảng · 528 test · gotcha 83 · menu 54 · bundle admin `BVCukFP5`/user `DoxyEOxh` (Run #399) · prod 37 NCC/17 user.** + ## ✅ Recently Done (S133 — 2026-07-17, closeout @S134 `/tiep`) **PE freeze ngân sách phiếu DaDuyet SHIP PROD (`d4fbced` 16 file +7831/−63, CI Run #398 GO 5/5, bundle rotate ×2) — UAT anh Kiệt FDC 07-16: cập nhật ngân sách gói thầu (`PeWorkItemBudgets` live) làm phiếu ĐÃ DUYỆT đổi số theo (retro-display) → R1 phiếu DaDuyet bất biến · R2 phiếu mới đọc bản cập nhật gần nhất · R3 DB delta nhỏ không bảng mới.** Session-log → `2026-07-17-S133-pe-budget-freeze-daduyet.md`. Lead Fable 5 owner-choice, HMW-ON, pipeline `/fable-real invest` → spec+errata → hmw implement Opus MAX ×3 invocation staged → reviewer → cicd. diff --git a/docs/changelog/sessions/2026-07-17-S134-pe-luyke-tam-tinh.md b/docs/changelog/sessions/2026-07-17-S134-pe-luyke-tam-tinh.md new file mode 100644 index 0000000..fa658bc --- /dev/null +++ b/docs/changelog/sessions/2026-07-17-S134-pe-luyke-tam-tinh.md @@ -0,0 +1,34 @@ +# S134 — PE lũy kế TẠM TÍNH vs CHÍNH XÁC (2026-07-17) + +**Commit:** `6664a61` (11 file: 4 BE + 6 FE + 1 test) + `e53a693` (docs S133 closeout, cùng push) — **squash §5.0 trước push, 9 `wal:` local tiêu, 0 lọt origin** · **CI:** Run **#399** VERDICT **GO 5/5** (5m27s, return CLEAN) · **Test:** 520→**528** (45D+483I) · **Mig:** 0 (Mig 67 giữ top, 89 bảng) · **Bundle:** admin `BVCukFP5`/`CBzUlgOA` · user `DoxyEOxh`/`BHsBUA8e` · **Lead:** Fable 5 · HMW-ON · run-folder `.claude/workflows/runs/2026-07-17-S134-pe-luyke-tam-tinh/` + +## Đề bài (UAT anh Kiệt FDC — chat 15/07, chốt 16:10 "Vậy em xử ký theo hướng này đi") + +Lũy kế PE chỉ bắt phiếu DaDuyet (Kenny S117) → phiếu chưa duyệt không góp vào phiếu sau. Vì **"cung đặc thù"** (phiếu sau trình khi phiếu trước chưa duyệt), anh Kiệt yêu cầu "vẫn cho bắt lên và tính toán, note nó màu gì đó… để đến bước cuối của CEO hay người duyệt thay cần phải duyệt phiếu trước phiếu này". Hướng chốt (em đề xuất, anh Kiệt duyệt ♥): **lũy kế TẠM TÍNH = tất cả** ⟂ **lũy kế CHÍNH XÁC = chỉ phiếu đã duyệt** (giữ nguyên). + +## Ship + +- **Ground-truth lật khung (fable-real invest):** row 1 ĐÃ gồm ChoDuyet sẵn — gap thật = row 2 (DaDuyet+IsWinner) + row 5/6 dẫn xuất ⇒ **0 migration, 0 endpoint mới, 0 đụng số chính xác**. +- **BE:** `PeBudgetAccumulator.ComputePendingAsync` MỚI (pure-add +68/0; `ComputeAsync` 0-diff) — PriorPes `NOT IN {7,99}` · delta-selected `NOT IN {1,7,99}`+IsWinner (GỒM ChoDuyet = gap chính) · delta-submitted `NOT IN {1,7,10,99}` (no-double-count, C6 chứng exact-numbers); `PeBudgetSummaryDto` +5 field append-cuối (frozen→defaults R1-S133 / live→fill); **D4 audit-note** trong `ApplyBudgetSnapshotOnFinalizeAsync` (1 chỗ, `Action=Update` né #49, signature giữ → 5 call-site 0-diff). +- **FE 2-app:** types ×2 · PeDetailTabs →`d28eaa16` ×2 (**`sub?: ReactNode` slot-prop** → sub-dòng amber "Tạm tính" row 1/2/5/6 N8-count-đúng-delta + danh sách mã+badge `PurchaseEvaluationPhaseLabel`, N9 no-link tránh 403-S89 + gate `!budgetFrozen`) · PeWorkflowPanel →`bebc0ada` ×2 (banner gate M2 `!readOnly && phase===ChoDuyet` + reminder trong dialog duyệt; Xác nhận 0-diff). +- **Decisions D1-D5** (lead chốt theo invest, ⚑ D1 flag anh): nháp list-only KHÔNG cộng tiền · delta row1 làm (TraLai+legacy) · plain-info không hard-block · changelog-in-helper · TuChoi exclude. + +## Pipeline (anh chỉ định: "/fable-real invest và review… Sau đó hmw cho Opus 4.8 MAX xử lý") + +1. `/fable-real investigator-codebase` — ⚠️ #53 garble return, **sub-file 8-phần 20.7KB cứu trọn** (lần 3 liên tiếp pattern ghi-đĩa-trong-lúc-làm thắng); lead verify **7/7 claim** + 2 errata (path `Dtos/`, hash-value) → spec 3-heading. +2. `/fable-real reviewer` — ⚠️ #53 garble return, sub-file cứu · **GO_WITH_FIXES 0C/2M/9n**: M1 D4-shape đầy đủ (thiếu → hmw tự thêm param = vỡ chính A6) + M2 banner-gate (edge-note "tự ẩn" SAI vs predicate) + N1-N9; **D4-seeder CLEAR** (set trực tiếp, không gọi helper — 0 changelog rác #75-class) → lead áp TRỌN → spec v2. +3. **hmw Opus 4.8 MAX** — INV-2 `wf_58302bd5-b9f` [IMPL-A BE ‖ IMPL-B FE] + INV-3 `wf_97d6a582-b7e` [TEST-C] = **3/3 lane 0-garble, return structured đầy đủ** (lần đầu chuỗi dài sạch trọn); lead re-verify độc lập từng chặng (scope/hash/grep/filter-S133-11-11). +4. Reviewer pre-commit `wf_8bb5abee-657` — **PASS 0C/0M/4-nice-to-have** (tự chạy build+npm ×2+filter 8/8; xác nhận #81-indirect 5/5-qua-helper); lead full-suite độc lập exit-0. +5. Squash §5.0 → push `d4fbced..6664a61` → cicd `wf_f366f38d-498` **GO 5/5 CLEAN**: gate **528 exact-từ-log** · Mig 67 frozen + 89 · bundle ×2 byte-verify 3 marker PRESENT + control 0-hit · smoke 4×200 + PE 401 → lead spot-check độc lập 4/4 hash + marker khớp. + +## Lessons + +- **hmw index sub-file GLOBAL theo taskList** (backend=0, frontend=1) → collision S133 tự hết khi role khác nhau; cùng-role re-invocation vẫn phải đặt tên riêng (đã áp `sub-reviewer-precommit.md`). +- **Insertion-only diff** (`grep '^-'` = 0 real-removal) = bằng chứng mạnh nhất cho "thân method/call-site bất động". +- **ct=text/html** là SPA-trap discriminator sạch hơn size-heuristic 919B (cicd). +- Spec đặt ràng buộc "không đổi X" phải tự kiểm việc-mới lấy đủ nguyên liệu trong X-nguyên-trạng (M1 — reviewer). + +## Carry + +- 🆕 `[carry:uat-s134-luyke]` — UAT script 3 bước trong HANDOFF (sub-dòng amber / banner+dialog / duyệt-A-xong-số-chuyển-chính-xác). +- ⚑ D1 nháp-không-cộng-tiền — chờ anh gật giữ hay đổi.