Skip to content

Scope activation by host, add opt-in extended glyphs, measure font coverage - #20

Merged
vladimirrott merged 2 commits into
mainfrom
feat/glyph-coverage-and-host-scope
Aug 18, 2026
Merged

vladimirrott merged 2 commits into
mainfrom
feat/glyph-coverage-and-host-scope

Conversation

@vladimirrott

Copy link
Copy Markdown
Member

Closes #18. Closes #19.

#18: activation scoped to surfaces that cannot render LaTeX

The frontmatter triggered on content alone. The body already said "in a terminal
coding agent", but the description is the only text a host matches against, so
the skill fired on surfaces that render math natively and lowered fidelity there.

The description now carries the surface predicate plus an explicit exclusion, and
"When this skill applies" spells out both sides.

I checked the Codex source before picking this lever rather than the one the
issue suggested:

  • policy.allow_implicit_invocation in agents/openai.yaml is global. Shipping
    it as false would disable implicit use in Codex CLI, the primary case, to fix
    a second surface.
  • codex-rs/core-skills/src/loader.rs loads CLI and desktop from the same
    $HOME/.agents/skills root, so there is no install-location split either.
  • No documented field scopes a skill to a surface.

So the description is the only lever that helps everyone, and the README now
documents the per-user ones: the [[skills.config]] name selector in
~/.codex/config.toml, and the openai.yaml policy override.

#19: opt-in extended glyph coverage

skills/math-unicode/references/extended-glyphs.md covers the Greek sub- and
superscripts and the rarer Latin capitals, with measured coverage per glyph.
Scoped to single-character scripts: Rule 5 keeps bracketed big-operator bounds
and Rule 13 still bars the Mathematical Alphanumeric block, both of which the
reporter had already conceded.

The gap list was wrong in three places

Two of them #19 surfaced directly.

claim reality
Greek sub/superscripts absent, examples ν μ ρ θ σ ᶿ U+1DBF exists and renders in 4/12 measured fonts, so θ joins the portable set. ᵨ U+1D68 exists too; I_ρ still stands, but the gap is font coverage, not Unicode
"No glyph exists ... S X Y Z" ꟱ U+A7F1 shipped in Unicode 17.0, September 2025. Stale for S
subscript capitals never mentioned; they are 0/26

The list now separates "no code point exists" from "a code point exists but no
font ships it".

Measure instead of assume

scripts/measure-font-coverage.mjs reads the cmap table of twelve monospace
fonts with no dependencies: JetBrains Mono, Fira Code, Cascadia Code, Hack,
Source Code Pro, IBM Plex Mono, DejaVu Sans Mono, Liberation Mono, Ubuntu Mono,
Ubuntu Sans Mono, Noto Mono, Cousine. Output cross-checked against fontTools on
all 295 glyphs, zero mismatches. Every published coverage number is asserted
against the fixture, so a typed number fails the build.

What it found:

  • 25 glyphs the cheatsheet advertised render in at most one of the twelve,
    including ∮ in Rule 5 and in the golden corpus, and both members of Rule 13's
    own exception (𝔼 and 𝔽 at 1/12, the worst in the file). They move to a new
    Glyphs to avoid section with substitutes that measure better.
  • The letter sub/superscripts are DejaVu-class. JetBrains Mono, Fira Code, Hack
    and IBM Plex Mono carry 0/17 subscripts and 0/19 capital superscripts, so xᵢ
    and xᵀ arrive through fontconfig fallback there. Documented, not changed:
    narrowing Rules 3 and 4 is a product call, not a bug fix.
  • Ubuntu Sans Mono, the current Ubuntu default, carries none of the letter
    scripts and none of the number sets. Only the digits survive.

docs/index.md

One sentence linked openai/codex#15865 as a "still-open gap" though it is
closed as a duplicate, and claimed Unicode "renders in every terminal". Both are
claims the suite already guarded, in the one public file neither guard read. The
corpora are widened.

Verification

  • 35/35 tests pass, up from 24.
  • 18 mutations, each against a verified-green baseline with a verified-clean
    restore, all caught. Two earlier holes that mutation testing exposed are fixed
    in the second commit: a 1/12 glyph could return to the cheatsheet, and a tier
    range could be tidied by dropping its weakest member.

Not in this PR

  • Rules 3 and 4 still prefer xᵢ and xᵀ. The measurement argues for revisiting
    that; it is a separate decision.
  • The repo prose uses em dashes against CLAUDE.local.md. A punctuation sweep
    would bury this diff.
  • AGENTS.md and CLAUDE.md are untracked and not in .git/info/exclude, while
    CLAUDE.local.md refers to "this repo's committed AGENTS.md".

