# STATUS — Snapshot hiện tại
> **Update rule:** trước khi bắt đầu 1 task → ghi row `🔥 In Progress`. Xong → `✅ Recently Done`.
> **Tiering rule (S40):** chỉ giữ **state hiện tại + 3 session gần nhất** ở file này. Session cũ hơn → `docs/changelog/sessions/`. Full history pre-S40 → `docs/_archive/STATUS-preS40-fullhistory.md`. (Tránh over-context — xóa double, không cắt nội dung.)
**Last updated:** 2026-06-19 (S78 — **PE: đính kèm file khi DUYỆT (UAT Tra Sol / 5 tester)** — người duyệt tải file của mình lên ngay lúc Duyệt thay vì Trả lại phiếu (tình huống thay đổi nhỏ). Reuse hệ attachment + enum `ApprovalAttachment=5` **MIGRATION-FREE** (int-stored, 0 schema change); endpoint `POST {id}/attachments` + authz có sẵn (handler không guard drafter-only → approver upload được). FE 2 app SHA-identical: `PeWorkflowPanel` picker multi-file + upload-TRƯỚC-chuyển-phase (file lỗi=không duyệt) + mục "📎 File đính kèm khi duyệt" (download/preview) + 2 filter fix loại purpose=5 khỏi "Bảng so sánh" (gotcha **#71** proxy-predicate pollution). commit `7886fd0` → **Run #330 PASS** ~4m56s (test gate **354**, bundle admin **`CsJetgZH`**/user **`BVS0ApIm`**, NO migration, smoke 4×200 + attachments 401-wired). **3 lỗi em tự bắt review-trước-deploy** (authz-verify handler · filter-pollution #71 · Dialog mirror-truncate fe-admin). em-main-led + self-gate (grep no-leak thay reviewer over-cap) + cicd-monitor verify. → log `2026-06-19-S78-pe-attach-file-on-approve.md`. · **Prev S77** — **buổi sản phẩm RẤT LỚN: 10 deploy prod-verified #320→#329 (anh Kiệt FDC + Tra Sol + Bích Phượng UAT realtime, HMW-mode ON)** — bundle cuối admin **`BqKD3Y23`** / user **`Cn-i349D`** (Run #329). **Mig 56→57** `AddPeSuggestedPriceNotes` · test 344→**354** (+10) · gotcha **70** (tái dùng #70). 10 việc PE: (1) cờ GẤP **pill** 🔴PRO/🟢CCM đồng bộ MỌI danh sách + inbox (#320, NEW `PeUrgentChips` ×2 app); (2) **focus mode** bấm phiếu→overlay (#321) → **revert** list về layout gốc bám-trái lấp-đầy (#322); (3) **Mig 57** ô ghi chú giá đề xuất PRO/CCM (2 cột nvarchar(1000)) + **số phân cách VND** (`VndInlineEdit`/`BudgetCell`) + sửa chính tả "Bảng so sánh giá" + **guard #70** stale-echo (#323); (4) số âm → **đỏ + ngoặc** `(…)` hàng 7/8/9 (#324); (5) mục con **thụt dòng + gạch đầu dòng** phân biệt có-số/không-số (#325); (6) cờ gấp authz **BẤT ĐỐI XỨNG** GẮN=NV chức năng / GỠ=chỉ Trưởng phòng (DeptManager) (#326, asymmetric handler + button-by-state); (7) **tách chọn-phiếu (inline 3-panel) khỏi mở-rộng (overlay)** + nút "Xem mở rộng" mỗi dòng (`?expand=1`) (#327); (8) **chuông báo người duyệt** khi phiếu vào cấp họ — submit + mỗi approve-advance (#328, `LogTransitionAsync` notify current-level approvers); (9) banner phiếu **Trả lại** hướng dẫn gửi lại (#329). **3 lỗi em tự bắt khi review TRƯỚC deploy** (guard #70 stale-echo cho ô ghi chú · luật cờ-gấp bất-đối-xứng Tra Sol clarify giữa-chừng · double-mount PeDetailTabs Task H — intent-comment có nhưng code sót). Cách chạy: em-main + frontend-designer ×3 (focus/revert/decouple, FD2 stub-verify do backend-down #3) + implementer-frontend (pill/notes/sep/spelling) + implementer-backend ×2 (Mig 57 · approver-notify) + test-specialist ×3 (notes +7 · urgent symmetric→asymmetric REDO do clarify-after-dispatch) + cicd-monitor ×10 (10/10 PASS). **frontend-designer process-death giữa Task H → recover-disk** (edit hoàn-chỉnh trên disk, em-main build-verify + mirror). **🔴 NEXT (em): curate L1 over-cap GẤP** — reviewer **45KB** + cicd-monitor 37.6KB + inv-codebase 35.6KB (keep-floor-hit → manual SPLIT/condense; archive-gate A7 GATE PASS 186/186 integrity OK) + FD 26KB/test-spec 27.7KB WATCH strike-1. → log `2026-06-19-S77-pe-ux-batch-10-deploy.md`. · **Prev S76** — **PE ngân sách MA TRẬN 3 cột (Dự án|PRO|CCM) + bảng lưới `
` 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 `` theo phản hồi anh, Run #319 **`jOqxW4-p`**/**`DbsznVvR`**, smoke 3×200). **Part 1:** PRO sửa cột PRO (canEditPro), CCM sửa cột CCM (canEditCcm), Dự án FE hiển-thị-only; Mig 56 +ProInitial/ProAdjust additive + data-migrate ProEstimate→ProInitial (4 rows prod). **Part 2+3:** badge "✎ NS PRO/CCM" cạnh approver (suy từ role, display-only no-authz) ở Workflow Designer + flow Duyệt NCC. Test 339→**344** (+5). **2 workflow review** (Part 1 PASS + Part 2/3 PASS) — reviewer bắt **race mất-dữ-liệu** Part 1 (impl self-review sót) → vá `useIsFetching` 2 app, **gotcha #70 NEW**. Lessons: flex+gap KHÔNG ra "bảng" → phải `` viền-ô · workflow-review-flaky (2-3 lane empty #53) → em-main self-gate lane rỗng. **NEXT:** 🔴 curate L1 over-cap (reviewer **45KB** + inv-codebase 35KB keep-floor-hit manual-condense; cicd 29KB + test-spec 28KB strike-1). → log `2026-06-19-S76-pe-budget-matrix-table-grid.md`. · **Prev S75 (2026-06-18)** — **Harness-11 adopt: engine bộ-nhớ-và-governance TỰ-BẢO-TRÌ + 2 double-check** — anh giao `/check-email AI_INFRA` + `/adap-apply` (mỗi stage workflow-review) + double-check ×2 + finalize report + push + session-end. em main + **5 Workflow** (audit `wf_7fdc3bd5-930` → implement `wf_c5e5844e-7c1` → review `wf_d7ca1ff8-942` → double-check `wf_a0b68d2f-30e` → checklist-verify `wf_39cd4cbe-f07`). **0 production code.** Built `scripts/governance-detectors.ps1` (C1 broken-pointer + C2/B3 staleness + C3 vocab-fork + C4 self-exclusion + C5 resolve, NO-API DÒ+FLAG, runtime **26 flag** bắt drift thật, C4 0-self-match) + `scripts/memory-archive-gate.ps1` (PHẦN A hysteresis 0.85/keep-floor 5/2-strike/A7 NO-API 186/186) + `docs/governance/harness-11-engine.md` canonical (3-tier D5/D6/D7 EXPLICIT + one-direction-lock D8) + **B1 ×11 count→pointer `docs/STATUS.md`** (drift mig53→55/test306→339/gotcha68→69/table93→88 RESOLVED) + cadence-wire session-start §2.1.3 (D1) + session-end §L.b(c) (D2) + agents/README Upgrade S75. **completeness-gate FORMAL ĐẠT** (B 4/4 + C 5/5 + D 11/11 đủ-trọn, A 🟡 tailored — A6 runtime cần 2×-Apply legit-by-design). **gotcha #30 reinforced** (box-glyph ├└─ KHÔNG vào .ps1 — PS5.1 -File ANSI mojibake, KỂ CẢ qua Edit render-normalize; detector pure-ASCII verified). 3 commit `e70c046`+`ae957c4`+`aa09e99` pushed + adap-report + email ai_infra (`2316773229f2`). **State THẬT GIỮ NGUYÊN: Mig 55 · 88 bảng · 339 test · gotcha 69 · menu 54 · bundle `BYF5vIMJ`/`CB-tiRxd`.** ⚠️ restart CLI (cadence §2.1.3/§L.b + ef-core skill). 🔴 curate-debt: reviewer 38.8KB + inv-codebase 31.5KB + cicd 26.8KB over-cap (archive-gate confirm; reviewer+inv keep-floor hit → manual split). → log `2026-06-18-S75-harness-11-adopt.md`. **Prev S74** — **PE ô "Ghi chú từ CCM" ngân sách gói thầu (Mig 55)** — anh forward 2 luồng Zalo (Trà Sol + Kiệt FDC) "CCM cũng giống PRO cho nhập + ghi chú, hiện 0 hết" → em-main BE+Mig55 ∥ implementer-frontend FE 2 app SHA-mirror ∥ test-specialist (chết rate-limit → recover-disk). 2 fork anh chốt qua AskUserQuestion: **thêm CcmNote (Mig 55)** + **GIỮ phân vai CCM** (CostControl/Admin). Entity `PeWorkItemBudget +CcmNote` mirror ProNote · `UpdatePeBudgetCcmCommand +CcmNote` absolute-set role-gate fail-closed · DTO+controller+mapping · FE dòng "Ghi chú từ CCM" gate `canEditCcm` (sau V0/hiệu chỉnh, absolute-set đủ 3 field). Mig 55 additive-nullable sạch (no #63). Test 334→**339** (+5 CcmNote). **Chẩn đoán "0 hết không nhập":** tài khoản thiếu role CostControl (KHÔNG bug) → UAT bằng CCM/Admin. commit `8655ebf` push main (cicd **Run #315 PASS** ~4m54s — Mig 55 applied prod, bundle admin `BYF5vIMJ`/user `CB-tiRxd`, smoke 4×200). Lessons: controller call-site thiếu arg sau +param record (grep+vá, #65 bắt) · agent-kill-529 recover-disk no-re-spawn · PS here-string commit-msg trong if-block mis-parse → `git commit -F`. → session log `2026-06-18-S74-pe-ccm-note.md`. **Prev S73** — **Mig 54 PE giá đề xuất PRO/CCM + CEO chọn giá chốt + CCM duyệt-done ô-tích (anh Kiệt FDC — go-live so-sánh-giá thứ Hai 22/06)** — em main + 6 sub + 2 review-workflow. **2 commit prod-verified:** `1d86abc` (feature, cicd Run #313 PASS — Mig 54 + bundle admin `OlNyG9OD`/user `DSzSLVtL`) + `6aa4dcb` (FE empty-candidates guard fix). **BE:** Mig 54 `AddPeSuggestedAndApprovedPrice` 5 cột additive-nullable (ProSuggestedMin/Max·CcmSuggested·ApprovedPriceAmount·Source) + 2 setter role-gate PRO/CCM (Forbidden fail-closed mirror budget) + ApproveV2 **③ AUTO→OPT-IN** (`finalizeByCcmDelegation` ô-tích, gỡ auto-threshold S69) + **① bind giá chốt** mọi nhánh DaDuyet (human bắt-buộc-chọn, isSystem-miễn) + DTO +7 field/capability. **FE 2 app SHA-mirror:** PeWorkflowPanel (bộ chọn giá + ô tích CCM + fix empty-candidates) + PeDetailTabs `SuggestedPriceRows` + types +7. **Test 306→334** (+28). **2 workflow review (bài học):** R1 schema-force CHỈ **1/4** lane returned (flaky no-StructuredOutput) → R2 **free-text 2/3 PASS** — rủi ro #1 FE empty-candidates = **UNREACHABLE** (submit-guard `:194` chặn gửi-duyệt khi winnerQuoteTotal≤0). → review fan-out dùng **free-text / hmw RUN-TRACE**, KHÔNG ép-schema inline. **Governance honest:** em lệch mandate auto-Workflow (mode-ON) + chỉ khai khi anh hỏi → **cam kết báo-TRƯỚC-khi-lệch**. Run-trace `runs/2026-06-18-mig54-pe-review/` (custom-inline, bù post-hoc). → session log `2026-06-18-S73-pe-gia-de-xuat-ccm-done.md` pending. · **Prev S72** — **Harness-10 flat-refine + checklist-v2 adopt (re-audit 3-workflow) + sleep NO-OP** — em main + 9 sub qua 3 Workflow (audit `wf_13868efb-ea7` → implement `wf_ac43b5ff-7d1` → review `wf_d482e10d-5dd`, mandate Harness-9 B1+B2). Anh chỉ "sisters làm tốt mỗi SE thiếu" → re-audit đo vs canonical: **SE BEHIND Harness-10 flat** (run-trace còn SUBFOLDER, canonical=FLAT) → migrate `hmw.js` (`:103` sub-md/→flat + `:52` schema + **H4.5→H8 doc-drift**) + `workflows/README` full-rewrite + `runs/README` + session-start/end + `agents/README` Upgrade S72 + `_ledger`; **5 run cũ S71 GIỮ subfolder** (C8 dual-accept). +2 broadcast 06-18 adopt (checklist-v2 + h10-flat-detector-refine). +`/sleep-recovery-memory-l2` port (A8, §J2-tailored SE-only, floor intact, live skill). **detector refine-b TAILORED-OUT** (SE Workflow-tool no-CLI-bypass; containment git-diff+tracked+orphan-scan G-015). **REVIEW (B2 dogfood) bắt 2 lỗi IMPLEMENT-self-assess sót** (hmw.js:52 schema-stale + sleep-cmd auto-check un-wired overclaim) → fixed (auto-check **WIRED thật**: budget.json `+last_sleep_at` + session-start:78 + session-end:48, grep-verified). em-main containment-check tự bắt 1 reviewer residual-write (raw-Workflow KHÔNG hmw.js writeGuard → reverse-finding #4) → revert. **B3 self-correct:** S71 report path tắt `runs/`+"14" → thật `.claude/workflows/runs`=22. **Sleep `all`=NO-OP** (5/9 empty-archive + 4/9 đã-gisted → 0 compressed; `last_sleep_at`=2026-06-18). **0 production code, state THẬT GIỮ NGUYÊN.** adap-report `2026-06-18-Governance-harness-10-flat-refine-checklist-v2` + email ai_infra (`5f511fe5c0f2`). ⚠️ **restart CLI** activate FLAT-runtime hmw.js + wired sleep-check + sleep-recovery skill. 🔴 **NEXT (em):** curate investigator-codebase L1 **28973 OVER** (audit-trail) + watch frontend-designer/test-specialist near-cap. → session log `2026-06-18-S72-harness-10-flat-refine.md`. **Prev S71 — Harness-10 adopt: tracked run-trace folder convention + checklist 9-10 self-verify** — em main + 3 Workflow (invest `wf_9c2cd2cd-2e7` → implement `wf_e4e46725-231` → review `wf_636bc95b-939`) theo mandate Harness-9 PART 2. **0 production code** (governance/workflow only). Migrate `.claude/workflows/wave-*/` gitignored → `runs//` **git-TRACKED** (run.md + sub-md/ + harvest/) + `_ledger.md` 2-nhịp + 3-layer anti-miss (L1 em-main@P1 ledger-check / L2 session-start orphan-scan / L3 session-end close-gate **idempotent-VERIFY-not-re-APPEND**) + **containment model shift** (Harness-2 B6 "mọi tracked-change=vi-phạm" → Harness-10 "tracked-change NGOÀI run-folder + code-disjoint=vi-phạm"; run-folder TRACKED → HIỆN git-diff = audit trực-tiếp). hmw.js wave→run-trace (accept `args.run`, alias `wave`; path `sub-md/`; `node --check` PARSE-OK). **Review độc-lập (R2+R3) bắt C5 L1 over-claim** (doc nói hmw.js prompt-builder emit L1 reminder nhưng grep engine=0 → engine no-fs → fixed path-a: L1 = em-main @P1 convention) — dogfood mandate B2 đúng (1-workflow-tự-chấm sẽ bỏ sót). **checklist 9-10:** Part A (Harness-9 memory) + Part B (adap 2-workflow) ĐÃ done S70; Part C (Harness-10) MỚI 8/8. dogfood: 3 run-trace folder TRACKED đầu + 3 entry ledger. adap-report `2026-06-18-Governance-checklist-harness-9-10` + email ai_infra. **State THẬT GIỮ NGUYÊN: Mig 53 · 88 bảng · 306 test · 68 gotcha · menu 54 · bundle admin `BgNCjwsG`/user `CBvh0vtf`.** + `CLAUDE.md` test-flush 263→306 (pre-existing uncommitted, resolve H1 stale-flag). ⚠️ restart CLI activate hmw.js RUN-TRACE runtime + (carry S66/S70) §2.1.2 budget-audit/reviewer-Cat-6/H8-inherit. ✅ **curate-debt CLOSED S71** (FINALIZE double-check `wf_73de399d-753` + curate `wf_f32987b8-03f`): reviewer 36.7→24.8KB + investigator 29.8→23.2KB (both <25600 cap, archive +N -0 0-byte-loss) + reviewer-gist gen:2 + 3 user-memory G2/G3 + budget.json re-measure. Race root-cause fixed cấu-trúc (hmw.js RUN-TRACE writeGuard). → session log `2026-06-18-S71-harness-10-run-trace.md` (pending). **Prev S70** — **Harness-9 adopt: L2 archive dark-matter recovery + adap 2-workflow mandate** — em main + 3 Workflow (investigate `wf_be952f3c-97f` → implement `wf_a58e0d15-beb` → audit `wf_9520d8cd-4fe`) + 2 monitor bootstrap. **0 production code** (governance/memory only, commit `f36aab8` pushed). 4 over-cap sub-agent (cicd-monitor/investigator-codebase/reviewer/implementer-backend) curate L1→L2 + `archive/_INDEX.md` (mục-lục con-trỏ **substring sha-keyed**, Ctrl-F fallback) + `.gist.md` (nén 4-field distill-gen:1, verbatim FROZEN) → **cả 4 < 25KB auto-inject cap** (P1 curate-debt CLOSED; ~240KB archive hết RAG-dark). PART 2/3 process-mandate codify (adap-apply + agents/README Upgrade S70 + session-start §2.1.2 budget-audit). **0-byte-loss git+sha verified** (Stage C audit + em-main self-gate khi 2 reviewer no-StructuredOutput). +`memory-budget.json` (seed-by-measure) + `scripts/measure-agent-memory.ps1` + `.ragignore` + doc-drift 4-cite flush. adap-report + email-back ai_infra (body-hash `7c07b716e775`). **State THẬT GIỮ NGUYÊN: Mig 53 · 88 bảng · 306 test · 68 gotcha · menu 54 · bundle admin `BgNCjwsG`/user `CBvh0vtf`.** ⚠️ restart CLI để activate session-start §2.1.2 + pending H8 inherit + reviewer Cat-6. → session log `2026-06-17-S70-harness-9-l2-recovery.md`. **Prev S69** — **Văn phòng số (E-Office) port + golive + PE cờ gấp/ngưỡng CCM — 4 deploy prod-verified Run #305→#308, HMW-mode ON, 2 workflow fan-out + ~14 spawn**: foundation PURO (shared PageHeader/KpiCard/WidgetCard + Dashboard 2-cột + sync fe-admin index.css đóng drift S66-S68) #305 → **re-skin TRỌN 10 page** PURO layout + CSS Hồ sơ NS, phẫu-thuật-giữ-100%-logic (reviewer verify api/queryKey byte-identical) #306 → **Office golive public** `SeedAllRolesOfficeModulePermissionsAsync` read+create 16-key allow-list mọi role (mirror S65 pattern, chạy SAU revoke; excluded Off_PhongHop_Manage/Off_AttendanceReport/Off_ChamCong giữ ẩn; cicd DB-verify 16/16×13 role) #307 → **PE cờ gấp PRO/CCM + CCM duyệt-final theo ngưỡng giá trị** Mig 53 (anh Kiệt FDC sau họp sếp) #308. **State THẬT: Mig 53 · 88 bảng · 306 test (45D+261I) · 68 gotcha · menu 54 · bundle admin `BgNCjwsG`/user `CBvh0vtf` Run #308.** 2 gotcha NEW (**#67** Tailwind accent palette thiếu-stop vỡ-màu-im-lặng · **#68** stale-diagnostic-background-agent). 2 truncation #53 (impl-backend positional-record + impl-frontend) → em main recover-disk + self-gate (cả 2 build PASS sau-cùng). C (sau duyệt → chuyển phiếu đến dự án) chờ anh Kiệt spec form. → session log `2026-06-17-S69-vanphong-golive-pe-urgent-threshold.md`. **Prev S68** — **Hồ sơ NS header chi tiết NV: làm nổi bật + fix tên render đen→trắng** — em main solo, 3 commit (2 FE `6983609`+`37752eb` · 1 docs `11bc96d`), 2 deploy prod-verified Run #303-304 (anh UAT realtime): tên `text-xl extrabold`+drop-shadow · dòng meta `text-[13px] font-medium` trắng-đậm · badge pill **màu theo trạng thái** (#303); anh báo "tên đen nền xanh ko nổi bật" → diagnose **rule `h1-h4{color:#0b1220}` viết NGOÀI `@layer` thắng `text-white`** (Tailwind v4 unlayered > all layers, **gotcha #66 NEW**) → ép `text-white!` + thu nhỏ `text-lg` (#304, grep dist confirm `!important`). Bootstrap: 2 monitor RE-REPORT CLEAN + 2 doc-drift fix (dep-audit 64→65 · root CLAUDE 263→286, H1 flag). **State THẬT: Mig 52 · 88 bảng · 286 test · 66 gotcha · menu 53 · bundle admin `CNUv1jxY`/user `CpOskeS1` Run #304.** ⚠️ curate-debt P1: cicd-monitor **44.1KB** (worst). **Prev S67:** **buổi sản phẩm LỚN, 6 deploy prod-verified Run #297→#302** (anh + anh Kiệt FDC UAT realtime, HMW-mode ON): fe-user Hồ sơ NS đồng nhất font + chữ đen→**xanh đậm `brand-800`** (#297 `ab4e681`) · **fe-admin mirror master-detail** + accent tokens index.css [đóng pending lớn nhất HRM go-live, page SHA256 ×2] (#298 `292d64d`) · **+23 test-after HRM** [Dept cycle-guard · PE HoSoLink absolute-set · HRM-perm seed] → 263→**286** (#299 `bcd619d`) · **list flex-row gọn** [bảng 3-cột→flex-row, `overflow-x-hidden` → hết tràn ngang rail] + đồng nhất cỡ chữ [18/14/13/11px] ×2 app (#300 `91aaf05`) · **PE Link hồ sơ auto-detect** `http(s)`→hyperlink/`O:\`→Copy (#301 `6df1b2d`) → **render link `file://` bấm-thử** + Copy (#302 `536dd6b`). **Workflow research 3 investigator-api** (auto-mở `O:\` từ web): default browser CHẶN https→file://; **chỉ Edge GPO `IntranetFileLinksEnabled`** (Edge-only, Intranet Zone, 1 GPO domain zero-per-machine) = one-click thật — Chrome không có; .url-download zero-install nhưng 2-click. **State THẬT: Mig 52 · 88 bảng · 286 test (45D+241I) · 65 gotcha · menu 53 · bundle admin `CcrZqfht`/user `DniDFUB_`** (#302). test-specialist truncated return #53 → em main recover-disk (3 file test đủ + 286 verify); 0 production bug. ⚠️ curate-debt: cicd-monitor 39.8KB + inv-codebase 39.4KB over-cap. **Prev S66** — **session-end closeout em-main-solo, 0 product-sub:** adopt **Harness-8 all-inherit** (7 sub demoted `claude-opus-4-8`→`inherit` → cả 11 = inherit, gỡ two-tier Harness-4) + **cicd-monitor L1 curate 86.8→28.9KB** (byte-exact sed → `archive/2026-06.md`, incl #291 forensic) + **ef-core skill doc-flush Mig 50→52** (H1 drift, +Mig 51/52 rows) + check-email AI_INFRA (**0 thư mới se-directed**). ~17 file docs/gov/config, **0 production code** → state THẬT GIỮ NGUYÊN: **Mig 52 · 88 bảng · 263 test · 65 gotcha · menu 53 · bundle admin `BDwV5d0X`/user `DbVv6rsf`**. ⚠️ **Restart CLI** để H8 runtime (frontmatter no hot-reload) + reviewer Category 6 (S64 pending). adap-report `2026-06-16-Governance-harness-8-all-inherit-workflow-fastest` + email-back ai_infra (hash `fa7f690d` round-trip MATCH). Prev S65 — **HRM go-live: public Hồ sơ Nhân sự + trang master-detail giống NamGroup + Department hierarchy + PE Link hồ sơ**, ~6 deploy prod-verified Run #289→#295, anh + anh Kiệt FDC UAT realtime): (1) **public Hồ sơ Nhân sự mọi role** — `SeedAllRolesHrmProfileReadPermissionsAsync` grant CanRead `Hrm`+`Hrm_HoSo` 13 role chạy SAU revoke S58 (upgrade-only; EmployeesController policy-based `Hrm_HoSo.Read` mở luôn API không hardcode Roles), giữ ẩn Dashboard NS, Run #289; (2) **redesign màu foundation fe-user** — accent palette teal/violet/amberx/greenx + `.app-gradient-brand`/`.card-accent`/`.icon-chip` + heading 700, brand #1F7DC1 + Be Vietnam Pro giữ, Run #290; (3) **Department hierarchy** Mig 51 `AddDepartmentParentId` (ParentId loose-Guid no-FK + `GET /departments/tree` ráp cây in-memory + rollup count theo `User.DepartmentId` + cycle-guard HashSet) + picker "Phòng cha" fe-admin (self-service org chart) + Update cycle-guard, Run #292; (4) **Hồ sơ Nhân sự master-detail giống NamGroup** — `EmployeesListPage` rewrite: 3-panel→**2-cột** (cây tổ chức gốc "SOLUTION COMPANY" + list chồng TRÁI · chi tiết 5 tab PHẢI) + tô màu accent, giữ 100% 5 satellite CRUD (16 endpoint), Run #293/#294/#295; (5) **PE mục "e. Link hồ sơ"** Mig 52 `AddHoSoLinkToPurchaseEvaluation` (`HoSoLink string?` hyperlink NAS + `` target_blank rel-noopener + null-safe) + rename "Dự trù PRO"→"Ngân sách PRO" (row+badge) ×2 app SHA256-mirror, Run #293. **State THẬT: Mig 52 · 88 bảng · 263 test (45D+218I) · 65 gotcha · menu 53 · bundle admin `BDwV5d0X`/user `DbVv6rsf`** (Run #295 `456c7a7` Employee-refine — user rotate `CZfo_PFZ→DbVv6rsf`, cicd PASS). **🔥 Workflow fan-out chạy THẬT lần đầu** (`pe-hoso-link-rename-pro` BE∥FE→review) — parallel disjoint-file OK, NHƯNG FE+reviewer return-RỖNG #53 → em main recover-disk + self-gate (bắt badge "DỰ TRÙ PRO" sót rename); **verdict: fan-out cho parallelism nhưng reviewer-stage không tin được trong harness này → verify-heavy task vẫn tự gác = tương đương spawn lẻ** (`feedback_workflow_fanout_reliability`). gotcha **#65** NEW (build csproj con ≠ `dotnet build slnx` gồm tests → miss test-compile khi đổi chữ ký record command → CI CS7036 Run #291 FAIL-gated). **Prev S64** adopt **Harness-7 writing-quality floor** — em main solo, commit `6afde19` docs/gov-only, 0 sub spawn: `rules.md §1.1` outward-VN-full-grammar + reviewer Category 6 + adap-report + email ai_infra; broadcast body-hash `a4580ea9` verified-MATCH **KHÔNG mis-stamp** [false-mismatch = gotcha #61 PS5.1 UTF-8 decode của em]. Prev S63 docs-closeout bù S60/S61/S62 — **State THẬT: Mig 50 · 88 bảng · 263 test (45D+218I) · 64 gotcha · menu 53 · bundle admin `0xKYGhhf`/user `C81ZdG9G` Run #286**; S60-62 = PE ràng buộc gửi-duyệt + bypass drafter (S60) · gỡ "Từ chối" (S60) · Mig 50 ngân sách per-gói-thầu Excel anh Kiệt + XÓA module Budget cũ (S61) · vượt-NS cảnh-báo-mềm cho lưu (S62); + reconcile stray reviewer cwd-misland; session log `2026-06-12-S60-S62-pe-budget-workitem-softwarning.md`). Prev Session 59 ( **10 đợt ship prod-verified: 8 Run PASS + 2 cancelled-supersede-benign #273→#282** (run_number API — dải đếm khác #38x S58, cùng pipeline; 2 cancel = push-đè khi UAT góp ý realtime, ancestor-verified): (1) **wipe transactional testing data** theo anh Kiệt FDC — 10 PE + 7 HĐ [DEMO] + 64 notif + 1 AwV2 cũ inactive = 0, reset PeSeq/CtSeq → phiếu thật đầu tiên team tạo chiều nay = **PE/2026/A/001** ✓, app-recycle KHÔNG resurrect (DemoSeed gate held), uploads orphan dọn (`56882ac` #273); (2+3) **PE tree Panel 1 chốt 4 tầng "📅 Năm > 📁 Dự án > 🧱 Hạng mục > Phiếu"** (anh chốt follow-up sau bản gộp "Dự án (Năm)"; `yearGroups` useMemo, expand-key v3, FE-only — list DTO đã có workItemName S57bis) (`0eafcd3` #274); (4) **dọn 15 mã hạng mục demo tự chế** theo chị Trà Sol "xóa cái đám phần thô phần hoàn thiện… MÀ ANH TỰ ĐẺ RA" — WorkItems 86→**71**, GỠ HẲN block seed demo khỏi DbInitializer, đối chiếu 71/71 khớp bảng PMH từng dòng (`bbd1554` #275, bundle frozen BE-only); (5) **rename 71 mã đúng format PMH anh Kiệt chốt** "MÃ CV gồm chữ MEP-SUB-1 rồi tên 1 MEP Sub MEP (Full) — đúng kiểu vậy" → `MAT-n`/`SUB-n`/`MEP-SUB-n`/`MEP-EQU-n` + Name "STT nhóm tên"; **DB-trước-code-sau** (gotcha **#62** NEW — seed per-code idempotent, sai thứ tự = 142 rows) + sqlcmd `-f 65001` (gotcha **#61** NEW — verify data qua API JSON, KHÔNG tin console mojibake) + FE sort numeric ×3 ×2 app (`c869d26` #276); (6) **UAT 6 vòng 11 điểm**: NEW **`ui/SearchableSelect`** combobox gõ-lọc BỎ DẤU (fold NFD — Hạng mục/Dự án/NCC) + auto Địa điểm từ Project.Location + điều khoản TT Textarea đa dòng (`faed59f` #277) · anh chốt: **ẩn cả Trả lại+Từ chối khi người duyệt = người soạn** (drafterUserId match) + **quick-add NCC ngay form** (SuppliersController POST hạ → any-auth, PUT/DELETE giữ khóa — cicd authz probe live 4/4: 401 unauth/201 nv.test/403 delete/cleanup) + upload multiple files ×2 chỗ (`9c330d2` #278) · vòng 3-6 realtime (`f21c55d` #279-cancelled / `69997da` #280 / `80b64dd` #281-cancelled / `792c030` **#282 FINAL**): **bảng NCC table-fixed** width từng cột (file dài hết vỡ layout) + **bỏ ô "Tên" ngân sách nhập tay** (chỉ còn Số tiền, hasManual detect theo amount) + **GỠ field "Điều khoản thanh toán" khỏi TẤT CẢ form phiếu** (cột per-NCC + display phiếu cũ GIỮ) + **bỏ nút "+ Thêm hạng mục"** (1 phiếu = 1 hạng mục header). Bundle FINAL admin **`B1DtNT9C`**/user **`D6uF3Mln`** (Run #282). Test 240 ×2 local + 8× CI gate. **0/14 spawn truncated** (lần đầu sau nhiều session). → session log `2026-06-11-S59-wipe-tree-pmh-uat-batch.md`. Prev S58 (2026-06-11 — **4 việc prod-verified Run #382/#383/#384**: lock-demo-user fix + tạm ẩn HRM/Office/Cá nhân + Danh mục cuối sidebar + fe-user redesign theo UI/UX guide AI_INFRA. **Việc 1 — lock fix** (Run #382, `5998163` ~3m31s): Run #381 cicd phát hiện S57bis lock = NO-OP (14 email named-person là population Dev-only). Recon dump prod: demo thật = 20 UAT-matrix `{dept}.{nv,pp,tp}@`+`bod.{1,2}@` tạo TAY 05-13; root cause sâu = `DemoUserPassword` 11 ký tự < prod `RequiredLength=12` → `CreateAsync` silent-fail MỌI startup từ trước tới giờ (= root cause "helpdesk inert phòng IT 0 user" S56). Fix: union 20 email + password 12 ký tự. Prod sau deploy: **55 user / 21 active / 34 locked** — 20 UAT + 14 named-person locked ✓, **nv.cao/nv.truong CREATED+ACTIVE (helpdesk S56 RESOLVED)** ✓, 5 real staff created ✓, guard admin/catalog.manager/nv.test/chuong.phan-typo active ✓ (anh chốt 3 quyết định AskUserQuestion). Bundle FROZEN. gotcha **#60** NEW (seed silent-fail vs prod password policy — dump population thật trước khi lock/seed-by-email). +Closeout S57bis residual: gotcha #59 commit, 4 spawn-record on-behalf (H2 4-MISS), H1 5-patch doc-drift, test 240 re-verified local. Prev S57bis (2026-06-11 sáng) — **PE gắn Hạng mục công việc (Mig 49) + mở quyền Pe all-role + menu "Cá nhân" + khóa demo user** (sếp Zalo deadline 15:00): commit `17b23a4` (Harness-4 two-tier runtime-VERIFIED spawn-test 2 chiều) + `dd117b7` (product) → Run #381 PASS ~4m25s. Mig 49 `AddWorkItemToPurchaseEvaluation`: PE.WorkItemId `Guid?` loose-Guid KHÔNG FK vật lý (convention PE — database-agent design) + IX + validator NotEmpty create + FK-guard handler Conflict + UpdateDraft null-safe. FE ×2 app PeWorkspaceCreateView/PeHeaderForm (SHA256 identical)/PeDetailTabs "Dự án – Hạng mục". Pe_* 11 key CanRead+CanCreate mọi role (130 rows/13 role — Pe_* leaf KHÔNG nằm MenuKeys.All, build qua factory). Menu Personal root@30 + Chấm công re-parent + Master write-lock `Admin,CatalogManager` ×3 controller. Test 228→**240** (+12 PeWorkItemGuardTests). Bundle rotate cả 2: admin `CP4CB1ym` / user `BmZ3VHnm`. 2 builder truncated #53 + reviewer die-0-byte ×2 → em main solo vá cross-stack + self-gate. Excel (3) đối chiếu = NO-CHANGE (S55 data identical). Prev S56 — **Pre-golive verify sweep + golive-harden 4 fix — HMW 2-workflow, prod-verified**: commit `a20cde8` → Run #379 PASS ~4m20s. WF1 `pre-golive-verify` 7-stream song song + adversarial → 6 PASS/1 CONCERN/0 blocker = **GO**; key finds = **ops not code** (prod IT-dept 0 active user → helpdesk inert + S43 LeaveBalance lost-update còn nguyên). WF2 `golive-harden` fix 4: **#3** LeaveBalance lost-update→atomic `ExecuteUpdateAsync`+Serializable tx (NO mig, exactly-once nguyên) · **#5** ItTicket authz Forbidden-trước-NotFound (fail-closed) · **#6** DocxRenderer null-guard (2 warn→0) · **#4** Travel/Vehicle ApproveV2 +4 smoke. Test **216→228**. Bundle FROZEN `4SUwDLD8`/`XdKzt9LL` (BE-only). `sys.tables` re-ground **92→93** (cicd ground-truth, Mig 48 col-only). reviewer stage StructuredOutput-fail→em main đỡ cross-stack review (3 diff clean) + bump Serializable đóng MAJOR. gotcha **#58** NEW (EF read-modify-write lost-update→ExecuteUpdate atomic). **2 ops VPS pending** (gán user phòng IT + `tzutil` UTC+7). FE Phase 2 redesign **deferred** (recon ready). Prev S55 — **Nạp master data thật từ Excel + Project +4 cột (Mig 48), HMW-mode ON**: commit `69cb393` → Run #377 PASS ~4m33s, prod-verified. Anh giao file Excel "HẠNG MỤC CÔNG VIỆC DỰ ÁN" → `/ultra-on "workflow làm xong hết"`. Nạp **62 dự án + 71 hạng mục + 3 NCC** vào Project/WorkItem/Supplier qua `SeedRealMasterDataAsync` (per-code idempotent, **UNGATED** → coexist demo, tự lên prod). **Mig 48 `AddProjectMasterFields`**: Project +4 cột nullable (Year/Investor/Location/Package, NO new table). FE ProjectsPage form +4 input ×2 app SHA256 mirror. Test 216 (compile-fix MasterCatalogFilteredUniqueTests +4 null args, no new test). Bundle admin `DmjI8Cmn`→`B-d6893W`/user `YxL_MljK`→`XdKzt9LL` (cả 2 rotate). Prod verify: Mig 48 applied · Projects spot-6/6 · WorkItems VT/TP/MEP/TB=71 · Suppliers 3 · CAL01.Investor="Công ty TNHH Calofic". **2 agent return truncated** (implementer-backend + reviewer, gotcha #53) → em main disk/runtime-recover (build/test/sqlcmd/git truth); cicd verdict-FIRST → PASS clean no-truncate. Data-quality catch: MEP col gộp 2 nhóm + divider "THIẾT BỊ" → split đúng 71/4-category. Provenance `scripts/master-import-data.generated.md`. Prev S54 — **IT staff tự reassign ticket (cross-stack authz, HMW-mode ON)**: 1 code commit `ca4b602` → Run #376 PASS ~4m18s, prod-verified. Cho tổ IT (dept Code=="IT") + Admin reassign ItTicket trên CẢ 2 app. BE: NEW `GetAssignableItStaffQuery` capability endpoint `{canReassign,staff}` + `AssignItTicketHandler` authz Admin-OR-dept-IT (Forbidden) + assignee-must-IT (Conflict) + controller `/assign` hạ `[Authorize(Roles=Admin)]`→`[Authorize]` (handler fine-grained). FE: fe-admin+fe-user ItTicketsPage **SHA256-identical** (REVERSE S53 divergence) gate nút by `canReassign`, dropdown từ `/assignable-staff` (không `/users`). Test 203→**216** (+13 authz guard test-before-merge). NO migration (DepartmentId reuse). Bundle admin `DfCfHUE9`→`DmjI8Cmn` / user `_3S0BPJ2`→`YxL_MljK` (cả 2 rotate). 6-agent fan-out (BE∥FE→test→reviewer→cicd) + em main reconcile stray-memory residual (3 agent ghi MEMORY nhầm `src/Backend/.claude` → harvest về canonical). reviewer PASS 0 blocker (role-string "Admin" chain-verified). Task 1 Phase 9 Ops KHÔNG làm (anh dừng). flag: cicd `sys.tables=93` vs STATUS 92 → monthly audit re-ground.) Prev S53 (gotcha #57 EXT Master Mig 47 + P11-D reassign-UI fe-admin + P11-E menu + database-agent verified-runtime: `44b9e54` Run #260 + `dbf6648` Run #261, test→203, bundle→`DfCfHUE9`). Prev S52 (Phase 11 P11-D+E+F deployed + database-agent adopt, HMW-mode ON): 3 commit — `e9ee97f` (database-agent DB1–DB11 read-advisory, roster 10→11, executed-file CHỜ restart) + `6a66429` Wave 1 (P11-E AttendanceReport+Excel+OtPolicy multiplier + P11-F MaTicket codegen, migration-free) + `dcf76f8` Wave 2 (P11-D ItTicket round-robin assign dept-IT + SLA timer, Mig 46). Test 186→**200**. Bundle admin `DYfjnpY0`/user `_3S0BPJ2` (cả 2 deploy verified curl độc lập — Wave 1 BE 401 wired + Wave 2 /assign 401 + Mig 46 applied health-200). ⚠️ **Session-limit hit giữa Wave 2** → recovery: BE/test verify-on-disk + em main solo FE redo + curl-self-verify thay cicd-spawn (multi-agent resilience, git/disk/prod = source-of-truth). RAG recovered (chunk 2416 rerank live) nhưng stale 05-29. Prev S51: P11-C Vehicle+Driver.)
---
## 🎯 CURRENT STATE (verified S40)
| Metric | Value | Note |
|---|---|---|
| Migrations | **57** | +S77: Mig 57 `AddPeSuggestedPriceNotes` (PE +`ProSuggestedPriceNote` +`CcmSuggestedPriceNote` nvarchar(1000) — ô ghi chú giá đề xuất PRO/CCM giải-thích Min/Max · additive-nullable, 0 backfill, no new table; absolute-set role-gate mirror Mig 54/55). +S76: Mig 56 `AddProBudgetSplitToPeWorkItemBudget` (PeWorkItemBudget +`ProInitialAmount`+`ProAdjustmentAmount` decimal(18,2)? — cột PRO "Ban hành lần đầu"+"V0/hiệu chỉnh" mirror CCM Initial/Adjustment; AddColumn additive + `Sql()` data-migrate `ProInitial=ProEstimate` 4 rows prod gotcha #64; no new table). +S74: Mig 55 `AddCcmNoteToPeWorkItemBudget` (PeWorkItemBudget +CcmNote nvarchar(1000) — "Ghi chú từ CCM" mirror ProNote · additive-nullable, 0 backfill, no new table). +S73: Mig 54 `AddPeSuggestedAndApprovedPrice` (PE +5 cột giá đề xuất PRO Min/Max + CCM + giá chốt ApprovedPriceAmount/Source — additive-nullable, 0 backfill, prod-verified Run #313). +S69: Mig 53 `AddPeUrgentAndCeoApprovalThreshold` (PE +IsUrgentByPro/Ccm cờ gấp + ApprovalWorkflow +CeoApprovalThreshold ngưỡng CCM duyệt-final · 3 AddColumn no new table). Prev S65: Mig 51 `AddDepartmentParentId` (Department.ParentId loose-Guid no-FK — org-tree) + Mig 52 `AddHoSoLinkToPurchaseEvaluation` (PE HoSoLink nvarchar(1000) hyperlink NAS) — **cả 2 AddColumn-only, no new table** (tables giữ 88). Prev Mig 50 `ReplaceBudgetModuleWithPeWorkItemBudgets` (bảng `PeWorkItemBudgets` per-gói-thầu + DROP module Budget cũ + backfill BudgetManual→BudgetPeriod TRƯỚC DropColumn + DROP PE/Contracts.BudgetId; gotcha #63/#64). Prev Mig 49 PE WorkItemId (S57bis) |
| SQL tables | **88** | re-ground S62 (cicd `sys.tables` Run #286 — Mig 50 XÓA module Budget (drop nhiều bảng) + CREATE `PeWorkItemBudgets` → net 93→88) |
| Master data (prod) | **71 WorkItems PMH-only S59** | 62 Projects + **WorkItems = ĐÚNG 71 mã PMH** (S59: wipe 15 demo + rename format anh Kiệt `MAT-1..16`/`SUB-1..30`/`MEP-SUB-1..9`/`MEP-EQU-1..16`, Name "STT nhóm tên") + Suppliers 22 (3 real + demo; POST mở any-auth S59 quick-add). Transactional testing data wiped S59 (PE/HĐ/Notif = 0 baseline, phiếu thật từ A/001). Provenance `scripts/master-import-data.generated.md` |
| API endpoints | **~253** | +1 S54 `GET /it-tickets/assignable-staff` (capability endpoint); +3 S52 (attendances/report + report/excel + it-tickets/{id}/assign) |
| FE pages | **68** | unchanged S54 (ItTicketsPage reassign = in-place 2 app); +1 S52 AttendanceReportPage |
| Menu keys | **54** | +1 S69 `Off_Dashboard` (landing Văn phòng số). Prev re-ground S61 (`MenuKeys.cs` const — Mig 50 gỡ 4 `Bg_*` Budget menu cũ). Prev 57 (S58) |
| Tests | **354 PASS** | 45 Domain + 309 Infra · 0 fail / 0 skip · **S77 +10** (+7 `PeSuggestedPriceSetterAuthzTests` ghi chú PRO/CCM Mig 57 absolute-set/role-gate/null-clear/max-1000 · +3 `PeUrgentToggleAuthzTests` rewrite cờ-gấp **BẤT ĐỐI XỨNG** SET=function role / UNSET=function+DeptManager, plain-PRO-unset Forbidden) · **S76 +5** (`PeWorkItemBudgetTests` PRO split: set ProInitial+ProAdjust gồm âm · validator ProInitial≥0/ProAdjust-cho-âm · full=proFull khi CCM empty · full=CCM khi CCM present) · **S74 +5** (`PeWorkItemBudgetTests` §4b CcmNote: set CCM/Admin · null-clear absolute-set · non-priv Forbidden+no-mutate · all-3-persist) · **S73 +28** (PE opt-in finalize spec 6→11 + 10 giá-chốt `PeApprovedPriceFinalizeTests` + 13 setter-authz `PeSuggestedPriceSetterAuthzTests`) · **S69 +20** (Office-golive OfficeModulePermissionSeed 6 + PE PeCcmThresholdFinalize 5 + PeUrgentToggleAuthz 9) · **S67 +23 HRM test-after** (DepartmentTreeTests 8 cycle-guard/rollup + PeHoSoLinkTests 9 absolute-set + HrmProfilePermissionSeedTests 6 reflection-seed) → 286 · S61 +22 `PeWorkItemBudgetTests` −14 `BudgetPolicyTests` −1 → 263 · S60 +14 `PeSubmitGuardAndBypassTests` +2 spec → 256 (Domain 58→45 do drop Budget module tests) |
| Gotchas | **71** | +1 S78 **#71** (thêm enum value vào entity DÙNG-CHUNG → pollute UI/guard phân-loại theo PROXY-predicate `supplierId===null` thay vì enum tường minh; file-khi-duyệt purpose=5 lẫn "Bảng so sánh" + false-pass submit-guard → grep mọi field-proxy predicate loại value mới + build-verify TỪNG app; em-main grep no-leak bắt trước deploy). +1 S76 **#70** (FE absolute-set echo field anh-em từ server-snapshot + `invalidate()` fire-and-forget → cửa-sổ stale-echo mất-dữ-liệu khi lưu 2 ô liên-tiếp; guard `useIsFetching` gate nút Lưu tới khi refetch land; reviewer workflow bắt, impl self-review sót). +1 S72 **#69** FE bundle-hash non-deterministic + `deploy.yml` rebuild-FE-unconditional → bundle rotate kể cả commit governance (SPA-fallback-200 trap; cicd Run #312). +2 S69: **#67** Tailwind v4 accent palette thiếu stop (teal/violet/amberx/greenx chỉ 50/100/500/600/700; dùng -300 → teal/violet rơi DEFAULT Tailwind sai-hệ, amberx/greenx drop hẳn — build PASS, phải soi dist CSS) · **#68** IDE TS diagnostic giữa background-agent/workflow = snapshot dở-dang (TS server bắn mỗi save), chỉ tin build SẠCH sau-cùng (2× session này: re-skin + PE-FE đều false-alarm). Prev +1 S68 **#66** Tailwind v4 rule element thô `h1-h4{color:#0b1220}` viết NGOÀI `@layer` thắng utility `text-white` → heading render đen; fix ĐIỂM `text-white!` (important, grep dist confirm), KHÔNG move `@layer` (load-bearing ~30+ heading toàn app). Prev +1 S65 **#65** build csproj con (vd `SolutionErp.Api.csproj`) ≠ `dotnet build SolutionErp.slnx` (gồm tests) → miss test-compile khi đổi chữ ký record command (CreateDepartmentCommand +ParentId) → CI CS7036 FAIL-gated Run #291 (deploy chặn, prod nguyên — test-gate làm đúng việc). Fix: build full slnx trước push BE signature-change. Prev +2 S61: **#63** EF scaffold tự sinh `RenameColumn` SAI-semantics khi drop+add cùng type (test xanh không bắt — SQLite EnsureCreated không replay migration) · **#64** `dotnet ef database update` áp Design-DB 0-rows ≠ Dev-DB → data-migrate `Sql()` chạy thật lần đầu trên prod. Prev +2 S59 (#61 sqlcmd `-f 65001` · #62 rename natural-key UPDATE trước deploy) |
| User memory | **29** | +S75 `feedback_harness11_engine` (engine governance tự-bảo-trì + gotcha #30-via-Edit + multi-workflow-verify + git-add-specific lesson). re-ground S71 (H1 disk-count: 25 `feedback_*` + 3 `project_*`; STATUS "21" stale từ S64). +S71 `feedback_harness10_run_trace` (run-trace + 3 lesson). Prev +1 S64 `feedback_harness7_outward_writing_quality`; re-grounded S54 base 19 |
| Skills | 6 | 3 domain + 3 ops |
| Sub-agents | **11** | **all-inherit top-tier (Harness-8 S66 06-16 — thay thế two-tier H4):** em main Fable 5 (1M) Max (fallback Opus 4.8 1M, Fable suspended H5) · **cả 11 sub `model: inherit`** (7 demoted `claude-opus-4-8` flip S66; SE không có helper/gopher rẻ → cả 11 lên top-tier) · effort Max. 9 product/quality + 2 monitor INFORM-only. Nấc H8 = **executed-file VERIFIED-pending-restart**. Prev two-tier H4 runtime-verified S57bis (spawn-test 2 chiều). |
| RAG chunks | **2423** | re-check S63 (`list_projects` — alive, +3 vs S58). Stale `last_indexed 05-29` (S42-S62 via store_memory stopgap; full re-index = AI_INFRA op cần VOYAGE_API_KEY). |
**Bundle hash live (prod):** admin **`CsJetgZH`** · user **`BVS0ApIm`** (S78 — **Run #330** `7886fd0` PE attach-file khi duyệt; bundle ROTATE từ S77 `BqKD3Y23`/`Cn-i349D` dù NO migration enum-only — gotcha #69 non-determ rebuild; cicd ship-proof byte-stable + fake-hash control). **Prev S77** — admin **`BqKD3Y23`** · user **`Cn-i349D`** (S77 — **Run #329** `e823694` banner Trả-lại; cuối chuỗi 10 deploy #320→#329 cùng ngày, cicd PASS each: #320 pill `DsSg6RRz`-era → #321 focus → #322 revert → #323 Mig57+notes `CPm4LTqm`/`BWJUAqEI` → #324 số-âm-đỏ `C6fx-0ea`/`N3sW4Div` → #325 indent `BhnNMucS`/`B1VebpXc` → #326 cờ-gấp-asymmetric `DwXqn37C`/`COXMCv7E` → #327 decouple `B0gboSAg`/`DbDg7pM-` → #328 notify (BE-only, FE frozen) → #329 banner **`BqKD3Y23`**/**`Cn-i349D`**). **Prev S76** — admin **`jOqxW4-p`** · user **`DbsznVvR`** (S76 — **Run #319** `21d1f4e` bảng lưới `` ngân sách viền-ô; chuỗi S76 cùng ngày: #318 `e33481e` feature ma-trận-3-cột + badge quyền-NS `BhFDF9IJ`/`BAkuRl3C` → #319 **`jOqxW4-p`**/**`DbsznVvR`**, cicd PASS each, smoke 3×200, Mig 56 applied prod #318). **Prev S74** — admin **`BYF5vIMJ`** · user **`CB-tiRxd`** (S74 — **Run #315** `8655ebf` Mig 55 CcmNote, cicd PASS ~4m54s: Mig 55 applied prod CcmNote nvarchar(1000) nullable · sys.tables 88 · smoke 4×200 · 0 regression). **Prev S73** — admin **`Bv3jUCNo`** · user **`BWlMBQz6`** (Run #314 `6aa4dcb` FE empty-candidates guard fix; chuỗi 2 deploy: #313 `1d86abc` feature `OlNyG9OD`/`DSzSLVtL` → #314 **`Bv3jUCNo`**/**`BWlMBQz6`**, cicd PASS each). **Prev S72** — admin **`fc_xkNpJ`** · user **`DP-tBcg0`** (Run #312 governance commit `18fced6`; bundle ROTATE do **non-deterministic hash + deploy rebuild-FE-unconditional** (gotcha #69) — 0 FE source change, prod state/DB GIỮ NGUYÊN). **Prev S69** — admin **`BgNCjwsG`** · user **`CBvh0vtf`** (Run #308 PE cờ gấp + ngưỡng CCM; chuỗi 4 deploy session: #305 Văn phòng số foundation → #306 re-skin 10 page → #307 Office golive (BE-only) `Wt54PHYl`/`B99fMU6X` → #308 **`BgNCjwsG`**/**`CBvh0vtf`**). **Prev S68** — admin **`CNUv1jxY`** · user **`CpOskeS1`** (S68 — Run #304 `37752eb` fix tên đen→trắng; chuỗi #303 `6983609` `D532XZKG`/`CuFaBoWt` → #304 **`CNUv1jxY`**/**`CpOskeS1`**, cicd PASS each). **Prev S67** — admin `CcrZqfht`/user `DniDFUB_` (S67 — 6 deploy Run #297→#302; admin rotate chuỗi #298`xkSz9BfE`→#300`PxiZQkaw`→#301`I1fpLeYw`→#302**`CcrZqfht`** · user #297`BumgrwCJ`→#300`B36hGoKd`→#301`DrQYkzh0`→#302**`DniDFUB_`**; #299 tests BE-only cả 2 frozen, cicd PASS each). **Prev S65** — admin `BDwV5d0X`/user `DbVv6rsf` (Run #293-295). Prev S62 admin `0xKYGhhf`/user `C81ZdG9G` (Run #286). **Prev S59:** admin `B1DtNT9C` · user `D6uF3Mln` (Run **#282** `792c030` FINAL — bỏ nút Thêm hạng mục; ships kèm `80b64dd` gỡ Điều khoản TT, #281 cancelled-benign ancestor-verified). Chuỗi S59 cùng ngày: #280 `69997da` (`BKy_8OO9`/`XcZ6PRyA`, ships kèm `f21c55d` table-fixed #279-cancelled) · #278 `9c330d2` self-approve+quick-add-NCC (`BSh2fG2X`/`D22KfpPc`, authz probe 4/4) · #277 `faed59f` SearchableSelect (`ex7Tc92G`/`DzUeSk96`) · #276 `c869d26` rename 71 PMH (`BBA0KSWu`/`DzdTI18G`) · #275 `bbd1554` dọn demo WorkItems (FROZEN BE-only) · #274 `0eafcd3` tree 4 tầng (`DuU7OTym`/`DWyeTzf3`) · #273 `56882ac` wipe + tree v1 (`R9uGRxvw`/`DikfX1RD`). Prev S58: Run #386 `3ebaf84` admin `DMm9rtNA`/user `BUkOMn_Y` (chi tiết session log S58).
**Phase:** ✅ Phase 10 COMPLETE · ✅ **Phase 11 product backlog ĐÓNG TRỌN** · ✅ **Văn phòng số (E-Office) golive S69** (foundation PURO + re-skin 10 page + public read+create 16-key allow-list mọi role) prod-verified · ✅ **PE cờ gấp PRO/CCM + CCM duyệt-final theo ngưỡng (Mig 53 S69)** prod-verified · ✅ **PE ngân sách MA TRẬN 3 cột Dự án/PRO/CCM (bảng lưới ``) + badge quyền-NS theo role trong Workflow Designer & flow Duyệt NCC (Mig 56 S76)** prod-verified · ✅ **PE UX batch S77 (10 deploy)** — cờ GẤP pill mọi danh sách+inbox · focus/inline+overlay decouple+"Xem mở rộng" · ô ghi chú giá đề xuất PRO/CCM (Mig 57) · số phân cách + số-âm-đỏ-ngoặc + indent mục con · cờ gấp GẮN=NV/GỠ=Trưởng phòng · chuông báo người duyệt · banner Trả-lại — prod-verified · ✅ **PE đính kèm file khi DUYỆT (S78, Run #330)** — người duyệt tải file lên lúc duyệt thay vì Trả lại; migration-free reuse-enum `ApprovalAttachment=5` — prod-verified · 🚫 Phase 9 Ops blocked (anh main coordinate — anh dừng).
> ⚠️ **Count drift fixed S40:** endpoints ~223→**211**, FE pages 53→**65**, menu keys 85→**~53**. Tables **84 confirmed correct** (DbSet 77 + Identity 7). 3 số "khó fake" (mig/gotcha/git) luôn đúng. Cause: số "incremented mỗi session" over/under-count optimistic — re-ground định kỳ.
---
## 🔥 In Progress (S78)
| Task | Owner | Status |
|---|---|---|
| **S78 — PE: đính kèm file khi DUYỆT (UAT Tra Sol / 5 tester)** — người duyệt tải file của mình lên ngay lúc Duyệt thay vì Trả lại phiếu. Reuse hệ attachment + enum `ApprovalAttachment=5` **MIGRATION-FREE** · FE 2 app SHA-identical (`PeWorkflowPanel` picker multi-file + upload-trước-chuyển-phase + mục "📎 File đính kèm khi duyệt" + 2 filter fix #71) · commit `7886fd0` → **Run #330 PASS** (test 354, bundle `CsJetgZH`/`BVS0ApIm`, no migration, smoke 4×200). 3 lỗi tự bắt (authz · filter-pollution #71 · Dialog mirror-truncate). em-main-led + self-gate (grep no-leak) + cicd-monitor. → log `2026-06-19-S78-pe-attach-file-on-approve.md`. | 👤 + 🟩cicd | ✅ |
| **S77 — PE UX batch: 10 deploy prod-verified #320→#329 (anh Kiệt FDC + Tra Sol + Bích Phượng UAT realtime, HMW-mode ON)** — (1) cờ GẤP **pill** 🔴PRO/🟢CCM mọi danh sách+inbox (#320 NEW `PeUrgentChips`) · (2) **focus mode** bấm phiếu→overlay (#321) → **revert** list layout gốc bám-trái (#322) · (3) **Mig 57** ô ghi chú giá đề xuất PRO/CCM + **số phân cách VND** + chính tả "Bảng so sánh giá" + **guard #70** (#323) · (4) số âm → **đỏ+ngoặc** hàng 7/8/9 (#324) · (5) mục con **thụt+gạch đầu dòng** (#325) · (6) cờ gấp **BẤT ĐỐI XỨNG** GẮN=NV / GỠ=Trưởng phòng (DeptManager) (#326) · (7) **tách chọn-phiếu (inline) khỏi mở-rộng (overlay)** + nút "Xem mở rộng" mỗi dòng `?expand=1` (#327) · (8) **chuông báo người duyệt** khi phiếu vào cấp họ (#328 `LogTransitionAsync`) · (9) **banner phiếu Trả lại** hướng dẫn gửi lại (#329). Mig 56→**57** · test 344→**354** (+10). Bundle cuối `BqKD3Y23`/`Cn-i349D`. **3 lỗi em tự bắt review-TRƯỚC-deploy** (guard#70 stale-echo · luật asymmetric Tra Sol clarify giữa-chừng · double-mount Task H). FD process-death Task H → recover-disk. **NEXT (em):** 🔴 curate L1 reviewer **45KB** + cicd 37.6KB + inv 35.6KB keep-floor-hit manual-condense (archive-gate A7 GATE PASS 186/186) + FD/test-spec WATCH. **NEXT (anh/anh Kiệt UAT):** cờ gấp (GỠ chỉ TP) · chuông báo người duyệt · banner Trả-lại · Xem mở rộng · ô ghi chú PRO/CCM. → log `2026-06-19-S77-pe-ux-batch-10-deploy.md`. | 👤 + 🩷FD×3 + 🟧impl-FE + 🟨impl-BE×2 + 🟪test×3 + 🟩cicd×10 | ✅ |
| **S76 — PE ngân sách MA TRẬN 3 cột (Dự án\|PRO\|CCM) + bảng lưới `` + badge quyền-NS theo role (anh Kiệt FDC + chị Trà Sol, go-live)** — anh giao `/ultra-on` step-by-step + workflow-review-per-step. **3 commit prod-verified:** `e33481e` (feature Run #318 `BhFDF9IJ`/`BAkuRl3C`) → `21d1f4e` (bảng lưới Run #319 **`jOqxW4-p`**/**`DbsznVvR`**). **Part 1** form ma trận: PRO/CCM sửa cột mình (canEditPro/canEditCcm), Dự án FE-only; Mig 56 +ProInitial/ProAdjust additive + data-migrate 4 rows prod. **Part 2+3** badge "✎ NS PRO/CCM" cạnh approver (suy role, display-only) ở Workflow Designer + flow Duyệt NCC. Bảng lưới `` viền-ô (anh phản hồi "chưa chia cột giống Excel"). Test 339→**344**. 2 workflow review bắt **race mất-dữ-liệu** → vá `useIsFetching` (gotcha #70). **NEXT:** 🔴 curate L1 (reviewer **45KB** keep-floor manual-condense + inv 35KB + cicd 29KB + test-spec 28KB) · anh/anh Kiệt UAT bằng PRO/CCM. → log `2026-06-19-S76-pe-budget-matrix-table-grid.md`. | 👤 + 🟦inv + 🟪test + 🟧impl-FE + 🟥reviewer×2wf + 🟩cicd×2 | ✅ |
| **S74 — PE ô "Ghi chú từ CCM" ngân sách gói thầu (Mig 55)** — anh forward chat Trà Sol + Kiệt FDC → CCM giống PRO (nhập số + ghi chú), "0 hết" = role CostControl thiếu (không bug). em-main BE+Mig55 (entity/config/command/DTO/controller/mapping) ∥ implementer-frontend FE 2 app SHA-mirror ∥ test-specialist (chết rate-limit→recover-disk). 2 fork anh chốt: +CcmNote (Mig 55) + GIỮ phân vai CCM. Test 334→**339**. commit `8655ebf` (cicd **Run #315 PASS** — bundle `BYF5vIMJ`/`CB-tiRxd`, Mig 55 applied). → log `2026-06-18-S74-pe-ccm-note.md`. **NEXT:** anh UAT bằng CCM/Admin; curate reviewer 38.8KB + inv-codebase 31.5KB. | 👤 + 🟧 impl-FE + 🟪 test-spec(recover) + 🟩 cicd | ✅ |
| **S72 — Harness-10 flat-refine + checklist-v2 adopt (re-audit 3-workflow) + sleep NO-OP** — audit `wf_13868efb-ea7` → implement `wf_ac43b5ff-7d1` → review `wf_d482e10d-5dd` (Harness-9 B1+B2). SE BEHIND flat → migrate SUBFOLDER→FLAT (hmw.js + 5 doc; 5 run cũ giữ subfolder C8) + 2 broadcast 06-18 + sleep-cmd port (A8) + detector tailored-out + hmw.js H4.5→H8. **REVIEW bắt 2 lỗi IMPLEMENT-self-assess sót** (schema-stale + auto-wire overclaim) → fixed (auto-check WIRED). 1 reviewer residual-write self-caught+revert (reverse-finding #4). B3 self-correct path/count. Sleep `all`=NO-OP. **0 prod code.** adap-report + email (`5f511fe5`). **NEXT (anh):** restart CLI (FLAT-runtime + wired sleep-check + sleep-recovery skill). **NEXT (em):** 🔴 curate investigator-codebase L1 **28973 OVER** + cicd-monitor **30123 OVER** (Run #312) + watch FD/test-spec. → session log `2026-06-18-S72-harness-10-flat-refine.md`. | 👤 + 9 sub | ✅ |
| **S71 — Harness-10 adopt: tracked run-trace folder + checklist 9-10** — em main + 3 Workflow (invest `wf_9c2cd2cd-2e7` / implement `wf_e4e46725-231` / review `wf_636bc95b-939`) per mandate Harness-9 PART 2. **0 production code**. Migrate `wave-*/` gitignored → `runs//` git-TRACKED (run.md+sub-md/+harvest/) + `_ledger.md` 2-nhịp + 3-layer (L1 em-main@P1 / L2 session-start / L3 session-end idempotent) + containment shift (B6→tracked-run-folder). hmw.js wave→run-trace (`node --check` OK). **Review (R2+R3) bắt C5 L1 over-claim → fixed** (em-main convention, engine no-fs). checklist 9-10: Part A/B done S70, Part C 8/8 MỚI. dogfood 3 run-folder TRACKED + ledger. adap-report + email ai_infra. **State GIỮ NGUYÊN: Mig 53·88 bảng·306 test·68 gotcha·menu 54.** **NEXT (anh):** restart CLI (hmw.js RUN-TRACE + carry §2.1.2/Cat-6/H8). **NEXT (em):** ✅ curate-debt CLOSED (finalize+curate workflow — reviewer/inv Dự án>Hạng mục · 71 mã PMH chuẩn (wipe 15 demo + rename format anh Kiệt) · UAT 6 vòng 11 điểm (SearchableSelect gõ-lọc bỏ dấu + auto địa điểm + ẩn nút self-approve + quick-add NCC + multi-file + bảng NCC table-fixed + bỏ ô Tên ngân sách + GỠ field Điều khoản TT mọi form + bỏ nút Thêm hạng mục). Bundle FINAL `B1DtNT9C`/`D6uF3Mln`. **🔴 Ops còn — của anh (giữ từ S58):** (1) `tzutil /g` VPS → confirm `SE Asia Standard Time` · (2) xác nhận anh Chương email nào → dọn `chuong.phan@solution.com.vn` typo · (3) báo 5 real staff password mặc định `User@1234567` + yêu cầu đổi · (4) khi gán người thật vào CNTT → thêm nv.cao/nv.truong vào lock list. **NEXT (anh pick):** test-after guard (🟪 test-specialist: `LockDemoSampleUsersAsync` S58 + suppliers asymmetric authz POST-open/PUT-DELETE-locked S59) · PE panels polish sâu (PeDetailTabs 111KB session riêng) · FE PermissionGuard per-route khi golive HRM/Office (flip revoke) · Phase 9 Ops (SMTP/backup/creds/UAT) · monthly audit 2026-07-01 (**STATUS/HANDOFF re-tier — defer ×2, ƯU TIÊN** · curate L1 cicd-monitor **~56KB** (S59 +9 cicd-spawn, H2-đo 54KB + 2 entry cuối) + investigator-codebase 32.9KB · schema-diagram §16+ Mig 32-49 ERD debt). → session log `2026-06-11-S59-wipe-tree-pmh-uat-batch.md`)_ | 👤 | ✅ |
**S40 done:** ✅ Consolidation (`d2f52ba`) · ✅ Curate 4 agent MEMORY >25KB→<8.4KB (`78c9de3`) · ✅ RAG catch-up chunk S37-S40 (rerank 0.867) · ✅ **AI_INFRA bulletin 2026-05-29 adopt 4/4** (MỤC2 Tiered Memory Policy v1 `6f08d1f` + MỤC3 /session-start+/session-end slash commands `c8ff5e1`). ⏳ Full RAG re-index = AI_INFRA op (cần VOYAGE_API_KEY).
> ⚙️ **NEW slash command** (`.claude/commands/`) — anh main **restart CLI** để activate (không hot-reload) → session sau gõ `/session-start` + `/session-end` thay paste prompt thủ công.
---
## ✅ Recently Done (newest on top — 3 session; cũ hơn → session logs)
### S75 (2026-06-18) — ✅ Harness-11 adopt: engine bộ-nhớ-và-governance TỰ-BẢO-TRÌ (em main + 5 Workflow, 0 production code)
- **Anh:** `/check-email AI_INFRA và /adap-apply` (mỗi stage workflow-review + report trung-thực) → "double check lại 1 turn + checklist 1 turn → hoàn thiện report → push → session-end".
- **STAGE 1 check-email:** H11 directed `harness-11-available` verify PASS (whole-file `318ff9f6` + body `b2a2fc1c`) → processed `inbox/ai_infra/`.
- **5 Workflow (run-id = evidence Harness-9 PART-2):** AUDIT `wf_7fdc3bd5-930` (4× inv-codebase → GAP: C 3-detector + B1/B3 + D5-D8 chưa codify) → IMPLEMENT `wf_c5e5844e-7c1` (2× gen-purpose script ∥ + em-main MD cluster) → REVIEW `wf_d7ca1ff8-942` (3× reviewer PASS + 2 refine C2/C1 59→27) → DOUBLE-CHECK `wf_a0b68d2f-30e` (3× reviewer; over-suppress regression CLEAN — DA1 no-return→em-main self-gate fake-drift "99 migration" CAUGHT, DA2/DA3 độc-lập confirm) → CHECKLIST-VERIFY `wf_39cd4cbe-f07` (3× inv-codebase; completeness-gate FORMAL ĐẠT).
- **Built (0 prod code):** `governance-detectors.ps1` (C1 broken-pointer + C2/B3 staleness + C3 vocab-fork + C4 self-exclusion 0-self-match + C5 resolve, NO-API DÒ+FLAG-only, runtime 26 flag bắt drift thật + gotcha #30 mojibake fix) + `memory-archive-gate.ps1` (A1 byte-gate + A4 hysteresis 0.85 + A5 keep-floor 5 + A6 2-strike + A7 NO-API L1-eval 186/186 pointer-resolve) + `harness-11-engine.md` canonical (artifact-map + PHẦN A/B/C/D + 3-tier D5/D6/D7 EXPLICIT + one-direction-lock D8 + CAVEAT honest) + B1 ×11 count→pointer (root CLAUDE.md/ef-core+dep-audit SKILL/skills-README/docs-CLAUDE.md; drift mig53→55/test306→339/gotcha68→69/table93→88 RESOLVED) + cadence session-start §2.1.3 (D1 DÒ+BÁO) + session-end §L.b(c) (D2 archive-gate) + agents/README Upgrade S75.
- **completeness-gate FORMAL ĐẠT** (checklist-verify): B 4/4 + C 5/5 + D 11/11 đủ-trọn (function-floor MET), A 🟡 tailored (A6 runtime cần 2×-Apply = legit-by-design, self-doc). D5/D6/D7 explicit-label + D8 one-direction codify = YES (2 chỗ H11 chuẩn-hoá-mới).
- **gotcha #30 reinforced:** box-glyph (├└─) KHÔNG đưa vào .ps1 — PS5.1 `-File` ANSI-decode mojibake, KỂ CẢ qua Edit tool (render-normalize \u-escape→literal); detector giữ pure-ASCII (Python scan 0 non-ASCII). Tree-line FP-skip attempted→reverted; "6 test" giữ documented soft-net FP.
- 3 commit pushed (`e70c046` adopt + `ae957c4` double-check/finalize + `aa09e99` cleanup 2 scratch DA1-reviewer). adap-report `docs/governance/adap-reports/2026-06-18-Governance-harness-11.md` + email ai_infra (body `2316773229f2`).
- **Lesson:** review→fix loop có giá-trị thật (REVIEW bắt 2 cái IMPLEMENT tự-chấm sót: C2 FP 89% + "71 flag" hardcoded) · raw-Workflow schema-force flaky (3 lane fail no-SO across 5 wf) → em-main self-gate recovery · `git add -A` quét stray scratch (Bash-residual read-only sub) → git-add file cụ-thể.
- **State THẬT GIỮ NGUYÊN:** Mig 55 · 88 bảng · 339 test · gotcha 69 · menu 54 · bundle `BYF5vIMJ`/`CB-tiRxd`.
### S74 (2026-06-18) — ✅ PE ô "Ghi chú từ CCM" ngân sách gói thầu (Mig 55) — anh + 2 sub + cicd, prod-deploy
- **Anh:** forward 2 luồng Zalo (Trà Sol + Kiệt FDC) về panel TỔNG HỢP NGÂN SÁCH TRÌNH KÝ "CCM cũng giống PRO cho nhập + ghi chú, hiện 0 hết" → AskUserQuestion 2 fork → `/session-end`.
- **Chẩn đoán:** ô nhập PRO/CCM gate `bs.canEditPro/canEditCcm` (thuần role, KHÔNG phase). "0 hết CCM" = tài khoản thiếu role CostControl (KHÔNG bug). Bất đối xứng thật: `ProNote` có, `CcmNote` chưa.
- **2 fork anh chốt:** (1) thêm "Ghi chú từ CCM" — Mig 55 cột CcmNote ✅ · (2) GIỮ phân vai CCM (CostControl/Admin) ✅.
- **Done commit `8655ebf` (14 file):** BE entity+config+**Mig 55 `AddCcmNoteToPeWorkItemBudget`** (additive-nullable sạch) + command/validator/handler + DTO/controller/mapping (em-main) · FE 2 app SHA-mirror dòng "Ghi chú từ CCM" gate canEditCcm absolute-set 3 field (implementer-frontend) · test +5 §4b (test-specialist chết rate-limit → em-main recover-disk + self-gate `dotnet test` **339 PASS**).
- **Lessons:** controller call-site thiếu arg sau +param record (grep mọi `new` + vá, full slnx build bắt #65) · test-specialist died-529 work-landed-disk → recover KHÔNG re-spawn (`feedback_agent_kill_recovery`) · PS here-string commit-msg trong if-block mis-parse → `git commit -F ` · hybrid em-main-BE + delegate-FE-mirror đúng cho migration+tight-coupling (`feedback_workflow_fanout_reliability`).
- **State:** Mig 55 · 88 tables · 339 test · 69 gotcha · menu 54 · bundle admin `BYF5vIMJ`/user `CB-tiRxd` (**Run #315 PASS** ~4m54s — Mig 55 applied prod CcmNote, sys.tables 88, smoke 4×200, 0 regression).
### S72 (2026-06-18) — ✅ Harness-10 flat-refine + checklist-v2 adopt (re-audit 3-workflow) + sleep NO-OP (em main + 9 sub, 0 production code)
- **Anh:** `/session-start` → "trí nhớ có thay đổi lớn" → `/sleep-recovery-memory-l2` báo Unknown (chưa có) → "double check hết Harness-8/9/10/10-refine + checklist + hmw, điều chỉnh, report trung thực" → `/sleep-recovery-memory-l2 all` + `/session-end`.
- **3-stage Workflow (mandate Harness-9 B1+B2):** INVESTIGATE `wf_13868efb-ea7` (4× investigator-codebase; 1 fail-no-SO + 2 truncated → em-main self-gate ground-truth) → IMPLEMENT `wf_ac43b5ff-7d1` (2× general-purpose file-disjoint + em-main cluster) → REVIEW `wf_d482e10d-5dd` (3× reviewer adversarial).
- **Gap (đo vs canonical):** SE BEHIND Harness-10 flat — run-trace còn SUBFOLDER (`sub-md/`+`harvest/`), canonical=FLAT. Fixed: `hmw.js` (`:103` sub-md/→`sub--.md` + `:52` schema-desc + **H4.5→H8 doc-drift**) · `workflows/README` full-rewrite + roster 8→9 · `runs/README` flat + detector-tailored-out · session-start/end flat + dual-accept · `agents/README` Upgrade S72 · `_ledger` C8 note. **5 run cũ S71 GIỮ subfolder** (C8, no-history-rewrite). +2 broadcast 06-18 adopt. +`/sleep-recovery-memory-l2` port (A8, 137 dòng, §J2-tailored SE-only, floor intact, 6 SE-env deviation, live skill). **detector refine-b TAILORED-OUT** (anh chốt — SE Workflow-tool no-CLI-launcher-bypass; containment git-diff+tracked+orphan-scan G-015).
- **REVIEW (B2 dogfood) bắt 2 lỗi IMPLEMENT-self-assess BỎ SÓT:** (1) `hmw.js:52` schema `subMdPath` desc stale `sub-md/`; (2) sleep-cmd auto-check ≥7d **UN-WIRED overclaim** → em fix: schema flat + **WIRE auto-check thật** (budget.json `+last_sleep_at` + `session-start:78` + `session-end:48`, grep-verified present). +3 minor fixed (provenance cite · charter anchor · README:31 dogfood). R3 PASS (containment clean, honesty strong).
- **em-main containment-check tự bắt residual-write:** 1 reviewer agent (REVIEW qua RAW Workflow tool — KHÔNG inject `hmw.js` writeGuard) tự ghi `agent-memory/reviewer/MEMORY.md` (+2850B over-cap) → revert (record ở run-trace; B3 single-writer restored) → **reverse-finding #4** (raw-Workflow ≠ wrapper-governance). investigator-codebase MEMORY (M từ session-start = S71 audit-trail) commit-as-is, over-cap → curate next.
- **B3 self-correct (trung thực):** S71 report cite path tắt `runs/` + count "14" → thật `.claude/workflows/runs` = **22** (đính chính trong adap-report mới).
- **Sleep `/sleep-recovery-memory-l2 all` = NO-OP (dogfood live):** 5/9 sub empty-archive (guard-rỗng) + 4/9 mọi period đã có gist (skip-if-gist + double-distill gen≥1) → 0 compressed; `last_sleep_at` null→2026-06-18. Command port giờ **executed-file + runtime** (guards fired đúng).
- **State THẬT (prod functionality/DB) GIỮ NGUYÊN:** Mig 53 · 88 bảng · 306 test · **69 gotcha** (+#69) · menu 54. **0 production code.** ⚠️ **bundle ROTATE** `BgNCjwsG`/`CBvh0vtf` → **`fc_xkNpJ`/`DP-tBcg0`** (cicd Run #312 PASS no-op — non-determ hash + deploy rebuild-FE-uncond = **gotcha #69**; 0 FE change → cosmetic; "frozen" claim đã SAI, đính chính). 3 run-trace folder FLAT git-tracked. adap-report `2026-06-18-Governance-harness-10-flat-refine-checklist-v2` + email ai_infra (`5f511fe5c0f2`, 4 reverse-findings). ⚠️ **restart CLI** activate FLAT-runtime hmw.js + wired sleep-check + sleep-recovery skill. 🔴 NEXT curate investigator-codebase L1 **28973 OVER**. → session log `2026-06-18-S72-harness-10-flat-refine.md`.
### S71 (2026-06-18) — ✅ Harness-10 adopt: tracked run-trace folder convention + checklist 9-10 self-verify (em main + 3 Workflow, 0 production code)
- **`/check-email AI_INFRA`** = 0 thư mới se-directed (UI/UX guide processed S58). Broadcast `2026-06-18-Governance-checklist-harness-9-10` ở `outbox/all` (content_sha256 `ec32951a` MATCH, đọc UTF-8 tường minh #61). **KHÔNG có base Harness-10 file riêng** — spec = Part C checklist (flag trong adap-report).
- **3-stage Workflow** (mandate Harness-9 PART 2; anh chốt full-adopt + dogfood qua HMW đủ invest/imple/review, tránh sai sót): INVEST `wf_9c2cd2cd-2e7` (4× investigator-codebase — A stub-fail structured-return nhưng ghi diary thật + B/C/D strong → self-gate bù) → IMPLEMENT `wf_e4e46725-231` (3× general-purpose file-disjoint + em-main cluster) → REVIEW `wf_636bc95b-939` (3× reviewer adversarial).
- **Migrate wave→run-trace:** `.gitignore` (runs/ tracked via negation `:83`, wave-*/ giữ legacy, exit-code-trap note) · `hmw.js` (accept `args.run` + alias `wave`, path `sub-md/`, wording containment, 9 ref wave→RUN-TRACE, `node --check` PARSE-OK) · `workflows/README.md` full-rewrite · NEW `runs/README.md` (C1-C7 + caveat trung-thực) · `session-start.md:71` (L2 orphan-scan) · `session-end.md:51` (L3 close-gate idempotent) · `agents/README.md`/`harvest-curator.md`/`tooling-auditor.md` repoint.
- **Review caught (R2+R3 độc-lập = high-conf):** C5 **L1 over-claim** — `runs/README.md` nói hmw.js prompt-builder emit L1 reminder, grep engine=0 → engine no-fs KHÔNG đọc được ledger → **fixed path-a**: L1 = em-main @P1 ledger-check convention. Floor C1-C8: 7/8 PASS + C5-fixed (C7 caveat reviewer khen "điểm sáng nhất"; C3 honest "tracked-eligible → committed sau commit", KHÔNG over-claim). **Dogfood thành công mandate B2** (review-workflow RIÊNG bắt lỗi mà 1-workflow-tự-chấm bỏ sót — IMPLEMENT synthesis không nhắc L1).
- **Containment audit CLEAN:** git status = đúng tập (8 Harness-10 file + runs/ untracked + investigator MEMORY race + CLAUDE.md test-flush), 0 stray, **frozen-evidence 0-byte-loss** (broadcasts/adap-harness-2/error-ledger/sessions/STATUS/HANDOFF/archives untouched — R1 per-path verify). **State THẬT GIỮ NGUYÊN: Mig 53 · 88 bảng · 306 test · 68 gotcha · menu 54 · bundle `BgNCjwsG`/`CBvh0vtf`.** adap-report `2026-06-18-Governance-checklist-harness-9-10` + email ai_infra (4 reverse-findings: L1-engine-no-fs · custom-workflow-thiếu-delta-guard-race · check-ignore-exit-trap · C3-2-level-value). → session log `2026-06-18-S71-harness-10-run-trace.md` (pending).
### S70 (2026-06-17→18) — ✅ Harness-9 adopt: L2 archive dark-matter recovery + adap 2-workflow mandate (em main + 3 Workflow + 2 monitor, 0 production code, commit `f36aab8` pushed)
- **Bootstrap (`/session-start`):** 2 monitor RE-REPORT — 🟫 H1 (3 skill cite stale + curate-debt 4 agent over-cap) + ⬜ H2 (CLEAN, 0-orphan, 5-trục PASS). RAG 2426 chunks alive (stale-index 05-29). test **306 baseline verified**. `/check-email AI_INFRA` = 0 thư mới directed (outbox/se chỉ UI/UX guide processed S58). Harness-9 ở `outbox/all` (kênh adap-apply).
- **`/adap-apply Harness-9`** (anh chốt "đầy-đủ-nhất", 3-stage Workflow): PART 1 L2-recovery (proposal, fit cao — SE có dark-matter thật) + PART 2/3 process-mandate (🔴 function-floor).
- **Stage A INVESTIGATE** (`wf_be952f3c-97f`, 4× investigator-codebase): recon 4 archive → build-plan + **quyết định pointer = substring sha-keyed** (KHÔNG anchor-slug: slug-collision same-date + diacritic-fragile + cicd `2026-06.md` ZERO heading; KHÔNG line-hint).
- **Stage B IMPLEMENT** (`wf_a58e0d15-beb`, 4× general-purpose file-disjoint): curate L1→L2 byte-exact + `_INDEX.md` + `.gist.md`. cicd 65→**23.2KB**(10 moved) · inv-codebase 47→**24.1KB**(15, tạo `2026-05-q4.md` fresh) · reviewer 43.5→**24.8KB**(9) · impl-backend 33→**17.4KB**(14). Cả 4 <25KB auto-inject cap.
- **Stage C AUDIT** (`wf_9520d8cd-4fe`, 4× reviewer): độc-lập verify. reviewer PASS · impl-backend CONCERN (read-side-gap→fixed) · 2 (cicd+inv-codebase) **no-StructuredOutput** → em-main self-gate git/sha (recovery-path `feedback_agent_kill_recovery`) → **4/4 0-byte-loss PASS** (git numstat `+N -0` additive + sha + content-identity CR-normalize).
- **Em-main infra + codify:** `memory-budget.json` (seed-by-measure) + `scripts/measure-agent-memory.ps1` + `.ragignore` + PART 2/3 codify (adap-apply mandate + agents/README Upgrade S70 + session-start §2.1.2). **Read-side gap fix:** 3/4 MEMORY.md L5 header → trỏ `_INDEX.md` (Stage C độc-lập bắt — giá trị của review-workflow riêng, PART 2 dogfood đúng).
- **§L:** doc-drift 4-cite flush (dep-audit:153 65→68 · skills/README:20 52→53 + :90 65→68 · session-start:44 58→68) · 4 curate-log refresh S70 · H2 GATE **CONDITIONAL PASS** (Corruption/Placement/Fidelity 🟢 md5-proven 0-loss; Coverage/Completeness 🟡 spawn-record-fill + 3 `S?`-label cosmetic). **State THẬT GIỮ NGUYÊN: Mig 53 · 88 bảng · 306 test · 68 gotcha · menu 54 · bundle `BgNCjwsG`/`CBvh0vtf`.** adap-report + email-back ai_infra (body-hash `7c07b716e775`) — 3 đề-xuất ngược (substring-pointer-for-real-archives · measure-then-seed reference · self-gate-fallback hợp-lệ). → session log `2026-06-17-S70-harness-9-l2-recovery.md`.
### S69 (2026-06-17) — ✅ Văn phòng số (E-Office) port + golive + PE cờ gấp/ngưỡng CCM — 4 deploy prod-verified Run #305→#308 (HMW-mode ON, 2 workflow fan-out)
- **#305 `a8bbdae` Văn phòng số foundation** (workflow `office-puro-foundation` 5-agent): sync fe-admin/index.css ← fe-user (đóng drift S66-S68 + gotcha #66 fix) + 3 shared component PageHeader/KpiCard/WidgetCard (×2 SHA256, tái dùng token Hồ sơ NS) + OfficeDashboardPage 2-cột widget kiểu PURO HomePage (reuse data hooks, no BE) + menu key Off_Dashboard (no-mig idempotent seed, giữ ẩn). em main fix KpiCard activeBorder -300→-500 (**gotcha #67** — Tailwind accent palette thiếu stop).
- **#306 `c556f6c` re-skin TRỌN 10 page** (workflow `office-puro-reskin-all` 7 designer song song write-only + reviewer): Đề xuất(List/Create/Detail)/Đơn từ/Ticket/Danh bạ/Phòng họp/Báo cáo CC → PURO layout + CSS Hồ sơ NS, **phẫu thuật giữ 100% logic** (reviewer verify mọi api.*/queryKey byte-identical HEAD vs working). em main build-tập-trung + mirror SHA256 ×2 + recover stale-diagnostic (**gotcha #68**). 9 page fe-user↔fe-admin SHA256-identical.
- **#307 `1f8947e` Office golive public** (+6 test): `SeedAllRolesOfficeModulePermissionsAsync` grant read+create **16-key allow-list mọi role** (mirror S65 HRM pattern, chạy SAU revoke để thắng). Excluded (giữ ẩn): Off_PhongHop_Manage (admin CRUD) + Off_AttendanceReport (riêng tư) + Off_ChamCong (Cá nhân). reviewer PASS security (cascade-safe: Off KHÔNG phải inherit-root → excluded-3 giữ false; no write-path: controller [Authorize(Roles=Admin)] độc lập menu-key). cicd DB-verify **16/16 × 13 role**, excluded-3 = 0, HRM/Personal vẫn ẩn, admin không hạ.
- **#308 `ebd7e1c` PE cờ gấp + CCM duyệt-final theo ngưỡng** (Mig 53, anh Kiệt FDC sau họp sếp, +14 test): ApprovalWorkflow +`CeoApprovalThreshold` (admin nhập Designer, null=luồng cũ rollout-an-toàn); `ApproveV2Async`: actor role CostControl + winnerQuoteTotal (tổng giá NCC chọn) < ngưỡng → DaDuyet bỏ CEO (Q4 theo role). PE +IsUrgentByPro(đỏ)/IsUrgentByCcm(xanh); endpoint PUT /urgent role-gated (PRO/CCM/Admin) + notify CEO (Director) khi bật, visibility-only (Q3 không đổi luồng). FE ×2: Designer ô ngưỡng + PE detail cờ gấp toggle/badge + hint giá-trị-vs-ngưỡng + list badge. Test PeCcmThresholdFinalize 5 (load-bearing: CCM dưới ngưỡng → DaDuyet skip CEO) + PeUrgentToggleAuthz 9. reviewer PASS security. **C (sau duyệt → chuyển phiếu đến dự án) chờ anh Kiệt spec form.**
- **§L:** 2 gotcha NEW (#67 Tailwind palette-thiếu-stop · #68 stale-diagnostic-background-agent). 2 truncation #53 (impl-backend positional-record DTO mid-fix + impl-frontend) → em main recover-disk + tự viết endpoint cờ gấp (agent chưa kịp) + tự fix 2 CS7036. H2 GATE PASS (1 non-block: PE-CCM-threshold test-covered not standalone-reviewed). **State: Mig 53 · 88 bảng · 306 test · 68 gotcha · menu 54 · bundle `BgNCjwsG`/`CBvh0vtf`.** ⚠️ curate-debt P1: cicd-monitor **65.2KB** (worst, trend 41→54→56→61→62→65) + inv-codebase 47 + reviewer 43.5 + impl-be 33. → session log `2026-06-17-S69-vanphong-golive-pe-urgent-threshold.md`.
### S68 (2026-06-16) — ✅ Hồ sơ NS header chi tiết NV: làm nổi bật + fix tên render đen→trắng — em main solo, 2 deploy prod-verified Run #303-304 (anh UAT realtime, HMW-mode ON)
- **Bootstrap (`/session-start`):** 2 monitor RE-REPORT CLEAN — 🟫 H1 roster 11/11 `model: inherit` confirmed trên disk (Harness-8 runtime-landed, hết "pending-restart"), ef-core skill FRESH (Mig 52), plugin 18/15/3; flag 1 stale `dep-audit SKILL:153` (64→65) + **drift-correction: curate-debt = 4 agent over-cap, không phải 2** (S67 sót reviewer 35.4 + impl-backend 30.7). ⬜ H2 0-orphan · 0-corruption · 5-trục PASS (S67 harvest landed trọn). → em main patch 2 doc-drift `11bc96d` (dep-audit 64→65 + root CLAUDE test 263→286).
- **#303 `6983609` header polish ×2 app SHA256:** tên NV `text-lg→text-xl font-extrabold`+`drop-shadow-sm` · dòng meta `text-xs text-white/85 → text-[13px] font-medium text-white` (to+đục+dày nét, mã NV `font-semibold`) · badge trạng thái từ pill trắng-mờ chìm → **pill đặc màu theo status** (`EmployeeStatusColor` emerald/amber/slate + chấm `bg-current` + shadow). Build×2 PASS, bundle `D532XZKG`/`CuFaBoWt`, cicd Run #303 PASS.
- **#304 `37752eb` fix tên ĐEN→TRẮNG (gotcha #66 NEW):** anh UAT báo "tên màu đen nền xanh ko nổi bật" — screenshot: `