cadrumo.entrypoints.adapter_composition module

The adapter composition shared by the CLI and TUI entrypoints.

A frontend process must bind the persistence and outbound adapters the application layer resolves through explicitly composed ports before it serves any work. That inventory is a property of the product, not of the frontend, so it is declared once here and entered by the CLI root and the TUI devtools fixture. The separately shipped MCP harness owns its independent composition root and does not import this entrypoint module.

An entrypoint that forgets this scope fails on every custody-touching verb, which is exactly the symptom that made the original MCP gap visible.

Core types: SecureObjectRepository, TransactionCatalogueRepository.

class ProfileAdapterComposition(*, profile_custody)[source]

Bases: object

Concrete capabilities composed for one executable profile session.

Each capability resolves on first read, so a command imports only the adapter trees it actually uses.

Parameters:

profile_custody (ProfileCustodyPort)

property state_projection_read_ports: StateProjectionReadPorts[source]

Resolve the state projection read ports on first read.

property diagnostics_ports: DiagnosticsPorts[source]

Resolve the diagnostics ports on first read.

property certificate_secret_backend_factory: CertificateSecretBackendFactory[source]

Resolve the certificate secret backend factory on first read.

property operator_probe_ports: OperatorProbePorts[source]

Resolve the operator probe ports on first read.

property operator_scope_ports: OperatorScopePorts[source]

Resolve the operator scope ports on first read.

property bucket_storage: ProfileBucketStoragePort[source]

Resolve the bucket storage on first read.

property verification_repository_bundle_factory: Callable[[str], VerificationRepositoryBundle]

Resolve the verification repository bundle factory on first read.

property profile_read_ports_factory: ProfileReadPortsFactory

Resolve the per-bucket profile read ports factory.

property calculation_action_ports_factory: CalculationActionPortsFactory

Resolve the calculation action ports factory on first read.

property amendment_action_ports_factory: AmendmentActionPortsFactory

Resolve the amendment action ports factory on first read.

property filing_action_ports_factory: FilingActionPortsFactory

Resolve the filing action ports factory on first read.

property bienes_inversion_repository_factory: BienesInversionIvaRegisterRepositoryFactory

Resolve the bienes inversion repository factory on first read.

property retencion_observation_ports_factory: RetencionObservationPortsFactory

Resolve the retencion observation ports factory on first read.

property percepcion_observation_ports_factory: PercepcionObservationPortsFactory

Resolve the percepcion observation ports factory on first read.

property borrador_100_snapshot_repository_factory: Borrador100SnapshotRepositoryFactory

Resolve the borrador 100 snapshot repository factory on first read.

property censal_fetch_port: CensalFetchPort[source]

Resolve the censal fetch port on first read.

property expedientes_ports_factory: ExpedientesPortsFactory

Resolve the expedientes ports factory on first read.

property ledger_evidence_ports_factory: LedgerEvidencePortsFactory

Resolve the ledger evidence ports factory on first read.

property invoice_confirmation_ports_factory: InvoiceConfirmationPortsFactory[source]

Resolve the invoice confirmation ports factory on first read.

property counterparty_establishment_repository_factory: CounterpartyEstablishmentRepositoryFactory[source]

Resolve the counterparty establishment repository factory on first read.

property inventory_service_ports_factory: InventoryServicePortsFactory

Resolve the inventory service ports factory on first read.

property catalogue_creation_ports_factory: CatalogueCreationPortsFactory[source]

Resolve the catalogue creation ports factory on first read.

property catalogue_lifecycle_ports_factory: CatalogueLifecyclePortsFactory[source]

Resolve the catalogue lifecycle ports factory on first read.

property draft_review_ports_factory: DraftReviewPortsFactory

Resolve the draft review ports factory on first read.

property modelo_export_ports_factory: ModeloExportPortsFactory

Resolve the modelo export ports factory on first read.

property modelo_edit_receipt_repository_factory: ModeloEditReceiptRepositoryFactory

Resolve the modelo edit receipt repository factory on first read.

property modelo_history_ports_factory: ModeloHistoryPortsFactory

Resolve the modelo history ports factory on first read.

property participation_index_rebuild_ports_factory: ParticipationIndexRebuildPortsFactory

Resolve the participation index rebuild ports factory on first read.

property review_package_signing_keypair_capability_factory: ReviewPackageSigningKeypairCapabilityFactory[source]

Resolve the review package signing keypair capability factory on first read.

property modelo_iva_wallet_seed_ports_factory: ModeloIvaWalletSeedPortsFactory

Resolve the modelo IVA wallet seed ports factory on first read.

property prorrata_register_repository_factory: ProrrataRegisterRepositoryFactory

Resolve the prorrata register repository factory on first read.

property m145_communication_records_ports_factory: M145CommunicationRecordsPortsFactory[source]

Resolve the Modelo 145 communication records ports factory on first read.

property m036_lifecycle_ports_factory: M036LifecyclePortsFactory[source]

Resolve the Modelo 036 lifecycle ports factory on first read.

property work_lifecycle_ports_factory: WorkLifecyclePortsFactory

Resolve the work lifecycle ports factory on first read.

property recipient_fingerprint_registry_ports_factory: RecipientFingerprintRegistryPortsFactory[source]

Resolve the recipient fingerprint registry ports factory on first read.

property recipient_encryption_capability_factory: RecipientEncryptionCapabilityFactory[source]

Resolve the recipient encryption capability factory on first read.

