diff --git a/.claude/agent-memory/cicd-monitor/MEMORY.md b/.claude/agent-memory/cicd-monitor/MEMORY.md index ac95da0..53880a7 100644 --- a/.claude/agent-memory/cicd-monitor/MEMORY.md +++ b/.claude/agent-memory/cicd-monitor/MEMORY.md @@ -188,29 +188,11 @@ Bug latency observed when miss points 9-10: 2-3 days prod silent (Mig 28-29 depl - **Archived Run #231 PARTIAL detail (Plan B Contract V2 kick-off DemoSeed gap discovery) → `archive/2026-05-q2.md` 2026-05-26 S32 curate.** KEY findings preserved in S29 wrap entry above: Run #231 PASS deploy + Mig 32+33 + bundle rotate, gap = ApplicableType=3 ZERO seed (DemoSeed gate), resolved by Run #232 Hotfix CICD → gotcha #51 added. -- **2026-05-22 (S28 wrap — Layer A governance apply, NO Run S28):** Zero git push remote cả S28 (all local docs + memory + RAG store chunks) → 0 deploy event, bundle hash 2/2 unchanged Run #227 baseline, Mig 31 prod unchanged, 111 test baseline unchanged. **Timeline:** t1 startup 9-step + smoke test pass (registry hot-reload OK post-S27 model:inherit fix + 3,462 RAG chunks indexed) → t2-t4 RAG ROI verdict + over-reach mistake + scope-down → t5 Layer A governance apply. **Layer A 3 rule cụ thể:** (1) **4-category default tags mandatory** cho mọi chunk forward — CICD scope: `pattern`, `gotcha`, `session-wrap`, `cicd` + tag bổ sung `phase-9` + optional `commit:` cross-ref + `severity:p0..p3`. (2) **source_path convention** for retrieval: `solution_erp/audit/cicd--` cho per-Run audit chunks; `solution_erp/session/cicd-wrap-` cho session wrap. (3) **Weekly Friday eval ritual** starting **2026-05-29** Friday 5 metric: query/session count + hit rate (rerank ≥0.7) + store noise % + RAG vs MD ratio + Voyage embed cost/week. 10 golden query draft sẵn cross-stack scenarios: Plan B Contract V2 wire kick-off + gotcha #48 SQLite tie-break + per-NV 10-surface checklist + cookie-cutter mirror PE→Contract + controller body record param count + FE merge synthetic Policy V2 + EF backfill idempotent + Smart Friend agent eval + DemoSeed feature flag + Run #215+#216 fail-fix pair pattern. **ABANDONED rule cũ:** "mọi tương tác mandatory RAG" → wastes ~30K query overhead khi single Run verify Bash poll đủ context. **Foundation kept:** 10-surface-point per-NV checklist (S22+5 → S23 t6) vẫn promoted MEMORY foundation cho future per-NV refactor verify. **Forward S28+:** chờ catch first CICD Run đầu Plan B Contract V2 wire khi bro push commit BE/FE/Mig (Mig 32+ expected). - -- **2026-05-22 (S27 wrap-up em main proxy - hot-reload pitfall):** NO Run triggered S27 (zero git push remote - all changes local docs + scripts + memory curate). 0 deploy event to monitor. **Meta-discovery em main S27:** Sub-agent registry KHÔNG load trong session active vì 4 file `.claude/agents/*.md` dùng `model: claude-opus-4-7` (200K) + non-standard `effort: max` field → CLI silent reject per VIPIX pitfall #2. Em main solo cả S27 KHÔNG có lựa chọn delegate. Fix applied: 4 file → `model: inherit` + remove `effort: max`. **Pending:** Anh restart Claude Code CLI để hot-reload (pitfall #1 - edit file disk KHÔNG hot-reload session đang chạy). Sau restart, S28+ next push sẽ có CICD Monitor spawn trở lại normal cycle. Pattern reinforced: SESSION START PROTOCOL MUST spawn test agent trước khi assume registry loaded. - -- **2026-05-22 (Curate session em main):** Archived Run #186 → Run #221 verbose entries (14 runs S21 t3 → S25 Plan AF) → `archive/2026-05-runs.md`. KEEP: Run #215+#216 (gotcha #48 fail+fix pair lesson critical) + Run #222-#227 S26 summary + setup baseline. Memory size before: ~72KB → after: ~25-28KB target. Cumulative 8 patterns extracted vào archive header + 10-surface-point per-NV checklist promoted to foundation section above. +- **Archived to `archive/2026-05-q3.md` 2026-05-27 S34 curate (em main proxy):** S28 wrap Layer A governance apply (NO Run, governance only — tag schema absorbed forward) + S27 wrap-up hot-reload pitfall (model:inherit fix, registry hot-reload lesson preserved in foundation) + 2026-05-22 Curate session note (Run #186-#221 → `archive/2026-05-runs.md`). KEY pattern absorbed forward: SESSION START PROTOCOL MUST spawn test agent trước khi assume registry loaded. - **2026-05-21 (S26 Run #222-#227 cumulative — Plan AG series PE List tree view UI iteration):** Hybrid verify pattern: CICD Monitor spawn 1× cho Phase wire initial Run #222 sha=`0bf6c7e` Plan AG (~12K — bundle hash 2/2 rotate admin `C8TvDy7r→CWHIdoFo` + user `BvcWrq2z→Bg2FNeIz`, smoke 5/5 200, PE List API shape preserved 9 fields, test gate 111 unchanged, Mig 31 unchanged). Run #223-#227 polish chunks Plan AG2-AG6 em main self-verify (bundle visual check + git push success + Gitea auto-trigger 3-4min deploy). Plan AG4 BE+FE cross-stack (DTO +4 fields DrafterUserId/DrafterName/DepartmentId/DepartmentName + 3 projection JOIN Users+Departments): dotnet test 111/111 PASS local pre-push. **Pattern saved:** CICD Monitor spawn 1× đầu Phase wire ROI tốt cho 1 dev solo iteration scenario. Polish chunks (CSS/UX/copy) cùng Plan em main self-verify thay vì re-spawn ~150K × N wasteful. 0 prod regression observed cumulative S26. -- **2026-05-19 10:13-10:21 — Run #215 FAIL → Run #216 PASS (gotcha #48 SQLite tie-break catch+fix pair, KEEP for crucial lesson):** - - **Run #215** id=329 sha=`cdfd542` VERDICT=FAIL (S25 t1 Plan AB Chunk A — Changelog visibility fix Bug 1 Budget Adjust + Bug 2 Return Mode). Push range `e23f51c..cdfd542` 1 commit 3 files (1 BE `PurchaseEvaluationWorkflowService.cs` +207/-95 LOC refactor `ApplyReturnModeAsync` + 2 FE `PeDetailTabs.tsx` mirror filter extend). Duration 1m06s (early test gate fail, deploy stage never reached). **CRITICAL — Test gate FAIL at test_infra:** 51/53 passed, 2 FAIL same root cause: - - `PurchaseEvaluationWorkflowServiceReturnModeTests.ApplyReturnMode_OneStep_AtStep1_ResetsToBuoc1Cap1_KeepsChoDuyet` - - `PurchaseEvaluationWorkflowServiceReturnModeTests.ApplyReturnMode_OneLevel_AtStep1Level1_ResetsToBuoc1Cap1_KeepsChoDuyet` - - **Error:** `Expected changelog.ContextNote not to be ` - - **Root cause:** Plan AB Chunk A `ApplyReturnModeAsync` adds NEW Changelog entry at end (line 403-412) for Bug 2 visibility — `EntityType=Workflow + Action=Update + Summary` (NO ContextNote field). After refactor, BOTH ApplyReturnModeAsync (new entry, no ContextNote) AND LogTransitionAsync (line 100, existing entry with ContextNote=comment) are added in same `SaveChangesAsync` transaction. Test fetches `.OrderByDescending(c => c.CreatedAt).FirstAsync()` — with SQLite + frozen test clock both entries get SAME CreatedAt, OrderByDescending tie-break returns Plan AB's Workflow entry (without ContextNote) instead of Transition entry. - - **Deploy NOT shipped:** Bundle hashes unchanged from Run #214 Plan AA baseline. Mig 31 TOP 1 unchanged. Plan AB Bug 1+Bug 2 fix NOT live (bro UAT screenshot pre-deploy stale). - - **Side benefit:** CI test gate caught BEFORE prod deploy — bro UAT spared broken Plan M edge case audit trail. - - **Run #216** id=330 sha=`8c05947` VERDICT=PASS (S25 t2 Plan AB Chunk A2 fix). Tip commit Chunk A2: 1 test file +7/-2 LOC — 2 Plan M edge case tests add `.Where(c => c.Summary!.Contains("Chuyển phase"))` filter trước `OrderByDescending(CreatedAt).First()` để pick LogTransition entry (chứa ContextNote) thay vì Plan AB new Changelog entry. Plan AB Chunk A code `cdfd542` KHÔNG bị revert — Bug 1+Bug 2 fix giữ nguyên. Test gate PASS: test_domain 58/58 + test_infra 53/53 (2 Plan M tests now PASS — verified live). Bundle hash 2/2 rotated. Bug 1 Budget Adjust entry LIVE + Bug 2 Return Mode entries LIVE on PE c6e9. 8 min turnaround 10:13 fail → 10:21 fix. **Demonstrates test-after UAT mode CAN tolerate edge case bug if next chunk lands within minutes — but Plan AB > 100 LOC BE refactor should have local `dotnet test` verify pre-push (UAT skip-test rule risky for refactor scope).** - -- **2026-05-13 23:25 — Verify S22 chốt cuối cumulative** (push range `3d725c4..cc8a7d3` 12 commits VERDICT=PASS — S22+1-S22+5 Plan C/D/E + Mig 30 F4 per-NV Approver edit Budget). 33 active users prod confirmed. Bundle hash rotated 2/2. 104/104 test (+1 từ S21 baseline 103). Mig 30 prod confirmed. **Discovery #3 first surfaced:** `cc8a7d3` docs+4 agent MEMORY.md → CI SKIPPED via `**/*.md` glob (all match — `.md` files at any depth match). Spec hypothesis "`.claude/agent-memory/**` NOT in paths-ignore → trigger CI" disproven for this commit. Gotcha #47 still useful as PREVENTIVE for future non-.md state files under `.claude/agent-memory/`. - -- **2026-05-12 (setup):** CI/CD Monitor agent initialized. Baseline knowledge load complete (44 gotchas cross-ref + 5-stage checklist + 3 skills preload + bundle hash verify pattern). No runs monitored yet. +- **Archived to `archive/2026-05-q3.md` 2026-05-27 S34 curate (em main proxy):** Run #215+#216 (gotcha #48 SQLite tie-break catch+fix pair, S25 t1-t2) — full detail preserved in archive. KEY lesson cumulative trong foundation gotcha #48 line 40-45 (test discriminator filter Summary contains "Chuyển phase"). 2026-05-13 S22 chốt cuối verify (Run #214 baseline + Discovery #3 docs-only skip). 2026-05-12 setup baseline. --- @@ -220,4 +202,4 @@ Bug latency observed when miss points 9-10: 2-3 days prod silent (Mig 28-29 depl - Duplicate failure patterns → merge into single entry (vd act_runner timeout x3 → 1 entry) - Stale > 3 months → remove -**Last curate: 2026-05-26 S32 em main proxy curate** (post-S31 RAG fix) — archived 1 verbose Run #231 PARTIAL detail → `archive/2026-05-q2.md`. KEEP in MEMORY: S32 startup, S29 wrap summary (Run #229-#232 cumulative), S28 Layer A governance, S27 hot-reload pitfall, S22 curate, Run #215+#216 pair gotcha #48 critical, S26 Run #222-#227 summary, 2026-05-12 setup. Foundation 10-surface-point per-NV checklist + Stage 0-5 checklist + Discovery #6 INFRASTRUCTURE vs DEMO seed (Stage 4.6) preserved. MEMORY size before: 27 KB → after: ~24 KB. **Previous curate: 2026-05-22** — archived 14 verbose Run #186-#221 → `archive/2026-05-runs.md`. Next trigger: > 25KB OR Plan G-H1 kick off. +**Last curate: 2026-05-27 S34 em main proxy curate** (post-S33 wrap, sequence 1/4) — archived Run #215+#216 verbose detail (gotcha #48 catch+fix pair, KEY lesson preserved in foundation line 40-45) + 2026-05-13 S22 verify + 2026-05-12 setup → `archive/2026-05-q3.md`. KEEP in MEMORY: Run #237 + Run #350 (S33 prod deploy), S33 startup health, S32 wrap + S32 startup, S29 wrap, S28 wrap, S26 Run #222-#227, S22 curate. Foundation 10-surface-point per-NV checklist + Stage 0-5 checklist + Stage 4.6 sqlcmd seed verify + Discovery #6 INFRASTRUCTURE vs DEMO seed + gotchas #39-#48 detail all preserved untouched. MEMORY size before: 32.9 KB → after: target ~22-24 KB. **Previous curate: 2026-05-26 S32** — Run #231 PARTIAL detail → `archive/2026-05-q2.md`. **Previous curate: 2026-05-22** — Run #186-#221 → `archive/2026-05-runs.md`. Next trigger: > 25KB OR Plan G-O1 Danh bạ kick off. diff --git a/.claude/agent-memory/cicd-monitor/archive/2026-05-q3.md b/.claude/agent-memory/cicd-monitor/archive/2026-05-q3.md new file mode 100644 index 0000000..8fd7397 --- /dev/null +++ b/.claude/agent-memory/cicd-monitor/archive/2026-05-q3.md @@ -0,0 +1,30 @@ +# CI/CD Monitor — Archive Q3 2026-05 (S34 curate) + +> Verbose Recent runs archived from MEMORY.md S34 init (em main proxy curate 2026-05-27). +> Foundation gotchas #39-#52 + 5-stage checklist + 10-surface-point per-NV + Stage 4.6 sqlcmd seed verify preserved untouched in MEMORY.md. + +--- + +## Run #215 FAIL → Run #216 PASS (gotcha #48 SQLite tie-break catch+fix pair) — 2026-05-19 S25 t1-t2 + +**Run #215** id=329 sha=`cdfd542` VERDICT=FAIL (S25 t1 Plan AB Chunk A — Changelog visibility fix Bug 1 Budget Adjust + Bug 2 Return Mode). Push range `e23f51c..cdfd542` 1 commit 3 files (1 BE `PurchaseEvaluationWorkflowService.cs` +207/-95 LOC refactor `ApplyReturnModeAsync` + 2 FE `PeDetailTabs.tsx` mirror filter extend). Duration 1m06s (early test gate fail, deploy stage never reached). **CRITICAL — Test gate FAIL at test_infra:** 51/53 passed, 2 FAIL same root cause: +- `PurchaseEvaluationWorkflowServiceReturnModeTests.ApplyReturnMode_OneStep_AtStep1_ResetsToBuoc1Cap1_KeepsChoDuyet` +- `PurchaseEvaluationWorkflowServiceReturnModeTests.ApplyReturnMode_OneLevel_AtStep1Level1_ResetsToBuoc1Cap1_KeepsChoDuyet` +- **Error:** `Expected changelog.ContextNote not to be ` +- **Root cause:** Plan AB Chunk A `ApplyReturnModeAsync` adds NEW Changelog entry at end (line 403-412) for Bug 2 visibility — `EntityType=Workflow + Action=Update + Summary` (NO ContextNote field). After refactor, BOTH ApplyReturnModeAsync (new entry, no ContextNote) AND LogTransitionAsync (line 100, existing entry with ContextNote=comment) are added in same `SaveChangesAsync` transaction. Test fetches `.OrderByDescending(c => c.CreatedAt).FirstAsync()` — with SQLite + frozen test clock both entries get SAME CreatedAt, OrderByDescending tie-break returns Plan AB's Workflow entry (without ContextNote) instead of Transition entry. +- **Deploy NOT shipped:** Bundle hashes unchanged from Run #214 Plan AA baseline. Mig 31 TOP 1 unchanged. Plan AB Bug 1+Bug 2 fix NOT live (bro UAT screenshot pre-deploy stale). +- **Side benefit:** CI test gate caught BEFORE prod deploy — bro UAT spared broken Plan M edge case audit trail. + +**Run #216** id=330 sha=`8c05947` VERDICT=PASS (S25 t2 Plan AB Chunk A2 fix). Tip commit Chunk A2: 1 test file +7/-2 LOC — 2 Plan M edge case tests add `.Where(c => c.Summary!.Contains("Chuyển phase"))` filter trước `OrderByDescending(CreatedAt).First()` để pick LogTransition entry (chứa ContextNote) thay vì Plan AB new Changelog entry. Plan AB Chunk A code `cdfd542` KHÔNG bị revert — Bug 1+Bug 2 fix giữ nguyên. Test gate PASS: test_domain 58/58 + test_infra 53/53 (2 Plan M tests now PASS — verified live). Bundle hash 2/2 rotated. Bug 1 Budget Adjust entry LIVE + Bug 2 Return Mode entries LIVE on PE c6e9. 8 min turnaround 10:13 fail → 10:21 fix. **Demonstrates test-after UAT mode CAN tolerate edge case bug if next chunk lands within minutes — but Plan AB > 100 LOC BE refactor should have local `dotnet test` verify pre-push (UAT skip-test rule risky for refactor scope).** + +--- + +## 2026-05-13 23:25 — Verify S22 chốt cuối cumulative + +Verify S22 chốt cuối cumulative (push range `3d725c4..cc8a7d3` 12 commits VERDICT=PASS — S22+1-S22+5 Plan C/D/E + Mig 30 F4 per-NV Approver edit Budget). 33 active users prod confirmed. Bundle hash rotated 2/2. 104/104 test (+1 từ S21 baseline 103). Mig 30 prod confirmed. **Discovery #3 first surfaced:** `cc8a7d3` docs+4 agent MEMORY.md → CI SKIPPED via `**/*.md` glob (all match — `.md` files at any depth match). Spec hypothesis "`.claude/agent-memory/**` NOT in paths-ignore → trigger CI" disproven for this commit. Gotcha #47 still useful as PREVENTIVE for future non-.md state files under `.claude/agent-memory/`. + +--- + +## 2026-05-12 — Setup baseline + +CI/CD Monitor agent initialized. Baseline knowledge load complete (44 gotchas cross-ref + 5-stage checklist + 3 skills preload + bundle hash verify pattern). No runs monitored yet. diff --git a/.claude/agent-memory/implementer/MEMORY.md b/.claude/agent-memory/implementer/MEMORY.md index 1226cc2..fb08114 100644 --- a/.claude/agent-memory/implementer/MEMORY.md +++ b/.claude/agent-memory/implementer/MEMORY.md @@ -330,30 +330,9 @@ KHÔNG `*` / `latest`. Critical pins: - **2026-05-26 (S32 startup — context verify + RAG live confirm + size FLAG > 25KB):** Em chủ trì spawn em verify Session 32 context. **Verify done:** (1) MEMORY size 36.2KB (Get-Item Length=36207 bytes) — **OVER 25KB threshold ~45% bigger** → FLAG cho em main schedule dedicated curate session per Pattern curate trigger rule line 364. KHÔNG self-curate vì em chủ trì preference reserve cho em main solo judgment call §6.5 KEEP vs CUT (S27 retrospective C1-C4 task lesson). (2) Patterns saved 1-12 foundation + 12-bis NEW S29 + 13-15 + 16-bis NEW S29 + 17-19 — total **17 numbered patterns** (Pattern 16 baseline implied trong recent activity S27 chưa numbered explicit). Pattern 12-bis (cross-module entity cookie-cutter mirror PE→Contract Mig 33) **SAVED line 178-200** confirmed present. Pattern 16-bis (4-place mirror cross-app S29 Plan CA Hotfix 1) **SAVED line 165-176** confirmed present. (3) MCP RAG tools **PRESENT** — `mcp__rag-unified__search_memory` + `mcp__rag-unified__cross_project_search` both visible trong tools list. Test query "Pattern 12-bis cross-module entity cookie-cutter mirror PE Contract V2" top_k=3 returned 3 results với rerank scores **0.824/0.801/0.793** — all healthy > 0.7 threshold. S31 RAG v1.3 baseline PASS confirmed live post CLI restart. **Pending tasks em main có thể gọi em lại spawn S32+:** (a) Plan B-Wrap BW1-BW7 test bundle codegen Case 2 cookie-cutter mirror PE WorkflowService test pattern (regression ApproveV2Async + UPSERT LevelOpinions test) — 7 file new test class mirror PE test bundle structure; (b) ContractWorkflowMatrixView mirror PE WorkflowMatrixView Plan AA S24 (1 page mirror cross-module — Case 2 fits Pattern 13 read-only admin Designer mirror + Pattern 14 Tailwind JIT palette + Pattern 15 HTML table rowSpan iteration helper). **Decision tree forward:** Em chủ trì gọi em với task code edit → em ACCEPT case (a)/(b) khi spec deterministic, REFUSE nếu first-time pattern. Em chủ trì confirm Layer A governance still active scope SOLUTION_ERP. Token cost spawn này ~5k (3 Read + 1 RAG query + 1 Edit + final report). KHÔNG curate — defer em main full curate session. Tag: `[verify, phase-9, infra]`. -- **2026-05-22 (S29 wrap — Plan CA Chunk B + Plan B 4 chunks Case 2 cookie-cutter + 1 stopped E3 + Pattern 12-bis NEW):** Implementer = busiest agent S29 với 5 spawn total. **Plan CA Chunk B (~10K):** 4 master pages mirror fe-admin→fe-user byte-identical SHA256, touch 6 file (4 page + App.tsx +5 route + menuKeys.ts +5 key Catalogs*), 948 LOC mirror PASS 0 TS err. Saved `pattern_master_page_mirror.md`. **Plan B 4 spawn cumulative:** (A2 Mig 32 ~25K) schema +column FK Restrict IX + Configuration + DbInitializer SeedSampleContractWorkflowV2 — **stash em main WIP ContractWorkflowService.cs** để build verify clean (em main + Implementer parallel touch BE → race condition trick); (C Mig 33 ContractLevelOpinions ~25K) entity + Mig + Config + DbSet + Contract.cs +LevelOpinions nav — **Pattern 12-bis NEW cross-module entity cookie-cutter mirror PE→Contract** scaffold 4-file pattern documented Patterns section; (D FE Workspace V2 ~12K) ContractCreatePage × 2 app +useQuery V2 + Select dropdown wire ApprovalWorkflowId, 88 LOC mirror byte-similar; (E3 stopped mid-task) FE Section 5 V2 STOPPED at "check ContractDetail type" judgment call → em main solo finish. **Lessons:** (1) **Race condition em main + Implementer parallel BE** → stash trick works but adds overhead. Forward SEQUENTIAL chunks A→B→C khi cùng touch BE, NOT parallel. (2) **Complex FE feature mirror với type extend + new component** → em main solo more reliable than Implementer khi spec ambiguity > 20% in Read-required component inspection. (3) Pattern 16-bis 4-place mirror cross-app reinforced 2× (Plan CA Chunk B + Plan B Chunk D) — verify Layout staticMap khi page move/route enhance. **Patterns proven NEW S29:** Pattern 12-bis cross-module entity scaffold + Pattern 16-bis 4-place mirror reinforced. **Anti-pattern observed:** (a) Implementer E3 stopped mid-task FE complex judgment — em main miss provide concrete component template trong prompt. (b) Race condition parallel BE → stash workaround. Tag: `[pattern, phase-9, frontend+infra]`. KHÔNG curate (33.2KB OK borderline > 25KB threshold but close — defer to next session em main full curate khi S30 wrap). +- **Archived to `archive/2026-05-q3.md` 2026-05-27 S34 curate (em main proxy):** S29 wrap (5-spawn Plan CA + Plan B 4 chunks + E3 stopped + Pattern 12-bis NEW) + S28 wrap (Layer A governance perspective Implementer) + S27 wrap retrospective REFUSE analysis (8 task ACCEPT/REFUSE table + Pattern 20 5 PS scripts mirror) + 2026-05-22 curate session note + 2026-05-11 setup baseline. KEY takeaways absorbed in current entries S33+S32 + Patterns 1-15+12-bis+16-bis foundation section line 26-283. -- **5 verbose entries S25-S29 archived to `archive/2026-05-q2.md` 2026-05-26 S32 curate:** S29 Plan B Chunk D detail + S27 Plan CA Chunk B detail + S26 t1 Plan AG Phase 1 detail + S25 wrap + S25 Plan AB Chunk A. KEY takeaways preserved in S29 wrap entry above. Patterns 16-19 NEW S25-S26 reference foundation section line 165-283. - -- **2026-05-22 (S28 wrap — Layer A governance distributed active, Implementer policy local apply):** S28 em main solo cả buổi (KHÔNG Implementer work code thực sự). Timeline: t1 RAG ROI verdict marginal-short/transform-long → t2 bro feedback "ghi mọi tương tác" → t3 em đề xuất 2-week monitoring 5 metric → t4 bro caught self-authorize cross-project rule mistake → t5 governance broadcast Layer A active 3-Layer distributed scope-down về SOLUTION_ERP self-discipline. **Implementer perspective về Layer A governance:** (1) Pattern proven ≥ 2× qualifies Layer B nominate. **Pattern 7 per-NV admin opt-in flag (Mig 29 AllowDrafterEdit + Mig 30 AllowApproverEditSection1 + Mig 31 AllowEarlyApprove + AllowDelegate) đã proven 4× — strong candidate Layer B promote khi unfreeze.** (2) Tag schema mandatory áp dụng forward: store Pattern chunk với format `[pattern, phase-, ]` — vd Pattern 19 HTML details tree view → `[pattern, phase-9, frontend]`; Pattern 18 FE userMap fallback → `[pattern, phase-9, frontend]`; Pattern 16 preventive batch fix → `[pattern, phase-9, cross-cutting]`. (3) source_path convention: `solution_erp/pattern/-` — vd `solution_erp/pattern/tailwind-jit-palette-2026-05-19` cho Pattern 14, `solution_erp/pattern/per-nv-flag-2026-05-15` cho Pattern 7. (4) **KHÔNG self-authorize cross-project rule (lesson S28 t4)** — distributed governance respects boundary, Implementer agent KHÔNG override Layer A scope cho cross-project (vd "NamGroup follow SOLUTION_ERP Pattern 19" → REFUSE cross-project assertion, route lên Layer B human review). (5) Quên rule cũ "mọi tương tác mandatory store" — **ABANDONED** (was self-authorize over-reach). Forward S28+ commit: Implementer apply tag schema `[type, phase, bc-or-module]` mandatory cho mỗi Pattern entry mới + scope discipline strict SOLUTION_ERP only + KHÔNG cross-project rule assertion + 4-category default (pattern/architecture/decision/gotcha) + skip list (ephemeral, code, log) + 11 phase enum (phase-9 UAT ACTIVE) + 8 BC + 5 cross-cutting + optional prefix. - -- **2026-05-22 (S27 wrap-up em main proxy - retrospective REFUSE analysis):** Em main S27 SOLO cả buổi vì registry KHÔNG load (per pitfall VIPIX #1+#2). Retrospective analysis 6 task S27 vs ACCEPT/REFUSE criteria: - - | Task S27 | Implementer fit? | Verdict | - |---|---|---| - | C1 Curate cicd-monitor 72KB | ❌ REFUSE #1 (judgment §6.5 KEEP vs CUT) | Em main solo CORRECT | - | C2-C4 Curate 3 agent MEMORY | ❌ REFUSE #1 same | Em main solo CORRECT | - | C5 Audit drift §6.4 + §9.4 | ❌ REFUSE #1 same | Em main solo CORRECT | - | A3.1 Write 5 PS scripts | ✅ ACCEPT Case 2 (5 file cookie-cutter mirror pattern) | **Implementer would ACCEPT** - em main miss delegate opportunity | - | A3.2 Dashboard HTML + generator | ❌ REFUSE #7 (first time pattern, no precedent) + #2 UX design needed | Em main solo CORRECT | - | A4 rag-onboarding-guide.md 421 lines | ❌ REFUSE #2 (docs writing judgment) | Em main solo CORRECT | - | F1 Qdrant Web UI fix | ❌ REFUSE #4 (bug reasoning chain) | Em main solo CORRECT | - | F2 4 agent files fix model:inherit | ✅ ACCEPT Case 1 (4 file mechanical same edit) | **Implementer would ACCEPT** - em main miss delegate opportunity | - - **Verdict: 2/8 task lẽ ra delegate được Implementer (Case 1+2) nhưng registry empty → em main forced solo.** Net loss ~30 phút time + miss cookie-cutter mirror discipline. Pattern 20 NEW saved foundation: "**5 PS scripts mirror pattern** — start/stop/status/dashboard/boot family cùng ASCII discipline + same Write-Host structure + same try-catch pattern" reusable cho future infra automation. **Pending post-restart CLI S28+:** Implementer Case 2 spawn cho any mass file mechanical refactor. - -- **2026-05-22 (Curate session em main):** Archived 12 verbose Recent activity entries S21 t3 → S24 Plan AA → `archive/2026-05-q1.md`. KEEP: S26 Plan AG (Pattern 19 NEW), S25 wrap (Patterns 16-18 NEW), S25 Plan AB, setup baseline. Patterns 1-19 foundation section preserved. Memory size before: 38.8 KB → after: target ~22-24 KB. - -- **2026-05-11 (setup):** Implementer agent initialized. Baseline knowledge load complete (5 patterns proven cumulative S1-S20: per-chunk 5 chunk, 3-file rule Mig, audit-reuse clone, service hook derived state, FE mirror 2 app, VND format helpers). No implementations performed yet. Awaiting first SendMessage from em main. Strict scope auto-refuse criteria active. +- **5 verbose entries S25-S29 archived to `archive/2026-05-q2.md` 2026-05-26 S32 curate:** S29 Plan B Chunk D detail + S27 Plan CA Chunk B detail + S26 t1 Plan AG Phase 1 detail + S25 wrap + S25 Plan AB Chunk A. KEY takeaways preserved trong S33+S32 wrap entries. Patterns 16-19 NEW S25-S26 reference foundation section line 165-283. --- @@ -363,4 +342,4 @@ KHÔNG `*` / `latest`. Critical pins: - Duplicate entries detected → merge - Stale > 3 months → remove -**Last curate: 2026-05-26 S32 em main proxy curate** (post-S31 RAG fix) — archived 5 verbose entries (S25 Plan AB → S29 Plan B Chunk D detail + S27 Plan CA Chunk B detail + S26 Plan AG) → `archive/2026-05-q2.md`. KEEP: S32 startup (latest), S29 wrap (5-spawn summary cumulative), S28 Layer A governance, S27 retrospective REFUSE analysis, S22 curate session lesson, S11 setup baseline. Patterns 1-19 + 12-bis + 16-bis foundation section preserved untouched. MEMORY size before: 38.4 KB → after: target ~21 KB. Per `feedback_md_compact_narrative.md` §6.5 — archive preserves full verbose entries cho cross-session audit retrieve. **Previous curate: 2026-05-22** — archived 12 verbose (S21 t3 → S24 Plan AA) → `archive/2026-05-q1.md`. Next trigger: > 25KB OR Plan G-H1 kick off. +**Last curate: 2026-05-27 S34 em main proxy curate** (post-S33 wrap, sequence 1/4) — archived 5 verbose entries (S29 wrap + S28 wrap + S27 wrap REFUSE analysis + S22 curate session note + S11 setup) → `archive/2026-05-q3.md`. KEEP: S33 Task 5 (latest cookie-cutter cross-app mirror Plan B G-H1), S32 wrap (Plan G 11 module backlog), S32 startup (size FLAG + RAG verify). Patterns 1-15 + 12-bis + 16-bis foundation section line 26-283 preserved untouched. MEMORY size before: 30.5 KB → after: target ~18-20 KB. Per `feedback_md_compact_narrative.md` §6.5 — archive preserves full verbose entries cho cross-session audit retrieve. **Previous curate: 2026-05-26 S32** — 5 verbose S25-S29 → `archive/2026-05-q2.md`. **Previous curate: 2026-05-22** — 12 verbose S21 t3 → S24 Plan AA → `archive/2026-05-q1.md`. Next trigger: > 25KB OR Plan G-O1 Danh bạ kick off. diff --git a/.claude/agent-memory/implementer/archive/2026-05-q3.md b/.claude/agent-memory/implementer/archive/2026-05-q3.md new file mode 100644 index 0000000..6037c34 --- /dev/null +++ b/.claude/agent-memory/implementer/archive/2026-05-q3.md @@ -0,0 +1,47 @@ +# Implementer — Archive Q3 2026-05 (S34 curate) + +> Verbose Recent activity entries archived from MEMORY.md S34 init (em main proxy curate 2026-05-27). +> Patterns 1-15 + 12-bis + 16-bis foundation section preserved untouched in MEMORY.md. + +--- + +## 2026-05-22 — S29 wrap Plan CA Chunk B + Plan B 4 chunks Case 2 cookie-cutter + 1 stopped E3 + Pattern 12-bis NEW + +Implementer = busiest agent S29 với 5 spawn total. **Plan CA Chunk B (~10K):** 4 master pages mirror fe-admin→fe-user byte-identical SHA256, touch 6 file (4 page + App.tsx +5 route + menuKeys.ts +5 key Catalogs*), 948 LOC mirror PASS 0 TS err. Saved `pattern_master_page_mirror.md`. **Plan B 4 spawn cumulative:** (A2 Mig 32 ~25K) schema +column FK Restrict IX + Configuration + DbInitializer SeedSampleContractWorkflowV2 — **stash em main WIP ContractWorkflowService.cs** để build verify clean (em main + Implementer parallel touch BE → race condition trick); (C Mig 33 ContractLevelOpinions ~25K) entity + Mig + Config + DbSet + Contract.cs +LevelOpinions nav — **Pattern 12-bis NEW cross-module entity cookie-cutter mirror PE→Contract** scaffold 4-file pattern documented Patterns section; (D FE Workspace V2 ~12K) ContractCreatePage × 2 app +useQuery V2 + Select dropdown wire ApprovalWorkflowId, 88 LOC mirror byte-similar; (E3 stopped mid-task) FE Section 5 V2 STOPPED at "check ContractDetail type" judgment call → em main solo finish. **Lessons:** (1) **Race condition em main + Implementer parallel BE** → stash trick works but adds overhead. Forward SEQUENTIAL chunks A→B→C khi cùng touch BE, NOT parallel. (2) **Complex FE feature mirror với type extend + new component** → em main solo more reliable than Implementer khi spec ambiguity > 20% in Read-required component inspection. (3) Pattern 16-bis 4-place mirror cross-app reinforced 2× (Plan CA Chunk B + Plan B Chunk D) — verify Layout staticMap khi page move/route enhance. + +--- + +## 2026-05-22 — S28 wrap Layer A governance distributed active + +Implementer policy local apply: S28 em main solo cả buổi (KHÔNG Implementer work code thực sự). Timeline: t1 RAG ROI verdict marginal-short/transform-long → t2 bro feedback "ghi mọi tương tác" → t3 em đề xuất 2-week monitoring 5 metric → t4 bro caught self-authorize cross-project rule mistake → t5 governance broadcast Layer A active 3-Layer distributed scope-down về SOLUTION_ERP self-discipline. **Implementer perspective về Layer A governance:** (1) Pattern proven ≥ 2× qualifies Layer B nominate. **Pattern 7 per-NV admin opt-in flag (Mig 29 AllowDrafterEdit + Mig 30 AllowApproverEditSection1 + Mig 31 AllowEarlyApprove + AllowDelegate) đã proven 4× — strong candidate Layer B promote khi unfreeze.** (2) Tag schema mandatory áp dụng forward: store Pattern chunk với format `[pattern, phase-, ]`. (3) source_path convention: `solution_erp/pattern/-`. (4) **KHÔNG self-authorize cross-project rule (lesson S28 t4)**. (5) Quên rule cũ "mọi tương tác mandatory store" — **ABANDONED**. + +--- + +## 2026-05-22 — S27 wrap-up retrospective REFUSE analysis + +Em main S27 SOLO cả buổi vì registry KHÔNG load (per pitfall VIPIX #1+#2). Retrospective analysis 6 task S27 vs ACCEPT/REFUSE criteria: + +| Task S27 | Implementer fit? | Verdict | +|---|---|---| +| C1 Curate cicd-monitor 72KB | ❌ REFUSE #1 (judgment §6.5 KEEP vs CUT) | Em main solo CORRECT | +| C2-C4 Curate 3 agent MEMORY | ❌ REFUSE #1 same | Em main solo CORRECT | +| C5 Audit drift §6.4 + §9.4 | ❌ REFUSE #1 same | Em main solo CORRECT | +| A3.1 Write 5 PS scripts | ✅ ACCEPT Case 2 (5 file cookie-cutter mirror pattern) | **Implementer would ACCEPT** - em main miss delegate opportunity | +| A3.2 Dashboard HTML + generator | ❌ REFUSE #7 (first time pattern, no precedent) + #2 UX design needed | Em main solo CORRECT | +| A4 rag-onboarding-guide.md 421 lines | ❌ REFUSE #2 (docs writing judgment) | Em main solo CORRECT | +| F1 Qdrant Web UI fix | ❌ REFUSE #4 (bug reasoning chain) | Em main solo CORRECT | +| F2 4 agent files fix model:inherit | ✅ ACCEPT Case 1 (4 file mechanical same edit) | **Implementer would ACCEPT** - em main miss delegate opportunity | + +**Verdict: 2/8 task lẽ ra delegate được Implementer (Case 1+2) nhưng registry empty → em main forced solo.** Net loss ~30 phút time + miss cookie-cutter mirror discipline. Pattern 20 NEW saved foundation: "**5 PS scripts mirror pattern** — start/stop/status/dashboard/boot family cùng ASCII discipline + same Write-Host structure + same try-catch pattern" reusable cho future infra automation. + +--- + +## 2026-05-22 — Curate session (S29 era) + +Archived 12 verbose Recent activity entries S21 t3 → S24 Plan AA → `archive/2026-05-q1.md`. KEEP: S26 Plan AG (Pattern 19 NEW), S25 wrap (Patterns 16-18 NEW), S25 Plan AB, setup baseline. Patterns 1-19 foundation section preserved. Memory size before: 38.8 KB → after: target ~22-24 KB. + +--- + +## 2026-05-11 — Setup baseline + +Implementer agent initialized. Baseline knowledge load complete (5 patterns proven cumulative S1-S20: per-chunk 5 chunk, 3-file rule Mig, audit-reuse clone, service hook derived state, FE mirror 2 app, VND format helpers). No implementations performed yet. Awaiting first SendMessage from em main. Strict scope auto-refuse criteria active. diff --git a/.claude/agent-memory/investigator/MEMORY.md b/.claude/agent-memory/investigator/MEMORY.md index 9496470..c447d2b 100644 --- a/.claude/agent-memory/investigator/MEMORY.md +++ b/.claude/agent-memory/investigator/MEMORY.md @@ -141,17 +141,7 @@ State machine 5 trạng thái phiếu PE: Nháp / Đã gửi duyệt / **Trả l - **Archived 4 verbose entries S25-S26-S29 → `archive/2026-05-q2.md` 2026-05-26 S32 curate:** S25 t1 5Q audit Bug Changelog detail + S26 Plan AG 5Q PE List tree view + S26 Plan AI RAG 4 study cases (Cursor/Cline/Continue/Sourcegraph) + Plan B Contract V2 Q1-Q5 audit detail. KEY recommendations preserved in S29 wrap entry above (Plan B re-chunk 6 chunks pattern + ApplicableType=3 ZERO Prod seed flag + PE Mig 22-26 reference template paths). -- **2026-05-22 (S28 wrap — Layer A governance internalized + tag schema mandatory forward):** S28 5-turn arc t1 RAG ROI verdict → t2 over-reach mistake → t4 bro caught → t5 Layer A active. Investigator agent absorb 3 rules forward: (1) **Tag schema mandatory** every RAG ingest `[, phase-, ]` — type ∈ {bug, plan, audit, schema, ui-pattern, decision, retrospective, gotcha-doc}; phase enum 11 (`phase-9` UAT current); bc/module 8 domain {contract, pe, budget, master, identity, forms, notifications, audit-log} + 5 cross-cutting {cicd, infra, rag, governance, deploy}. (2) **4-category default + skip list** — skip ephemeral state ("S28 t3 startup ngày 22"), pure file paths không context, single-file < 5-line edit confirmation. Investigator output report tags MUST include all 3. (3) **NO self-authorize cross-project rule** — lesson S28 t4: stay scope-down SOLUTION_ERP self-discipline, don't generalize policy without bro consent. **Pre-flight audit query patterns Layer A §6.2** internalized: Pattern A `lookup_gotcha_` (top_k=3, narrow), Pattern B `verify_precedent_pattern_X` (top_k=3 thay default 10 — broad similarity rerank surface 3 best matches), Pattern C `find_code_symbol_` (top_k=5, symbol-anchor). **Weekly Friday eval ritual:** Investigator support Plan B Contract V2 wire pre-flight audit kick-off khi bro launch. Cumulative audit checklist (foundation cicd-monitor MEMORY S22+5→S23 t6 10-surface-point per-NV): (a) Contract entity V1 state inspect `Domain/Contracts/Contract.cs` + `WorkflowDefinitionId`, (b) Mig 22-23/26 PE V2 mirror reference confirm pattern reusable, (c) 4 PE V1-only audit migrate gap (per memory S22+4 Plan F ABORT), (d) 7 V1 contract scope drop boundary, (e) verify 10-surface-point per-NV checklist S22+5 cumulative reusable Contract V2 wire trước Mig 32 schema design. **source_path convention output:** `solution_erp/audit/investigator--` standardized cho tag schema BC=`pe` or `contract` switch per task. **Lesson abandoned:** S28 t2 "ghi RAG mọi tương tác" rule ABANDONED — Investigator KHÔNG mass-ingest, only specific findings with full tag schema. Audit retroactive S20-S26 "Investigator spawn" claims (memory log discrepancy registry NOT loaded vs token cost ghi 28-40K) defer S28+ priority #4 — uncertainty preserve cross-session, không retract memory unverified. - -- **2026-05-22 (S27 wrap-up em main proxy - retrospective Investigator):** Investigator pre-flight CRITICAL miss: nếu spawn pre-Plan A.3 (RAG manual control build) → would have catch Qdrant Web UI static missing PRE-em main write rag-dashboard.ps1 link `localhost:6333/dashboard`. Pattern reinforced: **pre-flight infrastructure audit MUST spawn Investigator** trước khi em main claim "X work" trong docs. Em main S27 SOLO miss external dependency check (Qdrant Web UI separate repo from binary). Anh pqhuy catch via UAT browser → escalate. - - **Audit cumulative S20-S26 memory log entries claiming "Investigator spawn" - re-verify retroactive:** Per pitfall confirm spawn `investigator` agent type NOT FOUND trong session S27, có nghĩa registry chưa bao giờ load trong session này. Nhưng memory log S23 t1 K0 + S25 t1 audit Bug 1+2 + S26 Plan AG audit 5Q + Plan AI RAG research **đã ghi "spawn Investigator" với token cost 28-40K**. Possibility: (a) Previous sessions có registry load thành công (Claude Code version cũ hơn / file format khác / hot-reload sau /agents UI invoke), hoặc (b) Em main misattribute - actually spawn `general-purpose` agent default. Cần audit history Claude Code logs để xác minh - ngoài scope S27. **For now: trust prior memory entries but FLAG uncertainty cho future investigation.** - -- **2026-05-22 (Curate session em main):** Archived 10 verbose Recent activity entries S21 → S24 Plan AA → `archive/2026-05-q1.md`. KEEP: S25 Bug audit + wrap, S26 Plan AG + Plan AI RAG, 2026-05-11 setup. Patterns proven section + Active workflow schemas section preserved. Memory size before: 34.9 KB → after: target ~20-22 KB. - -- **2026-05-19 (S25 wrap — Plan AB Bug 1+2 audit + 6 follow-up plans em main solo):** Pre-Plan AB audit ~28K confirm root cause: Bug 1 Budget Adjust Handler ĐÃ log Changelog (Header+Update) nhưng FE HistoryTab filter strict TraLai-only loại. Bug 2 ApplyReturnModeAsync 4 mode KHÔNG add Changelog.Add() — chỉ caller LogTransitionAsync log phase transition. Recommended fix path: BE add log return mode + FE filter relax + Decision badge differentiation. **Em main solo từ Plan AC** (cross-stack reasoning Implementer would REFUSE). Patterns reusable Contract V2 audit recovery + Budget changelog UI: synthetic recovery FE merge + userMap fallback + drop misleading badges + preventive batch fix systemic gap. CICD result: 7 commits `e23f51c..506cada` push remote, runs #215 FAIL Plan M tests SQLite tie-break re-emerge → #216-#221 PASS streak. Gotcha #48 SQLite tie-break pending docs. - -- **2026-05-11 (setup):** Investigator agent initialized. Baseline knowledge load complete (44 gotchas + 14 memory entries + 6 skills + 27 mig + 81 test pass cumulative). No investigations performed yet. Awaiting first SendMessage from em main. +- **Archived to `archive/2026-05-q3.md` 2026-05-27 S34 curate (em main proxy):** S28 wrap Layer A governance internalized (3 rules + tag schema mandatory + 4-category default + NO self-authorize cross-project — absorbed forward into agent output discipline) + S27 wrap-up retrospective (pre-flight infrastructure audit must spawn Investigator lesson + S20-S26 spawn audit uncertainty flag) + 2026-05-22 curate session note + S25 wrap Bug 1+2 audit + 2026-05-11 setup baseline. KEY pattern absorbed forward: pre-flight infrastructure audit MUST spawn Investigator + scope-down SOLUTION_ERP self-discipline + tag schema `[type, phase, bc-or-module]` mandatory output. --- @@ -161,5 +151,5 @@ State machine 5 trạng thái phiếu PE: Nháp / Đã gửi duyệt / **Trả l - Duplicate entries detected → merge - Stale > 3 months → remove -**Last curate: 2026-05-26 S32 em main proxy curate** (post-S31 RAG fix) — archived 4 verbose entries (S25 t1 5Q audit detail + S26 Plan AG 5Q + S26 Plan AI RAG research + Plan B Contract V2 Q1-Q5 audit detail) → `archive/2026-05-q2.md`. KEEP: S32 startup (latest), S29 wrap summary, S28 Layer A governance, S27 retrospective, S25 wrap summary, S22 curate session, S11 setup baseline. Patterns + Active workflow schemas foundation preserved untouched. MEMORY size before: 27.7 KB → after: target ~21 KB. **Previous curate: 2026-05-22** — archived 10 verbose (S21 → S24 Plan AA) → `archive/2026-05-q1.md`. Next trigger: > 25KB OR Plan G-H1 kick off. +**Last curate: 2026-05-27 S34 em main proxy curate** (post-S33 wrap, sequence 1/4) — archived 4 verbose entries (S27 wrap retrospective + 2026-05-22 curate session + S25 wrap + S11 setup) → `archive/2026-05-q3.md`. KEEP: S33 t1 Plan G-H1 pre-flight NamGroup audit (latest 10 bảng inventory + 4 decision schema), S33 startup audit (4 MEMORY size + RAG hit verify), S32 wrap (Plan G 11 module backlog), S32 startup (S31 RAG awareness), S29 wrap (2 spawn Plan CA + Plan B pre-flight + 3 patterns NEW), S28 wrap (Layer A governance). Patterns + Active workflow schemas foundation preserved untouched. MEMORY size before: 26 KB → after: target ~20-22 KB. **Previous curate: 2026-05-26 S32** — 4 verbose entries → `archive/2026-05-q2.md`. **Previous curate: 2026-05-22** — 10 verbose S21→S24 → `archive/2026-05-q1.md`. Next trigger: > 25KB OR Plan G-O1 Danh bạ kick off. diff --git a/.claude/agent-memory/investigator/archive/2026-05-q3.md b/.claude/agent-memory/investigator/archive/2026-05-q3.md new file mode 100644 index 0000000..d8c2fd3 --- /dev/null +++ b/.claude/agent-memory/investigator/archive/2026-05-q3.md @@ -0,0 +1,30 @@ +# Investigator — Archive Q3 2026-05 (S34 curate) + +> Verbose Recent activity entries archived from MEMORY.md S34 init (em main proxy curate 2026-05-27). +> Patterns proven + Active workflow schemas foundation preserved untouched in MEMORY.md. + +--- + +## 2026-05-22 — S27 wrap-up retrospective em main proxy + +Investigator pre-flight CRITICAL miss: nếu spawn pre-Plan A.3 (RAG manual control build) → would have catch Qdrant Web UI static missing PRE-em main write rag-dashboard.ps1 link `localhost:6333/dashboard`. Pattern reinforced: **pre-flight infrastructure audit MUST spawn Investigator** trước khi em main claim "X work" trong docs. Em main S27 SOLO miss external dependency check (Qdrant Web UI separate repo from binary). Anh pqhuy catch via UAT browser → escalate. + +**Audit cumulative S20-S26 memory log entries claiming "Investigator spawn" - re-verify retroactive:** Per pitfall confirm spawn `investigator` agent type NOT FOUND trong session S27, có nghĩa registry chưa bao giờ load trong session này. Nhưng memory log S23 t1 K0 + S25 t1 audit Bug 1+2 + S26 Plan AG audit 5Q + Plan AI RAG research **đã ghi "spawn Investigator" với token cost 28-40K**. Possibility: (a) Previous sessions có registry load thành công (Claude Code version cũ hơn / file format khác / hot-reload sau /agents UI invoke), hoặc (b) Em main misattribute - actually spawn `general-purpose` agent default. Cần audit history Claude Code logs để xác minh - ngoài scope S27. **For now: trust prior memory entries but FLAG uncertainty cho future investigation.** + +--- + +## 2026-05-22 — Curate session em main S29 era + +Archived 10 verbose Recent activity entries S21 → S24 Plan AA → `archive/2026-05-q1.md`. KEEP: S25 Bug audit + wrap, S26 Plan AG + Plan AI RAG, 2026-05-11 setup. Patterns proven section + Active workflow schemas section preserved. Memory size before: 34.9 KB → after: target ~20-22 KB. + +--- + +## 2026-05-19 — S25 wrap Plan AB Bug 1+2 audit + 6 follow-up plans em main solo + +Pre-Plan AB audit ~28K confirm root cause: Bug 1 Budget Adjust Handler ĐÃ log Changelog (Header+Update) nhưng FE HistoryTab filter strict TraLai-only loại. Bug 2 ApplyReturnModeAsync 4 mode KHÔNG add Changelog.Add() — chỉ caller LogTransitionAsync log phase transition. Recommended fix path: BE add log return mode + FE filter relax + Decision badge differentiation. **Em main solo từ Plan AC** (cross-stack reasoning Implementer would REFUSE). Patterns reusable Contract V2 audit recovery + Budget changelog UI: synthetic recovery FE merge + userMap fallback + drop misleading badges + preventive batch fix systemic gap. CICD result: 7 commits `e23f51c..506cada` push remote, runs #215 FAIL Plan M tests SQLite tie-break re-emerge → #216-#221 PASS streak. Gotcha #48 SQLite tie-break pending docs. + +--- + +## 2026-05-11 — Setup baseline + +Investigator agent initialized. Baseline knowledge load complete (44 gotchas + 14 memory entries + 6 skills + 27 mig + 81 test pass cumulative). No investigations performed yet. Awaiting first SendMessage from em main. diff --git a/.claude/agent-memory/reviewer/MEMORY.md b/.claude/agent-memory/reviewer/MEMORY.md index 0a49e97..552da63 100644 --- a/.claude/agent-memory/reviewer/MEMORY.md +++ b/.claude/agent-memory/reviewer/MEMORY.md @@ -166,12 +166,7 @@ Flag commit nếu thấy `/` 2-level + localStorage Set persist. Schema 0 mig. AG2-AG6 (5 follow-up polish UAT feedback bro Tra Sol) em main solo verify (SHA256 IDENTICAL + npm build × 2 + dotnet test 111/111) — KHÔNG re-spawn Reviewer (ROI thấp UI polish 50-100 LOC). **Pattern reinforced**: Reviewer spawn cho heavy cross-stack (A+B+C ~370 LOC + 4 sub-agent collab), em main solo cho polish iteration. Cumulative S26: 6 commits, 0 prod regression, baseline 111 preserved. - -- **2026-05-19 (S25 Plan AB + wrap):** Archived to `archive/2026-05-q1.md` — keywords: gotcha #48 SQLite frozen clock tie-break (Multi-Changelog.Add same SaveChangesAsync transaction non-deterministic `OrderByDescending(CreatedAt).FirstAsync()`), UAT skip `dotnet test` recurring risk khi BE refactor > 100 LOC, ApplyReturnModeAsync refactor cdfd542 PE Budget Adjust + Trả lại Người chỉ định log. Cat 5 checklist add: test filter discriminator beyond timestamp (EntityType + Summary keyword). -- **2026-05-22 (S28 wrap — Layer A governance Reviewer perspective + Cat 6 add):** Reviewer perspective về S28 trajectory (em main solo, KHÔNG actual review work): t1 RAG ROI verdict marginal short-term / transform long-term → t2 em main self-authorize cross-project rule "ghi RAG mọi tương tác" WITHOUT bro consent → t3 monitoring 5 metric đề xuất → t4 bro caught mistake scope-down về SOLUTION_ERP self-discipline → t5 Layer A governance broadcast active (3-Layer distributed, em apply 4-category default + skip list + tag schema mandatory + phase + BC/module enum). **Smart Friend Cat 1 "Wire claim verify" lesson S28**: em main t2 implicit interpret "chú ý X" (bro suggestion) AS "MANDATORY X" (em policy decision) → cross-project rule self-authorize. Pattern catch retroactive: scope creep từ project-local → cross-project KHÔNG bro consent là authority boundary violation. Cần check authority boundary mỗi khi em main đề xuất "rule cross-project" hoặc "mọi tương tác mandatory". **Tag schema mandatory forward S28+**: store lesson/gotcha chunk với `[lesson, phase-, ]` format (phase ∈ {phase-9, phase-9plus, phase-10}, BC enum ∈ {contract, pe, budget, workflow, identity, form, infra}). **Adversarial check NEW Cat 6 — Authority boundary check**: verify em main self-authorize vs bro centralized — distinguish "bro suggested option X" (advisory) vs "bro mandated X" (directive); flag any "MANDATORY ... cross-project" sourced từ em main self-decision. 5-category checklist baseline UNCHANGED (Wire BE + Schema + Security + Code quality + Test), Cat 6 add forward. **Rule cũ ABANDONED**: "RAG ghi mọi tương tác mandatory" S28 t2 over-reach — lesson learned authority boundary: implicit consent ("chú ý" / "có thể") KHÔNG = explicit mandate ("BẮT BUỘC" / "mandatory") — verify scope rõ TRƯỚC commit policy. Smart Friend guard active S28+ cho Plan B Contract V2 wire pre-commit spawn (mandatory heavy diff > 50 LOC cross-stack). +- **Archived to `archive/2026-05-q2.md` 2026-05-27 S34 curate (em main proxy):** S29 Plan B pre-push detail (MAJOR catch ApplicableType validation — KEY lesson absorbed Cross-module security mirror foundation line 41-49) + S26 Plan AG pre-commit + AG2-AG6 em main solo + S25 Plan AB wrap (gotcha #48 lesson — foundation line 40-45) + S28 wrap Layer A governance Cat 6 add (absorbed forward 5-category baseline). Smart Friend guard 4× cumulative S22+S25+S29×2 preserved in current S33 entries. --- @@ -181,4 +176,4 @@ Flag commit nếu thấy ` 25KB OR Plan B Wrap test bundle complete OR Budget V2 wire start OR Phase 9 UAT hard blocker audit spawn. +**Last curate: 2026-05-27 S34 em main proxy curate** (post-S33 wrap, sequence 1/4) — archived 3 verbose entries (S26 Plan AG + S25 Plan AB wrap + S28 Layer A governance Cat 6 add) → `archive/2026-05-q2.md`. KEEP: S33 Plan B G-H1 Phase 2 pre-commit (Smart Friend 6× clean), S33 Plan C B-Wrap pre-commit (9/9 [Fact] verified), S33 startup drift audit (CLAUDE.md SEVERE), S32 wrap (Plan B-Wrap pre-commit scope ahead), S32 startup, S29 wrap (Smart Friend 4× cumulative), S29 Plan B pre-push (1 MAJOR catch ApplicableType). 5-category checklist + Cat 6 Authority boundary check + Smart Friend guard + Cross-module security validation mirror pattern (NEW S29 foundation) preserved. MEMORY size before: 28.5 KB → after: target ~20-22 KB. **Previous curate: 2026-05-26 S32 startup** drop S27 retrospective. Next curate trigger: > 25KB OR Plan G-O1 Danh bạ kick off. diff --git a/.claude/agent-memory/reviewer/archive/2026-05-q2.md b/.claude/agent-memory/reviewer/archive/2026-05-q2.md new file mode 100644 index 0000000..3c71725 --- /dev/null +++ b/.claude/agent-memory/reviewer/archive/2026-05-q2.md @@ -0,0 +1,22 @@ +# Reviewer — Archive Q2 2026-05 (S34 curate) + +> Verbose Recent activity entries archived from MEMORY.md S34 init (em main proxy curate 2026-05-27). +> Foundation gotchas #17-#48 + Smart Friend guard + 5-category + Cat 6 + Cross-module security validation mirror pattern preserved untouched in MEMORY.md. + +--- + +## 2026-05-21 — S26 Plan AG pre-commit + AG2-AG6 em main solo + +Plan AG Chunk A+B+C verify spawn ~25K, 12 adversarial deep check PASS 0 issue. Commit `0bf6c7e` 2 file +346/-116 LOC mirror IDENTICAL `21001E90...`. Wire: useMemo group nested + `
/` 2-level + localStorage Set persist. Schema 0 mig. AG2-AG6 (5 follow-up polish UAT feedback bro Tra Sol) em main solo verify (SHA256 IDENTICAL + npm build × 2 + dotnet test 111/111) — KHÔNG re-spawn Reviewer (ROI thấp UI polish 50-100 LOC). **Pattern reinforced**: Reviewer spawn cho heavy cross-stack (A+B+C ~370 LOC + 4 sub-agent collab), em main solo cho polish iteration. Cumulative S26: 6 commits, 0 prod regression, baseline 111 preserved. + +--- + +## 2026-05-19 — S25 Plan AB + wrap + +Keywords: gotcha #48 SQLite frozen clock tie-break (Multi-Changelog.Add same SaveChangesAsync transaction non-deterministic `OrderByDescending(CreatedAt).FirstAsync()`), UAT skip `dotnet test` recurring risk khi BE refactor > 100 LOC, ApplyReturnModeAsync refactor cdfd542 PE Budget Adjust + Trả lại Người chỉ định log. Cat 5 checklist add: test filter discriminator beyond timestamp (EntityType + Summary keyword). + +--- + +## 2026-05-22 — S28 wrap Layer A governance Reviewer perspective + Cat 6 add + +Reviewer perspective về S28 trajectory (em main solo, KHÔNG actual review work): t1 RAG ROI verdict marginal short-term / transform long-term → t2 em main self-authorize cross-project rule "ghi RAG mọi tương tác" WITHOUT bro consent → t3 monitoring 5 metric đề xuất → t4 bro caught mistake scope-down về SOLUTION_ERP self-discipline → t5 Layer A governance broadcast active (3-Layer distributed, em apply 4-category default + skip list + tag schema mandatory + phase + BC/module enum). **Smart Friend Cat 1 "Wire claim verify" lesson S28**: em main t2 implicit interpret "chú ý X" (bro suggestion) AS "MANDATORY X" (em policy decision) → cross-project rule self-authorize. Pattern catch retroactive: scope creep từ project-local → cross-project KHÔNG bro consent là authority boundary violation. Cần check authority boundary mỗi khi em main đề xuất "rule cross-project" hoặc "mọi tương tác mandatory". **Tag schema mandatory forward S28+**: store lesson/gotcha chunk với `[lesson, phase-, ]` format (phase ∈ {phase-9, phase-9plus, phase-10}, BC enum ∈ {contract, pe, budget, workflow, identity, form, infra}). **Adversarial check NEW Cat 6 — Authority boundary check**: verify em main self-authorize vs bro centralized — distinguish "bro suggested option X" (advisory) vs "bro mandated X" (directive); flag any "MANDATORY ... cross-project" sourced từ em main self-decision. 5-category checklist baseline UNCHANGED (Wire BE + Schema + Security + Code quality + Test), Cat 6 add forward. **Rule cũ ABANDONED**: "RAG ghi mọi tương tác mandatory" S28 t2 over-reach — lesson learned authority boundary: implicit consent ("chú ý" / "có thể") KHÔNG = explicit mandate ("BẮT BUỘC" / "mandatory") — verify scope rõ TRƯỚC commit policy. Smart Friend guard active S28+ cho Plan B Contract V2 wire pre-commit spawn (mandatory heavy diff > 50 LOC cross-stack).