[CLAUDE] Docs+Memory: S32 Phase 9 stabilize batch — Plan A3 MEMORY curate 3 agents + Plan B-Wrap spec BW1-BW7 defer + Plan C1 ops status update
Phase 9 stabilize sequential batch S32: - Plan A2 DONE: RAG re-ingest 166 files / 2988 chunks / 75.7s. Verify gotcha #52 query rerank 0.906 (was 0.516 < 0.7 threshold). Phase 10 backlog query rerank 0.758 semantic match good. - Plan A3 DONE: MEMORY curate 3 agents OVER 25KB threshold. Implementer 38.4 -> 27.5KB (5 verbose S25-S29 entries archived q2 - Patterns 1-19 + 12-bis + 16-bis foundation preserved). Investigator 27.7 -> 19KB (4 verbose S25-S26-S29 entries archived q2). CICD Monitor 27 -> 24.2KB (Run #231 PARTIAL detail archived q2 - S29 wrap summary preserves key findings). Reviewer 24.39KB unchanged (self-curated S32 startup). Total 117.9 -> 95.7KB (-22KB ~18%). - Plan B-Wrap spec BW1-BW7 documented detailed (migration-todos D-Bis section): BW1 happy path step advance + BW2 terminal gen ma HD + BW3 skipToFinal F2 admin opt-in + BW4 ForbiddenException + BW5 ApplicableType=Contract validation (Reviewer S29 MAJOR catch) + BW6 Mig 32+33 schema persistence UNIQUE composite + BW7 V1 fallback ConflictException. Defer dedicated session ~2h chot anh main S32 (test infra IChangelogService + IContractCodeGenerator mocks first-time). - Plan C1 ops status update: backup-sql.ps1 ready (register Task Scheduler manual cmd documented). win-acme cert api.solutions.com.vn notAfter=2026-07-23 (auto-renew ~2026-06-23 NOT 2026-06-18 stale STATUS.md note). SMTP + Rotate creds BLOCKED chờ anh main coordinate. Refs: docs/STATUS.md S31 wrap. docs/HANDOFF.md S31. gotcha #52 qdrant-client search removed (RAG layer stable post-S31 fix + S32 re-ingest gotchas hit). gotcha #51 INFRASTRUCTURE vs DEMO seed (Phase 10.3 enum extend caution). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@ -534,12 +534,12 @@ User chỉ thị restructure menu PE: leaf "Thao tác" (Pe_*_Create) từ page C
|
||||
- [x] **Verify**: 2 build (fe-admin + fe-user) pass + dotnet test 83 pass mỗi chunk. Route `/new` cũ giữ tồn tại cho deep-link "Sửa header" button.
|
||||
- [x] **KHÔNG đụng** BE / migration / schema / endpoint / test count.
|
||||
|
||||
### A. Hard blockers (chờ user / ops)
|
||||
### A. Hard blockers (chờ user / ops) — Plan C1 status S32 2026-05-26
|
||||
|
||||
- [ ] UAT thật 1 tuần với 2-3 user (30 demo: 16 sample + 14 Solutions thật)
|
||||
- [ ] SMTP config → Email outbox (BLOCKED chờ user cấp host/user/pass)
|
||||
- [ ] Rotate credentials (admin + 30 demo + SA + vrapp + JWT secret + Gitea runner token)
|
||||
- [ ] Schedule SQL backup daily Task Scheduler
|
||||
- [ ] UAT thật 1 tuần với 2-3 user (30 demo: 16 sample + 14 Solutions thật) — anh main coordinate
|
||||
- [ ] **SMTP config** → Email outbox — BLOCKED chờ anh main cấp host/user/pass + appsettings.Production.json update
|
||||
- [ ] **Rotate credentials** (admin + 30 demo + SA + vrapp + JWT secret + Gitea runner token) — BLOCKED chờ anh main approve cycle plan
|
||||
- [ ] **Schedule SQL backup daily Task Scheduler** — `scripts/backup-sql.ps1` READY. Anh main register Task Scheduler trên VPS qua: `ssh vietreport-vps "Register-ScheduledTask -TaskName SolutionErpBackupDaily -Trigger (New-ScheduledTaskTrigger -Daily -At 2am) -Action (New-ScheduledTaskAction -Execute powershell.exe -Argument '-File C:\solution-erp\scripts\backup-sql.ps1 -Server .\SQLEXPRESS')"`
|
||||
|
||||
### B. PE feature gap còn lại
|
||||
|
||||
@ -560,10 +560,68 @@ User chỉ thị restructure menu PE: leaf "Thao tác" (Pe_*_Create) từ page C
|
||||
- [ ] **Phase 4** — API smoke tests (WebApplicationFactory) ~7 test
|
||||
- [ ] **Phase 5** — FE Vitest cho lib utility (queryMatches, fmtMoney) ~10 test
|
||||
|
||||
### E. Ops chưa xong
|
||||
### D-Bis. Plan B-Wrap — Contract V2 test bundle (defer dedicated session ~2h post-S32 chốt anh main)
|
||||
|
||||
- [ ] Remove binding cũ `.huypham.vn` sau verify stable
|
||||
- [ ] win-acme scheduled task fix unhealthy (cert expire 2026-06-18)
|
||||
> **Trigger:** S29 Plan B Contract V2 wire deploy prod 4 CI Runs PASS nhưng `ContractWorkflowService.ApproveV2Async` ~227 LOC NO test cover (UAT mode skip per `feedback_uat_skip_verify`). Risk gotcha #48 high (Service refactor > 100 LOC touching audit + changelog paths). Anh main chốt defer dedicated session post-Phase 9 stabilize.
|
||||
|
||||
**Test infra dependencies (NEW — chưa có precedent từ PE):**
|
||||
- ✅ `TestApplicationDbContext` SQLite existing reuse
|
||||
- ✅ `IdentityFixture` existing reuse
|
||||
- ✅ `FixedDateTime` existing reuse
|
||||
- ✅ `NoOpNotificationService` existing reuse
|
||||
- 🆕 `NoOpChangelogService` mock OR use real `ChangelogService` với TestApplicationDbContext
|
||||
- 🆕 `TestContractCodeGenerator` mock (return predetermined `HD-TEST-001`) OR real với ContractCodeSequences seeded
|
||||
- 🆕 `SeedContractAsync` helper + `SeedContractWorkflowAsync` helper + `SeedSupplierAndProjectAsync` helper
|
||||
|
||||
**File new test class:** `tests/SolutionErp.Infrastructure.Tests/Services/ContractWorkflowServiceApproveV2Tests.cs` (mirror `PurchaseEvaluationWorkflowServiceReturnModeTests.cs` structure)
|
||||
|
||||
#### BW1 — ApproveV2Async happy path step advance (Cấp 1 → Cấp 2 cùng Bước)
|
||||
|
||||
- [ ] Setup: 1 Step + 2 Levels OR-of-N + 2 approver
|
||||
- [ ] Approver Cấp 1 TransitionAsync(Approve) → expect `contract.CurrentApprovalLevelOrder = 2` + Phase giữ ChoDuyet + SlaDeadline reset 7 ngày + ContractApproval row added + ContractLevelOpinion UPSERT Comment + LogTransition `"Hoàn tất Cấp 1, sang Cấp 2 cùng Bước 1"`
|
||||
|
||||
#### BW2 — ApproveV2Async terminal (Cấp cuối Bước cuối → DaPhatHanh + gen mã HĐ)
|
||||
|
||||
- [ ] Setup: 1 Step + 1 Level + 1 approver + Supplier(`SUP-001`) + Project(`PRJ-001`)
|
||||
- [ ] Approver TransitionAsync(Approve) → expect `contract.Phase = DaPhatHanh` + `contract.MaHopDong != null` (gen via `IContractCodeGenerator.GenerateAsync`) + `contract.CurrentWorkflowStepIndex = null` + `contract.CurrentApprovalLevelOrder = null` + ContractApproval row + ContractLevelOpinion final + LogTransition transition
|
||||
|
||||
#### BW3 — ApproveV2Async skipToFinal F2 (admin opt-in `AllowApproverSkipToFinal` per slot)
|
||||
|
||||
- [ ] Setup: 3 Step × 2 Levels each + approver Cấp 1 Bước 1 với `AllowApproverSkipToFinal = true`
|
||||
- [ ] Approver Cấp 1 Bước 1 TransitionAsync(Approve, skipToFinal=true) → expect `CurrentWorkflowStepIndex = 2` (Bước cuối) + `CurrentApprovalLevelOrder = 2` (Cấp cuối) + Phase giữ ChoDuyet + LogTransition `"[Approver skip thẳng tới Bước 3 Cấp 2..."` + ContractApproval comment prefix `"[Duyệt vượt cấp tới Cấp cuối]"`
|
||||
|
||||
#### BW4 — ApproveV2Async ForbiddenException khi actor không trong pendingLevelGroup.ApproverUserId
|
||||
|
||||
- [ ] Setup: 1 Step + 2 Levels OR-of-N với approver A, B + outsider C
|
||||
- [ ] Outsider C TransitionAsync(Approve) → expect `ForbiddenException` message `"Bước 1 ... Cấp 1: bạn không có trong danh sách NV duyệt..."`
|
||||
|
||||
#### BW5 — `CreateContractCommand` ApplicableType=Contract validation (Reviewer S29 MAJOR catch)
|
||||
|
||||
- [ ] Test class mới `tests/SolutionErp.Infrastructure.Tests/Application/CreateContractCommandApplicableTypeTests.cs`
|
||||
- [ ] Setup: ApprovalWorkflow với `ApplicableType = DuyetNcc` (id=1, PE-only)
|
||||
- [ ] CreateContractCommand pin `ApprovalWorkflowId` trỏ workflow ApplicableType=1 → expect `ValidationException` `"Workflow phải ApplicableType=Contract"` (security catch — cross-module misuse)
|
||||
|
||||
#### BW6 — Mig 32+33 schema persistence test (ContractLevelOpinion UPSERT + UNIQUE composite)
|
||||
|
||||
- [ ] Test class mới `tests/SolutionErp.Infrastructure.Tests/Common/ContractV2SchemaPersistenceTests.cs`
|
||||
- [ ] Setup: 1 Contract + 1 ApprovalWorkflowLevel
|
||||
- [ ] Add 2 ContractLevelOpinion cùng (ContractId, ApprovalWorkflowLevelId) → expect `DbUpdateException` (UNIQUE composite Mig 33)
|
||||
- [ ] Update existing Opinion via UPSERT pattern → expect 1 row only (mirror ApproveV2Async line 292-316)
|
||||
- [ ] FK Cascade test: delete Contract → ContractLevelOpinions auto-deleted (Restrict on ApprovalWorkflowLevel)
|
||||
|
||||
#### BW7 — ContractWorkflowService V1 fallback skipToFinal ConflictException
|
||||
|
||||
- [ ] Setup: Contract V1 legacy (`WorkflowDefinitionId` pin, `ApprovalWorkflowId = null`)
|
||||
- [ ] Approver TransitionAsync(Approve, skipToFinal=true, isAdmin=false) → expect `ConflictException` `"skipToFinal chỉ hỗ trợ HĐ V2 (ApprovalWorkflowsV2). HĐ V1 legacy không có per-Approver-slot flag."`
|
||||
|
||||
**Bundle review:** 🟥 Reviewer pre-commit verify 7 test scenario + verify NO regression baseline 111 PASS. Post-commit 🟩 CICD Monitor verify Run PASS bundle baseline preserve.
|
||||
|
||||
**Owner allocation:** 👤 Chủ trì Solo helper methods + mock services (3 file) + 🟨 Implementer Case 2 cookie-cutter mirror PE pattern cho 7 test method skeleton (deterministic spec above) + 🟥 Reviewer pre-commit + 🟩 CICD verify.
|
||||
|
||||
### E. Ops chưa xong — Plan C1 status S32 2026-05-26
|
||||
|
||||
- [ ] **Remove binding cũ `.huypham.vn`** sau verify stable — manual cmd `ssh vietreport-vps ; cd C:\solution-erp\scripts ; .\migrate-domains.ps1 -RemoveOld -SkipCert`
|
||||
- [x] **win-acme cert status** — cert **api.solutions.com.vn** notAfter=`2026-07-23` (renewed 2026-04-24). Not urgent — auto-renewal ~2026-06-23 (30d before expire). STATUS.md note `2026-06-18` STALE (Plan F win-acme schedule task fix may have resolved silently). Re-verify auto-renew trigger date qua `ssh vietreport-vps "Get-ScheduledTask -TaskName 'win-acme*' | Select State,LastRunTime,NextRunTime"`
|
||||
|
||||
## 🔁 Skill governance (recurring)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user