Skip to content

Interface: ExecutionContext<THandle> ​

Defined in: ports/execution-context.ts:20

Step-level execution context carrying isolation scope handles, leases, observed effects, and environment resolution.

Passed to step executors, checks, policy guards, tripwires, and hooks during flow execution.

Extended by ​

Type Parameters ​

Type ParameterDefault typeDescription
THandleunknownRuntime handle type of the active isolation scope.

Methods ​

getRunner() ​

ts
getRunner(node): RunnerDriver;

Defined in: ports/execution-context.ts:71

Returns the runtime's memoized RunnerDriver instance keyed by node.id.

Instantiates the runner driver on first access via RuntimeExecutorRegistry.runners[node.type] and caches it per node.id.

Parameters ​

ParameterTypeDescription
nodeNodeRunnerNodePassive runner pool AST node.

Returns ​

RunnerDriver

Memoized runner driver instance.


recordEffects() ​

ts
recordEffects(effects): void;

Defined in: ports/execution-context.ts:80

Appends newly observed tool effects to the active step's effect log and telemetry collector.

Triggers incremental quota tripwire checks and records effect attributes for step telemetry folding.

Parameters ​

ParameterTypeDescription
effectsreadonly ToolEffect[]Tool effects emitted by a tool execution or post-flight diff.

Returns ​

void


resolveEnv() ​

ts
resolveEnv(value): string | undefined;

Defined in: ports/execution-context.ts:60

Resolves a literal string or symbolic P.env(key) reference against the runtime environment map.

Returns literal strings unchanged and looks up EnvRef.key in the explicit runtime env record.

Parameters ​

ParameterTypeDescription
valuestring | EnvRefLiteral string or symbolic environment variable reference.

Returns ​

string | undefined

Resolved environment variable value, or undefined if unset.

Properties ​

PropertyModifierTypeDescriptionDefined in
activeLeasesreadonlyreadonly LeaseDelta[]Capability lease deltas currently granted to the active actor or loop.ports/execution-context.ts:41
activePartitionsreadonlyreadonly string[]Partition identifiers unlocked for the active step.ports/execution-context.ts:39
activeServiceSessions?readonlyReadonlyMap<string, ServiceSession<THandle>>Optional map of active background daemon service sessions keyed by service ID.ports/execution-context.ts:37
candidateHandles?readonlyReadonlyMap<number, THandle>Optional map of surviving speculative candidate branch indices to their live scope handles.ports/execution-context.ts:35
observedEffectsreadonlyreadonly ToolEffect[]Tool effects observed so far within the active step execution.ports/execution-context.ts:43
resumeContinuationStack?readonlyreadonly ContinuationFrame[]Optional continuation frame stack used when resuming a suspended or interrupted step.ports/execution-context.ts:49
runIdreadonlystringUnique identifier of the enclosing harness run.ports/execution-context.ts:22
scope?readonly| IsolationScope<THandle, Record<string, unknown>> | CheckpointableScope<THandle, Record<string, unknown>> | BranchableScope<THandle, Record<string, unknown>, Record<string, unknown>>Optional active isolation scope runtime driver instance.ports/execution-context.ts:30
scopeHandlereadonlyTHandleActive isolation scope handle for the current step or branch.ports/execution-context.ts:26
scopeNode?readonlyIsolationScopeASTNode<THandle, Record<string, unknown>, Record<string, unknown>>Optional passive AST node of the active isolation scope.ports/execution-context.ts:28
seededHistory?readonlyreadonly WireFrameRecord[]Optional pre-seeded wire transcript frames inherited from a parent or aborted fast-path attempt.ports/execution-context.ts:47
signal?readonlyAbortSignalOptional cancellation signal for aborting in-flight operations.ports/execution-context.ts:45
stepExecIdreadonlystringUnique execution identifier of the active step invocation.ports/execution-context.ts:24

Released under the MIT License.