Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 18 additions & 6 deletions workflows/repo-assist.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ 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.
# 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"]
Expand All @@ -97,12 +97,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"));
Expand Down Expand Up @@ -223,6 +220,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 }}
Expand Down
Loading