|
|
fb39a48bef
|
refactor: split phase3.go + extract MCP tool registry (R4)
internal/httpapi/phase3.go (2627 lines, 12+ resource domains) split into
15 per-resource files:
- actuator.go: SSH execution machinery (initSSH, sshExec, resolveRunTarget,
executeApprovedAction, jsonErr, gatewayPreflightPassed, resolveTemplate)
- checks.go, classifications.go, executions.go, approvals.go, patterns.go,
skills.go, approval_rules.go, autonomy.go, risk_classes.go,
relationships.go, entity_types.go, metrics.go, agent_activity.go,
helpers.go — one file per resource domain, each with its own imports.
internal/mcp/server.go: newServer (708 lines, 33 inline tool registrations)
refactored to a registry pattern:
- internal/mcp/tools.go (new): toolReg struct + allTools() returning all 33
tool definitions. Handler logic moved verbatim — no changes to tool names,
descriptions, schemas, or behavior.
- server.go: newServer is now 9 lines (iterate registry, AddTool each).
-699 lines.
No function logic, names, or signatures changed. go vet, build, and all
tests pass (httpapi, mcp, db, policy).
|
2026-07-17 22:41:40 +02:00 |
|