Skip to content

cayu.storage

Public Cayu API. Definitions are grouped by their public source module, and definitions from private implementation modules appear on their package’s page; adding a symbol does not move existing links. The import shown at each entry is a supported public namespace. Read the Python API overview and install the required extra.

from cayu import SQLiteEvalStore

Restart-durable embedded eval persistence for a single SQLite database.

Bases: EvalStore.

async SQLiteEvalStore.close() -> None
async SQLiteEvalStore.save_corpus(corpus: EvalCorpusDocument, *, redact_json: Callable[[Any], Any]) -> EvalCorpusCatalogEntry
async SQLiteEvalStore.load_corpus(revision: str, *, max_bytes: int=EVAL_CORPUS_MAX_BYTES) -> EvalCorpusDocument | None
async SQLiteEvalStore.list_corpora(query: EvalCatalogQuery | None=None) -> EvalCorpusCatalogPage
async SQLiteEvalStore.save_scenario(scenario: EvalScenarioDocumentV2, *, redact_json: Callable[[Any], Any]) -> EvalScenarioCatalogEntry
async SQLiteEvalStore.load_scenario(revision: str, *, max_bytes: int=EVAL_SCENARIO_MAX_BYTES) -> EvalScenarioDocumentV2 | None
async SQLiteEvalStore.list_scenarios(query: EvalScenarioCatalogQuery | None=None) -> EvalScenarioCatalogPage
async SQLiteEvalStore.save_authored_suite(document: EvalSuiteDocument, *, redact_json: Callable[[Any], Any]) -> EvalAuthoredSuiteCatalogEntry
async SQLiteEvalStore.load_authored_suite(revision: str, *, max_bytes: int=EVAL_SUITE_AUTHORING_MAX_BYTES) -> EvalSuiteDocument | None
async SQLiteEvalStore.list_authored_suites(query: EvalAuthoredSuiteCatalogQuery | None=None) -> EvalAuthoredSuiteCatalogPage
async SQLiteEvalStore.save_judge_calibration(report: EvalJudgeCalibrationReportV1, *, redact_json: Callable[[Any], Any]) -> EvalJudgeCalibrationReportV1
async SQLiteEvalStore.load_judge_calibration(revision: str, *, max_bytes: int=EVAL_JUDGE_CALIBRATION_MAX_BYTES) -> EvalJudgeCalibrationReportV1 | None
async SQLiteEvalStore.load_judge_calibration_by_run_id(run_id: str, *, max_bytes: int=EVAL_JUDGE_CALIBRATION_MAX_BYTES) -> EvalJudgeCalibrationReportV1 | None
async SQLiteEvalStore.list_suites(query: EvalSuiteCatalogQuery) -> EvalSuiteCatalogPage
async SQLiteEvalStore.list_cases(query: EvalCaseCatalogQuery) -> EvalCaseCatalogPage
async SQLiteEvalStore.admit_run(request: EvalRunRequest, *, redact_json: Callable[[Any], Any]) -> EvalRunRecord
async SQLiteEvalStore.load_run_by_idempotency_key(idempotency_key: str) -> EvalRunRecord | None
async SQLiteEvalStore.load_run(run_id: str) -> EvalRunRecord | None
async SQLiteEvalStore.load_run_observation(run_id: str) -> EvalRunObservation | None
async SQLiteEvalStore.wait_for_run_terminal(run_id: str, *, timeout_seconds: float=30.0, poll_interval_seconds: float=EVAL_RUN_MIN_OBSERVATION_INTERVAL_SECONDS, max_poll_interval_seconds: float=EVAL_RUN_MAX_OBSERVATION_INTERVAL_SECONDS) -> EvalRunObservation | None

Wait within a strict deadline for a terminal run observation.

Polling begins no faster than the public 50 ms floor and exponentially backs off to the caller’s bounded ceiling. A missing run returns None; deadline exhaustion raises TimeoutError.

