Skip to content

ci(lockfile): add drift detection workflow + outdated:check script - #246

Merged
h4yfans merged 1 commit into
mainfrom
debt/phase-6-u10-lockfile-drift
Apr 16, 2026
Merged

ci(lockfile): add drift detection workflow + outdated:check script#246
h4yfans merged 1 commit into
mainfrom
debt/phase-6-u10-lockfile-drift

Conversation

@h4yfans

@h4yfans h4yfans commented Apr 16, 2026

Copy link
Copy Markdown
Collaborator

Refs § 6.10 of .claude/plans/tech-debt-remediation.md (Phase 6 Unit U10).

Summary

  • New .github/workflows/lockfile-drift.yml runs on PRs + pushes to main when **/package.json, pnpm-lock.yaml, or pnpm-workspace.yaml change. Two-stage check: pnpm install --frozen-lockfile catches hard mismatches, then a regen diff catches the subtler case where pnpm would silently rewrite the lockfile on the next local install.
  • scripts/check-lockfile.js mirrors the CI workflow for pre-push feedback. Wired as pnpm check:lockfile at the repo root.
  • pnpm outdated:check surfaces stale workspace deps across the monorepo, truncated to 100 lines so the output is scan-able instead of a wall of text.
  • docs/ci-guardrails.md documents what the workflow does, how to fix a drift failure, and why reproducible builds matter.

Why

Lockfile drift = non-reproducible builds + "works on my machine" bugs. Today --frozen-lockfile in every CI job already catches drift as an install error, but the signal is noisy and only fires when pnpm treats the mismatch as a hard error. The new workflow is dedicated, narrowly scoped to dep-file changes, and also catches the silent-rewrite case.

Test plan

  • pnpm install --frozen-lockfile passes locally.
  • pnpm check:lockfile reports Lockfile is clean. on clean tree.
  • Simulated drift (appended a line to pnpm-lock.yaml) → script exits 1 with actionable error; lockfile auto-restored.
  • Tmp snapshot file cleaned up on both clean + drift exit paths.
  • pnpm outdated:check produces truncated workspace-wide dep report.
  • Workflow YAML parses cleanly (js-yaml); matches existing ci.yml conventions (action versions, pnpm-setup-before-setup-node ordering so cache works).
  • CI confirms workflow runs green on this PR.

Refs § 6.10 of tech-debt-remediation plan.

- New .github/workflows/lockfile-drift.yml runs on PRs + pushes to main
  when package.json, pnpm-lock.yaml, or pnpm-workspace.yaml change.
  Two-stage check: frozen install catches hard mismatches, then a regen
  diff catches cases where pnpm would silently rewrite the lockfile.
- scripts/check-lockfile.js mirrors the workflow for pre-push feedback;
  wired as pnpm check:lockfile.
- pnpm outdated:check surfaces stale deps across the workspace (truncated
  to 100 lines for scan-ability).
- docs/ci-guardrails.md explains what the workflow does, how to fix a
  drift failure, and why reproducible builds matter.
@h4yfans
h4yfans merged commit c7515d4 into main Apr 16, 2026
5 checks passed
@h4yfans
h4yfans deleted the debt/phase-6-u10-lockfile-drift branch April 16, 2026 22:21
h4yfans added a commit that referenced this pull request May 6, 2026
)

Refs § 6.10 of tech-debt-remediation plan.

- New .github/workflows/lockfile-drift.yml runs on PRs + pushes to main
  when package.json, pnpm-lock.yaml, or pnpm-workspace.yaml change.
  Two-stage check: frozen install catches hard mismatches, then a regen
  diff catches cases where pnpm would silently rewrite the lockfile.
- scripts/check-lockfile.js mirrors the workflow for pre-push feedback;
  wired as pnpm check:lockfile.
- pnpm outdated:check surfaces stale deps across the workspace (truncated
  to 100 lines for scan-ability).
- docs/ci-guardrails.md explains what the workflow does, how to fix a
  drift failure, and why reproducible builds matter.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant