Add iter.Seq2 iterators (All, GroupsSeq) for streaming DB rows,
GetSplit/GetFields using strings.SplitSeq/FieldsSeq, slices.DeleteFunc
in event watchers/callbacks, and range-over-int in benchmarks.
Co-Authored-By: Gemini <noreply@google.com>
Co-Authored-By: Virgil <virgil@lethean.io>
Uses reusable workflows from core/go-devops for Go testing
(with race detector and coverage) and security scanning
(govulncheck, gitleaks, trivy).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace internal task tracking (TODO.md, FINDINGS.md) with structured
documentation in docs/. Trim CLAUDE.md to agent instructions only.
Co-Authored-By: Virgil <virgil@lethean.io>
Watch/Unwatch API with buffered channels (cap 16) and wildcard matching,
OnChange callback hook for go-ws integration, non-blocking notify on
Set/SetWithTTL/Delete/DeleteGroup. ScopedStore events emit with full
prefixed group names. 16 new tests, race-clean, coverage 94.7% -> 95.5%.
Co-Authored-By: Virgil <virgil@lethean.io>
Detailed spec for reactive notification system: Event types,
Watcher API with buffered channels, OnChange callback hook for
go-ws integration, notify() with non-blocking sends, ScopedStore
event passthrough, and 13-item test matrix.
Co-Authored-By: Virgil <virgil@lethean.io>
ScopedStore wraps Store and auto-prefixes groups with a namespace to
prevent key collisions across tenants. QuotaConfig enforces per-namespace
MaxKeys and MaxGroups limits (zero = unlimited). Upserts and expired
keys are excluded from quota counts.
New Store methods: CountAll(prefix) and Groups(prefix) for cross-group
queries. All 93 tests pass with race detector, coverage 94.7%.
Co-Authored-By: Virgil <virgil@lethean.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add bench_test.go with benchmarks not covered by store_test.go:
- BenchmarkGetAll_VaryingSize: 4 sub-benchmarks (10/100/1K/10K keys)
to measure allocation scaling
- BenchmarkSetGet_Parallel: b.RunParallel for throughput under contention
- BenchmarkCount_10K: COUNT(*) on large groups
- BenchmarkDelete: delete throughput
- BenchmarkSetWithTTL: TTL write overhead vs plain Set
- BenchmarkRender: template rendering with 50 keys
All benchmarks use b.ReportAllocs().
Co-Authored-By: Virgil <virgil@lethean.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cover previously unreachable error paths in New(), GetAll(), and Render():
- New: schema conflict when index named "kv" pre-exists
- GetAll: scan error via NULL-key injection after table restructure
- GetAll: rows iteration error via database page corruption
- Render: scan error via same NULL-key technique
- Render: rows iteration error via same corruption technique
GetAll and Render now at 100%. Only 3 stmts remain uncovered in New()
(sql.Open lazy-error and PRAGMA busy_timeout — both genuinely
unreachable without driver mocking).
Co-Authored-By: Charon <charon@lethean.io>