aeat.application.workflow package

Public facade for workflow runs and profile-bucket discovery.

The workflow engine surface composes auth, filing, draft-building, and submission collaborators into resumable modelo runs. A WorkflowEngine advances WorkflowStage values and persists WorkflowResult records through WorkflowRunRepository. The companion WorkflowState envelope carries progress pointers, auth readiness, review annotations, and bucket events; it does not store profile facts or profile-value maps.

The profile-discovery surface is manifest-backed and intentionally cheap. list_profile_buckets(), read_profile_bucket(), read_profile_bucket_by_id(), and resolve_profile_bucket() scan plaintext bucket manifests and return ProfileBucketPointer records without opening an encrypted database. The scanners resolve immutable bucket UUIDs and operator labels, filter tombstoned buckets from live surfaces by default, and leave tombstoned-by-id inspection to diagnostics and repair callers. Active-profile status and repair use the redacted ActiveProfileHealth projection; sensitive profile records are loaded only through the active bucket and the user-profile orchestration layer.

Workflow persistence is likewise bucket-scoped. workflow_state_repository() binds the state envelope to the currently resolved active bucket via the storage runtime’s secure-object repository. A cold root with no active pointer is the only bootstrap exception, so recovery and status probes can observe an absent state without manufacturing a profile bucket. Reset helpers fingerprint_workflow_state() and reset_workflow_state() operate on the workflow-state row only: they emit a plaintext-free WorkflowStateResetFingerprint and append the workflow_state.reset bucket event before deleting the encrypted row.

This initializer is only the public re-export boundary. Manifest parsing stays in _profile_bucket_scan; health projection and pointer repair stay in _profile_health; encrypted state and run storage stay behind WorkflowStateRepository and WorkflowRunRepository; and engine orchestration stays in _engine. Callers must not duplicate pointer parsing, manifest resolution, secure-repository opening, SQL routing, or master-key handling here. The active-profile refusal NoActiveProfileError remains core-owned and is imported from core.errors.

See also

WorkflowState: Encrypted progress,

readiness, review, and event state for the active bucket.

WorkflowResult: Persisted terminal

result for one modelo workflow run.

resume_modelo_workflow(): Build the

resume context for a persisted aborted workflow run.

resolve_modelo_workflow_resume_target():

Resolve exact run ids, exact work-unit ids, calculation revisions, or visible modelo selectors to one resumable workflow run target.

list_profile_buckets(): Enumerate live

manifest-backed profile buckets without opening secure storage.

assess_active_profile_health(): Produce

the redacted active-profile status used by CLI status surfaces.

workflow_state_repository(): Resolve the

active-bucket secure-object repository for encrypted workflow state.

WorkflowStateResetFingerprint: Redacted

reset audit record produced before workflow-state deletion.

DeadlineEngineProtocol: Protocol

boundary for pluggable deadline calculation collaborators.

Submodules