Problem
Sessions are fully isolated. Architectural decisions, naming conventions, or context established in session A are invisible in session B. There is no persistent project-level knowledge base.
Design
New module: src/memory/ with:
memory.lex — CRUD over a .lex/memory.db SQLite store
remember(key: Str, value: Str, tags: List[Str]) -> Unit
recall(query: Str) -> List[MemoryEntry] — fuzzy match on key/tags/value
forget(key: Str) -> Unit
New tools: memory_write, memory_read, memory_search
These should be available to build, refactor, explore, and plan agents.
The memory store is per-project (rooted at the .lex/ directory), not global.
Stretch goal
Tag entries with SigIds so memory entries stay valid after refactors (a SigId-linked memory entry that refers to a deleted function can be flagged as stale).
Acceptance
- Memory persists across
lex-code invocations in the same project directory
lex check --strict src/ passes
- Tests in
tests/test_memory.lex
Problem
Sessions are fully isolated. Architectural decisions, naming conventions, or context established in session A are invisible in session B. There is no persistent project-level knowledge base.
Design
New module:
src/memory/with:memory.lex— CRUD over a.lex/memory.dbSQLite storeremember(key: Str, value: Str, tags: List[Str]) -> Unitrecall(query: Str) -> List[MemoryEntry]— fuzzy match on key/tags/valueforget(key: Str) -> UnitNew tools:
memory_write,memory_read,memory_searchThese should be available to build, refactor, explore, and plan agents.
The memory store is per-project (rooted at the
.lex/directory), not global.Stretch goal
Tag entries with SigIds so memory entries stay valid after refactors (a SigId-linked memory entry that refers to a deleted function can be flagged as stale).
Acceptance
lex-codeinvocations in the same project directorylex check --strict src/passestests/test_memory.lex