012-store-schema-and-repositories
Schema and repositories: versioned migrations, scope in the predicate, counters instead of scans
Lifecycle approvedImplementation completeVerification unknownQualification unknown
The tables and the only code allowed to touch them. Schema arrives as an ordered list of rahi migrations with versions, never as SQL a user pastes from a guide. Every repository call takes a scope and puts it in the SQL, so an unscoped read is not expressible. Aggregates are maintained counters updated in the writing transaction, because the predecessor's statistics call read every row's metadata into memory. Listing is keyset-paged; there is no offset pagination and no unbounded select.
Read the full pinned specification ↗Relationships
depends on
depended on by
Claimed units
- establishes
{ "kind": "file", "path": "crates/aicortex-store/Cargo.toml" } - establishes
{ "kind": "file", "path": "crates/aicortex-store/src/lib.rs" } - establishes
{ "kind": "file", "path": "crates/aicortex-store/src/migrations.rs" } - establishes
{ "kind": "file", "path": "crates/aicortex-store/src/memory_repo.rs" } - establishes
{ "kind": "file", "path": "crates/aicortex-store/src/provenance_repo.rs" } - establishes
{ "kind": "file", "path": "crates/aicortex-store/src/scope_repo.rs" } - establishes
{ "kind": "file", "path": "crates/aicortex-store/src/counters.rs" } - establishes
{ "kind": "file", "path": "crates/aicortex-store/src/cursor.rs" } - establishes
{ "kind": "file", "path": "crates/aicortex-store/tests/schema.rs" } - establishes
{ "kind": "file", "path": "crates/aicortex-store/tests/repo.rs" } - establishes
{ "kind": "file", "path": "crates/aicortex-store/tests/common/" } - establishes
{ "kind": "file", "path": "apps/aicortex/tests/migrate.rs" } - extends
{ "nature": "additive", "spec": "010-chassis-adoption-and-workspace", "unit": { "kind": "file", "path": "apps/aicortex/src/cell.rs" } } - extends
{ "nature": "additive", "spec": "010-chassis-adoption-and-workspace", "unit": { "anchor": "workspace.dependencies", "file": "Cargo.toml", "kind": "section" } } - extends
{ "nature": "additive", "spec": "010-chassis-adoption-and-workspace", "unit": { "kind": "file", "path": "apps/aicortex/Cargo.toml" } } - extends
{ "nature": "additive", "spec": "010-chassis-adoption-and-workspace", "unit": { "kind": "file", "path": "apps/aicortex/tests/cell.rs" } } - constrains
{ "flavor": "invariant-freeze", "note": "every statement carries a scope predicate; no post-filtering", "unit": { "kind": "file", "path": "crates/aicortex-store/src/memory_repo.rs" } }
Source headings
- 012: Schema and repositories
- 1. Purpose
- 2. Territory
- 3. Behavior
- 4. Functional requirements
- 5. Acceptance criteria
- 6. Out of scope
- 7. Resolved decisions
- Verification
Frozen anchors
No frozen anchors declared.