Repository navigation
LOU-W5: SQLite store for sessions, checkpoints and approvals - #65
Merged
Merged
Conversation
Adds SqliteStore (new subpath @loushy/build-ai-agent/sqlite, not in the root
barrel): one node:sqlite file implementing SessionStore, CheckpointStore and
ApprovalStore. Versioned schema via PRAGMA user_version with forward
migrations in a transaction, WAL + busy timeout for multi-process sharing,
prepared parameterized statements, opaque JSON payloads so snapshot fields
added by other tickets round-trip, prune({ olderThanMs }), clear errors for
corrupt files / use after close / missing node:sqlite. Shared contract suites
run against the in-memory, file and SQLite implementations. Docs: Stores
section in docs/sessions.md and a README bullet.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
SqliteStorefrom the new subpath@loushy/build-ai-agent/sqlite: onenode:sqlitefile with.sessions,.checkpoints,.approvalsimplementingSessionStore,CheckpointStore,ApprovalStore, plusprune({ olderThanMs })andclose().Why
Durable state only had memory/file/KV implementations (audit: "no DB adapters"). A single SQLite file is durable, transactional and zero-ops for a Node server.
How verified
Merged origin/main (10f2d24) before final verification.
npx tsc --noEmit: oknpm run lint: 0 errors (433 warnings, none from new files)npm run test:coverage: 120/121 files, 1768 tests passed; the one failure (NodeWorkspace.test.ts > caps captured output, LOU-X6) passes in isolation (25 passed) - load flake, not touched herenpm run fallow: no dead-code/dupes findingsnpm run test:types: 10 passed;docs:verify-snippets: 58 snippets type-check;docs:llms:check: okNotes for reviewer
dist/storage/sqlite/indexso the docs-snippetpathsmapping (dist -> src) resolves.@types/nodehere is 20.x (nonode:sqlitetypings), sodriver.tsdeclares a minimal structural interface and loads the module lazily viaprocess.getBuiltinModule; importing the subpath never loadsnode:sqlite.importGraph.test.tsdeny list now includesnode:sqlitefor all entries (and the new entry).node:sqlite, so tests load it through the same loader.resolve()on approvals stampsresolved_at(atomic claim in a transaction) instead of deleting;prune()removes resolved rows. Unresolved approvals are never pruned.src/storage/sqlite/__fixtures__/storeContracts.ts(not shipped in the npm package) and run against in-memory, file and SQLite stores; existing tests untouched.docs/durable-execution.mdon main yet, so the Stores section is indocs/sessions.md.🤖 Generated with Claude Code