Skip to content

feat: add transactional SQLite event store - #3

Merged
karngyan merged 4 commits into
mainfrom
feat/sqlite-event-store
Jul 16, 2026
Merged

karngyan merged 4 commits into
mainfrom
feat/sqlite-event-store

Conversation

@karngyan

@karngyan karngyan commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements logical PR 2 from the Milestone 1 roadmap.

  • add the cross-platform autophagy-store crate with bundled SQLite/FTS5
  • apply ordered migrations transactionally and pin each applied migration by SHA-256
  • validate AEP events before persistence and canonicalize timestamps to UTC
  • atomically maintain source provenance, session rollups, artifacts, and search rows
  • make identical reimports no-ops
  • quarantine same-ID/different-content payloads without overwriting canonical evidence
  • index only policy-processed structural fields and explicit redaction-approved free text
  • cascade session deletion through events, conflicts, links, and FTS while retaining shared artifacts
  • run the full mise quality gate on pull requests and pushes to main
  • update the repository and database architecture documentation to match the implementation

Trust boundaries

  • no network or cloud dependency at runtime
  • raw event JSON is persisted for evidence but never blindly copied into FTS5
  • raw tool input is stored for deterministic analysis but requires an explicit sanitized projection before search indexing
  • foreign keys, secure deletion, busy timeout, and WAL mode are configured per connection
  • malformed, provenance-conflicting, and sequence-conflicting inputs roll back atomically
  • CI uses read-only permissions and actions pinned to immutable commit SHAs

Verification

  • mise run check
  • actionlint
  • 8 storage/migration tests and 4 AEP contract tests
  • disk close/reopen migration verification
  • migration checksum drift and newer-schema rejection
  • duplicate no-op and repeated conflict-quarantine assertions
  • redaction-safe FTS and cascade deletion assertions
  • strict Clippy with warnings denied
  • rustdoc with warnings denied
  • git diff --check

@karngyan
karngyan merged commit fb6a967 into main Jul 16, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant