Skip to content

refactor(store): extract SQLite storage boundary#141

Merged
0xjunha merged 3 commits into
mainfrom
refactor
May 12, 2026
Merged

refactor(store): extract SQLite storage boundary#141
0xjunha merged 3 commits into
mainfrom
refactor

Conversation

@0xjunha
Copy link
Copy Markdown
Owner

@0xjunha 0xjunha commented May 12, 2026

Summary

This PR extracts Darc’s SQLite storage layer into a dedicated darc-store crate and tightens the architecture boundary between indexing, storage, and querying.

Before this change, darc-query depended on darc-index to access SQLite schema/opening helpers, which made the read side depend on the write-side indexing crate. This PR moves the shared persistence concerns into darc-store, so darc-index can focus on archive ingestion and darc-query can read through the shared storage boundary.

Changes

  • Add new darc-store workspace crate
    • owns SQLite schema and migrations
    • owns index DB open helpers
    • owns derived analytics/search row generation
    • owns evidence fields and file/tool access policies
    • owns storage test fixtures
  • Update darc-index
    • remove direct ownership of SQLite schema/migration modules
    • keep ingestion, parsing, duplicate resolution, and index orchestration
    • write sessions/turns through store-owned insert helpers
  • Update darc-query
    • remove dependency on darc-index
    • depend on darc-store for evidence fields, policies, and DB opening
  • Keep raw schema SQL internal
    • make schema crate-private in darc-store
    • remove darc_index::schema re-export
    • hide derived insertion and turn-metric helpers behind store write APIs

Compatibility

This narrows internal Rust crate APIs by no longer exposing raw SQLite schema details outside the storage crate. CLI behavior and JSON query protocol behavior are unchanged.

@0xjunha 0xjunha merged commit 73ab356 into main May 12, 2026
6 checks passed
@0xjunha 0xjunha deleted the refactor branch May 12, 2026 04:07
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.

1 participant