Repository navigation
Conversation
…ar and x2text - Drop CSS declarations the browser already discards (invalid values) and the margin-top longhands overridden by margin shorthand in the same rule. - Move the "already in this org" handler from a wrapper div onto the menu item so Enter/Space works; add keyboard and mouse tests. - x2text /process: read Content-Length with .get() and return a 400 when it is missing or not an integer instead of an unhandled 500. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ritwik-g
left a comment
There was a problem hiding this comment.
Self-review round 1 — tip 90ee5d944
Review: unstract:review-deep, INITIAL. review-shallow refused this PR because the x2text header parsing tripped its attack-surface trigger.
Verdict — REQUEST CHANGES
Summary — Critical: 0 · High: 1 · Medium: 2 · Low: 0 · Lenses run: 19/19
Security deep-dive: done. It returned no findings at confidence 8 or above, and no filter sub-task degraded.
boundary-sweep: 1 sink traced, clean. The new 400 body is a fixed string with no request data in it.
Base fetch: ok. Merge base 389a6eb80.
Lens checklist
- Correctness — See findings #2
- Design & architecture — Clean
- Error handling — Clean
- Security — Clean
- Data integrity & migrations — N/A — no data or schema change
- Concurrency — N/A — no concurrency primitives touched
- API compatibility — Clean
- Reliability — Clean
- Performance & cost — Clean
- Observability — Clean
- Operational safety — N/A — no infra, flags or rollout config
- LLM/agent — N/A — no LLM or agent code
- Testing — See findings #1, #3
- Dependencies & build — N/A — no dependency changes
- Code quality — Clean
- Doc accuracy — Clean
- Cross-document consistency — Clean
- On-prem experience — N/A — no chart, values, schema or on-prem build path touched
- Scaling & workload lifecycle — N/A — no workload config
Notes on the checklist:
- Lens 4: the security deep-dive was done, and the auth decorator on
/processis unchanged. - Lens 7: the 400 replaces a 500 only for malformed requests. The in-repo consumer (
sdk1 adapters/x2text/helper.py) always sends Content-Length. - Lens 15: the orchestrator ran
biome check(0 errors) andruff check/ruff format --check(pass). - Lenses 5, 6, 8, 11, 12, 14 and 16–19 were assessed by the orchestrator.
Open questions for the author
None.
Assumptions made
The app renders in standards mode (frontend/index.html has <!DOCTYPE html>), so the browser drops the deleted unitless CSS values.
Round 1 self-review findings: - Enter/Space on another org did nothing: the confirm lived in a ConfirmModal wrapper inside the label, which Radix's item click never reaches. Open it via openConfirm from item.onClick instead. - Tests now pin both sides of the current/other-org split (no switch prompt for the current org, no "already in" alert for another), plus a keyboard test for switching. - Note in code that the x2text Content-Length branch has no test suite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ritwik-g
left a comment
There was a problem hiding this comment.
Self-review round 2 — tip fc5ff49e (delta 90ee5d944..fc5ff49e)
Review: unstract:review-deep, FOLLOWUP. Lite was not eligible: its gate reads the whole PR, and the attack-surface trigger still fires.
Verdict — REQUEST CHANGES
Prior context fetched — followup-fetch.sh exited 0. The "since" boundary is 90ee5d944.
Scope change — NO
Summary — Critical: 0 · High: 1 · Medium: 0 · Low: 0 · Lenses run: 19/19
Security deep-dive: done. It returned no candidates and no filter sub-task degraded.
boundary-sweep: 1 sink traced, clean. The confirm dialog shows display_name as React text.
Prior findings status
- #1 [High] The x2text Content-Length branch has no test →
WAIVED. x2text-service has no test suite, and the requester asked for a script check instead. The waiver is written atx2text-service/app/controllers/controller.py:L92-L94. - #2 [Medium] Enter on another org does nothing →
RESOLVEDinfc5ff49e.openConfirmis now called fromitem.onClick(TopNavBar.jsx:L260-L274), and the keyboard switch test passes. - #3 [Medium] The tests don't pin the
isCurrentOrgsplit →RESOLVEDinfc5ff49e. Mutantstrue ?,false ?, the other-orgundefinedand the base file each fail at least one test.
Lens checklist
- Correctness — Clean
- Design & architecture — Clean
- Error handling — Clean
- Security — Clean
- Data integrity & migrations — N/A — no data change in the delta
- Concurrency — N/A — no concurrency primitives
- API compatibility — Clean
- Reliability — Clean
- Performance & cost — Clean
- Observability — Clean
- Operational safety — N/A — no infra
- LLM/agent — N/A — no LLM code
- Testing — See findings #1
- Dependencies & build — N/A — no dependency change
- Code quality — Clean
- Doc accuracy — Clean
- Cross-document consistency — Clean
- On-prem experience — N/A — no deployment surface
- Scaling & workload lifecycle — N/A — no workload config
Notes on the checklist:
- Lens 7: the delta changes no endpoint or response shape.
- Lens 15: the orchestrator ran
biome check(0 errors) andruff check/ruff format --check(pass). - Lens 16: the new comments in
TopNavBar.jsxandcontroller.pymatch the code. - Lens 17: nothing restates the changed rule.
Open questions / assumptions
None.
Round 2 self-review: replacing `axios` not-called with the no-prompt check dropped a different property. A current-org click that switched directly would pass. Assert both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
ritwik-g
left a comment
There was a problem hiding this comment.
Self-review round 3 — tip bcbf1a95 (delta fc5ff49e..bcbf1a95)
Review: unstract:review-deep, FOLLOWUP. Lite was not eligible: its gate reads the whole PR, and the attack-surface trigger still fires.
Verdict — APPROVE
Prior context fetched — followup-fetch.sh exited 0. The "since" boundary is fc5ff49e.
Scope change — NO
Summary — Critical: 0 · High: 0 · Medium: 0 · Low: 0 · Lenses run: 19/19
Security deep-dive: done. It returned no candidates and no filter sub-task degraded.
boundary-sweep: 0 sinks traced, clean. The delta is test-only.
Prior findings status
- Round 2 #1 [High] The current-org tests don't check that no switch request is sent →
RESOLVEDinbcbf1a95.expect(axios).not.toHaveBeenCalled()is back atTopNavBar.test.jsx:L159and:L176. The self-switch mutant now fails both current-org tests.
New findings
None. Both agents returned an explicit "No findings". pr-test-analyzer mutation-tested the isCurrentOrg split: the self-switch mutant and the inverted condition both fail.
Lens checklist
- Correctness — Clean
- Design & architecture — Clean
- Error handling — Clean
- Security — Clean
- Data integrity & migrations — N/A — test-only delta
- Concurrency — N/A — test-only delta
- API compatibility — N/A — test-only delta
- Reliability — N/A — test-only delta
- Performance & cost — Clean
- Observability — Clean
- Operational safety — N/A — no infra
- LLM/agent — N/A — no LLM code
- Testing — Clean
- Dependencies & build — N/A — no dependency change
- Code quality — Clean
- Doc accuracy — N/A — no comments changed
- Cross-document consistency — N/A — no rule changed
- On-prem experience — N/A — no deployment surface
- Scaling & workload lifecycle — N/A — no workload config
Notes on the checklist:
- Lens 15: the orchestrator ran
biome checkon the test file (0 errors).
Open questions / assumptions
None.



