Repository navigation
Description
Affected versions: v2.13.0 through v2.13.6 and current main (head f9bb13dd on 2026-11-23, MAX_OSV_QUERY_BATCHES = 4 unchanged).
Summary
OsvQueryBudget is created once per scan and shared by every query_batch() call of that scan
(static_patterns_supply_chain.py creates one budget and passes it to each per-manifest call).
query_batch() consumes one batch of MAX_OSV_QUERIES_PER_BATCH = 64 queries per 64-query chunk
and increments budget.batches_sent. When batches_sent >= MAX_OSV_QUERY_BATCHES = 4, it notes an
output_limit limitation and breaks. Capacity left in the last batch is never reused by a later
call: a scan with a large lockfile plus a second manifest loses the whole advisory coverage of the
second manifest.
Reproduction
Any skill folder with:
package.jsonwith a few npm dependencies (its lookups hit the cache of the lockfile pass),package-lock.jsonthat pins about 220 npm packages (4 batches: 64/64/64/28),requirements.txtwith exact PyPI pins (any pins work; zero-advisory pins isolate the effect).
Run a static scan (--no-llm). Observed on v2.13.0 with an instrumented
query_batch and OsvQueryBudget.note:
QUERY PyPI n=4immediately followed byNOTE reason=output_limit obs=5 limit=4.- The report marks
requirements.txtpartial with
static_patterns_supply_chain_dependencies_output_limit. - The 4 PyPI pins receive zero OSV advisory lookups. Downstream consumers that fail closed on
incomplete coverage must reject the skill.
Expected behavior
The 4 PyPI queries fit in the 36 free slots of batch 4 (28/64 used). The scan should pack queries
across query_batch() calls so the total request count stays at 4.
Suggested fixes (either one)
- Pack queries across calls: aggregate each call's uncached queries into the shared budget's
pending pool, or letquery_batch()fill the current batch's free slots before it opens a new
batch. Request count and rate stay identical. - Raise
MAX_OSV_QUERY_BATCHESor make it configurable, as v2.13.3 did for TP4 with
SKILLSPECTOR_TP4_MAX_BATCHES(and as fix(dependency-sources): make the analysis ceiling configurable #706 did for the dependency-sources ceiling), for example
SKILLSPECTOR_OSV_MAX_BATCHES. This raises the request count, so option 1 is the smaller fix.
Impact
Every skill with one dependency file above 192 uncached queries plus any further dependency file
silently loses coverage for all later files. The findings stay complete, but the advisory coverage
the scan vouches for is missing, and fail-closed consumers reject the skill.
Related
- feat(sc4): support offline OSV snapshots #1111 (offline OSV snapshots via
SKILLSPECTOR_OSV_DB_PATH) may avoid the cap in offline mode, but live OSV.dev lookups keep it. - Make TP4 batch capacity configurable for skills with many executable examples #941 / feat(tp4): support bounded assessment batch capacity #942 (configurable TP4 batch capacity) and fix(dependency-sources): make the analysis ceiling configurable #706 (configurable analysis ceiling) are the precedent for an operator-set cap.
- SkillSpector 2.14.0 release #959 (2.14.0 plan) does not list this change.
AI-assisted: an AI coding agent on the Ottr board found and analyzed this issue, and wrote this report. A human reviewed it before filing. The instrumented reproduction above ran on real scanner output.
Activity
Skare69 commentedon Nov 23, 2026
Proposed fix: #1177
fix(sc4): share OSV batches across dependency files
fix(sc4): share OSV batches across dependency files