Image Sense Gate — design (PHON-205)¶
Date: 2026-07-23 Ticket: PHON-205 — Root-inherited images misrepresent lexicalized inflections (e.g. rights → right arrow) Status: design approved, ready for implementation planning
Problem¶
The picture card for rights shows a right-arrow. rights inherits its lemma's
image through the root_inherited tier in
packages/data/src/phonolex_data/runtime/images.py, and the arrow teaches the
wrong word→image association in a child-facing SLP tool.
The ticket framed this as lexicalized inflection — an inflected form whose
dominant sense has drifted from its lemma's. That framing was tested against all
10,638 root_inherited pairs and does not isolate the defect.
What the probe measured¶
| Signal | Coverage | Flags | Behaviour |
|---|---|---|---|
| Inflection is its own WordNet lemma, synsets disjoint from root | 100% | 1,889 (17.8%) | catches arms, glasses, spirits, papers; swamped by abandoned, accepted, absorbing — participial adjectives WordNet lists separately, where the inherited image is correct |
| SemCor dominant sense of inflection ≠ dominant sense of root | 40.6% both-covered | 2,314 (21.8%) | dominated by made, told, asked, came — a different verb sense of the same verb, where the image is still correct |
Neither flags rights. SemCor gives the dominant sense of surface rights as
right.n.01 (12 of 13 tokens) and the dominant sense of surface right as
right.n.01 as well. There is no inflection-vs-root divergence to detect.
The actual defect¶
right.n.01 is "an abstract idea of that which is due to a person or
governmental body by law or tradition or nature" — the entitlement sense, which
WordNet ranks first for the bare word right.
The shipped card's own provenance in data/mappings/word_to_image.tsv:
right right mulberry CC-BY-SA-4.0 exact Noun Descriptive Direction 0 1
Mulberry declares the symbol depicts direction — right.n.02, rank 2 of 8
noun senses. So right's direct card already depicts a non-dominant sense.
Root inheritance did not introduce the error; it faithfully propagated one that
was already present.
The comparison that isolates the defect is not inflection-vs-root. It is the sense the card depicts vs. the dominant sense of the word it is shipped for.
The third term — what the picture shows — is not in WordNet. It lives in
Mulberry's symbol_category, OpenMoji's annotation, and our generated cards'
cardspec gloss/depiction. Supplying it is the only genuinely new work.
This comparison is strictly better for the reproducibility requirement on two
counts. WordNet orders synsets by frequency, so wn.synsets(w)[0] yields a
dominant sense at 100% coverage with no SemCor sparsity problem. And the
check applies to direct cards too, so future tranches are validated by
construction rather than audited after the fact.
Goal¶
No word ships a picture card depicting a sense it does not carry. Enforced by a deterministic rule over committed artifacts that re-runs on every future image tranche without a fresh audit.
Design¶
1. The gate¶
A verdict per (word, image) pair from three terms:
card_synset— the WordNet synset the shipped picture depictsword_senses— WordNet synsets for the surface form, frequency-ordered, refined by SemCor surface-form counts where there are ≥3 tokens (SemCor is surface-indexed, so it distinguishesrightsfromright; WordNet ordering is lemma-indexed and cannot)verdict—compatible|incompatible
Compatibility is graded, not synset equality. A pair is compatible when the card
synset is the dominant synset, is within a bounded number of hypernym/hyponym
hops of it, or shares a close common hypernym. Equality would be far too strict:
papers (dominant document.n.01) vs a paper.n.01 sheet-of-material card sits
in a different subtree and flags correctly, while cats vs cat.n.01 does not.
Asymmetric strictness¶
Strictness differs by tier. This is the load-bearing decision.
- Inherited cards (10,638 pairs) — strict. Flag when
card_synsetis not compatible with the inflection's dominant sense. - Direct cards (~11.4K pairs) — permissive. Flag only when
card_synsetfalls outside the word's top-K senses entirely.
The asymmetry keeps right's arrow (direction is rank 2, inside top-K) while
still flagging rights (card right.n.02 vs dominant right.n.01). Without it,
WordNet's adult-register frequency ordering would strip child-dominant senses off
cards that already passed PHON-185 rubric review.
K is a tunable constant in the gate module with a single documented default;
the implementation plan sets it from the alignment-pass results.
Mandatory guards¶
Prototyping on the 3,150 shipped Mulberry pairs showed the bare card-sense-vs-dominant-sense comparison flags 976 pairs (31%), overwhelmingly false positives. Three guards are required, not optional; together they bring it to 120 (3.8%).
- G1 — corpus support. Trust a dominant sense only when it has SemCor
backing (≥2 surface tokens) or is WordNet rank 1 with a nonzero tagged lemma
count. WordNet's frequency order is polluted by rare and technical senses:
bikini.n.01is Bikini Atoll,bendsis decompression sickness,ais angstrom,bis bacillus. Without G1 these all flag. - G2 — derivational bridge. A lexname shift reachable through WordNet
derivationally-related forms from the card's synset is a morphological
shift, not sense drift:
bicycling(noun.act) inheriting thebicycleartifact card is correct, as isarrests(noun.act) from a Verb card. The bridge must originate at the card synset, never at all senses of the card word — the looser form is what letrightspass in the prototype. - G3 — abstain. No confident dominant sense yields no verdict. 45% of
Mulberry pairs (1,407) abstain, and the gate must leave them untouched.
Absence of evidence is never a flag.
abstainis a first-class verdict in the committed artifact, distinct fromcompatible.
Supporting precision signals¶
Each is gated to the surface class where it is not noise, and raises confidence on a flag rather than producing one alone:
- WordNet plural marker — synset glosses carrying
(frequently plural)/(usually plural)etc. 100 lemmas repo-wide, 43 of our root-inherited pairs. Very high precision for the lexicalized-plural class (authorities,depths,conditions,interests,exercises). Gated to plural surface forms — it otherwise fires onchanneled,interesting. - Own-lemma disjointness — gated to nominal plurals, which removes the participial-adjective noise that made it unusable standalone.
- SemCor surface divergence — gated to nouns, which removes the verb-tense noise.
2. Term 1 — establishing what each card depicts¶
Term 1 must resolve to a synset, not a sense domain. A prototype that
approximated it as a set of WordNet lexnames failed on exactly the case this
ticket exists for: right has 8 noun senses whose derivational forms span nearly
every lexname, so a domain-level match let the direction card through for
rights. Domain granularity is adequate for monosemous words and unsafe for
polysemous ones — which are precisely the ones that can be sense-wrong.
| Provider | Cards | Signal | Method |
|---|---|---|---|
| mulberry | ~1,400 | symbol_category (110-value taxonomy) + symbol_grammar |
deterministic — category maps to candidate lexnames, which disambiguate the word's synsets to one card synset (Descriptive Direction + right → right.n.02) |
| generated | 9,724 | cardspec gloss + depiction |
LLM alignment batch |
| openmoji | ~280 | annotation + category | LLM alignment batch |
Mulberry — the stream where dropping a card actually removes third-party
coverage — needs no LLM pass at all. Its category taxonomy is a hand-assigned
sense declaration already in data/mappings/word_to_image.tsv. Only the
generated and OpenMoji streams need alignment, and generated is ours going
forward.
Committed as data/mappings/card_senses.tsv with columns
word, provider, image_file, synset, confidence, source_signal.
Forward-looking: research/2026-07-12-image-gen-style-probe/bakeoff/cardspec.py
gains a synset field so every future tranche declares its sense at generation
time and term 1 is free for new cards. This is an emit, not a hard blocking
gate on generation — a rule bug must not be able to block a tranche.
3. Pipeline integration¶
Follows the existing committed-artifact paradigm; images.py stays a reader.
- New dev-local script
packages/data/scripts/build_image_sense_gate.py. Requires nltk (WordNet + SemCor). CI never runs it, consistent withbuild_image_mapping.pyandbuild_generated_image_mapping.py. - New committed artifact
data/mappings/image_sense_verdicts.tsv—word, provider, image_file, card_synset, dominant_synset, relation, verdict, reason. Human-reviewed before it ships, mirroring the PHON-197 denylist pattern. The rule proposes; it does not auto-apply. - One change in
images.py— filterincompatiblepairs out of the shipped pool before preferred-selection and before root inheritance, so a dropped root card cannot be inherited by anything. - Fallthrough is then automatic: the word drops to the next-best provider, and to imageless if none survives.
4. Remediation batch¶
Flagged words split by the cardspec's existing depictability call:
- depictable → generate via the existing
gen_tranche.pylane → add todata/mappings/generated_word_images.tsv. The direct match then beats inheritance automatically with no further logic. UNDEPICTABLE→ add todata/mappings/image_policy_blocklist.tsvwithreason=sense-divergent. No card ships. A word that cannot be depicted correctly is left imageless rather than wrongly imaged.- Pixels upload via the existing
packages/web/workers/scripts/upload-generated-images-r2.py; the CI coverage verify gate (verify-generated-images-r2.py) already covers the new cards.
5. Validation¶
- Vision spot-check over the flagged set before verdicts are committed — a model is shown each card with the word it ships for and asked whether it fits. An accuracy check on the rule, not the mechanism.
- Unit tests in
packages/data/tests/with hermetic fixtures for the gate logic: compatibility relation, asymmetric strictness, each supporting signal's surface-class gating. - Regression assertions:
rightsno longer inheritsright.svg;catsstill inheritscat's card; a blocklisted word still ships no card from any provider.
Scope¶
In: the gate rule, the card-sense alignment pass, the images.py filter, the
committed verdicts artifact, the remediation batch for flagged words, the
cardspec synset emit.
Out: image quality review (PHON-185's rubric, orthogonal — the gate checks sense, not whether the picture is good); new coverage tranches (PHON-188); changes to the canonical rule or root morphology.
Blast radius¶
Third-party (Mulberry + OpenMoji) coverage is 3,674 shipped pairs — 1,561 exact, 1,992 root-inherited, 121 other tiers. Mulberry and our generated set overlap on 3 words, so a dropped third-party card almost never has a fallback: 88% of third-party pairs (3,239) would go imageless rather than fall through to another provider.
Bounds on how many are actually dropped:
| Bound | Pairs | Basis |
|---|---|---|
| Ceiling | 3,674 | every third-party pair |
| At-risk | 2,648 (72%) | polysemous and senses span ≥2 lexnames — i.e. a wrong sense exists to pick |
| Measured, guarded gate (Mulberry) | 120 (3.8%) | 53 inherited + 62 direct, from the prototype on all 3,150 Mulberry pairs |
| Supporting-signal lower bound | 222 | inherited pairs tripping plural-marker / own-lemma / SemCor divergence; 209 without fallback |
The realistic expectation is low hundreds, all regenerable through the
existing gen_tranche.py lane. The at-risk figure is the ceiling only if the
gate were strict everywhere — which is why the tier asymmetry matters. The 1,193
at-risk direct Mulberry cards include break (75 senses), cut (70), run
(57), play (52), take (44); a uniformly strict rule would put all of them in
question, while the top-K permissive tier leaves them alone.
Accepted posture: dropping third-party cards is desirable in itself, since the long-term direction is away from third-party assets. Words that lose a card and cannot be correctly regenerated stay imageless.
Risks¶
- WordNet frequency order reflects adult written register. No sense-tagged child corpus exists to correct it — CYP-LEX and the FineWeb-Edu grade bands are word-level, not sense-level. Mitigated by asymmetric strictness and by the verdicts file being human-reviewed rather than auto-applied. Accepted, not eliminated.
- The gate checks sense, not depiction quality. A card can pass the gate and still be a poor picture.
- The gate is only as good as term 1. The Mulberry prototype is deterministic and measurable today; the generated stream's alignment quality is unverified until the batch runs. The plan must checkpoint after alignment and sample-verify before any verdict ships.
- G3 abstains on ~45% of pairs. The gate is silent on a large minority — it reduces wrong cards, it does not certify the rest as correct.
- Mulberry cards will be dropped with no fallback. 88% of third-party pairs have no other provider, so a drop means imageless until regenerated. Accepted (see Blast radius), but it means the remediation batch should land in the same release as the gate, not after it.
Acceptance¶
rights, and similarly sense-divergent forms, either carry a correct image or no
image — never the lemma's misleading one. The rule is a committed script plus a
committed verdicts artifact, re-runnable on each future tranche without a fresh
audit.
References¶
- Ticket: PHON-205. Related: PHON-162 (mapping), PHON-184 (root population —
stale,
rootis populated), PHON-185/187 (generated pipeline), PHON-193 (WordNet sense signal in the canonical rule), PHON-197 (curated-denylist pattern). - Ship policy and inheritance:
packages/data/src/phonolex_data/runtime/images.py - Generation lane:
research/2026-07-12-image-gen-style-probe/bakeoff/gen_tranche.py