lasagnastack.base¶
lasagnastack.base
¶
Pipeline
¶
Bases: ABC
An ordered sequence of Stages run end-to-end.
Subclasses declare stages. The concrete run() handles MLflow
tracking, per-stage spans, confirmation prompts, and pipeline logging.
Override the three hook methods to customise observability behaviour
without touching the orchestration logic.
run
¶
run(
state: PipelineState, auto_confirm: bool = False
) -> PipelineState
Run all stages in order, wrapped in MLflow tracking.
Opens an MLflow experiment run and a top-level CHAIN span named
"{ClassName}.run" (using the concrete subclass name). Each stage
is executed via _run_stage, which opens an additional per-stage
CHAIN span. Falls back to uninstrumented execution when MLflow is
unreachable or unconfigured.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
state
|
PipelineState
|
Initial pipeline state. |
required |
auto_confirm
|
bool
|
When |
False
|
Returns:
| Type | Description |
|---|---|
PipelineState
|
Final pipeline state after all stages complete. |
Source code in src/lasagnastack/base.py
PipelineState
dataclass
¶
PipelineState(
input_dir: Path,
output_dir: Path,
brief_path: Path,
skill_path: Path | None = None,
critique_max_retries: int = 2,
)
Bases: ABC
Abstract base carrying configuration shared across all pipeline types.
Stage
¶
Bases: ABC
One step in a Pipeline.
Implement run() to transform the state and completion_message() to provide the text shown in the confirmation prompt before the next stage.
completion_message
abstractmethod
¶
completion_message(state: PipelineState) -> str
run
abstractmethod
¶
run(state: PipelineState) -> PipelineState