feat(evolution): EvalSignal types + post-run hook#1610
Merged
Conversation
Phase 3.1 of Epic #1565 evolution loop: define typed EvalSignal contract types and emit per-step + per-run signals from the executor into the pipeline_eval table via state.EvolutionStore.RecordEval. - internal/contract/eval_signal.go: SignalKind enum (success, failure, contract_failure, judge_score, duration, cost), Signal struct, concurrency-safe SignalSet aggregator with priority FailureClass (contract_failure > failure > "") and Aggregate -> PipelineEvalRecord. - internal/pipeline/executor_eval.go: per-run signal collector keyed by run ID; recordStepEval fires on terminal step transitions (completed, completed_empty, failed); recordPipelineEval folds the run-level aggregate, plumbs cost from costLedger, and persists via state.EvolutionStore.RecordEval. Skipped/reworking states emit no signal. UNIQUE constraint errors on duplicate (pipeline_name, run_id) inserts are swallowed for resume safety. RecordEval failures never bubble up. - Wired into executor_steps.go terminal branches and into executor_lifecycle.go finalizePipelineExecution + scheduling-loop failure/rejection exit paths.
This was referenced Apr 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
internal/contract/eval_signal.gowithSignalKindenum (success/failure/contract_failure/judge_score/duration/cost) andSignalstruct.internal/pipeline/executor_eval.gopost-run hook emitting signals on each step completion and final pipeline result.state.EvolutionStore.RecordEval(...)(PRE-5 store +pipeline_evaltable).executor.go,executor_lifecycle.go,executor_steps.go).pipeline_eval.Related to #1606
Changes
internal/contract/eval_signal.go— new contract types for evolution signals.internal/contract/eval_signal_test.go— type/enum coverage.internal/pipeline/executor_eval.go— post-run hook implementation.internal/pipeline/executor_eval_test.go— synthetic pipeline → EvolutionStore persistence test.internal/pipeline/executor.go,executor_lifecycle.go,executor_steps.go— wire hook into step + final result paths.specs/1606-evalsignal-hook/{spec,plan,tasks}.md— speckit planning artifacts.Test Plan
go test ./internal/contract/... ./internal/pipeline/...pipeline_evalrows for each step + final result.EvolutionStore.