Graphorin API reference v0.7.0
Graphorin API reference / @graphorin/core / / CheckpointStoreExt
Interface: CheckpointStoreExt
Defined in: packages/core/src/contracts/checkpoint-store.ts:235
Retention extension over CheckpointStore (W-009). The engine intentionally never deletes finished threads itself - a completed thread is still needed for inspection and duplicate-resume refusal; how long to keep it is an operator decision. These primitives are what an operator (or a host scheduler) drives.
Additive: third-party CheckpointStore implementations compile unchanged; hosts feature-detect with 'pruneThreads' in store.
Stable
Extends
Methods
compactThread()
compactThread(
threadId,
namespace,
keepLast): Promise<number>;Defined in: packages/core/src/contracts/checkpoint-store.ts:255
Keep only the keepLast most recent checkpoints (by stepNumber) of one (threadId, namespace) pair, deleting older ones together with their pending writes. keepLast >= 1; resume works from the latest tuple, so compaction never breaks resumability - it does remove time-travel/fork targets. Returns the number of checkpoints deleted.
Parameters
| Parameter | Type |
|---|---|
threadId | string |
namespace | string |
keepLast | number |
Returns
Promise<number>
deleteThread()
deleteThread(threadId): Promise<void>;Defined in: packages/core/src/contracts/checkpoint-store.ts:184
Full erasure primitive: delete every checkpoint and pending write of this thread across ALL namespaces. Namespace-blind by contract - retention sweeps must use CheckpointStoreExt.pruneThreads instead, which is namespace-scoped and protects suspended threads.
Parameters
| Parameter | Type |
|---|---|
threadId | string |
Returns
Promise<void>
Inherited from
getTuple()
getTuple(
threadId,
namespace,
checkpointId?): Promise<
| CheckpointTuple
| null>;Defined in: packages/core/src/contracts/checkpoint-store.ts:170
Parameters
| Parameter | Type |
|---|---|
threadId | string |
namespace | string |
checkpointId? | string |
Returns
Promise< | CheckpointTuple | null>
Inherited from
list()
list(
threadId,
namespace,
opts?): AsyncIterable<CheckpointTuple>;Defined in: packages/core/src/contracts/checkpoint-store.ts:176
Parameters
| Parameter | Type |
|---|---|
threadId | string |
namespace | string |
opts? | ListOptions |
Returns
AsyncIterable<CheckpointTuple>
Inherited from
listSuspended()?
optional listSuspended(namespace, opts?): Promise<readonly {
threadId: string;
wakeAt: number;
}[]>;Defined in: packages/core/src/contracts/checkpoint-store.ts:195
W-032: enumerate threads whose LATEST checkpoint in namespace is suspended with a due wakeAt (<= opts.dueBefore, default: any stamped wakeAt). This is what a durable-timer driver polls - without it an operator would have to keep an external registry of sleeping threadIds. OPTIONAL so third-party stores compile unchanged; createTimerDriver throws a typed error when the store lacks it (deterministic policy, no silent no-op).
Parameters
| Parameter | Type |
|---|---|
namespace | string |
opts? | { dueBefore?: number; limit?: number; } |
opts.dueBefore? | number |
opts.limit? | number |
Returns
Promise<readonly { threadId: string; wakeAt: number; }[]>
Inherited from
pruneThreads()
pruneThreads(opts): Promise<number>;Defined in: packages/core/src/contracts/checkpoint-store.ts:245
Namespace-scoped retention sweep: for every (threadId, namespace) pair matching the policy, delete that pair's checkpoints and pending writes - and ONLY that pair's. Never implemented via CheckpointStore.deleteThread (namespace-blind): with a reused threadId, pruning a terminal thread of workflow A must not erase the suspended checkpoints of workflow B. Returns the number of pairs pruned.
Parameters
| Parameter | Type |
|---|---|
opts | PruneThreadsOptions |
Returns
Promise<number>
put()
put(
threadId,
namespace,
checkpoint,
metadata,
opts?): Promise<string>;Defined in: packages/core/src/contracts/checkpoint-store.ts:154
Parameters
| Parameter | Type |
|---|---|
threadId | string |
namespace | string |
checkpoint | Checkpoint |
metadata | CheckpointMetadata |
opts? | CheckpointPutOptions |
Returns
Promise<string>
Inherited from
putWrites()
putWrites(
threadId,
namespace,
checkpointId,
writes,
taskId): Promise<void>;Defined in: packages/core/src/contracts/checkpoint-store.ts:162
Parameters
| Parameter | Type |
|---|---|
threadId | string |
namespace | string |
checkpointId | string |
writes | readonly PendingWrite[] |
taskId | string |
Returns
Promise<void>