Skip to main content
← Back to list
01Issue
FeatureShippedSwamp CLI
Assigneesstack72

#402 Add dependency-trust rubric factor to server-side scorer (RUBRIC_VERSION 3)

Opened by stack72 · 5/21/2026· Shipped 5/21/2026

Problem

The CLI now includes a dependency-trust quality rubric factor (worth 2 points) that audits bundled npm dependencies against OSV.dev advisories and npm registry trust signals (downloads, license, recency, maintenance, deprecation). The CLI scorer has been bumped to RUBRIC_VERSION 3, but the server-side scorer in swamp-club still runs RUBRIC_VERSION 2 — so local swamp extension quality scores will differ from registry scores until the server catches up.

Proposed Solution

Add matching dependency-trust factor logic to the server-side scorer:

  1. lib/domain/scorecard/analysis-factors.ts — extract npm/jsr import specifiers from extension source files in the uploaded tarball, query OSV.dev for vulnerabilities, query npm registry for trust signals (weekly downloads, license, maintainer count, publish recency, deprecation status). Compute dependencyTrustPassed (boolean) and dependencyTrustBlockerCount (number).

  2. lib/domain/scorecard/score.ts — add a dependency-trust row to composeScore worth 2 points. Earned when dependencyTrustPassed === true. Default to false when trust data is unavailable (do not give free points).

  3. Bump RUBRIC_VERSION to 3 to match the CLI.

Trust gates (matching CLI implementation)

Hard errors (block factor):

  • Deprecated packages
  • HIGH, CRITICAL, or UNKNOWN severity vulnerabilities (via OSV.dev)

Warnings (shown but don't block factor):

  • MEDIUM severity vulnerabilities
  • License not in allowlist (MIT, Apache-2.0, BSD-2/3-Clause, ISC, 0BSD, MPL-2.0, Unlicense, CC0-1.0)
  • No maintainers listed
  • Weekly downloads below 1,000
  • Last publish more than 24 months ago

jsr dependencies: Trust jsr's built-in enforcement; skip gates where data is unavailable.

Default thresholds (from @bixu/wheelshop)

  • minWeeklyDownloads: 1,000
  • maxAgeMonths: 24
  • minMaintenance: 0.4

Alternatives Considered

  • Making it CLI-only — rejected because scores would permanently differ between local and registry
  • Running the audit only on the CLI and sending results as metadata — rejected because the server should independently verify

References

  • CLI implementation: systeminit/swamp PR (pending, issue #395)
  • Trust gate design adapted from @bixu/wheelshop extension
  • OSV.dev API: https://osv.dev/docs/
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 5 MOREREVIEW+ 3 MOREPR_MERGEDSHIPPED

Shipped

5/21/2026, 8:36:42 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack725/21/2026, 7:33:59 PM

Sign in to post a ripple.