Memory
SQLite-backed memory: action_log and memory_summary.
All reads and writes use the stdlib sqlite3 module directly — no ORM,
no mocks. Tests must use a real temp-file or in-memory database.
| CLASS | DESCRIPTION |
|---|---|
MemoryStore |
Persistent action memory backed by a SQLite database. |
Classes¶
MemoryStore
¶
MemoryStore(db_path: Path)
Persistent action memory backed by a SQLite database.
Creates the database file and schema on first use. The connection is kept
open for the lifetime of the instance; call :meth:close (or use as a
context manager) when done.
| PARAMETER | DESCRIPTION |
|---|---|
db_path
|
Filesystem path to the SQLite database file. Intermediate directories are created automatically.
TYPE:
|
| METHOD | DESCRIPTION |
|---|---|
__enter__ |
Return self for use as a context manager. |
__exit__ |
Close the connection on context exit. |
close |
Close the database connection. |
get_last_polled |
Return the last-polled timestamp for repo, or |
get_memory_summary |
Return the stored summary for a (repo, issue_id) pair, or |
log_action |
Append a decision record to |
set_last_polled |
Persist the last-polled timestamp for repo. |
upsert_memory_summary |
Insert or replace the memory summary for a (repo, issue_id) pair. |
Functions¶
get_last_polled
¶
Return the last-polled timestamp for repo, or None if never polled.
| PARAMETER | DESCRIPTION |
|---|---|
repo
|
Repository in
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
datetime | None
|
The stored :class: |
datetime | None
|
|
get_memory_summary
¶
log_action
¶
log_action(repo: str, issue_id: int, task_type: str, decision: DecisionType, rationale: str | None, actions: list[ActionItem]) -> None
Append a decision record to action_log.
| PARAMETER | DESCRIPTION |
|---|---|
repo
|
Repository in
TYPE:
|
issue_id
|
GitHub issue number.
TYPE:
|
task_type
|
Task type string (e.g.
TYPE:
|
decision
|
The agent's decision.
TYPE:
|
rationale
|
Human-readable explanation, or
TYPE:
|
actions
|
Ordered list of actions the harness will execute.
TYPE:
|