# HANDOFF — Brief 5 phút cho session tiếp theo

> **Tiering rule (S40):** giữ **2-3 session gần nhất**. Cũ hơn → `docs/changelog/sessions/`. Full brief history pre-S40 → `docs/_archive/HANDOFF-preS40-fullhistory.md`.

**Last updated:** 2026-06-19 (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.)

---

## 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`.
