Validation
validate
Unified validation tool with five phases covering pre-implementation checks, post-implementation verification, violation listing, compound gates, and safety analysis.
Absorbs: validate_plan (phase=“pre”), verify_implementation (phase=“post”), get_violations (phase=“list”), plan_context (phase=“full”), check_plan_safety (phase=“safety”).
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
phase | string | No | pre (default), post, list, full, or safety. |
changes | string | phase=pre/full | JSON array of proposed changes. |
check_safety | boolean | No | When true with phase=pre, also runs failure-episode safety check. |
plan_description | string | No | Natural language plan description. Used by phase=pre (safety) and phase=safety/full. |
skip_logic_checks | boolean | No | Skip heuristic logic checks. phase=pre only. Default false. |
files_written | string | phase=post | JSON array of written file paths. |
task_id | string | No | Task ID for phase=post verification or phase=full relevance. |
rule_id | string | No | Filter violations to a rule ID. phase=list only. |
include_log | boolean | No | Include historical violation log. phase=list only. |
log_limit | number | No | Max log entries. phase=list only. Default 50. |
target | string | phase=full | Entity/file for scope assessment. |
file | string | No | File path suffix to disambiguate. phase=full only. |
agent_id | string | No | Agent identifier for attribution. |
project_id | string | No | Repo context for scoping failure search. phase=safety only. |
Phase: pre (default)
Check proposed changes against architectural rules before writing code.
{ "tool": "validate", "arguments": { "phase": "pre", "changes": "[{\"file\": \"internal/mcp/server.go\", \"description\": \"add new tool\"}]", "check_safety": true }}Phase: post
Verify files after writing. Checks that written code conforms to rules.
{ "tool": "validate", "arguments": { "phase": "post", "files_written": "[\"internal/mcp/server.go\"]", "task_id": "task-123" }}Phase: list
List current rule violations, optionally filtered by rule ID.
{ "tool": "validate", "arguments": { "phase": "list", "include_log": true, "log_limit": 20 }}Phase: full
Compound pre-implementation gate: safety + rules + scope assessment.
{ "tool": "validate", "arguments": { "phase": "full", "target": "handleLogin", "changes": "[{\"file\": \"auth.go\", \"description\": \"refactor login\"}]" }}Phase: safety
Search failure episodes for similar past failures to avoid repeating mistakes.
{ "tool": "validate", "arguments": { "phase": "safety", "plan_description": "Refactor authentication to use JWT tokens" }}Note: phases post, list, and full require a code graph. In knowledge-only mode, only phase=pre and phase=safety are available.