async SQLiteEvalStore.list_runs(query: EvalRunQuery | None=None) -> EvalRunPage
async SQLiteEvalStore.claim_run(*, target_key: str | None=None, launch_revision: str | None=None, lease_seconds: int=300) -> EvalRunLease | None
async SQLiteEvalStore.claim_run_for_targets(target_keys: tuple[str, ...], *, lease_seconds: int=300) -> EvalRunLease | None
async SQLiteEvalStore.heartbeat_run(claim: EvalRunClaim, *, extend_seconds: int=300) -> EvalRunRecord
async SQLiteEvalStore.heartbeat_run_observation(claim: EvalRunClaim, *, extend_seconds: int=300) -> EvalRunObservation
async SQLiteEvalStore.request_cancel(run_id: str) -> EvalRunRecord
async SQLiteEvalStore.initialize_scenario_progress(claim: EvalRunClaim, progress: EvalScenarioRunProgress) -> EvalRunRecord
async SQLiteEvalStore.update_scenario_trial(claim: EvalRunClaim, trial: EvalScenarioTrialProgress) -> EvalRunRecord
async SQLiteEvalStore.load_trial_checkpoints(claim: EvalRunClaim) -> tuple[EvalRunTrialCheckpoint, ...]
async SQLiteEvalStore.load_trial_evidence_links(run_id: str) -> tuple[EvalTrialEvidenceLinkV1, ...]
async SQLiteEvalStore.save_trial_checkpoint(claim: EvalRunClaim, checkpoint: EvalRunTrialCheckpoint, *, redact_json: Callable[[Any], Any]) -> None
async SQLiteEvalStore.submit_scenario_approval(run_id: str, submission: EvalScenarioApprovalSubmission) -> EvalRunRecord
async SQLiteEvalStore.publish_result(claim: EvalRunClaim, result: CorpusExecutionResult, *, redact_json: Callable[[Any], Any]) -> EvalRunRecord
async SQLiteEvalStore.fail_run(claim: EvalRunClaim, code: EvalRunFailureCode, *, diagnostic: EvalRunFailureDiagnostic | None=None) -> EvalRunRecord
async SQLiteEvalStore.finish_cancel(claim: EvalRunClaim) -> EvalRunRecord
async SQLiteEvalStore.release_run(claim: EvalRunClaim) -> EvalRunRecord
async SQLiteEvalStore.load_result(run_id: str, *, max_bytes: int=CORPUS_EXECUTION_RESULT_MAX_BYTES) -> CorpusExecutionResult | None
async SQLiteEvalStore.save_captured_result(corpus: EvalCorpusDocument, result: CapturedEvaluationResultV1, *, redact_json: Callable[[Any], Any]) -> EvalResultRecord
async SQLiteEvalStore.load_result_by_revision(revision: str, *, max_bytes: int=CORPUS_EXECUTION_RESULT_MAX_BYTES) -> CorpusExecutionResult | CapturedEvaluationResultV1 | None
async SQLiteEvalStore.load_result_record(revision: str) -> EvalResultRecord | None
async SQLiteEvalStore.list_results(query: EvalResultQuery) -> EvalResultPage
async SQLiteEvalStore.set_baseline(update: EvalBaselineUpdate, *, redact_json: Callable[[Any], Any]) -> EvalBaselineMutationRecord
async SQLiteEvalStore.load_baseline(key: EvalBaselineKey) -> EvalBaselineRecord | None
async SQLiteEvalStore.load_baseline_mutation(operation_id: str) -> EvalBaselineMutationRecord | None
SQLiteEvalStore.__init__(path: str | Path, *, schema_mode: schema.SchemaMode=schema.SchemaMode.CREATE, read_only: bool=False, writer_contention_policy: SQLiteEvalWriterContentionPolicy=DEFAULT_SQLITE_EVAL_WRITER_CONTENTION_POLICY) -> None

Release source · Runtime guarantees · Capability guides

from cayu import SQLiteEvalWriterContentionPolicy

Bounded SQLite lock acquisition and retry policy for paid-effect evidence.

Decorators: @dataclass(frozen=True, slots=True).

Defaults below are source expressions; Field(...) includes schema/validation settings and default_factory creates a fresh value. Inherited declarations are included. Constructor behavior follows the model or dataclass shown in the bases/decorators.

Name Type Default
max_wait_seconds float 60.0
lock_attempt_seconds float 0.25
initial_backoff_seconds float 0.01
max_backoff_seconds float 0.25

Release source · Runtime guarantees · Capability guides