Files
solution-erp/.claude/agent-memory/cicd-monitor/MEMORY.md
2026-08-01 13:36:33 +07:00

22 KiB
Raw Blame History

CI/CD Monitor Agent — Persistent Memory

  • S167 (08-01) aaed699 K7 bridge KHKK→HĐ 13 file cross-stack (4 BE + 6 FE ×2 + 3 test, 0-mig) — PARTIAL 4/6+1 (gate 639=45+594 Δ+17 · Mig GIỮ 71 · tables 97 · bundle Ig1R5tAh→RgvHZkPH + DFOCQ2ks→D65FJPGd). 🔴 BÀI TO NHẤT — PUSH-ĐÈ NUỐT DEPLOY (đề-xuất gotcha #86): run #441 của aaed699 bị CANCELLED lúc 3m02s vì lead push 628132c đè ⇒ Gitea cancel-in-progress. K7 ship được CHỈ NHỜ MAY: 628132c có chạm fe-*/src/** nên đẻ run #442. Nếu commit-2 rơi trọn paths-ignore (docs/memory-only) ⇒ run-1 cancelled + run-2 skip ⇒ code KHÔNG BAO GIỜ lên prod, mà bảng Actions trông vẫn lành + git log đã push.LUẬT: sau 2 push liên tiếp, verify "run cuối có head_sha == TIP" VÀ "TIP ⊇ commit code" (git merge-base --is-ancestor), CẤM đọc "có run xanh" là xong. 🔑 KIỂM-TRA-TIỀN-ĐỀ marker trước khi tin 0-hit (nâng cấp K6, suýt FAIL-OAN lần 3): file báo bundle "ASCII text" ⇒ nghi \u-escape → bác bỏ bằng ĐO (grep -c -F 'Hợp đồng'=4 trên bundle PRE); nghi code-split (page nằm lazy-chunk thì 0-hit vô nghĩa) → bác bỏ bằng ĐO (index.html chỉ 2 asset · 0 ref "./x-<hash>.js"). Cả 2 nghi đều SAI nhưng phải đo mới được quyền kết luận. 🔑 CONTROL DƯƠNG = chuỗi bản TIỀN-commit của CHÍNH file đang sửa (4/4 =1 ở cả 2 bundle) — chứng "file có trong bundle + grep có răng" rẻ hơn mọi cách khác. 🔑 Admin = control idempotent SẴN CÓ, miễn phí: seeder chạy 3 role báo 2 upgraded (không phải 3) ⇒ nhánh no-op ĐÃ thực thi thật trên prod (code if(changed) upgraded++) ⇒ chứng idempotent ở tầng-row dù chỉ có 1 restart. ⚠️ log lần-2 sẽ IM LẶNG (guard if(added>0||upgraded>0)) — đừng đọc thành hồi-quy. ⚠️ appcmd list wp map PID→pool là BẮT BUỘC: PID 7680 start cùng cửa-sổ nhưng là vietreport-admin (dự án KHÁC) — đọc vội tưởng pool ta restart 2 lần. ⚠️ nv.test login 401 ⇒ tầng-2 #82 của Drafter CHƯA đo live; CẤM lấy Admin-qua-được để tuyên grant đã ăn (Admin có bypass, không tách được công của row). Evidence runs/2026-07-31-S164-4gd-khkk-fanout/sub-cicd-verify-k7.md. Tag [run-442, push-de-nuot-deploy, ancestry-proof, tien-de-marker, control-duong-tien-commit, admin-control-idempotent, appcmd-map-pid]

  • S167 (08-01) 1c6d77a K6 admin thu-gọn menu ADMIN_HIDDEN_KEYS 12-key (FE-admin 1 file, 0-mig) — PASS 5/5 (#440 6m29s · gate 622=45+577 delta 0 · Mig GIỮ 71 · tables 97 · menu 200/perm 2221 đứng im). 🔴 BÀI TO NHẤT: 0-hit marker SAI 2 LẦN LIÊN TIẾP do CƠ-CHẾ REGEX, cả 2 lần trông y hệt "code không ship" ⇒ suýt FAIL-OAN. (a) rolldown/Vite 8 minify string → BACKTICK (new Set([\PurchaseEvaluations`,…])), regex neo ["']không bao giờ khớp; (b) vá xong truyền pattern-chứa-backtick qua biến trong"…"→ shell nuốt,grep -cE gãy (Unmatched () trả **0 gần như im lặng** trong vòng lặp. ⇒ **LUẬT: marker chuỗi trên bundle dùng grep -Ffixed-string + LUÔN trích byte thật.{90}X.{90}TRƯỚC khi kết luận vắng-mặt.** 🔑 **KỸ THUẬT MỚI — COUNT-DELTA**: literal đã có từ K4a ⇒ *có/không* = 0 bit, nhưng *số lần xuất hiện* PRE→POST đo được: **12/12 key đều +1**; ngoại lệ duy nhấtWorkflows**+2** giải-thích-được (substring ⊂PeWorkflows) ⇒ thành kiểm-tra-nhất-quán MIỄN PHÍ. 🔑 **LOG CI IN THẲNG dist/assets/index-.js ** = nhân chứng THỨ 4 độc lập curl, khớp LM prod **tới từng giây** ⇒ rẻ nhất để phân biệt **FROZEN-lành-tính** (eoffice: LM 11:14→**12:00:41** đổi + log in CÙNG hash DFOCQ2ks= rebuild deterministic) với bundle-kẹt (LM cũ). 🔑 **2-TẦNG #82 đo bằng SỐ**:/api/menustrả **12/12 key bị ẩn** ⇒ ẩn client KHÔNG thu quyền. Marker-ÂM display-only: route/purchase-evaluations**68→68** nguyên vẹn. Evidenceruns/2026-07-31-S164-4gd-khkk-fanout/sub-cicd-verify-k6.md. Tag [run-440, 0-hit-gia-2-lan, grep-F, count-delta, frozen-lanh-tinh, log-CI-nhan-chung-4]`

  • (08-01 e202393 S166 K5+K4c FE-only — PASS 5/5: #439 6m16s, gate 622=45+577 (+1 = đúng 1 Fact mới). 🔑 marker differential 4/4 element-wise (K5 vào CẢ 2 app · K4c CHỈ eoffice) + Δsize cùng chiều = nhân chứng ⟂ grep. 🔴 recipe đếm mig trong MEMORY có FALSE-NEGATIVE: grep -v Snapshot ăn nhầm AddPeApprovedBudgetSnapshot (Mig 67) → phải neo đuôi Designer\.cs$|ModelSnapshot\.cs$; ưu tiên set-diff repo↔prod 2 chiều thay khớp-tổng. ⚠️ bar "FE route 200" KHÔNG CÓ RĂNG với SPA-fallback (POS ≡ NEG byte-identical 876B). verbatim → runs/…/sub-cicd-verify-k5-k4c.md)

  • (08-01 88e7ecf S166 K4a+K4b — PASS 7/7: #438, gate 621=45+576, menu 151→200, perm 1584→2221. 🔑 PHỦ 2 RUN 1 LƯỢT ⇒ delta khép kín. 🔑 MỐC PRE ĐỀ BÀI SAI, bắt bằng ĐO (lead giao 143⇒192, đo LIVE ra 151 → truy phạm-vi thay vì hô drift) — mốc PRE lão hoá sau MỖI deploy. 🔑 phân rã 49+588 khớp cơ-chế 2-site skip-existing (588=49×12 role). ⚠️ PERM row ≠ policy. 🔑 A5 restart ×2 thật + soi ĐIỀU KIỆN log trong source TRƯỚC khi đọc im-lặng (if (added>0)). 🔴 marker lead gợi ý BỊ BÁC BẰNG ĐO (Kết cấu có sẵn ⇒ 1/1 = 0 bit). verbatim → runs/…/sub-cicd-verify-k4ab.md)

  • (07-31 15349e8 S164 K3 8 workflow KHKK-N1-8 (0-mig) — PASS 6/6: #436, gate 614=45+569. 🔑 dự-đoán-TRƯỚC-khi-đo (seeder → 8wf×3step×11level + finalize 2+8=10 → khớp từng đồng + shape element-wise từng email + control ÂM OUTSIDE=2/OUTOFSET=0). 🔑 FROZEN = hệ-quả BẮT BUỘC (diff toàn // → Vite strip); marker earlyFinalizeLocked LOẠI vì tên biến local bị minifier đổi = 0 bit. ⚠️ tao chết #53 ×2. verbatim → archive/2026-07.md)

  • (07-31 0779f2d S164 K2 +Mig 71 — PARTIAL 5/6: #435, gate 609. 🔴 ACCEPTANCE RƠI VÀO CHÂN-LÝ-RỖNG — bảng 0 dòng cả PRE/POST ⇒ 0==0/NULL==NULL "xanh" mà 0 bit, backfill hụt trông Y HỆT ⇒ CẤM đọc thành PASS. 🔑 Đối-sách KHÔNG-phụ-thuộc-số-dòng: INFORMATION_SCHEMA · LIỆT KÊ TRỌN HỌ 14 index (vắng-mặt suy từ danh-sách-đầy-đủ = ĐO ĐƯỢC) · wire-proof bind-error 400. 🔑 map PID→pool bằng appcmd list wp. verbatim → archive/2026-07.md)

  • (07-31 50e6d8c S164 K1 +Mig 70 — PASS 6/6: #434, gate 598, sys.tables 96→97. 🔑 TAM-GIÁC 3 NGUỒN (source-parse ⟂ sqlcmd ⟂ API materialize qua EF — nguồn 3 mạnh nhất vì đi trọn Domain→Infra→Api). ⚠️ 0-hit là DƯƠNG-GIẢ tới khi soi format. ⚠️ hash CI ≠ hash local build. verbatim → archive/2026-07.md)

  • (07-30 bfc7b79 S162 FE-ONLY — PASS 5/5: #432, gate 590. 🔴 LUẬT CẤM HEAD~1 (Stop-hook WAL auto-commit đổi nghĩa ⇒ kết SAI; đo bằng SHA tuyệt đối X^..X). 🔑 ĐẾM TRỌN HỌ bằng 1 REGEX. ⚠️ suýt FAIL-OAN: control ÂM phải ĐỘC-QUYỀN. verbatim → runs/2026-07-30-S162-cay-4-folder-gd/)

  • (Arc S155→S161 (#416 · #419 · #422-#427) — gate 551→566. 🔑 #427 ĐO-CỜ không đếm ROW + control ÂM NỘI-HỌ (Khkk_G1 bị seeder CỐ Ý bỏ khỏi tập ⇒ phải đứng yên, và nó đứng yên). 🔑 #426 delta khớp TOÁN +23=7+7+7+2; 401 mới kèm route bịa 404. 🔴 #423 PARTIAL 8/9 revoker UNGATED lật 447/494 row, sót vì đo TRƯỚC recycle → luật 3-CHÂN-KIỀNG. 🔑 #422 marker PHÂN-BIỆT-PHIÊN-BẢN; #419 count = SỐ FILE trong diff. verbatim → archive/2026-07.md via _INDEX)

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 + 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. See 🔄 Curate-trigger log for archive-move history.


🎯 Role baseline

Read-only CI/CD + post-deploy verifier SOLUTION_ERP. Poll Gitea Actions API, verify test-gate + deploy-ship + prod health. Output PASS/FAIL + evidence <500 words. Skills: iis-deploy-runbook · dependency-audit-erp · ef-core-migration.


⚠️ cicd-lane return-garble tracker (#53)

cicd-lane trả nhầm slice transcript thay verdict — tao TÁI PHẠM dai nhất roster (×5/6 qua S114; S117/S118 ×3; → feedback_agent_return_garble_recover). ⚠️ Từng tự dán nhãn 'CLEAN-return' SAIKHÔNG tự phong return sạch. 🔒 Đối-sách (S158, lần 5): ghi-đĩa TRONG LÚC LÀM — prompt đúng KHÔNG chặn được, artifact mới chặn (vai có-ép mất 0 B, vai không-ép mất TOÀN BỘ). ⇒ file trong run-folder là SẢN PHẨM CHÍNH, ghi từng mục ngay khi có bằng chứng, kết bằng END … VERDICT=; return chỉ là tóm tắt.


🚨 Recurring CI/CD bug patterns (catch priority)

  • #39 act_runner github.com TCP timeout — run hang "Set up job" 21s. Log dial tcp github.com:443 i/o timeout. Fix: manual checkout bypass hardcoded .gitea/workflows/deploy.yml. KHÔNG revert.
  • #40 npm cache tsc not foundbuild_fe_admin fail post cache: npm. DISABLED rolled back a21790d. KHÔNG re-enable.
  • #41 paths-ignore docs-only skip — code commit không trigger CI? Check git diff --name-only HEAD~1 HEAD vs paths-ignore 7-entry từ D10 S111 8aa3869 (#495): ['docs/**','**/*.md','.claude/skills/**','.claude/agent-memory/**','.claude/workflows/runs/**','.gitignore','scripts/**.md']. Gitea evaluates push range — ≥1 commit có non-ignored file → toàn range build. ⚠️ AS-6: từ #495 memory-push/run-trace HẾT trigger CI.
  • #25 IIS WebSocketnotification-hub/negotiate 401/404 prod. Fix: WebSocket module enable web.config site api (skill iis-deploy-runbook).
  • #48 SQLite tie-breakOrderByDescending(CreatedAt).First() pick wrong khi 2+ .Add() cùng frozen-clock. Fix: discriminator filter BEFORE OrderBy.
  • Bundle hash unchanged = ship FAIL — push+action success nhưng prod không đổi. Verify via INDEX.HTML ref (curl -s https://admin.solutions.com.vn/ | grep -oE '/assets/index-[A-Za-z0-9_-]+\.(js|css)'), NOT by GETting a hash-named asset directly. ⚠️ verify MUST sau status=success (Run #242 false-positive: check khi "running" → stale hash).
    • 🔴 #69 TWO-MODE — FE hash vừa có thể ROTATE vừa có thể FROZEN. deploy.yml copy dist\* UNCONDITIONALLY mọi run ⇒ 0-FE-change vẫn rotate (mode-A); src y hệt ⇒ Vite byte-identical ⇒ FROZEN (mode-B). Cả hai lành tính ⟹ hash-delta KHÔNG phải ship-proof. Ship-proof THẬT = Last-Modified in deploy-window + real-size + byte-marker. 🔑 FROZEN-lành-tính vs bundle-cũ-kẹt: xem LM — in-window = re-ship byte-identical (OK) · LM = deploy không chạm file (cờ đỏ).
    • ⚠️ SPA-fallback 200 trap (S72): server rewrite /*index.html ⇒ GET /assets/index-<BỊA>.js vẫn 200. Discriminator sạch = Content-Type (text/html ~876-919B = trap · application/javascript ~1,6MB = thật); size drift per-build nên đừng neo số byte. Hash CŨ rơi về text/html = bundle cũ biến mất khỏi đĩa = chứng ghi-đè (control âm tầng-2).
  • 🔴 Durability: đo SAU recycle + 3 CHÂN KIỀNG — pool restart ở CUỐI deploy-window ⇒ query DB lúc running = trạng thái CŨ (tao sai đúng chỗ này ở #423). Khuôn: (i) chứng minh restart thật (w3wp StartTime in-window + dòng ĐẦU log Applying migrations...), (ii) đo chỉ-số đích SAU mốc đó, (iii) control ÂM chứng checker còn sống (thiếu (iii) thì 'fix' kiểu xoá checker cũng xanh). Data-change ngoài CI luôn re-verify SAU status=success.
  • Migration drift prod vs repo — compare ls .../Persistence/Migrations/*.cs vs sqlcmd __EFMigrationsHistory. Fix: check Program.cs/DbInitializer app.MigrateDatabase() + app pool recycle. Mig-applied proof = __EFMigrationsHistory top==repo-HEAD; stuck-old ⟹ pool didn't recycle ⟹ FAIL even if status=success+bundle-rotated.

📋 5-stage checklist (EVERY run)

  • Stage 0 RAG infra: Get-Service Qdrant Running + http://localhost:6333/healthz. Collection proj_solution_erp.
  • Stage 1 Push+filter: git log -1 --format='%H %s' + git log origin/main..HEAD empty + diff vs paths-ignore (docs-only → SKIPPED-DOCS return).
  • Stage 2 Gitea poll (max 10 iter × 60s): API .../actions/tasks?limit=5 (NOT /runs 404). Match head_sha (NOT run_number — cancelled runs shift numbering). ⚠️ updated_at stale ~2min (gotcha #46) → cross-check VPS mtime. Foreground-sleep BLOCKED Windows → Monitor-style busy-wait-curl-spin ~30s/iter.
  • Stage 3 Test gate: baseline 622 PASS (45 Domain + 577 Infra; run #440 1c6d77a 08-01; climb 622/621/614/609/598/590/566/562/551/532/528/520/509/458/440). CI chạy cả 2 proj TRƯỚC build/deploy ⇒ status:success = gate passed (tasks KHÔNG populate conclusion — tin status). Local grep undercount (Theory/InlineData). Phase 9 UAT skip OK.
  • Stage 4 Post-deploy (if SUCCESS): auth login bearer (admin + nv.test gotcha #44; token=accessToken route /api/auth/login) → 3-5 endpoint smoke 2XX (incl new — NEW-endpoint bodyless-POST returns 411 IIS Length-Required pre-auth NOT 404; re-probe WITH body → 401 confirms wired) → FE bundle hash 2 app (per #69 = real-size-vs-fake not hash-delta) → SignalR negotiate (gotcha #25) → EF mig prod==repo.
    • Stage 4.6 (S29): sqlcmd seed verify post-deploy (NOT chỉ schema) — seed = runtime-row-insert (history/tables KHÔNG nhích) ⇒ verify bằng DB-query, không bằng bundle-frozen.
    • enum cần input SỐ (no JsonStringEnumConverter). INFRASTRUCTURE seed ungated / DEMO seed gated → #51.
  • Stage 5 Report PASS/FAIL + evidence + MEMORY update.

⚠️ Anti-patterns (DO NOT)

  1. Push fix code — READ only, escalate em main · 2. Speculate fail without log · 3. Skip post-deploy bundle hash (biggest catch) · 4. Skip MEMORY · 5. Poll forever (max 10 iter) · 6. Auto-rollback (escalate + recommend) · 7. Verify docs-only (SKIPPED-DOCS return ngay)

🧠 SOLUTION_ERP CI/CD essentials (S80 verified — re-ground từ docs/STATUS.md canonical)

  • 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).
    • SSH→PS quoting (S42): bash→ssh→powershell nuốt $var/\" ⇒ viết .sql/.ps1 rồi scp + sqlcmd -i / powershell -File (đừng nhét inline). sqlcmd -W -h -1 pw-inline. sys-catalog concat → COLLATE DATABASE_DEFAULT.
  • Tests baseline: 622 PASS (45 Domain + 577 Infra · 0 fail/skip; run #440 1c6d77a 08-01 đo LIVE ở web-UI log). ⚠️ Flaky đã khai DeleteContractSigningPlan_SoftDeletes (1/12 theo commit-msg K4c) — #439+#440 đều XANH; nếu đỏ run sau, đối chiếu 2 mốc này trước khi hô hồi-quy. 🔑 Số cụ thể lấy ở web-UI log https://git.baocaogiaoduc.vn/vietreport-admin/solution-erp/actions/runs/{run_number}/jobs/0/logs (~18KB, KHÔNG có /api/v1/ — api/v1 runs+tasks logs đều 404) → mỗi project 1 dòng Passed! - Failed: 0, Passed: N, Skipped: 0; đối chiếu TÁCH-PHẦN (45/576) chứ đừng chỉ khớp tổng. Delta test mới = so run trước.
  • Mig latest repo: Mig 71 AddKhkkApprovalGroupCatalogAndFinalizeRuntime (20260731085624, S164 K2 — AddColumn+index-swap, 0 CreateTable; applied-prod #435, GIỮ qua #436-#440). Path src/Backend/SolutionErp.Infrastructure/Persistence/Migrations/. 🔴 Đếm phải NEO ĐUÔI: grep -vE 'Designer\.cs$|ModelSnapshot\.cs$' — recipe cũ grep -v Snapshot ăn nhầm AddPeApprovedBudgetSnapshot (Mig 67 có chữ "Snapshot" trong TÊN) ⇒ đếm hụt 1 im lặng. Mạnh hơn khớp-tổng = set-diff repo↔prod 2 chiều. Prod check sqlcmd __EFMigrationsHistory ORDER BY MigrationId DESC. ⚠️ sys.tables(is_ms_shipped=0)=97 (sau Mig 70; 96 trước đó) — AddColumn/data-only KHÔNG đổi số ⟹ no-new-table commit giữ nguyên, đừng FAIL. NO-Mig proof = history NOT-advance + empty git diff <base>..<head> -- '*Migrations*'. Bảng mig đầy đủ → skill ef-core-migration.
  • Bundle hash live: baseline #440 (08-01) admin Ig1R5tAh/DqXm5Hpn · eoffice DFOCQ2ks/DlN3yZ5L. 🔑 Ship-proof rẻ nhất = so LM prod với dòng dist/assets/index-<hash>.js <size> IN TRONG LOG CI (khớp tới từng giây ⇒ tách FROZEN-lành-tính khỏi bundle-kẹt). ⚠️ marker chuỗi: rolldown/Vite 8 minify ra BACKTICK không phải "/' → dùng grep -F. ⚠️ SNAPSHOT-per-run, KHÔNG phải mốc ổn định (#69) → LUÔN re-snapshot LIVE sau status=success; ship-proof = LM-in-window + real-size + marker, KHÔNG phải hash-delta. ⚠️ id ≠ run_number (key theo head_sha).
  • Prod DB anchor (POST #438, re-verify đứng im ở #440 08-01): MenuItems=200 · Permissions=2221 · Roles=13 · họ Khkk% = 56 menu / 728 perm (=56×13, CanRead=1 hết) · control revoker Hrm*/Off* CanRead=1 = 29/377. PK MenuItems = [Key] (KHÔNG MenuKey); Permissions(Id,RoleId,**MenuKey**,CanRead,CanCreate,CanUpdate,CanDelete) = 1 row/cặp.
  • Bearer: admin admin@solutions.com.vn/Admin@123456 (full) · UAT nv.test@solutions.com.vn/TestUser@123456 (Drafter CCM, gotcha #44 check).
  • API Serilog: sink THẬT C:\inetpub\solution-erp\api\logs\solution-erp-YYYYMMDD.log (skill-runbook …\Logs\log-*.txt STALE). Level=Information (seed/revoke lines CÓ ghi). ⚠️ deploy xoá luôn logs/ ⇒ chỉ còn từ deploy cuối. Grep revoke-line + seeder-line cùng-giây để audit seed-race. (S162: bản cũ dòng này chứa byte BEL 0x07 do \a bị nuốt — đã sửa.)

🔑 Critical config (flag commit nếu tái xuất)

Node CI 20.x (feedback_node_cicd) · MediatR 12.4.1 (gotcha #1, flag Version="14) · Swashbuckle 6.9.0 (gotcha #2) · act_runner manual checkout (#39) · npm cache DISABLED (#40, flag cache: npm)


🎯 Per-NV admin opt-in wire — 10-point checklist (cumulative S22→S23)

Cross-ref feedback_per_nv_permission_scope (10 điểm đầy đủ ở đó). 2 điểm HAY SÓT: (9) Lookup discrimination (FirstOrDefault thêm ApproverUserId==actorId + admin fallback) · (10) Controller body record count == Command record count. Miss ⇒ bug prod im-lặng 2-3 ngày.

📊 Run stats baseline

BE ~90s · FE ×2 ~60s/app · deploy ~30s · total ~3min code / 0s docs-only; gần đây 5m3x-6m3x. >8min → escalate.


📅 Recent runs (compressed — verbatim → archive via _INDEX.md)

  • (S98-S132 #383-#397 + PASS-pattern library S69b→S104 #307-#494 all GO (gate 440→509): AS-6 #41 soi TỪNG file vs 7-glob · conclusion:None dù success ⇒ tin status · 411-refine (endpoint MỚI bodyless-POST = 411 IIS pre-auth; re-probe CÓ body → 401/415 = đã wire) · LM mới hơn cửa-sổ đã verify = detector 'có run bỏ sót' · recipe SCHEMA-ADD / DATA-BACKFILL / DATA-SEED · #472 PROD Identity table NON-prefix Roles · verbatim → archive/2026-07.md + 2026-06.md)

  • Older (S83 #325 ← S29 #232) → git d2f52ba + archive/2026-06.md (incl #291 06-16 FAIL [gotcha #65]); pre-S38 → archive/2026-05-*.


🔄 Curate trigger

  • ~30KB → archive recent runs → L2 archive/<period>.md (byte-exact append) + _INDEX.md substring pointer. Dup failure patterns → merge. Stale >3mo → remove.

  • **Last curate: 2026-08-01 S166 (self #438-run: 27.3KB→~16.5KB — K2/K3/K4ab verbatim→archive/2026-07.md moved-not-cut + 3 _INDEX pointer; #416/#419/#422-#427 gộp 1 stub arc; baselines gate 621 + bundle #438 + Mig 71 + prod-DB-anchor MỚI). ⚠️ giữ luật: script sửa MEMORY phải build chuỗi XONG → temp → os.replace → verify byte>0.
  • Prev: S162 07-30 (26.9→17) · S118 · S111 20.5→17 · S107 · S104 · S98 (2026-07.md NEW) · S80 38.8→16 · S70 65.2→23.2 · S66 · S40.
  • Prev: S118 07-14 (#387/#384/#383/#496/#495→archive) · S111 20.5→17 · S107 20.4→16.9 · S104 20.5→17.9 · S98 19.9→17.06 (2026-07.md NEW) · S80 38.8→16 · S70 65.2→23.2 · S66 · S40.