import { appendFileSync, existsSync, readFileSync, writeFileSync, } from "node:fs"; import { join } from "node:path"; import { getLogger } from "../../util/logger.js"; import type { WorkspaceMigration } from "./types.js"; const log = getLogger("workspace-migration-055-release-notes-agentic-recall"); const MIGRATION_ID = "055-release-notes-agentic-recall"; const MARKER = ``; const RELEASE_NOTE = `${MARKER} ## Recall can search more places now When you ask me to recall something, I can now search across memory, knowledge base notes, past conversations, and workspace files. That means I can find relevant context from more of your assistant workspace without you needing to remember where it was saved. `; export const releaseNotesAgenticRecallMigration: WorkspaceMigration = { id: MIGRATION_ID, description: "Append release notes for improved recall search coverage to UPDATES.md", run(workspaceDir: string): void { const updatesPath = join(workspaceDir, "UPDATES.md"); try { if (existsSync(updatesPath)) { const existing = readFileSync(updatesPath, "utf-8"); if (existing.includes(MARKER)) { return; } const needsLeadingNewline = !existing.endsWith("\n\n"); const prefix = existing.endsWith("\n") ? "\n" : "\n\n"; appendFileSync( updatesPath, needsLeadingNewline ? `${prefix}${RELEASE_NOTE}` : RELEASE_NOTE, "utf-8", ); } else { writeFileSync(updatesPath, RELEASE_NOTE, "utf-8"); } log.info({ path: updatesPath }, "Appended agentic recall release note"); } catch (err) { log.warn( { err, path: updatesPath }, "Failed to append agentic recall release note to UPDATES.md", ); } }, down(_workspaceDir: string): void { // Forward-only: UPDATES.md is a user-facing bulletin the assistant // processes and deletes on its own. }, };