Repository navigation
fix(report): escape sample text in the terminal report - #67
Merged
Merged
Conversation
A finding quoting MacBench's [ANSWER]...[/ANSWER] crashed print_report with a rich MarkupError. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MattFisher
enabled auto-merge
October 8, 2026 04:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
inspect-dataset scancrashed on MacBench. Its answers are wrapped in[ANSWER]…[/ANSWER], and a finding's explanation quotes the sample's text.print_reportpassed that explanation to rich unescaped, so rich read[/ANSWER]as a closing tag and raisedMarkupError: closing tag '[/ANSWER]' … doesn't match any open tag. The findings files had already been written, but the command exited 1, so callers treated the whole scan as failed. That includes inspect_audit's sweep, where MacBench was the one eval that crashed inspect-dataset itself.The explanation and the sample id are now escaped, as the "not applicable" line a few lines above already is. The header's dataset, split and scorer names are identifiers, not sample text, and are left as they are.
Testing
tests/test_report.py::test_terminal_report_prints_sample_text_that_looks_like_markupreproduces the crash, failing with the sameMarkupError, and now passes. It checks that both the explanation and a bracketed sample id print literally. Suite: 637 passed, excluding the browser e2e test. basedpyright: 0 errors. pre-commit passes.🤖 Generated with Claude Code