diff --git a/.github/actions/report-lane-outcome/action.yml b/.github/actions/report-lane-outcome/action.yml index de2fe734..79b96989 100644 --- a/.github/actions/report-lane-outcome/action.yml +++ b/.github/actions/report-lane-outcome/action.yml @@ -35,8 +35,9 @@ inputs: required: true execution-file: description: >- - The Claude action step's execution_file output. May be unset, missing, - or unparsable — all degrade to failure class `other`. + The Claude action step's execution_file output. Unset or missing + classifies as `no-execution` (or `timeout`/`install-failed`); + unparsable degrades to `other`. required: false default: "" lane: @@ -121,7 +122,7 @@ outputs: failure-class: description: >- auth | rate-limit | overloaded | max-turns | timeout | - install-failed | other (empty on + install-failed | no-execution | other (empty on a genuine success; skipped-validation when the action skipped itself; incomplete when require-completion found no completed review). value: ${{ steps.outcome.outputs.failure_class }} diff --git a/.github/actions/report-lane-outcome/classify.cjs b/.github/actions/report-lane-outcome/classify.cjs index e4c6dfa4..547b5a1e 100644 --- a/.github/actions/report-lane-outcome/classify.cjs +++ b/.github/actions/report-lane-outcome/classify.cjs @@ -1,8 +1,8 @@ // Project the last claude-code-action SDK result message into safe, structured // metadata and classify a genuine infrastructure failure into exactly one coarse // class: auth | rate-limit | overloaded | max-turns | timeout | -// install-failed | other, plus credit-stop for a caller that opts in (see -// isCreditStop). Reads +// install-failed | no-execution | other, plus credit-stop for a caller that +// opts in (see isCreditStop). Reads // the action's execution_file output (which may be unset, missing, or // unparsable) and returns the review detail plus failure class. // @@ -17,7 +17,8 @@ // budget. A killed step leaves no result message, so wall time decides. // Then `installFailed` with no execution file: the action's Bun install // failed (seen as an HTTP 429 on the GitHub release download), so Claude -// never started. +// never started. Any other missing execution file is `no-execution`: the +// step ended before writing one. // 1. `api_error_status` — the Anthropic-API HTTP status the SDK records when // the last assistant turn was an API error: 401/402/403 auth, 429 // rate-limit, 5xx overloaded, every other status other. @@ -190,8 +191,11 @@ function classifyExecutionFile( if (!executionFilePath || !fs.existsSync(executionFilePath)) { return { reviewDetail: "(no execution file was produced)", - failureClass: - installFailed && !timedOut ? "install-failed" : fallbackClass, + failureClass: timedOut + ? "timeout" + : installFailed + ? "install-failed" + : "no-execution", }; } diff --git a/.github/actions/report-lane-outcome/classify.test.cjs b/.github/actions/report-lane-outcome/classify.test.cjs index b4443107..a6f615e1 100644 --- a/.github/actions/report-lane-outcome/classify.test.cjs +++ b/.github/actions/report-lane-outcome/classify.test.cjs @@ -291,14 +291,14 @@ test("an unparsable execution file degrades to `other` and says so", () => { assert.equal(result.reviewDetail, "(execution file present but unparsable)"); }); -test("no execution file at all (the action failed before producing one)", () => { +test("no execution file, no timeout and no install failure classifies as no-execution", () => { fs.rmSync(executionFile, { force: true }); let result = classifyExecutionFile(executionFile); - assert.equal(result.failureClass, "other"); + assert.equal(result.failureClass, "no-execution"); assert.equal(result.reviewDetail, "(no execution file was produced)"); - result = classifyExecutionFile(""); - assert.equal(result.failureClass, "other"); + result = classifyExecutionFile("", { timedOut: false, installFailed: false }); + assert.equal(result.failureClass, "no-execution"); assert.equal(result.reviewDetail, "(no execution file was produced)"); }); diff --git a/.github/actions/report-lane-outcome/outcome-step.test.cjs b/.github/actions/report-lane-outcome/outcome-step.test.cjs index 99bf03a4..3b17dd3f 100644 --- a/.github/actions/report-lane-outcome/outcome-step.test.cjs +++ b/.github/actions/report-lane-outcome/outcome-step.test.cjs @@ -279,7 +279,7 @@ test("a failure with no execution file keeps the fail-path class, not the skip c }); assert.equal(outputs.review_failed, "true"); assert.equal(outputs.review_ran, "false"); - assert.equal(outputs.failure_class, "other"); + assert.equal(outputs.failure_class, "no-execution"); }); test("a failed step that ran its whole timeout-minutes is a timeout", async () => { @@ -310,7 +310,7 @@ test("a failed step that stopped inside its budget, or reported no start, is not }); assert.equal( outputs.failure_class, - "other", + "no-execution", `${startedAt}/${timeoutMinutes}`, ); } diff --git a/.github/workflows/pr-review-security.yml b/.github/workflows/pr-review-security.yml index 39c3e68f..726d076d 100644 --- a/.github/workflows/pr-review-security.yml +++ b/.github/workflows/pr-review-security.yml @@ -183,7 +183,8 @@ on: value: ${{ jobs.claude.outputs.review-failed }} failure-class: description: >- - auth | rate-limit | overloaded | max-turns | timeout | other on a failure; + auth | rate-limit | overloaded | max-turns | timeout | install-failed | + no-execution | other on a failure; incomplete when the step succeeded but no completed review was found; skipped-validation when the action skipped itself; sandbox-unavailable when bubblewrap could not create a namespace, so no review ran; @@ -1105,6 +1106,8 @@ jobs: overloaded) why="the Claude service was overloaded (5xx); re-run later" ;; max-turns) why="the review used every turn --max-turns allows before finishing; raise it in claude-args" ;; timeout) why="the review step reached its timeout-minutes and was stopped before it finished" ;; + install-failed) why="the Bun install failed (often an HTTP 429 on the release download), so Claude never started; re-run the job" ;; + no-execution) why="the review step ended before it wrote an execution file, so Claude crashed or never started; read the review step's log" ;; skipped-validation) why="claude-code-action skipped itself because the caller workflow differs from the default branch's copy; nothing was reviewed" ;; incomplete) why="no completed review was found on this head: the model returned no findings count or summary, its count was below its inline comments, or the review saw only part of the diff; read the verify step's log" ;; sandbox-unavailable) why="bubblewrap could not create a namespace on this runner, so Claude Code's sandbox could not start and no review ran; enable unprivileged user namespaces (read the probe step's log)" ;; diff --git a/.github/workflows/pr-review.yml b/.github/workflows/pr-review.yml index 90c10b00..759aa650 100644 --- a/.github/workflows/pr-review.yml +++ b/.github/workflows/pr-review.yml @@ -190,7 +190,8 @@ on: value: ${{ jobs.claude.outputs.review-failed }} failure-class: description: >- - auth | rate-limit | overloaded | max-turns | timeout | other on a failure; + auth | rate-limit | overloaded | max-turns | timeout | install-failed | + no-execution | other on a failure; incomplete when the step succeeded but no completed review was found; skipped-validation when the action skipped itself; sandbox-unavailable when bubblewrap could not create a namespace, so no review ran; @@ -1235,6 +1236,8 @@ jobs: overloaded) why="the Claude service was overloaded (5xx); re-run later" ;; max-turns) why="the review used every turn --max-turns allows before finishing; raise it in claude-args" ;; timeout) why="the review step reached its timeout-minutes and was stopped before it finished" ;; + install-failed) why="the Bun install failed (often an HTTP 429 on the release download), so Claude never started; re-run the job" ;; + no-execution) why="the review step ended before it wrote an execution file, so Claude crashed or never started; read the review step's log" ;; skipped-validation) why="claude-code-action skipped itself because the caller workflow differs from the default branch's copy; nothing was reviewed" ;; incomplete) why="no completed review was found on this head: the model returned no findings count or summary, its count was below its inline comments, or the review saw only part of the diff; read the verify step's log" ;; sandbox-unavailable) why="bubblewrap could not create a namespace on this runner, so Claude Code's sandbox could not start and no review ran; enable unprivileged user namespaces (read the probe step's log)" ;; diff --git a/README.md b/README.md index 7607e0f4..18c0d28d 100644 --- a/README.md +++ b/README.md @@ -1122,7 +1122,8 @@ job is named `claude-review-status`, so its check is `security-review`, so with the canonical caller its check is `security-review / security-review`. The job's last step goes red, naming the cause, whenever no review happened: a failed attempt (`auth`, -`rate-limit`, `overloaded`, `max-turns`, `timeout`, `other`), the action +`rate-limit`, `overloaded`, `max-turns`, `timeout`, `install-failed`, +`no-execution`, `other`), the action skipping itself because the PR edits the caller workflow (`skipped-validation`), a review that did not complete (`incomplete`), or a job that ended before the review reported