Skip to content

cayu.budgets.binding

Public Cayu API. Definitions are grouped by their public source module, and definitions from private implementation modules appear on their package’s page; adding a symbol does not move existing links. The import shown at each entry is a supported public namespace. Read the Python API overview and install the required extra.

from cayu.budgets import BudgetBinding

Immutable authority for one common-root budget domain.

Construction does not authenticate a caller. Applications must obtain instances from a registered trusted receiver and persist the resulting digest with every reservation and settlement.

Bases: BaseModel.

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
protocol_version StrictStr 'cayu:budget-binding:v1'
binding_id StrictStr required
application_scope StrictStr required
initiator StrictStr required
sponsor StrictStr required
purpose StrictStr required
root_budget_id StrictStr required
ancestor_budget_ids tuple[StrictStr, ...] ()
limits tuple[BudgetLimit, ...] Field(min_length=1)
ledger_owner StrictStr required
receiver_id StrictStr required
receiver_generation StrictInt Field(ge=0)
allowance StrictInt Field(gt=0, le=MAX_DURABLE_JSON_INTEGER)
retention_policy StrictStr required
settlement_policy StrictStr required
provider_name StrictStr | None None
model StrictStr | None None
environment_name StrictStr | None None
BudgetBinding.validate_text(value: str | None, info) -> str | None
BudgetBinding.validate_ancestors(value: tuple[str, ...]) -> tuple[str, ...]
BudgetBinding.copy_limits(value: object) -> tuple[BudgetLimit, ...]
BudgetBinding.require_root_ceiling() -> BudgetBinding
BudgetBinding.authority_digest() -> str

Return the stable digest of every decision-bearing authority field.

BudgetBinding.exact_match(other: BudgetBinding) -> bool

Compare complete authority, not only the binding identifier.

Release source · Runtime guarantees · Capability guides

from cayu.budgets import BudgetBindingError

Raised when a common-root binding is malformed or conflicts.

Bases: ValueError.

This type’s implementation and inherited behavior are available in the linked release source.

Release source · Runtime guarantees · Capability guides

from cayu.budgets import BudgetBindingReceiver

Trusted application/runtime receiver for common-root bindings.

Decorators: @runtime_checkable.

Bases: Protocol.

async BudgetBindingReceiver.resolve_budget_binding(*, request: Any) -> BudgetBinding

Resolve authenticated authority; caller-shaped values are not enough.

Receivers may expose a register method with the same signature; runtime admission prefers that registration boundary when present.

Release source · Runtime guarantees · Capability guides