[CLAUDE] Docs: S31 RAG v1.3 baseline PASS (11/11 recall@5=1.000) + gotcha #52
All checks were successful
Deploy SOLUTION_ERP / build-deploy (push) Successful in 3m38s

- eval/runs/: baseline v1.1 final PASS after retrieval.py fix (vector search restored)
- eval/trial-state-lock.json: quality_gate.pass=true, baseline=1.000, avg_rerank=0.847
- docs/gotchas.md: +gotcha #52 qdrant-client 1.18 removed search() silent AttributeError
- docs/STATUS.md: S31 entry — RAG PASS, retrieval.py fix, CLI restart required
- docs/HANDOFF.md: S31 brief + CRITICAL CLI restart note
- docs/changelog/sessions/: S31 session log

Root cause: qdrant-client 1.18 removed search() → vec_results always [] → BM25-only
Fix: retrieval.py query_points().points (applied to AI_INFRA repo)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-05-26 13:42:04 +07:00
parent b223466ded
commit 1e1c9a2433
6 changed files with 201 additions and 14 deletions

View File

@ -1,6 +1,14 @@
# HANDOFF — Brief 5 phút cho session tiếp theo
**Last updated:** 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.)
**Last updated:** 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.
**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.)
**Last updated S28 prev:** 2026-05-22 (Session 28 **FINAL wrap****🎯 S28 cumulative t1→t6 + Layer A governance apply + 4 sub-agent flush MEMORY DONE**. Bro broadcast Layer A governance active 2026-05-22 (3-Layer distributed: A project-local active / B shared_global defer / C infrastructure anh pqhuy). **Quên rule cũ "mọi tương tác PHẢI store_memory" — ABANDONED** (em main S28 t2 over-reach self-authorize cross-project rule → caught S28 t4 → scope-down về SOLUTION_ERP self-discipline). Em main apply Layer A policy local: **4-category default** (decision/lesson/pattern-proven-≥2×/session-wrap) + skip list nguyên + 5 SOLUTION_ERP-specific adjustment + tag schema mandatory `[type, phase, bc-or-module]` + phase enum 11 (current phase-9 UAT) + BC/module 8 domain + 5 cross-cutting + optional prefix 8 + source_path convention `solution_erp/<area>/<topic>-<date>` + eval ritual weekly Friday 5 metric từ 2026-05-29 → end-trial 2026-06-05 + 10 golden query draft. **4 sub-agent flush MEMORY DONE post-S27 model:inherit fix** — Investigator (aeda4 alive) + Implementer (a2a2f spawn) + Reviewer (a9e94 spawn) + CICD Monitor (a8098 spawn) — registry hot-reload verified, Recent activity entry S28 wrap góc nhìn từng con preserved cumulative S1-S27 narrative untouched. **6 chunk stored RAG S28 t2-t6** with tags schema mandatory format. **+1 memory user-level `feedback_interaction_logging_rag.md` SCOPE-DOWN S28 t4** (lesson authority boundary + implicit consent risk). **Hit rate verify 3 query**: Plan B Contract V2 rerank 0.84 ✓ + gotcha #48 rerank 0.84/0.82 ✓ + per-NV 10-surface checklist ✓ — cumulative > 0.7 threshold pass. **State chốt S28:** 31 mig · 59 tables · ~146 endpoints · 35 FE pages · **111 test pass** · 49 gotcha · **25 memory user-level (+1)** · 6 skills · 4 sub-agents verified · **3,462 RAG chunks SOLUTION_ERP** (+6 chunk S28). **0 commit remote S28** (all local docs + memory + RAG store — anh chốt push thủ công). Plan B Contract V2 wire kick-off PRIORITY HIGH S29+ — 8-chunk pre-allocated 🟦 Investigator pre-flight audit + 🟨 Implementer Case 2 mirror PE V2 (4 chunk) + 👤 Chủ trì Solo Service ApproveV2Async + 🟥 Reviewer pre-commit Smart Friend + 🟩 CICD Monitor post-deploy Run verify. Plan AI Phase 5 distributed bootstrap 4 project khác (NamGroup/DH/Ashico/Vipix) đã DONE — total 18,532 chunks indexed cross 5 project. VIPIX hosting governance docs `D:\Dropbox\CONG_VIEC\VIPIX_MULTISITE_PROJECT\docs\governance\RAG-LAYER-A-PROJECT-LOCAL.md` v1.1 (em đọc + apply scope SOLUTION_ERP). 2-week trial monitoring 2026-05-22 → 2026-06-05 weekly Friday eval — Friday 2026-05-29 first checkpoint.)