diff --git a/internal/exec/executor_test.go b/internal/exec/executor_test.go index ee6cf2c..0b9a25e 100644 --- a/internal/exec/executor_test.go +++ b/internal/exec/executor_test.go @@ -28,8 +28,10 @@ func fakeClaudePath(t *testing.T, output string, exitCode int) string { } func TestExecutorParsesValidResult(t *testing.T) { - validJSON := `{"status":"pass","phase":"red","skill":"tdd","file_path":"/tmp/x_test.go","runner_output":"FAIL","verified":true,"model_used":"self","message":"ok"}` - claude := fakeClaudePath(t, validJSON, 0) + // Fake claude emits the --output-format json envelope that the real CLI produces. + // The executor extracts the result from the "structured_output" field. + envelope := `{"type":"result","subtype":"success","is_error":false,"structured_output":{"status":"pass","phase":"red","skill":"tdd","file_path":"/tmp/x_test.go","runner_output":"FAIL","verified":true,"model_used":"self","message":"ok"}}` + claude := fakeClaudePath(t, envelope, 0) ex := iexec.New(iexec.Config{ ClaudeBinary: claude,