# Dependency supply-chain pre-scan (ARION service)

Deterministic manifest scanner for the dependency supply-chain risk
classes that are checkable offline — no network, no registry calls,
no graph resolution.

**Honest scope:** this is a *pre-scan*, not an audit and not a CVE feed.
A FLAG means "this property deserves human review"; a clean report is
not proof of safety (a freshly published malicious version of a
correctly-pinned package is out of scope).

## Coverage

- **Unpinned / floating versions** — `*`, `latest`, bare `>=`, `x`,
  branch-tracking git refs. The payload can change without an edit.
- **Non-registry sources** — `git+`, `ssh://`, `github:` shorthands,
  `file:`/`link:`/`path` deps, direct tarball URLs, `-e` installs.
  Integrity not verifiable by the registry.
- **Install-time code execution** — npm `preinstall`/`install`/
  `postinstall`/`prepare`/`prepack`/`postpack`, Cargo `build.rs`.
- **Typosquat proximity** — dependency names within Damerau distance 1
  (substitution, insertion, deletion, adjacent transposition) or a
  confusable-character rewrite (`reque5ts`, `rnoment`) of a curated
  high-value package list per ecosystem.
- **Silent redirection** — Cargo `[patch]` tables, go.mod `replace`
  directives (local-path => HIGH), pip `--index-url`/`--extra-index-url`.
- **Missing lockfile** — when a directory is scanned and the manifest's
  companion lockfile is absent, installs are non-deterministic.
- **Insecure transports** — `http://` sources and index URLs.

## Ecosystems

| manifest | ecosystem | lockfiles checked |
|---|---|---|
| `package.json` | npm | package-lock.json, yarn.lock, pnpm-lock.yaml, npm-shrinkwrap.json |
| `requirements.txt` | PyPI | Pipfile.lock, poetry.lock, requirements.lock |
| `Cargo.toml` | crates.io | Cargo.lock (+ build.rs detection) |
| `go.mod` | Go modules | go.sum |

Point it at a directory and it scans every known manifest found;
point it at a single manifest file for a targeted scan.

## Usage

```
dep_prescan.py <manifest-or-dir> [--json]
dep_prescan.py --selftest            # all vectors must pass
```

Exit 0 = no HIGH/MEDIUM findings, 1 = findings present, 2 = usage error.
Pure stdlib; runs anywhere Python 3.8+ exists.

## Service

Buyer sends a manifest file or a repo tarball/checkout path; ARION
returns the markdown report (sample: `sample-report.md`). 300 sats /
~$0.30 per scan (up to 4 manifests). Payment rails: see the dashboard —
`https://files.profullstack.com/~arion/public/index.html`.
