Skip to content

Dependencies

Pinning fixes what is installed; this page is about what is allowed in, and what is noticed after it is in. A pull request that changes package-lock.json (in CPRMV, serve_api/requirements.txt or requirements-dev.txt) is reviewed as data: where each package comes from, whether a new direct dependency has a written assessment, and whether every changed version is at least 14 days old. After the merge, a daily audit looks for advisories on acc and main, Semgrep scans every change, and a quarterly review looks for abandoned packages.

How the pins themselves are set and kept current is on Pinning.

How a lockfile change is reviewed

flowchart TD
    A["Pull request"] --> B["Self-test the gate and check dependency-register.json"]
    B -->|"register malformed"| F["Fail"]
    B --> C{"package-lock.json changed?"}
    C -->|no| P["Pass"]
    C -->|yes| D{"Every package from registry.npmjs.org, with integrity?"}
    D -->|no| F
    D -->|yes| E{"New direct dependency in a manifest?"}
    E -->|no| G{"Every added or changed version 14 days old?"}
    E -->|yes| H{"Register entry that agrees with the evidence?"}
    H -->|yes| G
    H -->|no| S{"Renovate security pull request?"}
    S -->|"yes: warning"| G
    S -->|no| F
    G -->|yes| P
    G -->|no| X{"Renovate security pull request, or a cooldownOverride with an open issue?"}
    X -->|"yes: logged as exception"| P
    X -->|no| F

The lockfile-review job (in .github/workflows/zizmor.yml) runs on every pull request, whatever its base or paths, so it can be a required check without ever failing to report.

  1. Self-test. The job runs the tests of scripts/lockfile-diff.mjs and scripts/dependency-gate.mjs, then dependency-gate.mjs --check-register, before it looks at the lockfile: a broken register fails every pull request, not only the next one that changes dependencies.
  2. Unchanged lockfile. The job passes at once.
  3. The lockfile diff. lockfile-diff.mjs compares the base and head lockfiles as data. It fails on any package resolved from somewhere other than https://registry.npmjs.org/, or recorded without an integrity hash. It prompts without failing on a licence change, a new package whose licence is not on the allow-list in lockfile-review.json, a new install script, and a downgrade.
  4. The dependency gate. dependency-gate.mjs runs whatever the diff found, and checks new direct dependencies and the cooldown (below).
  5. One report. Both write to the job summary, and a second job, lockfile-review-comment, posts or updates a single comment on the pull request. The first job holds a read-only token; the comment job holds pull-requests: write and runs no repository code.

Exit 2 from either script means it could not run (unreadable lockfile, registry or GitHub API unreachable) and fails the check: it never reads as clean.

A new direct dependency needs a register entry

"New" means new to that manifest, under any of dependencies, devDependencies, optionalDependencies or peerDependencies: a package already direct in one workspace still counts when it is added to another. Each one needs an entry in dependency-register.json in the same pull request. The register holds only what has been added through the gate; it is not a list of every dependency.

Field Content
name, manifest, field the package, the manifest ((root) or packages/<name>), the field
status assessed, or override for an urgent fix with no time to assess
assessed.version the version assessed; its major must equal the locked major
criteria the six criteria, each holds: true/false with a why
outcome keep, or replace with a followUp issue
override { reason, issue }: the issue is the assessment still owed

The six criteria are those of Linked Data Explorer's docs/dependency-criteria.md: maintained, maintainers, licence, release policy, footprint, needed. The gate gathers the evidence itself from the npm registry, the GitHub API and the lockfile, and blocks when:

  • the entry is missing (a Renovate security pull request passes with a warning instead);
  • an entry says a criterion holds that the evidence contradicts: no release in 12 months, deprecated, or an archived or unchecked repository (maintained); one npm maintainer and no organisation (maintainers); a licence not on the allow-list (licence); an install script anywhere in what it pulls in (footprint);
  • needed, or any criterion that does not hold, has a why shorter than 40 characters, or two whys are identical;
  • the assessed major is not the locked major;
  • a cited followUp or override issue is not an open issue (a pull request does not count);
  • the package is deprecated or archived, unless the outcome is replace with an open follow-up.

An override entry passes when its issue is open, and is listed as a warning.

The cooldown on lockfile versions

npm ci installs the lockfile without applying .npmrc's min-release-age, so the gate checks the lockfile itself: every package version from the registry that the pull request adds or changes, direct or transitive, must have been published at least minReleaseAgeDays (14, in lockfile-review.json) before the run. A version with no publish time fails. Two exceptions, both written into the comment's Cooldown exceptions section:

  • A Renovate security update. All three must hold: the author is renovate[bot], the pull request carries the security label, and the GitHub API's event history shows renovate[bot] adding it. The gate asks the API when it runs and waits up to 60 seconds for Renovate's labels. A person adding the label does not count.
  • A committed override. An entry in the register's cooldownOverrides: { package, version, reason, issue }, with an open issue.

