ci: gate on what we ship, and run the audit after the code checks #20

Merged
chrnx merged 2 commits from chore/ci-audit-gate into develop 2026-08-08 22:41:35 +00:00
Owner

npm audit sat fifth of fifteen steps, so any advisory anywhere in the tree
skipped lint, format, complexity, typecheck, test and build. A nanoid high
coming in through vitest was enough to hide whether the code itself was
correct, and CI had been red on main since 2026-08-07 for that reason alone.

For an external contributor the effect is worse: their runs need maintainer
approval before they see anything, and what they finally get is a red X with
no information about their own code. That happened on Expressive-Tea/green-tea#14.

Severity is the wrong axis. A critical in the test runner reaches nobody; a
high in reflect-metadata reaches everyone. Scope is the right one, so the
audit now splits: --omit=dev blocks, everything else reports and moves on.
With reflect-metadata as the sole runtime dependency the blocking half is
reliably clean, and it stays meaningful precisely because it is narrow.

Known gap: busboy and ws are peerDependencies, so --omit=dev never sees
them. Consumers audit those in their own tree.

Verified on GitHub contrib (run 31280451015): all sixteen steps green, with
npm audit --omit=dev reporting 0 vulnerabilities.

The contrib entry in the triggers is deliberate even though no such branch
exists here. GitHub reads workflow files from the base branch of a pull
request, so external PRs landing on contrib need it, and keeping the file
byte-identical across both forges avoids a permanent phantom diff.

`npm audit` sat fifth of fifteen steps, so any advisory anywhere in the tree skipped lint, format, complexity, typecheck, test and build. A `nanoid` high coming in through vitest was enough to hide whether the code itself was correct, and CI had been red on main since 2026-08-07 for that reason alone. For an external contributor the effect is worse: their runs need maintainer approval before they see anything, and what they finally get is a red X with no information about their own code. That happened on Expressive-Tea/green-tea#14. Severity is the wrong axis. A critical in the test runner reaches nobody; a high in `reflect-metadata` reaches everyone. Scope is the right one, so the audit now splits: `--omit=dev` blocks, everything else reports and moves on. With `reflect-metadata` as the sole runtime dependency the blocking half is reliably clean, and it stays meaningful precisely because it is narrow. Known gap: `busboy` and `ws` are peerDependencies, so `--omit=dev` never sees them. Consumers audit those in their own tree. Verified on GitHub `contrib` (run 31280451015): all sixteen steps green, with `npm audit --omit=dev` reporting 0 vulnerabilities. The `contrib` entry in the triggers is deliberate even though no such branch exists here. GitHub reads workflow files from the base branch of a pull request, so external PRs landing on `contrib` need it, and keeping the file byte-identical across both forges avoids a permanent phantom diff.
chrnx added 2 commits 2026-08-08 22:39:48 +00:00
External contributions land on `contrib`, and a PR targeting a branch absent
from the trigger list gets no checks at all — leaving contributors without the
feedback that would have caught the failure themselves.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
`npm audit` sat fifth of fifteen steps, so any advisory anywhere in the tree
skipped lint, typecheck, tests and build. A high in a vitest transitive was
enough to hide whether the code itself was correct — and for external
contributors, whose runs need approval before they see anything at all, that
turned a red X into no information.

Severity is the wrong axis: a critical in the test runner reaches nobody,
while a high in `reflect-metadata` reaches everyone. Scope is the right one.
Production dependencies block; build tooling reports and moves on.

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
chrnx force-pushed chore/ci-audit-gate from 5ca4e4e449 to 55263f2d97 2026-08-08 22:39:48 +00:00 Compare
chrnx merged commit 324ddf0d61 into develop 2026-08-08 22:41:35 +00:00
Sign in to join this conversation.