diff --git a/.claude/agent-memory/cicd-monitor/MEMORY.md b/.claude/agent-memory/cicd-monitor/MEMORY.md index 2e2acaf..c5830c3 100644 --- a/.claude/agent-memory/cicd-monitor/MEMORY.md +++ b/.claude/agent-memory/cicd-monitor/MEMORY.md @@ -32,7 +32,7 @@ Read-only CI/CD + post-deploy verifier SOLUTION_ERP. Polls Gitea Actions API, ve - **Stage 0 RAG infra:** `Get-Service Qdrant` Running + `http://localhost:6333/healthz`. Collection `proj_solution_erp`. - **Stage 1 Push+filter:** `git log -1 --format='%H %s'` + `git log origin/main..HEAD` empty + diff vs paths-ignore (docs-only → SKIPPED-DOCS return). - **Stage 2 Gitea poll** (max 10 iter × 60s): API `.../actions/tasks?limit=5` (NOT `/runs` 404). Match `head_sha` (NOT run_number — cancelled runs shift numbering). ⚠️ `updated_at` stale ~2min (gotcha #46) → cross-check VPS mtime. Foreground-sleep BLOCKED Windows → Monitor-style busy-wait-curl-spin ~30s/iter. -- **Stage 3 Test gate:** baseline **421 PASS** (45 Domain + 376 Infra; S90 #465 — 419 + 2 new `PeDraftVisibilityTests` [phiếu nháp riêng tư người tạo, chặn leak role + V2-approver]; prior S89 #348 419, S88-quad #347 413). CI runs both proj BEFORE build/deploy → status=success ⟹ test gate passed (`tasks` terminal=`status:success`, `conclusion` NOT populated — trust success NOT log-numeric). Local grep undercounts (Theory/InlineData). Phase 9 UAT skip OK. +- **Stage 3 Test gate:** baseline **440 PASS** (45 Domain + 395 Infra; S96 #480 `0c2f9f6` — 436 + new `PeSuggestedPriceSetterAuthzTests` [price-lock-after-submit authz]; prior S96 #479 436, S96/S95 434, S90 #465 421). CI runs both proj BEFORE build/deploy → status=success ⟹ test gate passed (`tasks` terminal=`status:success`, `conclusion` NOT populated — trust success NOT log-numeric). Local grep undercounts (Theory/InlineData). Phase 9 UAT skip OK. - **Stage 4 Post-deploy** (if SUCCESS): auth login bearer (admin + nv.test gotcha #44; token=`accessToken` route `/api/auth/login`) → 3-5 endpoint smoke 2XX (incl new — NEW-endpoint bodyless-POST returns **411 IIS Length-Required pre-auth NOT 404**; re-probe WITH body → 401 confirms wired) → FE bundle hash 2 app (per #69 = real-size-vs-fake not hash-delta) → SignalR negotiate (gotcha #25) → EF mig prod==repo. - **Stage 4.6 (S29 CRITICAL):** sqlcmd seed sample verify post-deploy (NOT chỉ schema). Seed=runtime-row-insert (no history/tables advance) → verify via DB-query (e.g. Permissions count), NOT bundle-frozen-alone. - Discovery: ASP.NET 10 record enum needs numeric input unless `JsonStringEnumConverter` (SOL has NO converter → FE sends numeric). sqlcmd ssh Windows-auth `\\\\SQLEXPRESS` 4-backslash. INFRASTRUCTURE seed MUST run (NOT inside `if(!demoSeedDisabled)`); DEMO seed gated → gotcha #51. @@ -50,9 +50,9 @@ Read-only CI/CD + post-deploy verifier SOLUTION_ERP. Polls Gitea Actions API, ve - **Gitea:** `git.baocaogiaoduc.vn/vietreport-admin/solution-erp` · workflow `.gitea/workflows/deploy.yml` · paths-ignore `['docs/**','**/*.md','.claude/skills/**']`. Anon API works (public repo) when GITEA_TOKEN absent. - **Prod:** api/admin/eoffice `.solutions.com.vn` · SSH `ssh vietreport-vps` (Administrator, id_ed25519) · IIS phys paths: API `C:\inetpub\solution-erp\api` · admin `\fe-admin` · user `\fe-user`. DB `.\SQLEXPRESS`/`SolutionErp`/`vrapp` SQL-auth. **Conn key = `ConnectionStrings.Default` (NOT `DefaultConnection`)**. DB pw = `buKL3TGBkD0wDDbYVw65QeX9` (User Id=`vrapp`; ⚠️ Password field has NO `vrapp/` prefix — S89 login-failed when prefix included; read verbatim from prod `appsettings.Production.json` ConnectionStrings.Default when `$env:PROD_DB_PASSWORD` empty). ⚠️ skill-doc path `C:\inetpub\apps\SolutionErp\Api` STALE. - **SSH→PS quoting (S42):** nested bash→ssh→powershell mangles `$var`/`\"` → use `iconv UTF-16LE | base64` → `powershell -EncodedCommand $B64`; OR write ps1-file + `powershell -File $(cygpath -w)`. sqlcmd over SSH direct `-W -h -1` pw-inline. sys-catalog string-concat → `COLLATE DATABASE_DEFAULT` (collation conflict). -- **Tests baseline:** **421 PASS** (45 Domain + 376 Infra · 0 fail/skip; S90 Run #465 sha a71753b — 419 + 2 `PeDraftVisibilityTests` [draft-private-to-creator, chặn leak role + V2-approver]; prior S89 #348 419, S88-quad #347 413). Phase 9 UAT skip per chunk OK. +- **Tests baseline:** **440 PASS** (45 Domain + 395 Infra · 0 fail/skip; S96 Run #480 sha 0c2f9f6 — 436 + new `PeSuggestedPriceSetterAuthzTests`; prior S96 #479 436, S96/S95 434, S90 #465 421). Phase 9 UAT skip per chunk OK. - **Mig latest repo:** **Mig 59 `20260624084608_AddCcmBudgetPeriodToPurchaseEvaluation`** (S88 #345; PE +1 AddColumn `CcmBudgetPeriodAmount` decimal(18,2) NULL no-backfill — VERIFIED-APPLIED-PROD history-HEAD + col-exists 0-nonnull). Prev Mig 58 `AddPeMultiWinnerAndLevelFinalize` (S87 #344). Path `src/Backend/SolutionErp.Infrastructure/Persistence/Migrations/`. Prod check `sqlcmd __EFMigrationsHistory ORDER BY MigrationId DESC TOP 5`. ⚠️ **`sys.tables` (is_ms_shipped=0) = 88** (S61 Budget-replace DROPPED 93→88 — narrative-93 STALE; when commit touches no schema, 88 correct, don't FAIL on 88. Always cross-ref COMMIT scope vs ambient count). enum-additive (e.g. `ApprovalAttachment=5`) = int-stored NO-mig → expect history NOT-advance + empty `git diff -- '*Migrations*'`. -- **Bundle hash live (S90 Run #465/id=465):** admin js `BXixQDuS`/css `DWQ-DgfZ` · user js `BMgckUPd`/css `Dr0-ikKX` (JS BOTH ROTATED from pre-deploy live `BeyLzf5i`/`CPe970sY` by real fe-src PeDetailTabs ×2; **css FROZEN `DWQ-DgfZ`/`Dr0-ikKX` — correct, FE logic-only [gỡ !readOnly gate] no new utility class**). ⚠️ **#465 ≠ run_number; head_sha-keyed.** ⚠️ pre-deploy baseline was `BeyLzf5i`/`CPe970sY` (Run #350 web.config rotated since #348 `BQq2eTP6`/`dHa64I59` — always re-snapshot LIVE before deploy, brief's stale prev-hash misleads). ⚠️ **PER #69: hash MAY rotate per deploy OR stay frozen if 0 fe-src diff (byte-identical) — SNAPSHOT for THIS run, NOT a frozen baseline.** Real FE ship = diff `fe-*/src` in commit/range + real-size-vs-fake (1.6/1.5MB vs ~919b SPA-trap), NOT hash delta. ASYMMETRIC-deploy framing (S66) RETIRED by #69. +- **Bundle hash live (S96 Run #480/id=480 — JS-rotated real-FE, CSS-frozen):** admin js **`COYAX-yQ`**/css `Bbtesa6B` · user js **`0MU-kb4N`**/css `BmuPz_Dy` (JS rotated from S96 `kL1-N1Zq`/`BRCrr80A` = real PeWorkflowPanel+PeDetailTabs FE change; CSS IDENTICAL S96/S96 = logic+gate-only ⟹ #69-REFINE byte-identical-CSS⟹same-hash). ⚠️ **id ≠ run_number(365); head_sha-keyed.** ⚠️ **PER #69: hash MAY rotate per deploy (real src-diff) OR stay frozen if 0 fe-src diff (byte-identical) — SNAPSHOT for THIS run, NOT a frozen baseline; ALWAYS re-snapshot LIVE pre-deploy (brief prev-hash=hint NOT truth).** Real FE ship = diff `fe-*/src` in commit/range + real-size-vs-fake (1.6/1.5MB vs ~919b SPA-trap) + Last-Modified-in-window, NOT hash delta alone. - **Bearer:** admin `admin@solutions.com.vn/Admin@123456` (full) · UAT `nv.test@solutions.com.vn/TestUser@123456` (Drafter CCM, gotcha #44 check). ## 🔑 Critical config (flag commit nếu tái xuất) @@ -70,15 +70,14 @@ 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`) -- **🟢 S95 #476 (id=476, run_number 362) `18a17f5` GO ~5m08s (adopt Harness-17 memory-self-improve loop — GOVERNANCE-ONLY 0 prod code, CI-triggered-by-.ps1)** — 10-file: 8 docs/md/broadcasts (paths-ignored) + **2 `.ps1` `scripts/governance-detectors.ps1`+`scripts/memory-selfimprove-audit.ps1`** NOT in paths-ignore (`scripts/**.md` ignores MD-under-scripts ONLY) ⟹ CI runs despite 0 .NET/FE impact (✅ path-filter as-designed, NOT docs-skip). `git diff --name-only 707b632 18a17f5` empty for `.cs`/`.csproj`/`.tsx`/`*Migrations*`/fe-src. status=success ⟹ test gate passed (baseline **434**=45 Dom+389 Infra; tasks-API `conclusion:None` even-on-success — trust terminal-success NOT numeric). run 09:15:17→09:20:25+07. Smoke 3×200 (api /health/ready, admin+eoffice root). **FE ship-proof (0 fe-src ⟹ #69 cosmetic-rotate)**: admin JS `CkZ1MjC1`→`0T6vVJST` + user `_-gpX7_Y`→`BGXEVZO6` rotated; **CSS FROZEN** admin `Bbtesa6B`/user `BmuPz_Dy` (0 new Tailwind, mirrors S90/S93). Last-Modified admin `02:19:03Z`/user `02:19:57Z` in-window (02:15→02:20 UTC) + size 1,636,195b/1,542,518b real · SPA-trap fake-hash=200-but-919b-html (large=genuine). **Mig prod=59 UNCHANGED** (0 mig-file ⟹ NO sqlcmd needed, repo-scope sufficient: nothing CAN drift w/ 0-schema + repo-HEAD known-applied). ⚠️ brief prev-hash S94 `CDn40vpV`/`CoPmPBg7` STALE — LIVE pre-deploy already `CkZ1MjC1`/`_-gpX7_Y` (#69 intermediate rotate); **always re-snapshot LIVE, brief prev-hash=hint NOT truth**. 🔑 **GOVERNANCE-ONLY PASS = CI-green + terminal-success + JS-rotate/CSS-frozen-benign(#69) + 3×200 + Mig-59-frozen** — 0 anomaly. -- _(S93 #473 `8ee8f3e` FULL-STACK PE tree-node Dự-án show-CODE-not-name DTO+3-projection NO-MIG baseline-434 · admin JS `xz8FdmLN`→`CDn40vpV`+user `CA8Rla2w`→`CoPmPBg7` rotated, **css FROZEN** `DWQ-DgfZ`/`Dr0-ikKX` logic-only ✅ · Mig59 frozen · pre-deploy-live==brief-prev-hash no-drift; 🔑 css-frozen-on-logic-FE=NOT-fail — full verbatim → git `8ee8f3e` + archive `2026-06.md` via `_INDEX`)_ -- _(S92 #472 `1408d4e` BE-ONLY DbInitializer permission-revoke +5-menu-groups non-Admin VERIFY-PROD-EFFECT baseline-434 · 3-evidence ship-proof Infrastructure.dll+Api.dll in-window + w3wp PID10060 recycle-AT-END-window · **PROD-EFFECT PROVEN**: hidden-key non-Admin CanRead=0, Admin-retained=5, Pe_* untouched=120, leak=0 · ⚠️ **PROD Identity tables NON-prefixed `Roles` NOT `AspNetRoles`** (Permissions cols RoleId/MenuKey/CanR/C/U/D) · JS-rotate-css-FROZEN #69 harmless — full verbatim → git `1408d4e` + archive `_INDEX`)_ -- _(S91 #470 `55494ad` GO-LIVE no-resurrect demo-NCC seed-gate `DemoSeed:Disabled` baseline-422 — pre+post-restart demo-code=0 + 3-evidence dll-mtime+w3wp-recycle; **NEW PATTERN go-live no-resurrect = (a) pre+post DB-count diff + (b) dll in-window + (c) w3wp StartTime ≥ run-window**; integrated-auth `-E`; full verbatim → archive `2026-06.md` via `_INDEX`)_ -- _(S90 #465 `a71753b` FULL-STACK PE draft-private+un-gate-suggested-price js-rotate-css-FROZEN · S89 #348 `1aa3bdb` PE create-contract-1→N multi-winner endpoint-411→401 · S88-quad #347 `73cce1f` PE D1 Block-B re-key+CEO-notify · S88-bis #346 `0d3c0cf` FE-only PE-layout js+css-BOTH-rotate · **S88 #345 `9b1ee0c` = Mig 59 `AddCcmBudgetPeriodToPurchaseEvaluation` AddColumn-no-backfill VERIFIED-PROD** setter PATCH-401 + 7 authz-test → all PASS, full verbatim → git + archive `2026-06.md` via `_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`. +- **🟢 S96 #480 (id=480, run_number 366) `0c2f9f6` GO ~5m25s (PASS) — cross-stack PE 3-commit range (`ba4b8e0`→HEAD): (a) `e657faa` opt-out KẾT-THÚC checkbox [BE+FE `PeWorkflowPanel` 2-app] + (b) `36cbf8b` mark-read stale-noti [BE-only] + (c) `0c2f9f6`=HEAD khóa-sửa-giá-đề-xuất-PRO/CCM-sau-gửi-duyệt [BE `PeSuggestedPriceFeatures` phase-guard + FE `PeDetailTabs.tsx` 2-app gate + test `PeSuggestedPriceSetterAuthzTests`], NO migration (cả 3)** — 3 runs sequential id=478 `e657faa`✅@15:46 → id=479 `36cbf8b`✅@15:52 → **id=480 `0c2f9f6`✅@16:12:59=HEAD=canonical=ship-tất**. Poll running→success ~5m25s (start 16:07:34→16:12:59; busy-wait-spin, `updated_at` fresh-advancing=alive-NOT-hung; foreground-sleep-BLOCKED Windows). status=success ⟹ test-gate green (baseline **440** = 45D+395I, +new `PeSuggestedPriceSetterAuthzTests`; tasks-API terminal-success trust-NOT-log-numeric). 🎯 **FE JS ROTATED (real FE proof — e657faa PeWorkflowPanel + 0c2f9f6 PeDetailTabs 2-app)**: admin `0T6vVJST`(S96)→**`COYAX-yQ`** + user `BGXEVZO6`(S96)→**`0MU-kb4N`** ✅. **CSS FROZEN** admin `Bbtesa6B`/user `BmuPz_Dy` = IDENTICAL S96/S96 (logic+gate-only-FE, 0-style-diff ⟹ #69-REFINE byte-identical-CSS-source⟹same-hash; matches S93/S95/S96 JS-rotate-CSS-frozen; NOT-fail). Real-size-verify (guard SPA-trap): admin JS **1,636,639B** + user **1,542,960B** (control fake-hash `ZZfakehash0.js`→919B text/html=SPA-fallback ⟹ real-bundles-genuine-not-trap); Last-Modified admin 09:11:38GMT=16:11:38+07 / user 09:12:34GMT=16:12:34+07 (=disk-mtime EXACT-match, in-window). **BE ship-proof**: Infrastructure.dll `16:08:35`+Application.dll `16:08:10`+Api.dll `16:10:20` all-in-window · w3wp fresh PID=3184@`16:12:39` + PID=11104@`16:12:21` AT-END-window (pool recycled ⟹ new DLL; 6 w3wp total=3-site pools, 2-newest bracket deploy-end). **Mig prod=59 `AddCcmBudgetPeriodToPurchaseEvaluation` UNCHANGED** (=repo-HEAD; 0-mig-file range `ba4b8e0..0c2f9f6`⟹correct-frozen). Smoke: api ready/live+admin/eoffice-root ALL 200, **auth accessToken 468ch, GET /api/purchase-evaluations 200 items[]-valid (PE-not-broken by price-lock-guard) + /approval-workflows-v2 + /notifications 200**. ⚠️ UI checkbox/chuông/khóa-giá NOT curl-verifiable (login+phiếu-thật → anh Kiệt UAT); scope=deploy-ship+test-gate+bundle-rotate+smoke. 🔑 **REAL-FE-CHANGE PASS = JS-hash-rotate(vs prev-snapshot) + real-size-vs-919b-trap + Last-Modified-in-window + CSS-frozen-OK-if-logic-only(#69-REFINE) + BE-DLL-mtime-in-window + w3wp-recycle + Mig-frozen + smoke-200-payload-valid**. base64-EncodedCommand-over-ssh WORKED this run (CLIXML-wrapper = PS-remoting-noise, `grep -v`; contradicts S96-note base64-FAIL — both methods situational, try base64 first fallback `.ps1`-File S42). +- _(S96 #479 `36cbf8b` GO ~5m40s PASS — PE 2-commit e657faa opt-out-checkbox+36cbf8b mark-read-stale-noti NO-mig · baseline-436 · JS admin`0T6vVJST`→`kL1-N1Zq`/user`BGXEVZO6`→`BRCrr80A` rotated **CSS FROZEN** Bbtesa6B/BmuPz_Dy · real-size 1636619/1542940B · Mig59-frozen · w3wp PID3024@15:52:19 · full verbatim → git `36cbf8b` + archive `2026-06.md` via `_INDEX`)_ +- _(S96 #477 `ba4b8e0` Infra data-only seed import NCC `DONGDUONG` Excel anh-Kiệt NO-mig ungated-idempotent · baseline-434 · 🎯 DONGDUONG-LANDED pre=3→post=4 suppliers total=21 EXACT+1-idempotent Type=2-NhaThauPhu · **FE bundle FROZEN** admin `0T6vVJST`/user `BGXEVZO6` 0-fe-src-diff(#69-REFINE) · Mig59-frozen · w3wp PID13660@14:54:28 recycle+DLL-in-window · 🔑 **DATA-SEED-PASS = pre-vs-post-DB-row-EXACT-delta + DLL-mtime + w3wp-recycle + Mig-frozen + API-payload-contains-row** · ⚠️ sqlcmd `-W` diacritic-LIKE false-NEG use `_`-wildcard; base64-EncodedCommand-FAIL→`.ps1`-File-method reliable — full verbatim → git `ba4b8e0` + archive `2026-06.md` via `_INDEX`)_ +- _(S95 #476 `18a17f5` GOVERNANCE-ONLY adopt Harness-17 — 2 `.ps1` scripts/ trigger CI despite 0-prod-code · baseline-434 · JS→`0T6vVJST`/`BGXEVZO6` rotated **CSS FROZEN** · Mig59 frozen · brief-prev-hash STALE→re-snapshot-LIVE · 🔑 GOVERNANCE-PASS=CI-green+JS-rotate/CSS-frozen(#69)+3×200+Mig-frozen — full verbatim → git `18a17f5` + archive `2026-06.md` via `_INDEX`)_ +- _(S93 #473 `8ee8f3e` FULL-STACK PE tree-node show-CODE DTO+3-proj NO-MIG · S92 #472 `1408d4e` BE-only permission-revoke +5-menu-group VERIFY-PROD-EFFECT [hidden-key non-Admin CanRead=0, Admin-retained, Pe_* untouched, leak=0; ⚠️ **PROD Identity tables NON-prefixed `Roles` NOT `AspNetRoles`**] · S91 #470 `55494ad` GO-LIVE no-resurrect demo-NCC seed-gate [pre+post-restart demo-code=0; **PATTERN go-live-no-resurrect = pre+post-DB-count-diff + dll-in-window + w3wp≥run-window**; integrated-auth `-E`] · S90 #465 `a71753b` FULL-STACK PE draft-private js-rotate-css-FROZEN → all PASS baseline-422→434, full verbatim → git + archive `2026-06.md` via `_INDEX`)_ +- _(S89 #348 `1aa3bdb` PE create-contract-1→N multi-winner endpoint-411→401 · S88-quad #347 `73cce1f` PE D1 Block-B re-key+CEO-notify · S88-bis #346 `0d3c0cf` FE-only PE-layout js+css-BOTH-rotate · **S88 #345 `9b1ee0c` = Mig 59 `AddCcmBudgetPeriodToPurchaseEvaluation` AddColumn-no-backfill VERIFIED-PROD** setter PATCH-401 + 7 authz-test → all PASS, full verbatim → git + archive `2026-06.md` via `_INDEX`)_ +- _(S87 #344 `f1b10e9` FULL-STACK PE CCM 3-fix + **Mig 58 `AddPeMultiWinnerAndLevelFinalize`** backfill-winners=13 VERIFIED-PROD select-winner-411→401 · S86 #343 `ae4f106` BE-only notify-exclude-drafter ship-proof=Infrastructure.dll-Last-Modified · S85 #342 `d4f6021` DOCS+SQL-no-op INVERTED-PASS-when-FROZEN [gotcha #73 TZ + #69-REFINE] · S83 #333 `fc1f19d` BE-only guard-V2-required hash-FROZEN-but-shipped · S78 #330 `7886fd0` enum-attach-on-approve · S76 #318 `e33481e` Mig56-ProInitial/Adjust · S74-bis #315 Mig55 · S73 #313 Mig54-endpoint-401-not-404-probe · S69b #307 Office-golive-seed-16/16 → all PASS, full verbatim → git + archive `2026-06.md` via `_INDEX`)_ +- **Older runs (S83 #325 FE-budget-indent ← S77 #329 banner ← 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/investigator-codebase/MEMORY.md b/.claude/agent-memory/investigator-codebase/MEMORY.md index fa65a20..85b0434 100644 --- a/.claude/agent-memory/investigator-codebase/MEMORY.md +++ b/.claude/agent-memory/investigator-codebase/MEMORY.md @@ -70,18 +70,10 @@ Bearer từ `POST api.solutions.com.vn/api/auth/login` → status matrix expecte ## 📅 Recent activity (compressed — full verbatim → `archive/2026-06.md` via `archive/_INDEX.md`) +- **2026-07-01 Supplier Excel-import GAP audit (anh Kiệt FDC — 30-col "Database NCC & Nhà thầu phụ" cho bên Pro):** ⭐ **Entity CỰC LEAN 9 domain-prop** (`Domain/Master/Supplier.cs:5-16`: Code·Name·Type·TaxCode·Phone·Email·Address·ContactPerson·Note) + 8 audit inherited (Base/AuditableEntity). EF `SupplierConfiguration.cs`: Code len50 UNIQUE-filtered `[IsDeleted]=0`(:24, Mig47 #57), Name200, TaxCode20, Phone30, Email100, Address500, ContactPerson200, Note1000. **enum `SupplierType.cs:3-10` = NhaCungCap1/NhaThauPhu2/ToDoi3/DonViDichVu4/ChuDauTu5 — KHÔNG có "Cả hai/Both"** (FE mirror `fe-admin/types/master.ts:11-16` identical). **GAP 30→entity: 6✅ · 7⚠️collision · 17❌ no-home** — Excel splits Address×2(invoice/office), Phone×2(company/contact), ContactPerson+role; ❌ Fax·Bank-acct×2·Legal-rep+role·GUQ+3-NAS-links·Status/blacklist·Referral·PMH-owner. ⚠️ **S55 seed `SeedRealMasterDataAsync` (`DbInitializer.cs:2768-2787`) crams NĐD/bank/status/category vào free-text `Note`** (:2771-73 TRUONGGIANG/TANPHU/TGN) — proof entity thiếu home. Seed **UNGATED** (called :128, idempotent-key=`Code` :2780) — KHÁC demo-master (`SeedDemoMasterDataAsync` GATED `DemoSeed:Disabled` :117, #75). POST any-auth (`SuppliersController.cs:37-42` S59). FE SHA-identical 2-app (`c1760788`, 253L, 9 fields). **Prod 20 NCC** (Type1×3+Type2×17; type3/4/5 wiped go-live S91 → "Cả hai" enum genuinely-needed). Precedent NAS-link = `PE.HoSoLink nvarchar(1000)` Mig52. Fork→em-main: core-widen ~15col+CaHai=6 vs satellite `SupplierDetail`. → _INDEX pending. - **2026-06-29 S93 Harness-16 MFE ground-truth (WF1 `wf_4c63e1bd`):** ⭐ MFE denominator extraction (deterministic, status-field KHÔNG grep): marks Active(-High) (`ACTIVE-MARKS.md`) + AS-class + Active-Guards (`error-ledger.md` Verified✅) + recurring-gotcha (`gotchas.md`); **dedup-by-AS-cross-reference** (gotcha/guard mà AS-row trỏ `#N`/`AS-N` → gộp) = **29 item**. Per-role sub-coverage: denom = numbered anti-pattern/NEVER trong `agents/.md`; numer = diary `agent-memory//MEMORY.md` (KHÔNG project/user — bẫy trùng-tên H15-v3) match exact-id OR ≥2 content-word sau stop-list (đánh bại leading-verb-9/9-giả). Codified `scripts/mfe-eval.ps1` + engine §H. (WF1 self-write reverted AS-10; em-main harvest single-writer.) → _INDEX. -- **2026-06-25 PE S89 AllowApproverFinalize NOTE feasibility (anh Kiệt FDC — "phiếu kết thúc cấp X không CEO" 3 surface):** ⭐ **GAP CONFIRMED — BE field MỚI cần.** `AllowApproverFinalize` (Mig 58 per-Level bool `ApprovalWorkflow.cs:142`) HIỆN CHỈ expose qua `currentLevelOptions` (CURRENT level only) `PurchaseEvaluationFeatures.cs:981` + DTO `PurchaseEvaluationDtos.cs:123` + FE type `purchaseEvaluation.ts:412`. **`approvalFlow` DTO KHÔNG carry flag**: flow-level record `PurchaseEvaluationApprovalFlowLevelDto` (`Dtos.cs:154-158`) chỉ {Order,Name,Approvers,Status}; build loop `PurchaseEvaluationFeatures.cs:1050-1065` KHÔNG project `l.AllowApproverFinalize`. **LIST DTO KHÔNG có** (`PurchaseEvaluationListItemDto:6-45`, 0 finalize field). **DASHBOARD = reuse list** → cũng thiếu. ⇒ FE detail CHỈ biết finalize khi actor LÀ approver cấp finalize (current). Để render "phiếu này kết thúc ở Bước Y/Cấp X — không CEO" cho MỌI người (kể cả non-approver, list, dashboard) → BE PHẢI expose field mới: bundle `bool EndsBeforeCeo`+`string? FinalizeStepName/FinalizeLevelName` (compute = first Step/Level có AllowApproverFinalize=true trong aw.Steps loop đã load `:985`) + mirror lên list-item + dashboard. BE finalize logic `PurchaseEvaluationWorkflowService.cs:861` (AUTO khi matchingLevel.AllowApproverFinalize → DaDuyet bỏ CEO, NO threshold/role-gate). **FE detail placement (cả 2 app SHA-IDENTICAL** sha `e477c939` PeWorkflowPanel + `49b39404` PeDetailTabs): note nên đặt đầu `PeWorkflowPanel.tsx` flow `
    ` (sau h3 "Quy trình duyệt" :245, trước :256) — banner emerald mirror style :599 existing approverFinalize callout (chỉ trong dialog hiện). Detail đã có precedent: TraLai banner `PeDetailTabs.tsx:370-378`, V2 current-level banner `PeWorkflowPanel.tsx:346-365`. Edge: phiếu **DaDuyet** → đổi copy "đã kết thúc tại , không qua CEO" (past-tense); copy đề xuất "⚑ Quy trình này duyệt tới là KẾT THÚC — không trình CEO". MIRROR 2-app bắt buộc. → _INDEX. -- **2026-06-25 PE FROZEN patchwork audit AREA-6 (FE consumers BOTH apps — multi-winner + mirror-drift + dead-code + #70):** ⭐ Post-Mig58 multi-winner (`isWinner` bool) NOW implemented (supersedes 06-24 "SINGLE" recon). **All 6 PE components + 3 PE pages SHA-IDENTICAL fe-admin↔fe-user** (PeDetailTabs/PeHeaderForm/PeUrgentChips/PeListPanel/PeWorkspaceCreateView/PeWorkflowPanel). type files DIFFER but ONLY badge-tint (-700→-800 ink) + comments (intentional per-app UX, struct fields identical incl ccmBudgetPeriodAmount/isWinner/8 Allow flags). **RESIDUAL single-winner BUG (low):** `PeListPanel.tsx:168` renders `p.selectedSupplierName` (list-card winner label) → BLANK when ≥2 joint winners (BE list-DTO `PurchaseEvaluationFeatures.cs:615,706` projects from `SelectedSupplierId` which BE sets null when count≠1 `PurchaseEvaluationDetailFeatures.cs:431`). List DTO has NO isWinner/winner-list field; detail-view multi-winner correct everywhere (8 detail consumers all converted: computeGiaChaoThau:78, missingForApproval:195, submitChecklist:229, ThongTinChonThau:1949/1970, Section-B row4:1578, CreateContractDialog:2171 fallback `||selectedSupplierName`, HangMucCard toggle:2560). **#70 stale-echo ASYMMETRY:** budget Section-B CCM-period editor gates `ccmPeriodMut.isPending||peFetching` (`PeDetailTabs.tsx:1563`) but PRO sibling row3/row8 `adjustMut` gates `.isPending` ONLY (`:1548,:1649`, NO peFetching) — rapid PRO row3→row8 absolute-set pair can echo stale ev.* pre-refetch (same #70 class CCM guards). 3 peFetching sites exist (945/1268/1736). **Stale comment** PeDetailTabs:2507 references `AddItemDialog` "giữ(dead)" but function DELETED (grep 0 def) — misleading comment only, not dead code. PeWorkflowsPage admin-only = by-design (workflow config not mirrored). → _INDEX. -- **2026-06-25 PE FROZEN patchwork audit AREA-2 (budget matrix + Section B 3-col, Mig 56/59):** ⭐ **BAND-AID CONFIRMED** `SetPeCcmBudgetPeriodCommand+Validator+Handler` (`PeSuggestedPriceFeatures.cs:153-199`) is a BUDGET setter (writes `pe.CcmBudgetPeriodAmount`) MISPLACED in a price-feature file; SHOULD live in `PeWorkItemBudgetFeatures.cs` (where UpdatePeBudgetPro/Ccm sit). Test+comments already self-flag (PeCcmBudgetPeriodSetterAuthzTests.cs:14). ⚠️ **Role-gate ASYMMETRY (intentional, NOT a bug — but inconsistent surface):** CCM budget setters = flat role-gate (CostControl|Admin fail-closed): UpdatePeBudgetCcm `PeWorkItemBudgetFeatures.cs:160-165` + SetPeCcmBudgetPeriod `PeSuggestedPriceFeatures.cs:176-181`. BUT the PRO sibling `/budget-adjust`→`AdjustPurchaseEvaluationBudgetCommandHandler` `PurchaseEvaluationFeatures.cs:349-394` = **phase/drafter/workflow-slot gate** (Drafter when Nháp/TraLai; Approver+AllowApproverEditBudget F4 when ChoDuyet) NOT role-PRO. So "PRO col" & "CCM col" of same Section-B row 3 have DIFFERENT authz models (PRO=drafter-flow on `pe.BudgetPeriodAmount`; CCM=role-flow on `pe.CcmBudgetPeriodAmount`). Both per-PE fields (NOT PeWorkItemBudget per-pair — that's the matrix rows Initial/Adjustment). Section-B **"Dự án" col = intentional FE-only "—"** hardcoded (`PeDetailTabs.tsx:1520,1542,1596,1606`; Domain `PeWorkItemBudget.cs:19` "chưa wire BE — sau mới có người dự án nhập") — documented, NOT a stub-bug. Controller class-level `[Authorize]` only (`PurchaseEvaluationsController.cs:15`) → handler gates ARE the boundary. Tests solid (PeWorkItemBudgetTests 30+ cases, PeCcmBudgetPeriodSetterAuthzTests 7). → _INDEX. - -- **2026-06-24 PE 3-change recon (Lưu Trần/anh Kiệt CCM — multi-winner + budget=0-valid + per-step terminal):** ⭐ (A1 winner) cardinality=**SINGLE** scalar `PE.SelectedSupplierId Guid?` (`PurchaseEvaluation.cs:28`); cmd `SelectPurchaseEvaluationWinnerCommand(PEId,Guid?)` `PurchaseEvaluationDetailFeatures.cs:392` handler `:398-423` (null=clear S85-C5); ctrl `/select-winner` `PurchaseEvaluationsController.cs:167-172`. winnerQuoteTotal=**DERIVED** SUM `Quote.ThanhTien WHERE SupplierId==Selected` 3 sites: read `PurchaseEvaluationFeatures.cs:1089` + submit-guard `PurchaseEvaluationWorkflowService.cs:191` + ccm-delegate `:868`. ⚠️ Quote ALREADY has `IsSelected bool` (`PurchaseEvaluationQuote.cs:15` per-item winner, UNUSED by total). Multi-winner = NEW junction OR reuse IsSelected + change predicate `==Selected`→`IN selectedSet`. FE single `` `PeDetailTabs.tsx:961-991` (NccSelectorRow). (A2 budget=0) BLOCKED 2 layers: validator `.GreaterThan(0).When(HasValue)` create `:55` + UpdateDraft `:233` + budget-adjust `:339`; submit-guard `effectiveBudget<=0`→missing `PurchaseEvaluationWorkflowService.cs:213-216` (effective=`BudgetPeriodAmount??ProInitialAmount` S85-D3). FE `effBudget<=0` `PeDetailTabs.tsx:211,237` canSubmit `:242`. To allow 0: relax `>0`→`>=0` validator + submit `<0` + FE. winnerQuoteTotal-gate SEPARATE `:194`. (A3 terminal) `ApprovalWorkflowLevel` already has 6 per-slot bool flags (`ApprovalWorkflow.cs:104-131`: AllowReturnOneLevel/OneStep/ToAssignee/ToDrafter/EditDetails/EditBudget/**SkipToFinal**); `CeoApprovalThreshold decimal?` on WORKFLOW `:43`. Finalize branches `ApproveV2Async`: terminal `nextIdx>=steps.Count` `:905-916` + ccm-delegate opt-in `:854-891` + skipToFinal `:803-844`. "Approve-ends-here" = NEW per-Level bool mirror SkipToFinal but set Phase=DaDuyet (like ccm-delegate but no threshold). Designer FE = `fe-admin/ApprovalWorkflowsV2Page.tsx`. **schema-decision forks→em-main:** (1) multi-winner storage: reuse Quote.IsSelected vs new PE↔Supplier winner-junction (2) budget=0 vs budget-null distinction post-relax (3) terminal flag scope per-Level vs per-Step + interaction w/ CeoApprovalThreshold (both finalize → ordering). → _INDEX. + +- **2026-06-25 PE AREA-4 UpdatePeDraft edit-preserve audit (gotcha #73-class hunt, FROZEN Mig 59):** ⭐ **LATENT #73-CLASS BUG FOUND:** `UpdatePeDraftHandler` absolute-sets `entity.HoSoLink = request.HoSoLink` (`PurchaseEvaluationFeatures.cs:280`) BUT `PeHeaderForm.tsx` PUT payload (admin+user `:112-120`) OMITS hoSoLink → editing header CLEARS HoSoLink (Mig 52) to null. HoSoLink set separately in `PeDetailTabs.tsx:2012-2020` HoSoLinkRow (re-sends all absolute fields but only IT edits link). Two PUT call-sites to SAME /purchase-evaluations/{id} endpoint are mutually destructive. PeHeaderForm reachable as EDIT (`PurchaseEvaluationCreatePage.tsx:13,26` editId from URL `?id=`, deep-link "Sửa header"). Field table: TenGoiThau/DiaDiem/MoTa/PaymentTerms absolute-set BUT PeHeaderForm re-sends all (safe); HoSoLink absolute-set + OMITTED (BUG); ApprovalWorkflowId/Budget/ExpectedRemaining/WorkItemId all null-safe `if(x is not null)` `:285-297` (S85 fix). ExpectedRemaining absolute-set in budget-adjust `:423-424` (FE sends both, OK). Require-workflow NOT duplicated: CREATE-validator `:48` + submit-guard `PurchaseEvaluationWorkflowService.cs:237` = different lifecycle (coherent defense-in-depth); UPDATE-validator correctly omits. Tests SOLID: PeUpdateDraftWorkflowPreserveTests (3 null-safe cases incl ApprovalWorkflowId+Budget) + PeSubmitGuardAndBypassTests (14) + PurchaseEvaluationDraftGuardTests (8). NO HoSoLink-preserve test (test-gap for the bug). → _INDEX. +- **2026-06-25 PE AREA-3 finalize/price audit (FROZEN Mig 59 Run#346 — patchwork hunt):** ⭐ TWO finalize mechanisms COEXIST + BOTH LIVE (NOT dead): (1) `AllowApproverFinalize` per-Level AUTO config (Mig 58) `PurchaseEvaluationWorkflowService.cs:861-877` + (2) `finalizeByCcmDelegation` OPT-IN param threshold-gated (Mig 54) `:879-915`. AUTO runs FIRST + returns → if both eligible, OPT-IN flag silently ignored (coherent, no double). `finalizeByCcmDelegation` FULLY wired E2E (ctrl `:141`+`:351` · Feature `:474,:526` · IPe…Service:32 · FE both `PeWorkflowPanel.tsx:184,584` ô-tích) — NOT orphan. ALL 3 DaDuyet paths bind giá chốt via `ApplyApprovedPriceOnFinalize` (private static `:956-971`, allow-list `{Ncc,ProMin,ProMax,Ccm}` `:955`): terminal `:933` + AllowApproverFinalize `:863` + ccm-delegate `:901`. isSystem-exempt branch (`:961-964`) = DEAD via public ApproveV2Async (needs decision=AutoApprove but APPROVE-STEP gates Approve; PE has NO SLA-job — only Contract) — tested-only-via-reflection (PeApprovedPriceFinalizeTests:238-295, header DISCLOSES "defensive/dead"). **MISPLACED-CODE CONFIRMED (known band-aid):** `SetPeCcmBudgetPeriodCommand` (Mig 59 Section-B BUDGET setter) lives in `PeSuggestedPriceFeatures.cs:153-199` (a SUGGESTED-PRICE file) — wrong file, own header admits Section-B. Has test `PeCcmBudgetPeriodSetterAuthzTests.cs` (NOT test-gap). DTO `currentLevelOptions` per-NV-discriminated `PurchaseEvaluationFeatures.cs:950-963` = same source as service `matchingLevel` (coherent). 4 finalize test files all present + green-design. → _INDEX. +- **2026-06-25 PE AREA-5 urgent/notify/TZ audit (FROZEN Mig 59 — gotcha #72):** ⭐ (a-TZ) `UtcDateTimeJsonConverter` registered ONLY on `AddControllers().AddJsonOptions` `Program.cs:33-34` — covers REST. ⚠️ **SignalR push BYPASSES it** (`AddSignalR()` no `.AddJsonProtocol`, separate STJ): `NotificationPushInterceptor.cs:77` pushes `createdAt=n.CreatedAt` over `SendAsync`. BENIGN at runtime: `n.CreatedAt=clock.UtcNow`=Kind.Utc (DateTimeService.cs:7) → default STJ writes 'Z' for Utc-kind, FE `new Date(iso)` NotificationBell.tsx:23 OK. Latent: any future SignalR push of an EF-READ (Unspecified) DateTime would skew. NOT a bug now, inconsistency-low. Converter handles DateTime? auto (non-null) — no double-convert. (b-authz) Urgent SET/UNSET branches `PurchaseEvaluationUrgentFeatures.cs:54-73` SYMMETRIC + fail-CLOSED both (`if(!allowed)throw` BEFORE mutate); 14 tests `PeUrgentToggleAuthzTests` cover plain/TP/Admin/drafter×set/unset. No fail-open. Controller class-`[Authorize]` only `:91` → handler IS boundary. (c-notify) Drafter excluded 2 sites: advance `:1138` (`!=DrafterUserId`) + terminal-result KEPT `:1085`; tests `PeApproverNotifyExcludesDrafterTests` RED-on-remove. ⚠️ **POSSIBLE double-notify-then-skip:** submit `:252` LogTransition notifies Cấp-1 approvers (excl drafter+actor) THEN `:260` ApplyDrafterBypass advances pointer + `:650/660` re-notifies new level — if drafter=Cấp1 w/ co-approver, co-approver pinged for a level immediately bypassed. Low-sev (extra ping, not wrong recipient); no de-dup across the 2 LogTransition calls. → _INDEX. +- **2026-06-23 PE UAT recon D2/D4/D5 (anh Kiệt FDC go-live):** ⭐ (D2-urgent authz) `PurchaseEvaluationUrgentFeatures.cs:49-50` BẤT-ĐỐI-XỨNG `isPro=IsUrgent?hasPro:(hasPro&&isDeptManager)` — GẮN=role-only / GỠ=DeptManager-only. NO DrafterUserId match (handler chỉ load entity, never reads DrafterUserId). Để drafter gỡ cờ mình: sửa :49-50 OR `actor.Id==entity.DrafterUserId`. Endpoint `PUT /purchase-evaluations/{id}/urgent` (controller:91). ⚠️ cờ KHÔNG split-by-drafter (PRO/CCM = role, drafter ≠ tất nhiên PRO/CCM). (D5) FE PE-create dropdown=`PeWorkspaceCreateView.tsx:94-104` GET `/approval-workflows-v2?applicableType={1|2}` filter `isUserSelectable`. **Dev DB: PE type1/type2 selectable=0** (6 selectable đều type3-9 Contract/Proposal/Leave/OT/Xe/Ticket NOT PE) → prod UNVERIFIED (SSH-paren-quote-trap). Validator REQUIRE workflow CẢ 2 tầng: `PurchaseEvaluationFeatures.cs:48` create NotEmpty (S83) + submit-guard `PurchaseEvaluationWorkflowService.cs:225` ConflictException. (D4 required) create-validator `:35-57`: Type/TenGoiThau≤500/ProjectId/WorkItemId/ApprovalWorkflowId NotEmpty + BudgetPeriodAmount>0-when-present. Submit-guard `:174-228`: SelectedSupplierId + winnerQuoteTotal>0 + BudgetPeriodAmount>0 + Bảng-so-sánh-attachment + ApprovalWorkflowId. → _INDEX. + +- **2026-06-25 PE S89 AllowApproverFinalize NOTE feasibility (anh Kiệt FDC — "phiếu kết thúc cấp X không CEO" 3 surface):** ⭐ **GAP CONFIRMED — BE field MỚI cần.** `AllowApproverFinalize` (Mig 58 per-Level bool `ApprovalWorkflow.cs:142`) HIỆN CHỈ expose qua `currentLevelOptions` (CURRENT level only) `PurchaseEvaluationFeatures.cs:981` + DTO `PurchaseEvaluationDtos.cs:123` + FE type `purchaseEvaluation.ts:412`. **`approvalFlow` DTO KHÔNG carry flag**: flow-level record `PurchaseEvaluationApprovalFlowLevelDto` (`Dtos.cs:154-158`) chỉ {Order,Name,Approvers,Status}; build loop `PurchaseEvaluationFeatures.cs:1050-1065` KHÔNG project `l.AllowApproverFinalize`. **LIST DTO KHÔNG có** (`PurchaseEvaluationListItemDto:6-45`, 0 finalize field). **DASHBOARD = reuse list** → cũng thiếu. ⇒ FE detail CHỈ biết finalize khi actor LÀ approver cấp finalize (current). Để render "phiếu này kết thúc ở Bước Y/Cấp X — không CEO" cho MỌI người (kể cả non-approver, list, dashboard) → BE PHẢI expose field mới: bundle `bool EndsBeforeCeo`+`string? FinalizeStepName/FinalizeLevelName` (compute = first Step/Level có AllowApproverFinalize=true trong aw.Steps loop đã load `:985`) + mirror lên list-item + dashboard. BE finalize logic `PurchaseEvaluationWorkflowService.cs:861` (AUTO khi matchingLevel.AllowApproverFinalize → DaDuyet bỏ CEO, NO threshold/role-gate). **FE detail placement (cả 2 app SHA-IDENTICAL** sha `e477c939` PeWorkflowPanel + `49b39404` PeDetailTabs): note nên đặt đầu `PeWorkflowPanel.tsx` flow `
      ` (sau h3 "Quy trình duyệt" :245, trước :256) — banner emerald mirror style :599 existing approverFinalize callout (chỉ trong dialog hiện). Detail đã có precedent: TraLai banner `PeDetailTabs.tsx:370-378`, V2 current-level banner `PeWorkflowPanel.tsx:346-365`. Edge: phiếu **DaDuyet** → đổi copy "đã kết thúc tại , không qua CEO" (past-tense); copy đề xuất "⚑ Quy trình này duyệt tới là KẾT THÚC — không trình CEO". MIRROR 2-app bắt buộc. → _INDEX. +- **2026-06-25 PE FROZEN patchwork audit AREA-6 (FE consumers BOTH apps — multi-winner + mirror-drift + dead-code + #70):** ⭐ Post-Mig58 multi-winner (`isWinner` bool) NOW implemented (supersedes 06-24 "SINGLE" recon). **All 6 PE components + 3 PE pages SHA-IDENTICAL fe-admin↔fe-user** (PeDetailTabs/PeHeaderForm/PeUrgentChips/PeListPanel/PeWorkspaceCreateView/PeWorkflowPanel). type files DIFFER but ONLY badge-tint (-700→-800 ink) + comments (intentional per-app UX, struct fields identical incl ccmBudgetPeriodAmount/isWinner/8 Allow flags). **RESIDUAL single-winner BUG (low):** `PeListPanel.tsx:168` renders `p.selectedSupplierName` (list-card winner label) → BLANK when ≥2 joint winners (BE list-DTO `PurchaseEvaluationFeatures.cs:615,706` projects from `SelectedSupplierId` which BE sets null when count≠1 `PurchaseEvaluationDetailFeatures.cs:431`). List DTO has NO isWinner/winner-list field; detail-view multi-winner correct everywhere (8 detail consumers all converted: computeGiaChaoThau:78, missingForApproval:195, submitChecklist:229, ThongTinChonThau:1949/1970, Section-B row4:1578, CreateContractDialog:2171 fallback `||selectedSupplierName`, HangMucCard toggle:2560). **#70 stale-echo ASYMMETRY:** budget Section-B CCM-period editor gates `ccmPeriodMut.isPending||peFetching` (`PeDetailTabs.tsx:1563`) but PRO sibling row3/row8 `adjustMut` gates `.isPending` ONLY (`:1548,:1649`, NO peFetching) — rapid PRO row3→row8 absolute-set pair can echo stale ev.* pre-refetch (same #70 class CCM guards). 3 peFetching sites exist (945/1268/1736). **Stale comment** PeDetailTabs:2507 references `AddItemDialog` "giữ(dead)" but function DELETED (grep 0 def) — misleading comment only, not dead code. PeWorkflowsPage admin-only = by-design (workflow config not mirrored). → _INDEX. diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md index 02474c5..37e85f6 100644 --- a/docs/HANDOFF.md +++ b/docs/HANDOFF.md @@ -2,7 +2,7 @@ > **Tiering rule (S40):** giữ **2-3 session gần nhất**. Cũ hơn → `docs/changelog/sessions/`. Full brief history pre-S40 → `docs/_archive/HANDOFF-preS40-fullhistory.md`. -**Last updated:** 2026-07-01 (S95 — **Harness-17 adopt (Vòng tự-cải-thiện bộ-nhớ Đo→Tinh-chỉnh→Kiểm) — governance-only 0 prod code, em-main-led 3-workflow.** `/check-email AI_INFRA` (0 directed mới; H16 áp trọn S93) → `/adap-apply` H17 (2 broadcast hash-MATCH `reviewer_gate:PASS`). **10/10 mục 🔴:** REUSE-cite A2=§H MFE/C3=D9/CG-2=value_protect/archive=§A + **build mới** `scripts/memory-selfimprove-audit.ps1` (C1 spec-audit NO-API, **runtime-verified bắt frontend-designer over-cap thật**) + `.claude/governance/reinject-ledger.md` (B2 CG-1 N=3) + engine §I + `session-start §2.1.7`/`session-end §L.b(c)` wire + HCV alias no-seed. **3-workflow:** WF1 `wf_f085d7c4-d78` ground-truth + WF2 `wf_8e73c1d6-ee6` 3-lane PASS + WF3 `wf_6f44eddf-680` **fault-injection 13-inject teeth-proof** + integration + cross-doc (0 application-defect). **2 commit:** `18a17f5` (cicd **Run #476 PASS** prod 200×3 bundle `0T6vVJST`/`BGXEVZO6` Mig 59) + `65b434a` (docs-only CI-skip). adap-report + 2 email AI_INFRA (`54789e19`+`8c94fa34`). **Dogfood AS-10 4-fire reverted** (git-diff = net thật; **WF3 explicit-return-only STILL self-wrote → instruction-fix NOT 100%**, E-006 recurrence, guard HELD 4/4; cicd-monitor diary KEPT = legit normal-spawn). **Lessons:** fault-injection-`-RepoRoot`-temp chứng checker-teeth · Lane B #53 empty→em-main self-gate. **State: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · prod 17 user/7 NCC.** **🔴 NEXT anh:** ⚠️ restart CLI (§2.1.7 + §L.b(c) H17-loop wire runtime — command `.md` no hot-reload). **🔴 NEXT em:** frontend-designer distill (WATCH strike-1 = H17 loop's live finding, chờ strike-2/anh) · monthly **2026-07-01 (hôm nay)** re-tier STATUS/HANDOFF mega-line + ef-core SKILL Mig→59 + docs/CLAUDE Budget-removed + 3 vocab-fork alias-map. **Pending product (carry):** Section B cột Dự-án · Ngưỡng CEO Mig 54 · "C" chuyển phiếu→dự án. → log `2026-07-01-S95-harness17-adopt.md`) · **Prev S94** (S94 — **anh-directive nâng cap lead 220K→380K** (canonical `memory-budget.json` · SE-override lead KHÔNG còn AI_INFRA-parity, subs giữ 60K/50K · mark H-15 v4-delta `RC-pqhuy1987-29-06-2026-23-25-50` · flush 3 echo · MFE live-read 380K) + **re-tier 2 mega-line** (fix Read-25K/call OOM): STATUS 389→89 · HANDOFF 732→12 dòng · 332KB→**34KB −90%** · ≤S90 → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` **0 byte-loss** · detector 27=baseline · `5f61b03` pushed CI-skip. MFE eval-all baseline: LEAD 29-item/380K=0.92% · SUB ≥85% (impl-backend 94%/impl-frontend 85%/reviewer 88%). **Lesson:** trần budget ⟂ harness Read-25K/call = 2 khóa độc-lập (cap-raise KHÔNG unblock mega-line Read → cần re-tier) · mega-LINE=tooling-breaker (ưu-tiên) vs mega-FILE nhiều-dòng=token-cost · re-tier=archive-không-cắt + assert head+tail==orig. em-main solo (0 sub, 0 fan-out). **State GIỮ NGUYÊN: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · bundle admin `CDn40vpV`/user `CoPmPBg7` · prod 17 user/7 NCC.** **🔴 NEXT anh:** ⚠️ restart CLI (session-start echo 380K + budget v4 runtime; số canonical đã sống ngay) · UAT eoffice node Dự án mã (carry S93). **🔴 NEXT em:** monthly **2026-07-01 (MAI!)** — ef-core SKILL Mig→59 · docs/CLAUDE Budget-removed · 3 vocab-fork alias-map · re-tier `migration-todos.md` (mega-FILE thứ-3, 807 dòng — không gấp, không vỡ tooling) · FD L1 26.1KB WATCH strike-1 (**test-specialist RESOLVED 7.8KB** — bỏ khỏi carry). **Pending product:** Section B cột Dự-án wire · Ngưỡng giá CEO Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. → log `2026-06-29-S94-cap-380k-retier-megaline.md`) · **Prev S93** (S93 — **(1) PE node Dự án hiện MÃ thay tên dài (anh Kiệt FDC) prod-verified Run #473** `8ee8f3e`: BE thread ProjectCode (DTO+3 projection+search) + FE 2-app SHA-mirror (render code+tooltip+sort) NO-MIG; grep bắt site#3 thoát replace_all; test 434; bundle admin `CDn40vpV`/user `CoPmPBg7`. **(2) adopt Harness-16 MFE (memory-fidelity-EVAL) 2-workflow PASS `9580098` 0-prod-code:** WF1 `wf_4c63e1bd` (ground-truth + bắt BLOCKING vocab-fork memory-fidelity≠H6.7) + WF2 `wf_13e3d35a` 3-lane PASS (denom-29-re-derived + READ-ONLY-proof + honesty + verb-trap-defeated); `scripts/mfe-eval.ps1` deterministic NO-API (LEAD coverage-FIT 29/220K=1.5% + age-band + Goodhart 21/9 · SUB đo-thật impl-backend 94%/reviewer 88% · prose→N/A) + judge-SCAFFOLD + budget:mfe + eval/mfe/ seed + engine §H + wire-opt-in + email AI_INFRA. AS-10 dogfood (WF1 residual caught+reverted; WF2 0-residual). #53 recover-from-disk. user-MEMORY compact 23.7→7.8KB. **State: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · bundle admin `CDn40vpV`/user `CoPmPBg7` · prod 17 user/7 NCC.** **🔴 NEXT anh:** ⚠️ restart CLI (MFE opt-in + wire) · UAT eoffice node Dự án mã · (anh Kiệt) nếu ô khoanh là Hạng-mục→báo em đổi work-item-code. **🔴 NEXT em:** monthly **2026-07-01 GẤP** re-tier mega-line (detector D1 OOM do bloat — STATUS 61K/HANDOFF 46K-char KHÔNG Read/Edit) + ef-core Mig→59 + Budget-removed docs + 3 vocab-fork + curate test-spec/FD L1. **Pending product:** Section B cột Dự-án · Ngưỡng giá CEO Mig 54 · "C" chuyển phiếu→dự án. → log `2026-06-29-S93-pe-projectcode-harness16-mfe.md`) · *(session ≤S90 đã tách → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` + `docs/changelog/sessions/`; re-tier S94)* +**Last updated:** 2026-07-01 (S96 — **buổi UAT LỚN anh Kiệt/chị Trà/anh Chương live + monthly-audit, em-main-led, 5 commit prod-verified.** **(1)** Monthly drift audit `881783c` (docs-only CI-skip): ef-core SKILL Mig→59 + rows 57/58/59 · skills/README + docs/CLAUDE Budget-removed · **`vocab-alias-map.md` MỚI** (3 fork + `$ExcludeExact`) · **re-tier mega-line 5→3** (S92/S91→archive, conservation delta=0 BOM) + hoist UAT-carry→blockers · **FD distill** (H17 strike-1 CLEARED L1 26129→21492B + archive/`_INDEX`/gist + Lessons L1). Workflow `wf_2d687d27` 4-cluster (reviewer bắt #74-drift + AS-10 residual reverted). detector 27→25. **(2)** Import NCC **DONGDUONG** `ba4b8e0` (Excel anh Kiệt; 3 NCC đã sẵn → +1 no-mig prod 21 NCC Run #477); backlog 15-18 field→Next-up. **(3-5)** 3 PE bug-fix UAT: `e657faa` ô "KẾT THÚC quy trình" (S89-auto)→**opt-out bỏ-tick-được** (2-tier grant/exercise +`applyLevelFinalize`, #478) · `36cbf8b` **chuông tự-sạch** noti "cần duyệt" (mark-read ExecuteUpdate BE-only, #479) · `0c2f9f6` **khóa sửa giá PRO/CCM sau gửi-duyệt** ("duyệt là fix" non-admin Nháp/TraLai+Admin-override, +4 test, #480). Test 434→440. **Delete-sau-duyệt = ĐÃ chặn sẵn**. Checkbox "ko-được" = **browser-cache** (verify byte-level prod `0MU-kb4N` chứa fix; incognito golden). **State: Mig 59 · 88 bảng · 440 test (45D+395I) · gotcha 77 · menu 54 · bundle admin `COYAX-yQ`/user `0MU-kb4N` · prod 21 NCC/17 user.** **🔴 NEXT anh:** ⚠️ restart CLI · UAT **incognito** checkbox + cho **số-phiếu/user** vụ "lỗi phân quyền vào phiếu". **🔴 NEXT em:** cicd S-tag-drift S97/S98→S96 reconcile (closeout) · monthly re-tier mega-line (giờ 4-blurb). **Lessons:** verify-deployed-artifact-byte-level (cache≠deploy; incognito golden — gotcha #77) · #53-return-garble ×3 recover-from-agent-memory (instruction-fix "return-verdict" ăn) · 2-tier-permission · spec-change→update-test. → log `2026-07-01-S96-uat-pe-fixes-monthly-audit.md`) · **Prev S95** (S95 — **Harness-17 adopt (Vòng tự-cải-thiện bộ-nhớ Đo→Tinh-chỉnh→Kiểm) — governance-only 0 prod code, em-main-led 3-workflow.** `/check-email AI_INFRA` (0 directed mới; H16 áp trọn S93) → `/adap-apply` H17 (2 broadcast hash-MATCH `reviewer_gate:PASS`). **10/10 mục 🔴:** REUSE-cite A2=§H MFE/C3=D9/CG-2=value_protect/archive=§A + **build mới** `scripts/memory-selfimprove-audit.ps1` (C1 spec-audit NO-API, **runtime-verified bắt frontend-designer over-cap thật**) + `.claude/governance/reinject-ledger.md` (B2 CG-1 N=3) + engine §I + `session-start §2.1.7`/`session-end §L.b(c)` wire + HCV alias no-seed. **3-workflow:** WF1 `wf_f085d7c4-d78` ground-truth + WF2 `wf_8e73c1d6-ee6` 3-lane PASS + WF3 `wf_6f44eddf-680` **fault-injection 13-inject teeth-proof** + integration + cross-doc (0 application-defect). **2 commit:** `18a17f5` (cicd **Run #476 PASS** prod 200×3 bundle `0T6vVJST`/`BGXEVZO6` Mig 59) + `65b434a` (docs-only CI-skip). adap-report + 2 email AI_INFRA (`54789e19`+`8c94fa34`). **Dogfood AS-10 4-fire reverted** (git-diff = net thật; **WF3 explicit-return-only STILL self-wrote → instruction-fix NOT 100%**, E-006 recurrence, guard HELD 4/4; cicd-monitor diary KEPT = legit normal-spawn). **Lessons:** fault-injection-`-RepoRoot`-temp chứng checker-teeth · Lane B #53 empty→em-main self-gate. **State: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · prod 17 user/7 NCC.** **🔴 NEXT anh:** ⚠️ restart CLI (§2.1.7 + §L.b(c) H17-loop wire runtime — command `.md` no hot-reload). **🔴 NEXT em:** frontend-designer distill (WATCH strike-1 = H17 loop's live finding, chờ strike-2/anh) · monthly **2026-07-01 (hôm nay)** re-tier STATUS/HANDOFF mega-line + ef-core SKILL Mig→59 + docs/CLAUDE Budget-removed + 3 vocab-fork alias-map. **Pending product (carry):** Section B cột Dự-án · Ngưỡng CEO Mig 54 · "C" chuyển phiếu→dự án. → log `2026-07-01-S95-harness17-adopt.md`) · **Prev S94** (S94 — **anh-directive nâng cap lead 220K→380K** (canonical `memory-budget.json` · SE-override lead KHÔNG còn AI_INFRA-parity, subs giữ 60K/50K · mark H-15 v4-delta `RC-pqhuy1987-29-06-2026-23-25-50` · flush 3 echo · MFE live-read 380K) + **re-tier 2 mega-line** (fix Read-25K/call OOM): STATUS 389→89 · HANDOFF 732→12 dòng · 332KB→**34KB −90%** · ≤S90 → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` **0 byte-loss** · detector 27=baseline · `5f61b03` pushed CI-skip. MFE eval-all baseline: LEAD 29-item/380K=0.92% · SUB ≥85% (impl-backend 94%/impl-frontend 85%/reviewer 88%). **Lesson:** trần budget ⟂ harness Read-25K/call = 2 khóa độc-lập (cap-raise KHÔNG unblock mega-line Read → cần re-tier) · mega-LINE=tooling-breaker (ưu-tiên) vs mega-FILE nhiều-dòng=token-cost · re-tier=archive-không-cắt + assert head+tail==orig. em-main solo (0 sub, 0 fan-out). **State GIỮ NGUYÊN: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · bundle admin `CDn40vpV`/user `CoPmPBg7` · prod 17 user/7 NCC.** **🔴 NEXT anh:** ⚠️ restart CLI (session-start echo 380K + budget v4 runtime; số canonical đã sống ngay) · UAT eoffice node Dự án mã (carry S93). **🔴 NEXT em:** monthly **2026-07-01 (MAI!)** — ef-core SKILL Mig→59 · docs/CLAUDE Budget-removed · 3 vocab-fork alias-map · re-tier `migration-todos.md` (mega-FILE thứ-3, 807 dòng — không gấp, không vỡ tooling) · FD L1 26.1KB WATCH strike-1 (**test-specialist RESOLVED 7.8KB** — bỏ khỏi carry). **Pending product:** Section B cột Dự-án wire · Ngưỡng giá CEO Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. → log `2026-06-29-S94-cap-380k-retier-megaline.md`) · **Prev S93** (S93 — **(1) PE node Dự án hiện MÃ thay tên dài (anh Kiệt FDC) prod-verified Run #473** `8ee8f3e`: BE thread ProjectCode (DTO+3 projection+search) + FE 2-app SHA-mirror (render code+tooltip+sort) NO-MIG; grep bắt site#3 thoát replace_all; test 434; bundle admin `CDn40vpV`/user `CoPmPBg7`. **(2) adopt Harness-16 MFE (memory-fidelity-EVAL) 2-workflow PASS `9580098` 0-prod-code:** WF1 `wf_4c63e1bd` (ground-truth + bắt BLOCKING vocab-fork memory-fidelity≠H6.7) + WF2 `wf_13e3d35a` 3-lane PASS (denom-29-re-derived + READ-ONLY-proof + honesty + verb-trap-defeated); `scripts/mfe-eval.ps1` deterministic NO-API (LEAD coverage-FIT 29/220K=1.5% + age-band + Goodhart 21/9 · SUB đo-thật impl-backend 94%/reviewer 88% · prose→N/A) + judge-SCAFFOLD + budget:mfe + eval/mfe/ seed + engine §H + wire-opt-in + email AI_INFRA. AS-10 dogfood (WF1 residual caught+reverted; WF2 0-residual). #53 recover-from-disk. user-MEMORY compact 23.7→7.8KB. **State: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · bundle admin `CDn40vpV`/user `CoPmPBg7` · prod 17 user/7 NCC.** **🔴 NEXT anh:** ⚠️ restart CLI (MFE opt-in + wire) · UAT eoffice node Dự án mã · (anh Kiệt) nếu ô khoanh là Hạng-mục→báo em đổi work-item-code. **🔴 NEXT em:** monthly **2026-07-01 GẤP** re-tier mega-line (detector D1 OOM do bloat — STATUS 61K/HANDOFF 46K-char KHÔNG Read/Edit) + ef-core Mig→59 + Budget-removed docs + 3 vocab-fork + curate test-spec/FD L1. **Pending product:** Section B cột Dự-án · Ngưỡng giá CEO Mig 54 · "C" chuyển phiếu→dự án. → log `2026-06-29-S93-pe-projectcode-harness16-mfe.md`) · *(session ≤S90 đã tách → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` + `docs/changelog/sessions/`; re-tier S94)* --- diff --git a/docs/STATUS.md b/docs/STATUS.md index 112c566..09ea6e9 100644 --- a/docs/STATUS.md +++ b/docs/STATUS.md @@ -3,7 +3,7 @@ > **Update rule:** trước khi bắt đầu 1 task → ghi row `🔥 In Progress`. Xong → `✅ Recently Done`. > **Tiering rule (S40):** chỉ giữ **state hiện tại + 3 session gần nhất** ở file này. Session cũ hơn → `docs/changelog/sessions/`. Full history pre-S40 → `docs/_archive/STATUS-preS40-fullhistory.md`. (Tránh over-context — xóa double, không cắt nội dung.) -**Last updated:** 2026-07-01 (S95 — **Harness-17 adopt (Vòng tự-cải-thiện bộ-nhớ Đo→Tinh-chỉnh→Kiểm) — governance-only 0 prod code, em-main-led + 3-workflow fan-out (HMW-mode ON).** `/check-email AI_INFRA` (0 directed mới; H16 đã áp trọn S93) → `/adap-apply` H17 (2 broadcast hash-MATCH · `reviewer_gate:PASS`). **10/10 mục 🔴 sàn ĐẠT:** REUSE-cite A2=§H MFE/C3=D9/CG-2=value_protect/archive=§A; **build mới** `scripts/memory-selfimprove-audit.ps1` (C1 spec-audit NO-API exit-0, **runtime-verified bắt frontend-designer over-cap GAP thật**) + `.claude/governance/reinject-ledger.md` (B2 CG-1 N=3, tách khỏi budget.json) + engine **§I** codify + `session-start §2.1.7`/`session-end §L.b(c)` wire + HCV alias no-seed (coverage 3-nghĩa, detector vẫn 27). **3-workflow (run-id bằng-chứng):** WF1 `wf_f085d7c4-d78` ground-truth + WF2 `wf_8e73c1d6-ee6` 3-lane review PASS 0-blocking + WF3 `wf_6f44eddf-680` deep-reverify (**fault-injection 13-inject chứng-răng-thật** + integration + cross-doc, 0 application-defect). **2 commit:** `18a17f5` (adopt — cicd **Run #476 PASS** prod 200×3, bundle rotate admin `0T6vVJST`/user `BGXEVZO6`, Mig 59 unchanged) + `65b434a` (deep-reverify docs-only CI-skip). **adap-report + 2 email AI_INFRA** (hash `54789e19` adopt + `8c94fa34` deep-reverify-update). **Dogfood C3 4-fire:** AS-10 WF1+WF3 self-write reverted (git-diff net = backstop THẬT; **instruction-fix NOT 100%** — WF3 explicit-return-only STILL self-wrote → E-006 recurrence S95, guard HELD 4/4, 0 escape; cicd-monitor diary KEPT = normal-spawn legit). **Lessons:** fault-injection-via-`-RepoRoot`-temp chứng checker-teeth (không chỉ happy-path PASS) · Lane B #53 empty-return → em-main self-gate recover · workflow-agent persona-write stochastic → git-diff mandatory. **State GIỮ NGUYÊN: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · prod 17 user/7 NCC.** **NEXT em:** frontend-designer distill (WATCH strike-1 = H17 loop's live finding) · monthly re-tier mega-line + ef-core SKILL Mig→59 + 3 vocab-fork (2026-07-01 due). → log `2026-07-01-S95-harness17-adopt.md`) · **Prev S94** (S94 — **(1) anh-directive nâng cap lead 220K→380K** (`memory-budget.json` canonical · SE-override lead KHÔNG còn AI_INFRA-parity, subs giữ 60K/50K · mark H-15 **v4-delta** `RC-pqhuy1987-29-06-2026-23-25-50` · flush 3 derived echo ACTIVE-MARKS/session-start §2.1.6/engine §G adopt-delta · MFE verified live-read 380K). **(2) re-tier 2 mega-line** (fix Read-25K/call OOM + token-cost ~169K/220K): STATUS 389→89 dòng (mega-line 59.6K→7.1K char) · HANDOFF 732→12 dòng · live 332KB→**34KB (−90%)** · session ≤S90 → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` **0 byte-loss** (new+archive=orig+995B pointer) · backup git+scratchpad · detector 27=baseline 0-broken-pointer · conservation spot-check PASS. **(3) MFE eval-all baseline** (đầu phiên): LEAD coverage-FIT 29-item/**380K=0.92%** · age-band 0-cut · Goodhart strikes-21/RCA-9 flat=no-lie · SUB per-role ≥85% (cicd/test-spec/FD 100% · impl-backend 94% · impl-frontend 85% · 3 prose-role N/A) · judge-scaffold-only honest. **(4) nạp full Phase-1 read-set** (budget 380K cho phép): +PROJECT-MAP +workflow-contract +migration-todos. **commit `5f61b03` pushed** docs-only CI-skip. **Lesson:** trần budget ⟂ harness **Read-25K/call** = 2 khóa ĐỘC-LẬP — cap-raise KHÔNG unblock mega-line Read (cần re-tier); **mega-LINE = tooling-breaker** (ưu-tiên) vs **mega-FILE nhiều-dòng = chỉ token-cost**; re-tier = **archive-không-cắt + assert head+tail==orig 0-loss**. em-main solo (governance single-writer, 0 sub, 0 fan-out). **State GIỮ NGUYÊN: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · bundle admin `CDn40vpV`/user `CoPmPBg7` · prod 17 user/7 NCC.** → log `2026-06-29-S94-cap-380k-retier-megaline.md`) · **Prev S93** (S93 — **(1) PE cây Duyệt NCC node Dự án hiện MÃ dự án thay tên dài (anh Kiệt FDC) prod-verified Run #473** `8ee8f3e`: BE thread ProjectCode (DTO + 3 projection List/Inbox/ListApproved + search) + FE 2-app SHA-mirror (render `projectCode||projectName`+tooltip+sort) NO-MIG; grep bắt construction-site#3 thoát replace_all (cardinality-grep-all-consumer); build 3× + test 434; bundle admin `xz8FdmLN`→`CDn40vpV`/user `CA8Rla2w`→`CoPmPBg7`. **(2) adopt Harness-16 MFE (memory-fidelity-EVAL) 2-workflow PASS, 0 production code** `9580098`: WF1 `wf_4c63e1bd` (ground-truth + bắt BLOCKING vocab-fork: memory-fidelity = H6.7 memoryDelta-routing ≠ H16 coverage-eval → đặt MFE + alias-map §H KHÔNG seed $aliasSets) + WF2 `wf_13e3d35a` 3-lane PASS (code-gate denom-29-re-derived to-the-digit + READ-ONLY-budget proof 1-write-op + honesty 5-floor + leading-verb-trap adversarial-probed-DEFEATED); `scripts/mfe-eval.ps1` deterministic NO-API ASCII#30 (LEAD coverage-FIT 29-item/220K=1.5% + age-band-flag-not-cut + Goodhart strikes-21/RCA-9 · SUB per-role ĐO-THẬT impl-backend 94%/impl-frontend 85%/reviewer 88% · prose-role→N/A KHÔNG 0%) + judge-SCAFFOLD-only (honest: số chưa-nghĩa tới khi age-mature+independent-judge) + budget:mfe config + eval/mfe/ seed-12-stable-id + engine §H + artifact-row + C3-comment + wire session-start §2.1.6/session-end §L.b(c) opt-in + agents/README S93 + adap-report ×2 + email AI_INFRA hash `da768330`. **AS-10 2nd-fire dogfood:** WF1 3-agent (return-only) residual agent-memory caught+reverted (E-006 recurrence, guard HELD); WF2 explicit-return-only-prompt → 0 residual (instruction-fix). **#53 recover-from-disk** (WF1 sub return-rỗng nhưng ghi diary trước). user-MEMORY compact 23.7→7.8KB (hook). **Lessons:** cardinality-change-grep-all-consumer · vocab-collision-check-on-adopt (2-workflow review bắt, 1-workflow trượt) · AS-10-instruction-fix (prompt override frontmatter + git-diff net) · MFE đóng-vòng detector-D1-OOM-đầu-phiên. **State THẬT: Mig 59 · 88 bảng · 434 test (45D+389I) · gotcha 76 · menu 54 · bundle admin `CDn40vpV`/user `CoPmPBg7` · prod 17 user/7 NCC.** **🔴 NEXT anh:** restart CLI (MFE opt-in + wire session-start/end + agents/README no hot-reload) · UAT eoffice node Dự án hiện mã. **NEXT em:** monthly **2026-07-01 (2 ngày) GẤP** re-tier STATUS/HANDOFF mega-line (detector D1 **OOM do bloat** = tooling vỡ, STATUS line 61K-char/HANDOFF 46K-char KHÔNG Read/Edit) + ef-core SKILL Mig→59 + docs/CLAUDE Budget-removed + 3 vocab-fork alias-map + curate test-specialist/FD L1 WATCH. **Pending product:** Section B cột Dự-án wire · Ngưỡng giá CEO Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. → log `2026-06-29-S93-pe-projectcode-harness16-mfe.md`) · *(session ≤S90 đã tách → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` + `docs/changelog/sessions/`; re-tier S94)* +**Last updated:** 2026-07-01 (S96 — **buổi UAT LỚN anh Kiệt/chị Trà/anh Chương live + monthly-audit — 5 commit prod-verified, em-main-led (HMW-mode ON; 1 prep-workflow monthly-audit + spawn-lẻ, chủ-yếu solo).** **(1) Monthly drift audit `881783c`** (docs-only CI-skip): ef-core SKILL Mig→59 + bảng rows 57/58/59 + Mig 14/Phase-7 Budget-DROPPED annotate · skills/README Mig 55→59 + gotcha #69→76 · docs/CLAUDE Budget REMOVED Mig 50 strike-through · **`docs/governance/vocab-alias-map.md` MỚI** (3 fork run-trace/Ngân-sách-PRO/all-inherit + `$ExcludeExact` anti-self-match) · **re-tier STATUS/HANDOFF mega-line 5→3 blurb** (S92/S91→archive, conservation delta=0 BOM-preserved) + hoist 3 UAT-carry→blockers · **FD memory distill** (H17 strike-1 CLEARED: L1 26129→21492B, 5 war-story→archive/`_INDEX`/gist, Lessons value-protect lên L1). Workflow `wf_2d687d27` 4-cluster draft→verify (reviewer bắt #74-paraphrase-drift + AS-10 residual reverted). detector 27→25. **(2) Import NCC DONGDUONG `ba4b8e0`** (Excel anh Kiệt "Database NCC" 4 NCC/30-field): 3 NCC đã seed sẵn (TRUONGGIANG/TANPHU/TGN) → chỉ +DONGDUONG vào SeedRealMasterDataAsync (ungated idempotent, pack extras→Note, no-mig); prod 20→21 NCC (Run #477). Backlog 15-18 field "note-lại-từ-từ-tính"→Next-up. **(3-5) 3 PE bug-fix UAT:** `e657faa` ô "Cấp này KẾT THÚC quy trình" (AllowApproverFinalize S89-auto) → **opt-out bỏ-tick-được** (2-tier: Designer=cấp-quyền / phiếu=chọn kết-thúc-hay-trình-CEO; +param `applyLevelFinalize` default-true BE + FE 2-app, Run #478) · `36cbf8b` **chuông tự sạch** noti "cần duyệt" cũ khi phiếu rời cấp (LogTransitionAsync mark-read Generic+RefId ExecuteUpdate BE-only, Run #479) · `0c2f9f6` **khóa sửa giá đề xuất PRO/CCM sau gửi-duyệt** ("duyệt là fix" — Mig 54 "KHÔNG-ràng-Phase" ĐẢO → non-admin chỉ sửa Nháp/TraLai + Admin-override; BE+FE 2-app+4 test, Run #480). Test 434→440. **Delete-sau-duyệt = ĐÃ chặn sẵn** (FE nút Xóa chỉ DangSoanThao + BE guard, không cần sửa). Checkbox "ko-được" = **browser-cache** (verify byte-level: prod bundle `0MU-kb4N` CHỨA fix + "✅-static" cũ đã mất; index.html no-cache đúng-chuẩn + no-service-worker) → **incognito = golden-test**. **State: Mig 59 · 88 bảng · 440 test (45D+395I) · gotcha 77 · menu 54 · bundle admin `COYAX-yQ`/user `0MU-kb4N` (Run #480) · prod 21 NCC/17 user.** **Lessons:** verify-deployed-artifact-byte-level (cache≠deploy; incognito golden — gotcha #77) · #53-return-garble tái-diễn ×3 (investigator + cicd×2 trả text-memory-curation thay verdict → recover từ agent-memory; instruction-fix "return-verdict" ăn lần-3) · 2-tier-permission (grant-vs-exercise) · spec-change→update-test-cũ (SeedPeAsync ChoDuyet→DangSoanThao). **🔴 NEXT anh:** UAT incognito checkbox + cho **số-phiếu/user** vụ "lỗi phân quyền vào phiếu" để em soi config-workflow. **NEXT em:** cicd-monitor S-tag-drift S97/S98→S96 reconcile (closeout này) · monthly re-tier mega-line (giờ 4-blurb S96/S95/S94/S93). → log `2026-07-01-S96-uat-pe-fixes-monthly-audit.md`) · **Prev S95** (S95 — **Harness-17 adopt (Vòng tự-cải-thiện bộ-nhớ Đo→Tinh-chỉnh→Kiểm) — governance-only 0 prod code, em-main-led + 3-workflow fan-out (HMW-mode ON).** `/check-email AI_INFRA` (0 directed mới; H16 đã áp trọn S93) → `/adap-apply` H17 (2 broadcast hash-MATCH · `reviewer_gate:PASS`). **10/10 mục 🔴 sàn ĐẠT:** REUSE-cite A2=§H MFE/C3=D9/CG-2=value_protect/archive=§A; **build mới** `scripts/memory-selfimprove-audit.ps1` (C1 spec-audit NO-API exit-0, **runtime-verified bắt frontend-designer over-cap GAP thật**) + `.claude/governance/reinject-ledger.md` (B2 CG-1 N=3, tách khỏi budget.json) + engine **§I** codify + `session-start §2.1.7`/`session-end §L.b(c)` wire + HCV alias no-seed (coverage 3-nghĩa, detector vẫn 27). **3-workflow (run-id bằng-chứng):** WF1 `wf_f085d7c4-d78` ground-truth + WF2 `wf_8e73c1d6-ee6` 3-lane review PASS 0-blocking + WF3 `wf_6f44eddf-680` deep-reverify (**fault-injection 13-inject chứng-răng-thật** + integration + cross-doc, 0 application-defect). **2 commit:** `18a17f5` (adopt — cicd **Run #476 PASS** prod 200×3, bundle rotate admin `0T6vVJST`/user `BGXEVZO6`, Mig 59 unchanged) + `65b434a` (deep-reverify docs-only CI-skip). **adap-report + 2 email AI_INFRA** (hash `54789e19` adopt + `8c94fa34` deep-reverify-update). **Dogfood C3 4-fire:** AS-10 WF1+WF3 self-write reverted (git-diff net = backstop THẬT; **instruction-fix NOT 100%** — WF3 explicit-return-only STILL self-wrote → E-006 recurrence S95, guard HELD 4/4, 0 escape; cicd-monitor diary KEPT = normal-spawn legit). **Lessons:** fault-injection-via-`-RepoRoot`-temp chứng checker-teeth (không chỉ happy-path PASS) · Lane B #53 empty-return → em-main self-gate recover · workflow-agent persona-write stochastic → git-diff mandatory. **State GIỮ NGUYÊN: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · prod 17 user/7 NCC.** **NEXT em:** frontend-designer distill (WATCH strike-1 = H17 loop's live finding) · monthly re-tier mega-line + ef-core SKILL Mig→59 + 3 vocab-fork (2026-07-01 due). → log `2026-07-01-S95-harness17-adopt.md`) · **Prev S94** (S94 — **(1) anh-directive nâng cap lead 220K→380K** (`memory-budget.json` canonical · SE-override lead KHÔNG còn AI_INFRA-parity, subs giữ 60K/50K · mark H-15 **v4-delta** `RC-pqhuy1987-29-06-2026-23-25-50` · flush 3 derived echo ACTIVE-MARKS/session-start §2.1.6/engine §G adopt-delta · MFE verified live-read 380K). **(2) re-tier 2 mega-line** (fix Read-25K/call OOM + token-cost ~169K/220K): STATUS 389→89 dòng (mega-line 59.6K→7.1K char) · HANDOFF 732→12 dòng · live 332KB→**34KB (−90%)** · session ≤S90 → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` **0 byte-loss** (new+archive=orig+995B pointer) · backup git+scratchpad · detector 27=baseline 0-broken-pointer · conservation spot-check PASS. **(3) MFE eval-all baseline** (đầu phiên): LEAD coverage-FIT 29-item/**380K=0.92%** · age-band 0-cut · Goodhart strikes-21/RCA-9 flat=no-lie · SUB per-role ≥85% (cicd/test-spec/FD 100% · impl-backend 94% · impl-frontend 85% · 3 prose-role N/A) · judge-scaffold-only honest. **(4) nạp full Phase-1 read-set** (budget 380K cho phép): +PROJECT-MAP +workflow-contract +migration-todos. **commit `5f61b03` pushed** docs-only CI-skip. **Lesson:** trần budget ⟂ harness **Read-25K/call** = 2 khóa ĐỘC-LẬP — cap-raise KHÔNG unblock mega-line Read (cần re-tier); **mega-LINE = tooling-breaker** (ưu-tiên) vs **mega-FILE nhiều-dòng = chỉ token-cost**; re-tier = **archive-không-cắt + assert head+tail==orig 0-loss**. em-main solo (governance single-writer, 0 sub, 0 fan-out). **State GIỮ NGUYÊN: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · bundle admin `CDn40vpV`/user `CoPmPBg7` · prod 17 user/7 NCC.** → log `2026-06-29-S94-cap-380k-retier-megaline.md`) · **Prev S93** (S93 — **(1) PE cây Duyệt NCC node Dự án hiện MÃ dự án thay tên dài (anh Kiệt FDC) prod-verified Run #473** `8ee8f3e`: BE thread ProjectCode (DTO + 3 projection List/Inbox/ListApproved + search) + FE 2-app SHA-mirror (render `projectCode||projectName`+tooltip+sort) NO-MIG; grep bắt construction-site#3 thoát replace_all (cardinality-grep-all-consumer); build 3× + test 434; bundle admin `xz8FdmLN`→`CDn40vpV`/user `CA8Rla2w`→`CoPmPBg7`. **(2) adopt Harness-16 MFE (memory-fidelity-EVAL) 2-workflow PASS, 0 production code** `9580098`: WF1 `wf_4c63e1bd` (ground-truth + bắt BLOCKING vocab-fork: memory-fidelity = H6.7 memoryDelta-routing ≠ H16 coverage-eval → đặt MFE + alias-map §H KHÔNG seed $aliasSets) + WF2 `wf_13e3d35a` 3-lane PASS (code-gate denom-29-re-derived to-the-digit + READ-ONLY-budget proof 1-write-op + honesty 5-floor + leading-verb-trap adversarial-probed-DEFEATED); `scripts/mfe-eval.ps1` deterministic NO-API ASCII#30 (LEAD coverage-FIT 29-item/220K=1.5% + age-band-flag-not-cut + Goodhart strikes-21/RCA-9 · SUB per-role ĐO-THẬT impl-backend 94%/impl-frontend 85%/reviewer 88% · prose-role→N/A KHÔNG 0%) + judge-SCAFFOLD-only (honest: số chưa-nghĩa tới khi age-mature+independent-judge) + budget:mfe config + eval/mfe/ seed-12-stable-id + engine §H + artifact-row + C3-comment + wire session-start §2.1.6/session-end §L.b(c) opt-in + agents/README S93 + adap-report ×2 + email AI_INFRA hash `da768330`. **AS-10 2nd-fire dogfood:** WF1 3-agent (return-only) residual agent-memory caught+reverted (E-006 recurrence, guard HELD); WF2 explicit-return-only-prompt → 0 residual (instruction-fix). **#53 recover-from-disk** (WF1 sub return-rỗng nhưng ghi diary trước). user-MEMORY compact 23.7→7.8KB (hook). **Lessons:** cardinality-change-grep-all-consumer · vocab-collision-check-on-adopt (2-workflow review bắt, 1-workflow trượt) · AS-10-instruction-fix (prompt override frontmatter + git-diff net) · MFE đóng-vòng detector-D1-OOM-đầu-phiên. **State THẬT: Mig 59 · 88 bảng · 434 test (45D+389I) · gotcha 76 · menu 54 · bundle admin `CDn40vpV`/user `CoPmPBg7` · prod 17 user/7 NCC.** **🔴 NEXT anh:** restart CLI (MFE opt-in + wire session-start/end + agents/README no hot-reload) · UAT eoffice node Dự án hiện mã. **NEXT em:** monthly **2026-07-01 (2 ngày) GẤP** re-tier STATUS/HANDOFF mega-line (detector D1 **OOM do bloat** = tooling vỡ, STATUS line 61K-char/HANDOFF 46K-char KHÔNG Read/Edit) + ef-core SKILL Mig→59 + docs/CLAUDE Budget-removed + 3 vocab-fork alias-map + curate test-specialist/FD L1 WATCH. **Pending product:** Section B cột Dự-án wire · Ngưỡng giá CEO Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. → log `2026-06-29-S93-pe-projectcode-harness16-mfe.md`) · *(session ≤S90 đã tách → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` + `docs/changelog/sessions/`; re-tier S94)* --- @@ -17,26 +17,27 @@ | API endpoints | **~253** | +1 S54 `GET /it-tickets/assignable-staff` (capability endpoint); +3 S52 (attendances/report + report/excel + it-tickets/{id}/assign) | | FE pages | **68** | unchanged S54 (ItTicketsPage reassign = in-place 2 app); +1 S52 AttendanceReportPage | | Menu keys | **54** | +1 S69 `Off_Dashboard` (landing Văn phòng số). Prev re-ground S61 (`MenuKeys.cs` const — Mig 50 gỡ 4 `Bg_*` Budget menu cũ). Prev 57 (S58) | -| Tests | **434 PASS** | 45 Domain + 389 Infra · 0 fail / 0 skip · **S92 +3** (`AdminOnlyModulesRevokeTests` ẩn 5 nhóm menu chỉ Admin — non-Admin revoked-4-cờ / Admin untouched / Pe_* preserved) · **S91 +9** (ChangePassword self-service BE+test) · **S89 +3** (`PeDraftVisibilityTests` IDOR nháp riêng-tư) · **S88 +17** (D1 financials/CEO-notify/HoSoLink null-safe +11 · D2 create-contract multi-winner +6) · **S87 +25** (Mig 58 net +18: `PeMultiWinnerTests` sum + `PeSelectWinnerClearTests` multi-update + `PeSubmitGuardAndBypass` budget=0 + `PeApproverFinalizeTests` 5 auto-finalize [từng 7, −2 khi opt-in→auto rework] + `PeCcmThresholdFinalize`/`PeWorkItemBudget` collateral; Mig 59 +7 `PeCcmBudgetPeriodSetterAuthzTests` role-gate Admin|CCM/budget=0/null-clear) · **S86 +3** (`PeApproverNotifyExcludesDrafterTests` — notify "cần duyệt" loại NGƯỜI TẠO phiếu: drafter-excluded · co-approver-vẫn-nhận · drafter-vẫn-nhận-chuông-kết-quả) · **S85 +18** (PE CV PRO C5 hủy/đổi NCC winner +10 · urgent drafter-self-unset +5 · workflow-preserve bug-class S42 +3 `PeUpdateDraftWorkflowPreserveTests`) · **S83 +2** (PE require-workflow: `PeWorkItemGuardTests` ApprovalWorkflowId `NotEmpty` ×2 validator + submit-guard rewrite test 7/13 `PeSubmitGuardAndBypass` V1-submit-deprecated, no-count-change) · **S77 +10** (+7 `PeSuggestedPriceSetterAuthzTests` ghi chú PRO/CCM Mig 57 absolute-set/role-gate/null-clear/max-1000 · +3 `PeUrgentToggleAuthzTests` rewrite cờ-gấp **BẤT ĐỐI XỨNG** SET=function role / UNSET=function+DeptManager, plain-PRO-unset Forbidden) · **S76 +5** (`PeWorkItemBudgetTests` PRO split: set ProInitial+ProAdjust gồm âm · validator ProInitial≥0/ProAdjust-cho-âm · full=proFull khi CCM empty · full=CCM khi CCM present) · **S74 +5** (`PeWorkItemBudgetTests` §4b CcmNote: set CCM/Admin · null-clear absolute-set · non-priv Forbidden+no-mutate · all-3-persist) · **S73 +28** (PE opt-in finalize spec 6→11 + 10 giá-chốt `PeApprovedPriceFinalizeTests` + 13 setter-authz `PeSuggestedPriceSetterAuthzTests`) · **S69 +20** (Office-golive OfficeModulePermissionSeed 6 + PE PeCcmThresholdFinalize 5 + PeUrgentToggleAuthz 9) · **S67 +23 HRM test-after** (DepartmentTreeTests 8 cycle-guard/rollup + PeHoSoLinkTests 9 absolute-set + HrmProfilePermissionSeedTests 6 reflection-seed) → 286 · S61 +22 `PeWorkItemBudgetTests` −14 `BudgetPolicyTests` −1 → 263 · S60 +14 `PeSubmitGuardAndBypassTests` +2 spec → 256 (Domain 58→45 do drop Budget module tests) | -| Gotchas | **76** | +2 S91 (**#76** deploy render config từ `.example` KHÔNG phải file-gitignored → prod thiếu setting tới khi điền tay · **#75** seed ungated per-code RESURRECT data đã-wipe mỗi restart → gate sau env-flag `DemoSeed:Disabled` + verify-by-restart-thật). +1 S90 (**#74** Chrome-MCP screenshot kẹt SPA-SignalR `document_idle` → PowerShell `CopyFromScreen` + Win32 lọc-process-`chrome.exe`). +2 S85 (**#72** lệch giờ +7h — DateTime lưu UTC nhưng serialize thiếu 'Z' → FE `new Date()`=local → `UtcDateTimeJsonConverter` global ép UTC-with-Z · **#73** UpdateDraft absolute-set CLEAR field SÓT khỏi pattern null-safe = bug-class S42 → guard `if (request.X is not null)`). +1 S78 **#71** (thêm enum value vào entity DÙNG-CHUNG → pollute UI/guard phân-loại theo PROXY-predicate `supplierId===null` thay vì enum tường minh; file-khi-duyệt purpose=5 lẫn "Bảng so sánh" + false-pass submit-guard → grep mọi field-proxy predicate loại value mới + build-verify TỪNG app; em-main grep no-leak bắt trước deploy). +1 S76 **#70** (FE absolute-set echo field anh-em từ server-snapshot + `invalidate()` fire-and-forget → cửa-sổ stale-echo mất-dữ-liệu khi lưu 2 ô liên-tiếp; guard `useIsFetching` gate nút Lưu tới khi refetch land; reviewer workflow bắt, impl self-review sót). +1 S72 **#69** FE bundle-hash non-deterministic + `deploy.yml` rebuild-FE-unconditional → bundle rotate kể cả commit governance (SPA-fallback-200 trap; cicd Run #312). +2 S69: **#67** Tailwind v4 accent palette thiếu stop (teal/violet/amberx/greenx chỉ 50/100/500/600/700; dùng -300 → teal/violet rơi DEFAULT Tailwind sai-hệ, amberx/greenx drop hẳn — build PASS, phải soi dist CSS) · **#68** IDE TS diagnostic giữa background-agent/workflow = snapshot dở-dang (TS server bắn mỗi save), chỉ tin build SẠCH sau-cùng (2× session này: re-skin + PE-FE đều false-alarm). Prev +1 S68 **#66** Tailwind v4 rule element thô `h1-h4{color:#0b1220}` viết NGOÀI `@layer` thắng utility `text-white` → heading render đen; fix ĐIỂM `text-white!` (important, grep dist confirm), KHÔNG move `@layer` (load-bearing ~30+ heading toàn app). Prev +1 S65 **#65** build csproj con (vd `SolutionErp.Api.csproj`) ≠ `dotnet build SolutionErp.slnx` (gồm tests) → miss test-compile khi đổi chữ ký record command (CreateDepartmentCommand +ParentId) → CI CS7036 FAIL-gated Run #291 (deploy chặn, prod nguyên — test-gate làm đúng việc). Fix: build full slnx trước push BE signature-change. Prev +2 S61: **#63** EF scaffold tự sinh `RenameColumn` SAI-semantics khi drop+add cùng type (test xanh không bắt — SQLite EnsureCreated không replay migration) · **#64** `dotnet ef database update` áp Design-DB 0-rows ≠ Dev-DB → data-migrate `Sql()` chạy thật lần đầu trên prod. Prev +2 S59 (#61 sqlcmd `-f 65001` · #62 rename natural-key UPDATE trước deploy) | +| Tests | **440 PASS** | 45 Domain + 395 Infra · 0 fail / 0 skip · **S96 +6** (PE `PeApproverFinalizeTests` +2 [#6 finalize-opt-out→advance-CEO · #7 stale-noti-clear ExecuteUpdate] · `PeSuggestedPriceSetterAuthzTests` +4 [price-lock phase-guard after-submit — PRO/CCM ChoDuyet/DaDuyet→Conflict, Admin-override; +sửa SeedPeAsync default ChoDuyet→DangSoanThao spec-change]) · **S92 +3** (`AdminOnlyModulesRevokeTests` ẩn 5 nhóm menu chỉ Admin — non-Admin revoked-4-cờ / Admin untouched / Pe_* preserved) · **S91 +9** (ChangePassword self-service BE+test) · **S89 +3** (`PeDraftVisibilityTests` IDOR nháp riêng-tư) · **S88 +17** (D1 financials/CEO-notify/HoSoLink null-safe +11 · D2 create-contract multi-winner +6) · **S87 +25** (Mig 58 net +18: `PeMultiWinnerTests` sum + `PeSelectWinnerClearTests` multi-update + `PeSubmitGuardAndBypass` budget=0 + `PeApproverFinalizeTests` 5 auto-finalize [từng 7, −2 khi opt-in→auto rework] + `PeCcmThresholdFinalize`/`PeWorkItemBudget` collateral; Mig 59 +7 `PeCcmBudgetPeriodSetterAuthzTests` role-gate Admin|CCM/budget=0/null-clear) · **S86 +3** (`PeApproverNotifyExcludesDrafterTests` — notify "cần duyệt" loại NGƯỜI TẠO phiếu: drafter-excluded · co-approver-vẫn-nhận · drafter-vẫn-nhận-chuông-kết-quả) · **S85 +18** (PE CV PRO C5 hủy/đổi NCC winner +10 · urgent drafter-self-unset +5 · workflow-preserve bug-class S42 +3 `PeUpdateDraftWorkflowPreserveTests`) · **S83 +2** (PE require-workflow: `PeWorkItemGuardTests` ApprovalWorkflowId `NotEmpty` ×2 validator + submit-guard rewrite test 7/13 `PeSubmitGuardAndBypass` V1-submit-deprecated, no-count-change) · **S77 +10** (+7 `PeSuggestedPriceSetterAuthzTests` ghi chú PRO/CCM Mig 57 absolute-set/role-gate/null-clear/max-1000 · +3 `PeUrgentToggleAuthzTests` rewrite cờ-gấp **BẤT ĐỐI XỨNG** SET=function role / UNSET=function+DeptManager, plain-PRO-unset Forbidden) · **S76 +5** (`PeWorkItemBudgetTests` PRO split: set ProInitial+ProAdjust gồm âm · validator ProInitial≥0/ProAdjust-cho-âm · full=proFull khi CCM empty · full=CCM khi CCM present) · **S74 +5** (`PeWorkItemBudgetTests` §4b CcmNote: set CCM/Admin · null-clear absolute-set · non-priv Forbidden+no-mutate · all-3-persist) · **S73 +28** (PE opt-in finalize spec 6→11 + 10 giá-chốt `PeApprovedPriceFinalizeTests` + 13 setter-authz `PeSuggestedPriceSetterAuthzTests`) · **S69 +20** (Office-golive OfficeModulePermissionSeed 6 + PE PeCcmThresholdFinalize 5 + PeUrgentToggleAuthz 9) · **S67 +23 HRM test-after** (DepartmentTreeTests 8 cycle-guard/rollup + PeHoSoLinkTests 9 absolute-set + HrmProfilePermissionSeedTests 6 reflection-seed) → 286 · S61 +22 `PeWorkItemBudgetTests` −14 `BudgetPolicyTests` −1 → 263 · S60 +14 `PeSubmitGuardAndBypassTests` +2 spec → 256 (Domain 58→45 do drop Budget module tests) | +| Gotchas | **77** | +1 S96 (**#77** SPA deploy bundle cache-lag: team thấy UI CŨ dù đã deploy + Ctrl+F5 — index.html no-cache ĐÚNG-chuẩn + JS hash-immutable nhưng browser giữ tab-SPA-mở/cache-local → verify bundle prod **BYTE-LEVEL** (curl + grep string-fix trong `/assets/index-.js`) phân-biệt cache-vs-deploy; **incognito = golden-test**; no-service-worker nên clear-site-data đủ). +2 S91 (**#76** deploy render config từ `.example` KHÔNG phải file-gitignored → prod thiếu setting tới khi điền tay · **#75** seed ungated per-code RESURRECT data đã-wipe mỗi restart → gate sau env-flag `DemoSeed:Disabled` + verify-by-restart-thật). +1 S90 (**#74** Chrome-MCP screenshot kẹt SPA-SignalR `document_idle` → PowerShell `CopyFromScreen` + Win32 lọc-process-`chrome.exe`). +2 S85 (**#72** lệch giờ +7h — DateTime lưu UTC nhưng serialize thiếu 'Z' → FE `new Date()`=local → `UtcDateTimeJsonConverter` global ép UTC-with-Z · **#73** UpdateDraft absolute-set CLEAR field SÓT khỏi pattern null-safe = bug-class S42 → guard `if (request.X is not null)`). +1 S78 **#71** (thêm enum value vào entity DÙNG-CHUNG → pollute UI/guard phân-loại theo PROXY-predicate `supplierId===null` thay vì enum tường minh; file-khi-duyệt purpose=5 lẫn "Bảng so sánh" + false-pass submit-guard → grep mọi field-proxy predicate loại value mới + build-verify TỪNG app; em-main grep no-leak bắt trước deploy). +1 S76 **#70** (FE absolute-set echo field anh-em từ server-snapshot + `invalidate()` fire-and-forget → cửa-sổ stale-echo mất-dữ-liệu khi lưu 2 ô liên-tiếp; guard `useIsFetching` gate nút Lưu tới khi refetch land; reviewer workflow bắt, impl self-review sót). +1 S72 **#69** FE bundle-hash non-deterministic + `deploy.yml` rebuild-FE-unconditional → bundle rotate kể cả commit governance (SPA-fallback-200 trap; cicd Run #312). +2 S69: **#67** Tailwind v4 accent palette thiếu stop (teal/violet/amberx/greenx chỉ 50/100/500/600/700; dùng -300 → teal/violet rơi DEFAULT Tailwind sai-hệ, amberx/greenx drop hẳn — build PASS, phải soi dist CSS) · **#68** IDE TS diagnostic giữa background-agent/workflow = snapshot dở-dang (TS server bắn mỗi save), chỉ tin build SẠCH sau-cùng (2× session này: re-skin + PE-FE đều false-alarm). Prev +1 S68 **#66** Tailwind v4 rule element thô `h1-h4{color:#0b1220}` viết NGOÀI `@layer` thắng utility `text-white` → heading render đen; fix ĐIỂM `text-white!` (important, grep dist confirm), KHÔNG move `@layer` (load-bearing ~30+ heading toàn app). Prev +1 S65 **#65** build csproj con (vd `SolutionErp.Api.csproj`) ≠ `dotnet build SolutionErp.slnx` (gồm tests) → miss test-compile khi đổi chữ ký record command (CreateDepartmentCommand +ParentId) → CI CS7036 FAIL-gated Run #291 (deploy chặn, prod nguyên — test-gate làm đúng việc). Fix: build full slnx trước push BE signature-change. Prev +2 S61: **#63** EF scaffold tự sinh `RenameColumn` SAI-semantics khi drop+add cùng type (test xanh không bắt — SQLite EnsureCreated không replay migration) · **#64** `dotnet ef database update` áp Design-DB 0-rows ≠ Dev-DB → data-migrate `Sql()` chạy thật lần đầu trên prod. Prev +2 S59 (#61 sqlcmd `-f 65001` · #62 rename natural-key UPDATE trước deploy) | | User memory | **31** | +S84 `feedback_derived_flush_execution` (derived→canonical flush = em-main execution KHÔNG gate user-confirm; monitor INFORM-only ≠ cần-anh-duyệt; chỉ ĐỔI-con-số/policy = quyền anh). +S79 `feedback_canonical_spec_over_broadcast` (adap pull canonical-command/§P đừng phỏng-theo broadcast + report-before-stamp dogfood + residual own-diary OK). +S75 `feedback_harness11_engine` (engine governance tự-bảo-trì + gotcha #30-via-Edit + multi-workflow-verify + git-add-specific lesson). re-ground S71 (H1 disk-count: 25 `feedback_*` + 3 `project_*`; STATUS "21" stale từ S64). +S71 `feedback_harness10_run_trace` (run-trace + 3 lesson). Prev +1 S64 `feedback_harness7_outward_writing_quality`; re-grounded S54 base 19 | | Skills | 6 | 3 domain + 3 ops | | Sub-agents | **11** | **all-inherit top-tier (Harness-8 S66 06-16 — thay thế two-tier H4):** em main Fable 5 (1M) Max (fallback Opus 4.8 1M, Fable suspended H5) · **cả 11 sub `model: inherit`** (7 demoted `claude-opus-4-8` flip S66; SE không có helper/gopher rẻ → cả 11 lên top-tier) · effort Max. 9 product/quality + 2 monitor INFORM-only. Nấc H8 = **executed-file VERIFIED-pending-restart**. Prev two-tier H4 runtime-verified S57bis (spawn-test 2 chiều). | | RAG chunks | **2429** | re-verify S80 (`list_projects` — alive, +6 vs S63's 2423). Stale `last_indexed 05-29` (S42-S62 via store_memory stopgap; full re-index = AI_INFRA op cần VOYAGE_API_KEY). | -**Bundle hash live (prod):** admin **`0T6vVJST`** · user **`BGXEVZO6`** (S95 — **Run #476** `18a17f5` H17 governance-only deploy; bundle rotate benign #69 CSS-frozen, prod 200×3, Mig 59 unchanged; cicd re-snapshot LIVE — pre-deploy `CkZ1MjC1`/`_-gpX7_Y`, mega-line S93 `CDn40vpV`/`CoPmPBg7` đã bị deploy trung-gian rotate từ S94). **Prev S85** — admin **`aKuNip19`** · user **`BUsL0HeQ`** (S85 — **Run #341** `49ac086` lệch-giờ TZ serialize UTC-with-Z; FE frozen #339+#341 BE-only. Chuỗi ~10 deploy #334→#341 buổi UAT anh Kiệt CV PRO: #334 `5a61254` batch CV PRO 6-fix → #335-#338 6 vòng UAT → #339 `1263c0d` workflow-preserve bug-class S42 → #341 `49ac086` TZ; #342 `d4f6021` docs+cicd BE-frozen, bundle giữ-nguyên gotcha #69-REFINE). **Prev S78** — admin **`CsJetgZH`** · user **`BVS0ApIm`** (S78 — **Run #330** `7886fd0` PE attach-file khi duyệt; bundle ROTATE từ S77 `BqKD3Y23`/`Cn-i349D` dù NO migration enum-only — gotcha #69 non-determ rebuild; cicd ship-proof byte-stable + fake-hash control). **Prev S77** — admin **`BqKD3Y23`** · user **`Cn-i349D`** (S77 — **Run #329** `e823694` banner Trả-lại; cuối chuỗi 10 deploy #320→#329 cùng ngày, cicd PASS each: #320 pill `DsSg6RRz`-era → #321 focus → #322 revert → #323 Mig57+notes `CPm4LTqm`/`BWJUAqEI` → #324 số-âm-đỏ `C6fx-0ea`/`N3sW4Div` → #325 indent `BhnNMucS`/`B1VebpXc` → #326 cờ-gấp-asymmetric `DwXqn37C`/`COXMCv7E` → #327 decouple `B0gboSAg`/`DbDg7pM-` → #328 notify (BE-only, FE frozen) → #329 banner **`BqKD3Y23`**/**`Cn-i349D`**). **Prev S76** — admin **`jOqxW4-p`** · user **`DbsznVvR`** (S76 — **Run #319** `21d1f4e` bảng lưới `` ngân sách viền-ô; chuỗi S76 cùng ngày: #318 `e33481e` feature ma-trận-3-cột + badge quyền-NS `BhFDF9IJ`/`BAkuRl3C` → #319 **`jOqxW4-p`**/**`DbsznVvR`**, cicd PASS each, smoke 3×200, Mig 56 applied prod #318). **Prev S74** — admin **`BYF5vIMJ`** · user **`CB-tiRxd`** (S74 — **Run #315** `8655ebf` Mig 55 CcmNote, cicd PASS ~4m54s: Mig 55 applied prod CcmNote nvarchar(1000) nullable · sys.tables 88 · smoke 4×200 · 0 regression). **Prev S73** — admin **`Bv3jUCNo`** · user **`BWlMBQz6`** (Run #314 `6aa4dcb` FE empty-candidates guard fix; chuỗi 2 deploy: #313 `1d86abc` feature `OlNyG9OD`/`DSzSLVtL` → #314 **`Bv3jUCNo`**/**`BWlMBQz6`**, cicd PASS each). **Prev S72** — admin **`fc_xkNpJ`** · user **`DP-tBcg0`** (Run #312 governance commit `18fced6`; bundle ROTATE do **non-deterministic hash + deploy rebuild-FE-unconditional** (gotcha #69) — 0 FE source change, prod state/DB GIỮ NGUYÊN). **Prev S69** — admin **`BgNCjwsG`** · user **`CBvh0vtf`** (Run #308 PE cờ gấp + ngưỡng CCM; chuỗi 4 deploy session: #305 Văn phòng số foundation → #306 re-skin 10 page → #307 Office golive (BE-only) `Wt54PHYl`/`B99fMU6X` → #308 **`BgNCjwsG`**/**`CBvh0vtf`**). **Prev S68** — admin **`CNUv1jxY`** · user **`CpOskeS1`** (S68 — Run #304 `37752eb` fix tên đen→trắng; chuỗi #303 `6983609` `D532XZKG`/`CuFaBoWt` → #304 **`CNUv1jxY`**/**`CpOskeS1`**, cicd PASS each). **Prev S67** — admin `CcrZqfht`/user `DniDFUB_` (S67 — 6 deploy Run #297→#302; admin rotate chuỗi #298`xkSz9BfE`→#300`PxiZQkaw`→#301`I1fpLeYw`→#302**`CcrZqfht`** · user #297`BumgrwCJ`→#300`B36hGoKd`→#301`DrQYkzh0`→#302**`DniDFUB_`**; #299 tests BE-only cả 2 frozen, cicd PASS each). **Prev S65** — admin `BDwV5d0X`/user `DbVv6rsf` (Run #293-295). Prev S62 admin `0xKYGhhf`/user `C81ZdG9G` (Run #286). **Prev S59:** admin `B1DtNT9C` · user `D6uF3Mln` (Run **#282** `792c030` FINAL — bỏ nút Thêm hạng mục; ships kèm `80b64dd` gỡ Điều khoản TT, #281 cancelled-benign ancestor-verified). Chuỗi S59 cùng ngày: #280 `69997da` (`BKy_8OO9`/`XcZ6PRyA`, ships kèm `f21c55d` table-fixed #279-cancelled) · #278 `9c330d2` self-approve+quick-add-NCC (`BSh2fG2X`/`D22KfpPc`, authz probe 4/4) · #277 `faed59f` SearchableSelect (`ex7Tc92G`/`DzUeSk96`) · #276 `c869d26` rename 71 PMH (`BBA0KSWu`/`DzdTI18G`) · #275 `bbd1554` dọn demo WorkItems (FROZEN BE-only) · #274 `0eafcd3` tree 4 tầng (`DuU7OTym`/`DWyeTzf3`) · #273 `56882ac` wipe + tree v1 (`R9uGRxvw`/`DikfX1RD`). Prev S58: Run #386 `3ebaf84` admin `DMm9rtNA`/user `BUkOMn_Y` (chi tiết session log S58). +**Bundle hash live (prod):** admin **`COYAX-yQ`** · user **`0MU-kb4N`** (S96 — **Run #480** `0c2f9f6` price-lock; chuỗi 3 PE deploy #478 `e657faa` checkbox-opt-out → #479 `36cbf8b` chuông-stale-clear (BE-only) → #480 `0c2f9f6` khóa-giá-sau-duyệt, cicd PASS each ~5m; **FE JS rotate THẬT** (PeWorkflowPanel #478 + PeDetailTabs #480, 2-app) real-size 1.64/1.54MB vs 919b SPA-trap, CSS frozen #69-REFINE; Mig 59 frozen 0-mig; +Run #477 `ba4b8e0` NCC seed no-mig prod 21 NCC. **Verify byte-level:** prod `0MU-kb4N` CHỨA checkbox-fix ("BỎ tick"/"Đã BỎ tick") + "✅-static" cũ MẤT → checkbox "ko-được" = browser-cache KHÔNG deploy-fail). **Prev S95** — admin **`0T6vVJST`** · user **`BGXEVZO6`** (S95 — **Run #476** `18a17f5` H17 governance-only deploy; bundle rotate benign #69 CSS-frozen, prod 200×3, Mig 59 unchanged; cicd re-snapshot LIVE — pre-deploy `CkZ1MjC1`/`_-gpX7_Y`, mega-line S93 `CDn40vpV`/`CoPmPBg7` đã bị deploy trung-gian rotate từ S94). **Prev S85** — admin **`aKuNip19`** · user **`BUsL0HeQ`** (S85 — **Run #341** `49ac086` lệch-giờ TZ serialize UTC-with-Z; FE frozen #339+#341 BE-only. Chuỗi ~10 deploy #334→#341 buổi UAT anh Kiệt CV PRO: #334 `5a61254` batch CV PRO 6-fix → #335-#338 6 vòng UAT → #339 `1263c0d` workflow-preserve bug-class S42 → #341 `49ac086` TZ; #342 `d4f6021` docs+cicd BE-frozen, bundle giữ-nguyên gotcha #69-REFINE). **Prev S78** — admin **`CsJetgZH`** · user **`BVS0ApIm`** (S78 — **Run #330** `7886fd0` PE attach-file khi duyệt; bundle ROTATE từ S77 `BqKD3Y23`/`Cn-i349D` dù NO migration enum-only — gotcha #69 non-determ rebuild; cicd ship-proof byte-stable + fake-hash control). **Prev S77** — admin **`BqKD3Y23`** · user **`Cn-i349D`** (S77 — **Run #329** `e823694` banner Trả-lại; cuối chuỗi 10 deploy #320→#329 cùng ngày, cicd PASS each: #320 pill `DsSg6RRz`-era → #321 focus → #322 revert → #323 Mig57+notes `CPm4LTqm`/`BWJUAqEI` → #324 số-âm-đỏ `C6fx-0ea`/`N3sW4Div` → #325 indent `BhnNMucS`/`B1VebpXc` → #326 cờ-gấp-asymmetric `DwXqn37C`/`COXMCv7E` → #327 decouple `B0gboSAg`/`DbDg7pM-` → #328 notify (BE-only, FE frozen) → #329 banner **`BqKD3Y23`**/**`Cn-i349D`**). **Prev S76** — admin **`jOqxW4-p`** · user **`DbsznVvR`** (S76 — **Run #319** `21d1f4e` bảng lưới `
      ` ngân sách viền-ô; chuỗi S76 cùng ngày: #318 `e33481e` feature ma-trận-3-cột + badge quyền-NS `BhFDF9IJ`/`BAkuRl3C` → #319 **`jOqxW4-p`**/**`DbsznVvR`**, cicd PASS each, smoke 3×200, Mig 56 applied prod #318). **Prev S74** — admin **`BYF5vIMJ`** · user **`CB-tiRxd`** (S74 — **Run #315** `8655ebf` Mig 55 CcmNote, cicd PASS ~4m54s: Mig 55 applied prod CcmNote nvarchar(1000) nullable · sys.tables 88 · smoke 4×200 · 0 regression). **Prev S73** — admin **`Bv3jUCNo`** · user **`BWlMBQz6`** (Run #314 `6aa4dcb` FE empty-candidates guard fix; chuỗi 2 deploy: #313 `1d86abc` feature `OlNyG9OD`/`DSzSLVtL` → #314 **`Bv3jUCNo`**/**`BWlMBQz6`**, cicd PASS each). **Prev S72** — admin **`fc_xkNpJ`** · user **`DP-tBcg0`** (Run #312 governance commit `18fced6`; bundle ROTATE do **non-deterministic hash + deploy rebuild-FE-unconditional** (gotcha #69) — 0 FE source change, prod state/DB GIỮ NGUYÊN). **Prev S69** — admin **`BgNCjwsG`** · user **`CBvh0vtf`** (Run #308 PE cờ gấp + ngưỡng CCM; chuỗi 4 deploy session: #305 Văn phòng số foundation → #306 re-skin 10 page → #307 Office golive (BE-only) `Wt54PHYl`/`B99fMU6X` → #308 **`BgNCjwsG`**/**`CBvh0vtf`**). **Prev S68** — admin **`CNUv1jxY`** · user **`CpOskeS1`** (S68 — Run #304 `37752eb` fix tên đen→trắng; chuỗi #303 `6983609` `D532XZKG`/`CuFaBoWt` → #304 **`CNUv1jxY`**/**`CpOskeS1`**, cicd PASS each). **Prev S67** — admin `CcrZqfht`/user `DniDFUB_` (S67 — 6 deploy Run #297→#302; admin rotate chuỗi #298`xkSz9BfE`→#300`PxiZQkaw`→#301`I1fpLeYw`→#302**`CcrZqfht`** · user #297`BumgrwCJ`→#300`B36hGoKd`→#301`DrQYkzh0`→#302**`DniDFUB_`**; #299 tests BE-only cả 2 frozen, cicd PASS each). **Prev S65** — admin `BDwV5d0X`/user `DbVv6rsf` (Run #293-295). Prev S62 admin `0xKYGhhf`/user `C81ZdG9G` (Run #286). **Prev S59:** admin `B1DtNT9C` · user `D6uF3Mln` (Run **#282** `792c030` FINAL — bỏ nút Thêm hạng mục; ships kèm `80b64dd` gỡ Điều khoản TT, #281 cancelled-benign ancestor-verified). Chuỗi S59 cùng ngày: #280 `69997da` (`BKy_8OO9`/`XcZ6PRyA`, ships kèm `f21c55d` table-fixed #279-cancelled) · #278 `9c330d2` self-approve+quick-add-NCC (`BSh2fG2X`/`D22KfpPc`, authz probe 4/4) · #277 `faed59f` SearchableSelect (`ex7Tc92G`/`DzUeSk96`) · #276 `c869d26` rename 71 PMH (`BBA0KSWu`/`DzdTI18G`) · #275 `bbd1554` dọn demo WorkItems (FROZEN BE-only) · #274 `0eafcd3` tree 4 tầng (`DuU7OTym`/`DWyeTzf3`) · #273 `56882ac` wipe + tree v1 (`R9uGRxvw`/`DikfX1RD`). Prev S58: Run #386 `3ebaf84` admin `DMm9rtNA`/user `BUkOMn_Y` (chi tiết session log S58). **Phase:** ✅ Phase 10 COMPLETE · ✅ **Phase 11 product backlog ĐÓNG TRỌN** · ✅ **Văn phòng số (E-Office) golive S69** (foundation PURO + re-skin 10 page + public read+create 16-key allow-list mọi role) prod-verified · ✅ **PE cờ gấp PRO/CCM + CCM duyệt-final theo ngưỡng (Mig 53 S69)** prod-verified · ✅ **PE ngân sách MA TRẬN 3 cột Dự án/PRO/CCM (bảng lưới `
      `) + badge quyền-NS theo role trong Workflow Designer & flow Duyệt NCC (Mig 56 S76)** prod-verified · ✅ **PE UX batch S77 (10 deploy)** — cờ GẤP pill mọi danh sách+inbox · focus/inline+overlay decouple+"Xem mở rộng" · ô ghi chú giá đề xuất PRO/CCM (Mig 57) · số phân cách + số-âm-đỏ-ngoặc + indent mục con · cờ gấp GẮN=NV/GỠ=Trưởng phòng · chuông báo người duyệt · banner Trả-lại — prod-verified · ✅ **PE đính kèm file khi DUYỆT (S78, Run #330)** — người duyệt tải file lên lúc duyệt thay vì Trả lại; migration-free reuse-enum `ApprovalAttachment=5` — prod-verified · 🚫 Phase 9 Ops blocked (anh main coordinate — anh dừng). > ⚠️ **Count drift fixed S40:** endpoints ~223→**211**, FE pages 53→**65**, menu keys 85→**~53**. Tables **84 confirmed correct** (DbSet 77 + Identity 7). 3 số "khó fake" (mig/gotcha/git) luôn đúng. Cause: số "incremented mỗi session" over/under-count optimistic — re-ground định kỳ. --- -## 🔥 In Progress (S95) +## 🔥 In Progress (S96) | Task | Owner | Status | |---|---|---| -| **S95 — Harness-17 adopt (Đo→Tinh-chỉnh→Kiểm) + 3-workflow deep-verify** — ✅ DONE, pushed `18a17f5`+`65b434a`; chi-tiết ở mega-line đầu file + session log `2026-07-01-S95-*` | 👤 em main | ✅ done (S95 closeout) | -| **Frontend-designer distill** (H17 loop's live finding: MEMORY.md 26129B over-cap, WATCH strike-1) | 👤 em main | ⚪ pending (strike-2 hoặc anh chỉ đạo) | +| **S96 — monthly audit + NCC import DONGDUONG + 3 PE bug-fix UAT anh Kiệt** — ✅ DONE, 5 commit pushed+deployed+verified (`881783c`/`ba4b8e0`/`e657faa`/`36cbf8b`/`0c2f9f6`); chi-tiết mega-line đầu file + log `2026-07-01-S96-*` | 👤 em main | ✅ done (S96 closeout) | +| **Frontend-designer distill** (H17 strike-1) — ✅ DONE S96 (`881783c`: L1 26129→21492B + archive/`_INDEX`/gist + Lessons value-protect L1) | 👤 em main | ✅ done | +| **PE "lỗi phân quyền vào phiếu"** (anh Kiệt UAT báo) — chờ **số-phiếu + user** để soi config workflow (nhiều khả năng user chưa được gán approver Cấp phiếu đang chờ — config, không phải code-bug) | 👤 em main | ⚪ pending (chờ anh specifics) | --- diff --git a/docs/changelog/sessions/2026-07-01-S96-uat-pe-fixes-monthly-audit.md b/docs/changelog/sessions/2026-07-01-S96-uat-pe-fixes-monthly-audit.md new file mode 100644 index 0000000..b99a47f --- /dev/null +++ b/docs/changelog/sessions/2026-07-01-S96-uat-pe-fixes-monthly-audit.md @@ -0,0 +1,52 @@ +# S96 — 2026-07-01 — Buổi UAT LỚN anh Kiệt/team live + Monthly-audit (5 commit prod-verified) + +> em-main-led. HMW-mode ON (1 prep-workflow monthly-audit + spawn-lẻ, chủ-yếu solo/reliable). Session dài: `/session-start` → monthly audit → NCC import → 3 PE bug-fix theo UAT anh Kiệt/chị Trà/anh Chương → `/session-end`. + +## 5 commit (đều pushed + deployed + cicd-verified) + +| # | SHA | Scope | Run | +|---|---|---|---| +| 1 | `881783c` | Docs: monthly drift audit + FD distill + mega-line re-tier | docs-only CI-skip | +| 2 | `ba4b8e0` | Infra: import NCC DONGDUONG + Supplier-field backlog | #477 | +| 3 | `e657faa` | PE: ô "KẾT THÚC quy trình" → opt-out bỏ-tick-được | #478 | +| 4 | `36cbf8b` | PE: mark-read noti "cần duyệt" cũ (fix chuông stale) | #479 | +| 5 | `0c2f9f6` | PE: khóa sửa giá đề xuất PRO/CCM sau gửi-duyệt | #480 | + +## (1) Monthly drift audit `881783c` (đúng hạn cron ngày 1) + +- **ef-core-migration/SKILL.md:** latest-mig 56→**59** + append bảng rows 57/58/59 + Mig 14/Phase-7 Budget annotate `DROPPED Mig 50`. +- **skills/README.md:** ef-core Mig 55→59 + gotcha cite #69→**76** (heading gốc gotchas.md). +- **docs/CLAUDE.md:** Budget module `REMOVED Mig 50 (S61)` strike-through (§1 item 6 + roadmap Phase 7/8). +- **`docs/governance/vocab-alias-map.md` MỚI:** 3 vocab-fork (run-trace/Ngân-sách-PRO/all-inherit canonical) + thêm vào `$ExcludeExact` governance-detectors (anti self-match; detector pure-grep nên flag stay "documented-known"). +- **Re-tier STATUS/HANDOFF mega-line** 5→3 blurb (S92/S91 → archive tier-S94, byte-exact conservation **delta=0**, BOM-preserved) + **hoist 3 UAT-carry** (S92 non-admin-menu · S91 change-pw · S91 NCC-demo) vào blockers (reviewer flag conservation). +- **FD memory distill** (H17 loop strike-1 → **CLEARED**): frontend-designer L1 **26129→21492B**, 5 war-story (S66/S65/S58/S55/S47) → `archive/2026-06.md` + `_INDEX` + gist; Lessons value-protect (anti-#53/Tailwind-v4-stop/rig-#3/lucide) lên L1. budget.json measured refreshed. +- **Workflow `wf_2d687d27`** 4-cluster draft→adversarial-verify: reviewer bắt **#74 paraphrase-drift** (em sửa từ heading gốc) + **AS-10 residual reviewer self-write reverted** (git-diff backstop). detector **27→25** (2 real drift clear; còn lại module-local false-pos). + +## (2) Import NCC DONGDUONG `ba4b8e0` + +- Excel anh Kiệt "Database NCC & Nhà thầu phụ" — 4 NCC, ~30 field. **Phát hiện:** 3 NCC (TRUONGGIANG/TANPHU/TGN) **đã seed sẵn** S55/S59 (data khớp) → chỉ **DONGDUONG** mới. +- Scope anh chốt = **option-3** (9 field entity + gói extras Loại/NĐD/TK/GUQ/Trạng-thái vào `Note`). **KHÔNG migration** (data-only seed). `SeedRealMasterDataAsync` ungated idempotent → prod 20→**21 NCC** (cicd #477: sqlcmd 21 rows, DONGDUONG type=2, Note "Thang máy"). +- **Backlog "15-18 field note-lại-từ-từ-tính"** (bank tách/link GUQ-GPKD-HSNL/địa-chỉ-VP/PMH... + enum SupplierType thêm "Cả hai") → `docs/STATUS` Maintenance backlog. + +## (3-5) 3 PE bug-fix theo UAT anh Kiệt/chị Trà/anh Chương + +- **`e657faa` — ô "Cấp này KẾT THÚC quy trình" opt-out bỏ-tick-được** (anh Kiệt "cái này option thôi"): AllowApproverFinalize (Mig 58, S89 auto-finalize im-lặng) NAY = **2-tier** — Designer tick = **cấp quyền** (level được phép finalize), phiếu = **thực-thi** (mặc-định tick=kết-thúc, bỏ-tick=trình-CEO). +param `applyLevelFinalize` (default-true backward-compat) xuyên interface→service (guard `&& applyLevelFinalize`)→command→handler→controller + FE checkbox 2-app. +test #6 (opt-out→advance-CEO). Run #478. +- **`36cbf8b` — chuông tự-sạch noti "cần duyệt"** (chị Trà/anh Kiệt "chuông không bỏ ra được"): noti "Phiếu cần bạn duyệt" cũ KHÔNG tự xóa khi phiếu được duyệt-thay/hoàn-tất bởi người khác. Fix: `LogTransitionAsync` (chạy MỌI transition) mark-read `ReadAt` mọi noti Generic+RefId=phiếu unread TRƯỚC block notify-cấp-mới. `ExecuteUpdateAsync` best-effort BE-only. +test #7 (finalize→noti CEO cũ mark-read). Run #479. +- **`0c2f9f6` — khóa sửa giá đề xuất PRO/CCM sau gửi-duyệt** (anh Kiệt/chị Trà "duyệt là fix"): screenshot drafter=PRO điền Min/Max SAU khi chị Trà duyệt. Root: 2 handler cố-ý "KHÔNG ràng Phase" (Mig 54). Fix ĐẢO: non-admin chỉ sửa Nháp/TraLai, đã-gửi-duyệt/đã-duyệt/từ-chối → ConflictException; Admin override. BE (PeSuggestedPriceFeatures) + FE (PeDetailTabs `SuggestedPriceRows` gate `&& isEditablePhase` 2-app) + **4 test** (spec-change: sửa `SeedPeAsync` default ChoDuyet→DangSoanThao). Run #480. +- **Delete-sau-duyệt = ĐÃ chặn sẵn** — không cần fix: FE nút Xóa chỉ hiện `DangSoanThao` + BE delete-guard block non-draft. chị Trà chắc test phiếu Nháp. +- **Checkbox "ko được"** (anh Chương) = **browser cache** (gotcha #77): verify prod bundle `0MU-kb4N` BYTE-LEVEL chứa fix ("BỎ tick"), "✅ static" cũ MẤT; index.html no-cache đúng + no-service-worker → **incognito = golden-test**. + +## Lessons + +1. **verify-deployed-artifact-byte-level** (gotcha #77 + `feedback_verify_deployed_artifact_byte_level`): cache≠deploy — curl-grep bundle prod tìm marker fix; incognito golden. Tiết-kiệm giờ debug sai hướng. +2. **#53 return-garble ×3** (`feedback_agent_return_garble_recover`): investigator + cicd×2 trả text-memory-curation thay verdict; WORK + diary ĐÚNG → recover từ agent-memory KHÔNG re-spawn; instruction-fix "return verdict" ăn lần-3 (không 100%). +3. **2-tier-permission** (grant-vs-exercise): config = cấp quyền, runtime = thực-thi — tách rõ (Designer AllowApproverFinalize vs phiếu applyLevelFinalize). +4. **spec-change→update-test-cũ** (rules §7): đảo "KHÔNG ràng Phase" → sửa SeedPeAsync seed-phase để 15 test cũ sống + 4 test mới. + +## State (verified) +Mig **59** · **88** bảng · **440** test (45D+395I, +6 S96) · gotcha **77** · menu 54 · bundle admin `COYAX-yQ`/user `0MU-kb4N` (Run #480) · prod **21 NCC** / 17 user. + +## Carry / NEXT +- **🔴 anh:** restart CLI · UAT **incognito** checkbox anh Chương · cho **số-phiếu + user** vụ "lỗi phân quyền vào phiếu" (nhiều khả năng config: user chưa gán approver Cấp phiếu đang chờ). +- **🔴 em:** cicd-monitor S-tag-drift S97/S98→S96 reconcile (closeout này) · monthly re-tier mega-line (giờ 4-blurb S96/S95/S94/S93) · Supplier-schema-mở-rộng backlog (khi anh chốt). +- **Pending product (carry):** Section B cột Dự-án · Ngưỡng giá CEO Mig 54 · "C" chuyển phiếu→dự án. diff --git a/docs/gotchas.md b/docs/gotchas.md index 365a587..b6ef6a0 100644 --- a/docs/gotchas.md +++ b/docs/gotchas.md @@ -1298,6 +1298,18 @@ for h in resp.points: # ← .points không phải iterable trực tiếp **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). +### 77. SPA deploy bundle cache-lag — user thấy UI CŨ dù đã deploy (index.html cache / tab-SPA-mở) (Session 96) + +**Triệu chứng:** Deploy FE xong (bundle rotate verified prod), nhưng user (anh Chương UAT) VẪN thấy UI CŨ dù Ctrl+F5 + logout/login — checkbox opt-out mới không hiện, vẫn "✅ Cấp này KẾT THÚC" static cũ. Team "bó tay rồi". + +**Cơ chế:** Vite đặt hash trong TÊN file (`index-.js`, `Cache-Control: immutable max-age=1năm` = ĐÚNG). `index.html` = `Cache-Control: no-cache` (ĐÚNG chuẩn — revalidate ETag mỗi load). Nhưng: (a) tab SPA đang-mở chạy JS cũ trong RAM (cần reload thật, không chỉ F5-nửa-vời); (b) browser đôi khi giữ `index.html` cached bất-chấp no-cache → trỏ file JS CŨ (tên hash cũ). KHÔNG có service-worker (fe-user grep `serviceWorker|workbox|VitePWA` = 0) → không phải SW-cache. + +**Chẩn-đoán (phân-biệt cache-vs-deploy — QUAN TRỌNG, đừng đoán):** **verify bundle prod BYTE-LEVEL**: `JS=$(curl -s $BASE/ | grep -oE '/assets/index-[A-Za-z0-9_-]+\.js')` → `curl -s "$BASE$JS" | grep -ao ""` + `grep ""`. Fix-string PRESENT + old-string GONE = deploy OK → **100% client-cache** (KHÔNG phải deploy-fail). S96: prod `0MU-kb4N` chứa "BỎ tick"/"Đã BỎ tick", "bạn duyệt xong" cũ MẤT → xác nhận cache. + +**Fix (client):** **incognito window (Ctrl+Shift+N) = golden-test** (không dùng cache, chắc-chắn bundle mới → nếu incognito OK = 100% cache). Hoặc F12→Application→Clear site data→reload. **Đừng chỉ Ctrl+F5** (đôi khi không xóa index.html cached). **Server ĐÃ đúng chuẩn** (index.html no-cache + JS hash-immutable) — KHÔNG cần fix infra. + +**Quy tắc:** UAT báo "fix chưa ăn" sau deploy → verify bundle prod byte-level TRƯỚC khi nghi deploy-fail; **incognito = phép-thử vàng** tách cache khỏi bug. Liên-quan #69 (bundle non-determ) · `feedback_verify_deployed_artifact_byte_level`. + **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`.