Commit graph

7 commits

Author SHA1 Message Date
Virgil
1ec0ea4d28 fix(ratelimit): align module metadata and repo guidance
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-27 04:23:34 +00:00
Virgil
36cc0a4750 refactor(ratelimit): upgrade to core v0.8.0-alpha.1
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-26 15:41:11 +00:00
Virgil
d1c90b937d fix(ratelimit): harden audit edge cases
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-23 07:26:15 +00:00
Snider
d4d9d7a798 chore(ratelimit): migrate dependencies from forge.lthn.ai to dappco.re
All checks were successful
Security Scan / security (pull_request) Successful in 7s
Test / test (pull_request) Successful in 2m17s
Update go.mod require lines and .go import paths:
- forge.lthn.ai/core/go-io v0.1.7 → dappco.re/go/core/io v0.2.0
- forge.lthn.ai/core/go-log v0.0.4 → dappco.re/go/core/log v0.1.0

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 01:34:23 +00:00
Snider
4bb1cb96d4 refactor(ratelimit): replace all fmt.Errorf with coreerr.E from go-log
All checks were successful
Security Scan / security (push) Successful in 8s
Test / test (push) Successful in 1m7s
Replace all 41 remaining fmt.Errorf calls in production code (ratelimit.go
and sqlite.go) with coreerr.E() from forge.lthn.ai/core/go-log. Promotes
go-log from indirect to direct dependency in go.mod.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-16 20:38:06 +00:00
Snider
79448bf3f3 fix: improve error handling and test coverage
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 08:30:03 +00:00
Snider
1afb1d636a feat(persist): Phase 2 — SQLite backend with WAL mode
Add multi-process safe SQLite persistence using modernc.org/sqlite (pure
Go, no CGO). Follows the go-store pattern: single connection,
WAL journal mode, 5-second busy timeout.

New files:
- sqlite.go: sqliteStore with schema (quotas, requests, tokens, daily
  tables), saveQuotas/loadQuotas, saveState/loadState, close methods
- sqlite_test.go: 25 tests covering basic round-trips, integration,
  concurrency (10 goroutines, race-clean), migration, corrupt DB recovery

Wiring:
- Backend field added to Config ("yaml" default, "sqlite" option)
- Persist() and Load() dispatch to correct backend
- NewWithSQLite() and NewWithSQLiteConfig() convenience constructors
- Close() method for cleanup (no-op for YAML)
- MigrateYAMLToSQLite() helper for upgrading existing YAML state

All existing YAML tests pass unchanged (backward compatible).

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-20 07:50:48 +00:00