dream(security-adversarial): disclose devDependency exclusion in harness audit/sbom (evaluated) - #243
Draft
ruvnet wants to merge 2 commits into
Draft
dream(security-adversarial): disclose devDependency exclusion in harness audit/sbom (evaluated)#243ruvnet wants to merge 2 commits into
ruvnet wants to merge 2 commits into
Conversation
β¦ harness audit/sbom (evaluated) harness audit (npm audit --omit=dev) and harness sbom (SPDX, filters pkg.dev===true) both default to excluding devDependencies -- a defensible two-tier posture, but neither said so. A reviewer trusting the default output saw a clean bill of health even when this repo's own dev tree carries a critical + 4 high advisories (Vitest UI arbitrary file read/execute, js-yaml/nanoid/postcss/vite). devDependencies execute during npm ci/test/build, a real CI/build-time attack surface (2025-2026 Shai-Hulud + node-ipc incidents). - audit-cmd.ts: best-effort second npm audit (no --omit=dev) discloses the suppressed count without changing default PASS/FAIL gating; also fixes a double-counting bug in `total` (npm's own `total` key was being summed a second time via Object.values()). - sbom-cmd.ts: counts excluded dev-scope packages, adds an SPDX creationInfo.comment + matching CLI line. - New tests (sbom-cmd.test.ts, audit-cmd.test.ts) verified red against pre-patch code. Full create-agent-harness suite: 468/468 passed (2 skipped), 0 regressions. tsc --noEmit clean. Never merged automatically -- draft PR for human review. Co-Authored-By: claude-flow <ruv@ruv.net>
Co-Authored-By: claude-flow <ruv@ruv.net>
This was referenced Aug 29, 2026
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.
Hypothesis
Given
harness audit/harness sbomin default mode (no--include-dev),when a disclosure patch reports the suppressed advisory count (
audit) /excluded package count (
sbom) without changing default PASS/FAIL gating,then a reviewer should be able to tell from default output alone that
devDependencies were excluded β subject to: (a) default
auditgatingunchanged, (b) no new dependency/external destination, (c) 0 regressions,
(d) new tests must fail against pre-patch code.
Candidate
Two files, ~70 lines of source change:
packages/create-agent-harness/src/audit-cmd.tsβ when!includeDev,runs one additional best-effort
npm audit(no--omit=dev) to computea suppressed-advisory count, surfaced as a new line (text) /
devDependenciesSuppressedfield (--bundle). Never affects theexisting pass/fail
code. Also fixes a pre-existing double-counting bugin the
totalcalculation (see Reward Hack Check).packages/create-agent-harness/src/sbom-cmd.tsβ counts dev-scopepackages excluded from the SPDX document, adds
creationInfo.commentplus a matching CLI line when any were excluded.
Evaluation Receipt
Deterministic code-correctness fix (no benchmark corpus/model calls
needed;
LLM_EVAL=availablebut unused). Real before/after repro againstthis repo's own
package-lock.json:New tests:
sbom-cmd.test.ts(4),audit-cmd.test.ts(6) β all verifiedto fail against pre-patch code (
git stash+ re-run: 2/4 and 2/6failed on exactly the new-disclosure assertions), then pass post-patch.
Baseline Comparison
create-agent-harnessfull suite: baseline 467/467 passed (2 skipped)β candidate 468/468 passed (2 skipped). 0 regressions.
tsc --noEmitclean. Diff: 2 source files (~70 lines) + 2 new test files (~180 lines) β
under the 300-line target, one conceptual change applied to both commands.
Darwin Lineage
Not run β this is a CLI-tooling correctness/disclosure fix, not a
genome/routing/topology/prompt/tool/tier parameter; no bounded-evolution
mutation surface applies.
Flywheel Evidence
Not applicable β generator-CLI fix, not a harness-runtime promotion
candidate. Evidence retained as the committed tests + gist + this PR.
Reward Hack Check
No test/benchmark weakened; no evaluator exploited (no corpus exists to
exploit); no hidden preprocessing. Disclosed cost:
harness audit'sdefault path now makes 2
npm auditcalls instead of 1 β reallatency/network increase, not hidden, left as a future-work
cache/memoize item rather than solved here. Bug caught and fixed in
this diff:
npm audit'smetadata.vulnerabilitiesobject includes atotalkey alongside the 5 severity keys; both my first draft of the newdisclosure line and the pre-existing
totalvariable summedObject.values(counts), double-counting that key (invisible previouslyonly because this repo's
--omit=devscope happens to be all-zero). Fixedboth occurrences to sum only the 5 known severity keys; added a regression
test with a realistic
totalkey in the mock so it can't silentlyreappear.
Security Review
No new dependency, no new external destination (same npm registry
harness auditalready contacts). Strictly more honest default-modeoutput; no reduction in security posture. Only tradeoff is the disclosed
latency/network increase, avoidable via
--include-dev(which alreadyskips the second call).
ADR
None created β this is a bug-fix-shaped correctness/disclosure change to
existing CLI commands, not an architectural decision (no new component,
no new policy). Per this repo's own guidance, ADRs are for architectural
decisions, not parameter/output-format fixes.
Research Gist
docs/dream-cycle/2026-08-28-gist.md(committed on this branch,GIST=LOCALβ no gist-creation tool available this session, matchingevery prior Dream Cycle night). Includes sourced 2025-2026 supply-chain
research (Shai-Hulud worm, May 2026 node-ipc CI-credential exfiltration),
a competitor comparison table, and a second, unfixed finding
(
threat-model's MCP-in-use false negative) flagged for a future night.Issue
Closes evidence for #242.
Witness
Verifier procedure in the gist file itself.
Merge Policy
Human review required. Do not self-merge. Do not autonomously promote
Flywheel state.
Generated by Claude Code