[CLAUDE] Docs: S40 adopt AI_INFRA Tiered Memory Policy v1 (bulletin MUC 2)

- README Memory discipline -> tiered L1 HOT (soft-cap ~30KB) / L2 archive on-demand / L3 RAG just-in-time (thay hard >25KB)
- 7 agent MEMORY.md header -> tiered framing
- Anti-truncation rule soft-cap ~30KB
- Adopt per AI_INFRA Cross-Project Bulletin 2026-05-29; SE 7-agent in scope

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-05-29 16:58:39 +07:00
parent 2839f3a59a
commit 6f08d1f0eb
8 changed files with 15 additions and 9 deletions

View File

@ -1,7 +1,7 @@
# CI/CD Monitor Agent — Persistent Memory # CI/CD Monitor Agent — Persistent Memory
> **Persistent diary cross-session.** Auto-injected first 200 lines / 25KB at spawn. > **Persistent diary cross-session.** Auto-injected first 200 lines / 25KB at spawn.
> Update BEFORE every stop. Curate when > 25KB. Keep entry ≤ 1.5K chars (gotcha #53). > Update BEFORE every stop. Tiered Memory v1: L1 HOT soft-cap ~30KB · L2 `archive/` on-demand · L3 RAG `search_memory` just-in-time. Keep entry ≤ 1.5K chars (gotcha #53).
> Full verbatim run history pre-S40 → git `d2f52ba` + `archive/2026-05-{runs,q2,q3,q4}.md`. > Full verbatim run history pre-S40 → git `d2f52ba` + `archive/2026-05-{runs,q2,q3,q4}.md`.
--- ---

View File

@ -1,7 +1,7 @@
# Implementer-Backend Agent — Persistent Memory # Implementer-Backend Agent — Persistent Memory
> **Persistent diary cross-session.** Auto-injected first 200 lines / 25KB at spawn. > **Persistent diary cross-session.** Auto-injected first 200 lines / 25KB at spawn.
> Update BEFORE every stop. Curate when > 25KB. Keep entry ≤ 1.5K chars (gotcha #53). > Update BEFORE every stop. Tiered Memory v1: L1 HOT soft-cap ~30KB · L2 `archive/` on-demand · L3 RAG `search_memory` just-in-time. Keep entry ≤ 1.5K chars (gotcha #53).
> Full verbatim history pre-S40 → git `d2f52ba` + `archive/2026-05-q1..q4.md`. > Full verbatim history pre-S40 → git `d2f52ba` + `archive/2026-05-q1..q4.md`.
> **Renamed S39:** implementer → implementer-backend (.NET half). FE patterns → `implementer-frontend` MEMORY. Test patterns → `test-specialist` MEMORY. > **Renamed S39:** implementer → implementer-backend (.NET half). FE patterns → `implementer-frontend` MEMORY. Test patterns → `test-specialist` MEMORY.

View File

@ -1,7 +1,7 @@
# Implementer-Frontend Agent — Persistent Memory # Implementer-Frontend Agent — Persistent Memory
> **Persistent diary cross-session.** Auto-injected first 200 lines / 25KB at spawn. > **Persistent diary cross-session.** Auto-injected first 200 lines / 25KB at spawn.
> Update BEFORE every stop. Curate when > 25KB. Keep entry ≤ 1.5K chars (gotcha #53). > Update BEFORE every stop. Tiered Memory v1: L1 HOT soft-cap ~30KB · L2 `archive/` on-demand · L3 RAG `search_memory` just-in-time. Keep entry ≤ 1.5K chars (gotcha #53).
> **NEW agent S39 (2026-05-29)** — split từ implementer (FE 2 app half). Backend scaffold history ở `implementer-backend`. > **NEW agent S39 (2026-05-29)** — split từ implementer (FE 2 app half). Backend scaffold history ở `implementer-backend`.
--- ---

View File

@ -1,7 +1,7 @@
# Investigator-API Agent — Persistent Memory # Investigator-API Agent — Persistent Memory
> **Persistent diary cross-session.** Auto-injected first 200 lines / 25KB at spawn. > **Persistent diary cross-session.** Auto-injected first 200 lines / 25KB at spawn.
> Update BEFORE every stop. Curate when > 25KB. Keep entry ≤ 1.5K chars (gotcha #53). > Update BEFORE every stop. Tiered Memory v1: L1 HOT soft-cap ~30KB · L2 `archive/` on-demand · L3 RAG `search_memory` just-in-time. Keep entry ≤ 1.5K chars (gotcha #53).
> **NEW agent S39 (2026-05-29)** — split từ investigator (external research half). Internal audit history ở `investigator-codebase`. > **NEW agent S39 (2026-05-29)** — split từ investigator (external research half). Internal audit history ở `investigator-codebase`.
--- ---

View File

@ -1,7 +1,7 @@
# Investigator-Codebase Agent — Persistent Memory # Investigator-Codebase Agent — Persistent Memory
> **Persistent diary cross-session.** Auto-injected first 200 lines / 25KB at spawn. > **Persistent diary cross-session.** Auto-injected first 200 lines / 25KB at spawn.
> Update BEFORE every stop. Curate when > 25KB. Keep entry ≤ 1.5K chars (gotcha #53). > Update BEFORE every stop. Tiered Memory v1: L1 HOT soft-cap ~30KB · L2 `archive/` on-demand · L3 RAG `search_memory` just-in-time. Keep entry ≤ 1.5K chars (gotcha #53).
> Full verbatim history pre-S40 → git `d2f52ba` + `archive/2026-05-q1..q4.md`. > Full verbatim history pre-S40 → git `d2f52ba` + `archive/2026-05-q1..q4.md`.
> **Renamed S39:** investigator → investigator-codebase (internal half; external → investigator-api). > **Renamed S39:** investigator → investigator-codebase (internal half; external → investigator-api).

View File

@ -1,7 +1,7 @@
# Reviewer Agent — Persistent Memory # Reviewer Agent — Persistent Memory
> **Persistent diary cross-session.** Auto-injected first 200 lines / 25KB at spawn. > **Persistent diary cross-session.** Auto-injected first 200 lines / 25KB at spawn.
> Update BEFORE every stop. Curate when > 25KB. Keep entry ≤ 1.5K chars (gotcha #53). > Update BEFORE every stop. Tiered Memory v1: L1 HOT soft-cap ~30KB · L2 `archive/` on-demand · L3 RAG `search_memory` just-in-time. Keep entry ≤ 1.5K chars (gotcha #53).
> Full verbatim history pre-S40 → git `d2f52ba` + `archive/2026-05-q1..q2.md`. > Full verbatim history pre-S40 → git `d2f52ba` + `archive/2026-05-q1..q2.md`.
--- ---

View File

@ -1,7 +1,7 @@
# Test-Specialist Agent — Persistent Memory # Test-Specialist Agent — Persistent Memory
> **Persistent diary cross-session.** Auto-injected first 200 lines / 25KB at spawn. > **Persistent diary cross-session.** Auto-injected first 200 lines / 25KB at spawn.
> Update BEFORE every stop. Curate when > 25KB. Keep entry ≤ 1.5K chars (gotcha #53). > Update BEFORE every stop. Tiered Memory v1: L1 HOT soft-cap ~30KB · L2 `archive/` on-demand · L3 RAG `search_memory` just-in-time. Keep entry ≤ 1.5K chars (gotcha #53).
> **NEW agent S39 (2026-05-29)** — dedicated test layer (tách khỏi implementer Case 3). > **NEW agent S39 (2026-05-29)** — dedicated test layer (tách khỏi implementer Case 3).
--- ---

View File

@ -50,7 +50,7 @@
**Anti-truncation rules (gotcha #53 — 5× occurrence S35-S37):** **Anti-truncation rules (gotcha #53 — 5× occurrence S35-S37):**
- Brief WRITE agent ≤ 8K (heavy spec ~10K → truncate risk). FE tight brief proven 0 truncation S36. - Brief WRITE agent ≤ 8K (heavy spec ~10K → truncate risk). FE tight brief proven 0 truncation S36.
- Curate MEMORY pre-spawn nếu > 25KB (Investigator 32KB S37 truncate mid-MEMORY). - Tiered Memory v1: L1 HOT soft-cap ~30KB + L2 archive on-demand + L3 RAG just-in-time (per AI_INFRA policy). Investigator 32KB S37 truncate = lesson; soft-cap ~30KB tránh tái diễn.
- Agent keep entry ≤ 1.5K chars (frontmatter rule mỗi agent). - Agent keep entry ≤ 1.5K chars (frontmatter rule mỗi agent).
- Em main grep verify manual nếu agent return truncated mid-task. - Em main grep verify manual nếu agent return truncated mid-task.
- 529 Overload transient → em main solo fallback (KHÔNG retry loop). - 529 Overload transient → em main solo fallback (KHÔNG retry loop).
@ -131,7 +131,13 @@ All 7 agent có 5 RAG MCP: `search_memory` + `search_code` (BM25, prefer over Re
## 💾 Memory discipline ## 💾 Memory discipline
Each agent `.claude/agent-memory/<name>/MEMORY.md` persistent diary. Spawn auto-inject 200 lines/25KB. Update BEFORE return (BẮT BUỘC, entry ≤ 1.5K chars). 7 folder: investigator-codebase (history từ investigator) · investigator-api (NEW seed) · implementer-backend (history từ implementer) · implementer-frontend (NEW seed) · test-specialist (NEW seed) · reviewer · cicd-monitor. Each agent `.claude/agent-memory/<name>/MEMORY.md` persistent diary. Spawn auto-inject first 200 lines/25KB. Update BEFORE return (BẮT BUỘC, entry ≤ 1.5K chars). 7 folder: investigator-codebase · investigator-api · implementer-backend · implementer-frontend · test-specialist · reviewer · cicd-monitor.
**Tiered Memory Policy v1** (adopt AI_INFRA bulletin 2026-05-29 — thay ngưỡng cứng ">25KB archive" bằng tiered + just-in-time; size to ≠ chất lượng, context-rot):
- **L1 HOT** = `MEMORY.md` soft-cap **~30KB** (role + patterns + anti-patterns + 5-8 entry gần nhất) → auto-inject mỗi spawn
- **L2 COLD** = `archive/<YYYY-MM>.md` (activity cũ) → Read on-demand
- **L3 SEARCHABLE** = RAG `search_memory` → just-in-time
- Discipline: search L3 / Read L2 TRƯỚC khi deep-dive (đừng nhồi L1). Agent nhớ vô hạn qua L2+L3, context spawn vẫn gọn. Curate khi L1 > ~30KB (KHÔNG còn hard 25KB).
**End-of-session:** em main SendMessage mỗi agent flush MEMORY → đọc 7 update → synthesize cross-agent → integrate project memory/session log → commit/push. **End-of-session:** em main SendMessage mỗi agent flush MEMORY → đọc 7 update → synthesize cross-agent → integrate project memory/session log → commit/push.