From 4263d63e747092f5ecb6f54c4c1da08e28c5cb64 Mon Sep 17 00:00:00 2001 From: pqhuy1987 Date: Thu, 2 Jul 2026 10:57:33 +0700 Subject: [PATCH] =?UTF-8?q?[CLAUDE]=20Docs:=20S98=20harness=20backlog=20?= =?UTF-8?q?=E2=80=94=20Fable-restore=20g=E1=BB=A1=20caveat=20H5.6=20(runti?= =?UTF-8?q?me-verified=20spawn-test=20=C3=972)=20+=20monthly=E2=86=922026-?= =?UTF-8?q?08-01=20+=20skill=20Mig=2060/61=20+=20re-tier=20mega-line=20S93?= =?UTF-8?q?/S94=E2=86=92archive-S98=20+=20cicd=20L1=20curate=20+=203=20orp?= =?UTF-8?q?han-append=20H2=20+=20ledger=20mode-A=20note=20+=20email=20AI?= =?UTF-8?q?=5FINFRA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Verify: V1 conservation PASS (arithmetic full-accounting 0-byte-unaccounted) · V2 cross-doc PASS (detector 28→25, còn lại false-positive class) · V3 moved-not-cut PASS (sha-match + byte-arithmetic đóng vòng). Co-Authored-By: Claude Fable 5 --- .claude/agent-memory/cicd-monitor/MEMORY.md | 15 ++++++------ .../cicd-monitor/archive/2026-07.md | 8 +++++++ .../cicd-monitor/archive/_INDEX.md | 8 ++++++- .claude/agent-memory/database-agent/MEMORY.md | 1 + .../agent-memory/harvest-curator/MEMORY.md | 1 + .../implementer-frontend/MEMORY.md | 3 +++ .../investigator-codebase/MEMORY.md | 1 + .claude/agent-memory/reviewer/MEMORY.md | 6 ++++- .../agent-memory/tooling-auditor/MEMORY.md | 1 + .claude/agents/README.md | 4 ++-- .claude/commands/session-start.md | 2 +- .claude/skills/README.md | 4 ++-- .claude/skills/ef-core-migration/SKILL.md | 12 ++++++---- .claude/workflows/runs/_ledger.md | 1 + CLAUDE.md | 8 +++---- broadcasts/_index.md | 1 + ...-07-02-se-to-ai_infra-fable-restore-h56.md | 23 +++++++++++++++++++ docs/CLAUDE.md | 2 +- docs/HANDOFF.md | 4 ++-- docs/STATUS.md | 12 +++++----- .../STATUS-HANDOFF-tier-S98-2026-07-02.md | 22 ++++++++++++++++++ 21 files changed, 107 insertions(+), 32 deletions(-) create mode 100644 .claude/agent-memory/cicd-monitor/archive/2026-07.md create mode 100644 broadcasts/outbox/ai_infra/2026-07-02-se-to-ai_infra-fable-restore-h56.md create mode 100644 docs/_archive/STATUS-HANDOFF-tier-S98-2026-07-02.md diff --git a/.claude/agent-memory/cicd-monitor/MEMORY.md b/.claude/agent-memory/cicd-monitor/MEMORY.md index 886ae5b..47e6e22 100644 --- a/.claude/agent-memory/cicd-monitor/MEMORY.md +++ b/.claude/agent-memory/cicd-monitor/MEMORY.md @@ -2,7 +2,7 @@ > **Persistent diary cross-session.** Auto-injected first ~200 lines at spawn (L1 HOT). > Update BEFORE every stop. Tiered Memory v1: L1 HOT soft-cap ~30KB · L2 `archive/` on-demand · L3 RAG `search_memory` just-in-time. Keep entry ≤ 1.5K chars (gotcha #53). -> Full verbatim run history pre-S40 → git `d2f52ba` + `archive/2026-05-{runs,q2,q3,q4}.md` + `archive/2026-06.md`. 🗺️ **Lookup map: `archive/_INDEX.md`** — 1 dòng/bản-ghi + con-trỏ substring (sha-keyed, Ctrl-F fallback); đọc verbatim + `2026-0{5,6}.gist.md` theo nhu cầu. **S80 curate: moved 3 huge run-entries (#330/#318/#325) → archive.** +> Full verbatim run history pre-S40 → git `d2f52ba` + `archive/2026-05-{runs,q2,q3,q4}.md` + `archive/2026-06.md` + `archive/2026-07.md`. 🗺️ **Lookup map: `archive/_INDEX.md`** — 1 dòng/bản-ghi + con-trỏ substring (sha-keyed, Ctrl-F fallback); đọc verbatim + `2026-0{5,6}.gist.md` theo nhu cầu. **S80 curate: moved 3 huge run-entries (#330/#318/#325) → archive. S98 curate: moved 2 huge S97 entries → `archive/2026-07.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 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. +- **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` (S97 #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** (S97 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 (S97 #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,9 +70,9 @@ BE (test+build) ~90s · FE × 2 ~60s/app · deploy ~30s · **total ~3min code / ## 📅 Recent runs (compressed — full verbatim → `archive/2026-06.md` via `archive/_INDEX.md`) -- **🟢🟢 S96+S97 FINAL-SESSION-REVIEW (2026-07-01 end, em main "review kỹ trước đóng session") — 11-commit day (S96 #478-480 + S97 #481-484 + docs closeouts) ALL-DEPLOYED-HEALTHY, verdict CLEAN.** HEAD=`5c914e4` (docs-only) → latest code=`fb2dfa9` #484. Re-verified whole-session GO on LIVE prod: **Gitea recent tasks ALL status=success** #478→#484 (no stuck/cancelled/fail; #484 21:30:36→21:35:49 in-baseline ~5m). **Mig 61 APPLIED-PROD** (`__EFMigrationsHistory` top==`20260701142752_BackfillEndedByLevelFinalizeFromChangelog`, pre=Mig60). **BACKFILL RE-CONFIRMED** A/005=1,A/008=1,A/010=0 (global flag-dist: 2×`=1` + 11×`=0` = exact target set, no over-reach). **sys.tables=88 excl-EFHistory / 89 incl** (⚠️ RECONCILE: S98-note-89 counted WITH `__EFMigrationsHistory`; 88+1=89 CONSISTENT no-drift; data-only Mig61 count-unchanged=correct). **Health 4×200** (ready/live/admin-root/eoffice-root). **Auth-login OK** token-len 468, **PE-list 200** (5KB items valid), menus/suppliers 200. **SignalR WIRED** bodyless-POST→411 (IIS Length-Required pre-auth NOT 404) · with-body→**200 full negotiate JSON** (connectionId+WebSockets transport) · no-auth→401 (JwtBearer challenge OK) — gotcha #25 clear. **BE ship-proof** `SolutionErp.Infrastructure.dll` mtime **21:31:39 in-#484-window** + w3wp fresh PIDs 21:32:41/21:35:25 (recycle happened). **⚠️ BUNDLE ROTATED AGAIN since #484-entry**: admin js **`mEGqlNWc`** (was `CeTA7Z82`) / user js **`Dnrp4PU1`** (was `CGaAyXen`) · CSS FROZEN admin `Bbtesa6B`/user `BmuPz_Dy`. Both REAL (admin 1637596b / user 1543944b vs SPA-trap-control `ZZfake…`→919b) · Last-Modified admin 14:34:26Z=21:34:26+07 / user 14:35:20Z=21:35:20+07 BOTH in-#484-window · immutable-max-age-1y. **⟹ #69 CONFIRMED: unconditional FE-rebuild rotates hash EVERY deploy even DATA-FIX commit (0 `fe-*/src` diff) — rotation=deploy-artifact NOT ship-signal; real-FE-ship = diff fe-src + real-size + Last-Modified-in-window (all satisfied by #483 real badge-FE + #484 benign-rotate).** 🔑 **WHOLE-SESSION GO = every-commit-CI-success + Mig-top==HEAD + backfill-exact + control-untouched + 4×health-200 + auth+PE+SignalR-wired + BE-dll+w3wp-in-window + bundles-real-in-window.** ⚠️ tooling: w3wp `$_.StartTime` mangled thru nested ssh→PS (S42) → base64-EncodedCommand fixed; sys.tables 2-variants to reconcile EF-history inclusion. -- **🟢 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+S97 FINAL-SESSION-REVIEW (2026-07-01 end) — 11-commit day #478-#484 ALL-DEPLOYED-HEALTHY, verdict CLEAN (whole-session GO trên LIVE prod):** CI-success ×7 + Mig61 history-top + backfill A/005=1/A/008=1/A/010=0 exact + sys.tables 88-excl/89-incl reconcile + health 4×200 + auth/PE-list/SignalR wired (#25 clear) + BE-dll+w3wp in-#484-window. ⚠️ bundle ROTATED post-#484: admin js **`mEGqlNWc`**/user **`Dnrp4PU1`**, CSS frozen — **#69 CONFIRMED: rebuild rotate MỌI deploy kể cả data-fix; rotation ≠ ship-signal** (real-FE-ship = diff fe-src + real-size + Last-Modified-in-window). 🔑 **WHOLE-SESSION GO = every-commit-CI-success + Mig-top==HEAD + backfill-exact + control-untouched + 4×health-200 + auth+PE+SignalR-wired + BE-dll+w3wp-in-window + bundles-real-in-window.** Full verbatim → `archive/2026-07.md` via `_INDEX` (curate S98). +- **🟢 S97 #484 (run_number 370) `fb2dfa9` GO ~5m — DATA-FIX Mig 61 backfill EndedByLevelFinalize từ Changelogs (fix Mig 60 wrong-table, gotcha #79):** sqlcmd **A/005=1 + A/008=1** (0→1 = fix ăn) · **A/010=0** control · Mig61 `__EFMigrationsHistory` top · endsBeforeCeo FLIP live A/005=True · smoke 200×3 + PE-list 200 · baseline 440. 🔑 **DATA-FIX-BACKFILL PASS = CI-success + Mig-top==HEAD + sqlcmd-target-rows-flip-EXACT + control-untouched + derived-API-field-FLIP-live + smoke-200.** Full verbatim → `archive/2026-07.md` via `_INDEX` (curate S98). +- _(endsBeforeCeo-saga PE finalize UAT cluster anh Kiệt: **S97 #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`** 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`)_ @@ -82,5 +82,6 @@ BE (test+build) ~90s · FE × 2 ~60s/app · deploy ~30s · **total ~3min code / ## 🔄 Curate trigger - >~30KB → archive recent runs → L2 `archive/.md` (byte-exact append) + `_INDEX.md` substring pointer. Dup failure patterns → merge. Stale >3mo → remove. -- **Last curate: 2026-06-20 S80 (em-main, archive-gate keep-floor-hit → manual)** (38.8→~16KB): moved 3 huge run-entries #330/#318/#325 (lines 73/90/96 byte-exact via `sed`) → `archive/2026-06.md` (100.6→116.7KB) + `_INDEX.md` +3 substring pointers (verified count=1). KEPT foundation (bug-patterns/5-stage/10-point gold) + compressed essentials + run-stubs; UPDATED stale (130→354 test Stage-3 + 263→354 essentials, Mig 55→57, bundle→#330) + dropped verbose per-run bundle-history (S86/S85/S84 → archived run-entries). +- **Last curate: 2026-07-02 S98 (em-main, garble-pressure #53 structural — L1 19.9KB > self-target 17.1KB)** (19.9→17.06KB): moved 2 huge S97 entries (S96+S97 FINAL-SESSION-REVIEW + #484 data-fix) content-exact → `archive/2026-07.md` (NEW) + `_INDEX.md` +2 substring pointers (count=1 verified; V3 reviewer PASS, byte-arithmetic đóng vòng 2858B). KEPT 🔑 pattern-keys trong 2 stub L1. +- **Prev curate: 2026-06-20 S80 (em-main, archive-gate keep-floor-hit → manual)** (38.8→~16KB): moved 3 huge run-entries #330/#318/#325 (lines 73/90/96 byte-exact via `sed`) → `archive/2026-06.md` (100.6→116.7KB) + `_INDEX.md` +3 substring pointers (verified count=1). KEPT foundation (bug-patterns/5-stage/10-point gold) + compressed essentials + run-stubs; UPDATED stale (130→354 test Stage-3 + 263→354 essentials, Mig 55→57, bundle→#330) + dropped verbose per-run bundle-history (S86/S85/S84 → archived run-entries). - **Prev curate: 2026-06-17 S70 Harness-9** (65.2→23.2KB dark-matter recovery, built _INDEX/gist gen:1). Earlier: S66 · S40. diff --git a/.claude/agent-memory/cicd-monitor/archive/2026-07.md b/.claude/agent-memory/cicd-monitor/archive/2026-07.md new file mode 100644 index 0000000..d8178fa --- /dev/null +++ b/.claude/agent-memory/cicd-monitor/archive/2026-07.md @@ -0,0 +1,8 @@ +# CI/CD Monitor — Archive 2026-07 (verbatim, FROZEN additive-only) + +> Curated L1→L2 by em-main (S98 2026-07-02 — garble-pressure #53 structural: L1 19.9KB > self-target 17.1KB). Records moved from `MEMORY.md` **content-exact (terminator normalized CRLF→LF — V3 verified sha-match trên text nội dung)**; L1 keeps compressed stubs + 🔑 pattern-keys. Lookup: `archive/_INDEX.md`. NEVER rewrite existing bytes; append-only. + +--- + +- **🟢🟢 S96+S97 FINAL-SESSION-REVIEW (2026-07-01 end, em main "review kỹ trước đóng session") — 11-commit day (S96 #478-480 + S97 #481-484 + docs closeouts) ALL-DEPLOYED-HEALTHY, verdict CLEAN.** HEAD=`5c914e4` (docs-only) → latest code=`fb2dfa9` #484. Re-verified whole-session GO on LIVE prod: **Gitea recent tasks ALL status=success** #478→#484 (no stuck/cancelled/fail; #484 21:30:36→21:35:49 in-baseline ~5m). **Mig 61 APPLIED-PROD** (`__EFMigrationsHistory` top==`20260701142752_BackfillEndedByLevelFinalizeFromChangelog`, pre=Mig60). **BACKFILL RE-CONFIRMED** A/005=1,A/008=1,A/010=0 (global flag-dist: 2×`=1` + 11×`=0` = exact target set, no over-reach). **sys.tables=88 excl-EFHistory / 89 incl** (⚠️ RECONCILE: S97-note-89 counted WITH `__EFMigrationsHistory`; 88+1=89 CONSISTENT no-drift; data-only Mig61 count-unchanged=correct). **Health 4×200** (ready/live/admin-root/eoffice-root). **Auth-login OK** token-len 468, **PE-list 200** (5KB items valid), menus/suppliers 200. **SignalR WIRED** bodyless-POST→411 (IIS Length-Required pre-auth NOT 404) · with-body→**200 full negotiate JSON** (connectionId+WebSockets transport) · no-auth→401 (JwtBearer challenge OK) — gotcha #25 clear. **BE ship-proof** `SolutionErp.Infrastructure.dll` mtime **21:31:39 in-#484-window** + w3wp fresh PIDs 21:32:41/21:35:25 (recycle happened). **⚠️ BUNDLE ROTATED AGAIN since #484-entry**: admin js **`mEGqlNWc`** (was `CeTA7Z82`) / user js **`Dnrp4PU1`** (was `CGaAyXen`) · CSS FROZEN admin `Bbtesa6B`/user `BmuPz_Dy`. Both REAL (admin 1637596b / user 1543944b vs SPA-trap-control `ZZfake…`→919b) · Last-Modified admin 14:34:26Z=21:34:26+07 / user 14:35:20Z=21:35:20+07 BOTH in-#484-window · immutable-max-age-1y. **⟹ #69 CONFIRMED: unconditional FE-rebuild rotates hash EVERY deploy even DATA-FIX commit (0 `fe-*/src` diff) — rotation=deploy-artifact NOT ship-signal; real-FE-ship = diff fe-src + real-size + Last-Modified-in-window (all satisfied by #483 real badge-FE + #484 benign-rotate).** 🔑 **WHOLE-SESSION GO = every-commit-CI-success + Mig-top==HEAD + backfill-exact + control-untouched + 4×health-200 + auth+PE+SignalR-wired + BE-dll+w3wp-in-window + bundles-real-in-window.** ⚠️ tooling: w3wp `$_.StartTime` mangled thru nested ssh→PS (S42) → base64-EncodedCommand fixed; sys.tables 2-variants to reconcile EF-history inclusion. +- **🟢 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. diff --git a/.claude/agent-memory/cicd-monitor/archive/_INDEX.md b/.claude/agent-memory/cicd-monitor/archive/_INDEX.md index e55374c..0bb3544 100644 --- a/.claude/agent-memory/cicd-monitor/archive/_INDEX.md +++ b/.claude/agent-memory/cicd-monitor/archive/_INDEX.md @@ -6,11 +6,17 @@ > **Archives are FROZEN / additive-only.** Records are never edited in place; this index + the `.gist.md` files are the only additive layers. > **SORTED by DATE (newest → oldest).** Labels: `[meta]` = curate-note (not a rich run-record) · `[stub→git]` = FIFO-trim pointer-to-git, thin · `[audit]` = read-only verify, no deploy · `[FAIL]`/`[PARTIAL]` = non-PASS verdict. > -> **Files indexed:** `2026-06.md` (39 records, no headings) · `2026-05-runs.md` (20 run-records + 6 meta-headers) · `2026-05-q4.md` (7) · `2026-05-q3.md` (3) · `2026-05-q2.md` (1). Total **76 records**. +> **Files indexed:** `2026-07.md` (2 records, S98 curate) · `2026-06.md` (39 records, no headings) · `2026-05-runs.md` (20 run-records + 6 meta-headers) · `2026-05-q4.md` (7) · `2026-05-q3.md` (3) · `2026-05-q2.md` (1). Total **78 records**. > Even-older verbatim (S29 #232 ← pre-S38) also lives in git `d2f52ba`. Gist companions: `2026-06.gist.md` + `2026-05.gist.md`. --- +## 2026-07 (file: `archive/2026-07.md`) + + +- 2026-07-01 · S96+S97 FINAL-SESSION-REVIEW 11-commit day #478-#484 ALL-HEALTHY whole-session GO · CLEAN, bundle rotated-post-#484 mEGqlNWc/Dnrp4PU1 (#69 confirmed data-fix-rotate) · `2026-07.md` · substring:"S96+S97 FINAL-SESSION-REVIEW (2026-07-01 end" +- 2026-07-01 · S97 #484 DATA-FIX Mig 61 backfill EndedByLevelFinalize từ Changelogs (fix Mig 60 wrong-table #79) · PASS backfill-flip A/005+A/008=1 control-A/010=0, Mig61-history-top, smoke-200×3 · `2026-07.md` · substring:"S97 #484 (id=484, run_number 370)" + ## 2026-06 (file: `archive/2026-06.md`) diff --git a/.claude/agent-memory/database-agent/MEMORY.md b/.claude/agent-memory/database-agent/MEMORY.md index 864e25d..735ebbc 100644 --- a/.claude/agent-memory/database-agent/MEMORY.md +++ b/.claude/agent-memory/database-agent/MEMORY.md @@ -33,3 +33,4 @@ - **S52 (2026-06-08):** Seeded (em main, adap-apply database-agent). Roster 10→11. Nấc executed-file. CHỜ restart + spawn-test → verified-runtime. - **S56 (2026-06-09) — pre-golive verify (2nd real spawn, verified-runtime ✓):** Schema/Mig integrity P11 + S55 master-data = SOLID. Mig 42-48 applied IDENTICALLY Dev+Design+prod `.\SQLEXPRESS` (48 mig / 92 tables, **NO S53-style unapplied-local drift**); 0 pending model-snapshot diff; **9 gotcha-#57 filtered-unique** confirmed BOTH EF config (HasFilter×13) AND DB (`filter_definition=([IsDeleted]=(0))`) incl Vehicle/Driver day-1; FK đúng (LeaveBalance→LeaveType Restrict + UNIQUE(User,Type,Year); 4× LevelOpinions Cascade(parent)/Restrict(Level)+UNIQUE composite; ItTicket SLA nullable). **DB11 FAIL (1 major, fast-follow KHÔNG blocker):** `LeaveBalance.UsedDays += NumDays` @ `LeaveOtApprovalFeatures.cs:361-386` chạy bare SaveChanges (no tx / no RowVersion / READ COMMITTED) → concurrent double-approve lost-update. **S43 gap STILL OPEN.** Fix-pattern sẵn repo: Serializable tx (codegen `:34`) HOẶC RowVersion+retry (1 mig). Low-prob ~30 user, recoverable Admin Adjustment. Tag [s56, pre-golive-verify, schema-pass, db11-lostupdate-open]. - **S57bis (2026-06-11) — PE gắn Hạng mục design (3rd real spawn, DELIVERED — on-behalf em main ghi hộ, H2-proposed):** Introspect LocalDB → design `PurchaseEvaluations.WorkItemId Guid?` scalar **loose-Guid + IX, KHÔNG FK vật lý** — nhất quán convention PE (ProjectId/SelectedSupplierId đều loose; duy nhất ApprovalWorkflowId có FK). Guard = validator + handler mirror S43 FK-invariant. KHÔNG đụng CodeSequences (mã phiếu giữ `PE/{YYYY}/{A|B}/{Seq}`). LEARNED: PE FK-convention map (loose-Guid là norm module này — FK vật lý là exception). SURPRISE: WorkItems = catalog GLOBAL (KHÔNG ProjectId) → 2 dropdown độc lập; "Dự án (năm) – Hạng mục" chỉ là chuỗi ghép hiển thị, không ràng buộc quan hệ. Ship: Mig 49 deploy Run #381 prod-applied. Tag `[s57bis, mig49-design, on-behalf]`. +- **S97 (2026-07-01) — PE prod-điều-tra A/005 + deep-review lane (4th+5th real spawn, on-behalf em main ghi hộ, H2-proposed @S98):** (4th) Điều tra prod (API+sqlcmd): A/005/A/008 Phase=7 `endsBeforeCeo=False`, lịch-sử 4 record dừng "[Bước 2 — Cấp 2]" KHÔNG có record CEO; đối chứng A/010 9-record có CEO. **Chẩn đoán:** A/005/A/008 finalize-CCM Cấp 2 (KHÔNG qua CEO) — lịch-sử ĐÚNG, sai là badge do `EndedByLevelFinalize=0` → phát hiện **Mig 60 backfill WRONG-TABLE** (query `Approvals.Comment` nhưng marker do `LogTransitionAsync:1073` ghi `Changelogs.ContextNote`) → dẫn tới Mig 61 + gotcha #79. (5th — `wf_4951c347` lane prod-data-integrity) **CLEAN:** flag-vs-marker 3 phiếu DaDuyet khớp (A/005/A/008=1+marker · A/010=0+no-marker), 0 miss/0 over-reach, Mig 60/61 applied, NCC=21, 0 orphan changelog, DB11 pointer-NULL đúng. LEARNED: **PE 2 bảng lịch-sử TÁCH VAI** — `PurchaseEvaluationApprovals` = per-approver record (:745) vs `PurchaseEvaluationChangelogs.ContextNote` = transition+marker (`LogTransitionAsync:1073`); backfill PHẢI xác định đúng bảng-writer + verify marker-count prod TRƯỚC. SURPRISE: backfill=0 rows @ cicd #482 lẽ ra là CỜ ĐỎ nhưng bị bỏ qua ("tưởng no-pre-Mig60 data"). Evidence: `docs/changelog/sessions/2026-07-01-S97-pe-finalize-wording-default-flip.md:97-133`. Tag `[s97, mig60-wrongtable, gotcha79, prod-integrity-clean, on-behalf]`. diff --git a/.claude/agent-memory/harvest-curator/MEMORY.md b/.claude/agent-memory/harvest-curator/MEMORY.md index 90db229..3c6a557 100644 --- a/.claude/agent-memory/harvest-curator/MEMORY.md +++ b/.claude/agent-memory/harvest-curator/MEMORY.md @@ -38,3 +38,4 @@ H2 harvest-MD-integrity auditor **SOLUTION_ERP-self**. Read-only + **propose-onl - **2026-06-15 (S63 `/session-end` 5-trục GATE — em-main-solo, 0 product-sub):** **GATE PASS 5/5, 0 MISS, 0 orphan.** Session = bootstrap + S63 closeout(S60-62) + check-email + Harness 5/6 adopt + gitattributes; sub DUY NHẤT = 2 monitor (H1+H2 start+end). Coverage: 2 monitor record-proposed (không product-sub miss). Completeness 4-field. **0-byte=0** ×8 file S63-written (session-log 10264B · adap-report H5 4930B/H6 5562B · adap-request 2779B · email 3853B · .gitattributes 348B · 2 reviewer child 1838/1701B). Placement: **fe-admin/.claude GONE** + 2 child đúng `agent-memory/reviewer/` + **pointer no-overwrite (31959B preserved)** + moved-not-cut (git log → S63 `5e6dcc1`). Corruption: U+FFFD=0 ×8. Fidelity: em-main-solo honest self-gate (đúng H6.1 governance→solo + precedent S56) → no-escalate. Wave=0 (S63 no-workflow). **3 flag non-block:** (1) email body-hash `8a247984` H2 không verify scope (3 candidate Python sai formula) — **em main ĐÃ self-verify spec-canonical recompute==stored** (PowerShell), non-issue · (2) **cicd 62KB over-cap 5th-session +2.3KB/S61 → curate-L2 P1 GẤP** (carry 41→54→56→61→62KB) · (3) "CLAUDE.md count stale" = docs/CLAUDE.md FULL (root ĐÃ fresh). Tag [s63-end, gate-pass-5/5, 0-miss, em-main-solo, cicd-62kb]. *(em main APPEND B3 — H2-proposed, verify: 0-byte ×8 + pointer-31959B + tree-clean đối chiếu độc lập ✓)* - **2026-06-16 (S66 @start RE-REPORT + @end GATE — em-main-solo, 0 product-sub):** @start: 0 orphan (S65 PE fan-out fully harvested+committed incl 2 empty-return subs) · 0 corruption (AS-8 clean) · Fidelity PASS (HoSoLink+Mig51/52 ground-truthed) · **🔴 cicd-monitor L1 86.8KB 2.9× cap GẤP** → em main curate **86.8→28.9KB** byte-exact sed move (Run #286→#232 → archive/2026-06.md, incl #291 forensic [lesson=gotcha#65]; baseline + 6 runs #289-#295 giữ). @end GATE 5-trục: Coverage (2 monitor spawn-record) · Completeness (4-field) · Placement (đúng agent-memory) · Corruption (moved-not-cut + email body-hash round-trip MATCH) · Fidelity PASS. NO wave-folder (no WAVE-MODE). GATE **PASS 5/5**. on-behalf em main (H2 read-only). +- **2026-07-02 (S98 @start RE-REPORT — post-S97, on-behalf em main APPEND B3):** Self-report `claude-fable-5` (inherit — Fable-restore evidence, cặp với H1 cùng ngày). Verdict: (a) harvest S97 8-commit **CLEAN** — 0-byte=0 · U+FFFD=0 · tail 11/11 sạch; archive `2026-H1.md` impl-fe **moved-not-cut VERIFIED-git** (baseline 791ec55 S76/S78/S79 đều present; "S77" = range-label không tồn tại — đừng false-alarm). (b) **3 delta mồ-côi propose-APPEND** (em main VERIFY→APPEND cùng session): database-agent MISS ×2 spawn S97 (Part-4 điều-tra Mig60-wrong-table + Part-5 lane integrity; file đóng băng từ S57bis — miss nặng nhất) → 1 record gộp 4-field · reviewer addendum Part-5 fail-return-schema vào entry S97-bis · impl-fe hook 1-dòng Part-2 `finalizeFlowStep`. (c) Orphan runs **0/15** (ledger `⏳` chỉ dòng legend); NOTE INFORM: S97 2 HMW workflow (`wf_0e01fdba`/`wf_4951c347`) **ephemeral KHÔNG ghi run-folder** = pattern S94+ — ledger H10 hiện chỉ cover run kiểu cũ. (d) Stray=0 (guard S76 giữ). **Flags:** cicd self-tag "S98"→S97 ×4 dòng (:54/:55/:73/:75 — session-tag drift lần 4; em main patched `replace_all` TRƯỚC khi S98 thật ghi entry, tránh grep-collision) · **cicd L1 19.9KB > self-target 17.1KB garble-pressure (#53 structural) → archive-sớm @closeout** · impl-be 23.9KB gần cap watch. Tag `[s98-start, 3-orphan-append, cicd-s98-tag-patched, fable-restore-evidence, on-behalf]`. diff --git a/.claude/agent-memory/implementer-frontend/MEMORY.md b/.claude/agent-memory/implementer-frontend/MEMORY.md index 4f87db2..a33e3b8 100644 --- a/.claude/agent-memory/implementer-frontend/MEMORY.md +++ b/.claude/agent-memory/implementer-frontend/MEMORY.md @@ -13,6 +13,9 @@ FE-ONLY, PROD LIVE. Đối xứng fix endsBeforeCeo (Mig 60). EDIT1 mở rộng - **EDIT2 6 site (grep `PeFinalizeChip endsBeforeCeo` = 6, hết):** admin{PeListPanel:162, ListPage:492} + user{PeListPanel:162, ListPage:492, InboxPage:292, UserDashboardPage:286}. MỌI item = `p` có `.phase` (đã dùng `getPeDisplayStatus(p.phase)`) → KHÔNG bịa. Grep-confirm 6/6 có `phase=`, 0 sót. - Build PASS ×2 (admin 1948mod `index-CScNAtL0.js` / user 1937mod `index-W2A6gg7n.js`, 0 TS err). Pre-existing warn: >500KB (#69) + realtime.ts dynamic. NO BE/mig/test touch. Full precedent (S89 tạo chip). Tag `[s97-badge, ceo-approved-chip, prop-type-number-not-union, ts2322-gotcha, 6-callsite, sha256-2pair]`. +## 🆕 S97-Part2 (2026-07-01) — FE gate endsBeforeCeo runtime (hook 1-dòng, on-behalf H2-proposed @S98) +- 2-app mirror `PeWorkflowPanel`: gate `finalizeFlowStep = endsBeforeCeo ? find(...) : null` + banner ~:278 (làm-mờ Bước CEO theo cờ RUNTIME Mig 60), type `endsBeforeCeo: boolean` sẵn 2 DTO, SHA256 IDENTICAL `b7abbc2f…`. Substance đã được cover third-party: reviewer MEMORY entry S97-bis + session-log S97 Part-2. Tag `[s97-part2, endsbeforeceo-gate, hook-only]`. + ## 🆕 S97 (2026-07-01) — PE finalize wording + đảo default checkbox opt-out→opt-in ×2 app (anh Kiệt FDC UAT, em-main chốt) 4 chuỗi-edit `PeWorkflowPanel.tsx` × {admin,user} = 8 hunk. PROD LIVE UAT (anh Kiệt xem trực tiếp). File 2 app byte-identical trước+sau → SHA-pair đúng nghĩa. - **E1 default checkbox:** `useState(true)`→`useState(false)` (~:57). Đảo S96 opt-out→opt-in: giờ default KHÔNG kết thúc, phải TÍCH mới finalize. diff --git a/.claude/agent-memory/investigator-codebase/MEMORY.md b/.claude/agent-memory/investigator-codebase/MEMORY.md index 3d01932..d2734aa 100644 --- a/.claude/agent-memory/investigator-codebase/MEMORY.md +++ b/.claude/agent-memory/investigator-codebase/MEMORY.md @@ -70,6 +70,7 @@ 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-02 S98 verify-lane V2 post-flush (VERDICT PASS):** detector 28→25 (derived-stale 11→8; wikilink 14 + vocab-fork 3 giữ by-design). **8 derived-stale còn = 100% FP-class count-token soft-net:** CLAUDE.md:84 tests-tree "(6 test…)" · ef-core SKILL :94/:95 ("2/1 migration tách/GỘP" history) + :103/:111/:114 ("4/3/1 bảng" Budget-defer/Mig-15 module-local) + :162/:179 (heading "Revert 1 migration" + comment "Script từ 1 migration") — 0 genuine drift vs canonical 61/89/440/79; SKILL edit sáng (+rows 60/61 @:82-83) chỉ shift line-number FP cũ, 0 flag MỚI. ⭐ Grep gotcha: **"Fable RESTORED" exact-string CHỈ STATUS:24 + session-start:29; agents/README dùng biến-thể "Fable 5 1M RESTORED" (:3) + "Fable-restore" (:12)** — exact-phrase grep miss README dù substance đủ. HANDOFF:5 mega-line: bundle mEGqlNWc/Dnrp4PU1=#484, CeTA7Z82 chỉ trong note "= #483" (1 line match duy nhất cả file). 3 on-behalf append đúng-chỗ: database-agent :36 (cuối Log = EOF) · reviewer addendum TRONG-entry S97-bis :68 (câu cuối + marker on-behalf @S98) · impl-fe S97-Part2 :16 giữa badge:9/S97:19. cicd "S98" = 2× "(curate S98)" stub :73/:74, 0 material-tag. Ledger :7 Mode-A ephemeral note (wf mode-A vắng ledger-row ≠ orphan) + bảng 15 row :11-25 nguyên. - **2026-07-01 S97 session-end feedback-audit (VERDICT CLEAN):** Grep-verified capture readiness pre-close. ✅ gotcha #77/#78/#79 present `docs/gotchas.md:1301/1317/1325` (format `### N.` count=79 = STATUS header — no self-count drift; all 3 have Triệu-chứng+Cơ-chế+Fix+**Quy-tắc** root-cause). ✅ #53 return-garble **x6 (cicd 5/6)** in BOTH `feedback_agent_return_garble_recover.md` (Why-line ×5→×6 + **structural root-cause: cicd MEMORY self-target ~17.1KB→curate-at-return→thinking-step=message-cuối=return-value**; fix=archive-cicd-sớm NOT instruction) AND S97-log Parts 1/2/4 (lần-4/5/6). cicd MEMORY LIVE=17.5KB (confirms self-target). ✅ Mig 60 wrong-table BUG = 2-fix present: code (Mig 61 `20260701142752` query Changelogs) + guard (gotcha #79 "xác định ĐÚNG bảng writer" + "verify marker-count prod trước"). Mig 60 code `:29-31` confirmed `PurchaseEvaluationApprovals a...a.Comment LIKE` = wrong. Both Mig 60/61 have 3-file rule. ✅ git status CLEAN, 0 stray `.claude` misland, 0 `git add -A` in log, S97 workflows HMW-ephemeral (NOT persisted run-folders — consistent S94+ pattern, runs/ only old 06-18). ✅ Product decisions captured (STATUS/HANDOFF/log + commit-msg): "duyệt là fix"→#480 price-lock, "fix trọn"→Mig 60 endsBeforeCeo-runtime, "hiện luôn CEO duyệt"→#483 badge, Supplier-backlog "15-18 field"→STATUS Next-up. **MINOR only:** S97-log per-Part State footers show progression (Part-1 `:47` "88 bảng gotcha 77" stale vs session-end "89/79" Part-4 `:113`) — intentional per-part snapshot but mid-log reader sees stale count. No BLOCKING/MAJOR gaps. - **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. diff --git a/.claude/agent-memory/reviewer/MEMORY.md b/.claude/agent-memory/reviewer/MEMORY.md index 4de193c..4760b6c 100644 --- a/.claude/agent-memory/reviewer/MEMORY.md +++ b/.claude/agent-memory/reviewer/MEMORY.md @@ -65,7 +65,11 @@ Adversarial pre-commit reviewer SOLUTION_ERP. Read-only verify + live curl prod ## 📅 Recent activity (compressed — full verbatim → `archive/2026-06.md` via `archive/_INDEX.md`) -- **S97-bis (2026-07-01) PE EndsBeforeCeo CONFIG→RUNTIME + Mig 60 backfill (bug anh Kiệt FDC, cross-stack+mig, live UAT) — PASS (0 issue):** field `EndedByLevelFinalize` set true DUY NHẤT nhánh level-finalize service:871 (grep-all confirm 5 nhánh DaDuyet: 671 drafter-auto / 873 finalize-SET / 911 ccm-delegation / 943 all-steps-CEO / 1049 V1-legacy — chỉ 873 set, 4 nhánh còn lại giữ false = đúng semantics). 4 projection nhất quán: detail ternary `phase==DaDuyet?field:true` (:1153) · List/Inbox `Phase==DaDuyet?field:config-subquery` (:647/:767) · ListApproved direct field (filter DaDuyet :176). **Migration 3-file OK** (Designer+Snapshot có bit-NOT-NULL-default-false); backfill marker `LIKE N'%Duyệt KẾT THÚC tại%'` KHỚP-EXACT service comment:883 (system prefix, user-comment nối SAU) + table `PurchaseEvaluationApprovals` verified (config:148+DbSet) + `Phase=7`=DaDuyet verified enum. ccm-delegation comment `[CCM duyệt done miễn CEO]` KHÔNG match backfill → false nhất-quán runtime. **EF-translate ternary List/Inbox CONFIRMED runtime** (không giả định): `PeDraftVisibilityTests` gọi ListPurchaseEvaluationsQuery full-projection nằm trong 395 Infra PASS. FE 2-app SHA256-IDENTICAL `b7abbc2f`, gate `finalizeFlowStep=endsBeforeCeo?find:null` + banner:278 + type `endsBeforeCeo:boolean` có sẵn 2 DTO. **Build slnx 0w/0e + 440 test (45D+395I) 0-fail + tsc×2 exit-0** (self-verified, không tin claim). Test repro `peFinButWentCeo` (cùng-config finalize + field=false → EndsBeforeCeo=FALSE) = contrast quyết-định runtime-vs-config, xuất sắc. **Anti-pattern-none:** 11-file đúng-scope 0-drift, extend-in-place test NET+0-method giữ 440. Lesson: backfill LIKE-2-wildcard trên chuỗi VN-đặc-thù = false-positive risk MINOR-lý-thuyết (chỉ phiếu DaDuyet-hiện-tại 1-lần, UAT ít-phiếu) KHÔNG đủ FAIL. Config→runtime split đúng: chỉ THÊM chính-xác cho DaDuyet, non-DaDuyet giữ heads-up config như trước = không regression. +- **S98 (2026-07-02) FIDELITY GATE gist impl-frontend 2026-H1 (10 record → 6 cụm + 5 reflection) — PASS-với-sửa (1 minor):** 34/34 substring-pointer count==1 (grep -o -F đếm occurrence, gồm cặp bẫy "gotcha #50"≠"gotcha#50" resolve 2 record khác nhau đều hợp-cảnh). 3 interpretive-flag verify GROUND-TRUTH ngoài verbatim: double-rAF (code ListPage:270 comment "2 rAF để browser commit translate-x-full TRƯỚC" + duration-200) · 2 PageHeader song-song (4 file disk thật ×2 app) · wildcard `ev.*Note` theo-từng-mut (đúng 3 call-site 1770/1785/1841). FLAG cwd-misland hướng-chéo: session-log S76:40 CORROBORATE verbatim (cd fe-admin → rơi fe-user/.claude) + .gitignore L109-111 comment trung-tính → draft trung-tính ĐÚNG, không sửa hướng. Sửa duy nhất: R4 parenthetical nói chuỗi "nằm trong chính gist" — misleading, chuỗi resolve count==1 trong archive. Lesson: fidelity-gate 3 lớp = so-verbatim + pointer-arithmetic + ground-truth-code cho MỌI chỗ gist DIỄN GIẢI vượt verbatim; honest-empty BẤT-NGỜ="không" > bịa filler; verbatim TỰ mâu-thuẫn (S52-vs-S53) → gist flag discrepancy chứ KHÔNG resolve bịa (anti-S88-fabrication-by-merge, lần này draft làm đúng). +- **S98 (2026-07-02) VERIFY LANE V3 cicd-monitor L1-curate moved-not-cut — PASS (0 blocking, 3 minor):** sha256 line-level backup-L73/74 == archive-L7/8 (2398/1909B text) + byte-arithmetic đóng EXACT (removed 4309 raw − stubs 1451 = 2858 = size-delta 19917→17059) + diff duy-nhất `73,74c73,74` + CR/LF profile 86/86→86/86 không đổi + FROZEN archives 0-diff + _INDEX 78=2+39+20+6+7+3+1 pointer-resolve count==1. **Tool-lesson Windows byte-verify:** MSYS grep/sed/awk = TEXT-MODE strip `\r` (grep -c `\r` báo 0 trên file CRLF thuần!); od-token-pipeline đếm sai (641 vs 86 — token-split artifact); ground-truth = `.NET ReadAllBytes` / `wc -c` / `tr` pipe / `od -c` tail. Moved entries CRLF→LF normalize (encoding-only, 0 ký tự mất — Write tool ghi file mới LF uniform). Minor caught: MEMORY.md "Last curate" ledger vẫn S80 (S98 chưa ghi sổ, discoverable qua stub "(curate S98)"); archive-header chữ "byte-exact" đúng trừ CR-terminator. +- **S98 (2026-07-02) VERIFY LANE V1 re-tier mega-line STATUS/HANDOFF conservation (uncommitted) — PASS (0 mismatch):** blurb S94+S93 cắt khỏi mega-line = VERBATIM trong archive tier-S98 (STATUS IndexOf ordinal 9412/11090 · HANDOFF 6147/7775; HEAD cross-check cùng blurb, HANDOFF lệch +51 = đúng bundle-hash morning-edit TRƯỚC blurb). **Proof-of-no-other-deletion = arithmetic full-accounting** prefix+b94+sep(` · `,3)+b93+tail(125=old-pointer) == lineLen exact ×2 file — mạnh hơn spot-check. Old-pointer tái hiện trong pointer mới (archive-S98 + archive-S94 đều =1). Kỹ thuật-bẫy: commonPrefix lấn 1-char (`*` đầu `**Prev` trùng `*` mở italic pointer mới) → Replace-decompose trên removed-region FAIL giả; fix = IndexOf(blurb) trên FULL line. Line-count bằng (92/92, 12/12) → index-by-index diff enumerate đủ 6+2 dòng vào allowed-list. Flagged: archive `??` UNTRACKED — phải `git add` cùng commit kẻo pointer gãy. Read-tool truncate dòng >2K = KHÔNG verify được mega-line → PS ReadAllLines UTF8 + ordinal IndexOf là đường duy nhất. + +- **S97-bis (2026-07-01) PE EndsBeforeCeo CONFIG→RUNTIME + Mig 60 backfill (bug anh Kiệt FDC, cross-stack+mig, live UAT) — PASS (0 issue):** field `EndedByLevelFinalize` set true DUY NHẤT nhánh level-finalize service:871 (grep-all confirm 5 nhánh DaDuyet: 671 drafter-auto / 873 finalize-SET / 911 ccm-delegation / 943 all-steps-CEO / 1049 V1-legacy — chỉ 873 set, 4 nhánh còn lại giữ false = đúng semantics). 4 projection nhất quán: detail ternary `phase==DaDuyet?field:true` (:1153) · List/Inbox `Phase==DaDuyet?field:config-subquery` (:647/:767) · ListApproved direct field (filter DaDuyet :176). **Migration 3-file OK** (Designer+Snapshot có bit-NOT-NULL-default-false); backfill marker `LIKE N'%Duyệt KẾT THÚC tại%'` KHỚP-EXACT service comment:883 (system prefix, user-comment nối SAU) + table `PurchaseEvaluationApprovals` verified (config:148+DbSet) + `Phase=7`=DaDuyet verified enum. ccm-delegation comment `[CCM duyệt done miễn CEO]` KHÔNG match backfill → false nhất-quán runtime. **EF-translate ternary List/Inbox CONFIRMED runtime** (không giả định): `PeDraftVisibilityTests` gọi ListPurchaseEvaluationsQuery full-projection nằm trong 395 Infra PASS. FE 2-app SHA256-IDENTICAL `b7abbc2f`, gate `finalizeFlowStep=endsBeforeCeo?find:null` + banner:278 + type `endsBeforeCeo:boolean` có sẵn 2 DTO. **Build slnx 0w/0e + 440 test (45D+395I) 0-fail + tsc×2 exit-0** (self-verified, không tin claim). Test repro `peFinButWentCeo` (cùng-config finalize + field=false → EndsBeforeCeo=FALSE) = contrast quyết-định runtime-vs-config, xuất sắc. **Anti-pattern-none:** 11-file đúng-scope 0-drift, extend-in-place test NET+0-method giữ 440. Lesson: backfill LIKE-2-wildcard trên chuỗi VN-đặc-thù = false-positive risk MINOR-lý-thuyết (chỉ phiếu DaDuyet-hiện-tại 1-lần, UAT ít-phiếu) KHÔNG đủ FAIL. Config→runtime split đúng: chỉ THÊM chính-xác cho DaDuyet, non-DaDuyet giữ heads-up config như trước = không regression. **Re-affirmed @S97 Part-5 session-review lane** (spawn fail-return-schema → verdict recovered từ chính entry này per #53-recover-from-diary; em-main grep bổ-sung: 0 wrong-table pattern nào khác ngoài Mig 60 — đã fix Mig 61). *(addendum on-behalf H2-proposed @S98)* - **S97 (2026-07-01) PE finalize UAT ×2 app: reword badge + đảo default checkbox opt-out→opt-in (uncommitted, prod-live anh Kiệt FDC) — PASS (0 issue):** 4 hunk/file × 2 = 8 total, 12ins/12del, no thừa. E1 `useState(true→false)` L57 · E2 reset `setApplyLevelFinalize(false)` L221 · E3 helper-text reword (strings KHỚP spec verbatim) · E4 badge `không trình tới`→`Kết thúc tại {finalizeLevelName ?? finalizeStepName ?? 'cấp trên'}` + template-literal title. **SHA256 full-file IDENTICAL** `bcf812fd…` ×2 + git-diff --no-index exit-0. **Comment L121 `không trình tới` INTACT** (bare-string 2-site: comment giữ + JSX đổi) + **`e.target.checked` handler L664 INTACT** (spec correctly NOT flip). Logic-non-break VERIFIED: default-false → eligible-untick → `sendPrice`(L171)=false + `shouldPickPrice`(L496)=false → price-picker KHÔNG bắt (spec pt6 ✓); payload L200 `(approverFinalizeEligible ? applyLevelFinalize : true)` = pre-existing S96 opt-out no-op cho non-eligible, unaffected by flip. Type `finalizeStepName/LevelName: string|null` (purchaseEvaluation.ts:149-150) → `??`-chain TS-safe. 0 BE/test/mig leak. Build fresh ~17:55 ×2 (fe-user hash `DxUomy4C` KHỚP impl-claim; fe-admin rotate `DkyQ0xCd`→disk `l_kwCZIF` = #69 normal). Anti-pattern-none: precedent-backed cosmetic+default-flip, byte-mirror tight. diff --git a/.claude/agent-memory/tooling-auditor/MEMORY.md b/.claude/agent-memory/tooling-auditor/MEMORY.md index ad84ed9..ff3f94c 100644 --- a/.claude/agent-memory/tooling-auditor/MEMORY.md +++ b/.claude/agent-memory/tooling-auditor/MEMORY.md @@ -37,3 +37,4 @@ H1 tooling-freshness auditor **SOLUTION_ERP-self**. Read-only + **propose-only** - **2026-06-15 (S63 start+end CHỐT 4-mặt — em-main-solo session):** @start audit + @end chốt sau S63 closeout(S60-62) + Harness 5/6 adopt + .gitattributes. **Self-report `claude-opus-4-8[1m]`** ("Opus 4.8, 1M context") = demote-pin ĂN runtime post-restart — **data-point H5:** lead + demote-sub ĐỀU Opus 4.8 lúc Fable-down (two-tier collapse single-tier như H5 mô tả). Verdict: ①SKILL 🟡 count-flush ĐÚNG (Mig 50/88/gotcha 64 ở ef-core desc:3/hist:19/total:74 + README:20/:90 + dep-audit:153) NHƯNG 2 residual ef-core `:282`+`:291` kẹt 93/49 → **em main FIXED in-session**. ②ROSTER 🟢 11=11=11, two-tier frontmatter (4 inherit+7 pin) đúng, agents/README:10 caveat H5 consistent runtime. ③PLUGIN 🟢 18/15/3 identical, **0 new-alloc** (H5/H6=governance · .gitattributes=hygiene — KHÔNG skill/plugin mới). ④DOCS 🟡 canonical FRESH (root CLAUDE.md:53/:66/:133 + STATUS + HANDOFF + agents/README khớp state THẬT) · 2 stale deep-doc defer-monthly (docs/CLAUDE.md full 58→64/93→88 + schema-diagram §16+ Mig 32-50). Method ⭐: system-reminder claudeMd header = pre-session snapshot (hiện "49 mig→93" cũ) → re-Read line thật (root=50→88 fresh), KHÔNG tin context-injection. Tag [s63, 4-mat, model-opus-confirm-h5, ef-residual-fixed, canonical-fresh]. *(em main APPEND B3 — H1-proposed, verify: self-report model + ef-core :282/:291 fix + canonical grep độc lập ✓)* - **2026-06-16 (S66 @start RE-REPORT + @end CHỐT — em-main-solo session):** @start 4-mặt: skill 6/6 + standalone 23 (0 diff) · roster 11=11=11 intact · plugin 18/15/3 (0 new-alloc) · docs canonical FRESH (STATUS/HANDOFF/root-CLAUDE đã flush S65) NHƯNG ef-core SKILL stuck Mig 50 (TRUE 52) ×5 cites + skills/README ×2 + root gotcha 64→65 → em main flush hết. @end CHỐT: roster model-tier ĐỔI LỚN = adopt **Harness-8 all-inherit** (7 sub demoted claude-opus-4-8→inherit, gỡ two-tier H4 → cả 11=inherit) + agents/README codify + hmw.js comment + adap-report mới. 0 new skill/plugin. Nấc = executed-file VERIFIED-pending-restart. on-behalf em main (H1 read-only, propose→VERIFY→APPEND). +- **2026-07-02 (S98 @start RE-REPORT — Fable-restore evidence, on-behalf em main APPEND B3):** 4-mặt: ①SKILL DRIFT — ef-core SKILL `:3`/`:19` stuck Mig 59 (disk **61**, thiếu rows 60/61 — drift born-S97 HẬU-monthly-audit-CÙNG-NGÀY) + skills/README `:20`→61 + `:90` latest #76→**79** → em main flush cùng session-start. ②ROSTER 11=11=11, frontmatter **11/11 `model: inherit`** khớp H8; **spawn này self-report `claude-fable-5` qua inherit** → H8 flip runtime-verified (em main flush STATUS:24 + agents/README:12). ③PLUGIN 18/15/3 + marketplace 35 identical, 0 new-alloc; observed-first-time: settings `effortLevel: xhigh` + `model: claude-fable-5[1m]`. ④DOCS: monthly-audit 07-01 **ĐÃ CHẠY** (S96 `881783c` + session-log §1) nhưng pointer "Lần kế" chưa flip → 2026-08-01 (root CLAUDE:111 + STATUS:63) + **Fable BACK runtime** → gỡ 3 caveat H5.6 (STATUS:24 · agents/README:3 · session-start.md:29) + HANDOFF:5 bundle mismatch (#483-hash `CeTA7Z82`/`CGaAyXen` gắn nhầm #484; canonical `mEGqlNWc`/`Dnrp4PU1` — cicd-MEMORY final-review xác nhận rotate). **Method ⭐: drift born-SAU-monthly-CÙNG-NGÀY = lớp riêng — audit đúng lúc chạy vẫn stale cuối ngày; per-session monitor bù lớp này.** Tag `[s98-start, 4-mat, fable-restore-evidence, post-audit-drift, on-behalf]`. diff --git a/.claude/agents/README.md b/.claude/agents/README.md index 14183ce..3765862 100644 --- a/.claude/agents/README.md +++ b/.claude/agents/README.md @@ -1,6 +1,6 @@ # Multi-agent SOLUTION_ERP — Master Coordination Guide (11-agent) -> **Architecture:** 11 sub-agents **all-inherit top-tier (Harness-8 2026-06-16 — thay thế two-tier Harness-4)** + em main **Fable 5 (1M) Max** coordinator — **9 product/quality** (7 core + frontend-designer pink S47 + database-agent read-advisory S52) + **2 monitor INFORM-only** (`tooling-auditor` H1 + `harvest-curator` H2, 2026-06-07 Harness 1). Tier: **toàn bộ 11 sub `model: inherit`** (ăn top-tier model của lead — hiện Opus 4.8 1M do Fable suspended H5, tự lên Fable 5 khi về) · effort **Max** (env machine-wide). SE KHÔNG có lớp helper/gopher rẻ (cả 11 đều substantive memory-bearing → cả 11 lên inherit). *(Trước H8: 4 promote inherit + 7 demote pin `claude-opus-4-8` — lịch sử ở Upgrade 2026-06-10 + S66 dưới.)* +> **Architecture:** 11 sub-agents **all-inherit top-tier (Harness-8 2026-06-16 — thay thế two-tier Harness-4)** + em main **Fable 5 (1M) Max** coordinator — **9 product/quality** (7 core + frontend-designer pink S47 + database-agent read-advisory S52) + **2 monitor INFORM-only** (`tooling-auditor` H1 + `harvest-curator` H2, 2026-06-07 Harness 1). Tier: **toàn bộ 11 sub `model: inherit`** (ăn top-tier model của lead — ✅ **Fable 5 1M RESTORED, runtime-verified S98 2026-07-02**: 2 monitor spawn-test self-report `claude-fable-5`; giai đoạn fallback Opus H5 S62→S97 kết thúc) · effort **Max** (env machine-wide). SE KHÔNG có lớp helper/gopher rẻ (cả 11 đều substantive memory-bearing → cả 11 lên inherit). *(Trước H8: 4 promote inherit + 7 demote pin `claude-opus-4-8` — lịch sử ở Upgrade 2026-06-10 + S66 dưới.)* > **Upgrade S52 (2026-06-08 — AI_INFRA broadcast `2026-06-08-Agent-database-codebase-agents`):** **+database-agent (read-advisory DB specialist, floor DB1–DB11)** — schema/query/migration-design-review/perf/concurrency (DB11 RowVersion vá lost-update S43). Tailor READ-tier (implementer-backend vẫn author) · color OMIT (8 standard hết) · `store_memory` strip. `codebase-agent` = **SKIP n-a** (investigator-codebase đã cover grep/audit + `csharp-lsp` Windows no-op). ✅ **verified-runtime** — spawned OK S53 (first real spawn, caught Mig 46 committed-but-unapplied-local drift) + S56 2× (pre-golive-verify schema-stream + golive-harden design+review). DB11 lost-update fix landed S56 (atomic ExecuteUpdate + Serializable tx, gotcha #58). > Pattern: Anthropic Building Effective Agents orchestrator-workers + Cognition "writes single-threaded" hybrid + post-deploy automated watchdog. > **Upgrade S39 (2026-05-29):** 4→7 agent (split investigator + implementer, +test-specialist) + budget +50% + 5 RAG MCP per agent. Reference BVAAU 7-agent config (adapted, NOT copied — SOLUTION_ERP 2-FE-app fit + 6 skill proven battle-test 38 session). Prior: S20t12 initial 3 + S21t1 +cicd-monitor. @@ -9,7 +9,7 @@ > **Upgrade 2026-06-10 (Harness-4 two-tier model — AI_INFRA broadcast `harness-4-model-tier-promotion` + `model-fable-5-max`):** lead = **Fable 5 (1M) Max** (user-level machine-wide, SE không project-pin) · sub two-tier theo tiêu chí H4.3 (a gate≥writer · b verdict-nuôi-quyết-định · c chống-rubber-stamp · d 1M-thật): **promote 4 giữ `inherit`** (reviewer·investigator-codebase·database-agent·harvest-curator) + **demote 7 pin `claude-opus-4-8`** (full-id no-suffix — gotcha #37 cấm `[1m]`; runtime resolve `[1m]` 1M trên máy chung per AI_INFRA s20). `hmw.js` tier-map H4.5 (role-less → `'opus'` · per-task `tier:'fable'|'opus'` override). Email-back AI_INFRA H4.7 BẮT BUỘC. Justification per-vị-trí: adap-report `2026-06-10-Governance-harness-4-model-tier-promotion.md`. > **Upgrade S63 (2026-06-15 — Harness-5 + 6 adopt):** **H5 model-fallback** — ⚠️ Fable 5/Mythos 5 **suspended 2026-06-12 no-ETA** → lead SE tạm **Opus 4.8 (1M) Max** (promote `inherit` tự theo → two-tier collapse single-tier Opus; demote-pin giữ; **revert-FREE** khi Fable về: đổi lead lại + spawn-test). KHÔNG sửa frontmatter · external-outage blameless KHÔNG RCA · session-start BƯỚC 0.6 check. **H6 governed-ultracode** — mode-ON: substantive task TỰ chạy HMW (KHÔNG đợi keyword "workflow"); workflow-agent default = **inherit lead** (`hmw.js` role-less `'opus'`→inherit) · role-fidelity (agentType ∈ VALID_ROLES) + memory-fidelity (memoryDelta→đúng agent-memory single-writer) ĐÃ sẵn từ HMW-engine. adap-report `2026-06-13-Governance-harness-5-...` + `2026-06-15-Agent-harness-6-...`. > **Upgrade S64 (2026-06-15 — Harness-7 writing-quality adopt):** sàn chất lượng viết **hướng ra ngoài** (email · broadcast · adap-report · tài-liệu-sister · **câu trả lời lead cho anh**) phải tiếng Việt rõ nghĩa, câu hoàn chỉnh, đủ dấu câu, đúng ngữ pháp (O1); nội bộ giữ lối nén §6.4/§6.5 (O2 — bất đối xứng); reviewer +**Category 6** writing-quality (O3, verified-pending-restart). Rule canonical `docs/rules.md §1.1`. adap-report `2026-06-15-Governance-harness-7-writing-quality.md`. body-hash `a4580ea9…` verified-MATCH (lesson gotcha #61: verify body-hash PHẢI đọc UTF-8 tường minh, PS5.1 default mis-decode tiếng Việt → false-mismatch). -> **Upgrade S66 (2026-06-16 — Harness-8 all-inherit + workflow-fastest adopt):** 🔴 BẮT BUỘC (anh-chốt, mọi sister; chất lượng trên chi phí). **H8.1** — toàn bộ 11 sub-agent có memory → `model: inherit` (ăn top-tier lead), **GỠ cơ chế demote two-tier của Harness-4** (7 sub pin `claude-opus-4-8` đã flip `inherit`: 2 implementer · test-specialist · cicd-monitor · investigator-api · frontend-designer · tooling-auditor; 4 đã-inherit giữ nguyên reviewer·investigator-codebase·database-agent·harvest-curator). SE KHÔNG có helper/gopher rẻ để chừa → cả 11 lên inherit. Escape-hatch per-task `tier:'opus'` (hmw.js) GIỮ cho sweep/cost. **H8.2** — chạy workflow nhanh nhất: **song song tối đa + xuất nhanh + lead auto-HMW** cho task substantive (theo H6) — "nhanh" = parallelism, **KHÔNG phải hạ model**. **Caveat (trung thực):** runtime HIỆN KHÔNG đổi (inherit = Opus 4.8 1M vì Fable suspended H5 — trùng two-tier đã collapse); khác biệt thật khi Fable về (cả đội tự lên Fable 5 không sửa frontmatter) + H5.6 restore gọn hơn (chỉ đổi lead). Frontmatter no hot-reload → **executed-file, VERIFIED-pending-restart**. `[1m]` cấm trong frontmatter `model` (gotcha #37). adap-report `2026-06-16-Governance-harness-8-all-inherit-workflow-fastest.md`. +> **Upgrade S66 (2026-06-16 — Harness-8 all-inherit + workflow-fastest adopt):** 🔴 BẮT BUỘC (anh-chốt, mọi sister; chất lượng trên chi phí). **H8.1** — toàn bộ 11 sub-agent có memory → `model: inherit` (ăn top-tier lead), **GỠ cơ chế demote two-tier của Harness-4** (7 sub pin `claude-opus-4-8` đã flip `inherit`: 2 implementer · test-specialist · cicd-monitor · investigator-api · frontend-designer · tooling-auditor; 4 đã-inherit giữ nguyên reviewer·investigator-codebase·database-agent·harvest-curator). SE KHÔNG có helper/gopher rẻ để chừa → cả 11 lên inherit. Escape-hatch per-task `tier:'opus'` (hmw.js) GIỮ cho sweep/cost. **H8.2** — chạy workflow nhanh nhất: **song song tối đa + xuất nhanh + lead auto-HMW** cho task substantive (theo H6) — "nhanh" = parallelism, **KHÔNG phải hạ model**. **Caveat (trung thực):** runtime HIỆN KHÔNG đổi (inherit = Opus 4.8 1M vì Fable suspended H5 — trùng two-tier đã collapse); khác biệt thật khi Fable về (cả đội tự lên Fable 5 không sửa frontmatter) + H5.6 restore gọn hơn (chỉ đổi lead). Frontmatter no hot-reload → **executed-file → runtime-verified S98** (2026-07-02 Fable-restore: inherit-chain spawn-test ×2 self-report `claude-fable-5` — "cả đội tự lên Fable, 0 sửa frontmatter" xảy ra đúng thiết kế). `[1m]` cấm trong frontmatter `model` (gotcha #37). adap-report `2026-06-16-Governance-harness-8-all-inherit-workflow-fastest.md`. > **Upgrade S70 (2026-06-17 — Harness-9 L2-recovery + adap 2-workflow adopt):** **(1) PROCESS-mandate 🔴 BẮT BUỘC (PART 2/3, áp MỌI adap từ nay):** mỗi adap 1 Harness = **2 workflow tách biệt** (IMPLEMENT + REVIEW double-check RIÊNG) + REPORT về AI_INFRA kèm **run-id** bằng chứng; task ngắn-nhưng-cần-confirm VẪN phải review-workflow. Codify `.claude/commands/adap-apply.md`. **(2) L2 dark-matter recovery (PART 1, tailored):** archive `agent-memory//archive/*.md` KHÔNG vào RAG → build `archive/_INDEX.md` (mục-lục 1-dòng/bản-ghi + con-trỏ **substring** sha-keyed, fallback Ctrl-F, KHÔNG line-hint) + `.gist.md` (nén 4-field ADDITIVE, `distill-gen` counter, verbatim FROZEN) + `memory-budget.json` (seed-by-measure qua `scripts/measure-agent-memory.ps1`) + budget-audit @session-start (§2.1.2) + `.ragignore` guard. Rollout S70 (đầy-đủ-nhất, stage investigate→implement→audit qua 3 Workflow run-id): 4 over-cap sub (cicd-monitor · investigator-codebase · reviewer · implementer-backend). adap-report `2026-06-17-Governance-harness-9-l2-recovery-and-adap-workflow.md`. > **Upgrade S72 (2026-06-18 — Harness-10 flat-refine + checklist-v2 adopt):** run-trace SUBFOLDER→**FLAT** (file phẳng cùng cấp: `sub--.md` raw + `-synthesis.md` verified, KHÔNG `sub-md/`/`harvest/` subdir) — `hmw.js` (`:103` subMd path) + `workflows/README` + `runs/README` + session-start/end + decision-tree (dòng dưới) repoint. **C8 migration:** 5 run cũ S71 GIỮ subfolder (đừng rewrite history); close-gate dual-accept cả hai dạng. **+`/sleep-recovery-memory-l2`** (đóng A8 — port §J2-tailored SE-only: sleep-compress L2 gist additive, INFORM-only ≥7d). **Anti-bypass detector (refine b): TAILORED-OUT** — SE dùng Anthropic Workflow tool (no CLI-launcher bypass-surface), containment = git-diff + run-folder TRACKED + ledger orphan-scan (G-015). 3 run-id bằng-chứng: audit `wf_13868efb-ea7` · implement `wf_ac43b5ff-7d1` · review (pending). adap-report `2026-06-18-Governance-harness-10-flat-refine-checklist-v2.md` (pending). > **Upgrade S75 (2026-06-18 — Harness-11 engine bộ-nhớ-và-governance TỰ-BẢO-TRÌ adopt):** engine tự-DÒ toàn-diện (luôn tươi báo cờ) + AUTO chỉ semantic-null git-diff + **single-writer bar-KHÔNG-hạ (D9)** + đổi-luật owner-approve (D7). 🔑 Canonical → [`docs/governance/harness-11-engine.md`](../../docs/governance/harness-11-engine.md) (**KHÔNG copy luật ở đây — B1 dogfood**). Artifact MỚI: `scripts/governance-detectors.ps1` (C1 broken-pointer + C2/B3 staleness + C3 vocab-fork + C4 self-exclusion, NO-API DÒ+FLAG-only, **runtime-proven** bắt drift root CLAUDE.md mig53→55 + 0 self-match; số flag động → run-trace) + `scripts/memory-archive-gate.ps1` (PHẦN A hysteresis 0.85/keep-floor 5/2-strike/A7 NO-API L1-eval) + budget.json `archive_gate`. 3-tier D5(AUTO)/D6(DÒ+FLAG)/D7(owner-approve) + one-direction-lock D8 (canonical→derived) codify ở engine-doc. Cadence wired: D1 session-start §2.1.3 (chạy detector) · D2 session-end §L.b(c) (archive-gate). Áp qua workflow: audit `wf_7fdc3bd5-930` + implement `wf_c5e5844e-7c1` + review `wf_d7ca1ff8-942` + double-check `wf_a0b68d2f-30e`. adap-report `docs/governance/adap-reports/2026-06-18-Governance-harness-11.md`. diff --git a/.claude/commands/session-start.md b/.claude/commands/session-start.md index 3b0609d..f2d51eb 100644 --- a/.claude/commands/session-start.md +++ b/.claude/commands/session-start.md @@ -26,7 +26,7 @@ Em main đọc `.claude/hmw-mode.on` → **BÁO ngay đầu response** (anh kh ## 📋 BƯỚC 0.6 — Model-availability check (H5 — adopt S63) -Em main xác nhận **lead model resolve được** đầu session. Lead SE = **Fable 5 (1M) Max** (per H4). **DOWN** = lỗi `"Model isn't available — claude-fable-5[1m]"` → fallback **`/model claude-opus-4-8[1m]`** (Opus 4.8 · 1M · Max — top-tier, KHÔNG hạ §A1; **KHÔNG sửa frontmatter agent** — promote `inherit` tự theo lead → two-tier tạm collapse single-tier Opus, **revert-FREE** khi Fable về). Phản xạ THỦ-CÔNG (không hook tự-switch). ⚠️ **Fable/Mythos suspended 2026-06-12 no-ETA** → SE đang fallback Opus (em chạy `claude-opus-4-8[1m]` từ S62). Restore (H5.6): Fable về → đổi lead lại + spawn-test confirm self-report `claude-fable-5[1m]` + gỡ caveat. +Em main xác nhận **lead model resolve được** đầu session. Lead SE = **Fable 5 (1M) Max** (per H4). **DOWN** = lỗi `"Model isn't available — claude-fable-5[1m]"` → fallback **`/model claude-opus-4-8[1m]`** (Opus 4.8 · 1M · Max — top-tier, KHÔNG hạ §A1; **KHÔNG sửa frontmatter agent** — promote `inherit` tự theo lead → two-tier tạm collapse single-tier Opus, **revert-FREE** khi Fable về). Phản xạ THỦ-CÔNG (không hook tự-switch). ✅ **Fable RESTORED 2026-07-02 (S98)** — lead chạy `claude-fable-5[1m]` (settings.json:11) + spawn-test inherit ×2 monitor self-report `claude-fable-5` → H5.6 hoàn tất, caveat suspended-2026-06-12 (fallback Opus S62→S97) đã gỡ. Nếu DOWN lại → fallback theo quy trình trên. ## Phase 1 — READ (load context) diff --git a/.claude/skills/README.md b/.claude/skills/README.md index 75236dc..1f4f1c2 100644 --- a/.claude/skills/README.md +++ b/.claude/skills/README.md @@ -17,7 +17,7 @@ Skill này là tài liệu chuyên biệt để Claude (và developer khác) dù | Skill | Mục đích | Trigger ví dụ | Trạng thái | |---|---|---|---| | `dependency-audit-erp` | Scan CVE NuGet + npm 2 FE, respect pin constraint (MediatR 12.4.1, Swashbuckle 6.9.0) | "npm audit", "dotnet vulnerable", "deps scan", "nâng cấp package" | ✅ New Tier 3 | -| `ef-core-migration` | Tạo/revert EF Core 10 migration, 3-file rule, DesignTimeDbContextFactory, migration history (mới nhất Mig 59; số → `docs/STATUS.md`) | "thêm migration", "EF migration", "schema update", "snapshot lỗi" | ✅ Updated S87 (Mig 59 PE CcmBudgetPeriod; số → `docs/STATUS.md`) | +| `ef-core-migration` | Tạo/revert EF Core 10 migration, 3-file rule, DesignTimeDbContextFactory, migration history (mới nhất Mig 61; số → `docs/STATUS.md`) | "thêm migration", "EF migration", "schema update", "snapshot lỗi" | ✅ Updated S98 (Mig 60/61 PE EndedByLevelFinalize + backfill-fix; số → `docs/STATUS.md`) | | `iis-deploy-runbook` | 3 IIS site + win-acme cert + gitea-runner + LibreOffice + debug 500/502/SignalR prod + **G-084 IPv4/IPv6 hardening** | "prod 500", "IIS fail", "cert hết hạn", "restart app pool", "deploy IIS", "port hijack" | ✅ Updated (G-084) | ## Format chuẩn 1 skill @@ -87,5 +87,5 @@ when-to-use: ## Related - `docs/CLAUDE.md` — quick rules + full stack context -- `docs/gotchas.md` — bẫy đã gặp (số hiện tại → `docs/STATUS.md`; latest #76 `deploy.yml` render `appsettings.Production.json` từ `.example` mỗi deploy → prod thiếu config gitignored, S91; #75 seed demo UNGATED per-code → RE-ADD data đã wipe mỗi restart (wipe KHÔNG bền), S91; #74 MCP `save_to_disk` KHÔNG tạo file truy-cập được → chụp prod bằng PowerShell `CopyFromScreen`, S90; #73 UPDATE-handler absolute-set → CLEAR field khi FE KHÔNG gửi (bug-class S42), S85; #72 DateTime serialize thiếu 'Z' → FE hiểu local lệch +7h, S85) +- `docs/gotchas.md` — bẫy đã gặp (số hiện tại → `docs/STATUS.md`; latest #79 backfill soi NHẦM bảng — PE transition-marker ở `Changelogs.ContextNote` KHÔNG phải `Approvals`, verify marker-count prod trước, S97; #78 display-flag suy CONFIG thay RUNTIME → nói dối khi instance lệch config, fix field `EndedByLevelFinalize`, S97; #77 SPA bundle cache-lag → verify deploy BYTE-LEVEL (curl+grep bundle), incognito = golden-test, S96; #76 `deploy.yml` render `appsettings.Production.json` từ `.example` mỗi deploy → prod thiếu config gitignored, S91; #75 seed demo UNGATED per-code → RE-ADD data đã wipe mỗi restart (wipe KHÔNG bền), S91) - `docs/changelog/migration-todos.md` — roadmap 5 phase + Tier 3 diff --git a/.claude/skills/ef-core-migration/SKILL.md b/.claude/skills/ef-core-migration/SKILL.md index f47a4f2..d1f437b 100644 --- a/.claude/skills/ef-core-migration/SKILL.md +++ b/.claude/skills/ef-core-migration/SKILL.md @@ -1,6 +1,6 @@ --- name: ef-core-migration -description: Tạo/sửa/revert EF Core 10 migration cho SOLUTION_ERP. Dùng khi thêm entity mới, thay đổi schema, rollback migration, debug DesignTimeDbContextFactory fail. Đã có nhiều migration (số hiện tại → docs/STATUS.md canonical; mới nhất Mig 59 AddCcmBudgetPeriodToPurchaseEvaluation, S87). Snapshot + Designer + Migration 3-file rule bắt buộc commit đủ. +description: Tạo/sửa/revert EF Core 10 migration cho SOLUTION_ERP. Dùng khi thêm entity mới, thay đổi schema, rollback migration, debug DesignTimeDbContextFactory fail. Đã có nhiều migration (số hiện tại → docs/STATUS.md canonical; mới nhất Mig 61 BackfillEndedByLevelFinalizeFromChangelog, S97). Snapshot + Designer + Migration 3-file rule bắt buộc commit đủ. when-to-use: - "thêm migration" - "EF Core migration" @@ -16,7 +16,7 @@ when-to-use: > **Context:** .NET 10 + EF Core 10 + SQL Server. DbContext: `ApplicationDbContext` ở `Infrastructure/Persistence/`. Startup: `SolutionErp.Api`. -## Migration history (số hiện tại → `docs/STATUS.md` canonical; mới nhất Mig 59) +## Migration history (số hiện tại → `docs/STATUS.md` canonical; mới nhất Mig 61) | # | Name | Tables added / changed | |---|---|---| @@ -79,8 +79,10 @@ when-to-use: | **57** | **`AddPeSuggestedPriceNotes`** | **🎯 S77 — PurchaseEvaluations +`ProSuggestedPriceNote`+`CcmSuggestedPriceNote` nvarchar(1000)? (ghi chú kèm giá đề xuất PRO/CCM, mirror ProNote/CcmNote). 2 AddColumn additive-nullable, no new table.** | | **58** | **`AddPeMultiWinnerAndLevelFinalize`** | **🎯 S87 — PE multi-winner + per-Level finalize: PurchaseEvaluationSuppliers +`IsWinner bit` (nhiều NCC trúng thầu, thay winner đơn lẻ `SelectedSupplierId`) + ApprovalWorkflowLevels +`AllowApproverFinalize bit` (per-Cấp kết-thúc-tại-đây, không lên CEO) + `Sql()` backfill `IsWinner=1 WHERE SupplierId = pe.SelectedSupplierId` (phiếu UAT giữ winner cũ, idempotent). 2 AddColumn, no new table.** | | **59** | **`AddCcmBudgetPeriodToPurchaseEvaluation`** | **🎯 S87 — PurchaseEvaluations +`CcmBudgetPeriodAmount` decimal(18,2)? (ngân sách CCM cột Section-B kỳ này, per-PE, mirror `BudgetPeriodAmount` phía PRO). 1 AddColumn additive-nullable, no new table.** | +| **60** | **`AddPeEndedByLevelFinalize`** | **🎯 S97 — 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 trong service); display `EndsBeforeCeo` cho phiếu DaDuyet đọc RUNTIME thay suy-CONFIG (gotcha #78 — phiếu opt-out lên CEO hết báo sai "không qua CEO"). Kèm `Sql()` backfill marker ⚠️ soi NHẦM bảng `Approvals` → match 0 (xem Mig 61). 1 AddColumn, no new table.** | +| **61** | **`BackfillEndedByLevelFinalizeFromChangelog`** | **🎯 S97 — DATA-ONLY no-schema (đính chính Mig 60): backfill query ĐÚNG bảng `PurchaseEvaluationChangelogs.ContextNote LIKE N'%Duyệt KẾT THÚC tại%'` + PhaseAtChange=7. PE 2 bảng lịch-sử TÁCH VAI: `Approvals` = per-approver record vs `Changelogs.ContextNote` = transition+marker (`LogTransitionAsync`). Idempotent, SQL-Server-only, prod-verified A/005/A/008 flag 0→1 + A/010 control unchanged (gotcha #79 — xác định đúng bảng-writer + verify marker-count prod TRƯỚC khi tin backfill; backfill=0-rows = cờ đỏ).** | -Total: **88 bảng** dbo + `__EFMigrationsHistory` (re-ground S62 cicd `sys.tables`; last schema-changing Mig 50 net 93→88 — Mig 51-55 đều AddColumn-only, không đổi số bảng). Xem `docs/database/schema-diagram.md` migration table + §11-15 module ERD (§16+ Mig 27-55 chi tiết pending). +Total: **89 bảng** `sys.tables` (= 88 dbo-app + `__EFMigrationsHistory`; re-ground S97 cicd Run #482 LIVE — số canonical → `docs/STATUS.md`; last schema-changing Mig 50 net 93→88-app, Mig 51-61 đều AddColumn/index/data-only không đổi số bảng). Xem `docs/database/schema-diagram.md` migration table + §11-15 module ERD (§16+ Mig 27-61 chi tiết pending). ## N-stage workflow pattern (Mig 18-20 — Session 12-13) @@ -288,7 +290,7 @@ sqlcmd -S .\SQLEXPRESS -d SolutionErp -U vrapp -P -i migrate.sql ## Code pointers -- `src/Backend/SolutionErp.Infrastructure/Persistence/ApplicationDbContext.cs` — DbSet cho 88 bảng (số migration → `docs/STATUS.md`) +- `src/Backend/SolutionErp.Infrastructure/Persistence/ApplicationDbContext.cs` — DbSet toàn bộ bảng app (số bảng/migration → `docs/STATUS.md`) - `src/Backend/SolutionErp.Infrastructure/Persistence/DesignTimeDbContextFactory.cs` — EF tooling factory - `src/Backend/SolutionErp.Infrastructure/Persistence/DbInitializer.cs` — seed + warn + migrate runtime + backfill (idempotent reconcile pattern) - `src/Backend/SolutionErp.Infrastructure/Persistence/Configurations/` — IEntityTypeConfiguration per entity @@ -297,5 +299,5 @@ sqlcmd -S .\SQLEXPRESS -d SolutionErp -U vrapp -P -i migrate.sql ## Related - `docs/database/database-guide.md` — conventions + migration workflow chi tiết -- `docs/database/schema-diagram.md` — **ERD 88 bảng** + §11 PE + §12 ~~Budget~~ (REMOVED Mig 50) + §13 PEDeptOpinions (Mig 15) + §14 ApprovalWorkflow V2 (Mig 22-25) + §15 PE Level Opinions V2 (Mig 26); §16+ Mig 27-55 detail pending (xem migration table) +- `docs/database/schema-diagram.md` — **ERD** (số bảng → `docs/STATUS.md`) + §11 PE + §12 ~~Budget~~ (REMOVED Mig 50) + §13 PEDeptOpinions (Mig 15) + §14 ApprovalWorkflow V2 (Mig 22-25) + §15 PE Level Opinions V2 (Mig 26); §16+ Mig 27-61 detail pending (xem migration table) - `docs/gotchas.md` #7, #17, #38 — migration pitfalls + Identity 4-field rename diff --git a/.claude/workflows/runs/_ledger.md b/.claude/workflows/runs/_ledger.md index 0ef5f39..abe36d6 100644 --- a/.claude/workflows/runs/_ledger.md +++ b/.claude/workflows/runs/_ledger.md @@ -4,6 +4,7 @@ > **Tracked (C3):** thư mục `runs//` được git theo dõi (KHÔNG gitignore). Containment chuyển sang model **"tracked-change NGOÀI run-folder (+ code-disjoint đã giao) = vi phạm"** (thay model Harness-2 B6 "mọi tracked-change = vi phạm"). > Cột `closed=⏳` = đang chạy (OPEN-beat). Điền timestamp + verdict khi đóng (CLOSE-beat). > 🆕 **FLAT (C1/C8, h10-refine 06-18):** run MỚI = file phẳng cùng cấp (`run.md` + `sub--.md` + `-synthesis.md`, KHÔNG subfolder). **5 run cũ (`h10-invest`…`h910-curate`) GIỮ `sub-md/`+`harvest/`** — đừng rewrite history; close-gate **dual-accept** cả hai dạng. +> 🆕 **Mode-A ephemeral (S98 note, 2026-07-02):** HMW run **return-delta-only** (MODE A default — `hmw.js` KHÔNG `args.run`) **KHÔNG tạo run-folder/ledger-row = by-design**; ledger này CHỈ cover MODE B run-trace (`args.run`, workflow DÀI). Ví dụ hợp lệ: S97 `wf_0e01fdba-209` + `wf_4951c347-247` (harvest per-turn thẳng vào agent-memory, KHÔNG phải orphan). H2 orphan-scan: vắng ledger-row cho wf-id mode-A ≠ lỗi. | run-id | workflow | opened | closed | agents | verdict | harvest | |---|---|---|---|---|---|---| diff --git a/CLAUDE.md b/CLAUDE.md index 058344f..ff4b9e9 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -50,14 +50,14 @@ Kiến trúc: **.NET 10 Clean Architecture + 2 React FE (admin + user) + SQL Ser - Audit fields: `CreatedAt`, `UpdatedAt`, `CreatedBy`, `UpdatedBy` (`BaseEntity`) - Soft delete: `IsDeleted`, `DeletedAt`, `DeletedBy` (`AuditableEntity`) - Migrations: `dotnet ef migrations add --project src/Backend/SolutionErp.Infrastructure --startup-project src/Backend/SolutionErp.Api` -- **Số migration · bảng hiện tại → [`docs/STATUS.md`](docs/STATUS.md) (canonical — KHÔNG copy số ở đây để tránh drift; Harness-11 B1).** Lịch sử mig gần đây: +S74 Mig 55 `AddCcmNoteToPeWorkItemBudget` (PE CcmNote) · +S73 Mig 54 `AddPeSuggestedAndApprovedPrice` (PE giá đề xuất PRO/CCM). +S69: Mig 53 `AddPeUrgentAndCeoApprovalThreshold` — PE +IsUrgentByPro/Ccm cờ gấp PRO/CCM + ApprovalWorkflow +CeoApprovalThreshold ngưỡng CCM duyệt-final, 3 AddColumn no new table. +S65: Mig 51 `AddDepartmentParentId` Department.ParentId loose-Guid no-FK org-tree phân cấp + Mig 52 `AddHoSoLinkToPurchaseEvaluation` PE HoSoLink nvarchar(1000) hyperlink NAS — cả 2 AddColumn no new table, tables giữ 88. Phase 10 COMPLETE + Phase 11 P11-A→F done — Mig 34-42 HRM/Office/WorkflowApps/Attendance + Contract V2 (32-33) + WireWorkflowApps V2 (41) + LeaveBalance (42) + Holiday filtered-unique (43, S45) + Vehicle/Driver catalog (44, S51) + HRM-catalog filtered-unique 3× (45, S51) + ItTicket SLA (46, S52) + Master filtered-unique 3× (47, S53 gotcha #57 EXT) + Project master fields Year/Investor/Location/Package (48, S55 — AddColumn no new table, kèm nạp 62 dự án + 71 hạng mục + 3 NCC real data từ Excel qua `SeedRealMasterDataAsync` ungated idempotent) + PE gắn Hạng mục công việc WorkItemId loose-Guid KHÔNG FK vật lý (49, S57bis — AddColumn+CreateIndex, no new table) + **Mig 50 `ReplaceBudgetModuleWithPeWorkItemBudgets` (S61, 2026-06-13) — XÓA module Budget cũ, thay bằng `PeWorkItemBudgets` ngân sách per-gói-thầu (1 record/cặp Dự án × Hạng mục, nhập theo role PRO/CCM, vượt ngân sách = cảnh báo mềm cho lưu S62); backfill `BudgetManualAmount→BudgetPeriodAmount` TRƯỚC DropColumn (phiếu UAT giữ số); net bảng 93→88; gotcha #63/#64**. V2 schema history S29-era bên dưới giữ nguyên — Mig 32+33 Plan B Contract V2 cookie-cutter mirror PE Mig 22-26 (S29). Mig 26 `AddPeLevelOpinionsForV2`: bảng mới `PurchaseEvaluationLevelOpinions` UNIQUE composite (PEId, LevelId), FK Cascade Pe + Restrict Level. Section 5 "Ý kiến cấp duyệt" V2 dynamic theo workflow đã pin: forEach Step (Phòng) → forEach Level (Cấp) → forEach NV → 1 OpinionBox. Service `ApproveV2Async` UPSERT auto khi NV duyệt — Q1=1B (sync gắn với Duyệt, KHÔNG form input rời). SignedByUserId track signer thật, FE banner "Admin duyệt thay" khi !== ApproverUserId. Comment empty → "(duyệt — không ý kiến)" placeholder. Phiếu V1 legacy fallback Mig 15 4 box readOnly (data history). Mig 25 `AddIsUserSelectableToApprovalWorkflows`: ALTER `ApprovalWorkflows` +`IsUserSelectable bit` (admin pin/unpin workflow nào cho user pick lúc create phiếu, multi-select độc lập IsActive). Backfill `WHERE IsActive=1 SET 1` giữ behavior cũ. Designer +badge "Cho user chọn" + button Ghim/Bỏ ghim. Workspace filter dropdown chỉ workflows `IsUserSelectable=true`. Mig 22-24 V2 schema (Session 17): `ApprovalWorkflows`/Steps/Levels — Quy trình > Bước (Phòng) > Cấp (N NV cụ thể qua ApproverUserId, OR-of-N cùng cấp). PE.ApprovalWorkflowId pin V2. PE.CurrentApprovalLevelOrder track. State machine 5 trạng thái: Nháp / Đã gửi duyệt / Trả lại (Phase riêng TraLai=98) / Từ chối / Đã duyệt. PE Service V2 wire match `actor.Id == ApproverUserId`. Contract V2 ĐÃ WIRE (Mig 32+33 Plan B S29 — cookie-cutter mirror PE V2: `ApproveV2Async` + `ContractLevelOpinions` UPSERT + Workspace V2 Select dropdown). Mig 21 V1 flat workflow vẫn live cho phiếu cũ.) +- **Số migration · bảng hiện tại → [`docs/STATUS.md`](docs/STATUS.md) (canonical — KHÔNG copy số ở đây để tránh drift; Harness-11 B1).** Lịch sử mig gần đây: **+S97 Mig 60 `AddPeEndedByLevelFinalize` + Mig 61 `BackfillEndedByLevelFinalizeFromChangelog`** (PE cờ RUNTIME finalize-sớm — display đọc runtime thay suy-config; backfill Mig 60 soi nhầm bảng Approvals → Mig 61 đúng Changelogs; gotcha #78/#79) · +S74 Mig 55 `AddCcmNoteToPeWorkItemBudget` (PE CcmNote) · +S73 Mig 54 `AddPeSuggestedAndApprovedPrice` (PE giá đề xuất PRO/CCM). +S69: Mig 53 `AddPeUrgentAndCeoApprovalThreshold` — PE +IsUrgentByPro/Ccm cờ gấp PRO/CCM + ApprovalWorkflow +CeoApprovalThreshold ngưỡng CCM duyệt-final, 3 AddColumn no new table. +S65: Mig 51 `AddDepartmentParentId` Department.ParentId loose-Guid no-FK org-tree phân cấp + Mig 52 `AddHoSoLinkToPurchaseEvaluation` PE HoSoLink nvarchar(1000) hyperlink NAS — cả 2 AddColumn no new table, tables giữ 88. Phase 10 COMPLETE + Phase 11 P11-A→F done — Mig 34-42 HRM/Office/WorkflowApps/Attendance + Contract V2 (32-33) + WireWorkflowApps V2 (41) + LeaveBalance (42) + Holiday filtered-unique (43, S45) + Vehicle/Driver catalog (44, S51) + HRM-catalog filtered-unique 3× (45, S51) + ItTicket SLA (46, S52) + Master filtered-unique 3× (47, S53 gotcha #57 EXT) + Project master fields Year/Investor/Location/Package (48, S55 — AddColumn no new table, kèm nạp 62 dự án + 71 hạng mục + 3 NCC real data từ Excel qua `SeedRealMasterDataAsync` ungated idempotent) + PE gắn Hạng mục công việc WorkItemId loose-Guid KHÔNG FK vật lý (49, S57bis — AddColumn+CreateIndex, no new table) + **Mig 50 `ReplaceBudgetModuleWithPeWorkItemBudgets` (S61, 2026-06-13) — XÓA module Budget cũ, thay bằng `PeWorkItemBudgets` ngân sách per-gói-thầu (1 record/cặp Dự án × Hạng mục, nhập theo role PRO/CCM, vượt ngân sách = cảnh báo mềm cho lưu S62); backfill `BudgetManualAmount→BudgetPeriodAmount` TRƯỚC DropColumn (phiếu UAT giữ số); net bảng 93→88; gotcha #63/#64**. V2 schema history S29-era bên dưới giữ nguyên — Mig 32+33 Plan B Contract V2 cookie-cutter mirror PE Mig 22-26 (S29). Mig 26 `AddPeLevelOpinionsForV2`: bảng mới `PurchaseEvaluationLevelOpinions` UNIQUE composite (PEId, LevelId), FK Cascade Pe + Restrict Level. Section 5 "Ý kiến cấp duyệt" V2 dynamic theo workflow đã pin: forEach Step (Phòng) → forEach Level (Cấp) → forEach NV → 1 OpinionBox. Service `ApproveV2Async` UPSERT auto khi NV duyệt — Q1=1B (sync gắn với Duyệt, KHÔNG form input rời). SignedByUserId track signer thật, FE banner "Admin duyệt thay" khi !== ApproverUserId. Comment empty → "(duyệt — không ý kiến)" placeholder. Phiếu V1 legacy fallback Mig 15 4 box readOnly (data history). Mig 25 `AddIsUserSelectableToApprovalWorkflows`: ALTER `ApprovalWorkflows` +`IsUserSelectable bit` (admin pin/unpin workflow nào cho user pick lúc create phiếu, multi-select độc lập IsActive). Backfill `WHERE IsActive=1 SET 1` giữ behavior cũ. Designer +badge "Cho user chọn" + button Ghim/Bỏ ghim. Workspace filter dropdown chỉ workflows `IsUserSelectable=true`. Mig 22-24 V2 schema (Session 17): `ApprovalWorkflows`/Steps/Levels — Quy trình > Bước (Phòng) > Cấp (N NV cụ thể qua ApproverUserId, OR-of-N cùng cấp). PE.ApprovalWorkflowId pin V2. PE.CurrentApprovalLevelOrder track. State machine 5 trạng thái: Nháp / Đã gửi duyệt / Trả lại (Phase riêng TraLai=98) / Từ chối / Đã duyệt. PE Service V2 wire match `actor.Id == ApproverUserId`. Contract V2 ĐÃ WIRE (Mig 32+33 Plan B S29 — cookie-cutter mirror PE V2: `ApproveV2Async` + `ContractLevelOpinions` UPSERT + Workspace V2 Select dropdown). Mig 21 V1 flat workflow vẫn live cho phiếu cũ.) ### Modules | Module | Namespace | Migration | Trạng thái | |---|---|---|---| | Contract (HĐ) | `Domain/Contracts/` | 1-11 | Feature-complete (7 ContractType × 9 phase) | -| PurchaseEvaluation (Duyệt NCC tiền-HĐ) | `Domain/PurchaseEvaluations/` | 12,13,15,49,50,52,53,54,55 | Feature-complete — +Hạng mục (Mig 49) +ngân sách per-gói-thầu role PRO/CCM (Mig 50) +Link hồ sơ NAS (Mig 52) +cờ gấp PRO/CCM + CCM duyệt-final theo ngưỡng (Mig 53) +**giá đề xuất PRO/CCM + CCM-note (Mig 54/55, S73/S74)**. Export PDF pending | +| PurchaseEvaluation (Duyệt NCC tiền-HĐ) | `Domain/PurchaseEvaluations/` | 12,13,15,49,50,52-61 | Feature-complete — +Hạng mục (Mig 49) +ngân sách per-gói-thầu role PRO/CCM (Mig 50) +Link hồ sơ NAS (Mig 52) +cờ gấp PRO/CCM + CCM duyệt-final theo ngưỡng (Mig 53) +giá đề xuất PRO/CCM + CCM-note (Mig 54/55) +PRO-split + ghi-chú-giá (Mig 56/57) +multi-winner + level-finalize + NS-kỳ-CCM (Mig 58/59) +**`EndedByLevelFinalize` runtime-flag + backfill-fix (Mig 60/61, S97 — gotcha #78/#79)**. Export PDF pending | | ~~Budget (Ngân sách dự án)~~ | — | 14 → **Mig 50 DROP** | ⚠️ **REMOVED S61** — module Budget cũ XÓA, thay bằng PE-budget-per-gói-thầu (`PeWorkItemBudgets`). FE pages/types/menu `Bg_*` gỡ hết | | Master (Supplier/Project/Department) | `Domain/Master/` | 2, 10 | Feature-complete | | Identity (User/Role/Permission/MenuItem) | `Domain/Identity/` | 1, 3, 11 | Feature-complete (30 demo user — 16 sample + 14 Solutions thật) | @@ -108,7 +108,7 @@ dotnet test SolutionErp.slnx # chạy cả 2 test project | `form-engine` — render docx/xlsx + PDF | `ef-core-migration` — EF migration + 3-file rule | | `permission-matrix` — role × menu × CRUD | `iis-deploy-runbook` — 3 site IIS + win-acme + runner | -**Audit định kỳ:** đầu mỗi tháng — combined skill + doc drift audit theo `docs/rules.md §6.4 + §9.4`. Cron `solution-erp-skill-audit-monthly` fire 9:00 ngày 1. Lần kế: **2026-07-01** (S44 đã chạy 06-01). +**Audit định kỳ:** đầu mỗi tháng — combined skill + doc drift audit theo `docs/rules.md §6.4 + §9.4`. Cron `solution-erp-skill-audit-monthly` fire 9:00 ngày 1. Lần kế: **2026-08-01** (S96 đã chạy 07-01). Quy tắc: - KHÔNG bulk-clone repo skill 3rd party. Chỉ thêm skill PROJECT-SPECIFIC. Xem `docs/rules.md §9` đầy đủ. @@ -128,7 +128,7 @@ Quy tắc: | [`docs/workflow-contract.md`](docs/workflow-contract.md) | State machine 9 phase HĐ + role matrix | | [`docs/forms-spec.md`](docs/forms-spec.md) | Catalog 8 form + quy định mã HĐ RG-001 | | [`docs/database/database-guide.md`](docs/database/database-guide.md) | DB conventions + migration workflow + cheatsheet | -| [`docs/database/schema-diagram.md`](docs/database/schema-diagram.md) | ⭐ ERD + luồng DB + data flow 88 table (+ §11 PE + §12 ~~Budget~~ DROP + §13 PEDeptOpinions + §14 Contract V2 LevelOpinions; §16+ Mig 32-55 pending) | +| [`docs/database/schema-diagram.md`](docs/database/schema-diagram.md) | ⭐ ERD + luồng DB + data flow (số bảng → [`docs/STATUS.md`](docs/STATUS.md)) (+ §11 PE + §12 ~~Budget~~ DROP + §13 PEDeptOpinions + §14 Contract V2 LevelOpinions; §16+ Mig 32-61 pending) | | [`docs/flows/README.md`](docs/flows/README.md) | Index 6 flow (auth, permission, contract, form, SLA) | | [`docs/gotchas.md`](docs/gotchas.md) | ⭐ Bẫy đã gặp (số hiện tại → [`docs/STATUS.md`](docs/STATUS.md)) — đọc trước khi debug tương tự | | [`.claude/skills/`](.claude/skills/README.md) | 6 skill: contract-workflow, form-engine, permission-matrix, dependency-audit-erp, ef-core-migration, iis-deploy-runbook | diff --git a/broadcasts/_index.md b/broadcasts/_index.md index 9cafc41..d58c73e 100644 --- a/broadcasts/_index.md +++ b/broadcasts/_index.md @@ -38,3 +38,4 @@ | 2026-06-29 | 2026-06-29-se-to-ai_infra-harness-16-mfe-report | se → ai_infra | outbox/ai_infra | da768330fadc | | 2026-07-01 | 2026-07-01-se-to-ai_infra-harness-17-adopt-report | se → ai_infra | outbox/ai_infra | 54789e1992c6 | | 2026-07-01 | 2026-07-01-se-to-ai_infra-harness-17-deep-reverify-update | se → ai_infra | outbox/ai_infra | 8c94fa348514 | +| 2026-07-02 | 2026-07-02-se-to-ai_infra-fable-restore-h56 | se → ai_infra | outbox/ai_infra | cf0aa0dcd055 | diff --git a/broadcasts/outbox/ai_infra/2026-07-02-se-to-ai_infra-fable-restore-h56.md b/broadcasts/outbox/ai_infra/2026-07-02-se-to-ai_infra-fable-restore-h56.md new file mode 100644 index 0000000..c8a9124 --- /dev/null +++ b/broadcasts/outbox/ai_infra/2026-07-02-se-to-ai_infra-fable-restore-h56.md @@ -0,0 +1,23 @@ +--- +id: 2026-07-02-se-to-ai_infra-fable-restore-h56 +from: se +to: ai_infra +category: Governance +type: report +date: 2026-07-02 +content_sha256: cf0aa0dcd05519ec2babae929aedaf16f17c7055132a3afea3f242a24ad47ba2 +nac: sent +--- + +# Fable 5 restore — SE lead + inherit-chain runtime-verified (H5.6 hoàn tất) + +**TL;DR:** Fable 5 đã hoạt động trở lại. SE xác nhận runtime tại S98 (2026-07-02): lead self-report `claude-fable-5` (settings user-global `model: "claude-fable-5[1m]"`) và spawn-test inherit-chain ×2 sub-agent (tooling-auditor + harvest-curator, cả hai `model: inherit`) đều self-report `claude-fable-5`. Giai đoạn fallback Opus 4.8 theo H5 (S62 → S97) kết thúc. SE đã gỡ caveat "Fable/Mythos suspended 2026-06-12" khỏi 3 chỗ current-state (`docs/STATUS.md` dòng Sub-agents · `.claude/agents/README.md` · `.claude/commands/session-start.md` BƯỚC 0.6); các bullet lịch sử giữ nguyên làm audit-trail. + +## Chi tiết + +- **H5.6 restore checklist:** (1) lead trở lại Fable ✓ (qua settings user-global, không cần thao tác thêm) · (2) spawn-test confirm self-report ✓ ×2 monitor · (3) gỡ caveat docs ✓. +- **H8 all-inherit trả cổ tức đúng thiết kế:** toàn bộ 11 sub `model: inherit` tự lên Fable 5 khi lead restore — **0 sửa frontmatter, 0 restart thêm** — đúng lời hứa "revert-FREE khi Fable về" lúc adopt H8 (S66). Nấc H8 flip executed-file → **runtime-verified S98 (2026-07-02)**. +- **Bằng chứng:** 2 monitor RE-REPORT đầu phiên S98 đều kết dòng `model=claude-fable-5`; env lead self-report `claude-fable-5`; settings.json user-global dòng model = `claude-fable-5[1m]`. +- **Phạm vi khiêm tốn (G-015):** SE chỉ chứng được lead + inherit-chain của chính SE; không suy ra trạng thái các sister khác. Nếu AI_INFRA có restore-notice chung thì SE đã compliant sẵn, không cần hành động thêm. + +— se (S98, 2026-07-02) diff --git a/docs/CLAUDE.md b/docs/CLAUDE.md index 9219118..80c4c03 100644 --- a/docs/CLAUDE.md +++ b/docs/CLAUDE.md @@ -67,7 +67,7 @@ SOLUTION_ERP/ │ ├── workflow-contract.md 9 phase HĐ + role matrix │ ├── database/ │ │ ├── database-guide.md conventions + migration workflow -│ │ └── schema-diagram.md ERD 88 bảng (+§11 PE +§12 ~~Budget~~ DROP +§13 PEDeptOpinions +§14 Contract V2 LevelOpinions; §16+ Mig 27-55 pending) +│ │ └── schema-diagram.md ERD (số bảng → docs/STATUS.md) (+§11 PE +§12 ~~Budget~~ DROP +§13 PEDeptOpinions +§14 Contract V2 LevelOpinions; §16+ Mig 27-61 pending) │ ├── flows/ 6 sequence diagram (auth/permission/contract/form/sla + PE ref architecture) │ ├── guides/ setup, cicd, deploy, runbook, security │ ├── changelog/ diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md index 7f67ccc..e6441f2 100644 --- a/docs/HANDOFF.md +++ b/docs/HANDOFF.md @@ -2,11 +2,11 @@ > **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). **(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)* +**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 `mEGqlNWc`/user `Dnrp4PU1` (Run #484 data-fix, #69-rebuild rotate — `CeTA7Z82`/`CGaAyXen` = #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`) · *(S93-S94 blurb đã tách → `docs/_archive/STATUS-HANDOFF-tier-S98-2026-07-02.md`, re-tier S98; session ≤S90 → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` + `docs/changelog/sessions/`, re-tier S94)* --- ## 📚 Session detail cũ (S84 → trở về trước) -> Brief 3 session gần nhất (S93/S92/S91) = mega-line trên. Chi-tiết per-session S84↓ đã tách (re-tier S94) → docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md + bản đầy-đủ ở docs/changelog/sessions/. +> Brief 3 session gần nhất (S97/S96/S95) = mega-line trên. Blurb S93-S94 → docs/_archive/STATUS-HANDOFF-tier-S98-2026-07-02.md (re-tier S98). Chi-tiết per-session S84↓ đã tách (re-tier S94) → docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md + bản đầy-đủ ở docs/changelog/sessions/. diff --git a/docs/STATUS.md b/docs/STATUS.md index a0bb6a0..4475169 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. **(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 `mEGqlNWc`/user `Dnrp4PU1` (Run #484 data-fix, #69-rebuild) · prod 21 NCC/17 user.** **REVIEW-before-session-end (anh yêu cầu, workflow `wf_4951c347` 4-lane):** prod-data-integrity CLEAN (flag-vs-marker 3 phiếu chuẩn 0-miss/0-over-reach, #78/#79 ăn prod) · prod-deploy CLEAN (11 commit deploy OK, Mig 61 applied, health 200) · code-review PASS (em-main grep 0 wrong-table khác) · feedback captured. **PROD AN TOÀN.** **🔴 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 `mEGqlNWc`/user `Dnrp4PU1` (Run #484 data-fix, #69-rebuild) · prod 21 NCC/17 user.** **REVIEW-before-session-end (anh yêu cầu, workflow `wf_4951c347` 4-lane):** prod-data-integrity CLEAN (flag-vs-marker 3 phiếu chuẩn 0-miss/0-over-reach, #78/#79 ăn prod) · prod-deploy CLEAN (11 commit deploy OK, Mig 61 applied, health 200) · code-review PASS (em-main grep 0 wrong-table khác) · feedback captured. **PROD AN TOÀN.** **🔴 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`) · *(S93-S94 blurb đã tách → `docs/_archive/STATUS-HANDOFF-tier-S98-2026-07-02.md`, re-tier S98; session ≤S90 → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` + `docs/changelog/sessions/`, re-tier S94)* --- @@ -21,7 +21,7 @@ | 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). | +| Sub-agents | **11** | **all-inherit top-tier (Harness-8 S66 06-16 — thay thế two-tier H4):** em main Fable 5 (1M) Max (✅ **Fable RESTORED S98 2026-07-02** — lead self-report `claude-fable-5` + settings `claude-fable-5[1m]`; fallback-Opus H5 S62→S97 kết thúc, H5.6 hoàn tất) · **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 = **runtime-verified S98 (2026-07-02)** — spawn-test inherit-chain ×2 monitor self-report `claude-fable-5` (cả đội tự lên Fable khi lead restore, 0 sửa frontmatter — đúng thiết kế all-inherit). 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 **`mEGqlNWc`** · user **`Dnrp4PU1`** (S97 — **Run #484** `fb2dfa9` Mig 61 data-fix backfill; bundle rebuild **#69-benign** [0 FE-src change, review-workflow cicd re-snapshot LIVE → `CeTA7Z82`/`CGaAyXen` #483 đã bị #484 rebuild rotate]; backfill A/005/A/008 flag 0→1 prod-verified). **Prev #483** — admin **`CeTA7Z82`** · user **`CGaAyXen`** (S97 — **Run #483** `9e12e80` badge "✅ Đã được CEO duyệt" phiếu đi-hết-lên-CEO [PeFinalizeChip single-source + 6 call-site 2-app, đối xứng chip "⚑ Kết thúc·X"]; FE-only tận-dụng endsBeforeCeo runtime, no BE/mig; JS rotate CSS-frozen #69; byte-#77 "Đã được CEO duyệt" PRESENT cả 2 app + prev-badge additive no-regression; Mig 60 frozen; smoke 200×3 + PE-list 200). **Prev #482** — admin **`DR9q2VUy`** · user **`Bgz8u4E5`** (S97 — **Run #482** `8037fa0` endsBeforeCeo config→RUNTIME [Mig 60 `EndedByLevelFinalize`]: **Mig 60 applied prod** (history-top + col-default-0 EXISTS + backfill=0 UAT-no-marker + sys.tables **89** pre==post); **EF-ternary SQL-Server LIVE-confirmed** GET /purchase-evaluations 200 items=9 + PE-detail `31faef0d` 200 **endsBeforeCeo=False phase=7** = runtime-path chạy = **bug fixed LIVE** (NOT 500); JS rotate 2-app PeWorkflowPanel gate-diff, CSS frozen #69-REFINE; byte-#77 `endsBeforeCeo` PRESENT in-bundle; smoke 200×3. reviewer PASS 0-issue + test 440. **Prev #481** — admin **`Cf0o8dx8`** · user **`x8rppRAK`** (S97 — **Run #481** `1c8fb6a` PE finalize 2-fix [badge "không trình tới"→"Kết thúc tại {cấp}" + đảo default checkbox opt-in]; JS rotate real-FE 2-app `PeWorkflowPanel` diff, CSS frozen `Bbtesa6B`/`BmuPz_Dy` #69-REFINE logic-only; **byte-level #77** NEW `Kết thúc tại`+helper PRESENT / OLD `không trình tới`+`Đã BỎ tick` ABSENT; real-size 1.64/1.54MB; Mig 59/88-table frozen; smoke 200×3. FE-only mirror SHA `bcf812fd`, 0 BE/mig/test). **Prev S96** — admin **`COYAX-yQ`** · user **`0MU-kb4N`** (S96 — **Run #480** `0c2f9f6` price-lock; chuỗi 3 PE deploy #478 `e657faa` checkbox-opt-out → #479 `36cbf8b` chuông-stale-clear (BE-only) → #480 `0c2f9f6` khóa-giá-sau-duyệt, cicd PASS each ~5m; **FE JS rotate THẬT** (PeWorkflowPanel #478 + PeDetailTabs #480, 2-app) real-size 1.64/1.54MB vs 919b SPA-trap, CSS frozen #69-REFINE; Mig 59 frozen 0-mig; +Run #477 `ba4b8e0` NCC seed no-mig prod 21 NCC. **Verify byte-level:** prod `0MU-kb4N` CHỨA checkbox-fix ("BỎ tick"/"Đã BỎ tick") + "✅-static" cũ MẤT → checkbox "ko-được" = browser-cache KHÔNG deploy-fail). **Prev S95** — admin **`0T6vVJST`** · user **`BGXEVZO6`** (S95 — **Run #476** `18a17f5` H17 governance-only deploy; bundle rotate benign #69 CSS-frozen, prod 200×3, Mig 59 unchanged; cicd re-snapshot LIVE — pre-deploy `CkZ1MjC1`/`_-gpX7_Y`, mega-line S93 `CDn40vpV`/`CoPmPBg7` đã bị deploy trung-gian rotate từ S94). **Prev S85** — admin **`aKuNip19`** · user **`BUsL0HeQ`** (S85 — **Run #341** `49ac086` lệch-giờ TZ serialize UTC-with-Z; FE frozen #339+#341 BE-only. Chuỗi ~10 deploy #334→#341 buổi UAT anh Kiệt CV PRO: #334 `5a61254` batch CV PRO 6-fix → #335-#338 6 vòng UAT → #339 `1263c0d` workflow-preserve bug-class S42 → #341 `49ac086` TZ; #342 `d4f6021` docs+cicd BE-frozen, bundle giữ-nguyên gotcha #69-REFINE). **Prev S78** — admin **`CsJetgZH`** · user **`BVS0ApIm`** (S78 — **Run #330** `7886fd0` PE attach-file khi duyệt; bundle ROTATE từ S77 `BqKD3Y23`/`Cn-i349D` dù NO migration enum-only — gotcha #69 non-determ rebuild; cicd ship-proof byte-stable + fake-hash control). **Prev S77** — admin **`BqKD3Y23`** · user **`Cn-i349D`** (S77 — **Run #329** `e823694` banner Trả-lại; cuối chuỗi 10 deploy #320→#329 cùng ngày, cicd PASS each: #320 pill `DsSg6RRz`-era → #321 focus → #322 revert → #323 Mig57+notes `CPm4LTqm`/`BWJUAqEI` → #324 số-âm-đỏ `C6fx-0ea`/`N3sW4Div` → #325 indent `BhnNMucS`/`B1VebpXc` → #326 cờ-gấp-asymmetric `DwXqn37C`/`COXMCv7E` → #327 decouple `B0gboSAg`/`DbDg7pM-` → #328 notify (BE-only, FE frozen) → #329 banner **`BqKD3Y23`**/**`Cn-i349D`**). **Prev S76** — admin **`jOqxW4-p`** · user **`DbsznVvR`** (S76 — **Run #319** `21d1f4e` bảng lưới `` ngân sách viền-ô; chuỗi S76 cùng ngày: #318 `e33481e` feature ma-trận-3-cột + badge quyền-NS `BhFDF9IJ`/`BAkuRl3C` → #319 **`jOqxW4-p`**/**`DbsznVvR`**, cicd PASS each, smoke 3×200, Mig 56 applied prod #318). **Prev S74** — admin **`BYF5vIMJ`** · user **`CB-tiRxd`** (S74 — **Run #315** `8655ebf` Mig 55 CcmNote, cicd PASS ~4m54s: Mig 55 applied prod CcmNote nvarchar(1000) nullable · sys.tables 88 · smoke 4×200 · 0 regression). **Prev S73** — admin **`Bv3jUCNo`** · user **`BWlMBQz6`** (Run #314 `6aa4dcb` FE empty-candidates guard fix; chuỗi 2 deploy: #313 `1d86abc` feature `OlNyG9OD`/`DSzSLVtL` → #314 **`Bv3jUCNo`**/**`BWlMBQz6`**, cicd PASS each). **Prev S72** — admin **`fc_xkNpJ`** · user **`DP-tBcg0`** (Run #312 governance commit `18fced6`; bundle ROTATE do **non-deterministic hash + deploy rebuild-FE-unconditional** (gotcha #69) — 0 FE source change, prod state/DB GIỮ NGUYÊN). **Prev S69** — admin **`BgNCjwsG`** · user **`CBvh0vtf`** (Run #308 PE cờ gấp + ngưỡng CCM; chuỗi 4 deploy session: #305 Văn phòng số foundation → #306 re-skin 10 page → #307 Office golive (BE-only) `Wt54PHYl`/`B99fMU6X` → #308 **`BgNCjwsG`**/**`CBvh0vtf`**). **Prev S68** — admin **`CNUv1jxY`** · user **`CpOskeS1`** (S68 — Run #304 `37752eb` fix tên đen→trắng; chuỗi #303 `6983609` `D532XZKG`/`CuFaBoWt` → #304 **`CNUv1jxY`**/**`CpOskeS1`**, cicd PASS each). **Prev S67** — admin `CcrZqfht`/user `DniDFUB_` (S67 — 6 deploy Run #297→#302; admin rotate chuỗi #298`xkSz9BfE`→#300`PxiZQkaw`→#301`I1fpLeYw`→#302**`CcrZqfht`** · user #297`BumgrwCJ`→#300`B36hGoKd`→#301`DrQYkzh0`→#302**`DniDFUB_`**; #299 tests BE-only cả 2 frozen, cicd PASS each). **Prev S65** — admin `BDwV5d0X`/user `DbVv6rsf` (Run #293-295). Prev S62 admin `0xKYGhhf`/user `C81ZdG9G` (Run #286). **Prev S59:** admin `B1DtNT9C` · user `D6uF3Mln` (Run **#282** `792c030` FINAL — bỏ nút Thêm hạng mục; ships kèm `80b64dd` gỡ Điều khoản TT, #281 cancelled-benign ancestor-verified). Chuỗi S59 cùng ngày: #280 `69997da` (`BKy_8OO9`/`XcZ6PRyA`, ships kèm `f21c55d` table-fixed #279-cancelled) · #278 `9c330d2` self-approve+quick-add-NCC (`BSh2fG2X`/`D22KfpPc`, authz probe 4/4) · #277 `faed59f` SearchableSelect (`ex7Tc92G`/`DzUeSk96`) · #276 `c869d26` rename 71 PMH (`BBA0KSWu`/`DzdTI18G`) · #275 `bbd1554` dọn demo WorkItems (FROZEN BE-only) · #274 `0eafcd3` tree 4 tầng (`DuU7OTym`/`DWyeTzf3`) · #273 `56882ac` wipe + tree v1 (`R9uGRxvw`/`DikfX1RD`). Prev S58: Run #386 `3ebaf84` admin `DMm9rtNA`/user `BUkOMn_Y` (chi tiết session log S58). @@ -31,18 +31,18 @@ --- -## 🔥 In Progress (S97) +## 🔥 In Progress (S98) | Task | Owner | Status | |---|---|---| -| **S97 — PE finalize 4-fix UAT anh Kiệt** (1: badge "không trình tới"→"Kết thúc tại CCM" · 2: đảo default checkbox opt-out→opt-in [`1c8fb6a` #481] · 3: **endsBeforeCeo config→RUNTIME** [Mig 60 `EndedByLevelFinalize` `8037fa0` #482] — phiếu lên CEO hết báo sai "không qua CEO", bug fixed LIVE) — ✅ DONE, test 440 + reviewer PASS 0-issue; chi-tiết mega-line + log `2026-07-01-S97-*` | 👤 em main (workflow + spawn-lẻ) | ✅ done (S97 closeout) | +| **S98 — Harness backlog batch** (✅ Fable-restore gỡ-caveat H5.6 + H8 runtime-verified spawn-test ×2 · monthly pointer→2026-08-01 · skill ef-core +row Mig 60/61 · 3 orphan-append H2 + cicd "S98"→S97 tag-patch ×4 · re-tier mega-line S93/S94→`_archive/…tier-S98…` · cicd L1 curate archive-sớm · sleep-recovery L2 · email AI_INFRA Fable-restore · ledger H10 mode-A note) | 👤 em main (D9 single-writer) + HMW verify 3-lane | 🟡 in-progress | | **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) | --- ## ✅ Recently Done (newest on top — 3 session; cũ hơn → session logs) -> Chi-tiết 3 session gần nhất (S93/S92/S91) = mega-line đầu file. Detail S75↓ đã tách (re-tier S94) → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` + bản đầy-đủ `docs/changelog/sessions/`. +> Chi-tiết 3 session gần nhất (S97/S96/S95) = mega-line đầu file. Blurb S93-S94 → `docs/_archive/STATUS-HANDOFF-tier-S98-2026-07-02.md` (re-tier S98). Detail S75↓ đã tách (re-tier S94) → `docs/_archive/STATUS-HANDOFF-tier-S94-2026-06-29.md` + bản đầy-đủ `docs/changelog/sessions/`. --- @@ -60,7 +60,7 @@ - RAG re-ingest `solution_erp` S42-S43 content (store_memory stopgap live; full re-index = AI_INFRA op) - ⬜ **Supplier schema mở-rộng (anh Kiệt "note lại từ từ tính", S96):** form Excel "Database NCC" ~30 field, entity `Supplier` hiện chỉ 9. S96 import 4 NCC (option-3: 9 field + gói extras vào `Note`). **15-18 field CHỜ thêm khi anh chốt:** GÓI THẦU (có thể → WorkItem/category) · ĐỊA CHỈ VP · FAX · SỐ TK+NGÂN HÀNG (tách field) · SỐ TK PHỤ · NGƯỜI ĐẠI DIỆN PL + CHỨC VỤ · GIẤY ỦY QUYỀN (số/ngày/người) · **Link GUQ/GPKD/HSNL** (nvarchar(1000) mirror HoSoLink) · CHỨC VỤ LH · SĐT contact riêng · ĐỊA CHỈ GỬI THƯ · NGƯỜI NHẬN THƯ · NGUỒN GT · PMH · TÌNH TRẠNG (enum active/blacklist) · NGÀY/NGƯỜI CẬP NHẬT. Additive-nullable → 1 migration khi làm. Enum `SupplierType` cần thêm "Cả hai" (NTP+NCC) nếu gặp. - ✅ **gotcha #57 LeaveType+ShiftPattern+OtPolicy filtered-unique DONE S51** (Mig 45, **3 HRM catalog** — OtPolicy bị bỏ sót khỏi backlog "2 catalog", bắt được via grep + test-before 5 case). ⬜ **EXT (worktree session, Mig 46):** Department/Supplier/Project (Master, confirmed-reachable via global query-filter quirk); ContractClause/MeetingRoom/EmployeeProfile = SKIP (audit-verified not-reachable). -- Skill + doc drift audit cron — ✅ **2026-06-01 DONE (S44)** — 42 count-drift fixes + AI_INFRA bundle adopt; next **2026-07-01** +- Skill + doc drift audit cron — ✅ **2026-07-01 DONE (S96 `881783c`)** — ef-core→Mig 59 + vocab-alias-map + re-tier mega-line (prev 2026-06-01 S44); next **2026-08-01** ### 🚫 Phase 9 Ops (blocked — anh main coordinate) - SMTP email outbound · Rotate prod creds · SQL auto-backup (backup-sql.ps1 ready, chờ Task Scheduler register) · UAT 2-3 user 1 tuần diff --git a/docs/_archive/STATUS-HANDOFF-tier-S98-2026-07-02.md b/docs/_archive/STATUS-HANDOFF-tier-S98-2026-07-02.md new file mode 100644 index 0000000..903745d --- /dev/null +++ b/docs/_archive/STATUS-HANDOFF-tier-S98-2026-07-02.md @@ -0,0 +1,22 @@ +# STATUS/HANDOFF tier archive — re-tier S98 (2026-07-02) + +> **Provenance:** tách blurb **S94 + S93** khỏi mega-line `docs/STATUS.md` (dòng Last-updated) + `docs/HANDOFF.md` (dòng Last-updated) theo tiering rule S40 ("giữ state hiện tại + 3 session gần nhất" — sau re-tier còn S97/S96/S95). **Verbatim 0 byte-loss** (archive-không-cắt, bài S94). Backup pre-retier: scratchpad `retier-backup/` + git HEAD `310b9fc`. +> Archive trước đó: session ≤S90 → [`STATUS-HANDOFF-tier-S94-2026-06-29.md`](STATUS-HANDOFF-tier-S94-2026-06-29.md) (re-tier S94). Bản đầy-đủ per-session → `docs/changelog/sessions/`. + +--- + +## 1. STATUS.md — blurb S94 (verbatim) + +**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`) + +## 2. STATUS.md — blurb S93 (verbatim) + +**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`) + +## 3. HANDOFF.md — blurb S94 (verbatim) + +**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`) + +## 4. HANDOFF.md — blurb S93 (verbatim) + +**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`)