Vladimir Rotariu and others added 2 commits August 18, 2026 03:09
Closes #18. The frontmatter triggered on content alone: "whenever a response
needs mathematical notation". The body already said "in a terminal coding
agent", but the description is the only text a host matches against, so the
skill fired on surfaces that render math natively and lowered fidelity there.
The description now carries the surface predicate and an explicit exclusion,
and a new block in "When this skill applies" spells both sides out. Checked
against Codex source before choosing this lever: policy.allow_implicit_invocation
in agents/openai.yaml is global, skills load from the same $HOME/.agents/skills
root on CLI and desktop, and no documented field scopes a skill to a surface.
Shipping allow_implicit_invocation: false would have disabled implicit use in
Codex CLI, the primary case, to fix a second surface. README documents the
per-user levers instead, including the [[skills.config]] name selector.

Closes #19. Adds references/extended-glyphs.md, an opt-in set covering the
Greek sub- and superscripts plus the rarer Latin capitals, with measured
coverage per glyph. Scoped to single-character scripts: Rule 5 keeps bracketed
big-operator bounds, so the mixed forms it exists to prevent cannot come back,
and Rule 13 still bars the Mathematical Alphanumeric Symbols block. The
reporter had already conceded both points.

The gap list was wrong in three places, and #19 surfaced the first two.
Superscript theta exists as U+1DBF and renders in four of twelve measured
fonts, the same tier as the Latin blocks, so it joins the portable set instead
of falling back to x^theta. Subscript rho exists as U+1D68; the recommendation
to write I_rho stands, but the stated reason was wrong, since the gap is font
coverage rather than Unicode. Superscript S shipped in Unicode 17.0 as U+A7F1,
so "no glyph exists ... S X Y Z" went stale in September 2025. The list now
separates "no code point exists" from "a code point exists but no font ships
it", and states subscript capitals as 0/26, which it never mentioned at all.

Measure instead of assume. scripts/measure-font-coverage.mjs reads the cmap
table of twelve monospace fonts with no dependencies, six of the most widely
installed programming fonts and six system fonts, and writes
test/fixtures/font-coverage.json. Its output was cross-checked against
fontTools on all 295 glyphs with zero mismatches. Every coverage number in
SKILL.md, README.md and the extended reference is asserted against that
fixture, so a typed number now fails the build.

What the measurement found: 25 glyphs the cheatsheet advertised render in at
most one of the twelve fonts, including the contour integral in Rule 5 and in
the golden corpus, and both members of Rule 13's own exception. Those move to
a new "Glyphs to avoid" section with substitutes that measure better, and the
Cauchy formula now uses the bracketed selector the rest of Rule 5 already uses.
Rule 13's exception keeps the Letterlike Symbols number sets, which fonts do
carry, and drops the two Mathematical Alphanumeric members it had carved out.

Also fixes docs/index.md, which linked openai/codex#15865 as a "still-open
gap" though it is closed as a duplicate, and claimed Unicode "renders in every
terminal" while Ubuntu's own default font carries none of the letter scripts.
Both are the exact claims the suite already guarded, in the one public file
neither guard read; the corpora are widened so the guards cover it now.

Every new guard was mutation-tested to confirm it fails when its claim is
removed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WDfNddyYD8XqS4kMZGzxnu
Mutation testing found both. A glyph like double-struck F measures 1/12, so
the "renders in at least one font" check passed even with it back in the
number-sets row; the avoid list is the actual decision, so assert that nothing
on it is recommended anywhere else. And a tier range could be tidied by
dropping its weakest member, since the test recomputed min and max over
whatever glyphs the row happened to list; the tier table must now account for
every glyph the cheatsheet's script rows offer, which also added rows for
superscript i and n, superscript theta, and the sign and paren scripts.

The tier-row pattern also required a lowercase label, so it silently skipped
the Greek letters row and never checked those numbers at all.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WDfNddyYD8XqS4kMZGzxnu
@vladimirrott
vladimirrott merged commit 6f55027 into main Aug 18, 2026
7 checks passed
@vladimirrott
vladimirrott deleted the feat/glyph-coverage-and-host-scope branch August 18, 2026 11:57
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.

Add an opt-in extended superscript/subscript glyph mode Scope implicit activation to terminal/TUI hosts

1 participant