Skip to content

Commit a99208c

Browse files
remigiusz-antczakRemigiusz Antczakclaude
authored
feat(skill): 1.148.0 — wave 69 i18n/l10n depth reference (domain R) (#390) (#409)
New references/i18n-l10n.md — the standards-heavy depth behind domain R's 8-line checklist (which omitted bidi/RTL). Routed from the R map row + the checklist header (no new archetype/letter). - Encoding & normalization: UTF-8 declared in-document; normalize before compare/dedup/key and AFTER concatenation ("None of the Normalization Forms are closed under string concatenation", UAX #15). - Bidi/RTL: declare dir; wrap opposite-direction phrases; flag bidi control chars in source/untrusted input (UAX #9 overrides "avoided ... security concerns", UTR #36) — the Trojan-Source class. - Plurals/formatting/collation: CLDR categories (zero/one/two/few/many/other), never n==1; locale-aware formatting; a locale collator not .sort(); text expansion. Sources fetched this session and added to docs/standards-index.md (W3C i18n, UAX #15, UAX #9 + UTR #36, CLDR). One eval (deep-code-review 144 to 145). Trio to 1.148.0. Dogfood reviewer: PASS-WITH-NITS -> both fixed pre-merge (scoped the UAX #9 security quote to overrides vs the safer isolates; "see UTR #36"). Tests: 19/19 gates green. Closes #390. Co-authored-by: Remigiusz Antczak <remigiusz@antczak.io> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent c538590 commit a99208c

13 files changed

Lines changed: 118 additions & 17 deletions

File tree

‎.claude-plugin/plugin.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "deep-code-review",
33
"description": "Perun — bring the thunder to your codebase. A portable, evidence-grounded quality bar for building with AI agents: the flagship deep-code-review skill (default install is review-only), plus opt-in overlays — gated delivery, an idea critic, a suite conductor, and stage-aware product, growth, positioning, business-ops, and output-safety specialists.",
44
"skills": "./.claude/skills",
5-
"version": "1.147.0",
5+
"version": "1.148.0",
66
"author": {
77
"name": "deep-code-review contributors"
88
},

‎.claude/skills/agentic-delivery/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ description: >-
1010
license: MIT
1111
metadata:
1212
author: deep-code-review contributors
13-
version: "1.147.0"
13+
version: "1.148.0"
1414
---
1515

1616
# Agentic delivery
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.147.0
1+
1.148.0

‎.claude/skills/deep-code-review/SKILL.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ description: >-
1111
license: MIT
1212
metadata:
1313
author: deep-code-review contributors
14-
version: "1.147.0"
14+
version: "1.148.0"
1515
---
1616

1717
# Deep Code Review
@@ -211,7 +211,7 @@ footguns: `references/language-stack-redflags.md`.
211211
| O | Docs & DX | `docs-and-dx.md`, `docs-evolution-by-stage.md` (which-docs-when, by stage), `readme-authoring.md` (writing/reviewing a README for onboarding) |
212212
| P | Frontend / UI / a11y | `frontend-a11y.md`, `product-ux-quality.md`, `migration-parity.md` |
213213
| Q | Privacy, compliance, licensing | `privacy-compliance.md` (code layer), `privacy-by-design.md` (pre-code product artifacts) |
214-
| R | i18n, encoding, localization | `domain-checklists.md` |
214+
| R | i18n, encoding, localization | `domain-checklists.md`, `i18n-l10n.md` (depth: bidi/RTL, Unicode normalization, CLDR plurals) |
215215
| S | Branches, merges, open-work triage | `branch-and-merge-hygiene.md` |
216216
| T | Multi-tenancy & isolation | `domain-checklists.md` (when one deployment serves multiple tenants) |
217217
| W | Workflows, jobs & scheduling | `domain-checklists.md` (when the target runs cron, queues, or multi-step workflows) |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.147.0
1+
1.148.0

‎.claude/skills/deep-code-review/evals/evals.json‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1547,6 +1547,17 @@
15471547
"No per-field source-of-truth map (authoritative / partial / never), so the consumer wires the wrong fields",
15481548
"Reconcile every claimed provider-input (count + classification) against the live artifact before it drives a score, plus a diff-gate"
15491549
]
1550+
},
1551+
{
1552+
"id": "i18n-unicode-normalization-not-closed-under-concatenation",
1553+
"prompt": "A pipeline normalizes each translated fragment to NFC, then concatenates the fragments to build a display string that is also used as a dedup key. Cross-locale, some 'identical' entries land as duplicates. Separately, a reviewer notes user-facing counts render via `n === 1 ? 'item' : 'items'`. What are the findings?",
1554+
"expected_output": "(1) Unicode normalization is NOT closed under string concatenation (UAX #15) -- even if each fragment is NFC, the concatenation X+Y is not guaranteed to be NFC, so the assembled dedup key can differ byte-for-byte between visually-identical entries, producing false duplicates. Fix: normalize at the boundary where the value is compared or stored, AFTER assembly, not per-fragment. (2) `n === 1 ? singular : plural` is wrong outside English-like languages -- Unicode CLDR defines up to six plural categories (zero/one/two/few/many/other) and languages vary in how they pluralize; route through an ICU/CLDR plural API ('other' is the required default), never a hardcoded binary or a count concatenated with a fixed suffix. (i18n-l10n.md.)",
1555+
"expectations": [
1556+
"Names UAX #15 concatenation non-closure: per-fragment NFC does not guarantee NFC after concatenation, so the assembled key mismatches -> false duplicates",
1557+
"Fix: normalize after assembly, at the compare/store boundary (not per-fragment)",
1558+
"n===1 binary plural is wrong: CLDR categories zero/one/two/few/many/other, route through an ICU/CLDR API ('other' required default)",
1559+
"Does not treat the author's locale as universal"
1560+
]
15501561
}
15511562
]
15521563
}

