RunResult
RunResult<
Out> = {lineage:RuntimeLineage;ok:true;value:Out; } | {failures:Failure[];lineage:RuntimeLineage;ok:false; }
Defined in: execution/result.ts:35
Result of executing a plan.
A discriminated union with two variants:
- Success (
ok: true): Contains the output value - Failure (
ok: false): Contains an array of failures
Both variants include lineage for debugging and provenance tracking.
Type Parameters
Section titled “Type Parameters”Out
The output type of the plan
Type Declaration
Section titled “Type Declaration”{ lineage: RuntimeLineage; ok: true; value: Out; }
lineage
Section titled “lineage”lineage:
RuntimeLineage
Execution trace for debugging and provenance
ok:
true
Indicates successful execution
value:
Out
The computed output value
{ failures: Failure[]; lineage: RuntimeLineage; ok: false; }
failures
Section titled “failures”failures:
Failure[]
Array of failures that occurred (usually one, first failure aborts)
lineage
Section titled “lineage”lineage:
RuntimeLineage
Partial execution trace up to the failure point
ok:
false
Indicates failed execution
Example
Section titled “Example”const result = await run(plan, ctx)
if (result.ok) { console.log('Success:', result.value)} else { console.log('Failed:', result.failures)}
// Lineage is always available for debuggingconsole.log('Steps:', result.lineage.nodes.size)