Repository navigation
Finish the Review Lens fallback fix, and undo the hole the last one dug - #401
Merged
Merged
Conversation
Two defects in the fix that shipped in #394. A verification pass measured both against the merged code; neither was theoretical. The fabricated grade was never actually closed. #394 gated the fallback on `json.loads` RAISING, which catches "the model said something unparseable" but not "the model said nothing usable". A reply that parses fine and carries no review sailed straight past it: model returns {} -> needs_revision 72/100 medium model returns {"error": "I cannot"} -> needs_revision 72/100 medium model returns null, or a list -> needs_revision 72/100 medium _normalize_scores defaults all eight categories to 72, so the node rendered a full verdict banner for a change no model had read - the exact defect #394 was written to remove, reached by a different door. A refusal is the likeliest non-happy-path reply any provider gives. looks_like_a_review() now decides it: a real review has an overview, or a scorecard naming a known category, or a non-empty walkthrough/findings/ errors list. A clean review still has the first two, so a genuine "nothing wrong here" is not discarded. Second, #394's narrowed shell pattern silently stopped detecting the common real shapes. Replacing `.*`+DOTALL with a flat `[^)]*` bounded the span to one call, but `[^)]` cannot cross the `)` that closes a nested call - and the ordinary way to write this puts a call in the argument list: subprocess.run(cmd, shell=True) DETECTED subprocess.run(cmd, env=os.environ.copy(), shell=True) MISSED subprocess.run(cmd, cwd=str(path), shell=True) MISSED subprocess.run(" ".join(parts), shell=True) MISSED subprocess.run(\n build(cmd),\n shell=True,\n) MISSED Four of six real shapes. The pre-#394 pattern caught all of them; the control test I added used the one multi-line shape with no nested parens, which is why it passed. The span now allows one level of nesting (`(?:[^()]|\([^()]*\))*?`) and still cannot escape the call. Test plan: - 6 parametrised cases pinning the contentless-reply shapes, and 3 pinning that a thin-but-real review (overview only, scores only, findings only) is still graded. - 7 parametrised cases for shell shapes that must be detected, 4 for shapes that must not be - including a later statement in the same file, the false positive the bound exists for. - Full suite: 3183 passed, 19 skipped. ruff clean. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Problem
Two defects in the fix that shipped in #394 earlier today. A verification pass measured both against the merged code; neither is theoretical.
The fabricated grade was never actually closed
#394 gated the fallback on
json.loadsraising — which catches "the model said something unparseable" but not "the model said nothing usable". A reply that parses fine and carries no review went straight past it:_normalize_scoresdefaults all eight categories to 72, so the node rendered a full verdict banner — "Needs Revision, 72/100, Release risk: Medium" — for a change no model had read. That is the exact defect #394 was written to remove, reached through a different door. And a refusal object is the single likeliest non-happy-path reply any provider gives, so this was the common case, not an edge one.#394's narrowed shell pattern silently stopped detecting the common shapes
Replacing
.*+DOTALLwith a flat[^)]*correctly bounded the span to one call — but[^)]cannot cross the)that closes a nested call, and the ordinary way to write this puts a call in the argument list:Four of six real shapes. The pre-#394 pattern caught all of them — so #394 traded a false-positive class for a false-negative class in a security heuristic. My control test used the one multi-line shape with no nested parens, which is why it passed.
Change
looks_like_a_review()decides the fallback now: a real review has an overview, or a scorecard naming at least one known category, or a non-empty walkthrough/findings/errors list. A genuinely clean review still has the first two, so "nothing wrong here" is not thrown away. Both routes — the parse raising, and the parse succeeding with nothing in it — reach the same place.The shell span allows one level of nesting (
(?:[^()]|\([^()]*\))*?) and still cannot escape the call.Test plan
ruff check .clean.🤖 Generated with Claude Code