Commit graph

21 commits

Author SHA1 Message Date
Virgil
4031b6719f docs(ax): prefer declarative store configuration
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-04 11:13:36 +00:00
Virgil
0ce6014836 docs(store): align agent-facing file layout docs
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-03 06:20:04 +00:00
Virgil
0c1b51413f feat(store): broaden journal query handling
Improve Flux measurement parsing, make orphan cleanup flow explicit, and align the CLAUDE watch example with the current API.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-03 05:53:56 +00:00
Virgil
bc578265a8 refactor(scope): make scoped helpers explicit
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-03 05:45:24 +00:00
Virgil
2eedf1e937 refactor(store): tighten AX naming and examples
All checks were successful
Security Scan / security (push) Successful in 10s
Test / test (push) Successful in 1m41s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 18:17:07 +00:00
Virgil
6261ea2afb refactor(store): clarify AX terminology in code and docs
All checks were successful
Security Scan / security (push) Successful in 9s
Test / test (push) Successful in 1m42s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 17:45:39 +00:00
Virgil
a82b0d379b docs(ax): align CLAUDE with AX examples
All checks were successful
Security Scan / security (push) Successful in 9s
Test / test (push) Successful in 1m39s
Update the repository guidance to match the current AX conventions, including explicit error handling and the actual file layout.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 16:46:18 +00:00
Virgil
25eb05e68d refactor(store): rename sqlite schema for AX clarity
All checks were successful
Security Scan / security (push) Successful in 9s
Test / test (push) Successful in 1m38s
Migrate legacy kv databases to the descriptive entries schema and cover the new iterator branches.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 15:37:49 +00:00
Virgil
57e061f742 fix(events): make callback dispatch re-entrant safe
All checks were successful
Security Scan / security (push) Successful in 9s
Test / test (push) Successful in 1m34s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 15:22:33 +00:00
Virgil
36a8d89677 refactor(store): tighten AX naming
All checks were successful
Security Scan / security (push) Successful in 9s
Test / test (push) Successful in 1m40s
Replace the remaining shorthand variable names in the implementation, examples, and supporting docs with explicit names.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 15:02:28 +00:00
Virgil
2bfb5af5e2 refactor(store): apply AX naming cleanup
All checks were successful
Security Scan / security (push) Successful in 9s
Test / test (push) Successful in 1m35s
Rename terse locals and callback internals, and update the user-facing examples to use explicit names.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 14:54:34 +00:00
Virgil
335c6460c9 refactor(store): adopt AX primary names
All checks were successful
Security Scan / security (push) Successful in 9s
Test / test (push) Successful in 1m35s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 14:22:49 +00:00
Virgil
380f2b9157 fix(store): finish ax v0.8.0 polish
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-29 23:26:44 +00:00
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
bf58dba643 docs(claude.md): add Getting Started section with workspace and test setup
All checks were successful
Security Scan / security (pull_request) Successful in 7s
Test / test (pull_request) Successful in 57s
Adds a concise Getting Started section covering:
- Go workspace requirement and go work sync
- First test command (go test ./... -count=1)
- Module directory layout (store.go and scope.go)

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-17 07:09:41 +00:00
Snider
b579a9f175 docs: add CLAUDE.md project instructions
All checks were successful
Security Scan / security (push) Successful in 7s
Test / test (push) Successful in 2m34s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-13 13:38:02 +00:00
Snider
c570f08eba docs: graduate TODO/FINDINGS into production documentation
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>
2026-02-20 15:01:55 +00:00
Snider
f202cfe218 feat(events): add reactive event hooks for store mutations
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>
2026-02-20 08:25:03 +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
Claude
b866dacdd2
feat(store): add TTL support and harden test coverage to 90.9%
Phase 0 -- Hardening:
- Fix SQLITE_BUSY under concurrent writes by setting SetMaxOpenConns(1)
  and PRAGMA busy_timeout=5000
- Add comprehensive tests: concurrent read/write (10 goroutines),
  edge cases (unicode, null bytes, SQL injection, long keys), error
  paths (closed store, invalid paths, corrupt files), group isolation,
  upsert verification, WAL mode verification, ErrNotFound wrapping
- Add benchmarks: Set, Get, GetAll (10K keys), file-backed Set

Phase 1 -- TTL Support:
- Add expires_at nullable column with schema migration for pre-TTL DBs
- SetWithTTL(group, key, value, duration) stores keys that auto-expire
- Lazy deletion on Get for expired keys
- Background purge goroutine (configurable interval, default 60s)
- Public PurgeExpired() method for manual cleanup
- Count, GetAll, Render all exclude expired entries
- Set clears TTL when overwriting a TTL key

Coverage: 73.1% -> 90.9% (48 tests, 0 races)

Co-Authored-By: Charon <developers@lethean.io>
2026-02-20 01:14:08 +00:00
Snider
9ebe581069 feat: extract go-store from core/go pkg/store
SQLite key-value store wrapper.
Zero external dependencies (stdlib only).
Module: forge.lthn.ai/core/go-store

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-19 16:09:15 +00:00