Skip to content

Rulvar API reference


Rulvar API reference / @rulvar/core / terminalEnvelopeOf

Function: terminalEnvelopeOf()

ts
function terminalEnvelopeOf(input): TerminalEnvelope;

Defined in: packages/core/src/engine/terminal-envelope.ts:80

Assembles one terminal envelope (RV1105). settlement present means nothing durable records the terminal: settled reads false, and the optional settledReason: 'superseded' names the fenced-out segment (RV1009); absent means the settle held and settled reads true. The per-model split is detached, so a consumer mutating the envelope never reaches back into the cost report.

provenance: 'journal' marks a copy rebuilt from the journal after the run left its process (RV1209). It is the same producer on purpose: a persisted reader must not assemble a second, subtly different shape, which is the whole point of the arc.

Parameters

ParameterTypeDescription
input{ agentsSpawned: number; configFingerprint?: string; outcome: TerminalOutcomeFacts; provenance?: "journal"; runId: string; settlement?: { settledReason?: "superseded"; }; workflow: string; }-
input.agentsSpawnednumber-
input.configFingerprint?stringThe run's declared config identity (RV3210), echoed onto the envelope (RV3304).
input.outcomeTerminalOutcomeFacts-
input.provenance?"journal"-
input.runIdstring-
input.settlement?{ settledReason?: "superseded"; }-
input.settlement.settledReason?"superseded"-
input.workflowstring-

Returns

TerminalEnvelope