Commit graph

47 commits

Author SHA1 Message Date
Snider
345fa26062 feat(store): add Exists, GroupExists, and Workspace.Count methods
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Add public existence-check methods across all store layers (Store,
ScopedStore, StoreTransaction, ScopedStoreTransaction) so callers can
test key/group presence declaratively without Get+error-type checking.
Add Workspace.Count for total entry count. Full test coverage with
Good/Bad/Ugly naming, race-clean.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-05 08:58:26 +01:00
Virgil
75f8702b74 feat: normalise declarative store config defaults
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-04 19:07:18 +00:00
Virgil
06f6229eaf feat(store): expose workspace state directory config
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-04 16:24:27 +00:00
Virgil
cae3c32d51 refactor: add AX config validation helpers
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-04 15:47:56 +00:00
Virgil
32e7413bf4 feat(store): make workspace state paths declarative
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-04 14:43:42 +00:00
Virgil
c2c5cecd7d refactor(store): unify journal configuration storage
Keep the exported JournalConfiguration type as the single in-memory representation.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-04 14:19:28 +00:00
Virgil
2ff98991a1 fix(store): require explicit database path in config
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-04 11:22:50 +00:00
Virgil
6ba5701955 refactor(config): validate declarative store options
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-04 10:46:46 +00:00
Virgil
09c78e13f4 fix(store): require complete journal configuration
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-04 09:43:27 +00:00
Virgil
37500c56ae refactor(store): clarify SQLite handle names
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-04 09:04:56 +00:00
Virgil
cc8bebb8e0 refactor(store): clarify journal configuration and workspace errors
Add a declarative journal configuration check and wrap workspace database errors with package context.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-04 08:41:28 +00:00
Virgil
2a28b5a71b feat(store): add closed-state accessor
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-04 08:32:55 +00:00
Virgil
5116662f41 feat(store): add database path accessor
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-04 08:23:23 +00:00
Virgil
ee984818d2 feat(store): expose active configuration
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-03 08:45:44 +00:00
Virgil
bf7b616fe1 feat(store): add paginated group reads
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-03 08:32:35 +00:00
Virgil
841e7b8936 fix(store): harden background purge interval
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-03 07:35:20 +00:00
Virgil
3a8cfcedf9 feat(store): add prefix cleanup helpers
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-03 07:14:22 +00:00
Virgil
aad8dded6b feat(store): add declarative store config
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-03 06:47:39 +00:00
Virgil
fd3266306a feat(store): expose journal configuration snapshot
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-03 06:15:45 +00:00
Virgil
12809c8d64 refactor(store): clarify journal configuration names
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-03 06:11:38 +00:00
Virgil
f4492b1861 feat(store): surface journal configuration on store
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-03 06:08:16 +00:00
Virgil
b6b29b50ce feat(store): add configurable purge interval
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-03 05:35:22 +00:00
Virgil
294a998282 refactor(store): rename journal config fields
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-03 05:28:57 +00:00
Virgil
387d1463fb feat(store): add RFC-scoped helpers and callbacks
Add the RFC-named scoped helpers, AllSeq iteration, and group-filtered change callbacks.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-03 05:13:46 +00:00
Virgil
016e2c3777 refactor(store): remove legacy alias entry points
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-03 05:05:53 +00:00
Virgil
d7f03d5db0 fix(store): make Close idempotent
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-03 05:00:56 +00:00
Virgil
5c7e243fc0 feat(store): align public API with RFC
Co-Authored-By: Virgil <virgil@lethean.io>
2026-04-03 04:44:45 +00:00
Virgil
4c44cfa336 fix(store): harden RFC journal and workspace flows
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 21:07:30 +00:00
Virgil
d9fad2d6be feat(store): implement RFC workspace and journal surfaces
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 20:46:43 +00:00
Virgil
9cd7b9b1a7 fix(store): stabilise AX iteration behaviour
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 19:39:54 +00:00
Virgil
23f207db3f refactor(store): tighten AX naming and error contexts
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 18:37:07 +00:00
Virgil
f144c5eb01 refactor(test): tighten AX naming in tests
All checks were successful
Security Scan / security (push) Successful in 9s
Test / test (push) Successful in 1m43s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 18:23:56 +00:00
Virgil
bf3db41d9f test(store): improve AX coverage and error paths
All checks were successful
Security Scan / security (push) Successful in 8s
Test / test (push) Successful in 1m39s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 18:08:33 +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
05af917e17 refactor(store): clarify AX helper names and examples
All checks were successful
Security Scan / security (push) Successful in 10s
Test / test (push) Successful in 1m42s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 17:37:50 +00:00
Virgil
0fb0d16149 refactor(store): tighten AX error context and examples
All checks were successful
Security Scan / security (push) Successful in 8s
Test / test (push) Successful in 1m39s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 16:27:54 +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
adc463ba75 docs(ax): add Codex conventions bridge
All checks were successful
Security Scan / security (push) Successful in 9s
Test / test (push) Successful in 1m36s
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-30 15:16:16 +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
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
Claude
c3de82b207
feat: upgrade to core v0.8.0-alpha.1, replace banned stdlib imports
All checks were successful
Security Scan / security (push) Successful in 9s
Test / test (push) Successful in 2m33s
Replace fmt, errors, strings, path/filepath with Core primitives
across 8 files. Keep strings for SplitSeq/FieldsSeq/Builder/Repeat.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 13:58:50 +00:00
Virgil
ec500b86d2 chore(repo): enforce AX review conventions
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-26 11:17:06 +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
3c6b2267a3 refactor: apply go fix modernizers for Go 1.26
Automated fixes: interface{} → any, range-over-int, t.Context(),
wg.Go(), strings.SplitSeq, strings.Builder, slices.Contains,
maps helpers, min/max builtins.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-22 21:00:17 +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