ntia_conformance_checker.probes package¶
Submodules¶
ntia_conformance_checker.probes.presence module¶
Built-in presence probes.
Together these two probes cover every active rule in the NTIA and FSCT catalogues – rule-id reuse is high because the question being asked is always the same shape (“is this attribute present?”).
- ntia_conformance_checker.probes.presence.require_component_attribute(checker: CheckerProtocol, *, attribute: str) Iterable[Finding][source]¶
Require every component in the SBOM to declare
attribute.Yields one
Findingper component whereattributeis absent or empty. The component’s SPDX-style id and human name are surfaced so SARIF / JSON / text emitters can locate the failure precisely.- Parameters:
checker – the running checker instance.
attribute – an element id from
ntia_conformance_checker.model.COMPONENT_ELEMENT_IDS, e.g."supplier"/"concluded_license".
- ntia_conformance_checker.probes.presence.require_document_attribute(checker: CheckerProtocol, *, attribute: str) Iterable[Finding][source]¶
Require the SBOM document to declare
attribute.Yields a single document-level
Findingwhen the attribute is absent; yields nothing when present.- Parameters:
checker – the running checker instance.
attribute – an element id from
ntia_conformance_checker.model.DOCUMENT_ELEMENT_IDS, e.g."author"/"dependency_relationship".
Module contents¶
Probe registry and built-in probe implementations.
A probe is a small, registered Python function that answers one yes/no
question about a parsed SBOM (e.g. “do all components have a supplier?”).
Rules declared in rules/*.yaml reference probes by name; the engine
calls them and collects Finding objects.
Importing ntia_conformance_checker.probes registers every built-in
probe as a side effect. See probes/presence.py for the canonical
two-probe vocabulary that covers all current NTIA + FSCT active rules.
- ntia_conformance_checker.probes.attribute_scope(name: str) frozenset[str] | None[source]¶
Element ids probe
nameaccepts asattribute;Noneif unrestricted.
- ntia_conformance_checker.probes.lookup(name: str) ProbeFn[source]¶
Return the probe registered under
name; raiseKeyErrorif absent.
- ntia_conformance_checker.probes.probe(name: str, *, attributes: frozenset[str] | None = None) Callable[[ProbeFn], ProbeFn][source]¶
Register
fnundernamein the global probe registry.attributesis for a probe taking anattributeparam: the element ids it accepts. The loader then requires a rule’sattributeto be one of them and to equal the rule’selement_id.Raises
ValueErroron duplicate registration so accidental overrides fail loudly at import time, and on a probe that takes*args/**kwargs(the loader validates YAML params against explicit parameters) or that is givenattributeswithout anattributeparameter.