Skip to content

rulvar API reference


rulvar API reference / @rulvar/core / JournalMatcher

Class: JournalMatcher

Defined in: packages/core/src/journal/matching.ts:89

The matching engine over a loaded journal. Consumption is per logical operation (running/terminal pairs count once); candidates are consumed in journal order, first unconsumed match wins (this also resolves cross-version double matches deterministically).

Constructors

Constructor

ts
new JournalMatcher(entries, options?): JournalMatcher;

Defined in: packages/core/src/journal/matching.ts:104

Parameters

ParameterType
entriesreadonly JournalEntry[]
options?{ disposition?: (op) => OperationDisposition; keyRing?: KeyRing; }
options.disposition?(op) => OperationDisposition
options.keyRing?KeyRing

Returns

JournalMatcher

Methods

consume()

ts
consume(runningSeq): void;

Defined in: packages/core/src/journal/matching.ts:291

Marks an operation consumed without matching (fold-driven paths).

Parameters

ParameterType
runningSeqnumber

Returns

void


match()

ts
match(
   scope, 
   identity, 
   mode): MatchResult;

Defined in: packages/core/src/journal/matching.ts:219

Forward-matches one live call. A miss does not advance any cursor and does not extinguish future hits: the scan always starts at the scope head and skips consumed operations, so insertion stability holds by construction.

Parameters

ParameterType
scopestring
identityIdentityInput
mode"scoped" | "cache" | "never"

Returns

MatchResult


registerAlias()

ts
registerAlias(donorPrefix, targetPrefix): void;

Defined in: packages/core/src/journal/matching.ts:160

Registers a scope-prefix rewrite (node.link, DEF-5): donorPrefix maps to targetPrefix for forward-matching purposes; the per-scope cursors work unchanged at every nested level, so partial subtree reuse falls out for free at any depth.

Parameters

ParameterType
donorPrefixstring
targetPrefixstring

Returns

void


report()

ts
report(): ResumeReport;

Defined in: packages/core/src/journal/matching.ts:295

Returns

ResumeReport


setAliasDisposition()

ts
setAliasDisposition(disposition): void;

Defined in: packages/core/src/journal/matching.ts:150

The disposition applied to alias-sourced candidates (DEF-5): the skipped overlay from abandon is bypassed ONLY through the alias, so entries regain their pre-abandon terminal status for matching in the NEW scope; the standalone old scope stays skipped.

Parameters

ParameterType
disposition(op) => OperationDisposition

Returns

void


setDisposition()

ts
setDisposition(disposition): void;

Defined in: packages/core/src/journal/matching.ts:140

M2-T06 swaps in the full DEF-1 predicate after folds are built.

Parameters

ParameterType
disposition(op) => OperationDisposition

Returns

void