Files
kami d26f20c316 docs(dox): build out the DOX AGENTS.md hierarchy
Root Child DOX Index assembled, plus a per-module AGENTS.md across the tree
(core/*, infrastructure/*, apps/*, testing/*, and docs/examples/frontend/etc),
each following the DOX section shape: Purpose, Ownership, Local Contracts,
Work Guidance, Verification, Child DOX Index.
2026-06-28 20:43:27 +04:00

1.2 KiB

infrastructure/persistence/

Purpose

Event store adapters for the correx event log. Provides SqliteEventStore (durable, production) and InMemoryEventStore (tests/dev). Also contains LiveArtifactRepository, which projects artifact state from the event log via core:artifacts.

Ownership

Sole persistence adapter for core:events (EventStore). No other infrastructure module may write to the event log.

Local Contracts

  • SqliteEventStore implements EventStore from core:events; the SQLite file is the authoritative event log.
  • InMemoryEventStore is for tests only — not suitable for production use.
  • LiveArtifactRepository implements ArtifactRepository from core:artifacts by replaying events; it never persists state independently (invariant #1).
  • Schema migrations are the responsibility of this module; JDBCHelper owns connection utilities.
  • The event log is append-only: no updates or deletes to existing rows.

Work Guidance

Standard adapter rules apply (see parent AGENTS.md). All JDBC calls go in withContext(Dispatchers.IO).

Verification

./gradlew :infrastructure:persistence:test --rerun-tasks

Child DOX Index

No child AGENTS.md (leaf module).