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

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

  1. 012: Schema and repositories
  2. 1. Purpose
  3. 2. Territory
  4. 3. Behavior
  5. 4. Functional requirements
  6. 5. Acceptance criteria
  7. 6. Out of scope
  8. 7. Resolved decisions
  9. Verification

Frozen anchors

No frozen anchors declared.