cadrumo.application.modelo.binding_readiness module

Binding-readiness query for the bindings list --missing surface.

bindings list reports the registry bindings a modelo revision declares. --missing narrows that list to the bindings an operator still owes — the ones not yet resolvable from the workspace’s current state. A binding is resolvable when the active profile already holds the fact the binding selects (source = "profile"). Every other binding — ledger aggregations, prior-filing pulls, live observations — needs data the operator has not supplied yet and is therefore missing.

This module owns the cross-domain step (registry snapshot + user profile) so the registry-query CLI stays a thin caller. The revision is fetched through a ValidatedRegistryAuthority given the requested modelo, year, and period.

See also

cadrumo.application.modelo.profile_binding.resolve_profile_sourced_bindings()

Profile binding resolver whose typed binding channels become the profile-resolved id set returned here.

cadrumo.application.state_projection

Broader modelo readiness projection that reports formula-consumed profile/manual bindings for the readiness command.

profile_resolvable_binding_ids(*, modelo, bucket_id, filing_year, period, as_of=None, revision_id=None, operation)[source]

Return binding ids resolvable from the active profile’s stored facts.

Resolves the registry snapshot for (modelo, filing_year, period) — or, when period is None, the revision covering filing_year — and projects the bucket’s user profile onto its source = "profile" bindings. A supplied Period must match filing_year and contributes the registry token used at the snapshot boundary. The returned set is the binding ids the profile already satisfies.

Returns an empty set when the snapshot cannot be resolved or the bucket has no profile — the caller then treats every binding as missing, which is the correct conservative answer.

Return type:

frozenset[str]

Parameters:
annual_period_for_year(authority, *, modelo, filing_year, as_of=None)[source]

Return a registry period token a snapshot for filing_year accepts.

With no --period the operator wants the revision covering the year. A snapshot still needs a concrete period token; pick the first period the covering revision declares so the snapshot resolves. The binding set is revision-wide, so the period choice does not change which bindings the revision declares.

The shared temporal selector resolves same-year revision windows using as_of before this helper chooses the revision’s first legal period.

Core types: ValidatedRegistryAuthority.

Return type:

str | None

Parameters: