Skip to content

feat(pipeline): add proposal engine for context-aware pipeline sequencing#218

Open
nextlevelshit wants to merge 4 commits intomainfrom
208-pipeline-proposal-engine
Open

feat(pipeline): add proposal engine for context-aware pipeline sequencing#218
nextlevelshit wants to merge 4 commits intomainfrom
208-pipeline-proposal-engine

Conversation

@nextlevelshit
Copy link
Collaborator

Summary

  • Add a proposal engine that consumes codebase health analysis artifacts and the pipeline catalog to recommend optimal pipeline sequences
  • Implement forge-aware filtering to only propose pipelines matching the detected forge type (GitHub, Gitea, etc.)
  • Build dependency graph construction with parallel eligibility detection for independent pipelines
  • Add scoring/ranking system to prioritize proposals based on codebase state relevance
  • Extend the matrix executor with dependency tiers and child pipeline invocation support
  • Add gh-implement-epic pipeline for orchestrating multi-issue epic implementations

Closes #208

Changes

Proposal Engine (internal/pipeline/proposal/)

  • types.go — Core domain types: Proposal, ProposalItem, HealthArtifact, PipelineCatalogEntry, DependencyEdge
  • engine.go — Main engine that orchestrates catalog discovery, forge filtering, scoring, and dependency ordering
  • catalog.go — Pipeline catalog discovery from manifest and filesystem
  • filter.go — Forge-aware pipeline filtering (gh-* for GitHub, gitea-* for Gitea, etc.)
  • scoring.go — Relevance scoring based on health artifact signals and pipeline metadata
  • integration_test.go — End-to-end integration tests for the full proposal generation flow

Matrix Executor Enhancements (internal/pipeline/)

  • matrix.go — Added dependency tier computation and child pipeline invocation to the matrix executor
  • matrix_test.go — Comprehensive tests for tier-based execution and child pipeline spawning
  • types.go — Added ChildPipelineResult type for tracking invoked pipeline outcomes

Epic Pipeline (.wave/pipelines/, .wave/contracts/, .wave/prompts/)

  • gh-implement-epic.yaml — New pipeline for orchestrating multi-issue epic implementations
  • epic-report.schema.json / epic-scope-plan.schema.json — Contract schemas for epic pipeline artifacts
  • fetch-scope.md / report.md — Persona prompts for epic scoping and reporting steps

Specifications (specs/208-pipeline-proposal-engine/)

  • spec.md — Feature specification
  • plan.md — Implementation plan
  • tasks.md — Task breakdown

Test Plan

  • Unit tests for all proposal engine components (types, catalog, filter, scoring)
  • Integration test validating end-to-end proposal generation from health artifact to structured output
  • Unit tests for matrix executor dependency tiers and child pipeline invocation
  • All tests run with go test ./... and pass

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)
…cing (#208)

Implement a separate proposal engine package (internal/pipeline/proposal/)
that consumes codebase health analysis artifacts and the pipeline catalog
to produce structured, prioritized pipeline execution proposals.

Key components:
- Core types with ForgeType enum, HealthArtifact, ProposalItem, Proposal
- Pipeline catalog discovery with YAML parsing and deduplication
- Forge-type filtering by pipeline name prefix (gh-*, gl-*, gt-*, bb-*)
- Relevance scoring via Scorer interface with DefaultScorer mapping
  health signals to pipeline recommendations
- Engine with dependency edge construction and parallel group assignment
- JSON Schema contract for the proposal output artifact

Design decision: built as a separate package rather than extending
MetaPipelineExecutor, since the proposal engine performs deterministic
pipeline selection (pure Go) vs the meta executor's LLM-based generation.
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(pipeline): pipeline proposal engine — context-aware sequencing from health artifact

1 participant