Pin the spec to LF, and give the outcome gate a control that can fail it - #35
Merged
Conversation
Three changes to the artwork gate, none of them to the drawings. The .gitattributes pinned the SVGs to LF but not the spec they are rendered from. On this checkout index.art.json came out of the index at 2354 bytes with CRLF endings; with the pin it is 2318 bytes with LF, the same 2318 bytes the renderer wrote. The gate's receipt records a byte count and a SHA-256 read from the checked-out file, so without the pin those two numbers depend on who cloned the repository. The comparison itself is unaffected either way, because both sides are read through Python's text layer, which normalizes line endings. The comment now says the narrower thing that is true. The outcome budget had the page geometry written into it as literals: 960, 44, 26. Move a margin in repo_flow and the gate keeps passing while measuring a box that no longer exists. It reads FLOW.W, FLOW.PAD and FLOW.GAP now. The overflow check is extracted into a helper so a negative control can feed it two outcomes it has to reject. Before, a green run proved only that the check ran. The module docstring said the test compares bytes. It compares the rendered text with line endings normalized away. Corrected. 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.
Three changes to the artwork gate. No drawing changes.
The spec was not pinned
.gitattributespinneddocs/art/*.svgto LF but leftdocs/art/*.art.jsonunpinned. Measured on this checkout:
index.art.json, beforeindex.art.json, after2318 is what
render_repo_art.pyactually wrote. The gate's receipt records abyte count and a SHA-256 read from the checked-out file, so unpinned those two
numbers depend on who cloned the repository.
What the pin does not do. It does not make the comparison work. Both sides
are read through
Path.read_text, which applies universal-newline translation,so the comparison passes on a CRLF checkout with or without the pin. Only the
receipt's size and hash fields are byte-sensitive. The comment in
.gitattributesnow says that narrower thing instead of the broader claim itcarried before.
The budget had the geometry copied into it
_outcome_budgetscomputed the box width from literals:(960 - 44 * 2 - 26 * (count - 1)) / count. Move a margin inrepo_flowand the gate keeps passingwhile measuring a box that no longer exists. It reads
FLOW.W,FLOW.PADandFLOW.GAPnow, so the two move together.The check had no control
The overflow logic is extracted into
_outcomes_that_overflowsotest_that_check_can_actually_failcan feed it two outcomes it must reject.Without that, a green run proved only that the check ran.
The module docstring also claimed the test compares bytes. It compares the
rendered text with line endings normalized away. Corrected.
13 art tests pass. Both budgets still count characters rather than measure
glyphs, so neither can tell
mmmmfromiiii: a guardrail, not a typographicfact.
🤖 Generated with Claude Code