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 Parameter | Default type | Description |
|---|---|---|
THandle | unknown | Runtime scope handle type. |
TReceipt extends Record<string, unknown> | Record<string, unknown> | Validated scope inspection receipt shape. |
Methods
acquireRoot()
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
| Parameter | Type | Description |
|---|---|---|
runId | string | Unique identifier of the flow run. |
Returns
Promise<THandle>
Newly acquired root scope handle.
inspect()
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
| Parameter | Type | Description |
|---|---|---|
handle | THandle | Active scope handle to inspect. |
Returns
Promise<TReceipt>
Validated inspection receipt.
reattachRoot()
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
| Parameter | Type | Description |
|---|---|---|
runId | string | Unique identifier of the recovering flow run. |
checkpoint? | string | Optional persisted baseScopeCheckpoint fallback. |
Returns
Promise<THandle>
Reattached root scope handle.
release()
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
| Parameter | Type | Description |
|---|---|---|
handle | THandle | Scope handle to release. |
Returns
Promise<void>
Resolves once all resources for handle are released.
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
id | readonly | string | Unique identifier of the isolation scope driver. | ports/isolation-scope.ts:17 |
receiptSchema | readonly | ZodType<TReceipt> | Zod schema validating receipts returned by inspect(). | ports/isolation-scope.ts:19 |