Skip to main content

Module pending_memories

Module pending_memories 

Source
Expand description

GAP-001 (v1.0.82): DAO for the pending_memories table.

Staged persistence with a resumable checkpoint. Lets remember resume from Stage B (embedding) without re-validating Stage A (parse + validate).

Status transitions: validated → embedding_in_progress → embedding_done → committed ↘ abandoned (manual cleanup) ↘ failed (max attempts reached)

Structs§

PendingMemory
Represents an entry in the pending_memories table.

Enums§

PendingStatus
Status enum of a pending entry. Maps 1:1 to the CHECK constraint of the pending_memories table.

Functions§

cleanup_older_than
Removes embedding_in_progress entries older than older_than_secs. Returns the number of entries removed.
find_by_id
Looks up by pending_id.
insert_validated
Inserts a new entry into pending_memories with status validated.
list_by_status
Lists entries by status, ordered by updated_at ascending.
mark_committed
Marks as committed (called after a successful Stage C).
mark_failed
Marks as failed with an error message.
update_to_embedding_done
Updates the status to embedding_done and stores the embedding BLOB.
update_to_embedding_in_progress
Updates the status to embedding_in_progress and increments attempt_count.