Shared Contracts¶
The raes_contracts package owns neutral DTOs and enums shared across
processor, runtime, backend protocols, conformance, and authoring surfaces.
These contracts are the typed boundary for backend-facing runtime calls; they
must not live in runtime or processor implementation modules.
Diagnostics¶
Shared diagnostic contracts.
- class raes_contracts.diagnostics.Diagnostic¶
Bases:
objectStructured planner/runtime message.
- code: str¶
- domain: str¶
- address: str¶
- message: str¶
- property is_error: bool¶
- class raes_contracts.diagnostics.DiagnosticModel¶
Bases:
BaseModelClosed portable diagnostic shape for published contracts.
- model_config = {'extra': 'forbid', 'frozen': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- code: str¶
- domain: str¶
- address: str¶
- message: str¶
- class raes_contracts.diagnostics.Severity¶
Bases:
str,EnumDiagnostic severity level.
- ERROR = 'error'¶
- WARNING = 'warning'¶
- INFO = 'info'¶
- __new__(value)¶
- raes_contracts.diagnostics.diagnostic_model(diagnostic)¶
Convert the internal immutable diagnostic to its closed contract model.
- Parameters:
diagnostic (Diagnostic)
- Return type:
- raes_contracts.diagnostics.diagnostic_payload(diagnostic)¶
Render a diagnostic as a JSON-ready mapping (severity as its string value).
- Parameters:
diagnostic (Diagnostic)
- Return type:
dict[str, Any]
- raes_contracts.diagnostics.portable_diagnostic_payload(diagnostic)¶
Render a diagnostic through the closed portable JSON contract.
Internal diagnostic addresses predate the transport contract and may use dotted runtime locations. Preserve that value as one escaped JSON-Pointer token instead of weakening the public address grammar.
- Parameters:
diagnostic (Diagnostic)
- Return type:
dict[str, Any]
Artifact Transformation Reports¶
Closed portable reports for pure RAES artifact transformations.
- class raes_contracts.contracts.artifact_transformations.ArtifactTransformationCheckModel¶
Bases:
ContractModel- model_config = {'extra': 'forbid', 'frozen': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- check_id: str¶
- outcome: TransformationCheckOutcome¶
- diagnostic_codes: tuple[str, ...]¶
- class raes_contracts.contracts.artifact_transformations.ArtifactTransformationIdentityMapModel¶
Bases:
ContractModel- model_config = {'extra': 'forbid', 'frozen': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- declaration_kind: NonEmptyString¶
- before: NonEmptyString¶
- after: NonEmptyString¶
- class raes_contracts.contracts.artifact_transformations.ArtifactTransformationKind¶
Bases:
str,Enum- SDL_AUTHORING = 'sdl-authoring'¶
- PORTABLE_CONTRACT = 'portable-contract'¶
- __new__(value)¶
- class raes_contracts.contracts.artifact_transformations.ArtifactTransformationLossKind¶
Bases:
str,Enum- DECLARATION_REMOVED = 'declaration-removed'¶
- SEMANTIC_OMISSION = 'semantic-omission'¶
- __new__(value)¶
- class raes_contracts.contracts.artifact_transformations.ArtifactTransformationLossModel¶
Bases:
ContractModel- model_config = {'extra': 'forbid', 'frozen': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- affected_identity: NonEmptyString¶
- diagnostic: DiagnosticModel¶
- class raes_contracts.contracts.artifact_transformations.ArtifactTransformationPreservationModel¶
Bases:
ContractModel- model_config = {'extra': 'forbid', 'frozen': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- profile: NonEmptyString¶
- outcome: PreservationOutcome¶
- evidence_digests: tuple[PrefixedDigestString, ...]¶
- limitations: tuple[NonEmptyString, ...]¶
- class raes_contracts.contracts.artifact_transformations.ArtifactTransformationReportModel¶
Bases:
ContractModelDeterministic all-or-none report for one semantic operation.
- model_config = {'extra': 'forbid', 'frozen': True, 'title': 'RAES Artifact Transformation Report v1'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- schema_version: Literal[ARTIFACT_TRANSFORMATION_REPORT_SCHEMA_VERSION]¶
- operation_profile: str¶
- status: ArtifactTransformationStatus¶
- artifact_kind: ArtifactTransformationKind¶
- source_profile: NonEmptyString¶
- target_profile: NonEmptyString¶
- canonicalization_profile: NonEmptyString¶
- source_digest: PrefixedDigestString¶
- target_digest: PrefixedDigestString | None¶
- policy_digest: PrefixedDigestString¶
- derivation_digest: PrefixedDigestString¶
- preconditions: tuple[ArtifactTransformationCheckModel, ...]¶
- postconditions: tuple[ArtifactTransformationCheckModel, ...]¶
- affected_identities: tuple[NonEmptyString, ...]¶
- identity_map: tuple[ArtifactTransformationIdentityMapModel, ...]¶
- preservation: ArtifactTransformationPreservationModel¶
- losses: tuple[ArtifactTransformationLossModel, ...]¶
- diagnostics: tuple[DiagnosticModel, ...]¶
- class raes_contracts.contracts.artifact_transformations.ArtifactTransformationStatus¶
Bases:
str,Enum- SUCCESS = 'success'¶
- REFUSED = 'refused'¶
- __new__(value)¶
Planning¶
Shared runtime planning contracts and safe planned-resource readers.
Backend and provisioner implementations should use the named
planned_* accessors in this module instead of traversing a
PlannedResource payload directly. The accessors are total, perform no
validation or normalization, and return None when a requested surface is
missing or does not apply to the resource’s domain and type.
- class raes_contracts.planning.ChangeAction¶
Bases:
str,EnumPlanner reconciliation result for a resource.
- CREATE = 'create'¶
- UPDATE = 'update'¶
- DELETE = 'delete'¶
- UNCHANGED = 'unchanged'¶
- __new__(value)¶
- class raes_contracts.planning.EvaluationOp¶
Bases:
PlanOperationEvaluation reconciliation operation.
- class raes_contracts.planning.EvaluationPlan¶
Bases:
objectResolved evaluation graph and reconciliation actions.
- resources: dict[str, PlannedResource]¶
- operations: list[EvaluationOp]¶
- startup_order: list[str]¶
- diagnostics: list[Diagnostic]¶
- observation_demands: tuple[EffectiveObservationDemand, ...] = ()¶
- run_id: str | None = None¶
- instantiation_id: str | None = None¶
- property actionable_operations: list[EvaluationOp]¶
- __init__(resources=<factory>, operations=<factory>, startup_order=<factory>, diagnostics=<factory>, observation_demands=(), run_id=None, instantiation_id=None)¶
- Parameters:
resources (dict[str, PlannedResource])
operations (list[EvaluationOp])
startup_order (list[str])
diagnostics (list[Diagnostic])
observation_demands (tuple[EffectiveObservationDemand, ...])
run_id (str | None)
instantiation_id (str | None)
- Return type:
None
- class raes_contracts.planning.OrchestrationOp¶
Bases:
PlanOperationOrchestration reconciliation operation.
- class raes_contracts.planning.OrchestrationPlan¶
Bases:
objectResolved orchestration graph and reconciliation actions.
- resources: dict[str, PlannedResource]¶
- operations: list[OrchestrationOp]¶
- startup_order: list[str]¶
- diagnostics: list[Diagnostic]¶
- observation_demands: tuple[EffectiveObservationDemand, ...] = ()¶
- property actionable_operations: list[OrchestrationOp]¶
- __init__(resources=<factory>, operations=<factory>, startup_order=<factory>, diagnostics=<factory>, observation_demands=())¶
- Parameters:
resources (dict[str, PlannedResource])
operations (list[OrchestrationOp])
startup_order (list[str])
diagnostics (list[Diagnostic])
observation_demands (tuple[EffectiveObservationDemand, ...])
- Return type:
None
- class raes_contracts.planning.PlanOperation¶
Bases:
objectA reconciliation operation for a planned resource.
- action: ChangeAction¶
- address: str¶
- resource_type: str¶
- payload: dict[str, Any]¶
- ordering_dependencies: tuple[str, ...] = ()¶
- refresh_dependencies: tuple[str, ...] = ()¶
- __init__(action, address, resource_type, payload, ordering_dependencies=(), refresh_dependencies=())¶
- Parameters:
action (ChangeAction)
address (str)
resource_type (str)
payload (dict[str, Any])
ordering_dependencies (tuple[str, ...])
refresh_dependencies (tuple[str, ...])
- Return type:
None
- class raes_contracts.planning.PlanScope¶
Bases:
objectIdentity of the realization a plan is computed for.
target_nameselects the backend target the plan is reconciled against, whilerun_idnames the authoritative run scope (run:<id>authority) andinstantiation_idnames the unique instantiation coordinate; together the run/instantiation pair lets per-run / per-instantiation generated values reconcile against the correct scope (issue #1276). Both identifiers are value-free scope identities, never the generated secret. Bundling the three keeps the planning entry points cohesive rather than threading loose optional identifiers through every signature.- target_name: str | None = None¶
- run_id: str | None = None¶
- instantiation_id: str | None = None¶
- __init__(target_name=None, run_id=None, instantiation_id=None)¶
- Parameters:
target_name (str | None)
run_id (str | None)
instantiation_id (str | None)
- Return type:
None
- class raes_contracts.planning.PlannedResource¶
Bases:
objectNormalized resource used by the planner and snapshot.
- address: str¶
- domain: RuntimeDomain¶
- resource_type: str¶
- payload: dict[str, Any]¶
- ordering_dependencies: tuple[str, ...] = ()¶
- refresh_dependencies: tuple[str, ...] = ()¶
- profile_bindings: tuple[DomainProfileBindingModel, ...] = ()¶
- __init__(address, domain, resource_type, payload, ordering_dependencies=(), refresh_dependencies=(), profile_bindings=())¶
- Parameters:
address (str)
domain (RuntimeDomain)
resource_type (str)
payload (dict[str, Any])
ordering_dependencies (tuple[str, ...])
refresh_dependencies (tuple[str, ...])
profile_bindings (tuple[DomainProfileBindingModel, ...])
- Return type:
None
- class raes_contracts.planning.ProvisionOp¶
Bases:
PlanOperationProvisioning reconciliation operation.
- profile_bindings: tuple[DomainProfileBindingModel, ...] = ()¶
- __init__(action, address, resource_type, payload, ordering_dependencies=(), refresh_dependencies=(), profile_bindings=())¶
- Parameters:
action (ChangeAction)
address (str)
resource_type (str)
payload (dict[str, Any])
ordering_dependencies (tuple[str, ...])
refresh_dependencies (tuple[str, ...])
profile_bindings (tuple[DomainProfileBindingModel, ...])
- Return type:
None
- class raes_contracts.planning.ProvisioningPlan¶
Bases:
objectProvisioning plan over canonical deployment resources.
- resources: dict[str, PlannedResource]¶
- operations: list[ProvisionOp]¶
- diagnostics: list[Diagnostic]¶
- realization_authority: tuple[ResolvedRealizationAuthority, ...] = ()¶
- realization_envelope: RealizationEnvelopeIdentityModel | None = None¶
- realization_constraints: tuple[PlannedRealizationConstraint, ...] = ()¶
- operation_id: str | None = None¶
- observation_demands: tuple[EffectiveObservationDemand, ...] = ()¶
- preparation: RealizationPreparationAuthority | None = None¶
- profile_authority: PlanProfileAuthority | None = None¶
- run_id: str | None = None¶
- instantiation_id: str | None = None¶
- property actionable_operations: list[ProvisionOp]¶
- __init__(resources=<factory>, operations=<factory>, diagnostics=<factory>, realization_authority=(), realization_envelope=None, realization_constraints=(), operation_id=None, observation_demands=(), preparation=None, profile_authority=None, run_id=None, instantiation_id=None)¶
- Parameters:
resources (dict[str, PlannedResource])
operations (list[ProvisionOp])
diagnostics (list[Diagnostic])
realization_authority (tuple[ResolvedRealizationAuthority, ...])
realization_envelope (RealizationEnvelopeIdentityModel | None)
realization_constraints (tuple[PlannedRealizationConstraint, ...])
operation_id (str | None)
observation_demands (tuple[EffectiveObservationDemand, ...])
preparation (RealizationPreparationAuthority | None)
profile_authority (PlanProfileAuthority | None)
run_id (str | None)
instantiation_id (str | None)
- Return type:
None
- class raes_contracts.planning.RealizationAuthorityBound¶
Bases:
objectOne publication-safe typed bound over a concern value or owned leaf.
- value_pointer: str¶
- domain: Annotated[ExactDomain | EnumDomain | BooleanDomain | NumericIntervalDomain | GovernedReferenceDomain | RecordDomain, FieldInfo(annotation=NoneType, required=True, discriminator='kind')]¶
- identity_digest: str | None = None¶
- __init__(value_pointer, domain, identity_digest=None)¶
- Parameters:
value_pointer (str)
domain (Annotated[ExactDomain | EnumDomain | BooleanDomain | NumericIntervalDomain | GovernedReferenceDomain | RecordDomain, FieldInfo(annotation=NoneType, required=True, discriminator='kind')])
identity_digest (str | None)
- Return type:
None
- class raes_contracts.planning.RealizationAuthorityMode¶
Bases:
str,EnumResolved author permission for one portable realization concern.
- CLOSED = 'closed'¶
- OPEN = 'open'¶
- CONSTRAINED = 'constrained'¶
- EXACT = 'exact'¶
- __new__(value)¶
- class raes_contracts.planning.RealizationResolutionSource¶
Bases:
str,EnumCanonical source that supplied a resolved realization decision.
- AUTHORED_LEAF = 'authored-leaf'¶
- AUTHORED_SCOPE = 'authored-scope'¶
- APPARATUS_DEFAULT = 'apparatus-default'¶
- LEGACY_DEFAULT = 'legacy-default'¶
- PROCESSOR_DERIVED = 'processor-derived'¶
- __new__(value)¶
- class raes_contracts.planning.ResolvedRealizationAuthority¶
Bases:
objectPortable, value-safe author boundary for one planned concern.
- address: str¶
- field_path: str¶
- domain: str¶
- requirement_kind: str¶
- payload_pointer: str¶
- source: RealizationResolutionSource¶
- provenance: ExplicitnessProvenance = 'author-declared'¶
- governing_scope: str | None = None¶
- bounds: tuple[RealizationAuthorityBound, ...] = ()¶
- verification_scope: RealizationVerificationScope | None = None¶
- required_observation_strength: ObservationStrength | None = None¶
- structure: Annotated[ExactRealizationValue | OpenRealizationValue | RealizationRecord | RealizationCollection, FieldInfo(annotation=NoneType, required=True, discriminator='kind')] | None = None¶
- constraint_document: RealizationConstraintDocument | None = None¶
- constraint_binding: str | None = None¶
- __init__(address, field_path, domain, requirement_kind, payload_pointer, mode, source, provenance=ExplicitnessProvenance.AUTHOR_DECLARED, governing_scope=None, bounds=(), verification_scope=None, required_observation_strength=None, structure=None, constraint_document=None, constraint_binding=None)¶
- Parameters:
address (str)
field_path (str)
domain (str)
requirement_kind (str)
payload_pointer (str)
mode (RealizationAuthorityMode)
source (RealizationResolutionSource)
provenance (ExplicitnessProvenance)
governing_scope (str | None)
bounds (tuple[RealizationAuthorityBound, ...])
verification_scope (RealizationVerificationScope | None)
required_observation_strength (ObservationStrength | None)
structure (Annotated[ExactRealizationValue | OpenRealizationValue | RealizationRecord | RealizationCollection, FieldInfo(annotation=NoneType, required=True, discriminator='kind')] | None)
constraint_document (RealizationConstraintDocument | None)
constraint_binding (str | None)
- Return type:
None
- class raes_contracts.planning.RuntimeDomain¶
Bases:
str,EnumTop-level runtime concern.
- PROVISIONING = 'provisioning'¶
- ORCHESTRATION = 'orchestration'¶
- EVALUATION = 'evaluation'¶
- PARTICIPANT = 'participant'¶
- __new__(value)¶
- raes_contracts.planning.planned_infrastructure_spec(resource)¶
Return
spec.infrastructurefor a provisioning node or network.Infrastructure is intentionally unavailable for other provisioning resource types and for other runtime domains rather than being inferred from a coincidentally similar payload shape.
- Parameters:
resource (PlannedResource)
- Return type:
Mapping[str, Any] | None
- raes_contracts.planning.planned_node_resources(resource)¶
Return a provisioning node’s authored resources mapping, if present.
- Parameters:
resource (PlannedResource)
- Return type:
Mapping[str, Any] | None
- raes_contracts.planning.planned_node_source(resource)¶
Return a provisioning node’s authored string-or-mapping source.
Mapping sources retain all source/build inputs and are not collapsed to a backend-specific image name. Empty strings and unsupported value shapes are treated as absent.
- Parameters:
resource (PlannedResource)
- Return type:
str | Mapping[str, Any] | None
- raes_contracts.planning.planned_node_spec(resource)¶
Return
spec.nodefor a provisioning node, otherwiseNone.- Parameters:
resource (PlannedResource)
- Return type:
Mapping[str, Any] | None
- raes_contracts.planning.planned_resource_authored_name(resource)¶
Return the authored top-level resource name, if one is available.
- Parameters:
resource (PlannedResource)
- Return type:
str | None
- raes_contracts.planning.planned_resource_name(resource)¶
Return the authored resource name or its full canonical address.
The address is a stable, provider-neutral fallback. Backends that require provider-safe native names remain responsible for deriving those names from the address.
- Parameters:
resource (PlannedResource)
- Return type:
str
- raes_contracts.planning.planned_resource_payload(resource)¶
Return the resource’s mapping payload, or
Nonewhen it is malformed.The original mapping is returned without copying or mutation. This reader is domain-neutral; callers should use the narrower provisioning readers below for fields whose meaning depends on a runtime domain or resource type.
- Parameters:
resource (PlannedResource)
- Return type:
Mapping[str, Any] | None
- raes_contracts.planning.planned_realization_authority(plan, address, requirement_kind)¶
Return one resolved authority entry, or
Nonewhen not present.- Parameters:
plan (ProvisioningPlan)
address (str)
requirement_kind (str)
- Return type:
ResolvedRealizationAuthority | None
- raes_contracts.planning.require_plan_operation_identity(domain, address, resource_type)¶
Reject operations outside a plan endpoint’s closed identity domain.
- Parameters:
domain (RuntimeDomain)
address (object)
resource_type (object)
- Return type:
None
Runtime State¶
Shared runtime state and control-plane result contracts.
- class raes_contracts.runtime_state.ApplyResult¶
Bases:
objectResult of applying or starting a runtime plan.
- success: bool¶
- snapshot: RuntimeSnapshot¶
- diagnostics: list[Diagnostic]¶
- changed_addresses: list[str]¶
- details: dict[str, Any]¶
- operational_realization_observations: tuple[RealizationObservationDisclosure, ...] = ()¶
- __init__(success, snapshot, diagnostics=<factory>, changed_addresses=<factory>, details=<factory>, operational_realization_observations=())¶
- Parameters:
success (bool)
snapshot (RuntimeSnapshot)
diagnostics (list[Diagnostic])
changed_addresses (list[str])
details (dict[str, Any])
operational_realization_observations (tuple[RealizationObservationDisclosure, ...])
- Return type:
None
- class raes_contracts.runtime_state.ExplicitnessClass¶
Bases:
str,EnumSEM-218 author-intent class for a declaration.
- EXACT = 'exact'¶
- CONSTRAINED = 'constrained'¶
- OPEN = 'open'¶
- __new__(value)¶
- class raes_contracts.runtime_state.ExplicitnessProvenance¶
Bases:
str,EnumWhere the classified value came from in the SDL lifecycle.
- AUTHOR_DECLARED = 'author-declared'¶
- PROCESSOR_DERIVED = 'processor-derived'¶
- BACKEND_REALIZED = 'backend-realized'¶
- __new__(value)¶
- class raes_contracts.runtime_state.OperationReceipt¶
Bases:
objectPortable acknowledgment for an accepted control-plane operation.
- operation_id: str¶
- domain: RuntimeDomain¶
- submitted_at: str¶
- accepted: bool¶
- context: OperationAdmissionContext¶
- schema_version: str = 'runtime-operation/v1'¶
- diagnostics: list[Diagnostic]¶
- __init__(operation_id, domain, submitted_at, accepted, context, schema_version='runtime-operation/v1', diagnostics=<factory>)¶
- Parameters:
operation_id (str)
domain (RuntimeDomain)
submitted_at (str)
accepted (bool)
context (OperationAdmissionContext)
schema_version (str)
diagnostics (list[Diagnostic])
- Return type:
None
- class raes_contracts.runtime_state.OperationAdmissionContext¶
Bases:
ContractModelImmutable, value-free authority and request context fixed at admission.
- model_config = {'extra': 'forbid', 'frozen': True}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- actor_id: _ContextString¶
- authorization_scope: tuple[_ContextString, ...]¶
- target_scope: _ContextString¶
- run_scope: _ContextString¶
- operation_kind: OperationKind¶
- request_commitment: _RequestCommitment¶
- parent_operation_id: _ContextString | None¶
- class raes_contracts.runtime_state.OperationKind¶
Bases:
str,EnumClosed kinds of work admitted by the runtime control plane.
- PROVISIONING = 'provisioning'¶
- ORCHESTRATION = 'orchestration'¶
- EVALUATION = 'evaluation'¶
- WORKFLOW_CANCELLATION = 'workflow-cancellation'¶
- WORKFLOW_TIMEOUT_RECONCILIATION = 'workflow-timeout-reconciliation'¶
- PARTICIPANT_ACTION = 'participant-action'¶
- PARTICIPANT_CONTROL = 'participant-control'¶
- PARTICIPANT_CROSSING = 'participant-crossing'¶
- __new__(value)¶
- class raes_contracts.runtime_state.OperationState¶
Bases:
str,EnumLifecycle for async control-plane operations.
- ACCEPTED = 'accepted'¶
- RUNNING = 'running'¶
- SUCCEEDED = 'succeeded'¶
- FAILED = 'failed'¶
- CANCELLED = 'cancelled'¶
- INDETERMINATE = 'indeterminate'¶
- __new__(value)¶
- class raes_contracts.runtime_state.OperationStatus¶
Bases:
objectPortable status for a submitted control-plane operation.
- operation_id: str¶
- domain: RuntimeDomain¶
- state: OperationState¶
- submitted_at: str¶
- updated_at: str¶
- context: OperationAdmissionContext¶
- schema_version: str = 'runtime-operation/v1'¶
- diagnostics: list[Diagnostic]¶
- changed_addresses: list[str]¶
- __init__(operation_id, domain, state, submitted_at, updated_at, context, schema_version='runtime-operation/v1', diagnostics=<factory>, changed_addresses=<factory>)¶
- Parameters:
operation_id (str)
domain (RuntimeDomain)
state (OperationState)
submitted_at (str)
updated_at (str)
context (OperationAdmissionContext)
schema_version (str)
diagnostics (list[Diagnostic])
changed_addresses (list[str])
- Return type:
None
- class raes_contracts.runtime_state.RealizationObservationDisclosure¶
Bases:
objectCorroboration metadata for one realized inventory concern.
Most concern disclosures remain value-free.
compute-substrateis a deliberately non-sensitive governed exception: its independently observed mechanism is needed to distinguish authored demand from actual selection.- address: str¶
- field_path: str¶
- domain: str¶
- requirement_kind: str¶
- verification_scope: RealizationVerificationScope¶
- observation_strength: ObservationStrength¶
- observed_value: str | None = None¶
- operating_system: ObservedOperatingSystemIdentity | None = None¶
- operation_id: str | None = None¶
- envelope_digest: str | None = None¶
- configuration_digest: str | None = None¶
- observer_version: str | None = None¶
- sequence: int | None = None¶
- binding_verified: bool = False¶
- __init__(address, field_path, domain, requirement_kind, verification_scope, observation_strength, observed_value=None, operating_system=None, operation_id=None, envelope_digest=None, configuration_digest=None, observer_version=None, sequence=None, binding_verified=False)¶
- Parameters:
address (str)
field_path (str)
domain (str)
requirement_kind (str)
verification_scope (RealizationVerificationScope)
observation_strength (ObservationStrength)
observed_value (str | None)
operating_system (ObservedOperatingSystemIdentity | None)
operation_id (str | None)
envelope_digest (str | None)
configuration_digest (str | None)
observer_version (str | None)
sequence (int | None)
binding_verified (bool)
- Return type:
None
- class raes_contracts.runtime_state.RealizationProvenanceEntry¶
Bases:
objectSEM-218 provenance for one realized realization concern (invariant I5).
Records, for a single realization concern that entered a runtime snapshot / result / history surface, its SEM-218 explicitness class and the origin of the realized value:
author-declared(honoured exactly as the author wrote it),processor-derived(produced by deterministic processor activity), orbackend-realized(picked by the backend from an open or constrained surface admitted by I3). It carries field-path and kind references only — never the realized value itself, which may carry sensitive material (SEM-218 host-exposure gate).- address: str¶
- field_path: str¶
- domain: str¶
- requirement_kind: str¶
- explicitness: ExplicitnessClass¶
- provenance: ExplicitnessProvenance¶
- governing_scope: str | None = None¶
- artifact_satisfaction: ArtifactSatisfactionDisclosureModel | None = None¶
- __init__(address, field_path, domain, requirement_kind, explicitness, provenance, governing_scope=None, artifact_satisfaction=None)¶
- Parameters:
address (str)
field_path (str)
domain (str)
requirement_kind (str)
explicitness (ExplicitnessClass)
provenance (ExplicitnessProvenance)
governing_scope (str | None)
artifact_satisfaction (ArtifactSatisfactionDisclosureModel | None)
- Return type:
None
- class raes_contracts.runtime_state.RuntimeSnapshot¶
Bases:
objectCurrent runtime snapshot.
- entries: dict[str, SnapshotEntry]¶
- orchestration_results: dict[str, dict[str, Any]]¶
- orchestration_history: dict[str, list[dict[str, Any]]]¶
- evaluation_results: dict[str, dict[str, Any]]¶
- evaluation_history: dict[str, list[dict[str, Any]]]¶
- proposition_truth_results: dict[str, dict[str, Any]]¶
- participant_episode_results: dict[str, dict[str, Any]]¶
- participant_episode_history: dict[str, list[dict[str, Any]]]¶
- participant_episode_closure_records: dict[str, list[dict[str, Any]]]¶
- participant_behavior_history: dict[str, list[dict[str, Any]]]¶
- participant_control_history: dict[str, list[dict[str, Any]]]¶
- participant_crossing_history: dict[str, list[dict[str, Any]]]¶
- information_state_history: dict[str, list[dict[str, Any]]]¶
- participant_autonomous_execution_states: dict[str, dict[str, Any]]¶
- participant_execution_services: dict[str, dict[str, Any]]¶
- participant_resource_budget_states: dict[str, dict[str, Any]]¶
- participant_resource_pool_states: dict[str, dict[str, Any]]¶
- participant_resource_budget_events: dict[str, dict[str, Any]]¶
- shared_state_records: dict[str, dict[str, Any]]¶
- shared_state_history: dict[str, list[dict[str, Any]]]¶
- joint_action_records: dict[str, dict[str, Any]]¶
- time_management_contexts: dict[str, dict[str, Any]]¶
- time_model_state: TimeRuntimeStateModel | None = None¶
- realization_provenance: tuple[RealizationProvenanceEntry, ...] = ()¶
- realization_observations: tuple[RealizationObservationDisclosure, ...] = ()¶
- realization_envelope: RealizationEnvelopeIdentityModel | None = None¶
- metadata: dict[str, Any]¶
- get(address)¶
- Parameters:
address (str)
- Return type:
SnapshotEntry | None
- for_domain(domain)¶
- Parameters:
domain (RuntimeDomain)
- Return type:
dict[str, SnapshotEntry]
- with_entries(entries, **updates)¶
- Parameters:
entries (dict[str, SnapshotEntry])
updates (object)
- Return type:
- __init__(entries=<factory>, orchestration_results=<factory>, orchestration_history=<factory>, evaluation_results=<factory>, evaluation_history=<factory>, proposition_truth_results=<factory>, participant_episode_results=<factory>, participant_episode_history=<factory>, participant_episode_closure_records=<factory>, participant_behavior_history=<factory>, participant_control_history=<factory>, participant_crossing_history=<factory>, information_state_history=<factory>, participant_autonomous_execution_states=<factory>, participant_execution_services=<factory>, participant_resource_budget_states=<factory>, participant_resource_pool_states=<factory>, participant_resource_budget_events=<factory>, shared_state_records=<factory>, shared_state_history=<factory>, joint_action_records=<factory>, time_management_contexts=<factory>, time_model_state=None, realization_provenance=(), realization_observations=(), realization_envelope=None, metadata=<factory>)¶
- Parameters:
entries (dict[str, SnapshotEntry])
orchestration_results (dict[str, dict[str, Any]])
orchestration_history (dict[str, list[dict[str, Any]]])
evaluation_results (dict[str, dict[str, Any]])
evaluation_history (dict[str, list[dict[str, Any]]])
proposition_truth_results (dict[str, dict[str, Any]])
participant_episode_results (dict[str, dict[str, Any]])
participant_episode_history (dict[str, list[dict[str, Any]]])
participant_episode_closure_records (dict[str, list[dict[str, Any]]])
participant_behavior_history (dict[str, list[dict[str, Any]]])
participant_control_history (dict[str, list[dict[str, Any]]])
participant_crossing_history (dict[str, list[dict[str, Any]]])
information_state_history (dict[str, list[dict[str, Any]]])
participant_autonomous_execution_states (dict[str, dict[str, Any]])
participant_execution_services (dict[str, dict[str, Any]])
participant_resource_budget_states (dict[str, dict[str, Any]])
participant_resource_pool_states (dict[str, dict[str, Any]])
participant_resource_budget_events (dict[str, dict[str, Any]])
shared_state_records (dict[str, dict[str, Any]])
shared_state_history (dict[str, list[dict[str, Any]]])
joint_action_records (dict[str, dict[str, Any]])
time_management_contexts (dict[str, dict[str, Any]])
time_model_state (TimeRuntimeStateModel | None)
realization_provenance (tuple[RealizationProvenanceEntry, ...])
realization_observations (tuple[RealizationObservationDisclosure, ...])
realization_envelope (RealizationEnvelopeIdentityModel | None)
metadata (dict[str, Any])
- Return type:
None
- class raes_contracts.runtime_state.RuntimeSnapshotEnvelope¶
Bases:
objectPortable envelope around the current runtime snapshot.
- schema_version: str = 'runtime-snapshot/v1'¶
- snapshot: RuntimeSnapshot¶
- __init__(schema_version='runtime-snapshot/v1', snapshot=<factory>)¶
- Parameters:
schema_version (str)
snapshot (RuntimeSnapshot)
- Return type:
None
- class raes_contracts.runtime_state.SnapshotEntry¶
Bases:
objectRecorded runtime state for a single canonical resource.
- address: str¶
- domain: RuntimeDomain¶
- resource_type: str¶
- payload: dict[str, Any]¶
- ordering_dependencies: tuple[str, ...] = ()¶
- refresh_dependencies: tuple[str, ...] = ()¶
- status: str = 'ready'¶
- profile_bindings: tuple[DomainProfileBindingModel, ...] = ()¶
- __init__(address, domain, resource_type, payload, ordering_dependencies=(), refresh_dependencies=(), status='ready', profile_bindings=())¶
- Parameters:
address (str)
domain (RuntimeDomain)
resource_type (str)
payload (dict[str, Any])
ordering_dependencies (tuple[str, ...])
refresh_dependencies (tuple[str, ...])
status (str)
profile_bindings (tuple[DomainProfileBindingModel, ...])
- Return type:
None
- raes_contracts.runtime_state.is_operation_transition_allowed(source, target)¶
Return whether the closed ADR-104 persisted transition is legal.
- Parameters:
source (OperationState)
target (OperationState)
- Return type:
bool
- raes_contracts.runtime_state.operation_terminal_diagnostic(state)¶
Return the stable diagnostic for a non-success terminal classification.
- Parameters:
state (OperationState)
- Return type:
- raes_contracts.runtime_state.operation_terminal_diagnostics(state, diagnostics)¶
Return diagnostics with exactly one canonical terminal classification.
- Parameters:
state (OperationState)
diagnostics (list[Diagnostic])
- Return type:
list[Diagnostic]
- raes_contracts.runtime_state.operation_transition_diagnostic(source, target)¶
Return the stable value-free diagnostic for an illegal transition.
- Parameters:
source (OperationState)
target (OperationState)
- Return type:
Workflow Results¶
Shared workflow runtime result contracts.
- class raes_contracts.workflow.WorkflowCancellationRequest¶
Bases:
objectPortable request for cancelling one workflow run.
- workflow_address: str¶
- run_id: str | None = None¶
- reason: str = 'cancelled by operator'¶
- __init__(workflow_address, run_id=None, reason='cancelled by operator')¶
- Parameters:
workflow_address (str)
run_id (str | None)
reason (str)
- Return type:
None
- class raes_contracts.workflow.WorkflowCompensationStatus¶
Bases:
str,EnumPortable workflow compensation status.
- NOT_REQUIRED = 'not_required'¶
- PENDING = 'pending'¶
- RUNNING = 'running'¶
- SUCCEEDED = 'succeeded'¶
- FAILED = 'failed'¶
- __new__(value)¶
- class raes_contracts.workflow.WorkflowExecutionContract¶
Bases:
objectCompiled contract for validating workflow-level execution state/history.
- state_schema_version: str = 'workflow-step-state/v1'¶
- start_step: str = ''¶
- timeout_seconds: int | None = None¶
- steps: dict[str, WorkflowStepSemanticContract]¶
- step_types: dict[str, str]¶
- control_edges: dict[str, tuple[str, ...]]¶
- join_owners: dict[str, str]¶
- call_steps: dict[str, str]¶
- compensation_mode: str = 'disabled'¶
- compensation_triggers: tuple[str, ...] = ()¶
- compensation_targets: dict[str, str]¶
- compensation_ordering: str = 'reverse_completion'¶
- compensation_failure_policy: str = 'fail_workflow'¶
- observable_steps: tuple[str, ...] = ()¶
- classmethod from_mapping(payload)¶
- Parameters:
payload (Mapping[str, Any])
- Return type:
- __init__(state_schema_version='workflow-step-state/v1', start_step='', timeout_seconds=None, steps=<factory>, step_types=<factory>, control_edges=<factory>, join_owners=<factory>, call_steps=<factory>, compensation_mode='disabled', compensation_triggers=(), compensation_targets=<factory>, compensation_ordering='reverse_completion', compensation_failure_policy='fail_workflow', observable_steps=())¶
- Parameters:
state_schema_version (str)
start_step (str)
timeout_seconds (int | None)
steps (dict[str, WorkflowStepSemanticContract])
step_types (dict[str, str])
control_edges (dict[str, tuple[str, ...]])
join_owners (dict[str, str])
call_steps (dict[str, str])
compensation_mode (str)
compensation_triggers (tuple[str, ...])
compensation_targets (dict[str, str])
compensation_ordering (str)
compensation_failure_policy (str)
observable_steps (tuple[str, ...])
- Return type:
None
- class raes_contracts.workflow.WorkflowExecutionState¶
Bases:
objectInternal normalized workflow result envelope.
- state_schema_version: str = 'workflow-step-state/v1'¶
- workflow_status: WorkflowStatus = 'pending'¶
- run_id: str = ''¶
- started_at: str = ''¶
- updated_at: str = ''¶
- terminal_reason: str | None = None¶
- compensation_status: WorkflowCompensationStatus = 'not_required'¶
- compensation_started_at: str | None = None¶
- compensation_updated_at: str | None = None¶
- compensation_failures: list[dict[str, Any]]¶
- steps: dict[str, WorkflowStepExecutionState]¶
- classmethod from_payload(payload)¶
- Parameters:
payload (Mapping[str, Any])
- Return type:
- to_payload()¶
- Return type:
dict[str, Any]
- __init__(state_schema_version='workflow-step-state/v1', workflow_status=WorkflowStatus.PENDING, run_id='', started_at='', updated_at='', terminal_reason=None, compensation_status=WorkflowCompensationStatus.NOT_REQUIRED, compensation_started_at=None, compensation_updated_at=None, compensation_failures=<factory>, steps=<factory>)¶
- Parameters:
state_schema_version (str)
workflow_status (WorkflowStatus)
run_id (str)
started_at (str)
updated_at (str)
terminal_reason (str | None)
compensation_status (WorkflowCompensationStatus)
compensation_started_at (str | None)
compensation_updated_at (str | None)
compensation_failures (list[dict[str, Any]])
steps (dict[str, WorkflowStepExecutionState])
- Return type:
None
- class raes_contracts.workflow.WorkflowHistoryEvent¶
Bases:
objectInternal normalized workflow history event.
- event_type: WorkflowHistoryEventType¶
- timestamp: str¶
- step_name: str | None = None¶
- branch_name: str | None = None¶
- join_step: str | None = None¶
- outcome: WorkflowStepOutcome | None = None¶
- details: dict[str, Any]¶
- classmethod from_payload(payload)¶
- Parameters:
payload (Mapping[str, Any])
- Return type:
- to_payload()¶
- Return type:
dict[str, Any]
- __init__(event_type, timestamp, step_name=None, branch_name=None, join_step=None, outcome=None, details=<factory>)¶
- Parameters:
event_type (WorkflowHistoryEventType)
timestamp (str)
step_name (str | None)
branch_name (str | None)
join_step (str | None)
outcome (WorkflowStepOutcome | None)
details (dict[str, Any])
- Return type:
None
- class raes_contracts.workflow.WorkflowHistoryEventType¶
Bases:
str,EnumPortable workflow history event kinds.
- WORKFLOW_STARTED = 'workflow_started'¶
- STEP_STARTED = 'step_started'¶
- STEP_COMPLETED = 'step_completed'¶
- SWITCH_CASE_SELECTED = 'switch_case_selected'¶
- CALL_STARTED = 'call_started'¶
- CALL_COMPLETED = 'call_completed'¶
- BRANCH_ENTERED = 'branch_entered'¶
- BRANCH_CONVERGED = 'branch_converged'¶
- WORKFLOW_COMPLETED = 'workflow_completed'¶
- WORKFLOW_FAILED = 'workflow_failed'¶
- WORKFLOW_CANCELLED = 'workflow_cancelled'¶
- WORKFLOW_TIMED_OUT = 'workflow_timed_out'¶
- COMPENSATION_REGISTERED = 'compensation_registered'¶
- COMPENSATION_STARTED = 'compensation_started'¶
- COMPENSATION_WORKFLOW_STARTED = 'compensation_workflow_started'¶
- COMPENSATION_WORKFLOW_COMPLETED = 'compensation_workflow_completed'¶
- COMPENSATION_WORKFLOW_FAILED = 'compensation_workflow_failed'¶
- COMPENSATION_COMPLETED = 'compensation_completed'¶
- COMPENSATION_FAILED = 'compensation_failed'¶
- __new__(value)¶
- class raes_contracts.workflow.WorkflowResultContract¶
Bases:
objectCompiled contract for validating portable workflow result envelopes.
- state_schema_version: str = 'workflow-step-state/v1'¶
- observable_steps: dict[str, WorkflowStepSemanticContract]¶
- classmethod from_mapping(payload)¶
- Parameters:
payload (Mapping[str, Any])
- Return type:
- __init__(state_schema_version='workflow-step-state/v1', observable_steps=<factory>)¶
- Parameters:
state_schema_version (str)
observable_steps (dict[str, WorkflowStepSemanticContract])
- Return type:
None
- class raes_contracts.workflow.WorkflowStatus¶
Bases:
str,EnumPortable workflow-level execution status.
- PENDING = 'pending'¶
- RUNNING = 'running'¶
- SUCCEEDED = 'succeeded'¶
- FAILED = 'failed'¶
- CANCELLED = 'cancelled'¶
- TIMED_OUT = 'timed_out'¶
- __new__(value)¶
- class raes_contracts.workflow.WorkflowStepExecutionState¶
Bases:
objectInternal normalized execution state for one workflow-visible step.
- lifecycle: WorkflowStepLifecycle = 'pending'¶
- outcome: WorkflowStepOutcome | None = None¶
- attempts: int = 0¶
- attempt_provenance: tuple[WorkflowStepAttemptProvenance, ...] = ()¶
- classmethod from_payload(payload)¶
- Parameters:
payload (Mapping[str, Any])
- Return type:
- to_payload()¶
- Return type:
dict[str, Any]
- __init__(lifecycle=WorkflowStepLifecycle.PENDING, outcome=None, attempts=0, attempt_provenance=())¶
- Parameters:
lifecycle (WorkflowStepLifecycle)
outcome (WorkflowStepOutcome | None)
attempts (int)
attempt_provenance (tuple[WorkflowStepAttemptProvenance, ...])
- Return type:
None
- class raes_contracts.workflow.WorkflowStepAttemptProvenance¶
Bases:
objectPortable provenance for one governed workflow-step realization attempt.
- step_name: str¶
- execution_mode: str¶
- attempt_id: str¶
- objective_address: str = ''¶
- procedure_ref: str = ''¶
- exposed_scaffold_refs: tuple[str, ...] = ()¶
- allowed_action_families: tuple[str, ...] = ()¶
- selected_action_family: str = ''¶
- selected_tool_ref: str = ''¶
- selected_affordance_ref: str = ''¶
- fact_versions: tuple[str, ...] = ()¶
- outcome: str = ''¶
- evidence_refs: tuple[str, ...] = ()¶
- assertion_truth_refs: tuple[str, ...] = ()¶
- participant_report: str = ''¶
- classmethod from_payload(payload)¶
- Parameters:
payload (Mapping[str, Any])
- Return type:
- to_payload()¶
- Return type:
dict[str, Any]
- __init__(step_name, execution_mode, attempt_id, objective_address='', procedure_ref='', exposed_scaffold_refs=(), allowed_action_families=(), selected_action_family='', selected_tool_ref='', selected_affordance_ref='', fact_versions=(), outcome='', evidence_refs=(), assertion_truth_refs=(), participant_report='')¶
- Parameters:
step_name (str)
execution_mode (str)
attempt_id (str)
objective_address (str)
procedure_ref (str)
exposed_scaffold_refs (tuple[str, ...])
allowed_action_families (tuple[str, ...])
selected_action_family (str)
selected_tool_ref (str)
selected_affordance_ref (str)
fact_versions (tuple[str, ...])
outcome (str)
evidence_refs (tuple[str, ...])
assertion_truth_refs (tuple[str, ...])
participant_report (str)
- Return type:
None
- class raes_contracts.workflow.WorkflowStepLifecycle¶
Bases:
str,EnumPortable execution lifecycle for workflow-visible step state.
- PENDING = 'pending'¶
- RUNNING = 'running'¶
- COMPLETED = 'completed'¶
- __new__(value)¶
- class raes_contracts.workflow.WorkflowStepOutcome¶
Bases:
str,EnumPortable execution outcomes for workflow-visible step state.
- SUCCEEDED = 'succeeded'¶
- FAILED = 'failed'¶
- EXHAUSTED = 'exhausted'¶
- __new__(value)¶
- raes_contracts.workflow.validate_workflow_step_result_contract(contract, *, lifecycle, outcome, attempts)¶
Validate a backend-reported workflow step result against a compiled contract.
- Parameters:
contract (WorkflowStepSemanticContract)
lifecycle (str)
outcome (str | None)
attempts (int)
- Return type:
tuple[str, …]
Evaluation Results¶
Shared evaluation runtime result contracts.
- class raes_contracts.evaluation.EvaluationExecutionContract¶
Bases:
objectCompiled contract for validating evaluator history/state transitions.
- state_schema_version: str = 'evaluation-result-state/v1'¶
- resource_type: str = ''¶
- allowed_statuses: tuple[str, ...] = ('pending', 'running', 'ready', 'failed')¶
- history_event_types: tuple[str, ...] = ('evaluation_started', 'evaluation_updated', 'evaluation_ready', 'evaluation_failed')¶
- requires_start_event: bool = True¶
- classmethod from_mapping(payload)¶
- Parameters:
payload (Mapping[str, Any])
- Return type:
- __init__(state_schema_version='evaluation-result-state/v1', resource_type='', allowed_statuses=('pending', 'running', 'ready', 'failed'), history_event_types=('evaluation_started', 'evaluation_updated', 'evaluation_ready', 'evaluation_failed'), requires_start_event=True)¶
- Parameters:
state_schema_version (str)
resource_type (str)
allowed_statuses (tuple[str, ...])
history_event_types (tuple[str, ...])
requires_start_event (bool)
- Return type:
None
- class raes_contracts.evaluation.EvaluationExecutionState¶
Bases:
objectInternal normalized execution state for one evaluator-observable resource.
- state_schema_version: str = 'evaluation-result-state/v1'¶
- resource_type: str = ''¶
- run_id: str = ''¶
- status: EvaluationResultStatus = 'pending'¶
- observed_at: str = ''¶
- updated_at: str = ''¶
- passed: bool | None = None¶
- score: float | int | None = None¶
- max_score: int | None = None¶
- detail: str | None = None¶
- evidence_refs: tuple[str, ...] = ()¶
- classmethod from_payload(payload)¶
- Parameters:
payload (Mapping[str, Any])
- Return type:
- to_payload()¶
- Return type:
dict[str, Any]
- __init__(state_schema_version='evaluation-result-state/v1', resource_type='', run_id='', status=EvaluationResultStatus.PENDING, observed_at='', updated_at='', passed=None, score=None, max_score=None, detail=None, evidence_refs=())¶
- Parameters:
state_schema_version (str)
resource_type (str)
run_id (str)
status (EvaluationResultStatus)
observed_at (str)
updated_at (str)
passed (bool | None)
score (float | int | None)
max_score (int | None)
detail (str | None)
evidence_refs (tuple[str, ...])
- Return type:
None
- class raes_contracts.evaluation.EvaluationHistoryEvent¶
Bases:
objectInternal normalized evaluator history event.
- event_type: EvaluationHistoryEventType¶
- timestamp: str¶
- status: EvaluationResultStatus¶
- passed: bool | None = None¶
- score: float | int | None = None¶
- max_score: int | None = None¶
- detail: str | None = None¶
- evidence_refs: tuple[str, ...] = ()¶
- details: dict[str, Any]¶
- classmethod from_payload(payload)¶
- Parameters:
payload (Mapping[str, Any])
- Return type:
- to_payload()¶
- Return type:
dict[str, Any]
- __init__(event_type, timestamp, status, passed=None, score=None, max_score=None, detail=None, evidence_refs=(), details=<factory>)¶
- Parameters:
event_type (EvaluationHistoryEventType)
timestamp (str)
status (EvaluationResultStatus)
passed (bool | None)
score (float | int | None)
max_score (int | None)
detail (str | None)
evidence_refs (tuple[str, ...])
details (dict[str, Any])
- Return type:
None
- class raes_contracts.evaluation.EvaluationHistoryEventType¶
Bases:
str,EnumPortable evaluator history event kinds.
- EVALUATION_STARTED = 'evaluation_started'¶
- EVALUATION_UPDATED = 'evaluation_updated'¶
- EVALUATION_READY = 'evaluation_ready'¶
- EVALUATION_FAILED = 'evaluation_failed'¶
- __new__(value)¶
- class raes_contracts.evaluation.EvaluationResultContract¶
Bases:
objectCompiled contract for validating evaluator result envelopes.
- state_schema_version: str = 'evaluation-result-state/v1'¶
- resource_type: str = ''¶
- supports_passed: bool = False¶
- supports_score: bool = False¶
- fixed_max_score: int | None = None¶
- classmethod from_mapping(payload)¶
- Parameters:
payload (Mapping[str, Any])
- Return type:
- __init__(state_schema_version='evaluation-result-state/v1', resource_type='', supports_passed=False, supports_score=False, fixed_max_score=None)¶
- Parameters:
state_schema_version (str)
resource_type (str)
supports_passed (bool)
supports_score (bool)
fixed_max_score (int | None)
- Return type:
None
- class raes_contracts.evaluation.EvaluationResultStatus¶
Bases:
str,EnumPortable lifecycle for evaluator-observable results.
- PENDING = 'pending'¶
- RUNNING = 'running'¶
- READY = 'ready'¶
- FAILED = 'failed'¶
- __new__(value)¶
- raes_contracts.evaluation.validate_evaluation_result(contract, state)¶
Return contract violations for one evaluator result envelope.
- Parameters:
contract (EvaluationResultContract)
state (EvaluationExecutionState)
- Return type:
list[str]
Participant Episodes¶
Shared participant episode runtime contracts.
- class raes_contracts.participant_episode.ParticipantEpisodeControlAction¶
Bases:
str,Enum- INITIALIZE = 'initialize'¶
- RESET = 'reset'¶
- RESTART = 'restart'¶
- __new__(value)¶
- class raes_contracts.participant_episode.ParticipantEpisodeExecutionState¶
Bases:
objectInternal normalized participant-episode execution state envelope.
- state_schema_version: str = 'participant-episode-state/v1'¶
- participant_address: str = ''¶
- episode_id: str = ''¶
- sequence_number: int = 0¶
- status: ParticipantEpisodeStatus = 'initializing'¶
- terminal_reason: ParticipantEpisodeTerminalReason | None = None¶
- initialized_at: str = ''¶
- updated_at: str = ''¶
- terminated_at: str | None = None¶
- last_control_action: ParticipantEpisodeControlAction = 'initialize'¶
- previous_episode_id: str | None = None¶
- classmethod from_payload(payload)¶
- Parameters:
payload (Mapping[str, Any])
- Return type:
- to_payload()¶
- Return type:
dict[str, Any]
- __init__(state_schema_version='participant-episode-state/v1', participant_address='', episode_id='', sequence_number=0, status=ParticipantEpisodeStatus.INITIALIZING, terminal_reason=None, initialized_at='', updated_at='', terminated_at=None, last_control_action=ParticipantEpisodeControlAction.INITIALIZE, previous_episode_id=None)¶
- Parameters:
state_schema_version (str)
participant_address (str)
episode_id (str)
sequence_number (int)
status (ParticipantEpisodeStatus)
terminal_reason (ParticipantEpisodeTerminalReason | None)
initialized_at (str)
updated_at (str)
terminated_at (str | None)
last_control_action (ParticipantEpisodeControlAction)
previous_episode_id (str | None)
- Return type:
None
- class raes_contracts.participant_episode.ParticipantEpisodeHistoryEvent¶
Bases:
objectInternal normalized participant-episode history event.
- event_type: ParticipantEpisodeHistoryEventType¶
- timestamp: str¶
- participant_address: str¶
- episode_id: str¶
- sequence_number: int¶
- terminal_reason: ParticipantEpisodeTerminalReason | None = None¶
- control_action: ParticipantEpisodeControlAction | None = None¶
- details: dict[str, Any]¶
- classmethod from_payload(payload)¶
- Parameters:
payload (Mapping[str, Any])
- Return type:
- to_payload()¶
- Return type:
dict[str, Any]
- __init__(event_type, timestamp, participant_address, episode_id, sequence_number, terminal_reason=None, control_action=None, details=<factory>)¶
- Parameters:
event_type (ParticipantEpisodeHistoryEventType)
timestamp (str)
participant_address (str)
episode_id (str)
sequence_number (int)
terminal_reason (ParticipantEpisodeTerminalReason | None)
control_action (ParticipantEpisodeControlAction | None)
details (dict[str, Any])
- Return type:
None
- class raes_contracts.participant_episode.ParticipantEpisodeHistoryEventType¶
Bases:
str,Enum- EPISODE_INITIALIZED = 'episode_initialized'¶
- EPISODE_RUNNING = 'episode_running'¶
- EPISODE_COMPLETED = 'episode_completed'¶
- EPISODE_TIMED_OUT = 'episode_timed_out'¶
- EPISODE_TRUNCATED = 'episode_truncated'¶
- EPISODE_INTERRUPTED = 'episode_interrupted'¶
- EPISODE_RESET = 'episode_reset'¶
- EPISODE_RESTARTED = 'episode_restarted'¶
- __new__(value)¶
- class raes_contracts.participant_episode.ParticipantEpisodeInitializeRequest¶
Bases:
objectPortable request for initializing the first episode of a participant.
- participant_address: str¶
- episode_id: str | None = None¶
- __init__(participant_address, episode_id=None)¶
- Parameters:
participant_address (str)
episode_id (str | None)
- Return type:
None
- class raes_contracts.participant_episode.ParticipantEpisodeResetRequest¶
Bases:
objectPortable request for resetting a non-terminal participant episode.
- participant_address: str¶
- episode_id: str | None = None¶
- reason: str = 'reset by operator'¶
- __init__(participant_address, episode_id=None, reason='reset by operator')¶
- Parameters:
participant_address (str)
episode_id (str | None)
reason (str)
- Return type:
None
- class raes_contracts.participant_episode.ParticipantEpisodeRestartRequest¶
Bases:
objectPortable request for restarting a terminated participant episode.
- participant_address: str¶
- episode_id: str | None = None¶
- reason: str = 'restarted by operator'¶
- __init__(participant_address, episode_id=None, reason='restarted by operator')¶
- Parameters:
participant_address (str)
episode_id (str | None)
reason (str)
- Return type:
None
- class raes_contracts.participant_episode.ParticipantEpisodeStatus¶
Bases:
str,Enum- INITIALIZING = 'initializing'¶
- RUNNING = 'running'¶
- TERMINATED = 'terminated'¶
- __new__(value)¶
- class raes_contracts.participant_episode.ParticipantEpisodeTerminalReason¶
Bases:
str,Enum- COMPLETED = 'completed'¶
- TIMED_OUT = 'timed_out'¶
- TRUNCATED = 'truncated'¶
- INTERRUPTED = 'interrupted'¶
- __new__(value)¶
- class raes_contracts.participant_episode.ParticipantEpisodeTerminateRequest¶
Bases:
objectPortable request for driving the current episode to
TERMINATED.- participant_address: str¶
- terminal_reason: ParticipantEpisodeTerminalReason = 'interrupted'¶
- detail: str = 'terminated by operator'¶
- __init__(participant_address, terminal_reason=ParticipantEpisodeTerminalReason.INTERRUPTED, detail='terminated by operator')¶
- Parameters:
participant_address (str)
terminal_reason (ParticipantEpisodeTerminalReason)
detail (str)
- Return type:
None
- raes_contracts.participant_episode.iter_participant_episode_snapshot_violations(participant_episode_results, participant_episode_history)¶
- Parameters:
participant_episode_results (object)
participant_episode_history (object)
- Return type:
Iterator[tuple[str, str]]
Participant Implementation Manifests¶
ParticipantImplementationManifestModel and
ParticipantImplementationProvenanceModel live in
raes_contracts.contracts with the other published contract models. The
manifest declares participant implementation identity, capabilities,
compatibility, decision-surface modes, tool-affordance expectations, and
constraints. The provenance record preserves the participant implementation,
selected manifest, selected configuration reference, participant contract
versions, and decision-surface exposure policy used in a run.