ADR-0030: pnpm boot document and GitHub dependency graph snapshot submission¶
- Status: Accepted
- Date: 2026-10-26
Context¶
On 2026-10-26, audit of the GitHub dependency graph and SBOM exports for SnatchArr revealed a blind spot in frontend dependency tracking:
- Two YAML documents in
web/pnpm-lock.yaml: Becauseweb/package.jsonpinspackageManager: pnpm@12.14.0, pnpm 12 emits a multi-document lockfile (https://pnpm.io/lockfile). Document 1 (lines 1–157) is the self-hosting boot document containing onlypackageManagerDependencies(pnpm@12.14.0) and platform-specific runner packages (@pnpm/exe.*). Document 2 (lines 158–4512) contains the actual 442 project packages. - GitHub Dependency Graph truncation: GitHub's built-in dependency graph parser reads only the first YAML document of
pnpm-lock.yaml. Consequently, the exported npm SBOM lists only 15 packages (the pnpm bootstrap shims), and Dependabot is blind to the 442 application dependencies in document 2. - Local and CI scanner coverage:
tools/ci/trivy_scan.py(Trivy 0.75.0) parses document 2 during CI PR checks.pnpm auditin.github/workflows/security.yml(web-auditjob) executes against document 2 in nightly security scans.- Trivy 0.75.0
fs --format github --include-dev-depsresolves document 2: 414 packages with--include-dev-deps(311 without), covering all 42 direct dependencies inweb/package.json.
Decision¶
- Keep two YAML documents: Retain
packageManager: pnpm@12.14.0inweb/package.jsonand keep the multi-documentweb/pnpm-lock.yamlto ensure strict pnpm version enforcement across local workstations and CI environments. - Submit Trivy dependency graph snapshot: Implement automated dependency snapshot generation via
tools/ci/dependency_snapshot.pyand submit it to GitHub's Dependency Submission API (POST repos/{owner}/{repo}/dependency-graph/snapshots) from.github/workflows/security.ymlin a dedicateddependency-submissionjob. - Planted-case and direct-dependency verification:
- Before scanning
web/,tools/ci/dependency_snapshot.pyruns a planted test case against a synthetic lockfile containing only the boot document. The check must reject this planted case; if accepted, the script exits immediately with status 2 ("check not proven"). - For the real scan,
tools/ci/dependency_snapshot.pyverifies that every direct dependency and devDependency declared inweb/package.jsonappears in the snapshot's resolved package URLs (pkg:npm/<urlencoded name>@ver). - The script rewrites the snapshot manifest key and
file.source_locationtoweb/pnpm-lock.yamlso the graph reflects the repository path.
Options Considered¶
pmOnFail: ignorein pnpm configuration:- Result: Rejected. While setting
pmOnFail: ignoreallows single-document lockfiles in certain setups, it disables automatic enforcement of the pinned pnpm version, permitting version drift between developers. - pnpm lockfile suppression settings:
- Result: Rejected. The pnpm lockfile documentation (
https://pnpm.io/lockfile, read 2026-10-26) namespmOnFail: ignoreas the only way to drop document 1, and that removes the version pinning; no other setting was found. - Accept the dependency graph blind spot:
- Result: Rejected. Relying solely on local linters leaves Dependabot alerts and GitHub security advisories inactive for frontend dependencies.
Defense in Depth (Two-Barrier Rule)¶
Frontend supply-chain security is protected by three independent defenses:
- PR Gate:
tools/ci/trivy_scan.pyscans all lockfiles (Go, Rust, and pnpm document 2) on pull requests and blocks on any HIGH/CRITICAL vulnerability with an available fix. - Scheduled Audit:
pnpm auditruns nightly in.github/workflows/security.yml(web-audit) and opens issues on main failures. - Dependabot Alerting: Automated snapshot submission populates the GitHub dependency graph, enabling continuous Dependabot alerting against newly disclosed CVEs.
Revisit Trigger¶
This decision will be revisited when:
- GitHub's native dependency graph parser adds support for multi-document YAML in
pnpm-lock.yaml, or - pnpm deprecates or modifies the multi-document boot document layout in future releases.