repositories / pi-ext
pi-ext
bugabingas pi extensions
owned by admin
extensions/ultra/workflows/bug.json
Raw{
"name": "bug",
"description": "Settle a correction brief, prove the bug with a regression test, fix it, verify independently, and report explicit outcomes.",
"args": { "hint": "<bug>", "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 this bug without modifying files: {args.bug}. First locate and read applicable AGENTS.md files in the working directory, ancestors and relevant subdirectories. Preserve applicable user instructions and constraints, including their source paths, in instructions. Reproduce or trace the failing path, inspect callers and shared routes, and settle the root cause, minimum correction and regression design. You own approach decisions and missing constraints: do not pass guesses to execution. Give exact affected files/symbols, evidence paths with line or command/log locators, rationale, a test_brief specifying setup/input/expected assertion and expected pre-fix failure, and completion_checks with commands and acceptance criteria. Set ready=true only when this is an executable settled brief with no blockers or material gaps; otherwise ready=false with explicit reasons and needed decisions. Respect schema bounds: use retrievable evidence references, and report overflow or uninspected scope in gaps rather than silently dropping it. Never invent evidence or unsupported assumptions. Return JSON matching Investigation.",
"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 the specified regression test for: {args.bug}. Settled brief: {investigate.results}. First read applicable AGENTS.md files, including the brief's instruction paths and any applicable ancestors/subdirectories. Follow all applicable user instructions and constraints. Execute the test_brief, not a new approach. Do not fix production code. If the brief is contradicted, incomplete or requires a new design decision, stop with ready=false and blockers; do not guess. Run the focused test and set ready=true only when it fails for the expected bug, not a test/environment error, with no blockers or gaps. Return exact command, observed failure and evidence_paths; distinguish checks not run from failures. Within schema bounds, report overflow or missing evidence in gaps with retrieval locators instead of silently omitting it. Return JSON matching Regression.",
"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 this bug: {args.bug}. Settled correction brief: {investigate.results}. Regression proof: {regression.results}. First read applicable AGENTS.md files, including the brief's instruction paths and applicable ancestors/subdirectories. Preserve applicable user instructions and constraints. Implement the specified correction and completion_checks, keeping unrelated edits intact. Do not redesign: if evidence contradicts the brief or missing constraints require judgment, stop with fixed=false and explicit blockers rather than making unsupported assumptions. Run the regression test and relevant checks; list commands, observed outcomes and retrievable evidence_paths. Set fixed=true only when the correction and required checks pass with no blockers or gaps; never call unrun checks passed. Report overflow or missing evidence in gaps, not silent omission. Return JSON matching Fix.",
"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 the bug fix from the {item} perspective. Bug: {args.bug}. Settled brief: {investigate.results}. Regression: {regression.results}. Fix: {fix.results}. First read applicable AGENTS.md files in ancestors and relevant subdirectories; respect applicable user instructions and constraints. Inspect the diff, callers and cited evidence; run permitted focused checks as needed, but do not modify files or remote systems. Do not assume the brief or fix is correct. Set passed=true only when this dimension is checked with no findings or unresolved issues. Findings need precise claim, scope and evidence locators; checks need observed outcomes, not assumed passes. Missing evidence, unsupported assumptions, unrun required checks and overflow belong in unresolved, never a clean pass. Keep independent findings intact, even if another dimension may overlap. Give concrete recommendations for each finding or unresolved issue. Echo dimension as {item}. Return JSON matching Verdict.",
"tools": ["read", "grep", "find", "ls", "bash"],
"model": "large",
"schema": "Verdict"
}
},
{
"id": "report",
"kind": "single",
"step": {
"summary": "Report bug outcome: {args.bug}",
"prompt": "Assemble the final status for bug: {args.bug}. Investigation: {investigate.results}. Investigation failures: {investigate.failures}. Regression: {regression.results}. Regression failures: {regression.failures}. Fix: {fix.results}. Fix failures: {fix.failures}. Verification: {verify.results}. Verification failures: {verify.failures}. This is faithful assembly from settled structured evidence, not new investigation or relevance judgment. Preserve applicable instructions and qualifications. Status rules in precedence order: blocked if investigation/regression is missing or not ready, fix is missing or not fixed, or a prerequisite failure prevented work; give exact blockers and explain downstream skips. Otherwise unresolved if any phase failure, missing verification dimension (expected regression, correctness, security), passed=false verdict, finding, gap, blocker or unresolved issue remains. Completed only when both readiness gates and fixed are true, all three dimensions passed and no such issues remain. An empty/skipped/missing result is never a pass. Carry observed commands/outcomes into checks and all findings and unresolved issues with evidence locators and phase/dimension attribution; never silently deduplicate independent findings. Copy supplied recommendations; for failures or skips recommend resolving the named blocker and rerunning the affected phase and downstream checks, without inventing a fix. On overflow beyond a schema list/string bound, reserve an unresolved entry naming the source phase/field and exact uncovered scope or count with supplied retrievable paths; mark unresolved (or retain blocked), never silently truncate or fabricate paths. Do not claim checks ran or problems were resolved without evidence. Return JSON matching BugReport.",
"model": "medium",
"schema": "BugReport"
}
}
],
"return": "{report.results}"
}