memory / projects.py — ProjectStore

Multi-session project & task store. SQLite-only; no ORM. Designed for cross-process access from API, Slack bot, dream consolidator.

Storage

SQLite at memory_dir/projects.db; threading.RLock; PRAGMA foreign_keys=ON.

Tables

projects

ColumnType / values
idTEXT PK (12-char hex)
title / kind / goal / statusTEXT (kind ∈ CODING/GENERAL · status ∈ ACTIVE/PAUSED/DONE/ARCHIVED)
workspace_dirTEXT
metadata_jsonTEXT
created_at / updated_atREAL

tasks

ColumnNotes
id, project_id, parent_idFKs (parent_id NULL = root).
descriptionTEXT.
statusPENDING / IN_PROGRESS / DONE / BLOCKED.
dependency_typeALL / ANY (BEST not persisted).
alternatives_json / postconditions_jsonlist[str].
result_summary / failure_reason / actual_tool_usedTEXT.
revision_count, estimated_cost, actual_cost, depth, positionnumeric.

task_artifacts

id · task_id · project_id · kind ∈ {file, url, note, tool_call} · payload · created_at.

project_events

id (auto PK) · project_id · task_id · type · payload_json · ts (REAL).

Public API

Projects

Tasks

Artifacts & events

No automatic eviction; archiving via status='ARCHIVED' preserves history. Hard delete cascades via FK ON DELETE CASCADE.