There is no label a person can set and no bypass.

The daily proof (RONL Business API). The Cooldown proof step of dependency-audit.yml runs scripts/cooldown-proof.mjs: it picks a version of a frequently published package (@types/node first) younger than the cooldown and asks npm to install it with the repository's .npmrc. It passes only if npm refuses, and the same command with --min-release-age=0 succeeds. A failure reaches the daily audit's tracking issue.

CPRMV: the same gate for PyPI

CPRMV runs the same review as the job requirements-review in .github/workflows/zizmor.yml, rewritten in Python for PyPI: stdlib-only scripts, tested under pytest in scripts/test/ on every run. The criteria, the register fields (with the pyproject.toml group in manifest), the cooldownOverrides, the Renovate security route and the exit codes are the npm gate's. Where it differs:

The three applications (lockfile-review) CPRMV (requirements-review)
The review and the gate run when package-lock.json changed requirements.txt, requirements-dev.txt, pyproject.toml or dependency-register.json in serve_api/ changed
A register change on its own format check only (--check-register) judged against PyPI and GitHub evidence
Blocks in the diff a package not from registry.npmjs.org, or without integrity a pin without hashes, or from anywhere but PyPI
"New direct dependency" new to a manifest field new to a group of serve_api/pyproject.toml (runtime, dev, tools)
Register only what was added through the gate every direct dependency (15)
A young version in Renovate's routine pull request blocks logged, not blocked
Required on acc acc and main

Why Renovate's routine pull requests are logged. Renovate's pip-compile manager passes no upload cutoff to pip-compile, so lock-file maintenance re-resolves the transitive pins without one and almost always brings a pin younger than 14 days. On a pull request whose author is renovate[bot] (read from the event), young pins are listed in the comment, the job summary and the next quarterly review instead of failing the check; the new-dependency rules still apply. A person's commit pushed onto a Renovate branch sits inside a Renovate-authored pull request, so its young pins are logged too. A person's own recompile meets the cooldown before it is pushed: make deps-linux sets PIP_UPLOADED_PRIOR_TO=P14D for pip (Pinning).

When the scans run

flowchart LR
    PR["Pull request"] --> AU["audit: zizmor, Renovate config, lockfile matches, registry signatures, pin check"]
    PR --> LR["lockfile-review (CPRMV: requirements-review)"]
    PR --> SC["scan: Semgrep, what the pull request introduces"]
    PU["Push to acc or main"] --> AU
    PU --> SB["scan: Semgrep, full, writes the baseline"]
    DA["Daily, 05:17 UTC"] --> DAU["dependency-audit of acc and main"]
    DAU --> TI["Tracking issue opened, updated or closed"]
    QU["2 Jan, Apr, Jul, Oct, 06:23 UTC"] --> DR["dependency-review"]
    DR --> QI["The quarter's review issue"]

Audits. dependency-audit.yml checks out acc and main in turn and audits each branch's lockfile; it installs nothing. A run that cannot audit exits 2 and counts as a finding. It opens one tracking issue, updates it while the finding stands, and closes it when the audit is clean. It also runs on a pull request that changes the audit itself, without touching the issue.

Component Tool Fails on Reported only
CPSV Editor, Linked Data Explorer, RONL Business API npm audit --package-lock-only, grouped per advisory by scripts/audit-tree.mjs a high or critical advisory in production dependencies moderate and low; everything dev-only
CPRMV pip-audit==2.10.1 via scripts/audit-requirements.sh any advisory in serve_api/requirements.txt (pip-audit grades no severity) advisories only in requirements-dev.txt

CPRMV passes accepted advisory IDs from scripts/pip-audit-accepted.txt as --ignore-vuln; each needs a row in the accepted-findings table of its SECURITY-PIPELINE.md. The file lists none.

Registry signatures. In the three applications the audit job runs npm run audit:signatures (scripts/audit-signatures.sh) after npm ci: it checks the registry signature of every installed package and the provenance attestation of those that have one, and fails on an invalid or missing signature or an advertised attestation that cannot be fetched. A package without an attestation passes. CPRMV relies on the hashes instead.

Semgrep. The scan job (.github/workflows/semgrep.yml) runs semgrep ci --no-suppress-errors with SEMGREP_APP_TOKEN: Semgrep Code and Supply Chain. On a pull request it reports what the pull request introduces; the pushes to acc and main write the baseline in Semgrep Cloud. It fails on findings the Semgrep Cloud policy marks blocking, and when the tool itself errors. .semgrepignore excludes tests and examples (CPRMV: docs/, generated ReSpec output and test fixtures). A pull request from a fork gets no secret, so scan fails for it; the repositories have no forks.

