Files
openclaw/extensions/memory-core/src/session-backfill-contract.ts
T
Peter Steinberger 53815217e9 fix(memory): session backfill drains and rolls back reversibly (#115926)
* fix(memory): complete reversible session backfill

* refactor(memory): split backfill lifecycle helpers

* fix(memory): break backfill lifecycle import cycle

* fix(memory): keep lifecycle contract exports minimal
2026-07-29 10:48:16 -04:00

41 lines
852 B
TypeScript

export type SessionBackfillDay = {
day: string;
candidateCount: number;
topCandidates: string[];
};
type SessionBackfillBatchProgress = {
batch: number;
days: number;
candidates: number;
stagedEntries: number;
};
export type SessionBackfillResult = {
agentId: string;
workspaceDir: string;
applied: boolean;
rem: boolean;
days: SessionBackfillDay[];
candidateCount: number;
stagedEntries: number;
writtenDiaryEntries: number;
replacedDiaryEntries: number;
batchCount?: number;
batches?: SessionBackfillBatchProgress[];
rollback?: {
removedDiaryEntries: number;
removedStagedEntries: number;
};
};
type SessionBackfillContinuation = {
advanced: boolean;
hasMore: boolean;
};
export type SessionBackfillExecution = {
result: SessionBackfillResult;
continuation: SessionBackfillContinuation;
};