What
Fixes the 9 open SonarCloud BUG issues not already covered by #2384, so that together they bring the project's reliability rating to A. #2384 covers the other 5 (
sdk1 tool/base.py,Header.jsx,ManageLlmProfiles.jsx,DisplayCode.jsx). This PR doesn't touch those files.1. css:S9424, invalid CSS values (5 findings)
All five declarations are invalid, so the browser already discards them. I checked this in headless Chrome in standards mode (the app's
index.htmlhas<!DOCTYPE html>): each rule'scssTextcomes back empty for these. Each one is deleted, so nothing renders differently.PromptCard.css:80row-gap: 22pxwould add a gap that doesn't render today.PromptCard.css:97scrollbar-color: inherit #fff8e6 !importantinheritcan't be combined with another value. A valid pair would recolour the scrollbar thumb.PromptCard.css:189width: fill-available !importantfill-availableisn't valid in any browser.-webkit-fill-availablewould change the width in Chromium and Safari, so it's dropped instead of "fixed".ToolIde.css:76transition: "left 0.1s linear"SideNavBar.css:106margin-top: 11px, but the app runs in standards mode, where it's dropped.2. css:S4657, longhand overridden by shorthand (2 findings)
In
PromptStudioModal.css,.prompt-studio-guide-btnand.prompt-studio-cancel-btneach setmargin-top: 8px !importantand thenmargin: 0 !importantin the same rule. Both are!important, so the later one wins and the computedmargin-topis0px(checked in Chrome). I removed the deadmargin-top. Rendering stays the same.3. python:S8371, x2text
/processheader readint(request.headers["Content-Length"])raised an unhandledKeyErrorwhen the header was missing (a chunked upload) and aValueErrorwhen it wasn't an integer. Both came back as a 500. The header is now read with.get(). A missing or non-integer value returns400 {"message": "Missing or invalid Content-Length header"}, the same shape as the other 400s in this handler. A valid header behaves as before.4. javascript:S1082, TopNavBar Switch Org keyboard access
The current-org entry in the Switch Org list put its handler on a wrapper
<div onClick>. Radix focuses the menu item, not that div, and turns Enter/Space into a click on the item itself, so a keyboard user got nothing. The handler now sits on the menu item (item.onClick, which the Dropdown shim already supports), and the label is plain text.Self-review found the same defect on the other orgs' entries in this list. Their
ConfirmModalwrapper sat inside the label, so pressing Enter on another org never opened the switch confirmation. Those entries now callopenConfirmfromitem.onClick, with the same title, text and buttons as before. Mouse and keyboard now behave the same for both kinds of entry.Testing
TopNavBar.test.jsx: added keyboard and mouse tests for the current org (alert shown, no switch prompt, no POST) and a keyboard test for switching to another org. The existing mouse switch test now also checks that no "already in" alert appears. I ran five mutants: the base file, the alert on every org, the alert on no org, no handler for other orgs, and a current-org click that also switches. Each one fails at least one test.vitest run: 40 files and 632 tests pass.tsc --noEmitis clean.biome check src/has no errors, and warnings went from 799 to 790.py_compile,ruff checkandruff format --check, then called/processfrom a script through a Flask request context, with auth, DB and the upstream mocked. Results with the header present, missing and invalid: before the fix 200 / 500 (KeyError) / 500 (ValueError); after it 200 / 400 / 400.🤖 Generated with Claude Code