fix(assets): pin plate SVG root size to pt so poppler builds agree #197

Merged
peterswimm merged 1 commit from fix/plate-svg-units into main 2026-10-08 01:59:28 +00:00
Owner

Scope

Plate derivatives come out different depending on which poppler build converts them. Debian's
poppler (used by the CI build bot) writes the root <svg width="667.94"> without a unit, while
Homebrew's writes width="667.94pt". Both mean points. The result: the bot's first live run (#195)
rewrote all three plate derivatives, though only one EPS had changed. A later local
just plates would flip them back. assets.py check compares only the EPS's sha256, so it can't
see the change.

_pt_units() in udg/generators/assets.py sets the root tag's width/height to pt. Inner
elements keep their user units.

Testing

  • generator/tests/unit/test_plate_units.py (3 tests): Debian output gains pt, Homebrew output
    is unchanged, and inner <rect> sizes stay bare.
  • Run in python:3.12-slim with Debian ghostscript and poppler-utils:
    • control (origin/main assets.py): 3 derived plates change;
    • this branch: 0 change.
  • Homebrew just plates (macOS): 0 change. just check: exit 0. pytest generator/tests: 292 passed.

Impact Statement

  • Existing features: plate conversion now gives the same bytes on macOS and in CI.
  • Public APIs / contracts: none.
  • Schemas: none.
  • Data / artifacts: no derivative changes. The committed files already use pt.
  • Integrations: the build bot no longer causes plate churn.
  • Mappings: none.
  • Backward compatibility: no expected impact.

Docs

None needed; the docstring explains the normalisation.

## Scope Plate derivatives come out different depending on which poppler build converts them. Debian's poppler (used by the CI build bot) writes the root `<svg width="667.94">` without a unit, while Homebrew's writes `width="667.94pt"`. Both mean points. The result: the bot's first live run (#195) rewrote **all three** plate derivatives, though only one EPS had changed. A later local `just plates` would flip them back. `assets.py check` compares only the EPS's sha256, so it can't see the change. `_pt_units()` in `udg/generators/assets.py` sets the root tag's `width`/`height` to `pt`. Inner elements keep their user units. ## Testing - `generator/tests/unit/test_plate_units.py` (3 tests): Debian output gains `pt`, Homebrew output is unchanged, and inner `<rect>` sizes stay bare. - Run in `python:3.12-slim` with Debian `ghostscript` and `poppler-utils`: - **control** (`origin/main` `assets.py`): 3 derived plates change; - **this branch:** 0 change. - Homebrew `just plates` (macOS): 0 change. `just check`: exit 0. `pytest generator/tests`: 292 passed. ## Impact Statement - Existing features: plate conversion now gives the same bytes on macOS and in CI. - Public APIs / contracts: none. - Schemas: none. - Data / artifacts: no derivative changes. The committed files already use `pt`. - Integrations: the build bot no longer causes plate churn. - Mappings: none. - Backward compatibility: no expected impact. ## Docs None needed; the docstring explains the normalisation.
fix(assets): pin plate SVG root size to pt so poppler builds agree
Some checks failed
PR policy check / policy-gate (pull_request) Successful in 0s
Security Scans / Gitleaks secret scan (pull_request) Successful in 25s
Security Scans / Trivy filesystem scan (pull_request) Failing after 30s
Test Generator / lint-workflows (pull_request) Successful in 16s
Test Generator / lint-prose (pull_request) Successful in 20s
Block Validation / validate (pull_request) Successful in 58s
UDG dist drift gate / dist/ matches dtcg + udg sources (pull_request) Successful in 16s
Copy coverage / Design copy reaching rendered HTML (pull_request) Successful in 28s
Test Generator / test (pull_request) Successful in 3m27s
366bcde602
The build bot's first live run (#195) rewrote every plate derivative, not
just the one whose EPS changed: Debian's poppler (CI) writes the root
<svg width="667.94">, Homebrew's writes width="667.94pt". Both mean points,
but a local `just plates` and a bot build flip the files back and forth,
and `assets.py check` (provenance sha only) can't see it.

_pt_units() pins the root tag's width/height to pt; inner elements keep
their user units.

Rehearsed in python:3.12-slim + Debian ghostscript/poppler-utils:
  control (origin/main assets.py): 3 derived plates change
  this branch:                     0 change
Homebrew (local) `just plates`: 0 change. just check: 0. pytest: all pass.
peterswimm deleted branch fix/plate-svg-units 2026-10-08 01:59:28 +00:00
Sign in to join this conversation.
No description provided.