Skip to content

Interface: CompactionConfigBuilder ​

Defined in: builders/compaction-config-builder.ts:12

Fluent configurator for ledger wire-frame compaction policies (.compactWhen($c => ...)).

Schedules raw wire-frame pruning for terminal runs based on correlated signals, terminal flow exit states, and failed-run retention windows.

Extends ​

Methods ​

onSignal() ​

ts
onSignal<TSig>(signal, options): CompactionConfigBuilder;

Defined in: builders/compaction-config-builder.ts:25

Registers a signal-driven compaction trigger correlated to a completed run's itemKey.

Schedules raw wire-frame pruning once signal arrives and options.afterGracePeriodHours elapses.

Type Parameters ​

Type ParameterDescription
TSigSignal payload type.

Parameters ​

ParameterTypeDescription
signalMaybeBuilder<SignalNode<TSig>>Target signal AST node or builder.
options{ afterGracePeriodHours: number; correlateBy: (sig) => string; }Correlation mapper and grace period in hours.
options.afterGracePeriodHoursnumber-
options.correlateBy(sig) => string-

Returns ​

CompactionConfigBuilder

New immutable compaction config builder.


onTerminalExit() ​

ts
onTerminalExit(states, options): CompactionConfigBuilder;

Defined in: builders/compaction-config-builder.ts:43

Registers a terminal exit state compaction trigger for completed runs.

Schedules raw wire-frame pruning once a run reaches one of states and options.afterGracePeriodHours elapses.

Parameters ​

ParameterTypeDescription
statesreadonly string[]Terminal flow exit states that arm compaction.
options{ afterGracePeriodHours: number; }Grace period in hours after terminal exit.
options.afterGracePeriodHoursnumber-

Returns ​

CompactionConfigBuilder

New immutable compaction config builder.


retainFailedRunsForDays() ​

ts
retainFailedRunsForDays(days): CompactionConfigBuilder;

Defined in: builders/compaction-config-builder.ts:57

Sets the retention window in days for failed or exhausted runs before raw wire frames are pruned.

Preserves failed run wire frames for post-mortem debugging across days days.

Parameters ​

ParameterTypeDescription
daysnumberPositive retention window in days.

Returns ​

CompactionConfigBuilder

New immutable compaction config builder.


toAST() ​

ts
toAST(): CompactionConfigNode;

Defined in: ast/ast-builder.ts:20

Compiles the current builder configuration into a deeply frozen passive AST node.

Validates required builder invariants at compilation time and returns an immutable plain-object AST representation containing zero execution methods.

Returns ​

CompactionConfigNode

Deeply frozen passive AST node.

Inherited from ​

AstBuilder.toAST

Released under the MIT License.