diff --git a/FINDINGS.md b/FINDINGS.md new file mode 100644 index 0000000..d9937f6 --- /dev/null +++ b/FINDINGS.md @@ -0,0 +1,23 @@ +# FINDINGS.md -- go-store + +## 2026-02-19: Split from core/go (Virgil) + +### Origin + +Extracted from `forge.lthn.ai/core/go` `pkg/store/` on 19 Feb 2026. + +### Architecture + +- SQLite database with WAL mode enabled for concurrent read performance +- Compound primary key: `(group, key)` -- groups act as logical namespaces +- UPSERT semantics on write (INSERT OR REPLACE) +- Template rendering support via Go `text/template` for dynamic values +- Pure Go SQLite driver via `modernc.org/sqlite` (no CGO required) + +### Dependencies + +- `modernc.org/sqlite` -- pure Go SQLite implementation + +### Tests + +- 1 test file covering CRUD operations, group isolation, and template rendering diff --git a/TODO.md b/TODO.md new file mode 100644 index 0000000..fd44afa --- /dev/null +++ b/TODO.md @@ -0,0 +1,29 @@ +# TODO.md -- go-store + +## Phase 1: TTL Support + +- [ ] Add optional expiry timestamp for keys +- [ ] Background goroutine to purge expired entries +- [ ] `SetWithTTL(group, key, value, duration)` API +- [ ] Lazy expiry check on `Get` as fallback + +## Phase 2: Namespace Isolation + +- [ ] Group-based access control for multi-tenant use +- [ ] Namespace prefixing to prevent key collisions across tenants +- [ ] Per-namespace quota limits (max keys, max total size) + +## Phase 3: Event Hooks + +- [ ] Notify on `Set` / `Delete` for reactive patterns +- [ ] Channel-based subscription: `Watch(group, key) <-chan Event` +- [ ] Support wildcard watches (`Watch(group, "*")`) +- [ ] Integration hook for go-ws to broadcast store changes via WebSocket + +--- + +## Workflow + +1. Virgil in core/go writes tasks here after research +2. This repo's dedicated session picks up tasks in phase order +3. Mark `[x]` when done, note commit hash