nirs4all.pipeline.dagml.core_archive_replay module
Fail-closed public replay adapter for Core Archive V2/V3.
This module only performs bounded routing and host-input adaptation. Core owns archive validation, DAG-ML owns replay contracts and scheduling, and the Methods runtime owns numerical execution. No legacy runner or Python model callback is part of this path.
- exception nirs4all.pipeline.dagml.core_archive_replay.CoreArchiveDependencyError(dependency: str, message: str, *, mitigation: str)[source]
Bases:
CoreArchiveReplayErrorA required native Archive V2 component is absent or incompatible.
- exception nirs4all.pipeline.dagml.core_archive_replay.CoreArchiveReplayError[source]
Bases:
RuntimeErrorA recognized Core archive cannot be replayed safely.
- class nirs4all.pipeline.dagml.core_archive_replay.CoreArchiveValidation(core: Any, package: dict[str, Any], predictors: tuple[dict[str, Any], ...], methods_library_path: str, methods_library_sha256: str)[source]
Bases:
objectCore-derived, byte-bound evidence cached by one strict consumer.
- nirs4all.pipeline.dagml.core_archive_replay.detect_core_archive_version(path: str | Path) int | None[source]
Return 2/3 only for an exact Core archive routing manifest.
The manifest read is a bounded routing hint, not archive validation. A recognized archive is subsequently reopened and fully validated by Core. Legacy/non-Core bundles return
Noneand keep their historical path. A manifest that claims the Core family but is inconsistent fails closed.
- nirs4all.pipeline.dagml.core_archive_replay.predict_core_methods_archive_v2(archive_path: str | Path, data: Any, *, methods_library_path: str | Path | None, validated_archive: tuple[Path, CoreArchiveValidation] | None = None, expected_archive_fingerprint: str | None = None, outcome_id: str = 'outcome:nirs4all.core_archive_predict', run_id: str = 'run:nirs4all.core_archive_predict') tuple[ndarray, dict[str, Any]][source]
Replay one exact, explicitly identified raw cohort through Core V2.
validated_archiveis the immutable package-contract cache owned by a loadedSession. Core still reopens and validates the archive for every replay, and the Methods runtime keeps all native handles scoped to that call. Whenexpected_archive_fingerprintis supplied, the adapter performs one bounded-memory full-file hash before readingdata; this binds the single Session cache entry to its source and is not a general replay-result cache.