Skip to content

API Reference parrot.semantic.accounting.validation

github-actions[bot] edited this page Dec 2, 2026 · 1 revision

parrot.semantic.accounting.validation

View source

Load-time model validation (FEAT-713 M4): returns EVERY problem.

Alias AccountSet

Re-exported from parrot.semantic.accounting.models.AccountSet.

Alias AccountingModelSpec

Re-exported from parrot.semantic.accounting.models.AccountingModelSpec.

Alias ChartSnapshot

Re-exported from parrot.semantic.accounting.models.ChartSnapshot.

Alias GrammarError

Re-exported from parrot.semantic.accounting.errors.GrammarError.

Attribute Interval

Alias Problem

Re-exported from parrot.semantic.accounting.errors.Problem.

Alias ResolvedSet

Re-exported from parrot.semantic.accounting.models.ResolvedSet.

Function metric_order

Deterministic topological order of metrics; members of a cycle are appended last in name order.

metric_order(spec: AccountingModelSpec) -> tuple[str, ...]

Parameter Type Default Description
spec AccountingModelSpec The model as written.

Returns: tuple[str, ...] — Every metric name, each after the metrics it references (except inside cycles).

Alias parse_assertion

Re-exported from parrot.semantic.accounting.grammar.parse_assertion.

Alias parse_expr

Re-exported from parrot.semantic.accounting.grammar.parse_expr.

Function partition_intervals

Half-open intervals between every valid_from / valid_to boundary, covering (-inf, +inf).

partition_intervals(sets: Mapping[str, AccountSet]) -> tuple[Interval, ...]

Parameter Type Default Description
sets Mapping[str, AccountSet] Account sets as written in the model.

Returns: tuple[Interval, ...] — ((None, d1), (d1, d2), ..., (dn, None)) over the sorted distinct boundaries, or ((None, None),) when no set is dated.

Alias references

Re-exported from parrot.semantic.accounting.grammar.references.

Function validate

Every invariant of spec §3 M4; never stops at the first problem.

validate(spec: AccountingModelSpec, resolved: Mapping[str, ResolvedSet], snapshot: ChartSnapshot, columns: Mapping[str, str] | None) -> list[Problem]

Parameter Type Default Description
spec AccountingModelSpec The model as written.
resolved Mapping[str, ResolvedSet] Every set with its selectors resolved against snapshot.
snapshot ChartSnapshot The chart of accounts the model is validated against.
columns Mapping[str, str] | None Journal column name -> declared type; None skips the column checks.

Returns: list[Problem] — Every problem, sorted by code, interval and accounts.

Architecture

Clients

Bots & Agents

Memory

Knowledge

Tools & Toolkits

Flows

Experts

Skills

Stores & Loaders

MCP & A2A

Server & APIs

Integrations

Outputs & A2UI

Prompts

Security

Operations

Migration

SDD Tooling

LLM Wiki

Deployment

Decisions

API Reference

Clone this wiki locally