forked from genewildish/Mainline
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:
@@ -111,7 +111,7 @@ class DisplayStage(Stage):
|
||||
|
||||
@property
|
||||
def dependencies(self) -> set[str]:
|
||||
return set()
|
||||
return {"render.output"} # Display needs rendered content
|
||||
|
||||
def init(self, ctx: PipelineContext) -> bool:
|
||||
w = ctx.params.viewport_width if ctx.params else 80
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user