[CLAUDE] Docs: STATUS Phase 11 P11-B done — Mig 42, 91 tables, 154 test, bundle Krjvg_3j/6sNStgxa

P11-B LeaveBalance deployed + verified prod (Gitea #367). Mig 42 applied,
LeaveBalances UNIQUE+FK Restrict, /leave-balances/my 200 lazy-default 5 LeaveType.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-05-30 11:26:14 +07:00
parent 82d7fcff4d
commit efc5f5f657

View File

@ -11,30 +11,30 @@
| Metric | Value | Note | | Metric | Value | Note |
|---|---|---| |---|---|---|
| Migrations | **41** | last `WireWorkflowAppsApprovalV2` (20260530021936) | | Migrations | **42** | last `AddLeaveBalances` (20260530034336) |
| SQL tables | **~90** | +5 S42 (4 WorkflowApp LevelOpinions + WorkflowAppCodeSequences) — all verified prod | | SQL tables | **91** | +1 S43 LeaveBalances (verified prod, UNIQUE composite + FK LeaveTypes Restrict) |
| API endpoints | **~235** | +24 S42 (4 module × 6 route approval wire) | | API endpoints | **~241** | +3 S43 (leave-balances my/admin/adjust) |
| FE pages | **67** | +2 S42 WorkflowAppDetailPage (admin+user SHA256 identical) | | FE pages | **67** | WorkflowAppDetailPage (admin+user SHA256 identical) |
| Menu keys | **~53** | BE `MenuKeys` const (FE menuKeys.ts mirror 54) | | Menu keys | **~53** | BE `MenuKeys` const (FE menuKeys.ts mirror 54) |
| Tests | **144 PASS** | 58 Domain + 86 Infra · 0 fail / 0 skip · +11 ApproveV2 +3 SetWorkflow S42 | | Tests | **154 PASS** | 58 Domain + 96 Infra · 0 fail / 0 skip · +11 LeaveBalance/guard S43 |
| Gotchas | **55** | `docs/gotchas.md` (latest #54 529-fallback, #55 truncation-mid-exploration) | | Gotchas | **55** | `docs/gotchas.md` (latest #54 529-fallback, #55 truncation-mid-exploration) |
| User memory | 27 | + `MEMORY.md` index | | User memory | 27 | + `MEMORY.md` index |
| Skills | 6 | 3 domain + 3 ops | | Skills | 6 | 3 domain + 3 ops |
| Sub-agents | **7** | Opus 4.8 1M (S39 split 4→7) | | Sub-agents | **7** | Opus 4.8 1M (S39 split 4→7) |
| RAG chunks | **2406** | ✅ S41 re-bootstrap clean (3080→2406, 674 junk: node_modules+_archive now excluded; user-memory 60 chunks/10 files slug-fixed + S38-S41 indexed) | | RAG chunks | **2406** | ✅ S41 re-bootstrap clean (3080→2406, 674 junk: node_modules+_archive now excluded; user-memory 60 chunks/10 files slug-fixed + S38-S41 indexed) |
**Bundle hash live (prod):** admin `BU8FTBRi` · user `tepE4jvR` (S42 final build — P11-A + picker fix `75df04e` + ProposalCreatePage fix `e47ef1d` all deployed). Auth-verified prod: dropdown endpoint trả `{types}` đúng shape + `QT-DX-V2-001` selectable=true → ProposalCreate dropdown populated OK. **Bundle hash live (prod):** admin `Krjvg_3j` · user `6sNStgxa` (Gitea #367, S43 P11-B). Auth-verified prod: `/leave-balances/my?year=2026` → 5 LeaveType lazy-default (Used=0, remaining=entitled).
**Phase:** ✅ Phase 10 COMPLETE · 🔄 **Phase 11 IN PROGRESS** — P11-A DONE (4 WorkflowApps ApproveV2 wired+deployed) · ⬜ P11-B..F pending · 🚫 Phase 9 Ops blocked (anh main coordinate). **Phase:** ✅ Phase 10 COMPLETE · 🔄 **Phase 11 IN PROGRESS** — P11-A + P11-B DONE (deployed prod) · ⬜ P11-C..F pending · 🚫 Phase 9 Ops blocked (anh main coordinate).
> ⚠️ **Count drift fixed S40:** endpoints ~223→**211**, FE pages 53→**65**, menu keys 85→**~53**. Tables **84 confirmed correct** (DbSet 77 + Identity 7). 3 số "khó fake" (mig/gotcha/git) luôn đúng. Cause: số "incremented mỗi session" over/under-count optimistic — re-ground định kỳ. > ⚠️ **Count drift fixed S40:** endpoints ~223→**211**, FE pages 53→**65**, menu keys 85→**~53**. Tables **84 confirmed correct** (DbSet 77 + Identity 7). 3 số "khó fake" (mig/gotcha/git) luôn đúng. Cause: số "incremented mỗi session" over/under-count optimistic — re-ground định kỳ.
--- ---
## 🔥 In Progress (S42) ## 🔥 In Progress (S43)
| Task | Owner | Status | | Task | Owner | Status |
|---|---|---| |---|---|---|
| _(none — P11-A SHIPPED + verified prod. Next: P11-B..F khi anh chọn)_ | — | ✅ | | _(none — P11-A + P11-B SHIPPED + verified prod. Next: P11-C..F khi anh chọn)_ | — | ✅ |
**S40 done:** ✅ Consolidation (`d2f52ba`) · ✅ Curate 4 agent MEMORY >25KB→<8.4KB (`78c9de3`) · RAG catch-up chunk S37-S40 (rerank 0.867) · **AI_INFRA bulletin 2026-05-29 adopt 4/4** (MỤC2 Tiered Memory Policy v1 `6f08d1f` + MỤC3 /session-start+/session-end slash commands `c8ff5e1`). Full RAG re-index = AI_INFRA op (cần VOYAGE_API_KEY). **S40 done:** ✅ Consolidation (`d2f52ba`) · ✅ Curate 4 agent MEMORY >25KB→<8.4KB (`78c9de3`) · RAG catch-up chunk S37-S40 (rerank 0.867) · **AI_INFRA bulletin 2026-05-29 adopt 4/4** (MỤC2 Tiered Memory Policy v1 `6f08d1f` + MỤC3 /session-start+/session-end slash commands `c8ff5e1`). Full RAG re-index = AI_INFRA op (cần VOYAGE_API_KEY).
@ -44,6 +44,16 @@
## ✅ Recently Done (newest on top — 3 session; cũ hơn → session logs) ## ✅ Recently Done (newest on top — 3 session; cũ hơn → session logs)
### S43 (2026-05-30) — 🔄 Phase 11 P11-B: LeaveBalance business logic (trừ phép + số dư)
- **Commit `82d7fcf` Gitea #367 PASS ~4m08s, deployed prod.** 7-agent (recon BE FE test reviewer cicd), agents Max **0 bug lọt**.
- **Mig 42 `AddLeaveBalances`** (additive): `LeaveBalances` (User×LeaveType×Year + Entitled/Used/Adjustment, UNIQUE composite + FK LeaveTypes Restrict). 9091 tables.
- **Trừ phép**: hook `ApproveLeaveRequestHandler` nhánh terminal DaDuyet exactly-once (guard chặn re-approve), upsert auto-create từ `DaysPerYear`, `UsedDays += NumDays`, Year=StartDate.Year. Policy **cho phép âm + cảnh báo** (anh chốt).
- **FK invariant guard** (em Max-review thêm sau test reveal): Create + UpdateDraft validate LeaveTypeId tồn tại ConflictException (đóng cửa, tránh 500 kẹt đơn lúc deduction FK insert).
- **CQRS** `LeaveBalanceFeatures.cs`: GetMy (self lazy-merge active LeaveType) + GetUser (admin) + Adjust (admin upsert). Embed balance NGƯỜI TẠO vào leave detail (approver xem đúng).
- **FE**: `WorkflowAppDetailPage` ×2 block "Số phép" + cảnh báo vượt (kind=leave, SHA256 identical, tích hợp trang đơn nghỉ không trang riêng).
- **Test**: 144→**154** (+11 LeaveBalance/guard + repair 2 template terminal FK). Reviewer Max PASS (deduction exactly-once + FK fully closed; 2 minor defer: concurrency lost-update no-RowVersion + stale comment).
- Verified prod: Mig 42 applied, LeaveBalances UNIQUE+FK ✓, `/leave-balances/my` 200 5 LeaveType lazy-default, bundle rotate.
### S42 (2026-05-30) — 🔄 Phase 11 P11-A: wire ApproveV2 + LevelOpinions 4 WorkflowApps module ### S42 (2026-05-30) — 🔄 Phase 11 P11-A: wire ApproveV2 + LevelOpinions 4 WorkflowApps module
- **Commit `e7b66cd` (Gitea #364) + fix `75df04e` (#365) PASS, deployed prod.** Cookie-cutter mirror Proposal (Mig 38). 7-agent end-to-end (recon BE×3 FE test reviewer cicd). (Run-id "#250" memory truncated ghi sai Max re-verify reconcile #364/#365.) - **Commit `e7b66cd` (Gitea #364) + fix `75df04e` (#365) PASS, deployed prod.** Cookie-cutter mirror Proposal (Mig 38). 7-agent end-to-end (recon BE×3 FE test reviewer cicd). (Run-id "#250" memory truncated ghi sai Max re-verify reconcile #364/#365.)
- **Mig 41 `WireWorkflowAppsApprovalV2`** (additive): +4 bảng `{Leave,Ot,Travel,Vehicle}LevelOpinions` (UNIQUE composite + Cascade/Restrict) + `WorkflowAppCodeSequences` (shared atomic MaDonTu) + 4 cột `RejectedFromStatus` + enum `TravelRequest=9`. - **Mig 41 `WireWorkflowAppsApprovalV2`** (additive): +4 bảng `{Leave,Ot,Travel,Vehicle}LevelOpinions` (UNIQUE composite + Cascade/Restrict) + `WorkflowAppCodeSequences` (shared atomic MaDonTu) + 4 cột `RejectedFromStatus` + enum `TravelRequest=9`.
@ -80,7 +90,8 @@
### 🔄 Phase 11 — Polish/wire skeleton (IN PROGRESS) ### 🔄 Phase 11 — Polish/wire skeleton (IN PROGRESS)
- **P11-A** wire ApproveV2 + LevelOpinions 4 module (Leave/OT/Travel/Vehicle) **DONE S42** (Run #250, deployed prod). CodeGen MaDonTu cho 4 module ĐÃ gộp luôn (WorkflowAppCodeSequences) P11-F phần ItTicket MaTicket còn lại. - **P11-A** wire ApproveV2 + LevelOpinions 4 module (Leave/OT/Travel/Vehicle) **DONE S42** (Run #250, deployed prod). CodeGen MaDonTu cho 4 module ĐÃ gộp luôn (WorkflowAppCodeSequences) P11-F phần ItTicket MaTicket còn lại.
- **P11-B** LeaveBalance business logic (👤 cross-stack) · **P11-C** Vehicle+Driver catalog Mig 42 · **P11-D** ItTicket auto-assign + SLA timer · **P11-E** AttendanceReport + Excel + OtPolicy multiplier · **P11-F** CodeGen atomic MaTicket (MaDonTu xong S42) - **P11-B** LeaveBalance business logic **DONE S43** (Mig 42, trừ phép terminal + số + FK guard, Gitea #367 prod).
- **P11-C** Vehicle+Driver catalog Mig 43 · **P11-D** ItTicket auto-assign + SLA timer · **P11-E** AttendanceReport + Excel + OtPolicy multiplier · **P11-F** CodeGen atomic MaTicket (MaDonTu xong S42)
### 🔧 Maintenance backlog ### 🔧 Maintenance backlog
- Curate 4 agent MEMORY >25KB: investigator-codebase 35.7 / cicd-monitor 35.3 / implementer-backend 30.9 / reviewer 28.4 - Curate 4 agent MEMORY >25KB: investigator-codebase 35.7 / cicd-monitor 35.3 / implementer-backend 30.9 / reviewer 28.4