Files
solution-erp/docs/HANDOFF.md
pqhuy1987 197c72f352 [CLAUDE] Docs: S42-S43 close-out — Phase 11 P11-A+P11-B session log + HANDOFF tier + gotcha #56
- Session log S42-S43 (P11-A WorkflowApps ApproveV2 + P11-B LeaveBalance, 8 commit chain)
- HANDOFF tiering: +S43 +S42, trim S40-S38 → session logs
- gotcha #56 CWD-drift stray memory (cd trước spawn → agent ghi nhầm fe-user/.claude, 3× S42-S43)
- STATUS gotchas 55→56
- cicd-monitor MEMORY (Run #367 P11-B verdict)

User memory: +feedback_high_to_max_multiagent_quality (High lọt 2 bug, Max 0 bug; WIRE FE
đọc reference proven + FK-invariant-at-write-doors + Max re-review cross-stack).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 12:04:34 +07:00

67 lines
5.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# HANDOFF — Brief 5 phút cho session tiếp theo
> **Tiering rule (S40):** giữ **2-3 session gần nhất**. Cũ hơn → `docs/changelog/sessions/`. Full brief history pre-S40 → `docs/_archive/HANDOFF-preS40-fullhistory.md`.
**Last updated:** 2026-05-30 (Session 42-43 — Phase 11 P11-A wire ApproveV2 4 WorkflowApps + P11-B LeaveBalance. Mig 41+42, 154 test, deployed prod #364-367)
---
## S43 (2026-05-30) — Phase 11 P11-B: LeaveBalance business logic
**Commit `82d7fcf` → Gitea #367 PASS, deployed prod.** Agents Max → 0 bug lọt.
**Done:**
- **Mig 42 `AddLeaveBalances`** — `LeaveBalances` (User×LeaveType×Year + Entitled/Used/Adjustment, UNIQUE composite + FK LeaveTypes Restrict). 90→91 tables.
- **Trừ phép** hook `ApproveLeaveRequestHandler` terminal DaDuyet — exactly-once (guard chặn re-approve), auto-create từ `DaysPerYear`, `UsedDays+=NumDays`, Year=StartDate.Year. Policy cho phép âm + cảnh báo.
- **FK invariant guard** Create+Update validate LeaveTypeId tồn tại → Conflict (đóng cửa tránh 500 kẹt đơn lúc deduction FK insert). grep xác nhận 2 write site duy nhất.
- **CQRS** GetMy/GetUser/Adjust (admin `[Authorize(Roles=Admin)]`) + embed balance NGƯỜI TẠO vào leave detail. **FE** block "Số dư phép" + cảnh báo vượt (kind=leave).
- **Test** 144→**154** (+11 + repair 2 template terminal FK). Reviewer Max PASS (exactly-once + FK fully closed; 2 minor defer: concurrency no-RowVersion + stale comment).
**Carry-over (chưa đụng):** `M BROADCAST-OUT...md` + `?? .mcp.json` (từ S40). · RAG S42-S43 chưa index (stopgap store_memory). · cicd flag: skill IIS path stale + agent-memory .md trigger CI.
**Next S44 (anh pick):** P11-C (Vehicle+Driver Mig 43) / P11-D (ItTicket SLA) / P11-E (AttendanceReport+Excel) / P11-F (MaTicket) · Phase 9 Ops · coord carry-over.
---
## S42 (2026-05-30) — Phase 11 P11-A: wire ApproveV2 + LevelOpinions 4 WorkflowApps + Max re-review fix
**4 commit `e7b66cd`+`75df04e`+`e47ef1d`+docs → #364-366 PASS.** 7-agent.
**Done:**
- **Mig 41 `WireWorkflowAppsApprovalV2`** — 4 `{Module}LevelOpinions` + `WorkflowAppCodeSequences` (atomic MaDonTu) + 4 RejectedFromStatus + enum TravelRequest=9. 84→89 tables. Cookie-cutter mirror Proposal (Mig 38).
- **BE** 30 handler + 8 route × 4 module (Leave/OT/Travel/Vehicle) + seed 4 WF. **FE** WorkflowAppDetailPage declarative 4-kind.
- **⚠️ Max re-review (agents High) bắt + fix 2 bug FE picker:** (#1) pinWorkflow PUT partial→400 (#2) fetch shape sai (copy nhầm ProposalCreatePage hỏng). Fix: dedicated `PUT /{id}/workflow` + fetch mirror PE/Contract. **Bonus** fix ProposalCreatePage latent S37 bug.
- **Test** +14 (ApproveV2 11 + SetWorkflow 3). 130→144.
**Lesson:** WIRE FE phải đọc reference proven (không đoán); Max re-review cross-stack bắt buộc (→ gotcha #56 CWD-drift + memory `feedback_high_to_max_multiagent_quality`). Detail → `docs/changelog/sessions/2026-05-30-S42-S43-phase11-p11a-p11b.md`.
---
## S41 (2026-05-29) — RAG corpus cleanup (w/ AI_INFRA)
**3 commit `282cbd0` + `e8cbbe5` + (this STATUS/HANDOFF)** — all docs/infra → CI skip. KHÔNG product code/schema.
**Done:**
-**Exclude fix** `.claude/rag.json` root-anchored → `**/`-anchored (gotcha #10: `node_modules/**`+`docs/_archive/**` không match nested path → 237 node_modules + 22 _archive junk chunks ẩn trong corpus). AI_INFRA cũng fix `find_files` dir-aware host-side (eb9634e).
-**store_memory reconcile 5/5** trước re-bootstrap (anti-data-loss). Unified at-risk rule: content phải reproducible từ file {exists ∧ matches corpus glob ∧ not excluded} — "file exists" CHƯA đủ (NAMGROUP mất 2 chunk vì .tsx ngoài glob). 3 broadcasts disk-twinned + `16a6b6db` twin-safe + `0307141b` S37-S40 catch-up **promote-to-disk** (anchor `#s37-s40-catchup` là virtual label, KHÔNG phải section thật trong STATUS.md đã tier).
-**AI_INFRA re-bootstrap** host-side `--config`: 3080→**2406** (674 junk). Verify Qdrant: node_modules=0 · _archive=0 · manual-marker=0 · user-memory 60 chunks/10 files (slug fix `D--Dropbox-CONG-VIEC-SOLUTION``-SOLUTION-ERP`) · catch-up 6 + audit-response 6.
-**SE post-verify PASS** in-session: `list_projects`=2406 live; promoted catch-up returns **file-indexed** (real heading, not `(manual)`) → twin-safety proven zero-loss.
**⚠️ CLI restart (fresh)** requested by AI_INFRA cho tag-persist (corpus đã serve live in-session).
**⏳ Standing infra backlog (AI_INFRA, non-blocking):** bootstrap glob→0 warn · auto_reindex hook fire · search_code corpus gap (src/*.cs+fe/*.tsx — v0 design call) · registry sync.
**⚠️ Concurrency carry-over (vẫn nguyên — chưa đụng):** `M docs/governance/BROADCAST-OUT-...-2026-05-29.md` (session SE thứ 2) + `?? .mcp.json` untracked. Anh main quyết.
**Next S42 (anh main pick) — FOCUS PRODUCT:** (1) Phase 11 P11-A wire ApproveV2 + LevelOpinions 4 module · (2) Test gaps (Gap1 Holiday UNIQUE CRITICAL + Gap3 gotcha #44) · (3) Phase 9 Ops (SMTP + rotate creds + UAT) · (4) coord concurrency carry-over.
---
## S40-S38 (older) → session logs
- **S40** (2026-05-29) init audit 10-mục + doc consolidation (STATUS/HANDOFF 393KB→9KB zero-loss archive) + AI_INFRA bulletin adopt 4/4 (Tiered Memory v1 + /session-start /session-end slash commands LIVE) + RAG MCP recovery (quit+relaunch FRESH). **Concurrency carry-over** (BROADCAST 2 + `.mcp.json`) bắt nguồn đây — vẫn chưa đụng (xem S43).
- **S39** (2026-05-29) infra: Opus 4.8 1M + multi-agent split 4→7 (+investigator/implementer split +test-specialist) + budget +50% + gotcha #54/#55.
- **S38** (2026-05-28) 🎊 Phase 10 COMPLETE 11/11 — Mig 39+40 skeleton combo (Đơn từ/Đặt xe/Ticket/Chấm công/Dashboard NS). ApproveV2+LevelOpinions+LeaveBalance DEFER Phase 11 (→ làm xong S42-S43).
Detail đầy đủ → `docs/changelog/sessions/` + `docs/_archive/HANDOFF-preS40-fullhistory.md`.