From 23465f1c83be57b83eacadf8f4932bc19fbf3861 Mon Sep 17 00:00:00 2001 From: Mikael Hugo Date: Thu, 7 May 2026 01:19:51 +0200 Subject: [PATCH] refactor: remove duplicate memory-store, use existing SF memory infrastructure - Removed redundant src/db/memory-store.ts (was duplicate of existing memory system) - Removed duplicate memory extension folder - SF already has complete memory infrastructure: * memory-store.js (core CRUD + ranking) * memory-embeddings.js (vector ops, Float32Array BLOB storage) * memory-embeddings-llm-gateway.js (semantic ranking) * memory-relations.js (relationship graph) * memory-ingest.js (ingestion from files/URLs) * memory-extractor.js (auto-learning from units) * memory-sleeper.js (decay/supersession) * commands-memory.js (CLI interface) - Uses Node 24 SQLite via sf-db.js (not separate package) - VectorDrive kept as fallback extension - Next: Integrate UOK kernel with existing memory system Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../extensions/sf/autonomous-solver.js | 12 ++++++++++- .../sf/tests/autonomous-solver.test.mjs | 20 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) 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(