[CLAUDE] Docs: S104 reconcile Mig 62 Supplier docs-lag
Commit 778fc98 (Mig 62 expand Supplier 9->27 field, today 16:06) shipped
BE+FE+deploy Run #488 but skipped docs closeout -> STATUS/HANDOFF stuck at
"Mig 61/S103". S104 session-start caught it: governance-detectors 1 HIGH
(STATUS Mig=61 vs disk=62) + 2 monitor (H1 patch-list D1-D4, H2 5-axis
CLEAN + investigator-harvest-in-HEAD moved-not-cut) + dotnet test 440 PASS
re-verified (#65 no-bite despite Create/UpdateSupplierCommand signature).
Reconcile (derived-flush to disk/prod ground-truth = em-main execution):
- STATUS.md: Migrations 61->62 + Mig 62 blurb; mega-line S104; Sub-agents
flip-chain +S104-Opus; In-Progress S104 (S103 collapsed <details>);
Maintenance-backlog Supplier Phase-A shipped (Phase B Excel-map defer).
- HANDOFF.md: S104 blurb + NEXT-em/NEXT-anh carry.
- ef-core-migration SKILL: description+header Mig 62 + table row 62 + Total.
- session log 2026-07-06-S104-mig62-supplier-reconcile.md.
State: Mig 62 . 89 tables . 440 test . gotcha 79 . menu 54. No prod-code;
docs/memory-only -> CI path-filter skip (#41), no deploy (Mig 62 already
shipped Run #488).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -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 61 BackfillEndedByLevelFinalizeFromChangelog, S97). 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 62 ExpandSupplierFields, S104). 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 61)
|
||||
## Migration history (số hiện tại → `docs/STATUS.md` canonical; mới nhất Mig 62)
|
||||
|
||||
| # | Name | Tables added / changed |
|
||||
|---|---|---|
|
||||
@ -81,8 +81,9 @@ when-to-use:
|
||||
| **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ờ đỏ).** |
|
||||
| **62** | **`ExpandSupplierFields`** | **🎯 S104 — Supplier 9→27 field (Phase A của 30-col NCC Excel import, anh Kiệt FDC): 18 AddColumn nullable + 18 DropColumn Down + `SupplierType +CaHai=6` append-only + enum `SupplierStatus` mới + guarded un-cram `Sql()` (clear legacy crammed Note 4 seeded rows exact-match, reversible). **No new table (89 giữ — 18 AddColumn/0 CreateTable)**. Seed fill-nulls-if-exists 30-field TRUONGGIANG/TANPHU/TGN/DONGDUONG idempotent. Commit `778fc98` shipped UN-closed-out → S104 docs-reconcile; prod-verified Run #488 PASS; 440 test #65-no-bite dù đổi chữ ký Create/UpdateSupplierCommand. Phase B (Excel-auto-map) defer.** |
|
||||
|
||||
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).
|
||||
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-62 đều AddColumn/index/data-only/schema-expand không đổi số bảng). Xem `docs/database/schema-diagram.md` migration table + §11-15 module ERD (§16+ Mig 27-62 chi tiết pending).
|
||||
|
||||
## N-stage workflow pattern (Mig 18-20 — Session 12-13)
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,36 @@
|
||||
# S104 — Session-start audit → Mig 62 Supplier docs-reconcile
|
||||
|
||||
**Date:** 2026-07-06 · **Type:** governance/docs-reconcile (0 prod-code) · **Lead:** em-main (Opus — Fable outage flip-5) · **Mode:** HMW=ON · Fable-clone
|
||||
|
||||
## TL;DR
|
||||
`/session-start` phát hiện **1 commit Mig 62 shipped nhưng bỏ closeout docs** → reconcile canonical docs + commit harvest cicd bị bỏ quên. Không có prod-code mới trong phiên này; toàn bộ là docs/memory-flush khớp disk/prod ground-truth.
|
||||
|
||||
## Phát hiện (session-start audit)
|
||||
- **governance-detectors:** 1 cờ **HIGH mới** = `STATUS Migrations=61 nhưng disk=62` (canonical-itself-stale). Còn lại 36 flag advisory (LOW derived-stale FP + 18 dangling-wikilink cosmetic + 3 MED vocab-fork đã alias-map S96). 0 CRITICAL.
|
||||
- **git log:** HEAD `778fc98 [CLAUDE] Supplier: Mig 62 expand 30-field + seed 4 NCC + FE form 2-app` (hôm nay 16:06, Opus) — nằm TRÊN closeout S103 (`6d217f7` 14:13) nhưng session đó chỉ commit code, **0 file docs/STATUS/HANDOFF**.
|
||||
|
||||
## Ground-truth (đã verify độc lập)
|
||||
- **Mig 62 `ExpandSupplierFields`** (`git show --stat 778fc98`): Supplier entity 9→27 field (18 AddColumn nullable + 18 DropColumn Down) · `SupplierType +CaHai=6` (append-only) · enum `SupplierStatus` mới · guarded un-cram `Sql()` (clear legacy crammed Note 4 seeded rows, exact-match, reversible) · **0 CreateTable → 89 bảng GIỮ NGUYÊN** · seed fill-nulls-if-exists 30-field TRUONGGIANG/TANPHU/TGN/DONGDUONG (idempotent) · DTO + Create/Update commands + validators (MaximumLength-only) + 2 query projections · FE 2-app SHA-mirror (types +18, SuppliersPage form 4-section + Status select + component `PathLink` mới tách từ PE HoSoLink, 3 NAS link). Excel upload auto-map = **Phase B (deferred)**. Tests test-after UAT-mode (deferred).
|
||||
- **`dotnet test SolutionErp.slnx`:** **440 PASS** (45 Domain + 395 Infra, 0 fail/skip) — solution compile sạch → **gotcha #65 KHÔNG cắn** (đổi chữ ký record `Create/UpdateSupplierCommand` không vỡ test call-site; validator additive-nullable).
|
||||
- **cicd Run #488 PASS** (từ harvest-curator đọc 3 file cicd memory uncommitted mtime 16:14–16:16 sau HEAD): bundle JS rotated **admin `ChSNAJBK` / user `Bn2w1znH`** (#69-meaningful real-src-diff) · sys.tables 89 unchanged · Note-un-cram count=0 · marker-grep HIT · health 200×3.
|
||||
|
||||
## 2 monitor RE-REPORT
|
||||
- **H1 tooling-auditor:** 4-mặt — ① skill PASS (Supplier commit không touch skills) ② sub-role PASS (11/11 inherit, roster khớp) ③ plugin PASS (18/15/3 unchanged, 0 new-alloc) ④ **docs-freshness = 4 drift từ Mig 62** (D1 STATUS Mig 61→62 HIGH · D2 ef-core SKILL row · D3 STATUS/HANDOFF closeout blurb · D4 STATUS:74 Supplier backlog). Xác nhận table-89/gotcha-79/test-440/menu-54 KHÔNG đổi (đúng disk).
|
||||
- **H2 harvest-curator:** 5-trục CLEAN — investigator-harvest-in-HEAD verified **moved-not-cut** (arithmetic-verified 18 AddColumn/2 Sql-guard/0 CreateTable · PathLink 2497B byte-identical 2-app · CaHai=6 append) + 3 cicd file uncommitted **commit-worthy** (DEDUP clean, #488 not-in-HEAD) + 0 orphan-delta khác + 0 orphan-run + 0-byte 0/11.
|
||||
|
||||
## Reconcile (S104)
|
||||
- `docs/STATUS.md`: Migrations row **61→62** + Mig 62 blurb · mega-line prepend S104 · Sub-agents flip-chain +S104-Opus · In-Progress → S104 (S103 collapse `<details>`) · Maintenance-backlog:74 Supplier **Phase A SHIPPED** (🟡, Phase B defer).
|
||||
- `docs/HANDOFF.md`: prepend S104 blurb + NEXT-em/NEXT-anh carry.
|
||||
- `.claude/skills/ef-core-migration/SKILL.md`: description + header Mig 61→62 + **row Mig 62** + Total note Mig 51-62/27-62.
|
||||
- **Commit A (Memory):** 3 cicd file (Run #488 harvest).
|
||||
- **Commit B (Docs):** STATUS + HANDOFF + SKILL + session log này. Cả 2 docs/memory-only → CI path-filter skip (#41), 0 deploy (Mig 62 đã deploy Run #488).
|
||||
|
||||
## State sau S104
|
||||
**Mig 62 · 89 bảng · 440 test · gotcha 79 · menu 54 · RAG 2432** · bundle prod admin `ChSNAJBK`/user `Bn2w1znH` (Run #488).
|
||||
|
||||
## NEXT
|
||||
- **em:** push S104 (chờ anh OK) · ⚠️ restart CLI nếu S103 đổi session-start/end + agents/README chưa ăn.
|
||||
- **anh (carry):** UAT **incognito** phiếu "8 MEP Sub Hệ thống solar" [fix 1-3 S97] · cho **số-phiếu/user** vụ "lỗi phân quyền vào phiếu" · duyệt **Supplier Phase B** (Excel upload auto-map) nếu làm tiếp.
|
||||
|
||||
## Lesson
|
||||
Closeout bị cắt ngang giữa "commit code" và "commit docs" = drift doc-vs-disk — session-start audit (governance-detector HIGH + 2 monitor) bắt được ngay đầu phiên kế. 3 số "khó fake" (mig/gotcha/git) = ground-truth để re-ground canonical. Reconcile = derived-flush thuần (em-main execution, khớp disk/prod, không gate) per `feedback_derived_flush_execution`.
|
||||
Reference in New Issue
Block a user