From 2db517499a0fe2d4218a5ca99b5c40e002dd523f Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 6 Oct 2026 23:55:22 +0100 Subject: [PATCH 1/2] Fix Repo Assist memory migration Move legacy-file cleanup before agent execution so custom validation remains read-only, remove all stale memory entries except notes.json, and restore the one-file limit. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- workflows/repo-assist.md | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/workflows/repo-assist.md b/workflows/repo-assist.md index 25cc52f..ba0d9fc 100644 --- a/workflows/repo-assist.md +++ b/workflows/repo-assist.md @@ -85,9 +85,7 @@ tools: repo-memory: max-file-size: 65536 max-patch-size: 65536 - # Allows the one-time removal of five legacy memory files plus notes.json. - # The validation script below still enforces exactly one persisted file. - max-file-count: 6 + max-file-count: 1 format-json: true allowed-extensions: [".json"] validation: @@ -97,12 +95,9 @@ tools: const path = require("node:path"); const fail = message => { throw new Error(`notes.json: ${message}`); }; const notesPath = path.join(memoryRoot, "notes.json"); - for (const legacyFile of ["memory.json", "state.json"]) { - fs.rmSync(path.join(memoryRoot, legacyFile), { force: true }); - } const memoryEntries = fs.readdirSync(memoryRoot, { withFileTypes: true }); if (memoryEntries.length !== 1 || !memoryEntries[0].isFile() || memoryEntries[0].name !== "notes.json") { - fail("must be the only file in repo memory"); + fail(`must be the only file in repo memory; found: ${memoryEntries.map(entry => entry.name).join(", ") || "(none)"}`); } if (!fs.existsSync(notesPath)) fail("missing (create an initial notes.json that matches schema version 1)"); const data = JSON.parse(fs.readFileSync(notesPath, "utf8")); @@ -223,6 +218,21 @@ safe-outputs: target: "*" steps: + - name: Migrate legacy Repo Assist memory + env: + MEMORY_DIR: /tmp/gh-aw/repo-memory/default + run: | + node <<'EOF' + const fs = require("node:fs"); + const path = require("node:path"); + const memoryDir = process.env.MEMORY_DIR; + for (const entry of fs.readdirSync(memoryDir, { withFileTypes: true })) { + if (entry.name !== ".git" && entry.name !== "notes.json") { + fs.rmSync(path.join(memoryDir, entry.name), { recursive: true, force: true }); + } + } + EOF + - name: Fetch repo data for task weighting env: GH_TOKEN: ${{ github.token }} From 743cb1e946b44d398afc7d374cdb07a6963f7af5 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Tue, 6 Oct 2026 23:59:09 +0100 Subject: [PATCH 2/2] Allow multi-file memory migration Keep the six-change limit until legacy memory deletions have been persisted. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- workflows/repo-assist.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/workflows/repo-assist.md b/workflows/repo-assist.md index ba0d9fc..3179267 100644 --- a/workflows/repo-assist.md +++ b/workflows/repo-assist.md @@ -85,7 +85,9 @@ tools: repo-memory: max-file-size: 65536 max-patch-size: 65536 - max-file-count: 1 + # Allow one migration commit to delete up to five legacy entries while + # notes.json remains the only persisted file accepted by validation. + max-file-count: 6 format-json: true allowed-extensions: [".json"] validation: