Commit 3afeb24c
3afeb24c320dMerged
Scott Nixon <[email protected]> · 9 months ago · 11 files · +2 added · ~9 modified
Description
Implement Phase 4: Pipeline execution with live progress (attractor-krz)
Complete implementation of real-time pipeline execution with streaming progress visualization.
Files Created (2):
- server/pipeline.rs: start_pipeline server function with background execution (~270 lines)
- Spawns tokio task for non-blocking pipeline execution
- Custom execution loop with SSE event emission at node boundaries
- Validates DOT graph and handles errors gracefully
- components/execution_node.rs: ExecutionNode component with status indicators (~62 lines)
- NodeStatus enum: Pending, InProgress, Success, Failed, Skipped
- Collapsible content display with cost tracking
Files Modified (7):
- pages/execution.rs: Complete rebuild with Execute button and SSE client (~260 lines total)
- Wire Execute button to start_pipeline server function
- SSE client pattern reused from EditorPage (Phase 3)
- Real-time node rendering with live status updates
- Total cost tracking and error display
- pages/editor.rs: Added "Execute Pipeline →" navigation button (+13 lines)
- server/mod.rs: Exported pipeline module with SSR feature gates (+5 lines)
- components/mod.rs: Exported execution_node module (+1 line)
- lib.rs: Made server module always available for client stubs (+2 lines)
- Cargo.toml: Added dependencies (attractor-pipeline, attractor-dot, attractor-types, chrono) (+8 lines)
- server/generate.rs: Added SSR feature gates for StreamEvent (+2 lines)
Architecture:
- EditorPage → "Execute Pipeline" → ExecutionPage with SSE stream
- start_pipeline spawns background task with execute_pipeline_with_streaming()
- Custom execution loop emits node_start, node_complete, error events via SSE
- ExecutionPage renders live updates with reactive signals
Success Criteria Met: ✅ start_pipeline server function implemented ✅ Execute button wired and functional ✅ ExecutionNode progress visualization working ✅ Real-time cost tracking displayed ✅ Error handling with user feedback ✅ All tests passing, 0 clippy warnings in attractor-web ✅ Workspace compiles successfully
Testing:
- Workspace compilation: PASS (0.15s)
- attractor-web unit tests: PASS (9.83s)
- Clippy (attractor-web): 0 warnings (0.13s)
- SSR feature: PASS (0.35s)
Total: 9 files, 296 insertions, 9 deletions
Details
- Commit
- 3afeb24c320d
- Parent
- 2af2e4f05cb5
Cargo.lockmodifiedView file
name = "attractor-web"version = "0.2.0"dependencies = [ "attractor-dot", "attractor-pipeline", "attractor-types", "axum", "chrono", "console_error_panic_hook", "futures", "gloo-net",crates/attractor-web/Cargo.tomlmodifiedView file
Loading diff…
crates/attractor-web/src/components/chat_input.rsmodifiedView file
Loading diff…
crates/attractor-web/src/components/execution_node.rsaddedView file
Loading diff…
crates/attractor-web/src/components/mod.rsmodifiedView file
Loading diff…
crates/attractor-web/src/lib.rsmodifiedView file
Loading diff…
crates/attractor-web/src/pages/editor.rsmodifiedView file
Loading diff…
crates/attractor-web/src/pages/execution.rsmodifiedView file
Loading diff…
crates/attractor-web/src/server/generate.rsmodifiedView file
Loading diff…
crates/attractor-web/src/server/mod.rsmodifiedView file
Loading diff…
crates/attractor-web/src/server/pipeline.rsaddedView file
Loading diff…