Commit graph

5 commits

Author SHA1 Message Date
Snider
5225c99cd7 refactor(module): migrate module paths from forge.lthn.ai to dappco.re
Some checks failed
Security Scan / security (pull_request) Successful in 8s
Test / test (pull_request) Failing after 32s
Update module path to dappco.re/go/core/store, require dappco.re/go/core/log v0.1.0,
and update all Go import paths and documentation references.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 01:27:35 +00:00
Snider
e88b8a3455 refactor(errors): replace fmt.Errorf and errors.New with coreerr.E()
All checks were successful
Security Scan / security (push) Successful in 7s
Test / test (push) Successful in 2m26s
Replace all fmt.Errorf and errors.New calls in production code
(store.go, scope.go) with structured coreerr.E() from go-log.
Sentinel errors (ErrNotFound, ErrQuotaExceeded) are now *log.Err
values; errors.Is() chains continue to work via Unwrap(). Update
four coverage_test.go assertions to match the new op-prefixed
error format from the All() iterator.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 21:48:59 +00:00
Snider
11f0781d0a fix: harden error handling and SQL wildcard injection
All checks were successful
Security Scan / security (push) Successful in 8s
Test / test (push) Successful in 1m38s
- Check ALTER TABLE migration errors (ignore duplicate column only)
- Handle background purge failures instead of swallowing errors
- Add escapeLike() to prevent SQL wildcard injection in LIKE queries
- Use errors.Is(ErrNotFound) in quota checks instead of treating all errors as not-found
- Add TestCountAll_Good_WithPrefix_Wildcards

Co-Authored-By: Gemini <noreply@google.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 08:20:38 +00:00
Snider
9636396298 feat: modernise to Go 1.26 iterators and stdlib helpers
Some checks failed
Security Scan / security (push) Successful in 12s
Test / test (push) Failing after 37s
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>
2026-02-23 05:21:44 +00:00
Snider
175fd6bf83 feat(scope): add namespace isolation with quota enforcement
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>
2026-02-20 08:19:11 +00:00