Skip to content

Interface: IsolationScope<THandle, TReceipt> ​

Defined in: ports/isolation-scope.ts:12

Tier-1 base runtime driver contract for isolated execution scopes (capabilityTier: 'scope').

Manages root handle acquisition, crash-recovery reattachment, side-effect-free inspection, and deterministic resource cleanup without requiring checkpointing or child branching.

Extended by ​

Type Parameters ​

Type ParameterDefault typeDescription
THandleunknownRuntime scope handle type.
TReceipt extends Record<string, unknown>Record<string, unknown>Validated scope inspection receipt shape.

Methods ​

acquireRoot() ​

ts
acquireRoot(runId): Promise<THandle>;

Defined in: ports/isolation-scope.ts:30

Provisions and initializes an isolated root scope handle for runId.

Executes any configured scope setup commands and pins the initial base state for the run.

Parameters ​

ParameterTypeDescription
runIdstringUnique identifier of the flow run.

Returns ​

Promise<THandle>

Newly acquired root scope handle.


inspect() ​

ts
inspect(handle): Promise<TReceipt>;

Defined in: ports/isolation-scope.ts:53

Captures a side-effect-free inspection receipt (TReceipt) for handle.

Validates the returned receipt against receiptSchema before exposing it to .inputFrom() or .evaluate().

Parameters ​

ParameterTypeDescription
handleTHandleActive scope handle to inspect.

Returns ​

Promise<TReceipt>

Validated inspection receipt.


reattachRoot() ​

ts
reattachRoot(runId, checkpoint?): Promise<THandle>;

Defined in: ports/isolation-scope.ts:42

Rebinds an existing root scope handle during process reboot crash recovery.

Restores the handle from persistent disk or remote state and falls back to checkpoint when needed.

Parameters ​

ParameterTypeDescription
runIdstringUnique identifier of the recovering flow run.
checkpoint?stringOptional persisted baseScopeCheckpoint fallback.

Returns ​

Promise<THandle>

Reattached root scope handle.


release() ​

ts
release(handle): Promise<void>;

Defined in: ports/isolation-scope.ts:64

Releases and cleans up an ephemeral root or child scope handle.

Invoked inside finally blocks when a branch, tournament loser, or completed flow run terminates.

Parameters ​

ParameterTypeDescription
handleTHandleScope handle to release.

Returns ​

Promise<void>

Resolves once all resources for handle are released.

Properties ​

PropertyModifierTypeDescriptionDefined in
idreadonlystringUnique identifier of the isolation scope driver.ports/isolation-scope.ts:17
receiptSchemareadonlyZodType<TReceipt>Zod schema validating receipts returned by inspect().ports/isolation-scope.ts:19

Released under the MIT License.