Skip to content

[feat] SQLite index for artifact queries + FTS #20

@NoobyGains

Description

@NoobyGains

Context

Git refs are the source of truth, but they are not queryable. Per docs/design.md "Layer 1", we need fast filters ("open Claims by agent X touching path Y", "unresolved Disagreements", "Plans pending objection") and full-text search across artifact bodies. SQLite is the projection layer.

Desired behavior

A @quorum/index-sqlite package providing:

  • hydrate() — full rebuild by walking refs/coord/*.
  • apply(event) — incremental update from a watchdog event ([feat] Define JSON schemas (Zod) for all 12 artifact types #8).
  • query(filter): Artifact[] — typed filter (kind, author, status, paths[], parents-of, children-of, since).
  • search(text, opts): { artifact, snippet }[] — FTS5 over body + title.
  • Schema migrations versioned and idempotent.

Acceptance criteria

  • FTS5 virtual table covering all text-bearing fields.
  • hydrate() is idempotent and matches incremental apply() byte-for-byte.
  • Query latency < 50ms p95 on 10k artifacts.
  • Unit tests pass.
  • Integration test against real git repo (no mocks) — write 1000 artifacts via chore(ci)(deps): Bump actions/checkout from 4 to 6 #2, hydrate, query, verify counts.

Implementation notes

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions