Dependency Policy — Supply-Chain Hardening#
Co-Vibe treats third-party packages as a primary attack surface. Recent npm registry incidents (compromised maintainer accounts publishing malicious patch releases) mean a floating version range can silently pull hostile code on the next install. Our posture is freeze by default, upgrade deliberately.
Rules#
- Direct dependencies are pinned to exact versions in
package.json— no^or~ranges. A given checkout always installs the same versions. - The lockfile is the source of truth.
package-lock.json(v3) pins every transitive dependency with an integrity hash. Always install withnpm ci, nevernpm install, in CI and production builds.npm cifails closed if the lockfile andpackage.jsondisagree or an integrity hash mismatches. .npmrcenforces the freeze.save-exact=truemakes any futurenpm install <pkg>record an exact version;engine-strict=truehonors the supported Node range. Thedoctorscript validates.npmrcand fails if it ever disables the lockfile, points at an untrusted registry, or embeds credentials.- No automatic upgrade bot. There is intentionally no Dependabot/Renovate config. Dependencies do not move on their own. (If one is added later, it must open PRs for review only — never auto-merge.)
- CI enforces supply-chain gates (
Security gatejob, every PR + push):npm ci— integrity-verified install from the frozen lockfile.npm audit --audit-level=high— fails the build on high/critical CVEs.npm audit signatures— verifies every installed package has a valid npm registry signature (provenance).npm run check:secrets— no committed secrets.
Upgrading (the deliberate path)#
Dependencies stay frozen until the next release cycle. To bump intentionally:
- Change the exact version in
package.jsonfor the specific package only. npm install --package-lock-onlyto update the lockfile (review the diff — confirm only the intended subtree changed; no unexpected transitive moves).npm cilocally, then runnpm run readiness(includesnpm run security).- Read the release notes / changelog and skim the diff for anything suspicious (new install scripts, network calls, obfuscated code) before merging.
- Prefer waiting a few days after a release before adopting it, so the ecosystem has time to surface a compromised publish.
Accepted advisories#
CI gates on --audit-level=high. Moderate advisories are reviewed and tracked
here rather than blocking the build:
postcss <8.5.10(CSS-stringify XSS, GHSA-qx2v-qp2m-jg93) — transitive vianext→@workos-inc/authkit-nextjs. No fix currently available; not reachable with untrusted CSS in this app. Re-evaluate when an upstream fix ships.