cadrumo.application.modelo.workspace_producers module¶
Stamped producer contracts and atomic capture ports for Modelo Workspace V1.
Core types:
CalculationRevision,
RegistrySnapshot.
- class RegistryAuthorityCapturePort(*args, **kwargs)[source]¶
Bases:
ProtocolNarrow authority surface required by the atomic workspace registry port.
- capture_law_selected_projection(modelo_id, *, filing_year, period, on=None, grade=None)[source]¶
- Return type:
- Parameters:
modelo_id (str)
filing_year (int)
period (str)
on (date | None)
grade (RegistryAuthorityGrade | None)
- class ModeloWorkspaceContributorKindV1(*values)[source]¶
Bases:
StrEnumThe closed contributor denominator for one successful Workspace V1 read.
- REGISTRY¶
- WORK¶
- BOUNDED_REVIEW¶
- CALCULATION¶
- READINESS¶
- LOCALE_CATALOGUE¶
- FIELD_MANIFEST¶
- class ModeloWorkspaceEpochKindV1(*values)[source]¶
Bases:
StrEnumThe accepted owner-scoped invalidation mechanism for Workspace contributors.
- MONOTONIC_GENERATION¶
- modelo_workspace_projection_schema_fingerprint(projection_type)[source]¶
Derive one deterministic fingerprint over the contract a consumer actually receives.
A port projects outward: the caller reads the SERIALIZATION shape, never the validation shape, so the serialization schema alone is the contract the fingerprint has to identify. Fingerprinting BOTH schemas and demanding they coincide was standing in for a round-trip guarantee it never tested and does not need: a bare
Decimalfield validates asanyOf[number, string]but serializes asstringalone, which is a faithful, round-trippable representation (model_validate_jsonparses the dumped string straight back toDecimal), not a broken contract. Refuse it here and every Decimal-bearing domain model – the registry snapshot, the work review, the calculation revision – becomes unregisterable for a shape difference that never breaks a round trip.- Return type:
TypeAliasType- Parameters:
projection_type (type[BaseModel])
- class ModeloWorkspaceProducerContractV1(**data)[source]¶
Bases:
_WorkspaceProducerModelFrozen declaration of one owner contribution to a successful Workspace result.
- Parameters:
contract_version (Literal[1])
contributor_kind (ModeloWorkspaceContributorKindV1)
contributor (ModeloWorkspaceContributorIdentityV1)
projection_discriminator (_ProducerCode)
projection_contract_version (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=1)])])
projection_schema_fingerprint (ContentDigest)
epoch_kind (ModeloWorkspaceEpochKindV1)
epoch_schema_version (Literal[2])
atomic_read_operation (Literal['capture_projection_with_epoch'])
contract_digest (ContentDigest)
- contract_version: Literal[1]¶
- contributor_kind: ModeloWorkspaceContributorKindV1¶
- contributor: ModeloWorkspaceContributorIdentityV1¶
- projection_discriminator: _ProducerCode¶
- projection_contract_version: Annotated[int, Field(ge=1)]¶
- projection_schema_fingerprint: ContentDigest¶
- epoch_kind: ModeloWorkspaceEpochKindV1¶
- epoch_schema_version: Literal[2]¶
- atomic_read_operation: Literal['capture_projection_with_epoch']¶
- contract_digest: ContentDigest¶
- classmethod declare(*, contributor_kind, contributor, projection_discriminator, projection_contract_version, projection_type, epoch_schema_version=2)[source]¶
Declare a contract from the exact public projection schema it returns.
- Return type:
Self- Parameters:
contributor_kind (ModeloWorkspaceContributorKindV1)
contributor (ModeloWorkspaceContributorIdentityV1)
projection_discriminator (_ProducerCode)
projection_contract_version (int)
projection_type (type[BaseModel])
epoch_schema_version (Literal[2])
- class ModeloWorkspaceProducerStampV1(**data)[source]¶
Bases:
_WorkspaceProducerModelThe captured declaration identity that binds one value to its producer contract.
- Parameters:
data (Any)
- stamp_version: Literal[1]¶
- contributor_kind: ModeloWorkspaceContributorKindV1¶
- contributor: ModeloWorkspaceContributorIdentityV1¶
- contract_digest: ContentDigest¶
- projection_discriminator: _ProducerCode¶
- projection_contract_version: Annotated[int, Field(ge=1)]¶
- projection_schema_fingerprint: ContentDigest¶
- classmethod from_contract(contract)[source]¶
Mint the one stamp that exactly represents
contract.- Return type:
Self- Parameters:
contract (ModeloWorkspaceProducerContractV1)
- require_contract(contract)[source]¶
Refuse a capture whose stamp differs from the declared current contract.
- Return type:
Self- Parameters:
contract (ModeloWorkspaceProducerContractV1)
- class ModeloWorkspaceEpochV1(**data)[source]¶
Bases:
_WorkspaceProducerModelOwner generation that exposes every ABA transition within one process incarnation.
- Parameters:
data (Any)
- owner: _ProducerCode¶
- kind: ModeloWorkspaceEpochKindV1¶
- schema_version: Literal[2]¶
- comparison_domain: ContentDigest¶
- generation: Annotated[int, Field(ge=1)]¶
- require_current(current)[source]¶
Require this epoch to remain current within its exact comparison domain.
- Return type:
Self- Parameters:
current (ModeloWorkspaceEpochV1)
- class ModeloWorkspaceContributingProjectionV1(**data)[source]¶
Bases:
_WorkspaceProducerModel,GenericOne projection, stamp, and incarnation-scoped ABA-safe epoch from one atomic read.
- Parameters:
projection (ProjectionT)
stamp (ModeloWorkspaceProducerStampV1)
epoch (ModeloWorkspaceEpochV1)
- projection: ProjectionT¶
- stamp: ModeloWorkspaceProducerStampV1¶
- epoch: ModeloWorkspaceEpochV1¶
- require_contract(contract)[source]¶
Validate the captured projection against its declared contract without a live reread.
- Return type:
Self- Parameters:
contract (ModeloWorkspaceProducerContractV1)
- class ModeloWorkspaceRegistryProjectionV1(**data)[source]¶
Bases:
_WorkspaceProducerModelExactly one of the two registry admission shapes, never both.
- Parameters:
inspection (RegistryRevisionInspection | None)
snapshot (RegistrySnapshot | None)
- inspection: RegistryRevisionInspection | None¶
- snapshot: RegistrySnapshot | None¶
- property revision_id: RevisionId¶
Return the one law-selected revision id, whichever admission shape carries it.
- property review_status: RevisionReviewStatus¶
Return the revision’s own governance stamp, whichever admission shape carries it.
- class ModeloWorkspaceReadinessProjectionV1(**data)[source]¶
Bases:
_WorkspaceProducerModelThe complete readiness report set, exactly as the sole producer built it.
- Parameters:
reports (tuple[ProjectionModeloReadiness, ...])
- reports: tuple[ProjectionModeloReadiness, ...]¶
- class ModeloWorkspaceLocaleCatalogueProjectionV1(**data)[source]¶
Bases:
_WorkspaceProducerModelOne captured catalogue entry, exactly as the sole catalogue reader returned it.
- Parameters:
locale (str)
translation_key (str)
present (bool)
value (str | None)
catalogue_digest (ContentDigest)
- locale: str¶
- translation_key: str¶
- present: bool¶
- value: str | None¶
- catalogue_digest: ContentDigest¶
- class ModeloWorkspaceRegistryPortV1(*, authority, modelo_id, filing_year, period, on=None, grade=None)[source]¶
Bases:
objectApplication-owned port realization delegating to the registry authority.
- Parameters:
authority (RegistryAuthorityCapturePort)
modelo_id (str)
filing_year (int)
period (str)
on (date | None)
grade (RegistryAuthorityGrade | None)
- property producer_contract: ModeloWorkspaceProducerContractV1¶
Return the frozen REGISTRY contributor contract.
- class ModeloWorkspaceWorkPortV1(*, request, catalogue_repository, mode=ModeloWorkSelectionMode.VISIBLE_OR_EXACT)[source]¶
Bases:
objectApplication-owned port realization delegating to the sole WORK capture.
- Parameters:
request (ModeloWorkSelectorRequest)
catalogue_repository (WorkUnitCatalogueRepositoryProtocol)
mode (ModeloWorkSelectionMode)
- property producer_contract: ModeloWorkspaceProducerContractV1¶
Return the frozen WORK contributor contract.
- class ModeloWorkspaceLocaleCataloguePortV1(*, translation_key, locale)[source]¶
Bases:
objectApplication-owned port realization delegating to the sole LOCALE_CATALOGUE capture.
- property producer_contract: ModeloWorkspaceProducerContractV1¶
Return the frozen LOCALE_CATALOGUE contributor contract.
- class ModeloWorkspaceFieldManifestPortV1(*, authority)[source]¶
Bases:
objectApplication-owned port realization delegating to the sole FIELD_MANIFEST capture.
A static inspection and a graded snapshot make different authority claims and generate over different type universes – this port accepts either admission’s own authority object and dispatches to the matching generator, never filtering one universe’s manifest down for the other.
- Parameters:
authority (RegistrySnapshot | RegistryRevisionInspection)
- property producer_contract: ModeloWorkspaceProducerContractV1¶
Return the frozen FIELD_MANIFEST contributor contract.