‎.claude/skills/deep-code-review/references/domain-checklists.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ export-boundary suppression, and licence-compatibility detail live there.
502502
agent-instance name, or personal workflow when the repo's privacy gate
503503
forbids it.
504504

505-
### R. Internationalization, encoding & localization
505+
### R. Internationalization, encoding & localization → depth: `references/i18n-l10n.md`
506506
- No hardcoded user-facing strings; locale-aware formatting, sort/collation, and
507507
pluralization; **Unicode normalization (NFC)** at boundaries — a NFC/NFD or
508508
casing difference silently splits or merges dedup/join keys (cross-ref D);
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Internationalization & localization — depth (domain R)
2+
3+
**Read this when** the target renders user-facing text in more than one language
4+
or locale, accepts user-supplied Unicode text, or the review question is "is this
5+
correct across locales and scripts?" It is the depth behind domain R's
6+
at-a-glance checklist in `domain-checklists.md` (§R) — the standards-heavy
7+
correctness a checklist can't hold. Cross-link the checklist; don't restate it.
8+
9+
## Encoding & Unicode normalization
10+
- **UTF-8 everywhere, declared in-document.** W3C i18n: "Choose UTF-8 for all
11+
content," and "always use an in-document encoding declaration, even if you are
12+
also using the HTTP header." When a document's bytes and its declared encoding
13+
disagree, non-ASCII text mojibakes silently.
14+
- **Normalize before you compare, dedup, or key on user text — and normalize
15+
*after* concatenation, not before.** Two visually identical strings can be
16+
different byte sequences (`é` as one code point vs `e` + a combining accent), so
17+
an equality check, a `GROUP BY`, a uniqueness constraint, or a cache key over
18+
un-normalized user text treats equal strings as different. Normalize to one form
19+
(NFC is the web default — W3C recommends it). The subtle trap: **"None of the
20+
Normalization Forms are closed under string concatenation … even if two strings
21+
X and Y are normalized, their string concatenation X+Y is _not_ guaranteed to be
22+
normalized"** (Unicode UAX #15). A pipeline that normalizes fragments and then
23+
concatenates can still emit un-normalized output — normalize at the boundary
24+
where the value is compared or stored, *after* assembly. (The checklist's
25+
🚩 "concatenated translated fragments" is this defect's surface form.)
26+
27+
## Bidirectional text (RTL) and the bidi-override attack
28+
- **Declare direction; don't rely on the renderer guessing.** W3C i18n: add
29+
`dir="rtl"` when the overall document direction is right-to-left, and "tightly
30+
wrap every opposite-direction phrase in markup that sets its base direction." An
31+
RTL string (Arabic, Hebrew) interleaved with LTR runs (numbers, Latin
32+
identifiers) reorders incorrectly without an explicit base direction — a
33+
displayed IBAN, price, or file path can render in the wrong visual order.
34+
- **Reject or flag Unicode bidi control characters in source and in untrusted
35+
input.** UAX #9 (the Unicode Bidirectional Algorithm) defines explicit
36+
directional-formatting controls in distinct classes: **overrides** (RLO/LRO),
37+
embeddings, **isolates** (RLI/LRI/FSI/PDI — the *safer* mechanism the
38+
direction-wrapping bullet above relies on), and the terminators PDF/PDI. UAX #9
39+
says the **overrides** in particular "are to be avoided wherever possible, because
40+
of security concerns" (see Unicode UTR #36). This is the Trojan-Source class: a
41+
bidi control in a source comment or string literal can make code *read* in review
42+
as the opposite of what compiles (the attack abused isolates as well as
43+
overrides), and in user content can spoof a displayed value — so flag bidi
44+
controls broadly in source and untrusted input, not only the overrides.
45+
(`domain-checklists.md`
46+
flags zero-width / bidi control characters for instruction-smuggling in code —
47+
the invisible-character check; this is the rendering-and-review-legibility side
48+
of the same characters.)
49+
50+
## Plurals, formatting, and collation
51+
- **Plural selection uses the locale's CLDR categories, never `n == 1`.** Unicode
52+
CLDR defines up to six plural categories — **zero, one, two, few, many, other** —
53+
and "languages vary in how they handle plurals"; a hardcoded
54+
`count === 1 ? singular : plural` is wrong for languages with dual/paucal forms.
55+
**`other` is the required default** every language has. Route plurals through an
56+
ICU / CLDR-backed API, never string concatenation of a count with a fixed suffix.
57+
- **Format numbers, dates, currency, and times through a locale-aware formatter.**
58+
Grouping separators, decimal marks, calendar system, first-day-of-week, and
59+
12/24-hour clock all vary by locale; a hand-rolled format is correct only for the
60+
author's locale. And **sort / collate with a locale collator, not a byte or
61+
`.sort()` compare** — `.sort()` on localized text orders by code point, which
62+
mis-orders accented and non-Latin scripts (the checklist's 🚩 ".sort() on
63+
localized text"). A collation test asserts the *locale's* expected order, not the
64+
ASCII order.
65+
- **Leave room for text expansion.** Translated strings run longer than English
66+
(German and Finnish are the usual worst cases); a layout that fits English
67+
exactly clips or overflows once localized. Verify the running UI in a
68+
long-string locale, not only in English (cross-ref `product-ux-quality.md` layout
69+
invariants across the sweep matrix).
70+
71+
## Standards (verified URLs + dates in `docs/standards-index.md`)
72+
W3C Internationalization (authoring techniques); Unicode UAX #15 (Normalization
73+
Forms, Unicode 18.0.0); Unicode UAX #9 (Bidirectional Algorithm, Unicode 18.0.0)
74+
with UTR #36 (security considerations); Unicode CLDR plural rules.

‎.claude/skills/idea-critic/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ description: >-
99
license: MIT
1010
metadata:
1111
author: deep-code-review contributors
12-
version: "1.147.0"
12+
version: "1.148.0"
1313
---
1414

1515
# Idea critic

‎.claude/skills/idea-critic/VERSION‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.147.0
1+
1.148.0

0 commit comments

Comments
 (0)