Ask the code gate which role came back unread, not what ratio it read at - #149
Merged
Conversation
The gate test pinned the exact contrast ratios its findings print. Those ratios are readings of the theme's own surfaces, so "Improve code and diff presentation" moving --pre-bg from #f5f2e9 to #f5f5f3 turned the faint fixture's 3.3:1 into 3.4:1 and reddened the nightly suite. The gate prints that sentence only for a role it read under 4.5:1, so the finding's presence is the claim the test is making; the digits added nothing and made every palette change a failure here. Both assertions now ask which role came back unread. The tinted case still discriminates: that role clears the threshold on the block, so a gate taking one colour per role reports nothing at all.
This was referenced Aug 31, 2026
Closed
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
cion main has been red ontests/test_render_gate.py::test_the_render_gate_reports_code_the_reader_cannot_tell_from_its_blocksince a8b6636 ("Improve code and diff presentation"), and it is still red on today'smain— reproduced locally at 2d46d4a:The test pinned the exact contrast ratio the gate's finding prints. That ratio is a reading of the theme's own surfaces, so when the commit moved
--pre-bgfrom#f5f2e9to#f5f5f3as part of the near-neutral code palette, the faint fixture's#8b8577went from 3.3:1 to 3.4:1 and thestartswith(... "reads at 3.3:1")filter came back empty. Nothing about the gate or the palette is wrong — the theme change was the point of the commit, and the same commit deleted the theme comment that was the 3.3 digit's source.Solution
Both ratio-pinned assertions now ask which role came back unread rather than what number it read at.
unreadSyntaxemits that sentence only whereread < 4.5, so the finding's presence is the claim the test is making; the digits proved nothing extra and made every palette change a failure of this test rather than of the page. The second assertion carried the identical brittleness on--syn-stringand is fixed in the same pass rather than left to redden on the next palette move. The two fixture comments that restated the same theme-owned digits are updated to state the colour and not the reading.Nothing is loosened that the cases were arranged to distinguish. The faint case still asserts that only the role the style touched is named. The tinted case still discriminates the per-surface reading from a per-role one, because that role clears the threshold on the block — a gate that stopped at its clean line reports nothing at all.
Testing
origin/main(2d46d4a) and passes with this change.uv run pytest tests/test_render_gate.py— 69 passed.unreadSyntax'sseenset on the role alone instead of role-plus-surface — the "one block colour taken once per role" bug the tinted case exists to catch — still fails the test, with the finding list empty. The gate was restored afterwards; this PR touches no runtime file.ruff format --checkandruff checkclean on both files.The other 29 tests red in that run predate this commit, and the two that appeared alongside this one (
test_a_reader_arrives_at_what_they_left_rather_than_watching_it_arrive,test_a_label_press_keeps_the_controls_keyboard_standing) did not recur on the next commit's run and pass locally — races rather than regressions, so they are out of scope here.How the failure was isolated
Failure lists from three consecutive
ciruns on main, diffed:Three failures are new at a8b6636; only this one recurs on the child run.
Arithmetic behind the move:
#8b8577has relative luminance 0.2360. Against#f5f2e9(0.8880) that is(0.938)/(0.286)= 3.28 →3.3; against#f5f5f3(0.9119) it is 3.36 →3.4.grepfor other pinned ratios acrosstests/*.pyfound onlytest_interact_document.py:3590, which computes its threshold rather than pinning a reading.This follows the shape of #66, which replaced a pinned number with the relation it stood for.
Automated fix for failed run