nirs4all.pipeline.storage.chain_builder module

Chain builder for converting ExecutionTrace to WorkspaceStore chain format.

Bridges the trace/artifact system and the WorkspaceStore by converting an ExecutionTrace (recorded during pipeline execution) into the chain dict format expected by store.save_chain().

When a pipeline has multiple model steps, the builder produces one chain per model step so that each prediction can be resolved independently.

Example

>>> from nirs4all.pipeline.storage.chain_builder import ChainBuilder
>>> chain_builder = ChainBuilder(trace, artifact_registry)
>>> for chain_data in chain_builder.build_all():
...     store.save_chain(pipeline_id=pipeline_id, **chain_data)