diff --git a/.claude/agent-memory/cicd-monitor/MEMORY.md b/.claude/agent-memory/cicd-monitor/MEMORY.md index 0b141f4..61e9ee6 100644 --- a/.claude/agent-memory/cicd-monitor/MEMORY.md +++ b/.claude/agent-memory/cicd-monitor/MEMORY.md @@ -50,9 +50,9 @@ Read-only CI/CD + post-deploy verifier SOLUTION_ERP. Polls Gitea Actions API, ve - **Gitea:** `git.baocaogiaoduc.vn/vietreport-admin/solution-erp` · workflow `.gitea/workflows/deploy.yml` · paths-ignore 7-entry (D10 S111 #495): `['docs/**','**/*.md','.claude/skills/**','.claude/agent-memory/**','.claude/workflows/runs/**','.gitignore','scripts/**.md']`. Anon API works (public repo) when GITEA_TOKEN absent. - **Prod:** api/admin/eoffice `.solutions.com.vn` · SSH `ssh vietreport-vps` (Administrator, id_ed25519) · IIS phys paths: API `C:\inetpub\solution-erp\api` · admin `\fe-admin` · user `\fe-user`. DB `.\SQLEXPRESS`/`SolutionErp`/`vrapp` SQL-auth. **Conn key = `ConnectionStrings.Default` (NOT `DefaultConnection`)**. DB pw = `buKL3TGBkD0wDDbYVw65QeX9` (User Id=`vrapp`; ⚠️ Password field has NO `vrapp/` prefix — S89 login-failed when prefix included; read verbatim from prod `appsettings.Production.json` ConnectionStrings.Default when `$env:PROD_DB_PASSWORD` empty). ⚠️ skill-doc path `C:\inetpub\apps\SolutionErp\Api` STALE. - **SSH→PS quoting (S42):** nested bash→ssh→powershell mangles `$var`/`\"` → use `iconv UTF-16LE | base64` → `powershell -EncodedCommand $B64`; OR write ps1-file + `powershell -File $(cygpath -w)`. sqlcmd over SSH direct `-W -h -1` pw-inline. sys-catalog string-concat → `COLLATE DATABASE_DEFAULT` (collation conflict). -- **Tests baseline:** **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 62 `20260706084342_ExpandSupplierFields`** (S104 #488; AddColumn ×18 on `Suppliers` [17 nullable string + `Status` int] + guarded `Sql()` UPDATE `Note=NULL WHERE Code IN (4 NCC) AND Note LIKE N'Loại:%'` — un-cram legacy concat Note; NO CreateTable ⟹ sys.tables stays 89 — VERIFIED-APPLIED-PROD history-HEAD + 18-cols-present + Suppliers-total-35-cols + 4-row Note=NULL/Pkg/Bank/LegalRep-populated/Status=1 + Note-still-Loại-count=0). Prev Mig 61 `BackfillEndedByLevelFinalizeFromChangelog` (S97, data-only). Path `src/Backend/SolutionErp.Infrastructure/Persistence/Migrations/`. Prod check `sqlcmd __EFMigrationsHistory ORDER BY MigrationId DESC TOP 5`. ⚠️ **`sys.tables` (is_ms_shipped=0) = 89** (S104 LIVE-verified post-#488 — AddColumn/data-only migs don't change count → commit touches no new table ⟹ 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 (S111 #495 re-verified 2026-07-12 — FROZEN-streak ×6 #490→#495):** admin js **`BVyH-FY7`**/css `Bbtesa6B` · user js **`EDsZebvn`**/css `BmuPz_Dy` — JS ROTATED-benign tại #489 (0 fe-src governance-only, Vite non-determinism #69) từ #488 `ChSNAJBK`/`Bn2w1znH`; CSS frozen. LM-in-window 11:49:07/11:50:00+07 (#495) + real-size 1,644,931/1,551,280b byte-identical ×6 = ship-proof. ⚠️ **id ≠ run_number; head_sha-keyed.** ⚠️ **PER #69 TWO-MODE: hash MAY rotate (real src-diff #488, HOẶC 0-fe-src #489/#312) OR freeze (0 fe-src #485-487) — SNAPSHOT per-run, NOT baseline; ALWAYS re-snapshot LIVE pre-deploy.** Real FE ship = diff `fe-*/src` in range + real-size-vs-fake (1.64/1.55MB vs ~919b SPA-trap 200-text/html) + Last-Modified-in-window + content-marker-grep, NOT hash delta alone. +- **Tests baseline:** **458 PASS** (45 Domain + 413 Infra · 0 fail/skip; D10 S112 Run #496 sha `e100ef0` — 440→458 incl +10 `SupplierExcelImportServiceTests` + `PeSubmitGuardAndBypass` mods; prior 440 [S96 #480 45D+395I `PeSuggestedPriceSetterAuthzTests`], 436, 434, 421). Phase 9 UAT skip per chunk OK. 🔑 **Anon log endpoint `https://git.baocaogiaoduc.vn/vietreport-admin/solution-erp/actions/runs/{run_number}/jobs/0/logs` (HTTP 200 ~18KB) EXPOSES per-project `Passed! - Failed: 0, Passed: N, Skipped: 0` — concrete test count now available, NOT just status=success (the `/api/v1/.../tasks/{id}/logs` variant 404s; use web-UI runs/{run_number}/jobs/0/logs).** +- **Mig latest repo:** **Mig 63 `20260712070117_AddSupplierImportSourceFields`** (D10 S112 #496 `e100ef0`; 2 AddColumn nullable on `Suppliers` [`SourceUpdatedAt` datetime2 + `SourceUpdatedBy` nvarchar(200)] for Excel-import Phase B provenance; NO CreateTable ⟹ sys.tables stays 89 — VERIFIED-APPLIED-PROD history-top==`AddSupplierImportSourceFields` + both-cols-present=2 + sys.tables=89). Prev Mig 62 `ExpandSupplierFields` (S104 #488, AddColumn ×18 Supplier 9→27 + un-cram 4-NCC Note). Prev Mig 61 `BackfillEndedByLevelFinalizeFromChangelog` (S97, data-only). Path `src/Backend/SolutionErp.Infrastructure/Persistence/Migrations/`. Prod check `sqlcmd __EFMigrationsHistory ORDER BY MigrationId DESC TOP 5`. ⚠️ **`sys.tables` (is_ms_shipped=0) = 89** (S104 LIVE-verified post-#488 — AddColumn/data-only migs don't change count → commit touches no new table ⟹ 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 (D10 S112 #496 `e100ef0` 2026-07-12 — REAL-FE-SHIP rotate, breaks FROZEN×6):** admin js **`Cixlt_MA`**/css **`Ds-E5neu`** · user js **`BhBOG1dn`**/css **`Beb0Bb1h`** — BOTH js+css rotated (from #490-#495 admin `BVyH-FY7`/`Bbtesa6B` · user `EDsZebvn`/`BmuPz_Dy`) = expected, real `fe-*/src` change (SupplierImportDialog.tsx NEW both apps). Ship-proof DEFINITIVE: real-size admin 1,652,140b / user 1,558,489b (vs 919b SPA-trap) + `application/javascript` + LM 09:18:32/09:19:25 GMT (=16:18/16:19+07 in deploy-window 16:14:33→16:19:58) + content-marker `"Database NCC"` count=1 in BOTH bundles. ⚠️ **id ≠ run_number; head_sha-keyed.** ⚠️ **PER #69 TWO-MODE: hash MAY rotate (real src-diff #488/#496, HOẶC 0-fe-src #489/#312) OR freeze (0 fe-src #485-487) — SNAPSHOT per-run, NOT baseline; ALWAYS re-snapshot LIVE pre-deploy.** Real FE ship = diff `fe-*/src` in range + real-size-vs-fake + Last-Modified-in-window + content-marker-grep, 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,6 +70,7 @@ BE (test+build) ~90s · FE × 2 ~60s/app · deploy ~30s · **total ~3min code / ## 📅 Recent runs (compressed — verbatim → archive via `_INDEX.md`) +- **🟢 S112 #496 (rn 382, id 496) `e100ef0` GO 5m25s (16:14:33→16:19:58+07 2026-07-12) — PE workflow (`a829d0d` code-only A1-creator-sign/EDGE-5-terminal-lock/opinion-history) + Supplier Excel-import Phase B + Mig 63 (22-file: FE ×4 SupplierImportDialog both apps, BE ×13 incl Mig63 3-file, tests):** status=success · **test gate CONCRETE from `runs/382/jobs/0/logs` (anon 200): Domain `Passed! Failed 0, Passed 45` + Infra `Passed! Failed 0, Passed 413` = 458/0-fail/0-skip** (matches parent baseline exact; +10 SupplierExcelImportServiceTests absorbed) · **Mig 63 `AddSupplierImportSourceFields` APPLIED-PROD** (history-top==name + `SourceUpdatedAt`+`SourceUpdatedBy` cols-present=2 + sys.tables=89 frozen) · **FE REAL-SHIP both apps** admin js `BVyH-FY7`→`Cixlt_MA`/css→`Ds-E5neu` · user js `EDsZebvn`→`BhBOG1dn`/css→`Beb0Bb1h` (all 4 rotated, real fe-src) ship-proof= real-size 1,652,140/1,558,489b + `application/javascript` + LM 09:18:32/09:19:25 GMT in-window + `"Database NCC"` marker count=1 both · **import routes WIRED** POST `/import/preview`+body→415 (multipart binder matched) · `/import/confirm`+body→401 (auth-gated) · bogus+body→404 control · smoke api-live/ready + admin/eoffice roots + authed suppliers/contracts/PE/menus ALL 200 (PE workflow change healthy). 🔑 **411-refinement: bodyless-POST → 411 for ANY route incl bogus (IIS Content-Length pre-routing) ⟹ 411≠route-exists; MUST re-probe WITH body → 401/415 (matched) vs 404 (missing).** - **🟢 S111 #495 (rn 381, id 495) `8aa3869` GO 5m11s (11:45:21→11:50:32+07 2026-07-12, iter6) — H22 WAL adopt 30-file +767 (0 src/BE/FE/mig; non-ignored: settings.json + wal-flush.ps1 + hmw.js + deploy.yml + governance-detectors.ps1 + .gitattributes → CI-run ĐÚNG thiết kế):** status=success (gate 440) · **deploy.yml TỰ-ĐỔI trong chính commit (D10 +2 paths-ignore `.claude/agent-memory/**` + `.claude/workflows/runs/**`) — run created+parse+chạy trọn 5m11s = YAML hợp lệ, workflow-self-change PASS** · Mig FROZEN 62 history-top `ExpandSupplierFields` + sys.tables=89 ✓ · smoke 3×200 (health/ready + 2 FE roots) · **bundle FROZEN ×6-streak** (admin `BVyH-FY7`/`Bbtesa6B` · user `EDsZebvn`/`BmuPz_Dy` = #490→#494) + LM-in-window 11:49:07/11:50:00+07 + size 1,644,931/1,551,280b byte-identical #494 vs fake-919b = ship-proof. 🔑 **AS-6 BASELINE SHIFT từ #495: paths-ignore 7-entry — memory-budget.json/agent-memory/run-trace push HẾT trigger (trigger-pattern #490/#492 DEAD); phân loại trigger giờ soi file ngoài 7-glob.** - _(**S107-closeout→S110-spot #490-#494** GOVERNANCE/MEMORY-push GO ×5 [`d74f67f`·`69957fd`·`f5a5c3e`·`6ee60cd`·`ac3f122` — trigger #41 non-.md-in-push: budget.json ×2 + hmw.js ×3, pattern DEAD từ D10 #495] — bundle FROZEN-streak ×5 sau ROTATE #489 [#69 TWO-MODE; LM-in-window + real-size 1,644,931/1,551,280b = signal duy nhất] · Mig 62 + sys.tables 89 frozen · gate 440 · smoke 3×200 ALL · 🔑 #494 spot-detection: LM-prod-newer-than-last-verified-window = missed-run detector · full verbatim → `archive/2026-07.md` via `_INDEX`)_ - _(**S107 #489 `21387cd` GOVERNANCE-ONLY (+office-document 12th sub) GO 5m33s** — JS ROTATED-benign `ChSNAJBK`→`BVyH-FY7` / `Bn2w1znH`→`EDsZebvn` CSS-frozen, 🔑 #69 TWO-MODE CONFIRMED (0-fe-src ROTATE #312/#489 hoặc FROZEN #333/#485-487 — ship-proof = LM-in-window + real-size, hash-delta phụ) · **S104 #488 `778fc98` FULL-STACK Supplier 9→27 + Mig 62 `ExpandSupplierFields` APPLIED-PROD** — AddColumn×18-exact + sys.tables-89-invariant + un-cram 4-NCC Note=NULL/Pkg/Bank/LegalRep-populated-EXACT + DTO-18-new-keys-live + JS-rotate-real-src + 🔑 FULL-STACK-SCHEMA-ADD+DATA-UN-CRAM PASS-pattern — full verbatim → `archive/2026-07.md` via `_INDEX`)_