Skip to content

Primordials coverage drift #55

Primordials coverage drift

Primordials coverage drift #55

name: Primordials coverage drift
# Detects when socket-btm's `additions/source-patched/**/*.js` files
# destructure a name from `primordials` that has no corresponding
# export in socket-lib's `src/primordials.ts` (or alias map / Node-
# internal allowlist). Catches the case where someone adds a new
# primordials use without updating socket-lib in lockstep.
#
# Runs on every PR that touches additions OR socket-lib catalog
# version, plus a weekly cron tripwire so drift surfaces even if
# nobody's editing additions.
on:
pull_request:
paths:
- 'packages/node-smol-builder/additions/source-patched/**/*.js'
- '.socket-lib.json'
- 'pnpm-workspace.yaml'
push:
branches:
- main
paths:
- 'packages/node-smol-builder/additions/source-patched/**/*.js'
- '.socket-lib.json'
- 'pnpm-workspace.yaml'
schedule:
# Every Monday 09:00 UTC — one cadence-checked run per week.
# Catches drift introduced by socket-lib publishing a rename
# without a matching socket-btm bump.
- cron: '0 9 * * 1'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
name: Check additions vs socket-lib primordials
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 (2026-05-15)
with:
persist-credentials: false
submodules: false
- uses: SocketDev/socket-registry/.github/actions/setup@f58e7ae37e486876c326366668e1b2a90ce193c3 # main (2026-06-01)
# Frozen lockfile guarantees socket-lib resolves to the catalog
# pin, so the diff reflects the version we ship — not whatever
# got hoisted yesterday.
- name: Install dependencies (workspace, frozen)
shell: bash
run: pnpm install --frozen-lockfile
- name: Run primordials coverage check
shell: bash
run: node_modules/.bin/socket-lib check prim --explain