Introduces event, goal, and task storage subsystems built on Badger:
- event: append-only log with typed payloads for state changes
- goal: CRUD operations for session goals with event tracking
- task: full lifecycle management with status indexing
- testutil: helpers for deterministic test clocks and databases
- timeutil: clock abstraction for testability
All packages include comprehensive test coverage.
Co-authored-by: Crush <crush@charm.land>
59b1849
fix(db): fix View txn and improve defaults
Click to expand commit body
Fix View transaction to return nil on success instead of ctx.Err(),
which
caused spurious failures when a context deadline was set but the
operation
completed successfully before expiration.
Improve configuration defaults for CLI durability:
- Default SyncWrites to true to ensure planning state persists across
crashes
- Use os.UserConfigDir() instead of custom platform logic for better
cross-platform config directory handling
Code cleanup:
- Remove redundant txn.Discard() after successful commit
- Rename suffixTasks to suffixTask for singular/plural consistency
- Fix KeyString doc to correctly state it allocates
- Remove unused ctx assignment in View
Signed-off-by: Crush <crush@charm.land>
Had a combo of Claude Code/Sonnet 4.5 and Amp/GPT-5 (Oracle) write one
schema each, then used CC and Crush/GPT-5 (high) to polish up CC's
version. Then I presented both schemas to CC and Crush/GPT-5 and asked
which they prefer. Both suggested copying some choice ideas from CC's
schema, but instead adopting Amp's schema overall.
Co-authored-by: Crush <crush@charm.land>