0031 addendum. npm enforcement
Source:
docs/decisions/0031-addendum-npm-enforcement.md. Generated at build time; edit the source file.
Date: 2026-11-21 Status: Accepted. Amends 0031 (Rust workspace, toolchain and crates; lives on the r1 branches).
Context
Section titled “Context”ADR 0031 and CLAUDE.md require every package to be at least 7 days old and pinned exactly. For crates, backend/scripts/check-crate-age.sh enforces it. For npm nothing did: minimumReleaseAge was unset, so pnpm 12 used its built-in default (1440 minutes, non-strict) and ranges were accepted.
Decision
Section titled “Decision”pnpm-workspace.yamlsetsminimumReleaseAge: 10080(7 days, in minutes) andminimumReleaseAgeStrict: true. pnpm then also verifies the lockfile against the policy on install. We never useminimumReleaseAgeExcludeto get around it.scripts/check-npm-age.mjsis the npm counterpart of the crate script. It reads every resolved version inpnpm-lock.yaml, fetches the publish time from the npm registry (cached in the git-ignored.cache/npm-age/), and fails on any version younger than 7 days. It also fails if a direct dependency in any workspacepackage.jsonis a range (^,~,*,>=, …).workspace:andcatalog:specifiers are allowed.- CI runs the script before
pnpm install. - All direct dependencies are pinned exactly. Versions that failed the age check were downgraded to the newest stable release at least 7 days old, and the lockfile was regenerated under the strict policy (no excludes, no overrides).
@playwright/mcpis not a dependency of the workspace. Every published version depends on an exact alphaplaywright, so keeping it inpackage.jsonwould put a prerelease in the lockfile. The Playwright MCP runs only through the pinnednpxentry in.mcp.json, as dev tooling that is never shipped, and that entry must pin an exact version that is at least 7 days old (never@latest).- Known residual: the lockfile still contains
@emnapi/coreand@emnapi/runtime2.0.0-beta.2. They are auto-installed peers of@napi-rs/wasm-runtime, used only by rolldown’s optional wasm32 binding, which never installs on a native platform. They pass the age check.
Consequences
Section titled “Consequences”Versions that are too young cannot enter the lockfile, and a range cannot be committed. When a package is too young, wait or pin an older, aged version; do not exclude it.