cadrumo.application.operations._registry_contracts module

Contract, digest, and registration helpers for the operation registry.

The public registry classes remain in registry so their import and serialization identities stay stable. This module contains the value-level work used to derive and validate their public contract fixed point.

schema_identity_key(identity)[source]

Return the complete identity tuple, including its fingerprint.

Return type:

tuple[str, int, TypeAliasType]

Parameters:

identity (OperationSchemaIdentityV1)

public_schema_bindings(registration)[source]

Index each registered public schema binding by its complete identity.

Return type:

dict[tuple[str, int, TypeAliasType], type[BaseModel]]

Parameters:

registration (OperationPublicDefinitionRegistrationV1)

declared_public_schema_identities(contract)[source]

Collect every schema identity declared by one public contract manifest.

Return type:

set[tuple[str, int, TypeAliasType]]

Parameters:

contract (OperationPublicDefinitionContractV1)

validate_public_schema_manifest(bindings, declared_identities)[source]

Require schema bindings to cover exactly the contract manifest.

Return type:

None

Parameters:
validate_public_request_binding(definition, contract, bindings)[source]

Require the declared request identity to bind the definition model.

Return type:

None

Parameters:
validate_public_result_registration(definition, registration, contract, bindings)[source]

Match result schema and projector declarations to the definition result.

Return type:

None

Parameters:
validate_resultless_public_registration(registration, contract)[source]

Refuse result declarations for an operation without a result model.

Return type:

None

Parameters:
validate_resultful_public_registration(definition, registration, contract, bindings)[source]

Match a result-bearing operation’s schema and optional projection adapter.

Return type:

None

Parameters:
validate_public_review_registration(definition, registration, contract)[source]

Match REVIEW declarations, operand validation, and projector shape.

Return type:

None

Parameters:
validate_public_review_declarations(declares_review, registration, contract)[source]

Require each REVIEW contract and runtime registration arm together.

Return type:

None

Parameters:
validate_public_review_implementations(registration)[source]

Validate the reviewed operand graph before the REVIEW projector shape.

Return type:

None

Parameters:

registration (OperationPublicDefinitionRegistrationV1)

validate_public_refresh_registration(registration, contract)[source]

Require refresh schema and adapter declarations to move together.

Return type:

None

Parameters:
validate_public_result_projector_signature(registration)[source]

Validate the optional projector on the registration model boundary.

Return type:

None

Parameters:

registration (OperationPublicDefinitionRegistrationV1)

validate_public_registration(definition, registration, *, contract_builder)[source]

Run the ordered live-registration checks for one operation definition.

Return type:

None

Parameters:
validate_public_contract_fixed_point(definition, contract, *, contract_builder)[source]

Require the manifest to equal the value derived from live definition data.

Return type:

None

Parameters:
definition_contract_digest(contract)[source]

Derive the digest over one public definition contract.

Return type:

TypeAliasType

Parameters:

contract (OperationPublicDefinitionContractV1)

contract_set_digest(definitions)[source]

Derive the digest over the canonical public contract set.

Return type:

TypeAliasType

Parameters:

definitions (tuple[OperationPublicDefinitionContractV1, ...])

definition_contract_value(contract, *, include_digest)[source]

Return the explicitly ordered, JSON-safe value governed by the digest.

Return type:

dict[str, object]

Parameters:
definition_contract_identity_value(contract)[source]

Return manifest and operation identity fields in digest order.

Return type:

dict[str, object]

Parameters:

contract (OperationPublicDefinitionContractV1)

definition_contract_schema_value(contract)[source]

Return declared public schema identities in digest order.

Return type:

dict[str, object]

Parameters:

contract (OperationPublicDefinitionContractV1)

definition_contract_policy_value(contract)[source]

Return policy and capability fields in digest order.

Return type:

dict[str, object]

Parameters:

contract (OperationPublicDefinitionContractV1)

build_public_contract(*, contract_type, definition, request_schema, result_schema, review_projection_schema, interaction_response_schema, workspace_refresh_target_schema)[source]

Build a public contract through the caller-owned Pydantic class.

Return type:

Any

Parameters:
  • contract_type (type[BaseModel])

  • definition (OperationDefinition)

  • request_schema (Any)

  • result_schema (Any)

  • review_projection_schema (Any)

  • interaction_response_schema (Any)

  • workspace_refresh_target_schema (Any)

require_positional_callable_signature(callable_value, *, arity, label)[source]

Require one synchronous callable with exactly the declared arity.

Return type:

None

Parameters: