Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ done
| G3 | 所有状态变更 MCP tool 必须幂等 |
| G4 | Breaking change 只能通过新增 tool 实现,不修改现有 schema |
| G5 | 生产代码不得新增 `unwrap`/`expect`(RF-6) |
| T11 | `mcp/tools/*` 不得直接调用 `rusqlite::Connection`,必须通过 registry 封装(已知例外:`repo.rs`、`brief.rs`、`impact.rs`) |
| T11 | `mcp/tools/*` 不得直接调用 `rusqlite::Connection`,必须通过 registry 封装(已知例外:`repo.rs`、`repo/nl_query.rs`、`brief.rs`、`impact.rs`) |
| T12 | `tui/render/*` 是纯消费者层,禁止写入 registry |

CI 通过 `scripts/invariant-checks/run-checks.ps1` 检测 G5 / T11 / T12 / README+Cargo.toml 完整性。
Expand Down
8 changes: 4 additions & 4 deletions KNOWN_ISSUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@

## P2 — 架构债务

### `mcp/tools/repo.rs` 730 行
### ~~`mcp/tools/repo.rs` 730 行~~

**现状**:已从 2376 行拆至 730 行,但仍超过理想阈值(~300 行/模块)。
**现状**:~~已从 2376 行拆至 730 行,但仍超过理想阈值(~300 行/模块)。~~

**计划**:按 domain 拆分为 `repo_health.rs` + `repo_query.rs` + `repo_index.rs`。已有 `docs/architecture/split-plan.md`。
**结果**:**已完成** — 拆分为 `repo/{scan,health,sync,index,query_repos,nl_query}.rs`,入口 `repo.rs` 降至 ~100 行。计划详见 `docs/architecture/split-plan.md`。

### `src/mcp/mod.rs` 工具枚举集中化

**现状**:`McpToolEnum` 是包含 68 个变体的 giant enum,`tier()` 方法是 200+ 行的 match 表达式。
**现状**:`McpToolEnum` 是包含 71 个变体的 giant enum,`tier()` 方法是 200+ 行的 match 表达式。

**影响**:新增工具需要修改 3 处(enum 定义、match arm、tier match),容易遗漏。

Expand Down
1 change: 1 addition & 0 deletions scripts/invariant-checks/run-checks.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ Write-CheckHeader "T11: mcp/tools direct rusqlite::Connection check"

$knownT11Exceptions = @(
"src/mcp/tools/repo.rs",
"src/mcp/tools/repo/nl_query.rs",
"src/mcp/tools/brief.rs",
"src/mcp/tools/impact.rs"
)
Expand Down
Loading
Loading