diff --git a/docs/HANDOFF.md b/docs/HANDOFF.md index 82591ec..09744e5 100644 --- a/docs/HANDOFF.md +++ b/docs/HANDOFF.md @@ -1,12 +1,48 @@ # HANDOFF — Brief 5 phút cho session tiếp theo -**Last updated:** 2026-05-26 (Session 31 — **🎯 RAG v1.3 Baseline PASS + retrieval.py fix**) +**Last updated:** 2026-05-26 (Session 32 — **🎯 Phase 10 backlog Plan G + Phase 9 stabilize batch DONE**) + +**S32 (2026-05-26):** Anh main yêu cầu plan kỹ NamGroup 11 module port → SOL (NHÂN SỰ 3 + VĂN PHÒNG SỐ 6 + CÁ NHÂN 1). 4 quyết định AskUserQuestion: FULL 11 module + single schema `dbo` Mig 34-42 + reuse Workflow V2 enum +5 values + chunk per-module Plan riêng. Document Phase 10 backlog detailed migration-todos.md với 10 Plan G-* atomic (G-H1 + G-H2 / G-O1 + G-O2 / G-O3-O6 / G-H3 + G-P1). Stats target Phase 10 end: 33→42 mig, 60→85 tables, 148→250 endpoints, 38→60 FE pages, 14→18 AppRoles, 60→110 permission menu, 111→200 tests. + +**Phase 9 stabilize batch done sequential anh main "finish hết":** +- **Plan A2** ✅ RAG re-ingest 2949→2988 chunks (166 files, 75.7s). Gotcha #52 rerank 0.516→0.906 verify. +- **Plan A3** ✅ MEMORY curate 3 agents OVER 25KB: Implementer 38.4→27.5KB (Patterns 1-19+12-bis+16-bis foundation preserved, 5 verbose S25-S29 archived q2) + Investigator 27.7→19KB (4 verbose S25-S26-S29 archived q2) + CICD 27→24.2KB (Run #231 PARTIAL detail archived q2). Reviewer 24.39KB unchanged (self-curated S32 startup earlier). +- **Plan B-Wrap** ✅ Spec BW1-BW7 documented detailed migration-todos D-Bis section. Implementation **defer dedicated session ~2h** chốt 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` (not 2026-06-18 stale). SMTP + rotate creds BLOCKED chờ anh main coordinate. + +**4 commits S32 push remote (all docs-only CI skip per #41):** +1. `b832f43` Phase 10 backlog Plan G + 4 sub-agent S32 startup MEMORY entries +2. `cce0963` Phase 9 stabilize batch (Plan A3 curate + B-Wrap spec + C1 ops) +3. + 2 earlier `f938bf5` (S31 docs patch) + `1e1c9a2` (S31 RAG baseline) + +**4 sub-agent reuse-able next session via SendMessage (if tool available):** +- 🟦 Investigator `afaf6d52a6a59a844` +- 🟨 Implementer `ab23cc322b5d495c0` +- 🟥 Reviewer `a0aa13093d14f3bca` +- 🟩 CICD Monitor `a505a02d84fc1fabe` + +**⚠️ Next session S33 — Phase 10.1 G-H1 Hồ sơ NS kick off:** +1. Spawn Investigator pre-flight audit NamGroup `TblNhanVien*` 8 bảng (`D:\Dropbox\CONG_VIEC\NAMGROUP\SOURCECODE_CÔNG_TY\NAMGROUP\NAMGROUP.Server\Data\Entities\`) + map fields → SOL EmployeeProfile schema (~30 phút) +2. Em main design Mig 34 `AddEmployeeProfiles` schema (1 main + 5 satellite: WorkHistory/Education/FamilyRelation/Skill/Document) +3. Implementer Case 2 cookie-cutter BE entity scaffold 6 entity + EF Config + DbInitializer seed 30 demo profile mirror 30 users +4. Implementer Case 2 mirror PE handler BE CQRS + 6 endpoint controller +5. Implementer Case 2 cookie-cutter mirror PE FE 2 app EmployeesPage 3-panel + EmployeeDetailTabs (6 section) +6. Em main solo Permission menu `Hrm_HoSo*` + Permission Matrix seed +7. Reviewer pre-commit + CICD Monitor post-deploy verify + +**Anh main coordinate Phase 9 ops trong meantime:** +- SMTP host/user/pass → appsettings.Production.json +- Rotate creds plan approve cycle (admin + 30 demo + SA + vrapp + JWT secret + Gitea runner) +- Register Task Scheduler SQL backup `ssh vietreport-vps "Register-ScheduledTask -TaskName SolutionErpBackupDaily ..."` +- UAT 2-3 user 1 tuần + +**Last updated S31 (prev):** 2026-05-26 (Session 31 — **🎯 RAG v1.3 Baseline PASS + retrieval.py fix**) **S30 (2026-05-26):** Setup RAG Framework v1.3 governance + eval framework. Bootstrap 2949 chunks (164 files). Golden set v1.1 14 queries. Baseline v1.0=0.455 FAIL. v1.1 tentative=0.364 (MCP stale — vector broken). Commit b223466 (docs-only, CI skip). **S31 (2026-05-26):** Diagnose vector search broken: qdrant-client 1.18 removed search() → AttributeError silently swallowed. Fix retrieval.py: search()→query_points().points. Re-run eval: **recall@5=1.000 (11/11) PASS** avg_rerank=0.847. Quality gate PASS. Gotcha #52 added. STATUS/HANDOFF updated. -**⚠️ CRITICAL next session:** CLI restart required — retrieval.py fix in AI_INFRA source but MCP server still loaded old code. After CLI restart: live MCP search_memory will use fixed vector pipeline. +**⚠️ S31 CRITICAL caveat (resolved S32):** CLI restart required — retrieval.py fix in AI_INFRA source but MCP server still loaded old code. ✅ S32 confirmed live (RAG query rerank 0.906 verify gotcha #52 hit post-CLI-restart + S32 re-ingest 2988 chunks). **Last updated S29 (prev):** 2026-05-22 (Session 29 **FINAL wrap** — **🎯 2 big plans END-TO-END deployed prod: Plan CA + Plan B Contract V2**). 20 commits cumulative S29 push 4 CI Runs PASS (#229+#230 Plan CA + #231+#232 Plan B). **Plan CA Move "Cấu hình danh mục dùng chung" admin → eoffice**: 9 menu (Master + 4 leaf + Catalogs + 4 sub-catalogs) move + role mới `CatalogManager` + demo user `catalog.manager@solutions.com.vn / CatalogMgr@2026`. 5 chunks A+B+C+D+D2 + Hotfix 1 (resolvePath staticMap silent sidebar drop — anh UAT screenshot catch). **Plan B Contract V2 wire mirror PE Mig 22-26**: COEXIST V1+V2 (7 V1 contract giữ behavior). 9 chunks A1+A2+B+C+B2+E1+D+E2+E3 + Hotfix Reviewer (ApplicableType=Contract guard MAJOR security catch) + Hotfix CICD (SeedSampleContractWorkflowV2 OUT of DemoSeed gate — V2 path BLOCKED prod nếu gated — **gotcha #51 NEW INFRASTRUCTURE vs DEMO seed**). Mig 32+33 prod applied. Sample `QT-HD-V2-001` seeded post Hotfix CICD. fe-admin/fe-user bundle 4× rotate cumulative S29. **Multi-agent ROI S29 ~565K total**: Investigator 2 spawn ~40K + Implementer Case 2 5 spawn ~82K (1 stopped mid-task E3) + Reviewer 4 spawn ~355K (Smart Friend MAJOR catch 2 lần) + CICD Monitor 3 spawn ~90K (2 fail 529 transient em main fallback manual + 1 CRITICAL catch). Em main solo ~150K coordinate + Chunk B/B2 cross-stack + E3 finish + 2 hotfix re-edit. **Smart Friend pattern proven 4× cumulative S22 #44 + S25 #48 + S29 Reviewer #ApplicableType + S29 CICD #DemoSeed**. **MCP RAG tools added 4 agent definitions** (commit `b51fc94`) — search_memory + cross_project_search — anh restart CLI hot-reload S30+. **Test gate:** 111/111 PASS preserved (UAT mode skip per chunk, V2 ApproveV2Async 150 LOC NO test cover — defer test bundle Plan B Wrap session). **8 patterns NEW saved S29** (xem STATUS.md). **NEW capability prod end-to-end:** (1) Anh login Drafter fe-user → `/contracts/new?type=1` → Workspace dropdown pick `QT-HD-V2-001` → submit ChoDuyet → CCM `binh.le` approve → Service ApproveV2Async UPSERT opinion + advance → terminal gen mã HĐ + Phase=DaPhatHanh (mirror PE V2 flow). (2) Anh login `catalog.manager@solutions.com.vn / CatalogMgr@2026` → fe-user sidebar Master + 4 leaf + Catalogs + 4 sub-catalogs CRUD full. **Pending S30+**: anh UAT verify end-to-end V2 contract flow + restart CLI MCP RAG load + curate 4 MEMORY (Investigator 25.2KB + Implementer 35.4KB + Reviewer ~22KB + CICD 24.9KB — Implementer over hard threshold, dedicate curate session) + test bundle Plan B (regression test ApproveV2Async + ApplicableType validation). **Stats final S29:** 33 mig (+2) · 60 tables (+1) · ~148 endpoints (+1) · 38 FE pages · 111 test · 51 gotcha (+1 #51) · 25 memory · 6 skills · 4 sub-agents · 14 AppRoles (+1) · 34 active prod users (+1) · 7 V1 contracts + V2 ready · 4× bundle rotate.) diff --git a/docs/STATUS.md b/docs/STATUS.md index a976f49..ee05d8a 100644 --- a/docs/STATUS.md +++ b/docs/STATUS.md @@ -2,7 +2,9 @@ > **Update rule:** trước khi bắt đầu 1 task → ghi row vào `🔥 In Progress`. Xong → chuyển sang `✅ Recently Done`. -**Last updated:** 2026-05-26 (Session 31 — **🎯 RAG v1.3 Baseline PASS (11/11 recall@5=1.000) + retrieval.py critical fix**. **S30 RAG Setup:** Setup RAG Framework v1.3 governance () + evaluator spec + golden set v1.1 (14 queries) + baseline runs v1.0+v1.1 + . Bootstrap 2949 chunks (164 files — fixed Anti #24 projects.json root_path + added corpus). Commit docs-only CI skip. **S31 Eval Fix:** Discover removed method → silently returns (gotcha #52 NEW). Fix: . After fix: **recall@5 = 1.000 (11/11) PASS** (prev tentative 0.364 FAIL). Quality gate updated: baseline=1.000, avg_rerank=0.847. **Sub-agents S30/S31:** 0 spawns (docs/infra only). **Commits pushed:** (docs-only S30) — S31 pending. State: **33 mig** · 60 tables · ~148 endpoints · 38 FE pages · **111 test PASS** · **52 gotcha (+1 #52 qdrant-client search() removed)** · **25 memory user-level** · 6 skills · 4 sub-agents · **RAG v1.3 ACTIVE baseline PASS** 2949 chunks · CLI restart required for live MCP vector fix.) +**Last updated:** 2026-05-26 (Session 32 — **🎯 Phase 10 backlog Plan G NamGroup port DOCUMENTED + Phase 9 stabilize batch DONE**: 10 Plan G-* atomic sprint ~3 tháng T6-T8/2026 (4 quyết định chốt: FULL 11 module + single schema `dbo` mở rộng Mig 34-42 + reuse Workflow V2 enum +5 values + chunk per-module). **Phase 9 stabilize 4 task done sequential anh main "finish hết":** (A2) RAG re-ingest 2949→2988 chunks, gotcha #52 rerank 0.516→0.906 verify; (A3) MEMORY curate 3 agent OVER 25KB: Implementer 38.4→27.5KB + Investigator 27.7→19KB + CICD 27→24.2KB (Patterns 1-19 + 12-bis + 16-bis foundation preserved, 10 verbose archived q2); (B-Wrap) Spec BW1-BW7 ContractWorkflowService ApproveV2Async test bundle DOCUMENTED implementation defer dedicated session ~2h; (C1) Ops status updated: backup-sql.ps1 ready (Task Scheduler register manual cmd), cert api.solutions.com.vn notAfter `2026-07-23` (~2 tháng nữa expire, auto-renew ~2026-06-23), SMTP+rotate creds BLOCKED chờ anh main coordinate. **4 sub-agent reuse-able S33:** Investigator agentId `afaf6d52a6a59a844` / Implementer `ab23cc322b5d495c0` / Reviewer `a0aa13093d14f3bca` / CICD `a505a02d84fc1fabe`. **Phase 10.1 G-H1 Hồ sơ NS handover S33 kick off:** spawn Investigator pre-flight NamGroup TblNhanVien* 8 bảng audit → em main design Mig 34 (1 main + 5 satellite) → Implementer Case 2 scaffold. Stats: 33 mig · 60 tables · ~148 endpoints · **111 test PASS unchanged** · **52 gotcha** · **26 memory user-level (+1 feedback_phase10_namgroup_port)** · 6 skills · 4 sub-agents · 38520 chunks 7 projects RAG live. 4 commits S32 push remote `b832f43..cce0963` all docs-only CI skip per #41.) + +**Last updated S31 (prev):** 2026-05-26 (Session 31 — **🎯 RAG v1.3 Baseline PASS (11/11 recall@5=1.000) + retrieval.py critical fix**. **S30 RAG Setup:** Setup RAG Framework v1.3 governance () + evaluator spec + golden set v1.1 (14 queries) + baseline runs v1.0+v1.1 + . Bootstrap 2949 chunks (164 files — fixed Anti #24 projects.json root_path + added corpus). Commit docs-only CI skip. **S31 Eval Fix:** Discover removed method → silently returns (gotcha #52 NEW). Fix: . After fix: **recall@5 = 1.000 (11/11) PASS** (prev tentative 0.364 FAIL). Quality gate updated: baseline=1.000, avg_rerank=0.847. **Sub-agents S30/S31:** 0 spawns (docs/infra only). **Commits pushed:** (docs-only S30) — S31 pending. State: **33 mig** · 60 tables · ~148 endpoints · 38 FE pages · **111 test PASS** · **52 gotcha (+1 #52 qdrant-client search() removed)** · **25 memory user-level** · 6 skills · 4 sub-agents · **RAG v1.3 ACTIVE baseline PASS** 2949 chunks · CLI restart required for live MCP vector fix.) **Last updated S29 FINAL (prev):** 2026-05-22 (Session 29 — **🎯 Plan CA + Plan B Contract V2 wire ALL DEPLOYED PROD**: cumulative **20 commits push 4 CI Runs PASS** (#229 + #230 + #231 + #232). **2 big plans done end-to-end:** Plan CA Move "Cấu hình danh mục dùng chung" admin → eoffice (7 commits + Hotfix 1) + Plan B Contract V2 wire mirror PE Mig 22-26 (9 chunks + Hotfix Reviewer + Hotfix CICD). **Multi-agent ROI explosive S29:** 🟦 Investigator 2 spawn ~40K (Plan CA terrain map + Plan B V1 audit) + 🟨 Implementer Case 2 5 spawn ~82K (Plan CA Chunk B + Plan B A2/C/D + E3 stopped mid-task) + 🟥 **Reviewer 4 spawn ~355K** (Plan CA Hotfix D2 password ≥12 MAJOR catch + Plan B Hotfix ApplicableType=Contract MAJOR catch — Smart Friend pattern 4× cumulative) + 🟩 **CICD Monitor 3 spawn ~90K** (2 fail 529 transient em main fallback manual + Plan B SeedSampleContractWorkflowV2 CRITICAL DemoSeed gate catch — gotcha #51 NEW). **Patterns NEW saved S29:** (1) 9-menu permission terrain map (Investigator) (2) V1+V2 coexist boundary (Investigator) (3) reference template paths cross-module mirror PE→Contract (Investigator) (4) Pattern 12-bis cross-module entity cookie-cutter mirror (Implementer) (5) Pattern 16-bis 4-place mirror cross-app reinforced 2× (Implementer) (6) Cross-module security validation mirror Cat 3 (Reviewer) (7) INFRASTRUCTURE vs DEMO seed classification gotcha #51 (CICD) (8) Race condition em main + Implementer parallel BE → stash workaround OR sequential preferred (Implementer). **3 hotfix cumulative:** Plan CA HF1 resolvePath staticMap + Plan CA D2 password ≥12 chars + Plan B Reviewer ApplicableType=Contract + Plan B CICD SeedSampleContractWorkflowV2 ungate. **NEW capability prod:** demo user `catalog.manager@solutions.com.vn / CatalogMgr@2026` (role CatalogManager — full CRUD 9 menu Master+Catalogs) + Drafter có thể create V2 contract qua Workspace dropdown `QT-HD-V2-001` sample workflow. **MCP RAG tools added cho 4 agent definitions** (commit `b51fc94`) — anh restart CLI để hot-reload. State chốt: **33 mig (+2 Mig 32+33)** · **60 tables (+1 ContractLevelOpinions)** · **~148 endpoints (+1 V2 contract create)** · **38 FE pages (+3: 4 master moved + WorkflowMatrixView counted unchanged S24)** · **111 test PASS unchanged** (UAT mode skip per chunk + cookie-cutter mirror) · **51 gotcha (+1 #51 INFRASTRUCTURE vs DEMO seed)** · **25 memory user-level unchanged** · 6 skills · 4 sub-agents (MCP RAG added pending CLI restart) · **14 AppRoles (+1 CatalogManager)** · **34 active prod users (+1 catalog.manager)** · **7 V1 contracts pinned coexist V2** · Bundle hash 4× rotate cumulative S29 (fe-admin: `BvcWrq2z→leEMWFLU→BBADl46y` + fe-user: `Bg2FNeIz→DVBLmZlt→Dgn1iU9E→DA_VI3zO`).)