Bun Analyzer (Scanner)

What it does

Inputs and precedence

  1. Installed inventory (node_modules/ present): traverse installed packages and emit components from installed package.json (uses bun.lock for resolved/integrity + scope enrichment when present).
  2. Lockfile-only (bun.lock present, no install): parse bun.lock and emit components from lock entries.
  3. Declared-only fallback (project markers present but no bun.lock/install): emit explicit-key components from package.json dependency sections.
  4. Unsupported (bun.lockb only): emit a remediation record explaining how to produce bun.lock.

Project discovery (including container roots)

The analyzer discovers Bun project roots under:

Discovery is bounded and deterministic:

Identity rules (PURL vs explicit key)

Concrete versions emit a PURL:

Non-concrete versions emit an explicit key:

Explicit-key digest input (canonical, UTF-8):

npm\n<name>\n<spec>\n<originLocator>

Generated via LanguageExplicitKey.Create(...) and aligned with docs/modules/scanner/language-analyzers-contract.md.

Evidence and locators

All evidence locators are relative and use / separators.

File evidence

Lockfile entry evidence

Scope semantics (dev/optional/peer)

Scope is derived deterministically from the bun.lock dependency graph rooted at package.json declarations:

includeDev=false filters only packages proven to be dev-only; unknown-scope packages are kept but marked scopeUnknown=true.

Patches and workspaces

Known limitations

References