Skip to content

feat(evolution): EvalSignal types + post-run hook#1610

Merged
nextlevelshit merged 1 commit into
mainfrom
1606-evalsignal-hook-v2
Apr 30, 2026
Merged

feat(evolution): EvalSignal types + post-run hook#1610
nextlevelshit merged 1 commit into
mainfrom
1606-evalsignal-hook-v2

Conversation

@nextlevelshit
Copy link
Copy Markdown
Collaborator

Summary

  • Add internal/contract/eval_signal.go with SignalKind enum (success/failure/contract_failure/judge_score/duration/cost) and Signal struct.
  • Add internal/pipeline/executor_eval.go post-run hook emitting signals on each step completion and final pipeline result.
  • Persist signals to state.EvolutionStore.RecordEval(...) (PRE-5 store + pipeline_eval table).
  • Wire hook into executor lifecycle (executor.go, executor_lifecycle.go, executor_steps.go).
  • Tests: contract types coverage + synthetic pipeline run verifying rows in 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/...
  • Synthetic pipeline test verifies pipeline_eval rows for each step + final result.
  • Manual: run any pipeline; confirm signals persisted via EvolutionStore.

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.
@nextlevelshit nextlevelshit merged commit efab252 into main Apr 30, 2026
15 checks passed
@nextlevelshit nextlevelshit deleted the 1606-evalsignal-hook-v2 branch April 30, 2026 08:13
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.

1 participant