Module

inspection

Explicit multi-root template inspection for tools and adapters.

The root inventory is filesystem-backed and namespaced by construction. Runtime loader precedence remains a separate concern: inspection never infers ownership from an unprefixedChoiceLoader.

Classes

TemplateRoot 3 ▼
One explicitly owned filesystem root for directory-wide inspection.

One explicitly owned filesystem root for directory-wide inspection.

Attributes

Name Type Description
namespace str —
path Path —

Methods

Internal Methods 1 ▼
__post_init__ 0 ▼
def __post_init__(self) -> None
ComponentRecord 4 ▼
One component definition with stable root ownership and source facts.

One component definition with stable root ownership and source facts.

Attributes

Name Type Description
owner str —
template str —
source_path str —
metadata DefMetadata —
ComponentInspection 3 ▼
Policy-neutral result of inspecting components across explicit roots.

Policy-neutral result of inspecting components across explicit roots.

Attributes

Name Type Description
components tuple[ComponentRecord, ...] —
diagnostics tuple[Diagnostic, ...] —
partial bool —

Functions

diagnose_roots 3 DiagnosticReport ▼
Diagnose explicitly namespaced roots with one deterministic inventory.
def diagnose_roots(roots: Iterable[TemplateRoot], *, environment: Environment | None = None, options: DiagnosticOptions = _DEFAULT_OPTIONS) -> DiagnosticReport
Parameters
Name Type Description
roots Iterable[TemplateRoot]
environment Environment | None Default:None
options DiagnosticOptions Default:_DEFAULT_OPTIONS
Returns
DiagnosticReport
inspect_components 3 ComponentInspection ▼
Collect component metadata across explicitly namespaced roots.
def inspect_components(roots: Iterable[TemplateRoot], *, environment: Environment | None = None, filter_name: str | None = None) -> ComponentInspection
Parameters
Name Type Description
roots Iterable[TemplateRoot]
environment Environment | None Default:None
filter_name str | None Default:None
Returns
ComponentInspection
advise_encapsulation_roots 3 DiagnosticReport ▼
Return opt-in extraction and flattening advice across owned roots.
def advise_encapsulation_roots(roots: Iterable[TemplateRoot], *, environment: Environment | None = None, context: Iterable[AdviceContext] = _EMPTY_ADVICE_CONTEXT) -> DiagnosticReport
Parameters
Name Type Description
roots Iterable[TemplateRoot]
environment Environment | None Default:None
context Iterable[AdviceContext] Default:_EMPTY_ADVICE_CONTEXT
Returns
DiagnosticReport