Skip to content

test: nothing the model is given prints italic, asked of the whole page - #46

Merged
FBumann merged 1 commit into
mainfrom
claude/notation-audit
Aug 23, 2026
Merged

FBumann merged 1 commit into
mainfrom
claude/notation-audit

Conversation

@FBumann

@FBumann FBumann commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #44, which introduced the convention but tested it only where someone thought to name a symbol.

What was missing

#44 left two kinds of guard on upright is what the model is given, italic is what the solver chooses: per-name tests over _derive_name_symbol, and the goldens byte-for-byte. Neither says nothing else prints a given quantity italic.

A rendering path added later reaches the page through its own call. The derivation tests would still pass, the goldens would be regenerated to match the new output, and the first to notice the leak would be a reader — which is the failure mode the notation page exists to prevent.

What this asks instead

The finished document, over the fixture that carries every construct:

italic = {m for m in re.findall(r'\\mathit\{([^}]*)\}', to_latex(golden.MODEL))}
assert italic <= set(schema.variables)

plus the derivation side, that every parameter symbol in that model is upright. Multi-letter names land in the first net; single letters land in the second, which is where $\mathrm{p}$ sits — a bare italic p for a parameter would otherwise be invisible to a text search, since an index letter looks the same.

Checked, not assumed

Against a plausible regression rather than a contrived one: narrowing the given test to single letters — the shape a careless refactor takes — puts nine parameters back in italic, and the test names all nine:

['budget', 'cost', 'growth', 'is_flexible', 'lead', 'load', 'min_up', 'tech_cap', 'zone_cap'] print italic and are not variables — upright is what the model is given

Checks

pixi.sh is unreachable from this environment, so the gates ran on a 3.13 venv at the versions pixi.toml pins: 383 passed, ruff check and format clean, pyrefly 0 errors, typos clean. No generated output changes — this adds a test and nothing else.


Generated by Claude Code

The convention had per-name tests and byte-for-byte goldens, and neither says
*nothing else* prints a given quantity italic. A rendering path added later
reaches the page through its own call: the derivation tests would still pass,
the goldens would be regenerated to match, and the first to notice the leak
would be a reader rather than the suite.

So this asks the finished document, over the fixture that carries every
construct: every `\mathit` on the page names a variable, and every parameter
symbol the derivation produced is upright. Multi-letter names land in the
first net and single letters in the second, which is where `\mathrm{p}` sits.

Checked against a plausible regression rather than assumed — a `given` test
narrowed to single letters puts nine parameters back in italic, and the test
names all nine.
@FBumann
FBumann requested a review from brynpickering as a code owner August 23, 2026 12:39
@FBumann
FBumann merged commit 13da65d into main Aug 23, 2026
5 checks passed
@FBumann
FBumann deleted the claude/notation-audit branch September 9, 2026 06:45
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.

2 participants