Triage. A Code finding that is a false positive is suppressed in the code: a comment with the reason, then nosemgrep: <full rule id> on the line above. A Supply Chain finding, or a true positive accepted rather than fixed, is triaged in the Semgrep UI with a comment. The RONL Business API and CPRMV also write the reason as a row in their SECURITY-PIPELINE.md table, because the platform's API does not return UI comments; the CPSV Editor and the Linked Data Explorer keep no such table, so the Linked Data Explorer's accepted Supply Chain findings carry their reason in the Semgrep UI only (iou-architectuur#132).

Quarterly review. dependency-review.yml runs scripts/dependency-review.mjs over every direct dependency in package-lock.json, asks the npm registry and the GitHub API for the same signals the gate uses, and opens an issue titled Quarterly dependency review — YYYY-Qn: Failing (deprecated, archived, or no evidence), To judge, Register: still open (overrides, replacements, cooldown overrides), the previous quarter's Renovate security exceptions, and all direct dependencies. The run never fails; the outcomes are recorded in the issue. A re-run in the same quarter adds a comment. In CPRMV, scripts/dependency_review.py does the same over every direct dependency in serve_api/pyproject.toml and every register entry, against PyPI and GitHub, and also lists entries past their assessed major and the young pins it logged on the previous quarter's Renovate pull requests; the issue is labelled dependencies.

Per repository

Component Lockfile review Register entries Daily audit (issue labels) Cooldown proof Quarterly review scan Accepted-findings table
CPSV Editor lockfile-review, required on acc 1 npm (security, ci) not in place yes required on acc and main not in place
Linked Data Explorer lockfile-review, required on acc 5 npm (dependencies, security) not in place yes required on acc and main not in place
RONL Business API lockfile-review, required on acc 3 npm (dependencies, security) daily yes required on acc and main Semgrep findings we accept, and why
CPRMV requirements-review, required on acc and main 15, every direct dependency pip-audit (security, ci) not in place yes required on acc and main Findings we accept, and why
Norm Editor not in place — not in place not in place not in place not in place —

The scripts lockfile-diff.mjs, dependency-gate.mjs and dependency-review.mjs are the same in the three applications (formatting aside); CPRMV's requirements_review.py, dependency_gate.py and dependency_review.py are their Python counterparts. The Norm Editor's GitLab pipeline runs tests and image builds only: no audit, no lockfile review, no Semgrep.

What it does not cover

  • The gate trusts its own pull request. The job runs the pull request's copy of the gate, and the rulesets require no approvals, so a pull request can weaken the gate by editing it. The change shows in the diff.
  • "inBundle": true. A lockfile entry marked as bundled is skipped by the origin, integrity and cooldown checks.
  • A register-only change in the three applications. A pull request that edits only dependency-register.json gets the format check (--check-register), not the evidence check: the gate judges entries against evidence only when package-lock.json changes too. CPRMV judges every register change against evidence.
  • A green pull request on a stale base. The checks run on the merge commit with the base as it is then. Two dependency pull requests that each pass can still combine into a lockfile that matches no package.json; merge them one at a time, rebasing each onto the merged acc.
  • main does not require lockfile-review in the three applications; it changes only by promotion of commits that passed it on acc. CPRMV's main requires requirements-review.
  • Judgement. The gate checks that an entry is consistent with the evidence and written out; whether the reasoning is sound is the reviewer's.
  • Dependencies already in the tree. The gate assesses only what a pull request adds; the quarterly review covers the rest.
  • Renovate's routine pull requests in CPRMV. Their young pins are logged, not blocked, so CPRMV's transitive tree meets the cooldown on people's changes only (CPRMV: the same gate for PyPI).
  • Norm Editor: none of this page.

Where it lives

What Path
Lockfile review and gate (job lockfile-review; CPRMV requirements-review) .github/workflows/zizmor.yml
Lockfile diff scripts/lockfile-diff.mjs; licence allow-list and minReleaseAgeDays in lockfile-review.json; CPRMV scripts/requirements_review.py, serve_api/lockfile-review.json
Dependency gate scripts/dependency-gate.mjs (rules in its header comment); CPRMV scripts/dependency_gate.py, scripts/gate_common.py, scripts/pypi_evidence.py, tests in scripts/test/
Register dependency-register.json (dependencies, cooldownOverrides); CPRMV serve_api/dependency-register.json
Criteria Linked Data Explorer docs/dependency-criteria.md
Daily audit .github/workflows/dependency-audit.yml; scripts/audit-tree.mjs; CPRMV scripts/audit-requirements.sh, scripts/pip-audit-accepted.txt
Cooldown proof RONL Business API scripts/cooldown-proof.mjs
Registry signatures scripts/audit-signatures.sh (npm run audit:signatures)
Semgrep .github/workflows/semgrep.yml, .semgrepignore
Quarterly review .github/workflows/dependency-review.yml, scripts/dependency-review.mjs; CPRMV scripts/dependency_review.py
Accepted findings SECURITY-PIPELINE.md in each repository
Required checks the rulesets; see Branches & Promotion