DialectScaffold.missingFrom and .dialectsOf, built as a deliberate parallel to
TranslationScaffold -- same package, same shape, same reason. "What is this room
missing" gets asked by the picker, again when a wave comes back, and a third time
by whatever reconciles the two; three copies would be three chances to disagree.
Matching is on (code, country) and never the name, which is the rule the eleven
tests exist to pin. A room that typed "Southern Sotho" where the catalogue says
"Sesotho" still holds st-in-Lesotho, and proposing it again would make a
duplicate that nothing can merge -- the two would not even collide, since their
ids differ by createdAt.
Normalisation is trim + lowercase(), the no-argument form on purpose: it is
locale-invariant in Kotlin common, so a device set to Turkish does not decide
that TI and ti are different languages.
dialectsOf takes one createdAt for the whole wave rather than reading the clock
per event, as TranslationScaffold.chaptersOf does, so a wave reads as the one act
it is. That also makes its ids a function of its inputs, which is what lets the
test assert the round trip back through fromDialectEventTemplate: what the picker
chose is what the row says once the group has signed it.
Pure and takes everything it reads, so it is testable without a database and a
composable can ask it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>