Skip to Content
ConceptsInventory

Inventory

The inventory engine has two parts. Locators find install roots and read package metadata. The engine writes one record per item.

Purl keying

Each inventory item has a purl (package URL). The purl is the primary key together with the install path.

Format: pkg:<ecosystem>/<name>@<version>

Examples:

  • pkg:pypi/litellm@1.107.0
  • pkg:npm/@anthropic-ai/claude-code@2.1.314
  • pkg:brew/node@22.11.0

PyPI names follow PEP 503: lowercase, runs of -, _, . become one -. npm keeps @scope/name as written. Other ecosystems keep the name as given.

Scope

Scope has three values:

  • installed: files exist on disk.
  • declared: a lockfile pins this version.
  • cache: a package manager cache holds the artifact.

All three scopes produce findings. A lockfile that pins a malicious version will reinstall it on the next install.

Locators per ecosystem

Each locator reads specific markers. The home directory walk starts every locator when it finds a marker. Global roots are read on every scan.

Python (pypi)

Markers: pyvenv.cfg, site-packages/, uv.lock, poetry.lock, Pipfile.lock, requirements*.txt

Global roots:

  • ~/.local/share/uv
  • ~/.pyenv
  • ~/.local/pipx
  • ~/miniconda3, ~/anaconda3
  • /opt/homebrew/lib/python*
  • /Library/Frameworks/Python.framework

Each site-packages directory is scanned for *.dist-info directories. The locator reads METADATA for name and version.

npm family (npm, pnpm, yarn, bun)

Markers: node_modules/, package-lock.json, pnpm-lock.yaml, yarn.lock, bun.lock, bun.lockb

Global roots:

  • npm root -g output
  • ~/.bun/install/global
  • pnpm global directory
  • ~/.npm/_cacache (cache scope)

The locator reads package.json in each node_modules/<name> directory. Scoped packages (@org/name) are read from node_modules/@org/name.

Lockfiles produce declared scope items. The nested node_modules walk finds installed scope.

Homebrew (brew and cask)

Global roots:

  • /opt/homebrew/Cellar/*/*/INSTALL_RECEIPT.json (brew)
  • /opt/homebrew/Caskroom/*/* (cask)

The locator reads the INSTALL_RECEIPT.json receipt for each keg. Casks are identified by directory name and version.

Homebrew has no OSV ecosystem. In v1 a Homebrew item matches only intel that names the formula or cask directly.

Cargo

Markers: Cargo.lock

Global roots:

  • ~/.cargo/.crates2.json
  • ~/.cargo/registry/cache (cache scope)

The locator reads .crates2.json for installed crates and parses Cargo.lock for declared.

Go (golang)

Markers: go.sum

Global roots:

  • ~/go/pkg/mod/cache/download

The locator parses go.sum for declared modules and reads the module cache for installed.

RubyGems (gem)

Global roots:

  • RubyGems system-wide directory (implementation to confirm)

The locator reads specifications/*.gemspec for installed gems.

VS Code extensions (vscode)

Global roots:

  • ~/.vscode/extensions
  • ~/.cursor/extensions
  • ~/.windsurf/extensions
  • ~/.vscode-oss/extensions

The locator reads package.json in each extension directory. The purl is pkg:vscode/<publisher>.<name>@<version>.

Extension directory names carry a platform suffix: anthropic.claude-code-2.1.313-darwin-arm64.

Docker (docker)

Global roots:

  • docker image ls --digests --format json output (only when the docker binary exists)

The locator reads image name, tag, and digest. The purl is pkg:docker/<name>@<tag>.

Host artifacts (host)

Host artifacts are not packages. The engine records a baseline on the first scan and a diff on later scans. See Host artifacts for details.

Home directory walk

The default walk root is the home directory. The walk skips:

  • ~/Library, except for known package paths (~/Library/Application Support/, extension directories)
  • .Trash
  • Time Machine mounts
  • Depth beyond 8

Configured roots in config.toml can add or replace the default. A .bucklerignore file in a directory stops the walk.

Excluded paths

Each locator may exclude items. The Python locator excludes pip, setuptools, and wheel by default. The npm locator excludes node_modules/.bin.

These exclusions reduce inventory size and avoid alerting on platform tooling.

Last updated on