Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/actions/report-lane-outcome/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 }}
Expand Down
14 changes: 9 additions & 5 deletions .github/actions/report-lane-outcome/classify.cjs
Original file line number Diff line number Diff line change
@@ -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.
//
Expand All @@ -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.
Expand Down Expand Up @@ -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",
};
}

Expand Down
8 changes: 4 additions & 4 deletions .github/actions/report-lane-outcome/classify.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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)");
});

Expand Down
4 changes: 2 additions & 2 deletions .github/actions/report-lane-outcome/outcome-step.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand Down Expand Up @@ -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}`,
);
}
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/pr-review-security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)" ;;
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/pr-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)" ;;
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading