My last post ended with a promise: v2.3.0 drops soon. It also ended with a number I couldn't believe — 617 downloads in a day, with every old version still pulling 140+ a week.
Both threads land in this post. First the minor release that made the major one possible, then the major release itself — and then the part nobody writes about: how the test suite is actually designed, and what a night of Windows debugging taught me about it.
v2.2.2 — the minor release that did the unglamorous work
v2.2.1 was a CI tool. v2.2.2 made it an honest CI tool. I went back through the code with a checklist and found 10 real defects — not edge cases, things users would hit:
| # | What was broken | What it means in practice |
|---|---|---|
| D1 | README promised a baseline mode that didn't exist | Docs lied about a feature |
| D2 | scan:all ignored --fail-on | Your CI gate did nothing on the one command that runs everything |
| D3 | --report documented but never declared | A flag in the docs that didn't exist |
| D5 | Ports scanner flagged 127.0.0.1 as exposed | Every localhost database looked like a public leak |
| D6 | CI secret check skipped any file containing ${{ | The most common workflow syntax disabled the check |
| D7 | engines said Node 16+, code needed 20+ | Installs that should fail, didn't |
| D9 | Vuln map keyed by package name only | Two versions of one package collapsed into one entry, and it suggested npm install for transitive deps — which can break their parents |
| D10 | redact() leaked the first 8 chars of the line | A "redacted" secret preview that wasn't |
| D11 | No file-size cap, assumed / separators | A 500 MB file could hang the scan; Windows paths broke assumptions |
The fix for D8 — zero tests existed — was the release itself: 69 tests, a CI matrix (Node 20/22 × ubuntu/windows), and fixtures that are permanent repo contents, not throwaway files. v2.2.2 shipped 2026-12-02, and every fix in that table has a regression test proving it stays fixed.
One honest footnote: v2.2.2 shipped with a broken --ai flag, and I didn't know it. The Groq model it used, llama-3.3-70b-versatile, was deprecated in June 2026 and shut down for free tiers in August. The flag failed silently. v2.3.0 switches to Groq's recommended replacement, openai/gpt-oss-120b. That's in the changelog, not hidden.
v2.3.0 — the major release
Baseline mode — stop failing on what you already know about
The feature the last post promised. A team wants to adopt scanning, but the codebase already has 200 old findings. Fixing all of them takes weeks, so scanning never gets adopted. Baseline mode ends that:
# Bless the current findings — they become your baseline dep-inspector scan:all --update-baseline git add .dep-inspector-baseline.json # From now on, only NEW findings fail the build dep-inspector scan:all --baseline --fail-on high Three rules keep baselines honest:
- Fingerprints, not names. Each entry is a SHA-256 of scanner + rule + file + discriminator (package name and version for deps, occurrence index for secrets). Copy a baselined finding to another file and it reports as new. Upgrade a baselined package and it reports again.
- HIGH secrets can never be baselined.
--update-baselinerefuses them, and a hand-edited baseline entry for one has no effect. Some things don't get accepted — they get fixed. - Baselines expire. HIGH in 30 days, MEDIUM in 90, LOW in 180. The CLI warns you 14 days before expiry, then reports the finding again with a "baseline expired" note. Accepted risk is temporary by design.
--strict shows everything, baseline or not. --baseline-file <path> keeps the baseline wherever you want.
SARIF — findings in GitHub's Security tab
dep-inspector scan:all --format sarif > results.sarif Real SARIF 2.1.0, validated against the official OASIS schema, on every finding-producing command. HIGH becomes error, MEDIUM warning, LOW note, with rule IDs, file paths, line numbers, and the baseline fingerprint attached:
- name: Scan run: dep-inspector scan:all --format sarif > results.sarif - name: Upload to GitHub Security uses: github/codeql-action/upload-sarif@v3 with: sarif_file: results.sarif The Finding model — the invisible change that matters most
Under the hood, v2.3.0 replaces six scanners doing six different things with one shared model:
interface Finding { ruleId: string; // stable, public API — never renamed scanner: Scanner; // deps | secrets | docker | ci | ports | logs severity: Severity; // HIGH | MEDIUM | LOW message: string; // one sentence, never contains a secret fix: string; // concrete remediation file?: string; // always relative, forward slashes line?: number; evidence?: string; // always masked } Every scanner is now a pure function — run(ctx) => ScanResult — with no console.log, no process.exit, no spinners inside. Rendering is separate: terminal, JSON, or SARIF from the same findings. And scan:all --json finally emits one parseable JSON object with a schema version, instead of several documents plus a banner.
Why should you care? Because this is what makes the next releases possible. The TUI reads findings. The AI router reads findings. MCP serves findings. None of that works cleanly when every scanner prints its own format.
Hardening — the scanner scans itself
A security scanner that can be exploited by the code it scans is worse than useless:
- No shell, anywhere. Every command runs through argument arrays, never string-built shell commands. The test suite greps
src/forexec(,execSync, andshell:on every run. - Size and depth limits. 1 MB file cap, 20,000 files, depth 20, 120 seconds per command — with a clear "scan truncated" note instead of silently hanging.
- Symlinks are never followed out of the scanned tree.
- ANSI/log injection stripped. Control characters in file names or snippets can't rewrite your terminal or poison your logs.
- Self-scan in CI. The repo's own workflow runs
dep-inspectoron itself with--fail-on high. The tool eats its own cooking on every push.
The test suite — the proper logic
139 tests, 12 files. But the count isn't the point. Here's how they're designed:
1. Fixtures are the spec. Four permanent fixture projects live in the repo: clean-project (one intentional MEDIUM — no logger configured), leaky-project (fake secrets only, never real ones), docker-bad, and workflows-bad. Every test runs the real built binary against a real fixture and asserts real exit codes. Nothing is mocked that matters.
2. Tests prove behavior, not implementation. The baseline tests don't check internal functions — they run scan:all --update-baseline, then scan:all --baseline, and assert exit 0. Then they copy a baselined finding to another file and assert it fails again. Then they hand-edit a HIGH-secret entry into the baseline and assert it has no effect. Each test is a user story with an exit code.
3. SARIF is validated against the real schema. Not hand-rolled assertions — the test loads the official SARIF 2.1.0 schema and validates the CLI's output against it. If the output drifts from the spec, the test fails.
4. The security tests attack the tool. A file named $(touch pwned).js. A 10 MB single-line file. A 500 MB sparse file. A symlink pointing outside the scanned tree. Control characters in filenames. These are hostile inputs, and the suite proves the scanner survives all of them without executing anything, without hanging, and without following the symlink out.
5. Machine-dependent tests must be scoped. The ports scanner reads live listening sockets, not the fixture — and Windows always has SMB (port 445) on 0.0.0.0. A test asserting an exact MEDIUM total across all scanners can never pass on a normal Windows box. The fix: assert the exact count only over the fixture-scoped scanners, and let ports be what it is — live machine state.
6. Snapshots prove determinism. The same scan on the same fixture produces byte-identical output across runs. If a refactor changes a message or a severity, the snapshot catches it before users do.
The Windows night, in numbers
The suite was green in my Linux sandbox. On Windows it went 119 → 138 → 139 across one night, and each jump taught something:
- 119: every deps-scanning command exited 3.
spawnSync("npm")fails on Windows — npm isnpm.cmd, and CreateProcess can't run.cmdfiles without a shell. - Still 119:
spawnSync("npm.cmd")fails too — withEINVAL..cmdfiles can't be spawned at all on that Node/Windows combo. The fix: run npm's CLI through Node itself (node <nodeDir>/node_modules/npm/bin/npm-cli.js) — exactly whatnpm.cmddoes internally. - Still 119: the new files hadn't actually landed in
dist— only the helper was placed, the three files using it weren't. Verified with oneSelect-Stringon the built output. Lesson: verify the build contains the fix before debugging the fix. - 138: the last failure was the ports test from point 5 above — Windows SMB 445.
- 139: the final failure was a timeout, not a bug — a healthy test took 32.7s against a 30s limit. The CLI spawn timeout was already 120s; the test timeout just needed to match it.
What's next
- v2.4.0 — interactive TUI, multi-model AI router (Groq, OpenAI, Claude, Gemini, OpenRouter, Ollama — you bring your own key), and MCP server, so agents can call the scanners directly.
-
score <package>— a dependency trust score before younpm install. - SBOM export (CycloneDX).
- Package-manager adapters (yarn, pnpm, Bun) and
scan:supplyfor install hooks.
Try it
npm install -g dep-inspector-cli dep-inspector scan:all --update-baseline dep-inspector scan:all --baseline --fail-on high dep-inspector scan:all --format sarif > results.sarif -
📦 npm:
-
🐙 GitHub:
Nevin100 / Dep-inspector-cli
Version 2 transforms dep-inspector from a dependency analyzer into a full DevOps security toolkit — covering secrets, Docker, CI/CD pipelines, ports, and logging. All features work without any API key. AI insights are optional.
dep-inspector-cli
DevOps-grade dependency, security & infrastructure scanner for Node.js projects.
What's new in v2
Version 2 transforms
dep-inspectorfrom a dependency analyzer into a full DevOps security toolkit — covering secrets, Docker, CI/CD pipelines, ports, and logging. All features work without any API key. AI insights are optional.- v2.2.1 —
--fail-on high|medium|lowexit codes on every finding-based command. - v2.3.0 — Shared finding model + JSON schema v1, baseline mode, SARIF output, security hardening (loopholes A–E, G, H, L). Includes the unreleased v2.2.2 fixes (test harness,
scan:all --fail-on, ports, CI secrets, redaction) and Node.js >= 20.
Baseline mode and SARIF output are new in v2.3.0 — see Baseline mode and SARIF output.
Features
…Command What it does dep-inspectorDependency tree + vulnerability scan (v1) scan:secretsDetect hardcoded API keys, .env leaks, private keys scan:dockerDockerfile security analysis scan:ciGitHub Actions workflow linting scan:portsOpen port detection & process
- v2.2.1 —
If baseline mode saves your CI from one false failure, tell me about it — that's the feature working as designed. And if you run the suite on Windows and it goes green first try, tell me that too — it took me a whole night to earn it.
🧿 nazar na lage

