diff --git a/.claude/agent-memory/cicd-monitor/MEMORY.md b/.claude/agent-memory/cicd-monitor/MEMORY.md index c5830c3..04d31a8 100644 --- a/.claude/agent-memory/cicd-monitor/MEMORY.md +++ b/.claude/agent-memory/cicd-monitor/MEMORY.md @@ -70,7 +70,8 @@ BE (test+build) ~90s · FE × 2 ~60s/app · deploy ~30s · **total ~3min code / ## 📅 Recent runs (compressed — full verbatim → `archive/2026-06.md` via `archive/_INDEX.md`) -- **🟢 S96 #480 (id=480, run_number 366) `0c2f9f6` GO ~5m25s (PASS) — cross-stack PE 3-commit range (`ba4b8e0`→HEAD): (a) `e657faa` opt-out KẾT-THÚC checkbox [BE+FE `PeWorkflowPanel` 2-app] + (b) `36cbf8b` mark-read stale-noti [BE-only] + (c) `0c2f9f6`=HEAD khóa-sửa-giá-đề-xuất-PRO/CCM-sau-gửi-duyệt [BE `PeSuggestedPriceFeatures` phase-guard + FE `PeDetailTabs.tsx` 2-app gate + test `PeSuggestedPriceSetterAuthzTests`], NO migration (cả 3)** — 3 runs sequential id=478 `e657faa`✅@15:46 → id=479 `36cbf8b`✅@15:52 → **id=480 `0c2f9f6`✅@16:12:59=HEAD=canonical=ship-tất**. Poll running→success ~5m25s (start 16:07:34→16:12:59; busy-wait-spin, `updated_at` fresh-advancing=alive-NOT-hung; foreground-sleep-BLOCKED Windows). status=success ⟹ test-gate green (baseline **440** = 45D+395I, +new `PeSuggestedPriceSetterAuthzTests`; tasks-API terminal-success trust-NOT-log-numeric). 🎯 **FE JS ROTATED (real FE proof — e657faa PeWorkflowPanel + 0c2f9f6 PeDetailTabs 2-app)**: admin `0T6vVJST`(S96)→**`COYAX-yQ`** + user `BGXEVZO6`(S96)→**`0MU-kb4N`** ✅. **CSS FROZEN** admin `Bbtesa6B`/user `BmuPz_Dy` = IDENTICAL S96/S96 (logic+gate-only-FE, 0-style-diff ⟹ #69-REFINE byte-identical-CSS-source⟹same-hash; matches S93/S95/S96 JS-rotate-CSS-frozen; NOT-fail). Real-size-verify (guard SPA-trap): admin JS **1,636,639B** + user **1,542,960B** (control fake-hash `ZZfakehash0.js`→919B text/html=SPA-fallback ⟹ real-bundles-genuine-not-trap); Last-Modified admin 09:11:38GMT=16:11:38+07 / user 09:12:34GMT=16:12:34+07 (=disk-mtime EXACT-match, in-window). **BE ship-proof**: Infrastructure.dll `16:08:35`+Application.dll `16:08:10`+Api.dll `16:10:20` all-in-window · w3wp fresh PID=3184@`16:12:39` + PID=11104@`16:12:21` AT-END-window (pool recycled ⟹ new DLL; 6 w3wp total=3-site pools, 2-newest bracket deploy-end). **Mig prod=59 `AddCcmBudgetPeriodToPurchaseEvaluation` UNCHANGED** (=repo-HEAD; 0-mig-file range `ba4b8e0..0c2f9f6`⟹correct-frozen). Smoke: api ready/live+admin/eoffice-root ALL 200, **auth accessToken 468ch, GET /api/purchase-evaluations 200 items[]-valid (PE-not-broken by price-lock-guard) + /approval-workflows-v2 + /notifications 200**. ⚠️ UI checkbox/chuông/khóa-giá NOT curl-verifiable (login+phiếu-thật → anh Kiệt UAT); scope=deploy-ship+test-gate+bundle-rotate+smoke. 🔑 **REAL-FE-CHANGE PASS = JS-hash-rotate(vs prev-snapshot) + real-size-vs-919b-trap + Last-Modified-in-window + CSS-frozen-OK-if-logic-only(#69-REFINE) + BE-DLL-mtime-in-window + w3wp-recycle + Mig-frozen + smoke-200-payload-valid**. base64-EncodedCommand-over-ssh WORKED this run (CLIXML-wrapper = PS-remoting-noise, `grep -v`; contradicts S96-note base64-FAIL — both methods situational, try base64 first fallback `.ps1`-File S42). +- **🟢 S97 #481 (id=481, run_number 367) `1c8fb6a` GO ~5m10s (PASS) — FE-ONLY PE finalize 2-fix, mirror 2-app SHA-identical `PeWorkflowPanel.tsx` (fe-admin+fe-user), NO BE/mig/test.** Fix1 badge cấp-sau-finalize `"không trình tới"`→`"Kết thúc tại {finalizeLevelName}"` (render-động + tooltip template-literal) · Fix2 đảo default checkbox "Cấp KẾT THÚC" opt-out→**opt-in** (`useState(true)`→`false` + reset onSuccess + helper reword). Poll running→success ~5m10s (18:05:56→18:11:06; busy-wait-spin, `updated_at` advancing=alive; foreground-sleep-BLOCKED Win). status=success ⟹ test-gate green (baseline **440**=45D+395I; tasks-API terminal-success trust-NOT-log-numeric). 🎯 **FE JS ROTATED (real FE proof — 2-app PeWorkflowPanel diff)**: admin `COYAX-yQ`(S96)→**`Cf0o8dx8`** + user `0MU-kb4N`(S96)→**`x8rppRAK`** ✅. **CSS FROZEN** admin `Bbtesa6B`/user `BmuPz_Dy` = IDENTICAL S96 (JSX-text+useState-bool-only, 0-style-diff ⟹ #69-REFINE byte-identical-CSS⟹same-hash). Real-size guard-SPA-trap: admin JS **1,636,732B** + user **1,543,053B** `application/javascript` (control fake `ZZfakehash0.js`→919B text/html=SPA-fallback ⟹ real-genuine); Last-Modified admin 11:09:44GMT=18:09:44+07 / user 11:10:38GMT=18:10:38+07 (in-window 18:05→18:11). 🔴 **BYTE-LEVEL grep (gotcha #77) BOTH apps CLEAN**: NEW `Kết thúc tại`=PRESENT(×1) + NEW helper `Mặc định: duyệt xong phiếu TRÌNH TIẾP`=PRESENT(×1) + tooltip `không cần trình tới`=PRESENT · OLD JSX `không trình tới`=ABSENT(0) + OLD helper `Đã BỎ tick`=ABSENT(0) ⟹ fix shipped byte-level, UI-cũ=cache→incognito NOT deploy-fail. **Mig prod=59 `AddCcmBudgetPeriodToPurchaseEvaluation` UNCHANGED**=repo-HEAD (0-mig-file commit⟹correct-frozen) + `sys.tables`(is_ms_shipped=0,excl-history)=**88** frozen. Smoke: api ready/live+admin/eoffice-root ALL 200, auth accessToken 468ch, GET /api/purchase-evaluations **200 items[]-valid** (PE-not-broken) + /approval-workflows-v2 **200**. ⚠️ UI badge-text/checkbox-default NOT curl-verifiable (login+phiếu-thật → anh Kiệt UAT); scope=deploy-ship+test-gate+JS-rotate+byte-grep+smoke+Mig-frozen. 🔑 **FE-ONLY-REAL-CHANGE PASS = JS-hash-rotate(vs prev-snapshot) + real-size-vs-919b-trap + Last-Modified-in-window + CSS-frozen-OK(#69-REFINE logic-only) + BYTE-LEVEL-grep-new-PRESENT/old-ABSENT(#77) + Mig+88-frozen + smoke-200-payload-valid**. ⚠️ tooling: **no-jq → Python-JSON-parse for id-match** (grep-slice `"id":,` BROKE→empty-status, wasted iter); background-output-file NEVER-materialized this Win-setup → **foreground-poll-only reliable**. +- _(S96 #480 `0c2f9f6` GO ~5m25s PASS — cross-stack PE 3-commit range ba4b8e0→HEAD [e657faa opt-out-checkbox BE+FE + 36cbf8b mark-read-noti BE + 0c2f9f6=HEAD khóa-giá-PRO/CCM-sau-gửi BE+FE PeDetailTabs+test], NO-mig · baseline-440 +new PeSuggestedPriceSetterAuthzTests · JS admin`0T6vVJST`→`COYAX-yQ`/user`BGXEVZO6`→`0MU-kb4N` rotated **CSS FROZEN** Bbtesa6B/BmuPz_Dy · real-size 1636639/1542960B · Mig59-frozen · w3wp PID3184@16:12:39 · full verbatim → git `0c2f9f6` + archive `2026-06.md` via `_INDEX`)_ - _(S96 #479 `36cbf8b` GO ~5m40s PASS — PE 2-commit e657faa opt-out-checkbox+36cbf8b mark-read-stale-noti NO-mig · baseline-436 · JS admin`0T6vVJST`→`kL1-N1Zq`/user`BGXEVZO6`→`BRCrr80A` rotated **CSS FROZEN** Bbtesa6B/BmuPz_Dy · real-size 1636619/1542940B · Mig59-frozen · w3wp PID3024@15:52:19 · full verbatim → git `36cbf8b` + archive `2026-06.md` via `_INDEX`)_ - _(S96 #477 `ba4b8e0` Infra data-only seed import NCC `DONGDUONG` Excel anh-Kiệt NO-mig ungated-idempotent · baseline-434 · 🎯 DONGDUONG-LANDED pre=3→post=4 suppliers total=21 EXACT+1-idempotent Type=2-NhaThauPhu · **FE bundle FROZEN** admin `0T6vVJST`/user `BGXEVZO6` 0-fe-src-diff(#69-REFINE) · Mig59-frozen · w3wp PID13660@14:54:28 recycle+DLL-in-window · 🔑 **DATA-SEED-PASS = pre-vs-post-DB-row-EXACT-delta + DLL-mtime + w3wp-recycle + Mig-frozen + API-payload-contains-row** · ⚠️ sqlcmd `-W` diacritic-LIKE false-NEG use `_`-wildcard; base64-EncodedCommand-FAIL→`.ps1`-File-method reliable — full verbatim → git `ba4b8e0` + archive `2026-06.md` via `_INDEX`)_ - _(S95 #476 `18a17f5` GOVERNANCE-ONLY adopt Harness-17 — 2 `.ps1` scripts/ trigger CI despite 0-prod-code · baseline-434 · JS→`0T6vVJST`/`BGXEVZO6` rotated **CSS FROZEN** · Mig59 frozen · brief-prev-hash STALE→re-snapshot-LIVE · 🔑 GOVERNANCE-PASS=CI-green+JS-rotate/CSS-frozen(#69)+3×200+Mig-frozen — full verbatim → git `18a17f5` + archive `2026-06.md` via `_INDEX`)_ diff --git a/.claude/agent-memory/implementer-frontend/MEMORY.md b/.claude/agent-memory/implementer-frontend/MEMORY.md index 97e10c1..753c78c 100644 --- a/.claude/agent-memory/implementer-frontend/MEMORY.md +++ b/.claude/agent-memory/implementer-frontend/MEMORY.md @@ -6,6 +6,15 @@ --- +## 🆕 S97 (2026-07-01) — PE finalize wording + đảo default checkbox opt-out→opt-in ×2 app (anh Kiệt FDC UAT, em-main chốt) +4 chuỗi-edit `PeWorkflowPanel.tsx` × {admin,user} = 8 hunk. PROD LIVE UAT (anh Kiệt xem trực tiếp). File 2 app byte-identical trước+sau → SHA-pair đúng nghĩa. +- **E1 default checkbox:** `useState(true)`→`useState(false)` (~:57). Đảo S96 opt-out→opt-in: giờ default KHÔNG kết thúc, phải TÍCH mới finalize. +- **E2 reset onSuccess:** `setApplyLevelFinalize(true)`→`(false)` (~:221). Anchor 3-dòng (`setFinalizeByCcm(false)`+X+`setApprovedPriceSource(null)`) để KHÔNG đụng `setApplyLevelFinalize(e.target.checked)` handler (:664). +- **E3 helper text ternary** (~:669-671): reword theo default mới — nhánh true "Đã tích — …KẾT THÚC tại cấp này…", nhánh false "Mặc định: …TRÌNH TIẾP lên CEO… TÍCH vào nếu muốn KẾT THÚC…". +- **E4a title** (~:329): static string → template literal `` `Quy trình kết thúc tại ${finalizeLevelName ?? finalizeStepName ?? 'cấp duyệt thay CEO'}…` ``. **E4b JSX text** (~:331): "không trình tới" → "Kết thúc tại {finalizeLevelName ?? finalizeStepName ?? 'cấp trên'}". `finalizeLevelName/finalizeStepName` ĐÃ trong scope (dùng banner :280-287) — no new prop/DTO. +- **GOTCHA "không trình tới" 2 chỗ:** comment :121 (KHÔNG đụng) vs JSX :331 (đổi). Dùng ngữ-cảnh `>`…`` cho E4b unique → grep-confirm :121 comment còn nguyên. +- **SHA256 IDENTICAL ×2 = `bcf812fd…`** (git diff --no-index exit 0; diff 2 file byte-identical incl. before/after index hash `a92c9db..d97a597`). git diff = đúng 8 hunk (4/file, 12ins/12del), no thừa. Build PASS ×2 (admin 1948mod `index-l_kwCZIF.js` 22.0s / user 1937mod `index-DxUomy4C.js` 8.2s, 0 TS err). Pre-existing warn: @import CSS-order + >500KB + realtime.ts dynamic (#69). NO BE/test/other-FE touch. Full precedent, NO ambiguity. **LESSON: đảo default state = sửa CẢ init `useState` LẪN reset-onSuccess (2 chỗ dễ sót 1); bare-string xuất hiện 2 chỗ (comment+JSX) → anchor context phân-biệt.** Tag `[s97, pe-finalize-opt-in, invert-default-checkbox, wording-reword, sha256-2pair, dual-string-anchor]`. + ## 🆕 S88 D2 (2026-06-25) — PE multi-winner OUTWARD FE ×2 app (BE đã đổi: create→LIST, list DTO winner names) 3 edit OUTWARD, em-main chốt FE behavior, coord BE (impl-backend đã viết). 2 SHA-pair + 1 type-DIVERGE. - **E1 CreateContractDialog (PeDetailTabs ~:2144):** mut type `{contractId:string}`→**`{contractIds:string[]}`** (BE tạo 1 HĐ/mỗi IsWinner). onSuccess: toast `` `Đã tạo ${res.data.contractIds.length} hợp đồng từ phiếu.` `` + `navigate(/contracts/${res.data.contractIds[0]})` (giữ destination `/contracts/${...}` của bản single). Dialog GIỮ joined winner-names (:2174) + 1 ContractType-cho-mọi-winner. Bản gốc KHÔNG invalidate → nothing to preserve. @@ -21,26 +30,10 @@ - **E4 type wording (2 file):** `previousSelectedTotal`/`currentProposalTotal` inline cmt "của SelectedSupplier" → "NCC trúng (IsWinner)" (BE giờ multi-winner). Block 7-dòng byte-identical 2 app → edit same → KHÔNG new divergence (grep-confirm my-line ∉ diff). - **SHA256 PeDetailTabs ×2 = `36292924…`** (cp admin→user, git-diff empty). PeHeaderForm untouched `987291c1…` identical. Build PASS ×2 (admin 1946mod `index-CqiQWR8e.js` / user 1935mod `index-Cp0DuKFQ.js`, 0 TS err). Pre-existing warn: @import CSS + >500KB + realtime.ts. NO BE/test touch. **LESSON: type files DIVERGED (S76/S79 color+prose) ≠ SHA-pair → mirror = edit-identical-block + verify-not-in-diff, KHÔNG cp.** Tag `[s87plus, pe-frozen-cleanup, hosolink-clear-empty, gotcha70-guard, type-diverge-edit-identical]`. -## 🆕 S79 (2026-06-19) — PE detail: live thousand-sep + ghi chú giá PRO/CCM + typo (×2 app) -3 task presentation+wiring `PeDetailTabs.tsx` (+`PeWorkspaceCreateView.tsx` typo). BE thêm `note` body song song; FE chốt UX rồi. -- **A live phân cách:** chỉ **2 comp** thiếu sep — `VndInlineEdit` (~990) + `BudgetCell` (~1100): đổi `onChange` `value.replace(/[^\d.]/g,'')` → **`formatVndInput(parseVnd(e.target.value))`** (format-on-keystroke, reuse helper module-level :51/52). Dialog money inputs (2111/2555/2645) ĐÃ dùng `formatVndInput`/`parseVnd` sẵn → no-op. KHÔNG đụng phone(tel)/%/qty. -- **B ghi chú giá:** `SuggestedPriceRows` (~1509) — `proPriceMut` body `{minPrice,maxPrice,note}` + `ccmPriceMut` `{ccmPrice,note}` (absolute-set 3-field S74). 3 call-site giá echo `note:ev.*SuggestedPriceNote`. State `proNoteText/ccmNoteText` (useEffect sync ev.*). Textarea+nút "Lưu ghi chú" dưới PRO Min/Max & dưới CCM (gate canEdit; read-only `

