Skip to content

docs: document segment matching and the declared-scope override for bugpocer - #30

Open
Tennis-Ball wants to merge 4 commits into
mainfrom
docs/scope-path-segment-matching
Open

Tennis-Ball wants to merge 4 commits into
mainfrom
docs/scope-path-segment-matching

Conversation

@Tennis-Ball

@Tennis-Ball Tennis-Ball commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Why

The "Default ignore list" section already promised segment matching"a whole /-delimited path segment must match, not an arbitrary substring". Until now that was only true of the server-side dependency list; the CLI matched substrings, so Attestation.sol and Permit2Lib.sol were silently dropped from scope. olympix/olympix-dotnet#1757 makes the documented behavior real.

Three things were also missing or wrong on the page:

  • The Solidity list omitted test/mock/example/script/certora entirely — they were documented for Rust and Cairo only, even though Solidity has always excluded them.
  • The published dependency list included protocol names (chainlink, curve, aave-v3, uniswap-v3, v4-core, permit2, openzeppelin) matched at any depth. That was accurate, and it was the bug: a directory with one of those names is just as likely to be your own integration code. The engines now anchor dependency matching by location, so the page has to say where a dependency lives rather than list names.
  • There was no mention that excluded files are still uploaded and readable as context, so "excluded" read as "invisible to the engine".

Changes

  • Split the list into non-production code (shared across languages, now including script/scripts/certora) and vendored dependencies, and documented the Foundry *.t.sol / *.s.sol conventions and foundry.toml-declared test/script directories.
  • Rewrote the dependency section around where a dependency lives — root lib/, node_modules/, dependencies/, plus eleven names that can only ever be vendored — and stated explicitly that protocol-named directories like src/oracles/chainlink/ and packages/v4-core/ are scanned.
  • Added a concrete note that segment matching means a contract is never excluded for its name — with the real examples (Attestation.sol, ContestToken.sol, LatestAnswer.sol, Permit2Lib.sol).
  • New "Scanning an excluded path anyway" section documenting the declared-scope override from olympix/olympix-bugpocer#39, with a table of the exact semantics, and the guarantee that declaring a scope can only ever widen what the built-in rules allow. This replaces the previous workaround, which was to rename the directory in your working copy.
  • The override applies in every language. The remaining Rust/Cairo caveat is narrower than previously documented: only the CLI's interactive scope picker prunes those directories before reading your config, so an opted-in directory will not appear in the picker even though the scan covers it.
  • Note clarifying that excluded files are still uploaded, parsed and readable for context.

Verification

Every row of the override table is pinned by an executable test against the production ranker (DeclaredScopeDocsContractTests in olympix/olympix-bugpocer#39), so the page cannot drift from the code without a test failing.

npm run build completes clean (19 pages); confirmed the new table and notes render into dist/cli/bugpocer/index.html.

Merge order

Ship after olympix/olympix-dotnet#1757 and olympix/olympix-bugpocer#39, since this documents their behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant