fix: DisplayStage dependency and render pipeline data flow

Critical fix for display rendering:

1. DisplayStage Missing Dependency
   - DisplayStage had empty dependencies, causing it to execute before render
   - No data was reaching the display output
   - Fix: Add 'render.output' dependency so display comes after render stages
   - Now proper execution order: source → render → display

2. create_default_pipeline Missing Render Stage
   - Default pipeline only had source and display, no render stage between
   - Would fail validation with 'Missing render.output' capability
   - Fix: Add SourceItemsToBufferStage to convert items to text buffer
   - Now complete data flow: source → render → display

3. Updated Test Expectations
   - test_display_stage_dependencies now expects 'render.output' dependency

Result: Display backends (pygame, terminal, websocket) now receive proper
rendered text buffers and can display output correctly.

Tests: All 502 tests passing
This commit is contained in:
2026-03-16 21:59:52 -07:00
parent affafe810c
commit d54147cfb4
3 changed files with 10 additions and 4 deletions

View File

@@ -520,7 +520,10 @@ def create_pipeline_from_params(params: PipelineParams) -> Pipeline:
def create_default_pipeline() -> Pipeline:
"""Create a default pipeline with all standard components."""
from engine.data_sources.sources import HeadlinesDataSource
from engine.pipeline.adapters import DataSourceStage
from engine.pipeline.adapters import (
DataSourceStage,
SourceItemsToBufferStage,
)
pipeline = Pipeline()
@@ -528,6 +531,9 @@ def create_default_pipeline() -> Pipeline:
source = HeadlinesDataSource()
pipeline.add_stage("source", DataSourceStage(source, name="headlines"))
# Add render stage to convert items to text buffer
pipeline.add_stage("render", SourceItemsToBufferStage(name="items-to-buffer"))
# Add display stage
display = StageRegistry.create("display", "terminal")
if display: