Dependency Security and Lockfile Policy
This project uses pnpm with a committed lockfile to keep installs reproducible and reduce supply-chain risk.
For the operational runbook used by developers, see docs/dependency-update-procedure.md.
Baseline Rules
- Keep
frontend/pnpm-lock.yamlcommitted and in sync withfrontend/package.json. - Use frozen installs for normal workflows:
- CI:
pnpm install --frozen-lockfile - Build scripts:
pnpm install --frozen-lockfile
- CI:
- Pin package manager version with Corepack (
pnpm@10.33.0).
CI Security Gates
The CI pipeline includes dedicated dependency audit jobs:
security:python-deps- installs
pip-audit - runs
pip-audit -r backend/nunet_api/requirements.txt --strict
- installs
security:frontend-deps- activates the pinned pnpm version through Corepack
- installs with
--frozen-lockfile - runs
pnpm audit --prod --audit-level=high
If vulnerabilities are detected, the pipeline fails before package build/deploy jobs.
The package build script also enforces the same audit check by default (STRICT_PNPM_AUDIT=1).
Safe Dependency Update Workflow
Use this workflow when intentionally updating dependencies:
- Create a dedicated update branch.
- Update dependency specifiers in
frontend/package.jsonas needed. - Regenerate lockfile:
corepack prepare pnpm@10.33.0 --activatecorepack pnpm install
- Verify:
corepack pnpm audit --prod --audit-level=highcorepack pnpm run build
- Commit both
frontend/package.jsonandfrontend/pnpm-lock.yamltogether.
Do not regenerate lockfiles in deployment hotfixes unless the dependency change is intentional and reviewed.
For Python dependency automation, use deploy/scripts/update_python_deps.sh (audit-only or --apply-fixes mode).
For frontend dependency triage/remediation with release-age guardrails, use deploy/scripts/update_frontend_deps.sh.
Emergency Response Pattern
If a supply-chain incident is reported:
- Pin the affected package to a known-safe version in
frontend/package.json. - Add or adjust
pnpm.overridesfor vulnerable transitive packages. - Regenerate and commit lockfile.
- Re-run audit/build gates before merge.
Local Policy Settings
frontend/.npmrc contains project-level safety defaults:
minimumReleaseAge=1440trustPolicy=no-downgradesave-exact=trueprefer-frozen-lockfile=trueverify-store-integrity=trueengine-strict=true
These settings are guardrails. CI checks and code review remain the enforcement layer.