Skip to content

Correct a false claim in .gitattributes, and control two uncontrolled gates - #6

Merged
HarperZ9 merged 1 commit into
mainfrom
feat/art-gate-control
Sep 3, 2026
Merged

Correct a false claim in .gitattributes, and control two uncontrolled gates#6
HarperZ9 merged 1 commit into
mainfrom
feat/art-gate-control

Conversation

@HarperZ9

@HarperZ9 HarperZ9 commented Sep 3, 2026

Copy link
Copy Markdown
Owner

A correction first

The .gitattributes comment I merged here said this:

The artwork under docs/art/ is generated, and a gate compares the committed
bytes to a fresh render. Normalizing line endings per platform would make that
comparison depend on who checked the repository out.

That is not true, and I wrote it. The gate compares like this:

if path.read_text(encoding="utf-8") != text + "\n":

Path.read_text applies universal-newline translation, so a CRLF checkout is
read back as LF and the comparison passes with or without the pin. The gate was
never at risk.

The pin is still worth keeping, for a narrower reason. The receipt records each
drawing's byte count and SHA-256 read from the checked-out file with
read_bytes, and those two numbers do depend on the checkout. The pin keeps them
the same for everyone. The comment now says that and nothing more.

What the gate could not do

tests/test_repo_art.py names its gates and asserts they all report clean.
Twelve green lines say the checks ran. They do not say the checks work: a check
that returns [] unconditionally is indistinguishable from one that found
nothing wrong.

art.the_gate_can_fail closes that. The three geometry checks now take their
spec list as an argument instead of reading the loaded set directly, and the new
check feeds them one spec built to break all three at once:

  • a stage note far too long for the wrapper,
  • a tagline past the rule it sits above,
  • an outcome band with one over-wide label and one over-long note.

It asserts the exact count of complaints, so a check that catches one problem
out of two fails here too. Verified against a deliberately weakened copy of the
module: with TAGLINE_BUDGET raised to 10000 and the page widened to 100000, the
control goes from empty to naming both budgets that stopped catching anything.

What this does not cover

The renderer itself is unchanged, and no drawing moves. Nothing here checks that
a drawing looks right, only that its text fits the shapes it is drawn into.

🤖 Generated with Claude Code

… gates

The .gitattributes comment said a gate compares the committed bytes to a fresh
render, and that normalizing line endings per platform would make that
comparison depend on who checked the repository out. Neither is true. Both
sides of the comparison are read with Path.read_text, which applies
universal-newline translation, so the comparison passes on a CRLF checkout with
or without the pin.

The pin is still worth keeping, for a narrower reason. The receipt records each
drawing's byte count and SHA-256 read from the checked-out file, and those two
numbers do depend on the checkout. The comment now says that instead.

The test file already proved the outcome-box gate can fail, by pointing ART at
a throwaway spec whose note is far too wide. The wrapper gate and the tagline
gate had nothing of the kind: twelve green lines said they ran.

The three geometry checks now take their spec list as an argument instead of
reading the loaded set directly, and art.the_gate_can_fail feeds them one spec
built to break all three at once: a note too long for the wrapper, a tagline
past the rule, and an outcome band with one over-wide label and one over-long
note. It asserts the exact count of complaints, so a check that half-works is
caught too. Verified against a deliberately weakened copy of the module, where
the control names the budgets that stopped catching anything.

GATES in the test names its gates rather than counting them, so the new one is
added there.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@HarperZ9
HarperZ9 merged commit fec1fbe into main Sep 3, 2026
10 checks passed
@HarperZ9
HarperZ9 deleted the feat/art-gate-control branch September 3, 2026 09:01
HarperZ9 added a commit that referenced this pull request Sep 3, 2026
… gates (#6)

The .gitattributes comment said a gate compares the committed bytes to a fresh
render, and that normalizing line endings per platform would make that
comparison depend on who checked the repository out. Neither is true. Both
sides of the comparison are read with Path.read_text, which applies
universal-newline translation, so the comparison passes on a CRLF checkout with
or without the pin.

The pin is still worth keeping, for a narrower reason. The receipt records each
drawing's byte count and SHA-256 read from the checked-out file, and those two
numbers do depend on the checkout. The comment now says that instead.

The test file already proved the outcome-box gate can fail, by pointing ART at
a throwaway spec whose note is far too wide. The wrapper gate and the tagline
gate had nothing of the kind: twelve green lines said they ran.

The three geometry checks now take their spec list as an argument instead of
reading the loaded set directly, and art.the_gate_can_fail feeds them one spec
built to break all three at once: a note too long for the wrapper, a tagline
past the rule, and an outcome band with one over-wide label and one over-long
note. It asserts the exact count of complaints, so a check that half-works is
caught too. Verified against a deliberately weakened copy of the module, where
the control names the budgets that stopped catching anything.

GATES in the test names its gates rather than counting them, so the new one is
added there.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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