repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

feat(ultra): assign compute to bundled workflows

bb3dba435ab0b6aaef922582ee51c456e72bdb1a

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (6)

extensions/ultra/__tests__/bug.test.ts

Modified
29 + it("assigns compute deliberately by phase role and complexity", () => {
30 + const spec = parseWorkflow(loadRaw());
31 + expect(
32 + Object.fromEntries(
33 + spec.phases.map((phase) => [
34 + phase.id,
35 + [phase.step.model, phase.step.thinkingLevel],
36 + ]),
37 + ),
38 + ).toEqual({
39 + investigate: ["small", "high"],
40 + regression: ["medium", "medium"],
41 + fix: ["medium", "high"],
42 + verify: ["big", "high"],
43 + });
44 + });
29 46 it("chains evidence forward and conditionally skips fix and verification", () => {
30 47 const spec = parseWorkflow(loadRaw());
31 48 const get = (id: string) => spec.phases.find((phase) => phase.id === id);

extensions/ultra/__tests__/example.test.ts

Modified
29 29 expect(spec.phases[1].id).toBe("verify");
32 + it("assigns compute deliberately by phase role and complexity", () => {
33 + const spec = parseWorkflow(loadRaw());
34 + expect(
35 + Object.fromEntries(
36 + spec.phases.map((phase) => [
37 + phase.id,
38 + [phase.step.model, phase.step.thinkingLevel],
39 + ]),
40 + ),
41 + ).toEqual({
42 + review: ["small", "medium"],
43 + verify: ["big", "high"],
44 + });
45 + });
32 47 it("declares a general review target positional and consumes {args.target}", () => {
33 48 const spec = parseWorkflow(loadRaw());
34 49 // A single positional param soaks the whole tail: `/ultra review PR 123`,

extensions/ultra/__tests__/feature.test.ts

Modified
35 + it("assigns compute deliberately by phase role and complexity", () => {
36 + const spec = parseWorkflow(loadRaw());
37 + expect(
38 + Object.fromEntries(
39 + spec.phases.map((phase) => [
40 + phase.id,
41 + [phase.step.model, phase.step.thinkingLevel],
42 + ]),
43 + ),
44 + ).toEqual({
45 + research: ["small", "medium"],
46 + plan: ["big", "high"],
47 + critique: ["big", "xhigh"],
48 + implement: ["medium", "high"],
49 + review: ["big", "high"],
50 + });
51 + });
35 53 it("takes a free-text task as a positional arg consumed by every phase", () => {
36 54 const spec = parseWorkflow(loadRaw());
37 55 expect(spec.args?.params).toEqual(["task"]);

extensions/ultra/workflows/bug.json

Modified
56 56 "step": {
57 57 "prompt": "Investigate this bug without modifying files: {args.bug}. Reproduce or trace the failing path, inspect callers and shared routes, identify the likely root cause, and list relevant files. Use read/grep/find/bash as needed. Return JSON matching Investigation.",
58 58 "tools": ["read", "grep", "find", "ls", "bash"],
59 + "model": "small",
60 + "thinkingLevel": "high",
59 61 "schema": "Investigation"
65 67 "step": {
66 68 "prompt": "Create the smallest regression test for this bug: {args.bug}. Investigation: {investigate.results}. Do not fix production code. Run the focused test and set ready=true only when it fails for the expected reason, not from a test error. Return JSON matching Regression.",
67 69 "tools": ["read", "grep", "find", "ls", "bash", "edit", "write"],
70 + "model": "medium",
71 + "thinkingLevel": "medium",
68 72 "schema": "Regression"
75 79 "step": {
76 80 "prompt": "Fix the root cause of this bug: {args.bug}. Investigation: {investigate.results}. Regression evidence: {regression.results}. Prefer the shared route over caller-specific patches. Make the minimum production change, run the regression test and relevant checks, and set fixed=true only when they pass. Then return JSON matching Fix.",
77 81 "tools": ["read", "grep", "find", "ls", "bash", "edit", "write"],
82 + "model": "medium",
83 + "thinkingLevel": "high",
78 84 "schema": "Fix"
86 92 "step": {
87 93 "prompt": "Adversarially verify the bug fix from the {item} perspective. Bug: {args.bug}. Investigation: {investigate.results}. Regression: {regression.results}. Fix: {fix.results}. Inspect the diff and run focused checks as needed; do not modify files. Set passed=false and list concrete findings if the fix is incomplete, the regression test is weak, or new risk was introduced. Echo dimension as {item}. Return JSON matching Verdict.",
88 94 "tools": ["read", "grep", "find", "ls", "bash"],
95 + "model": "big",
96 + "thinkingLevel": "high",
89 97 "schema": "Verdict"

extensions/ultra/workflows/feature.json

Modified
99 99 "step": {
100 100 "prompt": "Research this codebase to implement the feature: {args.task}. Identify the files you'd touch, the existing patterns/conventions to follow, and any constraints. Inspect with read/grep/find/bash (e.g. `git log`, `git grep`); do not modify anything. Return JSON matching the Research schema.",
101 101 "tools": ["read", "grep", "find", "ls", "bash"],
102 + "model": "small",
103 + "thinkingLevel": "medium",
102 104 "schema": "Research"
108 110 "step": {
109 111 "prompt": "Produce an implementation plan for: {args.task}. Ground it in this research: {research.results}. Give concrete ordered tasks, a one-paragraph approach, and the real risks. Read further if needed; do not modify anything. Return JSON matching the Plan schema.",
110 112 "tools": ["read", "grep", "find", "ls", "bash"],
113 + "model": "big",
114 + "thinkingLevel": "high",
111 115 "schema": "Plan"
117 121 "step": {
118 122 "prompt": "Adversarially critique this plan BEFORE any code is written. Task: {args.task}. Plan: {plan.results}. Research: {research.results}. Hunt for missing steps, wrong assumptions, and unhandled edge cases. Set approved=false and list each blocking issue if the plan isn't ready; default approved=false when uncertain. Do not modify anything. Return JSON matching the Critique schema.",
119 123 "tools": ["read", "grep", "find", "ls", "bash"],
124 + "model": "big",
125 + "thinkingLevel": "xhigh",
120 126 "schema": "Critique"
127 133 "step": {
128 134 "prompt": "Implement the feature: {args.task}. Follow the plan and resolve EVERY blocking item from the critique. Plan: {plan.results}. Critique: {critique.results}. Make the actual edits with the edit/write tools, keep the change focused, and follow the conventions surfaced in research. Run focused checks and set implemented=true only when the changes and checks complete. Then return JSON matching the Implementation schema (list the files you changed and a concise summary).",
129 135 "tools": ["read", "grep", "find", "ls", "bash", "edit", "write"],
136 + "model": "medium",
137 + "thinkingLevel": "high",
130 138 "schema": "Implementation"
138 146 "step": {
139 147 "prompt": "Review the just-made implementation of {args.task} from the {item} perspective. What changed: {implement.results}. Inspect the working tree with read/grep and `git diff`; do not modify anything. Set passed=false and list each blocking {item} problem you find. Echo the `dimension` field as \"{item}\" so the verdict ties back. Return JSON matching the Verdict schema.",
140 148 "tools": ["read", "grep", "find", "ls", "bash"],
149 + "model": "big",
150 + "thinkingLevel": "high",
141 151 "schema": "Verdict"

extensions/ultra/workflows/review.json

Modified
43 43 "step": {
44 44 "prompt": "Review the requested target for {item} issues. Target: {args.target}\n\nThe target may be a PR, branch/ref, recent changes, folder, or file. If target is empty, inspect the working tree and recent local changes. Use git/read/grep/find/ls as appropriate; for PRs or branches, inspect the relevant diff; for folders/files, inspect that scope. Do not modify files. Return JSON matching the Findings schema, and set each finding's `file` to the path it concerns.",
45 45 "tools": ["read", "bash", "grep", "find", "ls"],
46 + "model": "small",
47 + "thinkingLevel": "medium",
46 48 "schema": "Findings"
52 54 "over": "{review.results[].findings[]}",
53 55 "step": {
54 56 "prompt": "Adversarially try to refute this finding. Default to real=false if uncertain. Echo the finding's `file` verbatim in your verdict's `file` field so the verdict ties back to its finding.\n\nFinding: {item}",
57 + "model": "big",
58 + "thinkingLevel": "high",
55 59 "schema": "Verdict"