Skip to content

fix(panicbot): report panic-attack's own severity to the verdict grid - #726

Merged
hyperpolymath merged 2 commits into
mainfrom
fix/panicbot-grid-severity-parity
Dec 5, 2026
Merged

hyperpolymath merged 2 commits into
mainfrom
fix/panicbot-grid-severity-parity

Conversation

@hyperpolymath

@hyperpolymath hyperpolymath commented Dec 5, 2026 •

Copy link
Copy Markdown
Owner

Problem

The 26 Nov grid had panicbot and panic-attack both on cbf2b935, yet their rows disagreed on 11 of 37 PRs.

panicbot printed the fleet severity word on --format json scan. The fleet Severity has four levels and no critical. The grid's norm_sev (standards scripts/lib/verdict-grid.jq) reads:

panic-attack panicbot fleet word grid reads
Critical error high
High warning medium
Medium info info
Low suggestion info

So every panicbot finding read one level milder than in panic-attack's own row. A Critical could never reach the grid as critical.

Note: the hand-off said #1709 read critical in panicbot and high in panic-attack. The code gives the reverse. I have asked hypatia-rules for the raw rows to confirm which column was which.

Fix

  • translator::report_severity: a finding translated from a weak point reports panic-attack's own word (critical, high, medium, low). A finding with no panic-attack severity (a suite part) keeps its fleet word.
  • translator::findings_for_report: the JSON scan output puts that word in severity and keeps the fleet word in fleet_severity.
  • The fleet Severity is unchanged. blocks_release, the exit code and guardian mode behave as before. The fleet subcommand output is unchanged.

Evidence

  • cargo test in bots/panicbot: all pass. New tests cover every level, the #1709 critical/high shape, case handling, the fallback, and an end-to-end scan through a stub panic-attack (tests/grid_severity_parity_test.rs).
  • cargo fmt --check is clean, and cargo clippy --all-targets has 0 warnings.
  • tests/fleet-report-back-test.sh with STANDARDS_DIR set to standards 540331a: 243 passed, 69 passed.
  • Real verdict-grid.sh render, with the same 4 weak points on both rows:
    • before: panic-attack purple {critical 1, high 1, medium 1, minor 1}, panicbot red {critical 0, high 1, medium 1, minor 2}
    • after: both purple {critical 1, high 1, medium 1, minor 1}

Draft for the owner to decide. Not to be merged or marked ready by a session.


Generated by Claude Code

Summary by CodeRabbit

  • Improvements
    • JSON scan reports now show supported panic-attack severity levels—critical, high, medium, and low—while retaining the corresponding fleet severity separately. When a panic-attack severity is missing or unsupported, reports fall back to the fleet severity.
    • The updated severity details appear consistently in successful scan results and in error or not-run results that include findings. Scan status and included report sections remain unchanged.

panicbot printed the fleet severity word on `--format json scan`. The
fleet Severity has no critical level, and the grid reads `error` as
high, `warning` as medium and `suggestion` as info. So every finding
read one level milder in panicbot's row than in panic-attack's own row,
though both ran the same panic-attack revision. A Critical could never
reach the grid as critical.

Each finding translated from a weak point now reports panic-attack's
own word (critical, high, medium, low) in `severity`, with the fleet
word kept in `fleet_severity`. Findings with no panic-attack severity
(suite parts) keep the fleet word. The fleet Severity is unchanged, so
blocks_release, the exit code and guardian mode behave as before.

Tests: every level, the #1709 critical/high shape, case handling, the
fallback, and an end-to-end scan through a stub panic-attack.
@gitnotebooks

gitnotebooks Bot commented Dec 5, 2026

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Dec 5, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Panicbot now preserves recognized panic-attack severity in the JSON severity field and records fleet severity separately. JSON scan output uses these converted findings for successful, error, and not-run results. Status selection and included parts remain unchanged.

Changes: Panicbot report severity

Layer / File(s) Summary
Report severity conversion
bots/panicbot/src/translator.rs
The report conversion uses recognized panic-attack severity metadata for severity and preserves the fleet severity in fleet_severity. Tests cover severity parity, case handling, serialization, and fallback.
JSON scan output
bots/panicbot/src/main.rs, bots/panicbot/tests/envelope_parity_test.rs
cmd_scan uses converted findings in its JSON results. The scan test checks all four panic-attack severity levels and their fleet severity mappings.

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Bug fix

Possibly related PRs

Merge Risk: Minimal · up to a078f

This change makes the verdict grid receive panic-attack's own severity words for translated findings. Exit codes and release blocking are unchanged. No actionable merge risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the panicbot fix and the core change: findings now report panic-attack's own severity in the verdict grid. The changeset adds report_severity and findings_for_report in translator.rs, …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the panicbot fix and the core change: findings now report panic-attack's own severity in the verdict grid. The changeset adds report_severity and findings_for_report in translator.rs, wires them into cmd_scan, and keeps the fleet severity in fleet_severity. The title is specific and matches the main change. The phrase 'to the verdict grid' is slightly jargon-heavy but accurate.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 8d33c84 and a078f49.

Files selected for processing: 3

  • bots/panicbot/src/main.rs
  • bots/panicbot/src/translator.rs
  • bots/panicbot/tests/envelope_parity_test.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

The grid severity e2e test copied the stub and scan helpers from
envelope_parity_test.rs, which SonarCloud counted as duplicated new code.
It now lives in envelope_parity_test.rs and reuses those helpers, with a
stub_body_with_report helper behind full_stub_body.
@hyperpolymath
hyperpolymath force-pushed the fix/panicbot-grid-severity-parity branch from d90d86d to a078f49 Compare December 5, 2026 07:26
@hyperpolymath
hyperpolymath marked this pull request as ready for review December 5, 2026 07:27
@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-05T07:28:36.991405Z a078f49 Draft marked ready
🔒 Security Review ✅ Completed 2026-12-05T07:29:49.526275Z a078f49 Draft marked ready
ℹ️ 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.

@sonarqubecloud

sonarqubecloud Bot commented Dec 5, 2026

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath merged commit b178c56 into main Dec 5, 2026
141 checks passed
@hyperpolymath
hyperpolymath deleted the fix/panicbot-grid-severity-parity branch December 5, 2026 07:39
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.

2 participants