karenina.storage.models¶
models
¶
SQLAlchemy ORM models for Karenina database storage.
This module defines the database schema including tables for benchmarks, questions, verification runs, and results.
Note: VerificationResultModel is auto-generated from Pydantic schemas and is defined in generated_models.py to keep it in sync with domain models.
Classes¶
BenchmarkModel
¶
Bases: Base
Database model for benchmarks.
Stores benchmark metadata and tracks the checkpoint file that serves as the source of truth.
Source code in src/karenina/storage/models.py
BenchmarkQuestionModel
¶
Bases: Base
Database model for benchmark-question associations.
Junction table linking benchmarks to questions with benchmark-specific metadata like answer templates, completion status, and question-specific rubrics.
Source code in src/karenina/storage/models.py
ImportMetadataModel
¶
Bases: Base
Database model for tracking verification result imports.
Records audit information about imports for traceability.
Source code in src/karenina/storage/models.py
QuestionModel
¶
Bases: Base
Database model for questions.
Questions are shared across benchmarks (normalized). Each unique question appears only once in this table.
Source code in src/karenina/storage/models.py
VerificationRunModel
¶
Bases: Base
Database model for verification runs.
Tracks verification job metadata including configuration, status, and timing.