Skip to content

Sample CI: read the verdicts when rook run exits 2 - #90

Merged
gauravBansal06 merged 1 commit into
mainfrom
chore/sample-ci-exit-2
Dec 2, 2026
Merged

gauravBansal06 merged 1 commit into
mainfrom
chore/sample-ci-exit-2

Conversation

@samyakLambda

Copy link
Copy Markdown
Contributor

Why

rook run exits 2 when the run finished and at least one scenario failed (README, "Exit"). The industry samples' CI runner, samples/industry-agents/scripts/rook-ci.mjs, refused every non-zero exit before it read the report. A finished run with a failed scenario was reported as Rook exited with status 2, not as the scenario and criterion that failed.

Change

  • assessNativeRun treats 0 and 2 as a finished run and reads the report and the verdicts. 1, 3, 4 and any other code still fail with Rook exited with status N.
  • A run that exits 2 never passes the gate, even if every verdict it reads is Pass.
  • The runner still exits with Rook's status, so a failed scenario still exits 2.
  • The 8 copies under demos/*/scripts/rook-ci.mjs are regenerated with npm run demos:build, and only those files changed. On current main the build also rewrites docs/demo-walkthrough.md and docs/insurance-validation.md in each demo. That drift is unrelated, so it is left out of this PR.
  • One added test: an exit 2 with a Fail verdict names the scenario and criterion; 1, 3 and 4 name the exit status; an exit 2 with all-Pass verdicts is refused.

Checks

  • samples/industry-agents: npm test (55 pass), npm run check, npm run rook:coverage, npm run samples:check, npm run test:standalone (9 pass), all exit 0.
  • scripts/test-*.sh: 7 of 7 pass.
  • Mutations: removing the exit-2 exception, or the exit-2 guard, each fails the new test.
  • No credentials and no model calls. The industry-rook-ci workflow (manual dispatch) was not run.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KxTgyHx8kTjGzMoENMoEaj

rook run exits 2 when the run finished and a scenario failed. The industry
samples CI runner refused any non-zero exit before reading the report, so it
reported "Rook exited with status 2" instead of the failed scenario. Read the
verdicts for 0 and 2, keep refusing 1, 3 and 4, and never pass a run that
exited 2. The 8 demo copies are regenerated with demos:build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KxTgyHx8kTjGzMoENMoEaj
@vipulkv

vipulkv commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

Continuous Review — Round 1 — ✅ PASS

Head: 8e0a569 Reviewer panel: 4 CI: pass=8
3 reviewers, zero HIGH/CRITICAL

Per-reviewer summary

Reviewer Verdict CRIT HIGH MED LOW Duration
agy ABSTAIN_ERROR 0 0 0 0 6s
claude PASS 0 0 0 1 39s
glm PASS 0 0 0 1 109s
codex PASS 0 0 2 0 249s

Findings

codex — 2 finding(s)

[MED] An unrunnable scenario hides a completed failure

  • File: samples/industry-agents/scripts/rook-ci.mjs:147
  • Scenario: Run the banking demo with --only SC-106,SC-107 --profile demo-slow-tool. SC-106 can fail its latency criterion while SC-107 is unrunnable because the profile lacks token usage. When Rook exits 2 with SC-106's verdict, the read for SC-107 throws ENOENT before assessment. The CI summary reports only the missing file and omits SC-106 and its failed criterion. All eight generated runners share this path.

[MED] Empty stdout masks the CLI exit diagnostic

  • File: samples/industry-agents/scripts/rook-ci.mjs:141
  • Scenario: Rook can reject a command with exit 1 and write its diagnostic only to stderr. The runner parses stdout first, so problems contains only Unexpected end of JSON input and never reaches the status diagnostic. The new test passes a complete success-shaped document directly to assessNativeRun, so it misses this path. All eight generated runners have the same ordering.

Auto-posted by continuous-review-agent v1.3 (findings now include a suggested fix / code snippet). Contact @vipulkv for feedback.

@gauravBansal06
gauravBansal06 merged commit 7fa5e77 into main Dec 2, 2026
8 checks passed
@gauravBansal06
gauravBansal06 deleted the chore/sample-ci-exit-2 branch December 2, 2026 17:07
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.

3 participants