|
| 1 | +import { z } from "zod"; |
| 2 | + |
| 3 | +export const PlanSchema = z.object({ |
| 4 | + taskName: z.string().describe("Name of the next task to implement"), |
| 5 | + research: z |
| 6 | + .string() |
| 7 | + .describe("What was discovered by examining the codebase"), |
| 8 | + implementationPrompt: z |
| 9 | + .string() |
| 10 | + .describe("Detailed prompt for the implementer"), |
| 11 | + filesToCreate: z.array(z.string()).describe("Files that need to be created"), |
| 12 | + filesToModify: z.array(z.string()).describe("Files that need to be modified"), |
| 13 | + nextSmallestUnit: z |
| 14 | + .string() |
| 15 | + .nullable() |
| 16 | + .describe("Next smallest atomic unit after this task"), |
| 17 | +}); |
| 18 | + |
| 19 | +export const ImplementSchema = z.object({ |
| 20 | + summary: z.string().describe("What was implemented"), |
| 21 | + filesChanged: z |
| 22 | + .array(z.string()) |
| 23 | + .describe("Files that were created or modified"), |
| 24 | + testOutput: z.string().describe("Output from running pytest"), |
| 25 | + commitMessage: z.string().describe("Git commit message for this change"), |
| 26 | + nextSmallestUnit: z |
| 27 | + .string() |
| 28 | + .nullable() |
| 29 | + .describe("Next smallest atomic unit to implement"), |
| 30 | +}); |
| 31 | + |
| 32 | +export const ReviewSchema = z.object({ |
| 33 | + lgtm: z.boolean().describe("true ONLY if ALL checks pass"), |
| 34 | + review: z.string().describe("Summary of the review findings"), |
| 35 | + issues: z.array(z.string()).describe("Specific issues found"), |
| 36 | +}); |
| 37 | + |
| 38 | +export const FixSchema = z.object({ |
| 39 | + summary: z.string().describe("What was fixed"), |
| 40 | + filesChanged: z.array(z.string()).describe("Files that were modified"), |
| 41 | +}); |
| 42 | + |
| 43 | +export const FinalReviewSchema = z.object({ |
| 44 | + readyToMoveOn: z.boolean().describe("true ONLY if all criteria met"), |
| 45 | + reasoning: z |
| 46 | + .string() |
| 47 | + .describe("Why ready or not ready — feeds back into next pass"), |
| 48 | + qualityScore: z.number().min(1).max(10).describe("Overall quality score"), |
| 49 | +}); |
| 50 | + |
| 51 | +export const PassTrackerSchema = z.object({ |
| 52 | + totalIterations: z.number(), |
| 53 | + tasksCompleted: z.array(z.string()), |
| 54 | + summary: z.string(), |
| 55 | +}); |
0 commit comments