From 18d397f0957990e76708c479def198b4ad9a9286 Mon Sep 17 00:00:00 2001 From: pqhuy1987 Date: Mon, 8 Jun 2026 15:34:02 +0700 Subject: [PATCH] =?UTF-8?q?[CLAUDE]=20Docs:=20S53=20H1-gate=20residual=20f?= =?UTF-8?q?ixes=20=E2=80=94=20ef-core=20Mig=2044-47=20table=20rows=20+=20c?= =?UTF-8?q?ount=20stragglers=20+=20database-agent=20verified-runtime=20fli?= =?UTF-8?q?p?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Session-end H1 tooling-chốt (formal monitor gate on /session-end re-trigger) caught 4 residuals em-main self-check missed: - ef-core-migration/SKILL.md: added Mig 44/45/46/47 table rows + totals 91->92 bang / last Mig 43->47 (header said 47 but body stopped at 43 — internal contradiction). - dependency-audit-erp/SKILL.md:153 gotcha 56->57. - agents/README.md:155 'All 10 agent'->11 (RAG-MCP grant line straggler). - database-agent.md: SELF-CHECK [x] verified-runtime S53 + nac reword (honest: DB1/DB10 exercised, DB2-DB11 per-task). H2 harvest gate PASS 5/5 (separate run). Tree was clean before this; this closes the H1 residual loop. Co-Authored-By: Claude Opus 4.8 (1M context) --- .claude/agents/README.md | 2 +- .claude/agents/database-agent.md | 6 +++--- .claude/skills/dependency-audit-erp/SKILL.md | 2 +- .claude/skills/ef-core-migration/SKILL.md | 6 +++++- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.claude/agents/README.md b/.claude/agents/README.md index cacbb85..d06ed15 100644 --- a/.claude/agents/README.md +++ b/.claude/agents/README.md @@ -152,7 +152,7 @@ ## 🔧 Tool grant (S39 — +3 RAG MCP per agent) -All 10 agent có **4 RAG-READ MCP**: `search_memory` + `search_code` (BM25, prefer over Read full file — tiết kiệm token) + `cross_project_search` + `list_projects`. Base tools per role (READ: Read/Grep/Glob/Bash [+WebFetch/Search cho api] · WRITE: +Edit/Write/Skill). +All 11 agent có **4 RAG-READ MCP**: `search_memory` + `search_code` (BM25, prefer over Read full file — tiết kiệm token) + `cross_project_search` + `list_projects`. Base tools per role (READ: Read/Grep/Glob/Bash [+WebFetch/Search cho api] · WRITE: +Edit/Write/Skill). > **2 monitor sub (tooling-auditor H1 + harvest-curator H2 — 2026-06-07):** read-only toolset = `[Read, Grep, Glob, Bash, +4 RAG-read]`, **NO `store_memory`, NO Write/Edit** (mirror investigator read-set). INFORM-only — propose → em main single-writer VERIFY→APPEND (B3). 🔴 **G-015 accuracy:** đây KHÔNG = "read-only enforced" — sub vẫn giữ `Bash` (write-channel mở qua shell/curl). Containment thật = em main single-writer + **git-diff + chunk-count post-session** (defense-in-depth), KHÔNG allowlist đơn-độc. diff --git a/.claude/agents/database-agent.md b/.claude/agents/database-agent.md index a01df73..ab711df 100644 --- a/.claude/agents/database-agent.md +++ b/.claude/agents/database-agent.md @@ -46,11 +46,11 @@ maxTurns: 25 - [x] frontmatter `model: inherit` — KHÔNG `...[1m]` (gotcha #37). - [x] `description` dùng block scalar `|` (parse-safe, no colon-space break). - [x] Đủ DB1–DB11 (THÊM only-if-increase, 0 hạ floor) · DB2 destructive-guard + DB11 concurrency hiện diện rõ. -- [ ] Skill `sql-database-assistant` + `ef-core-migration` verify-present + active (session-end tooling-auditor H1 confirm). +- [x] Skill `sql-database-assistant` + `ef-core-migration` verify-present + active (S53 tooling-auditor H1 confirmed). - [x] `store_memory` KHÔNG có trong `tools:` (adap #1) · 4 RAG-read giữ. -- [ ] **Restart Claude Code** (agent no hot-reload) → spawn-test 1 task DB nhỏ (đọc schema 1 bảng `sys.tables` / introspect ItTicket) kiểm chạy thật → upgrade executed-file → verified-runtime. +- [x] **VERIFIED-RUNTIME (S53 2026-06-08)** — CLI restarted, spawn-test ran live (LocalDB Dev+Design: `__EFMigrationsHistory` read + ItTickets introspect + caught Mig 46-unapplied-local drift). executed-file → verified-runtime DONE. ## Accuracy (G-015 — KHÔNG overclaim) - Schema/perf-claim đo qua introspection + query-plan THẬT (`sqlcmd`/`dotnet ef`), KHÔNG narrative trí-nhớ. - DB7 scope-DB-only + READ-advisory tier = PHÂN-VAI, KHÔNG "read-only enforced" (agent vẫn giữ `Bash` → write-channel qua shell mở; containment = em main single-writer + git-diff post-session, defense-in-depth). -- Nấc đúng: **executed-file** (floor DB1–DB11 trong .md này) vs **verified-runtime** (spawn-test sau anh restart CLI) — KHÔNG claim runtime trước restart (§C5/§G-011). +- Nấc: **verified-runtime (S53)** — spawn-test confirmed agent loads + DB1/DB10 introspection chạy thật (LocalDB connect + schema read). KHÔNG overclaim: DB2–DB11 floor (vd DB11 RowVersion concurrency) là in-file, exercised per-task khi phát sinh — chỉ DB1/DB10 ran lần spawn đầu. diff --git a/.claude/skills/dependency-audit-erp/SKILL.md b/.claude/skills/dependency-audit-erp/SKILL.md index fc18ecb..3636e32 100644 --- a/.claude/skills/dependency-audit-erp/SKILL.md +++ b/.claude/skills/dependency-audit-erp/SKILL.md @@ -150,6 +150,6 @@ Lưu vào `docs/changelog/deps-audit-{YYYY-MM-DD}.md` nếu có action. ## Related -- `docs/gotchas.md` — 56 bẫy package compat / CI / IIS / Identity / per-NV refactor / SQLite tie-break đã gặp +- `docs/gotchas.md` — 57 bẫy package compat / CI / IIS / Identity / per-NV refactor / SQLite tie-break đã gặp - `docs/changelog/migration-todos.md` Phase 5.1 — checklist deps scan CI - `SolutionErp.slnx` + `global.json` — .NET version pin diff --git a/.claude/skills/ef-core-migration/SKILL.md b/.claude/skills/ef-core-migration/SKILL.md index ce01f3a..373dbec 100644 --- a/.claude/skills/ef-core-migration/SKILL.md +++ b/.claude/skills/ef-core-migration/SKILL.md @@ -63,8 +63,12 @@ when-to-use: | **41** | **`WireWorkflowAppsApprovalV2`** | **🎯 Phase 11 P11-A (S42) — +4 `{Leave,Ot,Travel,Vehicle}LevelOpinions` (UNIQUE composite + Cascade/Restrict) + `WorkflowAppCodeSequences` (atomic MaDonTu) + 4 ALTER `RejectedFromStatus` + enum `TravelRequest=9`.** | | **42** | **`AddLeaveBalances`** | **🎯 Phase 11 P11-B (S43) — 1 bảng `LeaveBalances` (User×LeaveType×Year + Entitled/Used/Adjustment, UNIQUE composite + FK LeaveTypes Restrict). Trừ phép tự động khi đơn nghỉ duyệt cuối.** | | **43** | **`FilterHolidayUniqueIndexByIsDeleted`** | **🎯 S45 — DropIndex + CreateIndex `IX_Holidays_Year_Date` UNIQUE filtered `WHERE [IsDeleted]=0` (was unfiltered). Fix reachable 500 khi recreate ngày lễ trên slot soft-deleted. Không bảng mới (table vẫn 91). gotcha #57 — soft-delete UNIQUE phải filter.** | +| **44** | **`AddVehicleAndDriverCatalogs`** | **🎯 Phase 11 P11-C (S51) — 2 catalog `Vehicles` + `Drivers` (`AuditableEntity`, filtered-unique Code day-1). Extend HrmConfigs declarative. Tables 91→92.** | +| **45** | **`FilterHrmCatalogUniqueIndexesByIsDeleted`** | **🎯 S51 — LeaveType + ShiftPattern + OtPolicy Code UNIQUE filtered `WHERE [IsDeleted]=0` (3 HRM catalog, gotcha #57 EXT). Index-only.** | +| **46** | **`AddSlaFieldsToItTicket`** | **🎯 Phase 11 P11-D (S52) — ItTickets +SlaDueAt/SlaWarnedSent/SlaBreached (SLA timer). Column-only, no new table.** | +| **47** | **`FilterMasterCatalogUniqueIndexesByIsDeleted`** | **🎯 S53 — Department + Supplier + Project Code UNIQUE filtered `WHERE [IsDeleted]=0` (gotcha #57 EXT Master, 6× cumulative). Index-only.** | -Total: **91 bảng** dbo + `__EFMigrationsHistory` (last Mig 43 FilterHolidayUniqueIndexByIsDeleted, index-only). Xem `docs/database/schema-diagram.md` migration table + §11-15 module ERD (§16+ Mig 27-42 chi tiết pending). +Total: **92 bảng** dbo + `__EFMigrationsHistory` (last Mig 47 FilterMasterCatalogUniqueIndexesByIsDeleted, index-only). Xem `docs/database/schema-diagram.md` migration table + §11-15 module ERD (§16+ Mig 27-47 chi tiết pending). ## N-stage workflow pattern (Mig 18-20 — Session 12-13)