From f98a743074109894e7d13f608b21c48bb631ad8f Mon Sep 17 00:00:00 2001 From: pqhuy1987 Date: Fri, 26 Jun 2026 13:07:01 +0700 Subject: [PATCH] =?UTF-8?q?[CLAUDE]=20Docs:=20S91=20closeout=20=E2=80=94?= =?UTF-8?q?=20go-live=20wipe=20+=20seed-gate=20+=20user-change-password=20?= =?UTF-8?q?+=20backup=20(gotcha=20#75/#76)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closeout phiên go-live 26/06 (4 commit prod-verified đã push: guide-fix 159b69d · wipe ba42c59 · seed-gate 55494ad · user-change-password e81e87f + backup local). - STATUS/HANDOFF +S91 entry, state re-ground: Mig 59 · 88 bang · 431 test (45D+386I) · gotcha 76 · menu 54 · bundle admin DgQyuG7f/user BmbQon23 · prod 17 user/7 NCC/0 PE-HD - gotchas #75 (SeedDemoMasterData ungated per-code -> resurrect NCC demo moi restart) + #76 (deploy render appsettings.Production.json tu .example, KHONG file gitignored) - session log 2026-06-26-S91 + feedback_wipe_durability_check_reseed (user memory) - harvest cicd-monitor + test-specialist diary (self-written, verified) - .gitignore +backups/ +*.bak Docs/memory-only -> CI skip (paths-ignore docs/** + **/*.md + .gitignore). Co-Authored-By: Claude Opus 4.8 --- .claude/agent-memory/cicd-monitor/MEMORY.md | 12 +--- .../cicd-monitor/archive/2026-06.md | 8 +++ .../agent-memory/test-specialist/MEMORY.md | 30 ++++------ .../archive/baseline-history.md | 59 +++++++++++++++++++ .gitignore | 2 + docs/HANDOFF.md | 2 +- docs/STATUS.md | 2 +- ...6-06-26-S91-golive-wipe-changepw-backup.md | 43 ++++++++++++++ docs/gotchas.md | 18 ++++++ 9 files changed, 148 insertions(+), 28 deletions(-) create mode 100644 .claude/agent-memory/test-specialist/archive/baseline-history.md create mode 100644 docs/changelog/sessions/2026-06-26-S91-golive-wipe-changepw-backup.md diff --git a/.claude/agent-memory/cicd-monitor/MEMORY.md b/.claude/agent-memory/cicd-monitor/MEMORY.md index 7cbe6f1..d300e29 100644 --- a/.claude/agent-memory/cicd-monitor/MEMORY.md +++ b/.claude/agent-memory/cicd-monitor/MEMORY.md @@ -70,16 +70,10 @@ 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`) -- **S90 #465 (id=465, run_number 351) `a71753b` PASS ~4m56s (FULL-STACK PE "nháp riêng tư" + "giá đề xuất CCM" fix, NO-MIG — anh Kiệt FDC UAT)** — 2-commit push `d085436..a71753b`: `f7bd97a` FE-only gỡ `!readOnly` over-gate trên PRO/CCM suggested-price inputs (both apps PeDetailTabs ×2, +18/−8) + `a71753b` BE PE draft-private-to-creator (PurchaseEvaluationFeatures.cs +18/−4 — chặn leak phiếu Nháp sang role khác + V2-approver) + new test PeDraftVisibilityTests. Files 4: FE 2 (PeDetailTabs admin+user) + BE 1 (PurchaseEvaluationFeatures) + 1 test. **NO `*Migrations*`/`*Persistence*` in range diff** (logic-only, no schema). status=success ⟹ test gate passed (**baseline 421** = 45 Domain + 376 Infra = 419 +2; logs 404 anon so count not log-scraped — trusted gate+baseline). **Bundle JS BOTH ROTATE (real fe-src PeDetailTabs ×2 ⟹ new content-hash): admin js `BeyLzf5i`→`BXixQDuS` · user js `CPe970sY`→`BMgckUPd`** (pre-deploy LIVE baseline = Run #350 web.config, NOT brief's stale #348 `BQq2eTP6`/`dHa64I59`); **css FROZEN admin `DWQ-DgfZ` user `Dr0-ikKX` — correct, FE logic-only [un-gate inputs] no new utility class** (gotcha #69-inverse). Real-ship proven (SPA-trap defeated): admin js 1,628,895b Last-Modified 07:43:18Z=14:43:18+07 in-window (run 14:39:38→14:44:34 = 07:39:38→07:44:34Z) · user js 1,532,796b 07:44:10Z in-window · control fake `ZZfakehash00.js`→200 but 919b text/html (size-check meaningful). **BE dll ALL 4 fresh in-window: Api 07:42:07Z · Application 07:40:13Z (PurchaseEvaluationFeatures draft-private live) · Infrastructure 07:40:37Z · Domain 07:39:56Z.** **Mig FROZEN 59** (repo MIGCOUNT=59 + prod history HEAD==`AddCcmBudgetPeriodToPurchaseEvaluation`==repo + HistCount=59 no-pending — correct NO-MIG). Health api ready/live 200 + admin/eoffice 200 (4×200). GET /api/purchase-evaluations + /api/menus + /api/approval-workflows-v2 all 401 unauth (wired NOT 404/500). **S88 cache headers LIVE: admin+eoffice index `Cache-Control: no-cache` + assets `immutable,max-age=31536000`** (web.config S88 hardening confirmed in prod). PE fix BE-internal (draft-visibility filter) + FE un-gate = no new endpoint → 421-test covers draft-visibility behavior, no curl-probe. gotcha #69-inverse re-confirmed (real fe-src ⟹ js rotates, css frozen logic-only). ⚠️ **brief's prev-hash #348 was STALE — Run #350 (`ca136d8` web.config) rotated bundle since; ALWAYS re-snapshot LIVE pre-deploy, don't trust brief's claimed prev.** SSH→PS `$_.LastWriteTimeUtc` mangled nested-double-quote → base64 EncodedCommand worked; sqlcmd `-Q` mangled → scp .sql + `-i` file cleanest. DB pw `buKL3TGBkD0wDDbYVw65QeX9` (no `vrapp/` prefix), conn key `ConnectionStrings.Default`, prod path `C:\inetpub\solution-erp\api`. -- **S89 #348 (id=462) `1aa3bdb` PASS ~5m10s (FULL-STACK PE D2 multi-winner outward, NO-MIG)** — create-contract 1→N per winner (command→List, multi-winner handler in CreateContractFromEvaluationFeatures, Controller returns `{contractIds}`) + list-card winner-names projection (PurchaseEvaluationFeatures + Dtos WinnerSupplierNames). Files 12: BE 4 (Controller/CreateContractFromEvaluationFeatures/Dtos/PurchaseEvaluationFeatures) + FE **both apps** 6 (PeDetailTabs+PeListPanel+types ×2) + 2 test (CreateContractFromEvaluationMultiWinnerTests + PeListWinnerNamesProjectionTests). **NO `*Migrations*`/`*Persistence*` in diff** (git diff EMPTY — logic-only, no schema). status=success ⟹ test gate passed (**baseline 419** = 45 Domain + 374 Infra = 413 +6; logs 404 anon so count not log-scraped — trusted gate+baseline). **Bundle JS BOTH ROTATE (real fe-src PeDetailTabs+PeListPanel ⟹ new content-hash): admin js `CP_iKhTu`→`BQq2eTP6` · user js `DUe0fndl`→`dHa64I59`** (#347 baseline); **css FROZEN admin `Pltrs5ku` user `Foiw55B6` = #347/#346 — correct, D2 FE logic-only no new utility class** (gotcha #69-inverse). Real-ship proven (SPA-trap defeated): admin js 1,628,901b Last-Modified 03:34:13Z=10:34+07 in-window (run 10:30:30→10:35:40 = 03:30:30→03:35:40Z) · user js 1,532,802b 03:35:07Z in-window · control fake `ZZfakehash00.js`→200 but 919b text/html (size-check meaningful). **BE dll ALL 4 fresh in-window: Api 03:33:00Z (Controller `{contractIds}` live) · Application 03:31:04Z (CreateContractFromEvaluation multi-winner handler + PE winner-names projection live) · Infrastructure 03:31:28Z · Domain 03:30:47Z.** **Mig FROZEN 59** (repo MIGCOUNT=59 + prod history HEAD==`AddCcmBudgetPeriodToPurchaseEvaluation`==repo + HistCount=59 no-pending) + sys.tables 89 incl __EFMigrationsHistory = 88 business (no schema change). **Endpoint live: `POST /api/purchase-evaluations/{id}/create-contract` bodyless→411 (IIS Length-Required pre-auth), +json-body→401 (wired: NOT 404=route-exists, NOT 500=no-crash; `{contractIds}` multi-winner contract live).** Health api ready/live + admin + eoffice 4×200. GET /api/purchase-evaluations + /api/menus + /api/approval-workflows-v2 all 401 unauth (wired). gotcha #69-inverse re-confirmed (real fe-src ⟹ js rotates, css frozen when logic-only). ⚠️ **DB pw = `buKL3TGBkD0wDDbYVw65QeX9` (NOT `vrapp/buKL3...` — `vrapp/` was user/pw-combined-notation in memory essentials, actual Password field has no prefix; read from prod `appsettings.Production.json` ConnectionStrings.Default).** SSH→PS `$_.LastWriteTimeUtc` mangled in nested double-quote → base64 EncodedCommand worked; sqlcmd `-Q` quoting mangled → scp .sql + `-i` file worked cleanest. conn key `ConnectionStrings.Default`, prod path `C:\inetpub\solution-erp\api`. -- **S88-quad #347 (id=461) `73cce1f` PASS ~5m04s (FULL-STACK PE D1 stability, NO-MIG)** — Block-B multi-winner financials re-key (PurchaseEvaluationFeatures) + CEO-notify SaveChanges-persist (PurchaseEvaluationUrgentFeatures +5 lines) + setter RELOCATE PeSuggestedPriceFeatures→PeWorkItemBudgetFeatures (−56/+57) + HoSoLink trim + #70 guard + Dtos comment. Files 12: BE 5 (Dtos+4 features) + FE **both apps** 4 (PeDetailTabs+types ×2) + 3 test (PeHoSoLinkTests+PeWorkItemBudgetTests EXTEND, **new PeUrgentNotifyDirectorTests +237 lines**). **NO `*Migrations*`/`*Persistence*` in diff** (logic-only re-key, no schema). status=success ⟹ test gate passed (**baseline 413** = 45 Domain + 368 Infra = 402 +11; logs 404 anon so count not log-scraped — trusted gate+baseline). **Bundle JS BOTH ROTATE (real fe-src #70-guard+HoSoLink-trim ⟹ new content-hash): admin js `BABhPh2s`→`CP_iKhTu` · user js `DLulO6uP`→`DUe0fndl`** (#346 baseline); **css FROZEN admin `Pltrs5ku` user `Foiw55B6` — correct, D1 FE logic-only no new utility class**. Real-ship proven: admin js 1,628,726b Last-Modified 02:57:57Z=09:57+07 in-window (run 09:54:15→09:59:19 = 02:54:15→02:59:19Z) · user js 1,532,627b 02:58:50Z in-window · SPA-trap control `ZZfakehash00.js`→200 but 919b text/html (size-check meaningful). **BE dll ALL 4 fresh in-window: Api 02:56:42Z · Infrastructure 02:55:16Z (PeWorkItemBudgetFeatures setter-relocate live) · Application 02:54:51Z (PurchaseEvaluationFeatures Block-B + UrgentFeatures CEO-persist live) · Domain 02:54:36Z.** **Mig FROZEN 59** (MIGCOUNT=59, prod history HEAD==`AddCcmBudgetPeriodToPurchaseEvaluation`==repo, no-pending; correct NO-MIG D1) + sys.tables 88 (89 incl __EFMigrationsHistory). Health api ready/live + admin + eoffice 4×200. GET /api/purchase-evaluations + /api/menus + /api/approval-workflows-v2 all 401 unauth (wired NOT 404/500). gotcha #69-REFINE inverse re-confirmed (real fe-src ⟹ js rotates, css frozen when logic-only). conn key `ConnectionStrings.Default`, prod path `C:\inetpub\solution-erp\api` (skill-doc `\apps\...` STALE). ⚠️ SSH→PS table-count `<>'literal'` mangled via base64/CLIXML AGAIN → use count-incl-history−1 (88) workaround. +- **🟢 S91 #470 (id=470, run_number 356) `55494ad` GO ~5m11s (GO-LIVE 26/06 Phase-01 PRO+CCM — VERIFY-NO-RESURRECT, BE-ONLY DbInitializer gate)** — 1-file `DbInitializer.cs` gate `SeedDemoMasterDataAsync` sau cờ `DemoSeed:Disabled` (prod=true) chống restart re-seed 18 NCC demo. NO `*Migrations*`/fe-src. status=success ⟹ test gate passed (baseline 422=45 Domain+377 Infra per spec; logs 404 anon, trusted gate+baseline). **PURPOSE = no-resurrect verify (NOT bundle-hash).** Pre-restart DB (binary cũ): Suppliers=7/demo-code=0/PE=0. **Post-restart (binary GATE mới): Suppliers=7 · demo-code=0 (tuyệt đối, 18 demo NCC-VLXD/CDT-VIN/CDT-SUNGROUP/NTP-XD/TD-NEHOANG/DV-CLEAN… KHÔNG re-seed) · PE=0 · PeWorkItemBudgets=0 · Notifications=0** ⟹ gate HIỆU LỰC. **3-evidence binary-mới-thực-chạy-DbInitializer** (chống đọc-state-process-cũ false-pass): (1) `Infrastructure.dll` UtcMod 03:54:35Z in-window (DbInitializer sống Infrastructure) · (2) `Api.dll` 03:56:04Z in-window (run 03:53:32Z→03:58:43Z UTC = 10:53:32→10:58:43+07) · (3) **`w3wp PID=10616 StartUtc=03:58:19Z` + `PID=4428 03:59:04Z` recycle SAU run-window** ⟹ app pool started binary mới + chạy DbInitializer với cờ gate → demo gated. ⚠️ **API in-proc w3wp (no SolutionErp.Api.exe process — ANCM in-process); shared VPS nhiều w3wp [VIETREPORT pools] → match pool by StartTime-in/after-window, KHÔNG by tên process.** Smoke 4×200 (health/live+ready, eoffice, admin). Wipe-S91 (scripts/s91-wipe-golive.sql, backup `SolutionErp_S91_pregolivewipe.bak`) + gate khớp → prod sạch 7 NCC thật, PeSeq reset A/001. **No re-run wipe.** **🆕 NEW PATTERN — go-live no-resurrect verify = (a) pre+post-restart DB-count diff [demo-code MUST stay 0] + (b) dll Last-Modified in-window [code-gate ship] + (c) w3wp StartTime ≥ run-window [pool recycled ⟹ DbInitializer ran]; thiếu (c) thì post-count chỉ là state cũ CHƯA chứng minh gate.** DB integrated-auth `-E` (no pw). CLIXML noise → `grep -v CLIXML/Objs/progress`. +- _(S90 #465 `a71753b` FULL-STACK PE draft-private + un-gate suggested-price js-rotate-css-FROZEN baseline-421 · S89 #348 `1aa3bdb` FULL-STACK PE create-contract-1→N multi-winner + winner-names-projection endpoint-411→401-wired baseline-419 · S88-quad #347 `73cce1f` FULL-STACK PE D1 Block-B re-key + CEO-notify-persist baseline-413 → all PASS NO-MIG (frozen-59), full verbatim → archive `2026-06.md` via `_INDEX`)_ - _(S88-bis #346 `0d3c0cf` FE-only PE layout "4. Thông tin chọn thầu" 2-files js+css-BOTH-rotate baseline-402 · S88 #345 `9b1ee0c` FULL-STACK Section-B 3-col + **Mig 59 `AddCcmBudgetPeriodToPurchaseEvaluation`** AddColumn-no-backfill VERIFIED-PROD + setter `PATCH .../budget/ccm-period` PATCH-401-not-411 + 7 authz-test → PASS, FIFO-trimmed, full verbatim git + archive `_INDEX`)_ -- **S87 #344 (id=458) `f1b10e9` PASS ~5m11s (FULL-STACK PE CCM 3-fix + Mig 58, anh Kiệt FDC)** — multi-winner SUM (SelectWinner→SupplierIds[] array body) + budget=0 valid-submit + per-level auto-finalize (`ApproveV2Async if matchingLevel.AllowApproverFinalize`). Files: BE 13 (Controller/App/Domain/Infra/Service + Mig 3-file) + FE **BOTH apps** 7 (PeDetailTabs/PeWorkflowPanel/types ×2 + fe-admin ApprovalWorkflowsV2Page Designer) + 6 test. **Mig 58 `20260624071509_AddPeMultiWinnerAndLevelFinalize`** = 2 AddColumn bit (`PurchaseEvaluationSuppliers.IsWinner` default0 + `ApprovalWorkflowLevels.AllowApproverFinalize` default0) + 1 backfill `UPDATE ... SET IsWinner=1 WHERE pes.SupplierId=pe.SelectedSupplierId` — VERIFIED-APPLIED-PROD (history top==`AddPeMultiWinnerAndLevelFinalize`==repo HEAD; both cols sys.columns=1; **backfill ran: winners=13 == pe_with_SelectedSupplierId=13 / 30 total supplier rows** — exactly 1 winner per pre-existing selected PE). Test gate=success ⟹ passed (**baseline 395** = 45 Domain + 350 Infra per spec; was 397 −2 because per-level-finalize moved runtime-flag→auto-config, NOT regression). **Bundle BOTH ROTATE (real fe-src ⟹ new content-hash, contrasts #69-REFINE BE-only): admin js `aKuNip19`→`CXCKlNay` (css FROZEN `BKB2NsgQ`, logic-only diff no new chunk), user js `BUsL0HeQ`→`Di40ewrF` (css FROZEN `BaqeI4iG`).** Real-ship proven: admin js 1,621,660b Last-Modified 08:26:32Z=15:26+07 in-window · user js 1,525,569b 08:27:26Z in-window · control fake-hash `ZZfakehash0.js`→200 but 919b text/html (SPA-trap confirms 200-alone meaningless). Endpoint live: `POST /api/purchase-evaluations/{id}/select-winner` bodyless→411 (IIS Length-Required pre-auth), +json-body→401 (wired, NOT 404/400/500; `SelectWinnerBody(IReadOnlyList? SupplierIds)`→`SelectPurchaseEvaluationWinnerCommand` array contract live). Health api ready/live + admin + eoffice 4×200. ⚠️ **ambient sys.tables=89 (was 88) — NOT from Mig 58** (AddColumn-only, 0 new table; newest table `PeWorkItemBudgets` 06-13 Mig 50, none created 06-24); 88 baseline last re-grounded S62, +1 pre-existing drift in Mig 50-57 range, harmless. ⚠️ prod path `C:\inetpub\solution-erp\api` (skill-doc `\apps\SolutionErp\Api` STALE — re-confirmed); conn key `ConnectionStrings.Default`; base64 EncodedCommand + 1 path-retry. gotcha #69-REFINE inverse confirmed (real fe-src ⟹ hash DOES rotate). -- **S86 #343 (id=457) `ae4f106` PASS ~5m00s (BE-ONLY notify-filter)** — PE "cần duyệt" notify EXCLUDE drafter + 1 new test (`PeApproverNotifyExcludesDrafterTests`) + STATUS + agent-memory. Only-BE-src: 1 file `PurchaseEvaluationWorkflowService.cs`, ZERO `fe-*/src`, ZERO `*Migrations*`. status=success ⟹ test gate passed (**baseline 377** = 45 Domain + 332 Infra per spec; S85 374 +3; reviewer's 2 transient parallel-collection flake did NOT surface red in CI — gate green). **Ship-proof #69-REFINE (BE-only) CONFIRMED via dll Last-Modified in run-window (16:37:38→16:42:35+07 = 09:37:38→09:42:35Z):** Api.dll 09:40:04Z · **Application.dll 09:38:12Z · Infrastructure.dll 09:38:34Z** (PurchaseEvaluationWorkflowService lives in Infrastructure → recompiled fresh) — all 3 in-window. **FE bundle FROZEN (correct, 0 fe-src diff ⟹ byte-identical): admin `aKuNip19`/`BKB2NsgQ`, user `BUsL0HeQ`/`BaqeI4iG` = S85 baseline.** Mig FROZEN 57 (`AddPeSuggestedPriceNotes`, prod head==repo) + tables 88. Prod 4×200 (api ready/live, admin, eoffice) + PE wired (GET /api/purchase-evaluations + /api/menus both 401 unauth, NOT 404/500). Notify-filter BE-internal no-new-endpoint → test 377 covers behavior (no curl-probe of notify logic). gotcha #69-REFINE reaffirmed (BE-only: dll Last-Modified = sole ship-proof, hash-delta N/A). ⚠️ SSH transient drop ×3 mid-session (`Connection closed by 103.124.94.38`) — base64 EncodedCommand + retry-loop recovered; not a deploy issue. -- **S85 #342 `d4f6021` PASS ~5m00s (DOCS+SQL NO-OP, INVERTED criteria)** — 6×.md + `scripts/s85-wipe-uat-data.sql` (only non-ignored path → CI triggers; whole-workflow still builds FE+publish). **PASS-when-FROZEN, NOT rotate.** Verified: status=success ⟹ test gate passed (baseline **374** = 45 Domain + 329 Infra per STATUS.md canonical, logs API 404 anon so count not log-scraped — trusted gate+baseline) + **bundle FROZEN admin `aKuNip19`/user `BUsL0HeQ` (correct: 0 fe-src diff ⟹ byte-identical ⟹ same hash, gotcha #69-REFINE)** but DID ship (admin js Last-Modified 08:56:34Z=15:56+07 IN-window 15:53→15:58, real 1.62MB/user 1.52MB vs SPA-trap 919b, 2nd-fetch byte-stable). Prod 4×200 (ready/live/admin/eoffice) + endpoint smoke 4×200 (PE/awf-v2/menus/projects). **Prior S85 deploys still live: R6 TZ fix `49ac086` → `createdAt:"…7331140Z"` trailing-Z CONFIRMED; R5 UpdateDraft `1263c0d` → both ancestors of d4f6021, shipped via #341 (#340 cancelled but #341 success built later commit incl TZ).** SignalR negotiate 411 (bodyless-POST IIS, wired, notif untouched). gotcha #73 (TZ) + #69-REFINE reaffirmed. -- **S83 #333 `fc1f19d` PASS ~4m59s** — BE-only PE-guard (require ApprovalWorkflowId V2 at create-validator + submit-branch ConflictException; close FE-only-validation gap → phiếu reached "Đã gửi duyệt" w/ null workflow = V1-legacy-banner trap). +2 validator tests → **test 356** (gate=success ⟹ pass). NO-mig (frozen 57, prod head `AddPeSuggestedPriceNotes`==repo, no-pending) + ZERO fe-*/src diff. **Bundle hash UNCHANGED (admin `CsJetgZH`/user `BVS0ApIm` = #330) BUT shipped — Last-Modified 17:10:35/17:11:27 in-window** (real js 1.62/1.52MB vs SPA-trap 919b) → **gotcha #69-REFINE: 0-FE-src ⟹ byte-identical ⟹ same-hash; Last-Modified is true ship-proof.** Guard BE-only no-endpoint → no curl-probe (356 tests cover RED→GREEN). Health api/ready+live 200, admin/eoffice 200, api-root 404 (no `/` route, expected). -- **S78 #330 `7886fd0` PASS ~4m56s** — cross-stack NO-MIG enum `ApprovalAttachment=5` (attach-on-approve) + FE 2-app PeWorkflowPanel modal-upload. Verified: empty-migrations-diff + Mig-frozen-57 + tables88 + bundle BOTH rotate js+css (real 1.6/1.5MB vs fake-919b) + endpoint bodyless-POST-411→re-probe-body-401-wired + health 4×200. → _INDEX. -- **S76 #318 `e33481e` PASS ~4m58s** — full-stack Mig56 ProInitial/ProAdjust VERIFIED-APPLIED-PROD (sys.columns decimal(18,2)) + **5th-axis BACKFILL-verify** 4-rows-0-violation (gotcha #64 prod-data-UPDATE-first-time) + history-advance-55→56 + tables88 + bundle BOTH+css rotate + health 4×200. Pre-deploy DB snapshot (Mig55) → post (Mig56) = unambiguous proof. → _INDEX. +- _(S87 #344 `f1b10e9` FULL-STACK PE CCM 3-fix + **Mig 58 `AddPeMultiWinnerAndLevelFinalize`** 2-AddColumn-bit+backfill winners=13 VERIFIED-PROD, select-winner endpoint-411→401-wired, baseline-395 · S86 #343 `ae4f106` BE-only notify-exclude-drafter baseline-377 ship-proof=Infrastructure.dll-Last-Modified · S85 #342 `d4f6021` DOCS+SQL-no-op INVERTED-PASS-when-FROZEN baseline-374 (gotcha #73 TZ + #69-REFINE) · S83 #333 `fc1f19d` BE-only PE-guard-V2-workflow-required hash-FROZEN-but-shipped baseline-356 · S78 #330 `7886fd0` cross-stack enum-attach-on-approve · S76 #318 `e33481e` Mig56-ProInitial/Adjust backfill-4rows → all PASS, full verbatim → archive `2026-06.md` via `_INDEX`)_ - _(S83 #325 `e29391e` FE-only budget-subitem indent js-rotate-css-FROZEN test351 · S77 #329 `e823694` FE-only banner Trả-lại · #328 `424131d` BE-only notify-block test-gate-KEY · #327 `fa6654b` FE-list-restructure · #326 `b5aa72d` BE-authz asymmetric · #323 #322 #321 #320 PE UX batch → all PASS, FIFO-trimmed, full verbatim git + archive `_INDEX`)_ - _(S74-bis #315 `8655ebf` Mig55 CcmNote · S73 #313 `1d86abc` Mig54 5-cols + endpoint-401-not-404-probe · S69b #307 `1f8947e` Office-golive seed-16/16-DB-query-proof → archive `_INDEX` + git)_ - **Older runs (S75 #301 ← S62 #286 ← … → S29 #232) full verbatim → git `d2f52ba` + `archive/2026-06.md`** (incl #291 06-16 FAIL forensic [gotcha #65]); pre-S38 → `archive/2026-05-{runs,q2,q3,q4}.md`. diff --git a/.claude/agent-memory/cicd-monitor/archive/2026-06.md b/.claude/agent-memory/cicd-monitor/archive/2026-06.md index af32037..b246793 100644 --- a/.claude/agent-memory/cicd-monitor/archive/2026-06.md +++ b/.claude/agent-memory/cicd-monitor/archive/2026-06.md @@ -54,3 +54,11 @@ - **2026-06-19 S78 Run #330 (run_number 330, id=444) sha=`7886fd0` PASS ~4m56s (CROSS-STACK NO-MIG — BE enum-only `PurchaseEvaluationAttachmentPurpose.ApprovalAttachment = 5` additive int-stored NO-migration + FE 2-app PeWorkflowPanel modal-upload-picker/upload-before-transition/"File đính kèm khi duyệt" display + PeDetailTabs 2 filter-fixes + types; anh Kiệt FDC UAT Tra Sol/5-tester):** Push HEAD=`7886fd0` nothing-unpushed, subject "nguoi duyet dinh kem file khi DUYET (reuse attachment Purpose=ApprovalAttachment, no migration)". `git diff --name-only 7886fd0~1 7886fd0` = 7 files: 6 FE {PeDetailTabs+PeWorkflowPanel+types ×2-app} + 1 Domain enum `PurchaseEvaluationAttachment.cs`. `git diff -- '*Persistence/Migrations*' '*Migrations*'` = **EMPTY = strongest no-schema signal** ✓. Enum-diff `+ApprovalAttachment = 5` confirmed (int-stored additive — no mig per skill ef-core-migration Phase-6 pattern, same as `ComparisonTable=4`). FE PeWorkflowPanel admin==user SHA256 `c3697bba...` (SHA-identical as claimed). `.cs/.tsx` non-ignored → full pipeline RAN. GITEA_TOKEN absent → anon Gitea API worked (public repo). Run RUNNING at spawn (running 16:48, exact head_sha `7886fd03dd43` matched run#330 id=444; #329=`e823694`+#328=`424131d`+#327=`fa6654b` all `success` in task list = prompt's stated priors). Poll-loop: first attempt 12-iter exhausted-RUNNING (foreground-sleep blocked Windows → no spacing); fixed Monitor-style until-loop busy-wait-curl-spin ~30s/iter → iter7 status=success (created 16:46:49→success 16:51:45 ≈**4m56s**; `updated_at` advanced each poll). **★ CI TEST GATE: both test proj run pre-build ⟹ status=success ⟹ test 354 passed (enum+FE-only, NO test change ⟹ 354 unchanged from #329; local-run-354-confirmed-by-em). `conclusion` empty (tasks terminal=`status:success`, trust success NOT log-numeric).** **★ MIG UNCHANGED PROD (sqlcmd-over-SSH ground-truth, captured PRE-poll AND re-confirmed POST-deploy): history-top STILL Mig 57 `20260619070051_AddPeSuggestedPriceNotes` == repo HEAD latest (`ls Migrations/*.cs` top), did NOT advance both queries (correct — enum-only no mig) ✓. sys.tables=88 UNCHANGED both pre+post — enum int-column no schema ✓.** **🔑★ BUNDLE BOTH ROTATE (FE 2-app real source change ⟹ EXPECTED per #69; verified AFTER status=success + STABLE 2nd-fetch identical-size no-transient per anti#3): admin JS ROTATE `BqKD3Y23→CsJetgZH` + css `BTszpA4r→Bvr5i5Nj` ✓ + user JS ROTATE `Cn-i349D→BVS0ApIm` + css `CnWwt3Oc→DHshp2tb` ✓ (both css rotated — modal/picker layout-touching).** Asset 200 + LARGE + STABLE: admin js 1,617,391b (fetch#1==fetch#2) + user js 1,521,772b (fetch#1==fetch#2) — 2nd-fetch byte-stable ⟹ no mid-deploy transient. Control fake `/assets/index-ZZfakehash0.js`→200 admin 919b + user 895b SPA-fallback ⟹ real JS shipped (gotcha #69 SPA-200-trap distinguished by SIZE). index.html `Last-Modified` ADVANCED admin 09:50:26z + user 09:51:19z (=16:50-16:51VN deploy window) ✓. Smoke **4×200**: api `/health/ready`+`/health/live` + admin + eoffice roots. **★ ENDPOINT-WIRED PROBE `POST /api/purchase-evaluations/{guid}/attachments`: bodyless→411 (IIS Length-Required pre-auth, NOT 404) → re-probe WITH body (`-H Content-Length:0` AND `-F x=1`)→401 unauth (auth-gate fires) ✓; contrast GET nonexistent-subroute→404 + GET attachments→405 (route-exists POST-only); source confirms `[HttpPost("{id:guid}/attachments")]` controller L230. Lesson: bodyless-POST 411≠404 — re-probe with body to make auth evaluate.** 0 regression, NO prod-data mutation (read-only curls + sqlcmd SELECT-only). Behavioral attach-on-approve = anh-Kiệt UAT (em confirms in-app upload-before-transition). **VERDICT PASS: green CI run#330 + test-gate-354-passed + Mig-UNCHANGED-57 (history NOT advance, pre+post) + tables88 + bundle BOTH-rotate (js+css both apps, real 1.6/1.5MB vs fake-919b, 2nd-fetch-stable) + LM-advanced + endpoint-401-with-body + health 4×200. NEW LIVE BUNDLES: admin js `CsJetgZH`/css `Bvr5i5Nj` + user js `BVS0ApIm`/css `DHshp2tb`. LESSON: ENUM-ADDITIVE = NO-MIG (int-stored, like Purpose=4 ComparisonTable Phase-6) ⟹ verify-as-FE-only-cross-stack: empty-migrations-diff + Mig-frozen-history-NOT-advance + tables88 (don't expect history-advance for enum). NEW-ENDPOINT bodyless-POST returns 411 NOT 401 (IIS rejects no-Content-Length before auth) → MUST re-probe WITH body to confirm 401-wired — else 411 misreads as not-wired. Contrast S86-BE-logic-only (bundle FROZEN, test-gate KEY) vs S87/this-FE-touching (bundle ROTATE both js+css). TOOLING: bash POSIX curl index.html grep `/assets/index-…` + `-w size_download/http_code` + `-I last-modified`; poll Monitor-until-loop busy-wait-curl-spin 30s (foreground-sleep blocked); SSH→sqlcmd direct `-W -h -1` pw-inline (`vrapp`/`buKL3TGBkD0wDDbYVw65QeX9`/path `C:\inetpub\solution-erp\api` ConnectionStrings.Default); pre-poll baseline BEFORE status=success per anti#3. NEVER fixed code (READ-only).** Tag `[s78, run330, pass, cross-stack-NO-MIG, BE-enum-only-ApprovalAttachment-eq-5-additive-int-stored-no-migration, FE-2app-PeWorkflowPanel-modal-upload-picker-upload-before-transition + PeDetailTabs-2-filter-fixes + types, 7-files-6FE-1Domain-enum, PeWorkflowPanel-admin-eq-user-sha256-c3697bba, empty-migrations-diff-strongest-no-schema, CI-test-gate-354-unchanged-enum-FE-only-trust-success, mig-UNCHANGED-57-history-top-NOT-advance-pre-and-post, tables88-unchanged, bundle-BOTH-ROTATE-admin-BqKD3Y23-to-CsJetgZH-css-BTszpA4r-to-Bvr5i5Nj-user-Cn-i349D-to-BVS0ApIm-css-CnWwt3Oc-to-DHshp2tb, both-css-rotate-modal-picker-layout-touching, real-JS-1617391-1521772-vs-fake-919-895-spa-200-trap-by-size, 2nd-fetch-byte-identical-no-transient, LM-advanced-09-50-09-51z-deploy-window, endpoint-probe-POST-attachments-bodyless-411-then-with-body-401-route-wired-HttpPost-L230-contrast-404-405, health-4x200, NEW-LIVE-BUNDLES-admin-CsJetgZH-Bvr5i5Nj-user-BVS0ApIm-DHshp2tb, enum-additive-no-mig-verify-as-cross-stack-no-schema, bodyless-POST-411-not-404-reprobe-with-body, poll-monitor-until-loop-busy-wait-iter7-4m56s, anon-gitea-api, pre-poll-baseline-anti3]`. - **2026-06-19 S76 Run #318 (run_number 318, id=432) sha=`e33481e` PASS ~4m58s (FULL-STACK: BE Mig 56 `AddProBudgetSplitToPeWorkItemBudget` — PE ngân-sách MA-TRẬN 3 cột Dự-án|PRO|CCM, PRO split số ban-hành + điều-chỉnh + badge quyền NS theo role; anh Kiệt FDC continuation Mig 50/53/54/55. 19 files: BE 9 {Controller, App ApprovalWorkflowV2AdminFeatures+PurchaseEvaluationDtos+PeWorkItemBudgetFeatures+PurchaseEvaluationFeatures, Domain PeWorkItemBudget.cs, Config PeWorkItemBudgetConfiguration} + 3 Mig-file + FE 6 {PeDetailTabs+PeWorkflowPanel+types ×2-app, admin +ApprovalWorkflowsV2Page} + 1 test PeWorkItemBudgetTests + .gitignore. deploy 17/17 session after #297–#315 all PASS):** Push HEAD=`e33481e` (nothing unpushed). `git diff --name-only e33481e~1 e33481e -- '*Persistence/Migrations*'` = 3 files (Mig 56 .cs/.Designer.cs/Snapshot) — REAL EF mig. Mig56 Up() read = **2× `AddColumn`: `ProAdjustmentAmount` + `ProInitialAmount` both decimal(18,2) precision18 scale2 nullable** + `migrationBuilder.Sql(UPDATE PeWorkItemBudgets SET ProInitialAmount=ProEstimateAmount WHERE ProEstimateAmount IS NOT NULL AND ProInitialAmount IS NULL)` data-migrate (phiếu cũ 1-cột giữ số PRO ở cột ban-hành); Down() 2× DropColumn — matches spec exactly, AddColumn-only no new table. `.cs/.tsx` non-ignored → full pipeline RAN. GITEA_TOKEN+PROD_DB_PW BOTH absent env → anon Gitea API (worked, public repo) + DB pw read prod `appsettings.Production.json`→`ConnectionStrings.Default` (`vrapp`/`buKL3TGBkD0wDDbYVw65QeX9`, `.\SQLEXPRESS`/`SolutionErp`, path `C:\inetpub\solution-erp\api`). Run IN-PROGRESS at spawn (running 11:03:00, exact head_sha match #318 deterministic; NOTE prompt said "Run #316" but #316=CANCELLED `ae957c4` — actual run for `e33481e` = #318 matched by head_sha NOT run_number). **★ PRE-DEPLOY DB SNAPSHOT captured BEFORE poll-loop (proves deploy hadn't shipped): prod history-top = Mig 55 `AddCcmNoteToPeWorkItemBudget`, ProInitial+ProAdjustment cols ABSENT (only ProEstimateAmount present), tables88.** Pre-poll bundle baseline (anti#3): admin `BYF5vIMJ`/css `X_45M1jX` + user `CB-tiRxd`/css `Bbbo0M5H` = still #315 live. Poll-loop iter6 status=success (created 11:03:00→success 11:07:58 ≈4m58s; iter1-5 running). CI gate (both proj pre-build ⟹ status=success ⟹ test **344** expected (45D+299I; +1 PeWorkItemBudgetTests vs #315's 339) passed; `conclusion` empty — `tasks` terminal=`status:success` doesn't populate conclusion, trust success; 344 INFERRED gate-passes-pre-build NOT log-confirmed numeric). **🔑★ MIG 56 VERIFIED APPLIED PROD (sqlcmd-over-SSH ground-truth, POST-deploy re-query): history-top advanced Mig55→Mig56 `20260619024427_AddProBudgetSplitToPeWorkItemBudget` == repo HEAD ✓ (DbInitializer auto-migrate-on-boot ran on app-pool recycle). BOTH cols EXIST sys.columns: `ProAdjustmentAmount` decimal len9 prec18 scale2 null=1 ✓ + `ProInitialAmount` decimal len9 prec18 scale2 null=1 ✓ — match Mig 56 spec. sys.tables=88 UNCHANGED — 2 AddColumn no new table ✓. ★ DATA-MIGRATE VERIFIED: 4 rows `ProEstimateAmount IS NOT NULL AND ProInitialAmount=ProEstimateAmount` (backfill ran on prod data) + 0 violation rows `estimate-set-but-initial-null` ✓ — UPDATE-Sql executed on real prod data per gotcha #64.** **★ BUNDLE BOTH ROTATE (FE 2-app PeDetailTabs+PeWorkflowPanel + admin ApprovalWorkflowsV2Page ⟹ both EXPECTED per gotcha #69; verified AFTER status=success + STABLE 2nd-fetch no-transient per anti#3): admin JS ROTATE `BYF5vIMJ→BhFDF9IJ` + css `X_45M1jX→DuqjXB6Y`** ✓ (css rotated too — admin had real style change ApprovalWorkflowsV2Page) **+ user JS ROTATE `CB-tiRxd→BAkuRl3C` + css `Bbbo0M5H→JQfATaQB`** ✓. Asset reachable 200 + LARGE: admin js 1,603,616b + user js 1,507,842b (control fake `/assets/index-ZZfakehash0.js`→200 size 919b/895b SPA-fallback ⟹ real JS shipped, gotcha #69 SPA-200-trap distinguished by size). index.html `Last-Modified` admin 04:06:36Z + user 04:07:28Z (=11:06-11:07VN deploy window) ✓. Smoke **4×200** health: api `/health/ready`+`/health/live` + admin root + eoffice root. 0 regression. NO prod-data mutation (read-only curls + sqlcmd SELECT-only; mig-apply+backfill-UPDATE+FE-copy = expected boot/deploy side-effects). Behavioral PRO budget-matrix 3-col + role-badge = anh Kiệt UAT (em confirm Mig56+2cols+backfill+bundles shipped per spec). **VERDICT PASS: green CI + test 344 + Mig 56 applied (ProInitial+ProAdjustment decimal(18,2) sys.columns ground-truth, history advanced 55→56) + tables 88 + backfill 4-rows-0-violation + bundle BOTH rotate (css too) + health 4×200. LESSON: full-stack-2-AddColumn-WITH-DATA-MIGRATE = S74-bis 4-axis + 5th-axis BACKFILL-VERIFY (count rows where new-col=source-col AND 0 violation) — gotcha #64 prod-data-UPDATE-runs-first-time confirmed real. PRE-deploy snapshot at spawn (Mig55+cols-absent) → POST-deploy (Mig56+2cols+4-backfill) = unambiguous proof, best-practice capture-baseline-before-poll when run still building. admin css ALSO rotated (real ApprovalWorkflowsV2Page style) — distinguishes from S74-bis css-frozen (tab-logic-only). Mig-applied proof = `__EFMigrationsHistory` top==repo-HEAD; if stuck Mig 55 ⟹ app pool didn't recycle ⟹ FAIL even if status=success+bundle-rotated. TOOLING: bash POSIX → write PS to `$LOCALAPPDATA/Temp/x.ps1` + `powershell.exe -File $(cygpath -w ...)`; Gitea `tasks` via Invoke-RestMethod `-Body @{limit=N}` hashtable; poll-loop backgrounded + grep-until FINAL; SSH→PS base64 `-EncodedCommand` UTF-16LE for appsettings-read AND sqlcmd; sqlcmd pw inline + `-W -h -1`. NEVER fixed code (READ-only).** Tag `[s76, run318, pass, full-stack-pe-budget-matrix-3col, mig56-AddProBudgetSplitToPeWorkItemBudget-VERIFIED-APPLIED-PROD, 2-cols-sys-columns-ProInitialAmount-ProAdjustmentAmount-decimal18-2-prec18-scale2-null, history-top-advance-55-to-56, tables88-unchanged-addcolumn-only, DATA-MIGRATE-backfill-4rows-ProInitial-eq-ProEstimate-0-violation-gotcha64-prod-data-update-first-time, bundle-BOTH-rotate-BhFDF9IJ-BAkuRl3C, css-BOTH-rotate-DuqjXB6Y-JQfATaQB-admin-ApprovalWorkflowsV2Page-real-style, asset-200-large-1.6MB-vs-fake-919b-spa-trap, last-modified-deploy-window-04-06-04-07z, health-4x200, test344-inferred-plus1-PeWorkItemBudgetTests, deploy17of17, pre-deploy-db-snapshot-mig55-then-post-mig56-unambiguous, prompt-said-316-but-actual-318-matched-by-head-sha-316-cancelled, anon-gitea-api-both-token-absent, behavioral-anh-kiet-uat, 5th-axis-backfill-verify-new]`. - **2026-06-19 S83 Run #325 (id=439) sha=`e29391e` PASS ~4m39s (FE-ONLY tiny, 6th deploy session, NO-mig-NO-BE): 2 files `PeDetailTabs.tsx` ×2-app SHA256-identical `67b2a4da` (budget table sub-items indent + dash-prefix "– Ngân sách Ban hành lần đầu / – Giá trị kỳ này" to distinguish from numbered parent rows). diff ZERO Migrations/* → mig untouched. PRE-deploy snapshot (anti#3, before poll): admin `C6fx-0ea`/user `N3sW4Div` = EXACT #324 live = clean baseline + Mig57 `AddPeSuggestedPriceNotes` history-top + tables88. Poll iter5 status=success (`tasks` anon-API head_sha match, created 14:24:54→success 14:29:33 VN ≈**4m39s**; iter1-4 running). CI gate both-proj-pre-build⟹success⟹test **351** inferred (no test/BE Δ vs #324; conclusion empty per `tasks`-terminal-norm). POST-deploy: **bundle BOTH JS ROTATE** admin `C6fx-0ea→BhnNMucS` + user `N3sW4Div→B1VebpXc` (FE 2-app real Δ⟹both EXPECTED gotcha#69) verified AFTER success + STABLE 2nd-fetch identical (no mid-deploy transient). **CSS BOTH FROZEN** admin `D1qzFQOK`/user `DggBL_MW` (indent/dash reuses existing utility → no new css chunk; asymmetric js-rotate/css-frozen OK #69 — same signature as S81/S82 note/color). Real-JS admin 1,611,075b + user 1,515,457b vs FAKE-control `ZZfakehash0.js` 919b (SPA-200-trap distinguished by SIZE). index.html `Last-Modified` admin 07:28:14Z + user 07:29:09Z (=14:28-14:29VN deploy window, advanced from pre #324 07:12/07:13... wait pre was C6fx live 07:20). **Mig UNCHANGED prod: history-top still Mig57 `AddPeSuggestedPriceNotes` + tables88** (no boot-migrate side-effect, correct for no-mig commit; pre AND post both Mig57). Smoke **4×200**: api/health/ready+live + admin + eoffice. 0 regression, NO prod-data mutation (read-only). VERDICT PASS: green CI + test351 + bundle BOTH-js-rotate (css-frozen, indent/dash reuse utility) + real-1.6/1.5MB-vs-fake-919b + 2nd-fetch-stable + Mig-frozen-57 + tables88 + 4×200. LESSON: FE-only-styling-tweak 3-axis (BE-skip · bundle-both-js-rotate-css-frozen · mig-frozen) = identical pattern S82-color & S81-note MINUS BE/mig axis. css-frozen+js-rotate = EXPECTED for indent/dash/color/note tweaks reusing existing Tailwind utilities (no layout/grid Δ → no new css chunk) — distinguishes from layout-change runs (S79/S80) where css rotated too. 6th-deploy session ALL-PASS (#320?–#325 streak). TOOLING: ps1-file→base64-EncodedCommand UTF-16LE for SSH (appsettings-read + sqlcmd); poll foreground 12×45s grep-until-terminal; sqlcmd pw read prod appsettings→ConnectionStrings.Default (`C:\inetpub\solution-erp\api`). NEVER fixed code (READ-only).** Tag `[s83, run325, pass, fe-only-tiny-NO-mig-NO-BE, 2-PeDetailTabs-sha256-identical-67b2a4da, budget-subitem-indent-dash-prefix, bundle-BOTH-JS-rotate-BhnNMucS-B1VebpXc, css-BOTH-FROZEN-D1qzFQOK-DggBL_MW-indent-dash-reuse-utility, asymmetric-js-rotate-css-frozen-ok-gotcha69-same-as-s81-s82, real-JS-1.6MB-1.5MB-vs-fake-919b-spa-200-trap-by-size, 2nd-fetch-stable-no-transient-anti3, last-modified-07-28-07-29z-deploy-window-advanced, mig-UNCHANGED-57-AddPeSuggestedPriceNotes-history-top-pre-AND-post, tables88, test351-inferred-no-be-change, health-4x200, deploy-6th-session-all-pass, pre-deploy-baseline-EXACT-324-clean, 3-axis-fe-only-styling-tweak]`._ + +--- + +> **Curated S91 (2026-06-26): 3 run-entries below FIFO-archived from L1 MEMORY.md (S90 #465, S89 #348, S88-quad #347 verbatim, byte-exact).** + +- **S90 #465 (id=465, run_number 351) `a71753b` PASS ~4m56s (FULL-STACK PE "nháp riêng tư" + "giá đề xuất CCM" fix, NO-MIG — anh Kiệt FDC UAT)** — 2-commit push `d085436..a71753b`: `f7bd97a` FE-only gỡ `!readOnly` over-gate trên PRO/CCM suggested-price inputs (both apps PeDetailTabs ×2, +18/−8) + `a71753b` BE PE draft-private-to-creator (PurchaseEvaluationFeatures.cs +18/−4 — chặn leak phiếu Nháp sang role khác + V2-approver) + new test PeDraftVisibilityTests. Files 4: FE 2 (PeDetailTabs admin+user) + BE 1 (PurchaseEvaluationFeatures) + 1 test. **NO `*Migrations*`/`*Persistence*` in range diff** (logic-only, no schema). status=success ⟹ test gate passed (**baseline 421** = 45 Domain + 376 Infra = 419 +2; logs 404 anon so count not log-scraped — trusted gate+baseline). **Bundle JS BOTH ROTATE (real fe-src PeDetailTabs ×2 ⟹ new content-hash): admin js `BeyLzf5i`→`BXixQDuS` · user js `CPe970sY`→`BMgckUPd`** (pre-deploy LIVE baseline = Run #350 web.config, NOT brief's stale #348 `BQq2eTP6`/`dHa64I59`); **css FROZEN admin `DWQ-DgfZ` user `Dr0-ikKX` — correct, FE logic-only [un-gate inputs] no new utility class** (gotcha #69-inverse). Real-ship proven (SPA-trap defeated): admin js 1,628,895b Last-Modified 07:43:18Z=14:43:18+07 in-window (run 14:39:38→14:44:34 = 07:39:38→07:44:34Z) · user js 1,532,796b 07:44:10Z in-window · control fake `ZZfakehash00.js`→200 but 919b text/html (size-check meaningful). **BE dll ALL 4 fresh in-window: Api 07:42:07Z · Application 07:40:13Z (PurchaseEvaluationFeatures draft-private live) · Infrastructure 07:40:37Z · Domain 07:39:56Z.** **Mig FROZEN 59** (repo MIGCOUNT=59 + prod history HEAD==`AddCcmBudgetPeriodToPurchaseEvaluation`==repo + HistCount=59 no-pending — correct NO-MIG). Health api ready/live 200 + admin/eoffice 200 (4×200). GET /api/purchase-evaluations + /api/menus + /api/approval-workflows-v2 all 401 unauth (wired NOT 404/500). **S88 cache headers LIVE: admin+eoffice index `Cache-Control: no-cache` + assets `immutable,max-age=31536000`** (web.config S88 hardening confirmed in prod). PE fix BE-internal (draft-visibility filter) + FE un-gate = no new endpoint → 421-test covers draft-visibility behavior, no curl-probe. gotcha #69-inverse re-confirmed (real fe-src ⟹ js rotates, css frozen logic-only). ⚠️ **brief's prev-hash #348 was STALE — Run #350 (`ca136d8` web.config) rotated bundle since; ALWAYS re-snapshot LIVE pre-deploy, don't trust brief's claimed prev.** SSH→PS `$_.LastWriteTimeUtc` mangled nested-double-quote → base64 EncodedCommand worked; sqlcmd `-Q` mangled → scp .sql + `-i` file cleanest. DB pw `buKL3TGBkD0wDDbYVw65QeX9` (no `vrapp/` prefix), conn key `ConnectionStrings.Default`, prod path `C:\inetpub\solution-erp\api`. +- **S89 #348 (id=462) `1aa3bdb` PASS ~5m10s (FULL-STACK PE D2 multi-winner outward, NO-MIG)** — create-contract 1→N per winner (command→List, multi-winner handler in CreateContractFromEvaluationFeatures, Controller returns `{contractIds}`) + list-card winner-names projection (PurchaseEvaluationFeatures + Dtos WinnerSupplierNames). Files 12: BE 4 (Controller/CreateContractFromEvaluationFeatures/Dtos/PurchaseEvaluationFeatures) + FE **both apps** 6 (PeDetailTabs+PeListPanel+types ×2) + 2 test (CreateContractFromEvaluationMultiWinnerTests + PeListWinnerNamesProjectionTests). **NO `*Migrations*`/`*Persistence*` in diff** (git diff EMPTY — logic-only, no schema). status=success ⟹ test gate passed (**baseline 419** = 45 Domain + 374 Infra = 413 +6; logs 404 anon so count not log-scraped — trusted gate+baseline). **Bundle JS BOTH ROTATE (real fe-src PeDetailTabs+PeListPanel ⟹ new content-hash): admin js `CP_iKhTu`→`BQq2eTP6` · user js `DUe0fndl`→`dHa64I59`** (#347 baseline); **css FROZEN admin `Pltrs5ku` user `Foiw55B6` = #347/#346 — correct, D2 FE logic-only no new utility class** (gotcha #69-inverse). Real-ship proven (SPA-trap defeated): admin js 1,628,901b Last-Modified 03:34:13Z=10:34+07 in-window (run 10:30:30→10:35:40 = 03:30:30→03:35:40Z) · user js 1,532,802b 03:35:07Z in-window · control fake `ZZfakehash00.js`→200 but 919b text/html (size-check meaningful). **BE dll ALL 4 fresh in-window: Api 03:33:00Z (Controller `{contractIds}` live) · Application 03:31:04Z (CreateContractFromEvaluation multi-winner handler + PE winner-names projection live) · Infrastructure 03:31:28Z · Domain 03:30:47Z.** **Mig FROZEN 59** (repo MIGCOUNT=59 + prod history HEAD==`AddCcmBudgetPeriodToPurchaseEvaluation`==repo + HistCount=59 no-pending) + sys.tables 89 incl __EFMigrationsHistory = 88 business (no schema change). **Endpoint live: `POST /api/purchase-evaluations/{id}/create-contract` bodyless→411 (IIS Length-Required pre-auth), +json-body→401 (wired: NOT 404=route-exists, NOT 500=no-crash; `{contractIds}` multi-winner contract live).** Health api ready/live + admin + eoffice 4×200. GET /api/purchase-evaluations + /api/menus + /api/approval-workflows-v2 all 401 unauth (wired). gotcha #69-inverse re-confirmed (real fe-src ⟹ js rotates, css frozen when logic-only). ⚠️ **DB pw = `buKL3TGBkD0wDDbYVw65QeX9` (NOT `vrapp/buKL3...` — `vrapp/` was user/pw-combined-notation in memory essentials, actual Password field has no prefix; read from prod `appsettings.Production.json` ConnectionStrings.Default).** SSH→PS `$_.LastWriteTimeUtc` mangled in nested double-quote → base64 EncodedCommand worked; sqlcmd `-Q` quoting mangled → scp .sql + `-i` file worked cleanest. conn key `ConnectionStrings.Default`, prod path `C:\inetpub\solution-erp\api`. +- **S88-quad #347 (id=461) `73cce1f` PASS ~5m04s (FULL-STACK PE D1 stability, NO-MIG)** — Block-B multi-winner financials re-key (PurchaseEvaluationFeatures) + CEO-notify SaveChanges-persist (PurchaseEvaluationUrgentFeatures +5 lines) + setter RELOCATE PeSuggestedPriceFeatures→PeWorkItemBudgetFeatures (−56/+57) + HoSoLink trim + #70 guard + Dtos comment. Files 12: BE 5 (Dtos+4 features) + FE **both apps** 4 (PeDetailTabs+types ×2) + 3 test (PeHoSoLinkTests+PeWorkItemBudgetTests EXTEND, **new PeUrgentNotifyDirectorTests +237 lines**). **NO `*Migrations*`/`*Persistence*` in diff** (logic-only re-key, no schema). status=success ⟹ test gate passed (**baseline 413** = 45 Domain + 368 Infra = 402 +11; logs 404 anon so count not log-scraped — trusted gate+baseline). **Bundle JS BOTH ROTATE (real fe-src #70-guard+HoSoLink-trim ⟹ new content-hash): admin js `BABhPh2s`→`CP_iKhTu` · user js `DLulO6uP`→`DUe0fndl`** (#346 baseline); **css FROZEN admin `Pltrs5ku` user `Foiw55B6` — correct, D1 FE logic-only no new utility class**. Real-ship proven: admin js 1,628,726b Last-Modified 02:57:57Z=09:57+07 in-window (run 09:54:15→09:59:19 = 02:54:15→02:59:19Z) · user js 1,532,627b 02:58:50Z in-window · SPA-trap control `ZZfakehash00.js`→200 but 919b text/html (size-check meaningful). **BE dll ALL 4 fresh in-window: Api 02:56:42Z · Infrastructure 02:55:16Z (PeWorkItemBudgetFeatures setter-relocate live) · Application 02:54:51Z (PurchaseEvaluationFeatures Block-B + UrgentFeatures CEO-persist live) · Domain 02:54:36Z.** **Mig FROZEN 59** (MIGCOUNT=59, prod history HEAD==`AddCcmBudgetPeriodToPurchaseEvaluation`==repo, no-pending; correct NO-MIG D1) + sys.tables 88 (89 incl __EFMigrationsHistory). Health api ready/live + admin + eoffice 4×200. GET /api/purchase-evaluations + /api/menus + /api/approval-workflows-v2 all 401 unauth (wired NOT 404/500). gotcha #69-REFINE inverse re-confirmed (real fe-src ⟹ js rotates, css frozen when logic-only). conn key `ConnectionStrings.Default`, prod path `C:\inetpub\solution-erp\api` (skill-doc `\apps\...` STALE). ⚠️ SSH→PS table-count `<>'literal'` mangled via base64/CLIXML AGAIN → use count-incl-history−1 (88) workaround. diff --git a/.claude/agent-memory/test-specialist/MEMORY.md b/.claude/agent-memory/test-specialist/MEMORY.md index c82e034..e826dd7 100644 --- a/.claude/agent-memory/test-specialist/MEMORY.md +++ b/.claude/agent-memory/test-specialist/MEMORY.md @@ -15,8 +15,10 @@ WRITE specialist độc quyền `tests/**`. xUnit + FluentAssertions 7.2 + EF SQ - ❌ NOT: production code `src/Backend/**` + `fe-*/**` → test reveal bug → REPORT em main, KHÔNG fix - ❌ NOT: decide WHAT to test (test plan) → em main + reviewer chốt priority -## 📊 Baseline 419 tests = 419 PASS (45 Domain + 374 Infra) ← D2 +6 PE Mig 58 multi-winner (test-after feature + EF translation-smoke): NEW `CreateContractFromEvaluationMultiWinnerTests.cs` (Application ns, 5) cho `CreateContractFromEvaluationCommand` đổi single→multi-winner trả `List` (1 HĐ per đơn vị IsWinner). Handler `(db, ICurrentUser, IContractWorkflowService, IContractCodeGenerator)` 4-dep wire THẬT (mirror CreateContractCommandApplicableTypeTests S33): ContractCodeGenerator(db,clock)+ContractWorkflowService — BeginTransactionAsync SERIALIZABLE chạy SẠCH SQLite, KHÔNG try/skip (proven ContractCodeGeneratorTests). IdentityFixture (ChangelogService→UserManager). 5 case: (a)≥2 winner→N=2 ids·2 Contract persisted·Phase=DangSoanThao·SupplierId khớp winner (loser excluded)·**GiaTri per-winner = SUM ThanhTien báo giá của ĐÚNG winner (q.PESupplierId==winnerRow.Id)** 140/260·2 mã DISTINCT·pe.ContractId==ids[0] / (b)single winner→**GiaTri = SUM details.ThanhTienNganSach (LEGACY 800, NOT quote-total 140)**·1 HĐ·TenHopDong null→fallback TenGoiThau / (c)idempotency re-call→ConflictException`*đã tạo HĐ rồi*`+count vẫn 2 / (d)0 winner→ConflictException`*chưa chọn NCC/TP trúng thầu*`+0 HĐ / (e)not-DaDuyet(ChoDuyet)→ConflictException`*DaDuyet*`+0 HĐ. ⚠️**SEED-FK: PurchaseEvaluationQuote HARD FK PESupplierId→Supplier nav Restrict (PurchaseEvaluationConfiguration:135)** → MỖI Quote ref 1 PESupplier-row thật (random Guid→SQLite Error 19); Contract.SupplierId/ProjectId KHÔNG FK vật lý (chỉ index) nhưng handler load Project(NotFound)+supplierMap từ Suppliers thật→vẫn seed real Supplier+Project. NEW `PeListWinnerNamesProjectionTests.cs` (Application ns, 1) **TRANSLATION-SMOKE** cho EF subquery `PurchaseEvaluationListItemDto.WinnerSupplierNames` (collection-projection trong Select: `(from sw in db.PurchaseEvaluationSuppliers where ...IsWinner join Suppliers orderby Name select sup.Name).ToList()`). Target `ListApprovedPurchaseEvaluationsQuery` (sạch nhất, filter Phase==DaDuyet&&ContractId==null) — cùng subquery ở ListPE(paged)+inbox (PurchaseEvaluationFeatures.cs:627/724). **✅ EF TRANSLATE OK — KHÔNG throw InvalidOperationException trên SQLite provider**: 2-winner PE→2 names (loser excluded, orderby Name deterministic) / 1-winner→1 / 0-winner→empty. SqliteDbFixture (read-only query, no Identity). No prod bug — code đúng spec. Tag [d2, pe-mig58, multi-winner, create-contract-1-to-n, giatri-per-winner-quote-total, single-winner-legacy-budget-sum, quote-pesupplier-hard-fk-seed-real, ef-collection-projection-translates, translation-smoke, idempotency-conflict, test-after]. Prev 402 (S87 +7 PE Mig 59 CCM-budget-period setter) (test-after authz, mirror PeSuggestedPriceSetterAuthzTests): NEW `PeCcmBudgetPeriodSetterAuthzTests.cs` (Application ns) cho `SetPeCcmBudgetPeriodCommand` — Section B (THỰC HIỆN) tách 3 cột Dự án|PRO|CCM, CCM nhập "NS kỳ này" cột riêng độc-lập PRO (PRO=BudgetPeriodAmount /budget-adjust sẵn có). Handler 2-dep `(IApplicationDbContext db, ICurrentUser)`: NotFound(172-173)→role-gate Admin|CostControl else Forbidden`*CCM*`(176-181)→absolute-set CcmBudgetPeriodAmount(184)→Changelog→Save. 7 test: (1a)Admin set / (1b)CostControl set / (1c)Drafter→Forbidden+no-set / (1c-bis)Procurement→Forbidden (PRO KHÔNG nhập cột CCM dù có cột riêng) / (1d)value=0 hợp lệ+persist+validator 0-valid/âm-invalid / (1e)null=clear absolute-set (pre-seed 500tr→null→cleared, chống skip-if-null gotcha #73)+validator null-valid / (2)unknownPE→NotFound TRƯỚC authz. Validator `GreaterThanOrEqualTo(0).When(HasValue)` (budget=0 luôn hợp lệ, KHÔNG submit-guard — guard chỉ trên PRO BudgetPeriodAmount). ⚠️Changelog.UserId=Guid? KHÔNG FK User (chỉ FK PE Cascade)→FakeCurrentUser random-Guid an toàn no SQLite-19. Reuse FakeCurrentUser(params roles)+SeedPeAsync (copy từ PeSuggestedPriceSetterAuthzTests). No prod bug — code đúng spec (absolute-set + fail-closed role-gate giống price setters). Tag [s87, pe-mig59, ccm-budget-period, section-b-3col, absolute-set-null-clear, budget-0-valid, role-gate-admin-costcontrol, forbidden-no-mutate, changelog-userid-no-fk, test-after]. Prev 395 (S86b→S86d task-stated 377→395, MEMORY chưa ghi từng delta) ← S86 +3 PE drafter-notify-exclusion REGRESSION (bug-fix test-alongside, anh Kiệt FDC UAT Zalo): em main fix `PurchaseEvaluationWorkflowService.LogTransitionAsync` (~:1083-1135) khối notify "Phiếu cần bạn duyệt" (`:1117` NotifyManyAsync) +filter `&& l.ApproverUserId != evaluation.DrafterUserId` → NGƯỜI TẠO phiếu KHÔNG nhận chuông cần-duyệt phiếu mình tạo (kể cả khi config làm approver 1 Cấp). NEW `PeApproverNotifyExcludesDrafterTests.cs` (Services ns) 3: (1)⭐CORE 1-Step-2-Level: Cấp1=approverL1(actor) Cấp2={drafter,otherL2}; actorL1(≠drafter) Approve→advance Cấp2→assert NeedApproval recipients EXCLUDE drafter INCLUDE otherL2 / (2) Cấp2=CHỈ drafter→advance→recipients EMPTY (lọc xong rỗng→NotifyMany ko gọi) / (3) SANITY terminal DaDuyet: drafter VẪN nhận chuông KẾT-QUẢ "đã duyệt" (NotifyAsync block :1060 untouched) + ko NeedApproval (chống over-broad misfix). ⚠️**KEY: actor-exclusion (`!= actorUserId`) KHÔNG che bug** vì actor=approver-Cấp1, drafter=Cấp2 → identity riêng. **RED-on-old-code EMPIRICALLY PROVEN** (git stash prod file→rebuild→Test1+2 FAIL "recipients contains drafter", Test3 PASS; stash pop restore). Spy=`CapturingNotificationService` (records NotifyAsync/NotifyManyAsync recipients+title, KHÁC NoOpNotificationService nuốt) — DI ctor nhận INotificationService trực tiếp, ko cần WebApplicationFactory. Harness mirror PeCcmThresholdFinalizeTests (IdentityFixture + SQLite + SeedWorkflowAsync). Test3 terminal cần `approvedPriceAmount`+source (Mig 54 ApplyApprovedPriceOnFinalize buộc human chọn giá). ⚠️PROD-FIX uncommitted working-tree (em main) — `git diff -- file` empty/grep false-neg là artifact em main edit ĐỒNG-THỜI (gotcha #68-like + Bash-grep-VN-text), authoritative=Read-tool. No prod touch (chỉ verify qua stash, restore exact). Tag [s86, pe-drafter-notify-exclusion, notify-recipients-spy, capturing-notification-fake, actor-exclusion-not-cover-bug, red-proven-via-stash, mirror-ccm-harness, test-alongside-bugfix]. Prev 374 ← S85b +3 PE UpdateDraft WF-preserve ROOT-FIX bug-class S42 (test-after BUG-FIX disc): em main fix `UpdatePurchaseEvaluationDraftCommandHandler` (PurchaseEvaluationFeatures.cs:285) ABSOLUTE-SET→NULL-SAFE `if(request.ApprovalWorkflowId is not null) entity.ApprovalWorkflowId=...` (form Sửa header KHÔNG gửi WF → trước = CLEAR WF → kết submit "chưa chọn quy trình" whack-a-mole). NEW `PeUpdateDraftWorkflowPreserveTests.cs` 3: (1) PRESERVE phiếu Nháp WF=W + UpdateDraft ApprovalWorkflowId=null (field text có giá trị) → entity GIỮ W (reproduce: trước-fix null, sau-fix W) + sanity TenGoiThau/DiaDiem vẫn update / (2) CHANGE WF=W1 + gửi W2 (≠null) → đổi W2 (null-safe chỉ chặn null KHÔNG chặn đổi) / (3) bonus mirror BudgetPeriodAmount null-safe S61 (cùng pattern bug-class S42). ⚠️GOTCHA: `PurchaseEvaluation.ApprovalWorkflowId` FK Restrict thật → PE seed PHẢI ref WF row thật (random Guid → SQLite Error 19 FK fail; lần đầu RED). Fix: `SeedWorkflowAsync(db, code)` ApplicableType=DuyetNcc khớp PE Type (CHANGE case validate block line 253-266 cũng cần WF thật); PRESERVE case request-null short-circuit validate NHƯNG seed vẫn cần FK hợp lệ. IdentityFixture (Changelog Add). No prod bug — code đúng spec sau fix. Tag [s85b, pe-updatedraft, wf-preserve, root-fix-bug-class-s42, null-safe-guard, absolute-set→null-safe, approvalworkflowid-fk-restrict-seed-real, mirror-budget-nullsafe, test-after-bugfix]. Prev 371 (S85 +5 PE urgent DRAFTER-self-unset) ← S85 +5 PE urgent DRAFTER-self-unset (test-after authz, mirror PeUrgentToggle): em main S85 restructure handler `PurchaseEvaluationUrgentFeatures.cs` thêm nhánh UNSET cho NGƯỜI KHAI (`isDrafter = currentUser.UserId == entity.DrafterUserId`) → drafter GỠ clear CẢ 2 cờ (giống Admin), SET vẫn role-only (drafter KHÔNG tự gắn). EXTEND `PeUrgentToggleAuthzTests.cs` 11→16: FakeCurrentUser.UserId→`init` (settable) + SeedPeAsync +`drafterUserId` opt param. NEW 5: (10) Drafter role-thường UNSET→clear cả 2 no-Forbidden (pre-seed ByPro để prove CLEAR) / (11) Finance(non-drafter non-TP) UNSET→Forbidden`*GỠ*`+no-mutate cả 2 / (12) Drafter SET→Forbidden`*đánh dấu*` (drafter chỉ gỡ, không gắn) / (13) Drafter UNSET chỉ-ByCcm-bật→clear cả 2 (drafter-clear độc lập cờ-đang-bật) / (14) Drafter+Procurement-no-DeptManager UNSET→clear CẢ 2 qua nhánh isDrafter (đối chứng test6 TP-PRO chỉ clear cờ-vai — isDrafter ưu tiên/độc lập isProTp). 11 test S77c cũ vẫn xanh (không động nhánh drafter). No prod bug — code đúng spec S85. Prev baseline 366 (task-stated, S78-S84 thêm test MEMORY chưa ghi). Tag [s85, pe-urgent, drafter-self-unset, clear-both, set-role-only, isdrafter-priority-over-isProTp, no-mutate-on-forbidden, test-after] ← S77c CORRECTION urgent-toggle SYMMETRIC→ASYMMETRIC (S77b symmetric tests RED vs prod): anh chốt FINAL gate BẤT-ĐỐI-XỨNG theo `request.IsUrgent` — em main đã sửa prod `PurchaseEvaluationUrgentFeatures.cs:49-55` `isPro = IsUrgent ? hasPro : (hasPro && isDeptManager)` + `isCcm = IsUrgent ? hasCcm : (hasCcm && isDeptManager)`; Forbidden-msg nhánh-theo-IsUrgent (SET `*đánh dấu phiếu gấp*` / UNSET `*GỠ cờ gấp*`). REWRITE `PeUrgentToggleAuthzTests.cs` 12→11: **SET = role-chức-năng-đủ** (plain Procurement SET→OK ByPro / plain CostControl SET→OK ByCcm / Admin SET→both) — bỏ hết 2b/2c/2d DeptManager-alone-restriction của S77b (không còn áp cho SET); **UNSET = role AND DeptManager** (plain-PRO UNSET→Forbidden`*GỠ*`+no-mutate flag-still-true pre-seed urgent / plain-CCM UNSET→Forbidden / PRO+DM UNSET→clear-ByPro CCM-preserved / CCM+DM UNSET→clear-ByCcm PRO-preserved / Admin UNSET→both-clear); 9a Drafter-SET→Forbidden`*đánh dấu*` / 9b Finance-SET→Forbidden / 9c UnknownPe→NotFound TRƯỚC authz. No prod touch — prod ĐÃ asymmetric, test theo CODE (S34). Prev S77b 354 (symmetric, superseded) ← S77 +7 PE Mig 57 suggested-price NOTE (test-after, mirror S74 §4b CcmNote): `UpdatePeSuggestedPricePro/CcmCommand` +`Note` (string?) absolute-set→`Pro/CcmSuggestedPriceNote` (overwrite always incl null=clear); rides SAME role-gate as price (PRO/Admin · CCM/Admin) fail-closed TRƯỚC side-effect; validator `Note.MaximumLength(1000)`. Handler ctor `(db, ICurrentUser)` 2-dep + record arity UNCHANGED on existing args (Note=null default → 5 existing `new UpdatePeSuggestedPrice*Command(...)` call-sites still compile, KHÔNG cần vá). NEW 7 → `PeSuggestedPriceSetterAuthzTests.cs`: PRO-note+Min/Max persist (note KHÔNG clobber price) / Admin-PRO-note / CCM-note+price persist / null-clear PRO (pre-seed note→null=cleared) / null-clear CCM / non-priv→Forbidden+note&price unchanged (no partial-write) / PRO↔CCM note independent + validator 1001-char invalid·1000 valid. No prod bug — code đúng spec (note absolute-set + rides price gate, intentional). Prev 344 ← S76 +5 PE Mig 56 PRO-column-split (spec-change+compile-fix arity): UpdatePeBudgetProCommand record 3→4 param `(PeId, ProInitialAmount, ProAdjustmentAmount, ProNote)`; handler set ProInitial+ProAdjust absolute-set (KHÔNG còn ProEstimateAmount). Vá 5 PRO call-site `new UpdatePeBudgetProCommand(...)` thêm arg ProAdjust + rename assert `.ProEstimateAmount`→`.ProInitialAmount` (handler giờ set ProInitial). Capability `FullAmount`: hasCcm?CCM:proFull(ProInitial+ProAdjust); FullIsEstimate=!hasCcm&&hasPro; DTO +2 field cuối ProInitial/ProAdjust. NEW 5: PRO set both incl ProAdjust ÂM persist / validator ProInitial<0 invalid + ProAdjust ÂM valid (mirror CCM no-sign-constraint) / full=proFull(100+50=150)+DTO-surface / full=proFull ÂM-adjust(100-30=70 no-clamp). Full-fallback seed `ProEstimateAmount=500`→`ProInitialAmount=500` (capability đọc ProInitial). **Handler ctor `(db, ICurrentUser)` 2-dep UNCHANGED**. ProEstimateAmount=LEGACY (Mig 56 backfill→ProInitial, FE bỏ). No prod bug. Prev 339 ← S74 +5 PE Mig 55 CcmNote (compile-fix arity + test-after): UpdatePeBudgetCcmCommand record +`string? CcmNote` (4 param) → fix 3 existing `new UpdatePeBudgetCcmCommand(...)` thêm `null` arg4 (PeWorkItemBudgetTests.cs line 388/407/421); NEW 5 test mirror ProNote: CostControl-set / Admin-set / null=clear-absolute-set (pre-seed prove not vốn-dĩ-null) / Procurement→Forbidden no-mutate (fail-closed role-gate TRƯỚC EnsureTrackedAsync+side-effect, AsNoTracking re-read) / Initial+Adjustment+CcmNote all-persist-together. **Handler ctor `(db, ICurrentUser)` 2-dep UNCHANGED** — chỉ COMMAND record +CcmNote. No prod bug. Prev 334 ← S72 +28 PE Mig 54 (spec-change+test-after): PeCcmThresholdFinalizeTests 6→11 (AUTO→OPT-IN finalizeByCcmDelegation) + NEW PeApprovedPriceFinalizeTests 10 (giá chốt) + NEW PeSuggestedPriceSetterAuthzTests 13 (2 setter role-gate). Prev 306 ← S69b +14 PE 2 feature anh Kiệt FDC (test-before-merge SECURITY/FINANCIAL): `PeCcmThresholdFinalizeTests.cs` (5, Services ns, value-threshold CCM-finalize ApproveV2Async) + `PeUrgentToggleAuthzTests.cs` (9, Application ns, urgent-toggle role authz). Prev 292 ← S69 +6 Office golive permission-seed (`OfficeModulePermissionSeedTests.cs`, test-after, mirror HrmProfilePermissionSeedTests S67). Prev 286 ← S67 +23 HRM test-after [DepartmentTreeTests 8 cycle-guard/rollup/orphan + PeHoSoLinkTests 9 absolute-set (⚠️spec-drift: HoSoLink gửi null=CLEAR, KHÔNG null-safe như Budget*/WorkItemId) + HrmProfilePermissionSeedTests 6 reflection private-static revoke→seed chain]. **em main PROXY-RECORD** — return truncated #53 (chết lúc update MEMORY), 3 file delivered + `dotnet test` 286 PASS verify-on-disk. Prev 263 (S61 +22 PeWorkItemBudget −14 BudgetPolicy; Domain 58→45 drop Budget module). Pre = 254 (S60). -> Pattern S67: private-static seed/init → invoke qua REFLECTION (`GetMethod(name, NonPublic|Static)` + `Invoke(null, [db, roleManager, NullLogger.Instance])`); seed MenuItem rows TRƯỚC Permission (FK MenuKey→MenuItem.Key Cascade, SQLite Error 19 nếu thiếu). Cycle-guard test: SqliteDbFixture đủ (no User); rollup-count test cần IdentityFixture (đếm User.DepartmentId active). +## 📊 Baseline: 419 tests = 419 PASS (45 Domain + 374 Infra) as of D2 +- Count history + verbose per-session test-design notes (S54→D2): [archive/baseline-history.md](archive/baseline-history.md) (L2, on-demand). +- Latest (D2): +6 PE Mig 58 multi-winner — `CreateContractFromEvaluationMultiWinnerTests.cs` (5, 1→N HĐ per IsWinner, GiaTri per-winner=quote-total / single=legacy-budget-sum) + `PeListWinnerNamesProjectionTests.cs` (1, EF collection-projection translation-smoke). No prod bug. +> Pattern S67: private-static seed/init → invoke qua REFLECTION (`GetMethod(name, NonPublic|Static)` + `Invoke(null, [db, roleManager, NullLogger.Instance])`); seed MenuItem rows TRƯỚC Permission (FK MenuKey→MenuItem.Key Cascade, SQLite Error 19 nếu thiếu). Cycle-guard test: SqliteDbFixture đủ (no User); rollup-count test cần IdentityFixture. Run: `dotnet test SolutionErp.slnx --nologo --verbosity minimal -p:BuildInParallel=false -maxcpucount:1` (MSBuild OOM → serialize build) ### ⚠️ Pattern: deduction hook FK → seed LeaveType cho terminal test (S43) @@ -52,22 +54,16 @@ Test theo CODE (single source truth), document mismatch header comment + report. 4. Phase 10.3 Proposal ApproveV2 (S37) + Workflow Apps skeleton (S38) — test-after khi UAT confirm 5. **gotcha #57 (S51+S52 REPRODUCED):** HRM `HrmConfigFilteredUniqueTests` 2 RED (LeaveType+Shift+OtPolicy) → em main Mig 45 `.HasFilter` GREEN. **S52 EXT Master** `MasterCatalogFilteredUniqueTests` 3 RED (Department cfg:18 / Project:19 / Supplier:24 bare `.IsUnique()`) → pending em main fix migration. Vehicle+Driver (Mig 44) ĐÃ filtered. Pattern: seed `IsDeleted=true` slot + Create cùng Code → assert active==1 + `IgnoreQueryFilters` all==2. -## 📅 Recent activity (last 10 FIFO) +## 📅 Recent activity (one-line FIFO — verbose in [archive/baseline-history.md](archive/baseline-history.md)) -- **2026-06-19 (S77 PE Mig 57 suggested-price NOTE — test-after, mirror S74 §4b CcmNote):** +7 test `tests/.../Application/PeSuggestedPriceSetterAuthzTests.cs` → **344→351 PASS** (45 Domain + Infra 299→306, 0 fail). BE done+builds (Mig 57 `AddPeSuggestedPriceNotes`, em main; entity `PurchaseEvaluation` +`ProSuggestedPriceNote`/`CcmSuggestedPriceNote` string? nvarchar(1000)). **SPEC:** `UpdatePeSuggestedPriceProCommand` +`Note` (string?, 4th param, default null) → absolute-set `pe.ProSuggestedPriceNote` (overwrite always incl null=clear, line 67); `UpdatePeSuggestedPriceCcmCommand` +`Note` (3rd param) → `pe.CcmSuggestedPriceNote` (line 127). Note **rides SAME role-gate as price** (PRO/Admin · CCM/Admin) — gate fail-closed AFTER NotFound, BEFORE mutate (PeSuggestedPriceFeatures.cs: NotFound 51-52 → role-gate 55-60/117-122 → set 65-67/126-127). Validator `Note.MaximumLength(1000)`. **⚠️ Handler ctor `(IApplicationDbContext db, ICurrentUser)` 2-dep UNCHANGED + record `Note=null` default → 5 existing `new UpdatePeSuggestedPrice*Command(...)` call-sites still compile, KHÔNG cần vá arity** (khác S74/S76 phải vá). **NEW 7:** (1) PRO Procurement set note + Min/Max all-persist (note KHÔNG clobber price) / (1b) Admin set PRO note / (2) CCM CostControl set note + price / (3) null-clear PRO (pre-seed note="cũ" trên tracked-pe → Note=null → cleared, AsNoTracking re-read; same-context tracked-instance pattern §4b) / (3b) null-clear CCM / (4) non-priv (CostControl→PRO-cmd) → Forbidden + note&price unchanged (no partial-write, fail-closed) / (5) PRO↔CCM note independent (set both seq, neither clobbers) + validator 1001-char invalid · 1000 valid both cmds. **No prod bug** — code đúng spec (note absolute-set + rides existing price gate, intentional; mirror Pro/CcmNote ngân sách S61/S74). Reuse `FakeCurrentUser(params roles)` + `SeedPeAsync` helper sẵn có trong file (S73). Tag [s77, pe-mig57, suggested-price-note, absolute-set-null-clear, note-rides-price-gate, fail-closed-no-mutate, no-arity-fix-needed, mirror-ccmnote, test-after]. -- **2026-06-19 (S76 PE Mig 56 PRO-column-split — SPEC-CHANGE + compile-fix arity + test-after):** +5 test `PeWorkItemBudgetTests.cs` → **339→344 PASS** (45 Domain + Infra 294→299, 0 fail). BE done+builds (Mig 56 `AddProBudgetSplitToPeWorkItemBudget`, em main). **SPEC:** `UpdatePeBudgetProCommand` record 3→**4 param** `(PeId, ProInitialAmount, ProAdjustmentAmount, ProNote)` (mirror CCM Initial/Adjustment); handler set `rec.ProInitialAmount + rec.ProAdjustmentAmount` absolute-set (KHÔNG còn `ProEstimateAmount`). Validator `ProInitialAmount>=0` when HasValue, `ProAdjustmentAmount` KHÔNG ràng dấu (ÂM OK), ProNote max1000. **⚠️ Handler ctor `(IApplicationDbContext db, ICurrentUser)` 2-dep UNCHANGED** — chỉ COMMAND record đổi arity. Capability `PeBudgetSummaryDto.FullAmount` (PurchaseEvaluationFeatures.cs:849-864): `hasPro = ProInitial∥ProAdjust not-null`; `proFull = ProInitial+ProAdjust`; `full = hasCcm ? CCM(Initial+Adjustment) : proFull`; `FullIsEstimate = !hasCcm && hasPro`. DTO +2 field cuối `ProInitialAmount`,`ProAdjustmentAmount`. **Compile-fix:** 5 PRO call-site `new UpdatePeBudgetProCommand(...)` thêm arg ProAdjust (regex `\([^,]+,[^,]+,[^,)]+\)` = 0 hit sau vá xác nhận hết 3-arg). **Assertion-vá:** 5 PRO-handler test `.ProEstimateAmount`→`.ProInitialAmount` (handler giờ set ProInitial). **Full-fallback seed-vá:** capability đọc ProInitial → `ProEstimateAmount=500m`→`ProInitialAmount=500m` (2 chỗ region 5 + 1 CanEdit seed). **NEW 5:** (1) PRO set both ProInitial+ProAdjust ÂM(-20tr)+note all-persist 1-lệnh / (2) validator ProInitial<0 invalid (khác ProAdjust) / (3) validator ProAdjust ÂM valid (mirror CCM no-sign-constraint) / (4) full=proFull(100+50=150)+DTO surface ProInitial/ProAdjust riêng / (5) full=proFull ÂM-adjust(100-30=70 no-clamp = tổng đại số). CCM-present test thêm seed PRO(500+20) chứng minh PRO bị bỏ qua trong full. **No prod bug** — code đúng spec (PRO mirror CCM, ProAdjust ÂM intentional, ProEstimateAmount=LEGACY Mig 56 backfill→ProInitial FE bỏ). Tag [s76, pe-mig56, pro-column-split, spec-change, compile-fix-arity, proadjust-negative-allowed, profull-no-clamp, mirror-ccm, full-fallback, test-after]. -- **2026-06-18 (S74 PE Mig 55 CcmNote — compile-fix arity + test-after):** +5 test `PeWorkItemBudgetTests.cs` → **334→339 PASS** (45 Domain + Infra 289→294, 0 fail). Mig 55 additive: `PeWorkItemBudget.CcmNote` (string? nvarchar(1000)) + `UpdatePeBudgetCcmCommand` record 3→**4 param** `(PeId, InitialAmount, AdjustmentAmount, CcmNote)` + DTO `PeBudgetSummaryDto +CcmNote` (slot after AdjustmentAmount). **⚠️ Handler ctor `UpdatePeBudgetCcmCommandHandler(IApplicationDbContext db, ICurrentUser)` 2-dep UNCHANGED** — chỉ COMMAND record đổi arity, KHÔNG đụng handler signature. **Compile-fix:** grep `new UpdatePeBudgetCcmCommand` toàn tests/ = 3 hit (line 388/407/421 PeWorkItemBudgetTests), thêm `null` arg4 mỗi cái. **NEW 5 test (region 4b, mirror ProNote pattern S61):** (1) CostControl set CcmNote→persist / (2) Admin set→persist / (3) **null=clear absolute-set** (pre-seed CcmNote="cũ" → null request → BeNull, chứng minh CLEAR không phải vốn-dĩ-null) / (4) **Procurement→ForbiddenException + record no-mutate** (fail-closed: role-gate line 152-157 TRƯỚC WorkItemId-check + EnsureTrackedAsync + side-effect; AsNoTracking re-read assert CcmNote/Initial/Adjustment giữ nguyên) / (5) Initial+Adjustment+CcmNote all-persist-together 1 lệnh. Handler `rec.CcmNote = request.CcmNote` absolute-set; changelog "ghi chú CCM cập nhật" khi `oldCcmNote != request.CcmNote`. **No prod bug** — code đúng spec (mirror ProNote, fail-closed role-gate giống Initial/Adjustment). Tag [s74, pe-mig55, ccmnote, compile-fix-arity, absolute-set-null-clear, fail-closed-no-mutate, mirror-pronote, test-after]. -- **2026-06-18 (S72 PE Mig 54 anh Kiệt FDC — SPEC-CHANGE + 2 test-after FINANCIAL):** +28 test → **306→334 PASS** (45 Domain + Infra 261→289, 0 fail). BE Mig 54 committed+builds. Mig 54 fields PE: `ProSuggestedMin/MaxPrice` + `CcmSuggestedPrice` + `ApprovedPriceAmount` + `ApprovedPriceSource`; `TransitionAsync`/`ApproveV2Async` +3 param `finalizeByCcmDelegation`(bool) + `approvedPriceAmount`(decimal?) + `approvedPriceSource`(string?). **① SPEC-CHANGE CCM-finalize AUTO→OPT-IN — UPDATE `PeCcmThresholdFinalizeTests` 6→11 (Services ns):** S69b AUTO (gói=ceoThreshold`→Conflict, strict-`<` giữ nguyên) → ApplyApprovedPriceOnFinalize(BẮT BUỘC giá chốt human)→DaDuyet. ApproveAsync helper +3 optional param. Cover: flag-true+ngưỡng→Conflict (no-mutation reload-assert) / flag-true non-CCM→Forbidden / flag-true threshold-null→Conflict / flag-true slot-cuối+giá→DaDuyet 1-Approval no-double / flag-true đủ-ĐK null-giá→Conflict("giá chốt"). **② NEW `PeApprovedPriceFinalizeTests` 10 (Services ns) — ApplyApprovedPriceOnFinalize (private-static):** terminal DaDuyet normal-advance human valid-price→bind / null-price human→Conflict NOT-finalized(ChoDuyet reload) / garbage-source→Conflict / Theory 4 valid-source {Ncc,ProMin,ProMax,Ccm} each-set + **isSystem null-price→no-throw no-set qua REFLECTION** (⚠️OBSERVATION report: isSystem KHÔNG reachable qua public ApproveV2Async — approve-branch gate `decision==Approve` còn isSystem cần `AutoApprove`; PE no SLA-auto-job chỉ Contract SlaExpiryJob → isSystem-exempt = defensive/dead qua V2-approve; test contract mức UNIT) + đối-chứng isSystem-false→Conflict + isSystem-true amount+garbage-source→Conflict. Reflection unwrap TargetInvocationException→inner. **③ NEW `PeSuggestedPriceSetterAuthzTests` 13 (Application ns) — 2 setter handler 2-dep db+ICurrentUser mirror PeWorkItemGuard:** PRO-cmd Procurement/Admin set Min/Max·CostControl/Drafter→Forbidden+no-set·validator Min>Max invalid+negative invalid+single/null valid·unknown-PE→NotFound(existence TRƯỚC authz). CCM-cmd CostControl/Admin set·Procurement→Forbidden·validator negative invalid·NotFound. **No prod bug** — code đúng spec (OPT-IN finalize an-toàn-hơn AUTO, fail-closed order intentional). FakeCurrentUser configurable-roles. Tag [s72, pe-mig54, ccm-finalize-opt-in, spec-change, approved-price, applyapprovedprice-private-static-reflection, issystem-unreachable-observation, suggested-price-setter-authz, fail-closed, test-after]. -- **2026-06-17 (S69b PE 2 feature anh Kiệt FDC — test-before-merge SECURITY+FINANCIAL workflow):** +14 test → **292→306 PASS** (45 Domain + Infra 247→261, 0 fail). BE done+builds, mirror harness PeSubmitGuardAndBypassTests/PeWorkItemGuardTests. **FEATURE B value-threshold CCM-finalize (`PeCcmThresholdFinalizeTests.cs` 5, Services ns, ApproveV2Async line 816-854):** NV duyệt role=CostControl + `aw.CeoApprovalThreshold!=null` + `winnerQuoteTotal < ngưỡng` + chưa-slot-cuối → Phase=DaDuyet bỏ CEO + pointers/SLA null. **⭐ BOUNDARY load-bearing: predicate `winnerQuoteTotal < ceoThreshold` STRICT-less-than (line 838)** → gói==đúng-ngưỡng = KHÔNG finalize = advance. Cover: (1)⭐LOAD-BEARING CCMngưỡng→advance / (3) threshold-null→advance kể-cả-CCM+gói-1đ (backward-compat) / (4) non-CCM(PRO)PRO>CCM intentional). FakeCurrentUser configurable-roles ctor. Reuse NoOpNotificationService internal qua `using ...Tests.Services`. Tag [s69b, pe-ccm-threshold-finalize, value-threshold, strict-less-than-boundary, role-based-routing, urgent-toggle-authz, forbidden-no-mutation, else-if-short-circuit, test-before-merge]. -- **S69 (aged to one-line):** Office golive permission-seed regression +6 `OfficeModulePermissionSeedTests.cs` (test-after SECURITY). Mirror HrmProfilePermissionSeedTests reflection harness (2 private-static revoke→seed via GetMethod NonPublic|Static; MenuItem rows TRƯỚC Permission FK Cascade). KHÁC HRM: Office grant Read AND Create trên 16-key allow-list. Load-bearing: excluded-3 (OffPhongHopManage/OffAttendanceReport/OffChamCong) stay hidden + upgrade-only preserves admin-raised Update/Delete. No prod bug. - -- **2026-06-12 (S60 UAT anh Kiệt — 2 feature PE submit branch, test-after build PASS):** +14 test `tests/.../Services/PeSubmitGuardAndBypassTests.cs` → **240→254 PASS** (58 Domain + Infra 182→196, 0 fail). Mirror `PurchaseEvaluationWorkflowServiceGuardTests` (IdentityFixture+SQLite, reuse `NoOpNotificationService` internal). **F1 Section 3 guard (8):** submit branch (DangSoanThao/TraLai→ChoDuyet) build `missing` list 4 mục → ConflictException msg gộp prefix `'Chưa đủ thông tin mục 3 "Đơn vị NCC/TP được chọn"...'` + join `' · '`. Cover: thiếu cả 4 / winner-only / winner+quote=0 / budget (cả null+manual=0) / comparison / **attachment gắn NCC (PES_Id!=null) KHÔNG đếm bảng so sánh = vẫn Conflict** (predicate PES_Id==null) / đủ-4-manual-budget→ChoDuyet / đủ-4-BudgetId→ChoDuyet. **F2 drafter-bypass (6, V2-only `ApplyDrafterBypassOnSubmitAsync`):** k=drafterSlots.Max(Order) bước đầu → auto Cấp 1..k. Cover: drafter=TP(2/2)+2bước→StepIdx=1/Lvl=1+opinion 1 row slot TP+2 AutoApprove / drafter=NV(1/2)→Lvl=2 cùng bước+opinion slot NV / drafter ngoài bước đầu→KHÔNG bypass StepIdx=0 Lvl=1 0-auto / 1-bước+drafter cấp cuối→DaDuyet pointers null SLA null / V1(awId null)→submit OK no-bypass no-crash / TraLai-resubmit→bypass áp lại opinion UPSERT 1 row + approval cộng dồn 2 vết. **⚠️ GUARD-FIRST:** mọi bypass-test PHẢI dựng PE đủ 4 ĐK Section 3 (winner+quote>0+manual-budget+comparison-attach) qua guard. **Seed pattern S60:** `SeedWinnerWithQuoteAsync`(PES+Detail+Quote ThanhTien) map winner→quote sum · `SeedComparisonAttachment`(PES_Id=null) · `SeedWorkflowAsync(Guid[][] stepApprovers)` build multi-step V2 1-NV/cấp. **Opinion-only-ownSlot invariant:** bypass cấp NV skip KHÔNG ghi opinion (chỉ Approval AutoApprove + Changelog vết); assert `opinions.HaveCount(1)` + `ApprovalWorkflowLevelId==drafterSlot.Id`. **No prod bug** — code đúng spec, test theo CODE (S34 rule). Tag [s60, pe-submit-guard, section3-completeness, drafter-bypass, v2-only, guard-first, opinion-ownslot-only, test-after]. - - - - -- **S54 (aged to one-line):** ItTicket reassign authz +13 test `ItTicketReassignAuthzTests.cs` (test-before-merge SECURITY). Pattern: authz-capability = seed 2-dept (IT+KT) + fake `ICurrentUser` role/dept matrix → assert CanReassign flag + Forbidden/Conflict guard + **empty-staff 0-leak** + side-effect no-mutation. Forbidden red-able BY-CONTRAST (non-IT vs IT-staff identical-setup, chỉ khác caller-identity). Data-driven handler-authz = enforcement point (KHÁC Pattern 10 reflection chỉ cho static `[Authorize]`). No prod bug. -- **S51-S52 (aged to L2 — `archive/activity-s51-s52.md`):** P11-C/D/E/F + gotcha #57 EXT — filtered-unique RED (LeaveType/Shift + Master Dept/Proj/Supplier bare `.IsUnique()` → em main `.HasFilter` Mig 45/47) · ItTicket round-robin+SLA-due · WorkflowApps codegen + Attendance day-type · Serializable-on-SQLite = NON-ISSUE proven. +- **2026-06-26 go-live ChangePassword (test-before-merge SECURITY) — BLOCKED by prod compile bug, REPORTED em main:** `ChangePasswordCommandTests.cs` 10 test WRITTEN, KHÔNG chạy được. Prod `ChangePasswordCommand.cs:49 throw new ValidationException(failures)` = CS0104 AMBIGUOUS (`using FluentValidation;` + `using ...Common.Exceptions;` cùng có `ValidationException`); file untracked, slnx+tests KHÔNG compile. Fix em main = fully-qualify custom exception. **Spec rerun:** custom `ValidationException.Errors` = `Dictionary` key=PropertyName (KHÔNG list); IdentityFixture RequiredLength=4 → 12-char là VALIDATOR enforce; tạo user qua `UserManager.CreateAsync(user,"")` trực tiếp; `FakeCurrentUser{UserId init;IsAuthenticated init}`. Kỳ vọng 419→429 khi build xanh. +- **S87** +7 PE Mig 59 CCM-budget-period setter authz (`PeCcmBudgetPeriodSetterAuthzTests.cs`, role-gate Admin|CostControl, null=clear gotcha #73). → 402. +- **S86** +3 PE drafter-notify-exclusion REGRESSION (bug-fix test-alongside; `PeApproverNotifyExcludesDrafterTests.cs`, RED-proven-via-git-stash, CapturingNotificationService spy). +- **S85b** +3 PE UpdateDraft WF-preserve ROOT-FIX (null-safe guard, ApprovalWorkflowId FK Restrict seed-real). **S85** +5 PE urgent DRAFTER-self-unset (isDrafter clear-both). +- **S77c** urgent-toggle SYMMETRIC→ASYMMETRIC correction (SET=role-đủ / UNSET=role AND DeptManager). **S77** +7 suggested-price NOTE (rides price-gate, no-arity-fix). **S76** +5 PRO-column-split (ProInitial/ProAdjust, ProAdjust ÂM-OK). **S72** +28 Mig 54 (CCM-finalize OPT-IN + ApprovedPrice private-static-reflection + isSystem-unreachable OBSERVATION). +- **S69b** +14 PE CCM-threshold-finalize (strict-`<` boundary) + urgent-toggle authz (test-before-merge). **S69** +6 Office permission-seed regression (reflection harness, 16-key Read+Create). +- **S60** +14 PE submit Section-3 guard + drafter-bypass V2-only (GUARD-FIRST; opinion-ownSlot invariant; `PeSubmitGuardAndBypassTests.cs`). +- **S54** +13 ItTicket reassign authz (2-dept matrix, Forbidden red-able BY-CONTRAST, empty-staff 0-leak). **S51-S52** (L2 `archive/activity-s51-s52.md`) filtered-unique RED→Mig45/47 + WorkflowApps codegen + Serializable-on-SQLite NON-ISSUE. --- ## ⚠️ Anti-patterns (DO NOT) diff --git a/.claude/agent-memory/test-specialist/archive/baseline-history.md b/.claude/agent-memory/test-specialist/archive/baseline-history.md new file mode 100644 index 0000000..c2213df --- /dev/null +++ b/.claude/agent-memory/test-specialist/archive/baseline-history.md @@ -0,0 +1,59 @@ +--- +name: baseline-history +description: L2 archive — verbose test-count history chain + aged FIFO entries (S54→D2). On-demand only; MEMORY.md index keeps one-liners. +metadata: + type: project +--- + +# Baseline count history (verbose) + aged FIFO + +> Moved out of `MEMORY.md` index 2026-06-26 (index over 24KB read cap). Each entry was a full test-design note; detail also recoverable from the test files + session logs. Newest first. + +## Count progression (one-line chain) +254 (S60) → 263 (S61 +22 PeWorkItemBudget, −14 BudgetPolicy Domain drop) → 286 (S67 +23 HRM) → 292 (S69 +6 Office) → 306 (S69b +14 PE) → 334 (S72 +28 PE Mig54) → 339 (S74 +5 CcmNote) → 344 (S76 +5 PRO-split) → 351 (S77 +7 suggested-price NOTE) → 354 (S77b symmetric, superseded) → 366 (S78-S84, MEMORY chưa ghi từng delta) → 371 (S85 +5 urgent drafter-unset) → 374 (S85b +3 UpdateDraft WF-preserve) → 377-395 (S86-S86d) → 402 (S87 +7 CCM-budget-period) → **419 (D2 +6 PE Mig58 multi-winner + translation-smoke)**. + +## D2 — PE Mig 58 multi-winner (test-after + EF translation-smoke), +6 → 419 +`CreateContractFromEvaluationMultiWinnerTests.cs` (Application ns, 5) cho `CreateContractFromEvaluationCommand` single→multi-winner trả `List` (1 HĐ per đơn vị IsWinner). Handler 4-dep `(db, ICurrentUser, IContractWorkflowService, IContractCodeGenerator)` wire THẬT (mirror CreateContractCommandApplicableTypeTests S33): ContractCodeGenerator(db,clock)+ContractWorkflowService — BeginTransactionAsync SERIALIZABLE chạy SẠCH SQLite, KHÔNG try/skip. IdentityFixture. 5 case: (a)≥2 winner→2 ids·2 Contract·Phase=DangSoanThao·SupplierId khớp winner·**GiaTri per-winner = SUM ThanhTien báo giá của ĐÚNG winner (q.PESupplierId==winnerRow.Id)** 140/260·2 mã DISTINCT·pe.ContractId==ids[0] / (b)single→**GiaTri = SUM details.ThanhTienNganSach (LEGACY 800, NOT quote-total 140)**·1 HĐ·TenHopDong null→fallback TenGoiThau / (c)idempotency→ConflictException`*đã tạo HĐ rồi*`+count 2 / (d)0 winner→Conflict`*chưa chọn NCC/TP trúng thầu*`+0 HĐ / (e)not-DaDuyet→Conflict`*DaDuyet*`+0 HĐ. ⚠️**SEED-FK: PurchaseEvaluationQuote HARD FK PESupplierId→Supplier Restrict (cfg:135)** → mỗi Quote ref 1 PESupplier-row thật (random Guid→SQLite 19); Contract.SupplierId/ProjectId no FK vật lý nhưng handler load Project(NotFound)+supplierMap→seed real. `PeListWinnerNamesProjectionTests.cs` (1) TRANSLATION-SMOKE cho EF subquery `WinnerSupplierNames` collection-projection → **EF TRANSLATE OK no InvalidOperationException trên SQLite**: 2/1/0-winner. SqliteDbFixture read-only. No prod bug. + +## S87 — PE Mig 59 CCM-budget-period setter (test-after authz), +7 +`PeCcmBudgetPeriodSetterAuthzTests.cs` cho `SetPeCcmBudgetPeriodCommand` — Section B 3-cột Dự án|PRO|CCM, CCM nhập "NS kỳ này" cột riêng độc-lập PRO. Handler 2-dep: NotFound→role-gate Admin|CostControl else Forbidden`*CCM*`→absolute-set CcmBudgetPeriodAmount→Changelog→Save. 7 test: Admin/CostControl set · Drafter/Procurement→Forbidden+no-set · value=0 valid+validator(0-valid/âm-invalid) · null=clear (pre-seed 500tr, gotcha #73)+validator null-valid · unknownPE→NotFound TRƯỚC authz. Validator `GreaterThanOrEqualTo(0).When(HasValue)`. ⚠️Changelog.UserId Guid? no FK User → random-Guid an toàn. No prod bug. + +## S86 — PE drafter-notify-exclusion REGRESSION (bug-fix test-alongside), +3 +em main fix `PurchaseEvaluationWorkflowService.LogTransitionAsync` (~:1083-1135) khối notify "Phiếu cần bạn duyệt" +filter `&& l.ApproverUserId != evaluation.DrafterUserId` → người tạo phiếu KHÔNG nhận chuông cần-duyệt phiếu mình tạo. `PeApproverNotifyExcludesDrafterTests.cs` (Services ns) 3: (1)CORE 1-Step-2-Level Cấp1=approverL1(actor) Cấp2={drafter,otherL2}; actorL1 Approve→advance→NeedApproval recipients EXCLUDE drafter INCLUDE otherL2 / (2)Cấp2=CHỈ drafter→recipients EMPTY / (3)SANITY terminal DaDuyet drafter VẪN nhận chuông KẾT-QUẢ. ⚠️**actor-exclusion KHÔNG che bug** (actor=Cấp1, drafter=Cấp2). **RED-on-old-code PROVEN qua git stash**. Spy=`CapturingNotificationService` (records recipients+title). No prod touch (verify qua stash, restore exact). + +## S85b — PE UpdateDraft WF-preserve ROOT-FIX bug-class S42 (test-after bug-fix), +3 +em main fix `UpdatePurchaseEvaluationDraftCommandHandler` (PurchaseEvaluationFeatures.cs:285) ABSOLUTE-SET→NULL-SAFE `if(request.ApprovalWorkflowId is not null)`. `PeUpdateDraftWorkflowPreserveTests.cs` 3: (1)PRESERVE Nháp WF=W + null request → GIỮ W + sanity update / (2)CHANGE W1→W2 (≠null)→đổi / (3)bonus BudgetPeriodAmount null-safe S61. ⚠️`ApprovalWorkflowId` FK Restrict → PE seed PHẢI ref WF thật (`SeedWorkflowAsync` ApplicableType=DuyetNcc). No prod bug sau fix. + +## S85 — PE urgent DRAFTER-self-unset (test-after authz), +5 +em main restructure `PurchaseEvaluationUrgentFeatures.cs` thêm nhánh UNSET cho NGƯỜI KHAI (`isDrafter = currentUser.UserId == entity.DrafterUserId`) → drafter GỠ clear CẢ 2 cờ, SET vẫn role-only. EXTEND `PeUrgentToggleAuthzTests.cs` 11→16: FakeCurrentUser.UserId→init + SeedPeAsync +drafterUserId. NEW 5: Drafter UNSET→clear cả 2 no-Forbidden / Finance UNSET→Forbidden`*GỠ*` / Drafter SET→Forbidden`*đánh dấu*` / Drafter UNSET chỉ-ByCcm→clear cả 2 / Drafter+Procurement-no-DM UNSET→clear CẢ 2 qua isDrafter (isDrafter ưu tiên/độc lập isProTp). No prod bug. + +## S77c — urgent-toggle SYMMETRIC→ASYMMETRIC CORRECTION +anh chốt FINAL gate BẤT-ĐỐI-XỨNG theo `request.IsUrgent`; em main sửa prod `PurchaseEvaluationUrgentFeatures.cs:49-55` `isPro = IsUrgent ? hasPro : (hasPro && isDeptManager)` (+isCcm). REWRITE `PeUrgentToggleAuthzTests.cs` 12→11: **SET = role-chức-năng-đủ** (plain Procurement/CostControl SET→OK; bỏ DeptManager-restriction) / **UNSET = role AND DeptManager** (plain-PRO/CCM UNSET→Forbidden+no-mutate; PRO+DM/CCM+DM UNSET→clear-own preserve-other; Admin→both) / Drafter/Finance SET→Forbidden / UnknownPe→NotFound. No prod touch — test theo CODE (S34). + +## S77 — PE Mig 57 suggested-price NOTE (test-after, mirror CcmNote), +7 +`UpdatePeSuggestedPricePro/CcmCommand` +`Note` (string?) absolute-set→`Pro/CcmSuggestedPriceNote` (incl null=clear); rides SAME role-gate as price (PRO/Admin · CCM/Admin) fail-closed TRƯỚC side-effect; validator `Note.MaximumLength(1000)`. Handler ctor 2-dep + record `Note=null` default → 5 existing call-sites still compile, KHÔNG cần vá arity. NEW 7 → `PeSuggestedPriceSetterAuthzTests.cs`: PRO-note+Min/Max persist (note KHÔNG clobber price) / Admin-PRO / CCM-note+price / null-clear PRO (pre-seed note→null, AsNoTracking re-read) / null-clear CCM / non-priv→Forbidden+unchanged / PRO↔CCM independent + validator 1001-invalid·1000-valid. No prod bug. + +## S76 — PE Mig 56 PRO-column-split (spec-change + compile-fix arity), +5 +`UpdatePeBudgetProCommand` record 3→4 param `(PeId, ProInitialAmount, ProAdjustmentAmount, ProNote)`; handler set ProInitial+ProAdjust absolute-set (KHÔNG còn ProEstimateAmount). Validator ProInitial>=0, ProAdjustment ÂM OK, ProNote max1000. Handler ctor 2-dep UNCHANGED. Capability `FullAmount` (PurchaseEvaluationFeatures.cs:849-864): hasCcm?CCM:proFull(ProInitial+ProAdjust); FullIsEstimate=!hasCcm&&hasPro; DTO +2 field. Compile-fix 5 PRO call-site +arg ProAdjust + assert `.ProEstimateAmount`→`.ProInitialAmount` + full-fallback seed 500→ProInitial. NEW 5: PRO set both ÂM-adjust persist / validator ProInitial<0 invalid / ProAdjust ÂM valid / full=proFull(150) / full=ÂM-adjust(70 no-clamp). No prod bug — ProEstimateAmount=LEGACY backfill→ProInitial. + +## S74 — PE Mig 55 CcmNote (compile-fix arity + test-after), +5 +`PeWorkItemBudget.CcmNote` (nvarchar1000) + `UpdatePeBudgetCcmCommand` record 3→4 `(PeId,Initial,Adjustment,CcmNote)` + DTO +CcmNote. Handler ctor 2-dep UNCHANGED. Compile-fix 3 call-site (PeWorkItemBudgetTests 388/407/421) +`null` arg4. NEW 5 (region 4b mirror ProNote): CostControl/Admin set→persist / null=clear (pre-seed prove) / Procurement→Forbidden+no-mutate (role-gate 152-157 TRƯỚC side-effect, AsNoTracking re-read) / all-persist-together. No prod bug. + +## S72 — PE Mig 54 anh Kiệt FDC (spec-change + 2 test-after FINANCIAL), +28 +Mig 54 PE fields: ProSuggestedMin/MaxPrice + CcmSuggestedPrice + ApprovedPriceAmount + ApprovedPriceSource; TransitionAsync/ApproveV2Async +3 param finalizeByCcmDelegation(bool)+approvedPriceAmount(decimal?)+approvedPriceSource(string?). **① CCM-finalize AUTO→OPT-IN — UPDATE `PeCcmThresholdFinalizeTests` 6→11:** chỉ finalize khi flag=true + fail-closed order (832-851: threshold-null→Conflict / role≠CostControl→Forbidden / winnerQuoteTotal>=ceoThreshold strict-`<`→Conflict) → ApplyApprovedPriceOnFinalize(human price BẮT BUỘC)→DaDuyet. **② NEW `PeApprovedPriceFinalizeTests` 10 — ApplyApprovedPriceOnFinalize private-static:** valid-price→bind / null-price→Conflict NOT-finalized / garbage-source→Conflict / Theory 4 source {Ncc,ProMin,ProMax,Ccm} / **isSystem null-price→no-throw qua REFLECTION** (⚠️OBSERVATION: isSystem KHÔNG reachable qua public ApproveV2Async — approve gate decision==Approve vs isSystem cần AutoApprove; PE no SLA-job → defensive/dead, test UNIT). Reflection unwrap TargetInvocationException→inner. **③ NEW `PeSuggestedPriceSetterAuthzTests` 13:** PRO/CCM setter handler 2-dep authz + validator + NotFound-TRƯỚC-authz. No prod bug — OPT-IN an-toàn-hơn AUTO. + +## S69b — PE 2 feature anh Kiệt FDC (test-before-merge SECURITY+FINANCIAL), +14 +**FEATURE B value-threshold CCM-finalize (`PeCcmThresholdFinalizeTests.cs` 5, ApproveV2Async 816-854):** CCM duyệt + ceoThreshold!=null + `winnerQuoteTotal < ngưỡng` STRICT-less-than (838) + chưa-slot-cuối → DaDuyet skip-CEO. Cover: ngưỡng→advance / threshold-null→advance / non-CCM→advance / CCM-last-slot→DaDuyet via normal-advance no-double. **FEATURE A urgent-toggle authz (`PeUrgentToggleAuthzTests.cs` 9, 4-dep):** PRO→ByPro / CCM→ByCcm / Admin→both / else→Forbidden. multi-role PRO+CCM no-Admin→else-if short-circuit chỉ ByPro. unknown→NotFound. No prod bug (strict-`<` + else-if priority intentional). [superseded by S77c for urgent SET/UNSET asymmetry] + +## S69 — Office golive permission-seed regression (test-after SECURITY), +6 +`OfficeModulePermissionSeedTests.cs` mirror HrmProfilePermissionSeedTests reflection (2 private-static revoke→seed via GetMethod NonPublic|Static; MenuItem TRƯỚC Permission FK Cascade). KHÁC HRM: Office grant Read AND Create trên 16-key allow-list. Load-bearing: excluded-3 (OffPhongHopManage/OffAttendanceReport/OffChamCong) stay hidden + upgrade-only preserves admin-raised. No prod bug. + +## S60 — UAT anh Kiệt 2 feature PE submit branch (test-after), +14 +`PeSubmitGuardAndBypassTests.cs`. **F1 Section 3 guard (8):** submit branch build `missing` 4 mục → ConflictException prefix `'Chưa đủ thông tin mục 3 ...'` join `' · '`. Cover thiếu cả 4 / winner-only / quote=0 / budget / comparison / attachment-gắn-NCC(PES_Id!=null) KHÔNG đếm / đủ-manual / đủ-BudgetId. **F2 drafter-bypass (6, V2-only):** k=drafterSlots.Max(Order) → auto Cấp 1..k. ⚠️GUARD-FIRST: bypass-test PHẢI dựng PE đủ 4 ĐK. Seed: SeedWinnerWithQuoteAsync / SeedComparisonAttachment(PES_Id=null) / SeedWorkflowAsync(Guid[][]). Opinion-only-ownSlot invariant. No prod bug. + +## S57bis / S56 (notes kept) +- S57bis spec-drift: `NotEmpty()` on `Guid?` does NOT catch `Guid.Empty` (FV 7.2 treats default(Guid?)==null) → relies on create-handler FK-guard (defense-in-depth, no prod bug). +- S56 gotcha: `ExecuteUpdateAsync` BYPASS change tracker → stale-tracked-read needs `.AsNoTracking()` re-read; shipped tx = IsolationLevel.Serializable per em-main post-review. + +## S54 — ItTicket reassign authz (test-before-merge SECURITY), +13 +`ItTicketReassignAuthzTests.cs`. Pattern: authz-capability = seed 2-dept (IT+KT) + fake ICurrentUser role/dept matrix → CanReassign flag + Forbidden/Conflict guard + empty-staff 0-leak + no-mutation. Forbidden red-able BY-CONTRAST (non-IT vs IT-staff identical-setup). Data-driven handler-authz = enforcement point (KHÁC Pattern 10 reflection static `[Authorize]`). No prod bug. diff --git a/.gitignore b/.gitignore index be34a0a..c8b181a 100644 --- a/.gitignore +++ b/.gitignore @@ -111,3 +111,5 @@ tmp/ # `fe-*/.claude/agent-memory/...`. Canonical agent-memory ở ROOT `.claude/` vẫn tracked # (negation `!.claude/**` trên). Pattern AFTER negation → last-match-wins cho path FE-app. fe-*/.claude/ +backups/ +*.bak diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md index 1f724f7..e057be4 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-06-25 (S90 — **Chèn 12 ảnh khoanh-đỏ vào guide Word Duyệt NCC (em tự chụp prod qua Chrome) + chẩn UltraViewer — em-main solo, 0 production code**: anh "mở chrome chụp ảnh dán vào luôn" (12 ô trống từ S89). **Pipeline tự-chế (gotcha #74):** MCP `save_to_disk` KHÔNG ra file env này → **PowerShell `CopyFromScreen` + Win32 lọc-process-`chrome.exe`+`SetForegroundWindow`** (app Claude-Code Electron cùng class+title → khớp nhầm) + **DOM overlay `__ccA` element-based** (case-insensitive, minLeft/maxLeft/exact/up — toạ-độ-cứng vỡ vì viewport đổi) + crop 92/72 (banner CDP s08/s12→146, verify montage) + `python-docx 6.0"`-fit-A4. 12 màn chụp+khoanh+chèn, verify 13 ảnh (1 logo+12) + montage sạch banner. **0 prod mutation** (xem-only). **🔴 NEXT anh:** ① review docx trong Word; ② ⚠️ restart CLI (carry budget v3 + `/user-mark-*` + cadence §2.1.x); ③ (tùy) bật finalize 1 cấp 1 workflow → chụp lại ảnh #10 badge "⚑ Duyệt thay CEO" / bấm tạo 1 HĐ thử → ảnh #11 hợp-đồng-nháp. **🔴 NEXT em:** sửa text guide "Từ chối"→"Duyệt/Trả lại" (app gỡ "Từ chối" từ S60) nếu anh OK · curate test-specialist L1 **34.8KB OVER** (carry S88, archive-gate DRY-RUN) · cicd 28KB + reviewer 27.7KB + FD 26.1KB WATCH. **Caveats guide:** #9 app chỉ Duyệt+Trả-lại · #10 chụp **cờ "Duyệt là KẾT THÚC quy trình"** (workflow chưa bật finalize) thay badge sơ-đồ · #11 chưa bấm Tạo-HĐ · account=admin. **UltraViewer (anh hỏi "sao bật"):** `UltraViewService` StartMode=Auto/LocalSystem standby, **0 kết-nối**, em KHÔNG mở (chỉ grant Chrome; computer-use screenshot detect+mask); tắt self-serve `Stop-Service`/`Set-Service -StartupType Manual` (cân-nhắc nếu IT dùng remote-support). **State GIỮ NGUYÊN: Mig 59·88 bảng·422 test·gotcha 74·menu 54·bundle admin `DalcOhvb`/user `CdS4tX_2`.** **monthly 2026-07-01 (carry):** STATUS line-6/HANDOFF line-5 mega-line >25K-token KHÔNG Read được — GẤP tách session-cũ ≤S87 ra session logs · ef-core SKILL Mig→59 · 3 vocab-fork alias-map. → log `2026-06-25-S90-guide-screenshots-insert.md`.) · **Prev S89** (S89 — **PE visibility/finalize batch + xóa 38 User test prod + Word guide, ~6 commit prod-verified, HMW-mode ON**: **D1 nháp riêng-tư** (`a71753b` Run #465, test 419→421) — IDOR fix nháp lộ qua cond#2 role + **cond#3 V2-approver** (workflow pin lúc-TẠO → CEO approver thấy MỌI nháp = leak màn CEO) → 4 chỗ owner-only (GetEligiblePhases bỏ DangSoanThao · admin-inbox bỏ · list-cond3 guard · detail-authz guard) + PeDraftVisibilityTests (anh chốt "bỏ nháp khỏi inbox hẳn") · **D2 CCM giá-đề-xuất** (`f7bd97a`) gỡ `!readOnly` over-gate (gate thuần role mirror ô ngân-sách; BE setter fail-closed = chốt; anh Trần Xuân Lưu CCM) · **D3 finalize-note 3-surface** (`f0bca77` test 421→422) BE +3 computed-field detail+list DTO **no-migration** + EF-subquery first-reachable + PeFinalizeChip 2-app (invest-WF `wf_341f7b29` + impl-WF `wf_3f57edb6`; **impl-FE return-rỗng #53** → em-main mirror fe-admin 4-file SHA + self-gate + PeFinalizeProjectionTests) + **flow badge "⚑ Duyệt thay CEO"** PeWorkflowPanel (`9c920ad`) + **matrix flag thứ-8** WorkflowMatrixViewPage thiếu allowApproverFinalize từ S87 (`fef4c33`) · **xóa User test** (`681b1ed`) recon prod (ssh sqlcmd) 55→giữ 17/xóa 38 (whitelist-keep + backup `SolutionErp_S89_preuserdelete.bak` + count-guard[30,45] + XACT_ABORT; KHÔNG approver-block FK; nv.test 1-PE) + gỡ seed SeedDemoUsers/Lock (deploy bắt-buộc — binary cũ resurrect) · **Word guide** `docs/Huong-dan-Duyet-NCC.docx` (skill docx, logo Solution, 8 phần, khoanh-đỏ 1→2→3). **State THẬT: Mig 59 · 88 bảng · 422 test (45D+377I) · gotcha 73 · menu 54 · bundle admin `DalcOhvb`/user `CdS4tX_2` · prod 17 user thật.** **🔴 NEXT (anh):** ⚠️ restart CLI (carry budget/cmd). **Chèn ảnh guide:** chụp 12 màn (theo nhãn ô trong .docx) gửi em → em khoanh-đỏ 1→2→3 + chèn → xuất bản; HOẶC bật Chrome + extension Claude-in-Chrome + pass admin → em tự chụp+annotate (em KHÔNG tự chụp prod được từ máy). **🔴 NEXT (em):** curate `test-specialist` L1 **34.8KB OVER-SOFT** + cicd 28KB + reviewer 27.7KB (archive-gate DRY-RUN). **monthly 2026-07-01:** ef-core SKILL Mig→59 · STATUS/HANDOFF re-tier (mega-line bloat — STATUS line-6 đã >25K-token KHÔNG Read được, GẤP tách session-cũ→logs S86↓) · 3 vocab-fork alias-map · docs/CLAUDE Budget-removed. **Pending product (carry):** Section B cột Dự-án wire · Ngưỡng giá CEO Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. **Lessons:** Designer-save=version-MỚI (phiếu pin cũ→finalize chỉ hiện phiếu-mới = "check rồi mà không thấy") · doc-drift thêm-flag-1-surface-quên-surface-song-song · whitelist-keep+3-guard prod-delete · WF-impl-FE-rỗng→em-main mirror+self-gate. → log `2026-06-25-S89-pe-visibility-finalize-userclean-guide.md`.) · **Prev S88** (S88 — **PE stability audit → fix patchwork D1 + hoàn-thiện multi-winner D2, 2 deploy prod-verified, HMW-mode ON**: anh giao "review/invest/test lại Duyệt NCC, chấp vá thì xử lý, tính năng đã ổn định". **Audit Workflow `wf_c15da996-be5`** (6 area invest→review + full-suite test) → core SOLID, tách findings safe vs behavior-affecting; AskUserQuestion ×4 chốt max-scope (incl create-contract = **1 HĐ/winner**). **D1 (`73cce1f` Run #347 PASS, test 402→413):** Block B financials re-key SelectedSupplierId→IsWinner (số=0 cho ≥2 winner) · CEO-notify-on-urgent +SaveChanges (trước rớt âm-thầm) · HoSoLink null-safe+clear-via-empty (sửa header không xoá link, #73-class) · #70 guard PRO budget · dời SetPeCcmBudgetPeriod→PeWorkItemBudgetFeatures. **D2 (`1aa3bdb` Run success, test 413→419):** create-contract **1→N** per winner (Command→List, gen-codes-first-then-atomic-add vì ContractCodeGenerator self-commit seq; GiaTri single=details-sum/≥2=per-winner-quote; pe.ContractId=first idempotency; {contractIds}) · list-card winner names (DTO +WinnerSupplierNames EF collection-subquery translate-OK SQLite) · FE dialog+PeListPanel. **State THẬT: Mig 59 · 88 bảng · 419 test (45D+374I) · gotcha 73 · menu 54 · bundle admin `BQq2eTP6`/user `dHa64I59`.** em-main-led BE core + delegate impl-backend ∥ impl-frontend ∥ test-specialist + reviewer PASS + cicd. **#53 truncation ×3** (test-specialist/reviewer/cicd return rớt MEMORY-over-budget → em-main recover-disk + self-gate + curl-self-verify deploy). **🔴 NEXT (anh):** ⚠️ restart CLI (carry: budget v3 + `/user-mark-*` + cadence §2.1.x). **NEXT UAT (anh Kiệt Ctrl+F5):** ① ≥2-winner Block B "Giá trị kỳ này" đúng số (không còn 0) · ② đánh dấu GẤP → Director nhận chuông+toast · ③ set Link hồ sơ rồi "Sửa header" → link GIỮ · ④ ≥2-winner phiếu → "Tạo HĐ" tạo N hợp đồng draft (1/winner) — **xác nhận GiaTri per-winner = giá NCC chào (quote total)** có đúng ý không, không thì chỉnh trong HĐ draft. **🔴 NEXT (em): curate test-specialist L1 34.8KB OVER-SOFT GẤP** (root-cause #53 ×3 phiên này; archive-gate DRY-RUN + move oldest→L2; reviewer 27.1KB + FD 26.1KB WATCH strike). **monthly 2026-07-01:** STATUS/HANDOFF re-tier (mega-line bloat — line không Read được, cần tách session-cũ ra session logs) · ef-core SKILL Mig→59 · docs/CLAUDE Budget-removed · 3 vocab-fork alias-map. **Pending product (carry):** Section B cột Dự-án wire (chờ anh) · Ngưỡng giá CEO Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. **Ops S58/S59:** email typo anh Chương · 5 real-staff pw · gán CNTT (tzutil N/A — R6 fix tầng-serialize). → log `2026-06-25-S88-pe-stability-audit-d1-d2.md`.) · **Prev S87** (S87 — **2 PE feature LỚN prod-verified, HMW-mode ON, ~14 spawn (nhiều #53 truncate → recover-disk + self-gate)**: **(1) CCM 3-fix Mig 58** `f1b10e9` **Run #344 PASS** — đọc PDF "CCM 4 ý" (BỎ mục 3): multi-winner (`IsWinner` SUM, multi-toggle `SupplierIds[]`, FE tick-nhiều-ô + tổng) + budget=0 hợp lệ (guard `is null` only) + cấp KẾT-THÚC quy trình (`AllowApproverFinalize` **AUTO** theo anh "bật trong quy trình hay hơn"). **Self-review bắt 8 chỗ FE `selectedSupplierId`** vỡ multi-winner (null khi ≥2) → `isWinner`. Test 377→395. Bundle admin `CXCKlNay`/user `Di40ewrF`. **(2) Section B 3-cột Mig 59** `9b1ee0c` **Run #345** (cicd-verifying) — anh AskUserQuestion "mỗi cột nhập kỳ-này RIÊNG" → `CcmBudgetPeriodAmount` + `PATCH /budget/ccm-period` role-gate CCM; FE Section B (THỰC HIỆN) `` list → `` 3 cột (Dự án—|PRO|CCM, `colCalc()` per-cột) qua **Workflow `wf_aafb18fe-d9d`** (BE→FE→test + 3-review: math/authz PASS · mirror+FE NULL → em-main self-gate identical+402+2-build). Test 395→**402**. **State: Mig 59 · 88 bảng · 402 test · gotcha 73 · menu 54 · bundle admin `BABhPh2s`/user `DLulO6uP` (Run #346 — `0d3c0cf` tách khối nổi bật "4. Thông tin chọn thầu" FE-only; #345 Section B=`C8lWxEQK`/`Kz5cSW2u`).** **NEXT UAT (anh Kiệt Ctrl+F5):** khối xanh "4. Thông tin chọn thầu" (1.Tên NCC/TP+giá trị · 2-3.Đề xuất PRO/CCM · 4.Bảng so sánh · 5.Link hồ sơ) trên "5. Ý kiến cấp duyệt" — có chỉnh thêm thì gửi. **🔴 NEXT (anh):** ⚠️ restart CLI (carry: budget v3 + `/user-mark-*` + cadence §2.1.x). **NEXT UAT (anh Kiệt Ctrl+F5):** ① tick NHIỀU NCC trúng + xem "Tổng chi phí đã chọn" · ② phiếu budget=0 gửi-duyệt OK · ④ Designer bật "Duyệt là kết thúc" cấp anh Chương → duyệt tới đó là DONE (không lên CEO) · Section B cột CCM nhập kỳ-này (bằng tài khoản CCM). **🔴 NEXT (em):** curate L1 over-cap (reviewer/cicd/inv/test-spec carry) · monthly **2026-07-01** (dọn CCM-setter `PeSuggestedPriceFeatures.cs` lệch-chỗ · re-ground sys.tables 88→89 · STATUS/HANDOFF re-tier bloat · ef-core SKILL + skills/README Mig→59). **Pending product:** Section B cột Dự-án wire (chờ anh) · Ngưỡng giá CEO Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. **Ops S58/S59:** email typo anh Chương · 5 real-staff pw · gán CNTT (tzutil = N/A R6). → log `2026-06-24-S87-pe-multiwinner-budget-finalize-sectionb.md`.) · **Prev S86** (`ae4f106` Run #343) — PE notify "cần duyệt" loại NGƯỜI TẠO phiếu (+3 `PeApproverNotifyExcludesDrafterTests`; re-ground test 356→377/gotcha→73). · **Prev S85** — **buổi UAT anh Kiệt FDC CỰC LỚN: CV PRO 6-fix + clear-data + 6 vòng UAT + 2 ROOT-CAUSE + 5 SQL-fix — ~10 deploy prod-verified #334→#341, HMW-mode ON**) — **Batch CV PRO** (Run #334 `5a61254`): file `Cần chỉnh sửa CV PRO.xlsx` = 8-ảnh-chú-thích → C1 ẩn c/d form tạo · C3 prefill ô8 · C4a live-recompute ô3/8 · C4b "Bằng ngân sách" · C5 hủy/đổi winner (BE `Guid?` clear) · C7 fullscreen preview. **Clear-data** (`scripts/s85-wipe-uat-data.sql`, BACKUP-trước): wipe 43 PE + 28 budgets + 21 NCC-test, reset→A/001 (AskUserQuestion chốt scope). **6 vòng UAT #335→#338:** D1 ẩn 3/4/5 · D5 auto-quy-trình · D2 drafter-gỡ-GẤP (nới S77) · D3 ngân-sách-tự-nhảy từ ban-hành · ràng-tạo-phiếu + D4 checklist xanh/đỏ + "Quy trình duyệt". **2 ROOT-CAUSE:** **R5 #339 `1263c0d`** workflow-clear-on-edit = bug-class S42 (`UpdatePeDraftHandler` absolute-set→null-safe `if (X is not null)`, gotcha **#73**, +3 test) · **R6 #341 `49ac086`** TZ +7h (timestamps UTC nhưng serialize thiếu 'Z' → `UtcDateTimeJsonConverter` UTC-with-Z, gotcha **#72**; cicd verify `createdAt:"…Z"`). **5 SQL-fix** phiếu workflow-less (gán QT-DN-V2-001). Test 356→**374**. **State: Mig 57 · 88 bảng · 374 test · gotcha 73 · menu 54 · bundle admin `aKuNip19`/user `BUsL0HeQ` Run #341.** **🔴 NEXT (anh):** ⚠️ restart CLI (carry: budget v3 runtime + lệnh `/user-mark-*` + cadence §2.1.x). **NEXT UAT (anh Kiệt/long.chau Ctrl+F5):** giờ thông-báo đúng ("vừa xong") + Sửa phiếu giữ workflow + submit OK + checklist xanh/đỏ đủ + auto-quy-trình. **🔴 NEXT (em):** curate L1 test-specialist 28.4KB WATCH strike-1 (value-protect gotcha#/guard → KEEP) · monthly **2026-07-01** (doc-cite flush ef-core/skills-README Mig→57 + STATUS/HANDOFF re-tier + **SignalR TZ-check** nếu realtime-push còn lệch + **edit-form workflow-selector** defer = đóng dead-end "mở Sửa chọn quy trình" mà form chưa có ô). **Pending product:** Ngưỡng giá CEO (Mig 54) Designer UAT · "C" chuyển phiếu→dự án chờ spec. **Ops S58/S59:** email typo anh Chương · 5 real-staff pw · gán CNTT (tzutil VPS = KHÔNG-cần-nữa, R6 fix tầng-serialize chuẩn hơn). → log `2026-06-23-S85-pe-uat-cvpro-rootcause-tz.md`. · **Prev S84** — **bootstrap + flush session-start cap-echo v3 + commit S83 cicd harvest-orphan (LIGHT, 0 production code)** — 2 monitor INFORM → flush `session-start.md:114` `60/20/16`→**`220/60/50`** (+canonical-pointer chống tái-drift; detector C2 không track cap-number) + commit `cicd-monitor/MEMORY.md` harvest S83 sót-closeout (Run #333 + gotcha #69-REFINE). Lesson `feedback_derived_flush_execution`: derived→canonical flush = em-main execution KHÔNG gate user-confirm; chỉ ĐỔI-số = quyền anh. ⚠️ restart CLI (command `.md` no hot-reload). State GIỮ NGUYÊN Mig 57·88·356·71·`CsJetgZH`/`BVS0ApIm`. → log `2026-06-22-S84-session-start-cap-flush.md`. · **Prev S83** — **(1) H-15 v3 memory-budget full-parity (lead 220K/sub 60K/wf 50K, anh owner-directive) + (2) fix PE require-workflow create+submit prod-verified Run #333** — 2 commit: `2c7fd63` (gov docs-only CI-skip) + `fc1f19d` (PE fix). **H-15 v3:** full AI_INFRA parity (sửa self-shrink S82) + NEW `spawn_fill_directive` (nạp sub tới budget bằng prompt GIÀU — byte-cap MEMORY.md = 1 lát) + engine §G.5 + mark **v3-delta** `RC-pqhuy1987-22-06-2026-16-35-37` (anh-directed). **PE fix:** validator `NotEmpty(ApprovalWorkflowId)` + submit-guard (sau Section-3) chặn phiếu null-workflow ("quy trình cũ", kẹt V1-legacy). Diagnose A/040 **tự-khỏi-reload = cache** (KHÔNG đụng prod). test-before RED→GREEN, full-suite bắt **9 đỏ** → triage (2 spec-conflict rewrite V1-deprecated + 6 collateral giữ + 1 validator). Test 354→**356**. **#69-REFINE:** bundle KHÔNG rotate vì 0 fe-src (Vite deterministic) — ship-signal = Last-Modified KHÔNG hash-delta. Chi tiết → `## S83` dưới. ⚠️ restart CLI (budget v3 runtime). State: Mig 57·88 bảng·**356 test**·gotcha 71·bundle `CsJetgZH`/`BVS0ApIm` Run #333. · **Prev S82** — **adopt Harness-15-v2 (Tầng-1 hot-feed-lớn + L2/L3 bỏ-trần + %-print 2-đầu-phiên + ranh-giới vai-trò), 0 production code** — anh `/check-email AI_INFRA và /adap-apply all step by step cẩn thận`. 1 thư mới H15-v2-notify (verify ✓✓) + fan-out 29 vs 22 → CHỈ H15-v2 MỚI (7 còn lại verify đã-phủ S72/S75/S79). em-main IMPLEMENT D9 (6 edit: L1 12K→per-role lead 60K/sub 20K/wf 16K · L2/L3→NO-CAP · §G.4 · §2.1.6+§L.b(c) %-print · mark refine) + REVIEW Workflow `wf_04667b25-5fa` **3/3 PASS** (3 MINOR fixed). Ranh-giới vai-trò: con-số = quyền anh, AI thực-thi + báo-% (sửa framing S81 "lead-authority" gộp nhầm AI-lead↔owner). mark H-15 **v2-delta anh-confirm** `RC-pqhuy1987-21-06-2026-01-58-01`. commit `aa3f0fe` push (docs-only CI-skip) + email AI_INFRA `a749bb6bd1be`. Chi tiết → `## S82` dưới. ⚠️ restart CLI (%-print runtime §2.1.6 + §L.b(c)). State GIỮ NGUYÊN Mig 57·88 bảng·354 test·gotcha 71·bundle `CsJetgZH`/`BVS0ApIm`. · **Prev S81** — **adopt Harness-15 memory-budget per-agent (token-governor + value-gate + work-state block), 0 production code** — anh `/check-email AI_INFRA và /adap-apply step by step, review sau lẫn imple, report trung thực`. 0 new directed email; fan-out → CHỈ H15. em-main IMPLEMENT (8/8 🔴 floor) + REVIEW Workflow `wf_b7f3c8ac-b53` (3-lane PASS/PASS/HONEST → bắt 2 CONCERN honesty → fixed). Chi tiết → `## S81` dưới + adap-report. ⚠️ restart CLI (session-start §2.1.5). ✅ mark H-15 stamped Active-High (`RC-…23-07-37`). State GIỮ NGUYÊN Mig 57·88 bảng·354 test·gotcha 71·bundle `CsJetgZH`/`BVS0ApIm`. · **Prev S80** — **curate L1 over-cap memory → L2 archive (em-main single-writer, 0 production code)** — anh `/session-start` (bootstrap clean: 2 monitor CLEAN · detector 26-flag baseline-safe · test 354) → "check làm thử đi". archive-gate DRY-RUN: reviewer 45→**10KB** · investigator-codebase 40→**10KB** · cicd-monitor 39→**12KB** = cả 3 **keep-floor-hit cannot-auto-drain** → manual condense-with-archive: 31 entries byte-exact `sed` → `archive/2026-06.md` (**+N −0**, 0 byte-loss) + 31 `_INDEX` substring pointer → **A7 GATE PASS 217/217**. Stale foundation counts flushed (130/263→354·55→71·Mig40/55→57·84→88·bundle→#330). **State GIỮ NGUYÊN: Mig 57·88 bảng·354 test·gotcha 71.** **Lesson:** `_INDEX` substring **quote-free** (A7 quote-parser cắt escaped-quote `\"PURO\"` → FAIL 1, gate bắt). **🔴 NEXT (em):** frontend-designer 26KB + test-specialist 28KB WATCH (A6 strike-1<2). → log `2026-06-20-S80-curate-l1-overcap.md`. · **Prev S79** — **adopt User-Mark (H-12/13) canonical §P + Harness-14 (Eval/Budget/Outcome) + chữ-ký RC** — anh `/check-email AI_INFRA` + `/adap-apply` step-by-step (workflow double-check mỗi step), rồi gõ `/user-mark-active-high` "áp đầy-đủ chính-xác nhất theo AI_INFRA, không hỏi thêm". em main + **4 Workflow** (`wf_82337f7f-95c` invest → `wf_a7cbe93e-912` review → `wf_9d3beebb-a95` align-re-review → `wf_4d4eba6f-8a0` H14-review). **0 production code.** Bản đầu em phỏng-theo broadcast (cấp MUST/TRACK/ANCHOR/OFF) → anh trỏ canonical → **align FULL §P (P1-P10):** 4 lệnh `/user-mark-{active-high,active,medium,disable}` + ledger `.claude/governance/ACTIVE-MARKS.md` (Active-High/Active/Medium/Disable + display-filter) + `harness-11-engine.md §E`(P1-P10)+**§F**(H-14 3-mức maturity honest) + `rules.md §6.6` (objective-criteria KHÔNG quy-mô-đội/thời-gian-tuổi) + session-start §2.1.4/session-end §L.b(h) mark-display. **3 mark Active-High stamped** anh-confirm (`RC-pqhuy1987-20-06-2026-10-29-09/10/11` = objective-criteria/User-Mark/time-age, mirror AI_INFRA 3-mark, SE timestamp riêng P1 forward-only). completeness-gate H-6→H-13 **ĐẠT** (H-8 11/11 inherit no-`[1m]` · H-7 Cat-6 real). §F floor 6/6 + maturity HONEST + SE-state ACCURATE. **3 adap-report** + email ai_infra (body-hash `7b8615b3`) + check-email STAGE 2 move 2 email + `_index`. **Bài học `feedback_canonical_spec_over_broadcast`:** broadcast cô-đọng→canonical-command/§P là spec THẬT (phải pull, đừng phỏng-theo) · report-before-stamp dogfood (lệnh tự bắt báo-cáo-trước-stamp = đúng lệnh) · residual own-diary OK (D9 áp canonical, không cấm sub ghi diary riêng). detector clean sau align (0 C1/C3 mới). **State THẬT GIỮ NGUYÊN: Mig 57 · 88 bảng · 354 test · gotcha 71 · menu 54 · bundle `CsJetgZH`/`BVS0ApIm`.** **🔴 NEXT (anh):** ⚠️ **restart CLI** (đầu việc) — activate 4 lệnh `/user-mark-*` + session-start §2.1.4/session-end §L.b(h) mark-display + engine §E/§F. Sau restart, session-start tự hiển-thị 3 mark Active-High. **🔴 NEXT (em):** curate L1 over-cap reviewer/cicd/investigator-codebase (carry 7-session + S79 workflow-spawn; inv 39.8KB +diary) — manual SPLIT/condense, archive-gate A7 GATE; + §7-header `rules.md` "77 test" stale → C2/monthly-audit. **Pending product (carry):** "Ngưỡng giá CEO" Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. **Ops S58/S59:** tzutil VPS · anh Chương email typo · 5 real-staff pw · gán CNTT. Chi tiết → `2026-06-20-S79-user-mark-harness-14-adopt.md`. · **Prev S78** — **PE: đính kèm file khi DUYỆT (UAT Tra Sol / 5 tester)** — người duyệt tải file lên ngay lúc Duyệt thay vì Trả lại phiếu. Reuse hệ attachment + enum `ApprovalAttachment=5` **MIGRATION-FREE** (int-stored, endpoint+authz có sẵn → approver upload được). FE 2 app SHA-identical: `PeWorkflowPanel` picker multi-file + upload-trước-chuyển-phase (file lỗi=không duyệt) + mục "📎 File đính kèm khi duyệt" + 2 filter fix loại purpose=5 khỏi "Bảng so sánh" (gotcha **#71** proxy-predicate pollution). commit `7886fd0` → **Run #330 PASS** (test 354, bundle admin `CsJetgZH`/user `BVS0ApIm`, NO migration, smoke 4×200). 3 lỗi em tự bắt review-trước-deploy (authz-verify · filter-pollution #71 · Dialog mirror-truncate fe-admin). em-main-led + self-gate (grep no-leak) + cicd-monitor verify. **🔴 NEXT (em):** curate L1 over-cap (carry 6 session) reviewer **45.2KB** + cicd 38.8KB + inv 35.7KB keep-floor-hit manual-condense (archive-gate A7 GATE PASS 186/186). **NEXT UAT:** mở phiếu chờ duyệt → Duyệt → "+ Chọn file đính kèm" → Xác nhận → file ở mục "📎 File đính kèm khi duyệt". Chi tiết → `2026-06-19-S78-pe-attach-file-on-approve.md`. · **Prev S77** — **PE UX batch: 10 deploy prod-verified #320→#329 (anh Kiệt FDC + Tra Sol + Bích Phượng UAT realtime, HMW-mode ON)** — cờ GẤP pill mọi danh sách+inbox · focus→revert list bám-trái · **Mig 57** ô ghi chú giá đề xuất PRO/CCM + số phân cách VND + chính tả "Bảng so sánh giá" + guard #70 · số âm đỏ-ngoặc · mục con thụt+gạch-đầu-dòng · cờ gấp **BẤT ĐỐI XỨNG** GẮN=NV/GỠ=Trưởng phòng(DeptManager) · tách chọn-phiếu(inline) khỏi mở-rộng(overlay)+nút "Xem mở rộng" · chuông báo người duyệt vào cấp họ · banner phiếu Trả-lại. Mig 56→**57** · test 344→**354** (+10) · bundle cuối admin `BqKD3Y23`/user `Cn-i349D` (Run #329). **3 lỗi em tự bắt review-TRƯỚC-deploy** (guard#70 stale-echo · luật asymmetric Tra Sol clarify giữa-chừng · double-mount Task H). FD process-death Task H → recover-disk. **🔴 NEXT (em):** curate L1 over-cap reviewer **45KB** + cicd 37.6KB + inv 35.6KB keep-floor-hit manual-condense (archive-gate A7 GATE PASS 186/186 integrity OK). **NEXT UAT:** cờ gấp (GỠ chỉ TP) · chuông báo người duyệt · banner Trả-lại · Xem mở rộng · ô ghi chú PRO/CCM. Chi tiết → `2026-06-19-S77-pe-ux-batch-10-deploy.md`. · **Prev S76** — **PE ngân sách MA TRẬN 3 cột (Dự án|PRO|CCM) + bảng lưới `
` viền-ô + badge quyền-NS theo role** — anh Kiệt FDC + chị Trà Sol go-live. anh giao `/ultra-on` "step-by-step + workflow-review-per-step, hoàn chỉnh rồi deploy". **3 commit prod-verified:** `e33481e` (feature Run #318 — Mig 56 + ma-trận-3-cột + badge designer/flow `BhFDF9IJ`/`BAkuRl3C`) → `21d1f4e` (bảng lưới `
` theo phản hồi anh "chưa chia cột giống Excel", Run #319 **`jOqxW4-p`**/**`DbsznVvR`** smoke 3×200). Mig 56 +ProInitial/ProAdjust cột PRO (additive + data-migrate ProEstimate→ProInitial 4 rows prod). Part 1 mỗi phòng sửa cột mình (PRO canEditPro / CCM canEditCcm / Dự án FE-only). Part 2+3 badge "✎ NS PRO/CCM" cạnh approver (display-only suy-role) ở Designer + flow Duyệt NCC. Test 339→**344**. reviewer bắt **race mất-dữ-liệu** Part 1 → vá `useIsFetching` 2 app (gotcha #70). **🔴 NEXT (em):** curate L1 over-cap reviewer **45KB** + inv-codebase 35KB (keep-floor-hit → manual condense) + cicd 29KB + test-spec 28KB. **NEXT (anh/anh Kiệt):** UAT bảng lưới bằng PRO/CCM (Ctrl+F5). Chi tiết → `2026-06-19-S76-pe-budget-matrix-table-grid.md`. · **Prev S75 (2026-06-18)** — **Harness-11 adopt: engine bộ-nhớ-và-governance tự-bảo-trì + 2 double-check** — anh giao `/check-email AI_INFRA` + `/adap-apply` (mỗi stage workflow-review) + double-check ×2 + finalize report + push + session-end. em main + **5 Workflow** (audit `wf_7fdc3bd5-930` → implement `wf_c5e5844e-7c1` → review `wf_d7ca1ff8-942` → double-check `wf_a0b68d2f-30e` → checklist-verify `wf_39cd4cbe-f07`). **0 production code.** Built 2 NO-API detector-script (`governance-detectors.ps1` C1-C5+B3 runtime **26 flag** bắt drift thật, C4 0-self-match · `memory-archive-gate.ps1` PHẦN A hysteresis/keep-floor/2-strike/A7 186/186) + `docs/governance/harness-11-engine.md` canonical (3-tier D5/D6/D7 + one-direction-lock D8) + **B1 ×11 count→pointer** (drift mig53→55/test306→339/gotcha68→69/table93→88 RESOLVED) + cadence-wire D1/D2 + agents/README. **completeness-gate FORMAL ĐẠT** (B 4/4 + C 5/5 + D 11/11; D5/D6/D7 explicit + D8 codify=YES). gotcha #30 reinforced (box-glyph ├└─ KHÔNG vào .ps1, kể cả qua Edit). 3 commit `e70c046`+`ae957c4`+`aa09e99` pushed + adap-report + email ai_infra (`2316773229f2`). State GIỮ NGUYÊN Mig 55·88 bảng·339 test·gotcha 69·bundle `BYF5vIMJ`/`CB-tiRxd`. **🔴 NEXT (anh):** restart CLI (cadence §2.1.3/§L.b + ef-core skill); curate reviewer 38.8KB+inv 31.5KB+cicd 26.8KB over-cap. Chi tiết → `2026-06-18-S75-harness-11-adopt.md`. · **Prev S74** — **PE ô "Ghi chú từ CCM" ngân sách gói thầu (Mig 55)** — anh forward 2 luồng Zalo (Trà Sol + Kiệt FDC) "CCM giống PRO cho nhập + ghi chú, hiện 0 hết" → em-main BE+Mig55 ∥ implementer-frontend FE 2 app SHA-mirror ∥ test-specialist (chết rate-limit → recover-disk). 2 fork anh chốt: **thêm CcmNote (Mig 55)** + **GIỮ phân vai CCM** (CostControl/Admin). Entity +CcmNote mirror ProNote · UpdatePeBudgetCcmCommand +CcmNote absolute-set role-gate · DTO+controller+mapping · FE dòng "Ghi chú từ CCM" gate canEditCcm. Test 334→**339** (+5). commit `8655ebf` (cicd **Run #315 PASS** — bundle admin `BYF5vIMJ`/user `CB-tiRxd`, Mig 55 applied prod). **"0 hết không nhập" = tài khoản thiếu role CostControl (KHÔNG bug)** → UAT bằng CCM/Admin. **🔴 NEXT (anh/anh Kiệt):** UAT ô CCM bằng tài khoản CCM/Admin + carry "Ngưỡng giá CEO" Mig 54. Chi tiết → session log `2026-06-18-S74-pe-ccm-note.md`. · **Prev S73** — **Mig 54 PE giá đề xuất PRO/CCM + CEO chọn giá chốt + CCM duyệt-done ô-tích (anh Kiệt FDC, go-live thứ Hai 22/06)** — em main + 6 sub + 2 review-workflow, 2 commit prod-verified (`1d86abc` feature Run #313 + `6aa4dcb` FE empty-candidates fix). Mig 54 5-cột additive-nullable + 2 setter role-gate + ApproveV2 ③ AUTO→OPT-IN + ① bind giá chốt; FE 2 app SHA-mirror; test 306→334. **Workflow review:** R1 schema-force 1/4 lane → R2 free-text 2/3 PASS (rủi ro FE empty-candidates UNREACHABLE per submit-guard `:194`). Bài học: review fan-out free-text/hmw KHÔNG ép-schema. **Governance:** em lệch mandate auto-Workflow → cam kết báo-TRƯỚC-khi-lệch. **🔴 NEXT (anh/anh Kiệt):** cấu hình "Ngưỡng giá CEO" Designer + test 3 luồng + xác nhận CCM-trước-CEO. Chi tiết → session log `2026-06-18-S73-pe-gia-de-xuat-ccm-done.md`. · **Prev S72** — **Harness-10 flat-refine + checklist-v2 adopt (re-audit 3-workflow) + sleep NO-OP** — audit `wf_13868efb-ea7` → implement `wf_ac43b5ff-7d1` → review `wf_d482e10d-5dd` (Harness-9 B1+B2). SE BEHIND flat → migrate run-trace SUBFOLDER→FLAT (hmw.js:103 + 5 doc; 5 run cũ giữ subfolder C8) + 2 broadcast 06-18 adopt + `/sleep-recovery-memory-l2` port (A8) + detector TAILORED-OUT + hmw.js H4.5→H8 doc-drift. **REVIEW (B2) bắt 2 lỗi IMPLEMENT-self-assess sót** (hmw.js:52 schema-stale + auto-check overclaim) → fixed (auto-check WIRED thật). em-main containment-check tự bắt reviewer residual-write (raw-Workflow no-writeGuard) → revert. B3 self-correct (runs path/count 14→22). Sleep `all`=NO-OP. **0 prod code, state GIỮ NGUYÊN.** adap-report + email ai_infra (`5f511fe5c0f2`). **🔴 NEXT (anh):** restart CLI (FLAT-runtime hmw.js + wired sleep-check + sleep-recovery skill). **🔴 NEXT (em):** curate investigator-codebase L1 28973 OVER + watch FD/test-spec. Chi tiết → session log `2026-06-18-S72-harness-10-flat-refine.md`. **Prev S71 — Harness-10 adopt: tracked run-trace folder + checklist 9-10** — em main + 3 Workflow (invest `wf_9c2cd2cd-2e7` → implement `wf_e4e46725-231` → review `wf_636bc95b-939`) per mandate Harness-9 PART 2. **0 production code**. Migrate `.claude/workflows/wave-*/` gitignored → `runs//` **git-TRACKED** (run.md+sub-md/+harvest/) + `_ledger.md` 2-nhịp + 3-layer anti-miss (L1 em-main@P1 / L2 session-start orphan-scan / L3 session-end close-gate idempotent) + **containment shift** (Harness-2 B6 "mọi tracked-change=vi-phạm" → "tracked-change NGOÀI run-folder + code-disjoint=vi-phạm"). hmw.js wave→run-trace (accept `args.run` + alias `wave`, path `sub-md/`, `node --check` PARSE-OK). **Review độc-lập (R2+R3) bắt C5 L1 over-claim** (doc nói hmw.js prompt-builder emit L1 reminder, grep engine=0 → engine no-fs → fixed path-a: L1 = em-main @P1 convention) — dogfood mandate B2 đúng. checklist 9-10: Part A (Harness-9 memory) + B (adap 2-workflow) done S70, Part C (Harness-10) 8/8 MỚI. **State GIỮ NGUYÊN: Mig 53·88 bảng·306 test·68 gotcha·menu 54·bundle admin `BgNCjwsG`/user `CBvh0vtf`.** + CLAUDE.md test-flush 263→306 (resolve H1 stale). **🔴 NEXT (anh):** restart CLI (hmw.js RUN-TRACE runtime + carry §2.1.2/Cat-6/H8). Chi tiết → session log `2026-06-18-S71-harness-10-run-trace.md` (pending). **Prev S70 —** **Harness-9 adopt: L2 archive dark-matter recovery + adap 2-workflow mandate** — em main + 3 Workflow (investigate `wf_be952f3c-97f` → implement `wf_a58e0d15-beb` → audit `wf_9520d8cd-4fe`) + 2 monitor bootstrap. **0 production code** (governance/memory only, commit `f36aab8` pushed). 4 over-cap sub-agent curate L1→L2 + `archive/_INDEX.md` (mục-lục substring sha-keyed) + `.gist.md` (4-field distill-gen:1, verbatim FROZEN) → **cả 4 < 25KB auto-inject cap** (P1 curate-debt CLOSED; ~240KB archive hết RAG-dark). PART 2/3 process-mandate codify (adap-apply 2-workflow + agents/README Upgrade S70 + session-start §2.1.2). **0-byte-loss git+sha verified** (Stage C audit + em-main self-gate khi 2 reviewer no-StructuredOutput → recovery-path). +memory-budget.json (seed-by-measure) + measure-agent-memory.ps1 + .ragignore + doc-drift 4-cite flush. adap-report + email-back ai_infra (`7c07b716e775`). **State THẬT GIỮ NGUYÊN: Mig 53 · 88 bảng · 306 test · 68 gotcha · menu 54 · bundle admin `BgNCjwsG`/user `CBvh0vtf`.** **🔴 NEXT (anh):** restart CLI để activate session-start §2.1.2 budget-audit + pending H8 inherit + reviewer Cat-6. Chi tiết → session log `2026-06-17-S70-harness-9-l2-recovery.md`. **Prev S69 —** **Văn phòng số (E-Office) port + golive + PE cờ gấp/ngưỡng CCM — 4 deploy prod-verified Run #305→#308, HMW-mode ON, 2 workflow fan-out**: #305 foundation PURO (shared PageHeader/KpiCard/WidgetCard + Dashboard 2-cột + sync fe-admin index.css đóng drift S66-S68) → #306 **re-skin TRỌN 10 page** (PURO layout + CSS Hồ sơ NS, phẫu-thuật-giữ-100%-logic) → #307 **Office golive public** read+create **16-key allow-list mọi role** (mirror S65, chạy SAU revoke; excluded Off_PhongHop_Manage/Off_AttendanceReport/Off_ChamCong; cicd DB-verify 16/16×13 role) → #308 **PE cờ gấp PRO/CCM + CCM duyệt-final theo ngưỡng giá trị** Mig 53 (anh Kiệt FDC sau họp sếp). **State THẬT: Mig 53 · 88 bảng · 306 test (45D+261I) · 68 gotcha · menu 54 · bundle admin `BgNCjwsG`/user `CBvh0vtf` Run #308.** 2 gotcha NEW (**#67** Tailwind accent palette thiếu-stop vỡ-màu-im-lặng · **#68** stale-diagnostic-background-agent → chỉ tin build sau-cùng). 2 truncation #53 (impl-backend positional-record + impl-frontend) → em main recover-disk + self-gate. **🔴 NEXT (anh/anh Kiệt UAT):** (1) cấu hình "Ngưỡng giá trị gói CEO" trong Workflow Designer (null=luồng cũ) + test phiếu < ngưỡng → CCM duyệt là xong, ≥ ngưỡng → lên CEO; (2) test cờ gấp PRO(đỏ)/CCM(xanh) → badge + notify CEO; (3) **xác nhận:** quy trình đặt CCM(CostControl)-trước-CEO + CEO = role Director (đích notify). **C (sau duyệt → chuyển phiếu đến dự án) chờ anh Kiệt spec form.** **NEXT (em):** 🔴 curate cicd-monitor **65.2KB** (worst, trend tăng) + inv-codebase 47 + reviewer 43.5 over-cap · doc-flush docs/CLAUDE.md full. Chi tiết → session log `2026-06-17-S69-vanphong-golive-pe-urgent-threshold.md`. **Prev S68 —** **Hồ sơ NS header chi tiết NV: làm nổi bật + fix tên render đen→trắng** — em main solo, 3 commit (2 FE + 1 docs), 2 deploy prod-verified Run #303-304 (anh UAT realtime): badge màu theo trạng thái + dòng meta đậm + tên to/drop-shadow (#303 `6983609`) → anh báo "tên đen nền xanh ko nổi bật" → diagnose **rule `h1-h4{color:#0b1220}` viết NGOÀI `@layer` thắng `text-white`** (Tailwind v4 unlayered > all layers, **gotcha #66 NEW**, load-bearing ~30+ heading → fix ĐIỂM `text-white!` không move @layer) + thu nhỏ `text-lg` (#304 `37752eb`). Bootstrap: 2 monitor RE-REPORT CLEAN + 2 doc-drift fix (dep-audit 64→65 · root CLAUDE 263→286, `11bc96d`). **State THẬT: Mig 52 · 88 bảng · 286 test · 66 gotcha · menu 53 · bundle admin `CNUv1jxY`/user `CpOskeS1` Run #304.** ⚠️ curate-debt P1: cicd-monitor **44.1KB**. Chi tiết → session log `2026-06-16-S68-hoso-header-name-color-fix.md`. **Prev S67 —** **buổi sản phẩm LỚN, 6 deploy prod-verified Run #297→#302** (anh + anh Kiệt FDC UAT realtime, HMW-mode ON): fe-user Hồ sơ NS đồng nhất font + chữ đen→**xanh đậm `brand-800`** (#297) · **fe-admin mirror master-detail** + vá accent tokens index.css [đóng pending lớn nhất HRM go-live, page SHA256 ×2] (#298) · **+23 test-after HRM** → 263→**286** (#299) · **list flex-row gọn** [hết tràn ngang rail] + đồng nhất cỡ chữ ×2 (#300) · **PE Link hồ sơ auto-detect** web→hyperlink/`O:\`→Copy (#301) → **link `file://` bấm-thử** (#302). **Research 3-agent:** auto-mở `O:\` từ web = chỉ **Edge GPO `IntranetFileLinksEnabled`** (zero-per-machine) one-click thật; default chặn https→file://. **State THẬT: Mig 52 · 88 bảng · 286 test (45D+241I) · 65 gotcha · menu 53 · bundle admin `CcrZqfht`/user `DniDFUB_` Run #302.** test-specialist trunc #53→recover-disk; 0 prod bug. Chi tiết → session log `2026-06-16-S67-hoso-visual-pe-link-research.md`. **Prev S66 — session-end closeout em-main-solo:** adopt **Harness-8 all-inherit** (7 sub demoted `claude-opus-4-8`→`inherit` → cả 11=inherit, gỡ two-tier H4) + **cicd-monitor L1 curate 86.8→28.9KB** (byte-exact sed → `archive/2026-06.md`) + **ef-core skill doc-flush Mig 50→52** + check-email AI_INFRA (**0 thư mới se-directed**). ~17 file docs/gov/config, **0 production code** → state THẬT GIỮ NGUYÊN (Mig 52 · 88 bảng · 263 test · 65 gotcha · menu 53 · bundle `BDwV5d0X`/`DbVv6rsf`). ⚠️ **Restart CLI** → H8 runtime (frontmatter no hot-reload) + reviewer Cat-6. adap-report + email-back ai_infra (`fa7f690d` MATCH). Chi tiết → session log `2026-06-16-S66-closeout-harness8-cicd-curate.md`. **Prev S65 — HRM go-live: public Hồ sơ Nhân sự + trang master-detail giống NamGroup + Department hierarchy Mig 51 + PE Link hồ sơ Mig 52 + gốc cây SOLUTION COMPANY**, ~6 deploy prod-verified Run #289→#295, anh + anh Kiệt FDC UAT realtime. **State THẬT: Mig 52 · 88 bảng · 263 test (45D+218I) · 65 gotcha · menu 53 · bundle admin `BDwV5d0X`/user `DbVv6rsf` Run #295.** Workflow fan-out chạy THẬT lần đầu [PE] — BE∥FE parallel OK nhưng FE+reviewer return-rỗng #53 → em main recover-disk + self-gate. gotcha #65 [build csproj con ≠ slnx → CS7036]. Chi tiết → session log `2026-06-16-S65-hrm-golive-employee-masterdetail-pe-link.md`. **Prev S64** adopt **Harness-7 writing-quality floor** qua `/adap-apply` + email ai_infra — em main solo, 1 commit `6afde19` docs/gov-only. Outward comms = tiếng Việt câu-hoàn-chỉnh; nội bộ giữ nén (asymmetric). reviewer +Category 6 (verified-pending-restart → cần restart CLI). Broadcast body-hash verified KHÔNG mis-stamp (gotcha #61 UTF-8). Prev S63 docs-closeout bù S60/S61/S62 — 3 session product ship CODE prod-verified nhưng KHÔNG closeout docs (UAT realtime anh Kiệt FDC). **State THẬT: Mig 50 · 88 bảng · 263 test · 64 gotcha · menu 53 · bundle admin `0xKYGhhf`/user `C81ZdG9G` Run #286.** S60-62 = PE ràng buộc gửi-duyệt + gỡ "Từ chối" (S60) · Mig 50 ngân sách per-gói-thầu Excel anh Kiệt + XÓA module Budget cũ (S61) · vượt-NS cảnh-báo-mềm (S62). Reconcile stray reviewer cwd-misland + count-flush 4 file. Chi tiết → session log `2026-06-12-S60-S62-pe-budget-workitem-softwarning.md`. Prev Session 59 ( **6 đợt ship prod-verified Run #273→#278**: wipe transactional testing data (10 PE + 7 HĐ demo + 64 notif = 0, mã reset → phiếu thật đầu tiên team tạo = **PE/2026/A/001** ✓) `56882ac` #273 · PE tree Panel 1 chốt 4 tầng **Năm > Dự án > Hạng mục > Phiếu** `0eafcd3` #274 · dọn 15 mã hạng mục demo "tự đẻ" (chị Trà Sol) + gỡ seed gốc, WorkItems 86→**71** `bbd1554` #275 · **rename 71 mã đúng format PMH anh Kiệt** (`MAT-n`/`SUB-n`/`MEP-SUB-n`/`MEP-EQU-n` + tên "STT nhóm tên"; **DB-trước-code-sau** gotcha #62 + sqlcmd `-f 65001` gotcha #61) `c869d26` #276 · UAT vòng 1: NEW `ui/SearchableSelect` gõ-lọc bỏ dấu (Hạng mục/Dự án) + auto Địa điểm + điều khoản đa dòng `faed59f` #277 · UAT vòng 2 (anh chốt ×2): ẩn Trả lại/Từ chối khi tự duyệt phiếu mình soạn + quick-add NCC ngay form (POST /suppliers any-auth, authz probe 4/4) + NCC gõ-tìm A-Z + upload multi-file `9c330d2` #278 · UAT vòng 3-6 realtime (#279/#281 cancelled-supersede-benign): bảng NCC table-fixed `f21c55d` + bỏ ô Tên ngân sách `69997da` #280 + GỠ field Điều khoản TT mọi form `80b64dd` + bỏ nút Thêm hạng mục `792c030` **#282 FINAL**. Tổng 10 đợt (8 PASS + 2 cancelled-benign). Bundle FINAL admin **`B1DtNT9C`**/user **`D6uF3Mln`**. Test 240. Gotchas 62. 0/14 spawn truncated. → session log `2026-06-11-S59-wipe-tree-pmh-uat-batch.md`. Prev S58 — **5 đợt prod-verified Run #382/#383/#384/#386** (#385 cancelled-supersede-benign): lock-demo-user fix (việc sếp deadline 15:00 ĐÓNG TRỌN — gotcha #60/E-008/AS-12, root cause password 11<12 từng phát hiện S22 nhưng const không fix) + tạm ẩn HRM/Office/Cá nhân + Danh mục cuối (`6c5fd26` #383) + **fe-user redesign theo UI/UX guide AI_INFRA giữ brand** (`e959f72` #384) + **brand polish ×2 app "thấy rõ"** (`ea793a4`: stripe 4px đỉnh + thead brand) + **PE gộp Tên-gói-thầu = chọn Hạng-mục** (anh Kiệt FDC chốt, `3ebaf84` #386 — bundle final admin `DMm9rtNA`/user `BUkOMn_Y`). Email AI_INFRA processed (guide + ACK H4 ACCEPT). Test **240**. → session log `2026-06-11-S58-lock-fix-hide-modules-redesign-pe-merge.md`. Root cause 2 tầng: lock-list = population Dev-only + `DemoUserPassword` 11 ký tự < prod RequiredLength=12 → CreateAsync silent-fail từ trước tới giờ (= "helpdesk inert" S56). Fix union 20 UAT email + password 12 ký tự → prod 55 user/34 locked, nv.cao+nv.truong sống, 5 real staff tạo. gotcha #59+#60. Commit `5998163`. Prev S57bis — **PE gắn Hạng mục (Mig 49) + Pe all-role + menu Cá nhân + Harness-4 runtime-VERIFIED**. Test 228→**240**. Bundle `CP4CB1ym`/`BmZ3VHnm`. Commit `17b23a4`+`dd117b7` → Run #381 PASS+1PARTIAL (lock NO-OP → RESOLVED S58). Prev S56 — **Pre-golive verify sweep + golive-harden 4 fix — Run #379 PASS, code golive-ready**. WF1 `pre-golive-verify` 7-stream + adversarial → 6 PASS/1 CONCERN/0 blocker = GO (key finds = ops not code). WF2 `golive-harden` fix 4: #3 LeaveBalance lost-update→atomic ExecuteUpdate+Serializable tx (NO mig) · #5 ItTicket authz Forbidden-trước-NotFound · #6 DocxRenderer null-guard · #4 Travel/Vehicle ApproveV2 tests. Test 216→**228**. Bundle FROZEN `4SUwDLD8`/`XdKzt9LL`. `sys.tables` re-ground 92→**93**. gotcha **#58** NEW. reviewer StructuredOutput-fail→em main đỡ. **2 ops VPS pending** (gán user IT + tzutil UTC+7). FE Phase 2 redesign **deferred** (recon ready). Commit `a20cde8`. Prev S55 — **Nạp master data thật từ Excel (62 dự án + 71 hạng mục + 3 NCC) + Project +4 cột (Mig 48) — prod-verified**. HMW-mode ON. Commit `69cb393` → Run #377 PASS ~4m33s. Test 216 (compile-fix only). Bundle admin `B-d6893W`/user `XdKzt9LL`. `SeedRealMasterDataAsync` ungated idempotent → coexist demo. 2 agent return truncated (BE+reviewer) → em main disk/runtime-recover. Prev S54 — IT staff tự reassign ticket (cross-stack authz) — prod-verified. 1 code commit `ca4b602` → Run #376 PASS ~4m18s. Test 203→**216**. Bundle admin `DfCfHUE9`→`DmjI8Cmn`/user `_3S0BPJ2`→`YxL_MljK` (cả 2 rotate). NO migration. Task 1 Phase 9 Ops anh dừng. ⚠️ residual: 3 agent ghi MEMORY nhầm `src/Backend/.claude` → em main reconcile. Prev S53: gotcha #57 EXT Master Mig 47 + P11-D/E + database-agent verified-runtime.) +**Last updated:** 2026-06-26 (S91 — **buổi go-live LỚN em-main-led, 4 commit prod-verified + backup local** — go-live 26/06 anh Kiệt SOL-IT Phase-01 PRO+CCM. #1 `159b69d` guide Word bỏ "Từ chối" 2 chỗ + fix 12 caption Hinh→Hình [unpack→XML→repack giữ 13 ảnh]. #2 `ba42c59` wipe go-live [16 PE+16 budgets+94 notif+19 NCC demo xóa, giữ 7 NCC thật+17 user+master, PeSeq→A/001, backup+2-guard+AskUserQuestion-scope]. #3 `55494ad` gate SeedDemoMasterData chống resurrect 18 NCC demo mỗi restart [gotcha #75 root-cause, verify demo_codes=0 qua 2 restart]. #4 `e81e87f` user tự đổi mật khẩu [BE ChangePasswordCommand + POST /auth/change-password Identity-verify-pass-cũ + FE 2-app ChangePasswordDialog/TopBar + 10 test; CS0104 ValidationException ambiguous fix]. +backup local `backups/SolutionErp_golive_clean_2026-06-26.bak` 21MB + accounts.txt 17 tk. **State: Mig 59 · 88 bảng · 431 test · gotcha 76 · menu 54 · bundle admin `DgQyuG7f`/user `BmbQon23` · prod 17 user/7 NCC/0 PE-HĐ.** **🔴 NEXT anh:** ⚠️ restart CLI · review guide docx Word · đóng 2 tab eoffice em mở · UAT đổi-mật-khẩu [avatar→Đổi mật khẩu, ≥12 ký tự] + xác nhận NCC demo không sống-lại. **🔴 NEXT em:** curate test-specialist L1 OVER [carry nhiều session] · monthly 2026-07-01 [re-tier mega-line STATUS/HANDOFF bloat · ef-core SKILL Mig→59 · docs/CLAUDE Budget-removed · 3 vocab-fork alias-map]. **Pending product:** Section B cột Dự-án wire · Ngưỡng giá CEO Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. **Ops:** tzutil VPS = N/A [R6 fix tầng-serialize] · 5 real-staff pw · email typo anh Chương. **Lessons S91:** wipe-không-bền-nếu-không-gate-reseed [#75] · deploy config từ .example KHÔNG file-gitignored [#76] · Chrome-MCP screenshot kẹt SPA document_idle [#74 carry]. → log `2026-06-26-S91-golive-wipe-changepw-backup.md`) · **Prev S90** (S90 — **Chèn 12 ảnh khoanh-đỏ vào guide Word Duyệt NCC (em tự chụp prod qua Chrome) + chẩn UltraViewer — em-main solo, 0 production code**: anh "mở chrome chụp ảnh dán vào luôn" (12 ô trống từ S89). **Pipeline tự-chế (gotcha #74):** MCP `save_to_disk` KHÔNG ra file env này → **PowerShell `CopyFromScreen` + Win32 lọc-process-`chrome.exe`+`SetForegroundWindow`** (app Claude-Code Electron cùng class+title → khớp nhầm) + **DOM overlay `__ccA` element-based** (case-insensitive, minLeft/maxLeft/exact/up — toạ-độ-cứng vỡ vì viewport đổi) + crop 92/72 (banner CDP s08/s12→146, verify montage) + `python-docx 6.0"`-fit-A4. 12 màn chụp+khoanh+chèn, verify 13 ảnh (1 logo+12) + montage sạch banner. **0 prod mutation** (xem-only). **🔴 NEXT anh:** ① review docx trong Word; ② ⚠️ restart CLI (carry budget v3 + `/user-mark-*` + cadence §2.1.x); ③ (tùy) bật finalize 1 cấp 1 workflow → chụp lại ảnh #10 badge "⚑ Duyệt thay CEO" / bấm tạo 1 HĐ thử → ảnh #11 hợp-đồng-nháp. **🔴 NEXT em:** sửa text guide "Từ chối"→"Duyệt/Trả lại" (app gỡ "Từ chối" từ S60) nếu anh OK · curate test-specialist L1 **34.8KB OVER** (carry S88, archive-gate DRY-RUN) · cicd 28KB + reviewer 27.7KB + FD 26.1KB WATCH. **Caveats guide:** #9 app chỉ Duyệt+Trả-lại · #10 chụp **cờ "Duyệt là KẾT THÚC quy trình"** (workflow chưa bật finalize) thay badge sơ-đồ · #11 chưa bấm Tạo-HĐ · account=admin. **UltraViewer (anh hỏi "sao bật"):** `UltraViewService` StartMode=Auto/LocalSystem standby, **0 kết-nối**, em KHÔNG mở (chỉ grant Chrome; computer-use screenshot detect+mask); tắt self-serve `Stop-Service`/`Set-Service -StartupType Manual` (cân-nhắc nếu IT dùng remote-support). **State GIỮ NGUYÊN: Mig 59·88 bảng·422 test·gotcha 74·menu 54·bundle admin `DalcOhvb`/user `CdS4tX_2`.** **monthly 2026-07-01 (carry):** STATUS line-6/HANDOFF line-5 mega-line >25K-token KHÔNG Read được — GẤP tách session-cũ ≤S87 ra session logs · ef-core SKILL Mig→59 · 3 vocab-fork alias-map. → log `2026-06-25-S90-guide-screenshots-insert.md`.) · **Prev S89** (S89 — **PE visibility/finalize batch + xóa 38 User test prod + Word guide, ~6 commit prod-verified, HMW-mode ON**: **D1 nháp riêng-tư** (`a71753b` Run #465, test 419→421) — IDOR fix nháp lộ qua cond#2 role + **cond#3 V2-approver** (workflow pin lúc-TẠO → CEO approver thấy MỌI nháp = leak màn CEO) → 4 chỗ owner-only (GetEligiblePhases bỏ DangSoanThao · admin-inbox bỏ · list-cond3 guard · detail-authz guard) + PeDraftVisibilityTests (anh chốt "bỏ nháp khỏi inbox hẳn") · **D2 CCM giá-đề-xuất** (`f7bd97a`) gỡ `!readOnly` over-gate (gate thuần role mirror ô ngân-sách; BE setter fail-closed = chốt; anh Trần Xuân Lưu CCM) · **D3 finalize-note 3-surface** (`f0bca77` test 421→422) BE +3 computed-field detail+list DTO **no-migration** + EF-subquery first-reachable + PeFinalizeChip 2-app (invest-WF `wf_341f7b29` + impl-WF `wf_3f57edb6`; **impl-FE return-rỗng #53** → em-main mirror fe-admin 4-file SHA + self-gate + PeFinalizeProjectionTests) + **flow badge "⚑ Duyệt thay CEO"** PeWorkflowPanel (`9c920ad`) + **matrix flag thứ-8** WorkflowMatrixViewPage thiếu allowApproverFinalize từ S87 (`fef4c33`) · **xóa User test** (`681b1ed`) recon prod (ssh sqlcmd) 55→giữ 17/xóa 38 (whitelist-keep + backup `SolutionErp_S89_preuserdelete.bak` + count-guard[30,45] + XACT_ABORT; KHÔNG approver-block FK; nv.test 1-PE) + gỡ seed SeedDemoUsers/Lock (deploy bắt-buộc — binary cũ resurrect) · **Word guide** `docs/Huong-dan-Duyet-NCC.docx` (skill docx, logo Solution, 8 phần, khoanh-đỏ 1→2→3). **State THẬT: Mig 59 · 88 bảng · 422 test (45D+377I) · gotcha 73 · menu 54 · bundle admin `DalcOhvb`/user `CdS4tX_2` · prod 17 user thật.** **🔴 NEXT (anh):** ⚠️ restart CLI (carry budget/cmd). **Chèn ảnh guide:** chụp 12 màn (theo nhãn ô trong .docx) gửi em → em khoanh-đỏ 1→2→3 + chèn → xuất bản; HOẶC bật Chrome + extension Claude-in-Chrome + pass admin → em tự chụp+annotate (em KHÔNG tự chụp prod được từ máy). **🔴 NEXT (em):** curate `test-specialist` L1 **34.8KB OVER-SOFT** + cicd 28KB + reviewer 27.7KB (archive-gate DRY-RUN). **monthly 2026-07-01:** ef-core SKILL Mig→59 · STATUS/HANDOFF re-tier (mega-line bloat — STATUS line-6 đã >25K-token KHÔNG Read được, GẤP tách session-cũ→logs S86↓) · 3 vocab-fork alias-map · docs/CLAUDE Budget-removed. **Pending product (carry):** Section B cột Dự-án wire · Ngưỡng giá CEO Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. **Lessons:** Designer-save=version-MỚI (phiếu pin cũ→finalize chỉ hiện phiếu-mới = "check rồi mà không thấy") · doc-drift thêm-flag-1-surface-quên-surface-song-song · whitelist-keep+3-guard prod-delete · WF-impl-FE-rỗng→em-main mirror+self-gate. → log `2026-06-25-S89-pe-visibility-finalize-userclean-guide.md`.) · **Prev S88** (S88 — **PE stability audit → fix patchwork D1 + hoàn-thiện multi-winner D2, 2 deploy prod-verified, HMW-mode ON**: anh giao "review/invest/test lại Duyệt NCC, chấp vá thì xử lý, tính năng đã ổn định". **Audit Workflow `wf_c15da996-be5`** (6 area invest→review + full-suite test) → core SOLID, tách findings safe vs behavior-affecting; AskUserQuestion ×4 chốt max-scope (incl create-contract = **1 HĐ/winner**). **D1 (`73cce1f` Run #347 PASS, test 402→413):** Block B financials re-key SelectedSupplierId→IsWinner (số=0 cho ≥2 winner) · CEO-notify-on-urgent +SaveChanges (trước rớt âm-thầm) · HoSoLink null-safe+clear-via-empty (sửa header không xoá link, #73-class) · #70 guard PRO budget · dời SetPeCcmBudgetPeriod→PeWorkItemBudgetFeatures. **D2 (`1aa3bdb` Run success, test 413→419):** create-contract **1→N** per winner (Command→List, gen-codes-first-then-atomic-add vì ContractCodeGenerator self-commit seq; GiaTri single=details-sum/≥2=per-winner-quote; pe.ContractId=first idempotency; {contractIds}) · list-card winner names (DTO +WinnerSupplierNames EF collection-subquery translate-OK SQLite) · FE dialog+PeListPanel. **State THẬT: Mig 59 · 88 bảng · 419 test (45D+374I) · gotcha 73 · menu 54 · bundle admin `BQq2eTP6`/user `dHa64I59`.** em-main-led BE core + delegate impl-backend ∥ impl-frontend ∥ test-specialist + reviewer PASS + cicd. **#53 truncation ×3** (test-specialist/reviewer/cicd return rớt MEMORY-over-budget → em-main recover-disk + self-gate + curl-self-verify deploy). **🔴 NEXT (anh):** ⚠️ restart CLI (carry: budget v3 + `/user-mark-*` + cadence §2.1.x). **NEXT UAT (anh Kiệt Ctrl+F5):** ① ≥2-winner Block B "Giá trị kỳ này" đúng số (không còn 0) · ② đánh dấu GẤP → Director nhận chuông+toast · ③ set Link hồ sơ rồi "Sửa header" → link GIỮ · ④ ≥2-winner phiếu → "Tạo HĐ" tạo N hợp đồng draft (1/winner) — **xác nhận GiaTri per-winner = giá NCC chào (quote total)** có đúng ý không, không thì chỉnh trong HĐ draft. **🔴 NEXT (em): curate test-specialist L1 34.8KB OVER-SOFT GẤP** (root-cause #53 ×3 phiên này; archive-gate DRY-RUN + move oldest→L2; reviewer 27.1KB + FD 26.1KB WATCH strike). **monthly 2026-07-01:** STATUS/HANDOFF re-tier (mega-line bloat — line không Read được, cần tách session-cũ ra session logs) · ef-core SKILL Mig→59 · docs/CLAUDE Budget-removed · 3 vocab-fork alias-map. **Pending product (carry):** Section B cột Dự-án wire (chờ anh) · Ngưỡng giá CEO Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. **Ops S58/S59:** email typo anh Chương · 5 real-staff pw · gán CNTT (tzutil N/A — R6 fix tầng-serialize). → log `2026-06-25-S88-pe-stability-audit-d1-d2.md`.) · **Prev S87** (S87 — **2 PE feature LỚN prod-verified, HMW-mode ON, ~14 spawn (nhiều #53 truncate → recover-disk + self-gate)**: **(1) CCM 3-fix Mig 58** `f1b10e9` **Run #344 PASS** — đọc PDF "CCM 4 ý" (BỎ mục 3): multi-winner (`IsWinner` SUM, multi-toggle `SupplierIds[]`, FE tick-nhiều-ô + tổng) + budget=0 hợp lệ (guard `is null` only) + cấp KẾT-THÚC quy trình (`AllowApproverFinalize` **AUTO** theo anh "bật trong quy trình hay hơn"). **Self-review bắt 8 chỗ FE `selectedSupplierId`** vỡ multi-winner (null khi ≥2) → `isWinner`. Test 377→395. Bundle admin `CXCKlNay`/user `Di40ewrF`. **(2) Section B 3-cột Mig 59** `9b1ee0c` **Run #345** (cicd-verifying) — anh AskUserQuestion "mỗi cột nhập kỳ-này RIÊNG" → `CcmBudgetPeriodAmount` + `PATCH /budget/ccm-period` role-gate CCM; FE Section B (THỰC HIỆN) `` list → `
` 3 cột (Dự án—|PRO|CCM, `colCalc()` per-cột) qua **Workflow `wf_aafb18fe-d9d`** (BE→FE→test + 3-review: math/authz PASS · mirror+FE NULL → em-main self-gate identical+402+2-build). Test 395→**402**. **State: Mig 59 · 88 bảng · 402 test · gotcha 73 · menu 54 · bundle admin `BABhPh2s`/user `DLulO6uP` (Run #346 — `0d3c0cf` tách khối nổi bật "4. Thông tin chọn thầu" FE-only; #345 Section B=`C8lWxEQK`/`Kz5cSW2u`).** **NEXT UAT (anh Kiệt Ctrl+F5):** khối xanh "4. Thông tin chọn thầu" (1.Tên NCC/TP+giá trị · 2-3.Đề xuất PRO/CCM · 4.Bảng so sánh · 5.Link hồ sơ) trên "5. Ý kiến cấp duyệt" — có chỉnh thêm thì gửi. **🔴 NEXT (anh):** ⚠️ restart CLI (carry: budget v3 + `/user-mark-*` + cadence §2.1.x). **NEXT UAT (anh Kiệt Ctrl+F5):** ① tick NHIỀU NCC trúng + xem "Tổng chi phí đã chọn" · ② phiếu budget=0 gửi-duyệt OK · ④ Designer bật "Duyệt là kết thúc" cấp anh Chương → duyệt tới đó là DONE (không lên CEO) · Section B cột CCM nhập kỳ-này (bằng tài khoản CCM). **🔴 NEXT (em):** curate L1 over-cap (reviewer/cicd/inv/test-spec carry) · monthly **2026-07-01** (dọn CCM-setter `PeSuggestedPriceFeatures.cs` lệch-chỗ · re-ground sys.tables 88→89 · STATUS/HANDOFF re-tier bloat · ef-core SKILL + skills/README Mig→59). **Pending product:** Section B cột Dự-án wire (chờ anh) · Ngưỡng giá CEO Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. **Ops S58/S59:** email typo anh Chương · 5 real-staff pw · gán CNTT (tzutil = N/A R6). → log `2026-06-24-S87-pe-multiwinner-budget-finalize-sectionb.md`.) · **Prev S86** (`ae4f106` Run #343) — PE notify "cần duyệt" loại NGƯỜI TẠO phiếu (+3 `PeApproverNotifyExcludesDrafterTests`; re-ground test 356→377/gotcha→73). · **Prev S85** — **buổi UAT anh Kiệt FDC CỰC LỚN: CV PRO 6-fix + clear-data + 6 vòng UAT + 2 ROOT-CAUSE + 5 SQL-fix — ~10 deploy prod-verified #334→#341, HMW-mode ON**) — **Batch CV PRO** (Run #334 `5a61254`): file `Cần chỉnh sửa CV PRO.xlsx` = 8-ảnh-chú-thích → C1 ẩn c/d form tạo · C3 prefill ô8 · C4a live-recompute ô3/8 · C4b "Bằng ngân sách" · C5 hủy/đổi winner (BE `Guid?` clear) · C7 fullscreen preview. **Clear-data** (`scripts/s85-wipe-uat-data.sql`, BACKUP-trước): wipe 43 PE + 28 budgets + 21 NCC-test, reset→A/001 (AskUserQuestion chốt scope). **6 vòng UAT #335→#338:** D1 ẩn 3/4/5 · D5 auto-quy-trình · D2 drafter-gỡ-GẤP (nới S77) · D3 ngân-sách-tự-nhảy từ ban-hành · ràng-tạo-phiếu + D4 checklist xanh/đỏ + "Quy trình duyệt". **2 ROOT-CAUSE:** **R5 #339 `1263c0d`** workflow-clear-on-edit = bug-class S42 (`UpdatePeDraftHandler` absolute-set→null-safe `if (X is not null)`, gotcha **#73**, +3 test) · **R6 #341 `49ac086`** TZ +7h (timestamps UTC nhưng serialize thiếu 'Z' → `UtcDateTimeJsonConverter` UTC-with-Z, gotcha **#72**; cicd verify `createdAt:"…Z"`). **5 SQL-fix** phiếu workflow-less (gán QT-DN-V2-001). Test 356→**374**. **State: Mig 57 · 88 bảng · 374 test · gotcha 73 · menu 54 · bundle admin `aKuNip19`/user `BUsL0HeQ` Run #341.** **🔴 NEXT (anh):** ⚠️ restart CLI (carry: budget v3 runtime + lệnh `/user-mark-*` + cadence §2.1.x). **NEXT UAT (anh Kiệt/long.chau Ctrl+F5):** giờ thông-báo đúng ("vừa xong") + Sửa phiếu giữ workflow + submit OK + checklist xanh/đỏ đủ + auto-quy-trình. **🔴 NEXT (em):** curate L1 test-specialist 28.4KB WATCH strike-1 (value-protect gotcha#/guard → KEEP) · monthly **2026-07-01** (doc-cite flush ef-core/skills-README Mig→57 + STATUS/HANDOFF re-tier + **SignalR TZ-check** nếu realtime-push còn lệch + **edit-form workflow-selector** defer = đóng dead-end "mở Sửa chọn quy trình" mà form chưa có ô). **Pending product:** Ngưỡng giá CEO (Mig 54) Designer UAT · "C" chuyển phiếu→dự án chờ spec. **Ops S58/S59:** email typo anh Chương · 5 real-staff pw · gán CNTT (tzutil VPS = KHÔNG-cần-nữa, R6 fix tầng-serialize chuẩn hơn). → log `2026-06-23-S85-pe-uat-cvpro-rootcause-tz.md`. · **Prev S84** — **bootstrap + flush session-start cap-echo v3 + commit S83 cicd harvest-orphan (LIGHT, 0 production code)** — 2 monitor INFORM → flush `session-start.md:114` `60/20/16`→**`220/60/50`** (+canonical-pointer chống tái-drift; detector C2 không track cap-number) + commit `cicd-monitor/MEMORY.md` harvest S83 sót-closeout (Run #333 + gotcha #69-REFINE). Lesson `feedback_derived_flush_execution`: derived→canonical flush = em-main execution KHÔNG gate user-confirm; chỉ ĐỔI-số = quyền anh. ⚠️ restart CLI (command `.md` no hot-reload). State GIỮ NGUYÊN Mig 57·88·356·71·`CsJetgZH`/`BVS0ApIm`. → log `2026-06-22-S84-session-start-cap-flush.md`. · **Prev S83** — **(1) H-15 v3 memory-budget full-parity (lead 220K/sub 60K/wf 50K, anh owner-directive) + (2) fix PE require-workflow create+submit prod-verified Run #333** — 2 commit: `2c7fd63` (gov docs-only CI-skip) + `fc1f19d` (PE fix). **H-15 v3:** full AI_INFRA parity (sửa self-shrink S82) + NEW `spawn_fill_directive` (nạp sub tới budget bằng prompt GIÀU — byte-cap MEMORY.md = 1 lát) + engine §G.5 + mark **v3-delta** `RC-pqhuy1987-22-06-2026-16-35-37` (anh-directed). **PE fix:** validator `NotEmpty(ApprovalWorkflowId)` + submit-guard (sau Section-3) chặn phiếu null-workflow ("quy trình cũ", kẹt V1-legacy). Diagnose A/040 **tự-khỏi-reload = cache** (KHÔNG đụng prod). test-before RED→GREEN, full-suite bắt **9 đỏ** → triage (2 spec-conflict rewrite V1-deprecated + 6 collateral giữ + 1 validator). Test 354→**356**. **#69-REFINE:** bundle KHÔNG rotate vì 0 fe-src (Vite deterministic) — ship-signal = Last-Modified KHÔNG hash-delta. Chi tiết → `## S83` dưới. ⚠️ restart CLI (budget v3 runtime). State: Mig 57·88 bảng·**356 test**·gotcha 71·bundle `CsJetgZH`/`BVS0ApIm` Run #333. · **Prev S82** — **adopt Harness-15-v2 (Tầng-1 hot-feed-lớn + L2/L3 bỏ-trần + %-print 2-đầu-phiên + ranh-giới vai-trò), 0 production code** — anh `/check-email AI_INFRA và /adap-apply all step by step cẩn thận`. 1 thư mới H15-v2-notify (verify ✓✓) + fan-out 29 vs 22 → CHỈ H15-v2 MỚI (7 còn lại verify đã-phủ S72/S75/S79). em-main IMPLEMENT D9 (6 edit: L1 12K→per-role lead 60K/sub 20K/wf 16K · L2/L3→NO-CAP · §G.4 · §2.1.6+§L.b(c) %-print · mark refine) + REVIEW Workflow `wf_04667b25-5fa` **3/3 PASS** (3 MINOR fixed). Ranh-giới vai-trò: con-số = quyền anh, AI thực-thi + báo-% (sửa framing S81 "lead-authority" gộp nhầm AI-lead↔owner). mark H-15 **v2-delta anh-confirm** `RC-pqhuy1987-21-06-2026-01-58-01`. commit `aa3f0fe` push (docs-only CI-skip) + email AI_INFRA `a749bb6bd1be`. Chi tiết → `## S82` dưới. ⚠️ restart CLI (%-print runtime §2.1.6 + §L.b(c)). State GIỮ NGUYÊN Mig 57·88 bảng·354 test·gotcha 71·bundle `CsJetgZH`/`BVS0ApIm`. · **Prev S81** — **adopt Harness-15 memory-budget per-agent (token-governor + value-gate + work-state block), 0 production code** — anh `/check-email AI_INFRA và /adap-apply step by step, review sau lẫn imple, report trung thực`. 0 new directed email; fan-out → CHỈ H15. em-main IMPLEMENT (8/8 🔴 floor) + REVIEW Workflow `wf_b7f3c8ac-b53` (3-lane PASS/PASS/HONEST → bắt 2 CONCERN honesty → fixed). Chi tiết → `## S81` dưới + adap-report. ⚠️ restart CLI (session-start §2.1.5). ✅ mark H-15 stamped Active-High (`RC-…23-07-37`). State GIỮ NGUYÊN Mig 57·88 bảng·354 test·gotcha 71·bundle `CsJetgZH`/`BVS0ApIm`. · **Prev S80** — **curate L1 over-cap memory → L2 archive (em-main single-writer, 0 production code)** — anh `/session-start` (bootstrap clean: 2 monitor CLEAN · detector 26-flag baseline-safe · test 354) → "check làm thử đi". archive-gate DRY-RUN: reviewer 45→**10KB** · investigator-codebase 40→**10KB** · cicd-monitor 39→**12KB** = cả 3 **keep-floor-hit cannot-auto-drain** → manual condense-with-archive: 31 entries byte-exact `sed` → `archive/2026-06.md` (**+N −0**, 0 byte-loss) + 31 `_INDEX` substring pointer → **A7 GATE PASS 217/217**. Stale foundation counts flushed (130/263→354·55→71·Mig40/55→57·84→88·bundle→#330). **State GIỮ NGUYÊN: Mig 57·88 bảng·354 test·gotcha 71.** **Lesson:** `_INDEX` substring **quote-free** (A7 quote-parser cắt escaped-quote `\"PURO\"` → FAIL 1, gate bắt). **🔴 NEXT (em):** frontend-designer 26KB + test-specialist 28KB WATCH (A6 strike-1<2). → log `2026-06-20-S80-curate-l1-overcap.md`. · **Prev S79** — **adopt User-Mark (H-12/13) canonical §P + Harness-14 (Eval/Budget/Outcome) + chữ-ký RC** — anh `/check-email AI_INFRA` + `/adap-apply` step-by-step (workflow double-check mỗi step), rồi gõ `/user-mark-active-high` "áp đầy-đủ chính-xác nhất theo AI_INFRA, không hỏi thêm". em main + **4 Workflow** (`wf_82337f7f-95c` invest → `wf_a7cbe93e-912` review → `wf_9d3beebb-a95` align-re-review → `wf_4d4eba6f-8a0` H14-review). **0 production code.** Bản đầu em phỏng-theo broadcast (cấp MUST/TRACK/ANCHOR/OFF) → anh trỏ canonical → **align FULL §P (P1-P10):** 4 lệnh `/user-mark-{active-high,active,medium,disable}` + ledger `.claude/governance/ACTIVE-MARKS.md` (Active-High/Active/Medium/Disable + display-filter) + `harness-11-engine.md §E`(P1-P10)+**§F**(H-14 3-mức maturity honest) + `rules.md §6.6` (objective-criteria KHÔNG quy-mô-đội/thời-gian-tuổi) + session-start §2.1.4/session-end §L.b(h) mark-display. **3 mark Active-High stamped** anh-confirm (`RC-pqhuy1987-20-06-2026-10-29-09/10/11` = objective-criteria/User-Mark/time-age, mirror AI_INFRA 3-mark, SE timestamp riêng P1 forward-only). completeness-gate H-6→H-13 **ĐẠT** (H-8 11/11 inherit no-`[1m]` · H-7 Cat-6 real). §F floor 6/6 + maturity HONEST + SE-state ACCURATE. **3 adap-report** + email ai_infra (body-hash `7b8615b3`) + check-email STAGE 2 move 2 email + `_index`. **Bài học `feedback_canonical_spec_over_broadcast`:** broadcast cô-đọng→canonical-command/§P là spec THẬT (phải pull, đừng phỏng-theo) · report-before-stamp dogfood (lệnh tự bắt báo-cáo-trước-stamp = đúng lệnh) · residual own-diary OK (D9 áp canonical, không cấm sub ghi diary riêng). detector clean sau align (0 C1/C3 mới). **State THẬT GIỮ NGUYÊN: Mig 57 · 88 bảng · 354 test · gotcha 71 · menu 54 · bundle `CsJetgZH`/`BVS0ApIm`.** **🔴 NEXT (anh):** ⚠️ **restart CLI** (đầu việc) — activate 4 lệnh `/user-mark-*` + session-start §2.1.4/session-end §L.b(h) mark-display + engine §E/§F. Sau restart, session-start tự hiển-thị 3 mark Active-High. **🔴 NEXT (em):** curate L1 over-cap reviewer/cicd/investigator-codebase (carry 7-session + S79 workflow-spawn; inv 39.8KB +diary) — manual SPLIT/condense, archive-gate A7 GATE; + §7-header `rules.md` "77 test" stale → C2/monthly-audit. **Pending product (carry):** "Ngưỡng giá CEO" Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. **Ops S58/S59:** tzutil VPS · anh Chương email typo · 5 real-staff pw · gán CNTT. Chi tiết → `2026-06-20-S79-user-mark-harness-14-adopt.md`. · **Prev S78** — **PE: đính kèm file khi DUYỆT (UAT Tra Sol / 5 tester)** — người duyệt tải file lên ngay lúc Duyệt thay vì Trả lại phiếu. Reuse hệ attachment + enum `ApprovalAttachment=5` **MIGRATION-FREE** (int-stored, endpoint+authz có sẵn → approver upload được). FE 2 app SHA-identical: `PeWorkflowPanel` picker multi-file + upload-trước-chuyển-phase (file lỗi=không duyệt) + mục "📎 File đính kèm khi duyệt" + 2 filter fix loại purpose=5 khỏi "Bảng so sánh" (gotcha **#71** proxy-predicate pollution). commit `7886fd0` → **Run #330 PASS** (test 354, bundle admin `CsJetgZH`/user `BVS0ApIm`, NO migration, smoke 4×200). 3 lỗi em tự bắt review-trước-deploy (authz-verify · filter-pollution #71 · Dialog mirror-truncate fe-admin). em-main-led + self-gate (grep no-leak) + cicd-monitor verify. **🔴 NEXT (em):** curate L1 over-cap (carry 6 session) reviewer **45.2KB** + cicd 38.8KB + inv 35.7KB keep-floor-hit manual-condense (archive-gate A7 GATE PASS 186/186). **NEXT UAT:** mở phiếu chờ duyệt → Duyệt → "+ Chọn file đính kèm" → Xác nhận → file ở mục "📎 File đính kèm khi duyệt". Chi tiết → `2026-06-19-S78-pe-attach-file-on-approve.md`. · **Prev S77** — **PE UX batch: 10 deploy prod-verified #320→#329 (anh Kiệt FDC + Tra Sol + Bích Phượng UAT realtime, HMW-mode ON)** — cờ GẤP pill mọi danh sách+inbox · focus→revert list bám-trái · **Mig 57** ô ghi chú giá đề xuất PRO/CCM + số phân cách VND + chính tả "Bảng so sánh giá" + guard #70 · số âm đỏ-ngoặc · mục con thụt+gạch-đầu-dòng · cờ gấp **BẤT ĐỐI XỨNG** GẮN=NV/GỠ=Trưởng phòng(DeptManager) · tách chọn-phiếu(inline) khỏi mở-rộng(overlay)+nút "Xem mở rộng" · chuông báo người duyệt vào cấp họ · banner phiếu Trả-lại. Mig 56→**57** · test 344→**354** (+10) · bundle cuối admin `BqKD3Y23`/user `Cn-i349D` (Run #329). **3 lỗi em tự bắt review-TRƯỚC-deploy** (guard#70 stale-echo · luật asymmetric Tra Sol clarify giữa-chừng · double-mount Task H). FD process-death Task H → recover-disk. **🔴 NEXT (em):** curate L1 over-cap reviewer **45KB** + cicd 37.6KB + inv 35.6KB keep-floor-hit manual-condense (archive-gate A7 GATE PASS 186/186 integrity OK). **NEXT UAT:** cờ gấp (GỠ chỉ TP) · chuông báo người duyệt · banner Trả-lại · Xem mở rộng · ô ghi chú PRO/CCM. Chi tiết → `2026-06-19-S77-pe-ux-batch-10-deploy.md`. · **Prev S76** — **PE ngân sách MA TRẬN 3 cột (Dự án|PRO|CCM) + bảng lưới `
` viền-ô + badge quyền-NS theo role** — anh Kiệt FDC + chị Trà Sol go-live. anh giao `/ultra-on` "step-by-step + workflow-review-per-step, hoàn chỉnh rồi deploy". **3 commit prod-verified:** `e33481e` (feature Run #318 — Mig 56 + ma-trận-3-cột + badge designer/flow `BhFDF9IJ`/`BAkuRl3C`) → `21d1f4e` (bảng lưới `
` theo phản hồi anh "chưa chia cột giống Excel", Run #319 **`jOqxW4-p`**/**`DbsznVvR`** smoke 3×200). Mig 56 +ProInitial/ProAdjust cột PRO (additive + data-migrate ProEstimate→ProInitial 4 rows prod). Part 1 mỗi phòng sửa cột mình (PRO canEditPro / CCM canEditCcm / Dự án FE-only). Part 2+3 badge "✎ NS PRO/CCM" cạnh approver (display-only suy-role) ở Designer + flow Duyệt NCC. Test 339→**344**. reviewer bắt **race mất-dữ-liệu** Part 1 → vá `useIsFetching` 2 app (gotcha #70). **🔴 NEXT (em):** curate L1 over-cap reviewer **45KB** + inv-codebase 35KB (keep-floor-hit → manual condense) + cicd 29KB + test-spec 28KB. **NEXT (anh/anh Kiệt):** UAT bảng lưới bằng PRO/CCM (Ctrl+F5). Chi tiết → `2026-06-19-S76-pe-budget-matrix-table-grid.md`. · **Prev S75 (2026-06-18)** — **Harness-11 adopt: engine bộ-nhớ-và-governance tự-bảo-trì + 2 double-check** — anh giao `/check-email AI_INFRA` + `/adap-apply` (mỗi stage workflow-review) + double-check ×2 + finalize report + push + session-end. em main + **5 Workflow** (audit `wf_7fdc3bd5-930` → implement `wf_c5e5844e-7c1` → review `wf_d7ca1ff8-942` → double-check `wf_a0b68d2f-30e` → checklist-verify `wf_39cd4cbe-f07`). **0 production code.** Built 2 NO-API detector-script (`governance-detectors.ps1` C1-C5+B3 runtime **26 flag** bắt drift thật, C4 0-self-match · `memory-archive-gate.ps1` PHẦN A hysteresis/keep-floor/2-strike/A7 186/186) + `docs/governance/harness-11-engine.md` canonical (3-tier D5/D6/D7 + one-direction-lock D8) + **B1 ×11 count→pointer** (drift mig53→55/test306→339/gotcha68→69/table93→88 RESOLVED) + cadence-wire D1/D2 + agents/README. **completeness-gate FORMAL ĐẠT** (B 4/4 + C 5/5 + D 11/11; D5/D6/D7 explicit + D8 codify=YES). gotcha #30 reinforced (box-glyph ├└─ KHÔNG vào .ps1, kể cả qua Edit). 3 commit `e70c046`+`ae957c4`+`aa09e99` pushed + adap-report + email ai_infra (`2316773229f2`). State GIỮ NGUYÊN Mig 55·88 bảng·339 test·gotcha 69·bundle `BYF5vIMJ`/`CB-tiRxd`. **🔴 NEXT (anh):** restart CLI (cadence §2.1.3/§L.b + ef-core skill); curate reviewer 38.8KB+inv 31.5KB+cicd 26.8KB over-cap. Chi tiết → `2026-06-18-S75-harness-11-adopt.md`. · **Prev S74** — **PE ô "Ghi chú từ CCM" ngân sách gói thầu (Mig 55)** — anh forward 2 luồng Zalo (Trà Sol + Kiệt FDC) "CCM giống PRO cho nhập + ghi chú, hiện 0 hết" → em-main BE+Mig55 ∥ implementer-frontend FE 2 app SHA-mirror ∥ test-specialist (chết rate-limit → recover-disk). 2 fork anh chốt: **thêm CcmNote (Mig 55)** + **GIỮ phân vai CCM** (CostControl/Admin). Entity +CcmNote mirror ProNote · UpdatePeBudgetCcmCommand +CcmNote absolute-set role-gate · DTO+controller+mapping · FE dòng "Ghi chú từ CCM" gate canEditCcm. Test 334→**339** (+5). commit `8655ebf` (cicd **Run #315 PASS** — bundle admin `BYF5vIMJ`/user `CB-tiRxd`, Mig 55 applied prod). **"0 hết không nhập" = tài khoản thiếu role CostControl (KHÔNG bug)** → UAT bằng CCM/Admin. **🔴 NEXT (anh/anh Kiệt):** UAT ô CCM bằng tài khoản CCM/Admin + carry "Ngưỡng giá CEO" Mig 54. Chi tiết → session log `2026-06-18-S74-pe-ccm-note.md`. · **Prev S73** — **Mig 54 PE giá đề xuất PRO/CCM + CEO chọn giá chốt + CCM duyệt-done ô-tích (anh Kiệt FDC, go-live thứ Hai 22/06)** — em main + 6 sub + 2 review-workflow, 2 commit prod-verified (`1d86abc` feature Run #313 + `6aa4dcb` FE empty-candidates fix). Mig 54 5-cột additive-nullable + 2 setter role-gate + ApproveV2 ③ AUTO→OPT-IN + ① bind giá chốt; FE 2 app SHA-mirror; test 306→334. **Workflow review:** R1 schema-force 1/4 lane → R2 free-text 2/3 PASS (rủi ro FE empty-candidates UNREACHABLE per submit-guard `:194`). Bài học: review fan-out free-text/hmw KHÔNG ép-schema. **Governance:** em lệch mandate auto-Workflow → cam kết báo-TRƯỚC-khi-lệch. **🔴 NEXT (anh/anh Kiệt):** cấu hình "Ngưỡng giá CEO" Designer + test 3 luồng + xác nhận CCM-trước-CEO. Chi tiết → session log `2026-06-18-S73-pe-gia-de-xuat-ccm-done.md`. · **Prev S72** — **Harness-10 flat-refine + checklist-v2 adopt (re-audit 3-workflow) + sleep NO-OP** — audit `wf_13868efb-ea7` → implement `wf_ac43b5ff-7d1` → review `wf_d482e10d-5dd` (Harness-9 B1+B2). SE BEHIND flat → migrate run-trace SUBFOLDER→FLAT (hmw.js:103 + 5 doc; 5 run cũ giữ subfolder C8) + 2 broadcast 06-18 adopt + `/sleep-recovery-memory-l2` port (A8) + detector TAILORED-OUT + hmw.js H4.5→H8 doc-drift. **REVIEW (B2) bắt 2 lỗi IMPLEMENT-self-assess sót** (hmw.js:52 schema-stale + auto-check overclaim) → fixed (auto-check WIRED thật). em-main containment-check tự bắt reviewer residual-write (raw-Workflow no-writeGuard) → revert. B3 self-correct (runs path/count 14→22). Sleep `all`=NO-OP. **0 prod code, state GIỮ NGUYÊN.** adap-report + email ai_infra (`5f511fe5c0f2`). **🔴 NEXT (anh):** restart CLI (FLAT-runtime hmw.js + wired sleep-check + sleep-recovery skill). **🔴 NEXT (em):** curate investigator-codebase L1 28973 OVER + watch FD/test-spec. Chi tiết → session log `2026-06-18-S72-harness-10-flat-refine.md`. **Prev S71 — Harness-10 adopt: tracked run-trace folder + checklist 9-10** — em main + 3 Workflow (invest `wf_9c2cd2cd-2e7` → implement `wf_e4e46725-231` → review `wf_636bc95b-939`) per mandate Harness-9 PART 2. **0 production code**. Migrate `.claude/workflows/wave-*/` gitignored → `runs//` **git-TRACKED** (run.md+sub-md/+harvest/) + `_ledger.md` 2-nhịp + 3-layer anti-miss (L1 em-main@P1 / L2 session-start orphan-scan / L3 session-end close-gate idempotent) + **containment shift** (Harness-2 B6 "mọi tracked-change=vi-phạm" → "tracked-change NGOÀI run-folder + code-disjoint=vi-phạm"). hmw.js wave→run-trace (accept `args.run` + alias `wave`, path `sub-md/`, `node --check` PARSE-OK). **Review độc-lập (R2+R3) bắt C5 L1 over-claim** (doc nói hmw.js prompt-builder emit L1 reminder, grep engine=0 → engine no-fs → fixed path-a: L1 = em-main @P1 convention) — dogfood mandate B2 đúng. checklist 9-10: Part A (Harness-9 memory) + B (adap 2-workflow) done S70, Part C (Harness-10) 8/8 MỚI. **State GIỮ NGUYÊN: Mig 53·88 bảng·306 test·68 gotcha·menu 54·bundle admin `BgNCjwsG`/user `CBvh0vtf`.** + CLAUDE.md test-flush 263→306 (resolve H1 stale). **🔴 NEXT (anh):** restart CLI (hmw.js RUN-TRACE runtime + carry §2.1.2/Cat-6/H8). Chi tiết → session log `2026-06-18-S71-harness-10-run-trace.md` (pending). **Prev S70 —** **Harness-9 adopt: L2 archive dark-matter recovery + adap 2-workflow mandate** — em main + 3 Workflow (investigate `wf_be952f3c-97f` → implement `wf_a58e0d15-beb` → audit `wf_9520d8cd-4fe`) + 2 monitor bootstrap. **0 production code** (governance/memory only, commit `f36aab8` pushed). 4 over-cap sub-agent curate L1→L2 + `archive/_INDEX.md` (mục-lục substring sha-keyed) + `.gist.md` (4-field distill-gen:1, verbatim FROZEN) → **cả 4 < 25KB auto-inject cap** (P1 curate-debt CLOSED; ~240KB archive hết RAG-dark). PART 2/3 process-mandate codify (adap-apply 2-workflow + agents/README Upgrade S70 + session-start §2.1.2). **0-byte-loss git+sha verified** (Stage C audit + em-main self-gate khi 2 reviewer no-StructuredOutput → recovery-path). +memory-budget.json (seed-by-measure) + measure-agent-memory.ps1 + .ragignore + doc-drift 4-cite flush. adap-report + email-back ai_infra (`7c07b716e775`). **State THẬT GIỮ NGUYÊN: Mig 53 · 88 bảng · 306 test · 68 gotcha · menu 54 · bundle admin `BgNCjwsG`/user `CBvh0vtf`.** **🔴 NEXT (anh):** restart CLI để activate session-start §2.1.2 budget-audit + pending H8 inherit + reviewer Cat-6. Chi tiết → session log `2026-06-17-S70-harness-9-l2-recovery.md`. **Prev S69 —** **Văn phòng số (E-Office) port + golive + PE cờ gấp/ngưỡng CCM — 4 deploy prod-verified Run #305→#308, HMW-mode ON, 2 workflow fan-out**: #305 foundation PURO (shared PageHeader/KpiCard/WidgetCard + Dashboard 2-cột + sync fe-admin index.css đóng drift S66-S68) → #306 **re-skin TRỌN 10 page** (PURO layout + CSS Hồ sơ NS, phẫu-thuật-giữ-100%-logic) → #307 **Office golive public** read+create **16-key allow-list mọi role** (mirror S65, chạy SAU revoke; excluded Off_PhongHop_Manage/Off_AttendanceReport/Off_ChamCong; cicd DB-verify 16/16×13 role) → #308 **PE cờ gấp PRO/CCM + CCM duyệt-final theo ngưỡng giá trị** Mig 53 (anh Kiệt FDC sau họp sếp). **State THẬT: Mig 53 · 88 bảng · 306 test (45D+261I) · 68 gotcha · menu 54 · bundle admin `BgNCjwsG`/user `CBvh0vtf` Run #308.** 2 gotcha NEW (**#67** Tailwind accent palette thiếu-stop vỡ-màu-im-lặng · **#68** stale-diagnostic-background-agent → chỉ tin build sau-cùng). 2 truncation #53 (impl-backend positional-record + impl-frontend) → em main recover-disk + self-gate. **🔴 NEXT (anh/anh Kiệt UAT):** (1) cấu hình "Ngưỡng giá trị gói CEO" trong Workflow Designer (null=luồng cũ) + test phiếu < ngưỡng → CCM duyệt là xong, ≥ ngưỡng → lên CEO; (2) test cờ gấp PRO(đỏ)/CCM(xanh) → badge + notify CEO; (3) **xác nhận:** quy trình đặt CCM(CostControl)-trước-CEO + CEO = role Director (đích notify). **C (sau duyệt → chuyển phiếu đến dự án) chờ anh Kiệt spec form.** **NEXT (em):** 🔴 curate cicd-monitor **65.2KB** (worst, trend tăng) + inv-codebase 47 + reviewer 43.5 over-cap · doc-flush docs/CLAUDE.md full. Chi tiết → session log `2026-06-17-S69-vanphong-golive-pe-urgent-threshold.md`. **Prev S68 —** **Hồ sơ NS header chi tiết NV: làm nổi bật + fix tên render đen→trắng** — em main solo, 3 commit (2 FE + 1 docs), 2 deploy prod-verified Run #303-304 (anh UAT realtime): badge màu theo trạng thái + dòng meta đậm + tên to/drop-shadow (#303 `6983609`) → anh báo "tên đen nền xanh ko nổi bật" → diagnose **rule `h1-h4{color:#0b1220}` viết NGOÀI `@layer` thắng `text-white`** (Tailwind v4 unlayered > all layers, **gotcha #66 NEW**, load-bearing ~30+ heading → fix ĐIỂM `text-white!` không move @layer) + thu nhỏ `text-lg` (#304 `37752eb`). Bootstrap: 2 monitor RE-REPORT CLEAN + 2 doc-drift fix (dep-audit 64→65 · root CLAUDE 263→286, `11bc96d`). **State THẬT: Mig 52 · 88 bảng · 286 test · 66 gotcha · menu 53 · bundle admin `CNUv1jxY`/user `CpOskeS1` Run #304.** ⚠️ curate-debt P1: cicd-monitor **44.1KB**. Chi tiết → session log `2026-06-16-S68-hoso-header-name-color-fix.md`. **Prev S67 —** **buổi sản phẩm LỚN, 6 deploy prod-verified Run #297→#302** (anh + anh Kiệt FDC UAT realtime, HMW-mode ON): fe-user Hồ sơ NS đồng nhất font + chữ đen→**xanh đậm `brand-800`** (#297) · **fe-admin mirror master-detail** + vá accent tokens index.css [đóng pending lớn nhất HRM go-live, page SHA256 ×2] (#298) · **+23 test-after HRM** → 263→**286** (#299) · **list flex-row gọn** [hết tràn ngang rail] + đồng nhất cỡ chữ ×2 (#300) · **PE Link hồ sơ auto-detect** web→hyperlink/`O:\`→Copy (#301) → **link `file://` bấm-thử** (#302). **Research 3-agent:** auto-mở `O:\` từ web = chỉ **Edge GPO `IntranetFileLinksEnabled`** (zero-per-machine) one-click thật; default chặn https→file://. **State THẬT: Mig 52 · 88 bảng · 286 test (45D+241I) · 65 gotcha · menu 53 · bundle admin `CcrZqfht`/user `DniDFUB_` Run #302.** test-specialist trunc #53→recover-disk; 0 prod bug. Chi tiết → session log `2026-06-16-S67-hoso-visual-pe-link-research.md`. **Prev S66 — session-end closeout em-main-solo:** adopt **Harness-8 all-inherit** (7 sub demoted `claude-opus-4-8`→`inherit` → cả 11=inherit, gỡ two-tier H4) + **cicd-monitor L1 curate 86.8→28.9KB** (byte-exact sed → `archive/2026-06.md`) + **ef-core skill doc-flush Mig 50→52** + check-email AI_INFRA (**0 thư mới se-directed**). ~17 file docs/gov/config, **0 production code** → state THẬT GIỮ NGUYÊN (Mig 52 · 88 bảng · 263 test · 65 gotcha · menu 53 · bundle `BDwV5d0X`/`DbVv6rsf`). ⚠️ **Restart CLI** → H8 runtime (frontmatter no hot-reload) + reviewer Cat-6. adap-report + email-back ai_infra (`fa7f690d` MATCH). Chi tiết → session log `2026-06-16-S66-closeout-harness8-cicd-curate.md`. **Prev S65 — HRM go-live: public Hồ sơ Nhân sự + trang master-detail giống NamGroup + Department hierarchy Mig 51 + PE Link hồ sơ Mig 52 + gốc cây SOLUTION COMPANY**, ~6 deploy prod-verified Run #289→#295, anh + anh Kiệt FDC UAT realtime. **State THẬT: Mig 52 · 88 bảng · 263 test (45D+218I) · 65 gotcha · menu 53 · bundle admin `BDwV5d0X`/user `DbVv6rsf` Run #295.** Workflow fan-out chạy THẬT lần đầu [PE] — BE∥FE parallel OK nhưng FE+reviewer return-rỗng #53 → em main recover-disk + self-gate. gotcha #65 [build csproj con ≠ slnx → CS7036]. Chi tiết → session log `2026-06-16-S65-hrm-golive-employee-masterdetail-pe-link.md`. **Prev S64** adopt **Harness-7 writing-quality floor** qua `/adap-apply` + email ai_infra — em main solo, 1 commit `6afde19` docs/gov-only. Outward comms = tiếng Việt câu-hoàn-chỉnh; nội bộ giữ nén (asymmetric). reviewer +Category 6 (verified-pending-restart → cần restart CLI). Broadcast body-hash verified KHÔNG mis-stamp (gotcha #61 UTF-8). Prev S63 docs-closeout bù S60/S61/S62 — 3 session product ship CODE prod-verified nhưng KHÔNG closeout docs (UAT realtime anh Kiệt FDC). **State THẬT: Mig 50 · 88 bảng · 263 test · 64 gotcha · menu 53 · bundle admin `0xKYGhhf`/user `C81ZdG9G` Run #286.** S60-62 = PE ràng buộc gửi-duyệt + gỡ "Từ chối" (S60) · Mig 50 ngân sách per-gói-thầu Excel anh Kiệt + XÓA module Budget cũ (S61) · vượt-NS cảnh-báo-mềm (S62). Reconcile stray reviewer cwd-misland + count-flush 4 file. Chi tiết → session log `2026-06-12-S60-S62-pe-budget-workitem-softwarning.md`. Prev Session 59 ( **6 đợt ship prod-verified Run #273→#278**: wipe transactional testing data (10 PE + 7 HĐ demo + 64 notif = 0, mã reset → phiếu thật đầu tiên team tạo = **PE/2026/A/001** ✓) `56882ac` #273 · PE tree Panel 1 chốt 4 tầng **Năm > Dự án > Hạng mục > Phiếu** `0eafcd3` #274 · dọn 15 mã hạng mục demo "tự đẻ" (chị Trà Sol) + gỡ seed gốc, WorkItems 86→**71** `bbd1554` #275 · **rename 71 mã đúng format PMH anh Kiệt** (`MAT-n`/`SUB-n`/`MEP-SUB-n`/`MEP-EQU-n` + tên "STT nhóm tên"; **DB-trước-code-sau** gotcha #62 + sqlcmd `-f 65001` gotcha #61) `c869d26` #276 · UAT vòng 1: NEW `ui/SearchableSelect` gõ-lọc bỏ dấu (Hạng mục/Dự án) + auto Địa điểm + điều khoản đa dòng `faed59f` #277 · UAT vòng 2 (anh chốt ×2): ẩn Trả lại/Từ chối khi tự duyệt phiếu mình soạn + quick-add NCC ngay form (POST /suppliers any-auth, authz probe 4/4) + NCC gõ-tìm A-Z + upload multi-file `9c330d2` #278 · UAT vòng 3-6 realtime (#279/#281 cancelled-supersede-benign): bảng NCC table-fixed `f21c55d` + bỏ ô Tên ngân sách `69997da` #280 + GỠ field Điều khoản TT mọi form `80b64dd` + bỏ nút Thêm hạng mục `792c030` **#282 FINAL**. Tổng 10 đợt (8 PASS + 2 cancelled-benign). Bundle FINAL admin **`B1DtNT9C`**/user **`D6uF3Mln`**. Test 240. Gotchas 62. 0/14 spawn truncated. → session log `2026-06-11-S59-wipe-tree-pmh-uat-batch.md`. Prev S58 — **5 đợt prod-verified Run #382/#383/#384/#386** (#385 cancelled-supersede-benign): lock-demo-user fix (việc sếp deadline 15:00 ĐÓNG TRỌN — gotcha #60/E-008/AS-12, root cause password 11<12 từng phát hiện S22 nhưng const không fix) + tạm ẩn HRM/Office/Cá nhân + Danh mục cuối (`6c5fd26` #383) + **fe-user redesign theo UI/UX guide AI_INFRA giữ brand** (`e959f72` #384) + **brand polish ×2 app "thấy rõ"** (`ea793a4`: stripe 4px đỉnh + thead brand) + **PE gộp Tên-gói-thầu = chọn Hạng-mục** (anh Kiệt FDC chốt, `3ebaf84` #386 — bundle final admin `DMm9rtNA`/user `BUkOMn_Y`). Email AI_INFRA processed (guide + ACK H4 ACCEPT). Test **240**. → session log `2026-06-11-S58-lock-fix-hide-modules-redesign-pe-merge.md`. Root cause 2 tầng: lock-list = population Dev-only + `DemoUserPassword` 11 ký tự < prod RequiredLength=12 → CreateAsync silent-fail từ trước tới giờ (= "helpdesk inert" S56). Fix union 20 UAT email + password 12 ký tự → prod 55 user/34 locked, nv.cao+nv.truong sống, 5 real staff tạo. gotcha #59+#60. Commit `5998163`. Prev S57bis — **PE gắn Hạng mục (Mig 49) + Pe all-role + menu Cá nhân + Harness-4 runtime-VERIFIED**. Test 228→**240**. Bundle `CP4CB1ym`/`BmZ3VHnm`. Commit `17b23a4`+`dd117b7` → Run #381 PASS+1PARTIAL (lock NO-OP → RESOLVED S58). Prev S56 — **Pre-golive verify sweep + golive-harden 4 fix — Run #379 PASS, code golive-ready**. WF1 `pre-golive-verify` 7-stream + adversarial → 6 PASS/1 CONCERN/0 blocker = GO (key finds = ops not code). WF2 `golive-harden` fix 4: #3 LeaveBalance lost-update→atomic ExecuteUpdate+Serializable tx (NO mig) · #5 ItTicket authz Forbidden-trước-NotFound · #6 DocxRenderer null-guard · #4 Travel/Vehicle ApproveV2 tests. Test 216→**228**. Bundle FROZEN `4SUwDLD8`/`XdKzt9LL`. `sys.tables` re-ground 92→**93**. gotcha **#58** NEW. reviewer StructuredOutput-fail→em main đỡ. **2 ops VPS pending** (gán user IT + tzutil UTC+7). FE Phase 2 redesign **deferred** (recon ready). Commit `a20cde8`. Prev S55 — **Nạp master data thật từ Excel (62 dự án + 71 hạng mục + 3 NCC) + Project +4 cột (Mig 48) — prod-verified**. HMW-mode ON. Commit `69cb393` → Run #377 PASS ~4m33s. Test 216 (compile-fix only). Bundle admin `B-d6893W`/user `XdKzt9LL`. `SeedRealMasterDataAsync` ungated idempotent → coexist demo. 2 agent return truncated (BE+reviewer) → em main disk/runtime-recover. Prev S54 — IT staff tự reassign ticket (cross-stack authz) — prod-verified. 1 code commit `ca4b602` → Run #376 PASS ~4m18s. Test 203→**216**. Bundle admin `DfCfHUE9`→`DmjI8Cmn`/user `_3S0BPJ2`→`YxL_MljK` (cả 2 rotate). NO migration. Task 1 Phase 9 Ops anh dừng. ⚠️ residual: 3 agent ghi MEMORY nhầm `src/Backend/.claude` → em main reconcile. Prev S53: gotcha #57 EXT Master Mig 47 + P11-D/E + database-agent verified-runtime.) --- diff --git a/docs/STATUS.md b/docs/STATUS.md index 327b71f..ab7ca02 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-06-25 (S90 — **Chèn 12 ảnh khoanh-đỏ vào guide Word `docs/Huong-dan-Duyet-NCC.docx` (em tự chụp prod qua Chrome) + chẩn UltraViewer — em-main solo, 0 production code, HMW-mode ON**: anh `/session-start` → "mở chrome vào chụp ảnh dán vào luôn" (12 ô ảnh trống từ S89). Browser-driving = vòng-lặp thị-giác tuần-tự → **em-main solo** (KHÔNG fan-out Workflow, đúng decision-tree). **Pipeline tự-chế (gotcha #74 NEW):** MCP `save_to_disk` (Chrome MCP + computer-use) KHÔNG ra file truy-cập được env này → **PowerShell .NET `CopyFromScreen` + Win32 `EnumWindows`+lọc-process-`chrome.exe`+`SetForegroundWindow`** (lọc process vì app Claude-Code Electron cùng class+title "Solutions ERP" → khớp nhầm) chụp PNG 2560×1600 + **DOM overlay `window.__ccA`** khoanh-đỏ **element-based** (minLeft/maxLeft/exact/up/nth/**case-insensitive** — toạ-độ-cứng vỡ do viewport đổi 812↔833; label CSS-uppercase→case-insensitive) + crop 92/72 (banner CDP "Claude started debugging" s08/s12→146, verify montage dải-trên) + `python-docx add_picture(6.0")` fit-A4 (6.3" tràn vì A4 content=6.27") vào 12 table cell + caption "Hình N". 12 màn: login·menu+tạo·form-fields·NCC+báo-giá·NS+QT·checklist+gửi·inbox·detail+so-sánh·quyết-định·workflow-matrix+cờ-finalize·tạo-HĐ·cây-list. Verify **13 ảnh** (1 logo+12) + montage sạch-banner. **0 prod mutation** (xem-only, KHÔNG bấm Gửi/Duyệt/Trả-lại/Tạo-HĐ; `?mode=new` không tạo draft). anh tự login Admin. **Caveats guide (carry):** ① #9 app chỉ **Duyệt+Trả-lại** (gỡ "Từ chối" S60 → text guide stale, chờ anh OK sửa) · ② #10 workflow chưa bật finalize → chụp **cờ "Duyệt là KẾT THÚC quy trình"** thay badge sơ-đồ · ③ #11 KHÔNG bấm Tạo-HĐ (no created-contract shot) · ④ account=admin (sidebar nhiều menu admin). **UltraViewer (anh hỏi "sao bật"):** chẩn `UltraViewService` StartMode=**Auto**/LocalSystem standby, **0 kết-nối Established**, em KHÔNG mở (chỉ grant Chrome; computer-use screenshot **detect+mask** nó) → hướng-dẫn tắt self-serve (KHÔNG tự đổi system-setting, theo prohibited-rule). **State GIỮ NGUYÊN: Mig 59 · 88 bảng · 422 test · gotcha 74 (+#74) · menu 54 · bundle admin `DalcOhvb`/user `CdS4tX_2`.** docx committed closeout (docs-only CI-skip). **🔴 NEXT anh:** review docx trong Word + ⚠️ restart CLI (carry budget v3 + `/user-mark-*` + cadence) + (tùy) bật finalize 1 cấp → ảnh #10 badge / bấm tạo 1 HĐ thử → ảnh #11. **NEXT em:** sửa text "Từ chối"→"Duyệt/Trả lại" guide nếu anh OK · curate test-specialist L1 34.8KB OVER (carry S88). → log `2026-06-25-S90-guide-screenshots-insert.md`.) · **Prev S89** (S89 — **PE visibility/finalize batch + xóa 38 User test prod + Word guide, ~6 commit prod-verified, HMW-mode ON**: **D1 nháp riêng-tư** (`a71753b` Run #465, test 419→421) — IDOR fix nháp lộ qua cond#2 role (GetEligiblePhases Drafter/DeptManager→DangSoanThao) + **cond#3 V2-approver** (workflow pin lúc-TẠO → CEO approver thấy MỌI nháp = leak màn CEO) → 4 chỗ owner-only (GetEligiblePhases bỏ DangSoanThao · admin-inbox bỏ · list-cond3 guard · detail-authz guard) + PeDraftVisibilityTests · **D2 CCM giá-đề-xuất** (`f7bd97a`) gỡ `!readOnly` over-gate (gate thuần role mirror ô ngân-sách; BE setter fail-closed = chốt) · **D3 finalize-note 3-surface** (`f0bca77` test 421→422) BE +3 computed-field detail+list DTO **no-migration** + EF-subquery first-reachable + PeFinalizeChip 2-app (invest-WF `wf_341f7b29` + impl-WF `wf_3f57edb6`; **impl-FE return-rỗng #53** → em-main mirror fe-admin 4-file SHA + self-gate + PeFinalizeProjectionTests) + **flow badge "⚑ Duyệt thay CEO"** PeWorkflowPanel (`9c920ad`) + **matrix flag thứ-8** WorkflowMatrixViewPage thiếu allowApproverFinalize từ S87 (`fef4c33`) · **xóa User test** (`681b1ed`) recon prod (ssh sqlcmd) 55→giữ 17/xóa 38 (whitelist-keep + backup `SolutionErp_S89_preuserdelete.bak` + count-guard[30,45] + XACT_ABORT; KHÔNG approver-block FK; nv.test 1-PE) + gỡ seed SeedDemoUsers/Lock · **Word guide** `docs/Huong-dan-Duyet-NCC.docx` (skill docx, logo Solution, 8 phần, khoanh-đỏ 1→2→3, ảnh-chờ-chụp). **State THẬT: Mig 59 · 88 bảng · 422 test (45D+377I) · gotcha 73 · menu 54 · bundle admin `DalcOhvb`/user `CdS4tX_2` · prod 17 user thật.** **Lessons:** Designer-save = version-MỚI (phiếu pin version-cũ → finalize chỉ hiện phiếu-MỚI = "check rồi mà không thấy") · doc-drift thêm-flag-Designer-quên-surface-matrix-song-song · whitelist-keep + 3-lớp-guard prod-delete · WF-impl-FE-return-rỗng → em-main mirror + self-gate (≡ S65/S73). 🔴 NEXT em: curate test-specialist L1 34.8KB OVER + cicd 28KB + reviewer 27.7KB. NEXT anh: chèn 12 ảnh guide + restart CLI. → log `2026-06-25-S89-pe-visibility-finalize-userclean-guide.md`.) · **Prev S88** (S88 — **PE stability audit (frozen CEO-approved spec) → fix patchwork D1 + hoàn-thiện multi-winner D2, 2 deploy prod-verified, HMW-mode ON, audit-workflow + ~14 spawn**: anh giao review/invest/test lại Duyệt NCC, "chấp vá thì xử lý, tính năng đã ổn định". **Audit Workflow `wf_c15da996-be5`** (6 area × invest→review pipeline + full-suite test, 13 agent) → CORE SOLID (winnerQuoteTotal 3 site · SelectWinner clear · urgent fail-closed authz · drafter-exclusion notify · 2 finalize mechanism) + tách findings **safe vs behavior-affecting**. AskUserQuestion ×4 chốt max-scope: sửa-hết-safe + hoàn-thiện-joint-winner + bật-CEO-notify + create-contract = **1 HĐ/winner**. **D1 (`73cce1f` Run #347 PASS):** Block B financials re-key `SelectedSupplierId→IsWinner` (số "Giá trị kỳ này"=0 + peer-rollup bỏ-sót cho ≥2 winner) · **CEO-notify-on-urgent +SaveChanges** (notify chạy SAU SaveChanges duy-nhất → rớt âm-thầm, Director KHÔNG nhận; +6 `PeUrgentNotifyDirectorTests` real-notify-fixture) · **HoSoLink null-safe + clear-via-empty** (sửa header wipe link đã-set, bug-class S42/#73; null=preserve/""=clear; HoSoLinkRow gửi `""`) · #70 guard PRO budget row3/row8 · dời `SetPeCcmBudgetPeriod` PeSuggestedPrice→PeWorkItemBudgetFeatures · comment. Test 402→**413** (+11). **D2 (`1aa3bdb` Run success):** **create-contract 1→N** (Command→`List`; **ContractCodeGenerator self-commit seq mỗi call → gen TẤT-CẢ mã TRƯỚC Add → build N local → atomic final SaveChanges** = no partial-create; GiaTri single=details-sum legacy/≥2=per-winner quote-total draft-editable anh-Kiệt-UAT; pe.ContractId=first idempotency; controller `{contractIds}`) · **list-card winner names** (DTO +`WinnerSupplierNames` EF collection-subquery **translate-OK SQLite** verified) · FE dialog contractIds[]+"Đã tạo N HĐ" · PeListPanel join names. Test 413→**419** (+6: multi-contract 5 + EF-translate smoke). **State THẬT: Mig 59 · 88 bảng · 419 test (45D+374I) · gotcha 73 · menu 54 · bundle admin `BQq2eTP6`/user `dHa64I59`.** **Cách chạy:** em-main-led BE core (financial/coupled/design-heavy = create-contract multi + financials) + delegate impl-backend (relocate) ∥ impl-frontend (FE 2-app SHA-mirror) ∥ test-specialist (test-before bug + test-after feature) + reviewer adversarial **PASS** (codegen-sequencing + arg-order + no-partial-create verified) + cicd-monitor. **#53 truncation ×3** (test-specialist/reviewer/cicd-monitor return rớt ở MEMORY-over-budget step → em-main recover-disk + self-gate + **curl-self-verify deploy** thay cicd-verdict). **Lessons:** ContractCodeGenerator self-commit-seq → multi-entity create = gen-all-codes-TRƯỚC-Add → atomic SaveChanges (no partial) [[feedback_multi_entity_create_self_committing_codegen]] · cardinality single→multi grep MỌI consumer (audit bắt 2 BE financial read-site sót S87 FE-only sweep) [[feedback_cardinality_change_grep_consumers]]. **🔴 NEXT (em): curate test-specialist L1 34.8KB OVER-SOFT GẤP** (root #53 ×3; reviewer 27.1KB+FD 26.1KB WATCH). **NEXT UAT (anh Kiệt Ctrl+F5):** ① ≥2-winner Block B "Giá trị kỳ này" đúng số · ② GẤP→Director nhận chuông · ③ Link hồ sơ giữ khi sửa header · ④ ≥2-winner "Tạo HĐ" → N HĐ draft (xác nhận GiaTri per-winner=giá NCC chào). → log `2026-06-25-S88-pe-stability-audit-d1-d2.md`.) · **Prev S87** (S87 — **2 buổi PE feature LỚN prod-verified, HMW-mode ON, ~14 spawn (nhiều #53 truncate → recover-disk + reviewer cross-verify + em-main self-gate)**: **(1) CCM 3-fix Mig 58** (`f1b10e9` **Run #344 PASS** ~5m11s) — anh forward PDF "CCM 4 ý cần sửa PM" (BỎ mục 3 theo anh): **①multi-winner** chọn NHIỀU NTP/NCC/ĐVDV cùng trúng → `winnerQuoteTotal=SUM PurchaseEvaluationSupplier.IsWinner` (cột mới, backfill từ SelectedSupplierId 13/13; SelectWinner→multi-toggle `SupplierIds[]`; FE bảng so sánh tick-nhiều-ô + "Tổng chi phí đã chọn"); **②budget=0 hợp lệ** (submit-guard nới `is null` only KHÔNG `<=0`, +3 validator GTE0; fallback ProInitial chỉ-khi-null bảo-vệ 0-cố-ý); **④cấp KẾT THÚC quy trình** `ApprovalWorkflowLevel.AllowApproverFinalize` — admin bật per-cấp Designer, duyệt tới đó TỰ DaDuyet bỏ CEO (**opt-in→AUTO** theo anh "cho bật trong quy trình hay hơn" → gỡ runtime-flag, nhánh `if (matchingLevel.AllowApproverFinalize)`). **Self-review bắt 8 chỗ FE keyed `selectedSupplierId`** (null khi liên-danh ≥2 → vỡ submit-guard/checklist/computeGiaChaoThau/tạo-HĐ) → đổi `isWinner` (cardinality single→multi = grep MỌI consumer). Test 377→**395** (+20−2 rework auto). Bundle admin `aKuNip19`→**`CXCKlNay`**/user `BUsL0HeQ`→**`Di40ewrF`**. **(2) Section B 3-cột Mig 59** (`9b1ee0c` **Run #345** cicd-verifying) — anh AskUserQuestion chốt "mỗi cột nhập kỳ-này RIÊNG" → `PurchaseEvaluation.CcmBudgetPeriodAmount` + endpoint `PATCH /budget/ccm-period` role-gate Admin|CCM fail-closed; FE Section B (THỰC HIỆN) rewrite `` list → `
` 3 cột (Dự án—|PRO budgetPeriodAmount/proFull|CCM ccmBudgetPeriodAmount/ccmFull, `colCalc()` per-cột) qua **Workflow `wf_aafb18fe-d9d`** (BE→FE→test + 3-lane review: math PASS · authz PASS · mirror+FE return NULL → em-main self-gate mirror byte-identical + 402-test + 2-build verify). Test 395→**402** (+7 authz setter). **State THẬT: Mig 59 · 88 bảng (cicd flag 89 — drift cũ KHÔNG do Mig 58/59 AddColumn-only, re-ground monthly) · 402 test (45D+357I) · gotcha 73 · menu 54 · bundle admin `BABhPh2s`/user `DLulO6uP` (Run #346 — `0d3c0cf` tách khối nổi bật "4. Thông tin chọn thầu" FE-only PASS; #345 Section B = `C8lWxEQK`/`Kz5cSW2u`; #344 CCM-3fix = `CXCKlNay`/`Di40ewrF`).** **Lessons:** cardinality single→multi = grep MỌI read-consumer (impl sửa write-site sót dependent — `feedback_cardinality_change_grep_consumers`) · design-dialog (item4 auto-config qua workflow-config, Section B AskUserQuestion) tránh rework · workflow review-lane value dù 2 lane NULL (lane-return verify disk độc-lập → trust PASS dù impl return NULL). ⚠️ CCM setter command rơi `PeSuggestedPriceFeatures.cs` (lệch chỗ, dọn monthly). → log `2026-06-24-S87-pe-multiwinner-budget-finalize-sectionb.md`.) · **Prev S86** (`ae4f106` Run #343) — PE notify "cần duyệt" loại NGƯỜI TẠO phiếu (drafter không nhận chuông phiếu mình tạo dù là approver 1 cấp; +3 `PeApproverNotifyExcludesDrafterTests`; re-ground STATUS test 356→377/gotcha 71→73 sót-S85-closeout). · **Prev S85** — **buổi UAT anh Kiệt FDC CỰC LỚN: CV PRO 6-fix batch + clear-data + 6 vòng UAT + 2 ROOT-CAUSE + 5 SQL-fix — ~10 deploy prod-verified #334→#341, HMW-mode ON, ~12 spawn** — anh forward Zalo anh Kiệt + Tra Sol + long.chau realtime. **Batch CV PRO (Run #334 `5a61254`):** đọc file `Cần chỉnh sửa CV PRO.xlsx` = **8 ảnh chú-thích nhúng** (không phải bảng công thức) → 6 fix: C1 ẩn "c.Giá chào thầu"+"d.Bảng so sánh" form TẠO · C3 ô8 pre-fill từ row7 (Ngân sách còn lại) · C4a **live-recompute** ô3/8 chưa-Lưu (VndInlineEdit +onLiveChange, draftRow3/8) · C4b So-sánh=0→"Bằng ngân sách"/"—" · C5 hủy/đổi NCC winner (BE `SelectWinnerBody(Guid?)` clear-branch + FE dropdown/toggle) · C7 nút "Toàn màn hình" preview file. **Clear-data (`scripts/s85-wipe-uat-data.sql`, BACKUP-trước):** wipe 43 PE + 28 PeWorkItemBudgets + 1 HĐ + 32 notif + 21 NCC-test (CreatedAt≥06-11, giữ 22 gốc) + reset mã→A/001; AskUserQuestion chốt scope (xóa budgets + NCC-test); SET QUOTED_IDENTIFIER ON (filtered-index). **6 vòng UAT (#335→#338):** R1 D1 ẩn mục 3/4/5 + D5 auto-chọn quy trình (1 option) · R2 D2 drafter tự-gỡ cờ GẤP (nới S77 GỠ=TP→+drafter clear-cả-2, BE restructure SET/UNSET) + D3 ngân-sách-kỳ-này tự-nhảy từ "Ban hành lần đầu" (`proInitialAmount`, FE display + BE/FE submit-guard fallback `budgetPeriodAmount ?? proInitialAmount`) · R3 ràng tạo-phiếu (hint đỏ "thiếu gì") + D4 checklist xanh✓/đỏ✗ trường bắt-buộc · R4 checklist +"Quy trình duyệt". **2 ROOT-CAUSE (whack-a-mole→fix gốc):** **(R5 #339 `1263c0d`)** workflow MẤT khi bấm Sửa = **bug-class S42** — `UpdatePeDraftHandler` absolute-set `ApprovalWorkflowId=null` khi form Sửa KHÔNG gửi field → CLEAR (field SÓT khỏi pattern null-safe mà BudgetPeriodAmount/WorkItemId cạnh đã có) → fix `if (request.X is not null)` (gotcha **#73** NEW, +3 regression test) · **(R6 #341 `49ac086`)** "mới tạo báo 7h trước" = **TZ** — timestamps lưu UTC nhưng EF đọc `DateTimeKind.Unspecified` → System.Text.Json default serialize KHÔNG có 'Z' → FE `new Date(naive)`=local → lệch +7h (VN UTC+7) → **`UtcDateTimeJsonConverter`** global (AddControllers.AddJsonOptions) ép UTC-with-Z (gotcha **#72** NEW) — cicd verify API trả `createdAt:"…3154440Z"`. **5 SQL-fix** (2 đợt 3+2 phiếu workflow-less, gán QT-DN-V2-001 type-1, ssh prod). **Cách chạy:** em-main-led + impl-backend (C5 BE clear) + impl-frontend mirror + test-specialist ×3 (C5 +10 · urgent-authz +5 · workflow-preserve +3) + reviewer ×2 (truncated→em-main self-gate, memory-lesson) + cicd-monitor ×7 (7/7 PASS; ship-proof BE-only = `Application.dll`/`Api.dll` Last-Modified in-window, #69-REFINE). **Test 356→374** (+18). **State THẬT: Mig 57 · 88 bảng · 374 test · gotcha 73 · menu 54 · bundle admin `aKuNip19`/user `BUsL0HeQ` (Run #341, FE frozen #339+#341 BE-only).** **Lesson `feedback_root_cause_over_symptom`:** bug lặp-lại (SQL/tzutil band-aid không dứt) → truy field/case **LỆCH-quy-ước** rồi đưa vào pattern đã-đúng = fix 1 chỗ hết tái-diễn. → log `2026-06-23-S85-pe-uat-cvpro-rootcause-tz.md`.) · **Prev S84** — **bootstrap + flush session-start hot-feed cap-echo v3 + commit S83 cicd harvest-orphan (em-main hygiene, 0 production code)** — anh `/session-start` → 2 monitor INFORM: H1 bắt `session-start.md:114` còn cap CŨ `lead 60K/sub 20K/wf 16K` ≠ canonical budget v3 `220K/60K/50K` (S82 self-shrink chưa flush khi S83 owner-set lại); H2 bắt `cicd-monitor/MEMORY.md` = harvest S83 hợp-lệ (Run #333 + gotcha **#69-REFINE**: hash giữ-nguyên khi 0 `fe-*/src` đổi → ship-proof THẬT = `Last-Modified` in-window, KHÔNG hash-delta) sót khỏi closeout `f71654f`. Anh "Sao ko add luôn?" → em flush `session-start.md:114` echo cap → **220K/60K/50K + canonical-pointer "đọc số sống ở budget.json"** chống tái-drift (detector C2 KHÔNG track cap-number → echo-trần lệch âm-thầm lần đổi cap sau) + commit cicd harvest-orphan. **Lesson (`feedback_derived_flush_execution`):** monitor INFORM-only proposal về **derived→canonical flush** = em-main **EXECUTION** (B3 VERIFY→APPEND = verify-rồi-LÀM), KHÔNG gate user-confirm; chỉ **ĐỔI-con-số** mới = quyền anh (chủ-dự-án). archive-gate A7 GATE PASS 217/217 · 2 WATCH strike-1 (FD/test-spec, no-action). **State GIỮ NGUYÊN: Mig 57 · 88 bảng · 356 test · gotcha 71 · bundle `CsJetgZH`/`BVS0ApIm`.** ⚠️ restart CLI (command `.md` no hot-reload — runtime %-print mới ăn cap đúng). → log `2026-06-22-S84-session-start-cap-flush.md`.) · **Prev S83** — **(1) adopt H-15 v3 memory-budget full-parity (anh owner-directive) + (2) fix PE require-workflow create+submit (đóng lỗ hổng "quy trình cũ") prod-verified Run #333** — anh `/session-start` → directive budget Tầng-1 **220K**/mem-sub **60K**/wf-sub **50K** "nạp đầy cho đủ" → diagnose phiếu A/040 "quy trình cũ" → "(B) vá guard BE + test-before → deploy" → `/session-end`. **Part 1 H-15 v3 (commit `2c7fd63` docs-only CI-skip):** `token_governor` lead 200K→**220K**/mem-sub 20K→**60K**/wf-sub 16K→**50K** full AI_INFRA parity (sửa self-shrink S82 = AI tự-co-nhỏ, mark `RC-…01-58-01` cấm) + NEW `spawn_fill_directive` (nạp sub tới budget bằng prompt GIÀU — byte-cap MEMORY.md = 1 lát, prompt nạp phần còn lại; retire `≤8K-brief`) + engine **§G.5** + ACTIVE-MARKS H-15 **v3-delta** `RC-pqhuy1987-22-06-2026-16-35-37` (anh-directed, report-before-stamp). **Part 2 PE fix (commit `fc1f19d`, cicd Run #333 PASS ~4m59s):** validator `NotEmpty(ApprovalWorkflowId)` + submit-guard (SAU Section-3, TRƯỚC mutate phase) → phiếu null-workflow KHÔNG gửi-duyệt được (trước: kẹt nhánh V1-legacy = banner "quy trình cũ", không Bước/Cấp, "Lịch sử duyệt 0"). **Diagnose:** banner ⟺ `approvalFlow` rỗng ⟺ `ApprovalWorkflowId` null; A/040 **tự-khỏi-khi-reload ⟹ cache** (data-hỏng reload không khỏi — em KHÔNG đụng prod). **test-before RED→GREEN**, full-suite bắt **9 đỏ** → triage: 2 genuine-spec-conflict (V1-submit deprecated, data wipe S59) rewrite + 6 collateral giữ (dời guard sau Section-3) + 1 validator fix. **Test 354→356** (+2 validator). **#69-REFINE (cicd):** bundle KHÔNG rotate vì 0 fe-src change (Vite deterministic) — ship-signal THẬT = Last-Modified in-window KHÔNG hash-delta; bundle GIỮ admin `CsJetgZH`/user `BVS0ApIm` Run #333. State THẬT: **Mig 57 · 88 bảng · 356 test · gotcha 71 · bundle `CsJetgZH`/`BVS0ApIm`**. ⚠️ restart CLI activate budget v3 runtime. → log `2026-06-22-S83-h15v3-pe-require-workflow.md`.) · **Prev S82** — **adopt Harness-15-v2 (Tầng-1 hot-feed-lớn + L2/L3 bỏ-trần + %-print 2-đầu-phiên + ranh-giới vai-trò), 0 production code** — `/check-email AI_INFRA` (1 thư mới H15-v2-notify verify ✓✓ whole-file+body) + `/adap-apply all` (fan-out 29 broadcast vs 22 report → CHỈ H15-v2 MỚI; 7 còn lại verify = đã-phủ S72/S75/S79). em-main IMPLEMENT single-writer D9 (6 edit: `token_governor` L1 12K→per-role **lead 60K/sub 20K/wf 16K** · L2/L3 6K/4K→**NO-CAP** · engine §G.4 · session-start §2.1.6 + session-end §L.b(c) %-print · mark H-15 What-cell refine) + **REVIEW Workflow `wf_04667b25-5fa` 3-lane 3/3 PASS** (bắt 3 MINOR → fixed: volume "~42K" stale · mark pending-confirm flag · _index STAGE-2). **Ranh-giới vai-trò:** con-số = quyền CHỦ-DỰ-ÁN/anh, AI thực-thi + báo-% — sửa framing S81 "lead-authority" gộp nhầm AI-lead↔owner. mark H-15 **v2-delta anh-confirm** `RC-pqhuy1987-21-06-2026-01-58-01` (report-before-stamp). commit `aa3f0fe` push (docs-only CI-skip) + email AI_INFRA `a749bb6bd1be`. **State THẬT GIỮ NGUYÊN: Mig 57 · 88 bảng · 354 test · gotcha 71 · bundle `CsJetgZH`/`BVS0ApIm`.** ⚠️ restart CLI (session-start §2.1.6 + session-end §L.b(c) %-print runtime). → log `2026-06-21-S82-harness-15-v2-adopt.md`.) · **Prev S81** — **adopt Harness-15 memory-budget per-agent (token-governor + value-gate + work-state block)** — em main single-writer + 1 REVIEW Workflow (`wf_b7f3c8ac-b53` 3-lane: Part-A PASS · Part-B PASS · Honesty HONEST), **0 production code**. `/check-email AI_INFRA` STAGE 1 = **0 new directed** (outbox/se 4 file processed S79); fan-out diff → CHỈ **H15** unapplied (H14/v2.0/checklist-9-10/11 đã phủ S72/S75/S79). **8/8 🔴 floor:** A1 đo-SÀN persona-direct `Get-ChildItem` 4.3-13.3KB + harness-injected SE-ước-riêng 21K→**30K cap-riêng-SE** · A2 `token_governor` L1 12K/L2 6K/L3 4K (lead hard-cap) · A3 tách-nhà · B(a) nạp-đầy-no-token-saving · B(b) **value-gate** `value_protect` 10-pattern + gate-script FLAG **runtime-fired** (test-specialist gotcha#/guard) ⟂ keep-floor recency = mark `RC-…11` áp tầng-bộ-nhớ · B(c) **work-state block** `session-start §2.1.5` · B(d) 3-tệp-chốt verified (`hmw.js:124` MEMORY-PACK) · B(e) **2-governor** byte⟂token. **5/6 sàn = convention, chỉ (e)+đo-SÀN = mechanized (honest no-overclaim).** Review bắt **2 CONCERN** (anchoring + tool-attribution) → **fixed** (review→fix loop) + refresh stale `measured` block S71→S81. Artifacts: `memory-budget.json` + engine `§G` + `session-start §2.1.5` + `rules §6.6` + gate-FLAG + adap-report `2026-06-20-Governance-harness-15-memory-budget.md`. A7 217/217 · detector 26-flag baseline (0 new). ⚠️ **restart CLI** (session-start §2.1.5). **✅ mark H-15 stamped Active-High** (`RC-…23-07-37`, anh-confirm S81). **State GIỮ NGUYÊN: Mig 57 · 88 bảng · 354 test · gotcha 71 · bundle `CsJetgZH`/`BVS0ApIm`.** → log `2026-06-20-S81-harness-15-adopt.md`. · **Prev S80** — **curate L1 over-cap reviewer/inv-codebase/cicd → L2 archive** — em-main single-writer, archive-gate keep-floor-hit→manual condense-with-archive: 31 entries byte-exact (`sed`) +N−0 → `archive/2026-06.md` + 31 `_INDEX` substring pointer → **A7 GATE PASS 217/217**; stale foundation counts flushed (130/263→354 · 55→71 · Mig 40/55→57 · 84→88 · bundle→#330). **0 production code, state GIỮ NGUYÊN: Mig 57 · 88 bảng · 354 test · gotcha 71 · bundle `CsJetgZH`/`BVS0ApIm`.** WATCH (A6 strike-1): frontend-designer 26KB + test-specialist 28KB. Lesson: `_INDEX` substring **quote-free** (A7 quote-parser bắt escaped-quote PURO pointer self-grep miss). 9 agent-memory file, docs-only commit (CI skip). → log `2026-06-20-S80-curate-l1-overcap.md`. · **Prev S79** — **adopt User-Mark (H-12/13) canonical §P + Harness-14 (Eval/Budget/Outcome) + chữ-ký RC** — em main + 4 Workflow (invest `wf_82337f7f-95c` → review `wf_a7cbe93e-912` → align-re-review `wf_9d3beebb-a95` → H14-review `wf_4d4eba6f-8a0`), **0 production code**. Anh gõ `/user-mark-active-high` "áp đầy-đủ chính-xác nhất theo AI_INFRA" → áp **canonical §P đầy-đủ** (P1-P10): 4 lệnh `/user-mark-*` + ledger `.claude/governance/ACTIVE-MARKS.md` (Active-High/Active/Medium/Disable) + `harness-11-engine.md §E`+**§F** + `rules.md §6.6` objective-criteria. **3 mark Active-High stamped** anh-confirm (`RC-pqhuy1987-20-06-2026-10-29-09/10/11`). completeness-gate H-6→H-13 **ĐẠT** (H-8 11/11 inherit no-`[1m]`). §F floor 6/6 + maturity HONEST. 3 adap-report + email ai_infra (`7b8615b3`). Bài học: broadcast cô-đọng→canonical-command/§P là spec THẬT (bản đầu MUST/TRACK→align lại) · report-before-stamp dogfood · investigator residual-diary OK. State GIỮ NGUYÊN Mig 57·88 bảng·354 test·gotcha 71·bundle `CsJetgZH`/`BVS0ApIm`. ⚠️ restart CLI. → log `2026-06-20-S79-user-mark-harness-14-adopt.md`). · **Prev S78** — **PE: đính kèm file khi DUYỆT (UAT Tra Sol / 5 tester)** — người duyệt tải file của mình lên ngay lúc Duyệt thay vì Trả lại phiếu (tình huống thay đổi nhỏ). Reuse hệ attachment + enum `ApprovalAttachment=5` **MIGRATION-FREE** (int-stored, 0 schema change); endpoint `POST {id}/attachments` + authz có sẵn (handler không guard drafter-only → approver upload được). FE 2 app SHA-identical: `PeWorkflowPanel` picker multi-file + upload-TRƯỚC-chuyển-phase (file lỗi=không duyệt) + mục "📎 File đính kèm khi duyệt" (download/preview) + 2 filter fix loại purpose=5 khỏi "Bảng so sánh" (gotcha **#71** proxy-predicate pollution). commit `7886fd0` → **Run #330 PASS** ~4m56s (test gate **354**, bundle admin **`CsJetgZH`**/user **`BVS0ApIm`**, NO migration, smoke 4×200 + attachments 401-wired). **3 lỗi em tự bắt review-trước-deploy** (authz-verify handler · filter-pollution #71 · Dialog mirror-truncate fe-admin). em-main-led + self-gate (grep no-leak thay reviewer over-cap) + cicd-monitor verify. → log `2026-06-19-S78-pe-attach-file-on-approve.md`. · **Prev S77** — **buổi sản phẩm RẤT LỚN: 10 deploy prod-verified #320→#329 (anh Kiệt FDC + Tra Sol + Bích Phượng UAT realtime, HMW-mode ON)** — bundle cuối admin **`BqKD3Y23`** / user **`Cn-i349D`** (Run #329). **Mig 56→57** `AddPeSuggestedPriceNotes` · test 344→**354** (+10) · gotcha **70** (tái dùng #70). 10 việc PE: (1) cờ GẤP **pill** 🔴PRO/🟢CCM đồng bộ MỌI danh sách + inbox (#320, NEW `PeUrgentChips` ×2 app); (2) **focus mode** bấm phiếu→overlay (#321) → **revert** list về layout gốc bám-trái lấp-đầy (#322); (3) **Mig 57** ô ghi chú giá đề xuất PRO/CCM (2 cột nvarchar(1000)) + **số phân cách VND** (`VndInlineEdit`/`BudgetCell`) + sửa chính tả "Bảng so sánh giá" + **guard #70** stale-echo (#323); (4) số âm → **đỏ + ngoặc** `(…)` hàng 7/8/9 (#324); (5) mục con **thụt dòng + gạch đầu dòng** phân biệt có-số/không-số (#325); (6) cờ gấp authz **BẤT ĐỐI XỨNG** GẮN=NV chức năng / GỠ=chỉ Trưởng phòng (DeptManager) (#326, asymmetric handler + button-by-state); (7) **tách chọn-phiếu (inline 3-panel) khỏi mở-rộng (overlay)** + nút "Xem mở rộng" mỗi dòng (`?expand=1`) (#327); (8) **chuông báo người duyệt** khi phiếu vào cấp họ — submit + mỗi approve-advance (#328, `LogTransitionAsync` notify current-level approvers); (9) banner phiếu **Trả lại** hướng dẫn gửi lại (#329). **3 lỗi em tự bắt khi review TRƯỚC deploy** (guard #70 stale-echo cho ô ghi chú · luật cờ-gấp bất-đối-xứng Tra Sol clarify giữa-chừng · double-mount PeDetailTabs Task H — intent-comment có nhưng code sót). Cách chạy: em-main + frontend-designer ×3 (focus/revert/decouple, FD2 stub-verify do backend-down #3) + implementer-frontend (pill/notes/sep/spelling) + implementer-backend ×2 (Mig 57 · approver-notify) + test-specialist ×3 (notes +7 · urgent symmetric→asymmetric REDO do clarify-after-dispatch) + cicd-monitor ×10 (10/10 PASS). **frontend-designer process-death giữa Task H → recover-disk** (edit hoàn-chỉnh trên disk, em-main build-verify + mirror). **🔴 NEXT (em): curate L1 over-cap GẤP** — reviewer **45KB** + cicd-monitor 37.6KB + inv-codebase 35.6KB (keep-floor-hit → manual SPLIT/condense; archive-gate A7 GATE PASS 186/186 integrity OK) + FD 26KB/test-spec 27.7KB WATCH strike-1. → log `2026-06-19-S77-pe-ux-batch-10-deploy.md`. · **Prev S76** — **PE ngân sách MA TRẬN 3 cột (Dự án|PRO|CCM) + bảng lưới `
` viền-ô + badge quyền-NS theo role** — anh Kiệt FDC + chị Trà Sol, go-live; anh giao `/ultra-on` "step-by-step + workflow-review-per-step, hoàn chỉnh rồi deploy". **3 commit prod-verified:** `e33481e` (feature Run #318 — Mig 56 + ma-trận-3-cột + badge designer/flow, `BhFDF9IJ`/`BAkuRl3C`) → `21d1f4e` (bảng lưới `
` theo phản hồi anh, Run #319 **`jOqxW4-p`**/**`DbsznVvR`**, smoke 3×200). **Part 1:** PRO sửa cột PRO (canEditPro), CCM sửa cột CCM (canEditCcm), Dự án FE hiển-thị-only; Mig 56 +ProInitial/ProAdjust additive + data-migrate ProEstimate→ProInitial (4 rows prod). **Part 2+3:** badge "✎ NS PRO/CCM" cạnh approver (suy từ role, display-only no-authz) ở Workflow Designer + flow Duyệt NCC. Test 339→**344** (+5). **2 workflow review** (Part 1 PASS + Part 2/3 PASS) — reviewer bắt **race mất-dữ-liệu** Part 1 (impl self-review sót) → vá `useIsFetching` 2 app, **gotcha #70 NEW**. Lessons: flex+gap KHÔNG ra "bảng" → phải `
` viền-ô · workflow-review-flaky (2-3 lane empty #53) → em-main self-gate lane rỗng. **NEXT:** 🔴 curate L1 over-cap (reviewer **45KB** + inv-codebase 35KB keep-floor-hit manual-condense; cicd 29KB + test-spec 28KB strike-1). → log `2026-06-19-S76-pe-budget-matrix-table-grid.md`. · **Prev S75 (2026-06-18)** — **Harness-11 adopt: engine bộ-nhớ-và-governance TỰ-BẢO-TRÌ + 2 double-check** — anh giao `/check-email AI_INFRA` + `/adap-apply` (mỗi stage workflow-review) + double-check ×2 + finalize report + push + session-end. em main + **5 Workflow** (audit `wf_7fdc3bd5-930` → implement `wf_c5e5844e-7c1` → review `wf_d7ca1ff8-942` → double-check `wf_a0b68d2f-30e` → checklist-verify `wf_39cd4cbe-f07`). **0 production code.** Built `scripts/governance-detectors.ps1` (C1 broken-pointer + C2/B3 staleness + C3 vocab-fork + C4 self-exclusion + C5 resolve, NO-API DÒ+FLAG, runtime **26 flag** bắt drift thật, C4 0-self-match) + `scripts/memory-archive-gate.ps1` (PHẦN A hysteresis 0.85/keep-floor 5/2-strike/A7 NO-API 186/186) + `docs/governance/harness-11-engine.md` canonical (3-tier D5/D6/D7 EXPLICIT + one-direction-lock D8) + **B1 ×11 count→pointer `docs/STATUS.md`** (drift mig53→55/test306→339/gotcha68→69/table93→88 RESOLVED) + cadence-wire session-start §2.1.3 (D1) + session-end §L.b(c) (D2) + agents/README Upgrade S75. **completeness-gate FORMAL ĐẠT** (B 4/4 + C 5/5 + D 11/11 đủ-trọn, A 🟡 tailored — A6 runtime cần 2×-Apply legit-by-design). **gotcha #30 reinforced** (box-glyph ├└─ KHÔNG vào .ps1 — PS5.1 -File ANSI mojibake, KỂ CẢ qua Edit render-normalize; detector pure-ASCII verified). 3 commit `e70c046`+`ae957c4`+`aa09e99` pushed + adap-report + email ai_infra (`2316773229f2`). **State THẬT GIỮ NGUYÊN: Mig 55 · 88 bảng · 339 test · gotcha 69 · menu 54 · bundle `BYF5vIMJ`/`CB-tiRxd`.** ⚠️ restart CLI (cadence §2.1.3/§L.b + ef-core skill). 🔴 curate-debt: reviewer 38.8KB + inv-codebase 31.5KB + cicd 26.8KB over-cap (archive-gate confirm; reviewer+inv keep-floor hit → manual split). → log `2026-06-18-S75-harness-11-adopt.md`. **Prev S74** — **PE ô "Ghi chú từ CCM" ngân sách gói thầu (Mig 55)** — anh forward 2 luồng Zalo (Trà Sol + Kiệt FDC) "CCM cũng giống PRO cho nhập + ghi chú, hiện 0 hết" → em-main BE+Mig55 ∥ implementer-frontend FE 2 app SHA-mirror ∥ test-specialist (chết rate-limit → recover-disk). 2 fork anh chốt qua AskUserQuestion: **thêm CcmNote (Mig 55)** + **GIỮ phân vai CCM** (CostControl/Admin). Entity `PeWorkItemBudget +CcmNote` mirror ProNote · `UpdatePeBudgetCcmCommand +CcmNote` absolute-set role-gate fail-closed · DTO+controller+mapping · FE dòng "Ghi chú từ CCM" gate `canEditCcm` (sau V0/hiệu chỉnh, absolute-set đủ 3 field). Mig 55 additive-nullable sạch (no #63). Test 334→**339** (+5 CcmNote). **Chẩn đoán "0 hết không nhập":** tài khoản thiếu role CostControl (KHÔNG bug) → UAT bằng CCM/Admin. commit `8655ebf` push main (cicd **Run #315 PASS** ~4m54s — Mig 55 applied prod, bundle admin `BYF5vIMJ`/user `CB-tiRxd`, smoke 4×200). Lessons: controller call-site thiếu arg sau +param record (grep+vá, #65 bắt) · agent-kill-529 recover-disk no-re-spawn · PS here-string commit-msg trong if-block mis-parse → `git commit -F`. → session log `2026-06-18-S74-pe-ccm-note.md`. **Prev S73** — **Mig 54 PE giá đề xuất PRO/CCM + CEO chọn giá chốt + CCM duyệt-done ô-tích (anh Kiệt FDC — go-live so-sánh-giá thứ Hai 22/06)** — em main + 6 sub + 2 review-workflow. **2 commit prod-verified:** `1d86abc` (feature, cicd Run #313 PASS — Mig 54 + bundle admin `OlNyG9OD`/user `DSzSLVtL`) + `6aa4dcb` (FE empty-candidates guard fix). **BE:** Mig 54 `AddPeSuggestedAndApprovedPrice` 5 cột additive-nullable (ProSuggestedMin/Max·CcmSuggested·ApprovedPriceAmount·Source) + 2 setter role-gate PRO/CCM (Forbidden fail-closed mirror budget) + ApproveV2 **③ AUTO→OPT-IN** (`finalizeByCcmDelegation` ô-tích, gỡ auto-threshold S69) + **① bind giá chốt** mọi nhánh DaDuyet (human bắt-buộc-chọn, isSystem-miễn) + DTO +7 field/capability. **FE 2 app SHA-mirror:** PeWorkflowPanel (bộ chọn giá + ô tích CCM + fix empty-candidates) + PeDetailTabs `SuggestedPriceRows` + types +7. **Test 306→334** (+28). **2 workflow review (bài học):** R1 schema-force CHỈ **1/4** lane returned (flaky no-StructuredOutput) → R2 **free-text 2/3 PASS** — rủi ro #1 FE empty-candidates = **UNREACHABLE** (submit-guard `:194` chặn gửi-duyệt khi winnerQuoteTotal≤0). → review fan-out dùng **free-text / hmw RUN-TRACE**, KHÔNG ép-schema inline. **Governance honest:** em lệch mandate auto-Workflow (mode-ON) + chỉ khai khi anh hỏi → **cam kết báo-TRƯỚC-khi-lệch**. Run-trace `runs/2026-06-18-mig54-pe-review/` (custom-inline, bù post-hoc). → session log `2026-06-18-S73-pe-gia-de-xuat-ccm-done.md` pending. · **Prev S72** — **Harness-10 flat-refine + checklist-v2 adopt (re-audit 3-workflow) + sleep NO-OP** — em main + 9 sub qua 3 Workflow (audit `wf_13868efb-ea7` → implement `wf_ac43b5ff-7d1` → review `wf_d482e10d-5dd`, mandate Harness-9 B1+B2). Anh chỉ "sisters làm tốt mỗi SE thiếu" → re-audit đo vs canonical: **SE BEHIND Harness-10 flat** (run-trace còn SUBFOLDER, canonical=FLAT) → migrate `hmw.js` (`:103` sub-md/→flat + `:52` schema + **H4.5→H8 doc-drift**) + `workflows/README` full-rewrite + `runs/README` + session-start/end + `agents/README` Upgrade S72 + `_ledger`; **5 run cũ S71 GIỮ subfolder** (C8 dual-accept). +2 broadcast 06-18 adopt (checklist-v2 + h10-flat-detector-refine). +`/sleep-recovery-memory-l2` port (A8, §J2-tailored SE-only, floor intact, live skill). **detector refine-b TAILORED-OUT** (SE Workflow-tool no-CLI-bypass; containment git-diff+tracked+orphan-scan G-015). **REVIEW (B2 dogfood) bắt 2 lỗi IMPLEMENT-self-assess sót** (hmw.js:52 schema-stale + sleep-cmd auto-check un-wired overclaim) → fixed (auto-check **WIRED thật**: budget.json `+last_sleep_at` + session-start:78 + session-end:48, grep-verified). em-main containment-check tự bắt 1 reviewer residual-write (raw-Workflow KHÔNG hmw.js writeGuard → reverse-finding #4) → revert. **B3 self-correct:** S71 report path tắt `runs/`+"14" → thật `.claude/workflows/runs`=22. **Sleep `all`=NO-OP** (5/9 empty-archive + 4/9 đã-gisted → 0 compressed; `last_sleep_at`=2026-06-18). **0 production code, state THẬT GIỮ NGUYÊN.** adap-report `2026-06-18-Governance-harness-10-flat-refine-checklist-v2` + email ai_infra (`5f511fe5c0f2`). ⚠️ **restart CLI** activate FLAT-runtime hmw.js + wired sleep-check + sleep-recovery skill. 🔴 **NEXT (em):** curate investigator-codebase L1 **28973 OVER** (audit-trail) + watch frontend-designer/test-specialist near-cap. → session log `2026-06-18-S72-harness-10-flat-refine.md`. **Prev S71 — Harness-10 adopt: tracked run-trace folder convention + checklist 9-10 self-verify** — em main + 3 Workflow (invest `wf_9c2cd2cd-2e7` → implement `wf_e4e46725-231` → review `wf_636bc95b-939`) theo mandate Harness-9 PART 2. **0 production code** (governance/workflow only). Migrate `.claude/workflows/wave-*/` gitignored → `runs//` **git-TRACKED** (run.md + sub-md/ + harvest/) + `_ledger.md` 2-nhịp + 3-layer anti-miss (L1 em-main@P1 ledger-check / L2 session-start orphan-scan / L3 session-end close-gate **idempotent-VERIFY-not-re-APPEND**) + **containment model shift** (Harness-2 B6 "mọi tracked-change=vi-phạm" → Harness-10 "tracked-change NGOÀI run-folder + code-disjoint=vi-phạm"; run-folder TRACKED → HIỆN git-diff = audit trực-tiếp). hmw.js wave→run-trace (accept `args.run`, alias `wave`; path `sub-md/`; `node --check` PARSE-OK). **Review độc-lập (R2+R3) bắt C5 L1 over-claim** (doc nói hmw.js prompt-builder emit L1 reminder nhưng grep engine=0 → engine no-fs → fixed path-a: L1 = em-main @P1 convention) — dogfood mandate B2 đúng (1-workflow-tự-chấm sẽ bỏ sót). **checklist 9-10:** Part A (Harness-9 memory) + Part B (adap 2-workflow) ĐÃ done S70; Part C (Harness-10) MỚI 8/8. dogfood: 3 run-trace folder TRACKED đầu + 3 entry ledger. adap-report `2026-06-18-Governance-checklist-harness-9-10` + email ai_infra. **State THẬT GIỮ NGUYÊN: Mig 53 · 88 bảng · 306 test · 68 gotcha · menu 54 · bundle admin `BgNCjwsG`/user `CBvh0vtf`.** + `CLAUDE.md` test-flush 263→306 (pre-existing uncommitted, resolve H1 stale-flag). ⚠️ restart CLI activate hmw.js RUN-TRACE runtime + (carry S66/S70) §2.1.2 budget-audit/reviewer-Cat-6/H8-inherit. ✅ **curate-debt CLOSED S71** (FINALIZE double-check `wf_73de399d-753` + curate `wf_f32987b8-03f`): reviewer 36.7→24.8KB + investigator 29.8→23.2KB (both <25600 cap, archive +N -0 0-byte-loss) + reviewer-gist gen:2 + 3 user-memory G2/G3 + budget.json re-measure. Race root-cause fixed cấu-trúc (hmw.js RUN-TRACE writeGuard). → session log `2026-06-18-S71-harness-10-run-trace.md` (pending). **Prev S70** — **Harness-9 adopt: L2 archive dark-matter recovery + adap 2-workflow mandate** — em main + 3 Workflow (investigate `wf_be952f3c-97f` → implement `wf_a58e0d15-beb` → audit `wf_9520d8cd-4fe`) + 2 monitor bootstrap. **0 production code** (governance/memory only, commit `f36aab8` pushed). 4 over-cap sub-agent (cicd-monitor/investigator-codebase/reviewer/implementer-backend) curate L1→L2 + `archive/_INDEX.md` (mục-lục con-trỏ **substring sha-keyed**, Ctrl-F fallback) + `.gist.md` (nén 4-field distill-gen:1, verbatim FROZEN) → **cả 4 < 25KB auto-inject cap** (P1 curate-debt CLOSED; ~240KB archive hết RAG-dark). PART 2/3 process-mandate codify (adap-apply + agents/README Upgrade S70 + session-start §2.1.2 budget-audit). **0-byte-loss git+sha verified** (Stage C audit + em-main self-gate khi 2 reviewer no-StructuredOutput). +`memory-budget.json` (seed-by-measure) + `scripts/measure-agent-memory.ps1` + `.ragignore` + doc-drift 4-cite flush. adap-report + email-back ai_infra (body-hash `7c07b716e775`). **State THẬT GIỮ NGUYÊN: Mig 53 · 88 bảng · 306 test · 68 gotcha · menu 54 · bundle admin `BgNCjwsG`/user `CBvh0vtf`.** ⚠️ restart CLI để activate session-start §2.1.2 + pending H8 inherit + reviewer Cat-6. → session log `2026-06-17-S70-harness-9-l2-recovery.md`. **Prev S69** — **Văn phòng số (E-Office) port + golive + PE cờ gấp/ngưỡng CCM — 4 deploy prod-verified Run #305→#308, HMW-mode ON, 2 workflow fan-out + ~14 spawn**: foundation PURO (shared PageHeader/KpiCard/WidgetCard + Dashboard 2-cột + sync fe-admin index.css đóng drift S66-S68) #305 → **re-skin TRỌN 10 page** PURO layout + CSS Hồ sơ NS, phẫu-thuật-giữ-100%-logic (reviewer verify api/queryKey byte-identical) #306 → **Office golive public** `SeedAllRolesOfficeModulePermissionsAsync` read+create 16-key allow-list mọi role (mirror S65 pattern, chạy SAU revoke; excluded Off_PhongHop_Manage/Off_AttendanceReport/Off_ChamCong giữ ẩn; cicd DB-verify 16/16×13 role) #307 → **PE cờ gấp PRO/CCM + CCM duyệt-final theo ngưỡng giá trị** Mig 53 (anh Kiệt FDC sau họp sếp) #308. **State THẬT: Mig 53 · 88 bảng · 306 test (45D+261I) · 68 gotcha · menu 54 · bundle admin `BgNCjwsG`/user `CBvh0vtf` Run #308.** 2 gotcha NEW (**#67** Tailwind accent palette thiếu-stop vỡ-màu-im-lặng · **#68** stale-diagnostic-background-agent). 2 truncation #53 (impl-backend positional-record + impl-frontend) → em main recover-disk + self-gate (cả 2 build PASS sau-cùng). C (sau duyệt → chuyển phiếu đến dự án) chờ anh Kiệt spec form. → session log `2026-06-17-S69-vanphong-golive-pe-urgent-threshold.md`. **Prev S68** — **Hồ sơ NS header chi tiết NV: làm nổi bật + fix tên render đen→trắng** — em main solo, 3 commit (2 FE `6983609`+`37752eb` · 1 docs `11bc96d`), 2 deploy prod-verified Run #303-304 (anh UAT realtime): tên `text-xl extrabold`+drop-shadow · dòng meta `text-[13px] font-medium` trắng-đậm · badge pill **màu theo trạng thái** (#303); anh báo "tên đen nền xanh ko nổi bật" → diagnose **rule `h1-h4{color:#0b1220}` viết NGOÀI `@layer` thắng `text-white`** (Tailwind v4 unlayered > all layers, **gotcha #66 NEW**) → ép `text-white!` + thu nhỏ `text-lg` (#304, grep dist confirm `!important`). Bootstrap: 2 monitor RE-REPORT CLEAN + 2 doc-drift fix (dep-audit 64→65 · root CLAUDE 263→286, H1 flag). **State THẬT: Mig 52 · 88 bảng · 286 test · 66 gotcha · menu 53 · bundle admin `CNUv1jxY`/user `CpOskeS1` Run #304.** ⚠️ curate-debt P1: cicd-monitor **44.1KB** (worst). **Prev S67:** **buổi sản phẩm LỚN, 6 deploy prod-verified Run #297→#302** (anh + anh Kiệt FDC UAT realtime, HMW-mode ON): fe-user Hồ sơ NS đồng nhất font + chữ đen→**xanh đậm `brand-800`** (#297 `ab4e681`) · **fe-admin mirror master-detail** + accent tokens index.css [đóng pending lớn nhất HRM go-live, page SHA256 ×2] (#298 `292d64d`) · **+23 test-after HRM** [Dept cycle-guard · PE HoSoLink absolute-set · HRM-perm seed] → 263→**286** (#299 `bcd619d`) · **list flex-row gọn** [bảng 3-cột→flex-row, `overflow-x-hidden` → hết tràn ngang rail] + đồng nhất cỡ chữ [18/14/13/11px] ×2 app (#300 `91aaf05`) · **PE Link hồ sơ auto-detect** `http(s)`→hyperlink/`O:\`→Copy (#301 `6df1b2d`) → **render link `file://` bấm-thử** + Copy (#302 `536dd6b`). **Workflow research 3 investigator-api** (auto-mở `O:\` từ web): default browser CHẶN https→file://; **chỉ Edge GPO `IntranetFileLinksEnabled`** (Edge-only, Intranet Zone, 1 GPO domain zero-per-machine) = one-click thật — Chrome không có; .url-download zero-install nhưng 2-click. **State THẬT: Mig 52 · 88 bảng · 286 test (45D+241I) · 65 gotcha · menu 53 · bundle admin `CcrZqfht`/user `DniDFUB_`** (#302). test-specialist truncated return #53 → em main recover-disk (3 file test đủ + 286 verify); 0 production bug. ⚠️ curate-debt: cicd-monitor 39.8KB + inv-codebase 39.4KB over-cap. **Prev S66** — **session-end closeout em-main-solo, 0 product-sub:** adopt **Harness-8 all-inherit** (7 sub demoted `claude-opus-4-8`→`inherit` → cả 11 = inherit, gỡ two-tier Harness-4) + **cicd-monitor L1 curate 86.8→28.9KB** (byte-exact sed → `archive/2026-06.md`, incl #291 forensic) + **ef-core skill doc-flush Mig 50→52** (H1 drift, +Mig 51/52 rows) + check-email AI_INFRA (**0 thư mới se-directed**). ~17 file docs/gov/config, **0 production code** → state THẬT GIỮ NGUYÊN: **Mig 52 · 88 bảng · 263 test · 65 gotcha · menu 53 · bundle admin `BDwV5d0X`/user `DbVv6rsf`**. ⚠️ **Restart CLI** để H8 runtime (frontmatter no hot-reload) + reviewer Category 6 (S64 pending). adap-report `2026-06-16-Governance-harness-8-all-inherit-workflow-fastest` + email-back ai_infra (hash `fa7f690d` round-trip MATCH). Prev S65 — **HRM go-live: public Hồ sơ Nhân sự + trang master-detail giống NamGroup + Department hierarchy + PE Link hồ sơ**, ~6 deploy prod-verified Run #289→#295, anh + anh Kiệt FDC UAT realtime): (1) **public Hồ sơ Nhân sự mọi role** — `SeedAllRolesHrmProfileReadPermissionsAsync` grant CanRead `Hrm`+`Hrm_HoSo` 13 role chạy SAU revoke S58 (upgrade-only; EmployeesController policy-based `Hrm_HoSo.Read` mở luôn API không hardcode Roles), giữ ẩn Dashboard NS, Run #289; (2) **redesign màu foundation fe-user** — accent palette teal/violet/amberx/greenx + `.app-gradient-brand`/`.card-accent`/`.icon-chip` + heading 700, brand #1F7DC1 + Be Vietnam Pro giữ, Run #290; (3) **Department hierarchy** Mig 51 `AddDepartmentParentId` (ParentId loose-Guid no-FK + `GET /departments/tree` ráp cây in-memory + rollup count theo `User.DepartmentId` + cycle-guard HashSet) + picker "Phòng cha" fe-admin (self-service org chart) + Update cycle-guard, Run #292; (4) **Hồ sơ Nhân sự master-detail giống NamGroup** — `EmployeesListPage` rewrite: 3-panel→**2-cột** (cây tổ chức gốc "SOLUTION COMPANY" + list chồng TRÁI · chi tiết 5 tab PHẢI) + tô màu accent, giữ 100% 5 satellite CRUD (16 endpoint), Run #293/#294/#295; (5) **PE mục "e. Link hồ sơ"** Mig 52 `AddHoSoLinkToPurchaseEvaluation` (`HoSoLink string?` hyperlink NAS + `` target_blank rel-noopener + null-safe) + rename "Dự trù PRO"→"Ngân sách PRO" (row+badge) ×2 app SHA256-mirror, Run #293. **State THẬT: Mig 52 · 88 bảng · 263 test (45D+218I) · 65 gotcha · menu 53 · bundle admin `BDwV5d0X`/user `DbVv6rsf`** (Run #295 `456c7a7` Employee-refine — user rotate `CZfo_PFZ→DbVv6rsf`, cicd PASS). **🔥 Workflow fan-out chạy THẬT lần đầu** (`pe-hoso-link-rename-pro` BE∥FE→review) — parallel disjoint-file OK, NHƯNG FE+reviewer return-RỖNG #53 → em main recover-disk + self-gate (bắt badge "DỰ TRÙ PRO" sót rename); **verdict: fan-out cho parallelism nhưng reviewer-stage không tin được trong harness này → verify-heavy task vẫn tự gác = tương đương spawn lẻ** (`feedback_workflow_fanout_reliability`). gotcha **#65** NEW (build csproj con ≠ `dotnet build slnx` gồm tests → miss test-compile khi đổi chữ ký record command → CI CS7036 Run #291 FAIL-gated). **Prev S64** adopt **Harness-7 writing-quality floor** — em main solo, commit `6afde19` docs/gov-only, 0 sub spawn: `rules.md §1.1` outward-VN-full-grammar + reviewer Category 6 + adap-report + email ai_infra; broadcast body-hash `a4580ea9` verified-MATCH **KHÔNG mis-stamp** [false-mismatch = gotcha #61 PS5.1 UTF-8 decode của em]. Prev S63 docs-closeout bù S60/S61/S62 — **State THẬT: Mig 50 · 88 bảng · 263 test (45D+218I) · 64 gotcha · menu 53 · bundle admin `0xKYGhhf`/user `C81ZdG9G` Run #286**; S60-62 = PE ràng buộc gửi-duyệt + bypass drafter (S60) · gỡ "Từ chối" (S60) · Mig 50 ngân sách per-gói-thầu Excel anh Kiệt + XÓA module Budget cũ (S61) · vượt-NS cảnh-báo-mềm cho lưu (S62); + reconcile stray reviewer cwd-misland; session log `2026-06-12-S60-S62-pe-budget-workitem-softwarning.md`). Prev Session 59 ( **10 đợt ship prod-verified: 8 Run PASS + 2 cancelled-supersede-benign #273→#282** (run_number API — dải đếm khác #38x S58, cùng pipeline; 2 cancel = push-đè khi UAT góp ý realtime, ancestor-verified): (1) **wipe transactional testing data** theo anh Kiệt FDC — 10 PE + 7 HĐ [DEMO] + 64 notif + 1 AwV2 cũ inactive = 0, reset PeSeq/CtSeq → phiếu thật đầu tiên team tạo chiều nay = **PE/2026/A/001** ✓, app-recycle KHÔNG resurrect (DemoSeed gate held), uploads orphan dọn (`56882ac` #273); (2+3) **PE tree Panel 1 chốt 4 tầng "📅 Năm > 📁 Dự án > 🧱 Hạng mục > Phiếu"** (anh chốt follow-up sau bản gộp "Dự án (Năm)"; `yearGroups` useMemo, expand-key v3, FE-only — list DTO đã có workItemName S57bis) (`0eafcd3` #274); (4) **dọn 15 mã hạng mục demo tự chế** theo chị Trà Sol "xóa cái đám phần thô phần hoàn thiện… MÀ ANH TỰ ĐẺ RA" — WorkItems 86→**71**, GỠ HẲN block seed demo khỏi DbInitializer, đối chiếu 71/71 khớp bảng PMH từng dòng (`bbd1554` #275, bundle frozen BE-only); (5) **rename 71 mã đúng format PMH anh Kiệt chốt** "MÃ CV gồm chữ MEP-SUB-1 rồi tên 1 MEP Sub MEP (Full) — đúng kiểu vậy" → `MAT-n`/`SUB-n`/`MEP-SUB-n`/`MEP-EQU-n` + Name "STT nhóm tên"; **DB-trước-code-sau** (gotcha **#62** NEW — seed per-code idempotent, sai thứ tự = 142 rows) + sqlcmd `-f 65001` (gotcha **#61** NEW — verify data qua API JSON, KHÔNG tin console mojibake) + FE sort numeric ×3 ×2 app (`c869d26` #276); (6) **UAT 6 vòng 11 điểm**: NEW **`ui/SearchableSelect`** combobox gõ-lọc BỎ DẤU (fold NFD — Hạng mục/Dự án/NCC) + auto Địa điểm từ Project.Location + điều khoản TT Textarea đa dòng (`faed59f` #277) · anh chốt: **ẩn cả Trả lại+Từ chối khi người duyệt = người soạn** (drafterUserId match) + **quick-add NCC ngay form** (SuppliersController POST hạ → any-auth, PUT/DELETE giữ khóa — cicd authz probe live 4/4: 401 unauth/201 nv.test/403 delete/cleanup) + upload multiple files ×2 chỗ (`9c330d2` #278) · vòng 3-6 realtime (`f21c55d` #279-cancelled / `69997da` #280 / `80b64dd` #281-cancelled / `792c030` **#282 FINAL**): **bảng NCC table-fixed** width từng cột (file dài hết vỡ layout) + **bỏ ô "Tên" ngân sách nhập tay** (chỉ còn Số tiền, hasManual detect theo amount) + **GỠ field "Điều khoản thanh toán" khỏi TẤT CẢ form phiếu** (cột per-NCC + display phiếu cũ GIỮ) + **bỏ nút "+ Thêm hạng mục"** (1 phiếu = 1 hạng mục header). Bundle FINAL admin **`B1DtNT9C`**/user **`D6uF3Mln`** (Run #282). Test 240 ×2 local + 8× CI gate. **0/14 spawn truncated** (lần đầu sau nhiều session). → session log `2026-06-11-S59-wipe-tree-pmh-uat-batch.md`. Prev S58 (2026-06-11 — **4 việc prod-verified Run #382/#383/#384**: lock-demo-user fix + tạm ẩn HRM/Office/Cá nhân + Danh mục cuối sidebar + fe-user redesign theo UI/UX guide AI_INFRA. **Việc 1 — lock fix** (Run #382, `5998163` ~3m31s): Run #381 cicd phát hiện S57bis lock = NO-OP (14 email named-person là population Dev-only). Recon dump prod: demo thật = 20 UAT-matrix `{dept}.{nv,pp,tp}@`+`bod.{1,2}@` tạo TAY 05-13; root cause sâu = `DemoUserPassword` 11 ký tự < prod `RequiredLength=12` → `CreateAsync` silent-fail MỌI startup từ trước tới giờ (= root cause "helpdesk inert phòng IT 0 user" S56). Fix: union 20 email + password 12 ký tự. Prod sau deploy: **55 user / 21 active / 34 locked** — 20 UAT + 14 named-person locked ✓, **nv.cao/nv.truong CREATED+ACTIVE (helpdesk S56 RESOLVED)** ✓, 5 real staff created ✓, guard admin/catalog.manager/nv.test/chuong.phan-typo active ✓ (anh chốt 3 quyết định AskUserQuestion). Bundle FROZEN. gotcha **#60** NEW (seed silent-fail vs prod password policy — dump population thật trước khi lock/seed-by-email). +Closeout S57bis residual: gotcha #59 commit, 4 spawn-record on-behalf (H2 4-MISS), H1 5-patch doc-drift, test 240 re-verified local. Prev S57bis (2026-06-11 sáng) — **PE gắn Hạng mục công việc (Mig 49) + mở quyền Pe all-role + menu "Cá nhân" + khóa demo user** (sếp Zalo deadline 15:00): commit `17b23a4` (Harness-4 two-tier runtime-VERIFIED spawn-test 2 chiều) + `dd117b7` (product) → Run #381 PASS ~4m25s. Mig 49 `AddWorkItemToPurchaseEvaluation`: PE.WorkItemId `Guid?` loose-Guid KHÔNG FK vật lý (convention PE — database-agent design) + IX + validator NotEmpty create + FK-guard handler Conflict + UpdateDraft null-safe. FE ×2 app PeWorkspaceCreateView/PeHeaderForm (SHA256 identical)/PeDetailTabs "Dự án – Hạng mục". Pe_* 11 key CanRead+CanCreate mọi role (130 rows/13 role — Pe_* leaf KHÔNG nằm MenuKeys.All, build qua factory). Menu Personal root@30 + Chấm công re-parent + Master write-lock `Admin,CatalogManager` ×3 controller. Test 228→**240** (+12 PeWorkItemGuardTests). Bundle rotate cả 2: admin `CP4CB1ym` / user `BmZ3VHnm`. 2 builder truncated #53 + reviewer die-0-byte ×2 → em main solo vá cross-stack + self-gate. Excel (3) đối chiếu = NO-CHANGE (S55 data identical). Prev S56 — **Pre-golive verify sweep + golive-harden 4 fix — HMW 2-workflow, prod-verified**: commit `a20cde8` → Run #379 PASS ~4m20s. WF1 `pre-golive-verify` 7-stream song song + adversarial → 6 PASS/1 CONCERN/0 blocker = **GO**; key finds = **ops not code** (prod IT-dept 0 active user → helpdesk inert + S43 LeaveBalance lost-update còn nguyên). WF2 `golive-harden` fix 4: **#3** LeaveBalance lost-update→atomic `ExecuteUpdateAsync`+Serializable tx (NO mig, exactly-once nguyên) · **#5** ItTicket authz Forbidden-trước-NotFound (fail-closed) · **#6** DocxRenderer null-guard (2 warn→0) · **#4** Travel/Vehicle ApproveV2 +4 smoke. Test **216→228**. Bundle FROZEN `4SUwDLD8`/`XdKzt9LL` (BE-only). `sys.tables` re-ground **92→93** (cicd ground-truth, Mig 48 col-only). reviewer stage StructuredOutput-fail→em main đỡ cross-stack review (3 diff clean) + bump Serializable đóng MAJOR. gotcha **#58** NEW (EF read-modify-write lost-update→ExecuteUpdate atomic). **2 ops VPS pending** (gán user phòng IT + `tzutil` UTC+7). FE Phase 2 redesign **deferred** (recon ready). Prev S55 — **Nạp master data thật từ Excel + Project +4 cột (Mig 48), HMW-mode ON**: commit `69cb393` → Run #377 PASS ~4m33s, prod-verified. Anh giao file Excel "HẠNG MỤC CÔNG VIỆC DỰ ÁN" → `/ultra-on "workflow làm xong hết"`. Nạp **62 dự án + 71 hạng mục + 3 NCC** vào Project/WorkItem/Supplier qua `SeedRealMasterDataAsync` (per-code idempotent, **UNGATED** → coexist demo, tự lên prod). **Mig 48 `AddProjectMasterFields`**: Project +4 cột nullable (Year/Investor/Location/Package, NO new table). FE ProjectsPage form +4 input ×2 app SHA256 mirror. Test 216 (compile-fix MasterCatalogFilteredUniqueTests +4 null args, no new test). Bundle admin `DmjI8Cmn`→`B-d6893W`/user `YxL_MljK`→`XdKzt9LL` (cả 2 rotate). Prod verify: Mig 48 applied · Projects spot-6/6 · WorkItems VT/TP/MEP/TB=71 · Suppliers 3 · CAL01.Investor="Công ty TNHH Calofic". **2 agent return truncated** (implementer-backend + reviewer, gotcha #53) → em main disk/runtime-recover (build/test/sqlcmd/git truth); cicd verdict-FIRST → PASS clean no-truncate. Data-quality catch: MEP col gộp 2 nhóm + divider "THIẾT BỊ" → split đúng 71/4-category. Provenance `scripts/master-import-data.generated.md`. Prev S54 — **IT staff tự reassign ticket (cross-stack authz, HMW-mode ON)**: 1 code commit `ca4b602` → Run #376 PASS ~4m18s, prod-verified. Cho tổ IT (dept Code=="IT") + Admin reassign ItTicket trên CẢ 2 app. BE: NEW `GetAssignableItStaffQuery` capability endpoint `{canReassign,staff}` + `AssignItTicketHandler` authz Admin-OR-dept-IT (Forbidden) + assignee-must-IT (Conflict) + controller `/assign` hạ `[Authorize(Roles=Admin)]`→`[Authorize]` (handler fine-grained). FE: fe-admin+fe-user ItTicketsPage **SHA256-identical** (REVERSE S53 divergence) gate nút by `canReassign`, dropdown từ `/assignable-staff` (không `/users`). Test 203→**216** (+13 authz guard test-before-merge). NO migration (DepartmentId reuse). Bundle admin `DfCfHUE9`→`DmjI8Cmn` / user `_3S0BPJ2`→`YxL_MljK` (cả 2 rotate). 6-agent fan-out (BE∥FE→test→reviewer→cicd) + em main reconcile stray-memory residual (3 agent ghi MEMORY nhầm `src/Backend/.claude` → harvest về canonical). reviewer PASS 0 blocker (role-string "Admin" chain-verified). Task 1 Phase 9 Ops KHÔNG làm (anh dừng). flag: cicd `sys.tables=93` vs STATUS 92 → monthly audit re-ground.) Prev S53 (gotcha #57 EXT Master Mig 47 + P11-D reassign-UI fe-admin + P11-E menu + database-agent verified-runtime: `44b9e54` Run #260 + `dbf6648` Run #261, test→203, bundle→`DfCfHUE9`). Prev S52 (Phase 11 P11-D+E+F deployed + database-agent adopt, HMW-mode ON): 3 commit — `e9ee97f` (database-agent DB1–DB11 read-advisory, roster 10→11, executed-file CHỜ restart) + `6a66429` Wave 1 (P11-E AttendanceReport+Excel+OtPolicy multiplier + P11-F MaTicket codegen, migration-free) + `dcf76f8` Wave 2 (P11-D ItTicket round-robin assign dept-IT + SLA timer, Mig 46). Test 186→**200**. Bundle admin `DYfjnpY0`/user `_3S0BPJ2` (cả 2 deploy verified curl độc lập — Wave 1 BE 401 wired + Wave 2 /assign 401 + Mig 46 applied health-200). ⚠️ **Session-limit hit giữa Wave 2** → recovery: BE/test verify-on-disk + em main solo FE redo + curl-self-verify thay cicd-spawn (multi-agent resilience, git/disk/prod = source-of-truth). RAG recovered (chunk 2416 rerank live) nhưng stale 05-29. Prev S51: P11-C Vehicle+Driver.) +**Last updated:** 2026-06-26 (S91 — **buổi go-live LỚN em-main-led, 4 commit prod-verified + backup local** — go-live chính thức 26/06 anh Kiệt SOL-IT Phase-01 PRO+CCM. **#1 `159b69d`** guide Word bỏ "Từ chối" 2 chỗ + fix 12 caption Hinh→Hình [app gỡ Từ chối S60, guide đã phát công ty stale; unpack→XML→repack giữ 13 ảnh, verify python-docx]. **#2 `ba42c59`** wipe go-live `scripts/s91-wipe-golive.sql`: xóa 16 PE+16 PeWorkItemBudgets+94 notif+19 NCC demo, GIỮ 7 NCC thật+17 user+master, reset PeSeq→**A/001** [backup `SolutionErp_S91_pregolivewipe.bak` + 2 guard PE>16-abort/NCC≠19-rollback + AskUserQuestion scope]. **#3 `55494ad`** gate SeedDemoMasterData sau DemoSeed:Disabled — root-cause: seed ungated per-code resurrect 18 NCC demo mỗi restart → prod skip → verify demo_codes=0 qua 2 restart [gotcha #75]. **#4 `e81e87f`** user tự đổi mật khẩu: BE ChangePasswordCommand + POST /auth/change-password [Identity verify pass-cũ, fail-PasswordMismatch→field CurrentPassword] + FE 2-app ChangePasswordDialog/TopBar + 10 test; fix CS0104 ValidationException ambiguous [FluentValidation vs custom]. + **backup local** `backups/SolutionErp_golive_clean_2026-06-26.bak` 21MB + accounts.txt 17 tk [.gitignore +backups/+*.bak]. **State THẬT: Mig 59 · 88 bảng · 431 test [45D+386I, +10 ChangePassword] · gotcha 76 [+#75 seed-resurrect +#76 deploy-config-từ-.example] · menu 54 · bundle admin `DgQyuG7f`/user `BmbQon23` · prod 17 user/7 NCC/70 dự án/71 hạng mục/0 PE-HĐ.** **Lessons:** wipe-không-bền-nếu-không-gate-reseed [#75 root>symptom] · deploy render Production.json từ .example KHÔNG file-gitignored [#76] · em-main-led security-feature báo-trước + test-specialist + build/test gate thay fan-out [#53 cicd garbled-return→em-main self-verify-prod; test-specialist độc-lập bắt CÙNG CS0104] · Chrome-MCP screenshot kẹt SPA-SignalR document_idle [carry #74, guide-ảnh defer — anh "tự check"]. **🔴 NEXT anh:** ⚠️ restart CLI · review guide docx Word · đóng 2 tab eoffice em mở. **NEXT em:** curate test-specialist L1 OVER [carry] · monthly 2026-07-01 [re-tier mega-line + ef-core Mig→59 + Budget-removed docs/CLAUDE]. → log `2026-06-26-S91-golive-wipe-changepw-backup.md`) · **Prev S90** (S90 — **Chèn 12 ảnh khoanh-đỏ vào guide Word `docs/Huong-dan-Duyet-NCC.docx` (em tự chụp prod qua Chrome) + chẩn UltraViewer — em-main solo, 0 production code, HMW-mode ON**: anh `/session-start` → "mở chrome vào chụp ảnh dán vào luôn" (12 ô ảnh trống từ S89). Browser-driving = vòng-lặp thị-giác tuần-tự → **em-main solo** (KHÔNG fan-out Workflow, đúng decision-tree). **Pipeline tự-chế (gotcha #74 NEW):** MCP `save_to_disk` (Chrome MCP + computer-use) KHÔNG ra file truy-cập được env này → **PowerShell .NET `CopyFromScreen` + Win32 `EnumWindows`+lọc-process-`chrome.exe`+`SetForegroundWindow`** (lọc process vì app Claude-Code Electron cùng class+title "Solutions ERP" → khớp nhầm) chụp PNG 2560×1600 + **DOM overlay `window.__ccA`** khoanh-đỏ **element-based** (minLeft/maxLeft/exact/up/nth/**case-insensitive** — toạ-độ-cứng vỡ do viewport đổi 812↔833; label CSS-uppercase→case-insensitive) + crop 92/72 (banner CDP "Claude started debugging" s08/s12→146, verify montage dải-trên) + `python-docx add_picture(6.0")` fit-A4 (6.3" tràn vì A4 content=6.27") vào 12 table cell + caption "Hình N". 12 màn: login·menu+tạo·form-fields·NCC+báo-giá·NS+QT·checklist+gửi·inbox·detail+so-sánh·quyết-định·workflow-matrix+cờ-finalize·tạo-HĐ·cây-list. Verify **13 ảnh** (1 logo+12) + montage sạch-banner. **0 prod mutation** (xem-only, KHÔNG bấm Gửi/Duyệt/Trả-lại/Tạo-HĐ; `?mode=new` không tạo draft). anh tự login Admin. **Caveats guide (carry):** ① #9 app chỉ **Duyệt+Trả-lại** (gỡ "Từ chối" S60 → text guide stale, chờ anh OK sửa) · ② #10 workflow chưa bật finalize → chụp **cờ "Duyệt là KẾT THÚC quy trình"** thay badge sơ-đồ · ③ #11 KHÔNG bấm Tạo-HĐ (no created-contract shot) · ④ account=admin (sidebar nhiều menu admin). **UltraViewer (anh hỏi "sao bật"):** chẩn `UltraViewService` StartMode=**Auto**/LocalSystem standby, **0 kết-nối Established**, em KHÔNG mở (chỉ grant Chrome; computer-use screenshot **detect+mask** nó) → hướng-dẫn tắt self-serve (KHÔNG tự đổi system-setting, theo prohibited-rule). **State GIỮ NGUYÊN: Mig 59 · 88 bảng · 422 test · gotcha 74 (+#74) · menu 54 · bundle admin `DalcOhvb`/user `CdS4tX_2`.** docx committed closeout (docs-only CI-skip). **🔴 NEXT anh:** review docx trong Word + ⚠️ restart CLI (carry budget v3 + `/user-mark-*` + cadence) + (tùy) bật finalize 1 cấp → ảnh #10 badge / bấm tạo 1 HĐ thử → ảnh #11. **NEXT em:** sửa text "Từ chối"→"Duyệt/Trả lại" guide nếu anh OK · curate test-specialist L1 34.8KB OVER (carry S88). → log `2026-06-25-S90-guide-screenshots-insert.md`.) · **Prev S89** (S89 — **PE visibility/finalize batch + xóa 38 User test prod + Word guide, ~6 commit prod-verified, HMW-mode ON**: **D1 nháp riêng-tư** (`a71753b` Run #465, test 419→421) — IDOR fix nháp lộ qua cond#2 role (GetEligiblePhases Drafter/DeptManager→DangSoanThao) + **cond#3 V2-approver** (workflow pin lúc-TẠO → CEO approver thấy MỌI nháp = leak màn CEO) → 4 chỗ owner-only (GetEligiblePhases bỏ DangSoanThao · admin-inbox bỏ · list-cond3 guard · detail-authz guard) + PeDraftVisibilityTests · **D2 CCM giá-đề-xuất** (`f7bd97a`) gỡ `!readOnly` over-gate (gate thuần role mirror ô ngân-sách; BE setter fail-closed = chốt) · **D3 finalize-note 3-surface** (`f0bca77` test 421→422) BE +3 computed-field detail+list DTO **no-migration** + EF-subquery first-reachable + PeFinalizeChip 2-app (invest-WF `wf_341f7b29` + impl-WF `wf_3f57edb6`; **impl-FE return-rỗng #53** → em-main mirror fe-admin 4-file SHA + self-gate + PeFinalizeProjectionTests) + **flow badge "⚑ Duyệt thay CEO"** PeWorkflowPanel (`9c920ad`) + **matrix flag thứ-8** WorkflowMatrixViewPage thiếu allowApproverFinalize từ S87 (`fef4c33`) · **xóa User test** (`681b1ed`) recon prod (ssh sqlcmd) 55→giữ 17/xóa 38 (whitelist-keep + backup `SolutionErp_S89_preuserdelete.bak` + count-guard[30,45] + XACT_ABORT; KHÔNG approver-block FK; nv.test 1-PE) + gỡ seed SeedDemoUsers/Lock · **Word guide** `docs/Huong-dan-Duyet-NCC.docx` (skill docx, logo Solution, 8 phần, khoanh-đỏ 1→2→3, ảnh-chờ-chụp). **State THẬT: Mig 59 · 88 bảng · 422 test (45D+377I) · gotcha 73 · menu 54 · bundle admin `DalcOhvb`/user `CdS4tX_2` · prod 17 user thật.** **Lessons:** Designer-save = version-MỚI (phiếu pin version-cũ → finalize chỉ hiện phiếu-MỚI = "check rồi mà không thấy") · doc-drift thêm-flag-Designer-quên-surface-matrix-song-song · whitelist-keep + 3-lớp-guard prod-delete · WF-impl-FE-return-rỗng → em-main mirror + self-gate (≡ S65/S73). 🔴 NEXT em: curate test-specialist L1 34.8KB OVER + cicd 28KB + reviewer 27.7KB. NEXT anh: chèn 12 ảnh guide + restart CLI. → log `2026-06-25-S89-pe-visibility-finalize-userclean-guide.md`.) · **Prev S88** (S88 — **PE stability audit (frozen CEO-approved spec) → fix patchwork D1 + hoàn-thiện multi-winner D2, 2 deploy prod-verified, HMW-mode ON, audit-workflow + ~14 spawn**: anh giao review/invest/test lại Duyệt NCC, "chấp vá thì xử lý, tính năng đã ổn định". **Audit Workflow `wf_c15da996-be5`** (6 area × invest→review pipeline + full-suite test, 13 agent) → CORE SOLID (winnerQuoteTotal 3 site · SelectWinner clear · urgent fail-closed authz · drafter-exclusion notify · 2 finalize mechanism) + tách findings **safe vs behavior-affecting**. AskUserQuestion ×4 chốt max-scope: sửa-hết-safe + hoàn-thiện-joint-winner + bật-CEO-notify + create-contract = **1 HĐ/winner**. **D1 (`73cce1f` Run #347 PASS):** Block B financials re-key `SelectedSupplierId→IsWinner` (số "Giá trị kỳ này"=0 + peer-rollup bỏ-sót cho ≥2 winner) · **CEO-notify-on-urgent +SaveChanges** (notify chạy SAU SaveChanges duy-nhất → rớt âm-thầm, Director KHÔNG nhận; +6 `PeUrgentNotifyDirectorTests` real-notify-fixture) · **HoSoLink null-safe + clear-via-empty** (sửa header wipe link đã-set, bug-class S42/#73; null=preserve/""=clear; HoSoLinkRow gửi `""`) · #70 guard PRO budget row3/row8 · dời `SetPeCcmBudgetPeriod` PeSuggestedPrice→PeWorkItemBudgetFeatures · comment. Test 402→**413** (+11). **D2 (`1aa3bdb` Run success):** **create-contract 1→N** (Command→`List`; **ContractCodeGenerator self-commit seq mỗi call → gen TẤT-CẢ mã TRƯỚC Add → build N local → atomic final SaveChanges** = no partial-create; GiaTri single=details-sum legacy/≥2=per-winner quote-total draft-editable anh-Kiệt-UAT; pe.ContractId=first idempotency; controller `{contractIds}`) · **list-card winner names** (DTO +`WinnerSupplierNames` EF collection-subquery **translate-OK SQLite** verified) · FE dialog contractIds[]+"Đã tạo N HĐ" · PeListPanel join names. Test 413→**419** (+6: multi-contract 5 + EF-translate smoke). **State THẬT: Mig 59 · 88 bảng · 419 test (45D+374I) · gotcha 73 · menu 54 · bundle admin `BQq2eTP6`/user `dHa64I59`.** **Cách chạy:** em-main-led BE core (financial/coupled/design-heavy = create-contract multi + financials) + delegate impl-backend (relocate) ∥ impl-frontend (FE 2-app SHA-mirror) ∥ test-specialist (test-before bug + test-after feature) + reviewer adversarial **PASS** (codegen-sequencing + arg-order + no-partial-create verified) + cicd-monitor. **#53 truncation ×3** (test-specialist/reviewer/cicd-monitor return rớt ở MEMORY-over-budget step → em-main recover-disk + self-gate + **curl-self-verify deploy** thay cicd-verdict). **Lessons:** ContractCodeGenerator self-commit-seq → multi-entity create = gen-all-codes-TRƯỚC-Add → atomic SaveChanges (no partial) [[feedback_multi_entity_create_self_committing_codegen]] · cardinality single→multi grep MỌI consumer (audit bắt 2 BE financial read-site sót S87 FE-only sweep) [[feedback_cardinality_change_grep_consumers]]. **🔴 NEXT (em): curate test-specialist L1 34.8KB OVER-SOFT GẤP** (root #53 ×3; reviewer 27.1KB+FD 26.1KB WATCH). **NEXT UAT (anh Kiệt Ctrl+F5):** ① ≥2-winner Block B "Giá trị kỳ này" đúng số · ② GẤP→Director nhận chuông · ③ Link hồ sơ giữ khi sửa header · ④ ≥2-winner "Tạo HĐ" → N HĐ draft (xác nhận GiaTri per-winner=giá NCC chào). → log `2026-06-25-S88-pe-stability-audit-d1-d2.md`.) · **Prev S87** (S87 — **2 buổi PE feature LỚN prod-verified, HMW-mode ON, ~14 spawn (nhiều #53 truncate → recover-disk + reviewer cross-verify + em-main self-gate)**: **(1) CCM 3-fix Mig 58** (`f1b10e9` **Run #344 PASS** ~5m11s) — anh forward PDF "CCM 4 ý cần sửa PM" (BỎ mục 3 theo anh): **①multi-winner** chọn NHIỀU NTP/NCC/ĐVDV cùng trúng → `winnerQuoteTotal=SUM PurchaseEvaluationSupplier.IsWinner` (cột mới, backfill từ SelectedSupplierId 13/13; SelectWinner→multi-toggle `SupplierIds[]`; FE bảng so sánh tick-nhiều-ô + "Tổng chi phí đã chọn"); **②budget=0 hợp lệ** (submit-guard nới `is null` only KHÔNG `<=0`, +3 validator GTE0; fallback ProInitial chỉ-khi-null bảo-vệ 0-cố-ý); **④cấp KẾT THÚC quy trình** `ApprovalWorkflowLevel.AllowApproverFinalize` — admin bật per-cấp Designer, duyệt tới đó TỰ DaDuyet bỏ CEO (**opt-in→AUTO** theo anh "cho bật trong quy trình hay hơn" → gỡ runtime-flag, nhánh `if (matchingLevel.AllowApproverFinalize)`). **Self-review bắt 8 chỗ FE keyed `selectedSupplierId`** (null khi liên-danh ≥2 → vỡ submit-guard/checklist/computeGiaChaoThau/tạo-HĐ) → đổi `isWinner` (cardinality single→multi = grep MỌI consumer). Test 377→**395** (+20−2 rework auto). Bundle admin `aKuNip19`→**`CXCKlNay`**/user `BUsL0HeQ`→**`Di40ewrF`**. **(2) Section B 3-cột Mig 59** (`9b1ee0c` **Run #345** cicd-verifying) — anh AskUserQuestion chốt "mỗi cột nhập kỳ-này RIÊNG" → `PurchaseEvaluation.CcmBudgetPeriodAmount` + endpoint `PATCH /budget/ccm-period` role-gate Admin|CCM fail-closed; FE Section B (THỰC HIỆN) rewrite `` list → `
` 3 cột (Dự án—|PRO budgetPeriodAmount/proFull|CCM ccmBudgetPeriodAmount/ccmFull, `colCalc()` per-cột) qua **Workflow `wf_aafb18fe-d9d`** (BE→FE→test + 3-lane review: math PASS · authz PASS · mirror+FE return NULL → em-main self-gate mirror byte-identical + 402-test + 2-build verify). Test 395→**402** (+7 authz setter). **State THẬT: Mig 59 · 88 bảng (cicd flag 89 — drift cũ KHÔNG do Mig 58/59 AddColumn-only, re-ground monthly) · 402 test (45D+357I) · gotcha 73 · menu 54 · bundle admin `BABhPh2s`/user `DLulO6uP` (Run #346 — `0d3c0cf` tách khối nổi bật "4. Thông tin chọn thầu" FE-only PASS; #345 Section B = `C8lWxEQK`/`Kz5cSW2u`; #344 CCM-3fix = `CXCKlNay`/`Di40ewrF`).** **Lessons:** cardinality single→multi = grep MỌI read-consumer (impl sửa write-site sót dependent — `feedback_cardinality_change_grep_consumers`) · design-dialog (item4 auto-config qua workflow-config, Section B AskUserQuestion) tránh rework · workflow review-lane value dù 2 lane NULL (lane-return verify disk độc-lập → trust PASS dù impl return NULL). ⚠️ CCM setter command rơi `PeSuggestedPriceFeatures.cs` (lệch chỗ, dọn monthly). → log `2026-06-24-S87-pe-multiwinner-budget-finalize-sectionb.md`.) · **Prev S86** (`ae4f106` Run #343) — PE notify "cần duyệt" loại NGƯỜI TẠO phiếu (drafter không nhận chuông phiếu mình tạo dù là approver 1 cấp; +3 `PeApproverNotifyExcludesDrafterTests`; re-ground STATUS test 356→377/gotcha 71→73 sót-S85-closeout). · **Prev S85** — **buổi UAT anh Kiệt FDC CỰC LỚN: CV PRO 6-fix batch + clear-data + 6 vòng UAT + 2 ROOT-CAUSE + 5 SQL-fix — ~10 deploy prod-verified #334→#341, HMW-mode ON, ~12 spawn** — anh forward Zalo anh Kiệt + Tra Sol + long.chau realtime. **Batch CV PRO (Run #334 `5a61254`):** đọc file `Cần chỉnh sửa CV PRO.xlsx` = **8 ảnh chú-thích nhúng** (không phải bảng công thức) → 6 fix: C1 ẩn "c.Giá chào thầu"+"d.Bảng so sánh" form TẠO · C3 ô8 pre-fill từ row7 (Ngân sách còn lại) · C4a **live-recompute** ô3/8 chưa-Lưu (VndInlineEdit +onLiveChange, draftRow3/8) · C4b So-sánh=0→"Bằng ngân sách"/"—" · C5 hủy/đổi NCC winner (BE `SelectWinnerBody(Guid?)` clear-branch + FE dropdown/toggle) · C7 nút "Toàn màn hình" preview file. **Clear-data (`scripts/s85-wipe-uat-data.sql`, BACKUP-trước):** wipe 43 PE + 28 PeWorkItemBudgets + 1 HĐ + 32 notif + 21 NCC-test (CreatedAt≥06-11, giữ 22 gốc) + reset mã→A/001; AskUserQuestion chốt scope (xóa budgets + NCC-test); SET QUOTED_IDENTIFIER ON (filtered-index). **6 vòng UAT (#335→#338):** R1 D1 ẩn mục 3/4/5 + D5 auto-chọn quy trình (1 option) · R2 D2 drafter tự-gỡ cờ GẤP (nới S77 GỠ=TP→+drafter clear-cả-2, BE restructure SET/UNSET) + D3 ngân-sách-kỳ-này tự-nhảy từ "Ban hành lần đầu" (`proInitialAmount`, FE display + BE/FE submit-guard fallback `budgetPeriodAmount ?? proInitialAmount`) · R3 ràng tạo-phiếu (hint đỏ "thiếu gì") + D4 checklist xanh✓/đỏ✗ trường bắt-buộc · R4 checklist +"Quy trình duyệt". **2 ROOT-CAUSE (whack-a-mole→fix gốc):** **(R5 #339 `1263c0d`)** workflow MẤT khi bấm Sửa = **bug-class S42** — `UpdatePeDraftHandler` absolute-set `ApprovalWorkflowId=null` khi form Sửa KHÔNG gửi field → CLEAR (field SÓT khỏi pattern null-safe mà BudgetPeriodAmount/WorkItemId cạnh đã có) → fix `if (request.X is not null)` (gotcha **#73** NEW, +3 regression test) · **(R6 #341 `49ac086`)** "mới tạo báo 7h trước" = **TZ** — timestamps lưu UTC nhưng EF đọc `DateTimeKind.Unspecified` → System.Text.Json default serialize KHÔNG có 'Z' → FE `new Date(naive)`=local → lệch +7h (VN UTC+7) → **`UtcDateTimeJsonConverter`** global (AddControllers.AddJsonOptions) ép UTC-with-Z (gotcha **#72** NEW) — cicd verify API trả `createdAt:"…3154440Z"`. **5 SQL-fix** (2 đợt 3+2 phiếu workflow-less, gán QT-DN-V2-001 type-1, ssh prod). **Cách chạy:** em-main-led + impl-backend (C5 BE clear) + impl-frontend mirror + test-specialist ×3 (C5 +10 · urgent-authz +5 · workflow-preserve +3) + reviewer ×2 (truncated→em-main self-gate, memory-lesson) + cicd-monitor ×7 (7/7 PASS; ship-proof BE-only = `Application.dll`/`Api.dll` Last-Modified in-window, #69-REFINE). **Test 356→374** (+18). **State THẬT: Mig 57 · 88 bảng · 374 test · gotcha 73 · menu 54 · bundle admin `aKuNip19`/user `BUsL0HeQ` (Run #341, FE frozen #339+#341 BE-only).** **Lesson `feedback_root_cause_over_symptom`:** bug lặp-lại (SQL/tzutil band-aid không dứt) → truy field/case **LỆCH-quy-ước** rồi đưa vào pattern đã-đúng = fix 1 chỗ hết tái-diễn. → log `2026-06-23-S85-pe-uat-cvpro-rootcause-tz.md`.) · **Prev S84** — **bootstrap + flush session-start hot-feed cap-echo v3 + commit S83 cicd harvest-orphan (em-main hygiene, 0 production code)** — anh `/session-start` → 2 monitor INFORM: H1 bắt `session-start.md:114` còn cap CŨ `lead 60K/sub 20K/wf 16K` ≠ canonical budget v3 `220K/60K/50K` (S82 self-shrink chưa flush khi S83 owner-set lại); H2 bắt `cicd-monitor/MEMORY.md` = harvest S83 hợp-lệ (Run #333 + gotcha **#69-REFINE**: hash giữ-nguyên khi 0 `fe-*/src` đổi → ship-proof THẬT = `Last-Modified` in-window, KHÔNG hash-delta) sót khỏi closeout `f71654f`. Anh "Sao ko add luôn?" → em flush `session-start.md:114` echo cap → **220K/60K/50K + canonical-pointer "đọc số sống ở budget.json"** chống tái-drift (detector C2 KHÔNG track cap-number → echo-trần lệch âm-thầm lần đổi cap sau) + commit cicd harvest-orphan. **Lesson (`feedback_derived_flush_execution`):** monitor INFORM-only proposal về **derived→canonical flush** = em-main **EXECUTION** (B3 VERIFY→APPEND = verify-rồi-LÀM), KHÔNG gate user-confirm; chỉ **ĐỔI-con-số** mới = quyền anh (chủ-dự-án). archive-gate A7 GATE PASS 217/217 · 2 WATCH strike-1 (FD/test-spec, no-action). **State GIỮ NGUYÊN: Mig 57 · 88 bảng · 356 test · gotcha 71 · bundle `CsJetgZH`/`BVS0ApIm`.** ⚠️ restart CLI (command `.md` no hot-reload — runtime %-print mới ăn cap đúng). → log `2026-06-22-S84-session-start-cap-flush.md`.) · **Prev S83** — **(1) adopt H-15 v3 memory-budget full-parity (anh owner-directive) + (2) fix PE require-workflow create+submit (đóng lỗ hổng "quy trình cũ") prod-verified Run #333** — anh `/session-start` → directive budget Tầng-1 **220K**/mem-sub **60K**/wf-sub **50K** "nạp đầy cho đủ" → diagnose phiếu A/040 "quy trình cũ" → "(B) vá guard BE + test-before → deploy" → `/session-end`. **Part 1 H-15 v3 (commit `2c7fd63` docs-only CI-skip):** `token_governor` lead 200K→**220K**/mem-sub 20K→**60K**/wf-sub 16K→**50K** full AI_INFRA parity (sửa self-shrink S82 = AI tự-co-nhỏ, mark `RC-…01-58-01` cấm) + NEW `spawn_fill_directive` (nạp sub tới budget bằng prompt GIÀU — byte-cap MEMORY.md = 1 lát, prompt nạp phần còn lại; retire `≤8K-brief`) + engine **§G.5** + ACTIVE-MARKS H-15 **v3-delta** `RC-pqhuy1987-22-06-2026-16-35-37` (anh-directed, report-before-stamp). **Part 2 PE fix (commit `fc1f19d`, cicd Run #333 PASS ~4m59s):** validator `NotEmpty(ApprovalWorkflowId)` + submit-guard (SAU Section-3, TRƯỚC mutate phase) → phiếu null-workflow KHÔNG gửi-duyệt được (trước: kẹt nhánh V1-legacy = banner "quy trình cũ", không Bước/Cấp, "Lịch sử duyệt 0"). **Diagnose:** banner ⟺ `approvalFlow` rỗng ⟺ `ApprovalWorkflowId` null; A/040 **tự-khỏi-khi-reload ⟹ cache** (data-hỏng reload không khỏi — em KHÔNG đụng prod). **test-before RED→GREEN**, full-suite bắt **9 đỏ** → triage: 2 genuine-spec-conflict (V1-submit deprecated, data wipe S59) rewrite + 6 collateral giữ (dời guard sau Section-3) + 1 validator fix. **Test 354→356** (+2 validator). **#69-REFINE (cicd):** bundle KHÔNG rotate vì 0 fe-src change (Vite deterministic) — ship-signal THẬT = Last-Modified in-window KHÔNG hash-delta; bundle GIỮ admin `CsJetgZH`/user `BVS0ApIm` Run #333. State THẬT: **Mig 57 · 88 bảng · 356 test · gotcha 71 · bundle `CsJetgZH`/`BVS0ApIm`**. ⚠️ restart CLI activate budget v3 runtime. → log `2026-06-22-S83-h15v3-pe-require-workflow.md`.) · **Prev S82** — **adopt Harness-15-v2 (Tầng-1 hot-feed-lớn + L2/L3 bỏ-trần + %-print 2-đầu-phiên + ranh-giới vai-trò), 0 production code** — `/check-email AI_INFRA` (1 thư mới H15-v2-notify verify ✓✓ whole-file+body) + `/adap-apply all` (fan-out 29 broadcast vs 22 report → CHỈ H15-v2 MỚI; 7 còn lại verify = đã-phủ S72/S75/S79). em-main IMPLEMENT single-writer D9 (6 edit: `token_governor` L1 12K→per-role **lead 60K/sub 20K/wf 16K** · L2/L3 6K/4K→**NO-CAP** · engine §G.4 · session-start §2.1.6 + session-end §L.b(c) %-print · mark H-15 What-cell refine) + **REVIEW Workflow `wf_04667b25-5fa` 3-lane 3/3 PASS** (bắt 3 MINOR → fixed: volume "~42K" stale · mark pending-confirm flag · _index STAGE-2). **Ranh-giới vai-trò:** con-số = quyền CHỦ-DỰ-ÁN/anh, AI thực-thi + báo-% — sửa framing S81 "lead-authority" gộp nhầm AI-lead↔owner. mark H-15 **v2-delta anh-confirm** `RC-pqhuy1987-21-06-2026-01-58-01` (report-before-stamp). commit `aa3f0fe` push (docs-only CI-skip) + email AI_INFRA `a749bb6bd1be`. **State THẬT GIỮ NGUYÊN: Mig 57 · 88 bảng · 354 test · gotcha 71 · bundle `CsJetgZH`/`BVS0ApIm`.** ⚠️ restart CLI (session-start §2.1.6 + session-end §L.b(c) %-print runtime). → log `2026-06-21-S82-harness-15-v2-adopt.md`.) · **Prev S81** — **adopt Harness-15 memory-budget per-agent (token-governor + value-gate + work-state block)** — em main single-writer + 1 REVIEW Workflow (`wf_b7f3c8ac-b53` 3-lane: Part-A PASS · Part-B PASS · Honesty HONEST), **0 production code**. `/check-email AI_INFRA` STAGE 1 = **0 new directed** (outbox/se 4 file processed S79); fan-out diff → CHỈ **H15** unapplied (H14/v2.0/checklist-9-10/11 đã phủ S72/S75/S79). **8/8 🔴 floor:** A1 đo-SÀN persona-direct `Get-ChildItem` 4.3-13.3KB + harness-injected SE-ước-riêng 21K→**30K cap-riêng-SE** · A2 `token_governor` L1 12K/L2 6K/L3 4K (lead hard-cap) · A3 tách-nhà · B(a) nạp-đầy-no-token-saving · B(b) **value-gate** `value_protect` 10-pattern + gate-script FLAG **runtime-fired** (test-specialist gotcha#/guard) ⟂ keep-floor recency = mark `RC-…11` áp tầng-bộ-nhớ · B(c) **work-state block** `session-start §2.1.5` · B(d) 3-tệp-chốt verified (`hmw.js:124` MEMORY-PACK) · B(e) **2-governor** byte⟂token. **5/6 sàn = convention, chỉ (e)+đo-SÀN = mechanized (honest no-overclaim).** Review bắt **2 CONCERN** (anchoring + tool-attribution) → **fixed** (review→fix loop) + refresh stale `measured` block S71→S81. Artifacts: `memory-budget.json` + engine `§G` + `session-start §2.1.5` + `rules §6.6` + gate-FLAG + adap-report `2026-06-20-Governance-harness-15-memory-budget.md`. A7 217/217 · detector 26-flag baseline (0 new). ⚠️ **restart CLI** (session-start §2.1.5). **✅ mark H-15 stamped Active-High** (`RC-…23-07-37`, anh-confirm S81). **State GIỮ NGUYÊN: Mig 57 · 88 bảng · 354 test · gotcha 71 · bundle `CsJetgZH`/`BVS0ApIm`.** → log `2026-06-20-S81-harness-15-adopt.md`. · **Prev S80** — **curate L1 over-cap reviewer/inv-codebase/cicd → L2 archive** — em-main single-writer, archive-gate keep-floor-hit→manual condense-with-archive: 31 entries byte-exact (`sed`) +N−0 → `archive/2026-06.md` + 31 `_INDEX` substring pointer → **A7 GATE PASS 217/217**; stale foundation counts flushed (130/263→354 · 55→71 · Mig 40/55→57 · 84→88 · bundle→#330). **0 production code, state GIỮ NGUYÊN: Mig 57 · 88 bảng · 354 test · gotcha 71 · bundle `CsJetgZH`/`BVS0ApIm`.** WATCH (A6 strike-1): frontend-designer 26KB + test-specialist 28KB. Lesson: `_INDEX` substring **quote-free** (A7 quote-parser bắt escaped-quote PURO pointer self-grep miss). 9 agent-memory file, docs-only commit (CI skip). → log `2026-06-20-S80-curate-l1-overcap.md`. · **Prev S79** — **adopt User-Mark (H-12/13) canonical §P + Harness-14 (Eval/Budget/Outcome) + chữ-ký RC** — em main + 4 Workflow (invest `wf_82337f7f-95c` → review `wf_a7cbe93e-912` → align-re-review `wf_9d3beebb-a95` → H14-review `wf_4d4eba6f-8a0`), **0 production code**. Anh gõ `/user-mark-active-high` "áp đầy-đủ chính-xác nhất theo AI_INFRA" → áp **canonical §P đầy-đủ** (P1-P10): 4 lệnh `/user-mark-*` + ledger `.claude/governance/ACTIVE-MARKS.md` (Active-High/Active/Medium/Disable) + `harness-11-engine.md §E`+**§F** + `rules.md §6.6` objective-criteria. **3 mark Active-High stamped** anh-confirm (`RC-pqhuy1987-20-06-2026-10-29-09/10/11`). completeness-gate H-6→H-13 **ĐẠT** (H-8 11/11 inherit no-`[1m]`). §F floor 6/6 + maturity HONEST. 3 adap-report + email ai_infra (`7b8615b3`). Bài học: broadcast cô-đọng→canonical-command/§P là spec THẬT (bản đầu MUST/TRACK→align lại) · report-before-stamp dogfood · investigator residual-diary OK. State GIỮ NGUYÊN Mig 57·88 bảng·354 test·gotcha 71·bundle `CsJetgZH`/`BVS0ApIm`. ⚠️ restart CLI. → log `2026-06-20-S79-user-mark-harness-14-adopt.md`). · **Prev S78** — **PE: đính kèm file khi DUYỆT (UAT Tra Sol / 5 tester)** — người duyệt tải file của mình lên ngay lúc Duyệt thay vì Trả lại phiếu (tình huống thay đổi nhỏ). Reuse hệ attachment + enum `ApprovalAttachment=5` **MIGRATION-FREE** (int-stored, 0 schema change); endpoint `POST {id}/attachments` + authz có sẵn (handler không guard drafter-only → approver upload được). FE 2 app SHA-identical: `PeWorkflowPanel` picker multi-file + upload-TRƯỚC-chuyển-phase (file lỗi=không duyệt) + mục "📎 File đính kèm khi duyệt" (download/preview) + 2 filter fix loại purpose=5 khỏi "Bảng so sánh" (gotcha **#71** proxy-predicate pollution). commit `7886fd0` → **Run #330 PASS** ~4m56s (test gate **354**, bundle admin **`CsJetgZH`**/user **`BVS0ApIm`**, NO migration, smoke 4×200 + attachments 401-wired). **3 lỗi em tự bắt review-trước-deploy** (authz-verify handler · filter-pollution #71 · Dialog mirror-truncate fe-admin). em-main-led + self-gate (grep no-leak thay reviewer over-cap) + cicd-monitor verify. → log `2026-06-19-S78-pe-attach-file-on-approve.md`. · **Prev S77** — **buổi sản phẩm RẤT LỚN: 10 deploy prod-verified #320→#329 (anh Kiệt FDC + Tra Sol + Bích Phượng UAT realtime, HMW-mode ON)** — bundle cuối admin **`BqKD3Y23`** / user **`Cn-i349D`** (Run #329). **Mig 56→57** `AddPeSuggestedPriceNotes` · test 344→**354** (+10) · gotcha **70** (tái dùng #70). 10 việc PE: (1) cờ GẤP **pill** 🔴PRO/🟢CCM đồng bộ MỌI danh sách + inbox (#320, NEW `PeUrgentChips` ×2 app); (2) **focus mode** bấm phiếu→overlay (#321) → **revert** list về layout gốc bám-trái lấp-đầy (#322); (3) **Mig 57** ô ghi chú giá đề xuất PRO/CCM (2 cột nvarchar(1000)) + **số phân cách VND** (`VndInlineEdit`/`BudgetCell`) + sửa chính tả "Bảng so sánh giá" + **guard #70** stale-echo (#323); (4) số âm → **đỏ + ngoặc** `(…)` hàng 7/8/9 (#324); (5) mục con **thụt dòng + gạch đầu dòng** phân biệt có-số/không-số (#325); (6) cờ gấp authz **BẤT ĐỐI XỨNG** GẮN=NV chức năng / GỠ=chỉ Trưởng phòng (DeptManager) (#326, asymmetric handler + button-by-state); (7) **tách chọn-phiếu (inline 3-panel) khỏi mở-rộng (overlay)** + nút "Xem mở rộng" mỗi dòng (`?expand=1`) (#327); (8) **chuông báo người duyệt** khi phiếu vào cấp họ — submit + mỗi approve-advance (#328, `LogTransitionAsync` notify current-level approvers); (9) banner phiếu **Trả lại** hướng dẫn gửi lại (#329). **3 lỗi em tự bắt khi review TRƯỚC deploy** (guard #70 stale-echo cho ô ghi chú · luật cờ-gấp bất-đối-xứng Tra Sol clarify giữa-chừng · double-mount PeDetailTabs Task H — intent-comment có nhưng code sót). Cách chạy: em-main + frontend-designer ×3 (focus/revert/decouple, FD2 stub-verify do backend-down #3) + implementer-frontend (pill/notes/sep/spelling) + implementer-backend ×2 (Mig 57 · approver-notify) + test-specialist ×3 (notes +7 · urgent symmetric→asymmetric REDO do clarify-after-dispatch) + cicd-monitor ×10 (10/10 PASS). **frontend-designer process-death giữa Task H → recover-disk** (edit hoàn-chỉnh trên disk, em-main build-verify + mirror). **🔴 NEXT (em): curate L1 over-cap GẤP** — reviewer **45KB** + cicd-monitor 37.6KB + inv-codebase 35.6KB (keep-floor-hit → manual SPLIT/condense; archive-gate A7 GATE PASS 186/186 integrity OK) + FD 26KB/test-spec 27.7KB WATCH strike-1. → log `2026-06-19-S77-pe-ux-batch-10-deploy.md`. · **Prev S76** — **PE ngân sách MA TRẬN 3 cột (Dự án|PRO|CCM) + bảng lưới `
` viền-ô + badge quyền-NS theo role** — anh Kiệt FDC + chị Trà Sol, go-live; anh giao `/ultra-on` "step-by-step + workflow-review-per-step, hoàn chỉnh rồi deploy". **3 commit prod-verified:** `e33481e` (feature Run #318 — Mig 56 + ma-trận-3-cột + badge designer/flow, `BhFDF9IJ`/`BAkuRl3C`) → `21d1f4e` (bảng lưới `
` theo phản hồi anh, Run #319 **`jOqxW4-p`**/**`DbsznVvR`**, smoke 3×200). **Part 1:** PRO sửa cột PRO (canEditPro), CCM sửa cột CCM (canEditCcm), Dự án FE hiển-thị-only; Mig 56 +ProInitial/ProAdjust additive + data-migrate ProEstimate→ProInitial (4 rows prod). **Part 2+3:** badge "✎ NS PRO/CCM" cạnh approver (suy từ role, display-only no-authz) ở Workflow Designer + flow Duyệt NCC. Test 339→**344** (+5). **2 workflow review** (Part 1 PASS + Part 2/3 PASS) — reviewer bắt **race mất-dữ-liệu** Part 1 (impl self-review sót) → vá `useIsFetching` 2 app, **gotcha #70 NEW**. Lessons: flex+gap KHÔNG ra "bảng" → phải `
` viền-ô · workflow-review-flaky (2-3 lane empty #53) → em-main self-gate lane rỗng. **NEXT:** 🔴 curate L1 over-cap (reviewer **45KB** + inv-codebase 35KB keep-floor-hit manual-condense; cicd 29KB + test-spec 28KB strike-1). → log `2026-06-19-S76-pe-budget-matrix-table-grid.md`. · **Prev S75 (2026-06-18)** — **Harness-11 adopt: engine bộ-nhớ-và-governance TỰ-BẢO-TRÌ + 2 double-check** — anh giao `/check-email AI_INFRA` + `/adap-apply` (mỗi stage workflow-review) + double-check ×2 + finalize report + push + session-end. em main + **5 Workflow** (audit `wf_7fdc3bd5-930` → implement `wf_c5e5844e-7c1` → review `wf_d7ca1ff8-942` → double-check `wf_a0b68d2f-30e` → checklist-verify `wf_39cd4cbe-f07`). **0 production code.** Built `scripts/governance-detectors.ps1` (C1 broken-pointer + C2/B3 staleness + C3 vocab-fork + C4 self-exclusion + C5 resolve, NO-API DÒ+FLAG, runtime **26 flag** bắt drift thật, C4 0-self-match) + `scripts/memory-archive-gate.ps1` (PHẦN A hysteresis 0.85/keep-floor 5/2-strike/A7 NO-API 186/186) + `docs/governance/harness-11-engine.md` canonical (3-tier D5/D6/D7 EXPLICIT + one-direction-lock D8) + **B1 ×11 count→pointer `docs/STATUS.md`** (drift mig53→55/test306→339/gotcha68→69/table93→88 RESOLVED) + cadence-wire session-start §2.1.3 (D1) + session-end §L.b(c) (D2) + agents/README Upgrade S75. **completeness-gate FORMAL ĐẠT** (B 4/4 + C 5/5 + D 11/11 đủ-trọn, A 🟡 tailored — A6 runtime cần 2×-Apply legit-by-design). **gotcha #30 reinforced** (box-glyph ├└─ KHÔNG vào .ps1 — PS5.1 -File ANSI mojibake, KỂ CẢ qua Edit render-normalize; detector pure-ASCII verified). 3 commit `e70c046`+`ae957c4`+`aa09e99` pushed + adap-report + email ai_infra (`2316773229f2`). **State THẬT GIỮ NGUYÊN: Mig 55 · 88 bảng · 339 test · gotcha 69 · menu 54 · bundle `BYF5vIMJ`/`CB-tiRxd`.** ⚠️ restart CLI (cadence §2.1.3/§L.b + ef-core skill). 🔴 curate-debt: reviewer 38.8KB + inv-codebase 31.5KB + cicd 26.8KB over-cap (archive-gate confirm; reviewer+inv keep-floor hit → manual split). → log `2026-06-18-S75-harness-11-adopt.md`. **Prev S74** — **PE ô "Ghi chú từ CCM" ngân sách gói thầu (Mig 55)** — anh forward 2 luồng Zalo (Trà Sol + Kiệt FDC) "CCM cũng giống PRO cho nhập + ghi chú, hiện 0 hết" → em-main BE+Mig55 ∥ implementer-frontend FE 2 app SHA-mirror ∥ test-specialist (chết rate-limit → recover-disk). 2 fork anh chốt qua AskUserQuestion: **thêm CcmNote (Mig 55)** + **GIỮ phân vai CCM** (CostControl/Admin). Entity `PeWorkItemBudget +CcmNote` mirror ProNote · `UpdatePeBudgetCcmCommand +CcmNote` absolute-set role-gate fail-closed · DTO+controller+mapping · FE dòng "Ghi chú từ CCM" gate `canEditCcm` (sau V0/hiệu chỉnh, absolute-set đủ 3 field). Mig 55 additive-nullable sạch (no #63). Test 334→**339** (+5 CcmNote). **Chẩn đoán "0 hết không nhập":** tài khoản thiếu role CostControl (KHÔNG bug) → UAT bằng CCM/Admin. commit `8655ebf` push main (cicd **Run #315 PASS** ~4m54s — Mig 55 applied prod, bundle admin `BYF5vIMJ`/user `CB-tiRxd`, smoke 4×200). Lessons: controller call-site thiếu arg sau +param record (grep+vá, #65 bắt) · agent-kill-529 recover-disk no-re-spawn · PS here-string commit-msg trong if-block mis-parse → `git commit -F`. → session log `2026-06-18-S74-pe-ccm-note.md`. **Prev S73** — **Mig 54 PE giá đề xuất PRO/CCM + CEO chọn giá chốt + CCM duyệt-done ô-tích (anh Kiệt FDC — go-live so-sánh-giá thứ Hai 22/06)** — em main + 6 sub + 2 review-workflow. **2 commit prod-verified:** `1d86abc` (feature, cicd Run #313 PASS — Mig 54 + bundle admin `OlNyG9OD`/user `DSzSLVtL`) + `6aa4dcb` (FE empty-candidates guard fix). **BE:** Mig 54 `AddPeSuggestedAndApprovedPrice` 5 cột additive-nullable (ProSuggestedMin/Max·CcmSuggested·ApprovedPriceAmount·Source) + 2 setter role-gate PRO/CCM (Forbidden fail-closed mirror budget) + ApproveV2 **③ AUTO→OPT-IN** (`finalizeByCcmDelegation` ô-tích, gỡ auto-threshold S69) + **① bind giá chốt** mọi nhánh DaDuyet (human bắt-buộc-chọn, isSystem-miễn) + DTO +7 field/capability. **FE 2 app SHA-mirror:** PeWorkflowPanel (bộ chọn giá + ô tích CCM + fix empty-candidates) + PeDetailTabs `SuggestedPriceRows` + types +7. **Test 306→334** (+28). **2 workflow review (bài học):** R1 schema-force CHỈ **1/4** lane returned (flaky no-StructuredOutput) → R2 **free-text 2/3 PASS** — rủi ro #1 FE empty-candidates = **UNREACHABLE** (submit-guard `:194` chặn gửi-duyệt khi winnerQuoteTotal≤0). → review fan-out dùng **free-text / hmw RUN-TRACE**, KHÔNG ép-schema inline. **Governance honest:** em lệch mandate auto-Workflow (mode-ON) + chỉ khai khi anh hỏi → **cam kết báo-TRƯỚC-khi-lệch**. Run-trace `runs/2026-06-18-mig54-pe-review/` (custom-inline, bù post-hoc). → session log `2026-06-18-S73-pe-gia-de-xuat-ccm-done.md` pending. · **Prev S72** — **Harness-10 flat-refine + checklist-v2 adopt (re-audit 3-workflow) + sleep NO-OP** — em main + 9 sub qua 3 Workflow (audit `wf_13868efb-ea7` → implement `wf_ac43b5ff-7d1` → review `wf_d482e10d-5dd`, mandate Harness-9 B1+B2). Anh chỉ "sisters làm tốt mỗi SE thiếu" → re-audit đo vs canonical: **SE BEHIND Harness-10 flat** (run-trace còn SUBFOLDER, canonical=FLAT) → migrate `hmw.js` (`:103` sub-md/→flat + `:52` schema + **H4.5→H8 doc-drift**) + `workflows/README` full-rewrite + `runs/README` + session-start/end + `agents/README` Upgrade S72 + `_ledger`; **5 run cũ S71 GIỮ subfolder** (C8 dual-accept). +2 broadcast 06-18 adopt (checklist-v2 + h10-flat-detector-refine). +`/sleep-recovery-memory-l2` port (A8, §J2-tailored SE-only, floor intact, live skill). **detector refine-b TAILORED-OUT** (SE Workflow-tool no-CLI-bypass; containment git-diff+tracked+orphan-scan G-015). **REVIEW (B2 dogfood) bắt 2 lỗi IMPLEMENT-self-assess sót** (hmw.js:52 schema-stale + sleep-cmd auto-check un-wired overclaim) → fixed (auto-check **WIRED thật**: budget.json `+last_sleep_at` + session-start:78 + session-end:48, grep-verified). em-main containment-check tự bắt 1 reviewer residual-write (raw-Workflow KHÔNG hmw.js writeGuard → reverse-finding #4) → revert. **B3 self-correct:** S71 report path tắt `runs/`+"14" → thật `.claude/workflows/runs`=22. **Sleep `all`=NO-OP** (5/9 empty-archive + 4/9 đã-gisted → 0 compressed; `last_sleep_at`=2026-06-18). **0 production code, state THẬT GIỮ NGUYÊN.** adap-report `2026-06-18-Governance-harness-10-flat-refine-checklist-v2` + email ai_infra (`5f511fe5c0f2`). ⚠️ **restart CLI** activate FLAT-runtime hmw.js + wired sleep-check + sleep-recovery skill. 🔴 **NEXT (em):** curate investigator-codebase L1 **28973 OVER** (audit-trail) + watch frontend-designer/test-specialist near-cap. → session log `2026-06-18-S72-harness-10-flat-refine.md`. **Prev S71 — Harness-10 adopt: tracked run-trace folder convention + checklist 9-10 self-verify** — em main + 3 Workflow (invest `wf_9c2cd2cd-2e7` → implement `wf_e4e46725-231` → review `wf_636bc95b-939`) theo mandate Harness-9 PART 2. **0 production code** (governance/workflow only). Migrate `.claude/workflows/wave-*/` gitignored → `runs//` **git-TRACKED** (run.md + sub-md/ + harvest/) + `_ledger.md` 2-nhịp + 3-layer anti-miss (L1 em-main@P1 ledger-check / L2 session-start orphan-scan / L3 session-end close-gate **idempotent-VERIFY-not-re-APPEND**) + **containment model shift** (Harness-2 B6 "mọi tracked-change=vi-phạm" → Harness-10 "tracked-change NGOÀI run-folder + code-disjoint=vi-phạm"; run-folder TRACKED → HIỆN git-diff = audit trực-tiếp). hmw.js wave→run-trace (accept `args.run`, alias `wave`; path `sub-md/`; `node --check` PARSE-OK). **Review độc-lập (R2+R3) bắt C5 L1 over-claim** (doc nói hmw.js prompt-builder emit L1 reminder nhưng grep engine=0 → engine no-fs → fixed path-a: L1 = em-main @P1 convention) — dogfood mandate B2 đúng (1-workflow-tự-chấm sẽ bỏ sót). **checklist 9-10:** Part A (Harness-9 memory) + Part B (adap 2-workflow) ĐÃ done S70; Part C (Harness-10) MỚI 8/8. dogfood: 3 run-trace folder TRACKED đầu + 3 entry ledger. adap-report `2026-06-18-Governance-checklist-harness-9-10` + email ai_infra. **State THẬT GIỮ NGUYÊN: Mig 53 · 88 bảng · 306 test · 68 gotcha · menu 54 · bundle admin `BgNCjwsG`/user `CBvh0vtf`.** + `CLAUDE.md` test-flush 263→306 (pre-existing uncommitted, resolve H1 stale-flag). ⚠️ restart CLI activate hmw.js RUN-TRACE runtime + (carry S66/S70) §2.1.2 budget-audit/reviewer-Cat-6/H8-inherit. ✅ **curate-debt CLOSED S71** (FINALIZE double-check `wf_73de399d-753` + curate `wf_f32987b8-03f`): reviewer 36.7→24.8KB + investigator 29.8→23.2KB (both <25600 cap, archive +N -0 0-byte-loss) + reviewer-gist gen:2 + 3 user-memory G2/G3 + budget.json re-measure. Race root-cause fixed cấu-trúc (hmw.js RUN-TRACE writeGuard). → session log `2026-06-18-S71-harness-10-run-trace.md` (pending). **Prev S70** — **Harness-9 adopt: L2 archive dark-matter recovery + adap 2-workflow mandate** — em main + 3 Workflow (investigate `wf_be952f3c-97f` → implement `wf_a58e0d15-beb` → audit `wf_9520d8cd-4fe`) + 2 monitor bootstrap. **0 production code** (governance/memory only, commit `f36aab8` pushed). 4 over-cap sub-agent (cicd-monitor/investigator-codebase/reviewer/implementer-backend) curate L1→L2 + `archive/_INDEX.md` (mục-lục con-trỏ **substring sha-keyed**, Ctrl-F fallback) + `.gist.md` (nén 4-field distill-gen:1, verbatim FROZEN) → **cả 4 < 25KB auto-inject cap** (P1 curate-debt CLOSED; ~240KB archive hết RAG-dark). PART 2/3 process-mandate codify (adap-apply + agents/README Upgrade S70 + session-start §2.1.2 budget-audit). **0-byte-loss git+sha verified** (Stage C audit + em-main self-gate khi 2 reviewer no-StructuredOutput). +`memory-budget.json` (seed-by-measure) + `scripts/measure-agent-memory.ps1` + `.ragignore` + doc-drift 4-cite flush. adap-report + email-back ai_infra (body-hash `7c07b716e775`). **State THẬT GIỮ NGUYÊN: Mig 53 · 88 bảng · 306 test · 68 gotcha · menu 54 · bundle admin `BgNCjwsG`/user `CBvh0vtf`.** ⚠️ restart CLI để activate session-start §2.1.2 + pending H8 inherit + reviewer Cat-6. → session log `2026-06-17-S70-harness-9-l2-recovery.md`. **Prev S69** — **Văn phòng số (E-Office) port + golive + PE cờ gấp/ngưỡng CCM — 4 deploy prod-verified Run #305→#308, HMW-mode ON, 2 workflow fan-out + ~14 spawn**: foundation PURO (shared PageHeader/KpiCard/WidgetCard + Dashboard 2-cột + sync fe-admin index.css đóng drift S66-S68) #305 → **re-skin TRỌN 10 page** PURO layout + CSS Hồ sơ NS, phẫu-thuật-giữ-100%-logic (reviewer verify api/queryKey byte-identical) #306 → **Office golive public** `SeedAllRolesOfficeModulePermissionsAsync` read+create 16-key allow-list mọi role (mirror S65 pattern, chạy SAU revoke; excluded Off_PhongHop_Manage/Off_AttendanceReport/Off_ChamCong giữ ẩn; cicd DB-verify 16/16×13 role) #307 → **PE cờ gấp PRO/CCM + CCM duyệt-final theo ngưỡng giá trị** Mig 53 (anh Kiệt FDC sau họp sếp) #308. **State THẬT: Mig 53 · 88 bảng · 306 test (45D+261I) · 68 gotcha · menu 54 · bundle admin `BgNCjwsG`/user `CBvh0vtf` Run #308.** 2 gotcha NEW (**#67** Tailwind accent palette thiếu-stop vỡ-màu-im-lặng · **#68** stale-diagnostic-background-agent). 2 truncation #53 (impl-backend positional-record + impl-frontend) → em main recover-disk + self-gate (cả 2 build PASS sau-cùng). C (sau duyệt → chuyển phiếu đến dự án) chờ anh Kiệt spec form. → session log `2026-06-17-S69-vanphong-golive-pe-urgent-threshold.md`. **Prev S68** — **Hồ sơ NS header chi tiết NV: làm nổi bật + fix tên render đen→trắng** — em main solo, 3 commit (2 FE `6983609`+`37752eb` · 1 docs `11bc96d`), 2 deploy prod-verified Run #303-304 (anh UAT realtime): tên `text-xl extrabold`+drop-shadow · dòng meta `text-[13px] font-medium` trắng-đậm · badge pill **màu theo trạng thái** (#303); anh báo "tên đen nền xanh ko nổi bật" → diagnose **rule `h1-h4{color:#0b1220}` viết NGOÀI `@layer` thắng `text-white`** (Tailwind v4 unlayered > all layers, **gotcha #66 NEW**) → ép `text-white!` + thu nhỏ `text-lg` (#304, grep dist confirm `!important`). Bootstrap: 2 monitor RE-REPORT CLEAN + 2 doc-drift fix (dep-audit 64→65 · root CLAUDE 263→286, H1 flag). **State THẬT: Mig 52 · 88 bảng · 286 test · 66 gotcha · menu 53 · bundle admin `CNUv1jxY`/user `CpOskeS1` Run #304.** ⚠️ curate-debt P1: cicd-monitor **44.1KB** (worst). **Prev S67:** **buổi sản phẩm LỚN, 6 deploy prod-verified Run #297→#302** (anh + anh Kiệt FDC UAT realtime, HMW-mode ON): fe-user Hồ sơ NS đồng nhất font + chữ đen→**xanh đậm `brand-800`** (#297 `ab4e681`) · **fe-admin mirror master-detail** + accent tokens index.css [đóng pending lớn nhất HRM go-live, page SHA256 ×2] (#298 `292d64d`) · **+23 test-after HRM** [Dept cycle-guard · PE HoSoLink absolute-set · HRM-perm seed] → 263→**286** (#299 `bcd619d`) · **list flex-row gọn** [bảng 3-cột→flex-row, `overflow-x-hidden` → hết tràn ngang rail] + đồng nhất cỡ chữ [18/14/13/11px] ×2 app (#300 `91aaf05`) · **PE Link hồ sơ auto-detect** `http(s)`→hyperlink/`O:\`→Copy (#301 `6df1b2d`) → **render link `file://` bấm-thử** + Copy (#302 `536dd6b`). **Workflow research 3 investigator-api** (auto-mở `O:\` từ web): default browser CHẶN https→file://; **chỉ Edge GPO `IntranetFileLinksEnabled`** (Edge-only, Intranet Zone, 1 GPO domain zero-per-machine) = one-click thật — Chrome không có; .url-download zero-install nhưng 2-click. **State THẬT: Mig 52 · 88 bảng · 286 test (45D+241I) · 65 gotcha · menu 53 · bundle admin `CcrZqfht`/user `DniDFUB_`** (#302). test-specialist truncated return #53 → em main recover-disk (3 file test đủ + 286 verify); 0 production bug. ⚠️ curate-debt: cicd-monitor 39.8KB + inv-codebase 39.4KB over-cap. **Prev S66** — **session-end closeout em-main-solo, 0 product-sub:** adopt **Harness-8 all-inherit** (7 sub demoted `claude-opus-4-8`→`inherit` → cả 11 = inherit, gỡ two-tier Harness-4) + **cicd-monitor L1 curate 86.8→28.9KB** (byte-exact sed → `archive/2026-06.md`, incl #291 forensic) + **ef-core skill doc-flush Mig 50→52** (H1 drift, +Mig 51/52 rows) + check-email AI_INFRA (**0 thư mới se-directed**). ~17 file docs/gov/config, **0 production code** → state THẬT GIỮ NGUYÊN: **Mig 52 · 88 bảng · 263 test · 65 gotcha · menu 53 · bundle admin `BDwV5d0X`/user `DbVv6rsf`**. ⚠️ **Restart CLI** để H8 runtime (frontmatter no hot-reload) + reviewer Category 6 (S64 pending). adap-report `2026-06-16-Governance-harness-8-all-inherit-workflow-fastest` + email-back ai_infra (hash `fa7f690d` round-trip MATCH). Prev S65 — **HRM go-live: public Hồ sơ Nhân sự + trang master-detail giống NamGroup + Department hierarchy + PE Link hồ sơ**, ~6 deploy prod-verified Run #289→#295, anh + anh Kiệt FDC UAT realtime): (1) **public Hồ sơ Nhân sự mọi role** — `SeedAllRolesHrmProfileReadPermissionsAsync` grant CanRead `Hrm`+`Hrm_HoSo` 13 role chạy SAU revoke S58 (upgrade-only; EmployeesController policy-based `Hrm_HoSo.Read` mở luôn API không hardcode Roles), giữ ẩn Dashboard NS, Run #289; (2) **redesign màu foundation fe-user** — accent palette teal/violet/amberx/greenx + `.app-gradient-brand`/`.card-accent`/`.icon-chip` + heading 700, brand #1F7DC1 + Be Vietnam Pro giữ, Run #290; (3) **Department hierarchy** Mig 51 `AddDepartmentParentId` (ParentId loose-Guid no-FK + `GET /departments/tree` ráp cây in-memory + rollup count theo `User.DepartmentId` + cycle-guard HashSet) + picker "Phòng cha" fe-admin (self-service org chart) + Update cycle-guard, Run #292; (4) **Hồ sơ Nhân sự master-detail giống NamGroup** — `EmployeesListPage` rewrite: 3-panel→**2-cột** (cây tổ chức gốc "SOLUTION COMPANY" + list chồng TRÁI · chi tiết 5 tab PHẢI) + tô màu accent, giữ 100% 5 satellite CRUD (16 endpoint), Run #293/#294/#295; (5) **PE mục "e. Link hồ sơ"** Mig 52 `AddHoSoLinkToPurchaseEvaluation` (`HoSoLink string?` hyperlink NAS + `` target_blank rel-noopener + null-safe) + rename "Dự trù PRO"→"Ngân sách PRO" (row+badge) ×2 app SHA256-mirror, Run #293. **State THẬT: Mig 52 · 88 bảng · 263 test (45D+218I) · 65 gotcha · menu 53 · bundle admin `BDwV5d0X`/user `DbVv6rsf`** (Run #295 `456c7a7` Employee-refine — user rotate `CZfo_PFZ→DbVv6rsf`, cicd PASS). **🔥 Workflow fan-out chạy THẬT lần đầu** (`pe-hoso-link-rename-pro` BE∥FE→review) — parallel disjoint-file OK, NHƯNG FE+reviewer return-RỖNG #53 → em main recover-disk + self-gate (bắt badge "DỰ TRÙ PRO" sót rename); **verdict: fan-out cho parallelism nhưng reviewer-stage không tin được trong harness này → verify-heavy task vẫn tự gác = tương đương spawn lẻ** (`feedback_workflow_fanout_reliability`). gotcha **#65** NEW (build csproj con ≠ `dotnet build slnx` gồm tests → miss test-compile khi đổi chữ ký record command → CI CS7036 Run #291 FAIL-gated). **Prev S64** adopt **Harness-7 writing-quality floor** — em main solo, commit `6afde19` docs/gov-only, 0 sub spawn: `rules.md §1.1` outward-VN-full-grammar + reviewer Category 6 + adap-report + email ai_infra; broadcast body-hash `a4580ea9` verified-MATCH **KHÔNG mis-stamp** [false-mismatch = gotcha #61 PS5.1 UTF-8 decode của em]. Prev S63 docs-closeout bù S60/S61/S62 — **State THẬT: Mig 50 · 88 bảng · 263 test (45D+218I) · 64 gotcha · menu 53 · bundle admin `0xKYGhhf`/user `C81ZdG9G` Run #286**; S60-62 = PE ràng buộc gửi-duyệt + bypass drafter (S60) · gỡ "Từ chối" (S60) · Mig 50 ngân sách per-gói-thầu Excel anh Kiệt + XÓA module Budget cũ (S61) · vượt-NS cảnh-báo-mềm cho lưu (S62); + reconcile stray reviewer cwd-misland; session log `2026-06-12-S60-S62-pe-budget-workitem-softwarning.md`). Prev Session 59 ( **10 đợt ship prod-verified: 8 Run PASS + 2 cancelled-supersede-benign #273→#282** (run_number API — dải đếm khác #38x S58, cùng pipeline; 2 cancel = push-đè khi UAT góp ý realtime, ancestor-verified): (1) **wipe transactional testing data** theo anh Kiệt FDC — 10 PE + 7 HĐ [DEMO] + 64 notif + 1 AwV2 cũ inactive = 0, reset PeSeq/CtSeq → phiếu thật đầu tiên team tạo chiều nay = **PE/2026/A/001** ✓, app-recycle KHÔNG resurrect (DemoSeed gate held), uploads orphan dọn (`56882ac` #273); (2+3) **PE tree Panel 1 chốt 4 tầng "📅 Năm > 📁 Dự án > 🧱 Hạng mục > Phiếu"** (anh chốt follow-up sau bản gộp "Dự án (Năm)"; `yearGroups` useMemo, expand-key v3, FE-only — list DTO đã có workItemName S57bis) (`0eafcd3` #274); (4) **dọn 15 mã hạng mục demo tự chế** theo chị Trà Sol "xóa cái đám phần thô phần hoàn thiện… MÀ ANH TỰ ĐẺ RA" — WorkItems 86→**71**, GỠ HẲN block seed demo khỏi DbInitializer, đối chiếu 71/71 khớp bảng PMH từng dòng (`bbd1554` #275, bundle frozen BE-only); (5) **rename 71 mã đúng format PMH anh Kiệt chốt** "MÃ CV gồm chữ MEP-SUB-1 rồi tên 1 MEP Sub MEP (Full) — đúng kiểu vậy" → `MAT-n`/`SUB-n`/`MEP-SUB-n`/`MEP-EQU-n` + Name "STT nhóm tên"; **DB-trước-code-sau** (gotcha **#62** NEW — seed per-code idempotent, sai thứ tự = 142 rows) + sqlcmd `-f 65001` (gotcha **#61** NEW — verify data qua API JSON, KHÔNG tin console mojibake) + FE sort numeric ×3 ×2 app (`c869d26` #276); (6) **UAT 6 vòng 11 điểm**: NEW **`ui/SearchableSelect`** combobox gõ-lọc BỎ DẤU (fold NFD — Hạng mục/Dự án/NCC) + auto Địa điểm từ Project.Location + điều khoản TT Textarea đa dòng (`faed59f` #277) · anh chốt: **ẩn cả Trả lại+Từ chối khi người duyệt = người soạn** (drafterUserId match) + **quick-add NCC ngay form** (SuppliersController POST hạ → any-auth, PUT/DELETE giữ khóa — cicd authz probe live 4/4: 401 unauth/201 nv.test/403 delete/cleanup) + upload multiple files ×2 chỗ (`9c330d2` #278) · vòng 3-6 realtime (`f21c55d` #279-cancelled / `69997da` #280 / `80b64dd` #281-cancelled / `792c030` **#282 FINAL**): **bảng NCC table-fixed** width từng cột (file dài hết vỡ layout) + **bỏ ô "Tên" ngân sách nhập tay** (chỉ còn Số tiền, hasManual detect theo amount) + **GỠ field "Điều khoản thanh toán" khỏi TẤT CẢ form phiếu** (cột per-NCC + display phiếu cũ GIỮ) + **bỏ nút "+ Thêm hạng mục"** (1 phiếu = 1 hạng mục header). Bundle FINAL admin **`B1DtNT9C`**/user **`D6uF3Mln`** (Run #282). Test 240 ×2 local + 8× CI gate. **0/14 spawn truncated** (lần đầu sau nhiều session). → session log `2026-06-11-S59-wipe-tree-pmh-uat-batch.md`. Prev S58 (2026-06-11 — **4 việc prod-verified Run #382/#383/#384**: lock-demo-user fix + tạm ẩn HRM/Office/Cá nhân + Danh mục cuối sidebar + fe-user redesign theo UI/UX guide AI_INFRA. **Việc 1 — lock fix** (Run #382, `5998163` ~3m31s): Run #381 cicd phát hiện S57bis lock = NO-OP (14 email named-person là population Dev-only). Recon dump prod: demo thật = 20 UAT-matrix `{dept}.{nv,pp,tp}@`+`bod.{1,2}@` tạo TAY 05-13; root cause sâu = `DemoUserPassword` 11 ký tự < prod `RequiredLength=12` → `CreateAsync` silent-fail MỌI startup từ trước tới giờ (= root cause "helpdesk inert phòng IT 0 user" S56). Fix: union 20 email + password 12 ký tự. Prod sau deploy: **55 user / 21 active / 34 locked** — 20 UAT + 14 named-person locked ✓, **nv.cao/nv.truong CREATED+ACTIVE (helpdesk S56 RESOLVED)** ✓, 5 real staff created ✓, guard admin/catalog.manager/nv.test/chuong.phan-typo active ✓ (anh chốt 3 quyết định AskUserQuestion). Bundle FROZEN. gotcha **#60** NEW (seed silent-fail vs prod password policy — dump population thật trước khi lock/seed-by-email). +Closeout S57bis residual: gotcha #59 commit, 4 spawn-record on-behalf (H2 4-MISS), H1 5-patch doc-drift, test 240 re-verified local. Prev S57bis (2026-06-11 sáng) — **PE gắn Hạng mục công việc (Mig 49) + mở quyền Pe all-role + menu "Cá nhân" + khóa demo user** (sếp Zalo deadline 15:00): commit `17b23a4` (Harness-4 two-tier runtime-VERIFIED spawn-test 2 chiều) + `dd117b7` (product) → Run #381 PASS ~4m25s. Mig 49 `AddWorkItemToPurchaseEvaluation`: PE.WorkItemId `Guid?` loose-Guid KHÔNG FK vật lý (convention PE — database-agent design) + IX + validator NotEmpty create + FK-guard handler Conflict + UpdateDraft null-safe. FE ×2 app PeWorkspaceCreateView/PeHeaderForm (SHA256 identical)/PeDetailTabs "Dự án – Hạng mục". Pe_* 11 key CanRead+CanCreate mọi role (130 rows/13 role — Pe_* leaf KHÔNG nằm MenuKeys.All, build qua factory). Menu Personal root@30 + Chấm công re-parent + Master write-lock `Admin,CatalogManager` ×3 controller. Test 228→**240** (+12 PeWorkItemGuardTests). Bundle rotate cả 2: admin `CP4CB1ym` / user `BmZ3VHnm`. 2 builder truncated #53 + reviewer die-0-byte ×2 → em main solo vá cross-stack + self-gate. Excel (3) đối chiếu = NO-CHANGE (S55 data identical). Prev S56 — **Pre-golive verify sweep + golive-harden 4 fix — HMW 2-workflow, prod-verified**: commit `a20cde8` → Run #379 PASS ~4m20s. WF1 `pre-golive-verify` 7-stream song song + adversarial → 6 PASS/1 CONCERN/0 blocker = **GO**; key finds = **ops not code** (prod IT-dept 0 active user → helpdesk inert + S43 LeaveBalance lost-update còn nguyên). WF2 `golive-harden` fix 4: **#3** LeaveBalance lost-update→atomic `ExecuteUpdateAsync`+Serializable tx (NO mig, exactly-once nguyên) · **#5** ItTicket authz Forbidden-trước-NotFound (fail-closed) · **#6** DocxRenderer null-guard (2 warn→0) · **#4** Travel/Vehicle ApproveV2 +4 smoke. Test **216→228**. Bundle FROZEN `4SUwDLD8`/`XdKzt9LL` (BE-only). `sys.tables` re-ground **92→93** (cicd ground-truth, Mig 48 col-only). reviewer stage StructuredOutput-fail→em main đỡ cross-stack review (3 diff clean) + bump Serializable đóng MAJOR. gotcha **#58** NEW (EF read-modify-write lost-update→ExecuteUpdate atomic). **2 ops VPS pending** (gán user phòng IT + `tzutil` UTC+7). FE Phase 2 redesign **deferred** (recon ready). Prev S55 — **Nạp master data thật từ Excel + Project +4 cột (Mig 48), HMW-mode ON**: commit `69cb393` → Run #377 PASS ~4m33s, prod-verified. Anh giao file Excel "HẠNG MỤC CÔNG VIỆC DỰ ÁN" → `/ultra-on "workflow làm xong hết"`. Nạp **62 dự án + 71 hạng mục + 3 NCC** vào Project/WorkItem/Supplier qua `SeedRealMasterDataAsync` (per-code idempotent, **UNGATED** → coexist demo, tự lên prod). **Mig 48 `AddProjectMasterFields`**: Project +4 cột nullable (Year/Investor/Location/Package, NO new table). FE ProjectsPage form +4 input ×2 app SHA256 mirror. Test 216 (compile-fix MasterCatalogFilteredUniqueTests +4 null args, no new test). Bundle admin `DmjI8Cmn`→`B-d6893W`/user `YxL_MljK`→`XdKzt9LL` (cả 2 rotate). Prod verify: Mig 48 applied · Projects spot-6/6 · WorkItems VT/TP/MEP/TB=71 · Suppliers 3 · CAL01.Investor="Công ty TNHH Calofic". **2 agent return truncated** (implementer-backend + reviewer, gotcha #53) → em main disk/runtime-recover (build/test/sqlcmd/git truth); cicd verdict-FIRST → PASS clean no-truncate. Data-quality catch: MEP col gộp 2 nhóm + divider "THIẾT BỊ" → split đúng 71/4-category. Provenance `scripts/master-import-data.generated.md`. Prev S54 — **IT staff tự reassign ticket (cross-stack authz, HMW-mode ON)**: 1 code commit `ca4b602` → Run #376 PASS ~4m18s, prod-verified. Cho tổ IT (dept Code=="IT") + Admin reassign ItTicket trên CẢ 2 app. BE: NEW `GetAssignableItStaffQuery` capability endpoint `{canReassign,staff}` + `AssignItTicketHandler` authz Admin-OR-dept-IT (Forbidden) + assignee-must-IT (Conflict) + controller `/assign` hạ `[Authorize(Roles=Admin)]`→`[Authorize]` (handler fine-grained). FE: fe-admin+fe-user ItTicketsPage **SHA256-identical** (REVERSE S53 divergence) gate nút by `canReassign`, dropdown từ `/assignable-staff` (không `/users`). Test 203→**216** (+13 authz guard test-before-merge). NO migration (DepartmentId reuse). Bundle admin `DfCfHUE9`→`DmjI8Cmn` / user `_3S0BPJ2`→`YxL_MljK` (cả 2 rotate). 6-agent fan-out (BE∥FE→test→reviewer→cicd) + em main reconcile stray-memory residual (3 agent ghi MEMORY nhầm `src/Backend/.claude` → harvest về canonical). reviewer PASS 0 blocker (role-string "Admin" chain-verified). Task 1 Phase 9 Ops KHÔNG làm (anh dừng). flag: cicd `sys.tables=93` vs STATUS 92 → monthly audit re-ground.) Prev S53 (gotcha #57 EXT Master Mig 47 + P11-D reassign-UI fe-admin + P11-E menu + database-agent verified-runtime: `44b9e54` Run #260 + `dbf6648` Run #261, test→203, bundle→`DfCfHUE9`). Prev S52 (Phase 11 P11-D+E+F deployed + database-agent adopt, HMW-mode ON): 3 commit — `e9ee97f` (database-agent DB1–DB11 read-advisory, roster 10→11, executed-file CHỜ restart) + `6a66429` Wave 1 (P11-E AttendanceReport+Excel+OtPolicy multiplier + P11-F MaTicket codegen, migration-free) + `dcf76f8` Wave 2 (P11-D ItTicket round-robin assign dept-IT + SLA timer, Mig 46). Test 186→**200**. Bundle admin `DYfjnpY0`/user `_3S0BPJ2` (cả 2 deploy verified curl độc lập — Wave 1 BE 401 wired + Wave 2 /assign 401 + Mig 46 applied health-200). ⚠️ **Session-limit hit giữa Wave 2** → recovery: BE/test verify-on-disk + em main solo FE redo + curl-self-verify thay cicd-spawn (multi-agent resilience, git/disk/prod = source-of-truth). RAG recovered (chunk 2416 rerank live) nhưng stale 05-29. Prev S51: P11-C Vehicle+Driver.) --- diff --git a/docs/changelog/sessions/2026-06-26-S91-golive-wipe-changepw-backup.md b/docs/changelog/sessions/2026-06-26-S91-golive-wipe-changepw-backup.md new file mode 100644 index 0000000..332f528 --- /dev/null +++ b/docs/changelog/sessions/2026-06-26-S91-golive-wipe-changepw-backup.md @@ -0,0 +1,43 @@ +# S91 (2026-06-26) — Go-live day: guide fix + wipe + seed-gate + user-change-password + backup local + +**Mode:** HMW-mode ON · em-main-led (security-sensitive + #53 risk → KHÔNG fan-out lớn, báo-trước) · 4 sub spawn (tooling-auditor + harvest-curator @start · cicd-monitor + test-specialist trong feature). +**Trigger:** anh forward email anh Kiệt SOL-IT "THÔNG BÁO GO-LIVE Trình duyệt So sánh Giá — 26/06, Phase-01 Phòng Mua hàng (PRO) + Kiểm soát chi phí (CCM)". Sau đó: wipe data cũ ("múc nó phát em") → user-change-password ("user chưa tự đổi pass được hả em") → backup local ("sao lưu local tk các thứ để dùng lại"). + +## 4 commit prod-verified (+ backup local) + +### #1 `159b69d` — Guide Word bỏ "Từ chối" + fix caption (docs-only, CI-skip) +Guide `docs/Huong-dan-Duyet-NCC.docx` (đã đính kèm email go-live, phát toàn công ty) còn ghi **"Từ chối" 2 chỗ** (Bước 4 + caption Hình 9) — app gỡ nút Từ chối từ S60, chỉ còn **Duyệt/Trả lại**. Caption Hình 9 còn **mâu thuẫn với ảnh nó chú thích** (ảnh chụp S90 = 2 nút, caption = 3). + 12 caption "Hinh"→"Hình" (thiếu dấu từ S90 ASCII-gen). Sửa qua skill docx **unpack→edit XML→repack** (giữ nguyên 13 ảnh: 1 logo+12 màn). Pack `--validate false` (validator dính bug cp1252 đọc UTF-8 VN, kể cả numbering.xml không sửa). Verify độc-lập **python-docx strict-open**: Từ chối=0, caption=12, media=13. + +### #2 `ba42c59` — Wipe go-live `scripts/s91-wipe-golive.sql` (prod-executed) +anh Kiệt "xóa data cũ" trước go-live. Recon prod read-only → PE=16 · PeWorkItemBudgets=16 · Notifications=94 · Suppliers=26 [19 demo tháng-4 + 3 thật 06-09 + 4 thật 06-23] · Users=17 · Projects=70 · WorkItems=71. **AskUserQuestion ×2 chốt scope:** budgets→xóa hết · suppliers→GIỮ 7 thật (CreatedAt≥06-01), xóa 19 demo (`<06-01`). ⚠️ **S85 cắt theo 06-11 = SAI cho lần này** (4 NCC thật nằm SAU 06-11) → recon-before-change bắt; dùng mốc 06-01 (demo toàn tháng-4, thật toàn tháng-6). **Backup bước-0** `SolutionErp_S91_pregolivewipe.bak` (XACT_ABORT + `-b` abort-trước-wipe). **2 guard atomic:** PE>16→ABORT [chống xóa phiếu thật mới tạo go-live-day] · Suppliers-deleted≠19→ROLLBACK. Kết quả: PE/budgets/notif/contracts→0, Suppliers→7, cascade child→0, PeSeq→0 (**phiếu thật đầu tiên = PE/2026/A/001**). + +### #3 `55494ad` — Gate SeedDemoMasterData (root-cause: chống resurrect NCC demo) +**Phát hiện TRƯỚC khi deploy:** `SeedDemoMasterDataAsync` (DbInitializer.cs:111) chạy **UNGATED** (ngoài mọi `if (!demoSeedDisabled)`) + per-code idempotent → 18 NCC demo (codes thiếu sau wipe) sẽ TỰ Add lại mỗi restart/IIS-recycle → wipe KHÔNG bền (gotcha **#75**). Fix gate sau `DemoSeed:Disabled` (prod=true, mirror Contracts/PE/Workflow demo). Verify config-flow: prod `appsettings.Production.json` render từ `.example` mỗi deploy (KHÔNG file gitignored — gotcha **#76**), `.example` không có DemoSeed → fallback `appsettings.json Disabled=true` → gate hiệu-lực. Deploy → **verify demo_codes=0 qua 2 restart** (binary Last-Modified fresh + count THẬT từ prod, KHÔNG tin cicd-monitor garbled-return). + +### #4 `e81e87f` — User tự đổi mật khẩu (BE + FE 2-app + 10 test) +anh Kiệt "user chưa tự đổi pass được hả em" → đúng (chỉ admin Reset hộ, KHÔNG self-service). AskUserQuestion → build cả 2 app. **BE:** `Auth/Commands/ChangePassword/ChangePasswordCommand` + `POST /api/auth/change-password [Authorize]` — lấy user qua `ICurrentUser.UserId`; `UserManager.ChangePasswordAsync` verify mật khẩu HIỆN TẠI (Identity); fail-`PasswordMismatch`→field `CurrentPassword` "Mật khẩu hiện tại không đúng."; rule ≥12 + khác-cũ (validator); vô hiệu refresh token sau đổi (mirror ResetPassword). **FE 2-app SHA-mirror:** `ChangePasswordDialog` (3 ô current/new/confirm + validate client) wire vào `TopBar` UserMenu ("Đổi mật khẩu" trên "Đăng xuất"). **Test:** +10 `ChangePasswordCommandTests` (đúng/sai pass-cũ keyed-field, <12 boundary, ==cũ, chưa-auth/UserId-null/not-found, RefreshToken-cleared). **Bug self+cross-caught:** CS0104 `ValidationException` ambiguous (FluentValidation vs custom) — em-main bắt qua build TRƯỚC test-specialist return (test-specialist độc-lập bắt CÙNG bug = 2-observer-converge). Full suite **422→431**. + +### + Backup local (anh "sao lưu local tk các thứ để dùng lại") +`backups/SolutionErp_golive_clean_2026-06-26.bak` (21MB, full DB clean go-live state) + `backups/accounts.txt` (17 tk: email·tên·status·phòng·role, clean -W). `.gitignore` +`backups/`+`*.bak`. ⚠️ backups/ trong Dropbox → sync cloud (flag anh). + +## Cách chạy (em-main-led) +Browser-guide định chụp [#74 carry] → Chrome-MCP screenshot **kẹt SPA-SignalR document_idle** (CDP capture/eval timeout) + browser chưa-login eoffice → anh "à thôi tự check" → defer. Security-feature (change-password) = em-main-led BE+FE (báo-TRƯỚC: cross-stack+security-sensitive+#53-risk) + test-specialist (10 test, return tốt) + build/test gate thay reviewer/cicd fan-out. **#53:** cicd-monitor return GARBLED (lạc sang memory-curate) → em-main self-verify từ prod (suppliers=7, demo_codes=0, endpoint 401, binary timestamp). + +## State THẬT (re-ground) +Mig **59** · 88 bảng · **431 test** (45D + 386I, +10 ChangePassword) · gotcha **76** (+#75 +#76) · menu 54 · bundle admin **`DgQyuG7f`**/user **`BmbQon23`** · prod **17 user / 7 NCC / 70 dự án / 71 hạng mục / 0 PE-HĐ** (clean go-live). + +## Lessons +- **Wipe KHÔNG bền nếu không gate re-seed** (#75, `feedback_wipe_durability_check_reseed`): xóa data = triệu chứng; nguồn re-populate (DbInitializer seeder ungated per-code) là gốc. TRƯỚC/SAU prod-wipe → audit seeder. Root-cause>symptom (mirror #73/S85). +- **Deploy render prod-config từ `.example`** (#76): sửa config-gitignored = vô-tác-dụng; effective = appsettings.json ⊕ rendered-.example. +- **inspect-before-change prod**: S85 supplier-cut-date stale → recon thật bắt 4 NCC-thật-sau-mốc (mirror `feedback_prod_config_inspect_before_change`). +- **em-main-led security-feature**: báo-trước-khi-lệch HMW-auto-Workflow (mode-ON) hợp-lệ cho security-sensitive; build/test gate + test-specialist độc-lập = đủ rigor; #53 cicd garbled → self-verify-prod. + +## NEXT +- **🔴 anh:** ⚠️ restart CLI · review guide docx Word · đóng 2 tab eoffice em mở · UAT đổi-mật-khẩu (avatar→Đổi mật khẩu). +- **🔴 em:** curate test-specialist L1 OVER (carry nhiều session) · monthly 2026-07-01 (re-tier mega-line STATUS/HANDOFF bloat · ef-core SKILL Mig→59 · docs/CLAUDE Budget-removed · 3 vocab-fork alias-map). +- **Pending product:** Section B cột Dự-án · Ngưỡng giá CEO Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. + +## §L closeout +- §L.a: 0 RCA hard (CS0104 + seed-resurrect đều CAUGHT pre-prod = gate hoạt động, không phải prod-bug). Wipe/deploy đúng quy-trình (backup+guard+verify). +- §L.b: (a) STATUS+HANDOFF +S91 ✓ · (c) sleep-check `last_sleep_at=2026-06-25` <7d skip · test-specialist L1 OVER carry-flag · (d) spawn-record: tooling-auditor[start/CLEAN-diff] · harvest-curator[start/CLEAN] · cicd-monitor[deploy-verify/return-GARBLED-#53→em-main self-verify-prod] · test-specialist[+10 test/return-OK/bắt-CS0104] · (g) tooling: 0 skill/plugin mới · (h) User-Mark: 4 Active-High display-only, 0 governance-decision-mới = n-a. +- INFRA-ADOPTION: **N/A** (no AI_INFRA infra adoption — pure product/ops + doc). diff --git a/docs/gotchas.md b/docs/gotchas.md index b19a017..365a587 100644 --- a/docs/gotchas.md +++ b/docs/gotchas.md @@ -1280,6 +1280,24 @@ for h in resp.points: # ← .points không phải iterable trực tiếp 3. **Crop:** bỏ chrome trình-duyệt top + taskbar bottom (top=92/bottom=72). ⚠️ Banner CDP **"Claude started debugging this browser"** hiện sau mỗi `navigate` (CDP re-attach), tự ẩn sau vài giây → ảnh chụp ngay-sau-navigate cần crop top≈146; verify nhanh bằng **montage dải-trên 12 ảnh** đọc 1 lần. 4. **Chèn:** `python-docx` `cell...add_picture(width=Inches(6.0))` — A4 content = **6.27"** nên 6.3" TRÀN; dùng ≤6.1". +--- + +### 75. Seed demo UNGATED + per-code idempotent → RE-ADD data đã wipe mỗi restart (wipe KHÔNG bền) (Session 91) + +**Triệu chứng:** Sau wipe 18 NCC demo (`s91-wipe-golive.sql`) cho go-live sạch, định deploy → `SeedDemoMasterDataAsync` (DbInitializer.cs:111) chạy NGOÀI mọi `if (!demoSeedDisabled)` + idempotent per-code (`existingSupplierCodes.Contains(s.Code) ? continue : Add`). Code 18 NCC demo giờ THIẾU (đã xóa) → mỗi restart/IIS-recycle TỰ Add lại → Suppliers 7→25, undo go-live clean. + +**Cơ chế:** wipe = triệu chứng; nguồn re-populate (seed) là gốc. Demo seed cố-ý-ungated (Production.json comment cũ "KEEP SeedMasterData") để giữ data UAT — nhưng go-live cần demo GONE. Khác user test (38): S89 đã gỡ KHỎI MẢNG `SeedDemoUsers` → không resurrect. + +**Fix (root-cause, `55494ad`):** gate `SeedDemoMasterDataAsync` sau `DemoSeed:Disabled` (=true ở prod, mirror Contracts/PE/Workflow demo đã gated). Prod skip → wipe BỀN; Dev (false) vẫn seed local. **Verify:** deploy restart 2× → `demo_codes=0` (binary Last-Modified fresh + count THẬT từ prod). **Quy tắc:** TRƯỚC/SAU mọi prod data-wipe → audit DbInitializer seeder cho ungated per-code re-seed (resurrect). Liên-quan #73 / `feedback_root_cause_over_symptom`. + +### 76. `deploy.yml` render `appsettings.Production.json` từ `.example` template mỗi deploy → prod config KHÔNG lấy từ file gitignored (Session 91) + +**Triệu chứng:** Sửa `appsettings.Production.json` (gitignored) tưởng đổi config prod → vô-tác-dụng; `git add` báo file ignored. + +**Cơ chế:** `deploy.yml:146-154` mỗi deploy đọc `appsettings.Production.json.example` (tracked) → `ConvertFrom-Json` → set `DB_CONNECTION`+`JWT_SECRET` từ secrets → **ghi đè** `C:\inetpub\...\appsettings.Production.json`. File local gitignored KHÔNG bao giờ deploy. Effective config = `appsettings.json` (tracked) ⊕ rendered-Production.json (từ `.example`). + +**Fix/Quy tắc:** đổi prod config = sửa `.example` (tracked) HOẶC `appsettings.json`, KHÔNG file local gitignored. `.example` KHÔNG có `DemoSeed` → prod fallback `appsettings.json DemoSeed:Disabled=true` (đúng fallback đã giữ Contracts/PE gated nhiều tháng → gate #75 hiệu-lực ở prod). + **An toàn prod:** chỉ XEM/scroll/screenshot — KHÔNG bấm nút mutate (Gửi duyệt/Duyệt/Trả lại/Tạo HĐ). Mở `+ Thêm mới` (form `?mode=new`) KHÔNG tạo draft cho tới khi sửa field (auto-save on-edit). **References:** `$env:TEMP\guideshots\capture.ps1` (session-scratch) · `docs/Huong-dan-Duyet-NCC.docx`. Pattern reusable → user-memory `pattern_prod_screenshot_to_docx`.