[CLAUDE] Docs: S53 closeout — gotcha #57 EXT Master (Mig 47) + P11-D/E + database-agent verified-runtime + doc-drift

Session 53 closeout (HMW-mode ON, 'làm hết' full close). Code already shipped in 44b9e54 (Mig 47, Run #260) + dbf6648 (C+D, Run #261), both prod-verified.

- STATUS/HANDOFF: S53 entry (mig 46->47, test 200->203, menu +Off_AttendanceReport, bundle admin DfCfHUE9, database-agent verified-runtime).
- Doc-drift E (H1 top-5): ef-core skill 43->47, agents/README roster 10->11 + plugin nac, CLAUDE.md root 45->47 mig + 186->203 test, docs/CLAUDE.md 56->57 gotcha + 91->92 ERD.
- adap-report: database-agent executed-file -> verified-runtime (spawn-test caught Mig 46-unapplied-local).
- session log 2026-06-08-S53 + 4 agent diaries (S53 work).
- Memory: +project_database_agent_verified_local_drift (user-memory, outside repo).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
pqhuy1987
2026-06-08 15:24:45 +07:00
parent dbf66489a9
commit d8cd111532
13 changed files with 155 additions and 31 deletions

View File

@ -6,7 +6,7 @@
`2026-06-08-Agent-database-codebase-agents` (from: ai_infra · category: **Agent** · reviewer_gate: **PASS_WITH_FIXES-applied** · nac: published · targets: **all-fit** · content_sha256 `76de8f24…`). 2 agent KHUNG: **A `database-agent`** (floor DB1DB11, EF-Core/SQL-Server-centric) + **B `codebase-agent`** (floor CB1CB8, .NET semantic + LSP). Recon-grounded: AI_INFRA quét 6/6 sister = .NET + EF Core + SQL Server → 2 floor universal.
## 2. nac G-011
**executed-file** (database-agent.md tailored + agent-memory seed + agents/README roster 10→11 5-điểm sync) → **VERIFIED-pending CLI restart** (agent `.md` no hot-reload → cần (a) anh restart Claude Code để registry load `database-agent`, (b) 1 spawn-test task DB nhỏ — đọc schema 1 bảng `sys.tables` / introspect ItTicket — confirm load OK + chạy DB1DB11 thật). **codebase-agent = SKIP n-a** (KHÔNG executed — lý do §3).
**VERIFIED-RUNTIME (S53 2026-06-08)** — CLI restarted (registry loaded `database-agent`), spawn-test ran live: connected LocalDB `(localdb)\MSSQLLocalDB` (Dev+Design), read `__EFMigrationsHistory`, introspected `ItTickets` schema, queried `sys.tables`/`sys.columns`**caught 2 real drifts** (Mig 46 committed-but-unapplied-local + table-count 93 raw = 92 domain + `__EFMigrationsHistory`). DB1/DB10 floor exercised. (S52 executed-file → S53 upgraded.) **codebase-agent = SKIP n-a** (KHÔNG executed — lý do §3).
## 3. evidence
**PROJECT-FIT:**
@ -26,7 +26,7 @@
- `store_memory` KHÔNG trong `tools:` (adap #1) · 4 RAG-read giữ. ✓ (`grep store_memory .claude/agents/database-agent.md` = 0 post-write)
- Restart + spawn-test → verified-runtime. ⏳ (defer session-end/next-session)
commit-sha: **pending S52** (governance .md → CI path-ignore skip; fill sau commit).
commit-sha: **`e9ee97f`** (S52 adopt, governance .md → CI path-ignore skip) · **verified-runtime S53** (this session, spawn-test).
## 4. tailored-gì + skip-gì-vì-sao
- **FUNCTION-floor adopt FULLY:** DB1DB11 giữ đủ canonical (0 hạ). DB2 destructive-guard + DB11 RowVersion concurrency + DB3 EF-Core discipline + DB6 3-file rule — nguyên vẹn.
@ -40,7 +40,7 @@ commit-sha: **pending S52** (governance .md → CI path-ignore skip; fill sau co
- **SKIP codebase-agent = n-a** (KHÔNG behind — investigator cover + csharp-lsp Windows no-op; §3). Đúng floor broadcast "skip nếu investigator đủ, KHÔNG thêm trùng".
## 5. honest-caveat
- **Nấc = executed-file, KHÔNG verified-runtime.** database-agent CHƯA spawn lần nào (agent `.md` no hot-reload) → DB1DB11 mới là floor-trong-file, chưa chạy thật. Anh restart CLI → spawn-test mới upgrade verified-runtime. KHÔNG claim "database-agent đang hoạt động".
- **Nấc = VERIFIED-RUNTIME (S53 2026-06-08).** database-agent spawn-test PASSED — load OK + DB1/DB10 introspection chạy thật (LocalDB connect + `__EFMigrationsHistory` read + schema introspect). **Value-add proven on first spawn:** read-advisory DB lens caught local-DB drift (Mig 46 unapplied) mà 200/203 tests (SQLite) + prod (CI-applied) đều MISS — đúng gap roster cũ không cover. (S52 executed-file → S53 upgraded; KHÔNG còn pre-restart caveat.)
- **G-015 KHÔNG overclaim:** DB7 scope-DB-only + READ-advisory tier = **PHÂN-VAI**, KHÔNG "read-only enforced" — agent giữ `Bash` (write-channel shell mở) + Skill. Containment thật = em main single-writer + git-diff post-session (defense-in-depth), KHÔNG allowlist đơn-độc.
- **Value-add chưa proven-runtime:** lý-lẽ "lấp DB-layer gap + DB11 vá S43 lost-update" = thiết-kế-hợp-lý, nhưng ROI thực phụ thuộc tần-suất task DB-design/concurrency phát sinh. Nếu sau vài session database-agent idle (investigator+reviewer đã đủ) → re-assess prune (tránh roster bloat 11-agent). Theo dõi @tooling-auditor H1 (idle/scope-drift check).
- **skill active-verify pending:** `sql-database-assistant` present trong skill-list nhưng chưa smoke-test trong vai database-agent; `ef-core-migration` project skill OK. tooling-auditor H1 @session-end confirm "đã-map-vai chưa".