import { readFileSync } from "node:fs"; /** * The V10 rectification turn runner as source text: agent-run.ts (public * types and the order of the phases) plus the phase modules it was split into * (TASK-rectification-code-split-20260926), in the order the code ran inside * the old runV9AgentTurn: preparation, the retry loop, the finish, one * attempt, then the shared pieces and the model messages. A whole-source * contract that held on agent-run.ts before the split holds on this * concatenation after it. Slices that no longer sit in one file are * rewritten per test. */ export const rectificationAgentRunFiles = [ "../src/lib/rectification-agentic/v9/agent-run.ts", "../src/lib/rectification-agentic/v9/agent-run-prepare.ts", "../src/lib/rectification-agentic/v9/agent-run-retry.ts", "../src/lib/rectification-agentic/v9/agent-run-finish.ts", "../src/lib/rectification-agentic/v9/agent-run-attempt.ts", "../src/lib/rectification-agentic/v9/agent-run-support.ts", "../src/lib/rectification-agentic/v9/agent-run-messages.ts", ] as const; export function readRectificationAgentRunFile(relativePath: (typeof rectificationAgentRunFiles)[number]): string { return readFileSync(new URL(relativePath, import.meta.url), "utf8"); } export const rectificationAgentRunSurface = rectificationAgentRunFiles .map((relativePath) => readRectificationAgentRunFile(relativePath)) .join("\n");