wal: flush 20260717T1035

This commit is contained in:
pqhuy1987
2026-07-17 10:35:19 +07:00
parent 3ad4f2c53e
commit 38b6d196d6
6 changed files with 48 additions and 14 deletions

View File

@ -22,7 +22,7 @@
- [x] 2. lead verify + ghi `spec-pe-budget-freeze-daduyet-17-07-2026.md` (OD1 CÓ · OD2 CÓ · OD3 KHÔNG)
- [ ] 3. hmw implement Opus MAX theo spec — 3 invocation staged:
- [x] INV-A (2-task ‖, wf_d9639faa-97a, 0-garble): T0 RED thật (`Failed 1/1` found 999tr @PeBudgetFreezeTests.cs:184, prod sạch — evidence sub-test-specialist-0.md) · FE 4 file (badge amber @ "Tổng hợp ngân sách trình ký" :1352, hash mirror `5534addb` ×2, npm build ×2 PASS) · errata spec: query = GetPurchaseEvaluationQuery (bundle prop BudgetSummary)
- [ ] INV-B (1-task): implementer-backend (Domain +11 col · Config · Mig 67 3-file + backfill idempotent · PeBudgetAccumulator · ApplyBudgetSnapshotOnFinalizeAsync 4-site · display-gate BudgetFrozen · 2 terminal-guard · build slnx · T0 GREEN)
- [x] INV-B (1-task, wf_4bef08b8-730, #53 return-fail ×2): lane XONG 6 file + PeBudgetAccumulator (helper 4-site :862/:901/:934/:1109 · display-gate · 2 guard) — chết trước mig → **em-main-solo Mig 67** (scaffold 11 AddColumn sạch + backfill Sql OUTER APPLY khớp accumulator; apply 2 DB, Dev catch-up Mig 66 lag; build slnx 0/0; filter 44/44 **T0 RED→GREEN**)
- [ ] INV-C (1-task): test-specialist T1-T9 + full suite
- [ ] 4. reviewer pre-commit → commit/push → cicd verify prod

View File

@ -0,0 +1,28 @@
# sub-implementer-backend-0 — INV-B pe-budget-freeze-daduyet (S133)
Role: implementer-backend. Task: implement TOÀN BỘ BE theo SPEC ② bước 1-8. T0 test ĐÃ TỒN TẠI + RED → mục tiêu TỰ GREEN, KHÔNG sửa test.
## Anchors verified (re-grep TRƯỚC edit — line trôi nhẹ)
- Domain `PurchaseEvaluation.cs`: props end ~:112 (`EndedByLevelFinalize`). Append 11 ApprovedBudget* props.
- `PurchaseEvaluationConfiguration.cs`: precision block :24-44 (mirror ApprovedPrice*/note pattern). HasQueryFilter(!IsDeleted) :74.
- DTO `PeBudgetSummaryDto` :331-349 (17-field positional record) → append `bool BudgetFrozen = false`.
- Query handler `GetPurchaseEvaluationQueryHandler` :853; budget block :905-973 (pairRec load :911-912; peers/lũy kế :917-943; currentProposal :947-951; fullAmount :957-962; DTO ctor :964-972).
- Workflow service `PurchaseEvaluationWorkflowService.cs` (ctor `IApplicationDbContext db, IDateTime dateTime, ...`). Finalize 4 site: :861 (AllowApproverFinalize) · :899 (CCM-threshold) · :931 (all-steps) · :1053 (V1 legacy — CHỈ budget-snapshot, KHÔNG ApplyApprovedPrice). ApplyApprovedPriceOnFinalize :955.
- Guard 7a `SetPeCcmBudgetPeriodCommandHandler` PeWorkItemBudgetFeatures.cs:228 (sau load+NotFound :230-231).
- Guard 7b `AdjustPurchaseEvaluationBudgetCommandHandler` PurchaseEvaluationFeatures.cs:358 (sau load+NotFound :360-361, TRƯỚC isAdmin block :363).
- Enum: DaDuyet=7, ChoDuyet=10, TraLai=98, TuChoi=99.
- NAMING TRAP: PeWorkItemBudget.InitialAmount/AdjustmentAmount = CCM; ProInitialAmount/ProAdjustmentAmount = PRO.
## Regression scan (tests trong acceptance filter)
- PeWorkItemBudgetTests: MỌI queried-PE ở non-terminal (DangSoanThao/ChoDuyet); DaDuyet chỉ là PEER lũy kế → frozen-gate KHÔNG kích cho queried PE → live(else) branch → behavior-preserving qua accumulator. AdjustBudget tests đều DangSoanThao → guard 7b không fire.
- PeCcmBudgetPeriodSetterAuthzTests: mọi seed Phase=ChoDuyet → guard 7a không fire. (Không trong filter nhưng verify để 0 regression FULL.)
- T0 PeBudgetFreezeTests: dùng UpdatePeBudgetPro/Ccm (KHÔNG guard) → snapshot chốt 100tr/200tr, live đổi 999/888, frozen branch đọc snapshot.
## TransitionAsync KHÔNG SaveChanges nội-bộ (:537 "caller có downstream save")
→ Trong T0, snapshot flush qua UpdatePeBudgetPro/Ccm SaveChanges (shared context, pe tracked). Mirror ApprovedPrice pattern (đã proven).
## Backfill pattern (mirror Mig 61/65)
- Plain `migrationBuilder.Sql()` T-SQL, KHÔNG C# ActiveProvider guard (SQLite tests EnsureCreated no-replay = "guard" kiến-trúc). Idempotent WHERE. Down no-op cho backfill data (nhưng Down MUST DropColumn ×11 cho schema).
## Progress log
(cập nhật trong lúc làm)