` khi có note). `hasAnyValue` +`!!note` (early-return không nuốt note-only readonly). -- **Type DIVERGE 2 app** (xác nhận S76): `PeDetailBundle` +`proSuggestedPriceNote`+`ccmSuggestedPriceNote` sửa **CẢ 2 file** riêng (sau `ccmSuggestedPrice`). PeDetailTabs/PeWorkspaceCreateView byte-identical → cp. -- **C typo:** `d. Bản so sánh` → `d. Bảng so sánh giá` PeDetailTabs:1661(``) + PeWorkspaceCreateView:278(`label`). Comment :1712 + `PeAttachmentPurposeLabel[4]` GIỮ (ngoài spec, không UI). -- SHA256 IDENTICAL ×2 pair: PeDetailTabs `285ebcf9…`, PeWorkspaceCreateView `99caed4b…`. Build PASS ×2 (user 1935mod `index-_axiw6cM.js` / admin 1946mod `index-BqPYp7Pt.js`, 0 TS err). Pre-existing warn: @import CSS + >500KB + realtime.ts. NO ambiguity, full precedent. Tag `[s79, pe-live-vnd-sep, suggested-price-note, sha256-2pair, type-diverge-2app]`. - -## 🆕 S78 (2026-06-19) — PE "focus mode" redesign mirror fe-user→fe-admin (CONVERGE, em-main chốt UX) -Mechanical mirror-step: redesign built+reviewed-PASS ở fe-user, em-main đã chốt UX (focus overlay). fe-admin ONLY, NO BE/schema. 2 file: -- **PeWorkflowPanel.tsx** PURE-ADDITIVE: +`onApproved?:()=>void` prop + `wasReject` const (byte-mirror `isReject` formula mutationFn) + `if(!wasReject) onApproved?.()` cuối `onSuccess`. Trả-lại/Từ-chối giữ overlay; chỉ forward-approve auto-đóng. -- **PurchaseEvaluationsListPage.tsx** STRUCTURAL port: bỏ 3-panel grid → list-state `mx-auto max-w-5xl` panel (4-level tree giữ verbatim) + focus-state `?id` = `fixed inset-0 z-50` overlay slide-from-right (translate-x-full→0, 2× rAF ~200ms) che menu+TopBar, top-strip "← Thu gọn"+title+"Chế độ duyệt" pill, phiếu trái scroll-riêng + panel duyệt phải `lg:w-[24rem] xl:w-[26rem]` stack ` + ``. Tình cờ trùng fe-user → redesign CONVERGE 2 app. -- **SHA256 IDENTICAL ×2 pair** (khớp tới trailing-newline `}\n\n`): page `011968bb…`, panel `1dc24641…`. LESSON: focus-overlay redesign khiến 2 app converge (props trùng) → mirror-step ra file byte-identical, đo bằng `diff`+`sha256sum` KHÔNG mắt. Build PASS (1946 mod, `index-D6IyFKgP.js`, 0 TS err — tsc-b clean trước vite). Pre-existing warning: @import-order CSS + >500KB chunk + realtime.ts dynamic-import. NO ambiguity, full precedent. Tag `[s78, pe-focus-mode, mirror-step, sha256-2pair, converge-2app]`. - -## 🆕 S76 (2026-06-19) — PE budget MA TRẬN 3 cột + bảng lưới `` + badge quyền NS (anh Kiệt FDC) -- **Part 1 mirror** (fe-user→fe-admin byte-identical, Python difflib slice-region): `PeBudgetSummaryTable` Block A → ma trận 3 cột (DỰ ÁN hiển-thị-only `—` / PRO `canEditPro` / CCM `canEditCcm`). Type `PeBudgetSummary` +`proInitialAmount`+`proAdjustmentAmount` cạnh `proEstimateAmount`(LEGACY). `proMut` body `{proInitialAmount,proAdjustmentAmount,proNote}`. proFull=proInit+proAdj. -- **Part 3 mirror:** `PeWorkflowPanel` approver `.join(' / ')` → map từng approver + badge `✎ NS PRO`(amber)/`✎ NS CCM`(sky) gate `a.canEditProBudget/canEditCcmBudget`. Type `PeCurrentApprovalLevelApprover` +2 cờ **CẢ 2 app** (purchaseEvaluation.ts types DIFFER giữa 2 app → sửa cả 2; PeDetailTabs/PeWorkflowPanel byte-identical). -- **Bảng lưới (em-main, anh phản hồi "chưa chia cột giống Excel"):** Block A flex→`
` viền ô. `BudgetCell` xếp dọc (input full ô + Lưu dưới). `BudgetNoteRow`→`BudgetNoteCell` (td colSpan=3). **LESSON: flex+gap KHÔNG ra "bảng" — phải `
` viền ô mới giống spreadsheet.** -- **cwd-misland:** Part-1 `cd fe-admin` npm build → MEMORY rơi `fe-user/.claude` stray → em-main harvest về + `.gitignore` guard `fe-*/.claude/` (S76). +## 📦 Archived detail → `archive/2026-H1.md` (read on demand) +- **S79** (2026-06-19) — PE live thousand-sep (`formatVndInput(parseVnd())` on-keystroke 2 comp) + ghi chú giá PRO/CCM (`note` 3-field absolute-set) + typo "Bảng so sánh giá". SHA-pair. `[s79, type-diverge-2app]` +- **S78** (2026-06-19) — PE "focus mode" overlay redesign mirror fe-user→admin CONVERGE. PeWorkflowPanel +`onApproved` prop; ListPage `fixed inset-0 z-50` slide overlay a11y. SHA-pair. `[s78, mirror-step, converge]` +- **S76** (2026-06-19) — PE budget ma trận 3 cột (DỰ ÁN/PRO/CCM) → `
` grid + badge `✎ NS PRO/CCM`. LESSON: flex+gap ≠ bảng, phải `
`. cwd-misland `fe-*/.claude/` gitignore-guard. `[s76]` --- @@ -78,15 +71,14 @@ Dynamic class purged. PALETTE array full literal `as const` cycle `index % lengt ## ✅ Verify protocol `cd fe-admin && npm run build` + `cd fe-user && npm run build` BOTH 0 TS error + `sha256sum` mirror proof. Bundle >500KB warning OK pre-existing. -## 📅 Recent activity (last 10 FIFO) - -- **2026-06-17 (Văn phòng số "Bảng điều khiển" — mirror fe-user→fe-admin + 4-place wiring ×2 app):** Mechanical mirror+wire step (frontend-designer built in fe-user, em main chốt UX). (A) **index.css SYNC** prereq: fe-admin STALE pre-S66 → `cp fe-user/src/index.css fe-admin/` (no admin-only class to merge — utility sets identical, chỉ S66 gotcha-66 diffs: h1-h4 `#0b1220`/wt700 + .label-eyebrow brand-600 + accent palette comments) → SHA256 `e8631471…` identical. (B) **Mirror 4 file** `cp` user→admin SHA256 IDENTICAL: ui/PageHeader `6ff5303f…`(Văn-phòng-số richer header — eyebrow/icon/accent/breadcrumb, NOT @/components/PageHeader constrained one), ui/KpiCard `f8042ade…`(clickable filter chip a11y role=button), ui/WidgetCard `9221cbed…`(gotcha66 gradient header `text-white!`), pages/office/OfficeDashboardPage `c6d9dc08…`(composes 3 ui over EXISTING hooks, NO new API). All `@/` imports + Button/api/cn + types/{proposal,workflowApps,meeting} đã có ở fe-admin → 0 import fix. (C) **4-place ×2 app:** page(mirror) + App.tsx import+`` (NEW `/office/` prefix convention — page file ở pages/office/, không xung đột; flat office routes giữ nguyên) + menuKeys `OffDashboard:'Off_Dashboard'` (mirror BE MenuKeys.OffDashboard, đặt sau `Off` trước `OffDanhBa` đúng thứ tự BE) + Layout staticMap `Off_Dashboard:'/office/dashboard'` (4th place gotcha#50, trước Off_DanhBa). Leaf admin auto via BE All[]. Build PASS ×2 (user 1934mod `index-BYj_ew5Q.js`, admin 1945mod `index-Cn1flmn6.js`, 0 TS err). CSS @import-order warning + >500KB chunk = pre-existing. NO ambiguity, full precedent (Pattern 16-bis 4-place + SHA256 mirror). Tag `[office-dashboard, mirror-step, 4-place, sha256-5file, office-route-prefix]`. -- **2026-06-16 (S65 PE mục E "Link hồ sơ" FE ×2 app — em-main PROXY, PE-Workflow FE-stage died-empty #53):** Thêm mục "e. Link hồ sơ" hyperlink NAS dưới mục "d. Bản so sánh" + rename "Dự trù PRO"→"Ngân sách PRO". 4-file ×{user,admin} SHA256-mirror: PeDetailTabs.tsx (`HoSoLinkRow` :1353/1386 — useState(ev.hoSoLink), PUT echo required+hoSoLink, readOnly→`` null-safe) + PeWorkspaceCreateView.tsx + types/purchaseEvaluation.ts (+hoSoLink). Ship Run #293 PASS, bundle both-rotate, GET phiếu thật `"hoSoLink":null` backward-compat ✓. SURPRISE: render landed on disk despite empty-return — work COMPLETE, chỉ MEMORY-update bị cắt (#53, lần này trong Workflow fan-out); em main self-gate bắt **badge "DỰ TRÙ PRO" sót rename** (agent chỉ đổi row label 1120/1126, sót badge 1078) → vá nốt ×2 app. Tag `[s65, pe-section-e-link-FE, hosolink-row, em-main-proxy-truncated-53, workflow-fanout]`. -- **2026-06-16 (Department parentId — cây tổ chức, fe-admin ONLY):** Case 1 master-data enrich (NO 4-place, NO menu/route/Layout — chỉ Place-1 page+type). BE đã sẵn (local `0f44d97`): `DepartmentDto.parentId:Guid?` + POST/PUT nhận `parentId?` + cycle-guard 409 ConflictException. fe-admin ONLY (intentional — KHÔNG fe-user, KHÔNG SHA256). 2 file: (1) types/master.ts `Department` +`parentId:string|null` (sau name, trước managerUserId) — DepartmentInput auto-inherit via Omit · (2) DepartmentsPage.tsx: import Select + FormState/emptyForm +`parentId:string` ('' khi rỗng) + load-all query `['departments-all']` pageSize:200 (reuse pattern proven UsersPage/Workflows/AttendanceReport) + `deptNameById` Map từ allDepts cho cột "Thuộc" + mutate payload `parentId:d.parentId||null` + openEdit `parentId:d.parentId??''` + Dialog `` passthrough, `value=''` ↔ null sentinel (proven UsersPage departmentId). Build PASS (1941 mod, 0 TS err — tsc -b clean trước vite). NO ambiguity, full precedent (S55 enrich + UsersPage Select). -- **2026-06-11 (S57bis PE WorkItem FE ×2 app — PARTIAL, on-behalf em main ghi hộ, H2-proposed):** Task = PeWorkspaceCreateView select "c. Hạng mục công việc *" sau Dự án + PeHeaderForm (select + load existing + PUT/POST workItemId) + PeDetailTabs (subtitle "Dự án – Hạng mục" + FormRow + inline-edit khóa) + types +3 field. Return-truncated #53 GIỮA mirror fe-admin → em main solo mirror 7 edits PeHeaderForm + 3 edits PeDetailTabs ×2 app; PeHeaderForm SHA256 IDENTICAL. LEARNED: mirror đo bằng SHA256 (không diff mắt); option label `[Category] Code — Name` + canSubmit require; route reuse `/catalogs/work-items` (KHÔNG endpoint mới). SURPRISE: điểm gãy lặp tại mirror-2-app-trong-1-spawn → cân nhắc per-app stage khi slice lớn. Tag `[s57bis, truncated-53, sha256-mirror, on-behalf]`. -- **2026-06-09 (S55 HMW P2 — Project +4 optional master fields):** Case 1 master-data enrich (NO 4-place, NO menu/route/Layout — chỉ Place-1 page+type). BE adds 4 nullable Project fields parallel (implementer-backend). 2 file × 2 app: (1) types/master.ts `Project` +`year:number|null`+`investor/location/package:string|null` (sau `note`) +ProjectInput auto-inherit via Omit · (2) ProjectsPage.tsx (single-Dialog CRUD, NO separate pages): FormState +4 `string` (form dùng string, convert on submit) + emptyForm +4 '' + mutate payload `year:d.year?Number():null, investor/location/package:d.x||null` + openEdit `year:p.year?.toString()??'', x:p.x??''` + Dialog 4 Input sau "Ngày kết thúc" trước "Ghi chú" (Năm type=number, Chủ đầu tư, Địa điểm col-span-2, Gói thầu col-span-2) + table column "Chủ đầu tư" (`p.investor??'—'`) giữa name↔startDate. **`package` = valid TS object KEY** (reserved chỉ khi binding-identifier) → `form.package`/`{...form,package:x}` build sạch, KHÔNG cần rename. cp admin→user SHA256 IDENTICAL: master.ts `93ac1b0f…`, ProjectsPage `b002061…`. Build PASS ×2 (admin 1945mod, user 1934mod, 0 TS err — tsc -b clean trước vite). Reuse S42 enrich-pattern (string-form + convert-on-submit). NO ambiguity, full precedent. -- **2026-06-08 (S54 ItTicket reassign → CONVERGE 2 app, REVERSE S53 divergence) [harvested by em main — agent MEMORY write mis-landed, B2/B3]:** S53 đã tách fe-admin-only (admin reassign). S54 cho tổ IT tự reassign → cả 2 app cần nút. **Pattern mới: BE capability-flag gate thay vì FE đoán role.** Dropdown đổi `GET /users` → `GET /it-tickets/assignable-staff` trả `{canReassign:bool, staff:[{id,fullName}]}` (`[Authorize]` any-auth, KHÔNG 403 → chống gotcha #44). `canReassign = staffQ.data?.canReassign ?? false` (fetch on mount, KHÔNG `enabled`) → nút Pencil bọc `{canReassign && …}`. types/workflowApps.ts +`AssignableStaff`+`AssignableStaffResult` (mirror cả 2). fe-admin rewrite (bỏ UserOption/Paged) + fe-user full-add → **SHA256 IDENTICAL `4bcaf2f…`** (viết admin canonical → `cp` → verify; cùng `@/...` import + shadcn Dialog/Select/Button identical 2 app). Build PASS ×2 (0 TS err). **Gotcha (pre-existing, NOT từ change này):** types/workflowApps.ts 2 app NOT SHA-identical — fe-admin có `AttendanceReportDto` (P11-E) mà fe-user thiếu; 2 type S54 mirror đúng cả 2. Lesson: BE-computed capability flag = single-source → 2 app converge lại sau intentional divergence. -- **2026-06-08 (S52 Task C+D-FE — ItTicket admin reassign + AttendanceReport menu, fe-admin ONLY):** Both intentional mirror-break (admin-only, NO fe-user touch, NO SHA256). **Task D-FE menu wiring:** Page+App.tsx route `/attendance/report` ALREADY exist (S52 prior). Only 2 of 4-place needed: (1) menuKeys.ts +OffAttendanceReport='Off_AttendanceReport' (mirror BE string exact, after OffChamCong) · (2) Layout.tsx staticMap +Off_AttendanceReport:'/attendance/report' (4th place gotcha #50). `types/menu.ts` = MenuNode tree type, key:string NOT typed-union → NO mirror there (resolvePath(key:string)). Leaf perm-gated via BE All[]→admin auto. **Task C reassign:** ItTicketsPage.tsx top-comment updated DIVERGES fe-user. Per-card Pencil button (cạnh 👤 assignee) → Dialog (size sm) + Select user. Users source = **GET /users {params:{page:1,pageSize:200}}→{items:UserOption{id,fullName,email}}** (reuse, proven PeWorkflows/Workflows/MeetingCalendar — `enabled:target!==null` lazy fetch). useMutation api.put(`/it-tickets/${id}/assign`,{assignedToUserId})→204 (NO json read)→invalidate['it-tickets']+toast.success+close. preselect t.assignedToUserId. UI deps: Dialog(open/onClose/title/children/footer?/size) + Select(native passthrough) + Button(variant=outline) + toast(sonner) + getErrorMessage(@/lib/apiError). Build PASS (0 err, 1945 mod). git: only 3 fe-admin file, fe-user untouched. +## 📅 Recent activity (FIFO — one-line hooks; full detail → `archive/2026-H1.md`) +- **2026-06-17** Văn phòng số "Bảng điều khiển" — mirror fe-user→admin 4 file (PageHeader/KpiCard/WidgetCard/OfficeDashboardPage) + 4-place wiring `/office/` prefix route. SHA-5file. `[office-dashboard, 4-place]` +- **2026-06-16 (S65)** PE mục "e. Link hồ sơ" NAS hyperlink + rename "Dự trù PRO"→"Ngân sách PRO". SHA-mirror 4 file. #53 empty-return (render landed OK); em-main bắt sót badge rename. `[s65, hosolink]` +- **2026-06-16** Department parentId cây tổ chức, **fe-admin ONLY** (no SHA). Select "Phòng cha" + load-all pageSize:200 + exclude-self khi Edit + cột "Thuộc"; BE cycle-guard 409. `[dept-parent, admin-only]` +- **2026-06-11 (S57bis)** PE WorkItem FE ×2 app (select "c. Hạng mục" + PeHeaderForm/PeDetailTabs +3 field). Truncated #53 GIỮA mirror → em-main solo. LESSON: per-app stage khi slice lớn. `[s57bis, truncated-53]` +- **2026-06-09 (S55)** Project +4 optional master fields (year/investor/location/package). String-form+convert-on-submit (S42 pattern). `package`=valid TS key. SHA-pair. `[s55, master-enrich]` +- **2026-06-08 (S54)** ItTicket reassign → CONVERGE 2 app (reverse S53). Pattern: BE capability-flag gate (`GET /it-tickets/assignable-staff {canReassign,staff}`) thay FE đoán role. SHA `4bcaf2f`. `[s54, capability-flag]` +- **2026-06-08 (S52)** ItTicket admin reassign + AttendanceReport menu, **fe-admin ONLY**. Menu = 2/4-place (menuKeys+Layout staticMap; types/menu.ts key:string no-union). `[s52, admin-only, menu-2place]` --- ## ⚠️ Anti-patterns (DO NOT) diff --git a/.claude/agent-memory/implementer-frontend/archive/2026-H1.md b/.claude/agent-memory/implementer-frontend/archive/2026-H1.md new file mode 100644 index 0000000..1a01000 --- /dev/null +++ b/.claude/agent-memory/implementer-frontend/archive/2026-H1.md @@ -0,0 +1,39 @@ +# Implementer-Frontend — L2 Archive 2026 H1 + +> Verbatim detail moved out of HOT `MEMORY.md` during S97 compaction (2026-07-01). +> One-line hooks remain in `MEMORY.md`. Read here for full detail; search L3 RAG for older. + +--- + +## S79 (2026-06-19) — PE detail: live thousand-sep + ghi chú giá PRO/CCM + typo (×2 app) +3 task presentation+wiring `PeDetailTabs.tsx` (+`PeWorkspaceCreateView.tsx` typo). BE thêm `note` body song song; FE chốt UX rồi. +- **A live phân cách:** chỉ **2 comp** thiếu sep — `VndInlineEdit` (~990) + `BudgetCell` (~1100): đổi `onChange` `value.replace(/[^\d.]/g,'')` → **`formatVndInput(parseVnd(e.target.value))`** (format-on-keystroke, reuse helper module-level :51/52). Dialog money inputs (2111/2555/2645) ĐÃ dùng `formatVndInput`/`parseVnd` sẵn → no-op. KHÔNG đụng phone(tel)/%/qty. +- **B ghi chú giá:** `SuggestedPriceRows` (~1509) — `proPriceMut` body `{minPrice,maxPrice,note}` + `ccmPriceMut` `{ccmPrice,note}` (absolute-set 3-field S74). 3 call-site giá echo `note:ev.*SuggestedPriceNote`. State `proNoteText/ccmNoteText` (useEffect sync ev.*). Textarea+nút "Lưu ghi chú" dưới PRO Min/Max & dưới CCM (gate canEdit; read-only `

