Skip to content

The redactor reads a crafted capture in time, and SonarCloud's shell style rule is set aside for two scripts (#361) - #453

Merged
don-petry merged 4 commits into
mainfrom
claude/sonar-shell-regex
Oct 31, 2026
Merged

don-petry merged 4 commits into
mainfrom
claude/sonar-shell-regex

Conversation

@don-petry

@don-petry don-petry commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Answers #361 (SonarCloud: shell script hygiene) as the Factory Builder ruled, and, as additional work they asked for in the same pull request, two python:S8786 findings that no audit issue lists yet. The reads found a worse fault on the same path, and that is fixed too. No record; no Kernel code.

Finding Where Verdict
Nested base64 in keys, exponential (found by the security pass) tools/check_trials.py:214 Fixed. A key was read twice at each level: 5,600 characters took over 4 s, and 17,700 ran past 60 s. It is on the redactor's path, before anyone has read the capture. Now read once
python:S8786 tools/redact_trial.py:36 Fixed. STATUS_LINE's phrase and trailing space overlapped: 2.8 s at 32,000 characters. Linear now, and it accepts the same strings
python:S8786 tools/check_context.py:53 Declined, marked inline. TITLE is linear on every shape tried, and issue 369's test holds that
shell:S7688 (43) tools/context_eval.sh, tools/trial_as_app.sh Set aside in sonar-project.properties, with the reason beside it. Neither script is edited

What #361's ruling departs from

Its acceptance asks for real fixes, with NOSONAR only for a confirmed false positive. These 43 are style, not false positives. The Factory Builder ruled to set them aside because tools/trial_as_app.sh holds a credential's path and CI cannot run it for real. The ruling is recorded on #361.

Not verified

  • Whether SonarCloud honours the two set-asides and the NOSONAR shows only in the scan after this merges. The rule key is the one SonarCloud's API reports.
  • That a crafted capture can actually reach the redactor from outside. A comment body in a captured answer is the likely route for the nested base64; the Claude reads traced it, and none of this ran against a real capture.

Checks

  • tests.test_tools.Verify, Redaction and Mutants pass locally, 51 tests. The first version of SonarCloud: the schema patterns are held to a limit, one finding fixed and two declined (#360, #359) #451 (SonarCloud: the schema patterns are held to a limit) missed Verify, so these ran before pushing.
  • The new mutants were each run on their named test alone: all killed.
  • Two independent comparisons by the reviewers, over millions of strings, found the old and new STATUS_LINE accepting the same language.
  • make verify and python3 -m tools.mutants: CI's checks job and eight shards at this head. Neither ran whole at a desk; this is queued only if they are green.

Reviews

All four reads ran on 542e93e; each finding was checked as data, with one fix round in 046635d. ca4029b also fixes a race CI found in a test outside this change: every ReaderTrialScript test removed a shared scratch directory, which could fail a mutant shard's baseline on any pull request.

The security pass's subagent also ran a pkill -f broad enough to match other sessions' processes. It changed nothing here. The Factory Builder has been told, in case a sibling's job died.

Reviewer Head Unread parts Blocking Major Minor Info
agy 542e93e none 0 0 0 0
muse 542e93e none 0 0 1 0
claude-review 542e93e none 0 0 3 0
claude-security 542e93e none 0 1 2 1
Finding Severity Criterion Where What Disposition
muse#1 minor PR-3 tests/test_tools.py:6909 No test holds a hyphen inside the status phrase, so the middle character class can lose it undetected fixed in 046635d: a hyphen inside a phrase, with its mutant
claude-review#1 minor PR-1 sonar-project.properties:16 Issue 361 still asks for real fixes, and the ruling that sets its 43 findings aside is recorded nowhere but this commit fixed: the ruling is recorded on #361, and the body says this departs from its acceptance
claude-review#2 minor PR-3 tests/test_tools.py:6909 The test that holds STATUS_LINE's language has no hyphen inside a phrase, so a mutant that refuses one survives fixed in 046635d: as muse#1
claude-review#3 minor PR-1 tools/redact_trial.py:37 Two python:S8786 changes that no issue asks for ride in the pull request that answers issue 361 fixed: the body names them as additional, at the Factory Builder's asking, and why one pull request
claude-security#1 major none tools/check_trials.py:214 The redactor's path is still exponential: shaped(key) runs twice per key in _credentials, so nested base64 stalls a 17 KB capture past 60 s fixed in 046635d: a key is read once, with a test and a mutant
claude-security#2 minor none tools/redact_trial.py:91 _clean rebuilds a long key's path for every item of a list under it, so a long key over a wide list takes time in its square declined: it needs a key and a list each of megabytes, far past what a GitHub answer holds. Nothing leaks
claude-security#3 minor none tools/redact_trial.py:184 Reading heads copies the rest of the capture once per head, so a capture of many heads takes time in its square declined: it needs megabytes of nothing but heads, and a head loop continues only while the body opens with a status line, which text inside an answer's JSON cannot make it do. Nothing leaks
claude-security#4 info none the change Not a defect of the change: this reviewer ran a kill wider than its own job on the shared machine, and cannot rule out that it hit another session no change needed in this pull request: the reviewer's broad pkill is reported to the Factory Builder, to pass on to running builders

🤖 Generated with Claude Code

don-petry and others added 2 commits October 31, 2026 12:46
…shell style rule is set aside for two scripts

STATUS_LINE's reason phrase and its trailing space could both hold a space, so a
status line with a long run of them and then what no status holds took time in
its square: 2.8 s at 32,000 characters through the redactor, on a capture read
before anyone has looked at it. The phrase now ends in no space. The language is
the same, and a test holds both.

S8786 on check_context's TITLE is declined where it stands: issue 369's test
holds its CPU linear on the shape the rule fears.

Issue 361's 43 findings are all shell:S7688, `[[` in place of `[`, style alone.
The Factory Builder ruled they are set aside in sonar-project.properties for
tools/context_eval.sh and tools/trial_as_app.sh, and neither script is edited:
the second holds a credential's path, and CI cannot run it for real.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…line's test holds a hyphen

The reads. `_credentials` read each key twice, and `shaped` reads what it decodes
through `_credentials`, so the work doubled at each level of base64 inside a key
while the text grew by a third: 5,600 characters took over four seconds. That is
worse than the regex this pull request set out to fix, and it is on the same
path. A key is now read once, with a test and a mutant.

STATUS_LINE's test had no hyphen inside a phrase, so a mutant that dropped it
survived. It has one now, with that mutant.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@don-petry
don-petry requested a review from a team as a code owner October 31, 2026 18:09
@chatgpt-codex-connector

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 ⚠️ Failed 2026-10-31T18:09:45.362794Z
We couldn’t complete this review. Comment @codex review to try again.
046635d 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • 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

don-petry and others added 2 commits October 31, 2026 14:50
…arallel run cannot remove it

Every test of ReaderTrialScript cleans up what INSIDE names, and a mutant shard's
baseline deals a class's methods to parts run at once. So another method's
clean-up could remove `__pycache__/scratch-of-the-reader` while this test used
it: mktemp failed, the script exited 1 and not 2, and the shard failed before any
mutant ran, on no fault of the pull request.

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

Copy link
Copy Markdown

@don-petry
don-petry added this pull request to the merge queue Oct 31, 2026
Merged via the queue into main with commit ff29db1 Oct 31, 2026
19 checks passed
@don-petry
don-petry deleted the claude/sonar-shell-regex branch October 31, 2026 20:21
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