-
Notifications
You must be signed in to change notification settings - Fork 1
Pipeline Plan 26
The plan file is in a sensitive location. Let me present the plan directly since the pipeline artifacts directory requires special permissions.
Add a DVR-style replay system to the Shipwright dashboard that lets users scrub through any completed (or running) pipeline run frame-by-frame. The feature reconstructs pipeline state from the existing events.jsonl event stream using an event-sourcing pattern — no new data collection is needed.
The foundation is already solid:
-
events.jsonlcaptures 40+ event types with timestamps, issue numbers, stages, and custom fields -
dashboard/server.tsalready hasgetPipelineDetail(),getTimeline(), andreadEvents() - The dashboard frontend already has tab navigation, SVG pipeline visualization (
renderPipelineSVG), and WebSocket state management - The timeline tab already shows Gantt-like stage segments
| File | Action | Purpose |
|---|---|---|
dashboard/server.ts |
Modify | Add 3 API endpoints + replay types + event reconstruction logic |
dashboard/public/app.js |
Modify | Add Replay tab with timeline scrubber, frame viewer, narrative panel |
dashboard/public/styles.css |
Modify | Add scrubber/frame viewer/narrative styles |
dashboard/public/index.html |
Modify | Add Replay tab button to navigation |
scripts/sw-pipeline.sh |
Modify | Enrich key events with activity descriptions |
scripts/sw-pipeline-test.sh |
Modify | Add replay-related test cases |
- Add
ReplayFrame,PipelineNarrative,PipelineReplayinterfaces - Implement
getPipelineReplay(issue)— event-sourcing walk that builds frames from filtered events, tracking current stage, completed stages, iteration count, test status - Implement
generateNarrative()— template-based summary from frame data (e.g., "Pipeline ran 8 stages in 12m. Built in 15 iterations with 2 auto-fixed failures.") - Implement
exportReplayMarkdown()— markdown report with timeline table, key decisions, event log
Add before the existing /api/pipeline/{issue} catch-all:
-
GET /api/pipeline/{issue}/replay— full replay data -
GET /api/pipeline/{issue}/events— raw filtered events -
GET /api/pipeline/{issue}/export— markdown download
- Add Replay tab (contextual — opens when clicking a pipeline)
- Timeline scrubber: SVG bar with color-coded stage segments (green=success, yellow=retry, red=fail, blue=running), draggable handle, keyboard arrows, play/pause auto-advance
- Frame viewer: stage progress bar, event details card, iteration counter, test status, decision highlights
- Narrative panel: summary paragraph, clickable key decisions list (seeks scrubber), stage breakdown table
- Permalink (
/#replay/{issue}) + copy link + export button
- Enrich
stage.started/stage.completed/pipeline.completedevents withactivityfield - Add mock events.jsonl test data, verify frame count, stage progression, narrative keywords, markdown export
- Task 1: Add ReplayFrame, PipelineNarrative, PipelineReplay TypeScript interfaces
- Task 2: Implement
getPipelineReplay()event-sourcing function - Task 3: Implement
generateNarrative()template-based narrative - Task 4: Implement
exportReplayMarkdown()markdown generator - Task 5: Add
/replay,/events,/exportAPI routes (fix route ordering) - Task 6: Add Replay tab to dashboard navigation
- Task 7: Build timeline scrubber SVG with drag/keyboard/playback
- Task 8: Build frame viewer panel (stage progress, event details, decisions)
- Task 9: Build narrative panel (summary, key decisions, stage breakdown)
- Task 10: Add permalink (
/#replay/{issue}) and export/copy buttons - Task 11: Enrich pipeline events with
activitydescriptions - Task 12: Add replay tests to sw-pipeline-test.sh
- Task 13: Run
npm test— all 22 suites pass
Unit: Mock events.jsonl with complete pipeline run → verify frame count, stage progression, narrative keywords, markdown sections
Manual: Start dashboard → open Replay tab → drag scrubber → click key decisions → export markdown → test permalink
Integration: npm test — all 22 existing suites pass, no regressions
- Pipeline runs replayable after completion (event-sourced frames)
- Timeline scrubber with color-coded stage segments
- Frame viewer with stage state, event details, iteration info
- Template-based narrative summary with key decisions
- Shareable permalink per pipeline run
- Markdown export via download button
- All 22 test suites pass
- Bash 3.2 compatible, follows existing code patterns