nirs4all.pipeline.dagml.torch_topology_replay module

Trusted Python sidecars retaining a complete native Torch predictor closure.

The signed DAG package owns scheduling and replay. This module transports fitted objects, attests their owners and input declarations, and never constructs folds, OOF predictions, scores or a selected recipe.

class nirs4all.pipeline.dagml.torch_topology_replay.CapturedTorchTopology(package: dict[str, Any], artifacts: dict[str, dict[str, Any]])[source]

Bases: object

One trusted joblib member holding all native-selected fitted sidecars.

predict(X: Any) → ndarray[source]
validate() → None[source]
nirs4all.pipeline.dagml.torch_topology_replay.capture_torch_topology(training: Any, frames: list[dict[str, Any]], store: dict[Any, Any]) → dict[str, Any][source]

Capture exactly the native REFIT artifact inventory before detach.

nirs4all.pipeline.dagml.torch_topology_replay.emit_refit_attestation(task: dict[str, Any], node: dict[str, Any], bundle: dict[str, Any], artifact: dict[str, Any], fit_ids: list[str], metadata: dict[str, Any], node_lookup: Any, edges: list[dict[str, Any]]) → None[source]

Record the true completed owner FIT before its ArtifactRef is emitted.

Capture and replay must never call this function or repair an unknown origin. The native ArtifactRef signs this attestation’s digest; the trusted joblib ZIP member retains its separate byte integrity check.

nirs4all.pipeline.dagml.torch_topology_replay.learned_state_sha256(estimator: Any) → str[source]

Hash the fitted numerical state without serializing a replacement model.

nirs4all.pipeline.dagml.torch_topology_replay.operator_name(node: dict[str, Any]) → str | None[source]

Accept the two existing import-reference spellings, no embedded controls.

nirs4all.pipeline.dagml.torch_topology_replay.predict_torch_task(task: dict[str, Any], resolver: Any, node_lookup: Any, store: Any, *, target_names: list[str]) → dict[str, Any][source]

Apply a retained fitted owner on native PREDICT rows without target access.

nirs4all.pipeline.dagml.torch_topology_replay.replay_torch_topology(model: CapturedTorchTopology, spectro: Any) → tuple[ndarray, dict[str, Any]][source]

Invoke the existing loaded-package native replay for every signed node.

nirs4all.pipeline.dagml.torch_topology_replay.selected_torch_features(resolver: Any, ids: list[str], selection: list[str], *, include_augmented: bool, fold_label: str | None = None) → ndarray[source]

Project named feature columns in signed order without altering sample scope.

nirs4all.pipeline.dagml.torch_topology_replay.torch_task_scope(task: dict[str, Any], resolver: Any, node_lookup: Any, edges: list[dict[str, Any]], metadata: dict[str, Any] | None) → Iterator[None][source]

Validate the closed owner boundary and restore CPU RNG after each task.

nirs4all.pipeline.dagml.torch_topology_replay.validate_refit_attestation(bundle: dict[str, Any], artifact: dict[str, Any]) → dict[str, Any][source]

Verify original owner provenance and current state, never regenerate it.