` khi có note). `hasAnyValue` +`!!note` (early-return không nuốt note-only readonly). +- **Type DIVERGE 2 app** (xác nhận S76): `PeDetailBundle` +`proSuggestedPriceNote`+`ccmSuggestedPriceNote` sửa **CẢ 2 file** riêng (sau `ccmSuggestedPrice`). PeDetailTabs/PeWorkspaceCreateView byte-identical → cp. +- **C typo:** `d. Bản so sánh` → `d. Bảng so sánh giá` PeDetailTabs:1661(``) + PeWorkspaceCreateView:278(`label`). Comment :1712 + `PeAttachmentPurposeLabel[4]` GIỮ (ngoài spec, không UI). +- SHA256 IDENTICAL ×2 pair: PeDetailTabs `285ebcf9…`, PeWorkspaceCreateView `99caed4b…`. Build PASS ×2 (user 1935mod `index-_axiw6cM.js` / admin 1946mod `index-BqPYp7Pt.js`, 0 TS err). Pre-existing warn: @import CSS + >500KB + realtime.ts. NO ambiguity, full precedent. Tag `[s79, pe-live-vnd-sep, suggested-price-note, sha256-2pair, type-diverge-2app]`. + +## S78 (2026-06-19) — PE "focus mode" redesign mirror fe-user→fe-admin (CONVERGE, em-main chốt UX) +Mechanical mirror-step: redesign built+reviewed-PASS ở fe-user, em-main đã chốt UX (focus overlay). fe-admin ONLY, NO BE/schema. 2 file: +- **PeWorkflowPanel.tsx** PURE-ADDITIVE: +`onApproved?:()=>void` prop + `wasReject` const (byte-mirror `isReject` formula mutationFn) + `if(!wasReject) onApproved?.()` cuối `onSuccess`. Trả-lại/Từ-chối giữ overlay; chỉ forward-approve auto-đóng. +- **PurchaseEvaluationsListPage.tsx** STRUCTURAL port: bỏ 3-panel grid → list-state `mx-auto max-w-5xl` panel (4-level tree giữ verbatim) + focus-state `?id` = `fixed inset-0 z-50` overlay slide-from-right (translate-x-full→0, 2× rAF ~200ms) che menu+TopBar, top-strip "← Thu gọn"+title+"Chế độ duyệt" pill, phiếu trái scroll-riêng + panel duyệt phải `lg:w-[24rem] xl:w-[26rem]` stack ` + ``. Tình cờ trùng fe-user → redesign CONVERGE 2 app. +- **SHA256 IDENTICAL ×2 pair** (khớp tới trailing-newline `}\n\n`): page `011968bb…`, panel `1dc24641…`. LESSON: focus-overlay redesign khiến 2 app converge (props trùng) → mirror-step ra file byte-identical, đo bằng `diff`+`sha256sum` KHÔNG mắt. Build PASS (1946 mod, `index-D6IyFKgP.js`, 0 TS err — tsc-b clean trước vite). Pre-existing warning: @import-order CSS + >500KB chunk + realtime.ts dynamic-import. NO ambiguity, full precedent. Tag `[s78, pe-focus-mode, mirror-step, sha256-2pair, converge-2app]`. + +## S76 (2026-06-19) — PE budget MA TRẬN 3 cột + bảng lưới `

