d26f20c316
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.
32 lines
1.2 KiB
Markdown
32 lines
1.2 KiB
Markdown
# 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).
|