Bug
packages/diff-filter's GENERATED_DIR_PREFIXES includes target/ (Cargo build output) but is missing .anchor/, the directory the Anchor framework writes during anchor build / anchor test.
We use Anchor in this very repo at contracts/solana/ — every time someone opens a PR that touches an instruction or struct, the .anchor/ ledger artifacts + IDL caches leak into the diff Sonnet sees, inflating the token count and pushing the signal-to-noise down.
Repro
import { classifyPath } from "@ghbounty/diff-filter";
classifyPath("contracts/solana/.anchor/test-ledger/genesis.bin");
// expected: { ignore: true, reason: "generated_dir" }
// actual: { ignore: false }
Why it matters
- Sonnet scoring quality drops when the diff contains regenerated ledger state.
- Reviewers waste time scrolling past binary noise on the Files Changed tab.
- Other tooling that consumes the filter (relayer, MCP) inherits the same blind spot.
Acceptance criteria
Out of scope
- Other Solana-toolchain caches (
.solana/, solana-test-validator-* ledger dirs created outside .anchor/). Open separate issues if needed.
- Anchor's
target/idl/*.json (covered by the existing target/ prefix).
Notes
The fix is almost certainly a one-line addition to packages/diff-filter/src/patterns.ts::GENERATED_DIR_PREFIXES. Keep the test-and-fix tightly scoped — this is a perfect "bug fix with red-green test" candidate for our own AI scorer to grade well.
Bug
packages/diff-filter'sGENERATED_DIR_PREFIXESincludestarget/(Cargo build output) but is missing.anchor/, the directory the Anchor framework writes duringanchor build/anchor test.We use Anchor in this very repo at
contracts/solana/— every time someone opens a PR that touches an instruction or struct, the.anchor/ledger artifacts + IDL caches leak into the diff Sonnet sees, inflating the token count and pushing the signal-to-noise down.Repro
Why it matters
Acceptance criteria
classifyPathreturns{ ignore: true, reason: "generated_dir" }for any path under.anchor/(top-level or nested, e.g.contracts/solana/.anchor/test-ledger/genesis.bin).packages/diff-filter/tests/classify.test.tscovers an.anchor/path.Out of scope
.solana/,solana-test-validator-*ledger dirs created outside.anchor/). Open separate issues if needed.target/idl/*.json(covered by the existingtarget/prefix).Notes
The fix is almost certainly a one-line addition to
packages/diff-filter/src/patterns.ts::GENERATED_DIR_PREFIXES. Keep the test-and-fix tightly scoped — this is a perfect "bug fix with red-green test" candidate for our own AI scorer to grade well.