nirs4all.pipeline.storage.artifacts.artifact_registry module
Artifact Registry V3 - Central registry for artifact management.
This module provides the ArtifactRegistry class which serves as the central hub for artifact operations in the V3 artifacts system:
Chain-based artifact identification for complete execution path tracking
Content-addressed storage with global deduplication
Dependency graph tracking for stacking/transfer
Cleanup utilities for orphan detection and deletion
V3 Key Changes: - Uses OperatorChain for artifact identification instead of V2 ID format - Chain hash-based artifact IDs for deterministic identification - Unified handling of branching, multi-source, stacking, and bundles
The registry works with centralized storage at workspace/binaries/<dataset>/.
- class nirs4all.pipeline.storage.artifacts.artifact_registry.DependencyGraph[source]
Bases:
objectTracks artifact dependencies for stacking and transfer.
Maintains a directed graph where edges represent “depends on” relationships. Supports transitive dependency resolution with cycle detection.
- add_dependencies(artifact_id: str, depends_on: list[str]) None[source]
Add multiple dependencies at once.
- Parameters:
artifact_id – The dependent artifact
depends_on – List of artifacts being depended upon
- add_dependency(artifact_id: str, depends_on: str) None[source]
Add a dependency relationship.
- Parameters:
artifact_id – The dependent artifact
depends_on – The artifact being depended upon
- get_dependencies(artifact_id: str) list[str][source]
Get direct dependencies of an artifact.
- Parameters:
artifact_id – Artifact to query
- Returns:
List of artifact IDs this artifact depends on
- get_dependents(artifact_id: str) list[str][source]
Get artifacts that directly depend on this artifact.
- Parameters:
artifact_id – Artifact to query
- Returns:
List of artifact IDs that depend on this artifact
- remove_artifact(artifact_id: str) None[source]
Remove an artifact and its edges from the graph.
- Parameters:
artifact_id – Artifact to remove
- resolve_dependencies(artifact_id: str, max_depth: int = 100) list[str][source]
Get all transitive dependencies (topologically sorted).
Returns dependencies in order suitable for loading - dependencies before dependents.
- Parameters:
artifact_id – Starting artifact
max_depth – Maximum recursion depth (prevents cycles)
- Returns:
List of all dependencies in topological order
- Raises:
ValueError – If cycle detected or max depth exceeded