` + badge quyền NS (anh Kiệt FDC) +- **Part 1 mirror** (fe-user→fe-admin byte-identical, Python difflib slice-region): `PeBudgetSummaryTable` Block A → ma trận 3 cột (DỰ ÁN hiển-thị-only `—` / PRO `canEditPro` / CCM `canEditCcm`). Type `PeBudgetSummary` +`proInitialAmount`+`proAdjustmentAmount` cạnh `proEstimateAmount`(LEGACY). `proMut` body `{proInitialAmount,proAdjustmentAmount,proNote}`. proFull=proInit+proAdj. +- **Part 3 mirror:** `PeWorkflowPanel` approver `.join(' / ')` → map từng approver + badge `✎ NS PRO`(amber)/`✎ NS CCM`(sky) gate `a.canEditProBudget/canEditCcmBudget`. Type `PeCurrentApprovalLevelApprover` +2 cờ **CẢ 2 app** (purchaseEvaluation.ts types DIFFER giữa 2 app → sửa cả 2; PeDetailTabs/PeWorkflowPanel byte-identical). +- **Bảng lưới (em-main, anh phản hồi "chưa chia cột giống Excel"):** Block A flex→`
` viền ô. `BudgetCell` xếp dọc (input full ô + Lưu dưới). `BudgetNoteRow`→`BudgetNoteCell` (td colSpan=3). **LESSON: flex+gap KHÔNG ra "bảng" — phải `
` viền ô mới giống spreadsheet.** +- **cwd-misland:** Part-1 `cd fe-admin` npm build → MEMORY rơi `fe-user/.claude` stray → em-main harvest về + `.gitignore` guard `fe-*/.claude/` (S76). + +--- + +## Recent activity FIFO (pre-2026-06-17, archived verbatim) + +- **2026-06-17 (Văn phòng số "Bảng điều khiển" — mirror fe-user→fe-admin + 4-place wiring ×2 app):** Mechanical mirror+wire step (frontend-designer built in fe-user, em main chốt UX). (A) **index.css SYNC** prereq: fe-admin STALE pre-S66 → `cp fe-user/src/index.css fe-admin/` (no admin-only class to merge — utility sets identical, chỉ S66 gotcha-66 diffs: h1-h4 `#0b1220`/wt700 + .label-eyebrow brand-600 + accent palette comments) → SHA256 `e8631471…` identical. (B) **Mirror 4 file** `cp` user→admin SHA256 IDENTICAL: ui/PageHeader `6ff5303f…`(Văn-phòng-số richer header — eyebrow/icon/accent/breadcrumb, NOT @/components/PageHeader constrained one), ui/KpiCard `f8042ade…`(clickable filter chip a11y role=button), ui/WidgetCard `9221cbed…`(gotcha66 gradient header `text-white!`), pages/office/OfficeDashboardPage `c6d9dc08…`(composes 3 ui over EXISTING hooks, NO new API). All `@/` imports + Button/api/cn + types/{proposal,workflowApps,meeting} đã có ở fe-admin → 0 import fix. (C) **4-place ×2 app:** page(mirror) + App.tsx import+`` (NEW `/office/` prefix convention — page file ở pages/office/, không xung đột; flat office routes giữ nguyên) + menuKeys `OffDashboard:'Off_Dashboard'` (mirror BE MenuKeys.OffDashboard, đặt sau `Off` trước `OffDanhBa` đúng thứ tự BE) + Layout staticMap `Off_Dashboard:'/office/dashboard'` (4th place gotcha#50, trước Off_DanhBa). Leaf admin auto via BE All[]. Build PASS ×2 (user 1934mod `index-BYj_ew5Q.js`, admin 1945mod `index-Cn1flmn6.js`, 0 TS err). CSS @import-order warning + >500KB chunk = pre-existing. NO ambiguity, full precedent (Pattern 16-bis 4-place + SHA256 mirror). Tag `[office-dashboard, mirror-step, 4-place, sha256-5file, office-route-prefix]`. +- **2026-06-16 (S65 PE mục E "Link hồ sơ" FE ×2 app — em-main PROXY, PE-Workflow FE-stage died-empty #53):** Thêm mục "e. Link hồ sơ" hyperlink NAS dưới mục "d. Bản so sánh" + rename "Dự trù PRO"→"Ngân sách PRO". 4-file ×{user,admin} SHA256-mirror: PeDetailTabs.tsx (`HoSoLinkRow` :1353/1386 — useState(ev.hoSoLink), PUT echo required+hoSoLink, readOnly→`` null-safe) + PeWorkspaceCreateView.tsx + types/purchaseEvaluation.ts (+hoSoLink). Ship Run #293 PASS, bundle both-rotate, GET phiếu thật `"hoSoLink":null` backward-compat ✓. SURPRISE: render landed on disk despite empty-return — work COMPLETE, chỉ MEMORY-update bị cắt (#53, lần này trong Workflow fan-out); em main self-gate bắt **badge "DỰ TRÙ PRO" sót rename** (agent chỉ đổi row label 1120/1126, sót badge 1078) → vá nốt ×2 app. Tag `[s65, pe-section-e-link-FE, hosolink-row, em-main-proxy-truncated-53, workflow-fanout]`. +- **2026-06-16 (Department parentId — cây tổ chức, fe-admin ONLY):** Case 1 master-data enrich (NO 4-place, NO menu/route/Layout — chỉ Place-1 page+type). BE đã sẵn (local `0f44d97`): `DepartmentDto.parentId:Guid?` + POST/PUT nhận `parentId?` + cycle-guard 409 ConflictException. fe-admin ONLY (intentional — KHÔNG fe-user, KHÔNG SHA256). 2 file: (1) types/master.ts `Department` +`parentId:string|null` (sau name, trước managerUserId) — DepartmentInput auto-inherit via Omit · (2) DepartmentsPage.tsx: import Select + FormState/emptyForm +`parentId:string` ('' khi rỗng) + load-all query `['departments-all']` pageSize:200 (reuse pattern proven UsersPage/Workflows/AttendanceReport) + `deptNameById` Map từ allDepts cho cột "Thuộc" + mutate payload `parentId:d.parentId||null` + openEdit `parentId:d.parentId??''` + Dialog `` passthrough, `value=''` ↔ null sentinel (proven UsersPage departmentId). Build PASS (1941 mod, 0 TS err — tsc -b clean trước vite). NO ambiguity, full precedent (S55 enrich + UsersPage Select). +- **2026-06-11 (S57bis PE WorkItem FE ×2 app — PARTIAL, on-behalf em main ghi hộ, H2-proposed):** Task = PeWorkspaceCreateView select "c. Hạng mục công việc *" sau Dự án + PeHeaderForm (select + load existing + PUT/POST workItemId) + PeDetailTabs (subtitle "Dự án – Hạng mục" + FormRow + inline-edit khóa) + types +3 field. Return-truncated #53 GIỮA mirror fe-admin → em main solo mirror 7 edits PeHeaderForm + 3 edits PeDetailTabs ×2 app; PeHeaderForm SHA256 IDENTICAL. LEARNED: mirror đo bằng SHA256 (không diff mắt); option label `[Category] Code — Name` + canSubmit require; route reuse `/catalogs/work-items` (KHÔNG endpoint mới). SURPRISE: điểm gãy lặp tại mirror-2-app-trong-1-spawn → cân nhắc per-app stage khi slice lớn. Tag `[s57bis, truncated-53, sha256-mirror, on-behalf]`. +- **2026-06-09 (S55 HMW P2 — Project +4 optional master fields):** Case 1 master-data enrich (NO 4-place, NO menu/route/Layout — chỉ Place-1 page+type). BE adds 4 nullable Project fields parallel (implementer-backend). 2 file × 2 app: (1) types/master.ts `Project` +`year:number|null`+`investor/location/package:string|null` (sau `note`) +ProjectInput auto-inherit via Omit · (2) ProjectsPage.tsx (single-Dialog CRUD, NO separate pages): FormState +4 `string` (form dùng string, convert on submit) + emptyForm +4 '' + mutate payload `year:d.year?Number():null, investor/location/package:d.x||null` + openEdit `year:p.year?.toString()??'', x:p.x??''` + Dialog 4 Input sau "Ngày kết thúc" trước "Ghi chú" (Năm type=number, Chủ đầu tư, Địa điểm col-span-2, Gói thầu col-span-2) + table column "Chủ đầu tư" (`p.investor??'—'`) giữa name↔startDate. **`package` = valid TS object KEY** (reserved chỉ khi binding-identifier) → `form.package`/`{...form,package:x}` build sạch, KHÔNG cần rename. cp admin→user SHA256 IDENTICAL: master.ts `93ac1b0f…`, ProjectsPage `b002061…`. Build PASS ×2 (admin 1945mod, user 1934mod, 0 TS err — tsc -b clean trước vite). Reuse S42 enrich-pattern (string-form + convert-on-submit). NO ambiguity, full precedent. +- **2026-06-08 (S54 ItTicket reassign → CONVERGE 2 app, REVERSE S53 divergence) [harvested by em main — agent MEMORY write mis-landed, B2/B3]:** S53 đã tách fe-admin-only (admin reassign). S54 cho tổ IT tự reassign → cả 2 app cần nút. **Pattern mới: BE capability-flag gate thay vì FE đoán role.** Dropdown đổi `GET /users` → `GET /it-tickets/assignable-staff` trả `{canReassign:bool, staff:[{id,fullName}]}` (`[Authorize]` any-auth, KHÔNG 403 → chống gotcha #44). `canReassign = staffQ.data?.canReassign ?? false` (fetch on mount, KHÔNG `enabled`) → nút Pencil bọc `{canReassign && …}`. types/workflowApps.ts +`AssignableStaff`+`AssignableStaffResult` (mirror cả 2). fe-admin rewrite (bỏ UserOption/Paged) + fe-user full-add → **SHA256 IDENTICAL `4bcaf2f…`** (viết admin canonical → `cp` → verify; cùng `@/...` import + shadcn Dialog/Select/Button identical 2 app). Build PASS ×2 (0 TS err). **Gotcha (pre-existing, NOT từ change này):** types/workflowApps.ts 2 app NOT SHA-identical — fe-admin có `AttendanceReportDto` (P11-E) mà fe-user thiếu; 2 type S54 mirror đúng cả 2. Lesson: BE-computed capability flag = single-source → 2 app converge lại sau intentional divergence. +- **2026-06-08 (S52 Task C+D-FE — ItTicket admin reassign + AttendanceReport menu, fe-admin ONLY):** Both intentional mirror-break (admin-only, NO fe-user touch, NO SHA256). **Task D-FE menu wiring:** Page+App.tsx route `/attendance/report` ALREADY exist (S52 prior). Only 2 of 4-place needed: (1) menuKeys.ts +OffAttendanceReport='Off_AttendanceReport' (mirror BE string exact, after OffChamCong) · (2) Layout.tsx staticMap +Off_AttendanceReport:'/attendance/report' (4th place gotcha #50). `types/menu.ts` = MenuNode tree type, key:string NOT typed-union → NO mirror there (resolvePath(key:string)). Leaf perm-gated via BE All[]→admin auto. **Task C reassign:** ItTicketsPage.tsx top-comment updated DIVERGES fe-user. Per-card Pencil button (cạnh 👤 assignee) → Dialog (size sm) + Select user. Users source = **GET /users {params:{page:1,pageSize:200}}→{items:UserOption{id,fullName,email}}** (reuse, proven PeWorkflows/Workflows/MeetingCalendar — `enabled:target!==null` lazy fetch). useMutation api.put(`/it-tickets/${id}/assign`,{assignedToUserId})→204 (NO json read)→invalidate['it-tickets']+toast.success+close. preselect t.assignedToUserId. UI deps: Dialog(open/onClose/title/children/footer?/size) + Select(native passthrough) + Button(variant=outline) + toast(sonner) + getErrorMessage(@/lib/apiError). Build PASS (0 err, 1945 mod). git: only 3 fe-admin file, fe-user untouched. diff --git a/.claude/agent-memory/reviewer/MEMORY.md b/.claude/agent-memory/reviewer/MEMORY.md index 060f4e1..2726c5c 100644 --- a/.claude/agent-memory/reviewer/MEMORY.md +++ b/.claude/agent-memory/reviewer/MEMORY.md @@ -65,6 +65,8 @@ Adversarial pre-commit reviewer SOLUTION_ERP. Read-only verify + live curl prod ## 📅 Recent activity (compressed — full verbatim → `archive/2026-06.md` via `archive/_INDEX.md`) +- **S97 (2026-07-01) PE finalize UAT ×2 app: reword badge + đảo default checkbox opt-out→opt-in (uncommitted, prod-live anh Kiệt FDC) — PASS (0 issue):** 4 hunk/file × 2 = 8 total, 12ins/12del, no thừa. E1 `useState(true→false)` L57 · E2 reset `setApplyLevelFinalize(false)` L221 · E3 helper-text reword (strings KHỚP spec verbatim) · E4 badge `không trình tới`→`Kết thúc tại {finalizeLevelName ?? finalizeStepName ?? 'cấp trên'}` + template-literal title. **SHA256 full-file IDENTICAL** `bcf812fd…` ×2 + git-diff --no-index exit-0. **Comment L121 `không trình tới` INTACT** (bare-string 2-site: comment giữ + JSX đổi) + **`e.target.checked` handler L664 INTACT** (spec correctly NOT flip). Logic-non-break VERIFIED: default-false → eligible-untick → `sendPrice`(L171)=false + `shouldPickPrice`(L496)=false → price-picker KHÔNG bắt (spec pt6 ✓); payload L200 `(approverFinalizeEligible ? applyLevelFinalize : true)` = pre-existing S96 opt-out no-op cho non-eligible, unaffected by flip. Type `finalizeStepName/LevelName: string|null` (purchaseEvaluation.ts:149-150) → `??`-chain TS-safe. 0 BE/test/mig leak. Build fresh ~17:55 ×2 (fe-user hash `DxUomy4C` KHỚP impl-claim; fe-admin rotate `DkyQ0xCd`→disk `l_kwCZIF` = #69 normal). Anti-pattern-none: precedent-backed cosmetic+default-flip, byte-mirror tight. + - **2026-06-29 S93 Harness-16 MFE adoption review (WF2 `wf_13e3d35a` 3-lane PASS 0-blocking):** ⭐ code-gate re-derived denom-29 to-the-digit + **leading-verb-trap adversarial-probed-DEFEATED** (`NEVER commit push`→0 content-word, no false-max). cross-harness **READ-ONLY-budget proof** (đúng 1 write-op = `.mfe-state.json`; token_governor read-only) + 0-conflict additive. honesty 5-floor đủ + **live-numbers KHỚP §H prose** (S81 stale-config trap KHÔNG tái). Earlier WF1-reviewer caught **BLOCKING vocab-fork** (memory-fidelity = H6.7 memoryDelta-routing ≠ H16 coverage-eval → đặt MFE + alias-map §H, KHÔNG seed $aliasSets). Detail → adap-report harness-16-mfe. → _INDEX. - **S92 (2026-06-29) Adversarial PROD-security hide 5 menu-groups admin-only on eoffice (uncommitted) — PASS (0 blocking, 1 awareness note):** A-E all upheld; CatalogManager Danh-mục access stripped (intended-by-spec, role assigned to 0 users post-S89, flag em-main only). Detail + per-attack file:line → [project_s92_admin_only_modules_revoke.md](project_s92_admin_only_modules_revoke.md). diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md index 37e85f6..cfd1647 100644 --- a/docs/HANDOFF.md +++ b/docs/HANDOFF.md @@ -2,7 +2,7 @@ > **Tiering rule (S40):** giữ **2-3 session gần nhất**. Cũ hơn → `docs/changelog/sessions/`. Full brief history pre-S40 → `docs/_archive/HANDOFF-preS40-fullhistory.md`. -**Last updated:** 2026-07-01 (S96 — **buổi UAT LỚN anh Kiệt/chị Trà/anh Chương live + monthly-audit, em-main-led, 5 commit prod-verified.** **(1)** Monthly drift audit `881783c` (docs-only CI-skip): ef-core SKILL Mig→59 + rows 57/58/59 · skills/README + docs/CLAUDE Budget-removed · **`vocab-alias-map.md` MỚI** (3 fork + `$ExcludeExact`) · **re-tier mega-line 5→3** (S92/S91→archive, conservation delta=0 BOM) + hoist UAT-carry→blockers · **FD distill** (H17 strike-1 CLEARED L1 26129→21492B + archive/`_INDEX`/gist + Lessons L1). Workflow `wf_2d687d27` 4-cluster (reviewer bắt #74-drift + AS-10 residual reverted). detector 27→25. **(2)** Import NCC **DONGDUONG** `ba4b8e0` (Excel anh Kiệt; 3 NCC đã sẵn → +1 no-mig prod 21 NCC Run #477); backlog 15-18 field→Next-up. **(3-5)** 3 PE bug-fix UAT: `e657faa` ô "KẾT THÚC quy trình" (S89-auto)→**opt-out bỏ-tick-được** (2-tier grant/exercise +`applyLevelFinalize`, #478) · `36cbf8b` **chuông tự-sạch** noti "cần duyệt" (mark-read ExecuteUpdate BE-only, #479) · `0c2f9f6` **khóa sửa giá PRO/CCM sau gửi-duyệt** ("duyệt là fix" non-admin Nháp/TraLai+Admin-override, +4 test, #480). Test 434→440. **Delete-sau-duyệt = ĐÃ chặn sẵn**. Checkbox "ko-được" = **browser-cache** (verify byte-level prod `0MU-kb4N` chứa fix; incognito golden). **State: Mig 59 · 88 bảng · 440 test (45D+395I) · gotcha 77 · menu 54 · bundle admin `COYAX-yQ`/user `0MU-kb4N` · prod 21 NCC/17 user.** **🔴 NEXT anh:** ⚠️ restart CLI · UAT **incognito** checkbox + cho **số-phiếu/user** vụ "lỗi phân quyền vào phiếu". **🔴 NEXT em:** cicd S-tag-drift S97/S98→S96 reconcile (closeout) · monthly re-tier mega-line (giờ 4-blurb). **Lessons:** verify-deployed-artifact-byte-level (cache≠deploy; incognito golden — gotcha #77) · #53-return-garble ×3 recover-from-agent-memory (instruction-fix "return-verdict" ăn) · 2-tier-permission · spec-change→update-test. → log `2026-07-01-S96-uat-pe-fixes-monthly-audit.md`) · **Prev S95** (S95 — **Harness-17 adopt (Vòng tự-cải-thiện bộ-nhớ Đo→Tinh-chỉnh→Kiểm) — governance-only 0 prod code, em-main-led 3-workflow.** `/check-email AI_INFRA` (0 directed mới; H16 áp trọn S93) → `/adap-apply` H17 (2 broadcast hash-MATCH `reviewer_gate:PASS`). **10/10 mục 🔴:** REUSE-cite A2=§H MFE/C3=D9/CG-2=value_protect/archive=§A + **build mới** `scripts/memory-selfimprove-audit.ps1` (C1 spec-audit NO-API, **runtime-verified bắt frontend-designer over-cap thật**) + `.claude/governance/reinject-ledger.md` (B2 CG-1 N=3) + engine §I + `session-start §2.1.7`/`session-end §L.b(c)` wire + HCV alias no-seed. **3-workflow:** WF1 `wf_f085d7c4-d78` ground-truth + WF2 `wf_8e73c1d6-ee6` 3-lane PASS + WF3 `wf_6f44eddf-680` **fault-injection 13-inject teeth-proof** + integration + cross-doc (0 application-defect). **2 commit:** `18a17f5` (cicd **Run #476 PASS** prod 200×3 bundle `0T6vVJST`/`BGXEVZO6` Mig 59) + `65b434a` (docs-only CI-skip). adap-report + 2 email AI_INFRA (`54789e19`+`8c94fa34`). **Dogfood AS-10 4-fire reverted** (git-diff = net thật; **WF3 explicit-return-only STILL self-wrote → instruction-fix NOT 100%**, E-006 recurrence, guard HELD 4/4; cicd-monitor diary KEPT = legit normal-spawn). **Lessons:** fault-injection-`-RepoRoot`-temp chứng checker-teeth · Lane B #53 empty→em-main self-gate. **State: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · prod 17 user/7 NCC.** **🔴 NEXT anh:** ⚠️ restart CLI (§2.1.7 + §L.b(c) H17-loop wire runtime — command `.md` no hot-reload). **🔴 NEXT em:** frontend-designer distill (WATCH strike-1 = H17 loop's live finding, chờ strike-2/anh) · monthly **2026-07-01 (hôm nay)** re-tier STATUS/HANDOFF mega-line + ef-core SKILL Mig→59 + docs/CLAUDE Budget-removed + 3 vocab-fork alias-map. **Pending product (carry):** Section B cột Dự-án · Ngưỡng CEO Mig 54 · "C" chuyển phiếu→dự án. → log `2026-07-01-S95-harness17-adopt.md`) · **Prev S94** (S94 — **anh-directive nâng cap lead 220K→380K** (canonical `memory-budget.json` · SE-override lead KHÔNG còn AI_INFRA-parity, subs giữ 60K/50K · mark H-15 v4-delta `RC-pqhuy1987-29-06-2026-23-25-50` · flush 3 echo · MFE live-read 380K) + **re-tier 2 mega-line** (fix Read-25K/call OOM): STATUS 389→89 · HANDOFF 732→12 dòng · 332KB→**34KB −90%** · ≤S90 → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` **0 byte-loss** · detector 27=baseline · `5f61b03` pushed CI-skip. MFE eval-all baseline: LEAD 29-item/380K=0.92% · SUB ≥85% (impl-backend 94%/impl-frontend 85%/reviewer 88%). **Lesson:** trần budget ⟂ harness Read-25K/call = 2 khóa độc-lập (cap-raise KHÔNG unblock mega-line Read → cần re-tier) · mega-LINE=tooling-breaker (ưu-tiên) vs mega-FILE nhiều-dòng=token-cost · re-tier=archive-không-cắt + assert head+tail==orig. em-main solo (0 sub, 0 fan-out). **State GIỮ NGUYÊN: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · bundle admin `CDn40vpV`/user `CoPmPBg7` · prod 17 user/7 NCC.** **🔴 NEXT anh:** ⚠️ restart CLI (session-start echo 380K + budget v4 runtime; số canonical đã sống ngay) · UAT eoffice node Dự án mã (carry S93). **🔴 NEXT em:** monthly **2026-07-01 (MAI!)** — ef-core SKILL Mig→59 · docs/CLAUDE Budget-removed · 3 vocab-fork alias-map · re-tier `migration-todos.md` (mega-FILE thứ-3, 807 dòng — không gấp, không vỡ tooling) · FD L1 26.1KB WATCH strike-1 (**test-specialist RESOLVED 7.8KB** — bỏ khỏi carry). **Pending product:** Section B cột Dự-án wire · Ngưỡng giá CEO Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. → log `2026-06-29-S94-cap-380k-retier-megaline.md`) · **Prev S93** (S93 — **(1) PE node Dự án hiện MÃ thay tên dài (anh Kiệt FDC) prod-verified Run #473** `8ee8f3e`: BE thread ProjectCode (DTO+3 projection+search) + FE 2-app SHA-mirror (render code+tooltip+sort) NO-MIG; grep bắt site#3 thoát replace_all; test 434; bundle admin `CDn40vpV`/user `CoPmPBg7`. **(2) adopt Harness-16 MFE (memory-fidelity-EVAL) 2-workflow PASS `9580098` 0-prod-code:** WF1 `wf_4c63e1bd` (ground-truth + bắt BLOCKING vocab-fork memory-fidelity≠H6.7) + WF2 `wf_13e3d35a` 3-lane PASS (denom-29-re-derived + READ-ONLY-proof + honesty + verb-trap-defeated); `scripts/mfe-eval.ps1` deterministic NO-API (LEAD coverage-FIT 29/220K=1.5% + age-band + Goodhart 21/9 · SUB đo-thật impl-backend 94%/reviewer 88% · prose→N/A) + judge-SCAFFOLD + budget:mfe + eval/mfe/ seed + engine §H + wire-opt-in + email AI_INFRA. AS-10 dogfood (WF1 residual caught+reverted; WF2 0-residual). #53 recover-from-disk. user-MEMORY compact 23.7→7.8KB. **State: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · bundle admin `CDn40vpV`/user `CoPmPBg7` · prod 17 user/7 NCC.** **🔴 NEXT anh:** ⚠️ restart CLI (MFE opt-in + wire) · UAT eoffice node Dự án mã · (anh Kiệt) nếu ô khoanh là Hạng-mục→báo em đổi work-item-code. **🔴 NEXT em:** monthly **2026-07-01 GẤP** re-tier mega-line (detector D1 OOM do bloat — STATUS 61K/HANDOFF 46K-char KHÔNG Read/Edit) + ef-core Mig→59 + Budget-removed docs + 3 vocab-fork + curate test-spec/FD L1. **Pending product:** Section B cột Dự-án · Ngưỡng giá CEO Mig 54 · "C" chuyển phiếu→dự án. → log `2026-06-29-S93-pe-projectcode-harness16-mfe.md`) · *(session ≤S90 đã tách → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` + `docs/changelog/sessions/`; re-tier S94)* +**Last updated:** 2026-07-01 (S97 — **PE finalize 2-fix UAT anh Kiệt FDC (em-main HMW-workflow implement+review), FE-only prod-verified Run #481.** **(1)** badge `"không trình tới"`→**`"Kết thúc tại {finalizeLevelName}"`** (hiện "Kết thúc tại CCM")+tooltip. **(2)** đảo default checkbox "Cấp KẾT THÚC" **opt-out→opt-in** (`useState true→false`+reset+helper reword+comment-drift fix). Mirror 2-app SHA `bcf812fd`, 0 BE/mig/test (BE tôn trọng cờ FE; param default=fallback). Workflow `wf_0e01fdba-209` (reviewer PASS 0-issue). Commit `1c8fb6a`. **cicd #481 PASS byte-level #77:** JS admin `COYAX-yQ`→**`Cf0o8dx8`**/user `0MU-kb4N`→**`x8rppRAK`** · NEW `Kết thúc tại`+helper PRESENT / OLD `không trình tới`+`Đã BỎ tick` ABSENT · Mig 59/88 frozen · smoke 200×3. **Lesson:** #53 return-garble **lần-4** (cicd trả memory-curation thay verdict → recover-from-diary NO re-spawn) · BE-honors-explicit-flag → đảo-default chỉ-FE zero-BE-churn. **State: Mig 59·88 bảng·440 test·gotcha 77·menu 54·bundle admin `Cf0o8dx8`/user `x8rppRAK`·prod 21 NCC/17 user.** **🔴 NEXT anh:** UAT **incognito** phiếu "8 MEP Sub Hệ thống solar" xác nhận badge+checkbox (+ vụ cũ "lỗi phân quyền": số-phiếu+user). **🔴 NEXT em:** monthly re-tier mega-line (giờ 5-blurb). → log `2026-07-01-S97-pe-finalize-wording-default-flip.md`) · **Prev S96** (S96 — **buổi UAT LỚN anh Kiệt/chị Trà/anh Chương live + monthly-audit, em-main-led, 5 commit prod-verified.** **(1)** Monthly drift audit `881783c` (docs-only CI-skip): ef-core SKILL Mig→59 + rows 57/58/59 · skills/README + docs/CLAUDE Budget-removed · **`vocab-alias-map.md` MỚI** (3 fork + `$ExcludeExact`) · **re-tier mega-line 5→3** (S92/S91→archive, conservation delta=0 BOM) + hoist UAT-carry→blockers · **FD distill** (H17 strike-1 CLEARED L1 26129→21492B + archive/`_INDEX`/gist + Lessons L1). Workflow `wf_2d687d27` 4-cluster (reviewer bắt #74-drift + AS-10 residual reverted). detector 27→25. **(2)** Import NCC **DONGDUONG** `ba4b8e0` (Excel anh Kiệt; 3 NCC đã sẵn → +1 no-mig prod 21 NCC Run #477); backlog 15-18 field→Next-up. **(3-5)** 3 PE bug-fix UAT: `e657faa` ô "KẾT THÚC quy trình" (S89-auto)→**opt-out bỏ-tick-được** (2-tier grant/exercise +`applyLevelFinalize`, #478) · `36cbf8b` **chuông tự-sạch** noti "cần duyệt" (mark-read ExecuteUpdate BE-only, #479) · `0c2f9f6` **khóa sửa giá PRO/CCM sau gửi-duyệt** ("duyệt là fix" non-admin Nháp/TraLai+Admin-override, +4 test, #480). Test 434→440. **Delete-sau-duyệt = ĐÃ chặn sẵn**. Checkbox "ko-được" = **browser-cache** (verify byte-level prod `0MU-kb4N` chứa fix; incognito golden). **State: Mig 59 · 88 bảng · 440 test (45D+395I) · gotcha 77 · menu 54 · bundle admin `COYAX-yQ`/user `0MU-kb4N` · prod 21 NCC/17 user.** **🔴 NEXT anh:** ⚠️ restart CLI · UAT **incognito** checkbox + cho **số-phiếu/user** vụ "lỗi phân quyền vào phiếu". **🔴 NEXT em:** cicd S-tag-drift S97/S98→S96 reconcile (closeout) · monthly re-tier mega-line (giờ 4-blurb). **Lessons:** verify-deployed-artifact-byte-level (cache≠deploy; incognito golden — gotcha #77) · #53-return-garble ×3 recover-from-agent-memory (instruction-fix "return-verdict" ăn) · 2-tier-permission · spec-change→update-test. → log `2026-07-01-S96-uat-pe-fixes-monthly-audit.md`) · **Prev S95** (S95 — **Harness-17 adopt (Vòng tự-cải-thiện bộ-nhớ Đo→Tinh-chỉnh→Kiểm) — governance-only 0 prod code, em-main-led 3-workflow.** `/check-email AI_INFRA` (0 directed mới; H16 áp trọn S93) → `/adap-apply` H17 (2 broadcast hash-MATCH `reviewer_gate:PASS`). **10/10 mục 🔴:** REUSE-cite A2=§H MFE/C3=D9/CG-2=value_protect/archive=§A + **build mới** `scripts/memory-selfimprove-audit.ps1` (C1 spec-audit NO-API, **runtime-verified bắt frontend-designer over-cap thật**) + `.claude/governance/reinject-ledger.md` (B2 CG-1 N=3) + engine §I + `session-start §2.1.7`/`session-end §L.b(c)` wire + HCV alias no-seed. **3-workflow:** WF1 `wf_f085d7c4-d78` ground-truth + WF2 `wf_8e73c1d6-ee6` 3-lane PASS + WF3 `wf_6f44eddf-680` **fault-injection 13-inject teeth-proof** + integration + cross-doc (0 application-defect). **2 commit:** `18a17f5` (cicd **Run #476 PASS** prod 200×3 bundle `0T6vVJST`/`BGXEVZO6` Mig 59) + `65b434a` (docs-only CI-skip). adap-report + 2 email AI_INFRA (`54789e19`+`8c94fa34`). **Dogfood AS-10 4-fire reverted** (git-diff = net thật; **WF3 explicit-return-only STILL self-wrote → instruction-fix NOT 100%**, E-006 recurrence, guard HELD 4/4; cicd-monitor diary KEPT = legit normal-spawn). **Lessons:** fault-injection-`-RepoRoot`-temp chứng checker-teeth · Lane B #53 empty→em-main self-gate. **State: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · prod 17 user/7 NCC.** **🔴 NEXT anh:** ⚠️ restart CLI (§2.1.7 + §L.b(c) H17-loop wire runtime — command `.md` no hot-reload). **🔴 NEXT em:** frontend-designer distill (WATCH strike-1 = H17 loop's live finding, chờ strike-2/anh) · monthly **2026-07-01 (hôm nay)** re-tier STATUS/HANDOFF mega-line + ef-core SKILL Mig→59 + docs/CLAUDE Budget-removed + 3 vocab-fork alias-map. **Pending product (carry):** Section B cột Dự-án · Ngưỡng CEO Mig 54 · "C" chuyển phiếu→dự án. → log `2026-07-01-S95-harness17-adopt.md`) · **Prev S94** (S94 — **anh-directive nâng cap lead 220K→380K** (canonical `memory-budget.json` · SE-override lead KHÔNG còn AI_INFRA-parity, subs giữ 60K/50K · mark H-15 v4-delta `RC-pqhuy1987-29-06-2026-23-25-50` · flush 3 echo · MFE live-read 380K) + **re-tier 2 mega-line** (fix Read-25K/call OOM): STATUS 389→89 · HANDOFF 732→12 dòng · 332KB→**34KB −90%** · ≤S90 → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` **0 byte-loss** · detector 27=baseline · `5f61b03` pushed CI-skip. MFE eval-all baseline: LEAD 29-item/380K=0.92% · SUB ≥85% (impl-backend 94%/impl-frontend 85%/reviewer 88%). **Lesson:** trần budget ⟂ harness Read-25K/call = 2 khóa độc-lập (cap-raise KHÔNG unblock mega-line Read → cần re-tier) · mega-LINE=tooling-breaker (ưu-tiên) vs mega-FILE nhiều-dòng=token-cost · re-tier=archive-không-cắt + assert head+tail==orig. em-main solo (0 sub, 0 fan-out). **State GIỮ NGUYÊN: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · bundle admin `CDn40vpV`/user `CoPmPBg7` · prod 17 user/7 NCC.** **🔴 NEXT anh:** ⚠️ restart CLI (session-start echo 380K + budget v4 runtime; số canonical đã sống ngay) · UAT eoffice node Dự án mã (carry S93). **🔴 NEXT em:** monthly **2026-07-01 (MAI!)** — ef-core SKILL Mig→59 · docs/CLAUDE Budget-removed · 3 vocab-fork alias-map · re-tier `migration-todos.md` (mega-FILE thứ-3, 807 dòng — không gấp, không vỡ tooling) · FD L1 26.1KB WATCH strike-1 (**test-specialist RESOLVED 7.8KB** — bỏ khỏi carry). **Pending product:** Section B cột Dự-án wire · Ngưỡng giá CEO Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. → log `2026-06-29-S94-cap-380k-retier-megaline.md`) · **Prev S93** (S93 — **(1) PE node Dự án hiện MÃ thay tên dài (anh Kiệt FDC) prod-verified Run #473** `8ee8f3e`: BE thread ProjectCode (DTO+3 projection+search) + FE 2-app SHA-mirror (render code+tooltip+sort) NO-MIG; grep bắt site#3 thoát replace_all; test 434; bundle admin `CDn40vpV`/user `CoPmPBg7`. **(2) adopt Harness-16 MFE (memory-fidelity-EVAL) 2-workflow PASS `9580098` 0-prod-code:** WF1 `wf_4c63e1bd` (ground-truth + bắt BLOCKING vocab-fork memory-fidelity≠H6.7) + WF2 `wf_13e3d35a` 3-lane PASS (denom-29-re-derived + READ-ONLY-proof + honesty + verb-trap-defeated); `scripts/mfe-eval.ps1` deterministic NO-API (LEAD coverage-FIT 29/220K=1.5% + age-band + Goodhart 21/9 · SUB đo-thật impl-backend 94%/reviewer 88% · prose→N/A) + judge-SCAFFOLD + budget:mfe + eval/mfe/ seed + engine §H + wire-opt-in + email AI_INFRA. AS-10 dogfood (WF1 residual caught+reverted; WF2 0-residual). #53 recover-from-disk. user-MEMORY compact 23.7→7.8KB. **State: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · bundle admin `CDn40vpV`/user `CoPmPBg7` · prod 17 user/7 NCC.** **🔴 NEXT anh:** ⚠️ restart CLI (MFE opt-in + wire) · UAT eoffice node Dự án mã · (anh Kiệt) nếu ô khoanh là Hạng-mục→báo em đổi work-item-code. **🔴 NEXT em:** monthly **2026-07-01 GẤP** re-tier mega-line (detector D1 OOM do bloat — STATUS 61K/HANDOFF 46K-char KHÔNG Read/Edit) + ef-core Mig→59 + Budget-removed docs + 3 vocab-fork + curate test-spec/FD L1. **Pending product:** Section B cột Dự-án · Ngưỡng giá CEO Mig 54 · "C" chuyển phiếu→dự án. → log `2026-06-29-S93-pe-projectcode-harness16-mfe.md`) · *(session ≤S90 đã tách → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` + `docs/changelog/sessions/`; re-tier S94)* --- diff --git a/docs/STATUS.md b/docs/STATUS.md index 09ea6e9..16cefc4 100644 --- a/docs/STATUS.md +++ b/docs/STATUS.md @@ -3,7 +3,7 @@ > **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-07-01 (S96 — **buổi UAT LỚN anh Kiệt/chị Trà/anh Chương live + monthly-audit — 5 commit prod-verified, em-main-led (HMW-mode ON; 1 prep-workflow monthly-audit + spawn-lẻ, chủ-yếu solo).** **(1) Monthly drift audit `881783c`** (docs-only CI-skip): ef-core SKILL Mig→59 + bảng rows 57/58/59 + Mig 14/Phase-7 Budget-DROPPED annotate · skills/README Mig 55→59 + gotcha #69→76 · docs/CLAUDE Budget REMOVED Mig 50 strike-through · **`docs/governance/vocab-alias-map.md` MỚI** (3 fork run-trace/Ngân-sách-PRO/all-inherit + `$ExcludeExact` anti-self-match) · **re-tier STATUS/HANDOFF mega-line 5→3 blurb** (S92/S91→archive, conservation delta=0 BOM-preserved) + hoist 3 UAT-carry→blockers · **FD memory distill** (H17 strike-1 CLEARED: L1 26129→21492B, 5 war-story→archive/`_INDEX`/gist, Lessons value-protect lên L1). Workflow `wf_2d687d27` 4-cluster draft→verify (reviewer bắt #74-paraphrase-drift + AS-10 residual reverted). detector 27→25. **(2) Import NCC DONGDUONG `ba4b8e0`** (Excel anh Kiệt "Database NCC" 4 NCC/30-field): 3 NCC đã seed sẵn (TRUONGGIANG/TANPHU/TGN) → chỉ +DONGDUONG vào SeedRealMasterDataAsync (ungated idempotent, pack extras→Note, no-mig); prod 20→21 NCC (Run #477). Backlog 15-18 field "note-lại-từ-từ-tính"→Next-up. **(3-5) 3 PE bug-fix UAT:** `e657faa` ô "Cấp này KẾT THÚC quy trình" (AllowApproverFinalize S89-auto) → **opt-out bỏ-tick-được** (2-tier: Designer=cấp-quyền / phiếu=chọn kết-thúc-hay-trình-CEO; +param `applyLevelFinalize` default-true BE + FE 2-app, Run #478) · `36cbf8b` **chuông tự sạch** noti "cần duyệt" cũ khi phiếu rời cấp (LogTransitionAsync mark-read Generic+RefId ExecuteUpdate BE-only, Run #479) · `0c2f9f6` **khóa sửa giá đề xuất PRO/CCM sau gửi-duyệt** ("duyệt là fix" — Mig 54 "KHÔNG-ràng-Phase" ĐẢO → non-admin chỉ sửa Nháp/TraLai + Admin-override; BE+FE 2-app+4 test, Run #480). Test 434→440. **Delete-sau-duyệt = ĐÃ chặn sẵn** (FE nút Xóa chỉ DangSoanThao + BE guard, không cần sửa). Checkbox "ko-được" = **browser-cache** (verify byte-level: prod bundle `0MU-kb4N` CHỨA fix + "✅-static" cũ đã mất; index.html no-cache đúng-chuẩn + no-service-worker) → **incognito = golden-test**. **State: Mig 59 · 88 bảng · 440 test (45D+395I) · gotcha 77 · menu 54 · bundle admin `COYAX-yQ`/user `0MU-kb4N` (Run #480) · prod 21 NCC/17 user.** **Lessons:** verify-deployed-artifact-byte-level (cache≠deploy; incognito golden — gotcha #77) · #53-return-garble tái-diễn ×3 (investigator + cicd×2 trả text-memory-curation thay verdict → recover từ agent-memory; instruction-fix "return-verdict" ăn lần-3) · 2-tier-permission (grant-vs-exercise) · spec-change→update-test-cũ (SeedPeAsync ChoDuyet→DangSoanThao). **🔴 NEXT anh:** UAT incognito checkbox + cho **số-phiếu/user** vụ "lỗi phân quyền vào phiếu" để em soi config-workflow. **NEXT em:** cicd-monitor S-tag-drift S97/S98→S96 reconcile (closeout này) · monthly re-tier mega-line (giờ 4-blurb S96/S95/S94/S93). → log `2026-07-01-S96-uat-pe-fixes-monthly-audit.md`) · **Prev S95** (S95 — **Harness-17 adopt (Vòng tự-cải-thiện bộ-nhớ Đo→Tinh-chỉnh→Kiểm) — governance-only 0 prod code, em-main-led + 3-workflow fan-out (HMW-mode ON).** `/check-email AI_INFRA` (0 directed mới; H16 đã áp trọn S93) → `/adap-apply` H17 (2 broadcast hash-MATCH · `reviewer_gate:PASS`). **10/10 mục 🔴 sàn ĐẠT:** REUSE-cite A2=§H MFE/C3=D9/CG-2=value_protect/archive=§A; **build mới** `scripts/memory-selfimprove-audit.ps1` (C1 spec-audit NO-API exit-0, **runtime-verified bắt frontend-designer over-cap GAP thật**) + `.claude/governance/reinject-ledger.md` (B2 CG-1 N=3, tách khỏi budget.json) + engine **§I** codify + `session-start §2.1.7`/`session-end §L.b(c)` wire + HCV alias no-seed (coverage 3-nghĩa, detector vẫn 27). **3-workflow (run-id bằng-chứng):** WF1 `wf_f085d7c4-d78` ground-truth + WF2 `wf_8e73c1d6-ee6` 3-lane review PASS 0-blocking + WF3 `wf_6f44eddf-680` deep-reverify (**fault-injection 13-inject chứng-răng-thật** + integration + cross-doc, 0 application-defect). **2 commit:** `18a17f5` (adopt — cicd **Run #476 PASS** prod 200×3, bundle rotate admin `0T6vVJST`/user `BGXEVZO6`, Mig 59 unchanged) + `65b434a` (deep-reverify docs-only CI-skip). **adap-report + 2 email AI_INFRA** (hash `54789e19` adopt + `8c94fa34` deep-reverify-update). **Dogfood C3 4-fire:** AS-10 WF1+WF3 self-write reverted (git-diff net = backstop THẬT; **instruction-fix NOT 100%** — WF3 explicit-return-only STILL self-wrote → E-006 recurrence S95, guard HELD 4/4, 0 escape; cicd-monitor diary KEPT = normal-spawn legit). **Lessons:** fault-injection-via-`-RepoRoot`-temp chứng checker-teeth (không chỉ happy-path PASS) · Lane B #53 empty-return → em-main self-gate recover · workflow-agent persona-write stochastic → git-diff mandatory. **State GIỮ NGUYÊN: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · prod 17 user/7 NCC.** **NEXT em:** frontend-designer distill (WATCH strike-1 = H17 loop's live finding) · monthly re-tier mega-line + ef-core SKILL Mig→59 + 3 vocab-fork (2026-07-01 due). → log `2026-07-01-S95-harness17-adopt.md`) · **Prev S94** (S94 — **(1) anh-directive nâng cap lead 220K→380K** (`memory-budget.json` canonical · SE-override lead KHÔNG còn AI_INFRA-parity, subs giữ 60K/50K · mark H-15 **v4-delta** `RC-pqhuy1987-29-06-2026-23-25-50` · flush 3 derived echo ACTIVE-MARKS/session-start §2.1.6/engine §G adopt-delta · MFE verified live-read 380K). **(2) re-tier 2 mega-line** (fix Read-25K/call OOM + token-cost ~169K/220K): STATUS 389→89 dòng (mega-line 59.6K→7.1K char) · HANDOFF 732→12 dòng · live 332KB→**34KB (−90%)** · session ≤S90 → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` **0 byte-loss** (new+archive=orig+995B pointer) · backup git+scratchpad · detector 27=baseline 0-broken-pointer · conservation spot-check PASS. **(3) MFE eval-all baseline** (đầu phiên): LEAD coverage-FIT 29-item/**380K=0.92%** · age-band 0-cut · Goodhart strikes-21/RCA-9 flat=no-lie · SUB per-role ≥85% (cicd/test-spec/FD 100% · impl-backend 94% · impl-frontend 85% · 3 prose-role N/A) · judge-scaffold-only honest. **(4) nạp full Phase-1 read-set** (budget 380K cho phép): +PROJECT-MAP +workflow-contract +migration-todos. **commit `5f61b03` pushed** docs-only CI-skip. **Lesson:** trần budget ⟂ harness **Read-25K/call** = 2 khóa ĐỘC-LẬP — cap-raise KHÔNG unblock mega-line Read (cần re-tier); **mega-LINE = tooling-breaker** (ưu-tiên) vs **mega-FILE nhiều-dòng = chỉ token-cost**; re-tier = **archive-không-cắt + assert head+tail==orig 0-loss**. em-main solo (governance single-writer, 0 sub, 0 fan-out). **State GIỮ NGUYÊN: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · bundle admin `CDn40vpV`/user `CoPmPBg7` · prod 17 user/7 NCC.** → log `2026-06-29-S94-cap-380k-retier-megaline.md`) · **Prev S93** (S93 — **(1) PE cây Duyệt NCC node Dự án hiện MÃ dự án thay tên dài (anh Kiệt FDC) prod-verified Run #473** `8ee8f3e`: BE thread ProjectCode (DTO + 3 projection List/Inbox/ListApproved + search) + FE 2-app SHA-mirror (render `projectCode||projectName`+tooltip+sort) NO-MIG; grep bắt construction-site#3 thoát replace_all (cardinality-grep-all-consumer); build 3× + test 434; bundle admin `xz8FdmLN`→`CDn40vpV`/user `CA8Rla2w`→`CoPmPBg7`. **(2) adopt Harness-16 MFE (memory-fidelity-EVAL) 2-workflow PASS, 0 production code** `9580098`: WF1 `wf_4c63e1bd` (ground-truth + bắt BLOCKING vocab-fork: memory-fidelity = H6.7 memoryDelta-routing ≠ H16 coverage-eval → đặt MFE + alias-map §H KHÔNG seed $aliasSets) + WF2 `wf_13e3d35a` 3-lane PASS (code-gate denom-29-re-derived to-the-digit + READ-ONLY-budget proof 1-write-op + honesty 5-floor + leading-verb-trap adversarial-probed-DEFEATED); `scripts/mfe-eval.ps1` deterministic NO-API ASCII#30 (LEAD coverage-FIT 29-item/220K=1.5% + age-band-flag-not-cut + Goodhart strikes-21/RCA-9 · SUB per-role ĐO-THẬT impl-backend 94%/impl-frontend 85%/reviewer 88% · prose-role→N/A KHÔNG 0%) + judge-SCAFFOLD-only (honest: số chưa-nghĩa tới khi age-mature+independent-judge) + budget:mfe config + eval/mfe/ seed-12-stable-id + engine §H + artifact-row + C3-comment + wire session-start §2.1.6/session-end §L.b(c) opt-in + agents/README S93 + adap-report ×2 + email AI_INFRA hash `da768330`. **AS-10 2nd-fire dogfood:** WF1 3-agent (return-only) residual agent-memory caught+reverted (E-006 recurrence, guard HELD); WF2 explicit-return-only-prompt → 0 residual (instruction-fix). **#53 recover-from-disk** (WF1 sub return-rỗng nhưng ghi diary trước). user-MEMORY compact 23.7→7.8KB (hook). **Lessons:** cardinality-change-grep-all-consumer · vocab-collision-check-on-adopt (2-workflow review bắt, 1-workflow trượt) · AS-10-instruction-fix (prompt override frontmatter + git-diff net) · MFE đóng-vòng detector-D1-OOM-đầu-phiên. **State THẬT: Mig 59 · 88 bảng · 434 test (45D+389I) · gotcha 76 · menu 54 · bundle admin `CDn40vpV`/user `CoPmPBg7` · prod 17 user/7 NCC.** **🔴 NEXT anh:** restart CLI (MFE opt-in + wire session-start/end + agents/README no hot-reload) · UAT eoffice node Dự án hiện mã. **NEXT em:** monthly **2026-07-01 (2 ngày) GẤP** re-tier STATUS/HANDOFF mega-line (detector D1 **OOM do bloat** = tooling vỡ, STATUS line 61K-char/HANDOFF 46K-char KHÔNG Read/Edit) + ef-core SKILL Mig→59 + docs/CLAUDE Budget-removed + 3 vocab-fork alias-map + curate test-specialist/FD L1 WATCH. **Pending product:** Section B cột Dự-án wire · Ngưỡng giá CEO Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. → log `2026-06-29-S93-pe-projectcode-harness16-mfe.md`) · *(session ≤S90 đã tách → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` + `docs/changelog/sessions/`; re-tier S94)* +**Last updated:** 2026-07-01 (S97 — **PE finalize 2-fix UAT anh Kiệt FDC — em-main-led HMW-workflow (implement+review), FE-only prod-verified Run #481.** **(1)** badge cấp-sau-finalize `"không trình tới"`→**`"Kết thúc tại {finalizeLevelName}"`** (render-động → hiện "Kết thúc tại CCM"; fallback finalizeStepName/'cấp trên') + tooltip template-literal. **(2)** đảo default checkbox "Cấp này KẾT THÚC quy trình" **opt-out→opt-in** (`useState(true→false)` init + reset onSuccess + helper text reword + comment S96-"default checked"-drift fix) — mặc định TRÌNH TIẾP CEO, tick mới KẾT THÚC tại cấp. **FE-only mirror 2-app SHA-identical `PeWorkflowPanel.tsx` (`bcf812fd`), 0 BE/mig/test** (BE service `if(AllowApproverFinalize && applyLevelFinalize)` tôn trọng cờ FE; param default `true` giữ làm fallback caller non-FE, FE luôn POST tường minh). Workflow `wf_0e01fdba-209`: implementer-frontend (8 hunk 4×2, build×2 PASS) → reviewer (PASS 0-issue; verify comment-L121+handler-L664 giữ, logic non-break). Commit `1c8fb6a`. **cicd Run #481 PASS ~5m10s byte-level #77:** JS rotate admin `COYAX-yQ`→**`Cf0o8dx8`**/user `0MU-kb4N`→**`x8rppRAK`** (CSS frozen `Bbtesa6B`/`BmuPz_Dy` #69-REFINE logic-only; real-size 1.64/1.54MB anti-SPA-trap) · **NEW `Kết thúc tại`+helper `Mặc định…TRÌNH TIẾP` PRESENT / OLD `không trình tới`+`Đã BỎ tick` ABSENT** (fix shipped byte-level → UI-cũ=cache→incognito, KHÔNG deploy-fail) · Mig 59/88-table frozen · smoke api+admin+eoffice 200×3 + PE-list 200 items[]-valid. **Lessons:** #53 return-garble **tái-diễn lần-4** (cicd trả prose-curate-memory "18.7KB above target" thay verdict dù instruction "return-verdict" → **recover-from-diary S97-#481-entry KHÔNG re-spawn** per `feedback_agent_return_garble_recover`; instruction-fix giảm-không-100%) · BE-honors-explicit-flag → đảo-default chỉ sửa FE `useState` (BE param=fallback, FE luôn POST tường minh) = zero BE/test-churn zero-prod-risk · comment-drift cleanup trước commit. impl MEMORY compaction giữa-spawn (23.8→11.5KB, archive S76-79→`2026-H1.md` verify no-loss). **State GIỮ: Mig 59 · 88 bảng · 440 test · gotcha 77 · menu 54 · bundle admin `Cf0o8dx8`/user `x8rppRAK` (Run #481) · prod 21 NCC/17 user.** **🔴 NEXT anh:** UAT **incognito** phiếu "8 MEP Sub Hệ thống solar" xác nhận badge "Kết thúc tại CCM" + checkbox default-unchecked (+ vụ cũ "lỗi phân quyền vào phiếu": cho số-phiếu+user). **NEXT em:** monthly re-tier mega-line pending (giờ 5-blurb). → log `2026-07-01-S97-pe-finalize-wording-default-flip.md`) · **Prev S96** (S96 — **buổi UAT LỚN anh Kiệt/chị Trà/anh Chương live + monthly-audit — 5 commit prod-verified, em-main-led (HMW-mode ON; 1 prep-workflow monthly-audit + spawn-lẻ, chủ-yếu solo).** **(1) Monthly drift audit `881783c`** (docs-only CI-skip): ef-core SKILL Mig→59 + bảng rows 57/58/59 + Mig 14/Phase-7 Budget-DROPPED annotate · skills/README Mig 55→59 + gotcha #69→76 · docs/CLAUDE Budget REMOVED Mig 50 strike-through · **`docs/governance/vocab-alias-map.md` MỚI** (3 fork run-trace/Ngân-sách-PRO/all-inherit + `$ExcludeExact` anti-self-match) · **re-tier STATUS/HANDOFF mega-line 5→3 blurb** (S92/S91→archive, conservation delta=0 BOM-preserved) + hoist 3 UAT-carry→blockers · **FD memory distill** (H17 strike-1 CLEARED: L1 26129→21492B, 5 war-story→archive/`_INDEX`/gist, Lessons value-protect lên L1). Workflow `wf_2d687d27` 4-cluster draft→verify (reviewer bắt #74-paraphrase-drift + AS-10 residual reverted). detector 27→25. **(2) Import NCC DONGDUONG `ba4b8e0`** (Excel anh Kiệt "Database NCC" 4 NCC/30-field): 3 NCC đã seed sẵn (TRUONGGIANG/TANPHU/TGN) → chỉ +DONGDUONG vào SeedRealMasterDataAsync (ungated idempotent, pack extras→Note, no-mig); prod 20→21 NCC (Run #477). Backlog 15-18 field "note-lại-từ-từ-tính"→Next-up. **(3-5) 3 PE bug-fix UAT:** `e657faa` ô "Cấp này KẾT THÚC quy trình" (AllowApproverFinalize S89-auto) → **opt-out bỏ-tick-được** (2-tier: Designer=cấp-quyền / phiếu=chọn kết-thúc-hay-trình-CEO; +param `applyLevelFinalize` default-true BE + FE 2-app, Run #478) · `36cbf8b` **chuông tự sạch** noti "cần duyệt" cũ khi phiếu rời cấp (LogTransitionAsync mark-read Generic+RefId ExecuteUpdate BE-only, Run #479) · `0c2f9f6` **khóa sửa giá đề xuất PRO/CCM sau gửi-duyệt** ("duyệt là fix" — Mig 54 "KHÔNG-ràng-Phase" ĐẢO → non-admin chỉ sửa Nháp/TraLai + Admin-override; BE+FE 2-app+4 test, Run #480). Test 434→440. **Delete-sau-duyệt = ĐÃ chặn sẵn** (FE nút Xóa chỉ DangSoanThao + BE guard, không cần sửa). Checkbox "ko-được" = **browser-cache** (verify byte-level: prod bundle `0MU-kb4N` CHỨA fix + "✅-static" cũ đã mất; index.html no-cache đúng-chuẩn + no-service-worker) → **incognito = golden-test**. **State: Mig 59 · 88 bảng · 440 test (45D+395I) · gotcha 77 · menu 54 · bundle admin `COYAX-yQ`/user `0MU-kb4N` (Run #480) · prod 21 NCC/17 user.** **Lessons:** verify-deployed-artifact-byte-level (cache≠deploy; incognito golden — gotcha #77) · #53-return-garble tái-diễn ×3 (investigator + cicd×2 trả text-memory-curation thay verdict → recover từ agent-memory; instruction-fix "return-verdict" ăn lần-3) · 2-tier-permission (grant-vs-exercise) · spec-change→update-test-cũ (SeedPeAsync ChoDuyet→DangSoanThao). **🔴 NEXT anh:** UAT incognito checkbox + cho **số-phiếu/user** vụ "lỗi phân quyền vào phiếu" để em soi config-workflow. **NEXT em:** cicd-monitor S-tag-drift S97/S98→S96 reconcile (closeout này) · monthly re-tier mega-line (giờ 4-blurb S96/S95/S94/S93). → log `2026-07-01-S96-uat-pe-fixes-monthly-audit.md`) · **Prev S95** (S95 — **Harness-17 adopt (Vòng tự-cải-thiện bộ-nhớ Đo→Tinh-chỉnh→Kiểm) — governance-only 0 prod code, em-main-led + 3-workflow fan-out (HMW-mode ON).** `/check-email AI_INFRA` (0 directed mới; H16 đã áp trọn S93) → `/adap-apply` H17 (2 broadcast hash-MATCH · `reviewer_gate:PASS`). **10/10 mục 🔴 sàn ĐẠT:** REUSE-cite A2=§H MFE/C3=D9/CG-2=value_protect/archive=§A; **build mới** `scripts/memory-selfimprove-audit.ps1` (C1 spec-audit NO-API exit-0, **runtime-verified bắt frontend-designer over-cap GAP thật**) + `.claude/governance/reinject-ledger.md` (B2 CG-1 N=3, tách khỏi budget.json) + engine **§I** codify + `session-start §2.1.7`/`session-end §L.b(c)` wire + HCV alias no-seed (coverage 3-nghĩa, detector vẫn 27). **3-workflow (run-id bằng-chứng):** WF1 `wf_f085d7c4-d78` ground-truth + WF2 `wf_8e73c1d6-ee6` 3-lane review PASS 0-blocking + WF3 `wf_6f44eddf-680` deep-reverify (**fault-injection 13-inject chứng-răng-thật** + integration + cross-doc, 0 application-defect). **2 commit:** `18a17f5` (adopt — cicd **Run #476 PASS** prod 200×3, bundle rotate admin `0T6vVJST`/user `BGXEVZO6`, Mig 59 unchanged) + `65b434a` (deep-reverify docs-only CI-skip). **adap-report + 2 email AI_INFRA** (hash `54789e19` adopt + `8c94fa34` deep-reverify-update). **Dogfood C3 4-fire:** AS-10 WF1+WF3 self-write reverted (git-diff net = backstop THẬT; **instruction-fix NOT 100%** — WF3 explicit-return-only STILL self-wrote → E-006 recurrence S95, guard HELD 4/4, 0 escape; cicd-monitor diary KEPT = normal-spawn legit). **Lessons:** fault-injection-via-`-RepoRoot`-temp chứng checker-teeth (không chỉ happy-path PASS) · Lane B #53 empty-return → em-main self-gate recover · workflow-agent persona-write stochastic → git-diff mandatory. **State GIỮ NGUYÊN: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · prod 17 user/7 NCC.** **NEXT em:** frontend-designer distill (WATCH strike-1 = H17 loop's live finding) · monthly re-tier mega-line + ef-core SKILL Mig→59 + 3 vocab-fork (2026-07-01 due). → log `2026-07-01-S95-harness17-adopt.md`) · **Prev S94** (S94 — **(1) anh-directive nâng cap lead 220K→380K** (`memory-budget.json` canonical · SE-override lead KHÔNG còn AI_INFRA-parity, subs giữ 60K/50K · mark H-15 **v4-delta** `RC-pqhuy1987-29-06-2026-23-25-50` · flush 3 derived echo ACTIVE-MARKS/session-start §2.1.6/engine §G adopt-delta · MFE verified live-read 380K). **(2) re-tier 2 mega-line** (fix Read-25K/call OOM + token-cost ~169K/220K): STATUS 389→89 dòng (mega-line 59.6K→7.1K char) · HANDOFF 732→12 dòng · live 332KB→**34KB (−90%)** · session ≤S90 → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` **0 byte-loss** (new+archive=orig+995B pointer) · backup git+scratchpad · detector 27=baseline 0-broken-pointer · conservation spot-check PASS. **(3) MFE eval-all baseline** (đầu phiên): LEAD coverage-FIT 29-item/**380K=0.92%** · age-band 0-cut · Goodhart strikes-21/RCA-9 flat=no-lie · SUB per-role ≥85% (cicd/test-spec/FD 100% · impl-backend 94% · impl-frontend 85% · 3 prose-role N/A) · judge-scaffold-only honest. **(4) nạp full Phase-1 read-set** (budget 380K cho phép): +PROJECT-MAP +workflow-contract +migration-todos. **commit `5f61b03` pushed** docs-only CI-skip. **Lesson:** trần budget ⟂ harness **Read-25K/call** = 2 khóa ĐỘC-LẬP — cap-raise KHÔNG unblock mega-line Read (cần re-tier); **mega-LINE = tooling-breaker** (ưu-tiên) vs **mega-FILE nhiều-dòng = chỉ token-cost**; re-tier = **archive-không-cắt + assert head+tail==orig 0-loss**. em-main solo (governance single-writer, 0 sub, 0 fan-out). **State GIỮ NGUYÊN: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · bundle admin `CDn40vpV`/user `CoPmPBg7` · prod 17 user/7 NCC.** → log `2026-06-29-S94-cap-380k-retier-megaline.md`) · **Prev S93** (S93 — **(1) PE cây Duyệt NCC node Dự án hiện MÃ dự án thay tên dài (anh Kiệt FDC) prod-verified Run #473** `8ee8f3e`: BE thread ProjectCode (DTO + 3 projection List/Inbox/ListApproved + search) + FE 2-app SHA-mirror (render `projectCode||projectName`+tooltip+sort) NO-MIG; grep bắt construction-site#3 thoát replace_all (cardinality-grep-all-consumer); build 3× + test 434; bundle admin `xz8FdmLN`→`CDn40vpV`/user `CA8Rla2w`→`CoPmPBg7`. **(2) adopt Harness-16 MFE (memory-fidelity-EVAL) 2-workflow PASS, 0 production code** `9580098`: WF1 `wf_4c63e1bd` (ground-truth + bắt BLOCKING vocab-fork: memory-fidelity = H6.7 memoryDelta-routing ≠ H16 coverage-eval → đặt MFE + alias-map §H KHÔNG seed $aliasSets) + WF2 `wf_13e3d35a` 3-lane PASS (code-gate denom-29-re-derived to-the-digit + READ-ONLY-budget proof 1-write-op + honesty 5-floor + leading-verb-trap adversarial-probed-DEFEATED); `scripts/mfe-eval.ps1` deterministic NO-API ASCII#30 (LEAD coverage-FIT 29-item/220K=1.5% + age-band-flag-not-cut + Goodhart strikes-21/RCA-9 · SUB per-role ĐO-THẬT impl-backend 94%/impl-frontend 85%/reviewer 88% · prose-role→N/A KHÔNG 0%) + judge-SCAFFOLD-only (honest: số chưa-nghĩa tới khi age-mature+independent-judge) + budget:mfe config + eval/mfe/ seed-12-stable-id + engine §H + artifact-row + C3-comment + wire session-start §2.1.6/session-end §L.b(c) opt-in + agents/README S93 + adap-report ×2 + email AI_INFRA hash `da768330`. **AS-10 2nd-fire dogfood:** WF1 3-agent (return-only) residual agent-memory caught+reverted (E-006 recurrence, guard HELD); WF2 explicit-return-only-prompt → 0 residual (instruction-fix). **#53 recover-from-disk** (WF1 sub return-rỗng nhưng ghi diary trước). user-MEMORY compact 23.7→7.8KB (hook). **Lessons:** cardinality-change-grep-all-consumer · vocab-collision-check-on-adopt (2-workflow review bắt, 1-workflow trượt) · AS-10-instruction-fix (prompt override frontmatter + git-diff net) · MFE đóng-vòng detector-D1-OOM-đầu-phiên. **State THẬT: Mig 59 · 88 bảng · 434 test (45D+389I) · gotcha 76 · menu 54 · bundle admin `CDn40vpV`/user `CoPmPBg7` · prod 17 user/7 NCC.** **🔴 NEXT anh:** restart CLI (MFE opt-in + wire session-start/end + agents/README no hot-reload) · UAT eoffice node Dự án hiện mã. **NEXT em:** monthly **2026-07-01 (2 ngày) GẤP** re-tier STATUS/HANDOFF mega-line (detector D1 **OOM do bloat** = tooling vỡ, STATUS line 61K-char/HANDOFF 46K-char KHÔNG Read/Edit) + ef-core SKILL Mig→59 + docs/CLAUDE Budget-removed + 3 vocab-fork alias-map + curate test-specialist/FD L1 WATCH. **Pending product:** Section B cột Dự-án wire · Ngưỡng giá CEO Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. → log `2026-06-29-S93-pe-projectcode-harness16-mfe.md`) · *(session ≤S90 đã tách → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` + `docs/changelog/sessions/`; re-tier S94)* --- @@ -24,19 +24,18 @@ | 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 | **2429** | re-verify S80 (`list_projects` — alive, +6 vs S63's 2423). 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 **`COYAX-yQ`** · user **`0MU-kb4N`** (S96 — **Run #480** `0c2f9f6` price-lock; chuỗi 3 PE deploy #478 `e657faa` checkbox-opt-out → #479 `36cbf8b` chuông-stale-clear (BE-only) → #480 `0c2f9f6` khóa-giá-sau-duyệt, cicd PASS each ~5m; **FE JS rotate THẬT** (PeWorkflowPanel #478 + PeDetailTabs #480, 2-app) real-size 1.64/1.54MB vs 919b SPA-trap, CSS frozen #69-REFINE; Mig 59 frozen 0-mig; +Run #477 `ba4b8e0` NCC seed no-mig prod 21 NCC. **Verify byte-level:** prod `0MU-kb4N` CHỨA checkbox-fix ("BỎ tick"/"Đã BỎ tick") + "✅-static" cũ MẤT → checkbox "ko-được" = browser-cache KHÔNG deploy-fail). **Prev S95** — admin **`0T6vVJST`** · user **`BGXEVZO6`** (S95 — **Run #476** `18a17f5` H17 governance-only deploy; bundle rotate benign #69 CSS-frozen, prod 200×3, Mig 59 unchanged; cicd re-snapshot LIVE — pre-deploy `CkZ1MjC1`/`_-gpX7_Y`, mega-line S93 `CDn40vpV`/`CoPmPBg7` đã bị deploy trung-gian rotate từ S94). **Prev S85** — admin **`aKuNip19`** · user **`BUsL0HeQ`** (S85 — **Run #341** `49ac086` lệch-giờ TZ serialize UTC-with-Z; FE frozen #339+#341 BE-only. Chuỗi ~10 deploy #334→#341 buổi UAT anh Kiệt CV PRO: #334 `5a61254` batch CV PRO 6-fix → #335-#338 6 vòng UAT → #339 `1263c0d` workflow-preserve bug-class S42 → #341 `49ac086` TZ; #342 `d4f6021` docs+cicd BE-frozen, bundle giữ-nguyên gotcha #69-REFINE). **Prev S78** — admin **`CsJetgZH`** · user **`BVS0ApIm`** (S78 — **Run #330** `7886fd0` PE attach-file khi duyệt; bundle ROTATE từ S77 `BqKD3Y23`/`Cn-i349D` dù NO migration enum-only — gotcha #69 non-determ rebuild; cicd ship-proof byte-stable + fake-hash control). **Prev S77** — admin **`BqKD3Y23`** · user **`Cn-i349D`** (S77 — **Run #329** `e823694` banner Trả-lại; cuối chuỗi 10 deploy #320→#329 cùng ngày, cicd PASS each: #320 pill `DsSg6RRz`-era → #321 focus → #322 revert → #323 Mig57+notes `CPm4LTqm`/`BWJUAqEI` → #324 số-âm-đỏ `C6fx-0ea`/`N3sW4Div` → #325 indent `BhnNMucS`/`B1VebpXc` → #326 cờ-gấp-asymmetric `DwXqn37C`/`COXMCv7E` → #327 decouple `B0gboSAg`/`DbDg7pM-` → #328 notify (BE-only, FE frozen) → #329 banner **`BqKD3Y23`**/**`Cn-i349D`**). **Prev S76** — admin **`jOqxW4-p`** · user **`DbsznVvR`** (S76 — **Run #319** `21d1f4e` bảng lưới `
` ngân sách viền-ô; chuỗi S76 cùng ngày: #318 `e33481e` feature ma-trận-3-cột + badge quyền-NS `BhFDF9IJ`/`BAkuRl3C` → #319 **`jOqxW4-p`**/**`DbsznVvR`**, cicd PASS each, smoke 3×200, Mig 56 applied prod #318). **Prev S74** — admin **`BYF5vIMJ`** · user **`CB-tiRxd`** (S74 — **Run #315** `8655ebf` Mig 55 CcmNote, cicd PASS ~4m54s: Mig 55 applied prod CcmNote nvarchar(1000) nullable · sys.tables 88 · smoke 4×200 · 0 regression). **Prev S73** — admin **`Bv3jUCNo`** · user **`BWlMBQz6`** (Run #314 `6aa4dcb` FE empty-candidates guard fix; chuỗi 2 deploy: #313 `1d86abc` feature `OlNyG9OD`/`DSzSLVtL` → #314 **`Bv3jUCNo`**/**`BWlMBQz6`**, cicd PASS each). **Prev S72** — admin **`fc_xkNpJ`** · user **`DP-tBcg0`** (Run #312 governance commit `18fced6`; bundle ROTATE do **non-deterministic hash + deploy rebuild-FE-unconditional** (gotcha #69) — 0 FE source change, prod state/DB GIỮ NGUYÊN). **Prev S69** — admin **`BgNCjwsG`** · user **`CBvh0vtf`** (Run #308 PE cờ gấp + ngưỡng CCM; chuỗi 4 deploy session: #305 Văn phòng số foundation → #306 re-skin 10 page → #307 Office golive (BE-only) `Wt54PHYl`/`B99fMU6X` → #308 **`BgNCjwsG`**/**`CBvh0vtf`**). **Prev S68** — admin **`CNUv1jxY`** · user **`CpOskeS1`** (S68 — Run #304 `37752eb` fix tên đen→trắng; chuỗi #303 `6983609` `D532XZKG`/`CuFaBoWt` → #304 **`CNUv1jxY`**/**`CpOskeS1`**, cicd PASS each). **Prev S67** — admin `CcrZqfht`/user `DniDFUB_` (S67 — 6 deploy Run #297→#302; admin rotate chuỗi #298`xkSz9BfE`→#300`PxiZQkaw`→#301`I1fpLeYw`→#302**`CcrZqfht`** · user #297`BumgrwCJ`→#300`B36hGoKd`→#301`DrQYkzh0`→#302**`DniDFUB_`**; #299 tests BE-only cả 2 frozen, cicd PASS each). **Prev S65** — admin `BDwV5d0X`/user `DbVv6rsf` (Run #293-295). Prev S62 admin `0xKYGhhf`/user `C81ZdG9G` (Run #286). **Prev S59:** admin `B1DtNT9C` · user `D6uF3Mln` (Run **#282** `792c030` FINAL — bỏ nút Thêm hạng mục; ships kèm `80b64dd` gỡ Điều khoản TT, #281 cancelled-benign ancestor-verified). Chuỗi S59 cùng ngày: #280 `69997da` (`BKy_8OO9`/`XcZ6PRyA`, ships kèm `f21c55d` table-fixed #279-cancelled) · #278 `9c330d2` self-approve+quick-add-NCC (`BSh2fG2X`/`D22KfpPc`, authz probe 4/4) · #277 `faed59f` SearchableSelect (`ex7Tc92G`/`DzUeSk96`) · #276 `c869d26` rename 71 PMH (`BBA0KSWu`/`DzdTI18G`) · #275 `bbd1554` dọn demo WorkItems (FROZEN BE-only) · #274 `0eafcd3` tree 4 tầng (`DuU7OTym`/`DWyeTzf3`) · #273 `56882ac` wipe + tree v1 (`R9uGRxvw`/`DikfX1RD`). Prev S58: Run #386 `3ebaf84` admin `DMm9rtNA`/user `BUkOMn_Y` (chi tiết session log S58). +**Bundle hash live (prod):** admin **`Cf0o8dx8`** · user **`x8rppRAK`** (S97 — **Run #481** `1c8fb6a` PE finalize 2-fix [badge "không trình tới"→"Kết thúc tại {cấp}" + đảo default checkbox opt-in]; JS rotate real-FE 2-app `PeWorkflowPanel` diff, CSS frozen `Bbtesa6B`/`BmuPz_Dy` #69-REFINE logic-only; **byte-level #77** NEW `Kết thúc tại`+helper PRESENT / OLD `không trình tới`+`Đã BỎ tick` ABSENT; real-size 1.64/1.54MB; Mig 59/88-table frozen; smoke 200×3. FE-only mirror SHA `bcf812fd`, 0 BE/mig/test). **Prev S96** — admin **`COYAX-yQ`** · user **`0MU-kb4N`** (S96 — **Run #480** `0c2f9f6` price-lock; chuỗi 3 PE deploy #478 `e657faa` checkbox-opt-out → #479 `36cbf8b` chuông-stale-clear (BE-only) → #480 `0c2f9f6` khóa-giá-sau-duyệt, cicd PASS each ~5m; **FE JS rotate THẬT** (PeWorkflowPanel #478 + PeDetailTabs #480, 2-app) real-size 1.64/1.54MB vs 919b SPA-trap, CSS frozen #69-REFINE; Mig 59 frozen 0-mig; +Run #477 `ba4b8e0` NCC seed no-mig prod 21 NCC. **Verify byte-level:** prod `0MU-kb4N` CHỨA checkbox-fix ("BỎ tick"/"Đã BỎ tick") + "✅-static" cũ MẤT → checkbox "ko-được" = browser-cache KHÔNG deploy-fail). **Prev S95** — admin **`0T6vVJST`** · user **`BGXEVZO6`** (S95 — **Run #476** `18a17f5` H17 governance-only deploy; bundle rotate benign #69 CSS-frozen, prod 200×3, Mig 59 unchanged; cicd re-snapshot LIVE — pre-deploy `CkZ1MjC1`/`_-gpX7_Y`, mega-line S93 `CDn40vpV`/`CoPmPBg7` đã bị deploy trung-gian rotate từ S94). **Prev S85** — admin **`aKuNip19`** · user **`BUsL0HeQ`** (S85 — **Run #341** `49ac086` lệch-giờ TZ serialize UTC-with-Z; FE frozen #339+#341 BE-only. Chuỗi ~10 deploy #334→#341 buổi UAT anh Kiệt CV PRO: #334 `5a61254` batch CV PRO 6-fix → #335-#338 6 vòng UAT → #339 `1263c0d` workflow-preserve bug-class S42 → #341 `49ac086` TZ; #342 `d4f6021` docs+cicd BE-frozen, bundle giữ-nguyên gotcha #69-REFINE). **Prev S78** — admin **`CsJetgZH`** · user **`BVS0ApIm`** (S78 — **Run #330** `7886fd0` PE attach-file khi duyệt; bundle ROTATE từ S77 `BqKD3Y23`/`Cn-i349D` dù NO migration enum-only — gotcha #69 non-determ rebuild; cicd ship-proof byte-stable + fake-hash control). **Prev S77** — admin **`BqKD3Y23`** · user **`Cn-i349D`** (S77 — **Run #329** `e823694` banner Trả-lại; cuối chuỗi 10 deploy #320→#329 cùng ngày, cicd PASS each: #320 pill `DsSg6RRz`-era → #321 focus → #322 revert → #323 Mig57+notes `CPm4LTqm`/`BWJUAqEI` → #324 số-âm-đỏ `C6fx-0ea`/`N3sW4Div` → #325 indent `BhnNMucS`/`B1VebpXc` → #326 cờ-gấp-asymmetric `DwXqn37C`/`COXMCv7E` → #327 decouple `B0gboSAg`/`DbDg7pM-` → #328 notify (BE-only, FE frozen) → #329 banner **`BqKD3Y23`**/**`Cn-i349D`**). **Prev S76** — admin **`jOqxW4-p`** · user **`DbsznVvR`** (S76 — **Run #319** `21d1f4e` bảng lưới `
` ngân sách viền-ô; chuỗi S76 cùng ngày: #318 `e33481e` feature ma-trận-3-cột + badge quyền-NS `BhFDF9IJ`/`BAkuRl3C` → #319 **`jOqxW4-p`**/**`DbsznVvR`**, cicd PASS each, smoke 3×200, Mig 56 applied prod #318). **Prev S74** — admin **`BYF5vIMJ`** · user **`CB-tiRxd`** (S74 — **Run #315** `8655ebf` Mig 55 CcmNote, cicd PASS ~4m54s: Mig 55 applied prod CcmNote nvarchar(1000) nullable · sys.tables 88 · smoke 4×200 · 0 regression). **Prev S73** — admin **`Bv3jUCNo`** · user **`BWlMBQz6`** (Run #314 `6aa4dcb` FE empty-candidates guard fix; chuỗi 2 deploy: #313 `1d86abc` feature `OlNyG9OD`/`DSzSLVtL` → #314 **`Bv3jUCNo`**/**`BWlMBQz6`**, cicd PASS each). **Prev S72** — admin **`fc_xkNpJ`** · user **`DP-tBcg0`** (Run #312 governance commit `18fced6`; bundle ROTATE do **non-deterministic hash + deploy rebuild-FE-unconditional** (gotcha #69) — 0 FE source change, prod state/DB GIỮ NGUYÊN). **Prev S69** — admin **`BgNCjwsG`** · user **`CBvh0vtf`** (Run #308 PE cờ gấp + ngưỡng CCM; chuỗi 4 deploy session: #305 Văn phòng số foundation → #306 re-skin 10 page → #307 Office golive (BE-only) `Wt54PHYl`/`B99fMU6X` → #308 **`BgNCjwsG`**/**`CBvh0vtf`**). **Prev S68** — admin **`CNUv1jxY`** · user **`CpOskeS1`** (S68 — Run #304 `37752eb` fix tên đen→trắng; chuỗi #303 `6983609` `D532XZKG`/`CuFaBoWt` → #304 **`CNUv1jxY`**/**`CpOskeS1`**, cicd PASS each). **Prev S67** — admin `CcrZqfht`/user `DniDFUB_` (S67 — 6 deploy Run #297→#302; admin rotate chuỗi #298`xkSz9BfE`→#300`PxiZQkaw`→#301`I1fpLeYw`→#302**`CcrZqfht`** · user #297`BumgrwCJ`→#300`B36hGoKd`→#301`DrQYkzh0`→#302**`DniDFUB_`**; #299 tests BE-only cả 2 frozen, cicd PASS each). **Prev S65** — admin `BDwV5d0X`/user `DbVv6rsf` (Run #293-295). Prev S62 admin `0xKYGhhf`/user `C81ZdG9G` (Run #286). **Prev S59:** admin `B1DtNT9C` · user `D6uF3Mln` (Run **#282** `792c030` FINAL — bỏ nút Thêm hạng mục; ships kèm `80b64dd` gỡ Điều khoản TT, #281 cancelled-benign ancestor-verified). Chuỗi S59 cùng ngày: #280 `69997da` (`BKy_8OO9`/`XcZ6PRyA`, ships kèm `f21c55d` table-fixed #279-cancelled) · #278 `9c330d2` self-approve+quick-add-NCC (`BSh2fG2X`/`D22KfpPc`, authz probe 4/4) · #277 `faed59f` SearchableSelect (`ex7Tc92G`/`DzUeSk96`) · #276 `c869d26` rename 71 PMH (`BBA0KSWu`/`DzdTI18G`) · #275 `bbd1554` dọn demo WorkItems (FROZEN BE-only) · #274 `0eafcd3` tree 4 tầng (`DuU7OTym`/`DWyeTzf3`) · #273 `56882ac` wipe + tree v1 (`R9uGRxvw`/`DikfX1RD`). Prev S58: Run #386 `3ebaf84` admin `DMm9rtNA`/user `BUkOMn_Y` (chi tiết session log S58). **Phase:** ✅ Phase 10 COMPLETE · ✅ **Phase 11 product backlog ĐÓNG TRỌN** · ✅ **Văn phòng số (E-Office) golive S69** (foundation PURO + re-skin 10 page + public read+create 16-key allow-list mọi role) prod-verified · ✅ **PE cờ gấp PRO/CCM + CCM duyệt-final theo ngưỡng (Mig 53 S69)** prod-verified · ✅ **PE ngân sách MA TRẬN 3 cột Dự án/PRO/CCM (bảng lưới `
`) + badge quyền-NS theo role trong Workflow Designer & flow Duyệt NCC (Mig 56 S76)** prod-verified · ✅ **PE UX batch S77 (10 deploy)** — cờ GẤP pill mọi danh sách+inbox · focus/inline+overlay decouple+"Xem mở rộng" · ô ghi chú giá đề xuất PRO/CCM (Mig 57) · số phân cách + số-âm-đỏ-ngoặc + indent mục con · cờ gấp GẮN=NV/GỠ=Trưởng phòng · chuông báo người duyệt · banner Trả-lại — prod-verified · ✅ **PE đính kèm file khi DUYỆT (S78, Run #330)** — người duyệt tải file lên lúc duyệt thay vì Trả lại; migration-free reuse-enum `ApprovalAttachment=5` — prod-verified · 🚫 Phase 9 Ops blocked (anh main coordinate — anh dừng). > ⚠️ **Count drift fixed S40:** endpoints ~223→**211**, FE pages 53→**65**, menu keys 85→**~53**. Tables **84 confirmed correct** (DbSet 77 + Identity 7). 3 số "khó fake" (mig/gotcha/git) luôn đúng. Cause: số "incremented mỗi session" over/under-count optimistic — re-ground định kỳ. --- -## 🔥 In Progress (S96) +## 🔥 In Progress (S97) | Task | Owner | Status | |---|---|---| -| **S96 — monthly audit + NCC import DONGDUONG + 3 PE bug-fix UAT anh Kiệt** — ✅ DONE, 5 commit pushed+deployed+verified (`881783c`/`ba4b8e0`/`e657faa`/`36cbf8b`/`0c2f9f6`); chi-tiết mega-line đầu file + log `2026-07-01-S96-*` | 👤 em main | ✅ done (S96 closeout) | -| **Frontend-designer distill** (H17 strike-1) — ✅ DONE S96 (`881783c`: L1 26129→21492B + archive/`_INDEX`/gist + Lessons value-protect L1) | 👤 em main | ✅ done | +| **S97 — PE finalize 2-fix UAT anh Kiệt** (badge "không trình tới"→"Kết thúc tại CCM" + đảo default checkbox finalize opt-out→opt-in) — ✅ DONE, commit `1c8fb6a` deployed **Run #481** byte-verified (#77); chi-tiết mega-line + log `2026-07-01-S97-*` | 👤 em main (HMW workflow `wf_0e01fdba`) | ✅ done (S97 closeout) | | **PE "lỗi phân quyền vào phiếu"** (anh Kiệt UAT báo) — chờ **số-phiếu + user** để soi config workflow (nhiều khả năng user chưa được gán approver Cấp phiếu đang chờ — config, không phải code-bug) | 👤 em main | ⚪ pending (chờ anh specifics) | --- diff --git a/docs/changelog/sessions/2026-07-01-S97-pe-finalize-wording-default-flip.md b/docs/changelog/sessions/2026-07-01-S97-pe-finalize-wording-default-flip.md new file mode 100644 index 0000000..3e1ff18 --- /dev/null +++ b/docs/changelog/sessions/2026-07-01-S97-pe-finalize-wording-default-flip.md @@ -0,0 +1,51 @@ +# S97 — PE finalize: đổi chữ "không trình tới" + đảo default checkbox (2026-07-01) + +> UAT anh Kiệt FDC (tiếp buổi live S96). 2 fix nối tiếp tính năng "Cấp KẾT THÚC quy trình" (S96 `e657faa`). **em-main-led + HMW-workflow** (implement + review). FE-only, prod-verified **Run #481**. + +## Bối cảnh +Anh Kiệt gửi 2 ảnh chat Zalo về phiếu "8 MEP Sub Hệ thống solar": +1. Badge trên sơ đồ duyệt ghi "không trình tới" — sai ngữ cảnh khi phiếu lên CEO. Chốt (Huy đề xuất → Kiệt "Yeb"): đổi thành **"Kết thúc tại CCM"**. +2. Checkbox "Cấp này KẾT THÚC quy trình" đang default = tick (opt-out, S96). Anh Kiệt: *"option mặc định là không chọn; khi nào chọn mới không đẩy lên"* → đảo thành **opt-in**. + +## Thay đổi +FILE (mirror 2 app, SHA-identical): `fe-{admin,user}/src/components/pe/PeWorkflowPanel.tsx` + +**Fix 1 — badge wording (dòng ~329-331):** +- text `"không trình tới"` → `Kết thúc tại {evaluation.finalizeLevelName ?? evaluation.finalizeStepName ?? 'cấp trên'}` (render động → "Kết thúc tại CCM" cho workflow của họ) +- tooltip title → template-literal tương ứng (`… kết thúc tại ${finalizeLevelName …} … không cần trình tới`) +- `finalizeLevelName`/`finalizeStepName` đã có sẵn trong scope (banner dòng ~280) — no new prop/DTO + +**Fix 2 — đảo default checkbox opt-out→opt-in:** +- `const [applyLevelFinalize] = useState(true)` → `useState(false)` (dòng 57) +- reset onSuccess `setApplyLevelFinalize(true)` → `(false)` (dòng 221) +- helper text ternary reword (default = "TRÌNH TIẾP lên CEO", tick = "KẾT THÚC tại cấp này") +- comment S96 "default checked" → "OPT-IN" (drift cleanup, em-main — landmine) +- Logic gửi BE (dòng 200 `approverFinalizeEligible ? applyLevelFinalize : true`) + price-picker gate (dòng 496) tự đúng theo state mới — no change + +**KHÔNG đụng:** BE (service dòng 867 `if (matchingLevel.AllowApproverFinalize && applyLevelFinalize)` **tôn trọng cờ FE gửi lên**) · migration · test · file FE khác. BE param default `applyLevelFinalize=true` **giữ nguyên** (fallback caller non-FE; FE luôn POST giá trị tường minh) → zero test-churn, zero prod-risk. + +## Quy trình (HMW-mode ON — anh consent "ultra-on hmw") +Workflow `wf_0e01fdba-209` (implement → review pipeline): +- 🟧 **implementer-frontend**: 8 hunk (4×2 app), SHA256 identical `bcf812fd`, build admin PASS 22s + user PASS 8s, 0 TS err. Ghi chú: MEMORY.md hit PostToolUse-hook compaction giữa-spawn (23.8→11.5KB) → archive S76-79 sang `archive/2026-H1.md` (file mới; verify nội dung không mất). +- 🟥 **reviewer**: PASS 0 issue — 4 edit đúng verbatim 2 app, comment L121 + handler L664 (`e.target.checked`) giữ nguyên (đúng), 0 BE/test/mig leak, logic non-break (default-false → không ép chọn giá chốt), TS-safe (`finalizeStepName/LevelName: string|null`). + +em-main: comment-drift cleanup (2 app) + verify SHA mirror (1 hash) + commit `1c8fb6a` + push. + +## Deploy verify — cicd-monitor Run #481 (byte-level #77) +- **PASS** ~5m10s (18:05:56→18:11:06). Test gate 440 green. +- JS rotate (real FE proof): admin `COYAX-yQ`→`Cf0o8dx8` · user `0MU-kb4N`→`x8rppRAK`. CSS frozen `Bbtesa6B`/`BmuPz_Dy` (#69-REFINE JSX-text+bool-only). Real-size 1.64/1.54MB (anti-SPA-trap 919b). +- **Byte-level (#77) 2 app CLEAN:** NEW `Kết thúc tại` PRESENT + helper `Mặc định: duyệt xong phiếu TRÌNH TIẾP` PRESENT · OLD `không trình tới` ABSENT + `Đã BỎ tick` ABSENT → **fix shipped byte-level; UI cũ = cache (incognito), KHÔNG phải deploy-fail.** +- Mig 59 / 88 tables frozen · smoke api+admin+eoffice 200×3 + PE-list 200 items[] valid. +- Caveat: badge-text/checkbox-default không curl-verify được (cần login + phiếu thật → anh Kiệt UAT). + +## Lessons +- **#53 return-garble tái diễn LẦN-4** — cicd-monitor trả prose curate-memory ("18.7KB still above 17.1KB target…") thay deploy-verdict, DÙ instruction tường minh "return verdict NOT memory-curation prose". Recover verdict từ diary (`agent-memory/cicd-monitor/MEMORY.md` S97 #481 entry) **KHÔNG re-spawn** — theo `feedback_agent_return_garble_recover`. → instruction-fix "return-verdict" **giảm-không-100%**; recover-from-diary là đường robust. +- **BE-honors-explicit-flag** → đảo default checkbox chỉ cần sửa FE `useState` (BE param default = fallback cho caller non-FE, FE luôn POST tường minh dòng 200) → zero BE/test churn, zero prod-risk. 1 UAT-flip "tưởng to" = 4 dòng × 2 app. +- **Comment-drift** — đổi behavior phải sửa comment mô tả (S96 "default checked" nằm ngay trên `useState(false)` = landmine cho reader sau). em-main cleanup trước commit. + +## State (GIỮ NGUYÊN trừ bundle) +Mig 59 · 88 bảng · 440 test (45D+395I) · gotcha 77 · menu 54 · **bundle admin `Cf0o8dx8`/user `x8rppRAK` (Run #481)** · prod 21 NCC / 17 user. + +## NEXT +- 🔴 **anh:** UAT **incognito** phiếu "8 MEP Sub Hệ thống solar" — xác nhận badge "Kết thúc tại CCM" + checkbox default unchecked. (+ vụ cũ "lỗi phân quyền vào phiếu": cho **số-phiếu + user** để em soi config approver.) +- **em:** đã closeout S97. Monthly re-tier STATUS/HANDOFF mega-line vẫn pending (giờ 5-blurb S97→S93).