fix(enrichment): bound dependency scans#1537
Conversation
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
Tip 🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩 ✅ Gittensory review — safe to merge
✅ Approved — safe to merge Review summary Nits (5)
Nits — 2 non-blocking
Review context
Contributor next steps
Signal definitions
Review detailsGenerated from public PR metadata and the diff. Advisory only; deterministic signals remain authoritative. This PR adds hard caps (MAX_MANIFEST_FILES=20, MAX_PATCH_LINES_PER_FILE=500, MAX_DEPENDENCY_QUERIES=25) to bound dependency extraction and OSV query counts, and propagates an AbortSignal from a new AbortController-backed runWithTimeout helper through scanDependencies into outbound fetch calls. The logic is correct throughout: the manifest counter only ticks after the ecosystem filter so non-manifest files don't consume budget, String.split's limit argument properly caps patch lines, .slice() before the OSV loop caps queries, and the per-iteration aborted check prevents additional OSV calls after cancellation. The three new regression tests cover manifest/patch caps, query-count caps with signal forwarding, and the end-to-end timeout-aborts-fetch integration path. Nits (5)
🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed 💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.
|
…sv-scans-in-rees # Conflicts: # review-enrichment/test/enrichment.test.ts
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
gittensory-ui | b3d4819 | Commit Preview URL Branch Preview URL |
Jun 27 2026, 01:15 AM |
Motivation
Description
MAX_MANIFEST_FILES,MAX_PATCH_LINES_PER_FILE,MAX_DEPENDENCY_QUERIES, plusScanLimits/ScanOptionsto the dependency analyzer.extractDependencyChangesandscanDependenciesso extraction and the number of OSV queries are bounded.AbortSignalintoqueryOsvand into outboundfetchso in-flight OSV requests can be cancelled.AbortController-backedrunWithTimeoutinbuildBriefand pass the abort signal into the dependency analyzer registry entry so timed-out analyzers stop background work.buildBriefaborts dependency OSV work.review-enrichment/src/analyzers/dependency-scan.ts,review-enrichment/src/brief.ts, andreview-enrichment/test/enrichment.test.ts.Testing
npm --prefix review-enrichment test, which completed successfully and the new regression tests passed.npm --prefix review-enrichment run build, which succeeded.npm run test:ci, which exercised many suites but did not complete cleanly due to unrelated root-suite timeouts and a Vitest coverage remapping error (TypeError: jsTokens is not a function).npm audit --audit-level=moderate, which failed to contact the registry audit endpoint (returned403), unrelated to the code changes.Codex Task