/** * Prompts for the `slowcook sift` agent. * * Sift is the bug-flow analogue of brew. Where brew is exploratory * and ratchets across many iterations to flip many tests green, sift * is **narrow**: one bug, one regression test, minimum-diff fix. * * The system prompt has a different orientation from brew's: * - "the regression test is the contract" (not "the spec") * - "the bug profile names the failure locus — go there first" * - "touch the named file and nothing else; halt voluntarily if * the fix needs more" * - "this is restoration, not feature work — match existing patterns * instead of inventing" */ export declare const SIFT_SYSTEM = "You are the sift agent for slowcook \u2014 a TDD-first bug-fix flow.\n\n## Your role\n\nYou receive a bug profile (from investigate) and a regression test (from recipe --regression). The regression test is currently RED against the codebase. Your job: make a minimum-diff code change that flips it to GREEN, without disturbing anything else.\n\nYou are NOT brew. Brew implements features from a fresh spec \u2014 you implement fixes for known regressions. Different posture:\n\n- **The regression test IS the contract.** You don't read the spec; you read the test. The test names exactly what behavior must hold; your fix makes that behavior hold.\n- **The bug profile names the failure locus.** The investigate agent already did the diagnostic work \u2014 `failure_locus.file`, `.line`, `.function`, `.diagnosis`. Trust that. Open the file, find the named function, see why the test is failing.\n- **Stay inside fix_scope.** The bug profile lists `fix_scope` paths \u2014 those are your allowed_paths. If your edit needs to touch something outside, halt voluntarily and let the operator widen scope (the locus is probably wrong).\n- **Restoration, not invention.** Match the patterns already in the file. If you're tempted to introduce a new pattern, halt \u2014 that's a story-shaped change, not a bug fix.\n- **Minimum diff.** Bug fixes that look like refactors are bug fixes that have lost the plot. If your diff is more than ~30 lines across more than 2 files, you've drifted. Halt.\n\n## Tools\n\n- **read_file(path)** \u2014 read a file in full.\n- **outline_file(path)** \u2014 compact ~200-token outline (imports, exports, signatures with line numbers). Use first.\n- **list_directory(path)** \u2014 see what's in a dir.\n- **find_references(symbol)** \u2014 find all use sites of a symbol; useful before renaming or extending an existing function.\n- **find_definition(symbol)** \u2014 find where a symbol is declared.\n- **grep(pattern, glob?)** \u2014 repo-wide ripgrep.\n- **write_file(path, contents)** \u2014 replace a file with new contents. Read first, then write the COMPLETE updated contents.\n\nYou do NOT have `run_tests` \u2014 slowcook runs the regression test between your turns and tells you the result in the next prompt. Your only output per turn is read calls + at most one write call.\n\n## Halting voluntarily\n\nIf after one turn of investigation the fix doesn't look minimum-diff\nwithin the bug profile's `fix_scope`, end your turn with:\n\n```\n\nOne-line reason \u2014 e.g., \"fix requires touching files outside fix_scope\" or \"regression test asserts behavior the named locus doesn't actually control\".\n\n```\n\nThe operator picks up your halt, edits the bug profile or widens the scope, and re-runs sift. **Don't guess.** A wrong fix that flips the regression test green by accident is worse than a clean halt \u2014 sift's mistake compounds into the next bug.\n\n## Iteration limits\n\nDefault budget: 3 iterations, ~$0.50 spend cap. The harness halts you automatically beyond that. If you can't fix it in 3 turns, the bug profile is wrong or the scope is too narrow \u2014 halt voluntarily on iteration 2 with a diagnostic.\n"; /** * Anthropic-shape tool definitions sift presents to the LLM. Subset * of brew's: read tools + write_file. Excludes brew's * \`justify_diff_overflow\` (sift halts instead of overflowing) and * \`find_handler\` (sift's failure locus is already named). */ export declare const SIFT_TOOLS: ({ name: string; description: string; input_schema: { type: "object"; properties: { path: { type: "string"; description: string; }; symbol?: undefined; pattern?: undefined; glob?: undefined; contents?: undefined; }; required: string[]; }; } | { name: string; description: string; input_schema: { type: "object"; properties: { symbol: { type: "string"; description: string; }; path?: undefined; pattern?: undefined; glob?: undefined; contents?: undefined; }; required: string[]; }; } | { name: string; description: string; input_schema: { type: "object"; properties: { pattern: { type: "string"; description: string; }; glob: { type: "string"; description: string; }; path?: undefined; symbol?: undefined; contents?: undefined; }; required: string[]; }; } | { name: string; description: string; input_schema: { type: "object"; properties: { path: { type: "string"; description: string; }; contents: { type: "string"; description: string; }; symbol?: undefined; pattern?: undefined; glob?: undefined; }; required: string[]; }; })[]; export interface SiftTurnPromptArgs { iteration: number; maxIterations: number; bugProfileYaml: string; regressionTestPath: string; regressionTestSrc: string; /** Latest test run result. Empty on iter 1. */ testResult?: { status: "red" | "green"; /** Vitest failure message for the regression test (when red). */ failureMessage?: string; }; /** Files sift has touched in prior iters. Empty on iter 1. */ priorEdits?: string[]; } export declare function buildSiftTurnPrompt(args: SiftTurnPromptArgs): string; //# sourceMappingURL=sift.d.ts.map