internal/

directory
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 22, 2026 License: Apache-2.0

Directories

Path Synopsis
Package app is the composition root — the ONLY wiring site in the codebase (ARCHITECTURE.md §12, decision D4).
Package app is the composition root — the ONLY wiring site in the codebase (ARCHITECTURE.md §12, decision D4).
Package assemble is the heart of the pipeline (ARCHITECTURE.md §9): the single-threaded, deterministic stage that turns detector claims into the canonical component graph.
Package assemble is the heart of the pipeline (ARCHITECTURE.md §9): the single-threaded, deterministic stage that turns detector claims into the canonical component graph.
Package cache implements the bbolt-backed scan cache (ARCHITECTURE.md §10, decision D10).
Package cache implements the bbolt-backed scan cache (ARCHITECTURE.md §10, decision D10).
Package classify implements file classification (ARCHITECTURE.md §3, §4): language identification from paths, binary sniffing over the shared header sample, and the magic-byte registry that routes model files to their header parsers.
Package classify implements file classification (ARCHITECTURE.md §3, §4): language identification from paths, binary sniffing over the shared header sample, and the magic-byte registry that routes model files to their header parsers.
Package cli implements the airom command tree, configuration layering, and exit-code policy (ARCHITECTURE.md §12, docs/cli.md).
Package cli implements the airom command tree, configuration layering, and exit-code policy (ARCHITECTURE.md §12, docs/cli.md).
Package compliance maps a named AI-governance framework's controls onto an assembled AIROM inventory.
Package compliance maps a named AI-governance framework's controls onto an assembled AIROM inventory.
Package conformance is AIROM's output-format conformance suite: a permanent, CI-enforced check that every writer's bytes satisfy the external contract the format claims to speak (docs/mapping.md).
Package conformance is AIROM's output-format conformance suite: a permanent, CI-enforced check that every writer's bytes satisfy the external contract the format claims to speak (docs/mapping.md).
detectors
all
Package all holds the GENERATED registration list of built-in detectors (ARCHITECTURE.md §6.2): no hand-edited central file for every detector PR to conflict on.
Package all holds the GENERATED registration list of built-in detectors (ARCHITECTURE.md §6.2): no hand-edited central file for every detector PR to conflict on.
dataset
Package dataset detects dataset files by format signature (ARCHITECTURE.md §4, §17): CSV and JSONL by structural sniffing of the shared header sample, Parquet and Arrow by magic bytes — emitting KindDataset claims that phase-2 stitching can attach to models via TRAINED_ON edges (the SPDX trainedOn mapping).
Package dataset detects dataset files by format signature (ARCHITECTURE.md §4, §17): CSV and JSONL by structural sniffing of the shared header sample, Parquet and Arrow by magic bytes — emitting KindDataset claims that phase-2 stitching can attach to models via TRAINED_ON edges (the SPDX trainedOn mapping).
frozen
Package frozen reads Python applications that were frozen into a single executable, where the usual evidence does not exist on disk.
Package frozen reads Python applications that were frozen into a single executable, where the usual evidence does not exist on disk.
gosrc
Package gosrc detects AI usage in Go source with the stdlib go/parser (ARCHITECTURE.md §6.4, decision D1): exact AST analysis of import paths, SDK call sites, and model-name literals — Go is the one language where a real parser is free, so it gets one instead of the region-lexer + regex path used elsewhere.
Package gosrc detects AI usage in Go source with the stdlib go/parser (ARCHITECTURE.md §6.4, decision D1): exact AST analysis of import paths, SDK call sites, and model-name literals — Go is the one language where a real parser is free, so it gets one instead of the region-lexer + regex path used elsewhere.
infra
Package infra detects AI serving-infrastructure signals in deployment artifacts (ARCHITECTURE.md §4, §17): Dockerfiles (AI base images such as ollama or vllm, model-pulling build steps), docker-compose services, and Kubernetes manifests — emitting KindInfra and KindService claims eligible for SERVED_BY and CONFIGURES edges, using MethodConfig evidence.
Package infra detects AI serving-infrastructure signals in deployment artifacts (ARCHITECTURE.md §4, §17): Dockerfiles (AI base images such as ollama or vllm, model-pulling build steps), docker-compose services, and Kubernetes manifests — emitting KindInfra and KindService claims eligible for SERVED_BY and CONFIGURES edges, using MethodConfig evidence.
manifest
Package manifest detects AI frameworks and SDKs declared in package manifests and lockfiles (ARCHITECTURE.md §4, §17): requirements.txt, pyproject.toml, package.json, go.mod, pom.xml, Gradle lockfiles, Cargo.toml, and csproj, emitting framework and library claims with declared versions.
Package manifest detects AI frameworks and SDKs declared in package manifests and lockfiles (ARCHITECTURE.md §4, §17): requirements.txt, pyproject.toml, package.json, go.mod, pom.xml, Gradle lockfiles, Cargo.toml, and csproj, emitting framework and library claims with declared versions.
modelfile
Package modelfile detects local model weight files by magic bytes and header-only parsing — core IP (ARCHITECTURE.md §4, §17): GGUF, safetensors, ONNX, torch zips (with static pickle opcode walking), TensorFlow SavedModel, TensorRT engines, TFLite, and HDF5.
Package modelfile detects local model weight files by magic bytes and header-only parsing — core IP (ARCHITECTURE.md §4, §17): GGUF, safetensors, ONNX, torch zips (with static pickle opcode walking), TensorFlow SavedModel, TensorRT engines, TFLite, and HDF5.
modelfilex
Package modelfilex implements binary "local model file" detectors for model serialization formats whose recognition needs more than a magic-byte gate: PyTorch archives (with a static, non-executing pickle opcode walk that flags dangerous imports), TensorFlow SavedModel protobufs, TFLite flatbuffers, Keras/HDF5 weight stores, and opaque TensorRT engines.
Package modelfilex implements binary "local model file" detectors for model serialization formats whose recognition needs more than a magic-byte gate: PyTorch archives (with a static, non-executing pickle opcode walk that flags dangerous imports), TensorFlow SavedModel protobufs, TFLite flatbuffers, Keras/HDF5 weight stores, and opaque TensorRT engines.
pgext
Package pgext reads PostgreSQL extension metadata off the filesystem.
Package pgext reads PostgreSQL extension metadata off the filesystem.
project
Package project holds the built-in phase-2 ProjectDetectors (ARCHITECTURE.md §3, §17) — cross-file logic the streaming phase cannot express: hfdir assembles a HuggingFace model directory (config.json + weights) into ONE component; adapterlink turns adapter_config.json into DERIVED_FROM base-model lineage; configbind attaches separated generation configs to the model they name via CONFIGURES edges under the refusal-first ambiguity policy (§9.5) — never a guessed edge; raglink stitches retriever, store, and embedder findings into a rag-pipeline composite with CONTAINS/QUERIES/EMBEDS_WITH edges; lockjoin joins manifests with their lockfiles.
Package project holds the built-in phase-2 ProjectDetectors (ARCHITECTURE.md §3, §17) — cross-file logic the streaming phase cannot express: hfdir assembles a HuggingFace model directory (config.json + weights) into ONE component; adapterlink turns adapter_config.json into DERIVED_FROM base-model lineage; configbind attaches separated generation configs to the model they name via CONFIGURES edges under the refusal-first ambiguity policy (§9.5) — never a guessed edge; raglink stitches retriever, store, and embedder findings into a rag-pipeline composite with CONTAINS/QUERIES/EMBEDS_WITH edges; lockjoin joins manifests with their lockfiles.
prompt
Package prompt detects prompt assets stored as standalone files (ARCHITECTURE.md §4, §17): .txt/.md/.yaml/.jinja content judged by template heuristics — placeholder syntax, role markers, instruction shape — plus prompt-suggestive path signals, emitting KindPrompt claims that can receive PROMPTED_BY edges.
Package prompt detects prompt assets stored as standalone files (ARCHITECTURE.md §4, §17): .txt/.md/.yaml/.jinja content judged by template heuristics — placeholder syntax, role markers, instruction shape — plus prompt-suggestive path signals, emitting KindPrompt claims that can receive PROMPTED_BY edges.
Package diff compares two native AIBOM documents (schemaVersion "1") and reports what changed between them: components added, removed, and changed, keyed by the stable component ID (ARCHITECTURE.md §9.2).
Package diff compares two native AIBOM documents (schemaVersion "1") and reports what changed between them: components added, removed, and changed, keyed by the stable component ID (ARCHITECTURE.md §9.2).
Package dispatch routes classified files to interested detectors through the compiled selector index (ARCHITECTURE.md §6.1) and adapts the internal read-once file context to the public SDK's detect.File.
Package dispatch routes classified files to interested detectors through the compiled selector index (ARCHITECTURE.md §6.1) and adapts the internal read-once file context to the public SDK's detect.File.
Package engine drives the two-phase scan pipeline (ARCHITECTURE.md §3, §8): phase 1 streams files from exactly one walker/producer through a bounded task channel into a worker pool where all matched detectors run SEQUENTIALLY on one shared buffer, with exactly one collector goroutine owning all mutable aggregation state — no locks.
Package engine drives the two-phase scan pipeline (ARCHITECTURE.md §3, §8): phase 1 streams files from exactly one walker/producer through a bounded task channel into a worker pool where all matched detectors run SEQUENTIALLY on one shared buffer, with exactly one collector goroutine owning all mutable aggregation state — no locks.
Package eol is the hosted-model end-of-life overlay: it matches the AI models AIROM inventoried against a curated catalog of provider retirement announcements and attaches a dated, sourced Lifecycle to them.
Package eol is the hosted-model end-of-life overlay: it matches the AI models AIROM inventoried against a curated catalog of provider retirement announcements and attaches a dated, sourced Lifecycle to them.
Package filectx implements the read-once file access contract (ARCHITECTURE.md §8, invariant P1): each file's bytes are read from the source at most once, and every interested detector shares that one buffer — detectors for a file run sequentially in one worker, so no buffer synchronization exists or is needed.
Package filectx implements the read-once file access contract (ARCHITECTURE.md §8, invariant P1): each file's bytes are read from the source at most once, and every interested detector shares that one buffer — detectors for a file run sequentially in one worker, so no buffer synchronization exists or is needed.
fix
Package fix turns the CVE overlay into an actionable remediation: for every vulnerable package it computes the version that clears the advisories and rewrites the pin in the manifest that declared it.
Package fix turns the CVE overlay into an actionable remediation: for every vulnerable package it computes the version that clears the advisories and rewrites the pin in the manifest that declared it.
fixui
Package fixui is the interactive CVE table: the advisories a scan found, one row per finding, with a Fix action per package that rewrites the manifest pin in place.
Package fixui is the interactive CVE table: the advisories a scan found, one row per finding, with a Fix action per package that rewrites the manifest pin in place.
Package metrics makes profiling a product feature (ARCHITECTURE.md §14): ScanStats accumulates files walked and skipped, bytes read versus bytes in tree, cache hit rates, per-detector nanoseconds and invocation counts, and the selection explanation of which --select expression enabled which detector (§6.2) — embedded into the Inventory under --stats, so "what did the scanner skip" is always answerable and detector #217 is triaged with data, not guesses.
Package metrics makes profiling a product feature (ARCHITECTURE.md §14): ScanStats accumulates files walked and skipped, bytes read versus bytes in tree, cache hit rates, per-detector nanoseconds and invocation counts, and the selection explanation of which --select expression enabled which detector (§6.2) — embedded into the Inventory under --stats, so "what did the scanner skip" is always answerable and detector #217 is triaged with data, not guesses.
Package osv is the opt-in CVE overlay: it matches the AI packages AIROM inventoried (by their purl) against the OSV.dev advisory database and attaches the resulting CVEs to those components.
Package osv is the opt-in CVE overlay: it matches the AI packages AIROM inventoried (by their purl) against the OSV.dev advisory database and attaches the resulting CVEs to those components.
Package perf is AIROM's performance-regression harness (ARCHITECTURE.md invariant P2: peak memory is a function of CONFIGURATION, never of input size).
Package perf is AIROM's performance-regression harness (ARCHITECTURE.md invariant P2: peak memory is a function of CONFIGURATION, never of input size).
Package ruleengine implements the declarative rule-pack compiler and the generic rule detector (ARCHITECTURE.md §6.3, docs/rule-schema.md — this package implements exactly that contract).
Package ruleengine implements the declarative rule-pack compiler and the generic rule detector (ARCHITECTURE.md §6.3, docs/rule-schema.md — this package implements exactly that contract).
lexer
Package lexer splits source text into code / comment / string regions for the rule engine (ARCHITECTURE.md §6.4, decision D1; docs/rule-schema.md "regions").
Package lexer splits source text into code / comment / string regions for the rule engine (ARCHITECTURE.md §6.4, decision D1; docs/rule-schema.md "regions").
ruletest
Package ruletest runs rule packs against annotated fixtures — the shared engine behind `airom rules test`/`lint` and the embedded-pack CI test (docs/rule-schema.md "Fixtures and the lint contract").
Package ruletest runs rule packs against annotated fixtures — the shared engine behind `airom rules test`/`lint` and the embedded-pack CI test (docs/rule-schema.md "Fixtures and the lint contract").
Package rulesync fetches, verifies, and caches a signed rule-pack bundle from the airomhq/airom-rules release channel, so rules can move faster than the airom binary without the user installing a second tool (Model B).
Package rulesync fetches, verifies, and caches a signed rule-pack bundle from the airomhq/airom-rules release channel, so rules can move faster than the airom binary without the user installing a second tool (Model B).
Package source defines the Source abstraction over scan targets (ARCHITECTURE.md §7): a Source couples a Walker (push-style, ignore-aware enumeration feeding phase 1), a Resolver (pull-style access for phase-2 project detectors), content identity (image digest, git HEAD, dir realpath), layer IDs for blob-cache granularity, and SourceInfo provenance.
Package source defines the Source abstraction over scan targets (ARCHITECTURE.md §7): a Source couples a Walker (push-style, ignore-aware enumeration feeding phase 1), a Resolver (pull-style access for phase-2 project detectors), content identity (image digest, git HEAD, dir realpath), layer IDs for blob-cache granularity, and SourceInfo provenance.
dirsource
Package dirsource implements the filesystem source (ARCHITECTURE.md §7): streaming enumeration with a nested per-directory .gitignore/.airomignore stack, non-overridable default skips, user --ignore globs, and an ignore-honoring resolver for the phase-2 pull API.
Package dirsource implements the filesystem source (ARCHITECTURE.md §7): streaming enumeration with a nested per-directory .gitignore/.airomignore stack, non-overridable default skips, user --ignore globs, and an ignore-honoring resolver for the phase-2 pull API.
gitsource
Package gitsource implements the remote-repository Source (ARCHITECTURE.md §7): git clone --depth=1 --single-branch --no-tags via an exec-git fast path when a git binary is available, with a go-git v6 fallback (decision D14: go-git's shallow-clone inefficiency is documented; established scanners shell out too).
Package gitsource implements the remote-repository Source (ARCHITECTURE.md §7): git clone --depth=1 --single-branch --no-tags via an exec-git fast path when a git binary is available, with a go-git v6 fallback (decision D14: go-git's shallow-clone inefficiency is documented; established scanners shell out too).
imagesource
Package imagesource implements the container-image Source (ARCHITECTURE.md §7, decision D11): go-containerregistry resolves a v1.Image through the remote → daemon → tarball → OCI-layout fallback chain, and the squashed tar from mutate.Extract is streamed exactly once.
Package imagesource implements the container-image Source (ARCHITECTURE.md §7, decision D11): go-containerregistry resolves a v1.Image through the remote → daemon → tarball → OCI-layout fallback chain, and the squashed tar from mutate.Extract is streamed exactly once.
k8ssource
Package k8ssource implements the Kubernetes Source (ARCHITECTURE.md §7).
Package k8ssource implements the Kubernetes Source (ARCHITECTURE.md §7).
Package tui holds AIROM's terminal presentation primitives: TTY detection, ANSI styling, and the scan progress indicator.
Package tui holds AIROM's terminal presentation primitives: TTY detection, ANSI styling, and the scan progress indicator.
Package writer defines the output stage (ARCHITECTURE.md §11): a Writer is a pure function from *airom.Inventory to bytes (invariant P5) that never invents, drops, or re-derives data — every format is a projection of the same assembled graph.
Package writer defines the output stage (ARCHITECTURE.md §11): a Writer is a pure function from *airom.Inventory to bytes (invariant P5) that never invents, drops, or re-derives data — every format is a projection of the same assembled graph.
cdx
Package cdx projects the inventory to CycloneDX ML-BOM via CycloneDX/cyclonedx-go (ARCHITECTURE.md §11, decision D16) — 1.6 by default, 1.7 via --cdx-version (the modelCard shape is identical in both).
Package cdx projects the inventory to CycloneDX ML-BOM via CycloneDX/cyclonedx-go (ARCHITECTURE.md §11, decision D16) — 1.6 by default, 1.7 via --cdx-version (the modelCard shape is identical in both).
compliancew
Package compliancew writes the human-readable compliance report (docs/compliance.md): each framework's controls as met / gap / manual, with the component evidence behind every verdict and a per-framework summary.
Package compliancew writes the human-readable compliance report (docs/compliance.md): each framework's controls as met / gap / manual, with the component evidence behind every verdict and a per-framework summary.
nativejson
Package nativejson emits AIROM's native JSON format (ARCHITECTURE.md §11): the lossless, round-trip reference serialization of the Inventory graph, versioned from release one (schemaVersion "1") with its JSON Schema published per release under schemas/ and enforced by conformance and fuzz round-trip tests in CI (§14).
Package nativejson emits AIROM's native JSON format (ARCHITECTURE.md §11): the lossless, round-trip reference serialization of the Inventory graph, versioned from release one (schemaVersion "1") with its JSON Schema published per release under schemas/ and enforced by conformance and fuzz round-trip tests in CI (§14).
sarifw
Package sarifw projects the inventory to SARIF 2.1.0 for GitHub Code Scanning (ARCHITECTURE.md §11, docs/mapping.md §3/§7).
Package sarifw projects the inventory to SARIF 2.1.0 for GitHub Code Scanning (ARCHITECTURE.md §11, docs/mapping.md §3/§7).
spdxw
Package spdxw writes an SPDX 3.0.1 document with the AI, Dataset, Software, and Security profiles.
Package spdxw writes an SPDX 3.0.1 document with the AI, Dataset, Software, and Security profiles.
tablew
Package tablew renders the human-facing terminal summary (ARCHITECTURE.md §11): a boxed scan-summary panel followed by a box-drawn component table with columns KIND | NAME | VERSION | PROVIDER | CONF | LOCATION (the primary path:line sighting) | EVIDENCE (rendered "n occ"), plus RISK | FLAGS when a scan surfaces an artifact risk.
Package tablew renders the human-facing terminal summary (ARCHITECTURE.md §11): a boxed scan-summary panel followed by a box-drawn component table with columns KIND | NAME | VERSION | PROVIDER | CONF | LOCATION (the primary path:line sighting) | EVIDENCE (rendered "n occ"), plus RISK | FLAGS when a scan surfaces an artifact risk.
vexw
Package vexw writes an OpenVEX document from the CVE overlay.
Package vexw writes an OpenVEX document from the CVE overlay.
writertest
Package writertest builds a representative Inventory shared by the writer tests and the mapping round-trip test — one fixture exercising every kind, tri-state, evidence shape, relationship type, and honesty record, so a single golden per format proves the whole projection.
Package writertest builds a representative Inventory shared by the writer tests and the mapping round-trip test — one fixture exercising every kind, tri-state, evidence shape, relationship type, and honesty record, so a single golden per format proves the whole projection.
yamlw
Package yamlw renders the native inventory model as YAML through yaml.v3 with stable key order (ARCHITECTURE.md §11) — the same lossless content as the native JSON writer, in a form suited to human review.
Package yamlw renders the native inventory model as YAML through yaml.v3 with stable key order (ARCHITECTURE.md §11) — the same lossless content as the native JSON writer, in a form suited to human review.
Package xio holds the bounded-I/O primitives behind the bounded-everything invariant (ARCHITECTURE.md §8, P2): sync.Pool buffer pools per size class (findings copy out ≤200-byte snippets and never retain buffers), the spool that grows from memory to a temp file under hard caps (≤4 MiB memory, ≤64 MiB tmpfile — §7), and the byte-weighted I/O semaphore (default budget 256 MiB, a separate knob from CPU parallelism) acquired at min(size, budget) around any read over 1 MiB.
Package xio holds the bounded-I/O primitives behind the bounded-everything invariant (ARCHITECTURE.md §8, P2): sync.Pool buffer pools per size class (findings copy out ≤200-byte snippets and never retain buffers), the spool that grows from memory to a temp file under hard caps (≤4 MiB memory, ≤64 MiB tmpfile — §7), and the byte-weighted I/O semaphore (default budget 256 MiB, a separate knob from CPU parallelism) acquired at min(size, budget) around any read over 1 MiB.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL