Skip to content

[store] SqliteFactStore — persistent key-value fact backend #124

@dgenio

Description

@dgenio

Context

Split from #41. Implements the SQLite-backed fact store. Simplest of the 4 store types alongside EpisodicStore.

Depends on #40 (FactStore protocol).

Acceptance Criteria

  • SqliteFactStore class in src/contextweaver/store/sqlite_facts.py implementing FactStore protocol
  • Supports all FactStore methods: set(), get(), list_keys()
  • Uses sqlite3 (stdlib) with WAL mode
  • Supports :memory: mode for testing
  • Deterministic key ordering
  • Passes the same test suite as InMemoryFactStore via parameterized fixture
  • Exported from src/contextweaver/store/__init__.py
  • Full type hints, docstrings, from __future__ import annotations
  • Module ≤300 lines

File Paths

  • src/contextweaver/store/sqlite_facts.py (new)
  • src/contextweaver/store/__init__.py (edit — export)
  • tests/test_store_facts.py (edit — parameterize fixture)

Verification

make ci
pytest tests/test_store_facts.py

Parent Issue

Part of #41 (SQLite-backed persistent stores).

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/storeData stores: event log, artifacts, episodic, factscomplexity/simpleStraightforward change, minimal riskenhancementNew feature or requestmilestone/v0.3v0.3 — Production readinesspriority/mediumMedium priority — production readiness

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions