src.dackar.RCA.orchestrators.artifact_store =========================================== .. py:module:: src.dackar.RCA.orchestrators.artifact_store .. autoapi-nested-parse:: artifact_store — Concrete ArtifactStore and SchemaValidator implementations. Extracted from rca_reasoning_orchestrator.py. The parent module re-exports both classes for backward-compatible imports. Attributes ---------- .. autoapisummary:: src.dackar.RCA.orchestrators.artifact_store.JsonDict Classes ------- .. autoapisummary:: src.dackar.RCA.orchestrators.artifact_store.NoOpSchemaValidator src.dackar.RCA.orchestrators.artifact_store.FileArtifactStore Module Contents --------------- .. py:data:: JsonDict .. py:class:: NoOpSchemaValidator Permissive :class:`SchemaValidator` that only enforces JSON-object shape. Implements all three validator styles but performs no schema checks — useful as a default when schema validation is not wired. Every artifact is reported as valid provided it is a JSON object. .. py:method:: validate(artifact_name, payload) Legacy style: raise ``TypeError`` unless *payload* is a JSON object. .. py:method:: validate_artifact(artifact_name, payload) Per-artifact style: shape-check *payload* and return an ``ok`` report. .. py:method:: validate_run_bundle(**kwargs) Bundle style: shape-check each non-None keyword artifact and return ``ok``. .. py:class:: FileArtifactStore(root_dir) :class:`ArtifactStore` that persists artifacts as JSON files on disk. Each artifact is written atomically to ``//.json`` so a reader never observes a partial write. .. py:attribute:: root_dir .. py:method:: save(run_id, artifact_name, payload) Persist a single-object artifact and return its file path. .. py:method:: save_list(run_id, artifact_name, payload) Persist a list-valued artifact and return its file path. .. py:method:: load(run_id, artifact_name) Load and return a previously saved artifact, or None if absent. .. py:method:: is_run_complete(run_id) Return True only if run_status.json exists and run_complete is True. External callers (notebooks, replay scripts) should check this before loading or re-validating artifacts from a run directory. A run that crashed mid-pipeline will have run_complete=False (or no run_status.json at all), and its artifacts should not be treated as authoritative. .. py:method:: _write_atomic(run_id, artifact_name, payload) Write payload to /.json via temp-file + rename. The rename is atomic on POSIX and near-atomic on Windows (py3.3+). A reader can never observe a partial write.