Skip to content

Interface: StepExecutionContext<THandle> ​

Defined in: ports/step-execution-context.ts:12

Extended step execution context combining ExecutionContext<THandle> with RuntimeExecutorRegistry.

Supplied to step executors, tool drivers, checks, policy guards, tripwires, and hooks so they can dispatch nested AST nodes via ctx.registry.

Extends ​

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.

Inherited from ​

ExecutionContext.getRunner


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

Inherited from ​

ExecutionContext.recordEffects


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.

Inherited from ​

ExecutionContext.resolveEnv

Properties ​

PropertyModifierTypeDescriptionInherited fromDefined in
activeLeasesreadonlyreadonly LeaseDelta[]Capability lease deltas currently granted to the active actor or loop.ExecutionContext.activeLeasesports/execution-context.ts:41
activePartitionsreadonlyreadonly string[]Partition identifiers unlocked for the active step.ExecutionContext.activePartitionsports/execution-context.ts:39
activeServiceSessions?readonlyReadonlyMap<string, ServiceSession<THandle>>Optional map of active background daemon service sessions keyed by service ID.ExecutionContext.activeServiceSessionsports/execution-context.ts:37
candidateHandles?readonlyReadonlyMap<number, THandle>Optional map of surviving speculative candidate branch indices to their live scope handles.ExecutionContext.candidateHandlesports/execution-context.ts:35
observedEffectsreadonlyreadonly ToolEffect[]Tool effects observed so far within the active step execution.ExecutionContext.observedEffectsports/execution-context.ts:43
registryreadonlyRuntimeExecutorRegistryComposite registry of stateless AST node executors and driver factories.-ports/step-execution-context.ts:14
resumeContinuationStack?readonlyreadonly ContinuationFrame[]Optional continuation frame stack used when resuming a suspended or interrupted step.ExecutionContext.resumeContinuationStackports/execution-context.ts:49
runIdreadonlystringUnique identifier of the enclosing harness run.ExecutionContext.runIdports/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.ExecutionContext.scopeports/execution-context.ts:30
scopeHandlereadonlyTHandleActive isolation scope handle for the current step or branch.ExecutionContext.scopeHandleports/execution-context.ts:26
scopeNode?readonlyIsolationScopeASTNode<THandle, Record<string, unknown>, Record<string, unknown>>Optional passive AST node of the active isolation scope.ExecutionContext.scopeNodeports/execution-context.ts:28
seededHistory?readonlyreadonly WireFrameRecord[]Optional pre-seeded wire transcript frames inherited from a parent or aborted fast-path attempt.ExecutionContext.seededHistoryports/execution-context.ts:47
signal?readonlyAbortSignalOptional cancellation signal for aborting in-flight operations.ExecutionContext.signalports/execution-context.ts:45
stepExecIdreadonlystringUnique execution identifier of the active step invocation.ExecutionContext.stepExecIdports/execution-context.ts:24

Released under the MIT License.