loom.ai.validate

Standalone agent artifact validation (FR-015).

python -m loom.ai.validate <globs> decodes every matching artifact and runs the configuration-independent compiler phases — structure (via the version envelope), output and policy limits — so a generator gets coded feedback with no deployment configuration, no credentials and no network.

Exit status is 0 with an empty stderr when every artifact is valid; otherwise every issue is printed to stderr as one line carrying its AgentErrorCode.

Functions

_issues_for_file(path)

_matched_files(patterns)

Resolve the globs to the files they name.

main([argv])

Entry point of python -m loom.ai.validate.

validate_patterns(patterns)

Validate every artifact matching the given glob patterns.

loom.ai.validate.main(argv=None)[source]

Entry point of python -m loom.ai.validate.

Parameters:

argv (Sequence[str] | None) – Glob patterns; defaults to sys.argv[1:].

Returns:

0 when every matched artifact is valid, 1 when issues were found, 2 on usage errors.

Return type:

int

loom.ai.validate.validate_patterns(patterns)[source]

Validate every artifact matching the given glob patterns.

Parameters:

patterns (Sequence[str]) – Glob patterns; absolute or relative to the working directory, expanded with ** support.

Returns:

Every issue found across every matched artifact, in path order.

Return type:

tuple[AgentCompilationIssue, …]