{ "name": "bug", "description": "Settle a correction brief, prove the bug with a regression test, fix it, verify independently, and report explicit outcomes.", "args": { "hint": "", "params": ["bug"] }, "schemas": { "Investigation": { "type": "object", "additionalProperties": false, "properties": { "ready": { "type": "boolean", "description": "True only for a settled, evidence-backed correction and regression brief with no blockers or material gaps." }, "summary": { "type": "string", "maxLength": 1600 }, "reproduction": { "type": "string", "maxLength": 2400 }, "likely_cause": { "type": "string", "maxLength": 2400 }, "correction": { "type": "string", "maxLength": 3200 }, "test_brief": { "type": "string", "maxLength": 3200 }, "rationale": { "type": "string", "maxLength": 2400 }, "instructions": { "type": "array", "maxItems": 16, "items": { "type": "string", "maxLength": 1600 } }, "files": { "type": "array", "maxItems": 20, "items": { "type": "string", "maxLength": 1024 } }, "evidence_paths": { "type": "array", "maxItems": 20, "items": { "type": "string", "maxLength": 1600 } }, "completion_checks": { "type": "array", "maxItems": 12, "items": { "type": "string", "maxLength": 1600 } }, "blockers": { "type": "array", "maxItems": 12, "items": { "type": "string", "maxLength": 1600 } }, "gaps": { "type": "array", "maxItems": 12, "items": { "type": "string", "maxLength": 1600 } } }, "required": [ "ready", "summary", "reproduction", "likely_cause", "correction", "test_brief", "rationale", "instructions", "files", "evidence_paths", "completion_checks", "blockers", "gaps" ] }, "Regression": { "type": "object", "additionalProperties": false, "properties": { "ready": { "type": "boolean", "description": "True only when the specified regression test fails for the expected bug, not a test or environment error, with no blockers or gaps." }, "test_files": { "type": "array", "maxItems": 12, "items": { "type": "string", "maxLength": 1024 } }, "command": { "type": "string", "maxLength": 1600 }, "failure": { "type": "string", "maxLength": 3200 }, "evidence_paths": { "type": "array", "maxItems": 12, "items": { "type": "string", "maxLength": 1600 } }, "blockers": { "type": "array", "maxItems": 12, "items": { "type": "string", "maxLength": 1600 } }, "gaps": { "type": "array", "maxItems": 12, "items": { "type": "string", "maxLength": 1600 } } }, "required": [ "ready", "test_files", "command", "failure", "evidence_paths", "blockers", "gaps" ] }, "Fix": { "type": "object", "additionalProperties": false, "properties": { "fixed": { "type": "boolean", "description": "True only when the settled correction, regression test and completion checks pass with no blockers or gaps." }, "summary": { "type": "string", "maxLength": 2400 }, "modified_files": { "type": "array", "maxItems": 20, "items": { "type": "string", "maxLength": 1024 } }, "checks": { "type": "array", "maxItems": 16, "items": { "type": "string", "maxLength": 1600 } }, "evidence_paths": { "type": "array", "maxItems": 16, "items": { "type": "string", "maxLength": 1600 } }, "blockers": { "type": "array", "maxItems": 12, "items": { "type": "string", "maxLength": 1600 } }, "gaps": { "type": "array", "maxItems": 12, "items": { "type": "string", "maxLength": 1600 } } }, "required": [ "fixed", "summary", "modified_files", "checks", "evidence_paths", "blockers", "gaps" ] }, "Verdict": { "type": "object", "additionalProperties": false, "properties": { "dimension": { "type": "string", "enum": ["regression", "correctness", "security"] }, "passed": { "type": "boolean" }, "findings": { "type": "array", "maxItems": 12, "items": { "type": "string", "maxLength": 2000 } }, "checks": { "type": "array", "maxItems": 12, "items": { "type": "string", "maxLength": 1600 } }, "unresolved": { "type": "array", "maxItems": 12, "items": { "type": "string", "maxLength": 1600 } }, "recommendations": { "type": "array", "maxItems": 12, "items": { "type": "string", "maxLength": 1600 } } }, "required": [ "dimension", "passed", "findings", "checks", "unresolved", "recommendations" ] }, "BugReport": { "type": "object", "additionalProperties": false, "properties": { "status": { "type": "string", "enum": ["completed", "blocked", "unresolved"] }, "summary": { "type": "string", "maxLength": 2400 }, "blockers": { "type": "array", "maxItems": 24, "items": { "type": "string", "maxLength": 1600 } }, "unresolved": { "type": "array", "maxItems": 48, "items": { "type": "string", "maxLength": 1600 } }, "checks": { "type": "array", "maxItems": 52, "items": { "type": "string", "maxLength": 1600 } }, "findings": { "type": "array", "maxItems": 36, "items": { "type": "string", "maxLength": 2000 } }, "recommendations": { "type": "array", "maxItems": 36, "items": { "type": "string", "maxLength": 1600 } } }, "required": [ "status", "summary", "blockers", "unresolved", "checks", "findings", "recommendations" ] } }, "phases": [ { "id": "investigate", "kind": "single", "step": { "summary": "Settle correction and regression brief: {args.bug}", "prompt": "Investigate {args.bug}; do not edit. Read applicable AGENTS.md (cwd, ancestors, relevant subdirs) and record user/repo constraints with source paths. Reproduce or trace failure; inspect callers/shared routes; settle root cause, minimum fix and regression design. Specify exact files/symbols, evidence locators, rationale, test setup/input/assertion and expected pre-fix failure, plus completion checks with observable contracts, commands, expected outcomes and evidence. For wide migrations/new provider routes, require an authorized representative child/tool/schema canary before expansion. Separate optional optimization. ready=true only for an executable settled brief without blockers/material gaps; otherwise state reasons/decisions. Never guess or invent evidence; report overflow/uninspected scope in gaps. Return Investigation JSON.", "tools": ["read", "grep", "find", "ls", "bash"], "model": "large", "schema": "Investigation" } }, { "id": "regression", "kind": "single", "when": "{investigate.results | where ready}", "step": { "summary": "Create regression test: {args.bug}", "prompt": "Create only the specified regression test for {args.bug}, following settled brief {investigate.results}. Read applicable AGENTS.md, including cited instruction paths; preserve constraints. Do not fix production code or redesign. If brief is contradicted/incomplete or requires a decision, ready=false with blockers. Run focused test; ready=true only for expected bug failure, not test/environment error, and no gaps/blockers. Report exact command, observed failure, changed test files, remaining scope, unrun checks and evidence locators; distinguish unrun from failed. Separate optional work; report overflow/missing evidence in gaps. Return Regression JSON.", "tools": ["read", "grep", "find", "ls", "bash", "edit", "write"], "model": "medium", "schema": "Regression" } }, { "id": "fix", "kind": "single", "when": "{regression.results | where ready}", "step": { "summary": "Implement settled correction: {args.bug}", "prompt": "Fix {args.bug} per brief {investigate.results} and regression {regression.results}. Read applicable AGENTS.md, including cited paths; preserve constraints and unrelated edits. Implement only specified correction/checks. If contradicted or new judgment needed, fixed=false with blockers. For wide migrations/new routes, prove authorized representative child/tool/schema canary before expansion. Run regression and required checks; report changed files, remaining scope, exact commands/outcomes, unrun checks and evidence. fixed=true only if all required work/checks pass without gaps/blockers; unrun ≠ pass. Separate optional work; report overflow/missing evidence in gaps. Return Fix JSON.", "tools": ["read", "grep", "find", "ls", "bash", "edit", "write"], "model": "medium", "schema": "Fix" } }, { "id": "verify", "kind": "fanout", "when": "{fix.results | where fixed}", "over": ["regression", "correctness", "security"], "step": { "summary": "Verify fix from {item} perspective", "prompt": "Independently verify {args.bug} from {item}. Brief: {investigate.results}; regression: {regression.results}; fix: {fix.results}. Read applicable AGENTS.md; inspect diff, callers and cited evidence; permitted focused checks only. No local/remote mutations; do not assume brief/fix correct. passed=true only after adequate dimension check with no findings/unresolved. Give claims, scope, locators, observed check outcomes and concrete recommendations. Missing evidence, assumptions, unrun required checks or overflow → unresolved. Preserve independent findings; echo dimension. Return Verdict JSON.", "tools": ["read", "grep", "find", "ls", "bash"], "model": "large", "schema": "Verdict" } }, { "id": "report", "kind": "single", "step": { "summary": "Report bug outcome: {args.bug}", "prompt": "Assemble BugReport for {args.bug}. Investigation: {investigate.results}; failures: {investigate.failures}. Regression: {regression.results}; failures: {regression.failures}. Fix: {fix.results}; failures: {fix.failures}. Verification: {verify.results}; failures: {verify.failures}. Faithfully preserve evidence, qualifications and instructions; do no new investigation/judgment. Status precedence: blocked if readiness/regression/fix missing or false, or prerequisite failure prevented work; otherwise unresolved for any failure, missing expected dimension (regression/correctness/security), failed verdict, finding, gap, blocker or unresolved issue; completed only when all readiness/fix gates and dimensions pass with none outstanding. Missing/skipped/empty ≠ pass. Carry observed commands/outcomes, locators and phase/dimension attribution; retain independent findings. Copy recommendations; for skips/failures recommend resolving blocker and rerunning affected/downstream phases. On overflow, record source phase/field, uncovered scope/count and supplied locators; never silently truncate, fabricate paths, or claim unsupported work. Return BugReport JSON.", "model": "medium", "schema": "BugReport" } } ], "return": "{report.results}" }