---
name: "CRDT state layer backed by SQLite"
agent: coder-opus
depends_on: [489]
---

# Story 490: CRDT state layer backed by SQLite

## User Story

As a developer, I want the BFT JSON CRDT document backed by SQLite for persistence, so CRDT ops survive restarts and the state layer is ready for multi-node sync.

## Acceptance Criteria

- [ ] BFT CRDT crate (crates/bft-json-crdt/) integrated into the server
- [ ] CRDT ops persisted to SQLite via sqlx (backend-agnostic schema)
- [ ] Pipeline state reads switch from filesystem to CRDT document
- [ ] Pipeline state writes go through CRDT ops (which persist to SQLite)
- [ ] Filesystem .huskies/work/ directories still updated as a secondary output for backwards compat during transition
- [ ] CRDT state reconstructed from SQLite on startup
- [ ] agent: coder-opus
- [ ] depends_on: [489]

## Out of Scope

- TBD
