Skip to content

store: memory + sqlite backends + --store scheme#26

Merged
fruwe merged 1 commit into
mainfrom
store-backends
Jun 30, 2026
Merged

store: memory + sqlite backends + --store scheme#26
fruwe merged 1 commit into
mainfrom
store-backends

Conversation

@fruwe

@fruwe fruwe commented Jun 30, 2026

Copy link
Copy Markdown
Member

Closes #22.

Implements the memory and SQLite store backends and the --store scheme (SPEC §8/§13.1).

store.py refactor to a small Store interface (abstract load/save) with three
backends behind it:

  • FileStore — the existing JSON-files-in-a-dir store (file:<dir> / bare <dir>).
  • MemoryStore — in-process, ephemeral (mem:); holds the state in memory, isolated per
    process (a run session, §13.7).
  • SqliteStore — single-file persistent DB (sqlite:<path>); sqlite3 is stdlib, no new
    dependency.
  • open_store(spec) parses the scheme (file: / mem: / sqlite:, bare = file).

CLI: --store now selects a backend via open_store; the default is unchanged
(./.harel, file). All backends are behaviorally identical — same CLI results and the same
§8 snapshot JSON (the on-disk/in-memory layout is an implementation detail).

Tests: round-trip an instance through each backend (parity of snapshot JSON); a sqlite:
store persists across CLI invocations; a mem: store is isolated per process but holds state
within one run session; file and sqlite produce identical CLI results. ruff + mypy
clean; 164 tests pass; the cli/03-stepping black-box case still passes.

@fruwe fruwe merged commit 5c5d29a into main Jun 30, 2026
1 check passed
@fruwe fruwe deleted the store-backends branch June 30, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

store: memory + sqlite backends + --store scheme

1 participant