diff --git a/packages/diff-filter/src/patterns.ts b/packages/diff-filter/src/patterns.ts index bbc23b7..e29a973 100644 --- a/packages/diff-filter/src/patterns.ts +++ b/packages/diff-filter/src/patterns.ts @@ -83,6 +83,14 @@ export const GENERATED_DIR_PREFIXES = [ ".ruff_cache/", ".venv/", "venv/", + // Anchor framework (Solana). Sibling to Cargo's `target/` which is + // already covered above, but `.anchor/` holds the test-ledger + // genesis, IDL caches, and program-test snapshots that change on + // every `anchor build` / `anchor test` run. We use Anchor in this + // very repo at `contracts/solana/`, so PRs touching escrow + // instructions previously leaked these regen artifacts into the + // diff Sonnet scored. + ".anchor/", ]; export const GENERATED_FILE_SUFFIXES = [ diff --git a/packages/diff-filter/tests/classify.test.ts b/packages/diff-filter/tests/classify.test.ts index 34ce8b7..85f7393 100644 --- a/packages/diff-filter/tests/classify.test.ts +++ b/packages/diff-filter/tests/classify.test.ts @@ -49,6 +49,12 @@ describe("classifyPath — generated dirs", () => { "app/.next/static/chunks/webpack.js", "coverage/lcov-report/index.html", "__pycache__/module.cpython-311.pyc", + // Anchor framework — `.anchor/` holds regenerated ledger state and + // IDL caches. Both top-level and nested (under the actual workspace + // path used in this repo) must be filtered. + ".anchor/test-ledger/genesis.bin", + "contracts/solana/.anchor/test-ledger/rocksdb/CURRENT", + "contracts/solana/.anchor/program-logs/escrow.log", ])("marks %s as generated_dir", (path) => { const r = classifyPath(path); expect(r.ignore).toBe(true);