Rulvar API reference / @rulvar/core / SettlementError
Class: SettlementError
Defined in: packages/core/src/l0/errors.ts:405
The segment computed its outcome but a settlement write failed with a NON-fencing store error, so nothing durable records that the run settled. handle.result rejects with this instead of resolving, because a caller acting on an unrecorded outcome is exactly the split view an authoritative store exists to prevent. stage names the write that failed: 'run-settle' is the journal decision entry (when it fails the terminal meta write is SKIPPED, so the projection can never run ahead of the journal), 'meta' is the terminal RunMeta projection (the journal settle IS durable; only the projection is behind, the same residue a crash between the two writes leaves). Every entry the run appended before settlement is already durable, so recovery is deterministic: resume the run and replay re-settles the same outcome without a provider call, or reconcile the store with rulvar runs audit [--repair]. A superseded segment's fencing rejection of the settle append (LeaseHeldError) is NOT this error: it rejects with the typed SupersededError (RV1009), while a meta-only lease bounce over an already durable settle stays swallowed (the journal records the outcome; only the projection belongs to the current holder). data records { runId, runStatus, stage }.
Extends
Constructors
Constructor
new SettlementError(message, opts): SettlementError;Defined in: packages/core/src/l0/errors.ts:413
Parameters
| Parameter | Type |
|---|---|
message | string |
opts | { cause?: unknown; runId: string; runStatus: string; stage: "run-settle" | "meta"; } |
opts.cause? | unknown |
opts.runId | string |
opts.runStatus | string |
opts.stage | "run-settle" | "meta" |
Returns
SettlementError
Overrides
Properties
| Property | Modifier | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
code | readonly | "settlement" | - | RulvarError.code | - | packages/core/src/l0/errors.ts:406 |
data? | readonly | Json | - | - | RulvarError.data | packages/core/src/l0/errors.ts:64 |
retryable | readonly | boolean | - | - | RulvarError.retryable | packages/core/src/l0/errors.ts:63 |
runId | readonly | string | - | - | - | packages/core/src/l0/errors.ts:409 |
runStatus | readonly | string | The outcome status the segment computed and could not record. | - | - | packages/core/src/l0/errors.ts:411 |
stage | readonly | "run-settle" | "meta" | The settlement write that failed first. | - | - | packages/core/src/l0/errors.ts:408 |
Methods
toWire()
toWire(): WireError;Defined in: packages/core/src/l0/errors.ts:75