refactor(modules): fold dep-scanner into code-scanner as the deps subsystem - #49
Merged
Merged
Conversation
…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>
vu1nz Security Review0 finding(s) in PR #? No security issues found. |
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.
Resolves the open module-boundary question in PRD 0002.
Why
PRD.mdalready assigns "dependency CVEs" tocode-scanner, so shipping a separatedep-scannermodule contradicted the product doc. Two modules would also have: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
src/deps/index.tsis the new subsystem entry point.scanDependencies()takes options and returns a result with noModuleContext, so the same code serves both the scheduled daemon scan and the one-shotscan --deps.src/index.tsis now a thin host that runs enabled subsystems and owns alerting/dedupe, with stubs documented forsecrets/,sast/andconfig/— the rest ofcode-scanner's remit perPRD.md.deps_*so sibling subsystems can be configured without collision.paths,min_severity,scan_interval_secondsand thefail_on_unparseablehonesty switch stay shared.implementation:set, and the UX/config sketches re-cast aroundcode-scanner.Verification
pnpm buildclean; repo pre-commit hooks (CLI + web build) pass.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.