perf(add): skip the second OSV query for packages the name gate already cleared #2034
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.43) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.43 · 388 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.357
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2034"
general
weight: 0.35
jdx
aube add left-padasked OSV aboutleft-padtwice: once in the name gate before the manifest is written, and again in the live check after resolve. The second query is on the critical path of the install, so everyaube addwaited for an extra OSV round trip even when the answer was already known.Now the name gate remembers which packages OSV cleared, and the scoped live check after resolve skips them. Packages the add brings in transitively are still checked, so
aube add expressstill sends its new dependencies to OSV.What counts as cleared:
aube add left-pad,aube add left-pad@^1): only names whose OSV response lists noMAL-advisory for any version. A name-only query returns every advisory for the package, so a versioned query for any of its versions would also be clean. Names whose only advisories cover specific releases are not cleared. The gate lets those through, but the versioned check still has to look at them. Results that OSV paginated are never treated as clean.aube add left-pad@1.3.0): the exact pair, when the versioned query came back clean.advisoryCheck = onthe live check still runs after a degraded gate.Protection is unchanged. The skip only applies where the live check is already scoped to new picks:
aube addunder the defaultadvisoryCheck = on.advisoryCheck = required,paranoid, andadvisoryCheckEveryInstallkeep the full live check.Benchmark
aube add left-pad, interleaved, 9 rounds each, warm caches, against a local stand-in forapi.osv.dev(100 ms to connect, 50 ms per request). Median wall ms:| fixture | before | after |
|---|---|---|
| next | 558 | 370 (-34%) |
| astro | 528 | 347 (-34%) |
| vue | 588 | 401 (-32%) |
The stand-in logged one OSV request per
aube add left-padinstead of two.aube add express(new transitive dependencies) still made two.Validation
next_page_tokenparsing, cleared-set matching, and when the scope applies.cargo clippy --workspace --all-targets -- -D warnings,cargo fmt, and theadd_supply_chainandsupply_chaintests pass locally.🤖 Generated with Claude Code
AI-assisted — Tool: Claude Code; model: anthropic/claude-opus-5-5; version: unavailable.
---
_Generated by Claude Code_
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Bug Fixes
Avoid repeating malicious-advisory checks for package names or exact versions already confirmed clean during the add flow.
Preserve full advisory checks when they’re required or configured for every install.
Treat results as clean only when no malicious advisory is found and no additional OSV results remain to be checked.
Keep advisory results in input order when checking multiple package versions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->