fix: report command start failures instead of phantom exit 0 - #1
fix: report command start failures instead of phantom exit 0#1matheusht wants to merge 1 commit into
Conversation
ExecRunner.Run swallowed start failures (missing binary, bad path, permission denied): when the process never started, ProcessState was nil, so Run returned (0, "", "", nil). Evidence gates then saw a phantom exit:0 and PASSED checks that never ran — a misconfigured check node silently passed proof gates, defeating corral's evidence guarantee. Return the real error when the command never started. startCheck and startMerge surface the failure through their gates (exit 1 with the error as feedback) instead of erroring the whole run. Regression tests cover the ExecRunner primitive, the command gate, and the check and merge scheduler paths; all fail on the previous behavior.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughCommand startup failures now return execution errors from verification. Check and merge scheduler gates convert those failures into recorded failed results, allowing runs to settle. Regression tests cover missing binaries for direct verification, check nodes, and merge verification. ChangesVerification and scheduling failure handling
Estimated code review effort: 3 (Moderate) | ~20 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
verify.ExecRunner.Runswallowed command start failures. When a command's binary does not exist (bad path, permission denied),cmd.Run()returns an error butcmd.ProcessStateisnil, so the function returned(0, "", "", nil). Evidence gates then saw a phantomexit: 0and passed checks that never actually ran.That meant a misconfigured check/merge node (e.g. a typo'd binary name, or a tool missing on the worker) would silently pass corral's proof gates — directly undermining the "proof, not promises" guarantee.
Fix
ExecRunner.Runnow returns the real error when the command never started (err != nil && cmd.ProcessState == nil). Legit non-zero exits and timeouts are unchanged (they setProcessState).startCheck/startMerge(scheduler) now surface a start failure through their evidence gates (exit 1with the real error as stderr feedback) instead of returning an error that would bubble up and kill the run loop.Tests
All four new regression tests fail on the previous code and pass with the fix:
TestExecRunnerReportsStartFailure— missing binary returns a real error, never a clean exit 0.TestCommandGateDoesNotPassOnMissingBinary— command gate fails when the binary is absent.TestCheckNodeFailsGateOnMissingBinary— scheduler check node landsfailed(run settles, no phantom pass).TestMergeFailsOnMissingVerificationBinary— scheduler merge node landsfailed(run settles).Verification
make test— all packages passgo test -race— all packages passgo vet ./...+ gofmt — cleanSummary by CodeRabbit
Bug Fixes
Tests