Skip to content

comments: cut the development log from the four largest offenders - #684

Merged
christopherthompson81 merged 5 commits into
mainfrom
comment-sweep-2
Aug 6, 2026
Merged

comments: cut the development log from the four largest offenders#684
christopherthompson81 merged 5 commits into
mainfrom
comment-sweep-2

Conversation

@christopherthompson81

Copy link
Copy Markdown
Owner

Continues the standard set in #683write it the way you would if you were porting the file to another language — against the biggest remaining files. All four are token-identical to their originals; comments only.

file comments note
slovenian/normalize.ts 458 → 380 67-line header → 23
core/normalizeSymbols.ts 404 → 345 185 of the remainder is genuine API spec
hungarian/normalize.ts 361 → 239 107-line header → 35, the largest block in the repo
khmer/normalize.ts 307 → 236 52-line header → 21

Running total across both PRs: 146 → 142 files, 16,610 → ~14,300 comment lines over 1:1.

What came out

Corpus tabulations of pre-fix readings (Hungarian's header listed a dozen wrong outputs with their IPA), post-change measurements ("355 of 1,995 utterances differ; periods went from 2,373 to 2,254"), discovery attribution ("reported by the Ukrainian run", "the Polish run hit this and had to omit its own złoty"), and accounts of earlier wrong conclusions (Khmer's currency block explained at length why a previous pass had recorded the yuan word as unsourceable).

What stayed

Every rule and every trap:

  • Slovenian's ordinal-period discriminator and the invariant it protects — no utterance-final pause lost, and the year rule Croatian uses would destroy every one of them here
  • Slovenian's four-way DUAL agreement and why the shared slavicCountForm cannot serve it
  • Hungarian's "lowercase follows" test being stronger than "anything follows", and the ordinal-before-a-capital knowingly given up to hold the invariant
  • Khmer native digits outnumbering ASCII, so every pattern must match both ranges
  • normalizeSymbols' longest-first magnitude ordering, the apostrophe in the trailing guard, the mark guard following unspacedScript, and why both halves of NOT_VERSION are needed

normalizeSymbols deliberately stopped at 345

Measured the split: 185 of those lines are API documentation for the ~30 SymbolData fields — four exponent positions, count-form selectors, prefix/suffix variants. That is specification a caller needs. Cutting it would make the module harder to use, not cleaner.

A real trap found, now documented

Writing *tri*/*štiri* in a block comment — markdown emphasis around a slashed alternative — forms */ and terminates the comment, so the rest parses as code. Typecheck caught it but pointed two lines past the cause, which made it look like a regex error. CONTRIBUTING.md now warns about it, and the replacement scripts assert no candidate text contains */.

224 test files / 3114 tests, typecheck clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_012Lc3WnUgogC7okV7n53vjr

christopherthompson81 and others added 5 commits August 6, 2026 17:41
Cut the discovery attribution ('reported by the Ukrainian run', 'found by the Italian fan-out run',
'the Polish run hit this and had to omit its own złoty') and the blast-radius tables, keeping every
rule and trap: longest-first magnitude ordering, the apostrophe in the trailing guard, the mark guard
following unspacedScript, why the connective is consumed on the unit path but generated on the
currency path, and why both halves of NOT_VERSION are needed.

Also removed a duplicated pair of lines about the percent signs.

185 of the remaining 345 are API docs for the ~30 SymbolData fields — specification, not narrative.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Lc3WnUgogC7okV7n53vjr
The 67-line header was half a tabulation of pre-fix readings; what survives is the ordinal-period
discriminator (lowercase follower = ordinal, uppercase or end-of-utterance = sentence period, and the
year rule Croatian uses would destroy every utterance-final pause here), the four-way DUAL agreement
and why slavicCountForm cannot serve it, and the numeral-gender repair.

⚠ Hit a real trap doing it: *tri*/*štiri* inside a block comment forms `*/` and terminates it, so the
rest of the block parses as code. Typecheck caught it but pointed two lines past the cause. Now noted
in CONTRIBUTING.md, and the replacement script asserts no candidate text contains `*/`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Lc3WnUgogC7okV7n53vjr
The 107-line header — the largest single comment block in the repo — was mostly a tabulation of
pre-fix readings and a post-change measurement. What survives: the ordinal detector's rule and the
invariant it protects (no sentence-final pause lost; an ordinal before a capital is knowingly given
up to hold it), why year-before-month must stay cardinal, why vowel harmony costs nothing, the
deliberate omissions, and why × is an unshipped harmonic suffix rather than a word.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Lc3WnUgogC7okV7n53vjr
Header 52 → 21: the corpus tabulation and the before-readings go; what stays is why the tokenizer skips
these characters at all, that native ០-៩ outnumber ASCII so every pattern must match both, why the
decimal point is removed rather than voiced, and why there is deliberately no clock rule.

Also cut the currency block's account of an earlier wrong conclusion, keeping the two rules it
established: US$ needs its own key because the tier refuses a sign after a Latin letter, and CN¥ is
declared while bare ¥ is not because the sign is yen/yuan-ambiguous where the code is not.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Lc3WnUgogC7okV7n53vjr
Wrote a test to detect an accidental comment terminator, then found it cannot be made precise: 'no
space before */' also flags legitimate comments ending 'text*/', and the pattern matches glob strings
like "src/**/*.ts" that are not comments at all. Four false positives on clean code.

The premise was wrong anyway. I justified the test by worrying it could pass silently at the tail of a
file, but the text following an accidental terminator is always prose, which never parses as valid
TypeScript — typecheck catches this reliably every time. A noisy guard gets disabled; the accurate
note does not.

CONTRIBUTING now says typecheck ALWAYS catches it, that the error points past the real cause and reads
as an unterminated regex, and what to look for.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Lc3WnUgogC7okV7n53vjr
@christopherthompson81
christopherthompson81 merged commit 00fc3a0 into main Aug 6, 2026
2 checks passed
@christopherthompson81
christopherthompson81 deleted the comment-sweep-2 branch August 6, 2026 23: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.

1 participant