Skip to content

Releases

stranger v0.1.0 — Zero Dependency 2026 submission

Choose a tag to compare

@keirsalterego keirsalterego released this 30 Aug 18:09

Zero Dependency 2026 — Track A, Developer Tools & CLI. Solo entry.

Every dependency is a stranger. stranger reads your lockfiles off disk and tells
you which of them you have never met — hallucinated names, code that runs at
install time, one-line packages, version drift — without installing, resolving, or
making a single network request.

$ stranger scan fixtures/poisoned.package-lock.json

  poisoned.package-lock.json 757 packages   (35 direct · 722 transitive)

  ⚠  HALLUCINATION RISK     3
     chalck@5.3.0             not in corpus · d=1 from "chalk" · root-only, no parent
     expres@4.18.2            not in corpus · d=1 from "express" · root-only, no parent
     lodahs@4.17.21           not in corpus · d=1 from "lodash" · root-only, no parent

  ⚠  INSTALL SCRIPTS        3     arbitrary code at install time
  ⚠  TRIVIAL                35    (4.6% of third-party)
  ⚠  VERSION DRIFT          55    same package at 2+ versions in one tree
  ·  UNPINNED               — no signal in this format

  risk 81/100    21ms    third-party deps used to compute this: 0

The idea

Edit distance alone false-positives constantly — lodash.merge is two edits from
lodash.mergewith and both are real. The third clause is the one nobody else has:

A hallucinated package is always a root dependency. Nothing depends on it,
because nothing real has ever heard of it. A model put it in your manifest; no
maintainer ever put it in theirs.

not in corpus AND edit distance ≤ budget(len) AND in-degree == 0.

Measured rather than asserted. At 90% corpus coverage the clause takes false
positives from 36 to 1 at no cost in recall. make ablation reproduces the
whole table in four seconds.

Verified, not claimed

cargo tree 1 line
[[package]] in Cargo.lock 1
unsafe 0 · #![forbid(unsafe_code)]
Command::new 0 — it reads files, it does not run programs
tests 415 pass, 5 ignored (slow, each with a make target)
clippy -D warnings clean
make repro MATCH, byte-identical across two directories
STDLIB.md 18 substitutions against a bonus that asks for 10

Builds offline into an empty CARGO_HOME — no registry index has to exist.

Three independent checks beyond the test suite:

  • make sweep — 1,484 real lockfiles on one disk: 8 refused by version, 0 unread
  • scripts/crosscheck.py — 1,373 of them re-counted in Python from each format's
    spec rather than from src/: 0 mismatches, including the hand-rolled
    src/json.rs agreeing with CPython's json on 107 npm lockfiles
  • fuzz — 1,366,400 mutants and 282,563 truncation prefixes, no panics

docs/check-output.py runs on every push and diffs every number published in the
README and the book against the tool that produced it.

What it does on files nobody planted anything in

1,477 real lockfiles, 106,673 packages, 28 slopsquat findings — and all 28 are
false positives
, by construction rather than by judgement: each sits beside a
registry URL that resolved, so the package demonstrably exists. About one in 3,800.
True positives on those files: zero, because there is no hallucinated
dependency on that disk to find.

Every true positive this tool has demonstrated is one of the three planted in the
poisoned fixture. That is the honest ceiling of the evidence and it is in the
README rather than left for someone to find.

Reads

npm · pnpm (v9 and v6) · yarn v1 · Cargo · poetry · uv · pip/requirements.txt ·
go.mod — eight formats, five rules, plus stranger tree and stranger diff.

Limits, named

Integrity hashes are never verified — Rust std has no cryptography, so presence is
reported and correctness never is. hasInstallScript is a bare boolean: the tool
can say code runs, never what it does. No Go corpus, so the rule cannot fire on
go.mod at all. Flat formats have no graph, so clause 3 is vacuous there.

Build

git clone https://github.com/keirsalterego/stranger
cd stranger && make

make demo replays the twelve beats of the submission video against your own
checkout — the same commands, the same fixtures, nothing staged.

Rust 1.98.0, pinned. No build.rs, no code generation, no vendored source.

Cookbook: https://keir.is-a.dev/stranger/


Commits after this tag are documentation added during the judging window, not
code. git diff v0.1.0-submission --stat -- src/ Cargo.toml Cargo.lock is how to
check that rather than take my word for it.