Skip to content

Rulvar API reference


Rulvar API reference / @rulvar/core / LeasableStore

Interface: LeasableStore

Defined in: packages/core/src/l0/spi/store.ts:280

Extends

Extended by

Properties

PropertyModifierTypeDescriptionInherited fromDefined in
fencedWrites?readonlytrueFenced writes capability (the fenced run state RFC, phase 2), optional exactly like getMeta and leaseTtlMs: a store declaring fencedWrites: true PROMISES that every mutation carrying a lease (append, putMeta, delete) verifies it is the CURRENT holder for the run the mutation targets, atomically with the mutation itself, and rejects with the typed LeaseHeldError leaving nothing mutated when it is not (stale epoch, foreign owner, expired, or a lease whose runId is not the mutation's run). The engine threads the segment's lease into every one of these writes on a leased resume, so over a declaring store a superseded worker cannot overwrite run meta or delete run state, exactly as it already cannot append. A mutation carrying NO lease keeps the single-writer semantics unchanged. Stores written before this capability are unaffected: without the marker the extra argument is ignored and hosts know the surface is advisory.JournalStore.fencedWritespackages/core/src/l0/spi/store.ts:228
leaseTtlMs?readonlynumberOptional TTL introspection (v1.35.0 review P2-4): the configured lease ttl in milliseconds. A store exposing it lets createWorker VERIFY at construction that the worker's renew cadence matches the store's expiry instead of trusting two config sources to agree; stores without it are accepted with the worker's own ttl.-packages/core/src/l0/spi/store.ts:291

Methods

acquire()

ts
acquire(runId, owner): Promise<Lease>;

Defined in: packages/core/src/l0/spi/store.ts:281

Parameters

ParameterType
runIdstring
ownerstring

Returns

Promise&lt;Lease&gt;


append()

ts
append(
   runId, 
   e, 
lease?): Promise<void>;

Defined in: packages/core/src/l0/spi/store.ts:206

Parameters

ParameterType
runIdstring
eJournalEntry
lease?Lease

Returns

Promise&lt;void&gt;

Inherited from

JournalStore.append


delete()

ts
delete(runId, lease?): Promise<void>;

Defined in: packages/core/src/l0/spi/store.ts:210

Parameters

ParameterType
runIdstring
lease?Lease

Returns

Promise&lt;void&gt;

Inherited from

JournalStore.delete


listRuns()

ts
listRuns(f?): Promise<RunMeta[]>;

Defined in: packages/core/src/l0/spi/store.ts:209

Parameters

ParameterType
f?RunFilter

Returns

Promise&lt;RunMeta[]&gt;

Inherited from

JournalStore.listRuns


load()

ts
load(runId): Promise<JournalEntry[]>;

Defined in: packages/core/src/l0/spi/store.ts:207

Parameters

ParameterType
runIdstring

Returns

Promise&lt;JournalEntry[]&gt;

Inherited from

JournalStore.load


putMeta()

ts
putMeta(m, lease?): Promise<void>;

Defined in: packages/core/src/l0/spi/store.ts:208

Parameters

ParameterType
mRunMeta
lease?Lease

Returns

Promise&lt;void&gt;

Inherited from

JournalStore.putMeta


release()

ts
release(l): Promise<void>;

Defined in: packages/core/src/l0/spi/store.ts:283

Parameters

ParameterType
lLease

Returns

Promise&lt;void&gt;


renew()

ts
renew(l): Promise<void>;

Defined in: packages/core/src/l0/spi/store.ts:282

Parameters

ParameterType
lLease

Returns

Promise&lt;void&gt;