# ARCHIVE — STATUS/HANDOFF mega-line tails (re-tier S94, 2026-06-29)

> Session-cũ ≤S90 tách khỏi STATUS line-6 + HANDOFF line-5 mega-line (re-tier GẤP — fix Read-25K/call OOM + token-cost). Nội-dung gốc đầy-đủ trong docs/changelog/sessions/. File này = bản-sao verbatim phần blurb đã cắt (zero data-loss, no-retrofit audit-trail).

---
## STATUS — cắt từ `docs\STATUS.md` line 6 (từ **Prev S90** trở đi)

 · **Prev S92** (S92 — **Ẩn 5 nhóm menu (Hợp đồng + Danh mục + Nhân sự + Văn phòng số + Cá nhân) CHỈ Admin thấy trên eoffice — em-main-led verify+review+deploy, 1 commit prod-verified `1408d4e`, BE-only no-migration, HMW-mode ON**: anh `/session-start` thấy WIP S92 uncommitted (dated hôm nay) → AskUserQuestion chốt "verify + hoàn thiện + deploy". `RevokeTemporarilyHiddenModulesAsync` mở rộng predicate +Contracts/Ct_* +Master/Suppliers/Projects/Departments/Catalog* (cộng dồn S58 Hrm*/Off*/Personal) + TẮT 2 re-grant public (S65 HRM + S69 Office) → revoke = bước permission CUỐI trong SeedAdminPermissionsAsync (ungated, durable mỗi restart, gotcha #75) + thu hẹp InReviewScope→chỉ Pe_*. **PE giữ nguyên** cho user (Pe_* không match predicate; master-data GET any-auth → form PE vẫn chọn Dự án/NCC/Hạng mục dù menu Danh mục ẩn). +AdminOnlyModulesRevokeTests 3 (non-Admin revoked 4 cờ / Admin untouched / PE preserved). **Verify chain:** test 431→**434** (45D+389I, full-suite 0 fail) · seed-chain-order verified (revoke last + prod-durable) · predicate coverage verified (5 nhóm đủ; Forms/Reports/PurchaseEvaluations sibling top-level giữ-hiện đúng; no over-match) · **reviewer PASS** (5 attack vector A-E independ re-derive, 15/15 trên 3 class, 0 blocking). **FYI intended-by-spec, 0 live impact:** role CatalogManager (hiện **0 user** — S89 xóa hết test user) cũng bị thu Danh mục; re-enable cần carve-out predicate. **State THẬT: Mig 59 · 88 bảng · 434 test (45D+389I) · gotcha 76 · menu 54 · bundle admin `xz8FdmLN`/user `CA8Rla2w` (JS rotate #69, CSS frozen) · prod 17 user/7 NCC.** cicd **Run #358 PASS** prod-verified (sqlcmd: non-Admin 0 leak / Admin 5 giữ / Pe_* 120 untouched; ship-proof = dll-mtime + w3wp-recycle 08:04Z). **🔴 NEXT anh:** UAT eoffice login user non-admin → xác nhận KHÔNG còn thấy Hợp đồng/Danh mục/Nhân sự/VP số/Cá nhân (chỉ Duyệt NCC + Dashboard) · ⚠️ restart CLI (carry budget v3 + `/user-mark-*` + cadence). **NEXT em:** monthly audit 2026-07-01 (2 ngày) re-tier STATUS/HANDOFF mega-line + flush ef-core/Budget docs + vocab alias-map. → log `2026-06-29-S92-admin-only-modules.md`) · **Prev S91** (S91 — **buổi go-live LỚN em-main-led, 4 commit prod-verified + backup local** — go-live chính thức 26/06 anh Kiệt SOL-IT Phase-01 PRO+CCM. **#1 `159b69d`** guide Word bỏ "Từ chối" 2 chỗ + fix 12 caption Hinh→Hình [app gỡ Từ chối S60, guide đã phát công ty stale; unpack→XML→repack giữ 13 ảnh, verify python-docx]. **#2 `ba42c59`** wipe go-live `scripts/s91-wipe-golive.sql`: xóa 16 PE+16 PeWorkItemBudgets+94 notif+19 NCC demo, GIỮ 7 NCC thật+17 user+master, reset PeSeq→**A/001** [backup `SolutionErp_S91_pregolivewipe.bak` + 2 guard PE>16-abort/NCC≠19-rollback + AskUserQuestion scope]. **#3 `55494ad`** gate SeedDemoMasterData sau DemoSeed:Disabled — root-cause: seed ungated per-code resurrect 18 NCC demo mỗi restart → prod skip → verify demo_codes=0 qua 2 restart [gotcha #75]. **#4 `e81e87f`** user tự đổi mật khẩu: BE ChangePasswordCommand + POST /auth/change-password [Identity verify pass-cũ, fail-PasswordMismatch→field CurrentPassword] + FE 2-app ChangePasswordDialog/TopBar + 10 test; fix CS0104 ValidationException ambiguous [FluentValidation vs custom]. + **backup local** `backups/SolutionErp_golive_clean_2026-06-26.bak` 21MB + accounts.txt 17 tk [.gitignore +backups/+*.bak]. **State THẬT: Mig 59 · 88 bảng · 431 test [45D+386I, +10 ChangePassword] · gotcha 76 [+#75 seed-resurrect +#76 deploy-config-từ-.example] · menu 54 · bundle admin `DgQyuG7f`/user `BmbQon23` · prod 17 user/7 NCC/70 dự án/71 hạng mục/0 PE-HĐ.** **Lessons:** wipe-không-bền-nếu-không-gate-reseed [#75 root>symptom] · deploy render Production.json từ .example KHÔNG file-gitignored [#76] · em-main-led security-feature báo-trước + test-specialist + build/test gate thay fan-out [#53 cicd garbled-return→em-main self-verify-prod; test-specialist độc-lập bắt CÙNG CS0104] · Chrome-MCP screenshot kẹt SPA-SignalR document_idle [carry #74, guide-ảnh defer — anh "tự check"]. **🔴 NEXT anh:** ⚠️ restart CLI · review guide docx Word · đóng 2 tab eoffice em mở. **NEXT em:** curate test-specialist L1 OVER [carry] · monthly 2026-07-01 [re-tier mega-line + ef-core Mig→59 + Budget-removed docs/CLAUDE]. → log `2026-06-26-S91-golive-wipe-changepw-backup.md`) · **Prev S90** (S90 — **Chèn 12 ảnh khoanh-đỏ vào guide Word `docs/Huong-dan-Duyet-NCC.docx` (em tự chụp prod qua Chrome) + chẩn UltraViewer — em-main solo, 0 production code, HMW-mode ON**: anh `/session-start` → "mở chrome vào chụp ảnh dán vào luôn" (12 ô ảnh trống từ S89). Browser-driving = vòng-lặp thị-giác tuần-tự → **em-main solo** (KHÔNG fan-out Workflow, đúng decision-tree). **Pipeline tự-chế (gotcha #74 NEW):** MCP `save_to_disk` (Chrome MCP + computer-use) KHÔNG ra file truy-cập được env này → **PowerShell .NET `CopyFromScreen` + Win32 `EnumWindows`+lọc-process-`chrome.exe`+`SetForegroundWindow`** (lọc process vì app Claude-Code Electron cùng class+title "Solutions ERP" → khớp nhầm) chụp PNG 2560×1600 + **DOM overlay `window.__ccA`** khoanh-đỏ **element-based** (minLeft/maxLeft/exact/up/nth/**case-insensitive** — toạ-độ-cứng vỡ do viewport đổi 812↔833; label CSS-uppercase→case-insensitive) + crop 92/72 (banner CDP "Claude started debugging" s08/s12→146, verify montage dải-trên) + `python-docx add_picture(6.0")` fit-A4 (6.3" tràn vì A4 content=6.27") vào 12 table cell + caption "Hình N". 12 màn: login·menu+tạo·form-fields·NCC+báo-giá·NS+QT·checklist+gửi·inbox·detail+so-sánh·quyết-định·workflow-matrix+cờ-finalize·tạo-HĐ·cây-list. Verify **13 ảnh** (1 logo+12) + montage sạch-banner. **0 prod mutation** (xem-only, KHÔNG bấm Gửi/Duyệt/Trả-lại/Tạo-HĐ; `?mode=new` không tạo draft). anh tự login Admin. **Caveats guide (carry):** ① #9 app chỉ **Duyệt+Trả-lại** (gỡ "Từ chối" S60 → text guide stale, chờ anh OK sửa) · ② #10 workflow chưa bật finalize → chụp **cờ "Duyệt là KẾT THÚC quy trình"** thay badge sơ-đồ · ③ #11 KHÔNG bấm Tạo-HĐ (no created-contract shot) · ④ account=admin (sidebar nhiều menu admin). **UltraViewer (anh hỏi "sao bật"):** chẩn `UltraViewService` StartMode=**Auto**/LocalSystem standby, **0 kết-nối Established**, em KHÔNG mở (chỉ grant Chrome; computer-use screenshot **detect+mask** nó) → hướng-dẫn tắt self-serve (KHÔNG tự đổi system-setting, theo prohibited-rule). **State GIỮ NGUYÊN: Mig 59 · 88 bảng · 422 test · gotcha 74 (+#74) · menu 54 · bundle admin `DalcOhvb`/user `CdS4tX_2`.** docx committed closeout (docs-only CI-skip). **🔴 NEXT anh:** review docx trong Word + ⚠️ restart CLI (carry budget v3 + `/user-mark-*` + cadence) + (tùy) bật finalize 1 cấp → ảnh #10 badge / bấm tạo 1 HĐ thử → ảnh #11. **NEXT em:** sửa text "Từ chối"→"Duyệt/Trả lại" guide nếu anh OK · curate test-specialist L1 34.8KB OVER (carry S88). → log `2026-06-25-S90-guide-screenshots-insert.md`.) · **Prev S89** (S89 — **PE visibility/finalize batch + xóa 38 User test prod + Word guide, ~6 commit prod-verified, HMW-mode ON**: **D1 nháp riêng-tư** (`a71753b` Run #465, test 419→421) — IDOR fix nháp lộ qua cond#2 role (GetEligiblePhases Drafter/DeptManager→DangSoanThao) + **cond#3 V2-approver** (workflow pin lúc-TẠO → CEO approver thấy MỌI nháp = leak màn CEO) → 4 chỗ owner-only (GetEligiblePhases bỏ DangSoanThao · admin-inbox bỏ · list-cond3 guard · detail-authz guard) + PeDraftVisibilityTests · **D2 CCM giá-đề-xuất** (`f7bd97a`) gỡ `!readOnly` over-gate (gate thuần role mirror ô ngân-sách; BE setter fail-closed = chốt) · **D3 finalize-note 3-surface** (`f0bca77` test 421→422) BE +3 computed-field detail+list DTO **no-migration** + EF-subquery first-reachable + PeFinalizeChip 2-app (invest-WF `wf_341f7b29` + impl-WF `wf_3f57edb6`; **impl-FE return-rỗng #53** → em-main mirror fe-admin 4-file SHA + self-gate + PeFinalizeProjectionTests) + **flow badge "⚑ Duyệt thay CEO"** PeWorkflowPanel (`9c920ad`) + **matrix flag thứ-8** WorkflowMatrixViewPage thiếu allowApproverFinalize từ S87 (`fef4c33`) · **xóa User test** (`681b1ed`) recon prod (ssh sqlcmd) 55→giữ 17/xóa 38 (whitelist-keep + backup `SolutionErp_S89_preuserdelete.bak` + count-guard[30,45] + XACT_ABORT; KHÔNG approver-block FK; nv.test 1-PE) + gỡ seed SeedDemoUsers/Lock · **Word guide** `docs/Huong-dan-Duyet-NCC.docx` (skill docx, logo Solution, 8 phần, khoanh-đỏ 1→2→3, ảnh-chờ-chụp). **State THẬT: Mig 59 · 88 bảng · 422 test (45D+377I) · gotcha 73 · menu 54 · bundle admin `DalcOhvb`/user `CdS4tX_2` · prod 17 user thật.** **Lessons:** Designer-save = version-MỚI (phiếu pin version-cũ → finalize chỉ hiện phiếu-MỚI = "check rồi mà không thấy") · doc-drift thêm-flag-Designer-quên-surface-matrix-song-song · whitelist-keep + 3-lớp-guard prod-delete · WF-impl-FE-return-rỗng → em-main mirror + self-gate (≡ S65/S73). 🔴 NEXT em: curate test-specialist L1 34.8KB OVER + cicd 28KB + reviewer 27.7KB. NEXT anh: chèn 12 ảnh guide + restart CLI. → log `2026-06-25-S89-pe-visibility-finalize-userclean-guide.md`.) · **Prev S88** (S88 — **PE stability audit (frozen CEO-approved spec) → fix patchwork D1 + hoàn-thiện multi-winner D2, 2 deploy prod-verified, HMW-mode ON, audit-workflow + ~14 spawn**: anh giao review/invest/test lại Duyệt NCC, "chấp vá thì xử lý, tính năng đã ổn định". **Audit Workflow `wf_c15da996-be5`** (6 area × invest→review pipeline + full-suite test, 13 agent) → CORE SOLID (winnerQuoteTotal 3 site · SelectWinner clear · urgent fail-closed authz · drafter-exclusion notify · 2 finalize mechanism) + tách findings **safe vs behavior-affecting**. AskUserQuestion ×4 chốt max-scope: sửa-hết-safe + hoàn-thiện-joint-winner + bật-CEO-notify + create-contract = **1 HĐ/winner**. **D1 (`73cce1f` Run #347 PASS):** Block B financials re-key `SelectedSupplierId→IsWinner` (số "Giá trị kỳ này"=0 + peer-rollup bỏ-sót cho ≥2 winner) · **CEO-notify-on-urgent +SaveChanges** (notify chạy SAU SaveChanges duy-nhất → rớt âm-thầm, Director KHÔNG nhận; +6 `PeUrgentNotifyDirectorTests` real-notify-fixture) · **HoSoLink null-safe + clear-via-empty** (sửa header wipe link đã-set, bug-class S42/#73; null=preserve/""=clear; HoSoLinkRow gửi `""`) · #70 guard PRO budget row3/row8 · dời `SetPeCcmBudgetPeriod` PeSuggestedPrice→PeWorkItemBudgetFeatures · comment. Test 402→**413** (+11). **D2 (`1aa3bdb` Run success):** **create-contract 1→N** (Command→`List<Guid>`; **ContractCodeGenerator self-commit seq mỗi call → gen TẤT-CẢ mã TRƯỚC Add → build N local → atomic final SaveChanges** = no partial-create; GiaTri single=details-sum legacy/≥2=per-winner quote-total draft-editable anh-Kiệt-UAT; pe.ContractId=first idempotency; controller `{contractIds}`) · **list-card winner names** (DTO +`WinnerSupplierNames` EF collection-subquery **translate-OK SQLite** verified) · FE dialog contractIds[]+"Đã tạo N HĐ" · PeListPanel join names. Test 413→**419** (+6: multi-contract 5 + EF-translate smoke). **State THẬT: Mig 59 · 88 bảng · 419 test (45D+374I) · gotcha 73 · menu 54 · bundle admin `BQq2eTP6`/user `dHa64I59`.** **Cách chạy:** em-main-led BE core (financial/coupled/design-heavy = create-contract multi + financials) + delegate impl-backend (relocate) ∥ impl-frontend (FE 2-app SHA-mirror) ∥ test-specialist (test-before bug + test-after feature) + reviewer adversarial **PASS** (codegen-sequencing + arg-order + no-partial-create verified) + cicd-monitor. **#53 truncation ×3** (test-specialist/reviewer/cicd-monitor return rớt ở MEMORY-over-budget step → em-main recover-disk + self-gate + **curl-self-verify deploy** thay cicd-verdict). **Lessons:** ContractCodeGenerator self-commit-seq → multi-entity create = gen-all-codes-TRƯỚC-Add → atomic SaveChanges (no partial) [[feedback_multi_entity_create_self_committing_codegen]] · cardinality single→multi grep MỌI consumer (audit bắt 2 BE financial read-site sót S87 FE-only sweep) [[feedback_cardinality_change_grep_consumers]]. **🔴 NEXT (em): curate test-specialist L1 34.8KB OVER-SOFT GẤP** (root #53 ×3; reviewer 27.1KB+FD 26.1KB WATCH). **NEXT UAT (anh Kiệt Ctrl+F5):** ① ≥2-winner Block B "Giá trị kỳ này" đúng số · ② GẤP→Director nhận chuông · ③ Link hồ sơ giữ khi sửa header · ④ ≥2-winner "Tạo HĐ" → N HĐ draft (xác nhận GiaTri per-winner=giá NCC chào). → log `2026-06-25-S88-pe-stability-audit-d1-d2.md`.) · **Prev S87** (S87 — **2 buổi PE feature LỚN prod-verified, HMW-mode ON, ~14 spawn (nhiều #53 truncate → recover-disk + reviewer cross-verify + em-main self-gate)**: **(1) CCM 3-fix Mig 58** (`f1b10e9` **Run #344 PASS** ~5m11s) — anh forward PDF "CCM 4 ý cần sửa PM" (BỎ mục 3 theo anh): **①multi-winner** chọn NHIỀU NTP/NCC/ĐVDV cùng trúng → `winnerQuoteTotal=SUM PurchaseEvaluationSupplier.IsWinner` (cột mới, backfill từ SelectedSupplierId 13/13; SelectWinner→multi-toggle `SupplierIds[]`; FE bảng so sánh tick-nhiều-ô + "Tổng chi phí đã chọn"); **②budget=0 hợp lệ** (submit-guard nới `is null` only KHÔNG `<=0`, +3 validator GTE0; fallback ProInitial chỉ-khi-null bảo-vệ 0-cố-ý); **④cấp KẾT THÚC quy trình** `ApprovalWorkflowLevel.AllowApproverFinalize` — admin bật per-cấp Designer, duyệt tới đó TỰ DaDuyet bỏ CEO (**opt-in→AUTO** theo anh "cho bật trong quy trình hay hơn" → gỡ runtime-flag, nhánh `if (matchingLevel.AllowApproverFinalize)`). **Self-review bắt 8 chỗ FE keyed `selectedSupplierId`** (null khi liên-danh ≥2 → vỡ submit-guard/checklist/computeGiaChaoThau/tạo-HĐ) → đổi `isWinner` (cardinality single→multi = grep MỌI consumer). Test 377→**395** (+20−2 rework auto). Bundle admin `aKuNip19`→**`CXCKlNay`**/user `BUsL0HeQ`→**`Di40ewrF`**. **(2) Section B 3-cột Mig 59** (`9b1ee0c` **Run #345** cicd-verifying) — anh AskUserQuestion chốt "mỗi cột nhập kỳ-này RIÊNG" → `PurchaseEvaluation.CcmBudgetPeriodAmount` + endpoint `PATCH /budget/ccm-period` role-gate Admin|CCM fail-closed; FE Section B (THỰC HIỆN) rewrite `<BudgetRow>` list → `<table>` 3 cột (Dự án—|PRO budgetPeriodAmount/proFull|CCM ccmBudgetPeriodAmount/ccmFull, `colCalc()` per-cột) qua **Workflow `wf_aafb18fe-d9d`** (BE→FE→test + 3-lane review: math PASS · authz PASS · mirror+FE return NULL → em-main self-gate mirror byte-identical + 402-test + 2-build verify). Test 395→**402** (+7 authz setter). **State THẬT: Mig 59 · 88 bảng (cicd flag 89 — drift cũ KHÔNG do Mig 58/59 AddColumn-only, re-ground monthly) · 402 test (45D+357I) · gotcha 73 · menu 54 · bundle admin `BABhPh2s`/user `DLulO6uP` (Run #346 — `0d3c0cf` tách khối nổi bật "4. Thông tin chọn thầu" FE-only PASS; #345 Section B = `C8lWxEQK`/`Kz5cSW2u`; #344 CCM-3fix = `CXCKlNay`/`Di40ewrF`).** **Lessons:** cardinality single→multi = grep MỌI read-consumer (impl sửa write-site sót dependent — `feedback_cardinality_change_grep_consumers`) · design-dialog (item4 auto-config qua workflow-config, Section B AskUserQuestion) tránh rework · workflow review-lane value dù 2 lane NULL (lane-return verify disk độc-lập → trust PASS dù impl return NULL). ⚠️ CCM setter command rơi `PeSuggestedPriceFeatures.cs` (lệch chỗ, dọn monthly). → log `2026-06-24-S87-pe-multiwinner-budget-finalize-sectionb.md`.) · **Prev S86** (`ae4f106` Run #343) — PE notify "cần duyệt" loại NGƯỜI TẠO phiếu (drafter không nhận chuông phiếu mình tạo dù là approver 1 cấp; +3 `PeApproverNotifyExcludesDrafterTests`; re-ground STATUS test 356→377/gotcha 71→73 sót-S85-closeout). · **Prev S85** — **buổi UAT anh Kiệt FDC CỰC LỚN: CV PRO 6-fix batch + clear-data + 6 vòng UAT + 2 ROOT-CAUSE + 5 SQL-fix — ~10 deploy prod-verified #334→#341, HMW-mode ON, ~12 spawn** — anh forward Zalo anh Kiệt + Tra Sol + long.chau realtime. **Batch CV PRO (Run #334 `5a61254`):** đọc file `Cần chỉnh sửa CV PRO.xlsx` = **8 ảnh chú-thích nhúng** (không phải bảng công thức) → 6 fix: C1 ẩn "c.Giá chào thầu"+"d.Bảng so sánh" form TẠO · C3 ô8 pre-fill từ row7 (Ngân sách còn lại) · C4a **live-recompute** ô3/8 chưa-Lưu (VndInlineEdit +onLiveChange, draftRow3/8) · C4b So-sánh=0→"Bằng ngân sách"/"—" · C5 hủy/đổi NCC winner (BE `SelectWinnerBody(Guid?)` clear-branch + FE dropdown/toggle) · C7 nút "Toàn màn hình" preview file. **Clear-data (`scripts/s85-wipe-uat-data.sql`, BACKUP-trước):** wipe 43 PE + 28 PeWorkItemBudgets + 1 HĐ + 32 notif + 21 NCC-test (CreatedAt≥06-11, giữ 22 gốc) + reset mã→A/001; AskUserQuestion chốt scope (xóa budgets + NCC-test); SET QUOTED_IDENTIFIER ON (filtered-index). **6 vòng UAT (#335→#338):** R1 D1 ẩn mục 3/4/5 + D5 auto-chọn quy trình (1 option) · R2 D2 drafter tự-gỡ cờ GẤP (nới S77 GỠ=TP→+drafter clear-cả-2, BE restructure SET/UNSET) + D3 ngân-sách-kỳ-này tự-nhảy từ "Ban hành lần đầu" (`proInitialAmount`, FE display + BE/FE submit-guard fallback `budgetPeriodAmount ?? proInitialAmount`) · R3 ràng tạo-phiếu (hint đỏ "thiếu gì") + D4 checklist xanh✓/đỏ✗ trường bắt-buộc · R4 checklist +"Quy trình duyệt". **2 ROOT-CAUSE (whack-a-mole→fix gốc):** **(R5 #339 `1263c0d`)** workflow MẤT khi bấm Sửa = **bug-class S42** — `UpdatePeDraftHandler` absolute-set `ApprovalWorkflowId=null` khi form Sửa KHÔNG gửi field → CLEAR (field SÓT khỏi pattern null-safe mà BudgetPeriodAmount/WorkItemId cạnh đã có) → fix `if (request.X is not null)` (gotcha **#73** NEW, +3 regression test) · **(R6 #341 `49ac086`)** "mới tạo báo 7h trước" = **TZ** — timestamps lưu UTC nhưng EF đọc `DateTimeKind.Unspecified` → System.Text.Json default serialize KHÔNG có 'Z' → FE `new Date(naive)`=local → lệch +7h (VN UTC+7) → **`UtcDateTimeJsonConverter`** global (AddControllers.AddJsonOptions) ép UTC-with-Z (gotcha **#72** NEW) — cicd verify API trả `createdAt:"…3154440Z"`. **5 SQL-fix** (2 đợt 3+2 phiếu workflow-less, gán QT-DN-V2-001 type-1, ssh prod). **Cách chạy:** em-main-led + impl-backend (C5 BE clear) + impl-frontend mirror + test-specialist ×3 (C5 +10 · urgent-authz +5 · workflow-preserve +3) + reviewer ×2 (truncated→em-main self-gate, memory-lesson) + cicd-monitor ×7 (7/7 PASS; ship-proof BE-only = `Application.dll`/`Api.dll` Last-Modified in-window, #69-REFINE). **Test 356→374** (+18). **State THẬT: Mig 57 · 88 bảng · 374 test · gotcha 73 · menu 54 · bundle admin `aKuNip19`/user `BUsL0HeQ` (Run #341, FE frozen #339+#341 BE-only).** **Lesson `feedback_root_cause_over_symptom`:** bug lặp-lại (SQL/tzutil band-aid không dứt) → truy field/case **LỆCH-quy-ước** rồi đưa vào pattern đã-đúng = fix 1 chỗ hết tái-diễn. → log `2026-06-23-S85-pe-uat-cvpro-rootcause-tz.md`.) · **Prev S84** — **bootstrap + flush session-start hot-feed cap-echo v3 + commit S83 cicd harvest-orphan (em-main hygiene, 0 production code)** — anh `/session-start` → 2 monitor INFORM: H1 bắt `session-start.md:114` còn cap CŨ `lead 60K/sub 20K/wf 16K` ≠ canonical budget v3 `220K/60K/50K` (S82 self-shrink chưa flush khi S83 owner-set lại); H2 bắt `cicd-monitor/MEMORY.md` = harvest S83 hợp-lệ (Run #333 + gotcha **#69-REFINE**: hash giữ-nguyên khi 0 `fe-*/src` đổi → ship-proof THẬT = `Last-Modified` in-window, KHÔNG hash-delta) sót khỏi closeout `f71654f`. Anh "Sao ko add luôn?" → em flush `session-start.md:114` echo cap → **220K/60K/50K + canonical-pointer "đọc số sống ở budget.json"** chống tái-drift (detector C2 KHÔNG track cap-number → echo-trần lệch âm-thầm lần đổi cap sau) + commit cicd harvest-orphan. **Lesson (`feedback_derived_flush_execution`):** monitor INFORM-only proposal về **derived→canonical flush** = em-main **EXECUTION** (B3 VERIFY→APPEND = verify-rồi-LÀM), KHÔNG gate user-confirm; chỉ **ĐỔI-con-số** mới = quyền anh (chủ-dự-án). archive-gate A7 GATE PASS 217/217 · 2 WATCH strike-1 (FD/test-spec, no-action). **State GIỮ NGUYÊN: Mig 57 · 88 bảng · 356 test · gotcha 71 · bundle `CsJetgZH`/`BVS0ApIm`.** ⚠️ restart CLI (command `.md` no hot-reload — runtime %-print mới ăn cap đúng). → log `2026-06-22-S84-session-start-cap-flush.md`.) · **Prev S83** — **(1) adopt H-15 v3 memory-budget full-parity (anh owner-directive) + (2) fix PE require-workflow create+submit (đóng lỗ hổng "quy trình cũ") prod-verified Run #333** — anh `/session-start` → directive budget Tầng-1 **220K**/mem-sub **60K**/wf-sub **50K** "nạp đầy cho đủ" → diagnose phiếu A/040 "quy trình cũ" → "(B) vá guard BE + test-before → deploy" → `/session-end`. **Part 1 H-15 v3 (commit `2c7fd63` docs-only CI-skip):** `token_governor` lead 200K→**220K**/mem-sub 20K→**60K**/wf-sub 16K→**50K** full AI_INFRA parity (sửa self-shrink S82 = AI tự-co-nhỏ, mark `RC-…01-58-01` cấm) + NEW `spawn_fill_directive` (nạp sub tới budget bằng prompt GIÀU — byte-cap MEMORY.md = 1 lát, prompt nạp phần còn lại; retire `≤8K-brief`) + engine **§G.5** + ACTIVE-MARKS H-15 **v3-delta** `RC-pqhuy1987-22-06-2026-16-35-37` (anh-directed, report-before-stamp). **Part 2 PE fix (commit `fc1f19d`, cicd Run #333 PASS ~4m59s):** validator `NotEmpty(ApprovalWorkflowId)` + submit-guard (SAU Section-3, TRƯỚC mutate phase) → phiếu null-workflow KHÔNG gửi-duyệt được (trước: kẹt nhánh V1-legacy = banner "quy trình cũ", không Bước/Cấp, "Lịch sử duyệt 0"). **Diagnose:** banner ⟺ `approvalFlow` rỗng ⟺ `ApprovalWorkflowId` null; A/040 **tự-khỏi-khi-reload ⟹ cache** (data-hỏng reload không khỏi — em KHÔNG đụng prod). **test-before RED→GREEN**, full-suite bắt **9 đỏ** → triage: 2 genuine-spec-conflict (V1-submit deprecated, data wipe S59) rewrite + 6 collateral giữ (dời guard sau Section-3) + 1 validator fix. **Test 354→356** (+2 validator). **#69-REFINE (cicd):** bundle KHÔNG rotate vì 0 fe-src change (Vite deterministic) — ship-signal THẬT = Last-Modified in-window KHÔNG hash-delta; bundle GIỮ admin `CsJetgZH`/user `BVS0ApIm` Run #333. State THẬT: **Mig 57 · 88 bảng · 356 test · gotcha 71 · bundle `CsJetgZH`/`BVS0ApIm`**. ⚠️ restart CLI activate budget v3 runtime. → log `2026-06-22-S83-h15v3-pe-require-workflow.md`.) · **Prev S82** — **adopt Harness-15-v2 (Tầng-1 hot-feed-lớn + L2/L3 bỏ-trần + %-print 2-đầu-phiên + ranh-giới vai-trò), 0 production code** — `/check-email AI_INFRA` (1 thư mới H15-v2-notify verify ✓✓ whole-file+body) + `/adap-apply all` (fan-out 29 broadcast vs 22 report → CHỈ H15-v2 MỚI; 7 còn lại verify = đã-phủ S72/S75/S79). em-main IMPLEMENT single-writer D9 (6 edit: `token_governor` L1 12K→per-role **lead 60K/sub 20K/wf 16K** · L2/L3 6K/4K→**NO-CAP** · engine §G.4 · session-start §2.1.6 + session-end §L.b(c) %-print · mark H-15 What-cell refine) + **REVIEW Workflow `wf_04667b25-5fa` 3-lane 3/3 PASS** (bắt 3 MINOR → fixed: volume "~42K" stale · mark pending-confirm flag · _index STAGE-2). **Ranh-giới vai-trò:** con-số = quyền CHỦ-DỰ-ÁN/anh, AI thực-thi + báo-% — sửa framing S81 "lead-authority" gộp nhầm AI-lead↔owner. mark H-15 **v2-delta anh-confirm** `RC-pqhuy1987-21-06-2026-01-58-01` (report-before-stamp). commit `aa3f0fe` push (docs-only CI-skip) + email AI_INFRA `a749bb6bd1be`. **State THẬT GIỮ NGUYÊN: Mig 57 · 88 bảng · 354 test · gotcha 71 · bundle `CsJetgZH`/`BVS0ApIm`.** ⚠️ restart CLI (session-start §2.1.6 + session-end §L.b(c) %-print runtime). → log `2026-06-21-S82-harness-15-v2-adopt.md`.) · **Prev S81** — **adopt Harness-15 memory-budget per-agent (token-governor + value-gate + work-state block)** — em main single-writer + 1 REVIEW Workflow (`wf_b7f3c8ac-b53` 3-lane: Part-A PASS · Part-B PASS · Honesty HONEST), **0 production code**. `/check-email AI_INFRA` STAGE 1 = **0 new directed** (outbox/se 4 file processed S79); fan-out diff → CHỈ **H15** unapplied (H14/v2.0/checklist-9-10/11 đã phủ S72/S75/S79). **8/8 🔴 floor:** A1 đo-SÀN persona-direct `Get-ChildItem` 4.3-13.3KB + harness-injected SE-ước-riêng 21K→**30K cap-riêng-SE** · A2 `token_governor` L1 12K/L2 6K/L3 4K (lead hard-cap) · A3 tách-nhà · B(a) nạp-đầy-no-token-saving · B(b) **value-gate** `value_protect` 10-pattern + gate-script FLAG **runtime-fired** (test-specialist gotcha#/guard) ⟂ keep-floor recency = mark `RC-…11` áp tầng-bộ-nhớ · B(c) **work-state block** `session-start §2.1.5` · B(d) 3-tệp-chốt verified (`hmw.js:124` MEMORY-PACK) · B(e) **2-governor** byte⟂token. **5/6 sàn = convention, chỉ (e)+đo-SÀN = mechanized (honest no-overclaim).** Review bắt **2 CONCERN** (anchoring + tool-attribution) → **fixed** (review→fix loop) + refresh stale `measured` block S71→S81. Artifacts: `memory-budget.json` + engine `§G` + `session-start §2.1.5` + `rules §6.6` + gate-FLAG + adap-report `2026-06-20-Governance-harness-15-memory-budget.md`. A7 217/217 · detector 26-flag baseline (0 new). ⚠️ **restart CLI** (session-start §2.1.5). **✅ mark H-15 stamped Active-High** (`RC-…23-07-37`, anh-confirm S81). **State GIỮ NGUYÊN: Mig 57 · 88 bảng · 354 test · gotcha 71 · bundle `CsJetgZH`/`BVS0ApIm`.** → log `2026-06-20-S81-harness-15-adopt.md`. · **Prev S80** — **curate L1 over-cap reviewer/inv-codebase/cicd → L2 archive** — em-main single-writer, archive-gate keep-floor-hit→manual condense-with-archive: 31 entries byte-exact (`sed`) +N−0 → `archive/2026-06.md` + 31 `_INDEX` substring pointer → **A7 GATE PASS 217/217**; stale foundation counts flushed (130/263→354 · 55→71 · Mig 40/55→57 · 84→88 · bundle→#330). **0 production code, state GIỮ NGUYÊN: Mig 57 · 88 bảng · 354 test · gotcha 71 · bundle `CsJetgZH`/`BVS0ApIm`.** WATCH (A6 strike-1): frontend-designer 26KB + test-specialist 28KB. Lesson: `_INDEX` substring **quote-free** (A7 quote-parser bắt escaped-quote PURO pointer self-grep miss). 9 agent-memory file, docs-only commit (CI skip). → log `2026-06-20-S80-curate-l1-overcap.md`. · **Prev S79** — **adopt User-Mark (H-12/13) canonical §P + Harness-14 (Eval/Budget/Outcome) + chữ-ký RC** — em main + 4 Workflow (invest `wf_82337f7f-95c` → review `wf_a7cbe93e-912` → align-re-review `wf_9d3beebb-a95` → H14-review `wf_4d4eba6f-8a0`), **0 production code**. Anh gõ `/user-mark-active-high` "áp đầy-đủ chính-xác nhất theo AI_INFRA" → áp **canonical §P đầy-đủ** (P1-P10): 4 lệnh `/user-mark-*` + ledger `.claude/governance/ACTIVE-MARKS.md` (Active-High/Active/Medium/Disable) + `harness-11-engine.md §E`+**§F** + `rules.md §6.6` objective-criteria. **3 mark Active-High stamped** anh-confirm (`RC-pqhuy1987-20-06-2026-10-29-09/10/11`). completeness-gate H-6→H-13 **ĐẠT** (H-8 11/11 inherit no-`[1m]`). §F floor 6/6 + maturity HONEST. 3 adap-report + email ai_infra (`7b8615b3`). Bài học: broadcast cô-đọng→canonical-command/§P là spec THẬT (bản đầu MUST/TRACK→align lại) · report-before-stamp dogfood · investigator residual-diary OK. State GIỮ NGUYÊN Mig 57·88 bảng·354 test·gotcha 71·bundle `CsJetgZH`/`BVS0ApIm`. ⚠️ restart CLI. → log `2026-06-20-S79-user-mark-harness-14-adopt.md`). · **Prev S78** — **PE: đính kèm file khi DUYỆT (UAT Tra Sol / 5 tester)** — người duyệt tải file của mình lên ngay lúc Duyệt thay vì Trả lại phiếu (tình huống thay đổi nhỏ). Reuse hệ attachment + enum `ApprovalAttachment=5` **MIGRATION-FREE** (int-stored, 0 schema change); endpoint `POST {id}/attachments` + authz có sẵn (handler không guard drafter-only → approver upload được). FE 2 app SHA-identical: `PeWorkflowPanel` picker multi-file + upload-TRƯỚC-chuyển-phase (file lỗi=không duyệt) + mục "📎 File đính kèm khi duyệt" (download/preview) + 2 filter fix loại purpose=5 khỏi "Bảng so sánh" (gotcha **#71** proxy-predicate pollution). commit `7886fd0` → **Run #330 PASS** ~4m56s (test gate **354**, bundle admin **`CsJetgZH`**/user **`BVS0ApIm`**, NO migration, smoke 4×200 + attachments 401-wired). **3 lỗi em tự bắt review-trước-deploy** (authz-verify handler · filter-pollution #71 · Dialog mirror-truncate fe-admin). em-main-led + self-gate (grep no-leak thay reviewer over-cap) + cicd-monitor verify. → log `2026-06-19-S78-pe-attach-file-on-approve.md`. · **Prev S77** — **buổi sản phẩm RẤT LỚN: 10 deploy prod-verified #320→#329 (anh Kiệt FDC + Tra Sol + Bích Phượng UAT realtime, HMW-mode ON)** — bundle cuối admin **`BqKD3Y23`** / user **`Cn-i349D`** (Run #329). **Mig 56→57** `AddPeSuggestedPriceNotes` · test 344→**354** (+10) · gotcha **70** (tái dùng #70). 10 việc PE: (1) cờ GẤP **pill** 🔴PRO/🟢CCM đồng bộ MỌI danh sách + inbox (#320, NEW `PeUrgentChips` ×2 app); (2) **focus mode** bấm phiếu→overlay (#321) → **revert** list về layout gốc bám-trái lấp-đầy (#322); (3) **Mig 57** ô ghi chú giá đề xuất PRO/CCM (2 cột nvarchar(1000)) + **số phân cách VND** (`VndInlineEdit`/`BudgetCell`) + sửa chính tả "Bảng so sánh giá" + **guard #70** stale-echo (#323); (4) số âm → **đỏ + ngoặc** `(…)` hàng 7/8/9 (#324); (5) mục con **thụt dòng + gạch đầu dòng** phân biệt có-số/không-số (#325); (6) cờ gấp authz **BẤT ĐỐI XỨNG** GẮN=NV chức năng / GỠ=chỉ Trưởng phòng (DeptManager) (#326, asymmetric handler + button-by-state); (7) **tách chọn-phiếu (inline 3-panel) khỏi mở-rộng (overlay)** + nút "Xem mở rộng" mỗi dòng (`?expand=1`) (#327); (8) **chuông báo người duyệt** khi phiếu vào cấp họ — submit + mỗi approve-advance (#328, `LogTransitionAsync` notify current-level approvers); (9) banner phiếu **Trả lại** hướng dẫn gửi lại (#329). **3 lỗi em tự bắt khi review TRƯỚC deploy** (guard #70 stale-echo cho ô ghi chú · luật cờ-gấp bất-đối-xứng Tra Sol clarify giữa-chừng · double-mount PeDetailTabs Task H — intent-comment có nhưng code sót). Cách chạy: em-main + frontend-designer ×3 (focus/revert/decouple, FD2 stub-verify do backend-down #3) + implementer-frontend (pill/notes/sep/spelling) + implementer-backend ×2 (Mig 57 · approver-notify) + test-specialist ×3 (notes +7 · urgent symmetric→asymmetric REDO do clarify-after-dispatch) + cicd-monitor ×10 (10/10 PASS). **frontend-designer process-death giữa Task H → recover-disk** (edit hoàn-chỉnh trên disk, em-main build-verify + mirror). **🔴 NEXT (em): curate L1 over-cap GẤP** — reviewer **45KB** + cicd-monitor 37.6KB + inv-codebase 35.6KB (keep-floor-hit → manual SPLIT/condense; archive-gate A7 GATE PASS 186/186 integrity OK) + FD 26KB/test-spec 27.7KB WATCH strike-1. → log `2026-06-19-S77-pe-ux-batch-10-deploy.md`. · **Prev S76** — **PE ngân sách MA TRẬN 3 cột (Dự án|PRO|CCM) + bảng lưới `<table>` viền-ô + badge quyền-NS theo role** — anh Kiệt FDC + chị Trà Sol, go-live; anh giao `/ultra-on` "step-by-step + workflow-review-per-step, hoàn chỉnh rồi deploy". **3 commit prod-verified:** `e33481e` (feature Run #318 — Mig 56 + ma-trận-3-cột + badge designer/flow, `BhFDF9IJ`/`BAkuRl3C`) → `21d1f4e` (bảng lưới `<table>` theo phản hồi anh, Run #319 **`jOqxW4-p`**/**`DbsznVvR`**, smoke 3×200). **Part 1:** PRO sửa cột PRO (canEditPro), CCM sửa cột CCM (canEditCcm), Dự án FE hiển-thị-only; Mig 56 +ProInitial/ProAdjust additive + data-migrate ProEstimate→ProInitial (4 rows prod). **Part 2+3:** badge "✎ NS PRO/CCM" cạnh approver (suy từ role, display-only no-authz) ở Workflow Designer + flow Duyệt NCC. Test 339→**344** (+5). **2 workflow review** (Part 1 PASS + Part 2/3 PASS) — reviewer bắt **race mất-dữ-liệu** Part 1 (impl self-review sót) → vá `useIsFetching` 2 app, **gotcha #70 NEW**. Lessons: flex+gap KHÔNG ra "bảng" → phải `<table>` viền-ô · workflow-review-flaky (2-3 lane empty #53) → em-main self-gate lane rỗng. **NEXT:** 🔴 curate L1 over-cap (reviewer **45KB** + inv-codebase 35KB keep-floor-hit manual-condense; cicd 29KB + test-spec 28KB strike-1). → log `2026-06-19-S76-pe-budget-matrix-table-grid.md`. · **Prev S75 (2026-06-18)** — **Harness-11 adopt: engine bộ-nhớ-và-governance TỰ-BẢO-TRÌ + 2 double-check** — anh giao `/check-email AI_INFRA` + `/adap-apply` (mỗi stage workflow-review) + double-check ×2 + finalize report + push + session-end. em main + **5 Workflow** (audit `wf_7fdc3bd5-930` → implement `wf_c5e5844e-7c1` → review `wf_d7ca1ff8-942` → double-check `wf_a0b68d2f-30e` → checklist-verify `wf_39cd4cbe-f07`). **0 production code.** Built `scripts/governance-detectors.ps1` (C1 broken-pointer + C2/B3 staleness + C3 vocab-fork + C4 self-exclusion + C5 resolve, NO-API DÒ+FLAG, runtime **26 flag** bắt drift thật, C4 0-self-match) + `scripts/memory-archive-gate.ps1` (PHẦN A hysteresis 0.85/keep-floor 5/2-strike/A7 NO-API 186/186) + `docs/governance/harness-11-engine.md` canonical (3-tier D5/D6/D7 EXPLICIT + one-direction-lock D8) + **B1 ×11 count→pointer `docs/STATUS.md`** (drift mig53→55/test306→339/gotcha68→69/table93→88 RESOLVED) + cadence-wire session-start §2.1.3 (D1) + session-end §L.b(c) (D2) + agents/README Upgrade S75. **completeness-gate FORMAL ĐẠT** (B 4/4 + C 5/5 + D 11/11 đủ-trọn, A 🟡 tailored — A6 runtime cần 2×-Apply legit-by-design). **gotcha #30 reinforced** (box-glyph ├└─ KHÔNG vào .ps1 — PS5.1 -File ANSI mojibake, KỂ CẢ qua Edit render-normalize; detector pure-ASCII verified). 3 commit `e70c046`+`ae957c4`+`aa09e99` pushed + adap-report + email ai_infra (`2316773229f2`). **State THẬT GIỮ NGUYÊN: Mig 55 · 88 bảng · 339 test · gotcha 69 · menu 54 · bundle `BYF5vIMJ`/`CB-tiRxd`.** ⚠️ restart CLI (cadence §2.1.3/§L.b + ef-core skill). 🔴 curate-debt: reviewer 38.8KB + inv-codebase 31.5KB + cicd 26.8KB over-cap (archive-gate confirm; reviewer+inv keep-floor hit → manual split). → log `2026-06-18-S75-harness-11-adopt.md`. **Prev S74** — **PE ô "Ghi chú từ CCM" ngân sách gói thầu (Mig 55)** — anh forward 2 luồng Zalo (Trà Sol + Kiệt FDC) "CCM cũng giống PRO cho nhập + ghi chú, hiện 0 hết" → em-main BE+Mig55 ∥ implementer-frontend FE 2 app SHA-mirror ∥ test-specialist (chết rate-limit → recover-disk). 2 fork anh chốt qua AskUserQuestion: **thêm CcmNote (Mig 55)** + **GIỮ phân vai CCM** (CostControl/Admin). Entity `PeWorkItemBudget +CcmNote` mirror ProNote · `UpdatePeBudgetCcmCommand +CcmNote` absolute-set role-gate fail-closed · DTO+controller+mapping · FE dòng "Ghi chú từ CCM" gate `canEditCcm` (sau V0/hiệu chỉnh, absolute-set đủ 3 field). Mig 55 additive-nullable sạch (no #63). Test 334→**339** (+5 CcmNote). **Chẩn đoán "0 hết không nhập":** tài khoản thiếu role CostControl (KHÔNG bug) → UAT bằng CCM/Admin. commit `8655ebf` push main (cicd **Run #315 PASS** ~4m54s — Mig 55 applied prod, bundle admin `BYF5vIMJ`/user `CB-tiRxd`, smoke 4×200). Lessons: controller call-site thiếu arg sau +param record (grep+vá, #65 bắt) · agent-kill-529 recover-disk no-re-spawn · PS here-string commit-msg trong if-block mis-parse → `git commit -F`. → session log `2026-06-18-S74-pe-ccm-note.md`. **Prev S73** — **Mig 54 PE giá đề xuất PRO/CCM + CEO chọn giá chốt + CCM duyệt-done ô-tích (anh Kiệt FDC — go-live so-sánh-giá thứ Hai 22/06)** — em main + 6 sub + 2 review-workflow. **2 commit prod-verified:** `1d86abc` (feature, cicd Run #313 PASS — Mig 54 + bundle admin `OlNyG9OD`/user `DSzSLVtL`) + `6aa4dcb` (FE empty-candidates guard fix). **BE:** Mig 54 `AddPeSuggestedAndApprovedPrice` 5 cột additive-nullable (ProSuggestedMin/Max·CcmSuggested·ApprovedPriceAmount·Source) + 2 setter role-gate PRO/CCM (Forbidden fail-closed mirror budget) + ApproveV2 **③ AUTO→OPT-IN** (`finalizeByCcmDelegation` ô-tích, gỡ auto-threshold S69) + **① bind giá chốt** mọi nhánh DaDuyet (human bắt-buộc-chọn, isSystem-miễn) + DTO +7 field/capability. **FE 2 app SHA-mirror:** PeWorkflowPanel (bộ chọn giá + ô tích CCM + fix empty-candidates) + PeDetailTabs `SuggestedPriceRows` + types +7. **Test 306→334** (+28). **2 workflow review (bài học):** R1 schema-force CHỈ **1/4** lane returned (flaky no-StructuredOutput) → R2 **free-text 2/3 PASS** — rủi ro #1 FE empty-candidates = **UNREACHABLE** (submit-guard `:194` chặn gửi-duyệt khi winnerQuoteTotal≤0). → review fan-out dùng **free-text / hmw RUN-TRACE**, KHÔNG ép-schema inline. **Governance honest:** em lệch mandate auto-Workflow (mode-ON) + chỉ khai khi anh hỏi → **cam kết báo-TRƯỚC-khi-lệch**. Run-trace `runs/2026-06-18-mig54-pe-review/` (custom-inline, bù post-hoc). → session log `2026-06-18-S73-pe-gia-de-xuat-ccm-done.md` pending. · **Prev S72** — **Harness-10 flat-refine + checklist-v2 adopt (re-audit 3-workflow) + sleep NO-OP** — em main + 9 sub qua 3 Workflow (audit `wf_13868efb-ea7` → implement `wf_ac43b5ff-7d1` → review `wf_d482e10d-5dd`, mandate Harness-9 B1+B2). Anh chỉ "sisters làm tốt mỗi SE thiếu" → re-audit đo vs canonical: **SE BEHIND Harness-10 flat** (run-trace còn SUBFOLDER, canonical=FLAT) → migrate `hmw.js` (`:103` sub-md/→flat + `:52` schema + **H4.5→H8 doc-drift**) + `workflows/README` full-rewrite + `runs/README` + session-start/end + `agents/README` Upgrade S72 + `_ledger`; **5 run cũ S71 GIỮ subfolder** (C8 dual-accept). +2 broadcast 06-18 adopt (checklist-v2 + h10-flat-detector-refine). +`/sleep-recovery-memory-l2` port (A8, §J2-tailored SE-only, floor intact, live skill). **detector refine-b TAILORED-OUT** (SE Workflow-tool no-CLI-bypass; containment git-diff+tracked+orphan-scan G-015). **REVIEW (B2 dogfood) bắt 2 lỗi IMPLEMENT-self-assess sót** (hmw.js:52 schema-stale + sleep-cmd auto-check un-wired overclaim) → fixed (auto-check **WIRED thật**: budget.json `+last_sleep_at` + session-start:78 + session-end:48, grep-verified). em-main containment-check tự bắt 1 reviewer residual-write (raw-Workflow KHÔNG hmw.js writeGuard → reverse-finding #4) → revert. **B3 self-correct:** S71 report path tắt `runs/`+"14" → thật `.claude/workflows/runs`=22. **Sleep `all`=NO-OP** (5/9 empty-archive + 4/9 đã-gisted → 0 compressed; `last_sleep_at`=2026-06-18). **0 production code, state THẬT GIỮ NGUYÊN.** adap-report `2026-06-18-Governance-harness-10-flat-refine-checklist-v2` + email ai_infra (`5f511fe5c0f2`). ⚠️ **restart CLI** activate FLAT-runtime hmw.js + wired sleep-check + sleep-recovery skill. 🔴 **NEXT (em):** curate investigator-codebase L1 **28973 OVER** (audit-trail) + watch frontend-designer/test-specialist near-cap. → session log `2026-06-18-S72-harness-10-flat-refine.md`. **Prev S71 — Harness-10 adopt: tracked run-trace folder convention + checklist 9-10 self-verify** — em main + 3 Workflow (invest `wf_9c2cd2cd-2e7` → implement `wf_e4e46725-231` → review `wf_636bc95b-939`) theo mandate Harness-9 PART 2. **0 production code** (governance/workflow only). Migrate `.claude/workflows/wave-*/` gitignored → `runs/<run-id>/` **git-TRACKED** (run.md + sub-md/ + harvest/) + `_ledger.md` 2-nhịp + 3-layer anti-miss (L1 em-main@P1 ledger-check / L2 session-start orphan-scan / L3 session-end close-gate **idempotent-VERIFY-not-re-APPEND**) + **containment model shift** (Harness-2 B6 "mọi tracked-change=vi-phạm" → Harness-10 "tracked-change NGOÀI run-folder + code-disjoint=vi-phạm"; run-folder TRACKED → HIỆN git-diff = audit trực-tiếp). hmw.js wave→run-trace (accept `args.run`, alias `wave`; path `sub-md/`; `node --check` PARSE-OK). **Review độc-lập (R2+R3) bắt C5 L1 over-claim** (doc nói hmw.js prompt-builder emit L1 reminder nhưng grep engine=0 → engine no-fs → fixed path-a: L1 = em-main @P1 convention) — dogfood mandate B2 đúng (1-workflow-tự-chấm sẽ bỏ sót). **checklist 9-10:** Part A (Harness-9 memory) + Part B (adap 2-workflow) ĐÃ done S70; Part C (Harness-10) MỚI 8/8. dogfood: 3 run-trace folder TRACKED đầu + 3 entry ledger. adap-report `2026-06-18-Governance-checklist-harness-9-10` + email ai_infra. **State THẬT GIỮ NGUYÊN: Mig 53 · 88 bảng · 306 test · 68 gotcha · menu 54 · bundle admin `BgNCjwsG`/user `CBvh0vtf`.** + `CLAUDE.md` test-flush 263→306 (pre-existing uncommitted, resolve H1 stale-flag). ⚠️ restart CLI activate hmw.js RUN-TRACE runtime + (carry S66/S70) §2.1.2 budget-audit/reviewer-Cat-6/H8-inherit. ✅ **curate-debt CLOSED S71** (FINALIZE double-check `wf_73de399d-753` + curate `wf_f32987b8-03f`): reviewer 36.7→24.8KB + investigator 29.8→23.2KB (both <25600 cap, archive +N -0 0-byte-loss) + reviewer-gist gen:2 + 3 user-memory G2/G3 + budget.json re-measure. Race root-cause fixed cấu-trúc (hmw.js RUN-TRACE writeGuard). → session log `2026-06-18-S71-harness-10-run-trace.md` (pending). **Prev S70** — **Harness-9 adopt: L2 archive dark-matter recovery + adap 2-workflow mandate** — em main + 3 Workflow (investigate `wf_be952f3c-97f` → implement `wf_a58e0d15-beb` → audit `wf_9520d8cd-4fe`) + 2 monitor bootstrap. **0 production code** (governance/memory only, commit `f36aab8` pushed). 4 over-cap sub-agent (cicd-monitor/investigator-codebase/reviewer/implementer-backend) curate L1→L2 + `archive/_INDEX.md` (mục-lục con-trỏ **substring sha-keyed**, Ctrl-F fallback) + `.gist.md` (nén 4-field distill-gen:1, verbatim FROZEN) → **cả 4 < 25KB auto-inject cap** (P1 curate-debt CLOSED; ~240KB archive hết RAG-dark). PART 2/3 process-mandate codify (adap-apply + agents/README Upgrade S70 + session-start §2.1.2 budget-audit). **0-byte-loss git+sha verified** (Stage C audit + em-main self-gate khi 2 reviewer no-StructuredOutput). +`memory-budget.json` (seed-by-measure) + `scripts/measure-agent-memory.ps1` + `.ragignore` + doc-drift 4-cite flush. adap-report + email-back ai_infra (body-hash `7c07b716e775`). **State THẬT GIỮ NGUYÊN: Mig 53 · 88 bảng · 306 test · 68 gotcha · menu 54 · bundle admin `BgNCjwsG`/user `CBvh0vtf`.** ⚠️ restart CLI để activate session-start §2.1.2 + pending H8 inherit + reviewer Cat-6. → session log `2026-06-17-S70-harness-9-l2-recovery.md`. **Prev S69** — **Văn phòng số (E-Office) port + golive + PE cờ gấp/ngưỡng CCM — 4 deploy prod-verified Run #305→#308, HMW-mode ON, 2 workflow fan-out + ~14 spawn**: foundation PURO (shared PageHeader/KpiCard/WidgetCard + Dashboard 2-cột + sync fe-admin index.css đóng drift S66-S68) #305 → **re-skin TRỌN 10 page** PURO layout + CSS Hồ sơ NS, phẫu-thuật-giữ-100%-logic (reviewer verify api/queryKey byte-identical) #306 → **Office golive public** `SeedAllRolesOfficeModulePermissionsAsync` read+create 16-key allow-list mọi role (mirror S65 pattern, chạy SAU revoke; excluded Off_PhongHop_Manage/Off_AttendanceReport/Off_ChamCong giữ ẩn; cicd DB-verify 16/16×13 role) #307 → **PE cờ gấp PRO/CCM + CCM duyệt-final theo ngưỡng giá trị** Mig 53 (anh Kiệt FDC sau họp sếp) #308. **State THẬT: Mig 53 · 88 bảng · 306 test (45D+261I) · 68 gotcha · menu 54 · bundle admin `BgNCjwsG`/user `CBvh0vtf` Run #308.** 2 gotcha NEW (**#67** Tailwind accent palette thiếu-stop vỡ-màu-im-lặng · **#68** stale-diagnostic-background-agent). 2 truncation #53 (impl-backend positional-record + impl-frontend) → em main recover-disk + self-gate (cả 2 build PASS sau-cùng). C (sau duyệt → chuyển phiếu đến dự án) chờ anh Kiệt spec form. → session log `2026-06-17-S69-vanphong-golive-pe-urgent-threshold.md`. **Prev S68** — **Hồ sơ NS header chi tiết NV: làm nổi bật + fix tên render đen→trắng** — em main solo, 3 commit (2 FE `6983609`+`37752eb` · 1 docs `11bc96d`), 2 deploy prod-verified Run #303-304 (anh UAT realtime): tên `text-xl extrabold`+drop-shadow · dòng meta `text-[13px] font-medium` trắng-đậm · badge pill **màu theo trạng thái** (#303); anh báo "tên đen nền xanh ko nổi bật" → diagnose **rule `h1-h4{color:#0b1220}` viết NGOÀI `@layer` thắng `text-white`** (Tailwind v4 unlayered > all layers, **gotcha #66 NEW**) → ép `text-white!` + thu nhỏ `text-lg` (#304, grep dist confirm `!important`). Bootstrap: 2 monitor RE-REPORT CLEAN + 2 doc-drift fix (dep-audit 64→65 · root CLAUDE 263→286, H1 flag). **State THẬT: Mig 52 · 88 bảng · 286 test · 66 gotcha · menu 53 · bundle admin `CNUv1jxY`/user `CpOskeS1` Run #304.** ⚠️ curate-debt P1: cicd-monitor **44.1KB** (worst). **Prev S67:** **buổi sản phẩm LỚN, 6 deploy prod-verified Run #297→#302** (anh + anh Kiệt FDC UAT realtime, HMW-mode ON): fe-user Hồ sơ NS đồng nhất font + chữ đen→**xanh đậm `brand-800`** (#297 `ab4e681`) · **fe-admin mirror master-detail** + accent tokens index.css [đóng pending lớn nhất HRM go-live, page SHA256 ×2] (#298 `292d64d`) · **+23 test-after HRM** [Dept cycle-guard · PE HoSoLink absolute-set · HRM-perm seed] → 263→**286** (#299 `bcd619d`) · **list flex-row gọn** [bảng 3-cột→flex-row, `overflow-x-hidden` → hết tràn ngang rail] + đồng nhất cỡ chữ [18/14/13/11px] ×2 app (#300 `91aaf05`) · **PE Link hồ sơ auto-detect** `http(s)`→hyperlink/`O:\`→Copy (#301 `6df1b2d`) → **render link `file://` bấm-thử** + Copy (#302 `536dd6b`). **Workflow research 3 investigator-api** (auto-mở `O:\` từ web): default browser CHẶN https→file://; **chỉ Edge GPO `IntranetFileLinksEnabled`** (Edge-only, Intranet Zone, 1 GPO domain zero-per-machine) = one-click thật — Chrome không có; .url-download zero-install nhưng 2-click. **State THẬT: Mig 52 · 88 bảng · 286 test (45D+241I) · 65 gotcha · menu 53 · bundle admin `CcrZqfht`/user `DniDFUB_`** (#302). test-specialist truncated return #53 → em main recover-disk (3 file test đủ + 286 verify); 0 production bug. ⚠️ curate-debt: cicd-monitor 39.8KB + inv-codebase 39.4KB over-cap. **Prev S66** — **session-end closeout em-main-solo, 0 product-sub:** adopt **Harness-8 all-inherit** (7 sub demoted `claude-opus-4-8`→`inherit` → cả 11 = inherit, gỡ two-tier Harness-4) + **cicd-monitor L1 curate 86.8→28.9KB** (byte-exact sed → `archive/2026-06.md`, incl #291 forensic) + **ef-core skill doc-flush Mig 50→52** (H1 drift, +Mig 51/52 rows) + check-email AI_INFRA (**0 thư mới se-directed**). ~17 file docs/gov/config, **0 production code** → state THẬT GIỮ NGUYÊN: **Mig 52 · 88 bảng · 263 test · 65 gotcha · menu 53 · bundle admin `BDwV5d0X`/user `DbVv6rsf`**. ⚠️ **Restart CLI** để H8 runtime (frontmatter no hot-reload) + reviewer Category 6 (S64 pending). adap-report `2026-06-16-Governance-harness-8-all-inherit-workflow-fastest` + email-back ai_infra (hash `fa7f690d` round-trip MATCH). Prev S65 — **HRM go-live: public Hồ sơ Nhân sự + trang master-detail giống NamGroup + Department hierarchy + PE Link hồ sơ**, ~6 deploy prod-verified Run #289→#295, anh + anh Kiệt FDC UAT realtime): (1) **public Hồ sơ Nhân sự mọi role** — `SeedAllRolesHrmProfileReadPermissionsAsync` grant CanRead `Hrm`+`Hrm_HoSo` 13 role chạy SAU revoke S58 (upgrade-only; EmployeesController policy-based `Hrm_HoSo.Read` mở luôn API không hardcode Roles), giữ ẩn Dashboard NS, Run #289; (2) **redesign màu foundation fe-user** — accent palette teal/violet/amberx/greenx + `.app-gradient-brand`/`.card-accent`/`.icon-chip` + heading 700, brand #1F7DC1 + Be Vietnam Pro giữ, Run #290; (3) **Department hierarchy** Mig 51 `AddDepartmentParentId` (ParentId loose-Guid no-FK + `GET /departments/tree` ráp cây in-memory + rollup count theo `User.DepartmentId` + cycle-guard HashSet) + picker "Phòng cha" fe-admin (self-service org chart) + Update cycle-guard, Run #292; (4) **Hồ sơ Nhân sự master-detail giống NamGroup** — `EmployeesListPage` rewrite: 3-panel→**2-cột** (cây tổ chức gốc "SOLUTION COMPANY" + list chồng TRÁI · chi tiết 5 tab PHẢI) + tô màu accent, giữ 100% 5 satellite CRUD (16 endpoint), Run #293/#294/#295; (5) **PE mục "e. Link hồ sơ"** Mig 52 `AddHoSoLinkToPurchaseEvaluation` (`HoSoLink string?` hyperlink NAS + `<a>` target_blank rel-noopener + null-safe) + rename "Dự trù PRO"→"Ngân sách PRO" (row+badge) ×2 app SHA256-mirror, Run #293. **State THẬT: Mig 52 · 88 bảng · 263 test (45D+218I) · 65 gotcha · menu 53 · bundle admin `BDwV5d0X`/user `DbVv6rsf`** (Run #295 `456c7a7` Employee-refine — user rotate `CZfo_PFZ→DbVv6rsf`, cicd PASS). **🔥 Workflow fan-out chạy THẬT lần đầu** (`pe-hoso-link-rename-pro` BE∥FE→review) — parallel disjoint-file OK, NHƯNG FE+reviewer return-RỖNG #53 → em main recover-disk + self-gate (bắt badge "DỰ TRÙ PRO" sót rename); **verdict: fan-out cho parallelism nhưng reviewer-stage không tin được trong harness này → verify-heavy task vẫn tự gác = tương đương spawn lẻ** (`feedback_workflow_fanout_reliability`). gotcha **#65** NEW (build csproj con ≠ `dotnet build slnx` gồm tests → miss test-compile khi đổi chữ ký record command → CI CS7036 Run #291 FAIL-gated). **Prev S64** adopt **Harness-7 writing-quality floor** — em main solo, commit `6afde19` docs/gov-only, 0 sub spawn: `rules.md §1.1` outward-VN-full-grammar + reviewer Category 6 + adap-report + email ai_infra; broadcast body-hash `a4580ea9` verified-MATCH **KHÔNG mis-stamp** [false-mismatch = gotcha #61 PS5.1 UTF-8 decode của em]. Prev S63 docs-closeout bù S60/S61/S62 — **State THẬT: Mig 50 · 88 bảng · 263 test (45D+218I) · 64 gotcha · menu 53 · bundle admin `0xKYGhhf`/user `C81ZdG9G` Run #286**; S60-62 = PE ràng buộc gửi-duyệt + bypass drafter (S60) · gỡ "Từ chối" (S60) · Mig 50 ngân sách per-gói-thầu Excel anh Kiệt + XÓA module Budget cũ (S61) · vượt-NS cảnh-báo-mềm cho lưu (S62); + reconcile stray reviewer cwd-misland; session log `2026-06-12-S60-S62-pe-budget-workitem-softwarning.md`). Prev Session 59 ( **10 đợt ship prod-verified: 8 Run PASS + 2 cancelled-supersede-benign #273→#282** (run_number API — dải đếm khác #38x S58, cùng pipeline; 2 cancel = push-đè khi UAT góp ý realtime, ancestor-verified): (1) **wipe transactional testing data** theo anh Kiệt FDC — 10 PE + 7 HĐ [DEMO] + 64 notif + 1 AwV2 cũ inactive = 0, reset PeSeq/CtSeq → phiếu thật đầu tiên team tạo chiều nay = **PE/2026/A/001** ✓, app-recycle KHÔNG resurrect (DemoSeed gate held), uploads orphan dọn (`56882ac` #273); (2+3) **PE tree Panel 1 chốt 4 tầng "📅 Năm > 📁 Dự án > 🧱 Hạng mục > Phiếu"** (anh chốt follow-up sau bản gộp "Dự án (Năm)"; `yearGroups` useMemo, expand-key v3, FE-only — list DTO đã có workItemName S57bis) (`0eafcd3` #274); (4) **dọn 15 mã hạng mục demo tự chế** theo chị Trà Sol "xóa cái đám phần thô phần hoàn thiện… MÀ ANH TỰ ĐẺ RA" — WorkItems 86→**71**, GỠ HẲN block seed demo khỏi DbInitializer, đối chiếu 71/71 khớp bảng PMH từng dòng (`bbd1554` #275, bundle frozen BE-only); (5) **rename 71 mã đúng format PMH anh Kiệt chốt** "MÃ CV gồm chữ MEP-SUB-1 rồi tên 1 MEP Sub MEP (Full) — đúng kiểu vậy" → `MAT-n`/`SUB-n`/`MEP-SUB-n`/`MEP-EQU-n` + Name "STT nhóm tên"; **DB-trước-code-sau** (gotcha **#62** NEW — seed per-code idempotent, sai thứ tự = 142 rows) + sqlcmd `-f 65001` (gotcha **#61** NEW — verify data qua API JSON, KHÔNG tin console mojibake) + FE sort numeric ×3 ×2 app (`c869d26` #276); (6) **UAT 6 vòng 11 điểm**: NEW **`ui/SearchableSelect`** combobox gõ-lọc BỎ DẤU (fold NFD — Hạng mục/Dự án/NCC) + auto Địa điểm từ Project.Location + điều khoản TT Textarea đa dòng (`faed59f` #277) · anh chốt: **ẩn cả Trả lại+Từ chối khi người duyệt = người soạn** (drafterUserId match) + **quick-add NCC ngay form** (SuppliersController POST hạ → any-auth, PUT/DELETE giữ khóa — cicd authz probe live 4/4: 401 unauth/201 nv.test/403 delete/cleanup) + upload multiple files ×2 chỗ (`9c330d2` #278) · vòng 3-6 realtime (`f21c55d` #279-cancelled / `69997da` #280 / `80b64dd` #281-cancelled / `792c030` **#282 FINAL**): **bảng NCC table-fixed** width từng cột (file dài hết vỡ layout) + **bỏ ô "Tên" ngân sách nhập tay** (chỉ còn Số tiền, hasManual detect theo amount) + **GỠ field "Điều khoản thanh toán" khỏi TẤT CẢ form phiếu** (cột per-NCC + display phiếu cũ GIỮ) + **bỏ nút "+ Thêm hạng mục"** (1 phiếu = 1 hạng mục header). Bundle FINAL admin **`B1DtNT9C`**/user **`D6uF3Mln`** (Run #282). Test 240 ×2 local + 8× CI gate. **0/14 spawn truncated** (lần đầu sau nhiều session). → session log `2026-06-11-S59-wipe-tree-pmh-uat-batch.md`. Prev S58 (2026-06-11 — **4 việc prod-verified Run #382/#383/#384**: lock-demo-user fix + tạm ẩn HRM/Office/Cá nhân + Danh mục cuối sidebar + fe-user redesign theo UI/UX guide AI_INFRA. **Việc 1 — lock fix** (Run #382, `5998163` ~3m31s): Run #381 cicd phát hiện S57bis lock = NO-OP (14 email named-person là population Dev-only). Recon dump prod: demo thật = 20 UAT-matrix `{dept}.{nv,pp,tp}@`+`bod.{1,2}@` tạo TAY 05-13; root cause sâu = `DemoUserPassword` 11 ký tự < prod `RequiredLength=12` → `CreateAsync` silent-fail MỌI startup từ trước tới giờ (= root cause "helpdesk inert phòng IT 0 user" S56). Fix: union 20 email + password 12 ký tự. Prod sau deploy: **55 user / 21 active / 34 locked** — 20 UAT + 14 named-person locked ✓, **nv.cao/nv.truong CREATED+ACTIVE (helpdesk S56 RESOLVED)** ✓, 5 real staff created ✓, guard admin/catalog.manager/nv.test/chuong.phan-typo active ✓ (anh chốt 3 quyết định AskUserQuestion). Bundle FROZEN. gotcha **#60** NEW (seed silent-fail vs prod password policy — dump population thật trước khi lock/seed-by-email). +Closeout S57bis residual: gotcha #59 commit, 4 spawn-record on-behalf (H2 4-MISS), H1 5-patch doc-drift, test 240 re-verified local. Prev S57bis (2026-06-11 sáng) — **PE gắn Hạng mục công việc (Mig 49) + mở quyền Pe all-role + menu "Cá nhân" + khóa demo user** (sếp Zalo deadline 15:00): commit `17b23a4` (Harness-4 two-tier runtime-VERIFIED spawn-test 2 chiều) + `dd117b7` (product) → Run #381 PASS ~4m25s. Mig 49 `AddWorkItemToPurchaseEvaluation`: PE.WorkItemId `Guid?` loose-Guid KHÔNG FK vật lý (convention PE — database-agent design) + IX + validator NotEmpty create + FK-guard handler Conflict + UpdateDraft null-safe. FE ×2 app PeWorkspaceCreateView/PeHeaderForm (SHA256 identical)/PeDetailTabs "Dự án – Hạng mục". Pe_* 11 key CanRead+CanCreate mọi role (130 rows/13 role — Pe_* leaf KHÔNG nằm MenuKeys.All, build qua factory). Menu Personal root@30 + Chấm công re-parent + Master write-lock `Admin,CatalogManager` ×3 controller. Test 228→**240** (+12 PeWorkItemGuardTests). Bundle rotate cả 2: admin `CP4CB1ym` / user `BmZ3VHnm`. 2 builder truncated #53 + reviewer die-0-byte ×2 → em main solo vá cross-stack + self-gate. Excel (3) đối chiếu = NO-CHANGE (S55 data identical). Prev S56 — **Pre-golive verify sweep + golive-harden 4 fix — HMW 2-workflow, prod-verified**: commit `a20cde8` → Run #379 PASS ~4m20s. WF1 `pre-golive-verify` 7-stream song song + adversarial → 6 PASS/1 CONCERN/0 blocker = **GO**; key finds = **ops not code** (prod IT-dept 0 active user → helpdesk inert + S43 LeaveBalance lost-update còn nguyên). WF2 `golive-harden` fix 4: **#3** LeaveBalance lost-update→atomic `ExecuteUpdateAsync`+Serializable tx (NO mig, exactly-once nguyên) · **#5** ItTicket authz Forbidden-trước-NotFound (fail-closed) · **#6** DocxRenderer null-guard (2 warn→0) · **#4** Travel/Vehicle ApproveV2 +4 smoke. Test **216→228**. Bundle FROZEN `4SUwDLD8`/`XdKzt9LL` (BE-only). `sys.tables` re-ground **92→93** (cicd ground-truth, Mig 48 col-only). reviewer stage StructuredOutput-fail→em main đỡ cross-stack review (3 diff clean) + bump Serializable đóng MAJOR. gotcha **#58** NEW (EF read-modify-write lost-update→ExecuteUpdate atomic). **2 ops VPS pending** (gán user phòng IT + `tzutil` UTC+7). FE Phase 2 redesign **deferred** (recon ready). Prev S55 — **Nạp master data thật từ Excel + Project +4 cột (Mig 48), HMW-mode ON**: commit `69cb393` → Run #377 PASS ~4m33s, prod-verified. Anh giao file Excel "HẠNG MỤC CÔNG VIỆC DỰ ÁN" → `/ultra-on "workflow làm xong hết"`. Nạp **62 dự án + 71 hạng mục + 3 NCC** vào Project/WorkItem/Supplier qua `SeedRealMasterDataAsync` (per-code idempotent, **UNGATED** → coexist demo, tự lên prod). **Mig 48 `AddProjectMasterFields`**: Project +4 cột nullable (Year/Investor/Location/Package, NO new table). FE ProjectsPage form +4 input ×2 app SHA256 mirror. Test 216 (compile-fix MasterCatalogFilteredUniqueTests +4 null args, no new test). Bundle admin `DmjI8Cmn`→`B-d6893W`/user `YxL_MljK`→`XdKzt9LL` (cả 2 rotate). Prod verify: Mig 48 applied · Projects spot-6/6 · WorkItems VT/TP/MEP/TB=71 · Suppliers 3 · CAL01.Investor="Công ty TNHH Calofic". **2 agent return truncated** (implementer-backend + reviewer, gotcha #53) → em main disk/runtime-recover (build/test/sqlcmd/git truth); cicd verdict-FIRST → PASS clean no-truncate. Data-quality catch: MEP col gộp 2 nhóm + divider "THIẾT BỊ" → split đúng 71/4-category. Provenance `scripts/master-import-data.generated.md`. Prev S54 — **IT staff tự reassign ticket (cross-stack authz, HMW-mode ON)**: 1 code commit `ca4b602` → Run #376 PASS ~4m18s, prod-verified. Cho tổ IT (dept Code=="IT") + Admin reassign ItTicket trên CẢ 2 app. BE: NEW `GetAssignableItStaffQuery` capability endpoint `{canReassign,staff}` + `AssignItTicketHandler` authz Admin-OR-dept-IT (Forbidden) + assignee-must-IT (Conflict) + controller `/assign` hạ `[Authorize(Roles=Admin)]`→`[Authorize]` (handler fine-grained). FE: fe-admin+fe-user ItTicketsPage **SHA256-identical** (REVERSE S53 divergence) gate nút by `canReassign`, dropdown từ `/assignable-staff` (không `/users`). Test 203→**216** (+13 authz guard test-before-merge). NO migration (DepartmentId reuse). Bundle admin `DfCfHUE9`→`DmjI8Cmn` / user `_3S0BPJ2`→`YxL_MljK` (cả 2 rotate). 6-agent fan-out (BE∥FE→test→reviewer→cicd) + em main reconcile stray-memory residual (3 agent ghi MEMORY nhầm `src/Backend/.claude` → harvest về canonical). reviewer PASS 0 blocker (role-string "Admin" chain-verified). Task 1 Phase 9 Ops KHÔNG làm (anh dừng). flag: cicd `sys.tables=93` vs STATUS 92 → monthly audit re-ground.) Prev S53 (gotcha #57 EXT Master Mig 47 + P11-D reassign-UI fe-admin + P11-E menu + database-agent verified-runtime: `44b9e54` Run #260 + `dbf6648` Run #261, test→203, bundle→`DfCfHUE9`). Prev S52 (Phase 11 P11-D+E+F deployed + database-agent adopt, HMW-mode ON): 3 commit — `e9ee97f` (database-agent DB1–DB11 read-advisory, roster 10→11, executed-file CHỜ restart) + `6a66429` Wave 1 (P11-E AttendanceReport+Excel+OtPolicy multiplier + P11-F MaTicket codegen, migration-free) + `dcf76f8` Wave 2 (P11-D ItTicket round-robin assign dept-IT + SLA timer, Mig 46). Test 186→**200**. Bundle admin `DYfjnpY0`/user `_3S0BPJ2` (cả 2 deploy verified curl độc lập — Wave 1 BE 401 wired + Wave 2 /assign 401 + Mig 46 applied health-200). ⚠️ **Session-limit hit giữa Wave 2** → recovery: BE/test verify-on-disk + em main solo FE redo + curl-self-verify thay cicd-spawn (multi-agent resilience, git/disk/prod = source-of-truth). RAG recovered (chunk 2416 rerank live) nhưng stale 05-29. Prev S51: P11-C Vehicle+Driver.)


---

## HANDOFF — cắt từ `docs\HANDOFF.md` line 5 (từ **Prev S90** trở đi)

 · **Prev S92** (S92 — **Ẩn 5 nhóm menu (Hợp đồng + Danh mục + Nhân sự + Văn phòng số + Cá nhân) CHỈ Admin thấy trên eoffice — em-main-led, 1 commit prod-verified `1408d4e`, BE-only no-migration, HMW-mode ON**: anh `/session-start` thấy WIP S92 uncommitted (hôm nay) → chốt "verify + hoàn thiện + deploy". `RevokeTemporarilyHiddenModulesAsync` mở rộng predicate +Contracts/Ct_* +Master/Suppliers/Projects/Departments/Catalog* (cộng dồn S58 Hrm*/Off*/Personal) + TẮT 2 re-grant (S65 HRM + S69 Office) → revoke = bước permission CUỐI ungated trong SeedAdminPermissionsAsync (durable mỗi restart, gotcha #75) + InReviewScope→chỉ Pe_*. PE giữ nguyên (Pe_* không match predicate; master-data GET any-auth). +AdminOnlyModulesRevokeTests 3. Test 431→**434** (45D+389I). seed-order + predicate coverage verified · **reviewer PASS** (5 attack A-E, 15/15 trên 3 class). **FYI:** role CatalogManager (0 user hiện tại) cũng bị thu Danh mục — intended-by-spec, re-enable cần carve-out predicate. **State: Mig 59 · 88 bảng · 434 test (45D+389I) · gotcha 76 · menu 54 · bundle admin `xz8FdmLN`/user `CA8Rla2w` (JS rotate #69, CSS frozen) · prod 17 user/7 NCC.** cicd **Run #358 PASS** prod-verified (sqlcmd: non-Admin 0 leak / Admin 5 giữ / Pe_* 120 untouched; ship-proof = dll-mtime + w3wp-recycle 08:04Z). **🔴 NEXT anh:** UAT eoffice login user non-admin → xác nhận KHÔNG còn thấy Hợp đồng/Danh mục/Nhân sự/VP số/Cá nhân (chỉ Duyệt NCC + Dashboard) · ⚠️ restart CLI (carry budget v3 + `/user-mark-*` + cadence). **🔴 NEXT em:** monthly 2026-07-01 (2 ngày) — **GẤP re-tier STATUS/HANDOFF mega-line** (STATUS line-6 giờ >25K-token KHÔNG Read/Edit được, S92 phải prepend qua PowerShell) + ef-core SKILL Mig→59 + docs/CLAUDE Budget-removed + 3 vocab-fork alias-map. **Pending product (carry):** Section B cột Dự-án wire · Ngưỡng giá CEO Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. → log `2026-06-29-S92-admin-only-modules.md`) · **Prev S91** (S91 — **buổi go-live LỚN em-main-led, 4 commit prod-verified + backup local** — go-live 26/06 anh Kiệt SOL-IT Phase-01 PRO+CCM. #1 `159b69d` guide Word bỏ "Từ chối" 2 chỗ + fix 12 caption Hinh→Hình [unpack→XML→repack giữ 13 ảnh]. #2 `ba42c59` wipe go-live [16 PE+16 budgets+94 notif+19 NCC demo xóa, giữ 7 NCC thật+17 user+master, PeSeq→A/001, backup+2-guard+AskUserQuestion-scope]. #3 `55494ad` gate SeedDemoMasterData chống resurrect 18 NCC demo mỗi restart [gotcha #75 root-cause, verify demo_codes=0 qua 2 restart]. #4 `e81e87f` user tự đổi mật khẩu [BE ChangePasswordCommand + POST /auth/change-password Identity-verify-pass-cũ + FE 2-app ChangePasswordDialog/TopBar + 10 test; CS0104 ValidationException ambiguous fix]. +backup local `backups/SolutionErp_golive_clean_2026-06-26.bak` 21MB + accounts.txt 17 tk. **State: Mig 59 · 88 bảng · 431 test · gotcha 76 · menu 54 · bundle admin `DgQyuG7f`/user `BmbQon23` · prod 17 user/7 NCC/0 PE-HĐ.** **🔴 NEXT anh:** ⚠️ restart CLI · review guide docx Word · đóng 2 tab eoffice em mở · UAT đổi-mật-khẩu [avatar→Đổi mật khẩu, ≥12 ký tự] + xác nhận NCC demo không sống-lại. **🔴 NEXT em:** curate test-specialist L1 OVER [carry nhiều session] · monthly 2026-07-01 [re-tier mega-line STATUS/HANDOFF bloat · ef-core SKILL Mig→59 · docs/CLAUDE Budget-removed · 3 vocab-fork alias-map]. **Pending product:** Section B cột Dự-án wire · Ngưỡng giá CEO Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. **Ops:** tzutil VPS = N/A [R6 fix tầng-serialize] · 5 real-staff pw · email typo anh Chương. **Lessons S91:** wipe-không-bền-nếu-không-gate-reseed [#75] · deploy config từ .example KHÔNG file-gitignored [#76] · Chrome-MCP screenshot kẹt SPA document_idle [#74 carry]. → log `2026-06-26-S91-golive-wipe-changepw-backup.md`) · **Prev S90** (S90 — **Chèn 12 ảnh khoanh-đỏ vào guide Word Duyệt NCC (em tự chụp prod qua Chrome) + chẩn UltraViewer — em-main solo, 0 production code**: anh "mở chrome chụp ảnh dán vào luôn" (12 ô trống từ S89). **Pipeline tự-chế (gotcha #74):** MCP `save_to_disk` KHÔNG ra file env này → **PowerShell `CopyFromScreen` + Win32 lọc-process-`chrome.exe`+`SetForegroundWindow`** (app Claude-Code Electron cùng class+title → khớp nhầm) + **DOM overlay `__ccA` element-based** (case-insensitive, minLeft/maxLeft/exact/up — toạ-độ-cứng vỡ vì viewport đổi) + crop 92/72 (banner CDP s08/s12→146, verify montage) + `python-docx 6.0"`-fit-A4. 12 màn chụp+khoanh+chèn, verify 13 ảnh (1 logo+12) + montage sạch banner. **0 prod mutation** (xem-only). **🔴 NEXT anh:** ① review docx trong Word; ② ⚠️ restart CLI (carry budget v3 + `/user-mark-*` + cadence §2.1.x); ③ (tùy) bật finalize 1 cấp 1 workflow → chụp lại ảnh #10 badge "⚑ Duyệt thay CEO" / bấm tạo 1 HĐ thử → ảnh #11 hợp-đồng-nháp. **🔴 NEXT em:** sửa text guide "Từ chối"→"Duyệt/Trả lại" (app gỡ "Từ chối" từ S60) nếu anh OK · curate test-specialist L1 **34.8KB OVER** (carry S88, archive-gate DRY-RUN) · cicd 28KB + reviewer 27.7KB + FD 26.1KB WATCH. **Caveats guide:** #9 app chỉ Duyệt+Trả-lại · #10 chụp **cờ "Duyệt là KẾT THÚC quy trình"** (workflow chưa bật finalize) thay badge sơ-đồ · #11 chưa bấm Tạo-HĐ · account=admin. **UltraViewer (anh hỏi "sao bật"):** `UltraViewService` StartMode=Auto/LocalSystem standby, **0 kết-nối**, em KHÔNG mở (chỉ grant Chrome; computer-use screenshot detect+mask); tắt self-serve `Stop-Service`/`Set-Service -StartupType Manual` (cân-nhắc nếu IT dùng remote-support). **State GIỮ NGUYÊN: Mig 59·88 bảng·422 test·gotcha 74·menu 54·bundle admin `DalcOhvb`/user `CdS4tX_2`.** **monthly 2026-07-01 (carry):** STATUS line-6/HANDOFF line-5 mega-line >25K-token KHÔNG Read được — GẤP tách session-cũ ≤S87 ra session logs · ef-core SKILL Mig→59 · 3 vocab-fork alias-map. → log `2026-06-25-S90-guide-screenshots-insert.md`.) · **Prev S89** (S89 — **PE visibility/finalize batch + xóa 38 User test prod + Word guide, ~6 commit prod-verified, HMW-mode ON**: **D1 nháp riêng-tư** (`a71753b` Run #465, test 419→421) — IDOR fix nháp lộ qua cond#2 role + **cond#3 V2-approver** (workflow pin lúc-TẠO → CEO approver thấy MỌI nháp = leak màn CEO) → 4 chỗ owner-only (GetEligiblePhases bỏ DangSoanThao · admin-inbox bỏ · list-cond3 guard · detail-authz guard) + PeDraftVisibilityTests (anh chốt "bỏ nháp khỏi inbox hẳn") · **D2 CCM giá-đề-xuất** (`f7bd97a`) gỡ `!readOnly` over-gate (gate thuần role mirror ô ngân-sách; BE setter fail-closed = chốt; anh Trần Xuân Lưu CCM) · **D3 finalize-note 3-surface** (`f0bca77` test 421→422) BE +3 computed-field detail+list DTO **no-migration** + EF-subquery first-reachable + PeFinalizeChip 2-app (invest-WF `wf_341f7b29` + impl-WF `wf_3f57edb6`; **impl-FE return-rỗng #53** → em-main mirror fe-admin 4-file SHA + self-gate + PeFinalizeProjectionTests) + **flow badge "⚑ Duyệt thay CEO"** PeWorkflowPanel (`9c920ad`) + **matrix flag thứ-8** WorkflowMatrixViewPage thiếu allowApproverFinalize từ S87 (`fef4c33`) · **xóa User test** (`681b1ed`) recon prod (ssh sqlcmd) 55→giữ 17/xóa 38 (whitelist-keep + backup `SolutionErp_S89_preuserdelete.bak` + count-guard[30,45] + XACT_ABORT; KHÔNG approver-block FK; nv.test 1-PE) + gỡ seed SeedDemoUsers/Lock (deploy bắt-buộc — binary cũ resurrect) · **Word guide** `docs/Huong-dan-Duyet-NCC.docx` (skill docx, logo Solution, 8 phần, khoanh-đỏ 1→2→3). **State THẬT: Mig 59 · 88 bảng · 422 test (45D+377I) · gotcha 73 · menu 54 · bundle admin `DalcOhvb`/user `CdS4tX_2` · prod 17 user thật.** **🔴 NEXT (anh):** ⚠️ restart CLI (carry budget/cmd). **Chèn ảnh guide:** chụp 12 màn (theo nhãn ô trong .docx) gửi em → em khoanh-đỏ 1→2→3 + chèn → xuất bản; HOẶC bật Chrome + extension Claude-in-Chrome + pass admin → em tự chụp+annotate (em KHÔNG tự chụp prod được từ máy). **🔴 NEXT (em):** curate `test-specialist` L1 **34.8KB OVER-SOFT** + cicd 28KB + reviewer 27.7KB (archive-gate DRY-RUN). **monthly 2026-07-01:** ef-core SKILL Mig→59 · STATUS/HANDOFF re-tier (mega-line bloat — STATUS line-6 đã >25K-token KHÔNG Read được, GẤP tách session-cũ→logs S86↓) · 3 vocab-fork alias-map · docs/CLAUDE Budget-removed. **Pending product (carry):** Section B cột Dự-án wire · Ngưỡng giá CEO Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. **Lessons:** Designer-save=version-MỚI (phiếu pin cũ→finalize chỉ hiện phiếu-mới = "check rồi mà không thấy") · doc-drift thêm-flag-1-surface-quên-surface-song-song · whitelist-keep+3-guard prod-delete · WF-impl-FE-rỗng→em-main mirror+self-gate. → log `2026-06-25-S89-pe-visibility-finalize-userclean-guide.md`.) · **Prev S88** (S88 — **PE stability audit → fix patchwork D1 + hoàn-thiện multi-winner D2, 2 deploy prod-verified, HMW-mode ON**: anh giao "review/invest/test lại Duyệt NCC, chấp vá thì xử lý, tính năng đã ổn định". **Audit Workflow `wf_c15da996-be5`** (6 area invest→review + full-suite test) → core SOLID, tách findings safe vs behavior-affecting; AskUserQuestion ×4 chốt max-scope (incl create-contract = **1 HĐ/winner**). **D1 (`73cce1f` Run #347 PASS, test 402→413):** Block B financials re-key SelectedSupplierId→IsWinner (số=0 cho ≥2 winner) · CEO-notify-on-urgent +SaveChanges (trước rớt âm-thầm) · HoSoLink null-safe+clear-via-empty (sửa header không xoá link, #73-class) · #70 guard PRO budget · dời SetPeCcmBudgetPeriod→PeWorkItemBudgetFeatures. **D2 (`1aa3bdb` Run success, test 413→419):** create-contract **1→N** per winner (Command→List<Guid>, gen-codes-first-then-atomic-add vì ContractCodeGenerator self-commit seq; GiaTri single=details-sum/≥2=per-winner-quote; pe.ContractId=first idempotency; {contractIds}) · list-card winner names (DTO +WinnerSupplierNames EF collection-subquery translate-OK SQLite) · FE dialog+PeListPanel. **State THẬT: Mig 59 · 88 bảng · 419 test (45D+374I) · gotcha 73 · menu 54 · bundle admin `BQq2eTP6`/user `dHa64I59`.** em-main-led BE core + delegate impl-backend ∥ impl-frontend ∥ test-specialist + reviewer PASS + cicd. **#53 truncation ×3** (test-specialist/reviewer/cicd return rớt MEMORY-over-budget → em-main recover-disk + self-gate + curl-self-verify deploy). **🔴 NEXT (anh):** ⚠️ restart CLI (carry: budget v3 + `/user-mark-*` + cadence §2.1.x). **NEXT UAT (anh Kiệt Ctrl+F5):** ① ≥2-winner Block B "Giá trị kỳ này" đúng số (không còn 0) · ② đánh dấu GẤP → Director nhận chuông+toast · ③ set Link hồ sơ rồi "Sửa header" → link GIỮ · ④ ≥2-winner phiếu → "Tạo HĐ" tạo N hợp đồng draft (1/winner) — **xác nhận GiaTri per-winner = giá NCC chào (quote total)** có đúng ý không, không thì chỉnh trong HĐ draft. **🔴 NEXT (em): curate test-specialist L1 34.8KB OVER-SOFT GẤP** (root-cause #53 ×3 phiên này; archive-gate DRY-RUN + move oldest→L2; reviewer 27.1KB + FD 26.1KB WATCH strike). **monthly 2026-07-01:** STATUS/HANDOFF re-tier (mega-line bloat — line không Read được, cần tách session-cũ ra session logs) · ef-core SKILL Mig→59 · docs/CLAUDE Budget-removed · 3 vocab-fork alias-map. **Pending product (carry):** Section B cột Dự-án wire (chờ anh) · Ngưỡng giá CEO Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. **Ops S58/S59:** email typo anh Chương · 5 real-staff pw · gán CNTT (tzutil N/A — R6 fix tầng-serialize). → log `2026-06-25-S88-pe-stability-audit-d1-d2.md`.) · **Prev S87** (S87 — **2 PE feature LỚN prod-verified, HMW-mode ON, ~14 spawn (nhiều #53 truncate → recover-disk + self-gate)**: **(1) CCM 3-fix Mig 58** `f1b10e9` **Run #344 PASS** — đọc PDF "CCM 4 ý" (BỎ mục 3): multi-winner (`IsWinner` SUM, multi-toggle `SupplierIds[]`, FE tick-nhiều-ô + tổng) + budget=0 hợp lệ (guard `is null` only) + cấp KẾT-THÚC quy trình (`AllowApproverFinalize` **AUTO** theo anh "bật trong quy trình hay hơn"). **Self-review bắt 8 chỗ FE `selectedSupplierId`** vỡ multi-winner (null khi ≥2) → `isWinner`. Test 377→395. Bundle admin `CXCKlNay`/user `Di40ewrF`. **(2) Section B 3-cột Mig 59** `9b1ee0c` **Run #345** (cicd-verifying) — anh AskUserQuestion "mỗi cột nhập kỳ-này RIÊNG" → `CcmBudgetPeriodAmount` + `PATCH /budget/ccm-period` role-gate CCM; FE Section B (THỰC HIỆN) `<BudgetRow>` list → `<table>` 3 cột (Dự án—|PRO|CCM, `colCalc()` per-cột) qua **Workflow `wf_aafb18fe-d9d`** (BE→FE→test + 3-review: math/authz PASS · mirror+FE NULL → em-main self-gate identical+402+2-build). Test 395→**402**. **State: Mig 59 · 88 bảng · 402 test · gotcha 73 · menu 54 · bundle admin `BABhPh2s`/user `DLulO6uP` (Run #346 — `0d3c0cf` tách khối nổi bật "4. Thông tin chọn thầu" FE-only; #345 Section B=`C8lWxEQK`/`Kz5cSW2u`).** **NEXT UAT (anh Kiệt Ctrl+F5):** khối xanh "4. Thông tin chọn thầu" (1.Tên NCC/TP+giá trị · 2-3.Đề xuất PRO/CCM · 4.Bảng so sánh · 5.Link hồ sơ) trên "5. Ý kiến cấp duyệt" — có chỉnh thêm thì gửi. **🔴 NEXT (anh):** ⚠️ restart CLI (carry: budget v3 + `/user-mark-*` + cadence §2.1.x). **NEXT UAT (anh Kiệt Ctrl+F5):** ① tick NHIỀU NCC trúng + xem "Tổng chi phí đã chọn" · ② phiếu budget=0 gửi-duyệt OK · ④ Designer bật "Duyệt là kết thúc" cấp anh Chương → duyệt tới đó là DONE (không lên CEO) · Section B cột CCM nhập kỳ-này (bằng tài khoản CCM). **🔴 NEXT (em):** curate L1 over-cap (reviewer/cicd/inv/test-spec carry) · monthly **2026-07-01** (dọn CCM-setter `PeSuggestedPriceFeatures.cs` lệch-chỗ · re-ground sys.tables 88→89 · STATUS/HANDOFF re-tier bloat · ef-core SKILL + skills/README Mig→59). **Pending product:** Section B cột Dự-án wire (chờ anh) · Ngưỡng giá CEO Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. **Ops S58/S59:** email typo anh Chương · 5 real-staff pw · gán CNTT (tzutil = N/A R6). → log `2026-06-24-S87-pe-multiwinner-budget-finalize-sectionb.md`.) · **Prev S86** (`ae4f106` Run #343) — PE notify "cần duyệt" loại NGƯỜI TẠO phiếu (+3 `PeApproverNotifyExcludesDrafterTests`; re-ground test 356→377/gotcha→73). · **Prev S85** — **buổi UAT anh Kiệt FDC CỰC LỚN: CV PRO 6-fix + clear-data + 6 vòng UAT + 2 ROOT-CAUSE + 5 SQL-fix — ~10 deploy prod-verified #334→#341, HMW-mode ON**) — **Batch CV PRO** (Run #334 `5a61254`): file `Cần chỉnh sửa CV PRO.xlsx` = 8-ảnh-chú-thích → C1 ẩn c/d form tạo · C3 prefill ô8 · C4a live-recompute ô3/8 · C4b "Bằng ngân sách" · C5 hủy/đổi winner (BE `Guid?` clear) · C7 fullscreen preview. **Clear-data** (`scripts/s85-wipe-uat-data.sql`, BACKUP-trước): wipe 43 PE + 28 budgets + 21 NCC-test, reset→A/001 (AskUserQuestion chốt scope). **6 vòng UAT #335→#338:** D1 ẩn 3/4/5 · D5 auto-quy-trình · D2 drafter-gỡ-GẤP (nới S77) · D3 ngân-sách-tự-nhảy từ ban-hành · ràng-tạo-phiếu + D4 checklist xanh/đỏ + "Quy trình duyệt". **2 ROOT-CAUSE:** **R5 #339 `1263c0d`** workflow-clear-on-edit = bug-class S42 (`UpdatePeDraftHandler` absolute-set→null-safe `if (X is not null)`, gotcha **#73**, +3 test) · **R6 #341 `49ac086`** TZ +7h (timestamps UTC nhưng serialize thiếu 'Z' → `UtcDateTimeJsonConverter` UTC-with-Z, gotcha **#72**; cicd verify `createdAt:"…Z"`). **5 SQL-fix** phiếu workflow-less (gán QT-DN-V2-001). Test 356→**374**. **State: Mig 57 · 88 bảng · 374 test · gotcha 73 · menu 54 · bundle admin `aKuNip19`/user `BUsL0HeQ` Run #341.** **🔴 NEXT (anh):** ⚠️ restart CLI (carry: budget v3 runtime + lệnh `/user-mark-*` + cadence §2.1.x). **NEXT UAT (anh Kiệt/long.chau Ctrl+F5):** giờ thông-báo đúng ("vừa xong") + Sửa phiếu giữ workflow + submit OK + checklist xanh/đỏ đủ + auto-quy-trình. **🔴 NEXT (em):** curate L1 test-specialist 28.4KB WATCH strike-1 (value-protect gotcha#/guard → KEEP) · monthly **2026-07-01** (doc-cite flush ef-core/skills-README Mig→57 + STATUS/HANDOFF re-tier + **SignalR TZ-check** nếu realtime-push còn lệch + **edit-form workflow-selector** defer = đóng dead-end "mở Sửa chọn quy trình" mà form chưa có ô). **Pending product:** Ngưỡng giá CEO (Mig 54) Designer UAT · "C" chuyển phiếu→dự án chờ spec. **Ops S58/S59:** email typo anh Chương · 5 real-staff pw · gán CNTT (tzutil VPS = KHÔNG-cần-nữa, R6 fix tầng-serialize chuẩn hơn). → log `2026-06-23-S85-pe-uat-cvpro-rootcause-tz.md`. · **Prev S84** — **bootstrap + flush session-start cap-echo v3 + commit S83 cicd harvest-orphan (LIGHT, 0 production code)** — 2 monitor INFORM → flush `session-start.md:114` `60/20/16`→**`220/60/50`** (+canonical-pointer chống tái-drift; detector C2 không track cap-number) + commit `cicd-monitor/MEMORY.md` harvest S83 sót-closeout (Run #333 + gotcha #69-REFINE). Lesson `feedback_derived_flush_execution`: derived→canonical flush = em-main execution KHÔNG gate user-confirm; chỉ ĐỔI-số = quyền anh. ⚠️ restart CLI (command `.md` no hot-reload). State GIỮ NGUYÊN Mig 57·88·356·71·`CsJetgZH`/`BVS0ApIm`. → log `2026-06-22-S84-session-start-cap-flush.md`. · **Prev S83** — **(1) H-15 v3 memory-budget full-parity (lead 220K/sub 60K/wf 50K, anh owner-directive) + (2) fix PE require-workflow create+submit prod-verified Run #333** — 2 commit: `2c7fd63` (gov docs-only CI-skip) + `fc1f19d` (PE fix). **H-15 v3:** full AI_INFRA parity (sửa self-shrink S82) + NEW `spawn_fill_directive` (nạp sub tới budget bằng prompt GIÀU — byte-cap MEMORY.md = 1 lát) + engine §G.5 + mark **v3-delta** `RC-pqhuy1987-22-06-2026-16-35-37` (anh-directed). **PE fix:** validator `NotEmpty(ApprovalWorkflowId)` + submit-guard (sau Section-3) chặn phiếu null-workflow ("quy trình cũ", kẹt V1-legacy). Diagnose A/040 **tự-khỏi-reload = cache** (KHÔNG đụng prod). test-before RED→GREEN, full-suite bắt **9 đỏ** → triage (2 spec-conflict rewrite V1-deprecated + 6 collateral giữ + 1 validator). Test 354→**356**. **#69-REFINE:** bundle KHÔNG rotate vì 0 fe-src (Vite deterministic) — ship-signal = Last-Modified KHÔNG hash-delta. Chi tiết → `## S83` dưới. ⚠️ restart CLI (budget v3 runtime). State: Mig 57·88 bảng·**356 test**·gotcha 71·bundle `CsJetgZH`/`BVS0ApIm` Run #333. · **Prev S82** — **adopt Harness-15-v2 (Tầng-1 hot-feed-lớn + L2/L3 bỏ-trần + %-print 2-đầu-phiên + ranh-giới vai-trò), 0 production code** — anh `/check-email AI_INFRA và /adap-apply all step by step cẩn thận`. 1 thư mới H15-v2-notify (verify ✓✓) + fan-out 29 vs 22 → CHỈ H15-v2 MỚI (7 còn lại verify đã-phủ S72/S75/S79). em-main IMPLEMENT D9 (6 edit: L1 12K→per-role lead 60K/sub 20K/wf 16K · L2/L3→NO-CAP · §G.4 · §2.1.6+§L.b(c) %-print · mark refine) + REVIEW Workflow `wf_04667b25-5fa` **3/3 PASS** (3 MINOR fixed). Ranh-giới vai-trò: con-số = quyền anh, AI thực-thi + báo-% (sửa framing S81 "lead-authority" gộp nhầm AI-lead↔owner). mark H-15 **v2-delta anh-confirm** `RC-pqhuy1987-21-06-2026-01-58-01`. commit `aa3f0fe` push (docs-only CI-skip) + email AI_INFRA `a749bb6bd1be`. Chi tiết → `## S82` dưới. ⚠️ restart CLI (%-print runtime §2.1.6 + §L.b(c)). State GIỮ NGUYÊN Mig 57·88 bảng·354 test·gotcha 71·bundle `CsJetgZH`/`BVS0ApIm`. · **Prev S81** — **adopt Harness-15 memory-budget per-agent (token-governor + value-gate + work-state block), 0 production code** — anh `/check-email AI_INFRA và /adap-apply step by step, review sau lẫn imple, report trung thực`. 0 new directed email; fan-out → CHỈ H15. em-main IMPLEMENT (8/8 🔴 floor) + REVIEW Workflow `wf_b7f3c8ac-b53` (3-lane PASS/PASS/HONEST → bắt 2 CONCERN honesty → fixed). Chi tiết → `## S81` dưới + adap-report. ⚠️ restart CLI (session-start §2.1.5). ✅ mark H-15 stamped Active-High (`RC-…23-07-37`). State GIỮ NGUYÊN Mig 57·88 bảng·354 test·gotcha 71·bundle `CsJetgZH`/`BVS0ApIm`. · **Prev S80** — **curate L1 over-cap memory → L2 archive (em-main single-writer, 0 production code)** — anh `/session-start` (bootstrap clean: 2 monitor CLEAN · detector 26-flag baseline-safe · test 354) → "check làm thử đi". archive-gate DRY-RUN: reviewer 45→**10KB** · investigator-codebase 40→**10KB** · cicd-monitor 39→**12KB** = cả 3 **keep-floor-hit cannot-auto-drain** → manual condense-with-archive: 31 entries byte-exact `sed` → `archive/2026-06.md` (**+N −0**, 0 byte-loss) + 31 `_INDEX` substring pointer → **A7 GATE PASS 217/217**. Stale foundation counts flushed (130/263→354·55→71·Mig40/55→57·84→88·bundle→#330). **State GIỮ NGUYÊN: Mig 57·88 bảng·354 test·gotcha 71.** **Lesson:** `_INDEX` substring **quote-free** (A7 quote-parser cắt escaped-quote `\"PURO\"` → FAIL 1, gate bắt). **🔴 NEXT (em):** frontend-designer 26KB + test-specialist 28KB WATCH (A6 strike-1<2). → log `2026-06-20-S80-curate-l1-overcap.md`. · **Prev S79** — **adopt User-Mark (H-12/13) canonical §P + Harness-14 (Eval/Budget/Outcome) + chữ-ký RC** — anh `/check-email AI_INFRA` + `/adap-apply` step-by-step (workflow double-check mỗi step), rồi gõ `/user-mark-active-high` "áp đầy-đủ chính-xác nhất theo AI_INFRA, không hỏi thêm". em main + **4 Workflow** (`wf_82337f7f-95c` invest → `wf_a7cbe93e-912` review → `wf_9d3beebb-a95` align-re-review → `wf_4d4eba6f-8a0` H14-review). **0 production code.** Bản đầu em phỏng-theo broadcast (cấp MUST/TRACK/ANCHOR/OFF) → anh trỏ canonical → **align FULL §P (P1-P10):** 4 lệnh `/user-mark-{active-high,active,medium,disable}` + ledger `.claude/governance/ACTIVE-MARKS.md` (Active-High/Active/Medium/Disable + display-filter) + `harness-11-engine.md §E`(P1-P10)+**§F**(H-14 3-mức maturity honest) + `rules.md §6.6` (objective-criteria KHÔNG quy-mô-đội/thời-gian-tuổi) + session-start §2.1.4/session-end §L.b(h) mark-display. **3 mark Active-High stamped** anh-confirm (`RC-pqhuy1987-20-06-2026-10-29-09/10/11` = objective-criteria/User-Mark/time-age, mirror AI_INFRA 3-mark, SE timestamp riêng P1 forward-only). completeness-gate H-6→H-13 **ĐẠT** (H-8 11/11 inherit no-`[1m]` · H-7 Cat-6 real). §F floor 6/6 + maturity HONEST + SE-state ACCURATE. **3 adap-report** + email ai_infra (body-hash `7b8615b3`) + check-email STAGE 2 move 2 email + `_index`. **Bài học `feedback_canonical_spec_over_broadcast`:** broadcast cô-đọng→canonical-command/§P là spec THẬT (phải pull, đừng phỏng-theo) · report-before-stamp dogfood (lệnh tự bắt báo-cáo-trước-stamp = đúng lệnh) · residual own-diary OK (D9 áp canonical, không cấm sub ghi diary riêng). detector clean sau align (0 C1/C3 mới). **State THẬT GIỮ NGUYÊN: Mig 57 · 88 bảng · 354 test · gotcha 71 · menu 54 · bundle `CsJetgZH`/`BVS0ApIm`.** **🔴 NEXT (anh):** ⚠️ **restart CLI** (đầu việc) — activate 4 lệnh `/user-mark-*` + session-start §2.1.4/session-end §L.b(h) mark-display + engine §E/§F. Sau restart, session-start tự hiển-thị 3 mark Active-High. **🔴 NEXT (em):** curate L1 over-cap reviewer/cicd/investigator-codebase (carry 7-session + S79 workflow-spawn; inv 39.8KB +diary) — manual SPLIT/condense, archive-gate A7 GATE; + §7-header `rules.md` "77 test" stale → C2/monthly-audit. **Pending product (carry):** "Ngưỡng giá CEO" Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. **Ops S58/S59:** tzutil VPS · anh Chương email typo · 5 real-staff pw · gán CNTT. Chi tiết → `2026-06-20-S79-user-mark-harness-14-adopt.md`. · **Prev S78** — **PE: đính kèm file khi DUYỆT (UAT Tra Sol / 5 tester)** — người duyệt tải file lên ngay lúc Duyệt thay vì Trả lại phiếu. Reuse hệ attachment + enum `ApprovalAttachment=5` **MIGRATION-FREE** (int-stored, endpoint+authz có sẵn → approver upload được). FE 2 app SHA-identical: `PeWorkflowPanel` picker multi-file + upload-trước-chuyển-phase (file lỗi=không duyệt) + mục "📎 File đính kèm khi duyệt" + 2 filter fix loại purpose=5 khỏi "Bảng so sánh" (gotcha **#71** proxy-predicate pollution). commit `7886fd0` → **Run #330 PASS** (test 354, bundle admin `CsJetgZH`/user `BVS0ApIm`, NO migration, smoke 4×200). 3 lỗi em tự bắt review-trước-deploy (authz-verify · filter-pollution #71 · Dialog mirror-truncate fe-admin). em-main-led + self-gate (grep no-leak) + cicd-monitor verify. **🔴 NEXT (em):** curate L1 over-cap (carry 6 session) reviewer **45.2KB** + cicd 38.8KB + inv 35.7KB keep-floor-hit manual-condense (archive-gate A7 GATE PASS 186/186). **NEXT UAT:** mở phiếu chờ duyệt → Duyệt → "+ Chọn file đính kèm" → Xác nhận → file ở mục "📎 File đính kèm khi duyệt". Chi tiết → `2026-06-19-S78-pe-attach-file-on-approve.md`. · **Prev S77** — **PE UX batch: 10 deploy prod-verified #320→#329 (anh Kiệt FDC + Tra Sol + Bích Phượng UAT realtime, HMW-mode ON)** — cờ GẤP pill mọi danh sách+inbox · focus→revert list bám-trái · **Mig 57** ô ghi chú giá đề xuất PRO/CCM + số phân cách VND + chính tả "Bảng so sánh giá" + guard #70 · số âm đỏ-ngoặc · mục con thụt+gạch-đầu-dòng · cờ gấp **BẤT ĐỐI XỨNG** GẮN=NV/GỠ=Trưởng phòng(DeptManager) · tách chọn-phiếu(inline) khỏi mở-rộng(overlay)+nút "Xem mở rộng" · chuông báo người duyệt vào cấp họ · banner phiếu Trả-lại. Mig 56→**57** · test 344→**354** (+10) · bundle cuối admin `BqKD3Y23`/user `Cn-i349D` (Run #329). **3 lỗi em tự bắt review-TRƯỚC-deploy** (guard#70 stale-echo · luật asymmetric Tra Sol clarify giữa-chừng · double-mount Task H). FD process-death Task H → recover-disk. **🔴 NEXT (em):** curate L1 over-cap reviewer **45KB** + cicd 37.6KB + inv 35.6KB keep-floor-hit manual-condense (archive-gate A7 GATE PASS 186/186 integrity OK). **NEXT UAT:** cờ gấp (GỠ chỉ TP) · chuông báo người duyệt · banner Trả-lại · Xem mở rộng · ô ghi chú PRO/CCM. Chi tiết → `2026-06-19-S77-pe-ux-batch-10-deploy.md`. · **Prev S76** — **PE ngân sách MA TRẬN 3 cột (Dự án|PRO|CCM) + bảng lưới `<table>` viền-ô + badge quyền-NS theo role** — anh Kiệt FDC + chị Trà Sol go-live. anh giao `/ultra-on` "step-by-step + workflow-review-per-step, hoàn chỉnh rồi deploy". **3 commit prod-verified:** `e33481e` (feature Run #318 — Mig 56 + ma-trận-3-cột + badge designer/flow `BhFDF9IJ`/`BAkuRl3C`) → `21d1f4e` (bảng lưới `<table>` theo phản hồi anh "chưa chia cột giống Excel", Run #319 **`jOqxW4-p`**/**`DbsznVvR`** smoke 3×200). Mig 56 +ProInitial/ProAdjust cột PRO (additive + data-migrate ProEstimate→ProInitial 4 rows prod). Part 1 mỗi phòng sửa cột mình (PRO canEditPro / CCM canEditCcm / Dự án FE-only). Part 2+3 badge "✎ NS PRO/CCM" cạnh approver (display-only suy-role) ở Designer + flow Duyệt NCC. Test 339→**344**. reviewer bắt **race mất-dữ-liệu** Part 1 → vá `useIsFetching` 2 app (gotcha #70). **🔴 NEXT (em):** curate L1 over-cap reviewer **45KB** + inv-codebase 35KB (keep-floor-hit → manual condense) + cicd 29KB + test-spec 28KB. **NEXT (anh/anh Kiệt):** UAT bảng lưới bằng PRO/CCM (Ctrl+F5). Chi tiết → `2026-06-19-S76-pe-budget-matrix-table-grid.md`. · **Prev S75 (2026-06-18)** — **Harness-11 adopt: engine bộ-nhớ-và-governance tự-bảo-trì + 2 double-check** — anh giao `/check-email AI_INFRA` + `/adap-apply` (mỗi stage workflow-review) + double-check ×2 + finalize report + push + session-end. em main + **5 Workflow** (audit `wf_7fdc3bd5-930` → implement `wf_c5e5844e-7c1` → review `wf_d7ca1ff8-942` → double-check `wf_a0b68d2f-30e` → checklist-verify `wf_39cd4cbe-f07`). **0 production code.** Built 2 NO-API detector-script (`governance-detectors.ps1` C1-C5+B3 runtime **26 flag** bắt drift thật, C4 0-self-match · `memory-archive-gate.ps1` PHẦN A hysteresis/keep-floor/2-strike/A7 186/186) + `docs/governance/harness-11-engine.md` canonical (3-tier D5/D6/D7 + one-direction-lock D8) + **B1 ×11 count→pointer** (drift mig53→55/test306→339/gotcha68→69/table93→88 RESOLVED) + cadence-wire D1/D2 + agents/README. **completeness-gate FORMAL ĐẠT** (B 4/4 + C 5/5 + D 11/11; D5/D6/D7 explicit + D8 codify=YES). gotcha #30 reinforced (box-glyph ├└─ KHÔNG vào .ps1, kể cả qua Edit). 3 commit `e70c046`+`ae957c4`+`aa09e99` pushed + adap-report + email ai_infra (`2316773229f2`). State GIỮ NGUYÊN Mig 55·88 bảng·339 test·gotcha 69·bundle `BYF5vIMJ`/`CB-tiRxd`. **🔴 NEXT (anh):** restart CLI (cadence §2.1.3/§L.b + ef-core skill); curate reviewer 38.8KB+inv 31.5KB+cicd 26.8KB over-cap. Chi tiết → `2026-06-18-S75-harness-11-adopt.md`. · **Prev S74** — **PE ô "Ghi chú từ CCM" ngân sách gói thầu (Mig 55)** — anh forward 2 luồng Zalo (Trà Sol + Kiệt FDC) "CCM giống PRO cho nhập + ghi chú, hiện 0 hết" → em-main BE+Mig55 ∥ implementer-frontend FE 2 app SHA-mirror ∥ test-specialist (chết rate-limit → recover-disk). 2 fork anh chốt: **thêm CcmNote (Mig 55)** + **GIỮ phân vai CCM** (CostControl/Admin). Entity +CcmNote mirror ProNote · UpdatePeBudgetCcmCommand +CcmNote absolute-set role-gate · DTO+controller+mapping · FE dòng "Ghi chú từ CCM" gate canEditCcm. Test 334→**339** (+5). commit `8655ebf` (cicd **Run #315 PASS** — bundle admin `BYF5vIMJ`/user `CB-tiRxd`, Mig 55 applied prod). **"0 hết không nhập" = tài khoản thiếu role CostControl (KHÔNG bug)** → UAT bằng CCM/Admin. **🔴 NEXT (anh/anh Kiệt):** UAT ô CCM bằng tài khoản CCM/Admin + carry "Ngưỡng giá CEO" Mig 54. Chi tiết → session log `2026-06-18-S74-pe-ccm-note.md`. · **Prev S73** — **Mig 54 PE giá đề xuất PRO/CCM + CEO chọn giá chốt + CCM duyệt-done ô-tích (anh Kiệt FDC, go-live thứ Hai 22/06)** — em main + 6 sub + 2 review-workflow, 2 commit prod-verified (`1d86abc` feature Run #313 + `6aa4dcb` FE empty-candidates fix). Mig 54 5-cột additive-nullable + 2 setter role-gate + ApproveV2 ③ AUTO→OPT-IN + ① bind giá chốt; FE 2 app SHA-mirror; test 306→334. **Workflow review:** R1 schema-force 1/4 lane → R2 free-text 2/3 PASS (rủi ro FE empty-candidates UNREACHABLE per submit-guard `:194`). Bài học: review fan-out free-text/hmw KHÔNG ép-schema. **Governance:** em lệch mandate auto-Workflow → cam kết báo-TRƯỚC-khi-lệch. **🔴 NEXT (anh/anh Kiệt):** cấu hình "Ngưỡng giá CEO" Designer + test 3 luồng + xác nhận CCM-trước-CEO. Chi tiết → session log `2026-06-18-S73-pe-gia-de-xuat-ccm-done.md`. · **Prev S72** — **Harness-10 flat-refine + checklist-v2 adopt (re-audit 3-workflow) + sleep NO-OP** — audit `wf_13868efb-ea7` → implement `wf_ac43b5ff-7d1` → review `wf_d482e10d-5dd` (Harness-9 B1+B2). SE BEHIND flat → migrate run-trace SUBFOLDER→FLAT (hmw.js:103 + 5 doc; 5 run cũ giữ subfolder C8) + 2 broadcast 06-18 adopt + `/sleep-recovery-memory-l2` port (A8) + detector TAILORED-OUT + hmw.js H4.5→H8 doc-drift. **REVIEW (B2) bắt 2 lỗi IMPLEMENT-self-assess sót** (hmw.js:52 schema-stale + auto-check overclaim) → fixed (auto-check WIRED thật). em-main containment-check tự bắt reviewer residual-write (raw-Workflow no-writeGuard) → revert. B3 self-correct (runs path/count 14→22). Sleep `all`=NO-OP. **0 prod code, state GIỮ NGUYÊN.** adap-report + email ai_infra (`5f511fe5c0f2`). **🔴 NEXT (anh):** restart CLI (FLAT-runtime hmw.js + wired sleep-check + sleep-recovery skill). **🔴 NEXT (em):** curate investigator-codebase L1 28973 OVER + watch FD/test-spec. Chi tiết → session log `2026-06-18-S72-harness-10-flat-refine.md`. **Prev S71 — Harness-10 adopt: tracked run-trace folder + checklist 9-10** — em main + 3 Workflow (invest `wf_9c2cd2cd-2e7` → implement `wf_e4e46725-231` → review `wf_636bc95b-939`) per mandate Harness-9 PART 2. **0 production code**. Migrate `.claude/workflows/wave-*/` gitignored → `runs/<run-id>/` **git-TRACKED** (run.md+sub-md/+harvest/) + `_ledger.md` 2-nhịp + 3-layer anti-miss (L1 em-main@P1 / L2 session-start orphan-scan / L3 session-end close-gate idempotent) + **containment shift** (Harness-2 B6 "mọi tracked-change=vi-phạm" → "tracked-change NGOÀI run-folder + code-disjoint=vi-phạm"). hmw.js wave→run-trace (accept `args.run` + alias `wave`, path `sub-md/`, `node --check` PARSE-OK). **Review độc-lập (R2+R3) bắt C5 L1 over-claim** (doc nói hmw.js prompt-builder emit L1 reminder, grep engine=0 → engine no-fs → fixed path-a: L1 = em-main @P1 convention) — dogfood mandate B2 đúng. checklist 9-10: Part A (Harness-9 memory) + B (adap 2-workflow) done S70, Part C (Harness-10) 8/8 MỚI. **State GIỮ NGUYÊN: Mig 53·88 bảng·306 test·68 gotcha·menu 54·bundle admin `BgNCjwsG`/user `CBvh0vtf`.** + CLAUDE.md test-flush 263→306 (resolve H1 stale). **🔴 NEXT (anh):** restart CLI (hmw.js RUN-TRACE runtime + carry §2.1.2/Cat-6/H8). Chi tiết → session log `2026-06-18-S71-harness-10-run-trace.md` (pending). **Prev S70 —** **Harness-9 adopt: L2 archive dark-matter recovery + adap 2-workflow mandate** — em main + 3 Workflow (investigate `wf_be952f3c-97f` → implement `wf_a58e0d15-beb` → audit `wf_9520d8cd-4fe`) + 2 monitor bootstrap. **0 production code** (governance/memory only, commit `f36aab8` pushed). 4 over-cap sub-agent curate L1→L2 + `archive/_INDEX.md` (mục-lục substring sha-keyed) + `.gist.md` (4-field distill-gen:1, verbatim FROZEN) → **cả 4 < 25KB auto-inject cap** (P1 curate-debt CLOSED; ~240KB archive hết RAG-dark). PART 2/3 process-mandate codify (adap-apply 2-workflow + agents/README Upgrade S70 + session-start §2.1.2). **0-byte-loss git+sha verified** (Stage C audit + em-main self-gate khi 2 reviewer no-StructuredOutput → recovery-path). +memory-budget.json (seed-by-measure) + measure-agent-memory.ps1 + .ragignore + doc-drift 4-cite flush. adap-report + email-back ai_infra (`7c07b716e775`). **State THẬT GIỮ NGUYÊN: Mig 53 · 88 bảng · 306 test · 68 gotcha · menu 54 · bundle admin `BgNCjwsG`/user `CBvh0vtf`.** **🔴 NEXT (anh):** restart CLI để activate session-start §2.1.2 budget-audit + pending H8 inherit + reviewer Cat-6. Chi tiết → session log `2026-06-17-S70-harness-9-l2-recovery.md`. **Prev S69 —** **Văn phòng số (E-Office) port + golive + PE cờ gấp/ngưỡng CCM — 4 deploy prod-verified Run #305→#308, HMW-mode ON, 2 workflow fan-out**: #305 foundation PURO (shared PageHeader/KpiCard/WidgetCard + Dashboard 2-cột + sync fe-admin index.css đóng drift S66-S68) → #306 **re-skin TRỌN 10 page** (PURO layout + CSS Hồ sơ NS, phẫu-thuật-giữ-100%-logic) → #307 **Office golive public** read+create **16-key allow-list mọi role** (mirror S65, chạy SAU revoke; excluded Off_PhongHop_Manage/Off_AttendanceReport/Off_ChamCong; cicd DB-verify 16/16×13 role) → #308 **PE cờ gấp PRO/CCM + CCM duyệt-final theo ngưỡng giá trị** Mig 53 (anh Kiệt FDC sau họp sếp). **State THẬT: Mig 53 · 88 bảng · 306 test (45D+261I) · 68 gotcha · menu 54 · bundle admin `BgNCjwsG`/user `CBvh0vtf` Run #308.** 2 gotcha NEW (**#67** Tailwind accent palette thiếu-stop vỡ-màu-im-lặng · **#68** stale-diagnostic-background-agent → chỉ tin build sau-cùng). 2 truncation #53 (impl-backend positional-record + impl-frontend) → em main recover-disk + self-gate. **🔴 NEXT (anh/anh Kiệt UAT):** (1) cấu hình "Ngưỡng giá trị gói CEO" trong Workflow Designer (null=luồng cũ) + test phiếu < ngưỡng → CCM duyệt là xong, ≥ ngưỡng → lên CEO; (2) test cờ gấp PRO(đỏ)/CCM(xanh) → badge + notify CEO; (3) **xác nhận:** quy trình đặt CCM(CostControl)-trước-CEO + CEO = role Director (đích notify). **C (sau duyệt → chuyển phiếu đến dự án) chờ anh Kiệt spec form.** **NEXT (em):** 🔴 curate cicd-monitor **65.2KB** (worst, trend tăng) + inv-codebase 47 + reviewer 43.5 over-cap · doc-flush docs/CLAUDE.md full. Chi tiết → session log `2026-06-17-S69-vanphong-golive-pe-urgent-threshold.md`. **Prev S68 —** **Hồ sơ NS header chi tiết NV: làm nổi bật + fix tên render đen→trắng** — em main solo, 3 commit (2 FE + 1 docs), 2 deploy prod-verified Run #303-304 (anh UAT realtime): badge màu theo trạng thái + dòng meta đậm + tên to/drop-shadow (#303 `6983609`) → anh báo "tên đen nền xanh ko nổi bật" → diagnose **rule `h1-h4{color:#0b1220}` viết NGOÀI `@layer` thắng `text-white`** (Tailwind v4 unlayered > all layers, **gotcha #66 NEW**, load-bearing ~30+ heading → fix ĐIỂM `text-white!` không move @layer) + thu nhỏ `text-lg` (#304 `37752eb`). Bootstrap: 2 monitor RE-REPORT CLEAN + 2 doc-drift fix (dep-audit 64→65 · root CLAUDE 263→286, `11bc96d`). **State THẬT: Mig 52 · 88 bảng · 286 test · 66 gotcha · menu 53 · bundle admin `CNUv1jxY`/user `CpOskeS1` Run #304.** ⚠️ curate-debt P1: cicd-monitor **44.1KB**. Chi tiết → session log `2026-06-16-S68-hoso-header-name-color-fix.md`. **Prev S67 —** **buổi sản phẩm LỚN, 6 deploy prod-verified Run #297→#302** (anh + anh Kiệt FDC UAT realtime, HMW-mode ON): fe-user Hồ sơ NS đồng nhất font + chữ đen→**xanh đậm `brand-800`** (#297) · **fe-admin mirror master-detail** + vá accent tokens index.css [đóng pending lớn nhất HRM go-live, page SHA256 ×2] (#298) · **+23 test-after HRM** → 263→**286** (#299) · **list flex-row gọn** [hết tràn ngang rail] + đồng nhất cỡ chữ ×2 (#300) · **PE Link hồ sơ auto-detect** web→hyperlink/`O:\`→Copy (#301) → **link `file://` bấm-thử** (#302). **Research 3-agent:** auto-mở `O:\` từ web = chỉ **Edge GPO `IntranetFileLinksEnabled`** (zero-per-machine) one-click thật; default chặn https→file://. **State THẬT: Mig 52 · 88 bảng · 286 test (45D+241I) · 65 gotcha · menu 53 · bundle admin `CcrZqfht`/user `DniDFUB_` Run #302.** test-specialist trunc #53→recover-disk; 0 prod bug. Chi tiết → session log `2026-06-16-S67-hoso-visual-pe-link-research.md`. **Prev S66 — session-end closeout em-main-solo:** adopt **Harness-8 all-inherit** (7 sub demoted `claude-opus-4-8`→`inherit` → cả 11=inherit, gỡ two-tier H4) + **cicd-monitor L1 curate 86.8→28.9KB** (byte-exact sed → `archive/2026-06.md`) + **ef-core skill doc-flush Mig 50→52** + check-email AI_INFRA (**0 thư mới se-directed**). ~17 file docs/gov/config, **0 production code** → state THẬT GIỮ NGUYÊN (Mig 52 · 88 bảng · 263 test · 65 gotcha · menu 53 · bundle `BDwV5d0X`/`DbVv6rsf`). ⚠️ **Restart CLI** → H8 runtime (frontmatter no hot-reload) + reviewer Cat-6. adap-report + email-back ai_infra (`fa7f690d` MATCH). Chi tiết → session log `2026-06-16-S66-closeout-harness8-cicd-curate.md`. **Prev S65 — HRM go-live: public Hồ sơ Nhân sự + trang master-detail giống NamGroup + Department hierarchy Mig 51 + PE Link hồ sơ Mig 52 + gốc cây SOLUTION COMPANY**, ~6 deploy prod-verified Run #289→#295, anh + anh Kiệt FDC UAT realtime. **State THẬT: Mig 52 · 88 bảng · 263 test (45D+218I) · 65 gotcha · menu 53 · bundle admin `BDwV5d0X`/user `DbVv6rsf` Run #295.** Workflow fan-out chạy THẬT lần đầu [PE] — BE∥FE parallel OK nhưng FE+reviewer return-rỗng #53 → em main recover-disk + self-gate. gotcha #65 [build csproj con ≠ slnx → CS7036]. Chi tiết → session log `2026-06-16-S65-hrm-golive-employee-masterdetail-pe-link.md`. **Prev S64** adopt **Harness-7 writing-quality floor** qua `/adap-apply` + email ai_infra — em main solo, 1 commit `6afde19` docs/gov-only. Outward comms = tiếng Việt câu-hoàn-chỉnh; nội bộ giữ nén (asymmetric). reviewer +Category 6 (verified-pending-restart → cần restart CLI). Broadcast body-hash verified KHÔNG mis-stamp (gotcha #61 UTF-8). Prev S63 docs-closeout bù S60/S61/S62 — 3 session product ship CODE prod-verified nhưng KHÔNG closeout docs (UAT realtime anh Kiệt FDC). **State THẬT: Mig 50 · 88 bảng · 263 test · 64 gotcha · menu 53 · bundle admin `0xKYGhhf`/user `C81ZdG9G` Run #286.** S60-62 = PE ràng buộc gửi-duyệt + gỡ "Từ chối" (S60) · Mig 50 ngân sách per-gói-thầu Excel anh Kiệt + XÓA module Budget cũ (S61) · vượt-NS cảnh-báo-mềm (S62). Reconcile stray reviewer cwd-misland + count-flush 4 file. Chi tiết → session log `2026-06-12-S60-S62-pe-budget-workitem-softwarning.md`. Prev Session 59 ( **6 đợt ship prod-verified Run #273→#278**: wipe transactional testing data (10 PE + 7 HĐ demo + 64 notif = 0, mã reset → phiếu thật đầu tiên team tạo = **PE/2026/A/001** ✓) `56882ac` #273 · PE tree Panel 1 chốt 4 tầng **Năm > Dự án > Hạng mục > Phiếu** `0eafcd3` #274 · dọn 15 mã hạng mục demo "tự đẻ" (chị Trà Sol) + gỡ seed gốc, WorkItems 86→**71** `bbd1554` #275 · **rename 71 mã đúng format PMH anh Kiệt** (`MAT-n`/`SUB-n`/`MEP-SUB-n`/`MEP-EQU-n` + tên "STT nhóm tên"; **DB-trước-code-sau** gotcha #62 + sqlcmd `-f 65001` gotcha #61) `c869d26` #276 · UAT vòng 1: NEW `ui/SearchableSelect` gõ-lọc bỏ dấu (Hạng mục/Dự án) + auto Địa điểm + điều khoản đa dòng `faed59f` #277 · UAT vòng 2 (anh chốt ×2): ẩn Trả lại/Từ chối khi tự duyệt phiếu mình soạn + quick-add NCC ngay form (POST /suppliers any-auth, authz probe 4/4) + NCC gõ-tìm A-Z + upload multi-file `9c330d2` #278 · UAT vòng 3-6 realtime (#279/#281 cancelled-supersede-benign): bảng NCC table-fixed `f21c55d` + bỏ ô Tên ngân sách `69997da` #280 + GỠ field Điều khoản TT mọi form `80b64dd` + bỏ nút Thêm hạng mục `792c030` **#282 FINAL**. Tổng 10 đợt (8 PASS + 2 cancelled-benign). Bundle FINAL admin **`B1DtNT9C`**/user **`D6uF3Mln`**. Test 240. Gotchas 62. 0/14 spawn truncated. → session log `2026-06-11-S59-wipe-tree-pmh-uat-batch.md`. Prev S58 — **5 đợt prod-verified Run #382/#383/#384/#386** (#385 cancelled-supersede-benign): lock-demo-user fix (việc sếp deadline 15:00 ĐÓNG TRỌN — gotcha #60/E-008/AS-12, root cause password 11<12 từng phát hiện S22 nhưng const không fix) + tạm ẩn HRM/Office/Cá nhân + Danh mục cuối (`6c5fd26` #383) + **fe-user redesign theo UI/UX guide AI_INFRA giữ brand** (`e959f72` #384) + **brand polish ×2 app "thấy rõ"** (`ea793a4`: stripe 4px đỉnh + thead brand) + **PE gộp Tên-gói-thầu = chọn Hạng-mục** (anh Kiệt FDC chốt, `3ebaf84` #386 — bundle final admin `DMm9rtNA`/user `BUkOMn_Y`). Email AI_INFRA processed (guide + ACK H4 ACCEPT). Test **240**. → session log `2026-06-11-S58-lock-fix-hide-modules-redesign-pe-merge.md`. Root cause 2 tầng: lock-list = population Dev-only + `DemoUserPassword` 11 ký tự < prod RequiredLength=12 → CreateAsync silent-fail từ trước tới giờ (= "helpdesk inert" S56). Fix union 20 UAT email + password 12 ký tự → prod 55 user/34 locked, nv.cao+nv.truong sống, 5 real staff tạo. gotcha #59+#60. Commit `5998163`. Prev S57bis — **PE gắn Hạng mục (Mig 49) + Pe all-role + menu Cá nhân + Harness-4 runtime-VERIFIED**. Test 228→**240**. Bundle `CP4CB1ym`/`BmZ3VHnm`. Commit `17b23a4`+`dd117b7` → Run #381 PASS+1PARTIAL (lock NO-OP → RESOLVED S58). Prev S56 — **Pre-golive verify sweep + golive-harden 4 fix — Run #379 PASS, code golive-ready**. WF1 `pre-golive-verify` 7-stream + adversarial → 6 PASS/1 CONCERN/0 blocker = GO (key finds = ops not code). WF2 `golive-harden` fix 4: #3 LeaveBalance lost-update→atomic ExecuteUpdate+Serializable tx (NO mig) · #5 ItTicket authz Forbidden-trước-NotFound · #6 DocxRenderer null-guard · #4 Travel/Vehicle ApproveV2 tests. Test 216→**228**. Bundle FROZEN `4SUwDLD8`/`XdKzt9LL`. `sys.tables` re-ground 92→**93**. gotcha **#58** NEW. reviewer StructuredOutput-fail→em main đỡ. **2 ops VPS pending** (gán user IT + tzutil UTC+7). FE Phase 2 redesign **deferred** (recon ready). Commit `a20cde8`. Prev S55 — **Nạp master data thật từ Excel (62 dự án + 71 hạng mục + 3 NCC) + Project +4 cột (Mig 48) — prod-verified**. HMW-mode ON. Commit `69cb393` → Run #377 PASS ~4m33s. Test 216 (compile-fix only). Bundle admin `B-d6893W`/user `XdKzt9LL`. `SeedRealMasterDataAsync` ungated idempotent → coexist demo. 2 agent return truncated (BE+reviewer) → em main disk/runtime-recover. Prev S54 — IT staff tự reassign ticket (cross-stack authz) — prod-verified. 1 code commit `ca4b602` → Run #376 PASS ~4m18s. Test 203→**216**. Bundle admin `DfCfHUE9`→`DmjI8Cmn`/user `_3S0BPJ2`→`YxL_MljK` (cả 2 rotate). NO migration. Task 1 Phase 9 Ops anh dừng. ⚠️ residual: 3 agent ghi MEMORY nhầm `src/Backend/.claude` → em main reconcile. Prev S53: gotcha #57 EXT Master Mig 47 + P11-D/E + database-agent verified-runtime.)


---

## HANDOFF structured-sections (S84 -> cũ) — cắt trọn từ `docs/HANDOFF.md` (line 7+)

---

## S84 (2026-06-22) — Session-start hot-feed cap flush v3 + commit S83 cicd harvest-orphan (LIGHT, 0 production code)

**Anh:** `/session-start` → (sau report) `session-start.md:114` flush → **"Sao ko add vào session-start luôn?"** → **"Làm cho xong đi rồi session-end luôn nhé."**

**Done:** (1) flush §2.1.6 cap-echo `60/20/16`→**`220/60/50`** + canonical-pointer `"đọc số sống ở budget.json"` chống tái-drift (detector C2 KHÔNG track cap-number → echo-trần lệch âm-thầm); (2) commit `cicd-monitor/MEMORY.md` = harvest S83 hợp-lệ sót-closeout (Run #333 + gotcha **#69-REFINE**: bundle hash giữ-nguyên khi 0 `fe-*/src` đổi → ship-proof = `Last-Modified` in-window). **Lesson `feedback_derived_flush_execution`:** monitor INFORM-only proposal về derived→canonical flush = em-main EXECUTION (verify-rồi-LÀM), KHÔNG gate user-confirm; chỉ ĐỔI-con-số = quyền anh.

**§L closeout:** §L.a 0 RCA · §L.b(c) archive-gate A7 GATE PASS 217/217, FD 26.1KB+test-spec 27.7KB WATCH strike-1 (no-action), sleep-check 4d<7 skip · §L.b(d) 2 monitor spawn-record verified · §L.b(g) H1 new-alloc none, carry stale-cite deferred-monthly · §L.b(h) User-Mark n-a (chỉ hiển-thị 4 Active-High; 0 governance-decision mới).

**🔴 NEXT:** **Anh:** ⚠️ restart CLI (command `.md` no hot-reload → %-print runtime ăn cap đúng 220/60/50). **Em (carry):** FD/test-spec WATCH strike-1 · **monthly 2026-07-01** (ef-core SKILL Mig→57 · skills/README Mig→57 · docs/CLAUDE Budget-module-removed · STATUS/HANDOFF re-tier · 3 vocab-fork alias-map · #69-REFINE fold gotcha canonical). **Pending product:** Ngưỡng giá CEO (Mig 54) Designer UAT · "C" chuyển phiếu→dự án chờ spec · FE proactive guard (disable submit null-workflow) offered chờ anh. **Ops S58/S59:** tzutil VPS UTC+7 · email typo anh Chương · 5 real-staff pw · gán CNTT.

**State GIỮ NGUYÊN:** Mig 57 · 88 bảng · 356 test · gotcha 71 · menu 54 · bundle admin `CsJetgZH`/user `BVS0ApIm` (Run #333).

---

## S83 (2026-06-22) — H-15 v3 memory-budget full-parity + PE require-workflow guard (2 commit prod-verified)

**Anh:** `/session-start` → directive ngân-sách "Giờ là 220k, đầu phiên nạp thêm cho đủ" + sub 60K/wf 50K + "tao đánh dấu User-mark" → screenshot PE/2026/A/040 "Sao cái này lại là quy trình cũ?" → (tự-khỏi) "do cache?" → **"(B) vá guard BE + test-before → deploy. Rồi Session-end."**

**Part 1 — H-15 v3 (commit `2c7fd63`, docs-only):** `memory-budget.json` lead 200K→**220K**/mem-sub 20K→**60K**/wf-sub 16K→**50K** full AI_INFRA parity (sửa self-shrink S82 = AI tự-co-nhỏ, vi-phạm `role_boundary_note` + mark `RC-…01-58-01`) + NEW **`spawn_fill_directive`** (khi SPAWN → nạp sub tới budget bằng prompt GIÀU: relevant gotcha + state + full task-context + docs/memory; byte-cap MEMORY.md = 1 lát, prompt nạp phần còn lại) + engine **§G.5** + agents/README retire `≤8K brief` + ACTIVE-MARKS H-15 **v3-delta** `RC-pqhuy1987-22-06-2026-16-35-37`. detector 26 baseline · A7 217/217.

**Part 2 — PE require-workflow fix (commit `fc1f19d`, Run #333 PASS):** validator `NotEmpty(ApprovalWorkflowId)` + submit-guard (SAU Section-3, TRƯỚC mutate phase). **Diagnose:** banner "quy trình cũ" ⟺ `approvalFlow` rỗng ⟺ `ApprovalWorkflowId` null → kẹt nhánh V1-legacy. Root = validate FE-only (FE canSubmit bắt buộc, BE chỉ validate-nếu-có-truyền). **A/040 tự-khỏi-reload ⟹ cache** (data-hỏng reload không khỏi). **Bài học triage:** full-suite bắt 9 đỏ → 2 genuine-spec-conflict (V1-submit deprecated, data wipe S59) rewrite + 6 collateral (dời guard sau Section-3 giữ nguyên) + 1 validator. Test 354→**356**. **#69-REFINE:** bundle hash KHÔNG rotate khi 0 fe-src change (Vite deterministic same-hash) — ship-signal THẬT = Last-Modified in-window; `deploy.yml` rebuild-FE-unconditional nhưng output byte-identical (canonical #69 fold refinement defer monthly).

**🔴 NEXT SESSION:**
- **Anh:** ⚠️ **restart CLI** — activate budget `token_governor` v3 (220/60/50) + `spawn_fill_directive` (config JSON sống ngay; engine/command `.md` no hot-reload).
- **Em (carry):** frontend-designer 26.1KB + test-specialist 27.7KB WATCH strike-1 (<2, no-action). **Monthly audit 2026-07-01:** fold #69-REFINE vào gotcha canonical · ef-core SKILL Mig56→57 + skills/README #69→#71 stale-cite · STATUS/HANDOFF re-tier (bloat).
- **Pending product:** "Ngưỡng giá CEO" Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. **FE proactive guard** (disable submit nút cho phiếu null-workflow) = offered, chờ anh.
- **Ops S58/S59:** tzutil VPS UTC+7 · anh Chương email typo · 5 real-staff pw · gán CNTT.
- **Phiếu A/040 kẹt:** Trả lại → Sửa → chọn Quy trình duyệt → gửi lại.

---

## S82 (2026-06-21) — Adopt Harness-15-v2 (Tầng-1 hot-feed-lớn + L2/L3 bỏ-trần + %-print + ranh-giới vai-trò, 0 production code)

**Anh:** `/check-email AI_INFRA và /adap-apply all step by step cẩn thận nhé.` → "OK duyệt, commit push sau đó /session-end".

**STAGE 1 (check-email):** 1 thư MỚI `2026-06-20-ai_infra-to-se-harness-15-v2-notify` (verify ✓✓ whole-file `0b92b3ed` + body `2e609781`) → copy inbox → STAGE 2 move `inbox/ai_infra/` + `_index` processed.

**Fan-out diff (`/adap-apply all`):** AI_INFRA 29 broadcast vs 22 adap-report → **CHỈ H15-v2 MỚI**. 7 không-khớp verify từng cái = đã-phủ: checklist-11 (S75) · checklist-9-10-v2 + h10-flat-detector-refine (S72) · checklist-all (S63-S79) · harness-all-update-v-2-0 (PLAN-ANNOUNCE n-a S79) · checklist-14 + harness-14-adopt (= source `harness-14.md` S79).

**IMPLEMENT (em-main single-writer D9, 6 edit):**
- `memory-budget.json:token_governor` — L1 12K → **per-role hot-feed** (lead 60K/sub 20K/wf 16K, tự-đo KHÔNG mượn 220/60/50) · L2/L3 6K/4K → **NO-CAP** on-demand · +`role_boundary_note` +`pct_print` +`honest_caveat`.
- `harness-11-engine.md §G.4` (4 delta) + §G.1-line + bảng row + adopt-note S82.
- `session-start.md §2.1.6` + `session-end.md §L.b(c)` — %-print 2 đầu-phiên.
- `ACTIVE-MARKS.md` mark H-15 What-cell refine + volume "~42K"→per-role + status v2-delta confirm.

**REVIEW (Workflow `wf_04667b25-5fa`, 3 free-text lane):** floor-completeness · faithfulness · honesty-regression = **3/3 PASS** ("genuine PASS not courtesy"). Bắt **3 MINOR → fixed**: (1) volume "~42K" stale · (2) mark status "(anh-confirm S81)" mang nội-dung S82 → flag pending-confirm · (3) `_index` pending → STAGE-2 move.

**Ranh-giới vai-trò (điểm governance đáng-chú-ý):** v2 §6 buộc sửa framing S81 "lead-authority" — gộp nhầm AI-lead với chủ-dự-án. Đúng: con-số = **quyền anh (chủ-dự-án)**, em-main thực-thi-đúng-số + báo-% (KHÔNG tự-tinh-chỉnh). Cùng họ mark `RC-…09` (AI = neo-lý-tính, anh quyết). **Phát-hiện-riêng (email AI_INFRA):** byte-governor (MEMORY.md cap 30720B) là ràng-buộc cứng cho sub → Tầng-1 sub tự-giới-hạn dưới 60K AI_INFRA = "kiến-trúc sàn, con-số tự-do theo scale".

**Verify:** JSON valid · detector 26-flag baseline (0 new drift) · engine §G.1-G.3 byte-intact. commit `aa3f0fe` push (docs-only CI-skip) + email AI_INFRA `a749bb6bd1be`. mark H-15 **v2-delta anh-confirm** `RC-pqhuy1987-21-06-2026-01-58-01`.

**📊 Hot-feed %-print CUỐI phiên (H15-v2 §L.b(c) — lần đầu chạy):** Tầng-1 lead phiên S82 (cap ~60K) ước-lượng composition: WIP work-state ~30% (adap H15-v2 + closeout) · lỗi-lặp/gotcha ~15% (#70/#71/#53/#64 PE) · tồn-đọng ~15% (curate WATCH · monthly-audit) · quyết-định-chờ ~20% (Ngưỡng giá CEO · C-form · ops S58/S59 · 4 mark) · governance-canonical ~20% (engine/marks/budget nạp đầu phiên). **Headroom ~ thấp** — phiên đốt nhiều cho adap + closeout, nạp-đầy đúng nội-dung-công-việc (KHÔNG nhồi-rác). *(Ước-lượng-tỉ-lệ, con-số = quyền anh chỉnh.)*

**🔴 NEXT SESSION:**
- **Anh:** ⚠️ **restart CLI** — activate `session-start §2.1.6` + `session-end §L.b(c)` %-print runtime (command `.md` no hot-reload). Config JSON đã sống ngay.
- **Em (carry):** frontend-designer 26.1KB + test-specialist 27.7KB WATCH (A6 strike-1<2, no-action — curate khi qua soft-cap 30.7KB). **2 stale-cite (H1 flag @start):** `ef-core-migration/SKILL.md:3,19` "Mig 56"→57 · `skills/README.md:90` gotcha "#69"→#71 (low-urgency, defer monthly 2026-07-01). **Monthly audit 2026-07-01:** STATUS/HANDOFF re-tier · docs/CLAUDE count-flush · 3 vocab-fork alias-map · schema-diagram §16+ Mig 32-57.
- **Pending product (carry):** "Ngưỡng giá CEO" Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec form.
- **Ops S58/S59 (carry):** tzutil VPS UTC+7 · anh Chương email typo · 5 real-staff pw · gán CNTT.

---

## S81 (2026-06-20) — Adopt Harness-15 memory-budget per-agent (token-governor + value-gate + work-state block, 0 production code)

**Anh:** `/check-email AI_INFRA và /adap-apply step by step cẩn thận từng bước, review sau lẫn imple, report trung thực.`

**STAGE 1 (check-email):** 0 new directed (outbox/se 4 file đều processed S79). **Fan-out diff:** AI_INFRA outbox/all 28 vs 21 adap-report → unambiguous-new = **H15 memory-budget** + checklist-15. H14/v2.0(plan-announce N/A)/checklist-9-10-v2/11 đã phủ S72/S75/S79 (verify-not-redo: H14 §F floor 6/6 confirm sẵn trong engine).

**IMPLEMENT (em-main single-writer D9, 8/8 🔴 floor):**
- `memory-budget.json`: +`harness_floor` (A1 21K→30K cap-riêng-SE) + `token_governor` (A2/A3/B(a)/B(e) L1 12K/L2 6K/L3 4K) + `archive_gate.value_protect` (B(b) 10-pattern) + refresh stale `measured` block S71→S81.
- `harness-11-engine.md §G` (canonical record 8 floor + honest mechanized-vs-convention) · `session-start §2.1.5` (B(c) work-state block 4 thành-phần) · `rules §6.6` (B(b) value-gate cross-ref) · `memory-archive-gate.ps1` (B(b) value-protect **FLAG** advisory pure-ASCII, runtime-fired test-specialist gotcha#/guard).
- B(d) verified KHÔNG redo (persona + MEMORY auto-inject + `hmw.js:124` MEMORY-PACK đã có).

**REVIEW (Workflow `wf_b7f3c8ac-b53`, 3 free-text lane):** Part-A PASS · Part-B PASS · Honesty HONEST. Bắt **2 CONCERN** → **fixed** (review→fix loop): (1) anchoring "matches AI_INFRA" → reframe SE-ước-riêng-trùng-vì-cùng-toolset · (2) attribution sai `measure-agent-memory.ps1` → sửa "persona đo TRỰC-TIẾP `Get-ChildItem`". **Bài học:** independent review bắt honesty-imprecision self-review ship (số-trông-mượn + tool-cite-lỏng); stale-config (`measured` S71) đánh-lừa cả reviewer ("no sub over cap").

**Verify:** A7 GATE PASS 217/217 (integrity post-edit) · detector 26-flag baseline (0 new drift) · budget.json JSON valid · gate value-protect FLAG runtime-proven.

**🔴 NEXT SESSION:**
- **Anh:** ⚠️ **restart CLI** (activate session-start §2.1.5 work-state block runtime). **✅ mark H-15 stamped Active-High** (`RC-pqhuy1987-20-06-2026-23-07-37`, anh-confirm S81 → `ACTIVE-MARKS.md`).
- **Em (carry):** frontend-designer 26.1KB + test-specialist 27.7KB WATCH strike-1 (cả 2 OVER autoinject-cap 25600 dưới soft-cap 30720; test-specialist có value-protect-FLAG → khi curate GIỮ gotcha#/guard L1). **Monthly audit 2026-07-01:** STATUS/HANDOFF re-tier · docs/CLAUDE count-flush · ef-core SKILL stale-count · 3 vocab-fork alias-map · `rules §7-header "77 test"` + `session-start §2.6 "130 PASS"` stale (C2-detector).
- **Pending product (carry):** "Ngưỡng giá CEO" Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec form.
- **Ops S58/S59 (carry):** tzutil VPS UTC+7 · anh Chương email typo · 5 real-staff pw · gán CNTT.

---

## S80 (2026-06-20) — Curate L1 over-cap memory → L2 archive (em-main single-writer, 0 production code)

**Anh:** `/session-start` → bootstrap clean → **"check làm thử đi"** (curate) + *"tao restart xong rồi mà?"* (đúng — 4 lệnh `/user-mark-*` đã hot-load; note "restart CLI" của em = carry-stale từ HANDOFF S79).

**Done (9 agent-memory file, 0 production code, docs-only commit → CI skip):**
- `memory-archive-gate.ps1` DRY-RUN: reviewer 45.2 · investigator-codebase 39.8 · cicd-monitor 38.8 KB = cả 3 **keep-floor-hit cannot-auto-drain** (newest-5 = bulk) → manual condense-with-archive.
- Move byte-exact (`sed`) **31 entries** (reviewer 13 war-story · inv 15 recon · cicd 3 huge run-record) → `archive/2026-06.md` mỗi sub (**+N −0** additive, `git numstat` verified 0 byte-loss) + **31 `_INDEX` substring pointer** → **A7 GATE PASS 217/217**.
- L1 sau: reviewer **10.2** · inv-codebase **10.3** · cicd-monitor **12.2** KB (đều <25.6KB autoinject cap).
- UPDATED stale foundation counts trong 3 sub (130/263→**354** test · 55→**71** gotcha · Mig 40/55→**57** · 84→**88** table · bundle→#330) — đóng drift C2-detector sẽ bắt.

**Lesson NEW (`feedback_harness11_engine`):** `_INDEX` substring pointer **MUST quote-free** — A7 gate quote-parser cắt tại `"` đầu → escaped-quote pointer (`NamGroup \"PURO\"`) FAIL resolve dù self-grep literal match (A7 FAIL 1 → fix `PURO = UI design-language/skin`). Gate độc-lập bắt cái self-grep giấu.

**§L spawn-record (2 monitor @start, INFORM-only):** 🟫 tooling-auditor (H1) = 4-mặt freshness ALL-PASS 0-drift (roster 11/11 inherit no-`[1m]` · plugin 18/15/3 · S79 artifacts present+wired) · ⬜ harvest-curator (H2) = 0 orphan/0 un-appended/0 integrity-issue (S79 4-workflow = mode-A no-run-folder benign · harvest committed `33d519e`). Cả 2 nấc=verified (disk-evidence).

**🔴 NEXT SESSION:**
- **Em (carry):** frontend-designer 26.1KB + test-specialist 27.7KB WATCH (A6 strike-1<2, no-action — curate khi qua soft-cap 30.7KB hoặc strike-2). **Monthly audit 2026-07-01:** STATUS/HANDOFF re-tier (history bloat S65↓ → session logs) · docs/CLAUDE deep-doc count-flush (Mig→57·test→354·gotcha→71) + schema-diagram §16+ Mig 32-57 ERD · ef-core SKILL stale-count + 3 vocab-fork (wave/run-trace · Dự-trù/Ngân-sách PRO · two-tier/all-inherit) alias-map · `rules.md §7-header` "77 test" stale (C2-detector).
- **Pending product (carry):** "Ngưỡng giá CEO" Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec form.
- **Ops S58/S59 (carry):** tzutil VPS UTC+7 · anh Chương email typo · 5 real-staff pw · gán CNTT.

---

## S78 (2026-06-19) — PE: đính kèm file khi DUYỆT (UAT Tra Sol / 5 tester)

**Anh:** forward chat Zalo (Tra Sol + team — "5 tester đang testing kaka") — *"chỗ duyệt thêm một trường cho đính kèm file… để khi họ duyệt mà muốn đính kèm file của mình lên vì có trường hợp thay đổi ko muốn trả lại"* → *"OK public và push luôn đi nhé"* → `/session-end`.

**Done (commit `7886fd0`, 7 file +313/−14, Run #330 PASS ~4m56s):**
- **BE:** enum `PurchaseEvaluationAttachmentPurpose.ApprovalAttachment=5` — **MIGRATION-FREE** (int-stored). Reuse endpoint `POST {id}/attachments` (đã nhận `purpose`+`note`, controller `[Authorize]` + handler không guard drafter-only → approver upload được). GET bundle KHÔNG lọc purpose → file purpose=5 tới FE. Test **354** unchanged.
- **FE 2 app SHA-identical:** `PeWorkflowPanel` (picker multi-file + upload-TRƯỚC-`/transitions` + mục "📎 File đính kèm khi duyệt" download/preview) · `PeDetailTabs` (2 filter fix loại purpose=5) · `types` (enum + label "File khi duyệt").
- **gotcha #71 NEW:** 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 → file-khi-duyệt lẫn "Bảng so sánh" + false-pass submit-guard. Fix: loại purpose=5 ở 2 filter.
- **Bundle:** admin `BqKD3Y23→CsJetgZH` / user `Cn-i349D→BVS0ApIm` (rotate dù no migration — enum-only #69). Smoke 4×200 + attachments 401-wired.

**Cách chạy:** em-main-led + self-gate (HMW-mode ON nhưng tight-coupling modal + go-live → `feedback_workflow_fanout_reliability`: em-main ≈ fan-out, tránh #53; reviewer over-cap → grep no-leak thay vai). 1 sub = cicd-monitor (Run #330 verify). **3 lỗi em tự bắt review-trước-deploy:** authz-verify handler (no 403) · filter-pollution #71 · Dialog mirror-truncate fe-admin (build-verify TỪNG app bắt — không tin "mirror identical").

**🔴 NEXT SESSION:**
- **Em (carry GẤP 6 session S72→S78):** curate L1 over-cap — reviewer **45.2KB** + cicd-monitor **38.8KB** + inv-codebase **35.7KB** = keep-floor-hit (manual SPLIT/condense, KHÔNG auto-drain; archive-gate `memory-archive-gate.ps1` A7 GATE PASS 186/186 — integrity OK, chỉ L1-hot truncate-on-inject) + FD 26.1KB/test-spec 27.7KB WATCH strike-1. Làm như op tập-trung (precedent S70/S71).
- **UAT (anh/Tra Sol/5 tester, Ctrl+F5 lấy `CsJetgZH`/`BVS0ApIm`):** phiếu chờ duyệt → ✓ Duyệt → "+ Chọn file đính kèm" (multi) → Xác nhận → file ở mục "📎 File đính kèm khi duyệt" (download/preview). Chỉ hiện ở hành động Duyệt.
- **Pending product (carry):** "Ngưỡng giá CEO" Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec form.
- **Ops giữ S58/S59:** tzutil VPS UTC+7 · anh Chương email typo · 5 real-staff pw `User@1234567` · gán CNTT. **Monthly audit 2026-07-01:** STATUS/HANDOFF re-tier · docs/CLAUDE deep-doc count-flush (Mig→57, test→354, gotcha→71) + schema-diagram §16+ Mig 32-57 ERD.

---

## S77 (2026-06-19) — PE UX batch: 10 deploy prod-verified (anh Kiệt FDC + Tra Sol + Bích Phượng UAT realtime)

**Anh:** forward liên-tục chat Zalo (anh Kiệt FDC + Tra Sol + Bích Phượng) — loạt tinh-chỉnh PE realtime, HMW-mode ON; cuối buổi "Xong thì session-end luôn".

**Done (10 deploy #320→#329, 10/10 cicd PASS):**
- **#320** `8e68ed1` cờ GẤP **pill** 🔴 GẤP (PRO) / 🟢 GẤP (CCM) đồng bộ MỌI danh sách + inbox (NEW `PeUrgentChips` ×2 app — data đã có từ S69, chỉ chưa render ở `PeListPanel`/inbox).
- **#321** `398b01d` **focus mode** bấm phiếu → overlay trượt phải ẩn menu → **#322** `3b98845` **revert** list về layout gốc bám-trái lấp-đầy (anh: "giữ như cũ, không canh giữa").
- **#323** `94e0e12` **Mig 57** `AddPeSuggestedPriceNotes` (2 cột ghi chú giá đề xuất PRO/CCM) + **số phân cách VND** (`VndInlineEdit`+`BudgetCell`) + sửa chính tả "Bản"→"Bảng so sánh giá" + **guard #70** (em-main review bắt impl-FE sót `peFetching` echo-guard).
- **#324** `e42d103` số âm → **đỏ + ngoặc** `(5.000.000)` hàng 7/8/9 (Tra Sol).
- **#325** `e29391e` mục con **thụt dòng + gạch đầu dòng** (`BudgetRow +indent`) phân biệt có-số/không-số (Tra Sol annotate đỏ).
- **#326** `b5aa72d` cờ gấp authz **BẤT ĐỐI XỨNG**: GẮN = NV chức năng (ai làm nấy gắn) / GỠ = chỉ **Trưởng phòng** (`DeptManager` + role chức năng) hoặc Admin — tránh NV khác lỡ tay gỡ (Tra Sol clarify GIỮA-CHỪNG → em REDO test symmetric→asymmetric).
- **#327** `fa6654b` **tách chọn-phiếu (inline 3-panel "như cũ") khỏi mở-rộng (overlay)** + nút **"Xem mở rộng"** (`Maximize2`) mỗi dòng (`?expand=1` decouple `?id`); em-main review thêm `!isExpand` guard tránh double-mount.
- **#328** `424131d` **chuông báo người duyệt** khi phiếu vào cấp họ (submit + mỗi approve-advance) — `LogTransitionAsync` notify current-level approvers (Bích Phượng/Tra Sol "không thấy chuông báo việc cần duyệt").
- **#329** `e823694` **banner phiếu Trả lại** ở chế độ Xem hướng dẫn Sửa→gửi lại (Bích Phượng "bấm nộp lần 2 chỗ nào").

**Mig 56→57 · test 344→354 (+10) · bundle cuối admin `BqKD3Y23`/user `Cn-i349D` (Run #329).**

**Cách chạy:** em-main điều phối + frontend-designer ×3 (focus/revert/decouple — FD2 stub-verify do backend :5443 down gotcha #3, live verify post-deploy) + implementer-frontend (pill/notes/separator/spelling) + implementer-backend ×2 (Mig 57 · approver-notify) + test-specialist ×3 (notes +7 · urgent symmetric→asymmetric REDO) + cicd-monitor ×10 (10/10 PASS). **3 lỗi em tự bắt review-TRƯỚC-deploy** (guard #70 stale-echo · luật asymmetric · double-mount) — minh chứng review-diff > tin "build PASS". **frontend-designer process-death giữa Task H → recover-disk** (edit hoàn-chỉnh trên disk, em-main build-verify + mirror, KHÔNG re-spawn — agent-kill recovery).

**🔴 NEXT SESSION:**
- **Em (carry GẤP, tích-lũy nhiều session):** curate L1 over-cap — reviewer **45KB** + cicd-monitor 37.6KB + inv-codebase 35.6KB (keep-floor-hit → **manual SPLIT/condense**, KHÔNG auto-drain; archive-gate `memory-archive-gate.ps1` A7 GATE PASS 186/186 — archive integrity OK, chỉ L1-hot bị truncate on-inject) + FD 26KB / test-spec 27.7KB WATCH strike-1. Làm như op tập-trung (precedent S70/S71 curate dedicated).
- **Anh/anh Kiệt/Tra Sol/Bích Phượng UAT (Ctrl+F5 eoffice):** (1) cờ gấp — GẮN bằng NV PRO/CCM, **GỠ chỉ Trưởng phòng** (DeptManager) làm được; (2) chuông báo — drafter gửi duyệt → người duyệt cấp 1 thấy 🔔; (3) banner phiếu **Trả lại** → bấm ✏️ Sửa → "Lưu & Gửi Duyệt"; (4) nút **"Xem mở rộng"** mỗi dòng → overlay, bấm dòng = inline 3-panel; (5) ô ghi chú giá đề xuất PRO/CCM (login đúng role); (6) số phân cách + số âm đỏ-ngoặc + mục con thụt-gạch.
- **Ops giữ S58/S59:** tzutil VPS UTC+7 · anh Chương email typo · 5 real-staff pw `User@1234567` · gán CNTT. **Monthly audit 2026-07-01:** re-tier STATUS/HANDOFF (history bloated S68↓ → session logs) · docs/CLAUDE deep-doc count-flush (Mig→57, test→354) + schema-diagram §16+ Mig 32-57 ERD.

---

## S76 (2026-06-19) — PE ngân sách MA TRẬN 3 cột + bảng lưới `<table>` + badge quyền-NS theo role (anh Kiệt FDC + chị Trà Sol, go-live)

**Anh:** forward chat Zalo (Trà Sol + Kiệt FDC) — "mỗi phòng (PRO/CCM) nhập+điều chỉnh ngân sách phòng mình; thêm cột tích quyền NS bên flow để nhìn biết ai sửa được; hiển thị ra fe-user mục Duyệt NCC" → `/ultra-on` "làm hết, step-by-step có workflow review kiểm tra đàng hoàng, hoàn chỉnh rồi deploy báo tao" → phản hồi "giao diện chưa chia cột giống Excel" → bảng lưới → "OK đồng ý, deploy public rồi session-end".

**2 fork anh chốt (AskUserQuestion):** cột Dự án = FE hiển-thị-only · ô tích quyền NS = chỉ-hiển-thị giữ-quyền-theo-role.

**Done (3 commit prod-verified):**
- **`e33481e`** (feature, Run #318 PASS — Mig 56 applied prod, `BhFDF9IJ`/`BAkuRl3C`): **Part 1** ma trận 3 cột. Mig 56 `AddProBudgetSplitToPeWorkItemBudget` (+ProInitialAmount/ProAdjustmentAmount cột PRO mirror CCM Initial/Adjustment; additive + `Sql()` data-migrate `ProInitial=ProEstimate` 4 rows prod). Handler `UpdatePeBudgetProCommand` (PeId,ProInitial,ProAdjust,ProNote) role-gate PRO/Admin + DTO/capability (full mỗi cột = CCM nếu hasCcm else proFull). FE 2 app SHA-mirror. **Part 2+3** badge "✎ NS PRO/CCM" cạnh approver: BE +2 cờ per approver (suy role qua 3 `GetUsersInRoleAsync` set-lookup no-N+1, khớp gate) vào AwLevelDto (designer) + PurchaseEvaluationApprovalLevelApproverDto (PE flow, 2 build-site). FE badge ở ApprovalWorkflowsV2Page + PeWorkflowPanel (2 app). Test 339→**344** (+5).
- **`21d1f4e`** (bảng lưới, Run #319 PASS — `jOqxW4-p`/`DbsznVvR`): Block A flex→`<table border-collapse>` viền ô (header Khoản mục|Dự án|PRO|CCM + 5 hàng); `BudgetCell` xếp dọc (input full + Lưu dưới); `BudgetNoteRow`→`BudgetNoteCell` (td colSpan=3). FE-only. **LESSON: flex+gap KHÔNG ra "bảng" — phải `<table>` viền ô.**
- **Race fix (gotcha #70):** reviewer workflow Part2/3 bắt — 2 ô PRO echo field anh-em từ `bs` (server snapshot) + `invalidate()` fire-and-forget → lưu 2 ô liên-tiếp đè mất. Vá `useIsFetching` gate nút Lưu tới khi refetch land. 2 app.

**Cách chạy:** HMW-mode ON. 1 verify-workflow (Step-1) + 2 review-workflow (Part 1 · Part 2/3) + em-main BE/FE + impl-FE mirror + test-spec + cicd×2. **Workflow-review-flaky** (2-3 lane empty #53) → em-main self-gate (`feedback_workflow_fanout_reliability`). cwd-misland: impl-FE MEMORY rơi stray → harvest + `.gitignore` guard `fe-*/.claude/`.

**🔴 NEXT SESSION:**
- **Em (carry ưu-tiên):** curate L1 over-cap GẤP — reviewer **45KB** + investigator-codebase **35KB** (keep-floor-hit, entries newest lớn → **manual SPLIT/condense**, KHÔNG auto-drain) + cicd 29KB + test-spec 28KB (strike-1). archive-gate A7 GATE PASS 186/186.
- **Anh/anh Kiệt UAT:** mở phiếu PE tab ngân sách (Ctrl+F5) → bảng lưới 3 cột; login PRO nhập cột PRO / CCM nhập cột CCM. Xem badge ✎NS trong Designer + flow.
- **Ops giữ S58/S59:** tzutil VPS · anh Chương email typo · 5 real-staff pw · gán CNTT. Monthly audit 2026-07-01 (STATUS/HANDOFF re-tier + docs/CLAUDE deep-doc + schema §16+).

---

## S75 (2026-06-18) — Harness-11 adopt (engine bộ-nhớ-và-governance tự-bảo-trì) + 2 double-check (anh giao)

**Anh:** `/session-start` → `/check-email AI_INFRA và /adap-apply Từng Stag 1, làm kỹ chi tiết sau mỗi stag đều phải workflow review kiểm, xong gửi report trung thực cho AI_INFRA` → "Workflow double check lại 1 turn + checklist 1 turn → hoàn thiện report push git rồi session-end".

**Done (0 production code, 3 commit pushed `462bfbc`→`aa09e99`):**
- **STAGE 1 check-email:** H11 directed `harness-11-available` verify PASS (whole-file `318ff9f6` + body `b2a2fc1c`) → archive `inbox/ai_infra/`.
- **5 Workflow** (run-id = bằng chứng): AUDIT `wf_7fdc3bd5-930` → IMPLEMENT `wf_c5e5844e-7c1` → REVIEW `wf_d7ca1ff8-942` → DOUBLE-CHECK `wf_a0b68d2f-30e` → CHECKLIST-VERIFY `wf_39cd4cbe-f07`. run-trace FLAT git-tracked `runs/2026-06-18-h11-{audit,implement,review,doublecheck,checklist-verify}/`.
- **Engine adopted:** `scripts/governance-detectors.ps1` (C1-C5+B3 NO-API DÒ+FLAG, 26 flag) + `scripts/memory-archive-gate.ps1` (PHẦN A) + `docs/governance/harness-11-engine.md` canonical + B1 ×11 pointer + cadence D1/D2.
- **completeness-gate FORMAL ĐẠT:** B 4/4 + C 5/5 + D 11/11 đủ-trọn; A 🟡 tailored. adap-report + email ai_infra (`2316773229f2`).
- Bài học: review→fix loop bắt 2 lỗi self-assess sót · raw-Workflow schema-force flaky (3/15 lane no-SO) → em-main self-gate · gotcha #30 box-glyph .ps1 (kể cả Edit render-normalize) · `git add -A` quét stray scratch → git-add cụ-thể.

**🔴 NEXT SESSION:**
- **Anh:** ⚠️ **restart CLI** (đầu việc) — activate cadence wiring (session-start §2.1.3 chạy detector + session-end §L.b(c) archive-gate) + ef-core skill desc. Sau restart, session-start sẽ tự chạy `governance-detectors.ps1` báo cờ drift.
- **Em (carry):** 🔴 **curate L1 over-cap** — reviewer **38.8KB** + inv-codebase **31.5KB** + cicd **26.8KB** (archive-gate confirm; reviewer+inv keep-floor hit → cần manual split/condense, KHÔNG auto-drain) · monthly audit 2026-07-01 (STATUS/HANDOFF re-tier + docs/CLAUDE deep-doc + schema §16+).
- **Pending product (carry S73/S74):** anh/anh Kiệt UAT PE CcmNote (login CostControl/Admin) + cấu hình "Ngưỡng giá CEO" Mig 54 Designer; "C" chuyển phiếu→dự án chờ spec. **Ops giữ S58/S59:** tzutil VPS · anh Chương email typo · 5 real-staff pw · gán CNTT lock nv.cao/nv.truong.

---

## S74 (2026-06-18) — PE ô "Ghi chú từ CCM" ngân sách gói thầu (Mig 55)

**Anh: forward 2 luồng Zalo (Trà Sol + Kiệt FDC) về panel TỔNG HỢP NGÂN SÁCH TRÌNH KÝ → "Chỗ CCM cũng giống Pro cũng cho tất cả nhập mới lần đầu và ghi chú lại, hiện đang hiển thị 0 hết." → AskUserQuestion 2 fork → /session-end (= đèn xanh deploy).**

**Chẩn đoán:** ô nhập PRO/CCM gate `bs.canEditPro/canEditCcm` (thuần role, KHÔNG phase). "0 hết CCM" = tài khoản đang xem thiếu role CostControl (KHÔNG bug — đúng phân vai). Bất đối xứng thật: PRO có `ProNote`, CCM thiếu ô ghi chú.

**2 fork anh chốt:** (1) thêm "Ghi chú từ CCM" — Mig 55 cột CcmNote ✅ · (2) GIỮ phân vai CCM (CostControl/Admin) ✅.

**Done (commit `8655ebf`, 14 file):**
- BE (em-main): Entity `+CcmNote` mirror ProNote + config HasMaxLength(1000) + **Mig 55 `AddCcmNoteToPeWorkItemBudget`** (additive-nullable sạch) + `UpdatePeBudgetCcmCommand +CcmNote` (absolute-set, role-gate fail-closed) + validator + handler + changelog + DTO + controller BudgetCcmBody + GET mapping.
- FE (implementer-frontend background): dòng "Ghi chú từ CCM" sau V0/hiệu chỉnh, gate `canEditCcm`, absolute-set đủ 3 field (2 call-site số tiền cũ echo `ccmNote`). SHA-mirror 2 app, build PASS.
- Test (test-specialist chết rate-limit → recover-disk, KHÔNG re-spawn): +5 §4b. em-main self-gate `dotnet test` → **339 PASS** (45D+294I).

**Cách chạy (hybrid có chủ đích, báo-trước theo cam kết S73):** mode HMW ON nhưng migration + tight DTO coupling + go-live → em-main làm BE+Mig55 ∥ delegate implementer-frontend mirror FE + test-after + em-main self-gate (`feedback_workflow_fanout_reliability`: migration/verify-heavy → em-main-led ≈ fan-out, tránh #53).

**🔴 NEXT SESSION:**
- **Anh/anh Kiệt UAT:** đăng nhập tài khoản **CostControl/Admin** mới thấy + nhập ô CCM (Ban hành lần đầu / Hiệu chỉnh / **Ghi chú từ CCM** mới). Tài khoản PRO chỉ thấy ô PRO (đúng phân vai S61).
- **Carry S73:** "Ngưỡng giá CEO" Designer + test 3 luồng giá Mig 54; "C" chuyển phiếu→dự án chờ spec form.
- **Em (carry):** curate L1 over-cap reviewer **38.8KB** + investigator-codebase **31.5KB** (budget.json re-measured S74) · monthly audit 2026-07-01 (doc-flush ef-core SKILL Mig 53→55 + root CLAUDE counts; STATUS/HANDOFF re-tier).
- **Ops giữ S58/S59:** tzutil VPS · anh Chương email typo · 5 real-staff pw `User@1234567` · gán CNTT lock nv.cao/nv.truong.

---

## S73 (2026-06-18) — Mig 54 PE giá đề xuất PRO/CCM + CEO chọn giá chốt + CCM duyệt-done ô-tích (anh Kiệt FDC, go-live thứ Hai 22/06)

**Anh: forward Zalo anh Kiệt FDC (① giá đề xuất PRO Min/Max + CCM · ② cờ gấp đỏ/xanh · ③ CCM duyệt-done CEO-uỷ-quyền) + "mai done, chiều mai testing, thứ 2 go-live" → AskUserQuestion 2 fork (anh chọn: ③ ô-tích-tay + ① CEO-chọn-giá) → "workflow cho nhanh, sao ko chạy workflow?" → fix empty-candidates + workflow double-check → session-end.**

**Done (2 commit prod-verified):**
- **`1d86abc`** (feature, cicd Run #313 PASS): Mig 54 5-cột additive-nullable + 2 setter role-gate (Forbidden fail-closed) + ApproveV2 ③ AUTO→OPT-IN (`finalizeByCcmDelegation`) + ① bind giá chốt mọi nhánh DaDuyet + DTO +7. FE 2 app SHA-mirror (PeWorkflowPanel bộ-chọn-giá + ô-tích CCM · PeDetailTabs `SuggestedPriceRows` · types +7). Test 306→**334**. Bundle admin `OlNyG9OD`/user `DSzSLVtL`.
- **`6aa4dcb`** (FE fix): khoá nút Xác nhận khi empty-candidates (double-check xác nhận edge UNREACHABLE per submit-guard `:194`).
- **② cờ gấp** đã có sẵn từ S69 (chỉ verify, không làm lại).
- **2 workflow review (bài học):** R1 custom-inline schema-force CHỈ 1/4 returned (flaky no-StructuredOutput) → R2 **free-text 2/3 PASS** — rủi ro #1 FE empty-candidates = UNREACHABLE. Ghi `feedback_workflow_fanout_reliability`: review fan-out free-text/hmw, KHÔNG ép-schema inline. Run-trace `runs/2026-06-18-mig54-pe-review/`.

**🔴 NEXT SESSION (anh/anh Kiệt UAT — go-live thứ Hai 22/06):**
- **Cấu hình "Ngưỡng giá trị gói CEO"** trong Workflow Designer (admin) — ③ ô-tích "CCM duyệt done miễn CEO" chỉ hiện khi gói < ngưỡng. Chưa set → ô tích ẩn (đúng).
- **Test 3 luồng:** ① PRO nhập Min/Max + CCM nhập giá đề xuất → duyệt cấp cuối chọn 1 giá chốt (NCC/PRO Min/PRO Max/CCM) · ③ phiếu < ngưỡng → CCM tích "Duyệt done miễn CEO" → hoàn tất không cần CEO.
- **Xác nhận:** quy trình đặt CCM (CostControl) NGAY TRƯỚC CEO — logic tự-done giả định vậy; nếu CCM không sát CEO, tích done bỏ qua cấp giữa.
- **"C" (sau duyệt → chuyển phiếu đến dự án)** chờ anh Kiệt spec form. **E-Office** update sau.
- **NEXT (em):** curate cicd-monitor + investigator-codebase L1 over-cap (carry S72) · optional `.gitignore` guard `fe-*/.claude` (cwd-misland) · monthly audit 2026-07-01.
- **Ops giữ S58/S59:** tzutil VPS · anh Chương email typo · 5 real-staff pw `User@1234567` · gán CNTT lock nv.cao/nv.truong.

---

## S72 (2026-06-18) — Harness-10 flat-refine + checklist-v2 adopt (re-audit 3-workflow) + sleep NO-OP (em main + 9 sub, 0 production code)

**Anh:** `/session-start` → "trí nhớ thay đổi lớn" + `/sleep-recovery-memory-l2` báo Unknown → "double check hết harness 8/9/10/10-refine + checklist + hmw, điều chỉnh, report trung thực" → `/sleep-recovery-memory-l2 all` + `/session-end`.

**Done:** 3-stage workflow (audit `wf_13868efb-ea7` → implement `wf_ac43b5ff-7d1` → review `wf_d482e10d-5dd`, Harness-9 B1+B2). SE BEHIND Harness-10 flat → migrate run-trace SUBFOLDER→FLAT (hmw.js `:103`+`:52` + workflows/README + runs/README + session-start/end + agents/README + _ledger; 5 run cũ giữ subfolder C8) + 2 broadcast 06-18 adopt + `/sleep-recovery-memory-l2` port (A8, §J2-tailored SE-only) + detector TAILORED-OUT + hmw.js H4.5→H8. REVIEW bắt 2 (schema-stale + auto-wire overclaim) → fixed (auto-check WIRED: budget.json+session-start/end). 1 reviewer residual-write self-caught+revert (reverse-finding #4, raw-Workflow≠wrapper-guard). B3 self-correct (runs path 14→22). Sleep `all`=NO-OP. adap-report `2026-06-18-Governance-harness-10-flat-refine-checklist-v2` + email (`5f511fe5c0f2`). **cicd Run #312 PASS no-op** (306/Mig 53/sys.tables 88/health 4×200 clean) NHƯNG **bundle ROTATE** `BgNCjwsG`/`CBvh0vtf`→**`fc_xkNpJ`/`DP-tBcg0`** (non-determ hash + deploy rebuild-FE-uncond = **gotcha #69**; 0 FE change, cosmetic). **Live bundle nay = `fc_xkNpJ`/`DP-tBcg0`.**

**🔴 NEXT SESSION:**
- **⚠️ RESTART CLI (đầu việc):** activate FLAT-runtime `hmw.js` (`:103` flat path) + wired sleep-check (`session-start §2.1.2` + `session-end §L.b(c)`) + `/sleep-recovery-memory-l2` skill. + carry (S66/S70) reviewer Cat-6 + H8-inherit. Sau restart spawn-test confirm.
- **🔴 curate 2 sub OVER cap → L1→L2** (move oldest Recent-activity → `archive/2026-06.md` + `_INDEX`): `investigator-codebase` **28973** (audit-trail S71/S72) + `cicd-monitor` **30123** (Run #312 entry + gotcha #69; chronic-worst sub). Watch near-cap: frontend-designer 24004 + test-specialist 23919 (**chưa có archive** → first-overflow phải build `_INDEX`/gist). `budget.json` measured STALE → re-run `scripts/measure-agent-memory.ps1` (§2.1.2 next session sẽ re-measure + catch).
- **Pending product (anh/anh Kiệt — carry S69):** cấu hình "Ngưỡng giá trị gói CEO" Designer + test cờ gấp PE PRO/CCM; "C" chuyển phiếu→dự án chờ spec form. **Ops giữ S58/S59:** tzutil VPS · anh Chương email typo · 5 real-staff pw `User@1234567` · gán CNTT lock nv.cao/nv.truong.
- **Monthly audit 2026-07-01:** STATUS/HANDOFF re-tier (trim S68↓→logs) · docs/CLAUDE deep-doc count-flush (gotcha 58→68 · 93→88 tables · Budget-removed) + schema §16+ Mig 32-53.
- **Cert** `api.solutions.com.vn` ~2026-07-23 (auto-renew ~06-23).

---

## S71 (2026-06-18) — Harness-10 adopt: tracked run-trace folder convention + checklist 9-10 (em main + 3 Workflow, 0 production code)

**Anh: `--resume` → `/check-email AI_INFRA và /adap-apply harness-10 và check list 9-10` → chốt "full-adap + dogfood ngay qua HMW đủ invest/imple/review, tránh sai sót".**

**Done (3 Workflow run-id = bằng chứng mandate B3, commit pending):**
- INVEST `wf_9c2cd2cd-2e7` (4× investigator-codebase) → IMPLEMENT `wf_e4e46725-231` (3× general-purpose file-disjoint + em-main cluster) → REVIEW `wf_636bc95b-939` (3× reviewer). Migrate wave-mode (Harness-2 B6 gitignored) → run-trace `runs/<run-id>/` TRACKED (run.md+sub-md/+harvest/) + `_ledger.md` 2-nhịp + 3-layer + containment model shift.
- **Review (R2+R3 độc-lập = high-conf) bắt C5 L1 over-claim** (doc nói hmw.js prompt-builder emit L1, engine no-fs → grep=0) → fixed path-a (L1 = em-main @P1 ledger-check convention). **Dogfood mandate B2 đúng** — 1-workflow-tự-chấm bỏ sót L1, review-workflow RIÊNG bắt TRƯỚC commit.
- checklist 9-10: Part A (memory) + B (adap 2-workflow) done S70; Part C (Harness-10) 8/8 (C7 caveat "điểm sáng nhất"; C3 honest tracked-eligible→committed). Containment audit CLEAN (frozen-evidence 0-byte-loss per-path). adap-report `2026-06-18-Governance-checklist-harness-9-10` + email ai_infra (4 reverse-findings).

**🔴 NEXT SESSION:**
- **⚠️ RESTART CLI (đầu việc):** activate hmw.js RUN-TRACE runtime (no hot-reload) + carry (S66/S70) §2.1.2 budget-audit + reviewer Cat-6 + H8 inherit. Sau restart spawn-test confirm.
- **L1 convention (mới Harness-10):** lúc mở run mới @P1, em-main đọc `_ledger.md` — run trước `closed=⏳` (chưa harvest) → harvest+CLOSE TRƯỚC. (Engine no-fs, KHÔNG auto — L2 session-start + L3 session-end là lưới muộn.)
- ✅ **curate-debt CLOSED S71** (FINALIZE double-check `wf_73de399d-753` + curate `wf_f32987b8-03f`): reviewer 36.7→24.8KB + investigator 29.8→23.2KB (<25600 cap, 0-byte-loss numstat +N -0) + reviewer-gist gen:2 + budget.json re-measure. Race root-cause fixed cấu-trúc (hmw.js RUN-TRACE writeGuard cấm sub tự-ghi MEMORY chung) + **AS-13/E-009** error-ledger. ⚠️ **Watch-list (H2, chưa over-cap):** frontend-designer 24.0KB · test-specialist 23.9KB · cicd-monitor 23.7KB approaching 25600 — budget-audit next session theo dõi (frontend-designer/test-specialist chưa có archive → lần đầu tràn cần build `_INDEX`/gist).
- **Pending product (anh/anh Kiệt — carry S69):** cấu hình "Ngưỡng giá trị gói CEO" Designer + test cờ gấp PE PRO/CCM; "C" chuyển phiếu→dự án chờ spec form. **Ops giữ S58/S59:** tzutil VPS · anh Chương email typo · 5 real-staff pw `User@1234567` · gán CNTT lock nv.cao/nv.truong.
- **Monthly audit 2026-07-01:** STATUS/HANDOFF re-tier (trim S67↓→logs) · docs/CLAUDE deep-doc count-flush + schema-diagram §16+ Mig 32-53 ERD.
- **Cert** `api.solutions.com.vn` ~2026-07-23 (auto-renew ~06-23).

---

## S70 (2026-06-17→18) — Harness-9 adopt: L2 archive dark-matter recovery + adap 2-workflow mandate (em main + 3 Workflow + 2 monitor, 0 production code)

**Anh: `/session-start` → `/check-email AI_INFRA và /adap-apply Harness-9` → chốt "đầy-đủ-nhất, từng stage workflow invest→imple→audit" → `/session-end`.**

**Done (commit `f36aab8` pushed, 30 file +998/−75):**
- **3-stage Workflow** (run-id = bằng chứng PART 2): investigate `wf_be952f3c-97f` (4× investigator-codebase → **pointer=substring sha-keyed** decision, no anchor-slug/line-hint) → implement `wf_a58e0d15-beb` (4× general-purpose file-disjoint → curate L1→L2 + `_INDEX.md` + `.gist.md`) → audit `wf_9520d8cd-4fe` (4× reviewer independent verify). 4 over-cap sub <25KB cap (**P1 curate-debt CLOSED**), ~240KB archive hết RAG-dark.
- **PART 2/3 mandate codify:** mỗi adap = 2 workflow tách biệt (IMPLEMENT + REVIEW) + report-with-run-id; task short-but-confirm vẫn cần review. → `adap-apply.md` + `agents/README` Upgrade S70 + `session-start §2.1.2`. + `memory-budget.json` (seed-by-measure) + `scripts/measure-agent-memory.ps1` + `.ragignore`.
- **0-byte-loss git+sha verified 4/4** (numstat `+N -0` additive + sha + content-identity). 2 reviewer no-StructuredOutput (cicd+inv-codebase) → em-main self-gate (recovery-path). **Read-side gap** (3/4 MEMORY.md không trỏ `_INDEX`) Stage-C-độc-lập-bắt → fixed L5 header (giá trị review-workflow riêng, PART 2 dogfood).
- adap-report + email-back ai_infra (`7c07b716e775`) — 3 đề-xuất ngược (substring-pointer-for-real-archives · measure-then-seed reference · self-gate-fallback hợp-lệ).

**🔴 NEXT SESSION:**
- **⚠️ RESTART CLI (đầu việc):** activate `session-start §2.1.2` budget-audit + (tồn) H8 all-inherit runtime + reviewer Category 6. Sau restart → spawn-test bất kỳ confirm.
- **Budget-audit @session-start (mới Harness-9):** đọc `memory-budget.json` → so `_INDEX.md` size vs cap 20KB. ⚠️ **cicd-monitor index 16.8KB (82% — WATCH-agent**, grows mỗi run; vượt → gist-of-index hoặc split, đừng drop marker).
- **Pending product (anh/anh Kiệt — carry S69):** cấu hình "Ngưỡng giá trị gói CEO" Designer + test cờ gấp PE PRO/CCM; "C" (sau duyệt → chuyển phiếu đến dự án) chờ spec form. **Ops giữ S58/S59:** tzutil VPS · anh Chương email typo · 5 real-staff pw `User@1234567` · gán CNTT lock nv.cao/nv.truong.
- **Monthly audit 2026-07-01:** STATUS/HANDOFF re-tier (trim S67↓→logs, defer ×9) · docs/CLAUDE deep-doc count-flush (gotcha 58→68 · 93→88 bảng · Budget-removed refs) + schema-diagram §16+ Mig 32-53 ERD · rollout Harness-9 `_INDEX`/gist cho sub khác KHI archive lớn lên (hiện chỉ 4 có dark-matter; frontend-designer/test-specialist L1 ~24KB watch).
- **Cert** `api.solutions.com.vn` ~2026-07-23 (auto-renew ~06-23).

---

## S68 (2026-06-16) — Hồ sơ NS header chi tiết NV: làm nổi bật + fix tên render đen→trắng (em main solo, 2 deploy, anh UAT realtime)

**Anh: `/session-start` → screenshot eoffice header NV "sửa màu/font cho nổi bật, đen mảnh xấu" → deploy → screenshot "tên nhỏ lại, màu đen nền xanh ko nổi bật" → fix → `/session-end`.**

**Done (3 commit, 2 deploy Run #303-304 prod-verified):**
- **Bootstrap:** 2 monitor CLEAN — 🟫 H1 roster 11/11 `inherit` disk-confirmed (Harness-8 landed) + flag `dep-audit SKILL:153` 64→65 + **curate-debt thật = 4 agent over-cap** (S67 sót reviewer + impl-backend); ⬜ H2 0-orphan/0-corruption/5-trục PASS → patch 2 doc-drift `11bc96d`.
- **#303 `6983609`** header polish ×2 SHA256: tên `text-xl extrabold`+drop-shadow · dòng meta `text-[13px] font-medium text-white` (to+đục+dày) · badge pill **màu theo trạng thái** (emerald/amber/slate + chấm `bg-current`).
- **#304 `37752eb`** fix tên ĐEN→TRẮNG: `<h2 text-white>` render đen vì `index.css:79 h1-h4{color:#0b1220}` viết **ngoài `@layer`** (Tailwind v4 unlayered thắng utilities, **gotcha #66**). Đo blast-radius ~30+ heading → **KHÔNG move @layer (load-bearing)**, fix ĐIỂM `text-white!` (grep dist confirm `!important`) + thu nhỏ `text-lg`.

**🔴 NEXT SESSION:**
- **anh xác nhận mắt:** tên NV giờ trắng + gọn (`text-lg`) — ưng chưa? Muốn nhỏ hơn → `text-base` (16px); muốn màu nhấn (vd vàng nhạt) → báo em.
- **🔴 curate L1 GẤP (em main — ưu tiên, defer nhiều session):** cicd-monitor **44.1KB** (worst, +#303/#304; tự FIFO-trim nhưng vẫn over) · investigator-codebase 38.5 · reviewer 35.4 · implementer-backend 30.7 — **4 agent > 30KB cap** (H1+H2 đồng thuận). Move runs/entry cũ → `archive/2026-06.md` byte-exact.
- **doc-flush (defer-monthly):** `docs/CLAUDE.md` full count (gotcha 58→66 · test 263→286 · tables 93→88) + schema-diagram §16+ Mig 32-52 ERD (~21 mig debt).
- **Ops của anh (giữ S58/S59):** tzutil VPS · anh Chương email typo · 5 real staff password `User@1234567` · gán CNTT → lock nv.cao/nv.truong.
- **Cert** `api.solutions.com.vn` ~2026-07-23 (auto-renew ~06-23). **monthly audit 2026-07-01** (STATUS/HANDOFF re-tier — header bloat, defer ×8).

---

## S67 (2026-06-16) — Hồ sơ NS visual polish + fe-admin mirror + PE Link hồ sơ auto-detect/file-link + research auto-open (6 deploy, anh + anh Kiệt FDC UAT realtime)

**Anh: `/session-start` → "đồng nhất font + chữ đen→xanh đậm" → deploy → `/ultra-on` "làm nhanh hết sức" → "đồng nhất list + hết tràn sliderbar" → chat anh Kiệt HoSoLink → "cho link đi" → "auto direct? cho workflow research" → "file:// đc mà" → "cho link file://" → `/session-end`.**

**Done (6 deploy Run #297→#302, đều prod-verified):**
- **#297** `ab4e681` fe-user Hồ sơ NS đồng nhất font/size (mono 12→14px) + chữ value/tên đen→`brand-800` (qua `Field` dùng-chung). **#298** `292d64d` fe-admin mirror master-detail + **vá accent tokens index.css TRƯỚC** (teal/violet/amberx/greenx + icon-chip/gradient — bẫy "vỡ màu im lặng" Tailwind) rồi `cp` page (SHA256 ×2). **#299** `bcd619d` +23 test-after HRM→286 (cycle-guard + HoSoLink absolute-set + HRM-perm reflection). **#300** `91aaf05` list bảng 3-cột→**flex-row** (hết tràn ngang rail) + cỡ chữ 18/14/13/11 ×2. **#301** `6df1b2d` PE Link auto-detect web→hyperlink/`O:\`→Copy. **#302** `536dd6b` Link `O:\` render file:// bấm-thử + Copy.
- **Research (workflow 3 investigator-api):** auto-mở `O:\` từ web = **chỉ Edge GPO `IntranetFileLinksEnabled`** (Edge-only, Intranet Zone, 1 GPO domain, **zero-per-machine**) = one-click thật. Default browser CHẶN https→file:// (Chrome/Edge/FF 76+). .url-download zero-install nhưng 2-click+SmartScreen. Chrome KHÔNG có policy tương đương.
- test-specialist truncated #53 → em main recover-disk (3 test file đủ, `dotnet test` 286 verify). 0 production bug.

**🔴 NEXT SESSION:**
- **anh test:** bấm link `O:\` trên máy → mở Explorer (Edge đã configured) hay no-op (cần GPO)? Báo em → quyết IT-guide.
- **IT-guide Edge GPO** (`IntranetFileLinksEnabled=1` + SiteToZoneAssignmentList `eoffice`→Intranet Zone) — em soạn sẵn nếu anh muốn `O:\` bấm-mở 1-click. SharePoint/web link thì đã bấm-mở sẵn (khuyến khích dùng).
- **visual check:** list gọn + màu xanh đậm `brand-800` ưng chưa (muốn nhạt hơn → `brand-700` 1 token cả 2 app).
- **🔴 curate L1 GẤP (em main):** cicd-monitor **39.8KB** + investigator-codebase **39.4KB** over-cap (re-inflated S67 — 6 cicd-run + recon; move runs cũ → `archive/2026-06.md`).
- **doc-flush (defer-monthly):** `docs/CLAUDE.md` full count (263→286, gotcha 58→65, tables 93→88) + schema-diagram §16+ Mig 32-52 ERD (~21 mig debt) + impl-backend record Mig 51→52.
- **Ops của anh (giữ S58/S59):** tzutil VPS · anh Chương email typo · 5 real staff password `User@1234567` · gán CNTT → lock nv.cao/nv.truong.
- **Cert** `api.solutions.com.vn` ~2026-07-23 (auto-renew ~06-23). **monthly audit 2026-07-01** (STATUS/HANDOFF re-tier — header bloat, defer ×7).

---

## S66 (2026-06-16) — Closeout: adopt Harness-8 all-inherit + cicd-monitor L1 curate + ef-core doc-flush + check-email AI_INFRA (em-main-solo, 0 product-sub)

**Anh: `/session-start` → chọn "cicd-monitor curate (P1 GẤP)" → `/check-email AI_INFRA /adap-apply` → `/session-end`.**

**Done (~17 file docs/gov/config, 0 production code):**
- **Bootstrap (`/session-start`):** 2 monitor RE-REPORT — 🟫 H1 roster 11=11 + plugin 18/15/3 clean, bắt ef-core SKILL stuck Mig 50 (TRUE 52); ⬜ H2 0-orphan + cicd L1 86.8KB GẤP. H1 doc-flush 3 file (ef-core SKILL +Mig 51/52 rows + count 50→52; skills/README + root CLAUDE.md gotcha 64→65 + schema pending 32-52).
- **cicd-monitor L1 curate 86.8→28.9KB** (66% giảm): byte-exact `sed` move Run #286→#232 → `archive/2026-06.md` (incl #291 forensic [gotcha #65] + #383 ex-VỊ-TRÍ-LẠC); baseline + 6 runs #289-#295 giữ; essentials Mig 52 + bundle-live S70 #295. Reliability fix (25KB auto-inject cap — trước ~30% file inject).
- **adopt Harness-8 (all-inherit + workflow-fastest)** qua `/adap-apply` (🔴 BẮT BUỘC, PROJECT-FIT 6/6): 7 sub demoted `claude-opus-4-8`→`inherit` (cả 11=inherit, gỡ two-tier H4; SE không có helper/gopher rẻ) + `agents/README.md` codify + `hmw.js` comment + adap-report + email-back ai_infra (`fa7f690d` round-trip MATCH). Nấc **executed-file VERIFIED-pending-restart**. Runtime chưa đổi (inherit=Opus 4.8 vì Fable down H5); giá trị forward-looking + H5.6 restore gọn hơn.
- **check-email AI_INFRA:** 0 thư mới se-directed (UI/UX guide đã xử lý S58).

**🔴 NEXT SESSION:**
- **⚠️ RESTART CLI (đầu việc):** activate H8 all-inherit runtime (frontmatter no hot-reload) + reviewer Category 6 (S64 pending). Sau restart → 1 spawn-test bất kỳ → nấc H8 verified-runtime.
- **Mirror Hồ sơ Nhân sự + gốc SOLUTION COMPANY + tô-màu sang fe-admin** (giữ từ S65 — fe-user ONLY, fe-admin `EmployeesListPage` còn bản cũ; PE pages ĐÃ mirror).
- **🟪 test-after:** HoSoLink + Department.ParentId/cycle-guard + HRM-perm seed + carry suppliers authz + LockDemoSampleUsers.
- **Curate L2 còn (H2 defer):** investigator-codebase 36.4KB + reviewer 36KB over-cap → batch khi curate next.
- **doc-flush còn (defer-monthly):** `docs/CLAUDE.md` full count + schema-diagram §16+ Mig 32-52 ERD (~21 mig debt) + impl-backend record Mig 51→52.
- **Ops của anh (giữ S58/S59):** tzutil VPS · anh Chương email typo · 5 real staff password `User@1234567` · gán CNTT → lock nv.cao/nv.truong.
- **Cert** `api.solutions.com.vn` ~2026-07-23 (auto-renew ~06-23). **monthly audit 2026-07-01** (STATUS/HANDOFF re-tier — header bloat, defer ×6).

---

## S65 (2026-06-16) — HRM go-live + Hồ sơ Nhân sự master-detail (giống NamGroup) + Department hierarchy + PE Link hồ sơ (~6 deploy, anh + anh Kiệt FDC UAT realtime)

**Anh: `/session-start` → screenshot eoffice "public NHÂN SỰ" → "redesign màu cho đẹp" → screenshot NamGroup "bố trí Hồ sơ NS giống thế này" → anh Kiệt FDC Zalo "mục E Link hồ sơ NAS + Dự trù→Ngân sách PRO" → "sao không workflow fan-out?" → "gốc SOLUTION COMPANY toả xuống phòng ban" → "chữ đen đơn điệu, đổi panel phòng ban trên-User dưới, trang trí màu" → `/session-end`.**

**Done (6 deploy Run #289→#295, đều prod-verified):**
- **#289** public Hồ sơ Nhân sự read 13 role (`SeedAllRolesHrmProfileReadPermissionsAsync` SAU revoke S58, upgrade-only, policy-based authz mở luôn API). **#290** foundation màu fe-user. **#292** Department.ParentId Mig 51 + `/departments/tree` + picker "Phòng cha" fe-admin (sau **#291 CS7036 FAIL** — gotcha #65 build csproj con ≠ slnx). **#293** Employee 3-panel master-detail + PE HoSoLink Mig 52 + rename Dự trù→Ngân sách PRO. **#294** gốc cây SOLUTION COMPANY. **#295** Employee refine 2-cột + tô màu.
- **Workflow fan-out THẬT lần đầu** (`pe-hoso-link-rename-pro` BE∥FE→review) — parallel disjoint-file OK NHƯNG FE+reviewer return-rỗng #53 → em main recover-disk + self-gate (bắt badge "DỰ TRÙ PRO" sót rename). `feedback_workflow_fanout_reliability`.

**🔴 NEXT SESSION:**
- **Mirror trang Hồ sơ Nhân sự + gốc SOLUTION COMPANY + tô-màu sang fe-admin** (hiện fe-user ONLY — fe-admin `EmployeesListPage` còn bản cũ; admin-bundle frozen suốt S65). Lưu ý fe-admin `PeDetailTabs`/`PeWorkspaceCreateView` ĐÃ mirror PE Link hồ sơ (SHA256 identical) — chỉ Employee page chưa.
- **🟪 test-after:** HoSoLink + Department.ParentId/cycle-guard + HRM-permission seed (assert non-Admin CanRead `Hrm_HoSo`=true & `Hrm_Dashboard`=false) + carry suppliers authz + LockDemoSampleUsers.
- **🔴 cicd-monitor L1 82KB curate-L2 P1 GẤP** (2.7× over 30KB cap, +21KB từ S63 62KB; trend 41→54→56→61→62→82) + investigator-codebase 37KB + reviewer 35KB over cap.
- **doc-flush (H1 coords, defer-monthly OK):** ef-core-migration SKILL Mig 50→52 (:3/:19/:74/:282/:291) · `docs/CLAUDE.md` full · schema-diagram §16+ Mig 32-52 ERD (~21 mig debt) · impl-backend record Mig 51→52 cosmetic.
- **anh:** gán phòng cha fe-admin → cây lồng tầng · xem màu/layout Hồ sơ NS ưng chưa. **Ops giữ S58/S59:** tzutil VPS · anh Chương email typo · 5 real staff password `User@1234567` · gán CNTT lock nv.cao/nv.truong.
- **Cert** `api.solutions.com.vn` ~2026-07-23 (auto-renew ~06-23). **monthly audit 2026-07-01** (STATUS/HANDOFF re-tier — header bloat S64→S51 inline, defer ×5).

---

## S64 (2026-06-15) — Adopt Harness-7 (writing-quality floor) + check-email ai_infra (1 commit, em-main solo)

**Anh: `/session-start` → `/check-email ai_infra` (mailbox trống) → "trong thư mục all đấy" → `/adap-apply` H7 + `/send-email ai_infra` → `/session-end`.**

**Done (`6afde19`, 6 file +106/−1, push):**
- **Harness-7 adopt:** broadcast mới duy nhất trong `outbox/all`. Rule canonical `rules.md §1.1` (O1 outward tiếng Việt full-grammar · O2 asymmetric nội-bộ-giữ-nén §6.4/§6.5 · O3 reviewer Category 6 + self-check). README Upgrade S64. adap-report + email se→ai_infra (body-hash `7e4f91f1` MATCH). PROJECT-FIT 6/6.
- **Lesson (gotcha #61):** broadcast `a4580ea9` verify đầu "mismatch" = lỗi em (PS5.1 UTF-8-no-BOM decode bằng Windows-1252); đọc UTF-8 tường minh → MATCH. KHÔNG mis-stamp. Verify body-hash Windows phải đọc UTF-8 tường minh.

**🔴 NEXT SESSION (anh):**
- **⚠️ RESTART CLI** activate reviewer Category 6 (verified-pending-restart — agent `.md` no hot-reload).
- **H5.6 restore** khi Fable 5 về (no-ETA).
- **Ops của anh (giữ S58/S59):** tzutil VPS · anh Chương email → dọn typo · báo 5 real staff password `User@1234567` · gán CNTT → lock nv.cao/nv.truong.
- **Backlog:** test-after guard suppliers authz + LockDemoSampleUsers · F4 approver-edit-budget UI (chờ anh Kiệt) · **monthly audit 2026-07-01** (cicd-monitor L1 62KB curate + STATUS/HANDOFF re-tier defer ×4 + schema-diagram §16+ Mig 32-50 ERD).
- **Cert** `api.solutions.com.vn` ~2026-07-23 (auto-renew ~06-23).

---

## S63 (2026-06-15) — Docs-closeout S60-62 + adopt Harness 5+6 + .gitattributes eol=lf (3 commit, em-main solo)

**Anh: `/session-start` → bootstrap bắt drift (docs S59 vs git S62 + stray reviewer) → chốt "đóng trọn closeout (A)" → `/check-email ai_infra` (mailbox trống, guide cũ intact) → "check kỹ harness 5/6" → `/adap-apply` cả 2 + `/send-email` ai_infra → "làm hết + session-end".**

**Done (3 commit `5e6dcc1`→`dbbf89a`→`08c7036`, đều push):**
- **Closeout S60-62:** reconcile stray reviewer cwd-misland (move+pointer, no-overwrite) + count-flush 4 file (Mig 50·88 bảng·263 test·64 gotcha·53 menu·Budget REMOVED) + session-log bù.
- **Harness 5** (model-fallback): SE đã de-facto fallback Fable→Opus 4.8 1M (Fable/Mythos down 06-12 no-ETA) — book caveat + session-start BƯỚC 0.6 H5.1 check; KHÔNG RCA/memory-permanent (external outage blameless). adap-report 06-13.
- **Harness 6** (governed-ultracode): H6.1 auto-HMW mode-ON (ultra-on+T4) + H6.2 hmw.js role-less→inherit lead; H6.7 đã sẵn S49. adap-report 06-15. Email ai_infra (`8a247984` spec-canonical, sửa mis-stamp S58).
- **`.gitattributes`** broadcasts eol=lf + adap-request federated.

**🔴 NEXT SESSION (anh):**
- **⚠️ RESTART CLI (đầu việc):** activate `session-start` BƯỚC 0.6 (H5.1 model-check) + `ultra-on`/T4 H6.1 (auto-HMW) — command no hot-reload. hmw.js H6.2 đã live (no-restart).
- **H5.6 restore** khi Fable 5 về (no-ETA): đổi lead lại Fable + spawn-test confirm `claude-fable-5[1m]` + gỡ caveat `agents/README` + báo update AI_INFRA.
- **Ops của anh (giữ S58/S59):** tzutil VPS · anh Chương email → dọn typo · báo 5 real staff password `User@1234567` · gán CNTT → lock nv.cao/nv.truong.
- **Backlog:** test-after guard suppliers authz + LockDemoSampleUsers · F4 approver-edit-budget UI (BE scope sẵn, chờ anh Kiệt UAT) · **monthly audit 2026-07-01** (curate cicd-monitor L1 **63.6KB** over-cap lần 5 + schema-diagram §16+ Mig 32-50 ERD + docs/CLAUDE.md full count-flush).
- **Cert** `api.solutions.com.vn` ~2026-07-23 (auto-renew ~06-23).

---

## S60–S62 (2026-06-12→06-13) — PE ngân sách per-gói-thầu (Mig 50, XÓA Budget) + workflow polish + soft-warning [4 commit prod-verified · docs bù S63]

**Anh Kiệt (FDC) UAT realtime eoffice → chuỗi chỉnh PE: ràng buộc gửi-duyệt + gỡ "Từ chối" (S60) → ngân sách gói thầu theo Excel + XÓA module Budget cũ (S61 Mig 50) → vượt ngân sách cho lưu, cảnh báo mềm (S62). 3 session ship code KHÔNG closeout docs → S63 `/session-start` bù (git log phát hiện drift S59→S62).**

**Done (4 commit `37122f0`→`7926c21`):**
- **S60:** guard gửi duyệt đủ 4 (đơn vị + giá>0 + ngân sách + bảng so sánh, áp cả Admin) + bypass drafter-in-chain V2 bước-đầu + rename mục 3 "Đơn vị NCC/TP được chọn" + gỡ "Từ chối" (chỉ còn Duyệt/Trả lại, guard chặn TuChoi). Test 240→256.
- **S61 Mig 50 `ReplaceBudgetModuleWithPeWorkItemBudgets`:** bảng `PeWorkItemBudgets` per-gói-thầu + drop module Budget cũ + backfill `BudgetManual→BudgetPeriod` TRƯỚC DropColumn (phiếu UAT giữ số) + bảng Tổng hợp 2-block 9-dòng công thức Excel + nhập role PRO/CCM (Forbidden fail-closed) + XÓA FE budgets. Test→**263**. database-agent advise (no FK vật lý · DropIndex trước DropColumn · IN-list). **gotcha #63/#64**.
- **S62:** vượt ngân sách = soft-warning (gỡ validator ExpectedRemaining>=0, allowNegative row8 + banner amber, mirror LeaveBalance). Reviewer PASS 0 issue. cicd **Run #286** bundle `0xKYGhhf`/`C81ZdG9G`, DATA-PRESERVE 8/8 phiếu giữ số.

**🔴 NEXT SESSION (anh pick):**
- **Ops của anh (giữ từ S58/S59):** ① `tzutil /g` VPS · ② anh Chương email → dọn typo `chuong.phan@` · ③ báo 5 real staff password `User@1234567` + đổi · ④ gán người thật CNTT → lock nv.cao/nv.truong.
- **🟪 test-after guard:** suppliers asymmetric authz (S59) + `LockDemoSampleUsersAsync` (S58) — IdentityFixture sẵn. (`PeWorkItemBudgetTests` 22 core đã có.)
- **F4 approver-edit-budget UI** tạm drafter-only (BE scope sẵn) — chờ anh Kiệt UAT chốt mở cho approver.
- **PE polish sâu** (PeDetailTabs lớn) · **PermissionGuard per-route** khi golive HRM/Office · **Phase 9 Ops** (SMTP/backup/creds/UAT).
- **Monthly audit 2026-07-01:** STATUS/HANDOFF re-tier (trim S53-S56 → logs — defer ×3 ƯU TIÊN) · curate L1 **cicd-monitor 63.6KB over-cap lần 5** + investigator-codebase 32.7KB · schema-diagram §16+ Mig 32-50 ERD debt.
- **Cert** `api.solutions.com.vn` expire ~2026-07-23 (auto-renew ~06-23).

---

## S59 (2026-06-11 chiều→tối) — Wipe testing + tree 4 tầng + 71 mã PMH + UAT 6 vòng (10 commit prod-verified #273→#282)

**Anh: forward Zalo anh Kiệt (xóa testing + tree theo hạng mục) → chốt tree "Năm chứa Dự án chứa Hạng mục" → forward chị Trà Sol (dọn mã tự chế, "không đẻ thêm mã công ty khác") → anh Kiệt chốt format mã ("MEP-SUB-1 — 1 MEP Sub MEP (Full), đúng kiểu vậy") → 6 vòng screenshot UAT realtime (11 điểm — 4 vòng cuối chen giữa session-end: table-fixed bảng NCC, bỏ Tên ngân sách, GỠ Điều khoản TT mọi form, bỏ nút Thêm hạng mục) → "Chốt làm đi nhé" (session-end).**

**Done (10 commit — 8 Run PASS + 2 cancelled-supersede-benign, đều prod-verify):** xem STATUS S59 entry / session log chi tiết. Điểm phải nhớ cho session sau:
- **Prod baseline SẠCH cho testing thật:** PE/HĐ/Notif từ 0, mã từ `…/001`, WorkItems = ĐÚNG 71 mã PMH format mới (`MAT-1` — "1 Mat Bê tông"…), 7 workflow ghim, master 70 dự án/22 NCC nguyên. Phiếu UAT thật của team ĐÃ tồn tại (PE/2026/A/001+) — **KHÔNG wipe nữa khi chưa hỏi**.
- **Quy trình rename natural-key (gotcha #62):** UPDATE DB prod+Dev TRƯỚC → push seed mới SAU (per-code idempotent, sai thứ tự = nhân đôi). **sqlcmd file tiếng Việt (gotcha #61):** `-f 65001` + verify qua API JSON, đừng tin console VPS.
- **SearchableSelect** (`components/ui/SearchableSelect.tsx` ×2 app) = combobox chuẩn mới cho dropdown lớn — fold bỏ dấu, tái dùng cho dropdown users/khác khi cần.
- **Suppliers authz asymmetric S59:** POST = any-auth (quick-add) · PUT/DELETE = Admin+CatalogManager (giữ S57) — probe live 4/4 OK. WorkItems/Catalogs write vẫn khóa nguyên.

**🔴 NEXT SESSION (anh pick):**
- **Ops của anh (giữ từ S58):** ① `tzutil /g` VPS confirm `SE Asia Standard Time` · ② email anh Chương → dọn typo `chuong.phan@solution.com.vn` · ③ báo 5 real staff password `User@1234567` + đổi · ④ gán người thật CNTT → lock nv.cao/nv.truong.
- **🟪 test-after guard:** `LockDemoSampleUsersAsync` (S58) + suppliers asymmetric authz (S59) — IdentityFixture sẵn.
- **PE polish sâu** (PeDetailTabs 111KB session riêng) · **PermissionGuard per-route** khi golive HRM/Office · **Phase 9 Ops** (SMTP/backup/creds/UAT).
- **Monthly audit 2026-07-01:** **STATUS/HANDOFF re-tier (defer ×2 — ƯU TIÊN)** · curate L1 cicd-monitor ~46KB + investigator-codebase 32.9KB · schema-diagram §16+ ERD Mig 32-49.
- **Cert** `api.solutions.com.vn` expire ~2026-07-23 (auto-renew ~06-23).

---

## S58 chiều (2026-06-11) — Ẩn modules + Danh mục cuối (Run #383) + fe-user redesign guide AI_INFRA (Run #384)

**Anh (sau lock fix): screenshot eoffice "tạm ẩn các tính năng này + thu hồi phân quyền User" + "Danh mục đưa xuống cuối" → "check email AI_INFRA" → "chỉnh giao diện giống vậy, giữ brand màu SOLUTION".**

**Done (2 commit `6c5fd26` Run #383 + `e959f72` Run #384, đều prod-verified):**
- **Ẩn + thu hồi:** `RevokeTemporarilyHiddenModulesAsync` (4 cờ false non-Admin trên `Hrm*`/`Off*`/`Personal`, giữ row) + grant scope thu hẹp + `Master` Order 20→**80**. Menu-tree đối chứng 2 chiều ✓ (nv.test mất 3 nhóm / admin còn). eoffice user thường còn: Hộp thư · PE · Danh mục (cuối). ⚠️ URL trực tiếp chưa chặn (không PermissionGuard per-route — OK cho "tạm ẩn"; golive flip: gỡ prefix revoke + thêm lại `InReviewScope`).
- **Email AI_INFRA processed:** UI/UX guide canonical 13 mục (`D:\Dropbox\CONG_VIEC\AI_INFRA\docs\reference\ui-ux-design-guide.md`) + FYI stamp-hash lesson + **ACK H4 ACCEPT** (SE sister đầu tiên trọn vòng H4.7).
- **fe-user redesign:** 🩷 designer 14 file (mirror fe-admin S55 + rubric guide) — density-first, **BRAND GIỮ** #1F7DC1 + Be Vietnam Pro + slate. Keys/props STABLE. Bundle user `CKjwqnGL` rotate / admin frozen / brand verified prod HTML+CSS. ⚠️ Designer truncated #53 lần 2 cùng điểm (trước FD2 screenshot) → em main recover + self-gate; **authed-pages visual gate cuối = anh mở eoffice xem mắt**.

**🔴 NEXT bổ sung:** anh login eoffice xem giao diện mới (visual gate) · khi golive HRM/Office → flip revoke + cân nhắc PermissionGuard per-route · gửi email-back AI_INFRA nếu có pattern hay từ fe-user redesign (2-way welcome, guide §F4).

---

## S58 (2026-06-11) — Fix lock-demo-user prod NO-OP + password-seed root-cause (1 code commit prod-verified Run #382)

**Anh: `/session-start` → bootstrap bắt Run #381 PARTIAL + 2 dirty S57bis → recon → anh chốt 3 quyết định (union+password-fix · giữ chuong.phan-typo · giữ nv.test) → ship 13:00, prod-verified 13:05 (deadline 15:00 dư ~2h).**

**Done (commit `5998163` → Run #382 PASS ~3m31s):**
- **Fix `DbInitializer.cs` 2 chỗ:** lock list union 20 email UAT-matrix prod thật (`{act,equ,fin,hra,pm,qs}.{nv,pp,tp}@` + `bod.{1,2}@` — tạo TAY 05-13, exact-email KHÔNG pattern) + `DemoUserPassword` `User@123456`→`User@1234567` (11→12 ký tự, thỏa prod `RequiredLength=12` — root cause CreateAsync silent-fail mọi user seed trên prod từ trước, luôn cả nv.cao/nv.truong IT pool + 5 real staff).
- **🟩 cicd Run #382:** prod Users **55/21 active/34 locked** ✓ · nv.cao+nv.truong CREATED+ACTIVE (**ops S56 "gán user IT" RESOLVED** — helpdesk round-robin sống) · 5 real staff created+active · guard 6/6 (admin/catalog.manager/nv.test/chuong.phan-typo/binh.le/binh.lethanh) · nv.test login+authed 200 · bundle FROZEN `CP4CB1ym`/`BmZ3VHnm` · Mig giữ 49 · 93 tables · custom Identity table = `Users` (không phải `AspNetUsers`).
- **Closeout S57bis residual:** commit 2 dirty (gotcha #59 + cicd Run #381 entry) · gotcha **#60** NEW · 4 spawn-record on-behalf (H2 Coverage 4-MISS đóng) · H1 5-patch (ef-core +Mig 49 row · skills/README · dep-audit · CLAUDE.md root) · STATUS/HANDOFF flush S57bis+S58 · menu keys re-ground **57** · RAG 2420.

**🔴 NEXT SESSION (anh pick):**
- **Ops của anh:** (1) `ssh vietreport-vps "tzutil /g"` → confirm `SE Asia Standard Time` · (2) hỏi anh Chương dùng email nào → dọn `chuong.phan@solution.com.vn` typo (đang active chủ đích) · (3) báo 5 real staff mới (`thanh.lethanh`, `anh.nguyen`, `tring.le`, `truong.le`, `long.nguyen`) password mặc định `User@1234567` + yêu cầu đổi · (4) khi gán người thật vào CNTT → thêm nv.cao/nv.truong vào lock list.
- **test-specialist guard test** cho `LockDemoSampleUsersAsync` (test-after — deadline trade-off S58, IdentityFixture sẵn).
- **FE redesign Phase 2** (recon ready) · **Phase 9 Ops** (SMTP/backup/creds/UAT) · **monthly audit 2026-07-01** (kèm schema-diagram §16+ Mig 32-49 ERD debt + L1 cap curate cicd-monitor 32.2KB/investigator-codebase 32.1KB + STATUS/HANDOFF re-tier).
- **Cert** `api.solutions.com.vn` expire ~2026-07-23 (auto-renew ~06-23).

---

## S57bis (2026-06-11 sáng) — PE gắn Hạng mục công việc (Mig 49) + Pe all-role + menu "Cá nhân" + Harness-4 runtime-VERIFIED (Run #381 PASS+1PARTIAL)

**Sếp Zalo 11:02-11:17 deadline 15:00: mapping master data + phân quyền PE all-user + flow tạo phiếu Dự án→Hạng mục→NCC + clear data cũ. Anh chốt: khóa CHỈ user sample · quyền Xem+Tạo · 1 phiếu 1 hạng mục header. 2 commit `17b23a4` (Harness-4) + `dd117b7` (product 26 file) → Run #381 PASS ~4m25s.**

**Done:**
- **Mig 49 `AddWorkItemToPurchaseEvaluation`** (🔵 database-agent design): PE.WorkItemId `Guid?` loose-Guid KHÔNG FK vật lý (convention PE) + IX + validator NotEmpty create-only + FK-guard `AnyAsync(IsActive)`→Conflict + UpdateDraft null-safe (chống null-hóa S42). WorkItems = catalog GLOBAL → 2 dropdown độc lập, "Dự án (năm) – Hạng mục" = chuỗi ghép. FE ×2 (PeHeaderForm SHA256 IDENTICAL). **Pe_* all-role 130 rows/13 role** (Pe_* leaf KHÔNG trong `MenuKeys.All` → factory; PeWf_* GIỮ Admin). Menu Personal root@30 + re-parent + Master write-lock ×3 controller. Excel (3) = NO-CHANGE vs S55. Test 228→**240** (+12). **Harness-4 runtime-VERIFIED** (spawn-test 2 chiều) + email-back AI_INFRA.
- ⚠️ **Lessons:** 2 builder truncated #53 + reviewer **die-0-byte ×2** → em main solo vá + self-gate. Đóng VỘI → 2 file dirty trôi S58 (đã commit S58). `LockDemoSampleUsersAsync` 14 email = prod NO-OP (population Dev-only — cicd #381 bắt, → **RESOLVED S58**). → session log `2026-06-11-S57bis-pe-workitem-perm-golive-prep.md`.

---

## S56 (2026-06-09) — Pre-golive verify sweep + golive-harden 4 fix (HMW 2-workflow · 1 code commit prod-verified)

**Anh: `/session-start` → hỏi NAMGROUP UI density-first → "Tiếp Phase 2 redesign" (dismiss scope → defer) → "kiểm tra lại tính năng + master data, sắp golive" + `/ultra-on` → "fix hết workflow luôn" → `/session-end`.**

**Done (commit `a20cde8` → Run #379 PASS ~4m20s, prod-verified):**
- **WF1 `pre-golive-verify`** (7 stream song song → adversarial-per-issue): prod-truth/schema/4×logic/authz-curl. **6/7 PASS · 1 CONCERN · 0 blocker · 8 issue (confirm 6 real)** = **GO**. Insight: phát hiện đáng giá nhất = **ops/data không phải bug code** — prod phòng IT (CNTT) 0 active user → helpdesk inert (chỉ live-curl+sqlcmd thấy) + S43 LeaveBalance lost-update còn nguyên + master-data idempotency PROVEN.
- **WF2 `golive-harden`** (Design→Build→Test→Review∥): **#3** LeaveBalance lost-update → database-agent design **atomic `ExecuteUpdateAsync`+Serializable tx** (NO migration, exactly-once nguyên) · **#5** ItTicket authz Forbidden-trước-NotFound (fail-closed) · **#6** DocxRenderer null-guard (CS8602 2→0) · **#4** Travel/Vehicle ApproveV2 +4 smoke. Test **216→228**.
- **🟥 reviewer stage StructuredOutput-FAIL** → em main đỡ cross-stack review (3 diff clean). **🔵 database-agent PASS** + 1 MAJOR (convention) → em main bump `IsolationLevel.Serializable`. **🟩 cicd Run #379 PASS** (228 test · bundle frozen BE-only · Mig 48 · health 200).
- **Closeout:** gotcha **#58** NEW (EF read-modify-write lost-update) · doc-drift patched (agents/README database-agent verified-runtime · ef-core skill 47→48 · sys.tables 92→93 reconciled · docs/CLAUDE 93/Mig48) · **H2 GATE 4.5/5** (Fidelity: Serializable-correction appended impl/test MEMORY).

**🔴 NEXT SESSION (anh pick):**
- **2 ops VPS — của anh (CHƯA làm):** (1) gán ≥1 user thật vào phòng IT (`UPDATE Users SET DepartmentId='65CC6307-BF3A-4F42-9B83-18FE187F46BB' WHERE Email='<email>@solutions.com.vn'`) — helpdesk inert vì 0 active user · (2) `ssh vietreport-vps "tzutil /g"` → confirm `SE Asia Standard Time` (codegen mã đơn dùng năm giờ-server).
- **FE redesign Phase 2 (DEFERRED — recon READY):** build `ui/Drawer.tsx` (chưa có) + tách `InlineEditRow` (mẫu `EmployeesListPage:256`) → áp Drawer (Suppliers/Projects/Users ≥8 field) + bậc-thang (Catalogs/MeetingRooms/HrmConfigs Dialog→inline) cho Master/Office/System/HRM. **Scope chờ anh chốt:** Budget (2 trang) + 3 WF-Designer = IN hay OUT (default em đề xuất **OUT**). fe-user mirror = Phase 3. NAMGROUP density-first, giữ brand #1F7DC1 + Be Vietnam Pro. Authed-page visual qua deploy-prod (dev-rig chặn authed screenshot, designer gotcha #3).
- **Phase 9 Ops** (go-live blockers): SMTP outbound (em code-able greenfield `IEmailSender`) · SQL backup register · rotate creds · UAT.
- **L1 soft-cap chore (H2):** cicd-monitor 29.2KB + investigator-codebase 28.4KB + reviewer 28KB ≈ 30KB cap → archive L2 next curate.
- **Monthly audit 2026-07-01:** root CLAUDE.md count-sweep còn (test "203"→228, "92 bảng"→93 ×several, gotcha "57"→58, ASCII tree "128") — defer deliberate (monthly mechanism).
- **Cert** `api.solutions.com.vn` expire ~2026-07-23 (auto-renew ~06-23).

---

## S55 (2026-06-09) — Nạp master data thật từ Excel + Project +4 cột (Mig 48 · HMW-mode ON · 1 commit prod-verified)

**Anh: `/session-start` → giao file Excel "HẠNG MỤC CÔNG VIỆC DỰ ÁN" → "nạp master data vào đi nhé" → `/ultra-on "workflow làm xong hết đi nhé"`.**

**Done (commit `69cb393` → Run #377 PASS ~4m33s, prod-verified):**
- **Nạp 62 dự án + 71 hạng mục + 3 NCC** vào `Project`/`WorkItem`/`Supplier` (real company data từ Excel 7-sheet). `WorkItem` master ĐÃ tồn tại → no new table.
- **🟨 BE:** Project +4 cột nullable (Year/Investor/Location/Package) + **Mig 48 `AddProjectMasterFields`** (3-file, no new table) + ProjectFeatures DTO/Create/Update +4 + **`SeedRealMasterDataAsync`** (per-code idempotent, **UNGATED** line 118 → reaches prod, coexist demo).
- **🟧 FE:** ProjectsPage form +4 input ×2 app SHA256 mirror + bonus cột "Chủ đầu tư".
- **Verify:** build 0 · test 216 (compile-fix only) · runtime Dev proof · cicd Run #377 (Mig 48 prod · Projects 6/6 · WorkItems 71 · Suppliers 3 · CAL01.Investor exact · bundle `B-d6893W`/`XdKzt9LL` rotate · health 200).
- **Decisions:** Q1 cột thật+migration · Q2 deploy prod. FLOCK01 collision → skip (demo wins).
- ⚠️ **Lessons:** 2 agent return truncated (implementer-backend + reviewer, gotcha #53) → em main recover qua disk/runtime (build/test/sqlcmd/git), KHÔNG agent return-message. cicd **verdict-FIRST brief → KHÔNG truncate** (PASS clean) — reinforces emit-verdict-early. Real-data import: extract Excel → generated spec file (chống brief-truncation) → runtime Dev proof TRƯỚC prod.

**🔴 NEXT SESSION (anh pick):**
- **Phase 9 Ops** (go-live blockers — anh main coordinate): SMTP outbound (em code-able greenfield `IEmailSender`) · SQL backup register (`scripts/backup-sql.ps1` READY → schtasks) · rotate creds · UAT real-user.
- **Doc-drift D1** (H1-flagged, anh dừng S55): `agents/README.md:4` database-agent "🔴 Cần CLI restart → executed-file" → "✅ verified-runtime S53" (1 dòng).
- **Monthly drift audit 2026-07-01** (cron) — investigator-codebase ground-truth + H1 chốt; re-ground cicd `sys.tables=93` vs 92.
- **Optional:** master data — nếu cần thêm field Project (StartDate/EndDate/Budget cho dự án thật) hoặc full NCC list (hiện 3 mẫu) · sửa tên demo FLOCK01 nếu chồng real.
- **Cert** `api.solutions.com.vn` expire ~2026-07-23 (auto-renew ~06-23).

## S54 (2026-06-08) — IT staff tự reassign ticket (cross-stack authz · HMW-mode ON · 1 commit prod-verified)

**Anh: `/session-start` → "2 xong sau đó là 1" (task 2 reassign trước, task 1 Phase 9 Ops sau) → task 2 done → "/session-end". Task 1 anh dừng (không khởi động).**

**Done (commit `ca4b602` → Run #376 PASS ~4m18s, prod-verified):**
- **Feature:** cho **tổ IT (dept Code=="IT") + Admin** reassign ItTicket trên CẢ 2 app (S53 chỉ Admin/fe-admin). "IT staff" = `User.DepartmentId == IT-dept.Id`. NO migration (DepartmentId reuse).
- **🟨 BE:** NEW `GetAssignableItStaffQuery`→`{CanReassign,Staff}` capability endpoint (`[Authorize]` any-auth, `{false,[]}` cho người ngoài) + `AssignItTicketHandler` authz Admin-OR-IT (Forbidden) + assignee-must-IT (Conflict) + controller `/assign` hạ Authorize-Roles→Authorize (handler fine-grained).
- **🟧 FE:** fe-admin+fe-user `ItTicketsPage.tsx` **SHA256-identical** (reverse S53 divergence) — nút gate `canReassign`, dropdown `/assignable-staff`. +2 type.
- **🟪 Test:** +13 (203→**216**) authz guard test-before-merge. **🟥 reviewer PASS** (role-string "Admin" chain-verified real). **🟩 cicd Run #376** bundle cả 2 rotate, smoke OK, Mig giữ 47.
- ⚠️ **Residual:** 3 agent ghi MEMORY nhầm `src/Backend/.claude/` (cwd-relative khi cd subdir) → em main bắt qua git-status + reconcile canonical + harvest delta. → memory `feedback_agent_cwd_relative_memory_misland`.

**🔴 NEXT SESSION (anh pick):**
- **Task 1 Phase 9 Ops** (đã scope sẵn — anh dừng S54): **SMTP email outbound** (em code-able — greenfield `IEmailSender`+`SmtpEmailSender` config-driven appsettings `Smtp` section + wire `NotificationService` gửi email cạnh in-app notif tới `User.Email`, no-op an toàn khi chưa creds; built-in `System.Net.Mail.SmtpClient` đủ, không cần MailKit NuGet trừ khi anh muốn; **cần anh quyết: notif nào → email + có SMTP provider/creds chưa**) · **SQL backup register** (`scripts/backup-sql.ps1` READY → em đưa lệnh schtasks daily-2AM retention-30d, anh chạy VPS) · rotate creds + UAT real-user (anh-infra).
- **Monthly drift audit 2026-07-01** (cron) — flag S54: cicd `sys.tables=93` vs STATUS 92 re-ground.
- **Cert** `api.solutions.com.vn` expire ~2026-07-23 (auto-renew ~06-23).

## S53 (2026-06-08) — gotcha #57 EXT Master (Mig 47) + P11-D reassign-UI + P11-E menu-key + database-agent verified-runtime (HMW-mode ON · "làm hết" full closeout · all prod-verified)

**User: `/session-start` → "Workflow làm nhanh" (Task B) → "làm hết luôn đi" (C+D+E+session-end). 2 code commit + docs closeout, all Gitea-verified prod.**

**Done:**
- **Bootstrap (3 governance agents):** database-agent **verified-runtime** spawn-test (first real spawn since S52 adopt — CLI restart confirmed; caught **Mig 46 committed-but-unapplied-local** drift) · H1 tooling-auditor + H2 harvest-curator re-report (S52 closeout debt cleared; H2 0-orphan, S52 proxy-append verified present).
- **Task B — Mig 47 `FilterMasterCatalogUniqueIndexesByIsDeleted`** (`44b9e54`, Run #260): gotcha #57 EXT to 3 Master (Department/Supplier/Project) filtered-unique Code. Workflow test-specialist→implementer-backend→reviewer (PASS). Test 200→203. Prod: 3 indexes `filter_definition` NULL→`([IsDeleted]=(0))` live. **gotcha #57 EXT backlog CLOSED (6× cumulative: Holiday 43 + 3 HRM 45 + 3 Master 47).** Bonus: Mig 46 local catch-up (Dev+Design).
- **Task C+D** (`dbf6648`, Run #261): C = ItTicket admin reassign-UI (fe-admin only divergence; per-card dialog reuse `PUT /assign` + `GET /users`). D = `Off_AttendanceReport` menu-key leaf (no migration, DbInitializer idempotent seed, admin-perm auto via `All[]`, 5 mirror points byte-identical). Workflow implementer-backend→implementer-frontend→reviewer (PASS). Prod: menu row seeded + admin bundle `DfCfHUE9` rotated / user unchanged.
- **Doc-drift E + closeout:** H1 top-5 patched (ef-core 43→47, roster 10→11, CLAUDE.md root 45→47/186→203, docs/CLAUDE.md 56→57/91→92) · database-agent adap-report→verified-runtime · STATUS/HANDOFF/session log.

**⚠️ Lessons:** cicd-monitor truncated 2× (gotcha #53/#55) → curl-self-verify recovery (Gitea run + bundle hashes public, no re-spawn). database-agent first spawn earned ROI immediately (caught local-DB drift that SQLite-tests + CI-prod both miss). Menu-key = 5 mirror points (gotcha #50) — reviewer byte-verified all 5.

**🔴 NEXT SESSION (anh pick):**
- **Phase 9 Ops** (go-live blockers — anh main coordinate): SMTP outbound · rotate creds · SQL auto-backup register · UAT 2-3 real user 1 tuần.
- **Monthly drift audit 2026-07-01** (cron) — investigator-codebase ground-truth + H1 chốt.
- **Optional minor:** mirror ItTicket reassign to fe-user (nếu employee cần) · RAG re-index S42-S53 (AI_INFRA op, stale 05-29).
- **Cert** `api.solutions.com.vn` expire ~2026-07-23 (auto-renew ~06-23).

---

## S52 (2026-06-08) — Phase 11 D+E+F close + database-agent adopt (HMW-mode ON · session-limit recovery · deployed prod)

**User: `/session-start` → "Cả 3 (D+E+F)" → pivot "Adopt database-agent" → để em chạy. 3 commit deployed prod.**

**Done (3 commit, deploy verified curl độc lập — no cicd-spawn do limit):**
- **database-agent adopt** (`e9ee97f`) — AI_INFRA broadcast `2026-06-08-Agent-database-codebase-agents`. Floor DB1–DB11 **READ-advisory** (impl-backend vẫn author) · skill `sql-database-assistant`+`ef-core-migration` · color OMIT · `store_memory` strip · DB11 vá S43 lost-update. **codebase-agent SKIP n-a** (investigator + csharp-lsp Windows no-op). Roster 10→**11**. **Nấc executed-file → CHỜ restart.**
- **Wave 1 (`6a66429`) P11-E+F migration-free:** P11-F MaTicket gen-on-Create (`IT/2026/NNN` Serializable). P11-E AttendanceReport monthly aggregate (OtPolicy multiplier, day-type in-memory) + Excel ClosedXML + fe-admin report page (download authed blob). reviewer PASS (gotcha #44 disarmed: decoy `"QTV"`=display-code). +5 test.
- **Wave 2 (`dcf76f8`) P11-D Mig 46:** round-robin least-loaded dept-"IT" (seed dept IT + nv.cao/nv.truong, ordering sau SeedDemoUsers) + SlaDueAt-by-Priority (4/8/24/72h) + `ItTicketSlaJob` (breach+warning, **no auto-transition**) + PUT /assign + FE badge 2-app SHA256 mirror. +9 test. em main self-review (limit).
- **Deploy verified:** admin `DYfjnpY0`/user `_3S0BPJ2` rotate · api 200 (Mig 46 applied) · /it-tickets+/assign+/attendances/report 401 wired. **Test 200 PASS** (58+142).

**⚠️ Session-limit recovery lesson:** 3 agent killed mid-Wave-2 (FE/test/cicd, "resets 1:10pm"). Recovery: BE/test verify-on-disk (build 0-err + 200 test) · **em main solo FE redo** (gotcha #53-class fallback) · **curl-self-verify** deploy thay cicd-spawn. → **git/disk/prod = source-of-truth, KHÔNG agent return-message** (`feedback_implementer_truncation_mitigation`).

**🔴 NEXT SESSION:**
- **🔴 RESTART CLI** → activate `database-agent` (registry load, no hot-reload) → spawn-test 1 task DB nhỏ (đọc schema `sys.tables` / introspect ItTicket) → upgrade executed-file → **verified-runtime**. adap-report nấc update.
- **Memory-proxy debt:** Wave 2 `implementer-backend` + `test-specialist` diaries KHÔNG update (killed trước MEMORY step) → em main proxy-append S52 learnings (round-robin dept-pool · SLA-window-shared-map · seed-ordering-sau-SeedDemoUsers · round-robin/SLA-due test pattern). **Đã proxy S52 closeout** (xem agent-memory).
- **H1/H2 monitor closeout SKIPPED S52** (session-limit) → next `/session-start` re-report tooling/harvest diff.
- **Follow-up minor:** ItTicket reassign-UI (endpoint `/assign` sẵn) · P11-E menu-key promote (hiện via button) · **gotcha #57 EXT Master = Mig 47** (Mig 46 đã dùng P11-D) · RAG re-index S42-S52 (AI_INFRA op, stale 05-29).
- **Product:** Phase 11 = DONE. Next = Phase 9 Ops (SMTP/creds/backup/UAT real-user) — anh main coordinate.

---

## S51 (2026-06-08) — P11-C Vehicle+Driver catalogs + gotcha #57 ext (HMW-mode ON · product feature · deployed prod)

**User: `/session-start` → "P11-C Vehicle+Driver" → "làm đi / chạy luôn cho nhanh". HMW fan-out, ship to prod.**

**Done (commit `30a99aa` → Gitea Run #371 PASS ~4m18s, verified prod):**
- **Mig 44 `AddVehicleAndDriverCatalogs`** — extend HrmConfigs +2 declarative kind (Vehicle/Driver), 2 catalog table filtered-unique day-1. BE Region 5/6 CRUD + Controller +2 route (GET public/write Admin) + MenuKeys +All (auto perm) + DbInitializer idempotent seed. FE KIND_CONFIG +2 ×2 app SHA256 mirror + 4-place (`:kind`-driven, no new route). Tables 91→**92** (sys.tables ground-truth — narrative "93" was +1 drift).
- **Mig 45 `FilterHrmCatalogUniqueIndexesByIsDeleted`** (bundled gotcha #57) — LeaveType+ShiftPattern+**OtPolicy** filtered (3 HRM catalog; OtPolicy missed in "2 catalog" backlog, caught via grep). +5 test-before (181→**186** RED→GREEN).
- **reviewer caught 1 MAJOR** → fixed: Driver FE↔BE required-field mismatch (root = inconsistent em-main brief BE-required vs FE-optional).
- **cicd Run #371:** bundle admin `Cg9mvltU`/user `YgqDvsqr`, 5 idx filtered `([IsDeleted]=(0))` live, smoke 200, /hrm-configs/{vehicles,drivers} wired.

**🔴 NEXT SESSION:**
- **gotcha #57 EXT (worktree session đang chạy):** Department/Supplier/Project (Master) → Mig 46 (3 idx, confirmed-reachable). Merge khi xong — nó tạo Mig 46; main KHÔNG tạo migration nào nữa → no conflict, chỉ cần sequence đúng.
- **RAG/Qdrant DOWN:** restart `rag-infra.ps1 -Action ensure` (AI_INFRA repo) → verify `list_projects`. RAG re-index S42-S51 stale (AI_INFRA op).
- **AI_INFRA-side carry-over:** `/check-email se` pull S50 handshake.
- **🔌 NEW-ALLOC `database-agent`** (AI_INFRA broadcast `2026-06-08-Agent-database-codebase-agents`) — H1 + em main recommend **`/adap-apply`** (STRONG-FIT: DB11 RowVersion fixes S43 lost-update gap; template `AI_INFRA/docs/templates/database-agent.agent.template.md`). 5 caveats: 9th color · EF-pin guard (sql-database-assistant ≠ cover EF Core → pair `ef-core-migration`) · DB7 boundary vs implementer-backend (DB=design/perf/review, impl=author) · executed-file nâc only (runtime PENDING restart+spawn-test) · model:inherit + store_memory-strip. **codebase-agent = SKIP** (investigator covers + csharp-lsp Windows no-op). Needs CLI restart → next session.
- **Product (anh pick):** P11-D ItTicket SLA / P11-E AttendanceReport+OtPolicy multiplier / P11-F MaTicket / Phase 9 Ops.
- **Doc-drift backlog → monthly audit 2026-07-01 (H1 exact coords):** `docs/CLAUDE.md:65` (56→57) + `:70` (91→92 + "Mig 27-42"→"32-45") · `.claude/skills/README.md:20` (ef-core 43→45, S45→S51) · `agents/README.md:157` (plugin "18 enabled"→"18 registered/15 enabled/3 disabled") + `:223` S38-snapshot · **schema-diagram §16+ Mig 32-45 = 14-mig debt (dedicated session)** · cicd-monitor MEMORY essentials label S51-work as "S50" (cosmetic) · STATUS/HANDOFF over-tiering re-tier.

---

## S50 (2026-06-07) — S49 Harness 1·2·3 verified-runtime closeout (HMW-mode ON · infra-finish, no product, CI-skip)

**User: `/session-start` → chọn "Finish S49 infra" → `/session-end`. Đóng trọn 3 phần S49 milestone (verified-runtime).**

**Done (em main + 4 sub spawn — all background per visibility feedback):**
- **(a)** `/session-start` spawned 2 monitor sub (tooling-auditor H1 + harvest-curator H2) → **verified-runtime CONFIRMED**. H1 caught + em main patched 3 freshness drifts (plugin 15→18, skill-index 31→43 mig / 49→57 gotcha, verified-runtime markers). H2 harvest 🟢 clean (0-byte/orphan=0). Test **181 PASS**, RAG 2415.
- **(b)** H2 **wave-mode VERIFIED** — Workflow `hmw.js` wave-run `h2-verify` (Run `wf_b7e4d6ef-787`, 2-agent: investigator-codebase read-only + test-specialist write-direct). **B6 isolation HELD** (git status 6-baseline, sub-MD gitignored, chunk 2415=2415, B4 both-paths). Bonus: gotcha #57 exact coords.
- **(c)** H3 **email send-path VERIFIED** — `/send-email ai_infra` handshake (body-hash `c9656c19…` self-verified MATCH) → `broadcasts/outbox/ai_infra/` + `_index.md` OUTBOUND.
- **session-end §L:** H2 GATE **PASS 5/5** + B5 wave-gom (2 sub-MD → agent-memory). H1 freshness CHỐT (0 new-alloc). §L.a scan: no new RCA (E-005 git-add guard held — staged specific files).

**🔴 NEXT SESSION:**
- **AI_INFRA-side (their step):** `/check-email se` → pull SE handshake → confirm **2-way byte-identical**; optional reply `/send-email se` so SE tests receive-path (`ai_infra/outbox/se/` currently empty).
- **Product (anh pick):** P11-C Vehicle+Driver (Mig 44, recon ready) · **gotcha #57** (coords ready: `LeaveTypeConfiguration.cs:19` + `ShiftPatternConfiguration.cs:19`, template `HrmConfigHolidayTests.cs:180-197`, test-before) · P11-D/E/F · Phase 9 Ops.
- **Cleanup (optional):** wave-folder `.claude/workflows/wave-h2-verify/` harvested → safe to delete (gitignored transient).
- **Doc backlog (low):** STATUS Recently Done + HANDOFF over tiering (re-tier next consolidation) · `agents/README.md:13` ASCII 7→10 lanes (cosmetic).

---

## S49 (2026-06-07) — AI_INFRA Harness 1·2·3 adopt (HMW-mode ON · governance/infra, no product code)

**User: `/ultra-on` + `/adap-apply harness 1·2·3` — BẬT HMW-mode rồi adopt 3 broadcast harness của AI_INFRA.**

**HMW flow:** marker `.claude/hmw-mode.on` tạo (ON) → P2 recon fan-out **4 read-only agent** (3× investigator-codebase gap H1/H2/H3 + 1× investigator-api plugin audit · return-delta · 367K tok ~4m46s) → P3 harvest → em main single-writer WRITE ~25 file → reviewer P4 **PASS all 3**. **Containment post-P2:** git-diff 1 file-write (inv-api self-MEMORY benign) + chunk-count 2414=2414 (0 RAG-write) = defense-in-depth proven.

**Done:**
- **H1 (Self-observability):** roster **8→10** — NEW 2 sub TÁCH BIỆT (anh-mandate H1≠H2 "hay quên+nhầm") `tooling-auditor` (tooling/docs-freshness 4-mặt) + `harvest-curator` (harvest-integrity 5-trục), INFORM-only (4 RAG-read, NO store_memory/Write) + 2 memory seed. Wire `session-start.md` Phase 2.1.1 RE-REPORT + `session-end.md` §L.b 6→7-step. H3 plugin/skill = gộp-vai doc (0 agent mới).
- **H2 (wave-folder isolation):** `hmw.js` wave-mode (subMdPath + tool-aware writeGuard) + `.gitignore` `wave-*/`+`agent-teams/` (B6 **git-check-ignore VERIFIED**) + NEW `.claude/workflows/README.md`. ADD-mode (chỉ workflow DÀI). A agent-team n-a (Windows in-process).
- **H3 (email channel):** NEW `broadcasts/` (outbox/{6 others+all} + inbox/{6 others} + _index + inbox/README + **13 .gitkeep**, committed) + 2 cmd send/check-email (self=`se`, 6 others short-id `{ai_infra,vipix,dyd,namgroup,ashico,bvaau}`) + adap-apply base-path fix `outbox/all/`.
- **3 adap-report** `docs/governance/adap-reports/2026-06-07-Agent-harness-{1,2,3}.md` + reviewer PASS (no blocker; 1 MINOR pre-existing README diagram → fixed). **Test 181 unchanged** (no .cs).

**🔴 S49 NEXT-FIRST — status S50:** restart done. (a) ✅ **DONE S50** — `/session-start` spawned 2 monitor sub, both loaded + ran RE-REPORT clean → verified-runtime CONFIRMED (H1 found 3 freshness drifts → patched; H2 harvest 🟢 clean, 0-byte/orphan none); (b) ✅ **DONE S50** — wave-run `h2-verify` (Run wf_b7e4d6ef-787, 2-agent): B6 isolation HELD (git status 6-baseline, sub-MDs gitignored, chunk 2415 unchanged), B4 both-paths exercised (write-direct + read-only-scribe); B5 harvest → harvest-curator @session-end; (c) ✅ **SE-side DONE S50** — `/send-email ai_infra` handshake written + body-hash self-verified (`c9656c19…`); **AI_INFRA `/check-email se` pull = their step** to complete 2-way byte-identical proof.

**Next product (anh pick):** P11-C Vehicle+Driver (Mig 44, recon ready) · gotcha #57 LeaveType/Shift filtered-unique · P11-D/E/F · Phase 9 Ops.

---

## S48 (2026-06-02) — adap-* verification closure post-restart + FD2 proof + Gov-v2 error-ledger

**User: "làm xong hết đi rồi session-end luôn" — đóng cả 3 adap item post-restart, rồi session-end.**

**Restart confirmed done** (registry có frontend-designer agent + adap-* commands + 8 subs KHÔNG store_memory) → S47 verified-pending nâng cấp. `/adap-apply all-pending` = 0 mới (cả 3 applied S47). `/adap-report all-applied` re-assess + update 3 report (honest §C5/G-015).

**Done (em main solo + 1 FD spawn):**
- **#1 store_memory strip → VERIFIED-runtime** — grep agents `tools:`=0 · registry 0/8 subs. (Caveat giữ: KHÔNG "read-only" — sub vẫn có Bash/Write; containment = defense-in-depth.)
- **#2 frontend-designer FD2 → VERIFIED-RAN** — 🩷 first real spawn (background). Full FD2 loop trên fe-user `/login`: read DS → Vite dev → Playwright shot 375+1440 → viewed PNG → FD4 rubric all-PASS → contrast fix `LoginPage.tsx:56` slate-500→600 → re-shot → build PASS. em main mirror fe-admin (parity). **Rig lessons (FD MEMORY):** (1) Vite-dev `networkidle` never fires → `domcontentloaded`+selector; (2) cold-start dep-optimize >15s → warm-up goto 60s. **Fact: SE = Tailwind v4 CSS-first** (`@theme{}` in index.css, **NO tailwind.config.js**).
- **#3 Gov-v2 delta → CLOSED (executed-file)** — NEW `docs/governance/error-ledger.md` (blameless RCA E-001..E-004 + Active-Guards 2-strike index + §L.a AS-1..AS-9 deterministic-detect + 3-ledger triad map) + §L.b 6-step wired `session-end.md` Phase 1.5 (ran live this session = demo).

**Code shipped:** `fe-{admin,user}/src/pages/LoginPage.tsx` subtitle contrast a11y (slate-500→600, ~7.5:1). Build ×2 PASS 0 TS error. **Test 181 unchanged** (FE-only, no .cs). → code commit deploys → 🟩 cicd-monitor verify bundle rotate.

**⚠️ NEXT SESSION:** (a) ✅ **DONE** — cicd Run #369 PASS, login fix live (admin `DPPTx2Kw`/user `CjoUEsoV`, Mig 43, health 200); no action; (b) §L.b chạy AUTO từ /session-end kế (session này chạy thủ công — command no hot-reload); (c) wire `reviewer` làm FD4 design-gate (quality-ADD, defer); (d) RAG re-index S42-S48 (AI_INFRA op).

**Next product (anh pick):** P11-C Vehicle+Driver (Mig 44, recon ready) · gotcha #57 LeaveType+Shift filtered-unique (test-before) · P11-D/E/F · Phase 9 Ops.

---

## S47 (2026-06-02) — AI_INFRA adap-* adoption channel + 3 broadcasts (infra/governance, no product code)

**Installed federated adoption channel** (AI_INFRA relay): 3 slash-commands `.claude/commands/adap-{apply,report,request}.md` (forked verbatim). Read AI_INFRA `broadcasts/outbox/` read-only (§J2) → apply own repo → `docs/governance/adap-reports/<id>.md`. 3 reports written. 0 agents spawned (em main solo).

**Adopted 3 broadcasts (all nấc executed-file / verified-pending — restart needed, agent/cmd `.md` no hot-reload):**
- **#1 store_memory strip** — removed from ALL 8 subs → **lead (em main) = sole RAG-writer** (em main keeps it). 4 RAG-read retained. Corroborates SE S41 re-bootstrap-loss lesson.
- **#2 frontend-designer (8th agent, pink)** — adopted (user call), forked canonical FD1–FD10 visual-verify floor, tailored SE stack + use-existing-DS + boundary ⟂ implementer-frontend.
- **#3 Gov-v2** — already-applied S44, delta report (gap: no formal error-ledger/§L.b checklist).

**🔴 NEXT SESSION FIRST (anh restart CLI):** 1 restart activates 3 commands + store_memory strip + frontend-designer. Then **spawn-test frontend-designer** small design task → confirm FD2 Playwright loop runs THẬT (upgrades #2 verified-pending → verified). Optional `/adap-report all-applied` re-confirm.

**Follow-ups (non-blocking):** (a) broadcast #3 formal error-ledger/§L.b checklist; (b) wire `reviewer` as FD4 design-gate; (c) RAG re-index S42-S47 (AI_INFRA op).

**Next product (anh pick):** P11-C Vehicle+Driver (Mig 44, recon ready) · gotcha #57 LeaveType/Shift filtered-unique · P11-D/E/F · Phase 9 Ops.

---

## S46 (2026-06-01) — Memory integrity repair (no code, docs-only)

**`/session-start` audit phát hiện S45 close-out để lại 2 file user-memory 0 byte** — `MEMORY.md` (index) + `feedback_background_spawn_visibility.md`. Index rỗng = S46 bootstrap chạy KHÔNG có memory auto-inject (degrade thầm lặng).

**Done (👤 em main solo, no agent spawn):**
- Rebuilt `MEMORY.md` index — 14 entry (8 feedback + 3 project + 2 pattern). Repopulate `feedback_background_spawn_visibility` từ HANDOFF/STATUS S45 ref (marked reconstructed). NEW `feedback_session_end_memory_write_verify`.
- Verified **0 empty `.md`** (`find -size 0` = 0). STATUS count drift "27"→**14** corrected. Test gate re-confirm 181 PASS lúc bootstrap.
- Memory files NGOÀI repo (`~/.claude/.../memory/`) → no git commit cho memory. Chỉ repo docs (STATUS+HANDOFF) = docs-only commit, CI skip.

**Root cause:** S45 session-end flush tạo stub rồi Write body truncate (gotcha #53 — S45 có test-specialist truncate). File 0-byte không báo lỗi + ngoài git-track → trôi tới S46 mới lộ.

**Next S47 (anh pick):** P11-C Vehicle+Driver (Mig 44, recon ready) · gotcha #57 fix LeaveType/Shift filtered-unique · P11-D/E/F · Phase 9 Ops · (optional) add verify-byte-count step vào /session-end skill — đề xuất AI_INFRA per charter v2.

---

## S45 (2026-06-01) — HRM test-gap stabilization + Holiday drift fix (Mig 43)

**2 commit `051b62b` (Tests +27) + `0c5a014` (Mig 43) → push → cicd Run #368 PASS, verified prod. 154→181 test.**

**Done:**
- **Đóng 3 test-gap deferred S35-S38** (stabilize before extend): Gap1 Holiday composite UNIQUE (7) + Gap2 EmployeeSatellite FK-invariant/soft-delete/cascade (10) + Gap3 gotcha #44 authz regression HrmConfigs+Employees (10). 🟪 test-specialist viết (return truncated #53 → 👤 em main verify-on-disk + proxy MEMORY).
- **Mig 43 `FilterHolidayUniqueIndexByIsDeleted`** (👤 em main solo) — Gap1 test lòi bug thật: Holiday DB UNIQUE (Year,Date) unfiltered vs handler `!IsDeleted` → admin xoá + thêm lại ngày lễ cùng date = **500 reachable**. Fix `.HasFilter("[IsDeleted]=0")` (khớp pattern 13×). 🟩 cicd verify filtered index live prod. Table vẫn 91 (index-only), FE bundle unchanged (đúng — BE-only).
- **🟦 P11-C recon sẵn:** Vehicle+Driver = extend HrmConfigs +2 kind declarative (Mig 44), giữ VehicleBooking free-text.

**gotcha #57 NEW:** soft-delete + UNIQUE → MUST `.HasFilter("[IsDeleted]=0")`. ⚠️ **LeaveType.Code + ShiftPattern.Code vẫn unfiltered** (cùng bug, backlog test-before). Process: `feedback_background_spawn_visibility` (foreground spawn im lặng "looks frozen" → đẩy background + report ngay).

**Next S46 (anh pick):** P11-C Vehicle+Driver (Mig 44, recon ready) · gotcha #57 fix LeaveType/Shift filtered-unique · P11-D/E/F · Phase 9 Ops.

---

## S44 (2026-06-01) — Monthly drift audit + AI_INFRA bundle 06-01 (docs-only, 2-way VERIFIED)

**4 commit `ae30f8f` → `5b8736d` → `071c25c` → `5dbcad3`, pushed, tree clean. CI-skip (all .md). 154 test unchanged (no code).**

**Done:**
- **Monthly cadence audit** (cron 2026-06-01, next **2026-07-01**): 🟦 investigator-codebase ground-truth-from-disk scan → 👤 patch **42 count-drift fixes** (`40→42 mig · 84/59/55/47→91 tables · 130/111→154 test · 52/49→56 gotcha`) across CLAUDE.md + docs/CLAUDE.md + ef-core/dependency-audit skills + schema-diagram + database-guide. schema-diagram migration table +Mig 17-42; ef-core history +Mig 27-42; detailed-§ ERD gap (Mig 27-42 modules) flag EXPLICIT → deferred backlog.
- **AI_INFRA bundle 06-01 adopt (full scope):** §A RAG T1/T2 auto · §C 7/7 agent-mem L1 ≤16KB + "25KB"→"~30KB tiered" ×7 · §D **#4 self-report step → /session-end Phase 6.3** (skip #1 have/#3 helper) · §E/§F report+ledger docs/governance. **AI_INFRA RT3 re-verified độc lập → VERIFIED 2-way, ĐÓNG HẲN.**
- **Carry-over S40 ĐÓNG** (`5b8736d`): BROADCAST-2 infra-feedback committed (governance trail) + `.mcp.json` gitignored (machine-path local, no secret).

**Lesson:** "incremented-per-session" counts drift → re-ground từ code monthly (count files). gotchas.md header KHÔNG có self-count → mỗi cite = downstream copy (patch từng chỗ). → memory `feedback_monthly_drift_audit`.

**Còn lại (AI_INFRA-owned, non-blocking):** eval baseline cite 11,922 cũ + SE full re-index (last-index 05-29, S42-S44 stopgap) → AI_INFRA op, batch chung web-MCP migration (ping nếu cần cross_project_search SE tươi sớm).

**Next S45 (anh pick):** product Phase 11 (P11-C Vehicle+Driver / P11-D ItTicket SLA / P11-E AttendanceReport / P11-F MaTicket) · test-gap backlog (Gap1 Holiday UNIQUE 🔴) · Phase 9 Ops.

---

## S43-S38 (older) → session logs

- **S43** (2026-05-30) Phase 11 P11-B LeaveBalance: Mig 42 `AddLeaveBalances` (90→91 tables, UNIQUE composite + FK LeaveTypes Restrict) + trừ phép exactly-once terminal DaDuyet (auto-create từ DaysPerYear, policy cho phép âm + cảnh báo) + FK invariant guard Create/Update + CQRS GetMy/GetUser/Adjust + FE "Số dư phép". 144→154 test, Gitea #367 prod, agents Max 0 bug. → `docs/changelog/sessions/2026-05-30-S42-S43-phase11-p11a-p11b.md`.

- **S42** (2026-05-30) Phase 11 P11-A: Mig 41 WireWorkflowAppsApprovalV2 (4 LevelOpinions + WorkflowAppCodeSequences) + 30 handler 4 module + Max re-review fix 2 FE picker bug. 130→144 test. → `docs/changelog/sessions/2026-05-30-S42-S43-phase11-p11a-p11b.md`.

- **S41** (2026-05-29) RAG corpus cleanup w/ AI_INFRA: `.claude/rag.json` exclude `**/`-anchored fix (gotcha #10) + store_memory reconcile 5/5 (anti-data-loss, at-risk rule) + re-bootstrap 3080→2406 (−674 junk, zero-loss verified). Standing infra backlog → AI_INFRA. Concurrency carry-over (BROADCAST-2 + `.mcp.json`) originated here → **resolved S44** (`5b8736d`). → memory `feedback_store_memory_rebootstrap_protection`.

- **S40** (2026-05-29) init audit 10-mục + doc consolidation (STATUS/HANDOFF 393KB→9KB zero-loss archive) + AI_INFRA bulletin adopt 4/4 (Tiered Memory v1 + /session-start /session-end slash commands LIVE) + RAG MCP recovery (quit+relaunch FRESH). **Concurrency carry-over** (BROADCAST 2 + `.mcp.json`) bắt nguồn đây — vẫn chưa đụng (xem S43).
- **S39** (2026-05-29) infra: Opus 4.8 1M + multi-agent split 4→7 (+investigator/implementer split +test-specialist) + budget +50% + gotcha #54/#55.
- **S38** (2026-05-28) 🎊 Phase 10 COMPLETE 11/11 — Mig 39+40 skeleton combo (Đơn từ/Đặt xe/Ticket/Chấm công/Dashboard NS). ApproveV2+LevelOpinions+LeaveBalance DEFER Phase 11 (→ làm xong S42-S43).

Detail đầy đủ → `docs/changelog/sessions/` + `docs/_archive/HANDOFF-preS40-fullhistory.md`.


---

## STATUS 'In Progress' stale rows (S80->S59) — cắt từ `docs/STATUS.md`

## 🔥 In Progress (S80)

| Task | Owner | Status |
|---|---|---|
| **S80 — curate L1 over-cap memory (reviewer 45→10KB · investigator-codebase 40→10KB · cicd-monitor 39→12KB) → L2 archive** — anh `/session-start` (bootstrap: 2 monitor RE-REPORT CLEAN + governance-detectors 26-flag baseline-safe + measure 3 over-cap + test **354** PASS) → "check làm thử đi" curate. em-main single-writer (gotcha race S71 = cấm sub ghi memory chung + truncation-sensitive → solo, KHÔNG workflow). archive-gate `memory-archive-gate.ps1` DRY-RUN = 3 sub **keep-floor-hit cannot-auto-drain** → **manual condense-with-archive**: 31 entries (13+15+3) move byte-exact (`sed`) → `archive/2026-06.md` (**+N −0** additive, 0 byte-loss) + 31 `_INDEX` substring pointer → **A7 GATE PASS 217/217** resolve. UPDATED stale foundation counts (130/263→**354** test · 55→**71** gotcha · Mig 40/55→**57** · 84→**88** table · bundle→#330). **0 production code, state THẬT GIỮ NGUYÊN.** **Lesson:** `_INDEX` substring **MUST quote-free** — A7 quote-parser cắt escaped-quote (`NamGroup \"PURO\"` pointer FAIL 1, self-grep miss → gate BẮT → fix quote-free phrase). WATCH (no-action A6 2-strike): frontend-designer 26KB + test-specialist 28KB (>autoinject <soft, strike-1<2). → log `2026-06-20-S80-curate-l1-overcap.md`. | 👤 + 🟫H1 + ⬜H2 monitor | ✅ |
| **S79 — adopt User-Mark (H-12/13) canonical §P + Harness-14 (Eval/Budget/Outcome) + chữ-ký RC** — anh `/check-email AI_INFRA` + `/adap-apply` step-by-step (workflow double-check mỗi step), rồi gõ `/user-mark-active-high` "áp đầy-đủ chính-xác nhất theo AI_INFRA, không hỏi thêm". em main + **4 Workflow** (invest `wf_82337f7f-95c` → review `wf_a7cbe93e-912` → align-re-review `wf_9d3beebb-a95` → H14-review `wf_4d4eba6f-8a0`). **0 production code.** Áp **canonical §P đầy-đủ** (P1-P10): 4 lệnh `.claude/commands/user-mark-{active-high,active,medium,disable}.md` (DACI report-before-stamp) + ledger `.claude/governance/ACTIVE-MARKS.md` (4 cấp **Active-High/Active/Medium/Disable** + display-filter) + `harness-11-engine.md §E`(P1-P10)+**§F**(H-14 3-mức maturity honest) + `rules.md §6.6` (objective-criteria KHÔNG quy-mô-đội/thời-gian-tuổi) + session-start §2.1.4/session-end §L.b(h) mark-display. **3 mark Active-High stamped** anh-confirm (`RC-pqhuy1987-20-06-2026-10-29-09/10/11` = objective-criteria/User-Mark/time-age). completeness-gate H-6→H-13 **ĐẠT** (H-8 soi: 11/11 inherit no-`[1m]`; H-7 Cat-6 real). §F floor 6/6 + maturity HONEST. **3 adap-report** + email ai_infra (`7b8615b3`). **Bài học:** broadcast cô-đọng→canonical command/§P là spec THẬT (em bản đầu MUST/TRACK→align lại khi anh trỏ `/user-mark-active-high`) · report-before-stamp dogfood (lệnh tự cưỡng-chế báo-cáo-trước-stamp, em hỏi anh = đúng lệnh) · investigator residual-write own-diary = OK (D9 áp canonical/memory-chính, không cấm sub ghi diary). **State THẬT GIỮ NGUYÊN: Mig 57 · 88 bảng · 354 test · gotcha 71 · menu 54 · bundle `CsJetgZH`/`BVS0ApIm`.** ⚠️ restart CLI (4 lệnh + session-cmd no hot-reload — skill-list đã hot-register tên). **🔴 NEXT (em):** curate L1 over-cap reviewer/cicd/inv (carry 7-session, +workflow-spawn S79) · §7-header `rules.md` "77 test" stale → C2/monthly-audit. → log `2026-06-20-S79-user-mark-harness-14-adopt.md`. | 👤 + 8 review-agent (4 wf) | ✅ |
| **S78 — PE: đính kèm file khi DUYỆT (UAT Tra Sol / 5 tester)** — người duyệt tải file của mình lên ngay lúc Duyệt thay vì Trả lại phiếu. Reuse hệ attachment + enum `ApprovalAttachment=5` **MIGRATION-FREE** · FE 2 app SHA-identical (`PeWorkflowPanel` picker multi-file + upload-trước-chuyển-phase + mục "📎 File đính kèm khi duyệt" + 2 filter fix #71) · commit `7886fd0` → **Run #330 PASS** (test 354, bundle `CsJetgZH`/`BVS0ApIm`, no migration, smoke 4×200). 3 lỗi tự bắt (authz · filter-pollution #71 · Dialog mirror-truncate). em-main-led + self-gate (grep no-leak) + cicd-monitor. → log `2026-06-19-S78-pe-attach-file-on-approve.md`. | 👤 + 🟩cicd | ✅ |
| **S77 — PE UX batch: 10 deploy prod-verified #320→#329 (anh Kiệt FDC + Tra Sol + Bích Phượng UAT realtime, HMW-mode ON)** — (1) cờ GẤP **pill** 🔴PRO/🟢CCM mọi danh sách+inbox (#320 NEW `PeUrgentChips`) · (2) **focus mode** bấm phiếu→overlay (#321) → **revert** list layout gốc bám-trái (#322) · (3) **Mig 57** ô ghi chú giá đề xuất PRO/CCM + **số phân cách VND** + chính tả "Bảng so sánh giá" + **guard #70** (#323) · (4) số âm → **đỏ+ngoặc** hàng 7/8/9 (#324) · (5) mục con **thụt+gạch đầu dòng** (#325) · (6) cờ gấp **BẤT ĐỐI XỨNG** GẮN=NV / GỠ=Trưởng phòng (DeptManager) (#326) · (7) **tách chọn-phiếu (inline) khỏi mở-rộng (overlay)** + nút "Xem mở rộng" mỗi dòng `?expand=1` (#327) · (8) **chuông báo người duyệt** khi phiếu vào cấp họ (#328 `LogTransitionAsync`) · (9) **banner phiếu Trả lại** hướng dẫn gửi lại (#329). Mig 56→**57** · test 344→**354** (+10). Bundle cuối `BqKD3Y23`/`Cn-i349D`. **3 lỗi em tự bắt review-TRƯỚC-deploy** (guard#70 stale-echo · luật asymmetric Tra Sol clarify giữa-chừng · double-mount Task H). FD process-death Task H → recover-disk. **NEXT (em):** 🔴 curate L1 reviewer **45KB** + cicd 37.6KB + inv 35.6KB keep-floor-hit manual-condense (archive-gate A7 GATE PASS 186/186) + FD/test-spec WATCH. **NEXT (anh/anh Kiệt UAT):** cờ gấp (GỠ chỉ TP) · chuông báo người duyệt · banner Trả-lại · Xem mở rộng · ô ghi chú PRO/CCM. → log `2026-06-19-S77-pe-ux-batch-10-deploy.md`. | 👤 + 🩷FD×3 + 🟧impl-FE + 🟨impl-BE×2 + 🟪test×3 + 🟩cicd×10 | ✅ |
| **S76 — PE ngân sách MA TRẬN 3 cột (Dự án\|PRO\|CCM) + bảng lưới `<table>` + badge quyền-NS theo role (anh Kiệt FDC + chị Trà Sol, go-live)** — anh giao `/ultra-on` step-by-step + workflow-review-per-step. **3 commit prod-verified:** `e33481e` (feature Run #318 `BhFDF9IJ`/`BAkuRl3C`) → `21d1f4e` (bảng lưới Run #319 **`jOqxW4-p`**/**`DbsznVvR`**). **Part 1** form ma trận: PRO/CCM sửa cột mình (canEditPro/canEditCcm), Dự án FE-only; Mig 56 +ProInitial/ProAdjust additive + data-migrate 4 rows prod. **Part 2+3** badge "✎ NS PRO/CCM" cạnh approver (suy role, display-only) ở Workflow Designer + flow Duyệt NCC. Bảng lưới `<table>` viền-ô (anh phản hồi "chưa chia cột giống Excel"). Test 339→**344**. 2 workflow review bắt **race mất-dữ-liệu** → vá `useIsFetching` (gotcha #70). **NEXT:** 🔴 curate L1 (reviewer **45KB** keep-floor manual-condense + inv 35KB + cicd 29KB + test-spec 28KB) · anh/anh Kiệt UAT bằng PRO/CCM. → log `2026-06-19-S76-pe-budget-matrix-table-grid.md`. | 👤 + 🟦inv + 🟪test + 🟧impl-FE + 🟥reviewer×2wf + 🟩cicd×2 | ✅ |
| **S74 — PE ô "Ghi chú từ CCM" ngân sách gói thầu (Mig 55)** — anh forward chat Trà Sol + Kiệt FDC → CCM giống PRO (nhập số + ghi chú), "0 hết" = role CostControl thiếu (không bug). em-main BE+Mig55 (entity/config/command/DTO/controller/mapping) ∥ implementer-frontend FE 2 app SHA-mirror ∥ test-specialist (chết rate-limit→recover-disk). 2 fork anh chốt: +CcmNote (Mig 55) + GIỮ phân vai CCM. Test 334→**339**. commit `8655ebf` (cicd **Run #315 PASS** — bundle `BYF5vIMJ`/`CB-tiRxd`, Mig 55 applied). → log `2026-06-18-S74-pe-ccm-note.md`. **NEXT:** anh UAT bằng CCM/Admin; curate reviewer 38.8KB + inv-codebase 31.5KB. | 👤 + 🟧 impl-FE + 🟪 test-spec(recover) + 🟩 cicd | ✅ |
| **S72 — Harness-10 flat-refine + checklist-v2 adopt (re-audit 3-workflow) + sleep NO-OP** — audit `wf_13868efb-ea7` → implement `wf_ac43b5ff-7d1` → review `wf_d482e10d-5dd` (Harness-9 B1+B2). SE BEHIND flat → migrate SUBFOLDER→FLAT (hmw.js + 5 doc; 5 run cũ giữ subfolder C8) + 2 broadcast 06-18 + sleep-cmd port (A8) + detector tailored-out + hmw.js H4.5→H8. **REVIEW bắt 2 lỗi IMPLEMENT-self-assess sót** (schema-stale + auto-wire overclaim) → fixed (auto-check WIRED). 1 reviewer residual-write self-caught+revert (reverse-finding #4). B3 self-correct path/count. Sleep `all`=NO-OP. **0 prod code.** adap-report + email (`5f511fe5`). **NEXT (anh):** restart CLI (FLAT-runtime + wired sleep-check + sleep-recovery skill). **NEXT (em):** 🔴 curate investigator-codebase L1 **28973 OVER** + cicd-monitor **30123 OVER** (Run #312) + watch FD/test-spec. → session log `2026-06-18-S72-harness-10-flat-refine.md`. | 👤 + 9 sub | ✅ |
| **S71 — Harness-10 adopt: tracked run-trace folder + checklist 9-10** — em main + 3 Workflow (invest `wf_9c2cd2cd-2e7` / implement `wf_e4e46725-231` / review `wf_636bc95b-939`) per mandate Harness-9 PART 2. **0 production code**. Migrate `wave-*/` gitignored → `runs/<run-id>/` git-TRACKED (run.md+sub-md/+harvest/) + `_ledger.md` 2-nhịp + 3-layer (L1 em-main@P1 / L2 session-start / L3 session-end idempotent) + containment shift (B6→tracked-run-folder). hmw.js wave→run-trace (`node --check` OK). **Review (R2+R3) bắt C5 L1 over-claim → fixed** (em-main convention, engine no-fs). checklist 9-10: Part A/B done S70, Part C 8/8 MỚI. dogfood 3 run-folder TRACKED + ledger. adap-report + email ai_infra. **State GIỮ NGUYÊN: Mig 53·88 bảng·306 test·68 gotcha·menu 54.** **NEXT (anh):** restart CLI (hmw.js RUN-TRACE + carry §2.1.2/Cat-6/H8). **NEXT (em):** ✅ curate-debt CLOSED (finalize+curate workflow — reviewer/inv <cap, budget re-measured) · monthly audit 07-01. → session log `2026-06-18-S71-harness-10-run-trace.md`. | 👤 + 9 sub + 5 finalize/curate | ✅ |
| **S70 — Harness-9 adopt: L2 archive dark-matter recovery + adap 2-workflow mandate** — em main + 3 Workflow (investigate `wf_be952f3c-97f` / implement `wf_a58e0d15-beb` / audit `wf_9520d8cd-4fe`) + 2 monitor bootstrap. **0 production code** (governance/memory, commit `f36aab8` pushed). 4 over-cap sub curate L1→L2 + `_INDEX.md` (substring sha-keyed) + `.gist.md` (distill-gen:1) → cả 4 <25KB cap (**P1 curate-debt CLOSED**, ~240KB archive hết RAG-dark). 0-byte-loss git+sha (Stage C + self-gate 2 reviewer no-return). Codify adap-apply/agents-README/session-start §2.1.2 + budget.json/measure.ps1/.ragignore + doc-drift 4-flush. adap-report + email-back ai_infra (`7c07b716e775`). **NEXT (anh):** restart CLI (session-start §2.1.2 + reviewer Cat-6 + H8 inherit pending). **NEXT (em):** monthly audit 07-01 — STATUS/HANDOFF re-tier (trim S67↓→logs, defer ×9) · docs/CLAUDE deep-doc (gotcha 58→68 · 93→88 bảng · Budget-removed) + schema §16+ Mig 32-53 ERD. → session log `2026-06-17-S70-harness-9-l2-recovery.md`. | 👤 + 12 sub + 2 monitor | ✅ |
| **S69 — Văn phòng số port + golive (#305→#307) + PE cờ gấp/ngưỡng CCM (#308 Mig 53)** — 4 deploy prod-verified, HMW-mode ON, 2 workflow fan-out + ~14 spawn. Foundation PURO + re-skin 10 page + Office public 16-key allow-list + PE cờ gấp/threshold. 2 gotcha NEW (#67/#68) · 2 truncation #53 recover-disk. **NEXT (anh/anh Kiệt UAT):** cấu hình "Ngưỡng giá trị gói CEO" trong Workflow Designer + test cờ gấp PRO/CCM; **xác nhận:** quy trình đặt CCM(CostControl)-trước-CEO + CEO = role Director (notify đích). **NEXT (em):** 🔴 curate cicd-monitor **65.2KB** (worst, trend tăng) + inv-codebase 47 + reviewer 43.5 + impl-be 33 over-cap · doc-flush docs/CLAUDE.md full + schema-diagram §16+. **C (sau duyệt → chuyển phiếu đến dự án) chờ anh Kiệt spec form.** → session log `2026-06-17-S69-vanphong-golive-pe-urgent-threshold.md`. | 👤 + ~14 sub | ✅ |
| **S68 — Hồ sơ NS header chi tiết NV: nổi bật (size/weight/badge màu) + fix tên đen→trắng (gotcha #66)** — em main solo, 3 commit (FE `6983609`+`37752eb` · docs `11bc96d`), 2 deploy prod-verified Run #303-304 (anh UAT realtime): tên `text-xl extrabold`+drop-shadow · meta `text-[13px] font-medium` trắng-đậm · badge pill màu emerald/amber/slate theo trạng thái (#303 `D532XZKG`/`CuFaBoWt`) → anh báo "tên đen nền xanh ko nổi bật" → **rule `h1-h4{color:#0b1220}` unlayered thắng `text-white`** (Tailwind v4) → ép `text-white!` + thu nhỏ `text-lg` (#304 `CNUv1jxY`/`CpOskeS1`). Bootstrap: 2 monitor RE-REPORT CLEAN + 2 doc-drift fix (dep-audit 64→65, root CLAUDE 263→286). **NEXT (anh):** xác nhận mắt tên trắng+gọn ưng chưa (muốn nhỏ hơn→`text-base`; màu nhấn nếu cần). **NEXT (em):** 🔴 curate cicd-monitor **44.1KB** + inv-codebase 38.5 + reviewer 35.4 + impl-backend 30.7 over-cap · doc-flush docs/CLAUDE.md count + schema §16+. → session log `2026-06-16-S68-hoso-header-name-color-fix.md`. | 👤 + 3 sub | ✅ |
| **S67 — Hồ sơ NS visual polish (font/màu/list) + fe-admin mirror + PE Link hồ sơ auto-detect/file-link + research auto-open** — 6 deploy prod-verified #297→#302 (anh + anh Kiệt FDC UAT realtime): font/màu xanh đậm fe-user (#297) · **fe-admin mirror** master-detail + accent tokens index.css (#298) · **+23 test→286** (#299) · **list flex-row hết tràn ngang** + đồng nhất cỡ (#300) · PE Link auto-detect web/Copy (#301) → **link file:// bấm-thử** (#302). Research 3-agent: auto-mở `O:\` = chỉ Edge GPO `IntranetFileLinksEnabled`. test-specialist trunc #53→recover-disk. bundle `CcrZqfht`/`DniDFUB_`. **NEXT (anh):** ① bấm thử link `O:\` (mở/no-op) báo em môi trường · ② IT-guide Edge GPO nếu muốn 1-click `O:\` · ③ visual list+màu ưng chưa (đổi `brand-700` nếu muốn nhạt hơn). **NEXT (em):** curate cicd-monitor 39.8KB + inv-codebase 39.4KB over-cap · doc-flush docs/CLAUDE.md count + schema-diagram §16+. → session log `2026-06-16-S67-hoso-visual-pe-link-research.md`. | 👤 + 4 sub | ✅ |
| **S65 — HRM go-live: public Hồ sơ Nhân sự + trang master-detail giống NamGroup + Department hierarchy + PE Link hồ sơ** — ~6 deploy prod-verified Run #289→#295 (anh + anh Kiệt FDC UAT realtime): HRM public read 13 role (#289) · foundation màu fe-user (#290) · Mig 51 Department.ParentId + picker phòng cha fe-admin (#292) · Employee 3-panel→**2-cột** 5-tab + tô màu + gốc cây "SOLUTION COMPANY" (#293/#294/#295) · Mig 52 PE HoSoLink hyperlink NAS + rename "Dự trù PRO"→"Ngân sách PRO" (#293). **Workflow fan-out chạy THẬT lần đầu** (PE) — FE+reviewer empty-return → em main recover-disk + self-gate. gotcha #65. **NEXT:** mirror Employee page→fe-admin · test-after (HoSoLink/ParentId/HRM-perm) · **cicd-monitor 82KB curate P1**. → session log `2026-06-16-S65-hrm-golive-employee-masterdetail-pe-link.md`. | 👤 + 9 sub | ✅ |
| **S64 adopt Harness-7 (writing-quality floor)** — em main solo (0 sub), commit `6afde19` docs/gov-only: `rules.md §1.1` (O1 outward tiếng Việt full-grammar · O2 asymmetric nội-bộ-giữ-nén §6.4/§6.5 · O3 reviewer-gate) + reviewer Category 6 (verified-pending-restart) + adap-report + email se→ai_infra (`7e4f91f1` self-verified MATCH). Broadcast `a4580ea9` verified KHÔNG mis-stamp (gotcha #61 UTF-8). **NEXT:** restart CLI activate Category 6. | 👤 | ✅ |
| _(**S63 docs-closeout S60-62 + adopt Harness 5/6 ✅** — [adap-apply H5 model-fallback (SE đã de-facto Opus 4.8 1M do Fable down 06-12, book caveat + session-start BƯỚC 0.6) + H6 governed-ultracode (auto-HMW mode-ON + hmw.js role-less→inherit; H6.7 đã sẵn) → 2 adap-report + email ai_infra] · reconcile stray reviewer cwd-misland (2 file → canonical + xóa stray) + commit harvest (cicd MEMORY Run #286 + gotcha #63/#64) + count-flush 4 file (ef-core/README/dep-audit/CLAUDE root) + session-log bù `2026-06-12-S60-S62-*`. **S60-62 product ĐÓNG TRỌN prod-verified:** Mig 50 ngân sách per-gói-thầu (Excel anh Kiệt) + XÓA module Budget cũ + gỡ "Từ chối" + vượt-NS cảnh-báo-mềm. **🔴 Ops còn — của anh (giữ từ S58/S59):** (1) `tzutil /g` VPS · (2) anh Chương email → dọn typo · (3) báo 5 real staff password `User@1234567` · (4) gán người thật CNTT → lock nv.cao/nv.truong. **NEXT (anh pick):** test-after guard suppliers authz + LockDemoSampleUsers · F4 approver-edit-budget UI (BE sẵn scope, chờ anh Kiệt) · PE panels polish · monthly audit 2026-07-01 (STATUS/HANDOFF re-tier trim S53-S56 → logs · curate L1 cicd-monitor **63.6KB** over-cap lần 5 + investigator-codebase 32.7KB · schema-diagram §16+ Mig 32-50 ERD). · Prev S59 ĐÓNG TRỌN 10 đợt Run #273→#282 (8 PASS + 2 cancelled-benign): wipe testing data (phiếu thật đầu = PE/2026/A/001 ✓) · tree 4 tầng Năm>Dự án>Hạng mục · 71 mã PMH chuẩn (wipe 15 demo + rename format anh Kiệt) · UAT 6 vòng 11 điểm (SearchableSelect gõ-lọc bỏ dấu + auto địa điểm + ẩn nút self-approve + quick-add NCC + multi-file + bảng NCC table-fixed + bỏ ô Tên ngân sách + GỠ field Điều khoản TT mọi form + bỏ nút Thêm hạng mục). Bundle FINAL `B1DtNT9C`/`D6uF3Mln`. **🔴 Ops còn — của anh (giữ từ S58):** (1) `tzutil /g` VPS → confirm `SE Asia Standard Time` · (2) xác nhận anh Chương email nào → dọn `chuong.phan@solution.com.vn` typo · (3) báo 5 real staff password mặc định `User@1234567` + yêu cầu đổi · (4) khi gán người thật vào CNTT → thêm nv.cao/nv.truong vào lock list. **NEXT (anh pick):** test-after guard (🟪 test-specialist: `LockDemoSampleUsersAsync` S58 + suppliers asymmetric authz POST-open/PUT-DELETE-locked S59) · PE panels polish sâu (PeDetailTabs 111KB session riêng) · FE PermissionGuard per-route khi golive HRM/Office (flip revoke) · Phase 9 Ops (SMTP/backup/creds/UAT) · monthly audit 2026-07-01 (**STATUS/HANDOFF re-tier — defer ×2, ƯU TIÊN** · curate L1 cicd-monitor **~56KB** (S59 +9 cicd-spawn, H2-đo 54KB + 2 entry cuối) + investigator-codebase 32.9KB · schema-diagram §16+ Mig 32-49 ERD debt). → session log `2026-06-11-S59-wipe-tree-pmh-uat-batch.md`)_ | 👤 | ✅ |

**S40 done:** ✅ Consolidation (`d2f52ba`) · ✅ Curate 4 agent MEMORY >25KB→<8.4KB (`78c9de3`) · ✅ RAG catch-up chunk S37-S40 (rerank 0.867) · ✅ **AI_INFRA bulletin 2026-05-29 adopt 4/4** (MỤC2 Tiered Memory Policy v1 `6f08d1f` + MỤC3 /session-start+/session-end slash commands `c8ff5e1`). ⏳ Full RAG re-index = AI_INFRA op (cần VOYAGE_API_KEY).

> ⚙️ **NEW slash command** (`.claude/commands/`) — anh main **restart CLI** để activate (không hot-reload) → session sau gõ `/session-start` + `/session-end` thay paste prompt thủ công.



## STATUS 'Recently Done' detail (S75->S38) — cắt từ `docs/STATUS.md`

## ✅ Recently Done (newest on top — 3 session; cũ hơn → session logs)

### S75 (2026-06-18) — ✅ Harness-11 adopt: engine bộ-nhớ-và-governance TỰ-BẢO-TRÌ (em main + 5 Workflow, 0 production code)
- **Anh:** `/check-email AI_INFRA và /adap-apply` (mỗi stage workflow-review + report trung-thực) → "double check lại 1 turn + checklist 1 turn → hoàn thiện report → push → session-end".
- **STAGE 1 check-email:** H11 directed `harness-11-available` verify PASS (whole-file `318ff9f6` + body `b2a2fc1c`) → processed `inbox/ai_infra/`.
- **5 Workflow (run-id = evidence Harness-9 PART-2):** AUDIT `wf_7fdc3bd5-930` (4× inv-codebase → GAP: C 3-detector + B1/B3 + D5-D8 chưa codify) → IMPLEMENT `wf_c5e5844e-7c1` (2× gen-purpose script ∥ + em-main MD cluster) → REVIEW `wf_d7ca1ff8-942` (3× reviewer PASS + 2 refine C2/C1 59→27) → DOUBLE-CHECK `wf_a0b68d2f-30e` (3× reviewer; over-suppress regression CLEAN — DA1 no-return→em-main self-gate fake-drift "99 migration" CAUGHT, DA2/DA3 độc-lập confirm) → CHECKLIST-VERIFY `wf_39cd4cbe-f07` (3× inv-codebase; completeness-gate FORMAL ĐẠT).
- **Built (0 prod code):** `governance-detectors.ps1` (C1 broken-pointer + C2/B3 staleness + C3 vocab-fork + C4 self-exclusion 0-self-match + C5 resolve, NO-API DÒ+FLAG-only, runtime 26 flag bắt drift thật + gotcha #30 mojibake fix) + `memory-archive-gate.ps1` (A1 byte-gate + A4 hysteresis 0.85 + A5 keep-floor 5 + A6 2-strike + A7 NO-API L1-eval 186/186 pointer-resolve) + `harness-11-engine.md` canonical (artifact-map + PHẦN A/B/C/D + 3-tier D5/D6/D7 EXPLICIT + one-direction-lock D8 + CAVEAT honest) + B1 ×11 count→pointer (root CLAUDE.md/ef-core+dep-audit SKILL/skills-README/docs-CLAUDE.md; drift mig53→55/test306→339/gotcha68→69/table93→88 RESOLVED) + cadence session-start §2.1.3 (D1 DÒ+BÁO) + session-end §L.b(c) (D2 archive-gate) + agents/README Upgrade S75.
- **completeness-gate FORMAL ĐẠT** (checklist-verify): B 4/4 + C 5/5 + D 11/11 đủ-trọn (function-floor MET), A 🟡 tailored (A6 runtime cần 2×-Apply = legit-by-design, self-doc). D5/D6/D7 explicit-label + D8 one-direction codify = YES (2 chỗ H11 chuẩn-hoá-mới).
- **gotcha #30 reinforced:** box-glyph (├└─) KHÔNG đưa vào .ps1 — PS5.1 `-File` ANSI-decode mojibake, KỂ CẢ qua Edit tool (render-normalize \u-escape→literal); detector giữ pure-ASCII (Python scan 0 non-ASCII). Tree-line FP-skip attempted→reverted; "6 test" giữ documented soft-net FP.
- 3 commit pushed (`e70c046` adopt + `ae957c4` double-check/finalize + `aa09e99` cleanup 2 scratch DA1-reviewer). adap-report `docs/governance/adap-reports/2026-06-18-Governance-harness-11.md` + email ai_infra (body `2316773229f2`).
- **Lesson:** review→fix loop có giá-trị thật (REVIEW bắt 2 cái IMPLEMENT tự-chấm sót: C2 FP 89% + "71 flag" hardcoded) · raw-Workflow schema-force flaky (3 lane fail no-SO across 5 wf) → em-main self-gate recovery · `git add -A` quét stray scratch (Bash-residual read-only sub) → git-add file cụ-thể.
- **State THẬT GIỮ NGUYÊN:** Mig 55 · 88 bảng · 339 test · gotcha 69 · menu 54 · bundle `BYF5vIMJ`/`CB-tiRxd`.

### S74 (2026-06-18) — ✅ PE ô "Ghi chú từ CCM" ngân sách gói thầu (Mig 55) — anh + 2 sub + cicd, prod-deploy
- **Anh:** forward 2 luồng Zalo (Trà Sol + Kiệt FDC) về panel TỔNG HỢP NGÂN SÁCH TRÌNH KÝ "CCM cũng giống PRO cho nhập + ghi chú, hiện 0 hết" → AskUserQuestion 2 fork → `/session-end`.
- **Chẩn đoán:** ô nhập PRO/CCM gate `bs.canEditPro/canEditCcm` (thuần role, KHÔNG phase). "0 hết CCM" = tài khoản thiếu role CostControl (KHÔNG bug). Bất đối xứng thật: `ProNote` có, `CcmNote` chưa.
- **2 fork anh chốt:** (1) thêm "Ghi chú từ CCM" — Mig 55 cột CcmNote ✅ · (2) GIỮ phân vai CCM (CostControl/Admin) ✅.
- **Done commit `8655ebf` (14 file):** BE entity+config+**Mig 55 `AddCcmNoteToPeWorkItemBudget`** (additive-nullable sạch) + command/validator/handler + DTO/controller/mapping (em-main) · FE 2 app SHA-mirror dòng "Ghi chú từ CCM" gate canEditCcm absolute-set 3 field (implementer-frontend) · test +5 §4b (test-specialist chết rate-limit → em-main recover-disk + self-gate `dotnet test` **339 PASS**).
- **Lessons:** controller call-site thiếu arg sau +param record (grep mọi `new` + vá, full slnx build bắt #65) · test-specialist died-529 work-landed-disk → recover KHÔNG re-spawn (`feedback_agent_kill_recovery`) · PS here-string commit-msg trong if-block mis-parse → `git commit -F <file>` · hybrid em-main-BE + delegate-FE-mirror đúng cho migration+tight-coupling (`feedback_workflow_fanout_reliability`).
- **State:** Mig 55 · 88 tables · 339 test · 69 gotcha · menu 54 · bundle admin `BYF5vIMJ`/user `CB-tiRxd` (**Run #315 PASS** ~4m54s — Mig 55 applied prod CcmNote, sys.tables 88, smoke 4×200, 0 regression).

### S72 (2026-06-18) — ✅ Harness-10 flat-refine + checklist-v2 adopt (re-audit 3-workflow) + sleep NO-OP (em main + 9 sub, 0 production code)
- **Anh:** `/session-start` → "trí nhớ có thay đổi lớn" → `/sleep-recovery-memory-l2` báo Unknown (chưa có) → "double check hết Harness-8/9/10/10-refine + checklist + hmw, điều chỉnh, report trung thực" → `/sleep-recovery-memory-l2 all` + `/session-end`.
- **3-stage Workflow (mandate Harness-9 B1+B2):** INVESTIGATE `wf_13868efb-ea7` (4× investigator-codebase; 1 fail-no-SO + 2 truncated → em-main self-gate ground-truth) → IMPLEMENT `wf_ac43b5ff-7d1` (2× general-purpose file-disjoint + em-main cluster) → REVIEW `wf_d482e10d-5dd` (3× reviewer adversarial).
- **Gap (đo vs canonical):** SE BEHIND Harness-10 flat — run-trace còn SUBFOLDER (`sub-md/`+`harvest/`), canonical=FLAT. Fixed: `hmw.js` (`:103` sub-md/→`sub-<role>-<i>.md` + `:52` schema-desc + **H4.5→H8 doc-drift**) · `workflows/README` full-rewrite + roster 8→9 · `runs/README` flat + detector-tailored-out · session-start/end flat + dual-accept · `agents/README` Upgrade S72 · `_ledger` C8 note. **5 run cũ S71 GIỮ subfolder** (C8, no-history-rewrite). +2 broadcast 06-18 adopt. +`/sleep-recovery-memory-l2` port (A8, 137 dòng, §J2-tailored SE-only, floor intact, 6 SE-env deviation, live skill). **detector refine-b TAILORED-OUT** (anh chốt — SE Workflow-tool no-CLI-launcher-bypass; containment git-diff+tracked+orphan-scan G-015).
- **REVIEW (B2 dogfood) bắt 2 lỗi IMPLEMENT-self-assess BỎ SÓT:** (1) `hmw.js:52` schema `subMdPath` desc stale `sub-md/`; (2) sleep-cmd auto-check ≥7d **UN-WIRED overclaim** → em fix: schema flat + **WIRE auto-check thật** (budget.json `+last_sleep_at` + `session-start:78` + `session-end:48`, grep-verified present). +3 minor fixed (provenance cite · charter anchor · README:31 dogfood). R3 PASS (containment clean, honesty strong).
- **em-main containment-check tự bắt residual-write:** 1 reviewer agent (REVIEW qua RAW Workflow tool — KHÔNG inject `hmw.js` writeGuard) tự ghi `agent-memory/reviewer/MEMORY.md` (+2850B over-cap) → revert (record ở run-trace; B3 single-writer restored) → **reverse-finding #4** (raw-Workflow ≠ wrapper-governance). investigator-codebase MEMORY (M từ session-start = S71 audit-trail) commit-as-is, over-cap → curate next.
- **B3 self-correct (trung thực):** S71 report cite path tắt `runs/` + count "14" → thật `.claude/workflows/runs` = **22** (đính chính trong adap-report mới).
- **Sleep `/sleep-recovery-memory-l2 all` = NO-OP (dogfood live):** 5/9 sub empty-archive (guard-rỗng) + 4/9 mọi period đã có gist (skip-if-gist + double-distill gen≥1) → 0 compressed; `last_sleep_at` null→2026-06-18. Command port giờ **executed-file + runtime** (guards fired đúng).
- **State THẬT (prod functionality/DB) GIỮ NGUYÊN:** Mig 53 · 88 bảng · 306 test · **69 gotcha** (+#69) · menu 54. **0 production code.** ⚠️ **bundle ROTATE** `BgNCjwsG`/`CBvh0vtf` → **`fc_xkNpJ`/`DP-tBcg0`** (cicd Run #312 PASS no-op — non-determ hash + deploy rebuild-FE-uncond = **gotcha #69**; 0 FE change → cosmetic; "frozen" claim đã SAI, đính chính). 3 run-trace folder FLAT git-tracked. adap-report `2026-06-18-Governance-harness-10-flat-refine-checklist-v2` + email ai_infra (`5f511fe5c0f2`, 4 reverse-findings). ⚠️ **restart CLI** activate FLAT-runtime hmw.js + wired sleep-check + sleep-recovery skill. 🔴 NEXT curate investigator-codebase L1 **28973 OVER**. → session log `2026-06-18-S72-harness-10-flat-refine.md`.

### S71 (2026-06-18) — ✅ Harness-10 adopt: tracked run-trace folder convention + checklist 9-10 self-verify (em main + 3 Workflow, 0 production code)
- **`/check-email AI_INFRA`** = 0 thư mới se-directed (UI/UX guide processed S58). Broadcast `2026-06-18-Governance-checklist-harness-9-10` ở `outbox/all` (content_sha256 `ec32951a` MATCH, đọc UTF-8 tường minh #61). **KHÔNG có base Harness-10 file riêng** — spec = Part C checklist (flag trong adap-report).
- **3-stage Workflow** (mandate Harness-9 PART 2; anh chốt full-adopt + dogfood qua HMW đủ invest/imple/review, tránh sai sót): INVEST `wf_9c2cd2cd-2e7` (4× investigator-codebase — A stub-fail structured-return nhưng ghi diary thật + B/C/D strong → self-gate bù) → IMPLEMENT `wf_e4e46725-231` (3× general-purpose file-disjoint + em-main cluster) → REVIEW `wf_636bc95b-939` (3× reviewer adversarial).
- **Migrate wave→run-trace:** `.gitignore` (runs/ tracked via negation `:83`, wave-*/ giữ legacy, exit-code-trap note) · `hmw.js` (accept `args.run` + alias `wave`, path `sub-md/`, wording containment, 9 ref wave→RUN-TRACE, `node --check` PARSE-OK) · `workflows/README.md` full-rewrite · NEW `runs/README.md` (C1-C7 + caveat trung-thực) · `session-start.md:71` (L2 orphan-scan) · `session-end.md:51` (L3 close-gate idempotent) · `agents/README.md`/`harvest-curator.md`/`tooling-auditor.md` repoint.
- **Review caught (R2+R3 độc-lập = high-conf):** C5 **L1 over-claim** — `runs/README.md` nói hmw.js prompt-builder emit L1 reminder, grep engine=0 → engine no-fs KHÔNG đọc được ledger → **fixed path-a**: L1 = em-main @P1 ledger-check convention. Floor C1-C8: 7/8 PASS + C5-fixed (C7 caveat reviewer khen "điểm sáng nhất"; C3 honest "tracked-eligible → committed sau commit", KHÔNG over-claim). **Dogfood thành công mandate B2** (review-workflow RIÊNG bắt lỗi mà 1-workflow-tự-chấm bỏ sót — IMPLEMENT synthesis không nhắc L1).
- **Containment audit CLEAN:** git status = đúng tập (8 Harness-10 file + runs/ untracked + investigator MEMORY race + CLAUDE.md test-flush), 0 stray, **frozen-evidence 0-byte-loss** (broadcasts/adap-harness-2/error-ledger/sessions/STATUS/HANDOFF/archives untouched — R1 per-path verify). **State THẬT GIỮ NGUYÊN: Mig 53 · 88 bảng · 306 test · 68 gotcha · menu 54 · bundle `BgNCjwsG`/`CBvh0vtf`.** adap-report `2026-06-18-Governance-checklist-harness-9-10` + email ai_infra (4 reverse-findings: L1-engine-no-fs · custom-workflow-thiếu-delta-guard-race · check-ignore-exit-trap · C3-2-level-value). → session log `2026-06-18-S71-harness-10-run-trace.md` (pending).

### S70 (2026-06-17→18) — ✅ Harness-9 adopt: L2 archive dark-matter recovery + adap 2-workflow mandate (em main + 3 Workflow + 2 monitor, 0 production code, commit `f36aab8` pushed)
- **Bootstrap (`/session-start`):** 2 monitor RE-REPORT — 🟫 H1 (3 skill cite stale + curate-debt 4 agent over-cap) + ⬜ H2 (CLEAN, 0-orphan, 5-trục PASS). RAG 2426 chunks alive (stale-index 05-29). test **306 baseline verified**. `/check-email AI_INFRA` = 0 thư mới directed (outbox/se chỉ UI/UX guide processed S58). Harness-9 ở `outbox/all` (kênh adap-apply).
- **`/adap-apply Harness-9`** (anh chốt "đầy-đủ-nhất", 3-stage Workflow): PART 1 L2-recovery (proposal, fit cao — SE có dark-matter thật) + PART 2/3 process-mandate (🔴 function-floor).
- **Stage A INVESTIGATE** (`wf_be952f3c-97f`, 4× investigator-codebase): recon 4 archive → build-plan + **quyết định pointer = substring sha-keyed** (KHÔNG anchor-slug: slug-collision same-date + diacritic-fragile + cicd `2026-06.md` ZERO heading; KHÔNG line-hint).
- **Stage B IMPLEMENT** (`wf_a58e0d15-beb`, 4× general-purpose file-disjoint): curate L1→L2 byte-exact + `_INDEX.md` + `.gist.md`. cicd 65→**23.2KB**(10 moved) · inv-codebase 47→**24.1KB**(15, tạo `2026-05-q4.md` fresh) · reviewer 43.5→**24.8KB**(9) · impl-backend 33→**17.4KB**(14). Cả 4 <25KB auto-inject cap.
- **Stage C AUDIT** (`wf_9520d8cd-4fe`, 4× reviewer): độc-lập verify. reviewer PASS · impl-backend CONCERN (read-side-gap→fixed) · 2 (cicd+inv-codebase) **no-StructuredOutput** → em-main self-gate git/sha (recovery-path `feedback_agent_kill_recovery`) → **4/4 0-byte-loss PASS** (git numstat `+N -0` additive + sha + content-identity CR-normalize).
- **Em-main infra + codify:** `memory-budget.json` (seed-by-measure) + `scripts/measure-agent-memory.ps1` + `.ragignore` + PART 2/3 codify (adap-apply mandate + agents/README Upgrade S70 + session-start §2.1.2). **Read-side gap fix:** 3/4 MEMORY.md L5 header → trỏ `_INDEX.md` (Stage C độc-lập bắt — giá trị của review-workflow riêng, PART 2 dogfood đúng).
- **§L:** doc-drift 4-cite flush (dep-audit:153 65→68 · skills/README:20 52→53 + :90 65→68 · session-start:44 58→68) · 4 curate-log refresh S70 · H2 GATE **CONDITIONAL PASS** (Corruption/Placement/Fidelity 🟢 md5-proven 0-loss; Coverage/Completeness 🟡 spawn-record-fill + 3 `S?`-label cosmetic). **State THẬT GIỮ NGUYÊN: Mig 53 · 88 bảng · 306 test · 68 gotcha · menu 54 · bundle `BgNCjwsG`/`CBvh0vtf`.** adap-report + email-back ai_infra (body-hash `7c07b716e775`) — 3 đề-xuất ngược (substring-pointer-for-real-archives · measure-then-seed reference · self-gate-fallback hợp-lệ). → session log `2026-06-17-S70-harness-9-l2-recovery.md`.

### S69 (2026-06-17) — ✅ Văn phòng số (E-Office) port + golive + PE cờ gấp/ngưỡng CCM — 4 deploy prod-verified Run #305→#308 (HMW-mode ON, 2 workflow fan-out)
- **#305 `a8bbdae` Văn phòng số foundation** (workflow `office-puro-foundation` 5-agent): sync fe-admin/index.css ← fe-user (đóng drift S66-S68 + gotcha #66 fix) + 3 shared component PageHeader/KpiCard/WidgetCard (×2 SHA256, tái dùng token Hồ sơ NS) + OfficeDashboardPage 2-cột widget kiểu PURO HomePage (reuse data hooks, no BE) + menu key Off_Dashboard (no-mig idempotent seed, giữ ẩn). em main fix KpiCard activeBorder -300→-500 (**gotcha #67** — Tailwind accent palette thiếu stop).
- **#306 `c556f6c` re-skin TRỌN 10 page** (workflow `office-puro-reskin-all` 7 designer song song write-only + reviewer): Đề xuất(List/Create/Detail)/Đơn từ/Ticket/Danh bạ/Phòng họp/Báo cáo CC → PURO layout + CSS Hồ sơ NS, **phẫu thuật giữ 100% logic** (reviewer verify mọi api.*/queryKey byte-identical HEAD vs working). em main build-tập-trung + mirror SHA256 ×2 + recover stale-diagnostic (**gotcha #68**). 9 page fe-user↔fe-admin SHA256-identical.
- **#307 `1f8947e` Office golive public** (+6 test): `SeedAllRolesOfficeModulePermissionsAsync` grant read+create **16-key allow-list mọi role** (mirror S65 HRM pattern, chạy SAU revoke để thắng). Excluded (giữ ẩn): Off_PhongHop_Manage (admin CRUD) + Off_AttendanceReport (riêng tư) + Off_ChamCong (Cá nhân). reviewer PASS security (cascade-safe: Off KHÔNG phải inherit-root → excluded-3 giữ false; no write-path: controller [Authorize(Roles=Admin)] độc lập menu-key). cicd DB-verify **16/16 × 13 role**, excluded-3 = 0, HRM/Personal vẫn ẩn, admin không hạ.
- **#308 `ebd7e1c` PE cờ gấp + CCM duyệt-final theo ngưỡng** (Mig 53, anh Kiệt FDC sau họp sếp, +14 test): ApprovalWorkflow +`CeoApprovalThreshold` (admin nhập Designer, null=luồng cũ rollout-an-toàn); `ApproveV2Async`: actor role CostControl + winnerQuoteTotal (tổng giá NCC chọn) < ngưỡng → DaDuyet bỏ CEO (Q4 theo role). PE +IsUrgentByPro(đỏ)/IsUrgentByCcm(xanh); endpoint PUT /urgent role-gated (PRO/CCM/Admin) + notify CEO (Director) khi bật, visibility-only (Q3 không đổi luồng). FE ×2: Designer ô ngưỡng + PE detail cờ gấp toggle/badge + hint giá-trị-vs-ngưỡng + list badge. Test PeCcmThresholdFinalize 5 (load-bearing: CCM dưới ngưỡng → DaDuyet skip CEO) + PeUrgentToggleAuthz 9. reviewer PASS security. **C (sau duyệt → chuyển phiếu đến dự án) chờ anh Kiệt spec form.**
- **§L:** 2 gotcha NEW (#67 Tailwind palette-thiếu-stop · #68 stale-diagnostic-background-agent). 2 truncation #53 (impl-backend positional-record DTO mid-fix + impl-frontend) → em main recover-disk + tự viết endpoint cờ gấp (agent chưa kịp) + tự fix 2 CS7036. H2 GATE PASS (1 non-block: PE-CCM-threshold test-covered not standalone-reviewed). **State: Mig 53 · 88 bảng · 306 test · 68 gotcha · menu 54 · bundle `BgNCjwsG`/`CBvh0vtf`.** ⚠️ curate-debt P1: cicd-monitor **65.2KB** (worst, trend 41→54→56→61→62→65) + inv-codebase 47 + reviewer 43.5 + impl-be 33. → session log `2026-06-17-S69-vanphong-golive-pe-urgent-threshold.md`.

### S68 (2026-06-16) — ✅ Hồ sơ NS header chi tiết NV: làm nổi bật + fix tên render đen→trắng — em main solo, 2 deploy prod-verified Run #303-304 (anh UAT realtime, HMW-mode ON)
- **Bootstrap (`/session-start`):** 2 monitor RE-REPORT CLEAN — 🟫 H1 roster 11/11 `model: inherit` confirmed trên disk (Harness-8 runtime-landed, hết "pending-restart"), ef-core skill FRESH (Mig 52), plugin 18/15/3; flag 1 stale `dep-audit SKILL:153` (64→65) + **drift-correction: curate-debt = 4 agent over-cap, không phải 2** (S67 sót reviewer 35.4 + impl-backend 30.7). ⬜ H2 0-orphan · 0-corruption · 5-trục PASS (S67 harvest landed trọn). → em main patch 2 doc-drift `11bc96d` (dep-audit 64→65 + root CLAUDE test 263→286).
- **#303 `6983609` header polish ×2 app SHA256:** tên NV `text-lg→text-xl font-extrabold`+`drop-shadow-sm` · dòng meta `text-xs text-white/85 → text-[13px] font-medium text-white` (to+đục+dày nét, mã NV `font-semibold`) · badge trạng thái từ pill trắng-mờ chìm → **pill đặc màu theo status** (`EmployeeStatusColor` emerald/amber/slate + chấm `bg-current` + shadow). Build×2 PASS, bundle `D532XZKG`/`CuFaBoWt`, cicd Run #303 PASS.
- **#304 `37752eb` fix tên ĐEN→TRẮNG (gotcha #66 NEW):** anh UAT báo "tên màu đen nền xanh ko nổi bật" — screenshot: `<h2 text-white>` render **đen** dù `<div text-white>` (meta cùng banner) trắng → diagnose **`index.css:79 h1,h2,h3,h4{color:#0b1220}` viết NGOÀI `@layer`** thắng utility (Tailwind v4: unlayered > all layers). Đo blast-radius (`grep '<h[1-4][^>]*text-'`: ~30+ heading toàn app bị ép #0b1220 dù gắn text-slate/brand) → **KHÔNG move `@layer` (load-bearing)**, fix ĐIỂM `text-white!` (grep dist CSS confirm `color:var(--color-white)!important`) + thu nhỏ `text-lg font-bold`. Build×2 PASS, bundle `CNUv1jxY`/`CpOskeS1`, cicd Run #304 PASS.
- **§L:** 0 production-bug RCA — iter-1 (tên to+đen) = pre-existing black amplified, KHÔNG phải defect mới (bình thường cho UI iterate live UAT, authed page không screenshot dev-rig được gotcha #3). Guard mới = **gotcha #66**. harvest: cicd self-record ×2 (#303/#304, tự FIFO-trim S74→pointer) + H1/H2 proxy spawn-record (INFORM bootstrap). 0 zero-byte · 0 stray-path. **State: Mig 52 · 88 bảng · 286 test · 66 gotcha · menu 53 · bundle `CNUv1jxY`/`CpOskeS1`.** ⚠️ curate-debt P1: cicd-monitor **44.1KB** (worst, +#303/#304). → session log `2026-06-16-S68-hoso-header-name-color-fix.md`.

### S67 (2026-06-16) — ✅ Hồ sơ NS visual polish (font/màu/list) + fe-admin mirror + PE Link hồ sơ auto-detect/file-link + research auto-open — 6 deploy prod-verified Run #297→#302 (anh + anh Kiệt FDC UAT realtime, HMW-mode ON)
- **#297 `ab4e681` fe-user Hồ sơ NS:** đồng nhất font/size (mono value 12→14px) + chữ value/tên đen `slate-900`→**xanh đậm `brand-800`** (#175685, WCAG-AA ~7.4:1) qua component `Field` dùng-chung (1 sửa = ~40 ô đổi) + 9 vị trí tên/heading/inline. Label accent giữ.
- **#298 `292d64d` fe-admin mirror master-detail:** vá `index.css` (+4 accent palette teal/violet/amberx/greenx + `.icon-chip`/`.app-gradient-brand`/`.card-accent`/`.stat-value`) TRƯỚC rồi `cp` page fe-user→fe-admin (1602 dòng, **SHA256 identical**). Đóng pending lớn nhất HRM go-live. recon investigator-codebase: token-parity gap = bẫy "vỡ màu im lặng" (Tailwind v4 token thiếu → class emit-rỗng).
- **#299 `bcd619d` +23 test-after HRM → 286** (45D+241I): `DepartmentTreeTests` 8 (cây/rollup/inactive/orphan + **cycle-guard** self/con/cháu-sâu/clear) · `PeHoSoLinkTests` 9 (persist/null/1000 + update absolute-set — **bắt spec-drift: HoSoLink KHÔNG null-safe, gửi null=clear**) · `HrmProfilePermissionSeedTests` 6 (reflection private-static revoke→seed chain). test-specialist truncated return #53 → em main recover-disk (3 file đủ + dotnet test 286 PASS).
- **#300 `91aaf05` list pane gọn + đồng nhất cỡ ×2 app:** bảng 3-cột (tràn ngang rail 22rem → thanh cuộn ngang) → **flex-row 1-ô/dòng** truncate + `overflow-x-hidden` = hết tràn. Thang cỡ chặt 18/14/13/11px (header `text-xl`→`lg`). SHA256 ×2.
- **#301 `6df1b2d` PE Link hồ sơ auto-detect** (anh Kiệt FDC): `http(s)`→hyperlink bấm-mở (SharePoint OK) / `O:\`-ổ-mạng→chữ+nút Copy (`navigator.clipboard`). SHA256 ×2.
- **#302 `536dd6b` Link `O:\` render file:// bấm-thử** + Copy dự phòng (`toFileUrl` O:\→file:///O:/). **Workflow research 3 investigator-api:** default browser CHẶN https→file:// (Chrome/Edge/FF 76+); **chỉ Edge GPO `IntranetFileLinksEnabled`** (Edge-only, Intranet Zone, 1 GPO domain zero-per-machine) = one-click thật; .url-download zero-install nhưng 2-click+SmartScreen; extension/registry = per-máy.
- **§L:** 0 RCA (guard giữ — #53 truncate recover, cwd-after-build git-add minor). harvest: 3 sub self-record (cicd/inv-codebase/inv-api) + **test-specialist proxy-record** (trunc #53). **State: Mig 52 · 88 bảng · 286 test · 65 gotcha · menu 53 · bundle `CcrZqfht`/`DniDFUB_`.** ⚠️ curate-debt: cicd-monitor 39.8KB + inv-codebase 39.4KB over-cap → next session. → session log `2026-06-16-S67-hoso-visual-pe-link-research.md`.

### S66 (2026-06-16) — ✅ Session-start/end closeout em-main-solo (0 product-sub): adopt Harness-8 all-inherit + cicd-monitor L1 curate + ef-core doc-flush + check-email AI_INFRA
- **Bootstrap (`/session-start`):** 2 monitor RE-REPORT — 🟫 H1 roster 11=11 clean + plugin 18/15/3 + **ef-core SKILL stuck Mig 50 (TRUE 52) ×5 cites** drift → flushed; ⬜ H2 0-orphan (S65 PE fan-out fully harvested+committed) + flagged **cicd-monitor L1 86.8KB (2.9× cap) P1 GẤP**.
- **cicd-monitor L1 curate 86.8→28.9KB** (66% giảm): **byte-exact `sed` move** Run #286→#232 → `archive/2026-06.md` (incl #291 forensic [lesson=gotcha #65] + #383 ex-VỊ-TRÍ-LẠC); baseline + 6 runs #289-#295 giữ; essentials Mig 50→52 + bundle-live S70 #295. **Reliability fix** (25KB auto-inject cap: trước chỉ ~30% file inject).
- **H1 doc-flush:** `ef-core-migration` SKILL +Mig 51/52 rows + 5 count-flush (50→52); `skills/README.md` ×2 + root `CLAUDE.md` gotcha 64→65 + schema-diagram pending 32-50→32-52.
- **check-email AI_INFRA:** 0 thư mới se-directed (UI/UX guide đã xử lý S58). Phát hiện broadcast MỚI `outbox/all` → `/adap-apply`.
- **adopt Harness-8 (all-inherit + workflow-fastest)** [🔴 BẮT BUỘC, PROJECT-FIT 6/6]: 7 sub demoted `claude-opus-4-8`→`inherit` (cả 11=inherit, gỡ two-tier H4; SE không có helper/gopher rẻ) + `agents/README.md` codify (header+S66 note+ASCII) + `hmw.js` comment (logic vốn defer frontmatter) + adap-report + email-back ai_infra (hash `fa7f690d` round-trip MATCH). Nấc **executed-file VERIFIED-pending-restart**. Runtime chưa đổi (inherit=Opus 4.8 vì Fable down H5); giá trị forward-looking + H5.6 restore gọn hơn. H8.2 workflow-fastest codified (song song tối đa, KHÔNG hạ model).
- **§L:** AS scan 0 RCA · harvest GATE PASS 5/5 (no wave) · 2 monitor spawn-record on-behalf · tooling CHỐT (H8 roster change). **State THẬT GIỮ NGUYÊN** (0 production code): Mig 52 · 88 bảng · 263 test · 65 gotcha · menu 53 · bundle `BDwV5d0X`/`DbVv6rsf`. ⚠️ **Restart CLI** → H8 runtime + reviewer Cat-6. → session log `2026-06-16-S66-closeout-harness8-cicd-curate.md`.

### S65 (2026-06-16) — ✅ HRM go-live + Hồ sơ Nhân sự master-detail (giống NamGroup) + Department hierarchy + PE Link hồ sơ — ~6 deploy prod-verified Run #289→#295 (anh + anh Kiệt FDC UAT realtime)
- **#289 public Hồ sơ Nhân sự mọi role** (`4004481`): `SeedAllRolesHrmProfileReadPermissionsAsync` grant CanRead `Hrm`+`Hrm_HoSo` 13 role chạy SAU revoke S58 (upgrade-only nâng false→true row prod đã có; EmployeesController policy-based `Hrm_HoSo.Read` mở luôn API không hardcode Roles → gotcha #44 family CLEAN). Giữ ẩn Dashboard NS + Hrm_Config*. reviewer PASS 7/7. cicd: non-admin GET /employees **200** (was 403) · POST/PUT/DELETE **403** · DB 13 role CanRead=1.
- **#290 redesign màu foundation fe-user** (`c98030f`, 14 file): accent palette teal/violet/amberx/greenx (né trùng Tailwind) + `.app-gradient-brand`/`.card-accent`/`.icon-chip`/`.stat-value` + heading 600→700; Button gradient · Input/Select focus-glow · DataTable thead gradient · Dialog title-bar. brand #1F7DC1 + Be Vietnam Pro GIỮ; variant keys STABLE (build PASS = type-contract intact).
- **#292 Department hierarchy** (`0f44d97` + `6ce5803` test-fix, Mig 51 `AddDepartmentParentId`): ParentId loose-Guid no-FK + `GET /departments/tree` (ráp cây in-memory + đếm NV active theo `User.DepartmentId` [EmployeeProfile KHÔNG có DepartmentId] + rollup + cycle-guard HashSet) + Create/Update +ParentId + Update cycle-guard (chặn tự-cha + vòng A→B→A). Picker "Phòng cha" fe-admin (`8c8179c`, self-service, exclude-self). **gotcha #65** (Run #291 CS7036 — build csproj con lọt test-compile, fix +5th arg → Run #292 PASS).
- **#293 Employee 3-panel + PE Link hồ sơ** (`318860a` Phase B + `5a0aaa4` PE): EmployeesListPage rewrite master-detail (cây tổ chức + list + chi tiết 5 tab, giữ 100% 5 satellite CRUD = 16 endpoint) · Mig 52 `AddHoSoLinkToPurchaseEvaluation` (PE +HoSoLink hyperlink NAS `<a target=_blank rel=noopener>` null-safe) + rename "Dự trù PRO"→"Ngân sách PRO" ×2 app SHA256-mirror. **Workflow fan-out `pe-hoso-link-rename-pro` (BE∥FE→review)** — FE+reviewer empty-return #53 → em main recover-disk + self-gate (bắt badge sót rename) → `feedback_workflow_fanout_reliability`.
- **#294 gốc cây "SOLUTION COMPANY"** (`ec517f7`): gộp "Tất cả phòng ban" + list phẳng thành 1 node gốc công ty (chevron + bấm=tất cả) chứa phòng ban toả xuống (cha-con giống NamGroup).
- **#295 Employee refine 2-cột + màu** (`456c7a7`): anh góp ý live — layout 2 cột (cây+list TRÁI chồng · detail PHẢI rộng) + tô màu panel chi tiết (accent icon-chip/heading/rail). Designer self-caught 2 bug (accent `-800` không có → `-700`; rail `before:content`).
- **Bundle final:** admin `BDwV5d0X` / user `DbVv6rsf`. **State: Mig 52 · 88 bảng · 263 test · 65 gotcha · menu 53.** Test 263 unchanged (test-after defer, BE changes 0 test break). → session log `2026-06-16-S65-hrm-golive-employee-masterdetail-pe-link.md`.

### S64 (2026-06-15) — ✅ Adopt Harness-7 (writing-quality floor) + check-email ai_infra — em main solo, 1 commit
- **check-email ai_infra:** 0 email mới directed-to-se; UI/UX guide (S58) intact (whole-file hash MATCH). Anh chỉ: broadcast cho-mọi-sister ở `outbox/all/` (kênh `/adap-apply`), KHÔNG phải `outbox/se/`.
- **Adopt Harness-7** (`6afde19`, 6 file +106/−1): broadcast mới duy nhất trong `outbox/all` (13 vs 12 đã applied). Rule canonical `rules.md §1.1` (**O1** outward tiếng Việt câu-hoàn-chỉnh + đủ-dấu-câu + đúng-ngữ-pháp · **O2** asymmetric — nội bộ giữ lối nén §6.4/§6.5 · **O3** reviewer Category 6 + lead self-check). README Upgrade S64. adap-report + email se→ai_infra (`7e4f91f1` self-verified MATCH). PROJECT-FIT 6/6 áp trọn.
- **Body-hash lesson (gotcha #61 family):** broadcast `content_sha256 a4580ea9` verify đầu báo "mismatch" = **LỖI CỦA EM** (PS5.1 `Get-Content -Raw` đọc UTF-8-no-BOM bằng Windows-1252 → decode sai tiếng Việt); đọc `[IO.File]::ReadAllText UTF-8` → MATCH tuyệt đối. → **KHÔNG mis-stamp / tamper** (khác adap-request S63 `eol=lf` vốn class thật). Lesson: verify body-hash trên Windows phải đọc UTF-8 tường minh.
- **Nấc:** rule + reviewer wiring = executed-file · lead self-check = verified-live (session này) · reviewer Category 6 thực thi = verified-pending-restart (agent `.md` no hot-reload). **State unchanged** (docs/gov-only): Mig 50 · 88 bảng · 263 test (N/A re-run) · 64 gotcha · menu 53 · RAG 2423. → session log `2026-06-15-S64-harness-7-adopt.md`.

### S63 (2026-06-15) — ✅ Docs-closeout S60-62 (bù 3 session) + adopt Harness 5+6 + .gitattributes eol=lf — 3 commit em-main solo
- **Closeout S60-62** (`5e6dcc1`): drift bắt ở `/session-start` (git log: docs dừng S59 vs HEAD S62 + Mig 50). Reconcile **stray reviewer cwd-misland** (2 file con→canonical + pointer no-overwrite, xóa `fe-admin/.claude`) · commit harvest (cicd MEMORY Run #286 + gotcha #63/#64) · **count-flush 4 file** (Mig 49→50 · tables 93→88 · test 240→263 · gotcha 62→64 · menu 57→53 · Budget module REMOVED→PeWorkItemBudgets) · session-log bù `2026-06-12-S60-S62-*`.
- **Adopt Harness 5+6** (`dbbf89a`): **H5 model-fallback** (SE đã de-facto Opus 4.8 1M do Fable down 06-12 — book caveat agents/README + session-start BƯỚC 0.6; KHÔNG RCA/memory-permanent) · **H6 governed-ultracode** (H6.1 auto-HMW mode-ON + hmw.js role-less→inherit; H6.7 role/memory-fidelity đã sẵn S49) · 2 adap-report + email ai_infra (`8a247984` spec-canonical self-verified, sửa mis-stamp S58).
- **`.gitattributes`** (`08c7036`): `broadcasts/** eol=lf` (ổn định email body-hash cross-checkout) + adap-request federated (mis-stamp CLASS → propose floor eol=lf lên AI_INFRA).
- **State:** test 263 (N/A re-run — 0 code change) · RAG 2423 · lead **Opus 4.8 1M** (H5 fallback, Fable down). ⚠️ **Anh RESTART CLI** activate session-start BƯỚC 0.6 + ultra-on H6.1 (command no hot-reload; hmw.js H6.2 đã live). → session log S60-62 + 2 adap-report + 1 adap-request.

### S60–S62 (2026-06-12→06-13) — ✅ PE workflow polish + ngân sách per-gói-thầu (Mig 50, XÓA module Budget) + soft-warning vượt NS — 4 commit prod-verified Run ~#283→#286 [docs viết bù S63]
- **S60 `37122f0`+`6db195d`:** ràng buộc gửi duyệt đủ 4 thông tin mục 3 (đơn vị được chọn + giá chào>0 + ngân sách + bảng so sánh đính kèm, áp cả Admin) + rename mục 3 "Đơn vị NCC/TP được chọn" + bypass drafter-in-chain V2 bước-đầu (audit 3 tầng) · gỡ hành động "Từ chối" khỏi cả 4 policy (chỉ còn Duyệt/Trả lại, guard chặn TuChoi mọi caller). Test 240→256.
- **S61 `79ef8da` Mig 50 `ReplaceBudgetModuleWithPeWorkItemBudgets`:** bảng `PeWorkItemBudgets` per-gói-thầu (Dự án×Hạng mục, UNIQUE filtered) + **XÓA module Budget cũ** + drop PE/Contracts.BudgetId + backfill BudgetManual→BudgetPeriod TRƯỚC DropColumn (phiếu UAT giữ số) + bảng "Tổng hợp ngân sách trình ký" 2-block 9-dòng Excel anh Kiệt + nhập role PRO/CCM (Forbidden fail-closed) + XÓA FE budgets pages/types/menu `Bg_*`. Test → **263** (45D+218I). database-agent advise (no FK vật lý · DropIndex trước DropColumn SQL 5074 · IN-list). **gotcha #63** (EF RenameColumn sai-semantics) + **#64** (Design-DB 0-rows ≠ Dev-DB data-migrate).
- **S62 `7926c21`:** vượt ngân sách = cảnh báo mềm (gỡ validator `ExpectedRemaining>=0`, allowNegative row8, banner amber) — mirror LeaveBalance allow-negative. Reviewer PASS 0 issue. cicd **Run #286** bundle admin `0xKYGhhf`/user `C81ZdG9G`, DATA-PRESERVE 8/8 phiếu giữ số (gồm phiếu 1.243.820.600 đ anh Kiệt).
- **⚠️ docs closeout muộn:** 3 session ship code KHÔNG closeout → drift S59→S62 bắt ở S63 `/session-start` (git log). Reconcile stray reviewer (cwd-misland S62) + count-flush. → session log `2026-06-12-S60-S62-pe-budget-workitem-softwarning.md`.

### S59 (2026-06-11 chiều→tối) — ✅ Wipe testing data + PE tree 4 tầng + 71 mã PMH + 6 vòng UAT — 10 đợt prod-verified Run #273→#282 (8 PASS + 2 cancelled-benign)
- **Đợt 1 — wipe (anh Kiệt "xoá các cái testing trước đi em", `56882ac` #273):** recon → anh chốt scope (AskUserQuestion) → `scripts/s59-wipe-testing-data.sql`: 10 PE + child 252 + 7 HĐ [DEMO] + 64 notif + 1 AwV2 inactive = 0 · reset PeSeq/CtSeq (generator INSERT-if-missing → mã từ 001) · KEEP master 70/86/22 + users 55 + 7 workflow ghim · uploads orphan dọn. App-recycle KHÔNG resurrect. **Team vào testing chiều: phiếu thật đầu tiên = PE/2026/A/001 ✓.**
- **Đợt 2+3 — tree Panel 1 (`0eafcd3` #274):** v1 "Dự án (Năm) > Hạng mục" theo anh Kiệt → anh chốt follow-up **4 tầng 📅 Năm (DESC) > 📁 Dự án (A-Z) > 🧱 Hạng mục > phiếu**. FE-only (list DTO có workItemName S57bis), expand-key v3, SHA256 mirror ×2.
- **Đợt 4 — dọn 15 mã demo (chị Trà Sol, `bbd1554` #275):** WorkItems 86→**71** (Phần thô/Hoàn thiện/Cơ điện/Khác = mã "tự đẻ") + **GỠ HẲN seed demo block** DbInitializer (diệt gốc DB-mới) · đối chiếu **71/71 khớp bảng PMH từng dòng** · LocalDB Dev sync · bundle FROZEN (BE-only) · recycle giữ 71.
- **Đợt 5 — rename 71 mã format PMH (anh Kiệt "đúng kiểu vậy", `c869d26` #276):** `VT→MAT-n · TP→SUB-n · MEP-0n→MEP-SUB-n · TB→MEP-EQU-n`, Name "STT nhóm tên" ("1 MEP Sub MEP (Full)"). **DB-trước-code-sau** (gotcha **#62**: seed per-code idempotent — sai thứ tự = 142 rows; Run #276 verify đúng 71) · sqlcmd **`-f 65001`** + verify data qua API JSON (gotcha **#61**) · FE sort numeric ×3 · spec provenance sync.
- **Đợt 6+7 — UAT vòng 1+2 (`faed59f` #277 + `9c330d2` #278):** NEW **`ui/SearchableSelect`** (~140 LOC no-lib, fold bỏ dấu "be tong"→"Bê tông", keyboard, clear) áp Hạng mục/Dự án/NCC ×2 form · auto Địa điểm từ `Project.Location` (track lastAutoLoc, không đè tay) · anh chốt ×2 (AskUserQuestion): **ẩn Trả lại+Từ chối khi drafter tự duyệt** + **quick-add NCC** (POST /suppliers any-auth, PUT/DELETE giữ khóa — **cicd authz probe live 4/4**: 401/201/403/cleanup-204) · upload **multiple** files (báo giá + bảng so sánh).
- **Đợt 8-10 — UAT vòng 3-6 realtime (`f21c55d` #279-cancelled → `69997da` #280 → `80b64dd` #281-cancelled → `792c030` **#282 FINAL**):** **bảng NCC table-fixed** + width % từng cột + min-w-860 (file đính kèm tên dài hết vỡ layout, chip/email truncate kích hoạt) · **bỏ ô "Tên" ngân sách nhập tay** (user không hiểu — chỉ còn Số tiền; hasManual detect theo amount cho phiếu name-null) · **GỠ field "Điều khoản thanh toán" khỏi TẤT CẢ form phiếu** (Create + HeaderForm + inline-edit, PAYMENT_PRESETS drop −142 LOC; cột per-NCC + display read-only phiếu cũ GIỮ) · **bỏ nút "+ Thêm hạng mục"** (1 phiếu = 1 hạng mục header, AddItemDialog giữ dead để flip lại). 2 cancelled = Gitea concurrency push-đè khi UAT góp ý realtime — ancestor-verified preserved, pattern #385 S58.
- **Quality:** test 240/240 ×2 local + 8× CI gate · **0/14 spawn truncated** (H1×2+H2×2+recon+cicd×9 — verdict-FIRST + scoped prompt works) · 3 SQL script committed vào repo · Suppliers note: GET list = page (đếm thật qua DB 22).
- ⚠️ Carry: test-after guard suppliers authz + LockDemoSampleUsers · cicd-monitor L1 ~56KB curate monthly. → session log `2026-06-11-S59-wipe-tree-pmh-uat-batch.md`.

### S58 chiều (2026-06-11) — ✅ Tạm ẩn modules + Danh mục cuối (Run #383) + fe-user redesign guide AI_INFRA (Run #384)
- **Ẩn + thu hồi quyền (anh yêu cầu từ screenshot eoffice, commit `6c5fd26` → Run #383 PASS):** NEW `RevokeTemporarilyHiddenModulesAsync` — set 4 cờ CRUD=false mọi role TRỪ Admin trên `Hrm*` + `Off*` + `Personal` (menu tự ẩn 2 app; giữ row flip-lại-nhanh khi golive) + grant seed thu hẹp scope (không re-grant). Menu `Master` Order 20→**80** (Danh mục cuối sidebar). Prod verified: non-Admin CanRead=0 · Admin giữ 29 · Pe 120 · Master 48 · **menu-tree đối chứng 2 chiều** (nv.test mất 3 nhóm, admin còn). User thường eoffice giờ chỉ thấy: Hộp thư · Quy trình chọn TP-NCC · Danh mục (cuối). ⚠️ Mức che = menu + permission matrix; URL gõ trực tiếp chưa chặn (FE không PermissionGuard per-route — chấp nhận "tạm ẩn", note sẵn khi golive flip lại).
- **`/check-email ai_infra`:** nhận `2026-06-11-ui-ux-design-guide` (hash ✓✓ whole-file + body, processed) — **UI/UX Design Guide canonical 13 mục** (anh-approved, lineage NAMGROUP→BVAAU→AI_INFRA) + FYI lỗi stamp hash email H4-report SE (không tamper — lesson stamp lần send tới) + **ACK H4 ACCEPT** (SE = sister đầu tiên trọn vòng H4.7 email-back).
- **fe-user redesign (commit `e959f72` → Run #384 PASS):** 🩷 frontend-designer 14 file (index.css + 6 ui primitives + 6 shell + LoginPage) — density-first theo guide, **BRAND GIỮ** #1F7DC1 + Be Vietnam Pro + slate. Variant/size keys + props STABLE, RowActions/RowActionButton additive. Build ×2 PASS. **Bundle asymmetric đúng:** user `CKjwqnGL` rotate / admin `CP4CB1ym` frozen; brand verified trong HTML+CSS prod. ⚠️ Designer truncated #53 **lần 2 liên tiếp cùng điểm** (trước FD2 screenshot) → em main disk-recover + self-gate (lesson: emit file-list verdict TRƯỚC screenshot loop — ghi MEMORY nó).
- **Brand polish "thấy rõ" (anh: "có thấy khác gì đâu, trang trí lên 1 tý" — commit `ea793a4`, 8 file ×2 app, em main solo):** dải gradient brand 4px đỉnh app + logo zone sidebar tint brand-50 + PageHeader accent bar dọc + **thead mọi DataTable `bg-brand-50/60 text-brand-700`** + TopBar title semibold. Lý do anh chưa thấy đợt đầu: density tinh tế + PE panels (chỗ anh nhìn) chưa đụng (file shared 111KB).
- **PE gộp "Tên gói thầu" = chọn Hạng mục công việc (anh Kiệt FDC Zalo 14:06: "hạng mục chính là tên gói thầu, cho chọn chỗ đó" — commit `3ebaf84` → Run #386 PASS):** `PeWorkspaceCreateView` + `PeHeaderForm` — field "a. Tên gói thầu" Input tay → **1 Select từ 71 hạng mục** (`[Category] Code — Name`), chọn 1 phát set cả `workItemId` + `tenGoiThau` (= tên hạng mục); gỡ field "c" S57bis (trùng ý nghĩa). Phiếu cũ: option "Giữ nguyên: «tên cũ»" — không ép, PUT null-safe. NO BE change. **SHA256 mirror ×2 app** ✓. Run #385 cancelled supersede-benign (cicd ancestor-verified polish intact #386).

### S58 (2026-06-11) — ✅ Fix lock-demo-user prod NO-OP + password-seed root-cause — prod-verified Run #382
- **Commit `5998163` (1 file `DbInitializer.cs` +28/-5) → Run #382 PASS ~3m31s, prod-verified.** Anh: `/session-start` → bootstrap phát hiện Run #381 PARTIAL (lock NO-OP) + 2 file dirty S57bis → recon → anh chốt 3 quyết định (AskUserQuestion): union+password-fix · giữ chuong.phan-typo · giữ nv.test.
- **Root cause 2 tầng (🟦 recon dump prod + Dev + git pickaxe):** (1) lock list 14 email named-person = population **Dev-only** — demo prod thật = 20 UAT-matrix `{dept}.{nv,pp,tp}@`+`bod.{1,2}@` tạo TAY 05-13 chưa từng trong code; (2) `DemoUserPassword` 11 ký tự < prod `RequiredLength=12` → `CreateAsync` **silent-fail mọi startup từ trước tới giờ** (LogWarning-only) = root cause "helpdesk inert phòng IT 0 user" S56 + 5 real staff thiếu account.
- **Fix:** union 20 email (exact-email, KHÔNG pattern — `binh.le@` người thật sát scheme demo) + password → `User@1234567` 12 ký tự. **🟩 cicd Run #382 PASS:** prod Users **55/21 active/34 locked** · 20 UAT + 14 named-person locked · **nv.cao/nv.truong CREATED+ACTIVE (ops S56 "gán user IT" RESOLVED)** · 5 real staff created · guard 6/6 active · nv.test login 200 · bundle FROZEN `CP4CB1ym`/`BmZ3VHnm` · Mig giữ 49 · 93 tables.
- **Closeout kèm:** gotcha **#59** (PS5.1 `git commit -F`) + **#60** (seed silent-fail vs password policy) NEW · 4 spawn-record on-behalf APPEND (database-agent/implementer-backend/implementer-frontend/reviewer — H2 4-MISS đóng) · H1 doc-drift 5-patch (ef-core +row Mig 49, skills/README, dep-audit, CLAUDE.md root) · menu keys re-ground 57 · test 240 re-verified local · bundle hash curl-verified.
- ⚠️ **Lessons:** test xanh + deploy PASS + health 200 ≠ data tồn tại — seed `IdentityResult` silent-fail chỉ lộ khi **dump population env đích** (cicd PASS+PARTIAL + recon = tầng bắt được, CI gate không). Trade-off deadline: ship trước, test-specialist guard test sau (test-after, list-data fix).

### S57bis (2026-06-11 sáng) — ✅ PE gắn Hạng mục công việc (Mig 49) + Pe all-role + menu "Cá nhân" + Harness-4 runtime-VERIFIED — Run #381 PASS+PARTIAL
- **2 commit `17b23a4` (governance) + `dd117b7` (product, 26 file +7.4K) → Run #381 PASS ~4m25s** (Run #380 cancelled superseded — đúng). Sếp Zalo 11:02-11:17 deadline 15:00: mapping master data + phân quyền PE all-user + flow tạo phiếu chọn Dự án→Hạng mục→NCC + clear data cũ. Anh chốt: khóa CHỈ user sample · quyền Xem+Tạo · 1 phiếu 1 hạng mục header-level.
- **Mig 49 `AddWorkItemToPurchaseEvaluation`** (🔵 database-agent design): PE.WorkItemId `Guid?` **loose-Guid KHÔNG FK vật lý** (convention PE — ProjectId/SelectedSupplierId đều loose) + IX + validator `NotEmpty` create-only (DB nullable backward-compat 4 phiếu cũ) + FK-guard `AnyAsync(IsActive)`→Conflict + UpdateDraft null-safe. WorkItems = catalog GLOBAL → 2 dropdown độc lập, "Dự án (năm) – Hạng mục" = chuỗi ghép. 3 projection LEFT-join.
- **FE ×2 app:** PeWorkspaceCreateView select "c. Hạng mục *" + PeHeaderForm (SHA256 IDENTICAL) + PeDetailTabs subtitle. **Pe_* all-role:** 11 key CanRead+CanCreate=true 13 role (130 rows, upgrade-only — Pe_* leaf KHÔNG nằm `MenuKeys.All`, build qua factory; PeWf_*/AwV2 GIỮ Admin). **Menu "Cá nhân"** Personal root@30 + Chấm công re-parent + HrmConfig→Master + Master write-lock `Admin,CatalogManager` ×3 controller. `LockDemoSampleUsersAsync` 14 email (→ NO-OP prod, RESOLVED S58). Excel (3) đối chiếu = NO-CHANGE.
- **Test 228→240** (+12 `PeWorkItemGuardTests` — finding: `NotEmpty()` trên `Guid?` không chặn `Guid.Empty` → handler guard locked 2 test). **Harness-4 runtime-VERIFIED** spawn-test 2 chiều (H1 `claude-opus-4-8[1m]` + H2 `claude-fable-5[1m]`) + email-back AI_INFRA.
- ⚠️ **Lessons:** 2 builder return-truncated #53 (BE trước Mig, FE giữa mirror) + reviewer **die-0-byte ×2** (class mới resume-kill) → em main solo vá cross-stack + self-gate evidence-checklist. Session đóng VỘI sau commit → 2 file dirty (gotcha #59 + cicd Run #381 entry) trôi sang S58 harvest. → session log `2026-06-11-S57bis-pe-workitem-perm-golive-prep.md`.

### S56 (2026-06-09) — ✅ Pre-golive verify sweep + golive-harden 4 fix — HMW 2-workflow, prod-verified
- **2 Workflow fan-out + 1 code commit `a20cde8` → Gitea Run #379 PASS ~4m20s, prod-verified.** Anh: `/session-start` → hỏi NAMGROUP UI density-first → "Tiếp Phase 2 redesign" (dismiss scope → defer) → "kiểm tra lại tính năng + master data, sắp golive" + `/ultra-on` → "fix hết workflow luôn" → `/session-end`.
- **WF1 `pre-golive-verify`** (7 stream song song → adversarial-per-issue): prod-truth(🟩cicd) · schema(🔵database-agent) · 4× logic(🟦investigator) · authz-curl(🟥reviewer). **6/7 PASS · 1 CONCERN(non-blocker) · 0 blocker · 8 issue (adversarial confirm 6 real, refute 2 false-pos).** Verdict **GO**. Insight: phát hiện đáng giá nhất = **ops/data, không phải bug code** — prod phòng IT (CNTT) tồn tại nhưng **0 active user** → ItTicket auto-assign/reassign/SLA-notify đều inert (chỉ live-curl+sqlcmd thấy, test xanh không bắt). + S43 LeaveBalance lost-update còn nguyên + master-data idempotency PROVEN.
- **WF2 `golive-harden`** (Design→Build→Test→Review∥): **#3** LeaveBalance lost-update → database-agent design **atomic `ExecuteUpdateAsync`+Serializable tx** (NO migration, exactly-once `Status!=DaGuiDuyet:296` nguyên, server-side `UPDATE SET UsedDays=UsedDays+n` race-free) · **#5** ItTicket `AssignItTicketHandler` authz Forbidden-trước-NotFound (fail-closed, hết existence-oracle) · **#6** DocxRenderer null-guard MainDocumentPart+Document (CS8602 2→0) · **#4** Travel/Vehicle ApproveV2 +4 smoke test (trước đó 0 coverage).
- **Test 216→228** (+12). Build 0 warn. Bundle FROZEN admin `4SUwDLD8`/user `XdKzt9LL` (BE-only đúng). Mig 48 unchanged. `sys.tables` re-ground **92→93** (cicd ground-truth — Mig 48 col-only, prior under-count).
- **🟥 reviewer stage StructuredOutput-FAIL** → em main đỡ cross-stack review (đọc 3 production diff = clean). **🔵 database-agent review PASS** nêu 1 MAJOR (tx READ COMMITTED vs convention Serializable + rare auto-create-race) → **em main bump `IsolationLevel.Serializable`** đóng nốt + align convention. **🟩 cicd Run #379 PASS:** test 228 · health 200 ×3 · bundle frozen verified 3× · endpoint 401 (control 404 chứng minh auth thật) · Mig 48 top.
- ⚠️ **Lessons:** (1) **workflow-agent StructuredOutput-fail = class mới** của agent-return-unreliable → em main đỡ qua git-diff/disk truth (extends `feedback_agent_kill_recovery`). (2) workflow-agent self-write MEMORY (G-015 residual — sub giữ Write dù MODE-A) → em main verify sane + bundle harvest commit. (3) **gotcha #58** NEW. (4) HMW full-cycle: verify→fix→review→em-main-đỡ→re-verify→ship→cicd-PASS — adversarial tách-vai bắt lỗ phụ build+test-xanh không thấy.
- **🔴 NEXT:** 2 ops VPS (gán user IT + tzutil) · FE Phase 2 (recon ready) · Phase 9 Ops · monthly audit 2026-07-01. → session log `2026-06-09-S56-pre-golive-verify-harden.md`.

### S55 cont. (2026-06-09) — ✅ Phase 1 FE redesign fe-admin (density-first, giữ brand) — HMW-mode ON, prod-verified
- **Commit `7feb53e` → Gitea Run #378 PASS ~4m24s, prod-verified.** Anh: `/check-email NAMGROUP` (nhận bộ quy ước UI density-first) → "thiết kế lại giao diện cho đẹp hơn, tham khảo NAMGROUP, cho designer làm, workflow plan + làm luôn".
- **🩷 frontend-designer** redesign **14 file fe-admin** (Phase 1 foundation): `index.css` density heading-ladder + `.label-eyebrow` util (drop font-bold) · 6 UI primitive (Button/Input/Label/Select/Textarea/Dialog → `text-xs font-semibold`, `py-1.5` ≤36px, `rounded-lg`, brand focus-ring) · 6 shell (DataTable sticky-thead+RowActions / Layout brand-rail / TopBar / PageHeader / PhaseBadge / EmptyState) · **DashboardPage** flagship (KPI cards + brand-50 icon chips + uppercase labels + accent bars).
- **GIỮ brand** #1F7DC1 + Be Vietnam Pro (NAMGROUP nói brand=Solution tự quyết → chỉ mượn cấu trúc density). Visual-only, **functionality nguyên** (Button variant/size keys stable 51 call-sites, props/forwardRef intact).
- **🟥 reviewer PASS** 0 blocker (regression all-preserved, brand-confirmed `index.css:3/22/34`, exactly 14 file) — 2 minor a11y defer (slate-400 hint nhỏ). **🟩 cicd Run #378:** admin bundle `B-d6893W`→`4SUwDLD8`, user `XdKzt9LL` UNCHANGED (asymmetric FE-admin-only verify), no mig, health 200.
- ⚠️ **2 agent truncated** (designer + reviewer-#1, gotcha #53) → em main recover disk (build+login-visual+diff-review). **Dashboard live-screenshot bị chặn** dev auth-rig (API HTTPS vs proxy HTTP + protected route) → xem live qua deploy. Designer rig-gotcha #3 logged. **⬜ Phase 2** (Suppliers/Projects/Contracts pages) + **Phase 3** (mirror fe-user) pending. → session log `2026-06-09-S55-master-data-import.md` (redesign §).

### S55 (2026-06-09) — ✅ Nạp master data thật từ Excel + Project +4 cột (Mig 48) — HMW-mode ON, prod-verified
- **Commit `69cb393` → Gitea Run #377 PASS ~4m33s, prod-verified.** Anh: `/session-start` → giao file Excel "HẠNG MỤC CÔNG VIỆC DỰ ÁN" → "nạp master data vào đi nhé" → `/ultra-on "workflow làm xong hết"`.
- **Nạp 3 nguồn thật** (Excel 7-sheet → loadable): **62 Projects** (Mã+Năm; ~6 có CĐT/địa điểm/gói thầu) · **71 WorkItems** hạng mục (Vật tư16/Thầu phụ30/MEP9/Thiết bị16) · **3 Suppliers** (TRUONGGIANG/TANPHU/TGN). `WorkItem` master ĐÃ tồn tại → no new table cho hạng mục.
- **🟨 BE:** `Project.cs` +4 prop nullable (Year/Investor/Location/Package) + `ProjectConfiguration` maxlen 250/500/300 + **Mig 48 `AddProjectMasterFields`** (3-file, 4 AddColumn reversible) + `ProjectFeatures` DTO/Create/Update +4 + **`SeedRealMasterDataAsync`** (62+71+3 tuple-loop per-code idempotent, wired **UNGATED** line 118 sau SeedCatalogsAsync → reaches prod, coexist demo).
- **🟧 FE:** `ProjectsPage.tsx` form +4 input (Năm/Chủ đầu tư/Địa điểm/Gói thầu) + bonus cột "Chủ đầu tư" + `types/master.ts` +4 — **2 app SHA256-identical**. npm build ×2 PASS.
- **Verify:** build 0-err · test **216 PASS** (compile-fix `MasterCatalogFilteredUniqueTests` +4 null args, no new test) · **runtime Dev proof** (data landed, Investor col works) · **cicd Run #377 PASS** (Mig 48 applied prod · Projects spot-6/6 · WorkItems 71 · Suppliers 3 · CAL01.Investor exact · bundle admin `B-d6893W`/user `XdKzt9LL` · health 200).
- **Decisions (anh chốt):** Q1 thêm cột thật+migration (không Note-pack) · Q2 cả 3 → Dev+deploy prod. **FLOCK01 collision** → per-code skip (demo wins). Prod totals: Projects=70 (62 real+8 demo), WorkItems=86.
- ⚠️ **2 agent return truncated** (implementer-backend + reviewer, gotcha #53) → em main recover qua disk/runtime truth (`feedback_agent_kill_recovery`); cicd verdict-FIRST → PASS clean. Data-quality catch: MEP col gộp MEP-Sub+THIẾT BỊ divider → split đúng. → session log `2026-06-09-S55-master-data-import.md`.

### S54 (2026-06-08) — ✅ IT staff tự reassign ticket (cross-stack authz, HMW-mode ON) — 1 commit prod-verified
- **Commit `ca4b602` → Gitea Run #376 PASS ~4m18s, prod-verified.** Anh: `/session-start` → "2 xong sau đó là 1" (task 2 reassign trước, task 1 Phase 9 Ops sau) → task 2 done, task 1 anh dừng → `/session-end`.
- **Feature (cho tổ IT tự reassign — KHÔNG chỉ Admin như S53):** "IT staff" = `User.DepartmentId == Department(Code=="IT").Id` (reuse round-robin S52 predicate). Cross-stack, **NO migration** (DepartmentId reuse), no menu change.
- **🟨 BE** (`WorkflowAppsFeatures.cs` REGION 5 + `ItTicketsController.cs`): NEW `GetAssignableItStaffQuery`→`AssignableStaffResult{CanReassign,Staff}` capability endpoint (`[Authorize]` any-auth, trả `{false,[]}` cho người ngoài → **0 silent-403 chống gotcha #44**) + `AssignItTicketHandler` authz Admin-OR-dept-IT (`ForbiddenException`) + assignee-must-IT (`ConflictException`) + controller `/assign` hạ `[Authorize(Roles="Admin")]`→`[Authorize]` (handler enforce fine-grained data-driven).
- **🟧 FE** (2 app): `ItTicketsPage.tsx` **SHA256-identical `4bcaf2f…`** — REVERSE divergence S53 (cả 2 cùng gate nút by BE-computed `canReassign`, dropdown từ `/assignable-staff` thay `/users`). +2 type `AssignableStaff`/`AssignableStaffResult`. npm build ×2 PASS.
- **🟪 Test** (`ItTicketReassignAuthzTests.cs`): +13 (203→**216**) test-before-merge SECURITY — GetAssignableItStaff 6 (canReassign matrix + 0-leak empty + inactive-excluded) + AssignItTicket 7 (Forbidden guard-proof by-contrast + Conflict assignee-not-IT + side-effect no-mutation). No prod bug.
- **🟥 reviewer PASS** 0 blocker/0 major/1 minor: điểm chí mạng **role-string "Admin" chain-verified real** (`AppRoles.Admin`→`SeedRoles Role.Name`→`JwtTokenService Claim(ClaimTypes.Role)`→`cu.Roles` — decoy "QTV" chỉ ShortName, không vào JWT). Fail-closed verified, defense-in-depth nguyên.
- **🟩 cicd Run #376:** test 216 · bundle admin `DfCfHUE9`→`DmjI8Cmn`/user `_3S0BPJ2`→`YxL_MljK` (cả 2 rotate) · smoke health 200 + /assignable-staff 401 + /assign 401(body) · Mig giữ 47. Note: 411-bodyless-PUT = IIS Content-Length pre-`[Authorize]` (không phải routing miss).
- ⚠️ **Residual caught + fixed (em main single-writer):** 3 agent (BE/FE/test) ghi MEMORY nhầm `src/Backend/.claude/` (cwd-relative Write khi cd subdir) → em main git-status scan bắt stray + reconcile 2 pattern file về canonical + APPEND S54 delta vào 3 canonical MEMORY (harvest B2/B3). → memory `feedback_agent_cwd_relative_memory_misland`.
- 📌 **flag monthly audit 2026-07-01:** cicd đo `sys.tables=93` vs STATUS 92 → ✅ **RECONCILED S56** (93 authoritative, cicd ground-truth Run #379; Mig 48 col-only added no table — STATUS Current State updated 92→93).
- → session log `2026-06-08-S54-it-ticket-reassign-cross-stack.md`.

### S53 (2026-06-08) — ✅ gotcha #57 EXT Master (Mig 47) + P11-D reassign-UI + P11-E menu-key — all prod-verified · database-agent verified-runtime (HMW-mode ON, "làm hết" full closeout)
- **2 code commit deployed prod:** `44b9e54` Task B (Mig 47 `FilterMasterCatalogUniqueIndexesByIsDeleted` — Department/Supplier/Project filtered-unique Code, gotcha #57 EXT) Run #260 · `dbf6648` Task C+D Run #261. Test 200→**203** (+3 `MasterCatalogFilteredUniqueTests` RED→GREEN). Bundle admin `DYfjnpY0`→**`DfCfHUE9`** (rotated C+D FE) · user `_3S0BPJ2` unchanged.
- **Bootstrap:** database-agent **verified-runtime** (first real spawn since S52 adopt → caught **Mig 46 committed-but-unapplied-local** drift that 203 SQLite-tests + CI-applied-prod both MISS → bonus closed via Mig 47 deploy applying 46+47 to LocalDB Dev+Design). H1+H2 monitors re-reported (S52 closeout debt cleared; H2 confirmed S52 proxy-append present, 0 orphan).
- **Task B (Mig 47, Run #260):** workflow 🟪 test-specialist → 🟨 implementer-backend → 🟥 reviewer (PASS 0 issues). 3 prod indexes `filter_definition` NULL→`([IsDeleted]=(0))` live. gotcha #57 EXT cumulative now **6×** (Holiday 43 + 3 HRM 45 + 3 Master 47) — **backlog CLOSED**. Root cause: app dup-check `AnyAsync(Code==req)` đi qua `HasQueryFilter(!IsDeleted)` (bỏ qua soft-deleted) nhưng bare unique index đếm cả → delete+re-add = UNIQUE-500 reachable.
- **Task C+D (`dbf6648`, Run #261):** workflow 🟨 implementer-backend → 🟧 implementer-frontend → 🟥 reviewer (PASS 0 issues). C = ItTicket admin reassign dialog (fe-admin only, intentional mirror-break; reuse `PUT /assign` + `GET /users`). D = `Off_AttendanceReport` menu leaf (order 8, no migration — DbInitializer idempotent seed, admin-perm auto via `All[]`, menu-key byte-identical 5 mirror points). Prod: menu row seeded + admin bundle rotated + smoke 200/401.
- **Doc-drift E:** H1 top-5 patched (ef-core skill 43→47, agents/README roster 10→11, CLAUDE.md root 45→47 mig + 186→203 test, docs/CLAUDE.md 56→57 + 91→92 ERD). database-agent adap-report → verified-runtime.
- ⚠️ **cicd-monitor truncated 2×** (gotcha #53/#55; C+D verify cut mid-Q3) → recovered via curl-self-verify (Gitea run + bundle hashes public; menu-row from agent's pre-truncation sqlcmd). `feedback_agent_kill_recovery` reinforced.
- → session log `2026-06-08-S53-gotcha57-ext-p11-cd-closeout.md`.

### S52 (2026-06-08) — 🎉 Phase 11 product backlog ĐÓNG TRỌN (P11-D+E+F deployed) + database-agent adopt — HMW-mode ON, session-limit recovery
- **3 commit deployed prod:** `e9ee97f` (database-agent governance .md, CI-skip) + `6a66429` Wave 1 (P11-E+F code) + `dcf76f8` Wave 2 (P11-D, Mig 46). Test 186→191→**200**. Bundle admin `DYfjnpY0`/user `_3S0BPJ2` (cả 2 rotate; deploy verified curl độc lập — không cicd-spawn do limit).
- **🔌 database-agent adopt** (AI_INFRA broadcast `2026-06-08-Agent-database-codebase-agents`): floor DB1–DB11 **READ-advisory tier** (implementer-backend vẫn author file) · skill `sql-database-assistant`+`ef-core-migration` · color OMIT (8 standard hết → mirror monitor precedent) · `store_memory` strip · DB11 RowVersion tie-in vá S43 lost-update gap. **codebase-agent SKIP n-a** (investigator cover + csharp-lsp Windows no-op). Roster 10→**11**. Nấc executed-file → **🔴 CHỜ CLI restart** verified-runtime. adap-report 5-trường LOCK written.
- **P11-F MaTicket codegen** (Wave 1): `WorkflowAppCodeGen.GenerateMaDonTuAsync(db,"IT",clock.Now.Year,...)` gen-on-**Create** (kanban no-workflow, khác Leave/OT gen-on-Submit), `IT/2026/NNN` Serializable atomic. Migration-free.
- **P11-E AttendanceReport** (Wave 1): `GetAttendanceReportQuery` monthly aggregate (day-type weekday/weekend/holiday OT × OtPolicy multiplier, **classify in-memory** không EF-translate `.DayOfWeek`) + `AttendanceReportExcelExporter` (ClosedXML, sync no-DB) + 2 endpoint Admin-only + fe-admin `AttendanceReportPage` (download authed `api.get(blob)`). Migration-free. `Holiday.Date`=DateOnly (agent verify source-of-truth, không tin spec mù).
- **P11-D ItTicket assign+SLA** (Wave 2, **Mig 46** AddSlaFieldsToItTicket): round-robin least-loaded dept-"IT" (DbInitializer seed dept IT + 2 sample staff nv.cao/nv.truong, **ordering sau SeedDemoUsers** vì reconcile dept) + SlaDueAt theo Priority (Urgent4/High8/Medium24/Low72h) + `ItTicketSlaJob` (breach+warning notify, **KHÔNG auto-transition** — khác Contract) + PUT /assign admin override + FE badge 2-app SHA256 mirror.
- **⚠️ Session-limit hit giữa Wave 2** (3 agent killed: FE/test/cicd) → recovery (multi-agent resilience proof): Wave 2 BE/test verify-on-disk (build 0-err + 200 test) + **em main solo FE redo** (gotcha #53-class fallback) + **curl-self-verify** Wave 1+2 deploy thay cicd-spawn. Lesson: **git/disk/prod = source-of-truth, KHÔNG agent return-message**.
- **reviewer (Wave 1) PASS** — independent re-verify (build/test/tsc) + gotcha #44 role-string "Admin" disarmed (decoy `"QTV"`=display-code KHÔNG phải role-name). Wave 2 = **em main self-review** (seed↔query dept-code cross-check PASS, nv.cao/nv.truong tồn tại) do limit pressure.
- → session log `2026-06-08-S52-phase11-def-close-database-agent.md`.

### S51 (2026-06-08) — ✅ P11-C Vehicle+Driver catalogs (Mig 44) + gotcha #57 ext 3 HRM catalog (Mig 45) — HMW fan-out, deployed prod
- **Commit `30a99aa` → Gitea Run #371 PASS ~4m18s, verified prod.** HMW-mode ON, 7-agent fan-out: 🟦 recon → 🟨 BE ∥ 🟧 FE (parallel file-disjoint) → 🟪 test-before → 🟥 reviewer → 🟩 cicd. RAG/Qdrant DOWN cả session → ground-truth on-disk (đáng tin hơn stale RAG index 05-29).
- **Mig 44 `AddVehicleAndDriverCatalogs`** — 2 catalog table (Vehicles + Drivers, `AuditableEntity`), filtered-unique Code day-1 (gotcha #57 từ đầu). Extend HrmConfigs declarative: BE Region 5/6 CRUD (mirror LeaveType) + Controller +2 route-group (8 endpoint, GET public / write Roles=Admin) + MenuKeys +2 +All (auto Admin perm) + DbInitializer idempotent seed 2 veh/2 drv. FE KIND_CONFIG +2 kind ×2 app (SHA256 mirror) + 4-place (types/page/menuKeys/Layout staticMap), `:kind`-driven (no new App.tsx route). Tables 91→**92** (cicd `sys.tables` ground-truth).
- **Mig 45 `FilterHrmCatalogUniqueIndexesByIsDeleted`** (bundled gotcha #57) — LeaveType + ShiftPattern + **OtPolicy** bare `.IsUnique()` → `.HasFilter("[IsDeleted]=0")`. **OtPolicy BỊ BỎ SÓT khỏi backlog "2 catalog" → em main bắt được khi grep toàn bộ config** (= 3 HRM catalog). test-before: +5 `HrmConfigFilteredUniqueTests` (181→**186**), RED→GREEN observed.
- **🟥 reviewer caught 1 MAJOR** (pre-commit): Driver FE↔BE required-field mismatch (FE optional vs BE `NotEmpty`+NOT NULL) — root = inconsistent em-main brief across BE/FE → fixed (FE +`required:true`). Lesson: parallel fan-out → shared-contract inconsistency chỉ lộ lúc integration; green tests ≠ correct contract.
- **🟩 cicd Run #371 PASS:** test 186 · Mig 44+45 prod · 5 `IX_*_Code` filtered `([IsDeleted]=(0))` live (3 HRM was NULL) · bundle rotate admin `Cg9mvltU`/user `YgqDvsqr` · health 200 · /hrm-configs/{vehicles,drivers} 401 unauth + 200 authed (2 seed each).
- **gotcha #57 EXT** (investigator audit complete): Department/Supplier/Project (Master, confirmed-reachable via global query-filter quirk) → **worktree session** Mig 46 (3 idx). ContractClause/MeetingRoom/EmployeeProfile = SKIP (not reachable). → session log `2026-06-08-S51-p11c-vehicle-driver-gotcha57.md`.

### S50 (2026-06-07) — ✅ S49 Harness 1·2·3 verified-runtime closeout (HMW-mode ON · infra-finish, no product code, CI-skip)
- **`/session-start` bootstrap** → spawned **2 monitor sub** (tooling-auditor H1 + harvest-curator H2) RE-REPORT → **verified-runtime CONFIRMED** (S49 milestone (a) closed). H1 caught 3 doc-freshness drifts → em main patched (plugin 15→18 · skill-index 31→43 mig + 49→57 gotcha · verified-runtime markers). H2 harvest 🟢 clean (0-byte/orphan/corruption=0). Test gate **181 PASS**, RAG 2415.
- **(b) H2 wave-mode VERIFIED** — wave-run `h2-verify` (Workflow Run `wf_b7e4d6ef-787`, 2-agent: investigator-codebase read-only + test-specialist write-direct). **B6 isolation HELD**: git status = 6-baseline only (0 canonical/agent-memory leak), sub-MDs gitignored, **chunk 2415→2415** (0 rogue RAG write). B4 both-paths exercised. Bonus: gotcha #57 confirmed open + exact coords (`LeaveTypeConfiguration.cs:19` + `ShiftPatternConfiguration.cs:19` vs fixed `HolidayConfiguration.cs:18`).
- **(c) H3 email send-path VERIFIED** — `/send-email ai_infra` handshake → `broadcasts/outbox/ai_infra/`, body SHA256 `c9656c19…` self-verified MATCH + `_index.md` OUTBOUND logged. AI_INFRA `/check-email se` pull = their step (completes 2-way byte-identical proof).
- **§L.b(d)(f)(g) session-end:** H2 GATE **PASS 5/5** + B5 wave-gom (2 sub-MD → agent-memory/{investigator-codebase,test-specialist}). H1 freshness CHỐT (3 drifts patched, 0 new-alloc). 4 sub spawn-records all nấc=verified. **Rig fact:** Bash subs = `/usr/bin/bash` not PowerShell → POSIX only. → session log `2026-06-07-S50-harness-verified-runtime.md`.

### S49 (2026-06-07) — 🌐 AI_INFRA Harness 1·2·3 adopt (HMW-mode ON · governance/infra, no product code, CI-skip)
- **HMW-mode BẬT** (`/ultra-on` → marker `.claude/hmw-mode.on` gitignored) → anh `/adap-apply harness 1·2·3`. **Recon fan-out 4 read-only agent @P2** (3× investigator-codebase H1/H2/H3 gap + 1× investigator-api plugin/skill audit · return-delta · 367K tok · ~4m46s) → em main single-writer WRITE ~25 file. **Containment audit post-P2:** git-diff = 1 file-write (inv-api self-MEMORY, benign verified) + chunk-count **2414=2414** (0 RAG-write) → defense-in-depth proven (sub giữ Bash/Write — G-015).
- **Harness 1 (Self-observability):** roster **8→10** — NEW 2 sub **TÁCH BIỆT** (anh-mandate) `tooling-auditor` (H1 tooling/docs-freshness 4-mặt skill·sub-role·plugin·docs) + `harvest-curator` (H2 harvest-integrity 5-trục), INFORM-only (4 RAG-read, NO store_memory/Write). Wire `session-start.md` Phase 2.1.1 RE-REPORT + `session-end.md` §L.b **6→7-step** (H2 5-trục GATE + H1 chốt + B5 wave-gom). H3 plugin/skill = gộp-vai doc (0 agent mới — code-modernization/code-reviewer KHÔNG enable).
- **Harness 2 (wave-folder isolation):** `hmw.js` +wave-mode (subMdPath schema + tool-aware writeGuard) · `.gitignore` +`wave-*/`+`agent-teams/` (B6 **VERIFIED** `git check-ignore`) · NEW `.claude/workflows/README.md` convention. A agent-team = n-a (Windows in-process, convention-ready).
- **Harness 3 (email channel):** NEW `broadcasts/` (outbox/{6 others+all}/ + inbox/{6 others}/ + _index + inbox/README + **13 .gitkeep**, committed not-gitignored) + 2 cmd `send/check-email` (self=`se`, 6 others short-id `{ai_infra,vipix,dyd,namgroup,ashico,bvaau}`) + fix `adap-apply.md` base-path → `outbox/all/` (latent bug đóng luôn).
- **3 adap-report** `docs/governance/adap-reports/2026-06-07-Agent-harness-{1,2,3}.md` (nấc executed-file/verified-pending + evidence + tailored/skip + G-015 honest-caveat). 🟥 reviewer P4 **PASS all 3 — no blocker** (genuinely tailored not copy-paste · B6 git-check-ignore verified · SHA256 byte-identical · 1 MINOR pre-existing README diagram drift → fixed). **Test 181 unchanged** (no .cs). 🔴 **NEXT: anh restart CLI** → activate 2 sub + 2 cmd + hmw.js wave-mode → spawn-test confirm verified-runtime. → session log `2026-06-07-S49-harness-1-2-3-adopt.md`.

### S48 (2026-06-02) — ✅ adap-* verification closure post-restart + FD2 proof + Gov-v2 error-ledger (governance + 1 a11y fix)
- **CLI restart confirmed done** (registry has frontend-designer + adap-* cmds + 8 subs sans store_memory) → S47 "verified-pending" upgraded. `/adap-apply all-pending` = 0 new (all 3 applied S47); `/adap-report all-applied` → re-assessed + updated 3 reports honest (§C5/G-015).
- **#1 store_memory strip → VERIFIED-runtime:** `grep` agents `tools:` = 0 · loaded registry grants 0 `store_memory` to all **8** subs. NOT "read-only" (subs keep Bash/Write — defense-in-depth caveat holds).
- **#2 frontend-designer → FD2 loop VERIFIED-RAN** (🩷 first real spawn, background): full loop on fe-user `/login` — DS read (Tailwind v4 CSS-first) → Vite dev → Playwright screenshot 375+1440 → viewed PNGs → FD4 rubric all-PASS → 1-line contrast fix → re-shot → build PASS. em main mirrored fix to fe-admin (parity). 2 Vite-dev rig gotchas + Tailwind-v4 fact in FD MEMORY.
- **#3 Gov-v2 delta → CLOSED (executed-file):** NEW [`docs/governance/error-ledger.md`](governance/error-ledger.md) (blameless RCA E-001..E-004 + Active-Guards 2-strike index + §L.a AS-1..AS-9 deterministic-detect + 3-ledger triad map) + §L.b 6-step wired `session-end.md` Phase 1.5 (ran live this session = demo).
- **Code:** `fe-{admin,user}/src/pages/LoginPage.tsx` subtitle `text-slate-500→600` (a11y contrast ~7.5:1). Build × 2 PASS 0 TS error. **Test 181 unchanged** (FE-only, no .cs). Commit `350b2bf` → 🟩 **cicd Run #369 PASS** (~4m13s · bundle admin `DPPTx2Kw`/user `CjoUEsoV` rotated · Mig stays 43 · health 200 ×4). → session log `2026-06-02-S48-adap-verify-fd2-error-ledger.md`.

### S47 (2026-06-02) — 🔌 AI_INFRA adap-* adoption channel + 3 broadcasts (infra/governance, no product code)
- **Federated adoption channel installed** (AI_INFRA relay): 3 slash-commands forked → `.claude/commands/adap-{apply,report,request}.md`. Read AI_INFRA `broadcasts/outbox/` read-only (§J2) → apply own repo → `docs/governance/adap-reports/<id>.md` (5-field LOCK); AI_INFRA `/adap-audit` reads cross-repo 2-way. 0 agents spawned (em main solo — governance task).
- **#1 store_memory strip** — removed from ALL 8 subs' `tools:` → **lead (em main) = sole RAG-writer** (failure-safe). 4 RAG-read retained ×8. `agents/README.md` synced + G-015 note (NOT "read-only" — subs keep Bash/Write). Corroborates SE S41 re-bootstrap-loss lesson.
- **#2 frontend-designer (8th agent, pink)** — adopted (user call), forked AI_INFRA canonical FD1–FD10 visual-verification floor (Playwright screenshot ≥2 viewport → rubric → fix). Tailored SE stack + use-existing-DS (#1F7DC1/Be Vietnam Pro) + boundary ⟂ implementer-frontend (design/UX vs mechanical-mirror). memory seed + roster doc 7→8.
- **#3 Gov-v2** — already-applied S44 (`ae30f8f`); delta report flags 1 gap (no formal error-ledger/§L.b checklist — defer).
- **Nấc all executed-file / verified-pending** (restart + spawn-test). Test **181 unchanged** (no product code). CI-skip (all .md). → session log `2026-06-02-S47-aiinfra-adap-channel.md` · memory `feedback_aiinfra_adap_channel` · restart-batching lesson (front-load .md edits → 1 restart).

### S46 (2026-06-01) — 🧹 Memory integrity repair (no code, docs-only)
- **`/session-start` audit caught 2 user-memory files at 0 bytes** (S45 close-out truncation, gotcha #53): `MEMORY.md` index + `feedback_background_spawn_visibility.md`. Empty index = S46 bootstrap chạy KHÔNG có memory auto-inject (degrade thầm lặng).
- **Repaired (👤 em main solo):** rebuilt `MEMORY.md` index (14 entries: 8 feedback + 3 project + 2 pattern) · repopulate `feedback_background_spawn_visibility` từ HANDOFF/STATUS S45 ref (marked reconstructed) · NEW `feedback_session_end_memory_write_verify` (verify byte>0 sau closeout Write). **0 empty `.md` remain** (verified `find -size 0`).
- **No production/repo code touched.** Memory files ngoài repo (`~/.claude/.../memory/`) — không git-tracked → repo unchanged từ S45 `7fbe05a`. Test gate re-confirm **181 PASS** (58+123) lúc bootstrap.
- **Residual:** STATUS "27 user memory" stale → corrected **14**. Recommend thêm verify-byte-count step vào `/session-end` skill mechanism (AI_INFRA op per charter v2) — auto-catch class lỗi này.

### S45 (2026-06-01) — 🧪 HRM test-gap stabilization + Holiday drift fix (Mig 43)
- **2 commit `051b62b` (Tests) + `0c5a014` (Mig 43) → push → Gitea Run #368 PASS, verified prod.** "Stabilize before extend": đóng 3 test-gap deferred S35-S38 TRƯỚC khi chồng schema mới.
- **+27 test (154→181):** Gap1 Holiday composite UNIQUE (7) · Gap2 EmployeeSatellite FK-invariant+soft-delete+cascade (10) · Gap3 gotcha #44 authz regression HrmConfigs+Employees (10). 🟪 test-specialist viết (return truncated gotcha #53 → 👤 em main verify-on-disk + proxy MEMORY).
- **Mig 43 `FilterHolidayUniqueIndexByIsDeleted`** (👤 em main solo, bug-fix chain): Gap1 test lòi drift — Holiday DB UNIQUE (Year,Date) unfiltered vs handler `!IsDeleted` → admin xoá+thêm lại ngày lễ cùng date = **500 reachable**. Fix `.HasFilter("[IsDeleted]=0")` (khớp pattern 13× sẵn có). Flip Case 7 assert success. Table vẫn 91 (index-only).
- **🟩 cicd Run #368 PASS** ~4m20s: test gate 181 · Mig 43 applied prod · `IX_Holidays_Year_Date` filter=`([IsDeleted]=(0))` live (was NULL) · FE bundle UNCHANGED `Krjvg_3j`/`6sNStgxa` (đúng — BE-only) · health 200 · 0 regression.
- **🟦 investigator P11-C pre-flight** (Vehicle+Driver catalog): chưa có master → extend HrmConfigs +2 kind declarative, Mig 44, giữ VehicleBooking free-text. **gotcha #57 caught:** LeaveType.Code + ShiftPattern.Code cũng unfiltered (backlog).
- **gotcha #57 NEW** (soft-delete UNIQUE phải `.HasFilter`). Process: foreground spawn = im lặng = "looks frozen" → đẩy background + report-ngay (`feedback_background_spawn_visibility`).

### S44 (2026-06-01) — 🗓️ Monthly drift audit + AI_INFRA bundle 06-01 adoption (docs-only, CI-skip)
- **Cadence audit** (cron 2026-06-01) + adopt AI_INFRA bundle 06-01 (federated, team chọn full scope). 🟦 investigator-codebase drift scan (read-only, ground-truth verified) → 👤 em main patch. No code touched → **154 test PASS unchanged**.
- **42 count-drift fixes:** CLAUDE.md root + docs/CLAUDE.md + `ef-core-migration` SKILL + `dependency-audit-erp` SKILL + schema-diagram + database-guide — `40→42 mig · 84/59/55/47→91 tables · 130/111→154 test · 52/49→56 gotcha`.
- **Schema-diagram:** migration table extended Mig 17-42 (was stop ở 16) + total 55→91; detailed-§ gap (Mig 27-42 modules) flagged **explicit** (không silent → deferred backlog). `ef-core` SKILL migration history extended Mig 27-42.
- **AI_INFRA bundle:** §A RAG T1/T2 auto-ack · §B Gov-v2 align (no new layer) · §C hygiene **7/7 agent-mem L1 ≤16KB**, "25KB"→"~30KB tiered" wording ×7 · §D `#4` self-sustaining adoption-report step → `/session-end` (skip #1 đã có / #3 helper) · §E report + §F ledger `docs/governance/`.

### S43 (2026-05-30) — 🔄 Phase 11 P11-B: LeaveBalance business logic (trừ phép + số dư)
- **Commit `82d7fcf` → Gitea #367 PASS ~4m08s, deployed prod.** 7-agent (recon → BE → FE ∥ test → reviewer → cicd), agents Max → **0 bug lọt**.
- **Mig 42 `AddLeaveBalances`** (additive): `LeaveBalances` (User×LeaveType×Year + Entitled/Used/Adjustment, UNIQUE composite + FK LeaveTypes Restrict). 90→91 tables.
- **Trừ phép**: hook `ApproveLeaveRequestHandler` nhánh terminal DaDuyet — exactly-once (guard chặn re-approve), upsert auto-create từ `DaysPerYear`, `UsedDays += NumDays`, Year=StartDate.Year. Policy **cho phép âm + cảnh báo** (anh chốt).
- **FK invariant guard** (em Max-review thêm sau test reveal): Create + UpdateDraft validate LeaveTypeId tồn tại → ConflictException (đóng cửa, tránh 500 kẹt đơn lúc deduction FK insert).
- **CQRS** `LeaveBalanceFeatures.cs`: GetMy (self lazy-merge active LeaveType) + GetUser (admin) + Adjust (admin upsert). Embed balance NGƯỜI TẠO vào leave detail (approver xem đúng).
- **FE**: `WorkflowAppDetailPage` ×2 block "Số dư phép" + cảnh báo vượt (kind=leave, SHA256 identical, tích hợp trang đơn nghỉ — không trang riêng).
- **Test**: 144→**154** (+11 LeaveBalance/guard + repair 2 template terminal FK). Reviewer Max PASS (deduction exactly-once + FK fully closed; 2 minor defer: concurrency lost-update no-RowVersion + stale comment).
- Verified prod: Mig 42 applied, LeaveBalances UNIQUE+FK ✓, `/leave-balances/my` 200 → 5 LeaveType lazy-default, bundle rotate.

### S42 (2026-05-30) — 🔄 Phase 11 P11-A: wire ApproveV2 + LevelOpinions 4 WorkflowApps module
- **Commit `e7b66cd` (Gitea #364) + fix `75df04e` (#365) → PASS, deployed prod.** Cookie-cutter mirror Proposal (Mig 38). 7-agent end-to-end (recon → BE×3 → FE → test → reviewer → cicd). (Run-id "#250" memory truncated ghi sai → Max re-verify reconcile #364/#365.)
- **Mig 41 `WireWorkflowAppsApprovalV2`** (additive): +4 bảng `{Leave,Ot,Travel,Vehicle}LevelOpinions` (UNIQUE composite + Cascade/Restrict) + `WorkflowAppCodeSequences` (shared atomic MaDonTu) + 4 cột `RejectedFromStatus` + enum `TravelRequest=9`.
- **BE:** 30 handler (`LeaveOt` + `TravelVehicle` ApprovalFeatures.cs) — GetById/Update/Submit/Approve(UPSERT+advance)/Reject/Return + verify ApplicableType per module. 8 controller route. Seed 4 WF mẫu (QT-NP/OT/CT/XE-V2-001, AppType 5/6/7/9) — gotcha #51 INFRASTRUCTURE-gated PASS prod.
- **FE:** `WorkflowAppDetailPage.tsx` declarative 4-kind (admin+user SHA256 identical) — workflow status + opinion timeline + Submit/Approve/Reject/Return actions; gỡ banner skeleton + row nav.
- **Test:** +11 `WorkflowAppApproveV2Tests` (130→141) — state machine + UPSERT invariant + guards + forbidden + placeholder + codegen. No prod bug.
- **Verified:** Mig 41 applied prod (5 bảng EXIST) · bundle rotate cả 2 app · 4 endpoint live · seed prod · reviewer checklist (no copy-paste bug, [Authorize] OK).
- ⚠️ **Gotcha #53/#55 tái diễn 3× session này** (FE + reviewer + cicd-monitor truncate output cuối) — mỗi lần recover qua MEMORY + em main manual verify. Anti-truncation lesson reinforced.
- 🔬 **Max re-review (agents chạy High) phát hiện + fix 2 bug FE picker** (chưa commit lúc deploy đầu): (#1) `pinWorkflow` PUT `/{id}` partial → 400 validator; (#2) fetch expect array nhưng endpoint trả `{types}` object → picker rỗng. Fix: thêm endpoint chuyên dụng `PUT /{id}/workflow` (set workflow only, verify ApplicableType) + sửa fetch mirror PE/Contract `data.types.find().history.filter(isUserSelectable)`. +3 test SetWorkflow (141→144). **Bonus phát hiện:** `ProposalCreatePage` (S37) có bug #2 có sẵn → spawn task riêng.
- 📌 Follow-up minor (non-blocking): known-minor unreachable (Reject/Return actor-check khi CurrentApprovalLevelOrder null) · deploy.yml stale comment "54/17 test" (cosmetic) · test Travel/Vehicle mirror pending (Leave full + Ot smoke có).

### S41 (2026-05-29) — RAG corpus cleanup (w/ AI_INFRA)
- AI_INFRA RAG audit → SE-side prep: `.claude/rag.json` exclude root-anchored→`**/`-anchored (defeats gotcha #10: `node_modules/**`+`docs/_archive/**` weren't matching nested paths) + retired stale `_decision_log` "+321%/11,922".
- **store_memory reconcile (anti-data-loss, NAMGROUP lesson):** unified at-risk rule = content reproducible từ file {exists ∧ matches corpus glob ∧ not excluded}. 5/5 accounted: 3 broadcasts disk-twinned + `16a6b6db` audit-response twin-safe + `0307141b` S37-S40 catch-up **promoted-to-disk** (`docs/changelog/sessions/2026-05-29-S37-S40-rag-catchup.md` — anchor was virtual, not real STATUS section).
- AI_INFRA re-bootstrap host-side `--config`: **3080→2406** (−674 junk), node_modules=0 / _archive=0 / manual-marker=0, user-memory 60 chunks (slug fix). SE post-verify PASS (promoted catch-up returns file-indexed real heading, not `(manual)`). Commits `282cbd0`+`e8cbbe5` pushed (docs/infra → CI skip).
- ⏳ Standing infra backlog (AI_INFRA, non-blocking): bootstrap glob→0 warn · auto_reindex hook fire · search_code corpus gap (src/*.cs+fe/*.tsx, v0 design) · registry sync.

### S40 (2026-05-29) — Init audit + doc consolidation
- 7-agent smoke verify (🟪 test-specialist + 🟦 investigator-api load OK), RAG re-rank PASS (top 0.8789 Voyage rerank-2.5), 130 test confirm.
- Doc consolidation: STATUS 170KB→5.7KB + HANDOFF 224KB→3.4KB (archive full → `docs/_archive/`). Count re-ground (endpoints 211, FE pages 65, menu ~53; tables 84 confirmed). Stale credential `admin@solutionerp.local`→`admin@solutions.com.vn` fixed. CLAUDE.md root patch (mig/table/test).
- Curate 4 agent MEMORY >25KB→<8.4KB (~130KB→41KB, foundation preserved + verbatim git). RAG store_memory S37-S40 catch-up chunk. 2 commit push `d2f52ba`+`78c9de3` (docs-only CI skip).

### S39 (2026-05-29) — ⚙️ INFRA: Opus 4.8 1M + Multi-agent 4→7 + budget +50%
- Pure infra/governance, 1 commit `fd0554a` (docs CI skip). Model default Opus 4.8 1M. investigator→codebase+api · implementer→backend+frontend · +test-specialist (purple). 5 RAG MCP/agent. 2 gotcha NEW #54 (529 fallback) + #55 (truncation mid-exploration). CLI restart → registry hot-reload (done S40).
- → `docs/changelog/sessions/2026-05-29-S36-S39-phase10-complete-7agent.md`

### S38 (2026-05-28) — 🎊 PHASE 10 COMPLETE 11/11 (SKELETON combo)
- Mig 39+40 + BE ~1100 LOC + FE 5 file × 2 app + 8 menu. Run #247 PASS 3m25s. G-O4/O5/O6/P1/H3 skeleton. Trade-off DEFER Phase 11: ApproveV2 wire + LevelOpinions per-module + LeaveBalance + CodeGen atomic + Vehicle/Driver catalog + ItTicket auto-assign/SLA.
- → same session log



---

