Skip to content

OIC persistence: schema, migrations, and append-only claim history #221

Open

Description

@exactml

Context

Accepted knowledge needs a durable store that never silently overwrites history. Depends on #220.

Behavior to implement

  • SQL schema and migrations for every domain type in OIC domain model: claims, evidence, entities, scopes, and two timelines #220, running on SQLite and Postgres.
  • Append-only claim versions: revising a claim writes a new version row with who, when, why, and which investigation caused it. The previous version stays readable.
  • Repositories (read/write services) that the application layer uses. Nothing outside them touches tables.
  • Indexes for the queries the API needs: by scope, entity, claim type, status, and valid time.

Acceptance criteria

  • Migrations apply on an empty SQLite file and on Postgres.
  • Revising a claim twice leaves three readable versions, and "what was true on date D" returns the right one.
  • New evidence never deletes older evidence.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendbackend devfeatureoicOrganizational Intelligence Core

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions