feat(storage): implement SQLite database layer with tests#7
Merged
Conversation
Implement the local persistence layer for document storage with comprehensive test coverage. Architecture: - System of Record pattern: SQLite stores extracted data, decoupled from Vector DB - Repository pattern with dependency injection for testability - Lazy migrations with graceful error handling - XDG_DATA_HOME for cross-platform data directory Implementation: - Drizzle ORM + better-sqlite3 - Extracted functions (ensureDirectoryExists, getDbPath) for testability - Structured logging with @lytics/kero Testing: - 100% statement/function/line coverage, 92.85% branch coverage - Tests use __tests__ directory structure - Mock logger and migrator for clean test output Issue: #2
Clarify commit best practices with emphasis on atomic commits. Changes: - Add 'Atomic Commits (Always)' section emphasizing complete logical units - Clarify that atomic ≠ small, atomic = complete logical unit - Default to single commit for cohesive features (still atomic) - Maintain guidance on when to split commits Rationale: - Atomic commits are always required (complete, reviewable, revertible) - Cohesive features form one atomic unit - Avoid artificial splitting while maintaining atomicity
- Fix formatting issues in drizzle.config.ts and snapshot.json - Add full lint check to pre-commit hook (in addition to lint-staged) - Ensures CI lint checks match local pre-commit checks
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.
Overview
Implements the local persistence layer for document storage using SQLite as the System of Record, decoupled from Vector DB.
Architecture
Implementation
Testing
Changes
@doc-agent/storagepackageRelated