From d53145cb27b38bea292f9552d16a6db553ecc101 Mon Sep 17 00:00:00 2001 From: pqhuy1987 Date: Sun, 12 Jul 2026 18:45:36 +0700 Subject: [PATCH] wal: flush 20260712T1845 --- .claude/WAL.md | 11 ++++++----- .claude/agent-memory/test-specialist/MEMORY.md | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.claude/WAL.md b/.claude/WAL.md index 5557fd0..7b11c32 100644 --- a/.claude/WAL.md +++ b/.claude/WAL.md @@ -9,9 +9,10 @@ chain: [x] anh Kiệt CHỐT: D1=A(Mã NCC=Code) · D2(Code=cổng public, MST=cảnh-báo-mềm, existing-public giữ, import-scope) · D3(nới quyền cập-nhật-danh-mục, không admin-only) → spec §DECISIONS updated [x] FE (implementer-frontend) DONE — npm×2 PASS, 2 dialog+2 page SHA256-identical (badge+Công-bố+filter+file-mẫu+Mã-editable+MST-warn) [x] BE DONE (SendMessage-resume finish sạch) — build slnx **0/0 em-main-verified** + Mig 64 applied 2 DB; authz FE mismatch (Import nút Create→Update 2-app) em-main FIX; policy Suppliers.Update auto-reg Program.cs:80 verified -[!] test-specialist ≥15 test (dedup T1-T7 + publish-guard T8-T11 + list/all-or-nothing/LayoutValid) ĐANG chạy nền -[ ] reviewer adversarial + FE rebuild + commit + deploy + cicd +[x] test-specialist DONE — +19 test, **477 PASS** (458→477) + bắt BUG THẬT null-Code NRE trong NewSupplier (path R4 lõi) → em-main FIX `(r.Code??"").Trim()` + flip test → 477 xanh re-verify +[!] reviewer adversarial (dedup-OQ4 + publish-guard + authz-D3 + visibility + LayoutValid + Mig64 + null-fix + SHA-mirror) ĐANG chạy nền +[ ] reviewer về → fix must-fix → FE rebuild → BÁO anh review → commit → deploy → cicd byte-verify -next: test-specialist về → run full suite pass → reviewer → BÁO anh review → commit → deploy → cicd byte-verify -verify: BE build 0/0 CONFIRMED (em-main chạy); OQ4 open sub-point (MST-A-Code-B: BE = MST-precedence silent, FillNulls-safe không clobber — reviewer flag, anh refine sau nếu muốn conflict-error); session chết → /tiep: BE+FE code DONE trên đĩa, chỉ còn test/review/deploy -wf: test-specialist | HMW-test | ≥15-test-dedup+publish | RUNNING | resume=full-suite-pass→reviewer→deploy +next: reviewer về → xử must-fix → BÁO anh review (spec+diff) TRƯỚC deploy → commit → deploy → cicd +verify: build 0/0 + 477 test CONFIRMED em-main; null-Code bug fixed+tested; OQ4 MST-A-Code-B FillNulls-safe (reviewer đang verify); session chết → /tiep: code+test DONE đĩa, chờ reviewer verdict → deploy (KHÔNG re-implement) +wf: reviewer | HMW-review | adversarial-pre-commit-8-focus | RUNNING | resume=xử-must-fix→báo-anh→commit→deploy diff --git a/.claude/agent-memory/test-specialist/MEMORY.md b/.claude/agent-memory/test-specialist/MEMORY.md index ffa2f44..cbcf45b 100644 --- a/.claude/agent-memory/test-specialist/MEMORY.md +++ b/.claude/agent-memory/test-specialist/MEMORY.md @@ -15,7 +15,7 @@ WRITE specialist độc quyền `tests/**`. xUnit + FluentAssertions 7.2 + EF SQ - ❌ NOT: production code `src/Backend/**` + `fe-*/**` → test reveal bug → REPORT em main, KHÔNG fix - ❌ NOT: decide WHAT to test (test plan) → em main + reviewer chốt priority -## 📊 Baseline: 458 tests = 458 PASS (45 Domain + 413 Infra) as of D4 +## 📊 Baseline: 477 tests = 477 PASS (45 Domain + 432 Infra) as of S113 - Count history + verbose per-session test-design notes (S54→D2): [archive/baseline-history.md](archive/baseline-history.md) (L2, on-demand). - Latest (D2): +6 PE Mig 58 multi-winner — `CreateContractFromEvaluationMultiWinnerTests.cs` (5, 1→N HĐ per IsWinner, GiaTri per-winner=quote-total / single=legacy-budget-sum) + `PeListWinnerNamesProjectionTests.cs` (1, EF collection-projection translation-smoke). No prod bug. > Pattern S67: private-static seed/init → invoke qua REFLECTION (`GetMethod(name, NonPublic|Static)` + `Invoke(null, [db, roleManager, NullLogger.Instance])`); seed MenuItem rows TRƯỚC Permission (FK MenuKey→MenuItem.Key Cascade, SQLite Error 19 nếu thiếu). Cycle-guard test: SqliteDbFixture đủ (no User); rollup-count test cần IdentityFixture. @@ -56,6 +56,7 @@ Test theo CODE (single source truth), document mismatch header comment + report. ## 📅 Recent activity (one-line FIFO — verbose in [archive/baseline-history.md](archive/baseline-history.md)) +- **S113 (2026-07-12) Supplier import v2 dedup + publish-guard TEST-AFTER (critical-algo + security) — 458→477 PASS (+19 Infra), no-red, 🔴 1 BUG-FOUND (REPORTED em-main, NOT fixed):** 2 new files `Services/SupplierImportV2DedupTests.cs` (13) + `Application/SupplierPublishAndListTests.cs` (6). Existing S112 file UNTOUCHED (re-baked ExpectedHeaderTokens=30 \n-token → real tokens khớp → Case9 tự flip LayoutValid=true). **Dedup precedence** existing-MST→existing-Code→batch-MST→batch-Code→New: strip-ws-normalize MST-match · 2-blank-MST=2-insert (blank không index) · same-MST-batch=1-insert+fill-null-skip · **Code-backstop CI** (S112: dedup ở SERVICE OrdinalIgnoreCase, SQLite BINARY KHÔNG bắt "backstop"≈"BACKSTOP" → xanh=chứng không dựa DB) · **MST→A/Code→B = MST-precedence WINS, no silent-clobber** (FillNulls skip Code → A.Code giữ, B untouched). **Publish** `PublishSupplierCommand` (KHÔNG UpdateSupplier #73): gate D2 Publish+blank-Code→Conflict "Cần Mã NCC" · unique-exact→Conflict "đã tồn tại" (⚠️ `x.Code==newCode` DB-collation, SQLite bắt exact-case only — prod SQL CI bắt CI-dup; asymmetry vs import, observation không bug) · unpublish always. ListSuppliers Published t/f/null · GetSupplier DTO.IsPublic. **🔴 BUG:** `NewSupplier` `Code=r.Code!.Trim()` → NRE khi row.Code==NULL (path R4 nháp: parser sinh null ô rỗng + preview classify New no-error → confirm NRE → 500 CẢ batch dbCount=0). Empty ""=OK (T8/T14). Characterization test CHỐT NRE → fix null-safe thì flip NotThrow+draft. - **D4 (2026-07-12) PE sign-off A1 + EDGE-5 + opinion-history TEST-BEFORE-MERGE (critical-algo bug-fix + security) — 450→458 PASS (+8 Infra, 4 updated in-place), no-red, NO prod bug:** BE đổi `ApplyDrafterBypassOnSubmitAsync` sang **A1** trong `PeSubmitGuardAndBypassTests.cs`. **4 updated + RENAMED** (tên cũ misleading): drafter bypass CHỈ cấp NV dưới THUẦN (Order