test: pin text color, button label placement, star import, and per-path scale cache - #43
Merged
dmccoystephenson merged 1 commit intoSep 20, 2026
Conversation
…th scale cache Characterization tests only; no production change. Each new test was confirmed to fail under a targeted mutation of the behavior it pins: - drawText paints glyphs in the requested color (exact match on covered pixels, only blends of that color elsewhere). - drawButton centers its label on the box midpoint and renders it in colorText, not colorBox. - `from preponderous.graphik import *` resolves Graphik through the lazy __getattr__ via __all__. - The scaled-image cache keeps one (size, surface) pair per path, so rescaling one asset does not evict another's entry. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Member
Author
|
Self-review rubric (anchored on the green
Observations outside the diff (not blocking): the two exact-color assertions assume a 24/32-bit display surface, which the existing exact-color tests in the file already assume, so no new fragility is introduced. Inline review ( This review was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
dmccoystephenson
deleted the
test/pin-text-rendering-star-import-and-scaled-cache-scoping
branch
September 20, 2026 07:31
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.
Summary
Test-only expansion (Stage B of the dev loop). Five characterization tests are added to
src/test/python/preponderous/graphik/test_graphik.pyfor documented behaviors that were not previously pinned. No production code is changed.drawTextcolor — glyphs are painted with the requestedcolor: on a black background a red"W"at size 40 produces at least one exactly-red pixel, and every inked pixel is a pure shade of red (no green/blue component from antialiasing against a different hue).drawButtonlabel placement — the label sits entirely inside the drawn box, straddles the box midpoint on both axes, and is horizontally centered on it to within 1px (the same tolerance the existingdrawTextcentering test uses, for the same glyph-asymmetry reason).drawButtonlabel color — the label is rendered incolorText, notcolorBox; a swap of the two arguments (which would make the label invisible against its own box) is caught.from preponderous.graphik import *resolvesGraphikthrough the package's lazy__getattr__via__all__; a name listed in__all__that__getattr__could not serve would make the star import itself raise.(size, surface)pair is kept perfilePath, so rescaling one asset leaves another asset's cached scale intact (red at 10→12 does not force blue at 10 to be rescaled).Each new test was confirmed to fail under a targeted mutation of the behavior it pins (color swapped to white; label anchored at the top-left;
colorBoxpassed todrawText; a single shared cache slot;Graphikdropped from__all__) and to pass on the real code.Test plan
python3 -m py_compile src/main/python/preponderous/graphik/graphik.pypython3 -c "import preponderous.graphik as g; print(g.__version__)"(import smoke test)python3 -m pytest -q→ 52 passed (47 baseline + 5 new), headless viaconftest.py's dummy SDL driversTestworkflow green across the 3.9–3.13 matrixTriage notes
No tracking issue — gap found during triage. The three open issues were all deferred this cycle because each is explicitly maintainer-gated:
.github/workflows/publish.ymland the release process; the issue body itself defers the choice between the two options to a maintainer.test.ymlheader comment) — a one-line comment fix, but under.github/workflows/, which is excluded from autonomous change; awaits a maintainer either applying the reword or broadening the trigger.preponderous/__init__.pynamespace package) — the deletion is only safe if sibling Preponderous-Software distributions follow the PEP 420 convention, which cannot be determined from this repository.A documentation sweep (README, RELEASING.md, pyproject.toml, docstrings) found no drift against the current source, so test expansion was chosen as the work mode.
This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson