Skip to content

refactor(modules): fold dep-scanner into code-scanner as the deps subsystem - #49

Merged
ralyodio merged 1 commit into
masterfrom
refactor/fold-dep-scanner-into-code-scanner
Jul 28, 2026
Merged

refactor(modules): fold dep-scanner into code-scanner as the deps subsystem#49
ralyodio merged 1 commit into
masterfrom
refactor/fold-dep-scanner-into-code-scanner

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Resolves the open module-boundary question in PRD 0002.

Why

PRD.md already assigns "dependency CVEs" to code-scanner, so shipping a separate dep-scanner module contradicted the product doc. Two modules would also have:

  • walked the same directory trees twice,
  • held two inventories of the same packages,
  • given the operator two path lists to keep in sync,

for a user-visible surface (threatcrush scan --deps) that was always meant to be one command.

The arguments for splitting were real, but all internal: a package-graph data model, an external advisory database, and a per-ecosystem parser surface that will keep growing. Those are preserved as a subsystem boundary rather than a module boundary.

What changed

modules/dep-scanner/src/{inventory,osv,scripts,semver}.ts
  -> modules/code-scanner/src/deps/
  • src/deps/index.ts is the new subsystem entry point. scanDependencies() takes options and returns a result with no ModuleContext, so the same code serves both the scheduled daemon scan and the one-shot scan --deps.
  • src/index.ts is now a thin host that runs enabled subsystems and owns alerting/dedupe, with stubs documented for secrets/, sast/ and config/ — the rest of code-scanner's remit per PRD.md.
  • Dependency config is namespaced deps_* so sibling subsystems can be configured without collision. paths, min_severity, scan_interval_seconds and the fail_on_unparseable honesty switch stay shared.
  • PRD 0002 updated: the boundary question is marked resolved, implementation: set, and the UX/config sketches re-cast around code-scanner.

Verification

  • 41 tests pass (unchanged — this is a move plus a host rewrite, not a behaviour change).
  • pnpm build clean; repo pre-commit hooks (CLI + web build) pass.
  • Re-ran against the reference pnpm workspace that motivated the PRD: still resolves 21 roots / 101 packages, versus the 0 dependencies, coupling 0/100 (good) that the original analyzer reported.

Git tracked every file move as a rename, so the diff is reviewable as such.

…system

Resolves the open module-boundary question in PRD 0002.

PRD.md already assigns "dependency CVEs" to code-scanner, so shipping a
separate dep-scanner module contradicted the product doc. Two modules would
also have walked the same trees, held two inventories of the same packages,
and given the operator two path lists to keep in sync — for a user-visible
surface (`threatcrush scan --deps`) that was always meant to be one command.

The arguments for splitting were real but all internal: a package-graph data
model, an external advisory database, a per-ecosystem parser surface that will
keep growing. Those are preserved as a subsystem boundary under src/deps/
rather than a module boundary, alongside stubs for the rest of code-scanner's
remit (secrets/, sast/, config/).

  modules/dep-scanner/src/{inventory,osv,scripts,semver}.ts
    -> modules/code-scanner/src/deps/

src/deps/index.ts is the subsystem entry point: scanDependencies() takes
options and returns a result with no ModuleContext, so the same code serves
the scheduled daemon scan and the one-shot `scan --deps`. src/index.ts is now
a thin host that runs enabled subsystems and owns alerting and dedupe.

Dependency-specific config is namespaced deps_* so sibling subsystems can be
configured without collision; paths, min_severity, scan interval and the
fail_on_unparseable honesty switch stay shared.

Behaviour is unchanged — 41 tests pass, and a scan of the reference pnpm
workspace still resolves 21 roots and 101 packages rather than the "0
dependencies, coupling 0/100 (good)" that motivated the PRD.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio merged commit 589a4ff into master Jul 28, 2026
9 checks passed
@ralyodio
ralyodio deleted the refactor/fold-dep-scanner-into-code-scanner branch July 28, 2026 13:52
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