Skip to content

fix(claude-lanes): classify timeouts and max turns, harden intake outcomes - #691

Merged
kyle-sexton merged 5 commits into
mainfrom
fix/claude-lanes
Oct 5, 2026
Merged

kyle-sexton merged 5 commits into
mainfrom
fix/claude-lanes

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

No related issue: Phase 7 defects D02, D04, D05, D06, D07 and D08 from the 2026-10-03 ci-workflows defect review.

Summary

The Claude lanes (pr-review, pr-review-security, intake-triage) reported a step timeout and a max-turns stop as a generic failure class, treated an intake API error as an escalation, had an install step with no timeout, carried a comment that contradicted the skipped-validation behavior, and pr-review-security did not export its job outputs to callers.

Fix

  • D02: each lane records a started-at epoch before the Claude step. report-lane-outcome takes step-started-at and step-timeout-minutes and classifies a failed step that ran its whole budget as timeout. Empty inputs never classify, and a success is never relabeled. The status steps name the class.
  • D04: result subtype error_max_turns maps to max-turns.
  • D05: intake treats only an API error (subtype: success with is_error) as an infrastructure failure. Every other error subtype still escalates with needs-human, because issue text can force one.
  • D06: the intake CLI install step gets timeout-minutes: 3, and the job goes from 12 to 13 minutes.
  • D07: the report-lane-outcome comment now says the status steps go red on a skipped validation.
  • D08: pr-review-security exports review-failed and failure-class through workflow_call, as pr-review does. README failure-class list and output note updated.
  • Not changed: permissions, tokens, track_progress, triggers, secrets. D01 is wont-fix by decision (the lanes keep write access). D03 (a step timeout kills the action's cleanup) is blocked upstream: Feature request: wall-clock time limit so cleanup steps run before a step timeout anthropics/claude-code-action#1881.

Verification

  • node --test .github/actions/report-lane-outcome/*.test.cjs .github/scripts/*.test.cjs: 242 pass. New cases cover timeout and max-turns classification, the status-step classes, the exported security outputs, and intake's API-error versus forced-error handling.
  • actionlint on the three workflows: exit 0. zizmor --offline: unchanged (2 medium, pre-existing and documented).
  • A fresh-context security review passed all seven criteria: no token, permission or trigger change; new values only through env:/with:; only fixed-token outputs exported; timeout class not spoofable; SECURITY MODEL invariants hold; no new zizmor findings. Both of its low findings are addressed here.

Related

🤖 Generated with Claude Code

kyle-sexton and others added 4 commits October 4, 2026 21:18
- report-lane-outcome takes the Claude step's start epoch and
  timeout-minutes; a failed step that ran its whole budget classifies
  as `timeout`. Subtype error_max_turns classifies as `max-turns`. The
  review lanes' status steps name both.
- intake-triage: an is_error result is an infrastructure failure, not
  a needs-human escalation (max turns still escalates); the CLI install
  step gets a 3-minute timeout inside the 12-minute job.
- pr-review-security exports review-failed and failure-class through
  workflow_call, as pr-review does.
- Correct the validation-skip comment: the status steps go red on it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…puts

- The status-step corpus covers the timeout and max-turns classes.
- Both lanes must export review-failed and failure-class through
  workflow_call, and time the review against the step's own
  timeout-minutes.
- README lists the two new failure classes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Run the apply step's script: an is_error result applies nothing,
  and a run stopped at max turns still escalates.
- README: both review lanes expose review-failed and failure-class.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Only an API error (subtype success with is_error) is an
  infrastructure failure; any other error subtype escalates, since
  issue text can force one.
- Job timeout 13 minutes, so install (3) and triage (8) leave room for
  the apply step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kyle-sexton
kyle-sexton enabled auto-merge (squash) October 5, 2026 01:23
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-05T01:26:20.315461Z aaf894a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude

claude Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 7m 4s —— View job


Code review in progress

  • Gather context (PR diff, changed files, repo guidelines)
  • Understand request (run /review:code-review per custom instructions)
  • Review report-lane-outcome action + classify.cjs changes (D02/D04)
  • Review workflow changes (intake-triage.yml, pr-review.yml, pr-review-security.yml) (D05/D06/D08)
  • Review test coverage changes
  • Review README updates (D07)
  • Adversarial validation of candidate findings
  • Post inline comments + summary

@claude

claude Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 2m 48s —— View job


Security review complete

  • Gather context (PR diff, changed files, repo rules)
  • Check instruction-surface deletions (AGENTS.md / rules files) against protected classes
  • Review report-lane-outcome action + classify.cjs changes
  • Review workflow changes (intake-triage.yml, pr-review.yml, pr-review-security.yml)
  • Review test file additions
  • Adversarially verify any candidate findings
  • Post final review

No security issues found.

Scope note: no AGENTS.md, REVIEW.md, rules file, or skill/agent body is touched by this diff, so there's no instruction-surface deletion to evaluate against the protected-class register.

What I checked, with the reasoning for why each is clean:

  • Timeout classification (step-started-at / step-timeout-minutes). report-lane-outcome/action.yml and classify.cjs compute timedOut from wall-clock time against caller-supplied inputs. Both inputs trace to values the workflow itself produces (date +%s in the compose-args step, and a literal step-timeout-minutes: number matching the Claude step's own timeout-minutes:) — nothing PR/issue-controlled feeds either value, so the class isn't spoofable from untrusted content. The timedOut branch is also only reached after an explicit outcome === "success" early return in action.yml, so it can't relabel a genuine success.
  • classify.cjs projection. The new max-turns/timeout classes still flow through the existing closed allowlist / numeric-field projection (classify.cjs#L130-L141); no raw model/error text is newly surfaced into the public annotation.
  • Intake triage ran redefinition (intake-triage.yml#L330). subtype/is_error come from the SDK's own result object, not from model-authored/issue-controlled JSON, so an attacker can't force the success+is_error shape to dodge escalation. Every other error subtype (including a prompt-forced error_max_turns/error_during_execution) still escalates. Label allowlisting, the credential regex, and @-mention escaping downstream are unchanged.
  • New pr-review-security.yml workflow_call outputs. review-failed/failure-class mirror what pr-review.yml already exposes — fixed-vocabulary strings only, no secrets, same composite action.
  • Input plumbing. All new values (step-started-at, step-timeout-minutes) pass through env:/with:, never interpolated into a run: shell string, consistent with this repo's SECURITY MODEL convention.

No CRITICAL/IMPORTANT/SUGGESTION findings to post inline.

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

claude-security-review has reviewed this pull request through 526993e; a later push is reviewed from there.

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

claude-review has reviewed this pull request through 526993e; a later push is reviewed from there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@claude

claude Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 29s —— View job


Security review complete

  • Gather context (incremental diff since aaf894a84e36a1edcd1aa6a362874e887e7d763a, repo rules)
  • Read .claude-lane/incremental.diff
  • Evaluate skip gate
  • Post final review

No security issues found.

Scope. Per the lane's incremental-review instructions, this pass covers only what changed since aaf894a84e36a1edcd1aa6a362874e887e7d763a, in:

  • .github/actions/report-lane-outcome/classify.test.cjs
  • .github/actions/report-lane-outcome/outcome-step.test.cjs
  • .github/scripts/claude-lane-status-check.test.cjs

Every other file in this PR was reviewed at aaf894a (see the prior claude-security-review comment on this thread) and is unchanged since.

Why this is a clean skip. The incremental diff (.claude-lane/incremental.diff) is formatting-only — each hunk rewraps an existing assert.equal(...) or .find((candidate) => ...) call across multiple lines (consistent with the commit message style: format lane test files for biome). No assertion, input, fixture, or control-flow logic changed in any of the three files; diffing the rewrapped calls against their prior single-line form confirms identical arguments. None of the three files is CLAUDE.md, AGENTS.md, a rules file, or a skill/agent body, so there's no instruction-surface deletion to evaluate against the protected-class register.

This satisfies the skip gate (no security-relevant surface after reading the diff) — nothing further to report for this slice.

@claude

claude Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 22s —— View job


Code review complete

  • Gather context (incremental diff, prior review baseline at aaf894a)
  • Review .claude-lane/incremental.diff against the three listed test files
  • Post final review

No findings.

Scope note: this lane last reviewed aaf894a. The only change since then, per
the supplied .claude-lane/incremental.diff, is Biome reformatting
(long-line wrapping of assert.equal/.find calls) in:

  • .github/actions/report-lane-outcome/classify.test.cjs
  • .github/actions/report-lane-outcome/outcome-step.test.cjs
  • .github/scripts/claude-lane-status-check.test.cjs

Every hunk is a pure whitespace/line-break reformat — no assertion, test
case, logic, or string content differs before and after. This matches commit
526993e ("style: format lane test files for biome"). No meaningful review
surface; skipping deep review per the skip gate (trivial/automated change,
no logic delta).

All other files in this PR were already reviewed at aaf894a per the stated
incremental scope and are unchanged since.

@kyle-sexton
kyle-sexton merged commit f973eaf into main Oct 5, 2026
28 checks passed
@kyle-sexton
kyle-sexton deleted the fix/claude-lanes branch October 5, 2026 01:39
kyle-sexton added a commit that referenced this pull request Oct 20, 2026
…ed in status (#813)

Closes #657

## Summary

When a review step fails without leaving an execution file, and it
neither timed out nor failed its Bun install, the lane reported `other`,
and the status step printed "an unclassified failure". That case now
gets its own class, `no-execution`. Both lanes' status steps also gain
an arm for `install-failed`, which the classifier could already return
but the status steps did not handle by name.

## Fix

- `.github/actions/report-lane-outcome/classify.cjs`: with no execution
file, the class is `timeout`, then `install-failed`, otherwise
`no-execution`. An execution file that exists but cannot be parsed still
classifies as `other`, which is outside this issue's scope. The class
list in the header comment now includes `no-execution`.
- `.github/actions/report-lane-outcome/action.yml`: the `execution-file`
input description and the `failure-class` output description now name
`no-execution`.
- `pr-review.yml` and `pr-review-security.yml`:
- the status steps get `install-failed)` and `no-execution)` case arms,
placed before `*)`. Both fall through to the existing `exit 1`.
- the `failure-class` output descriptions now list `install-failed` and
`no-execution`.
- `README.md`: the red-status list names `install-failed` and
`no-execution`. Only line 1125 changed (one line inserted).
- Tests:
- `classify.test.cjs`: the existing no-execution-file test now asserts
`no-execution`, including with explicit `timedOut: false, installFailed:
false`.
- `outcome-step.test.cjs`: two assertions that expected `other` for the
no-file path now expect `no-execution`.
- The existing `timeout` and `install-failed` tests are unchanged and
pass.
- Effect on other callers:
- `run-claude-cli/lane.cjs` also calls `classifyExecutionFile`. A CLI
leg that leaves no file and did not time out now reports `no-execution`.
Its summary note falls back to the `other` note.
- `intake-triage.yml`'s status allowlist maps any unknown class to
`other`, so intake output does not change.
- No step timeout was changed: `pr-review-security.yml:613` is still
`timeout-minutes: 13`.

## Verification

- `node --test .github/scripts/*.test.cjs`: 471 tests, 471 pass, 0 fail.
- `node --test .github/scripts/*.test.cjs .github/actions/*/*.test.cjs`:
559 tests, 559 pass, 0 fail. Before the edit, the same command gave
559/559. After the classifier change, 2 `outcome-step` tests failed
because they still asserted `other`; they were updated as described
above.
- `node --test .github/actions/*/*.test.cjs`: 88 tests, 88 pass, 0 fail.
- `actionlint .github/workflows/pr-review.yml
.github/workflows/pr-review-security.yml`: clean.
- `grep -n "timeout-minutes: 13"
.github/workflows/pr-review-security.yml`: line 613.

## Related

- #811 (issue #761) adds `sandbox-unavailable` to the same README
red-status paragraph, on lines 1127-1128. This PR changes only line 1125
and leaves line 1126 untouched, so the two hunks should not overlap.
Whichever PR merges second must keep both sets of rows.
- #691 added the `install-failed` class. #760 set the security step
timeout to 13 minutes. Also related: #795.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant