Skip to content

feat(tui): extend interactive UI for multi-pipeline sequence selection and DAG preview#219

Open
nextlevelshit wants to merge 4 commits intomainfrom
209-tui-multi-pipeline
Open

feat(tui): extend interactive UI for multi-pipeline sequence selection and DAG preview#219
nextlevelshit wants to merge 4 commits intomainfrom
209-tui-multi-pipeline

Conversation

@nextlevelshit
Copy link
Collaborator

Summary

  • Adds multi-pipeline proposal selector TUI using charmbracelet/huh for accept/modify/skip workflows
  • Implements text-based DAG preview renderer showing execution order, dependencies, and parallel groups
  • Extends pipeline matrix executor with dependency tier resolution and child pipeline invocation
  • Adds gh-implement-epic pipeline with contracts, prompts, and schema definitions
  • Includes comprehensive test coverage for DAG preview, proposal selector, and matrix executor

Closes #209

Changes

TUI Extensions (internal/tui/)

  • proposal_selector.go — Multi-pipeline proposal selector with accept/modify/skip per proposal, multi-select support, and parallel group visualization
  • dag_preview.go — Text-based DAG preview renderer showing execution tiers, dependencies, and parallel-eligible groupings
  • proposal.go — Proposal data types and conversion logic between pipeline proposals and TUI display models
  • mock_proposals.go — Test fixtures for proposal-based TUI testing
  • *_test.go — Table-driven tests for DAG preview rendering, proposal selector behavior, and edge cases

Pipeline Executor (internal/pipeline/)

  • matrix.go — Extended matrix executor with dependency tier computation and child pipeline invocation support
  • matrix_test.go — Comprehensive tests for tier resolution, cycle detection, and parallel grouping
  • executor.go / types.go — Minor extensions to support matrix execution hooks

Epic Pipeline (.wave/)

  • pipelines/gh-implement-epic.yaml — New multi-step epic implementation pipeline
  • contracts/epic-report.schema.json / epic-scope-plan.schema.json — JSON schemas for epic pipeline artifacts
  • prompts/gh-implement-epic/ — Persona prompts for epic fetch-scope and report steps

CLI (cmd/wave/commands/)

  • run.go — Proposal mode integration in the run command
  • run_proposal_test.go — Tests for proposal flow entry point

Specs (specs/209-tui-multi-pipeline/)

  • spec.md / plan.md / tasks.md — Feature specification, implementation plan, and task tracking

Test Plan

  • Unit tests for DAG preview rendering cover: single pipeline, multi-tier DAGs, parallel groups, empty input, cycle detection
  • Proposal selector tests cover: accept all, skip all, modify selections, single pipeline, no proposals
  • Matrix executor tests cover: dependency tier computation, parallel grouping, child invocation hooks, error propagation
  • All tests pass with go test ./...

Add tiered execution support to MatrixStrategy, enabling items with
dependencies to execute in topologically-sorted tiers. Items within
a tier run in parallel; tiers execute sequentially.

New MatrixStrategy fields:
- item_id_key: dot-path to unique ID field in each item
- dependency_key: dot-path to dependency array in each item
- child_pipeline: name of pipeline to invoke per item (Phase 2)
- input_template: Go template for constructing input (Phase 2)

New MatrixResult fields: Skipped, SkipReason, ItemID

Implementation uses Kahn's algorithm (BFS topological sort) to compute
tiers. Dependency failure propagation skips downstream items but allows
unrelated items to continue.

6 new tests covering independent items, linear chains, diamond
dependencies, dependency failure propagation, cycle detection, and
missing dependency validation.
Add the ability for matrix strategy steps to invoke a full child pipeline
per matrix item instead of executing a single step. This enables the
gh-implement-epic pipeline to fan out gh-implement runs per subissue.

Key additions:
- NewChildExecutor() factory on DefaultPipelineExecutor for independent state
- ChildPipeline field on MatrixStrategy to name or path a child pipeline
- InputTemplate field with Go text/template rendering for item → input
- Refactored tieredExecution to accept a matrixWorkerFunc for reuse
- 5 new tests: LoadsAndExecutes, InputTemplate, WithTiers, PartialFailure, NotFound
New pipeline that consumes gh-scope output and implements all subissues
by fanning out parallel gh-implement child pipeline runs, respecting
the dependency ordering from the scope plan.

Pipeline steps:
- fetch-scope: parse epic's scope comment, extract subissues + deps
- implement-subissues: matrix strategy with child_pipeline + dependency tiers
- report: post implementation summary comment on parent epic

Includes:
- Pipeline YAML with matrix strategy using child_pipeline and dependency_key
- Prompt files for fetch-scope and report steps
- Contract schemas for epic-scope-plan and epic-report
- Mock adapter output for testing (gh-implement-epic routing before gh-implement)
…n and DAG preview

Add multi-pipeline proposal TUI with accept/modify/skip flow, text-based
DAG preview, and parallel group visualization. Wire into CLI via --propose flag.

New files:
- internal/tui/proposal.go — Proposal, ProposalDecision, ProposalResult types
  with validation (empty name, circular dependency detection)
- internal/tui/dag_preview.go — Text-based DAG renderer using Kahn's algorithm
  with box-drawing connectors, parallel group labels, terminal-width-aware
  label truncation
- internal/tui/proposal_selector.go — RunProposalSelector entry point with
  per-proposal accept/modify/skip, parallel group multi-select, inline DAG
  preview, and confirmation
- internal/tui/mock_proposals.go — MockProposalProvider for development/testing

Modified files:
- cmd/wave/commands/run.go — Added --propose flag dispatching to
  RunProposalSelector when interactive with mock proposals (gated on #208)

Closes #209
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(tui): extend interactive UI for multi-pipeline sequence selection and DAG preview

1 participant