Luigit
repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by admin

extensions/ultra/workflows/review.json

Raw
{
	"name": "review",
	"description": "Review a target across independent dimensions, verify evidence-rich findings, and report confirmed defects and unresolved coverage explicitly.",
	"args": { "hint": "[target]", "params": ["target"] },
	"schemas": {
		"Findings": {
			"type": "object",
			"additionalProperties": false,
			"properties": {
				"dimension": {
					"type": "string",
					"enum": ["correctness", "security", "performance"]
				},
				"findings": {
					"type": "array",
					"maxItems": 12,
					"items": {
						"type": "object",
						"additionalProperties": false,
						"properties": {
							"id": {
								"type": "string",
								"maxLength": 96,
								"pattern": "^(correctness|security|performance):[A-Za-z0-9_-]+$",
								"description": "Globally unique dimension prefix plus a locally unique identifier, for example correctness:1."
							},
							"title": { "type": "string", "minLength": 1, "maxLength": 240 },
							"file": { "type": "string", "minLength": 1, "maxLength": 1024 },
							"claim": { "type": "string", "minLength": 1, "maxLength": 2000 },
							"evidence": {
								"type": "string",
								"minLength": 1,
								"maxLength": 3200,
								"description": "Precise paths/lines, symbols, diff/ref locators or observed commands/results supporting the claim."
							},
							"scope": {
								"type": "string",
								"minLength": 1,
								"maxLength": 1600,
								"description": "Affected behavior, triggering conditions and inspected target revision/range."
							},
							"instructions": {
								"type": "array",
								"maxItems": 12,
								"items": { "type": "string", "maxLength": 1600 }
							}
						},
						"required": [
							"id",
							"title",
							"file",
							"claim",
							"evidence",
							"scope",
							"instructions"
						]
					}
				},
				"blockers": {
					"type": "array",
					"maxItems": 12,
					"items": { "type": "string", "maxLength": 1600 }
				},
				"gaps": {
					"type": "array",
					"maxItems": 12,
					"items": { "type": "string", "maxLength": 1600 }
				}
			},
			"required": ["dimension", "findings", "blockers", "gaps"]
		},
		"Verdict": {
			"type": "object",
			"additionalProperties": false,
			"properties": {
				"id": {
					"type": "string",
					"maxLength": 96,
					"pattern": "^(correctness|security|performance):[A-Za-z0-9_-]+$"
				},
				"title": { "type": "string", "minLength": 1, "maxLength": 240 },
				"file": { "type": "string", "minLength": 1, "maxLength": 1024 },
				"status": {
					"type": "string",
					"enum": ["confirmed", "refuted", "unresolved"]
				},
				"why": {
					"type": "string",
					"minLength": 1,
					"maxLength": 4000,
					"description": "Required evidence-backed explanation, including inspected paths/lines or commands and what remains unknown."
				}
			},
			"required": ["id", "title", "file", "status", "why"]
		},
		"ReviewReport": {
			"type": "object",
			"additionalProperties": false,
			"properties": {
				"status": {
					"type": "string",
					"enum": ["completed", "blocked", "unresolved"]
				},
				"summary": { "type": "string", "maxLength": 1600 },
				"analysis": { "type": "string", "maxLength": 4000 },
				"blockers": {
					"type": "array",
					"maxItems": 36,
					"items": { "type": "string", "maxLength": 1600 }
				},
				"findings": {
					"type": "array",
					"maxItems": 36,
					"items": {
						"type": "object",
						"additionalProperties": false,
						"properties": {
							"id": {
								"type": "string",
								"maxLength": 96,
								"pattern": "^(correctness|security|performance):[A-Za-z0-9_-]+$"
							},
							"title": { "type": "string", "minLength": 1, "maxLength": 240 },
							"file": { "type": "string", "minLength": 1, "maxLength": 1024 },
							"why": { "type": "string", "minLength": 1, "maxLength": 4000 },
							"severity": {
								"type": "string",
								"enum": ["critical", "high", "medium", "low"]
							}
						},
						"required": ["id", "title", "file", "why", "severity"]
					}
				},
				"unresolved": {
					"type": "array",
					"maxItems": 48,
					"items": {
						"type": "object",
						"additionalProperties": false,
						"properties": {
							"id": { "type": "string", "minLength": 1, "maxLength": 96 },
							"title": { "type": "string", "minLength": 1, "maxLength": 240 },
							"file": {
								"type": "string",
								"maxLength": 1024,
								"description": "Original file for candidates; empty only for coverage/phase gaps with no known file."
							},
							"why": { "type": "string", "minLength": 1, "maxLength": 4000 }
						},
						"required": ["id", "title", "file", "why"]
					}
				},
				"recommendations": {
					"type": "array",
					"maxItems": 36,
					"items": { "type": "string", "maxLength": 2000 }
				}
			},
			"required": [
				"status",
				"summary",
				"analysis",
				"blockers",
				"findings",
				"unresolved",
				"recommendations"
			]
		}
	},
	"phases": [
		{
			"id": "review",
			"kind": "fanout",
			"over": ["correctness", "security", "performance"],
			"step": {
				"summary": "Review target for {item} issues",
				"prompt": "Independently review the requested target for {item} issues. Target: {args.target}. First locate and read applicable AGENTS.md files in the working directory, ancestors and inspected subdirectories. Respect applicable user instructions and constraints. The target may be a PR, branch/ref, recent changes, folder or file; if empty inspect the working tree and recent local changes. Inspect the relevant diff or file scope with read/grep/find/ls and read-only bash commands. Do not modify files or remote systems. Do not make unsupported assumptions about the target, behavior or coverage: report access blockers and uncertain scope. Echo dimension as {item}. Each finding must have a globally unique id formed from the dimension prefix {item} plus colon plus a locally unique identifier; never reuse an id within this scan. Preserve each independent finding, even if another dimension may overlap. Provide a precise atomic claim, affected file, evidence with paths/lines/symbols and observed results, scope with triggering conditions and target revision/range, and applicable instructions with source paths needed by verification. Stay within 12 findings: report overflow count if known, exact uncovered scope and retrievable locators in gaps rather than silently losing findings or claiming complete coverage. Never invent evidence or paths. Return JSON matching Findings.",
				"tools": ["read", "bash", "grep", "find", "ls"],
				"model": "large",
				"schema": "Findings"
			}
		},
		{
			"id": "verify",
			"kind": "fanout",
			"over": "{review.results[].findings[]}",
			"step": {
				"summary": "Verify one candidate finding",
				"prompt": "Adversarially verify this candidate against the original target: {args.target}. Finding packet: {item}. First read applicable AGENTS.md files, including packet instruction paths and applicable ancestors/subdirectories, and respect applicable user instructions and constraints. Use read/grep/find/ls and read-only bash commands to inspect the actual target diff/ref, cited files, callers and counterevidence. Do not modify files or remote systems. Echo id, file and title verbatim. Return status confirmed only when inspected evidence establishes the precise claim in its stated scope; refuted only when inspected counterevidence disproves it; unresolved when evidence, access, instructions, target identity or scope is insufficient. Uncertainty is never refutation. why is required for every status: name the evidence inspected with precise retrievable locators, explain what it supports or contradicts, and state remaining unknowns or blocked checks. Never imply execution or inspection that did not happen, or invent unsupported assumptions. Within the why bound preserve evidence references and explicitly name overflow or uninspected scope; mark unresolved if that prevents a settled verdict. Return JSON matching Verdict.",
				"tools": ["read", "bash", "grep", "find", "ls"],
				"model": "large",
				"schema": "Verdict"
			}
		},
		{
			"id": "report",
			"kind": "single",
			"step": {
				"summary": "Synthesize review analysis and next steps",
				"prompt": "Write the final review report for target: {args.target}. Candidate scans: {review.results}. Scan failures: {review.failures}. Verification verdicts: {verify.results}. Verification failures including original finding packets: {verify.failures}. Preserve applicable user instructions and evidence qualifications. Correlate by globally unique id and check echoed file/title; mismatched, duplicate or missing verdicts are unresolved, never refuted. Include only status confirmed verdicts in findings; preserve each independent id, even with overlapping files/titles. Assign severity from the supplied claim, scope and evidence, not conjecture. Every unresolved verdict and every unverified candidate (including failed verification) needs an unresolved entry with original id/title/file and required why, including evidence/access gaps or failure reason. Scan failures, missing dimensions (expected correctness, security, performance), blockers and overflow/uninspected scope also require explicit coverage entries using unique coverage-prefixed ids; file may be empty only when unknown. Do not collapse uncertainty into refutation. Explain material strengths, gaps, confidence and verified/refuted outcomes in analysis without treating absent findings as proof of safety. Status is blocked if the target cannot be inspected at all; otherwise unresolved if any failure, blocker, coverage gap or unresolved entry remains; otherwise completed means review completed, not defect-free. Give a concise summary, explicit blockers and concrete ordered recommendations for confirmed defects and missing validation. Do not invent checks or claim resolution without evidence. Within schema bounds preserve retrievable references; if any field/list overflows, explicitly describe uncovered scope/count and source phase/field in an unresolved coverage entry rather than silently truncating or deduplicating findings. Never dump source JSON into prose. Return JSON matching ReviewReport.",
				"model": "large",
				"schema": "ReviewReport"
			}
		}
	],
	"return": "{report.results}"
}