property apoderado_config_repository_factory: ApoderadoConfigurationRepositoryFactory[source]

Resolve the apoderado config repository factory on first read.

build_operator_probe_ports()[source]

Compose the session, certificate and Cl@ve probes the auth flows consult.

Return type:

OperatorProbePorts

build_censal_fetch_port()[source]

Bind the concrete Sede censo reader to the application fetch port.

Return type:

CensalFetchPort

build_calc_sheets_parity_apply_port()[source]

Bind the Google workbook writer to the application parity capability.

Return type:

CalcSheetsParityApplyPort

build_modelo_export_ports(*, bucket_id, m303_rectificativa_taxpayer_tax_id)[source]

Compose every persisted authority required by one Modelo export.

Return type:

ModeloExportPorts

Parameters:
build_profile_read_ports(*, bucket_id)[source]

Compose the authenticated profile projection for one calculation bucket.

Return type:

ProfileReadPorts

Parameters:

bucket_id (str)

build_bienes_inversion_repository(*, bucket_id)[source]

Compose the encrypted register capability for one profile bucket.

Return type:

BienesInversionIvaRegisterRepositoryProtocol

Parameters:

bucket_id (str)

build_prorrata_register_repository(*, bucket_id)[source]

Compose the bucket-bound prorrata register repository capability.

Return type:

ProrrataRegisterServiceRepositoryProtocol

Parameters:

bucket_id (str)

build_diagnostics_ports()[source]

Compose the translated secure-object capabilities used by diagnostics.

Return type:

DiagnosticsPorts

build_draft_review_ports(*, bucket_id)[source]

Compose the persisted authorities required by draft review.

Return type:

DraftReviewPorts

Parameters:

bucket_id (str)

build_modelo_history_ports(*, bucket_id)[source]

Compose every persisted authority required by Modelo history reads.

Return type:

ModeloHistoryPorts

Parameters:

bucket_id (str)

build_modelo_edit_receipt_repository(*, bucket_id)[source]

Compose the encrypted Modelo edit-receipt capability for one bucket.

Return type:

ModeloEditReceiptRepositoryPort

Parameters:

bucket_id (str)

build_participation_index_rebuild_ports(*, bucket_id)[source]

Compose every persisted authority required by a participation-index rebuild.

Return type:

ParticipationIndexRebuildPorts

Parameters:

bucket_id (str)

build_modelo_iva_wallet_seed_ports(*, bucket_id)[source]

Compose every persisted authority required by IVA-wallet seed operations.

Return type:

ModeloIvaWalletSeedPorts

Parameters:

bucket_id (str)

build_inventory_service_ports(*, bucket_id)[source]

Compose the encrypted inventory repository and bucket-event sink.

Return type:

InventoryServicePorts

Parameters:

bucket_id (str)

build_borrador_100_snapshot_repository(*, bucket_id)[source]

Bind the encrypted borrador snapshot adapter to one profile bucket.

Return type:

Borrador100SnapshotRepository

Parameters:

bucket_id (str)

build_retencion_observation_ports(*, bucket_id)[source]

Compose the encrypted retención observation capability for one bucket.

Return type:

RetencionObservationPorts

Parameters:

bucket_id (str)

build_percepcion_observation_ports(*, bucket_id)[source]

Compose the encrypted percepciones observation capability for one bucket.

Return type:

PercepcionObservationPorts

Parameters:

bucket_id (str)

build_calculation_action_ports(*, bucket_id, operation, profile_record=None)[source]

Compose every persisted authority required by one Modelo calculation.

Return type:

CalculationActionPorts

Parameters:
build_work_lifecycle_ports(*, bucket_id)[source]

Compose the two required Modelo work-lifecycle authorities.

Return type:

WorkLifecyclePorts

Parameters:

bucket_id (str)

build_active_work_lifecycle_ports()[source]

Compose lifecycle authorities for the active profile operation scope.

Return type:

WorkLifecyclePorts

build_amendment_action_ports(*, bucket_id, operation)[source]

Compose every persisted authority required by one Modelo amendment.

Return type:

AmendmentActionPorts

Parameters:
build_filing_action_ports(*, bucket_id)[source]

Compose every persisted authority required by one Modelo filing.

Return type:

FilingActionPorts

Parameters:

bucket_id (str)

build_ledger_evidence_ports(*, bucket_id)[source]

Compose the encrypted catalogue, attachment custody, and event sink.

Return type:

LedgerEvidencePorts

Parameters:

bucket_id (str)

build_expedientes_ports(*, bucket_id)[source]

Compose translated Sede reading and encrypted expedientes persistence.

Return type:

ExpedientesPorts

Parameters:

bucket_id (str)

build_verification_repository_bundle(bucket_id)[source]

Compose every verification repository against one bucket store.

Return type:

VerificationRepositoryBundle

Parameters:

bucket_id (str)

profile_free_adapter_composition()[source]

Bind only what a command that reads no profile still touches.

Every envelope names the selected profile from its plaintext summary, and output follows its plaintext language hint, so the custody port and the language resolver are bound; the persistence and outbound trees a profile-bound command needs are not imported at all.

Return type:

Generator[None]

profile_adapter_composition()[source]

Bind every adapter port a frontend session resolves, and unbind after.

The imports are function-local because entering this scope is what pulls the adapter layer into the process: a frontend that never serves work should not pay for the persistence and outbound trees at import time. The yielded capabilities resolve on first read for the same reason.

Return type:

Generator[ProfileAdapterComposition]