diff --git a/src/resources/extensions/sf/autonomous-solver.js b/src/resources/extensions/sf/autonomous-solver.js index 6118ad168..2727d45f7 100644 --- a/src/resources/extensions/sf/autonomous-solver.js +++ b/src/resources/extensions/sf/autonomous-solver.js @@ -635,7 +635,17 @@ export function buildAutonomousSolverMissingCheckpointRepairPrompt( `- ${diagnosis.classification}: ${diagnosis.summary ?? "missing checkpoint"}`, ); } - if (repairAttempt <= 1) { + if (diagnosis?.classification === "no-transcript") { + lines.push( + "", + "No transcript was captured from your previous turn. To reconstruct the checkpoint:", + "1. Read .sf/runtime/autonomous-solver/LOOP.md to see what was expected.", + "2. List files in the milestone/slice/task directories to find what artifacts exist.", + "3. Read any SUMMARY.md or PLAN.md files to understand what progress was made.", + "4. Based on the evidence, call sf_autonomous_checkpoint with the appropriate outcome and PDD fields.", + "5. If you cannot determine what happened, use outcome='decide' and ask the human what the checkpoint should contain.", + ); + } else if (repairAttempt <= 1) { lines.push("Do not continue implementation work in this repair turn."); } else { lines.push( diff --git a/src/resources/extensions/sf/tests/autonomous-solver.test.mjs b/src/resources/extensions/sf/tests/autonomous-solver.test.mjs index 08c77b3f5..cfbebfb60 100644 --- a/src/resources/extensions/sf/tests/autonomous-solver.test.mjs +++ b/src/resources/extensions/sf/tests/autonomous-solver.test.mjs @@ -281,6 +281,26 @@ describe("autonomous solver", () => { expect(second).toHaveLength(0); }); + test("buildAutonomousSolverMissingCheckpointRepairPrompt_no_transcript_includes_filesystem_guidance", () => { + const prompt = buildAutonomousSolverMissingCheckpointRepairPrompt( + { iteration: 2 }, + "research-slice", + "M012/parallel-research", + { + classification: "no-transcript", + summary: "No agent-end transcript was available to classify.", + }, + 2, + 4, + ); + + expect(prompt).toContain("no-transcript"); + expect(prompt).toContain("No transcript was captured"); + expect(prompt).toContain(".sf/runtime/autonomous-solver/LOOP.md"); + expect(prompt).toContain("SUMMARY.md"); + expect(prompt).toContain("outcome='decide'"); + }); + test("getConfiguredAutonomousSolverMaxIterations_clamps_preference", () => { expect(getConfiguredAutonomousSolverMaxIterations()).toBe(30000); expect(