RunCompletionOutcome
L49class RunCompletionOutcome(StrEnum)Caller-authored terminal intent for one Run.
fastsim.api.recording 的公共 Python API;签名从 FastSim 源码直接提取。
源码 src/fastsim/api/recording.pyclass RunCompletionOutcome(StrEnum)Caller-authored terminal intent for one Run.
class FinalizerStatus(StrEnum)Portable outcome reported by one data-consumer finalizer.
class RunLifecycleContractError(RuntimeError)Stable base error for completion/finalizer protocol violations.
class RunCompletionConflictError(RunLifecycleContractError)An idempotency key was reused with different completion content.
class FinalizerRegistrationError(RunLifecycleContractError)A finalizer registration is late, unauthorized, or conflicting.
class FinalizerResultError(RunLifecycleContractError)A finalizer result is early, mismatched, or conflicting.
class RunCompletionRequest(object)Idempotent request to complete the current Run. Plugin identity is intentionally absent. Core replaces caller identity with the scoped identity attached to ``run.lifecycle``.
| 字段 | 类型 | 默认值 |
|---|---|---|
| request_id | str | — |
| outcome | RunCompletionOutcome | str | — |
| reason_code | str | — |
| summary | FrozenDict[str, object] | Mapping[str, object] | field(default_factory=FrozenDict) |
| schema | str | field(default='fastsim-run-completion-request/1', init=False) |
class RunCompletionReceipt(object)Admission result. It never contains another plugin's private summary.
| 字段 | 类型 | 默认值 |
|---|---|---|
| request_id | str | — |
| requester_instance | str | — |
| completion_sequence | int | — |
| won | bool | — |
| winning_instance | str | None | — |
| winning_sequence | int | None | — |
| schema | str | field(default='fastsim-run-completion-receipt/1', init=False) |
class RunCompletionWinner(object)| 字段 | 类型 | 默认值 |
|---|---|---|
| request_id | str | — |
| requester_instance | str | — |
| completion_sequence | int | — |
| outcome | RunCompletionOutcome | str | — |
| reason_code | str | — |
| summary | FrozenDict[str, object] | Mapping[str, object] | — |
| schema | str | field(default='fastsim-run-completion-winner/1', init=False) |
class FinalizerRegistrationRequest(object)| 字段 | 类型 | 默认值 |
|---|---|---|
| finalizer_id | str | — |
| required | bool | — |
| requested_timeout_s | float | — |
| schema | str | field(default='fastsim-plugin-finalizer-registration/1', init=False) |
class FinalizerResult(object)| 字段 | 类型 | 默认值 |
|---|---|---|
| finalizer_id | str | — |
| status | FinalizerStatus | str | — |
| reason_code | str | — |
| summary | FrozenDict[str, object] | Mapping[str, object] | field(default_factory=FrozenDict) |
| output_commit_receipts | tuple[RunOutputCommitReceipt, ...] | () |
| schema | str | field(default='fastsim-plugin-finalizer-result/1', init=False) |
class FinalizerCompletionReceipt(object)| 字段 | 类型 | 默认值 |
|---|---|---|
| finalizer_id | str | — |
| instance | str | — |
| result_sequence | int | — |
| accepted | bool | True |
| schema | str | field(default='fastsim-plugin-finalizer-completion-receipt/1', init=False) |
class FinalizerSnapshot(object)| 字段 | 类型 | 默认值 |
|---|---|---|
| finalizer_id | str | — |
| instance | str | — |
| required | bool | — |
| requested_timeout_s | float | — |
| effective_timeout_s | float | — |
| active | bool | — |
| result | FinalizerResult | None | — |
| schema | str | field(default='fastsim-plugin-finalizer-snapshot/1', init=False) |
class TerminalSemanticCut(object)Terminal fences for each selected globally ordered source. ``observation_sequence`` identifies the active mutually exclusive observation capture lane: legacy snapshot/barrier sequence when no locked explicit demand exists, or channel/barrier ``capture_sequence`` when it does. Consumers must not assume it is always a snapshot sequence.
| 字段 | 类型 | 默认值 |
|---|---|---|
| run_id | str | — |
| record_sequence | int | — |
| lifecycle_sequence | int | — |
| control_audit_sequence | int | — |
| plugin_event_sequence | int | — |
| observation_sequence | int | — |
| media_sequence | int | 0 |
| fluid_audit_sequence | int | 0 |
| render_state_sequence | int | 0 |
| schema | str | field(default='fastsim-terminal-semantic-cut/1', init=False) |
class RunFinalOutcome(object)| 字段 | 类型 | 默认值 |
|---|---|---|
| outcome | RunCompletionOutcome | str | — |
| reason_code | str | — |
| stop_reason | str | — |
| degraded | bool | — |
| source | str | — |
| required_finalizer_failures | tuple[str, ...] | () |
| optional_finalizer_failures | tuple[str, ...] | () |
| schema | str | field(default='fastsim-run-final-outcome/1', init=False) |
class RunCompletionSnapshot(object)| 字段 | 类型 | 默认值 |
|---|---|---|
| state | str | — |
| winner | RunCompletionWinner | None | — |
| finalizers | tuple[FinalizerSnapshot, ...] | — |
| terminal_cut | TerminalSemanticCut | None | — |
| final_outcome | RunFinalOutcome | None | — |
| schema | str | field(default='fastsim-run-completion-snapshot/1', init=False) |
class RunTerminalPolicy(object)Trusted launch policy; never compiled from scenario or plugin config.
| 字段 | 类型 | 默认值 |
|---|---|---|
| global_deadline_s | float | 120.0 |
| per_consumer_cap_s | float | 60.0 |
| cleanup_reserve_s | float | 10.0 |
class ScopedFinalizerHandle(Protocol)Process-local finalizer completion capability.
class ScopedControlAuditSubscription(Protocol)Bounded, revocable subscription to the portable control audit stream.
class ControlAuditService(Protocol)Capability-scoped access to authored and applied control evidence.
class RunLifecycleSubscription(Protocol)Bounded, revocable stream of portable run-lifecycle envelopes.
class RunLifecycleService(Protocol)Scoped lifecycle view plus completion/finalizer admission.
class PluginEventSubscriptionService(Protocol)Bounded, revocable stream of portable plugin-event envelopes.
class EventSubscribeService(Protocol)Topic-filtered event view with optional ordered-history bootstrap.