Skip to content

rulvar API reference


rulvar API reference / @rulvar/testing / TestEngine

Interface: TestEngine

Defined in: packages/testing/src/test-engine.ts:27

Extends

Properties

PropertyModifierTypeDescriptionInherited fromDefined in
fakepublicFakeAdapterThe adapter instance, for call-level assertions.-packages/testing/src/test-engine.ts:30
storepublicInMemoryStoreThe backing journal store (journal capture for replay-strict tests).-packages/testing/src/test-engine.ts:32
storesreadonly{ journal: JournalStore; transcripts: TranscriptStore; }The engine's configured stores, exposed for shells and hosts (M8 entry amendment: the journal store comes from the engine). Exactly the instances createEngine received, or the defaults it built; no store contract widens through this accessor. With a serialization hook configured these are the HOOKED wrappers, so every reader passes the one policy point (M8-T04).Engine.storespackages/core/dist/index.d.ts
stores.journalpublicJournalStore--packages/core/dist/index.d.ts
stores.transcriptspublicTranscriptStore--packages/core/dist/index.d.ts

Methods

deleteRun()

ts
deleteRun(runId): Promise<void>;

Defined in: packages/core/dist/index.d.ts

Retention (OQ-20 executed at M8-T04): deletes every blob transcripts.list(runId) returns, then the journal; no orphan blobs survive. The caller owns the decision that the run is done.

Parameters

ParameterType
runIdstring

Returns

Promise&lt;void&gt;

Inherited from

Engine.deleteRun


profileCard()

ts
profileCard(names?): string;

Defined in: packages/core/dist/index.d.ts

Renders the registered agent profiles into the shared vocabulary card, optionally filtered to names; the registry itself stays private to the engine (M6-T05 amendment). Unknown names are ignored.

Parameters

ParameterType
names?readonly string[]

Returns

string

Inherited from

Engine.profileCard


pruneRun()

ts
pruneRun(runId): Promise<number>;

Defined in: packages/core/dist/index.d.ts

Checkpoint pruning (OQ-20 executed at M8-T04): deletes checkpoint blobs of ok-terminal attempts that no other entry references; returns the count. Parked, cancelled, escalated, and hanging attempts keep theirs (park/unpark, DEF-5 retention, and dangling redispatch boot from them).

Parameters

ParameterType
runIdstring

Returns

Promise&lt;number&gt;

Inherited from

Engine.pruneRun


resume()

ts
resume<A, R>(
   runId, 
   wf?, 
options?): ResumeHandle<R>;

Defined in: packages/core/dist/index.d.ts

Rebinds a journal to a workflow definition and resumes. Requires wf for in-process workflows; a name mismatch is a typed ConfigError; a body-hash mismatch warns loudly and proceeds (the journal decides replay per content keys). A compiled run resumes WITHOUT wf: the engine rehydrates the persisted source pinned by workflowHash; supplying a compiled wf whose source hash differs from the recorded one is a typed ConfigError (M6-T02).

Type Parameters

Type Parameter
A
R

Parameters

ParameterType
runIdstring
wf?| CompiledWorkflow | Workflow&lt;A, R&gt;
options?ResumeOptions

Returns

ResumeHandle&lt;R&gt;

Inherited from

Engine.resume


run()

ts
run<A, R>(
   wf, 
   args, 
opts?): TestRunHandle<R>;

Defined in: packages/testing/src/test-engine.ts:28

Type Parameters

Type Parameter
A
R

Parameters

ParameterType
wfWorkflow&lt;A, R&gt;
argsA
opts?RunOptions

Returns

TestRunHandle&lt;R&gt;

Overrides

Engine.run