security-adversarial: gate CI on npm audit production findings (issue #43) - #46
Draft
ruvnet wants to merge 2 commits into
Draft
security-adversarial: gate CI on npm audit production findings (issue #43)#46ruvnet wants to merge 2 commits into
ruvnet wants to merge 2 commits into
Conversation
…43) Nightly Dream Cycle, 2026-08-28. DEEP=security-adversarial, SCAN=redblue,supply-chain. npm ci reports 8 dependency vulnerabilities (2 critical, 1 high, 3 moderate, 2 low) but CI does not gate on any of them (issue #43). `npm audit --omit=dev` confirms live tonight that all 8 live in the vitest/vite/esbuild/eslint dev toolchain — 0 of the 13 production dependencies are implicated. Adds a deterministic classifyAuditGate() + `dream-machine audit-gate` CLI command + a new CI job that fails only on a reachable high/critical *production* finding (npm audit --omit=dev), and reports (never fails) on dev-only findings. Delegates production-reachability classification to npm's own dependency-graph walk rather than re-deriving it, avoiding the false-positive/negative class of bug PR #19's critic caught in a hand-rolled detector. npm test: 98 -> 111 (+13, 0 removed/modified). Full report: docs/dream-cycle/2026-08-28-security-adversarial-report.md
#46) ACCEPT — audit-gate CI job scoped to npm audit --omit=dev, npm test 98->111, 0 regressions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Nightly Dream Cycle, 2026-08-28. DEEP=security-adversarial, SCAN=redblue,supply-chain. Full report:
docs/dream-cycle/2026-08-28-security-adversarial-report.md. Issue: #45.Hypothesis
Given this repo's CI pipeline, which currently reports
npm auditfindings without gating on them, when a deterministic classifier is added that parsesnpm audit --omit=dev --jsonoutput and fails CI only on a high/critical finding within that production-scoped report, then CI should correctly distinguish reachable production risk from dev-toolchain risk — subject to: no existing test modified/weakened, no re-derivation of npm's own dependency-graph reachability computation, zero-false-negative against a synthetic high/critical finding, zero-false-positive against tonight's real dev-only findings. Frozen before implementation.Candidate
+373/-0 across 6 files (2 new source files, 1 new report, 3 small edits: CLI wiring, CLI tests, CI workflow). One conceptual change:
packages/cli/src/auditgate.ts(pureclassifyAuditGate()) wired into a newdream-machine audit-gateCLI command and a newdependency-securityCI job.Evaluation Receipt
Real evaluator:
npm test(vitest, this repo's ownbenchentrypoint).7933c359)Live end-to-end receipt (real repo data):
The second call proves the gate is not a rubber stamp — CI itself only ever points it at the
--omit=devreport.Baseline
Parent commit
7933c3599abe22df5290f4609d1f93f598feb3de, 98/98 tests passing, clean build.Darwin Lineage
Not run —
DARWIN=not-applicable. Probed live tonight (npx @metaharness/darwin evolve --sandbox mock→ real leaderboard, winnerg2_v5, delta +0.110, LIVE), but no evolvable population exists for a single, already-minimal pure classifier with one fixed policy boundary — same rationale as 2026-08-13/ADR-0002 and 2026-08-18/PR #19.Evidence
Reproduced live tonight (grade A, first-hand):
npm audit --omit=dev --jsonon this repo's real lockfile →metadata.vulnerabilitiesall-zero,metadata.dependencies.prod: 13.npm audit --json(dev-inclusive) → 2 critical, 1 high, 3 moderate, 2 low — matches issue #37's independently-reported findings exactly (GHSA-5xrq-8626-4rwpcritical Vitest UI arbitrary file read,GHSA-fx2h-pf6j-xcffhigh Viteserver.fs.denybypass, plus esbuild/eslint-plugin-kit moderate/low). Full evidence trail with grades in the committed report.Reward-Hack Check
Self-adversarial (solo session, no separate critic agent available):
bench/darwinevaluator entrypoints.--omit=devdependency-graph walk rather than re-deriving it — avoiding exactly the false-positive/negative class of bug PR security-adversarial: detect unpinned npx supply-chain risk in evaluator entrypoints #19's independent critic caught in a hand-rolled npx-pinning detector on 2026-08-18.malformed(exit 2), never silentlyclear(exit 0) — dedicated tests for empty object, null/undefined, non-audit shape, and partial-counts shape.npm audit --omit=dev --json ... || trueonly survivesnpm audit's own nonzero exit on any finding; the gate command itself determines the job's real (non-rubber-stamped) exit code.Security Review
No prompt-injection surface (pure JSON parsing, no LLM calls). No credential exposure, no new network I/O. New filesystem I/O is a single local read of a caller-supplied JSON path (
io.readFile), consistent with every other CLI command's I/O surface. No change toio.exec's actual shell-exec path.Regression Analysis
0 pre-existing tests modified or removed. All 98 baseline tests still pass unchanged; 13 new tests added (9 pure-classifier + 4 CLI-dispatch).
ADR
None. This extends ADR-0002's "classify, don't silently trust or silently fix" precedent within the existing architecture (a new CI job gating on an existing classification primitive), rather than introducing a new invariant.
Gist
No
ghCLI or gist-creation tool available this session (same as 2026-08-13/2026-08-18). Report committed atdocs/dream-cycle/2026-08-28-security-adversarial-report.md.GIST=LOCAL.Issue
#45
Witness
Verify:
sha256sum docs/dream-cycle/2026-08-28-security-adversarial-report.md, thenprintf '%s%s' "<that hash>" "7933c3599abe22df5290f4609d1f93f598feb3de" | sha256summust equal the witness above. Confirmed tonight viadream-machine witness verify(✓ VALID).Merge Policy
Draft — human review required. This PR does not carry the
automerge-safelabel: it adds a new CI job (gate infrastructure), which the repo's own merge policy treats as human-review-only regardless of risk level. The session never merges and never applies that label itself.Generated by Claude Code