Skip to content

feat: incremental scans that reuse unchanged results - #93

Merged
arminazimi merged 4 commits into
mainfrom
feat/50-incremental-scans
Nov 14, 2026
Merged

arminazimi merged 4 commits into
mainfrom
feat/50-incremental-scans

Conversation

@arminazimi

Copy link
Copy Markdown
Contributor

Closes #50

What changed

  • Warm scans reuse detector results when every input file's size and mtime still match the cached fingerprint (keyed with detector version and data version); content bytes are not re-read on a hit.
  • Build a per-scan basename/extension index so input resolution stays cheap on large trees, and keep directory-prefix work lazy so pathological detector directories stay linear-time.
  • Add a ≥10× warm-speedup identity test and npm run benchmark:scan-cache for offline corpus proof.

Quality bar

Read docs/QUALITY.md before you change code, data, or docs. CI enforces its nine criteria: add no new debt, and allowlist existing debt only with an expiry.

Checks CI cannot make

  • Tests added or updated for changed behavior
  • Changelog fragment added in changes/ for user-visible changes (not for docs, test, ci, chore, build, refactor, or style)

Verification

  • npm run check
  • node --test dist/tests/scan-cache-speed.test.js (asserts ≥10× and identical findings; warm path reads zero file bytes)
  • OFFING_CORPUS_CACHE=~/.cache/offing-corpus npm run validate:public-repos -- --repo expressjs/express --repo sindresorhus/got --repo fastify/fastify --repo koajs/koa --repo axios/axios
  • OFFING_CORPUS_CACHE=~/.cache/offing-corpus npm run benchmark:scan-cache -- --offline → aggregate 28.95×, identical findings on all five repositories

Notes for reviewers

  • Cross-file detectors still invalidate at the manifest level when any input changes; CLE and other skipped-tree readers still bypass the cache.
  • benchmark:scan-cache is a local/offline proof helper; the CI gate is the unit test plus npm run check.

Made with Cursor

Skip content hashing when size and mtime still match the cached detector
manifest, index detector inputs once per scan, and prove ≥10× warm speedup
with identical findings on a corpus-shaped fixture and offline corpus sample.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread src/detector-inputs.ts Fixed
Strip trailing slashes without a ReDoS-prone regex, unit-test fingerprint
and input-index helpers so changed-line mutation stays above the floor, and
drop the deleted antono4/openmind corpus pin that failed affected runs.

Co-authored-by: Cursor <cursoragent@cursor.com>
@arminazimi

Copy link
Copy Markdown
Contributor Author

Pushed fixes for CodeQL (linear trailing-slash trim), mutation coverage on fingerprint helpers, and removal of the deleted antono4/openmind corpus pin that caused the affected-ecosystems fetch failure.

Record rust at 199 after removing antono4/openmind (GitHub 404), and raise
other bucket floors to the current pinned counts.

Co-authored-by: Cursor <cursoragent@cursor.com>
@arminazimi

Copy link
Copy Markdown
Contributor Author

Corpus targets updated: rust minimum is now 199 after removing the deleted antono4/openmind pin; other bucket floors ratcheted up to current counts.

Cover Windows path normalization, duplicate basename/extension indexing,
and fingerprint warm hits that preserve unclassified references.

Co-authored-by: Cursor <cursoragent@cursor.com>
@arminazimi
arminazimi merged commit 8205922 into main Nov 14, 2026
24 checks passed
@arminazimi
arminazimi deleted the feat/50-incremental-scans branch November 15, 2026 18:17
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.

Add incremental scans that reuse unchanged results

2 participants