nirs4all.pipeline.storage.workspace_read_contract module

Published read-only projection contracts for WorkspaceStore schema v5.

The contract is a distribution resource so native consumers can use the same bounded SQL projections without importing WorkspaceStore or recreating its private schema knowledge. It is intentionally limited to bounded run, pipeline, and explicitly directed chain-ranking projections. Studio’s high-level results policy, arrays, artifacts, predictions and mutations need their own contracts.

The results-summary contract is deliberately a separate resource: it composes the stable low-level read projection with the ranking and serialization policy of the compact Studio results response without changing the read-v1 bytes.

The run-detail HTTP contract is a cutover manifest plus a Python oracle for the inputs owned by this distribution. It deliberately leaves Studio catalogue, presentation/runtime compatibility, and legacy-manifest policies external.

nirs4all.pipeline.storage.workspace_read_contract.studio_run_detail_http_contract() → dict[str, Any][source]

Return the version-checked run-detail HTTP composition contract.

The contract publishes complete Store-v5 owner inputs, but intentionally forbids route selection until the separately owned Studio and legacy policies named in cutover.blocked_on are versioned and qualified.

nirs4all.pipeline.storage.workspace_read_contract.studio_run_detail_http_inputs_v1(workspace_path: str | Path, run_id: str) → dict[str, Any] | None[source]

Return the Store/library-owned inputs for Studio run-detail HTTP.

This is not the complete HTTP response. Dataset linking, Studio’s CV label vocabulary, runtime compatibility aliases, rerun readiness, and the legacy manifest branch remain external exactly as declared by studio_run_detail_http_contract().

nirs4all.pipeline.storage.workspace_read_contract.workspace_store_read_contract() → dict[str, Any][source]

Return the version-checked, read-only WorkspaceStore contract.

Consumers must refuse a database whose PRAGMA user_version differs from the contract’s exact store schema version before executing its query.

nirs4all.pipeline.storage.workspace_read_contract.workspace_store_results_summary_contract() → dict[str, Any][source]

Return the version-checked Store-v5 results-summary contract.

This policy is self-contained except for its explicit reference to the studio_chain_ranked_v1 projection in workspace_store_read_contract(). It owns the complete, paged source query plus selection, synthetic-refit, metric-direction and JSON/null serialization semantics needed by a native consumer of the fixed n=5 summary surface.