From e53a69307f64d736fb9844a5b8a58d6b41543429 Mon Sep 17 00:00:00 2001 From: pqhuy1987 Date: Fri, 17 Jul 2026 14:27:19 +0700 Subject: [PATCH] =?UTF-8?q?[CLAUDE]=20Docs:=20S133=20closeout=20=E2=80=94?= =?UTF-8?q?=20PE=20budget=20freeze=20DaDuyet=20(STATUS=20Mig=2067/520=20+?= =?UTF-8?q?=20HANDOFF=20UAT-script=209-carry=20+=20gotcha=20#81-EXT=20+=20?= =?UTF-8?q?session-log=20+=20close-synthesis=20dong=20orphan)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 --- .../close-synthesis.md | 24 ++++++++++ .../run.md | 16 +++++-- CLAUDE.md | 4 +- docs/HANDOFF.md | 6 ++- docs/STATUS.md | 20 ++++++-- ...026-07-17-S133-pe-budget-freeze-daduyet.md | 46 +++++++++++++++++++ docs/gotchas.md | 2 + 7 files changed, 108 insertions(+), 10 deletions(-) create mode 100644 .claude/workflows/runs/2026-07-17-S133-pe-budget-freeze-daduyet/close-synthesis.md create mode 100644 docs/changelog/sessions/2026-07-17-S133-pe-budget-freeze-daduyet.md diff --git a/.claude/workflows/runs/2026-07-17-S133-pe-budget-freeze-daduyet/close-synthesis.md b/.claude/workflows/runs/2026-07-17-S133-pe-budget-freeze-daduyet/close-synthesis.md new file mode 100644 index 0000000..24f55bd --- /dev/null +++ b/.claude/workflows/runs/2026-07-17-S133-pe-budget-freeze-daduyet/close-synthesis.md @@ -0,0 +1,24 @@ +# close-synthesis — 2026-07-17-S133-pe-budget-freeze-daduyet (VERIFIED) + +> Lead-verified synthesis toàn run (dạng-1 flat — đóng orphan; ghi @S134 `/tiep` closeout). +> Goal: PE budget FREEZE-at-DaDuyet (UAT anh Kiệt 07-16, R1 bất-biến · R2 live-cho-phiếu-mới · R3 no-new-table). + +## Kết quả chốt (evidence-first) + +| Stage | wf | Kết quả VERIFIED | Evidence | +|---|---|---|---| +| 1. invest fable-real | `wf_348f6155-167` | map read/write-site + 1 choke-point + spec 3-mục (⚠️ #53 return-fail) | `sub-investigator-codebase-0.md` 22.5KB (disk cứu); lead verify 7/7 claim | +| 2. spec + errata | — | OD1 CÓ · OD2 CÓ · OD3 KHÔNG; errata query=`GetPurchaseEvaluationQuery` | `spec-pe-budget-freeze-daduyet-17-07-2026.md` | +| 3a. INV-A | `wf_d9639faa-97a` | T0 RED thật (found 999tr) + FE badge 4 file mirror `5534addb` ×2 + npm ×2 PASS | `PeBudgetFreezeTests.cs:184` RED log · `sub-test-specialist-0.md` | +| 3b. INV-B + solo-mig | `wf_4bef08b8-730` | 6 file BE + `PeBudgetAccumulator` 4-site `:862/:901/:934/:1109` (⚠️ #53 ×2, chết trước mig) → em-main-solo **Mig 67** 11 AddColumn + backfill OUTER APPLY; T0 RED→GREEN | `Persistence/Migrations/20260717032812_AddPeApprovedBudgetSnapshot.cs` · filter 44/44 | +| 3c. INV-C | `wf_75c6bfd3-754` | +T1-T9 (⚠️ #53 lần 3 → disk; ⚠️ sub-file INV-A bị overwrite — lesson multi-invocation) | `grep -c "\[Fact\]" PeBudgetFreezeTests.cs` = 11 · full 519/0 | +| 4a. reviewer | `wf_f9c0b939-181` | **PASS_WITH_FIXES 0M/2S/2N** — 2 SHOULD = #81-EXT indirect-assignment (`PurchaseEvaluationWorkflowService.cs:308` + `DbInitializer:1323`) → FIXED + test site-5 | `grep -n "S133 site 5"` hit `:308` · filter 11/11 · FULL **520/0** · npm ×2 | +| 4b. commit+push | — | `d4fbced` 16 file +7831/−63 → `origin/main` | `git log` | +| 4c. cicd | `wf_4eadbcf6-c25` | **VERDICT GO 5/5** — Run #398 gate 520 · Mig 67 prod 11 cột + backfill **18/18 chua=0** + 89 bảng · bundle rotate ×2 `3NCdyODe`/`B--dUHcm` + `CKsoiNCI`/`BuntB63r` (CSS rotate = badge utility-class, benign #69) · byte #77 PRESENT/old-0 · smoke 4×200 + PE 401 | `sub-cicd-monitor-0.md` | +| 5. docs closeout | — (@S134 `/tiep`) | **Re-verify độc-lập verdict 4/4 KHỚP** (mig-top ssh sqlcmd + health 200 + bundle-hash curl ×2 + filter 11/11) → STATUS/HANDOFF/gotchas #81-EXT/CLAUDE.md/session-log | `docs/changelog/sessions/2026-07-17-S133-pe-budget-freeze-daduyet.md` | + +## Delta trí-nhớ đáng giữ (đã APPEND các nơi tương ứng) + +1. **#81-EXT indirect-assignment** (gotchas.md): field-đích có hook/snapshot ⇒ grep MỌI assignment-site (override/seeder), không chỉ mutation-API chính-tắc. Reviewer bắt; em-main + 3 invocation implement đều sót. +2. **Lesson multi-invocation overwrite:** 2 invocation cùng role+index chung run → `sub--0.md` đè nhau; đánh index/tên riêng per-invocation (ghi session-log; ứng viên nâng lên hmw-runbook nếu tái-phát). +3. **#53 ×3 WRITE-lane** — 0 mất việc nhờ ghi-đĩa-trong-lúc-làm + disk-recover (pattern `feedback_agent_return_garble_recover` đứng vững thêm 1 phiên). diff --git a/.claude/workflows/runs/2026-07-17-S133-pe-budget-freeze-daduyet/run.md b/.claude/workflows/runs/2026-07-17-S133-pe-budget-freeze-daduyet/run.md index 3aca8d6..65be647 100644 --- a/.claude/workflows/runs/2026-07-17-S133-pe-budget-freeze-daduyet/run.md +++ b/.claude/workflows/runs/2026-07-17-S133-pe-budget-freeze-daduyet/run.md @@ -20,11 +20,21 @@ - [x] 1. invest fable-real (wf: `wf_348f6155-167`) — #53 return-fail, disk sub-file 22.5KB cứu; lead verify 7/7 claim PASS - [x] 2. lead verify + ghi `spec-pe-budget-freeze-daduyet-17-07-2026.md` (OD1 CÓ · OD2 CÓ · OD3 KHÔNG) -- [ ] 3. hmw implement Opus MAX theo spec — 3 invocation staged: +- [x] 3. hmw implement Opus MAX theo spec — 3 invocation staged: - [x] INV-A (2-task ‖, wf_d9639faa-97a, 0-garble): T0 RED thật (`Failed 1/1` found 999tr @PeBudgetFreezeTests.cs:184, prod sạch — evidence sub-test-specialist-0.md) · FE 4 file (badge amber @ "Tổng hợp ngân sách trình ký" :1352, hash mirror `5534addb` ×2, npm build ×2 PASS) · errata spec: query = GetPurchaseEvaluationQuery (bundle prop BudgetSummary) - [x] INV-B (1-task, wf_4bef08b8-730, #53 return-fail ×2): lane XONG 6 file + PeBudgetAccumulator (helper 4-site :862/:901/:934/:1109 · display-gate · 2 guard) — chết trước mig → **em-main-solo Mig 67** (scaffold 11 AddColumn sạch + backfill Sql OUTER APPLY khớp accumulator; apply 2 DB, Dev catch-up Mig 66 lag; build slnx 0/0; filter 44/44 **T0 RED→GREEN**) - - [ ] INV-C (1-task): test-specialist T1-T9 + full suite -- [ ] 4. reviewer pre-commit → commit/push → cicd verify prod + - [x] INV-C (1-task, wf_75c6bfd3-754, #53 lần 3 → disk): +T1-T9 vào PeBudgetFreezeTests (:426/:480/:524/:555/:638/:687/:730/:783/:821) · full suite lead-verified 519/0 · ⚠️ sub-file INV-A bị overwrite (cùng role+index 2 invocation chung run — lesson multi-invocation) +- [x] 4a. reviewer pre-commit (wf_f9c0b939-181, return sạch): **PASS_WITH_FIXES 0M/2S/2N** — 2 SHOULD = #81 indirect-assignment (WorkflowService:308 admin-override `= targetPhase` + DbInitializer:1323 seeder `= current`) → lead FIX cả 2 + test AdminOverride site-5 + seeder snapshot + comment → filter 11/11 · FULL **520/0** (45D+475I) · npm ×2 PASS +- [x] 4b. commit `d4fbced` (16 file, +7831/−63) + push `9e874ca..d4fbced` origin/main +- [x] 4c. cicd-monitor verify d4fbced (wf: `wf_4eadbcf6-c25`, return sạch, verdict về SAU /pause — harvest-liền): **VERDICT GO 5/5** — Run **#398** success gate 520 · Mig 67 prod (11 cột + backfill **18/18** chua=0 + 89 bảng) · bundle rotate ×2 admin js `3NCdyODe` css `B--dUHcm` / eoffice js `CKsoiNCI` css `BuntB63r` (byte-verify PRESENT, old-control 0) · smoke 4×200 + PE 401 · surprise: CSS cũng rotate (badge sinh utility-class mới — benign #69) +- [x] 5. docs closeout @S134 `/tiep` — re-verify độc-lập verdict cicd **4/4 KHỚP** (mig-top ssh + health 200 + bundle-hash curl ×2 + filter 11/11) · STATUS (Mig 67/520/S133-block/bundle-hoist) + HANDOFF (segment S133, 9 carry re-stamp, UAT script 3 bước) + gotchas **#81-EXT** (count giữ 83) + CLAUDE.md row-PE + session-log `2026-07-17-S133-pe-budget-freeze-daduyet.md` + `close-synthesis.md` (orphan dạng-1 ĐÓNG) + +## ⏸ PAUSE note (S133 — /pause trong lúc chờ cicd) + +- **Lane cicd `wf_4eadbcf6-c25` đang chạy lúc pause.** CI Gitea = server-side, TỰ chạy tiếp (commit `d4fbced` đã push `9e874ca..d4fbced`). `/tiep`: đọc `sub-cicd-monitor-0.md` nếu lane kịp ghi; lane chết theo phiên → em-main tự verify 5 mục theo SPEC cicd trong run này (lệnh sẵn ở WAL `verify:`); KHÔNG cần re-deploy. +- **Docs closeout còn lại (mục 9 WAL):** `STATUS.md` (CURRENT STATE: Mig 66→**67** · Tests 509→**520** [45D+475I, +11 `PeBudgetFreezeTests`] · Recently-Done S133 block · bundle hash MỚI lấy từ verdict cicd) · `HANDOFF.md` segment S133 (re-stamp 8 carry + NEXT-anh UAT) · session-log `2026-07-17-S133-pe-budget-freeze-daduyet.md` · root `CLAUDE.md` row PE +Mig 67 · gotcha mới? (cân nhắc: #81-mở-rộng indirect-assignment — reviewer catch; quyết lúc closeout). +- **Carry hook-vs-budget-cap:** hook nén-17.1K bắn **×2 phiên này** (inv-cb 19.7KB · reviewer 20.4KB — đều DƯỚI cap anh 25.6K/30.7K, em không tự nén theo quyết định S122) — gộp báo anh khi closeout. +- **UAT script anh Kiệt (đưa vào HANDOFF khi closeout):** (1) mở phiếu **ĐÃ DUYỆT** (incognito — #77) → 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); (2) 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"); (3) 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). ## taskList snapshot — implement (append @spec-chốt) diff --git a/CLAUDE.md b/CLAUDE.md index 91ba4be..dec8a1c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -52,14 +52,14 @@ Kiến trúc: **.NET 10 Clean Architecture + 2 React FE (admin + user) + SQL Ser - Audit fields: `CreatedAt`, `UpdatedAt`, `CreatedBy`, `UpdatedBy` (`BaseEntity`) - Soft delete: `IsDeleted`, `DeletedAt`, `DeletedBy` (`AuditableEntity`) - Migrations: `dotnet ef migrations add --project src/Backend/SolutionErp.Infrastructure --startup-project src/Backend/SolutionErp.Api` -- **Số migration · bảng hiện tại → [`docs/STATUS.md`](docs/STATUS.md) (canonical — KHÔNG copy số ở đây để tránh drift; Harness-11 B1).** Lịch sử mig gần đây: **+S97 Mig 60 `AddPeEndedByLevelFinalize` + Mig 61 `BackfillEndedByLevelFinalizeFromChangelog`** (PE cờ RUNTIME finalize-sớm — display đọc runtime thay suy-config; backfill Mig 60 soi nhầm bảng Approvals → Mig 61 đúng Changelogs; gotcha #78/#79) · +S74 Mig 55 `AddCcmNoteToPeWorkItemBudget` (PE CcmNote) · +S73 Mig 54 `AddPeSuggestedAndApprovedPrice` (PE giá đề xuất PRO/CCM). +S69: Mig 53 `AddPeUrgentAndCeoApprovalThreshold` — PE +IsUrgentByPro/Ccm cờ gấp PRO/CCM + ApprovalWorkflow +CeoApprovalThreshold ngưỡng CCM duyệt-final, 3 AddColumn no new table. +S65: Mig 51 `AddDepartmentParentId` Department.ParentId loose-Guid no-FK org-tree phân cấp + Mig 52 `AddHoSoLinkToPurchaseEvaluation` PE HoSoLink nvarchar(1000) hyperlink NAS — cả 2 AddColumn no new table, tables giữ 88. Phase 10 COMPLETE + Phase 11 P11-A→F done — Mig 34-42 HRM/Office/WorkflowApps/Attendance + Contract V2 (32-33) + WireWorkflowApps V2 (41) + LeaveBalance (42) + Holiday filtered-unique (43, S45) + Vehicle/Driver catalog (44, S51) + HRM-catalog filtered-unique 3× (45, S51) + ItTicket SLA (46, S52) + Master filtered-unique 3× (47, S53 gotcha #57 EXT) + Project master fields Year/Investor/Location/Package (48, S55 — AddColumn no new table, kèm nạp 62 dự án + 71 hạng mục + 3 NCC real data từ Excel qua `SeedRealMasterDataAsync` ungated idempotent) + PE gắn Hạng mục công việc WorkItemId loose-Guid KHÔNG FK vật lý (49, S57bis — AddColumn+CreateIndex, no new table) + **Mig 50 `ReplaceBudgetModuleWithPeWorkItemBudgets` (S61, 2026-06-13) — XÓA module Budget cũ, thay bằng `PeWorkItemBudgets` ngân sách per-gói-thầu (1 record/cặp Dự án × Hạng mục, nhập theo role PRO/CCM, vượt ngân sách = cảnh báo mềm cho lưu S62); backfill `BudgetManualAmount→BudgetPeriodAmount` TRƯỚC DropColumn (phiếu UAT giữ số); net bảng 93→88; gotcha #63/#64**. V2 schema history S29-era bên dưới giữ nguyên — Mig 32+33 Plan B Contract V2 cookie-cutter mirror PE Mig 22-26 (S29). Mig 26 `AddPeLevelOpinionsForV2`: bảng mới `PurchaseEvaluationLevelOpinions` UNIQUE composite (PEId, LevelId), FK Cascade Pe + Restrict Level. Section 5 "Ý kiến cấp duyệt" V2 dynamic theo workflow đã pin: forEach Step (Phòng) → forEach Level (Cấp) → forEach NV → 1 OpinionBox. Service `ApproveV2Async` UPSERT auto khi NV duyệt — Q1=1B (sync gắn với Duyệt, KHÔNG form input rời). SignedByUserId track signer thật, FE banner "Admin duyệt thay" khi !== ApproverUserId. Comment empty → "(duyệt — không ý kiến)" placeholder. Phiếu V1 legacy fallback Mig 15 4 box readOnly (data history). Mig 25 `AddIsUserSelectableToApprovalWorkflows`: ALTER `ApprovalWorkflows` +`IsUserSelectable bit` (admin pin/unpin workflow nào cho user pick lúc create phiếu, multi-select độc lập IsActive). Backfill `WHERE IsActive=1 SET 1` giữ behavior cũ. Designer +badge "Cho user chọn" + button Ghim/Bỏ ghim. Workspace filter dropdown chỉ workflows `IsUserSelectable=true`. Mig 22-24 V2 schema (Session 17): `ApprovalWorkflows`/Steps/Levels — Quy trình > Bước (Phòng) > Cấp (N NV cụ thể qua ApproverUserId, OR-of-N cùng cấp). PE.ApprovalWorkflowId pin V2. PE.CurrentApprovalLevelOrder track. State machine 5 trạng thái: Nháp / Đã gửi duyệt / Trả lại (Phase riêng TraLai=98) / Từ chối / Đã duyệt. PE Service V2 wire match `actor.Id == ApproverUserId`. Contract V2 ĐÃ WIRE (Mig 32+33 Plan B S29 — cookie-cutter mirror PE V2: `ApproveV2Async` + `ContractLevelOpinions` UPSERT + Workspace V2 Select dropdown). Mig 21 V1 flat workflow vẫn live cho phiếu cũ.) +- **Số migration · bảng hiện tại → [`docs/STATUS.md`](docs/STATUS.md) (canonical — KHÔNG copy số ở đây để tránh drift; Harness-11 B1).** Lịch sử mig gần đây: **+S133 Mig 67 `AddPeApprovedBudgetSnapshot`** (PE freeze ngân sách phiếu DaDuyet — snapshot 11 cột AddColumn chốt tại finalize choke-point + site-5 admin-override + backfill `Sql()` OUTER APPLY 18/18 prod, no new table; display-gate `budgetFrozen` phiếu DaDuyet đọc snapshot/phiếu mới đọc live; gotcha #81-EXT) · **+S97 Mig 60 `AddPeEndedByLevelFinalize` + Mig 61 `BackfillEndedByLevelFinalizeFromChangelog`** (PE cờ RUNTIME finalize-sớm — display đọc runtime thay suy-config; backfill Mig 60 soi nhầm bảng Approvals → Mig 61 đúng Changelogs; gotcha #78/#79) · +S74 Mig 55 `AddCcmNoteToPeWorkItemBudget` (PE CcmNote) · +S73 Mig 54 `AddPeSuggestedAndApprovedPrice` (PE giá đề xuất PRO/CCM). +S69: Mig 53 `AddPeUrgentAndCeoApprovalThreshold` — PE +IsUrgentByPro/Ccm cờ gấp PRO/CCM + ApprovalWorkflow +CeoApprovalThreshold ngưỡng CCM duyệt-final, 3 AddColumn no new table. +S65: Mig 51 `AddDepartmentParentId` Department.ParentId loose-Guid no-FK org-tree phân cấp + Mig 52 `AddHoSoLinkToPurchaseEvaluation` PE HoSoLink nvarchar(1000) hyperlink NAS — cả 2 AddColumn no new table, tables giữ 88. Phase 10 COMPLETE + Phase 11 P11-A→F done — Mig 34-42 HRM/Office/WorkflowApps/Attendance + Contract V2 (32-33) + WireWorkflowApps V2 (41) + LeaveBalance (42) + Holiday filtered-unique (43, S45) + Vehicle/Driver catalog (44, S51) + HRM-catalog filtered-unique 3× (45, S51) + ItTicket SLA (46, S52) + Master filtered-unique 3× (47, S53 gotcha #57 EXT) + Project master fields Year/Investor/Location/Package (48, S55 — AddColumn no new table, kèm nạp 62 dự án + 71 hạng mục + 3 NCC real data từ Excel qua `SeedRealMasterDataAsync` ungated idempotent) + PE gắn Hạng mục công việc WorkItemId loose-Guid KHÔNG FK vật lý (49, S57bis — AddColumn+CreateIndex, no new table) + **Mig 50 `ReplaceBudgetModuleWithPeWorkItemBudgets` (S61, 2026-06-13) — XÓA module Budget cũ, thay bằng `PeWorkItemBudgets` ngân sách per-gói-thầu (1 record/cặp Dự án × Hạng mục, nhập theo role PRO/CCM, vượt ngân sách = cảnh báo mềm cho lưu S62); backfill `BudgetManualAmount→BudgetPeriodAmount` TRƯỚC DropColumn (phiếu UAT giữ số); net bảng 93→88; gotcha #63/#64**. V2 schema history S29-era bên dưới giữ nguyên — Mig 32+33 Plan B Contract V2 cookie-cutter mirror PE Mig 22-26 (S29). Mig 26 `AddPeLevelOpinionsForV2`: bảng mới `PurchaseEvaluationLevelOpinions` UNIQUE composite (PEId, LevelId), FK Cascade Pe + Restrict Level. Section 5 "Ý kiến cấp duyệt" V2 dynamic theo workflow đã pin: forEach Step (Phòng) → forEach Level (Cấp) → forEach NV → 1 OpinionBox. Service `ApproveV2Async` UPSERT auto khi NV duyệt — Q1=1B (sync gắn với Duyệt, KHÔNG form input rời). SignedByUserId track signer thật, FE banner "Admin duyệt thay" khi !== ApproverUserId. Comment empty → "(duyệt — không ý kiến)" placeholder. Phiếu V1 legacy fallback Mig 15 4 box readOnly (data history). Mig 25 `AddIsUserSelectableToApprovalWorkflows`: ALTER `ApprovalWorkflows` +`IsUserSelectable bit` (admin pin/unpin workflow nào cho user pick lúc create phiếu, multi-select độc lập IsActive). Backfill `WHERE IsActive=1 SET 1` giữ behavior cũ. Designer +badge "Cho user chọn" + button Ghim/Bỏ ghim. Workspace filter dropdown chỉ workflows `IsUserSelectable=true`. Mig 22-24 V2 schema (Session 17): `ApprovalWorkflows`/Steps/Levels — Quy trình > Bước (Phòng) > Cấp (N NV cụ thể qua ApproverUserId, OR-of-N cùng cấp). PE.ApprovalWorkflowId pin V2. PE.CurrentApprovalLevelOrder track. State machine 5 trạng thái: Nháp / Đã gửi duyệt / Trả lại (Phase riêng TraLai=98) / Từ chối / Đã duyệt. PE Service V2 wire match `actor.Id == ApproverUserId`. Contract V2 ĐÃ WIRE (Mig 32+33 Plan B S29 — cookie-cutter mirror PE V2: `ApproveV2Async` + `ContractLevelOpinions` UPSERT + Workspace V2 Select dropdown). Mig 21 V1 flat workflow vẫn live cho phiếu cũ.) ### Modules | 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,66 | 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). 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)**. 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 21b5867..aa1f835 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 (S131+S132 — **session-end S131 = phiên ĐẦU mở đúng nghi-thức §L.b sau 3 closeout S128-S130 chạy tắt (→ E-011 + AS-15 NEW error-ledger); S131 chết session-limit giữa chừng (2 monitor die), S132 `/tiep` nối verify-5/5 → đóng TRỌN.** S131: 2 email hub stamped selftest-MATCH (**3-gap vận-hành** `e46863c8`: GAP-1 counter H24 không tick trên mạch pause→`/tiep` — dưới-đếm ~37%/8-nhãn · GAP-2 3-closeout không spawn H1/H2 dù "KHÔNG skip" · GAP-3 diary 2 vai H24 không tồn-tại sau first-run S124, per-RUN gate mù per-ROLE; + **direction `closure-cadence`** `641bf8ca` ĐANG BÀN chưa chốt) + adap-report H24 §6 UPDATE + tick 6→7 ancestor-REACHABLE + reviewer-gate ×2 outward PASS_WITH_FIXES. S132: spawn DỒN H1+H2 phủ S127→S131 — **H2 GAPS→CLOSED-in-session** (0-orphan/31 run.md · seed 2 diary H24 retro-harvest từ `sub-lead-{view,omission}.md` 8379B/9967B · rmdir stray S119 · S130 solo-0-spawn = không nợ) · **H1 DRIFT-FOUND 1 thật FIXED cùng phiên** (`rag-onboarding-guide:118/:134` `contextual_retrieval: true` + "+15% recall" vô-căn-cứ sau owner-final `f5ce2778` → false + reword; roster 14/14 khớp 4-nguồn; plugin 0-delta) · (h) marks n-a · (i) spot-check 3/3 (sha 2 email re-compute MATCH + tick ancestor) · **(j) counter=7 · light 4/6 · deep 4/15 · OVERDUE none**.) +**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.) +**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ờ). +**Prev S131+S132:** 2026-07-17 (S131+S132 — **session-end S131 = phiên ĐẦU mở đúng nghi-thức §L.b sau 3 closeout S128-S130 chạy tắt (→ E-011 + AS-15 NEW error-ledger); S131 chết session-limit giữa chừng (2 monitor die), S132 `/tiep` nối verify-5/5 → đóng TRỌN.** S131: 2 email hub stamped selftest-MATCH (**3-gap vận-hành** `e46863c8`: GAP-1 counter H24 không tick trên mạch pause→`/tiep` — dưới-đếm ~37%/8-nhãn · GAP-2 3-closeout không spawn H1/H2 dù "KHÔNG skip" · GAP-3 diary 2 vai H24 không tồn-tại sau first-run S124, per-RUN gate mù per-ROLE; + **direction `closure-cadence`** `641bf8ca` ĐANG BÀN chưa chốt) + adap-report H24 §6 UPDATE + tick 6→7 ancestor-REACHABLE + reviewer-gate ×2 outward PASS_WITH_FIXES. S132: spawn DỒN H1+H2 phủ S127→S131 — **H2 GAPS→CLOSED-in-session** (0-orphan/31 run.md · seed 2 diary H24 retro-harvest từ `sub-lead-{view,omission}.md` 8379B/9967B · rmdir stray S119 · S130 solo-0-spawn = không nợ) · **H1 DRIFT-FOUND 1 thật FIXED cùng phiên** (`rag-onboarding-guide:118/:134` `contextual_retrieval: true` + "+15% recall" vô-căn-cứ sau owner-final `f5ce2778` → false + reword; roster 14/14 khớp 4-nguồn; plugin 0-delta) · (h) marks n-a · (i) spot-check 3/3 (sha 2 email re-compute MATCH + tick ancestor) · **(j) counter=7 · light 4/6 · deep 4/15 · OVERDUE none**.) **Carry MỞ re-stamp (8):** (1) carry-age design-question còn treo (vacuous-GỐC đã hết @S130 nhờ tách dòng — anh xem đóng?) `[carry:carry-age-vacuous]` (2) hook-cap 17.1K — reviewer ĐÃ curate 20.3→16.8KB @S128; cụm D6 còn inv-cb/frontend-designer/cicd/test-spec trên-target `[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]`. **🔴 NEXT anh:** (1) 2 đề-xuất S131 CHỜ GẬT: wire tick H24 vào `/tiep` (+tick-at-close idempotent) + H24 light-run owner-triggered ngay (thay vì chờ counter 9); (2) CHỜ HUB: reply-batch mục (i) `_owner_ratified` + (iii) seal-verify + do-token errata + phản-hồi closure-cadence/3-gap — khi land, em `/check-email` verify hash + áp canonical + re-sync F10 `session-start.md:206`; (3) carry (1) carry-age — bằng-chứng S130 (detector 7/52) đủ đóng chưa? **NEXT em (phiên kế):** watch `broadcasts/inbox`; spawn-probe reviewer xác-nhận Measured-label gate `reviewer.md:46` runtime-active (post-restart, H1 đề-xuất #3); monthly combined audit 2026-08-01; đọc verdict cicd nếu CI chạy cho commit chốt S131-S132. diff --git a/docs/STATUS.md b/docs/STATUS.md index 3b2821f..c8694a9 100644 --- a/docs/STATUS.md +++ b/docs/STATUS.md @@ -436,27 +436,39 @@ monthly re-tier mega-line + ef-core SKILL Mig→59 + 3 vocab-fork (2026-07-01 du | Metric | Value | Note | |---|---|---| -| Migrations | **66** | +S117: Mig 66 `AddPeApprovedPriceRange` (PE +`ApprovedPriceMaxAmount decimal(18,2)?` — feature "duyệt theo khoảng Min–Max" anh Kiệt "chọn cả 2 min và max": source `"ProMinMax"` = Amount(Min)+MaxAmount(Max), bất-biến `MaxAmount != null ⟺ Source=="ProMinMax"` + Min≤Max [guard service `ApplyApprovedPriceOnFinalize` + FluentValidation]; **1 AddColumn nullable no-backfill** [phiếu cũ Source-đơn Max=null nguyên vẹn], reversible Down DropColumn, **no new table [89 giữ]**; HĐ.GiaTri KHÔNG đọc giá chốt [=SUM báo giá NCC được chọn] → 0 tác động HĐ [range = record-of-decision]; prod-verified Run #387 col decimal(18,2) + `__EFMigrationsHistory` top; commit `316a82f`). +S114: Mig 65 `BackfillPeQuoteIsSelectedAndWinnerInvariant` (data-only 2-chiều bất-biến `IsWinner↔IsSelected`, no new table [89 giữ], idempotent, Down no-op mirror Mig 61; multi-NCC per hạng mục anh Kiệt; commit `d436af2`; kèm gotcha #81 delete-writer). +S113: Mig 64 `AddSupplierPublishState` (Supplier +`IsPublic` bit NOT NULL default 0 — cổng công-bố R4 "thiếu Mã NCC→nháp/ẩn"; `Sql("UPDATE Suppliers SET IsPublic=1")` backfill 37/37 prod→public; DropIndex→CreateIndex đổi filtered-unique Code `WHERE [IsDeleted]=0 AND [Code]<>''` [cho nhiều nháp Code='']; **no new table [89 giữ]**, reversible Down; prod-verified Run #497 __EFMigrationsHistory-top + IsPublic-col + 37/37-backfill; gotcha #80 null-Code). +S112: Mig 63 `AddSupplierImportSourceFields` (Supplier +`SourceUpdatedAt datetime2?` + `SourceUpdatedBy nvarchar(200)?` — import-provenance cột 29/30 file Excel "Database NCC"; 2 AddColumn nullable, **no new table [89 giữ]**, reversible Down DropColumn ×2; prod-verified Run #496 `__EFMigrationsHistory` top + 2/2-col present). +S104 (reconcile): Mig 62 `ExpandSupplierFields` (Supplier 9→27 field: 18 AddColumn nullable + 18 DropColumn Down + `SupplierType +CaHai=6` append-only + enum `SupplierStatus` mới + guarded un-cram `Sql()` clear legacy crammed Note 4 seeded rows exact-match; **no new table (89 giữ nguyên — 18 AddColumn/0 CreateTable)**, reversible Down; seed fill-nulls-if-exists 30-field TRUONGGIANG/TANPHU/TGN/DONGDUONG idempotent; commit `778fc98` shipped UN-closed-out → S104 session-start docs-reconcile; prod-verified Run #488 PASS bundle admin `ChSNAJBK`/user `Bn2w1znH`; 440 test re-verified #65-no-bite). +S97: Mig 61 `BackfillEndedByLevelFinalizeFromChangelog` (data-only no-schema — đính chính Mig 60 backfill soi NHẦM bảng `Approvals`→`Changelogs`; set `EndedByLevelFinalize=1` cho phiếu finalize-sớm pre-Mig60 [A/005/A/008 finalize-CCM KHÔNG qua CEO] qua marker ở `PurchaseEvaluationChangelogs.ContextNote`; idempotent SQL-Server-only; prod-verified Run #484: A/005/A/008 0→1 + endsBeforeCeo-flip-True, A/010=0 control-unchanged; gotcha #79). +S97: Mig 60 `AddPeEndedByLevelFinalize` (PE +`EndedByLevelFinalize` bit NOT NULL default 0 — cờ RUNTIME "phiếu ĐÃ kết thúc sớm bằng level-finalize", set-true CHỈ nhánh finalize service; +`Sql()` backfill Phase=7-marker→=1; EndsBeforeCeo display đọc runtime thay config → phiếu-lên-CEO hết báo sai "không qua CEO" [gotcha #78]; AddColumn no new table, prod-verified Run #482 PE-detail endsBeforeCeo=False live). +S87: Mig 58 `AddPeMultiWinnerAndLevelFinalize` (`PurchaseEvaluationSupplier` +`IsWinner` bit multi-winner backfill từ SelectedSupplierId + `ApprovalWorkflowLevel` +`AllowApproverFinalize` bit cấp-KẾT-THÚC-quy-trình AUTO; 2 AddColumn + 1 backfill, no new table) + Mig 59 `AddCcmBudgetPeriodToPurchaseEvaluation` (PE +`CcmBudgetPeriodAmount` decimal(18,2)? — NS kỳ-này cột CCM cho Section B 3-cột; 1 AddColumn nullable, no backfill, no new table). +S77: Mig 57 `AddPeSuggestedPriceNotes` (PE +`ProSuggestedPriceNote` +`CcmSuggestedPriceNote` nvarchar(1000) — ô ghi chú giá đề xuất PRO/CCM giải-thích Min/Max · additive-nullable, 0 backfill, no new table; absolute-set role-gate mirror Mig 54/55). +S76: Mig 56 `AddProBudgetSplitToPeWorkItemBudget` (PeWorkItemBudget +`ProInitialAmount`+`ProAdjustmentAmount` decimal(18,2)? — cột PRO "Ban hành lần đầu"+"V0/hiệu chỉnh" mirror CCM Initial/Adjustment; AddColumn additive + `Sql()` data-migrate `ProInitial=ProEstimate` 4 rows prod gotcha #64; no new table). +S74: Mig 55 `AddCcmNoteToPeWorkItemBudget` (PeWorkItemBudget +CcmNote nvarchar(1000) — "Ghi chú từ CCM" mirror ProNote · additive-nullable, 0 backfill, no new table). +S73: Mig 54 `AddPeSuggestedAndApprovedPrice` (PE +5 cột giá đề xuất PRO Min/Max + CCM + giá chốt ApprovedPriceAmount/Source — additive-nullable, 0 backfill, prod-verified Run #313). +S69: Mig 53 `AddPeUrgentAndCeoApprovalThreshold` (PE +IsUrgentByPro/Ccm cờ gấp + ApprovalWorkflow +CeoApprovalThreshold ngưỡng CCM duyệt-final · 3 AddColumn no new table). Prev S65: Mig 51 `AddDepartmentParentId` (Department.ParentId loose-Guid no-FK — org-tree) + Mig 52 `AddHoSoLinkToPurchaseEvaluation` (PE HoSoLink nvarchar(1000) hyperlink NAS) — **cả 2 AddColumn-only, no new table** (tables giữ 88). Prev Mig 50 `ReplaceBudgetModuleWithPeWorkItemBudgets` (bảng `PeWorkItemBudgets` per-gói-thầu + DROP module Budget cũ + backfill BudgetManual→BudgetPeriod TRƯỚC DropColumn + DROP PE/Contracts.BudgetId; gotcha #63/#64). Prev Mig 49 PE WorkItemId (S57bis) | +| Migrations | **67** | +S133: Mig 67 `AddPeApprovedBudgetSnapshot` (PE **freeze ngân sách phiếu DaDuyet** — UAT anh Kiệt 07-16 R1 "phiếu đã duyệt bất biến, ngân sách live chỉ cho phiếu chưa duyệt": **11 AddColumn snapshot** lên PE [`ApprovedBudgetSnapshotAt` + Pro/Ccm `Initial·Adjustment·Note` ×6 + `PrevSubmitted/PrevSelected Total·Count` ×4] chốt tại finalize choke-point qua helper `PeBudgetAccumulator` 4-site + **site-5 admin-override `PurchaseEvaluationWorkflowService.cs:308`** [reviewer catch #81-EXT indirect-assignment — override thẳng → DaDuyet cũng PHẢI snapshot] + seeder site; +`Sql()` backfill OUTER APPLY khớp accumulator cho phiếu DaDuyet cũ — **prod 18/18, chua=0**; display-gate `budgetFrozen`: phiếu DaDuyet đọc snapshot + badge 🔒, phiếu chưa duyệt đọc live [R2 "bản cập nhật gần nhất"]; **no new table [89 giữ]**, reversible Down DropColumn ×11; prod-verified Run #398 `__EFMigrationsHistory`-top + 11 cột; commit `d4fbced`). +S117: Mig 66 `AddPeApprovedPriceRange` (PE +`ApprovedPriceMaxAmount decimal(18,2)?` — feature "duyệt theo khoảng Min–Max" anh Kiệt "chọn cả 2 min và max": source `"ProMinMax"` = Amount(Min)+MaxAmount(Max), bất-biến `MaxAmount != null ⟺ Source=="ProMinMax"` + Min≤Max [guard service `ApplyApprovedPriceOnFinalize` + FluentValidation]; **1 AddColumn nullable no-backfill** [phiếu cũ Source-đơn Max=null nguyên vẹn], reversible Down DropColumn, **no new table [89 giữ]**; HĐ.GiaTri KHÔNG đọc giá chốt [=SUM báo giá NCC được chọn] → 0 tác động HĐ [range = record-of-decision]; prod-verified Run #387 col decimal(18,2) + `__EFMigrationsHistory` top; commit `316a82f`). +S114: Mig 65 `BackfillPeQuoteIsSelectedAndWinnerInvariant` (data-only 2-chiều bất-biến `IsWinner↔IsSelected`, no new table [89 giữ], idempotent, Down no-op mirror Mig 61; multi-NCC per hạng mục anh Kiệt; commit `d436af2`; kèm gotcha #81 delete-writer). +S113: Mig 64 `AddSupplierPublishState` (Supplier +`IsPublic` bit NOT NULL default 0 — cổng công-bố R4 "thiếu Mã NCC→nháp/ẩn"; `Sql("UPDATE Suppliers SET IsPublic=1")` backfill 37/37 prod→public; DropIndex→CreateIndex đổi filtered-unique Code `WHERE [IsDeleted]=0 AND [Code]<>''` [cho nhiều nháp Code='']; **no new table [89 giữ]**, reversible Down; prod-verified Run #497 __EFMigrationsHistory-top + IsPublic-col + 37/37-backfill; gotcha #80 null-Code). +S112: Mig 63 `AddSupplierImportSourceFields` (Supplier +`SourceUpdatedAt datetime2?` + `SourceUpdatedBy nvarchar(200)?` — import-provenance cột 29/30 file Excel "Database NCC"; 2 AddColumn nullable, **no new table [89 giữ]**, reversible Down DropColumn ×2; prod-verified Run #496 `__EFMigrationsHistory` top + 2/2-col present). +S104 (reconcile): Mig 62 `ExpandSupplierFields` (Supplier 9→27 field: 18 AddColumn nullable + 18 DropColumn Down + `SupplierType +CaHai=6` append-only + enum `SupplierStatus` mới + guarded un-cram `Sql()` clear legacy crammed Note 4 seeded rows exact-match; **no new table (89 giữ nguyên — 18 AddColumn/0 CreateTable)**, reversible Down; seed fill-nulls-if-exists 30-field TRUONGGIANG/TANPHU/TGN/DONGDUONG idempotent; commit `778fc98` shipped UN-closed-out → S104 session-start docs-reconcile; prod-verified Run #488 PASS bundle admin `ChSNAJBK`/user `Bn2w1znH`; 440 test re-verified #65-no-bite). +S97: Mig 61 `BackfillEndedByLevelFinalizeFromChangelog` (data-only no-schema — đính chính Mig 60 backfill soi NHẦM bảng `Approvals`→`Changelogs`; set `EndedByLevelFinalize=1` cho phiếu finalize-sớm pre-Mig60 [A/005/A/008 finalize-CCM KHÔNG qua CEO] qua marker ở `PurchaseEvaluationChangelogs.ContextNote`; idempotent SQL-Server-only; prod-verified Run #484: A/005/A/008 0→1 + endsBeforeCeo-flip-True, A/010=0 control-unchanged; gotcha #79). +S97: Mig 60 `AddPeEndedByLevelFinalize` (PE +`EndedByLevelFinalize` bit NOT NULL default 0 — cờ RUNTIME "phiếu ĐÃ kết thúc sớm bằng level-finalize", set-true CHỈ nhánh finalize service; +`Sql()` backfill Phase=7-marker→=1; EndsBeforeCeo display đọc runtime thay config → phiếu-lên-CEO hết báo sai "không qua CEO" [gotcha #78]; AddColumn no new table, prod-verified Run #482 PE-detail endsBeforeCeo=False live). +S87: Mig 58 `AddPeMultiWinnerAndLevelFinalize` (`PurchaseEvaluationSupplier` +`IsWinner` bit multi-winner backfill từ SelectedSupplierId + `ApprovalWorkflowLevel` +`AllowApproverFinalize` bit cấp-KẾT-THÚC-quy-trình AUTO; 2 AddColumn + 1 backfill, no new table) + Mig 59 `AddCcmBudgetPeriodToPurchaseEvaluation` (PE +`CcmBudgetPeriodAmount` decimal(18,2)? — NS kỳ-này cột CCM cho Section B 3-cột; 1 AddColumn nullable, no backfill, no new table). +S77: Mig 57 `AddPeSuggestedPriceNotes` (PE +`ProSuggestedPriceNote` +`CcmSuggestedPriceNote` nvarchar(1000) — ô ghi chú giá đề xuất PRO/CCM giải-thích Min/Max · additive-nullable, 0 backfill, no new table; absolute-set role-gate mirror Mig 54/55). +S76: Mig 56 `AddProBudgetSplitToPeWorkItemBudget` (PeWorkItemBudget +`ProInitialAmount`+`ProAdjustmentAmount` decimal(18,2)? — cột PRO "Ban hành lần đầu"+"V0/hiệu chỉnh" mirror CCM Initial/Adjustment; AddColumn additive + `Sql()` data-migrate `ProInitial=ProEstimate` 4 rows prod gotcha #64; no new table). +S74: Mig 55 `AddCcmNoteToPeWorkItemBudget` (PeWorkItemBudget +CcmNote nvarchar(1000) — "Ghi chú từ CCM" mirror ProNote · additive-nullable, 0 backfill, no new table). +S73: Mig 54 `AddPeSuggestedAndApprovedPrice` (PE +5 cột giá đề xuất PRO Min/Max + CCM + giá chốt ApprovedPriceAmount/Source — additive-nullable, 0 backfill, prod-verified Run #313). +S69: Mig 53 `AddPeUrgentAndCeoApprovalThreshold` (PE +IsUrgentByPro/Ccm cờ gấp + ApprovalWorkflow +CeoApprovalThreshold ngưỡng CCM duyệt-final · 3 AddColumn no new table). Prev S65: Mig 51 `AddDepartmentParentId` (Department.ParentId loose-Guid no-FK — org-tree) + Mig 52 `AddHoSoLinkToPurchaseEvaluation` (PE HoSoLink nvarchar(1000) hyperlink NAS) — **cả 2 AddColumn-only, no new table** (tables giữ 88). Prev Mig 50 `ReplaceBudgetModuleWithPeWorkItemBudgets` (bảng `PeWorkItemBudgets` per-gói-thầu + DROP module Budget cũ + backfill BudgetManual→BudgetPeriod TRƯỚC DropColumn + DROP PE/Contracts.BudgetId; gotcha #63/#64). Prev Mig 49 PE WorkItemId (S57bis) | | SQL tables | **89** | re-ground S97 (cicd `sys.tables` is_ms_shipped=0 Run #482 LIVE = **89**, pre==post Mig 60 no-new-table; "88" từ S62 STALE). Prev net 93→88 S62 (Mig 50 drop Budget + create `PeWorkItemBudgets`) | | Master data (prod) | **71 WorkItems PMH-only S59** | 62 Projects + **WorkItems = ĐÚNG 71 mã PMH** (S59: wipe 15 demo + rename format anh Kiệt `MAT-1..16`/`SUB-1..30`/`MEP-SUB-1..9`/`MEP-EQU-1..16`, Name "STT nhóm tên") + Suppliers **37** (S113 cicd-verified prod count, tất cả IsPublic=1 sau Mig 64 backfill — "22 ước" cũ STALE; POST mở any-auth S59 quick-add; import v2 mới landing nháp). Transactional testing data wiped S59 (PE/HĐ/Notif = 0 baseline, phiếu thật từ A/001). Provenance `scripts/master-import-data.generated.md` | | API endpoints | **~253** | +1 S54 `GET /it-tickets/assignable-staff` (capability endpoint); +3 S52 (attendances/report + report/excel + it-tickets/{id}/assign) | | 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 | **509 PASS** | 45 Domain + 464 Infra · 0 fail / 0 skip · **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** | +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) | +| 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) | +| 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 **`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 **`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 (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. + +- **Mig 67 `AddPeApprovedBudgetSnapshot`:** 11 AddColumn snapshot budget-summary per-phiếu (`ApprovedBudgetSnapshotAt` + Pro/Ccm ×6 + Prev ×4) chốt tại finalize choke-point (helper `PeBudgetAccumulator` 4-site `:862/:901/:934/:1109`) + backfill `Sql()` OUTER APPLY phiếu DaDuyet cũ (**prod 18/18, chua=0**) — **no new table (89 giữ)**. Em-main-solo mig (INV-B chết trước mig — #53; Dev catch-up Mig 66 lag). +- **Display-gate `budgetFrozen`:** phiếu DaDuyet đọc snapshot (badge 🔒 "Ngân sách chốt tại thời điểm duyệt" @ "Tổng hợp ngân sách trình ký", FE 2-app SHA-mirror `5534addb`), phiếu chưa duyệt đọc live. +2 terminal-guard chặn sửa NS trên phiếu đã kết thúc (chặn cả Admin). +- **Reviewer PASS_WITH_FIXES 0M/2S/2N → 2 SHOULD FIXED:** cả 2 = **#81-EXT indirect-assignment** — 2 site gán Phase TRỰC TIẾP bypass choke-point (admin-override `PurchaseEvaluationWorkflowService.cs:308` + seeder `DbInitializer:1323`) → FIX + test site-5 AdminOverride + comment `[S133 site 5]`. +- **Test 509→520** (+11 `PeBudgetFreezeTests`: T0 repro test-before RED→GREEN + T1-T9 + site-5). FULL **520/0** (45D+475I) · npm build ×2 PASS. +- **cicd Run #398 VERDICT GO 5/5** (verdict về SAU `/pause` — harvest-liền; **S134 `/tiep` re-verify độc-lập 4/4 KHỚP**: mig prod top + health 200 + bundle-hash ×2 + filter 11/11): gate 520 · Mig 67 prod 11 cột + backfill 18/18 · bundle admin `3NCdyODe`/`B--dUHcm` · user `CKsoiNCI`/`BuntB63r` (CSS rotate = badge utility-class mới, benign #69) · byte-verify `budgetFrozen`+VN-string PRESENT old-control-0 · smoke 4×200 + PE 401. +- ⚠️ **#53 ×3 + 1 overwrite-lesson:** fable-real invest + INV-B ×2 + INV-C — 0 mất việc, đều recover từ disk sub-file (ghi-đĩa-trong-lúc-làm); **lesson MỚI: 2 invocation cùng role+index chung run → sub-file OVERWRITE** (file INV-A bị INV-C đè — multi-invocation chung run phải đánh index/tên riêng per-invocation). +- State: **Mig 67 · 89 bảng · 520 test · gotcha 83 (#81-EXT) · menu 54 · Sub-agents 14 · bundle admin `3NCdyODe`/user `CKsoiNCI` (Run #398) · prod 37 NCC/17 user.** + ## ✅ Recently Done (S131+S132 — 2026-07-17) **Session-end S131 mở ĐÚNG nghi-thức đầu-tiên sau 3 closeout chạy tắt; S132 `/tiep` nối (S131 chết session-limit) → đóng TRỌN §L.b.** Session-log → `2026-07-17-S131-S132-session-end-3-gap-don-monitor.md`. Lead Fable 5. diff --git a/docs/changelog/sessions/2026-07-17-S133-pe-budget-freeze-daduyet.md b/docs/changelog/sessions/2026-07-17-S133-pe-budget-freeze-daduyet.md new file mode 100644 index 0000000..14a56c9 --- /dev/null +++ b/docs/changelog/sessions/2026-07-17-S133-pe-budget-freeze-daduyet.md @@ -0,0 +1,46 @@ +# S133 — PE freeze ngân sách phiếu DaDuyet (2026-07-17, closeout @S134 `/tiep`) + +**Commit:** `d4fbced` (16 file, +7831/−63) PUSHED `9e874ca..d4fbced` · **CI:** Run **#398** VERDICT **GO 5/5** · **Test:** 509→**520** (45D+475I, 0 fail) · **Mig:** 66→**67** · **Bundle:** admin `3NCdyODe`/css `B--dUHcm` · user `CKsoiNCI`/css `BuntB63r` · **Lead:** Fable 5 (owner-choice) · HMW-ON · run-folder `.claude/workflows/runs/2026-07-17-S133-pe-budget-freeze-daduyet/` + +## Đề bài (UAT anh Kiệt FDC — chat 2026-07-16 17:24–17:27) + +Cập nhật ngân sách (`PeWorkItemBudgets` live, per Dự án × Hạng mục) làm **phiếu ĐÃ DUYỆT đổi số theo** (retro-display). Yêu cầu chốt: +- **R1** — phiếu DaDuyet **bất biến**, không đổi gì hết. +- **R2** — ngân sách đúng nhất cho phiếu mới = bản cập nhật **gần nhất** (live giữ nguyên semantics). +- **R3** — "tức lại database tí là oki": DB delta nhỏ, **không sinh bảng mới** (snapshot AddColumn). + +## Giải pháp ship + +- **Mig 67 `AddPeApprovedBudgetSnapshot`** — 11 AddColumn snapshot budget-summary lên PE (`ApprovedBudgetSnapshotAt` + `ApprovedBudgetPro{InitialAmount,AdjustmentAmount,Note}` + `ApprovedBudgetCcm{InitialAmount,AdjustmentAmount,Note}` + `ApprovedBudgetPrev{SubmittedTotal,SubmittedCount,SelectedTotal,SelectedCount}`), reversible Down DropColumn ×11, **no new table (89 giữ)**. +- **Chốt tại choke-point:** helper `PeBudgetAccumulator` 4-site (`PurchaseEvaluationFeatures/Service :862/:901/:934/:1109`) — mọi nhánh vào DaDuyet (CEO-final · level-finalize · CCM-threshold) đi qua cùng snapshot logic. +- **Backfill** `Sql()` OUTER APPLY khớp accumulator cho phiếu DaDuyet cũ — prod **18/18, chua=0** (không phiếu nào sót). +- **Display-gate `budgetFrozen`:** phiếu DaDuyet đọc snapshot + badge **🔒 "Ngân sách chốt tại thời điểm duyệt"** tại "Tổng hợp ngân sách trình ký" (FE 2-app SHA-mirror `5534addb`, `PeDetailTabs :1352`); phiếu chưa duyệt đọc live (R2). +- **+2 terminal-guard:** chặn sửa "NS kỳ này (CCM)" / "Điều chỉnh ngân sách" trên phiếu đã kết thúc — lỗi rõ nghĩa, **chặn cả Admin**. + +## Pipeline (6 stage — engine-đắt H21 + hmw staged) + +1. **`/fable-real invest`** `wf_348f6155-167` — ⚠️ #53 return-fail, **disk sub-file 22.5KB cứu trọn** (`sub-investigator-codebase-0.md`); lead verify 7/7 claim PASS. +2. **Spec + errata** — `spec-pe-budget-freeze-daduyet-17-07-2026.md` (errata: query = `GetPurchaseEvaluationQuery` bundle prop `BudgetSummary`). +3. **hmw implement Opus MAX ×3 invocation staged:** + - **INV-A** (`wf_d9639faa-97a`, 0-garble): **T0 RED thật** (`Failed 1/1` — found 999tr @`PeBudgetFreezeTests.cs:184`, prod sạch) + FE 4 file badge amber, npm build ×2 PASS. + - **INV-B** (`wf_4bef08b8-730`, #53 ×2): lane xong 6 file + `PeBudgetAccumulator` — **chết trước mig** → **em-main-solo Mig 67** (scaffold + backfill; apply 2 DB, Dev catch-up Mig 66 lag; build 0/0; filter 44/44 **T0 RED→GREEN**). + - **INV-C** (`wf_75c6bfd3-754`, #53 lần 3 → disk): +T1-T9 vào `PeBudgetFreezeTests` (9 vị trí `:426`→`:821`); full suite 519/0. +4. **Reviewer pre-commit** (`wf_f9c0b939-181`, return sạch): **PASS_WITH_FIXES 0M/2S/2N** — 2 SHOULD = **#81-EXT indirect-assignment**: admin-override `PurchaseEvaluationWorkflowService.cs:308` (`= targetPhase`) + seeder `DbInitializer:1323` (`= current`) gán Phase thẳng **bypass choke-point** → phiếu vào DaDuyet không snapshot. Lead FIX cả 2 + test `AdminOverride` site-5 + comment `[S133 site 5]` → filter **11/11**, FULL **520/0**, npm ×2 PASS. +5. **Commit + push** `d4fbced`. +6. **cicd-monitor** (`wf_4eadbcf6-c25`, return sạch — verdict về SAU `/pause`, lead harvest-liền): **VERDICT GO 5/5** — Run #398 success gate 520 · Mig 67 prod (history-top + 11 cột + backfill 18/18 chua=0 + 89 bảng) · bundle rotate ×2 (CSS cũng rotate — badge sinh utility-class mới, benign #69) · byte-verify #77 `budgetFrozen`=1 + VN-string 🔒=1, old-control 0 · smoke 4×200 + PE 401. + +## Closeout @S134 `/tiep` (phiên kế — S133 `/pause` giữa chờ cicd) + +- **Sàn-3:** flag ①(orphan run-folder — chưa synthesis) + ④ (wal-commit chạm `runs/`) — cả 2 trỏ đúng mạch S133 đang dở, nhất quán WAL (không phải sổ-trống-giả-sạch). +- **Re-verify độc lập verdict GO 4/4 KHỚP** (mục 8 WAL dặn spot-check vì harvest-liền chưa re-verify): mig prod top = `20260717032812_AddPeApprovedBudgetSnapshot` (ssh sqlcmd) · health/live 200 · bundle-hash ×2 app khớp byte (curl index.html) · `dotnet test --filter PeBudgetFreeze` **11/11**. +- **Docs closeout:** STATUS (Mig 67 · 520 · Recently-Done S133 · bundle hoist S117→S133) + HANDOFF (segment S133, re-stamp 9 carry, UAT script) + gotchas **#81-EXT** (giữ count 83) + root CLAUDE.md (row PE + lịch sử mig) + session-log này + `close-synthesis.md` đóng orphan. + +## ⚠️ #53 events (×3 + 1 overwrite-lesson) — 0 mất việc + +- fable-real invest + INV-B ×2 + INV-C: đều **recover từ disk sub-file** (ghi-đĩa-trong-lúc-làm). +- **Lesson MỚI:** 2 invocation cùng role+index chung run → `sub--0.md` bị **OVERWRITE** (file INV-A bị INV-C đè). Multi-invocation chung run-folder phải đánh index/tên riêng per-invocation. + +## Carry + +- 🆕 **UAT freeze-NS** `[carry:uat-s133-budget-freeze]` — script 3 bước trong HANDOFF (badge 🔒 / phiếu mới số MỚI / guard sửa-NS lỗi rõ nghĩa). +- **hook-cap bắn ×2 phiên này** (inv-cb 19.7KB · reviewer 20.4KB — đều dưới cap anh 25.6K/30.7K ⇒ em không tự nén theo S122) `[carry:hook-vs-budget-cap]`. diff --git a/docs/gotchas.md b/docs/gotchas.md index 5d80cf2..2981924 100644 --- a/docs/gotchas.md +++ b/docs/gotchas.md @@ -1348,6 +1348,8 @@ for h in resp.points: # ← .points không phải iterable trực tiếp **Bài học:** derived-invariant phải re-establish ở **MỌI mutation đổi tập-nguồn — kể cả DELETE + cascade-delete**, không chỉ write/select. **Enumeration writer trong spec KHÔNG đáng tin** — grep độc-lập MỌI `.Remove(` chạm entity chứa field-nguồn (S87/S88 cardinality class mở rộng lên tầng mutation-path: writer-miss ≡ read-site-miss). Chỉ **verify adversarial-refute** bắt (invest/review/implement đều sót vì cùng theo enumeration). Liên-quan #72/#73 (cardinality) + `feedback_cardinality_change_grep_consumers`. +**EXT S133 (instance 2 — indirect-assignment):** snapshot ngân-sách-at-DaDuyet (Mig 67) đặt hook ở finalize choke-point (`ApplyApprovedPriceOnFinalize` + helper `PeBudgetAccumulator` 4-site) NHƯNG 2 site gán `Phase` TRỰC TIẾP bypass hook: 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á, chỉ ở nhánh hiếm hơn). Reviewer adversarial bắt pre-commit; em-main + 3 invocation implement đều sót — cùng bài enumeration. Fix: site-5 chốt snapshot trong admin-override (comment `[S133 site 5]`) + seeder + test `AdminOverride`. **Meta-class chung với instance 1:** field-đích có hook/derive/snapshot ⇒ grep MỌI assignment-site của field đó (`= targetPhase`, `.Phase =`, seeder, override) chứ không chỉ mutation-API chính-tắc. + ### 82. Menu-flag permission grant ≠ quyền API thật — controller gate GET bằng `[Authorize]` trần (Session 118) **Triệu chứng:** S118 phân quyền role Procurement — grant menu `Suppliers` (R+C+U) tưởng "menu hiện = làm được mọi thứ". THỰC TẾ 2 chiều lệch: (1) `PUT/DELETE /suppliers` gate `[Authorize(Roles="Admin,CatalogManager")]` → PRO vẫn **403 khi Sửa/Xóa NCC** dù CanUpdate=1 (chỉ Publish/Import theo policy `Suppliers.Update` là ăn); nút Sửa hiện nhưng bấm lỗi. (2) Ngược lại `ReportsController` chỉ `[Authorize]` **trần (KHÔNG policy)** → menu bị S92 ẩn nhưng **MỌI user đăng nhập** vẫn gọi `GET /reports/dashboard` lấy tổng giá trị HĐ + top NCC/dự án theo giá trị (gõ URL/API trực tiếp, bỏ qua menu).