Repository navigation
Commit f9ced43
committed
test(p2): close the last unguarded twin - the EN sister vs the AR dictionary
v0.5.28 pinned the AR page's 277-key dictionary as a bijection against its own
markup and left one thing explicitly unguarded: whether the EN sister file
actually renders what that dictionary's `en` side says. Two files, one message,
nothing comparing them.
The obvious fix is to assert the two files match. Measured first, they do NOT,
and the divergence is designed:
- the AR page is the INTERACTIVE twin - it carries the language switcher
- the sister is the PRINTABLE twin - it carries a printhead + print button
which is exactly why the [C5] dictionary walk dropped the EN `printhead` subtree
first. So a "they must be equal" test would have been 637 all over again: a
number that reads like a guarantee, matches nothing, and fails the first time a
real design decision meets it. This contract instead pins the drift that must
never happen, and pins the intended drift as fact:
- all 277 dictionary `.en` values appear VERBATIM in the sister (0 absent) -
the cross-file link is real and it holds
- load-bearing element counts are IDENTICAL (section 10, h2 10, h3 12, tr 30,
p 19, a 14, ids 34): a row or heading present in one twin only means the
sister is a stale snapshot, invisible to any per-file test
- the only permitted tag differences are b/span/div each +1 in the sister,
pinned AS A SET and re-checked against the printhead that causes them, so a
new divergence cannot hide beside a sanctioned one
- the sister stays dictionary-free (0 data-i18n, 0 D.nodes, 0 L()) - it is
literal English, and a second dictionary is a second source of truth [C27]
- the sister leaks no Arabic across its 539 text runs
- lang/dir asserted per twin: a wrong dir silently reverses the whole board's
order while every text assertion still passes
- the role asymmetry (AR langBtn <-> EN printBtn) is pinned as fact, so a
future session neither "fixes" it nor lets a dead button rot
Two findings the sweep produced that nobody had asked about:
- 221 of the 277 `.ar` values are ALREADY literal Arabic in the static markup,
so the AR page renders with JS disabled. The dictionary is the switcher's
payload, not the page's only text source - and that count is now pinned so
stripping the literal Arabic (a silent availability regression that every
dictionary-level assertion would pass) cannot land unnoticed.
- the file decoder FAILS LOUD on any new HTML entity, because a string
comparison that is quietly wrong is worse than no string comparison.
The 12-control battery reports COVERAGE, not a count: all 8 declared tests had to
be observed failing. That requirement immediately paid - the extractor read zero
failures until the harness was moved to --test-reporter=tap, because the default
reporter prints glyphs and an ASCII `not ok` filter finds nothing (the documented
grep trap, live, in a guard built to catch exactly that class).
Measured: 1201/1201, 836 files, 0 violations, docs-node 94/55/20, freeze 49/49.1 parent df9f62b commit f9ced43
4 files changed
Lines changed: 216 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| |||
0 commit comments