diff --git a/.claude/agent-memory/cicd-monitor/MEMORY.md b/.claude/agent-memory/cicd-monitor/MEMORY.md index eccfadd..214c99c 100644 --- a/.claude/agent-memory/cicd-monitor/MEMORY.md +++ b/.claude/agent-memory/cicd-monitor/MEMORY.md @@ -51,8 +51,8 @@ Read-only CI/CD + post-deploy verifier SOLUTION_ERP. Polls Gitea Actions API, ve - **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:** **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 60 `20260701120138_AddPeEndedByLevelFinalize`** (S98 #482; PE +1 AddColumn `EndedByLevelFinalize` bit NOT NULL default 0 + `Sql()` backfill Phase=7-marker→=1 [SQL-Server-only, tests skip-replay #63] — VERIFIED-APPLIED-PROD history-HEAD + col-exists is_nullable=0 default CONVERT([bit],(0)) + backfill=0 fresh-UAT). Prev Mig 59 `AddCcmBudgetPeriodToPurchaseEvaluation` (S88 #345). Path `src/Backend/SolutionErp.Infrastructure/Persistence/Migrations/`. Prod check `sqlcmd __EFMigrationsHistory ORDER BY MigrationId DESC TOP 5`. ⚠️ **`sys.tables` (is_ms_shipped=0) = 89** (S98 LIVE-verified pre AND post #482 — narrative/spec-88 STALE, re-ground 89 = current truth; AddColumn-only migs don't change count → when commit touches no schema, 89 correct don't FAIL. 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 (S98 Run #482/id=482 — JS-rotated real-FE, CSS-frozen):** admin js **`DR9q2VUy`**/css `Bbtesa6B` · user js **`Bgz8u4E5`**/css `BmuPz_Dy` (JS rotated from S97 `Cf0o8dx8`/`x8rppRAK` = real PeWorkflowPanel 2-app endsBeforeCeo-gate FE change; CSS IDENTICAL = JSX-logic-only ⟹ #69-REFINE byte-identical-CSS⟹same-hash). ⚠️ **id ≠ run_number(368); 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. +- **Mig latest repo:** **Mig 61 `20260701142752_BackfillEndedByLevelFinalizeFromChangelog`** (S97 #484; data-only NO-schema, `Sql()` UPDATE `EndedByLevelFinalize=1` cho phiếu có finalize-marker ở `PurchaseEvaluationChangelogs` — fix Mig 60 soi NHẦM bảng — VERIFIED-APPLIED-PROD history-HEAD + A/005/A/008 flipped 0→1, A/010 stayed 0). Prev Mig 60 `AddPeEndedByLevelFinalize` (S98 #482 AddColumn bit default 0). Path `src/Backend/SolutionErp.Infrastructure/Persistence/Migrations/`. Prod check `sqlcmd __EFMigrationsHistory ORDER BY MigrationId DESC TOP 5`. ⚠️ **`sys.tables` (is_ms_shipped=0) = 89** (S98 LIVE-verified pre/post #482 — narrative/spec-88 STALE, 89=truth; AddColumn/data-only migs don't change count → commit touches no schema ⟹ 89 correct don't FAIL. Cross-ref COMMIT scope vs ambient count). enum-additive (e.g. `ApprovalAttachment=5`) = int-stored NO-mig → history NOT-advance + empty `git diff -- '*Migrations*'`. +- **Bundle hash live (S98 #482 last-FE-ship — JS-rotated real-FE, CSS-frozen):** admin js **`DR9q2VUy`**/css `Bbtesa6B` · user js **`Bgz8u4E5`**/css `BmuPz_Dy` (JS rotated real PeWorkflowPanel 2-app endsBeforeCeo-gate; CSS IDENTICAL=JSX-logic-only ⟹ #69-REFINE byte-identical⟹same-hash). Note #483 badge later rotated JS→`CeTA7Z82`/`CGaAyXen` CSS-same; #484 data-fix NO-FE-change → not snapshotted. ⚠️ **id ≠ run_number; 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 THAT run, NOT frozen baseline; ALWAYS re-snapshot LIVE pre-deploy (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,14 +70,11 @@ 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`) -- **🟢 S97-badge #483 (id=483, run_number 369) `9e12e80` GO ~5m13s (PASS) — FE-ONLY 8-file badge "✅ Đã được CEO duyệt" cho phiếu đi HẾT lên CEO (endsBeforeCeo=false), anh Kiệt FDC UAT.** Follow-up to #482 endsBeforeCeo runtime. 8 files ALL `fe-*/src`: `PeFinalizeChip.tsx`+`PeListPanel.tsx` 2-app + admin ListPage + user Inbox/Dashboard/ListPage. NO BE/Mig/test. Poll running→success 20:52:23→20:57:36 (~5m13s in-baseline). status=success ⟹ test-gate green (baseline **440** unchanged). 🎯 **FE JS ROTATED both apps**: admin `DR9q2VUy`→**`CeTA7Z82`** + user `Bgz8u4E5`→**`CGaAyXen`** (6 call-sites 2-app real diff) · **CSS FROZEN** Bbtesa6B/BmuPz_Dy (JSX-logic-only ⟹ #69-REFINE). Real-size admin 1,637,119 / user 1,543,467B `application/javascript` (SPA-trap control fake-hash→919B text/html) · Last-Modified admin 13:56:13GMT / user 13:57:09GMT =20:56/20:57+07 IN-WINDOW. 🔴 **BYTE-LEVEL grep #77 BOTH bundles**: new string `Đã được CEO duyệt` PRESENT count=1 admin AND user (matches source `PeFinalizeChip.tsx:26`) · prev-badge `Kết thúc tại` (S97 #481) still-present ⟹ additive no-regression ⟹ badge SHIPPED. 🔴 **Mig UNCHANGED (FE-only)**: history-top==`AddPeEndedByLevelFinalize`(Mig 60) NOT-advanced · sys.tables=88-excl-history [=89-incl; note: my SQL excluded `__EFMigrationsHistory` → count 88, memory-baseline 89 counts it; stable no-schema-change either frame]. Smoke: admin-root/eoffice-root 200, auth accessToken 468ch, `GET /api/purchase-evaluations` **200** items=9 (new FE prop did NOT break list serialization), api ready/live 200. 🔑 **FE-ONLY PASS = CI-success + JS-rotate-BOTH/CSS-frozen(#69) + real-size-vs-919b + LastMod-in-window + byte-grep-new-PRESENT-both(#77) + prev-badge-still-present(additive) + Mig-top-frozen + smoke-200 + PE-list-200-not-500**. ⚠️ tooling: busy-wait-spin ~5-15s/iter TOO-SLOW (poll timed-out mid-run twice) → run finished ~5m, single long-loop w/ 40×favicon-curl spacing worked; #69 hash-rotate held (real 2-app src diff). -- **🟢 S98 #482 (id=482, run_number 368) `8037fa0` GO ~4m (PASS) — CROSS-STACK BE+Mig60+FE+tests, endsBeforeCeo config→RUNTIME (phiếu lên CEO hết báo sai "không qua CEO", anh Kiệt FDC UAT).** 12 files: Domain PE +`EndedByLevelFinalize` · **Mig 60 `20260701120138_AddPeEndedByLevelFinalize`** (AddColumn bit NOT NULL default 0 + `Sql()` backfill Phase=7-marker→=1, SQL-Server-only tests-skip-replay #63) · Features list+detail ternary · WorkflowService · FE `PeWorkflowPanel.tsx` 2-app. Poll running→success 19:23→19:28. status=success ⟹ test-gate green (baseline **440**). 🔴 **Mig 60 APPLIED-PROD**: history-top==Mig60 (pre=Mig59, advanced) · col `EndedByLevelFinalize` bit is_nullable=0 default `CONVERT([bit],(0))` EXISTS · backfill=0 (fresh-UAT no-marker) · **sys.tables=89 pre AND post** (AddColumn no-new-table; ⚠️ spec/baseline-88 STALE, LIVE-truth=89 identical pre/post NOT regression). 🔴 **EF-TERNARY SQL-Server TRANSLATE LIVE-CONFIRMED (SQLite≠SQL Server)**: `GET /api/purchase-evaluations` **200** items=9 endsBeforeCeo-present (NOT 500 → `Phase==DaDuyet?EndedByLevelFinalize:subquery.Any()` translates ✅) + PE-detail `31faef0d` **200** endsBeforeCeo=False phase=7 (runtime-path executed = exact-bug-fix) + `/inbox` 200 + `/approval-workflows-v2` 200 (`/approved` 404=wrong-route NOT regression). 🎯 **FE JS ROTATED (real 2-app diff)**: admin `Cf0o8dx8`→`DR9q2VUy` + user `x8rppRAK`→`Bgz8u4E5` · **CSS FROZEN** Bbtesa6B/BmuPz_Dy (JSX-logic-only ⟹ #69-REFINE). Real-size 1,636,753/1,543,074B `application/javascript` (control fake→919B text/html SPA-trap) · Last-Modified admin 12:27:07GMT/user 12:27:59GMT =19:27+07 in-window. 🔴 **BYTE-LEVEL grep #77 admin bundle**: `endsBeforeCeo`=PRESENT(1)+`allowApproverFinalize`=PRESENT(2) ⟹ shipped (`finalizeFlowStep`=0=local-const MINIFIED expected-absent). Smoke: api ready/live+admin/eoffice-root 200, auth 468ch. w3wp recycle-clean (transient 127.0.0.1:5443 refused mid-recycle 19:25 → public 200 by verify). 🔑 **CROSS-STACK+MIG PASS = CI-success + Mig-top==HEAD + col-correct-default + sys.tables-stable + EF-ternary-200-NOT-500-live + JS-rotate/CSS-frozen(#69) + real-size-vs-919b + LastMod-in-window + byte-grep-field-PRESENT(#77) + smoke-200**. ⚠️ tooling: busy-wait-spin TOO-SLOW this Win-setup → single-shot-recheck + DLL-mtime-cross-signal beats blind-loop; no-jq→Python-JSON. -- _(S97 #481 `1c8fb6a` GO ~5m10s PASS — FE-ONLY PE finalize 2-fix mirror 2-app SHA-identical PeWorkflowPanel [badge `không trình tới`→`Kết thúc tại {name}` + checkbox opt-out→opt-in] NO-BE/mig/test · baseline-440 · JS admin`COYAX-yQ`→`Cf0o8dx8`/user`0MU-kb4N`→`x8rppRAK` rotated **CSS FROZEN** Bbtesa6B/BmuPz_Dy · real-size 1636732/1543053B · #77 byte-grep BOTH-apps new-PRESENT/old-ABSENT · Mig59-frozen sys.tables-88[STALE→89] · full verbatim → git `1c8fb6a` + archive `2026-06.md` via `_INDEX`)_ +- **🟢 S97 #484 (id=484, run_number 370) `fb2dfa9` GO ~5m (PASS) — DATA-FIX Mig 61 backfill EndedByLevelFinalize từ Changelogs (fix Mig 60 soi NHẦM bảng), phiếu finalize-CCM hết hiện sai "Đã được CEO duyệt", anh Kiệt FDC UAT.** 3 files: **Mig 61 `20260701142752_BackfillEndedByLevelFinalizeFromChangelog`**+Designer (data-only NO-schema, chỉ `Sql()` UPDATE set=1 cho phiếu có finalize-marker ở `PurchaseEvaluationChangelogs`) + docs/gotchas.md. Poll running→success ~21:31→21:36:28 (~5m in-baseline; ⚠️ `started_at/stopped_at`=None trong tasks API). status=success ⟹ test-gate green (baseline **440**). 🔴🔴 **BACKFILL EFFECT VERIFIED-PROD (điểm quan trọng nhất) sqlcmd `SELECT MaPhieu,EndedByLevelFinalize WHERE Phase=7`**: **A/005=1, A/008=1** (finalize-CCM set 0→1 = fix ăn) · **A/010=0** (CEO thật giữ nguyên = control OK, backfill KHÔNG over-reach). 🔴 **Mig 61 APPLIED-PROD**: `__EFMigrationsHistory` top==Mig61 (pre=Mig60, advanced). 🔴 **endsBeforeCeo FLIP LIVE (API)**: A/005 `3da9b890` → `endsBeforeCeo=True` (trước False = exact-bug-fix) · A/010 `31faef0d` → `False` (control). ⚠️ DTO field `endedByLevelFinalize`=None (không expose shape này) NHƯNG derived `endsBeforeCeo` phản-ánh col-DB=1 đúng ⟹ verify col qua sqlcmd NOT DTO. 🎯 **DATA-FIX ⟹ NO-FE-change**: không snapshot bundle (0 `fe-*/src` diff; #69 rotate benign nếu có ≠ ship-signal). Smoke: api-ready/admin-root/eoffice-root 200×3 + `GET /purchase-evaluations` **200** (list không vỡ). 🔑 **DATA-FIX-BACKFILL PASS = CI-success + Mig-top==HEAD + sqlcmd-target-rows-flip-EXACT(A/005+A/008=1) + control-untouched(A/010=0) + derived-API-field-FLIP-live + smoke-200**. ⚠️ tooling: busy-wait favicon-spin ~10s/iter(40×)=TOO-SLOW → 250×/iter≈50s hit terminal; integrated-auth `-E` `-h -1 -W`; A/010-id qua sqlcmd-inline-lookup. +- _(endsBeforeCeo-saga PE finalize UAT cluster anh Kiệt: **S98 #482 `8037fa0` CROSS-STACK + Mig60 `AddPeEndedByLevelFinalize`** [config→RUNTIME · Mig-APPLIED col-bit-default-CONVERT(0) backfill=0 sys.tables=89-pre/post · 🔴 EF-TERNARY-SQL-Server-TRANSLATE-LIVE list-200-NOT-500 + detail-endsBeforeCeo-False-runtime · JS `Cf0o8dx8`/`x8rppRAK`→`DR9q2VUy`/`Bgz8u4E5` CSS-frozen · #77 field-PRESENT] · **S97-badge #483 `9e12e80` FE-ONLY 8-file badge "✅ Đã được CEO duyệt"** [JS→`CeTA7Z82`/`CGaAyXen` CSS-frozen · #77 new-str-BOTH+prev-additive · Mig60-frozen list-200] · **S97 #481 `1c8fb6a` FE-ONLY 2-fix** [badge `không trình tới`→`Kết thúc tại {name}`+opt-out→opt-in · JS→`Cf0o8dx8`/`x8rppRAK` CSS-frozen · #77 new-PRESENT/old-ABSENT] — all baseline-440 all PASS, full verbatim → git + `2026-06.md` via `_INDEX`)_ - _(S96 #480 `0c2f9f6` cross-stack PE 3-commit-range khóa-giá+mark-read+opt-out NO-mig baseline-440+new-PeSuggestedPriceSetterAuthzTests JS-rotate/CSS-frozen · S96 #479 `36cbf8b` PE 2-commit mark-read-stale-noti baseline-436 JS-rotate/CSS-frozen · all PASS Mig59-frozen · full verbatim → git + archive `2026-06.md` via `_INDEX`)_ -- _(S96 #477 `ba4b8e0` Infra data-seed NCC `DONGDUONG` ungated-idempotent 🎯 pre=3→post=4 suppliers total=21-EXACT Type=2 **FE-FROZEN** 0-fe-src(#69) · 🔑 **DATA-SEED-PASS = pre/post-DB-row-EXACT-delta + DLL-mtime + w3wp-recycle + Mig-frozen + API-payload-contains-row** · ⚠️ sqlcmd `-W` diacritic-LIKE false-NEG use `_`-wildcard; base64-EncodedCmd-FAIL→`.ps1`-File · S95 #476 `18a17f5` GOVERNANCE-ONLY .ps1-triggers-CI JS-rotate/CSS-frozen 🔑 GOVERNANCE-PASS=CI-green+JS-rotate(#69)+3×200+Mig-frozen — all PASS full verbatim → git + archive `2026-06.md` via `_INDEX`)_ -- _(S93 #473 `8ee8f3e` PE tree-node show-CODE NO-MIG · S92 #472 `1408d4e` BE permission-revoke +5-menu VERIFY-PROD [non-Admin CanRead=0, Pe_* untouched; ⚠️ **PROD Identity tables NON-prefixed `Roles` NOT `AspNetRoles`**] · S91 #470 `55494ad` GO-LIVE no-resurrect demo-seed-gate [**PATTERN go-live-no-resurrect = pre+post-DB-count-diff + dll-in-window + w3wp≥run-window**; integrated-auth `-E`] · S90 #465 `a71753b` 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`)_ +- _(**S96 #477 `ba4b8e0` Infra data-seed NCC `DONGDUONG`** pre=3→post=4 total=21-EXACT · 🔑 **DATA-SEED-PASS = pre/post-DB-row-EXACT-delta + DLL-mtime + w3wp-recycle + Mig-frozen + API-payload-contains-row** · ⚠️ sqlcmd `-W` diacritic-LIKE false-NEG use `_`-wildcard; base64-EncodedCmd-FAIL→`.ps1`-File · S95 #476 GOVERNANCE-ONLY .ps1-triggers-CI 🔑 GOVERNANCE-PASS=CI-green+JS-rotate(#69)+3×200+Mig-frozen · S93 #473 PE tree-CODE · S92 #472 permission-revoke [⚠️ **PROD Identity tables NON-prefixed `Roles` NOT `AspNetRoles`**] · **S91 #470 GO-LIVE 🔑 PATTERN no-resurrect = pre+post-DB-count-diff + dll-in-window + w3wp≥run-window** [integrated-auth `-E`] · S90 #465 PE draft-private → all PASS, full verbatim → git + `2026-06.md` via `_INDEX`)_ +- _(S89 #348 `1aa3bdb` PE 1→N multi-winner endpoint-411→401 · S88-quad #347 `73cce1f` PE D1 re-key+CEO-notify · S88-bis #346 `0d3c0cf` FE-only js+css-BOTH-rotate · **S88 #345 `9b1ee0c` Mig 59 `AddCcmBudgetPeriodToPurchaseEvaluation`** PATCH-401+7-authz · **S87 #344 `f1b10e9` FULL-STACK + Mig 58 `AddPeMultiWinnerAndLevelFinalize`** backfill-winners=13 · S86 #343 BE-only notify-exclude ship-proof=Infra.dll-mtime · S85 #342 DOCS+SQL-no-op INVERTED-PASS-FROZEN [#73 TZ+#69] · S83 #333 BE-only guard-V2 hash-FROZEN-shipped · S78 #330 enum-attach · S76 #318 Mig56-ProInitial · S74-bis #315 Mig55 · S73 #313 Mig54-401-not-404 · S69b #307 Office-seed-16/16 → all PASS, full verbatim → git + `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/docs/HANDOFF.md b/docs/HANDOFF.md index 0035832..7f67ccc 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 (S97 — **PE finalize 4-fix UAT anh Kiệt FDC buổi live — em-main-led, prod-verified Run #481+#482.** **(1)** badge `"không trình tới"`→**`"Kết thúc tại {finalizeLevelName}"`** (hiện "Kết thúc tại CCM")+tooltip. **(2)** đảo default checkbox "Cấp KẾT THÚC" **opt-out→opt-in** (`useState true→false`+reset+helper reword+comment-drift fix). Mirror 2-app SHA `bcf812fd`, 0 BE/mig/test (BE tôn trọng cờ FE; param default=fallback). Workflow `wf_0e01fdba-209` (reviewer PASS 0-issue). Commit `1c8fb6a`. **cicd #481 PASS byte-level #77:** JS admin `COYAX-yQ`→**`Cf0o8dx8`**/user `0MU-kb4N`→**`x8rppRAK`** · NEW `Kết thúc tại`+helper PRESENT / OLD `không trình tới`+`Đã BỎ tick` ABSENT · Mig 59/88 frozen · smoke 200×3. **Lesson:** #53 return-garble **lần-4** (cicd trả memory-curation thay verdict → recover-from-diary NO re-spawn) · BE-honors-explicit-flag → đảo-default chỉ-FE zero-BE-churn. **(3) endsBeforeCeo config→RUNTIME (Mig 60 `EndedByLevelFinalize` `8037fa0` #482 cross-stack):** phiếu opt-out finalize→lên CEO nhưng sơ đồ báo sai "không qua CEO" (endsBeforeCeo suy config). Fix field runtime set-nhánh-finalize → DaDuyet đọc runtime; 4 projection + FE gate + backfill; test 440 (repro peFinButWentCeo) + reviewer PASS 0-issue + cicd #482 **bug fixed LIVE** (PE-detail endsBeforeCeo=False). gotcha #78. **(4) badge "✅ Đã được CEO duyệt" (`9e12e80` #483 FE-only):** phiếu DaDuyet+`!endsBeforeCeo`→PeFinalizeChip badge (đối xứng fix-3, tận-dụng cờ runtime, 0 BE/mig, mirror 2-app+6 site, byte-#77 PRESENT). **State: Mig 60·89 bảng·440 test·gotcha 78·menu 54·bundle admin `CeTA7Z82`/user `CGaAyXen` (Run #483)·prod 21 NCC/17 user.** **🔴 NEXT anh:** UAT **incognito** phiếu "8 MEP Sub Hệ thống solar": (a) sơ đồ hết "không qua CEO" + Bước 3 CEO KHÔNG mờ [fix-3], (b) badge+checkbox [fix 1-2] (+ vụ cũ "lỗi phân quyền": số-phiếu+user). **🔴 NEXT em:** monthly re-tier mega-line (giờ 5-blurb). → log `2026-07-01-S97-pe-finalize-wording-default-flip.md`) · **Prev S96** (S96 — **buổi UAT LỚN anh Kiệt/chị Trà/anh Chương live + monthly-audit, em-main-led, 5 commit prod-verified.** **(1)** Monthly drift audit `881783c` (docs-only CI-skip): ef-core SKILL Mig→59 + rows 57/58/59 · skills/README + docs/CLAUDE Budget-removed · **`vocab-alias-map.md` MỚI** (3 fork + `$ExcludeExact`) · **re-tier mega-line 5→3** (S92/S91→archive, conservation delta=0 BOM) + hoist UAT-carry→blockers · **FD distill** (H17 strike-1 CLEARED L1 26129→21492B + archive/`_INDEX`/gist + Lessons L1). Workflow `wf_2d687d27` 4-cluster (reviewer bắt #74-drift + AS-10 residual reverted). detector 27→25. **(2)** Import NCC **DONGDUONG** `ba4b8e0` (Excel anh Kiệt; 3 NCC đã sẵn → +1 no-mig prod 21 NCC Run #477); backlog 15-18 field→Next-up. **(3-5)** 3 PE bug-fix UAT: `e657faa` ô "KẾT THÚC quy trình" (S89-auto)→**opt-out bỏ-tick-được** (2-tier grant/exercise +`applyLevelFinalize`, #478) · `36cbf8b` **chuông tự-sạch** noti "cần duyệt" (mark-read ExecuteUpdate BE-only, #479) · `0c2f9f6` **khóa sửa giá PRO/CCM sau gửi-duyệt** ("duyệt là fix" non-admin Nháp/TraLai+Admin-override, +4 test, #480). Test 434→440. **Delete-sau-duyệt = ĐÃ chặn sẵn**. Checkbox "ko-được" = **browser-cache** (verify byte-level prod `0MU-kb4N` chứa fix; incognito golden). **State: Mig 59 · 88 bảng · 440 test (45D+395I) · gotcha 77 · menu 54 · bundle admin `COYAX-yQ`/user `0MU-kb4N` · prod 21 NCC/17 user.** **🔴 NEXT anh:** ⚠️ restart CLI · UAT **incognito** checkbox + cho **số-phiếu/user** vụ "lỗi phân quyền vào phiếu". **🔴 NEXT em:** cicd S-tag-drift S97/S98→S96 reconcile (closeout) · monthly re-tier mega-line (giờ 4-blurb). **Lessons:** verify-deployed-artifact-byte-level (cache≠deploy; incognito golden — gotcha #77) · #53-return-garble ×3 recover-from-agent-memory (instruction-fix "return-verdict" ăn) · 2-tier-permission · spec-change→update-test. → log `2026-07-01-S96-uat-pe-fixes-monthly-audit.md`) · **Prev S95** (S95 — **Harness-17 adopt (Vòng tự-cải-thiện bộ-nhớ Đo→Tinh-chỉnh→Kiểm) — governance-only 0 prod code, em-main-led 3-workflow.** `/check-email AI_INFRA` (0 directed mới; H16 áp trọn S93) → `/adap-apply` H17 (2 broadcast hash-MATCH `reviewer_gate:PASS`). **10/10 mục 🔴:** REUSE-cite A2=§H MFE/C3=D9/CG-2=value_protect/archive=§A + **build mới** `scripts/memory-selfimprove-audit.ps1` (C1 spec-audit NO-API, **runtime-verified bắt frontend-designer over-cap thật**) + `.claude/governance/reinject-ledger.md` (B2 CG-1 N=3) + engine §I + `session-start §2.1.7`/`session-end §L.b(c)` wire + HCV alias no-seed. **3-workflow:** WF1 `wf_f085d7c4-d78` ground-truth + WF2 `wf_8e73c1d6-ee6` 3-lane PASS + WF3 `wf_6f44eddf-680` **fault-injection 13-inject teeth-proof** + integration + cross-doc (0 application-defect). **2 commit:** `18a17f5` (cicd **Run #476 PASS** prod 200×3 bundle `0T6vVJST`/`BGXEVZO6` Mig 59) + `65b434a` (docs-only CI-skip). adap-report + 2 email AI_INFRA (`54789e19`+`8c94fa34`). **Dogfood AS-10 4-fire reverted** (git-diff = net thật; **WF3 explicit-return-only STILL self-wrote → instruction-fix NOT 100%**, E-006 recurrence, guard HELD 4/4; cicd-monitor diary KEPT = legit normal-spawn). **Lessons:** fault-injection-`-RepoRoot`-temp chứng checker-teeth · Lane B #53 empty→em-main self-gate. **State: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · prod 17 user/7 NCC.** **🔴 NEXT anh:** ⚠️ restart CLI (§2.1.7 + §L.b(c) H17-loop wire runtime — command `.md` no hot-reload). **🔴 NEXT em:** frontend-designer distill (WATCH strike-1 = H17 loop's live finding, chờ strike-2/anh) · monthly **2026-07-01 (hôm nay)** re-tier STATUS/HANDOFF mega-line + ef-core SKILL Mig→59 + docs/CLAUDE Budget-removed + 3 vocab-fork alias-map. **Pending product (carry):** Section B cột Dự-án · Ngưỡng CEO Mig 54 · "C" chuyển phiếu→dự án. → log `2026-07-01-S95-harness17-adopt.md`) · **Prev S94** (S94 — **anh-directive nâng cap lead 220K→380K** (canonical `memory-budget.json` · SE-override lead KHÔNG còn AI_INFRA-parity, subs giữ 60K/50K · mark H-15 v4-delta `RC-pqhuy1987-29-06-2026-23-25-50` · flush 3 echo · MFE live-read 380K) + **re-tier 2 mega-line** (fix Read-25K/call OOM): STATUS 389→89 · HANDOFF 732→12 dòng · 332KB→**34KB −90%** · ≤S90 → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` **0 byte-loss** · detector 27=baseline · `5f61b03` pushed CI-skip. MFE eval-all baseline: LEAD 29-item/380K=0.92% · SUB ≥85% (impl-backend 94%/impl-frontend 85%/reviewer 88%). **Lesson:** trần budget ⟂ harness Read-25K/call = 2 khóa độc-lập (cap-raise KHÔNG unblock mega-line Read → cần re-tier) · mega-LINE=tooling-breaker (ưu-tiên) vs mega-FILE nhiều-dòng=token-cost · re-tier=archive-không-cắt + assert head+tail==orig. em-main solo (0 sub, 0 fan-out). **State GIỮ NGUYÊN: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · bundle admin `CDn40vpV`/user `CoPmPBg7` · prod 17 user/7 NCC.** **🔴 NEXT anh:** ⚠️ restart CLI (session-start echo 380K + budget v4 runtime; số canonical đã sống ngay) · UAT eoffice node Dự án mã (carry S93). **🔴 NEXT em:** monthly **2026-07-01 (MAI!)** — ef-core SKILL Mig→59 · docs/CLAUDE Budget-removed · 3 vocab-fork alias-map · re-tier `migration-todos.md` (mega-FILE thứ-3, 807 dòng — không gấp, không vỡ tooling) · FD L1 26.1KB WATCH strike-1 (**test-specialist RESOLVED 7.8KB** — bỏ khỏi carry). **Pending product:** Section B cột Dự-án wire · Ngưỡng giá CEO Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. → log `2026-06-29-S94-cap-380k-retier-megaline.md`) · **Prev S93** (S93 — **(1) PE node Dự án hiện MÃ thay tên dài (anh Kiệt FDC) prod-verified Run #473** `8ee8f3e`: BE thread ProjectCode (DTO+3 projection+search) + FE 2-app SHA-mirror (render code+tooltip+sort) NO-MIG; grep bắt site#3 thoát replace_all; test 434; bundle admin `CDn40vpV`/user `CoPmPBg7`. **(2) adopt Harness-16 MFE (memory-fidelity-EVAL) 2-workflow PASS `9580098` 0-prod-code:** WF1 `wf_4c63e1bd` (ground-truth + bắt BLOCKING vocab-fork memory-fidelity≠H6.7) + WF2 `wf_13e3d35a` 3-lane PASS (denom-29-re-derived + READ-ONLY-proof + honesty + verb-trap-defeated); `scripts/mfe-eval.ps1` deterministic NO-API (LEAD coverage-FIT 29/220K=1.5% + age-band + Goodhart 21/9 · SUB đo-thật impl-backend 94%/reviewer 88% · prose→N/A) + judge-SCAFFOLD + budget:mfe + eval/mfe/ seed + engine §H + wire-opt-in + email AI_INFRA. AS-10 dogfood (WF1 residual caught+reverted; WF2 0-residual). #53 recover-from-disk. user-MEMORY compact 23.7→7.8KB. **State: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · bundle admin `CDn40vpV`/user `CoPmPBg7` · prod 17 user/7 NCC.** **🔴 NEXT anh:** ⚠️ restart CLI (MFE opt-in + wire) · UAT eoffice node Dự án mã · (anh Kiệt) nếu ô khoanh là Hạng-mục→báo em đổi work-item-code. **🔴 NEXT em:** monthly **2026-07-01 GẤP** re-tier mega-line (detector D1 OOM do bloat — STATUS 61K/HANDOFF 46K-char KHÔNG Read/Edit) + ef-core Mig→59 + Budget-removed docs + 3 vocab-fork + curate test-spec/FD L1. **Pending product:** Section B cột Dự-án · Ngưỡng giá CEO Mig 54 · "C" chuyển phiếu→dự án. → log `2026-06-29-S93-pe-projectcode-harness16-mfe.md`) · *(session ≤S90 đã tách → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` + `docs/changelog/sessions/`; re-tier S94)* +**Last updated:** 2026-07-01 (S97 — **PE finalize 4-fix UAT anh Kiệt FDC buổi live — em-main-led, prod-verified Run #481+#482.** **(1)** badge `"không trình tới"`→**`"Kết thúc tại {finalizeLevelName}"`** (hiện "Kết thúc tại CCM")+tooltip. **(2)** đảo default checkbox "Cấp KẾT THÚC" **opt-out→opt-in** (`useState true→false`+reset+helper reword+comment-drift fix). Mirror 2-app SHA `bcf812fd`, 0 BE/mig/test (BE tôn trọng cờ FE; param default=fallback). Workflow `wf_0e01fdba-209` (reviewer PASS 0-issue). Commit `1c8fb6a`. **cicd #481 PASS byte-level #77:** JS admin `COYAX-yQ`→**`Cf0o8dx8`**/user `0MU-kb4N`→**`x8rppRAK`** · NEW `Kết thúc tại`+helper PRESENT / OLD `không trình tới`+`Đã BỎ tick` ABSENT · Mig 59/88 frozen · smoke 200×3. **Lesson:** #53 return-garble **lần-4** (cicd trả memory-curation thay verdict → recover-from-diary NO re-spawn) · BE-honors-explicit-flag → đảo-default chỉ-FE zero-BE-churn. **(3) endsBeforeCeo config→RUNTIME (Mig 60 `EndedByLevelFinalize` `8037fa0` #482 cross-stack):** phiếu opt-out finalize→lên CEO nhưng sơ đồ báo sai "không qua CEO" (endsBeforeCeo suy config). Fix field runtime set-nhánh-finalize → DaDuyet đọc runtime; 4 projection + FE gate + backfill; test 440 (repro peFinButWentCeo) + reviewer PASS 0-issue + cicd #482 **bug fixed LIVE** (PE-detail endsBeforeCeo=False). gotcha #78. **(4) badge "✅ Đã được CEO duyệt" (`9e12e80` #483 FE-only):** phiếu DaDuyet+`!endsBeforeCeo`→PeFinalizeChip badge (đối xứng fix-3, tận-dụng cờ runtime, 0 BE/mig, mirror 2-app+6 site, byte-#77 PRESENT). **(5) Mig 61 backfill fix (`fb2dfa9` #484 data-fix):** check A/005 "CEO duyệt chưa" → A/005/A/008 finalize-CCM KHÔNG qua CEO nhưng badge sai (Mig 60 backfill nhầm bảng Approvals→Changelogs). Mig 61 đúng bảng → prod A/005/A/008 flag 0→1 endsBeforeCeo-True (cicd #484), A/010 control. gotcha #79. **State: Mig 61·89 bảng·440 test·gotcha 79·menu 54·bundle admin `CeTA7Z82`/user `CGaAyXen` (Run #484 data-fix)·prod 21 NCC/17 user.** **🔴 NEXT anh:** UAT **incognito** phiếu "8 MEP Sub Hệ thống solar": (a) sơ đồ hết "không qua CEO" + Bước 3 CEO KHÔNG mờ [fix-3], (b) badge+checkbox [fix 1-2] (+ vụ cũ "lỗi phân quyền": số-phiếu+user). **🔴 NEXT em:** monthly re-tier mega-line (giờ 5-blurb). → log `2026-07-01-S97-pe-finalize-wording-default-flip.md`) · **Prev S96** (S96 — **buổi UAT LỚN anh Kiệt/chị Trà/anh Chương live + monthly-audit, em-main-led, 5 commit prod-verified.** **(1)** Monthly drift audit `881783c` (docs-only CI-skip): ef-core SKILL Mig→59 + rows 57/58/59 · skills/README + docs/CLAUDE Budget-removed · **`vocab-alias-map.md` MỚI** (3 fork + `$ExcludeExact`) · **re-tier mega-line 5→3** (S92/S91→archive, conservation delta=0 BOM) + hoist UAT-carry→blockers · **FD distill** (H17 strike-1 CLEARED L1 26129→21492B + archive/`_INDEX`/gist + Lessons L1). Workflow `wf_2d687d27` 4-cluster (reviewer bắt #74-drift + AS-10 residual reverted). detector 27→25. **(2)** Import NCC **DONGDUONG** `ba4b8e0` (Excel anh Kiệt; 3 NCC đã sẵn → +1 no-mig prod 21 NCC Run #477); backlog 15-18 field→Next-up. **(3-5)** 3 PE bug-fix UAT: `e657faa` ô "KẾT THÚC quy trình" (S89-auto)→**opt-out bỏ-tick-được** (2-tier grant/exercise +`applyLevelFinalize`, #478) · `36cbf8b` **chuông tự-sạch** noti "cần duyệt" (mark-read ExecuteUpdate BE-only, #479) · `0c2f9f6` **khóa sửa giá PRO/CCM sau gửi-duyệt** ("duyệt là fix" non-admin Nháp/TraLai+Admin-override, +4 test, #480). Test 434→440. **Delete-sau-duyệt = ĐÃ chặn sẵn**. Checkbox "ko-được" = **browser-cache** (verify byte-level prod `0MU-kb4N` chứa fix; incognito golden). **State: Mig 59 · 88 bảng · 440 test (45D+395I) · gotcha 77 · menu 54 · bundle admin `COYAX-yQ`/user `0MU-kb4N` · prod 21 NCC/17 user.** **🔴 NEXT anh:** ⚠️ restart CLI · UAT **incognito** checkbox + cho **số-phiếu/user** vụ "lỗi phân quyền vào phiếu". **🔴 NEXT em:** cicd S-tag-drift S97/S98→S96 reconcile (closeout) · monthly re-tier mega-line (giờ 4-blurb). **Lessons:** verify-deployed-artifact-byte-level (cache≠deploy; incognito golden — gotcha #77) · #53-return-garble ×3 recover-from-agent-memory (instruction-fix "return-verdict" ăn) · 2-tier-permission · spec-change→update-test. → log `2026-07-01-S96-uat-pe-fixes-monthly-audit.md`) · **Prev S95** (S95 — **Harness-17 adopt (Vòng tự-cải-thiện bộ-nhớ Đo→Tinh-chỉnh→Kiểm) — governance-only 0 prod code, em-main-led 3-workflow.** `/check-email AI_INFRA` (0 directed mới; H16 áp trọn S93) → `/adap-apply` H17 (2 broadcast hash-MATCH `reviewer_gate:PASS`). **10/10 mục 🔴:** REUSE-cite A2=§H MFE/C3=D9/CG-2=value_protect/archive=§A + **build mới** `scripts/memory-selfimprove-audit.ps1` (C1 spec-audit NO-API, **runtime-verified bắt frontend-designer over-cap thật**) + `.claude/governance/reinject-ledger.md` (B2 CG-1 N=3) + engine §I + `session-start §2.1.7`/`session-end §L.b(c)` wire + HCV alias no-seed. **3-workflow:** WF1 `wf_f085d7c4-d78` ground-truth + WF2 `wf_8e73c1d6-ee6` 3-lane PASS + WF3 `wf_6f44eddf-680` **fault-injection 13-inject teeth-proof** + integration + cross-doc (0 application-defect). **2 commit:** `18a17f5` (cicd **Run #476 PASS** prod 200×3 bundle `0T6vVJST`/`BGXEVZO6` Mig 59) + `65b434a` (docs-only CI-skip). adap-report + 2 email AI_INFRA (`54789e19`+`8c94fa34`). **Dogfood AS-10 4-fire reverted** (git-diff = net thật; **WF3 explicit-return-only STILL self-wrote → instruction-fix NOT 100%**, E-006 recurrence, guard HELD 4/4; cicd-monitor diary KEPT = legit normal-spawn). **Lessons:** fault-injection-`-RepoRoot`-temp chứng checker-teeth · Lane B #53 empty→em-main self-gate. **State: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · prod 17 user/7 NCC.** **🔴 NEXT anh:** ⚠️ restart CLI (§2.1.7 + §L.b(c) H17-loop wire runtime — command `.md` no hot-reload). **🔴 NEXT em:** frontend-designer distill (WATCH strike-1 = H17 loop's live finding, chờ strike-2/anh) · monthly **2026-07-01 (hôm nay)** re-tier STATUS/HANDOFF mega-line + ef-core SKILL Mig→59 + docs/CLAUDE Budget-removed + 3 vocab-fork alias-map. **Pending product (carry):** Section B cột Dự-án · Ngưỡng CEO Mig 54 · "C" chuyển phiếu→dự án. → log `2026-07-01-S95-harness17-adopt.md`) · **Prev S94** (S94 — **anh-directive nâng cap lead 220K→380K** (canonical `memory-budget.json` · SE-override lead KHÔNG còn AI_INFRA-parity, subs giữ 60K/50K · mark H-15 v4-delta `RC-pqhuy1987-29-06-2026-23-25-50` · flush 3 echo · MFE live-read 380K) + **re-tier 2 mega-line** (fix Read-25K/call OOM): STATUS 389→89 · HANDOFF 732→12 dòng · 332KB→**34KB −90%** · ≤S90 → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` **0 byte-loss** · detector 27=baseline · `5f61b03` pushed CI-skip. MFE eval-all baseline: LEAD 29-item/380K=0.92% · SUB ≥85% (impl-backend 94%/impl-frontend 85%/reviewer 88%). **Lesson:** trần budget ⟂ harness Read-25K/call = 2 khóa độc-lập (cap-raise KHÔNG unblock mega-line Read → cần re-tier) · mega-LINE=tooling-breaker (ưu-tiên) vs mega-FILE nhiều-dòng=token-cost · re-tier=archive-không-cắt + assert head+tail==orig. em-main solo (0 sub, 0 fan-out). **State GIỮ NGUYÊN: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · bundle admin `CDn40vpV`/user `CoPmPBg7` · prod 17 user/7 NCC.** **🔴 NEXT anh:** ⚠️ restart CLI (session-start echo 380K + budget v4 runtime; số canonical đã sống ngay) · UAT eoffice node Dự án mã (carry S93). **🔴 NEXT em:** monthly **2026-07-01 (MAI!)** — ef-core SKILL Mig→59 · docs/CLAUDE Budget-removed · 3 vocab-fork alias-map · re-tier `migration-todos.md` (mega-FILE thứ-3, 807 dòng — không gấp, không vỡ tooling) · FD L1 26.1KB WATCH strike-1 (**test-specialist RESOLVED 7.8KB** — bỏ khỏi carry). **Pending product:** Section B cột Dự-án wire · Ngưỡng giá CEO Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. → log `2026-06-29-S94-cap-380k-retier-megaline.md`) · **Prev S93** (S93 — **(1) PE node Dự án hiện MÃ thay tên dài (anh Kiệt FDC) prod-verified Run #473** `8ee8f3e`: BE thread ProjectCode (DTO+3 projection+search) + FE 2-app SHA-mirror (render code+tooltip+sort) NO-MIG; grep bắt site#3 thoát replace_all; test 434; bundle admin `CDn40vpV`/user `CoPmPBg7`. **(2) adopt Harness-16 MFE (memory-fidelity-EVAL) 2-workflow PASS `9580098` 0-prod-code:** WF1 `wf_4c63e1bd` (ground-truth + bắt BLOCKING vocab-fork memory-fidelity≠H6.7) + WF2 `wf_13e3d35a` 3-lane PASS (denom-29-re-derived + READ-ONLY-proof + honesty + verb-trap-defeated); `scripts/mfe-eval.ps1` deterministic NO-API (LEAD coverage-FIT 29/220K=1.5% + age-band + Goodhart 21/9 · SUB đo-thật impl-backend 94%/reviewer 88% · prose→N/A) + judge-SCAFFOLD + budget:mfe + eval/mfe/ seed + engine §H + wire-opt-in + email AI_INFRA. AS-10 dogfood (WF1 residual caught+reverted; WF2 0-residual). #53 recover-from-disk. user-MEMORY compact 23.7→7.8KB. **State: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · bundle admin `CDn40vpV`/user `CoPmPBg7` · prod 17 user/7 NCC.** **🔴 NEXT anh:** ⚠️ restart CLI (MFE opt-in + wire) · UAT eoffice node Dự án mã · (anh Kiệt) nếu ô khoanh là Hạng-mục→báo em đổi work-item-code. **🔴 NEXT em:** monthly **2026-07-01 GẤP** re-tier mega-line (detector D1 OOM do bloat — STATUS 61K/HANDOFF 46K-char KHÔNG Read/Edit) + ef-core Mig→59 + Budget-removed docs + 3 vocab-fork + curate test-spec/FD L1. **Pending product:** Section B cột Dự-án · Ngưỡng giá CEO Mig 54 · "C" chuyển phiếu→dự án. → log `2026-06-29-S93-pe-projectcode-harness16-mfe.md`) · *(session ≤S90 đã tách → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` + `docs/changelog/sessions/`; re-tier S94)* --- diff --git a/docs/STATUS.md b/docs/STATUS.md index 27071da..d99ea78 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 (S97 — **PE finalize 4-fix UAT anh Kiệt FDC (buổi live) — em-main-led, prod-verified Run #481+#482.** **(1)** badge cấp-sau-finalize `"không trình tới"`→**`"Kết thúc tại {finalizeLevelName}"`** (render-động → hiện "Kết thúc tại CCM"; fallback finalizeStepName/'cấp trên') + tooltip template-literal. **(2)** đảo default checkbox "Cấp này KẾT THÚC quy trình" **opt-out→opt-in** (`useState(true→false)` init + reset onSuccess + helper text reword + comment S96-"default checked"-drift fix) — mặc định TRÌNH TIẾP CEO, tick mới KẾT THÚC tại cấp. **FE-only mirror 2-app SHA-identical `PeWorkflowPanel.tsx` (`bcf812fd`), 0 BE/mig/test** (BE service `if(AllowApproverFinalize && applyLevelFinalize)` tôn trọng cờ FE; param default `true` giữ làm fallback caller non-FE, FE luôn POST tường minh). Workflow `wf_0e01fdba-209`: implementer-frontend (8 hunk 4×2, build×2 PASS) → reviewer (PASS 0-issue; verify comment-L121+handler-L664 giữ, logic non-break). Commit `1c8fb6a`. **cicd Run #481 PASS ~5m10s byte-level #77:** JS rotate admin `COYAX-yQ`→**`Cf0o8dx8`**/user `0MU-kb4N`→**`x8rppRAK`** (CSS frozen `Bbtesa6B`/`BmuPz_Dy` #69-REFINE logic-only; real-size 1.64/1.54MB anti-SPA-trap) · **NEW `Kết thúc tại`+helper `Mặc định…TRÌNH TIẾP` PRESENT / OLD `không trình tới`+`Đã BỎ tick` ABSENT** (fix shipped byte-level → UI-cũ=cache→incognito, KHÔNG deploy-fail) · Mig 59/88-table frozen · smoke api+admin+eoffice 200×3 + PE-list 200 items[]-valid. **Lessons:** #53 return-garble **tái-diễn lần-4** (cicd trả prose-curate-memory "18.7KB above target" thay verdict dù instruction "return-verdict" → **recover-from-diary S97-#481-entry KHÔNG re-spawn** per `feedback_agent_return_garble_recover`; instruction-fix giảm-không-100%) · BE-honors-explicit-flag → đảo-default chỉ sửa FE `useState` (BE param=fallback, FE luôn POST tường minh) = zero BE/test-churn zero-prod-risk · comment-drift cleanup trước commit. impl MEMORY compaction giữa-spawn (23.8→11.5KB, archive S76-79→`2026-H1.md` verify no-loss). **(3) endsBeforeCeo config→RUNTIME (Mig 60 `8037fa0` #482 — cross-stack, reviewer PASS 0-issue):** phiếu có cấp finalize nhưng approver opt-out → lên CEO thật + CEO duyệt, nhưng sơ đồ báo sai "kết thúc tại CCM, không qua CEO" + làm-mờ Bước CEO (endsBeforeCeo suy CONFIG). Fix: field runtime `EndedByLevelFinalize` (set CHỈ nhánh level-finalize) → EndsBeforeCeo cho phiếu DaDuyet đọc runtime; 4 projection (detail/List/Inbox/ListApproved) + FE gate làm-mờ 2-app + backfill marker; test 440 (repro `peFinButWentCeo` config-finalize+field-false→false) + reviewer 6-điểm PASS + **cicd #482 bug fixed LIVE** (PE-detail `31faef0d` endsBeforeCeo=False phase=7, EF-ternary SQL-Server 200-NOT-500) → gotcha #78 (display-flag CONFIG-vs-RUNTIME). **(4) badge "✅ Đã được CEO duyệt" (`9e12e80` #483, FE-only):** đối xứng fix-3 — phiếu DaDuyet + `!endsBeforeCeo` (đi hết lên CEO) → PeFinalizeChip hiện badge; tận-dụng cờ runtime (0 BE/mig); mirror 2-app + 6 call-site; cicd #483 byte-#77 PRESENT. **State: Mig 60 · 89 bảng · 440 test · gotcha 78 · menu 54 · bundle admin `CeTA7Z82`/user `CGaAyXen` (Run #483) · prod 21 NCC/17 user.** **🔴 NEXT anh:** UAT **incognito** phiếu "8 MEP Sub Hệ thống solar" xác nhận: (a) sơ đồ hết báo "không qua CEO" + Bước 3 CEO KHÔNG còn mờ [fix-3 mới], (b) badge "Kết thúc tại CCM" + checkbox default-unchecked [fix 1-2] (+ vụ cũ "lỗi phân quyền vào phiếu": cho số-phiếu+user). **NEXT em:** monthly re-tier mega-line pending (giờ 5-blurb S97-S93). → log `2026-07-01-S97-pe-finalize-wording-default-flip.md`) · **Prev S96** (S96 — **buổi UAT LỚN anh Kiệt/chị Trà/anh Chương live + monthly-audit — 5 commit prod-verified, em-main-led (HMW-mode ON; 1 prep-workflow monthly-audit + spawn-lẻ, chủ-yếu solo).** **(1) Monthly drift audit `881783c`** (docs-only CI-skip): ef-core SKILL Mig→59 + bảng rows 57/58/59 + Mig 14/Phase-7 Budget-DROPPED annotate · skills/README Mig 55→59 + gotcha #69→76 · docs/CLAUDE Budget REMOVED Mig 50 strike-through · **`docs/governance/vocab-alias-map.md` MỚI** (3 fork run-trace/Ngân-sách-PRO/all-inherit + `$ExcludeExact` anti-self-match) · **re-tier STATUS/HANDOFF mega-line 5→3 blurb** (S92/S91→archive, conservation delta=0 BOM-preserved) + hoist 3 UAT-carry→blockers · **FD memory distill** (H17 strike-1 CLEARED: L1 26129→21492B, 5 war-story→archive/`_INDEX`/gist, Lessons value-protect lên L1). Workflow `wf_2d687d27` 4-cluster draft→verify (reviewer bắt #74-paraphrase-drift + AS-10 residual reverted). detector 27→25. **(2) Import NCC DONGDUONG `ba4b8e0`** (Excel anh Kiệt "Database NCC" 4 NCC/30-field): 3 NCC đã seed sẵn (TRUONGGIANG/TANPHU/TGN) → chỉ +DONGDUONG vào SeedRealMasterDataAsync (ungated idempotent, pack extras→Note, no-mig); prod 20→21 NCC (Run #477). Backlog 15-18 field "note-lại-từ-từ-tính"→Next-up. **(3-5) 3 PE bug-fix UAT:** `e657faa` ô "Cấp này KẾT THÚC quy trình" (AllowApproverFinalize S89-auto) → **opt-out bỏ-tick-được** (2-tier: Designer=cấp-quyền / phiếu=chọn kết-thúc-hay-trình-CEO; +param `applyLevelFinalize` default-true BE + FE 2-app, Run #478) · `36cbf8b` **chuông tự sạch** noti "cần duyệt" cũ khi phiếu rời cấp (LogTransitionAsync mark-read Generic+RefId ExecuteUpdate BE-only, Run #479) · `0c2f9f6` **khóa sửa giá đề xuất PRO/CCM sau gửi-duyệt** ("duyệt là fix" — Mig 54 "KHÔNG-ràng-Phase" ĐẢO → non-admin chỉ sửa Nháp/TraLai + Admin-override; BE+FE 2-app+4 test, Run #480). Test 434→440. **Delete-sau-duyệt = ĐÃ chặn sẵn** (FE nút Xóa chỉ DangSoanThao + BE guard, không cần sửa). Checkbox "ko-được" = **browser-cache** (verify byte-level: prod bundle `0MU-kb4N` CHỨA fix + "✅-static" cũ đã mất; index.html no-cache đúng-chuẩn + no-service-worker) → **incognito = golden-test**. **State: Mig 59 · 88 bảng · 440 test (45D+395I) · gotcha 77 · menu 54 · bundle admin `COYAX-yQ`/user `0MU-kb4N` (Run #480) · prod 21 NCC/17 user.** **Lessons:** verify-deployed-artifact-byte-level (cache≠deploy; incognito golden — gotcha #77) · #53-return-garble tái-diễn ×3 (investigator + cicd×2 trả text-memory-curation thay verdict → recover từ agent-memory; instruction-fix "return-verdict" ăn lần-3) · 2-tier-permission (grant-vs-exercise) · spec-change→update-test-cũ (SeedPeAsync ChoDuyet→DangSoanThao). **🔴 NEXT anh:** UAT incognito checkbox + cho **số-phiếu/user** vụ "lỗi phân quyền vào phiếu" để em soi config-workflow. **NEXT em:** cicd-monitor S-tag-drift S97/S98→S96 reconcile (closeout này) · monthly re-tier mega-line (giờ 4-blurb S96/S95/S94/S93). → log `2026-07-01-S96-uat-pe-fixes-monthly-audit.md`) · **Prev S95** (S95 — **Harness-17 adopt (Vòng tự-cải-thiện bộ-nhớ Đo→Tinh-chỉnh→Kiểm) — governance-only 0 prod code, em-main-led + 3-workflow fan-out (HMW-mode ON).** `/check-email AI_INFRA` (0 directed mới; H16 đã áp trọn S93) → `/adap-apply` H17 (2 broadcast hash-MATCH · `reviewer_gate:PASS`). **10/10 mục 🔴 sàn ĐẠT:** REUSE-cite A2=§H MFE/C3=D9/CG-2=value_protect/archive=§A; **build mới** `scripts/memory-selfimprove-audit.ps1` (C1 spec-audit NO-API exit-0, **runtime-verified bắt frontend-designer over-cap GAP thật**) + `.claude/governance/reinject-ledger.md` (B2 CG-1 N=3, tách khỏi budget.json) + engine **§I** codify + `session-start §2.1.7`/`session-end §L.b(c)` wire + HCV alias no-seed (coverage 3-nghĩa, detector vẫn 27). **3-workflow (run-id bằng-chứng):** WF1 `wf_f085d7c4-d78` ground-truth + WF2 `wf_8e73c1d6-ee6` 3-lane review PASS 0-blocking + WF3 `wf_6f44eddf-680` deep-reverify (**fault-injection 13-inject chứng-răng-thật** + integration + cross-doc, 0 application-defect). **2 commit:** `18a17f5` (adopt — cicd **Run #476 PASS** prod 200×3, bundle rotate admin `0T6vVJST`/user `BGXEVZO6`, Mig 59 unchanged) + `65b434a` (deep-reverify docs-only CI-skip). **adap-report + 2 email AI_INFRA** (hash `54789e19` adopt + `8c94fa34` deep-reverify-update). **Dogfood C3 4-fire:** AS-10 WF1+WF3 self-write reverted (git-diff net = backstop THẬT; **instruction-fix NOT 100%** — WF3 explicit-return-only STILL self-wrote → E-006 recurrence S95, guard HELD 4/4, 0 escape; cicd-monitor diary KEPT = normal-spawn legit). **Lessons:** fault-injection-via-`-RepoRoot`-temp chứng checker-teeth (không chỉ happy-path PASS) · Lane B #53 empty-return → em-main self-gate recover · workflow-agent persona-write stochastic → git-diff mandatory. **State GIỮ NGUYÊN: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · prod 17 user/7 NCC.** **NEXT em:** frontend-designer distill (WATCH strike-1 = H17 loop's live finding) · monthly re-tier mega-line + ef-core SKILL Mig→59 + 3 vocab-fork (2026-07-01 due). → log `2026-07-01-S95-harness17-adopt.md`) · **Prev S94** (S94 — **(1) anh-directive nâng cap lead 220K→380K** (`memory-budget.json` canonical · SE-override lead KHÔNG còn AI_INFRA-parity, subs giữ 60K/50K · mark H-15 **v4-delta** `RC-pqhuy1987-29-06-2026-23-25-50` · flush 3 derived echo ACTIVE-MARKS/session-start §2.1.6/engine §G adopt-delta · MFE verified live-read 380K). **(2) re-tier 2 mega-line** (fix Read-25K/call OOM + token-cost ~169K/220K): STATUS 389→89 dòng (mega-line 59.6K→7.1K char) · HANDOFF 732→12 dòng · live 332KB→**34KB (−90%)** · session ≤S90 → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` **0 byte-loss** (new+archive=orig+995B pointer) · backup git+scratchpad · detector 27=baseline 0-broken-pointer · conservation spot-check PASS. **(3) MFE eval-all baseline** (đầu phiên): LEAD coverage-FIT 29-item/**380K=0.92%** · age-band 0-cut · Goodhart strikes-21/RCA-9 flat=no-lie · SUB per-role ≥85% (cicd/test-spec/FD 100% · impl-backend 94% · impl-frontend 85% · 3 prose-role N/A) · judge-scaffold-only honest. **(4) nạp full Phase-1 read-set** (budget 380K cho phép): +PROJECT-MAP +workflow-contract +migration-todos. **commit `5f61b03` pushed** docs-only CI-skip. **Lesson:** trần budget ⟂ harness **Read-25K/call** = 2 khóa ĐỘC-LẬP — cap-raise KHÔNG unblock mega-line Read (cần re-tier); **mega-LINE = tooling-breaker** (ưu-tiên) vs **mega-FILE nhiều-dòng = chỉ token-cost**; re-tier = **archive-không-cắt + assert head+tail==orig 0-loss**. em-main solo (governance single-writer, 0 sub, 0 fan-out). **State GIỮ NGUYÊN: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · bundle admin `CDn40vpV`/user `CoPmPBg7` · prod 17 user/7 NCC.** → log `2026-06-29-S94-cap-380k-retier-megaline.md`) · **Prev S93** (S93 — **(1) PE cây Duyệt NCC node Dự án hiện MÃ dự án thay tên dài (anh Kiệt FDC) prod-verified Run #473** `8ee8f3e`: BE thread ProjectCode (DTO + 3 projection List/Inbox/ListApproved + search) + FE 2-app SHA-mirror (render `projectCode||projectName`+tooltip+sort) NO-MIG; grep bắt construction-site#3 thoát replace_all (cardinality-grep-all-consumer); build 3× + test 434; bundle admin `xz8FdmLN`→`CDn40vpV`/user `CA8Rla2w`→`CoPmPBg7`. **(2) adopt Harness-16 MFE (memory-fidelity-EVAL) 2-workflow PASS, 0 production code** `9580098`: WF1 `wf_4c63e1bd` (ground-truth + bắt BLOCKING vocab-fork: memory-fidelity = H6.7 memoryDelta-routing ≠ H16 coverage-eval → đặt MFE + alias-map §H KHÔNG seed $aliasSets) + WF2 `wf_13e3d35a` 3-lane PASS (code-gate denom-29-re-derived to-the-digit + READ-ONLY-budget proof 1-write-op + honesty 5-floor + leading-verb-trap adversarial-probed-DEFEATED); `scripts/mfe-eval.ps1` deterministic NO-API ASCII#30 (LEAD coverage-FIT 29-item/220K=1.5% + age-band-flag-not-cut + Goodhart strikes-21/RCA-9 · SUB per-role ĐO-THẬT impl-backend 94%/impl-frontend 85%/reviewer 88% · prose-role→N/A KHÔNG 0%) + judge-SCAFFOLD-only (honest: số chưa-nghĩa tới khi age-mature+independent-judge) + budget:mfe config + eval/mfe/ seed-12-stable-id + engine §H + artifact-row + C3-comment + wire session-start §2.1.6/session-end §L.b(c) opt-in + agents/README S93 + adap-report ×2 + email AI_INFRA hash `da768330`. **AS-10 2nd-fire dogfood:** WF1 3-agent (return-only) residual agent-memory caught+reverted (E-006 recurrence, guard HELD); WF2 explicit-return-only-prompt → 0 residual (instruction-fix). **#53 recover-from-disk** (WF1 sub return-rỗng nhưng ghi diary trước). user-MEMORY compact 23.7→7.8KB (hook). **Lessons:** cardinality-change-grep-all-consumer · vocab-collision-check-on-adopt (2-workflow review bắt, 1-workflow trượt) · AS-10-instruction-fix (prompt override frontmatter + git-diff net) · MFE đóng-vòng detector-D1-OOM-đầu-phiên. **State THẬT: Mig 59 · 88 bảng · 434 test (45D+389I) · gotcha 76 · menu 54 · bundle admin `CDn40vpV`/user `CoPmPBg7` · prod 17 user/7 NCC.** **🔴 NEXT anh:** restart CLI (MFE opt-in + wire session-start/end + agents/README no hot-reload) · UAT eoffice node Dự án hiện mã. **NEXT em:** monthly **2026-07-01 (2 ngày) GẤP** re-tier STATUS/HANDOFF mega-line (detector D1 **OOM do bloat** = tooling vỡ, STATUS line 61K-char/HANDOFF 46K-char KHÔNG Read/Edit) + ef-core SKILL Mig→59 + docs/CLAUDE Budget-removed + 3 vocab-fork alias-map + curate test-specialist/FD L1 WATCH. **Pending product:** Section B cột Dự-án wire · Ngưỡng giá CEO Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. → log `2026-06-29-S93-pe-projectcode-harness16-mfe.md`) · *(session ≤S90 đã tách → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` + `docs/changelog/sessions/`; re-tier S94)* +**Last updated:** 2026-07-01 (S97 — **PE finalize 4-fix UAT anh Kiệt FDC (buổi live) — em-main-led, prod-verified Run #481+#482.** **(1)** badge cấp-sau-finalize `"không trình tới"`→**`"Kết thúc tại {finalizeLevelName}"`** (render-động → hiện "Kết thúc tại CCM"; fallback finalizeStepName/'cấp trên') + tooltip template-literal. **(2)** đảo default checkbox "Cấp này KẾT THÚC quy trình" **opt-out→opt-in** (`useState(true→false)` init + reset onSuccess + helper text reword + comment S96-"default checked"-drift fix) — mặc định TRÌNH TIẾP CEO, tick mới KẾT THÚC tại cấp. **FE-only mirror 2-app SHA-identical `PeWorkflowPanel.tsx` (`bcf812fd`), 0 BE/mig/test** (BE service `if(AllowApproverFinalize && applyLevelFinalize)` tôn trọng cờ FE; param default `true` giữ làm fallback caller non-FE, FE luôn POST tường minh). Workflow `wf_0e01fdba-209`: implementer-frontend (8 hunk 4×2, build×2 PASS) → reviewer (PASS 0-issue; verify comment-L121+handler-L664 giữ, logic non-break). Commit `1c8fb6a`. **cicd Run #481 PASS ~5m10s byte-level #77:** JS rotate admin `COYAX-yQ`→**`Cf0o8dx8`**/user `0MU-kb4N`→**`x8rppRAK`** (CSS frozen `Bbtesa6B`/`BmuPz_Dy` #69-REFINE logic-only; real-size 1.64/1.54MB anti-SPA-trap) · **NEW `Kết thúc tại`+helper `Mặc định…TRÌNH TIẾP` PRESENT / OLD `không trình tới`+`Đã BỎ tick` ABSENT** (fix shipped byte-level → UI-cũ=cache→incognito, KHÔNG deploy-fail) · Mig 59/88-table frozen · smoke api+admin+eoffice 200×3 + PE-list 200 items[]-valid. **Lessons:** #53 return-garble **tái-diễn lần-4** (cicd trả prose-curate-memory "18.7KB above target" thay verdict dù instruction "return-verdict" → **recover-from-diary S97-#481-entry KHÔNG re-spawn** per `feedback_agent_return_garble_recover`; instruction-fix giảm-không-100%) · BE-honors-explicit-flag → đảo-default chỉ sửa FE `useState` (BE param=fallback, FE luôn POST tường minh) = zero BE/test-churn zero-prod-risk · comment-drift cleanup trước commit. impl MEMORY compaction giữa-spawn (23.8→11.5KB, archive S76-79→`2026-H1.md` verify no-loss). **(3) endsBeforeCeo config→RUNTIME (Mig 60 `8037fa0` #482 — cross-stack, reviewer PASS 0-issue):** phiếu có cấp finalize nhưng approver opt-out → lên CEO thật + CEO duyệt, nhưng sơ đồ báo sai "kết thúc tại CCM, không qua CEO" + làm-mờ Bước CEO (endsBeforeCeo suy CONFIG). Fix: field runtime `EndedByLevelFinalize` (set CHỈ nhánh level-finalize) → EndsBeforeCeo cho phiếu DaDuyet đọc runtime; 4 projection (detail/List/Inbox/ListApproved) + FE gate làm-mờ 2-app + backfill marker; test 440 (repro `peFinButWentCeo` config-finalize+field-false→false) + reviewer 6-điểm PASS + **cicd #482 bug fixed LIVE** (PE-detail `31faef0d` endsBeforeCeo=False phase=7, EF-ternary SQL-Server 200-NOT-500) → gotcha #78 (display-flag CONFIG-vs-RUNTIME). **(4) badge "✅ Đã được CEO duyệt" (`9e12e80` #483, FE-only):** đối xứng fix-3 — phiếu DaDuyet + `!endsBeforeCeo` (đi hết lên CEO) → PeFinalizeChip hiện badge; tận-dụng cờ runtime (0 BE/mig); mirror 2-app + 6 call-site; cicd #483 byte-#77 PRESENT. **(5) Mig 61 backfill fix (`fb2dfa9` #484 data-fix):** anh Kiệt check A/005 "CEO duyệt chưa" → điều tra (API+sqlcmd) phát hiện A/005/A/008 **finalize-CCM (KHÔNG qua CEO)** nhưng badge sai "Đã được CEO duyệt" do Mig 60 backfill soi NHẦM bảng (Approvals thay Changelogs nơi marker thật). Mig 61 query đúng Changelogs → prod A/005/A/008 EndedByLevelFinalize 0→1 + endsBeforeCeo flip True (cicd #484), A/010 control unchanged → gotcha #79. database-agent điều tra + em-main verify-prod + migration. **State: Mig 61 · 89 bảng · 440 test · gotcha 79 · menu 54 · bundle admin `CeTA7Z82`/user `CGaAyXen` (Run #484 data-fix no-FE) · prod 21 NCC/17 user.** **🔴 NEXT anh:** UAT **incognito** phiếu "8 MEP Sub Hệ thống solar" xác nhận: (a) sơ đồ hết báo "không qua CEO" + Bước 3 CEO KHÔNG còn mờ [fix-3 mới], (b) badge "Kết thúc tại CCM" + checkbox default-unchecked [fix 1-2] (+ vụ cũ "lỗi phân quyền vào phiếu": cho số-phiếu+user). **NEXT em:** monthly re-tier mega-line pending (giờ 5-blurb S97-S93). → log `2026-07-01-S97-pe-finalize-wording-default-flip.md`) · **Prev S96** (S96 — **buổi UAT LỚN anh Kiệt/chị Trà/anh Chương live + monthly-audit — 5 commit prod-verified, em-main-led (HMW-mode ON; 1 prep-workflow monthly-audit + spawn-lẻ, chủ-yếu solo).** **(1) Monthly drift audit `881783c`** (docs-only CI-skip): ef-core SKILL Mig→59 + bảng rows 57/58/59 + Mig 14/Phase-7 Budget-DROPPED annotate · skills/README Mig 55→59 + gotcha #69→76 · docs/CLAUDE Budget REMOVED Mig 50 strike-through · **`docs/governance/vocab-alias-map.md` MỚI** (3 fork run-trace/Ngân-sách-PRO/all-inherit + `$ExcludeExact` anti-self-match) · **re-tier STATUS/HANDOFF mega-line 5→3 blurb** (S92/S91→archive, conservation delta=0 BOM-preserved) + hoist 3 UAT-carry→blockers · **FD memory distill** (H17 strike-1 CLEARED: L1 26129→21492B, 5 war-story→archive/`_INDEX`/gist, Lessons value-protect lên L1). Workflow `wf_2d687d27` 4-cluster draft→verify (reviewer bắt #74-paraphrase-drift + AS-10 residual reverted). detector 27→25. **(2) Import NCC DONGDUONG `ba4b8e0`** (Excel anh Kiệt "Database NCC" 4 NCC/30-field): 3 NCC đã seed sẵn (TRUONGGIANG/TANPHU/TGN) → chỉ +DONGDUONG vào SeedRealMasterDataAsync (ungated idempotent, pack extras→Note, no-mig); prod 20→21 NCC (Run #477). Backlog 15-18 field "note-lại-từ-từ-tính"→Next-up. **(3-5) 3 PE bug-fix UAT:** `e657faa` ô "Cấp này KẾT THÚC quy trình" (AllowApproverFinalize S89-auto) → **opt-out bỏ-tick-được** (2-tier: Designer=cấp-quyền / phiếu=chọn kết-thúc-hay-trình-CEO; +param `applyLevelFinalize` default-true BE + FE 2-app, Run #478) · `36cbf8b` **chuông tự sạch** noti "cần duyệt" cũ khi phiếu rời cấp (LogTransitionAsync mark-read Generic+RefId ExecuteUpdate BE-only, Run #479) · `0c2f9f6` **khóa sửa giá đề xuất PRO/CCM sau gửi-duyệt** ("duyệt là fix" — Mig 54 "KHÔNG-ràng-Phase" ĐẢO → non-admin chỉ sửa Nháp/TraLai + Admin-override; BE+FE 2-app+4 test, Run #480). Test 434→440. **Delete-sau-duyệt = ĐÃ chặn sẵn** (FE nút Xóa chỉ DangSoanThao + BE guard, không cần sửa). Checkbox "ko-được" = **browser-cache** (verify byte-level: prod bundle `0MU-kb4N` CHỨA fix + "✅-static" cũ đã mất; index.html no-cache đúng-chuẩn + no-service-worker) → **incognito = golden-test**. **State: Mig 59 · 88 bảng · 440 test (45D+395I) · gotcha 77 · menu 54 · bundle admin `COYAX-yQ`/user `0MU-kb4N` (Run #480) · prod 21 NCC/17 user.** **Lessons:** verify-deployed-artifact-byte-level (cache≠deploy; incognito golden — gotcha #77) · #53-return-garble tái-diễn ×3 (investigator + cicd×2 trả text-memory-curation thay verdict → recover từ agent-memory; instruction-fix "return-verdict" ăn lần-3) · 2-tier-permission (grant-vs-exercise) · spec-change→update-test-cũ (SeedPeAsync ChoDuyet→DangSoanThao). **🔴 NEXT anh:** UAT incognito checkbox + cho **số-phiếu/user** vụ "lỗi phân quyền vào phiếu" để em soi config-workflow. **NEXT em:** cicd-monitor S-tag-drift S97/S98→S96 reconcile (closeout này) · monthly re-tier mega-line (giờ 4-blurb S96/S95/S94/S93). → log `2026-07-01-S96-uat-pe-fixes-monthly-audit.md`) · **Prev S95** (S95 — **Harness-17 adopt (Vòng tự-cải-thiện bộ-nhớ Đo→Tinh-chỉnh→Kiểm) — governance-only 0 prod code, em-main-led + 3-workflow fan-out (HMW-mode ON).** `/check-email AI_INFRA` (0 directed mới; H16 đã áp trọn S93) → `/adap-apply` H17 (2 broadcast hash-MATCH · `reviewer_gate:PASS`). **10/10 mục 🔴 sàn ĐẠT:** REUSE-cite A2=§H MFE/C3=D9/CG-2=value_protect/archive=§A; **build mới** `scripts/memory-selfimprove-audit.ps1` (C1 spec-audit NO-API exit-0, **runtime-verified bắt frontend-designer over-cap GAP thật**) + `.claude/governance/reinject-ledger.md` (B2 CG-1 N=3, tách khỏi budget.json) + engine **§I** codify + `session-start §2.1.7`/`session-end §L.b(c)` wire + HCV alias no-seed (coverage 3-nghĩa, detector vẫn 27). **3-workflow (run-id bằng-chứng):** WF1 `wf_f085d7c4-d78` ground-truth + WF2 `wf_8e73c1d6-ee6` 3-lane review PASS 0-blocking + WF3 `wf_6f44eddf-680` deep-reverify (**fault-injection 13-inject chứng-răng-thật** + integration + cross-doc, 0 application-defect). **2 commit:** `18a17f5` (adopt — cicd **Run #476 PASS** prod 200×3, bundle rotate admin `0T6vVJST`/user `BGXEVZO6`, Mig 59 unchanged) + `65b434a` (deep-reverify docs-only CI-skip). **adap-report + 2 email AI_INFRA** (hash `54789e19` adopt + `8c94fa34` deep-reverify-update). **Dogfood C3 4-fire:** AS-10 WF1+WF3 self-write reverted (git-diff net = backstop THẬT; **instruction-fix NOT 100%** — WF3 explicit-return-only STILL self-wrote → E-006 recurrence S95, guard HELD 4/4, 0 escape; cicd-monitor diary KEPT = normal-spawn legit). **Lessons:** fault-injection-via-`-RepoRoot`-temp chứng checker-teeth (không chỉ happy-path PASS) · Lane B #53 empty-return → em-main self-gate recover · workflow-agent persona-write stochastic → git-diff mandatory. **State GIỮ NGUYÊN: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · prod 17 user/7 NCC.** **NEXT em:** frontend-designer distill (WATCH strike-1 = H17 loop's live finding) · monthly re-tier mega-line + ef-core SKILL Mig→59 + 3 vocab-fork (2026-07-01 due). → log `2026-07-01-S95-harness17-adopt.md`) · **Prev S94** (S94 — **(1) anh-directive nâng cap lead 220K→380K** (`memory-budget.json` canonical · SE-override lead KHÔNG còn AI_INFRA-parity, subs giữ 60K/50K · mark H-15 **v4-delta** `RC-pqhuy1987-29-06-2026-23-25-50` · flush 3 derived echo ACTIVE-MARKS/session-start §2.1.6/engine §G adopt-delta · MFE verified live-read 380K). **(2) re-tier 2 mega-line** (fix Read-25K/call OOM + token-cost ~169K/220K): STATUS 389→89 dòng (mega-line 59.6K→7.1K char) · HANDOFF 732→12 dòng · live 332KB→**34KB (−90%)** · session ≤S90 → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` **0 byte-loss** (new+archive=orig+995B pointer) · backup git+scratchpad · detector 27=baseline 0-broken-pointer · conservation spot-check PASS. **(3) MFE eval-all baseline** (đầu phiên): LEAD coverage-FIT 29-item/**380K=0.92%** · age-band 0-cut · Goodhart strikes-21/RCA-9 flat=no-lie · SUB per-role ≥85% (cicd/test-spec/FD 100% · impl-backend 94% · impl-frontend 85% · 3 prose-role N/A) · judge-scaffold-only honest. **(4) nạp full Phase-1 read-set** (budget 380K cho phép): +PROJECT-MAP +workflow-contract +migration-todos. **commit `5f61b03` pushed** docs-only CI-skip. **Lesson:** trần budget ⟂ harness **Read-25K/call** = 2 khóa ĐỘC-LẬP — cap-raise KHÔNG unblock mega-line Read (cần re-tier); **mega-LINE = tooling-breaker** (ưu-tiên) vs **mega-FILE nhiều-dòng = chỉ token-cost**; re-tier = **archive-không-cắt + assert head+tail==orig 0-loss**. em-main solo (governance single-writer, 0 sub, 0 fan-out). **State GIỮ NGUYÊN: Mig 59 · 88 bảng · 434 test · gotcha 76 · menu 54 · bundle admin `CDn40vpV`/user `CoPmPBg7` · prod 17 user/7 NCC.** → log `2026-06-29-S94-cap-380k-retier-megaline.md`) · **Prev S93** (S93 — **(1) PE cây Duyệt NCC node Dự án hiện MÃ dự án thay tên dài (anh Kiệt FDC) prod-verified Run #473** `8ee8f3e`: BE thread ProjectCode (DTO + 3 projection List/Inbox/ListApproved + search) + FE 2-app SHA-mirror (render `projectCode||projectName`+tooltip+sort) NO-MIG; grep bắt construction-site#3 thoát replace_all (cardinality-grep-all-consumer); build 3× + test 434; bundle admin `xz8FdmLN`→`CDn40vpV`/user `CA8Rla2w`→`CoPmPBg7`. **(2) adopt Harness-16 MFE (memory-fidelity-EVAL) 2-workflow PASS, 0 production code** `9580098`: WF1 `wf_4c63e1bd` (ground-truth + bắt BLOCKING vocab-fork: memory-fidelity = H6.7 memoryDelta-routing ≠ H16 coverage-eval → đặt MFE + alias-map §H KHÔNG seed $aliasSets) + WF2 `wf_13e3d35a` 3-lane PASS (code-gate denom-29-re-derived to-the-digit + READ-ONLY-budget proof 1-write-op + honesty 5-floor + leading-verb-trap adversarial-probed-DEFEATED); `scripts/mfe-eval.ps1` deterministic NO-API ASCII#30 (LEAD coverage-FIT 29-item/220K=1.5% + age-band-flag-not-cut + Goodhart strikes-21/RCA-9 · SUB per-role ĐO-THẬT impl-backend 94%/impl-frontend 85%/reviewer 88% · prose-role→N/A KHÔNG 0%) + judge-SCAFFOLD-only (honest: số chưa-nghĩa tới khi age-mature+independent-judge) + budget:mfe config + eval/mfe/ seed-12-stable-id + engine §H + artifact-row + C3-comment + wire session-start §2.1.6/session-end §L.b(c) opt-in + agents/README S93 + adap-report ×2 + email AI_INFRA hash `da768330`. **AS-10 2nd-fire dogfood:** WF1 3-agent (return-only) residual agent-memory caught+reverted (E-006 recurrence, guard HELD); WF2 explicit-return-only-prompt → 0 residual (instruction-fix). **#53 recover-from-disk** (WF1 sub return-rỗng nhưng ghi diary trước). user-MEMORY compact 23.7→7.8KB (hook). **Lessons:** cardinality-change-grep-all-consumer · vocab-collision-check-on-adopt (2-workflow review bắt, 1-workflow trượt) · AS-10-instruction-fix (prompt override frontmatter + git-diff net) · MFE đóng-vòng detector-D1-OOM-đầu-phiên. **State THẬT: Mig 59 · 88 bảng · 434 test (45D+389I) · gotcha 76 · menu 54 · bundle admin `CDn40vpV`/user `CoPmPBg7` · prod 17 user/7 NCC.** **🔴 NEXT anh:** restart CLI (MFE opt-in + wire session-start/end + agents/README no hot-reload) · UAT eoffice node Dự án hiện mã. **NEXT em:** monthly **2026-07-01 (2 ngày) GẤP** re-tier STATUS/HANDOFF mega-line (detector D1 **OOM do bloat** = tooling vỡ, STATUS line 61K-char/HANDOFF 46K-char KHÔNG Read/Edit) + ef-core SKILL Mig→59 + docs/CLAUDE Budget-removed + 3 vocab-fork alias-map + curate test-specialist/FD L1 WATCH. **Pending product:** Section B cột Dự-án wire · Ngưỡng giá CEO Mig 54 Designer UAT · "C" chuyển phiếu→dự án chờ spec. → log `2026-06-29-S93-pe-projectcode-harness16-mfe.md`) · *(session ≤S90 đã tách → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` + `docs/changelog/sessions/`; re-tier S94)* --- @@ -11,14 +11,14 @@ | Metric | Value | Note | |---|---|---| -| Migrations | **60** | +S97: Mig 60 `AddPeEndedByLevelFinalize` (PE +`EndedByLevelFinalize` bit NOT NULL default 0 — cờ RUNTIME "phiếu ĐÃ kết thúc sớm bằng level-finalize", set-true CHỈ nhánh finalize service; +`Sql()` backfill Phase=7-marker→=1; EndsBeforeCeo display đọc runtime thay config → phiếu-lên-CEO hết báo sai "không qua CEO" [gotcha #78]; AddColumn no new table, prod-verified Run #482 PE-detail endsBeforeCeo=False live). +S87: Mig 58 `AddPeMultiWinnerAndLevelFinalize` (`PurchaseEvaluationSupplier` +`IsWinner` bit multi-winner backfill từ SelectedSupplierId + `ApprovalWorkflowLevel` +`AllowApproverFinalize` bit cấp-KẾT-THÚC-quy-trình AUTO; 2 AddColumn + 1 backfill, no new table) + Mig 59 `AddCcmBudgetPeriodToPurchaseEvaluation` (PE +`CcmBudgetPeriodAmount` decimal(18,2)? — NS kỳ-này cột CCM cho Section B 3-cột; 1 AddColumn nullable, no backfill, no new table). +S77: Mig 57 `AddPeSuggestedPriceNotes` (PE +`ProSuggestedPriceNote` +`CcmSuggestedPriceNote` nvarchar(1000) — ô ghi chú giá đề xuất PRO/CCM giải-thích Min/Max · additive-nullable, 0 backfill, no new table; absolute-set role-gate mirror Mig 54/55). +S76: Mig 56 `AddProBudgetSplitToPeWorkItemBudget` (PeWorkItemBudget +`ProInitialAmount`+`ProAdjustmentAmount` decimal(18,2)? — cột PRO "Ban hành lần đầu"+"V0/hiệu chỉnh" mirror CCM Initial/Adjustment; AddColumn additive + `Sql()` data-migrate `ProInitial=ProEstimate` 4 rows prod gotcha #64; no new table). +S74: Mig 55 `AddCcmNoteToPeWorkItemBudget` (PeWorkItemBudget +CcmNote nvarchar(1000) — "Ghi chú từ CCM" mirror ProNote · additive-nullable, 0 backfill, no new table). +S73: Mig 54 `AddPeSuggestedAndApprovedPrice` (PE +5 cột giá đề xuất PRO Min/Max + CCM + giá chốt ApprovedPriceAmount/Source — additive-nullable, 0 backfill, prod-verified Run #313). +S69: Mig 53 `AddPeUrgentAndCeoApprovalThreshold` (PE +IsUrgentByPro/Ccm cờ gấp + ApprovalWorkflow +CeoApprovalThreshold ngưỡng CCM duyệt-final · 3 AddColumn no new table). Prev S65: Mig 51 `AddDepartmentParentId` (Department.ParentId loose-Guid no-FK — org-tree) + Mig 52 `AddHoSoLinkToPurchaseEvaluation` (PE HoSoLink nvarchar(1000) hyperlink NAS) — **cả 2 AddColumn-only, no new table** (tables giữ 88). Prev Mig 50 `ReplaceBudgetModuleWithPeWorkItemBudgets` (bảng `PeWorkItemBudgets` per-gói-thầu + DROP module Budget cũ + backfill BudgetManual→BudgetPeriod TRƯỚC DropColumn + DROP PE/Contracts.BudgetId; gotcha #63/#64). Prev Mig 49 PE WorkItemId (S57bis) | +| Migrations | **61** | +S97: Mig 61 `BackfillEndedByLevelFinalizeFromChangelog` (data-only no-schema — đính chính Mig 60 backfill soi NHẦM bảng `Approvals`→`Changelogs`; set `EndedByLevelFinalize=1` cho phiếu finalize-sớm pre-Mig60 [A/005/A/008 finalize-CCM KHÔNG qua CEO] qua marker ở `PurchaseEvaluationChangelogs.ContextNote`; idempotent SQL-Server-only; prod-verified Run #484: A/005/A/008 0→1 + endsBeforeCeo-flip-True, A/010=0 control-unchanged; gotcha #79). +S97: Mig 60 `AddPeEndedByLevelFinalize` (PE +`EndedByLevelFinalize` bit NOT NULL default 0 — cờ RUNTIME "phiếu ĐÃ kết thúc sớm bằng level-finalize", set-true CHỈ nhánh finalize service; +`Sql()` backfill Phase=7-marker→=1; EndsBeforeCeo display đọc runtime thay config → phiếu-lên-CEO hết báo sai "không qua CEO" [gotcha #78]; AddColumn no new table, prod-verified Run #482 PE-detail endsBeforeCeo=False live). +S87: Mig 58 `AddPeMultiWinnerAndLevelFinalize` (`PurchaseEvaluationSupplier` +`IsWinner` bit multi-winner backfill từ SelectedSupplierId + `ApprovalWorkflowLevel` +`AllowApproverFinalize` bit cấp-KẾT-THÚC-quy-trình AUTO; 2 AddColumn + 1 backfill, no new table) + Mig 59 `AddCcmBudgetPeriodToPurchaseEvaluation` (PE +`CcmBudgetPeriodAmount` decimal(18,2)? — NS kỳ-này cột CCM cho Section B 3-cột; 1 AddColumn nullable, no backfill, no new table). +S77: Mig 57 `AddPeSuggestedPriceNotes` (PE +`ProSuggestedPriceNote` +`CcmSuggestedPriceNote` nvarchar(1000) — ô ghi chú giá đề xuất PRO/CCM giải-thích Min/Max · additive-nullable, 0 backfill, no new table; absolute-set role-gate mirror Mig 54/55). +S76: Mig 56 `AddProBudgetSplitToPeWorkItemBudget` (PeWorkItemBudget +`ProInitialAmount`+`ProAdjustmentAmount` decimal(18,2)? — cột PRO "Ban hành lần đầu"+"V0/hiệu chỉnh" mirror CCM Initial/Adjustment; AddColumn additive + `Sql()` data-migrate `ProInitial=ProEstimate` 4 rows prod gotcha #64; no new table). +S74: Mig 55 `AddCcmNoteToPeWorkItemBudget` (PeWorkItemBudget +CcmNote nvarchar(1000) — "Ghi chú từ CCM" mirror ProNote · additive-nullable, 0 backfill, no new table). +S73: Mig 54 `AddPeSuggestedAndApprovedPrice` (PE +5 cột giá đề xuất PRO Min/Max + CCM + giá chốt ApprovedPriceAmount/Source — additive-nullable, 0 backfill, prod-verified Run #313). +S69: Mig 53 `AddPeUrgentAndCeoApprovalThreshold` (PE +IsUrgentByPro/Ccm cờ gấp + ApprovalWorkflow +CeoApprovalThreshold ngưỡng CCM duyệt-final · 3 AddColumn no new table). Prev S65: Mig 51 `AddDepartmentParentId` (Department.ParentId loose-Guid no-FK — org-tree) + Mig 52 `AddHoSoLinkToPurchaseEvaluation` (PE HoSoLink nvarchar(1000) hyperlink NAS) — **cả 2 AddColumn-only, no new table** (tables giữ 88). Prev Mig 50 `ReplaceBudgetModuleWithPeWorkItemBudgets` (bảng `PeWorkItemBudgets` per-gói-thầu + DROP module Budget cũ + backfill BudgetManual→BudgetPeriod TRƯỚC DropColumn + DROP PE/Contracts.BudgetId; gotcha #63/#64). Prev Mig 49 PE WorkItemId (S57bis) | | SQL tables | **89** | re-ground S97 (cicd `sys.tables` is_ms_shipped=0 Run #482 LIVE = **89**, pre==post Mig 60 no-new-table; "88" từ S62 STALE). Prev net 93→88 S62 (Mig 50 drop Budget + create `PeWorkItemBudgets`) | | Master data (prod) | **71 WorkItems PMH-only S59** | 62 Projects + **WorkItems = ĐÚNG 71 mã PMH** (S59: wipe 15 demo + rename format anh Kiệt `MAT-1..16`/`SUB-1..30`/`MEP-SUB-1..9`/`MEP-EQU-1..16`, Name "STT nhóm tên") + Suppliers 22 (3 real + demo; POST mở any-auth S59 quick-add). Transactional testing data wiped S59 (PE/HĐ/Notif = 0 baseline, phiếu thật từ A/001). Provenance `scripts/master-import-data.generated.md` | | API endpoints | **~253** | +1 S54 `GET /it-tickets/assignable-staff` (capability endpoint); +3 S52 (attendances/report + report/excel + it-tickets/{id}/assign) | | FE pages | **68** | unchanged S54 (ItTicketsPage reassign = in-place 2 app); +1 S52 AttendanceReportPage | | Menu keys | **54** | +1 S69 `Off_Dashboard` (landing Văn phòng số). Prev re-ground S61 (`MenuKeys.cs` const — Mig 50 gỡ 4 `Bg_*` Budget menu cũ). Prev 57 (S58) | | Tests | **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 | **78** | +1 S97 (**#78** display-flag suy CONFIG thay RUNTIME → nói dối khi instance lệch config: `endsBeforeCeo` từ "workflow CÓ cấp finalize" thay "phiếu NÀY finalize" → phiếu lên CEO báo sai "không qua CEO"; nặng sau S97 default-flip opt-in; fix field runtime `EndedByLevelFinalize` Mig 60. Flag = "instance ĐÃ làm-gì" KHÔNG "config CÓ THỂ"). +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) | +| Gotchas | **79** | +1 S97 (**#79** backfill soi NHẦM bảng — transition-marker "[Duyệt KẾT THÚC]" nằm ở `PurchaseEvaluationChangelogs.ContextNote` KHÔNG phải `PurchaseEvaluationApprovals` → Mig 60 backfill match 0, phiếu finalize-CCM giữ flag=0 hiện sai "Đã được CEO duyệt"; fix Mig 61 query đúng bảng. PE 2 bảng lịch-sử tách vai [Approvals=ai-duyệt record :745 · Changelogs=chuyển-phase+marker LogTransition :1073]; verify marker-count prod trước khi tin backfill). +1 S97 (**#78** display-flag suy CONFIG thay RUNTIME → nói dối khi instance lệch config: `endsBeforeCeo` từ "workflow CÓ cấp finalize" thay "phiếu NÀY finalize" → phiếu lên CEO báo sai "không qua CEO"; nặng sau S97 default-flip opt-in; fix field runtime `EndedByLevelFinalize` Mig 60. Flag = "instance ĐÃ làm-gì" KHÔNG "config CÓ THỂ"). +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). | diff --git a/docs/changelog/sessions/2026-07-01-S97-pe-finalize-wording-default-flip.md b/docs/changelog/sessions/2026-07-01-S97-pe-finalize-wording-default-flip.md index d459adc..0fc4708 100644 --- a/docs/changelog/sessions/2026-07-01-S97-pe-finalize-wording-default-flip.md +++ b/docs/changelog/sessions/2026-07-01-S97-pe-finalize-wording-default-flip.md @@ -90,4 +90,24 @@ Mig 59 · 88 bảng · 440 test (45D+395I) · gotcha 77 · menu 54 · **bundle a **Verify:** implementer-frontend build ×2 PASS 0-TS-err (bắt `PeListItem.phase: number` → prop `phase?: number` không narrow-union, gotcha type-plumbing) + SHA mirror. cicd #483 PASS: bundle admin `CeTA7Z82`/user `CGaAyXen`, **byte-#77 "Đã được CEO duyệt" PRESENT cả 2 app** + prev-badge additive, Mig 60 frozen, smoke 200×3 + PE-list 200. -**State cuối S97:** Mig 60 · 89 bảng · 440 test · gotcha 78 · menu 54 · bundle admin `CeTA7Z82`/user `CGaAyXen` (Run #483) · prod 21 NCC/17 user. **4 fix PE** (badge-wording + default-flip + endsBeforeCeo-runtime + CEO-duyệt-badge). +**State sau Part 3:** Mig 60 · 89 bảng · 440 test · gotcha 78 · bundle `CeTA7Z82`/`CGaAyXen` (Run #483). + +--- + +## Part 4 (cùng ngày S97) — check CEO-duyệt A/005 → phát hiện Mig 60 backfill WRONG-TABLE (gotcha #79) + +**Anh Kiệt:** PE/2026/A/005 "7 Mat Nắp gang" — CEO đã duyệt chưa, nếu rồi hiển thị lịch sử đàng hoàng. + +**Điều tra (API + sqlcmd prod):** A/005+A/008 Phase=7, endsBeforeCeo=False, con-trỏ NULL (terminal ran), lịch-sử 4 record dừng ở "[Bước 2 — Cấp 2]" (Phan Văn Chương), KHÔNG có record CEO. Đối chứng A/010: 9 record có "[Bước 3 — Cấp 1]" CEO. Verify Changelogs: A/005/A/008 fin_marker=1 (terminal Changelog "...không trình CEO]"), A/010=0. + +**Chẩn đoán:** A/005/A/008 **KHÔNG qua CEO** — finalize tại CCM Cấp 2 (Phan Văn Chương duyệt-thay-CEO, auto-finalize code cũ). Lịch sử 4 record ĐÚNG. Sai = badge "Đã được CEO duyệt" (fix-4) do `EndedByLevelFinalize=0`. + +**Root-cause (gotcha #79):** Mig 60 backfill query `PurchaseEvaluationApprovals.Comment` cho marker "[Duyệt KẾT THÚC tại]", nhưng marker do `LogTransitionAsync:1073` ghi vào `PurchaseEvaluationChangelogs.ContextNote` (2 bảng tách vai: Approvals=per-approver :745 · Changelogs=transition+marker) → match 0 → phiếu finalize pre-Mig60 giữ flag=0. + +**Fix (Mig 61 `fb2dfa9`):** backfill ĐÚNG `Changelogs.ContextNote LIKE N'%Duyệt KẾT THÚC tại%'` + PhaseAtChange=7, idempotent, SQL-Server-only. database-agent điều tra prod + em-main verify (marker-count prod) + viết migration + reviewer-skip (đã prod-verify signal). + +**Verify (cicd #484 prod):** Mig 61 applied · **backfill: A/005=1, A/008=1 (0→1) · A/010=0 (control)** · **endsBeforeCeo FLIP: A/005 True (trước False), A/010 False** · smoke 200×3 · NO-FE (data-fix). → A/005/A/008 giờ đúng "⚑ Kết thúc · CCM — không qua CEO". + +**Lessons:** **#79** backfill/query transition-marker phải xác định ĐÚNG bảng writer (PE Approvals≠Changelogs) + verify marker-count prod trước · **#53 lần-6** cicd garble → recover diary #484 (cicd = 5/6 offender, structural curate-at-return). + +**State cuối S97:** Mig 61 · 89 bảng · 440 test · gotcha 79 · menu 54 · bundle admin `CeTA7Z82`/user `CGaAyXen` (Run #484 data-fix no-FE) · prod 21 NCC/17 user. **5 fix PE** (wording + default-flip + endsBeforeCeo-runtime + CEO-badge + backfill-wrong-table).