You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor: model pipeline stages as executable specs #323
The low-churn audit in #315 found that polylogue/pipeline/run_execution.py still carries long orchestration paths, especially around run_sources, nested helper functions, status/log/state handling, and stage sequencing.
The current implementation is type-safe but still path-dependent: stage behavior is encoded procedurally rather than as a clear executable model.
Scope
Introduce a table-driven stage execution model, likely centered on a PipelineStageSpec or equivalent, to make stage dependencies, cache behavior, status logging, and materialization boundaries explicit.
Acceptance criteria
Stage order and stage-specific behavior are represented by data/spec objects where practical.
Common logging/status/error handling is shared rather than duplicated in nested functions.
Existing run behavior and stage names remain compatible.
Pipeline-focused tests cover at least parse/materialize/render/index paths through the new model.
Starting #323 on feature/refactor/pipeline-executable-stage-specs.
Initial boundary:
Focus on polylogue/pipeline/run_execution.py and directly adjacent stage/run tests.
Preserve existing stage names and operator behavior.
Make stage order/dependencies/status behavior explicit through executable specs where practical, instead of widening the pipeline scope into acquisition or source splitting work reserved for refactor: split source acquisition into explicit components #324.
First step is to map the current run_sources path and existing pipeline tests before cutting the stage spec shape.
Added a PipelineStageSpec catalog for leaf-stage execution facts: log/metric stage names, context-token policy, FTS trigger suspension, and whether the normal pipeline owns execution.
Replaced the default-vs-explicit run_sources() stage dispatch branches with a single spec-driven execution loop while keeping stage helpers scoped to their stage bodies.
Kept embed in the stage catalog as externally managed because the CLI dispatches embedding before entering run_sources(); this preserves existing direct run_sources(stage="embed") compatibility instead of changing it into an API-key-requiring path.
Added unit coverage that the spec catalog covers the full leaf-stage vocabulary and preserves sequence/FTS policy, plus existing parse/materialize/render/index sequencing coverage remains green.
Activity
Sinity commentedon Apr 22, 2026
Starting #323 on
feature/refactor/pipeline-executable-stage-specs.Initial boundary:
polylogue/pipeline/run_execution.pyand directly adjacent stage/run tests.First step is to map the current
run_sourcespath and existing pipeline tests before cutting the stage spec shape.Sinity commentedon Apr 22, 2026
Progress update for #323:
PipelineStageSpeccatalog for leaf-stage execution facts: log/metric stage names, context-token policy, FTS trigger suspension, and whether the normal pipeline owns execution.run_sources()stage dispatch branches with a single spec-driven execution loop while keeping stage helpers scoped to their stage bodies.embedin the stage catalog as externally managed because the CLI dispatches embedding before enteringrun_sources(); this preserves existing directrun_sources(stage="embed")compatibility instead of changing it into an API-key-requiring path.Focused verification so far:
ruff check polylogue/pipeline/run_execution.py polylogue/pipeline/stage_specs.py tests/unit/pipeline/test_run_sources.pymypy polylogue/pipeline/run_execution.py polylogue/pipeline/stage_specs.pypytest -q tests/unit/pipeline/test_run_sources.pydevtools render-all --checkNext: commit this slice, run full
devtools verify, then push/open the PR if the full local gate passes.refactor(pipeline): catalog executable stage specs (#370)
refactor(pipeline): catalog executable stage specs (#370)