Files
solution-erp/.claude/auto-memory/MEMORY.md

14 KiB
Raw Blame History

Memory Index — SOLUTION_ERP

One line per memory. Feedback = how I work · Project = ongoing context · Pattern = reusable scaffold. Detail lives in topic files; this index = recall hook only. Compacted S93 (was 23.7KB).

Feedback — how I should work

  • Charter v2 — infra ownership — AI_INFRA owns infra (RAG/MCP/agent/skill); SE focus product, phản-biện infra chỉ khi derail
  • Monthly drift audit — cron ngày 1: investigator ground-truth-from-disk → em-main patch từng cite (gotchas no self-count)
  • STATUS/HANDOFF tiering — giữ lean (current + 2-3 session); archive verbatim trước rewrite; re-ground count từ code
  • Implementer truncation mitigation — heavy scaffold truncate mid-MEMORY; Strategy B = em-main proxy-append next session
  • High→Max multi-agent quality — Max reasoning ↑ cross-stack reliability; Max re-review wire/financial claim BẮT BUỘC
  • Background spawn visibility — long foreground spawn "looks frozen" → run_in_background + report ngay
  • RAG MCP recovery + concurrency — MCP rớt → quit+relaunch FRESH trust .mcp.json (KHÔNG resume); KHÔNG 2 SE-session cùng repo; git-add file cụ-thể
  • store_memory rebootstrap protection — at-risk ⟺ content NOT in {exists ∧ corpus-glob ∧ not-excluded}; promote-to-disk twin trước re-bootstrap
  • Session-end memory write verify — closeout Write có thể 0-byte (#53); verify byte>0 sau mỗi memory Write (S45 mất index)
  • AI_INFRA adap-* channel — federated adoption /adap-apply|report|request; read outbox→apply own repo→adap-report (§J2); lead=sole RAG-writer
  • Monitor residual-write containment — propose-only sub vẫn Bash-write được (G-015); git-diff commit-gate = backstop THẬT (AS-10/E-006)
  • Agent kill/truncation recovery — kill/truncate/die-0-byte giữa task → recover qua git/disk/prod truth + em-main-solo redo + self-gate evidence-checklist (S52)
  • Agent cwd-relative memory mis-land — sub cd subdir → MEMORY Write rơi <subdir>/.claude stray; session-end git-status scan + reconcile (S54)
  • Harness-7 outward writing quality — outward (email/broadcast/report + lead→anh) = full-grammar VN; internal stays compressed (asymmetric, S64)
  • Workflow fan-out reliability — fan-out parallelism thật; return: schema-NHỎ 3-field 4/4-clean S108 (S73 "tránh schema" thu hẹp còn schema-SÂU) + free-text VERDICT-header-dòng-1; 2 bẫy Workflow-tool: args-đến-dạng-STRING → parse-guard · tier: hmw-only → generic dùng model:'opus' (S65/S73/S108)
  • Fault-injection proves teeth — chứng checker/guard có RĂNG bằng inject-lỗi-vào-cây-tạm (-RepoRoot) → confirm FLAG, KHÔNG chỉ happy-path PASS; boundary + anti-Goodhart-flip; verify anchor bằng chính regex script (S95)
  • Harness-9 L2-recovery + 2-workflow adap — mỗi adap = 2 workflow (impl+review) + run-id; L2 _INDEX/gist dark-matter recovery; self-gate khi reviewer no-schema (S70); + vocab-collision-check on adopt (review bắt tên-trùng: memory-fidelity H6.7≠H16; alias-map KHÔNG seed detector, S93)
  • Stale diagnostic in background agent — IDE diagnostic giữa agent NỀN = snapshot dở; chỉ tin build SẠCH chạy SAU agent (gotcha #68, S69)
  • Harness-10 run-trace folder — git-tracked runs/<id>/ FLAT (sub-*+*-synthesis.md); raw-Workflow≠writeGuard→residual caught+revert; detector-tailored-out (S71-72)
  • Harness-11 engine adopt — engine governance tự-bảo-trì: governance-detectors.ps1+memory-archive-gate.ps1; B1 derived-trỏ-canonical; #30-via-Edit (.ps1 pure-ASCII+code-point) (S75)
  • Canonical spec over broadcast — adap khi anh trỏ LỆNH canonical → pull command/§P/ledger, ĐỪNG phỏng-theo broadcast cô-đọng; report-before-stamp (S79)
  • Review presentation & stale config — review độc-lập bắt honesty-PRESENTATION gap + stale-config đánh-lừa reviewer; tighten-wording + re-measure TRƯỚC review (S81)
  • Derived-flush = execution — derived-doc flush khớp canonical owner-set = em-main tự làm KHÔNG gate; chỉ ĐỔI con-số/policy = quyền anh (S84)
  • Root-cause over symptom — bug lặp sau band-aid → truy field/case LỆCH-quy-ước vào pattern đã-đúng = fix 1 chỗ; verify "tạo lỗi MỚI còn lặp?" (S85, #72/#73) · +S122 anh nêu: (i) được-chỉ-1-chỗ ⇒ PHẢI grep cùng-lớp (script thứ-2 lòi ra khi anh hỏi — thoát vì MAY) · (ii) 🔴 bài-học nằm-trong-context KHÔNG tự bật (file này auto-inject mà lead vẫn vá triệu-chứng; +SHA-bịa tái-phạm sau 1 NGÀY) ⇒ chặn được = LUẬT soi-được, không phải trí-nhớ · chứng: hardcode sống 27 ngày qua 1 đợt "double-check" vì nó hỏi "logic đúng?" mà logic VẪN đúng · truy-gốc ≠ tự-sửa-gốc (harness owns → R6 hỏi hub)
  • Cardinality change grep consumers — đổi field single→multi = grep MỌI consumer; sửa write-site sót read-site → vỡ feature (S87/S88 PE multi-winner)
  • Prod config: inspect-before-change — đổi config prod = inspect LIVE trước (runbook STALE); backup→apply→verify-LIVE→commit; replicate mọi rule cũ + delta (S88)
  • Wipe durability — check re-seed — sau prod-wipe audit seeder: ungated per-code seed RE-ADD mỗi restart; gate sau env-flag + verify-by-restart-THẬT (S91, #75/#76)
  • Verify deployed artifact byte-level — UAT "fix chưa ăn" sau deploy → curl-grep bundle prod byte-level (cache≠deploy); incognito=golden-test (S96, #77)
  • Agent return-garble recover — sub trả wrong-slice-of-transcript thay verdict (#53, ×20 qua S118) → recover: (0) WRITE-lane→disk-truth (git+build+test) · VERIFY-lane→em-main-re-curl+sqlcmd (2-nguồn-khớp) → (1) diary → (2) SendMessage-resume in-session → (3) em-main solo; garble ∝ reasoning-lane; WRITE-lane garble≠mất-code (S114 ×5); cicd tái-phạm dai + tự-dán "CLEAN-return" sai (harvest-curator bắt S118)
  • H18 ghost-wire + stamp-integrity — hash-verify TRƯỚC khi áp broadcast (bắt stamp-then-edit THẬT → HELD + re-stamp); ghost-wire 2 class (cron-claim CronList=0 · config-key defined-but-unread); KHÔNG stamp run-id chưa chạy (S100)
  • Resume premise re-verify — re-verify tiền-đề từ ĐĨA trước execute (header+git-date, match NỘI-DUNG KHÔNG tên-file 1:1); S121: bảng-kế-hoạch ≠ đĩa — "không-ai-được-giao" ≠ "chưa-làm"; khẳng-định trạng-thái-đĩa = phải chạm đĩa 1 lệnh; +bẫy grep -c (dòng) vs -o|wc -l (occurrence) trên mega-line; +bẫy Get-Content-no-Encoding no-BOM = ANSI đếm ×2-3 → báo-số-sai-owner, đính-chính-ngay (S130 E-010/AS-14); +acceptance literal tự-lão-hoá (S109/S121)
  • Permission grant = 2 layers — cấp/verify quyền = display-layer (menu CanRead) ⟂ API-authz-layer (controller [Authorize(Policy)]) 2 tầng ĐỘC-LẬP; grep authz controller đích TRƯỚC khi tin grant (menu-ẩn ≠ API-đóng; [Authorize] trần = lỗ hổng); reviewer-adversarial bắt, em-main-solo sót (S118, #82)
  • Meta-count self-coverage blind-spot — lead ĐO tốt (~80% đúng) nhưng ĐẾM-VỀ-MÌNH sai (~13%, tập trung TRỌN ở meta-count/coverage); "vá 19 finding" khi thật 23 = con-số đóng vai đã-phủ-hết → bảng disposition TỪNG DÒNG thay số tổng; giữ kết-luận thì giữ cả caveat (S119)
  • Return terminates agent — CẤM lệnh "trả verdict TRƯỚC, làm việc SAU" = bất-khả-thi vật-lý; sub mô-tả ý-định rồi tắt → claim-sai mà lỗi ở LỆNH lead; thứ-tự đúng = làm→verify→return, hoặc lead ghi on-behalf sau VERIFY-đĩa (S119) · +S123: prompt-đúng KHÔNG chặn được #53 (cấm bẫy từ prompt đầu cho cả 3 sub, cả 3 vẫn garble ×4) ⇒ chặn được = ghi-đĩa-TRONG-lúc-làm (harvest-curator vớt ngay từ đĩa; 2 vai kia phải resume) + resume-in-session; reviewer tự rút luật "ghi diary TRƯỚC return" từ garble-1 và nhờ đúng nó mà garble-2 vớt được
  • Citation-trap self-reference — doc định-nghĩa anti-pattern TẤT-YẾU chứa mẫu đó ⇒ detector khớp-mẫu bắt chính nó, lây qua trích-dẫn (3 đời/1 wave); discriminator = enclosure use⟂mention, KHÔNG port charset-guard; vá 1 CLASS ⇒ grep MỌI matcher cùng-lớp TRONG diff (gen-2 xảy ra thật)
  • Goodhart: rời tập-đo — "vá" bằng đổi HÌNH-DẠNG thứ đang bị đo = rời tập-đo; flag-count giảm trông y hệt thành công ⇒ hỏi "cái mất đi là dương-giả hay CHỨNG-NHÂN?"; kể chuyện bằng THÀNH-PHẦN không bằng tổng; +2 phép thử rẻ (trục-nào-KHÔNG-có-ca · áp-luật-cho-nhánh-anh-em)
  • Edit phải có trước review — edit-cần-review (nhất là file vai reviewer) LAND TRƯỚC lượt L3 (no-self-exempt cần vật tồn-tại trong diff); spec tự-mâu-thuẫn → fix-mới thắng footer-cũ + khai trong report (anh ratify S139)

Project — ongoing decisions / context

  • H22 WAL session-continuity — sổ WAL ≤40 + Stop-hook persist VERIFIED-RUNTIME S111 (hot-reload ENV-DEP #2/#3) + /pause·/tiep 1-đường + squash wal: + FLIP run-trace ≥3-task + D10 AS-6-taxonomy-đổi; hook PS1 KHÔNG bash (PATH 3-context); pilot kill/đổi-acc pending
  • Model-tier evolution → worker-tier-pin S124 — H4 two-tier → H8 all-inherit → S124 worker-tier-pin (14/14 sub = opus+effort:max, lead owner-choice, Fable qua /fable-real); restart-lesson: EDIT-agent-tồn-tại/command cần restart (hot-reload ENV-DEP, agent-MỚI khác)
  • H23 spawn-precedence — ĐO S126 — spawn-param tier THẮNG frontmatter hard-pin ⇒ /fable-real SỐNG · worker-pin ăn runtime (no-tier=opus DÙ lead=Fable ⇒ không inherit); đo 2026-07-16 spawn-model-audit 0-mismatch
  • database-agent verified + local-drift catch — verified-runtime S53; read-advisory DB lens bắt committed-but-unapplied-local mig (green tests+prod miss)
  • HoSoLink open-from-web browser block — web KHÔNG click-open file:// từ https (browser block); chỉ Edge GPO IntranetFileLinksEnabled one-click; FE render + Copy fallback (S67)
  • Harness 1·2·3 adopt — roster 8→10 (+2 monitor INFORM-only tooling-auditor+harvest-curator) · email channel broadcasts/ self=se; verified-runtime S50
  • 7-agent split upgrade — multi-agent 4→7: backend/frontend split + test-specialist, budget +50%, split theo trục workload (S39)
  • Phase 10 NamGroup port — port 11 module; scope FULL / DB single dbo / reuse WF V2 ApplicableType / rollout per-module (S32)
  • Skeleton-first aggressive finish — "finish cho xong" → schema FULL + logic SKELETON defer, trade-off ghi commit + UI banner (S38)

Pattern — reusable scaffold