Skip to main content

PT/RO diacritic splice — pre-registered gate spec (#900 accept-overlap)

Status: PRE-REGISTRATION, per the #900 splice-safety-gate contract (CONTRIBUTING_MODEL_WORK.mdx § Splice safety gate): accepting a codepoint-overlapping localelocaleThe combination of language and country an address comes from. en-US and fr-FR are the locales Mailwoman ships weights for. is a commitment to a per-localelocaleThe combination of language and country an address comes from. en-US and fr-FR are the locales Mailwoman ships weights for. non-inferiority leg, declared in advance. The FR n=3000 coordinate leg from v5.1.0 is the template.

Commit-record caveat (honest sequencing). This file was authored before any leg was graded, and its bars are unedited since. But the commit that was supposed to land it first failed silently — the pre-commit hook runs the compiled CLI and out/ was stale from another branch, and a tail -1 pipe hid the error — so it entered git AFTER the v266 grading below rather than before it. The bars were not tuned to the result (v266 is a no-op; there was nothing to tune toward), but the git record cannot prove that ordering, and pretending otherwise is worth less than saying so. Protocol lesson in the night-3 postmortem: verify the commit landed, and rebuild out/ after any branch switch.

The candidate

TrainingtrainingThe process of adjusting a model's parameters so its predictions match labeled examples, by repeatedly measuring error and nudging the weights to reduce it. Distinct from inference, when the trained model is run on new input.-free vocabvocabularyThe fixed set of tokens a tokenizer can produce. Mailwoman's SentencePiece vocabulary is tens of thousands of subword pieces, with byte fallback for anything outside it. splice + FVT mean-init (the v5.1.0 / #825 recipe, onnx-mean-init path — no GPU, no checkpointcheckpointA saved snapshot of the model weights and optimizer state during training. Mailwoman saves a checkpoint periodically so training can resume after a GPU hang.): PT + RO diacriticdiacriticAn accent mark that modifies a letter (é, ñ, ç). Address normalization must fold diacritics for matching without discarding the information a user typed.-bearing piecesECE (Expected Calibration Error). A metric that measures how well a model's confidence scores align with its actual accuracy. Lower is better. Mailwoman's held-out ECE drops from 0.067 (raw) to 0.0035 (calibrated). appended to the shipped v0.9.0-multisplice vocabvocabularyThe fixed set of tokens a tokenizer can produce. Mailwoman's SentencePiece vocabulary is tens of thousands of subword pieces, with byte fallback for anything outside it. (73,143), embeddingsembeddingA vector of numbers representing a token (or other item) so that similar items sit near each other in vector space. The first thing the model does is turn each token into an embedding. expanded off the v264 (v6.3.0) ONNXONNX (Open Neural Network Exchange). An open format for machine learning models that enables interoperability between training frameworks and inference runtimes. Mailwoman ships its trained model as an ONNX file so it can run in Node.js and the browser via onnxruntime.. The encoderencoderThe part of a transformer that turns input tokens into contextualized vector representations. Mailwoman's classifier is a small encoder-only transformer (~30M parameters). is untouched.

Motivation (night-3, 2026-07-15-727-stage2-kbest-plan.md): PT and RO were never spliced. RO ț byte-falls-back, and the heal deliberately skips byte-fallback words, so those rows are unreachable from the decode side. Parity streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels.-tag exactness: PT 0.63, RO 0.80.

Build facts (measured at build time, pre-grading)

  • CorpuscorpusThe BIO-labeled training data used to train Mailwoman's neural classifier. Assembled from real sources (OpenAddresses, National Address Database) and synthetic shards (boundary stress, order variants, negative space). Managed by @mailwoman/corpus.: 311,155 deduped OA PT+RO streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels./citylocalityThe city / town / settlement component of an address: a populated place sitting between region and neighbourhood in the hierarchy. lines (seed 42, cap 2M rows/file).
  • New piecesECE (Expected Calibration Error). A metric that measures how well a model's confidence scores align with its actual accuracy. Lower is better. Mailwoman's held-out ECE drops from 0.067 (raw) to 0.0035 (calibrated).: 1,110 diacriticdiacriticAn accent mark that modifies a letter (é, ñ, ç). Address normalization must fold diacritics for matching without discarding the information a user typed.-bearing → vocabvocabularyThe fixed set of tokens a tokenizer can produce. Mailwoman's SentencePiece vocabulary is tens of thousands of subword pieces, with byte fallback for anything outside it. 73,143 → 74,253 (+1.5%).
  • English byte-identity: asserted, 0 diff (built into the tool).
  • Overlap report: tokenizer-ptro.overlap-report.json.

The #900 overlap finding

New-piece non-ASCII codepoints: º À Á Â Ã Ç É Ê Í Ó Ô Õ Ú Û â.

trained localelocaleThe combination of language and country an address comes from. en-US and fr-FR are the locales Mailwoman ships weights for.overlapdisposition
frclean, no leg needed
plclean
itclean
czÚACCEPTED → leg below
esÀ Á ÉACCEPTED → leg below
nlâACCEPTED → leg below

The overlap is uppercase-only for cz/es (address text is majority lowercase, and normalizeInput title-cases all-caps input — so the exposed surface is initial-capital tokenstokenOne word or subword in the tokenized input. For the neural classifier, tokens come from SentencePiece (subword units); for the rule classifiers, tokens are whitespace- and punctuation-separated words.) plus a single lowercase â for nl. Narrow, but narrow is a prediction, not a permission: the legs run regardless.

Pre-registered legs — the bars, fixed now

Each accepted localelocaleThe combination of language and country an address comes from. en-US and fr-FR are the locales Mailwoman ships weights for. gets a coordinate non-inferiority leg on its existing OA evalevalRunning the model against a held-out golden dataset and computing per-component F1, exact-match, calibration, and resolved-coordinate error. set, candidate vs the shipped v264 baseline, same resolverresolverThe component that converts parsed address components (locality, region, postcode) into coordinates by looking them up in the gazetteer. The resolver ranks candidates by name match, population, and proximity, and returns the best-matching place with its centroid or polygon./config, ship-config parseaddress parsingThe process of decomposing a free-text postal address string into structured components — house number, street name, locality, region, postcode, and country — so a geocoder can resolve them to coordinates. (heal ON):

legsetnbar
czdata/eval/external/oa-cz-coord-1k.jsonl1000resolve-rate ≥ baseline − 1.0pp AND mean coord error ≤ 1.05 × baseline
esdata/eval/external/oa-es-coord-1k.jsonl1000same
nldata/eval/external/oa-nl-coord-1k.jsonl1000same

Plus the standing battery, unchanged and non-negotiable:

  • Target legs (the point of the splice): PT + RO parity streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels.-tag must IMPROVE; RO byte-fallback words must disappear from the tokenization.
  • Parity floors (eval parity, ship config): house_number / postcodepostcodeThe country-specific postal code (US ZIP, French code postal, etc.). Mailwoman handles postcode parsing entirely by rule classifier — a regex problem, not an ML one. / streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels. must not regress.
  • Golden 2pp per-tag promote gate (eval error-analysis).
  • Gauntlet (regression + metamorphic) PASS.
  • Demo presets 6/6, zero grouper-auditgrouper-auditA validation pass checking that phrase-grouper spans are internally consistent — no overlaps, no contradictions with BIO structural rules. Audit errors must be zero on a shipping model. nodes.
  • FR non-inferiority: oa-fr-coord-150 — no overlap, so this is a control leg; a move here means the "no overlap ⇒ no change" reasoning is wrong and the whole splice is suspect.
  • #378 browser SLO: +1.5% vocabvocabularyThe fixed set of tokens a tokenizer can produce. Mailwoman's SentencePiece vocabulary is tens of thousands of subword pieces, with byte fallback for anything outside it. ≈ +1.7 MB fp32fp32 / fp1632-bit and 16-bit floating-point formats. Mailwoman trains in bf16 (a 16-bit variant) and exports the ONNX model in int8 for size. / +0.4 MB int8 embeddingembeddingA vector of numbers representing a token (or other item) so that similar items sit near each other in vector space. The first thing the model does is turn each token into an embedding. table. Report the actual int8 artifact delta; a size regression beyond the bundle budget blocks the ship regardless of accuracy.

RESULT — v266 (OA-sourced) is FALSIFIED at the data level, no GPU spent

The splice built and mean-init'd cleanly (74,253 vocabvocabularyThe fixed set of tokens a tokenizer can produce. Mailwoman's SentencePiece vocabulary is tens of thousands of subword pieces, with byte fallback for anything outside it., package-shaped candidate at scratchpad/v266-cache), and then did nothing: tokenization byte-identical to v264 on PT/RO inputs, parity identical (PT 5/8, RO 4/5, CZ 2/3, PL 5/6, SK 1/1 — every cell unchanged). The accepted-localelocaleThe combination of language and country an address comes from. en-US and fr-FR are the locales Mailwoman ships weights for. legs were never reached, because the target legs failed first. Cause, measured in the source data rather than inferred:

  • PT: the OpenAddressesOpenAddresses (OA). A global open aggregation of address points collected from many official sources. A primary source of component-supervised training data outside proprietary registries. PT source text is 100% UPPERCASE (R PRINCIPAL, MACINHATA DO VOUGA — 188,430/188,430 STREETstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels. values isupper()). So every piece the splice learned is uppercase (▁LOULÉ, ▁PORTIMÃO, ▁FAMALICÃO); zero new piecesECE (Expected Calibration Error). A metric that measures how well a model's confidence scores align with its actual accuracy. Lower is better. Mailwoman's held-out ECE drops from 0.067 (raw) to 0.0035 (calibrated). contain a lowercase é. Production title-cases all-caps input (#690 normalizeCase) and real queries are mixed-case, so those piecesECE (Expected Calibration Error). A metric that measures how well a model's confidence scores align with its actual accuracy. Lower is better. Mailwoman's held-out ECE drops from 0.067 (raw) to 0.0035 (calibrated). can never match the text the modelneural classifierThe machine learning model at the core of Mailwoman's parser — a transformer encoder (~30M parameters) trained from scratch to do BIO token classification over addresses. It learns the 'grammar' of address formats; the gazetteer supplies the 'atlas.' sees. A no-op by construction.
  • RO: the OpenAddressesOpenAddresses (OA). A global open aggregation of address points collected from many official sources. A primary source of component-supervised training data outside proprietary registries. RO source text is diacriticdiacriticAn accent mark that modifies a letter (é, ñ, ç). Address normalization must fold diacritics for matching without discarding the information a user typed.-stripped — 43 of 149,858 rows carry any RO diacriticdiacriticAn accent mark that modifies a letter (é, ñ, ç). Address normalization must fold diacritics for matching without discarding the information a user typed. (0.03%), and none carry ț/ș (Str. Dumitru Brumarescu for Brumărescu, Sacasel for Săcășel). The PT+RO trainingtrainingThe process of adjusting a model's parameters so its predictions match labeled examples, by repeatedly measuring error and nudging the weights to reduce it. Distinct from inference, when the trained model is run on new input. corpuscorpusThe BIO-labeled training data used to train Mailwoman's neural classifier. Assembled from real sources (OpenAddresses, National Address Database) and synthetic shards (boundary stress, order variants, negative space). Managed by @mailwoman/corpus. contained 0 lines with RO diacriticsdiacriticAn accent mark that modifies a letter (é, ñ, ç). Address normalization must fold diacritics for matching without discarding the information a user typed., so the 24k unigram produced exactly one RO-diacriticdiacriticAn accent mark that modifies a letter (é, ñ, ç). Address normalization must fold diacritics for matching without discarding the information a user typed. piece (Î). ț byte-fallback is untouched (en|<0xC8>|<0x9B>|ei before and after).

The --accept-overlap cz,es,nl legs are therefore moot for v266 and are NOT reported as passes: an unchanged tokenizertokenizerThe component that converts a raw address string into a sequence of numeric token IDs the model can process. Mailwoman's tokenizer is a SentencePiece unigram model trained specifically on postal addresses. trivially cannot move them, and reporting "no regression" from a no-op would be a fake green.

The fix, mechanism-confirmed (v267 — a NEW candidate, NOT covered by this spec)

Re-sourcing the splice text from WOFWOF (Who's On First). An open-source gazetteer of places maintained by Mapzen/whosonfirst. Mailwoman builds a custom SQLite database from WOF GeoJSON repos, extended with postcode data, importance scores, and coincident-role relations. native-language names (names table, language='', PT+RO; 23,768 names, 3,836 with ț/ș, 2,260 with ã/õ/ç) via the tool's existing --extra-text feed produces 2,064 piecesECE (Expected Calibration Error). A metric that measures how well a model's confidence scores align with its actual accuracy. Lower is better. Mailwoman's held-out ECE drops from 0.067 (raw) to 0.0035 (calibrated). with lowercase diacriticsdiacriticAn accent mark that modifies a letter (é, ñ, ç). Address normalization must fold diacritics for matching without discarding the information a user typed., and the mechanism works at the tokenizertokenizerThe component that converts a raw address string into a sequence of numeric token IDs the model can process. Mailwoman's tokenizer is a SentencePiece unigram model trained specifically on postal addresses. level:

inputv264 basev267 WOFWOF (Who's On First). An open-source gazetteer of places maintained by Mapzen/whosonfirst. Mailwoman builds a custom SQLite database from WOF GeoJSON repos, extended with postcode data, importance scores, and coincident-role relations.-name splice
Splaiul Independențeien|<0xC8>|<0x9B>|eien|țeibyte-fallback gone
Str. Săcășel▁S|ă|c|ă|ș|el (6)▁Săc|ășel (2)
Tv. dos Fiéis▁Fi|é|is▁Fi|éis
ASCII rowsbyte-identical

But v267 is a different candidate with a wider blast surface: its lowercase piecesECE (Expected Calibration Error). A metric that measures how well a model's confidence scores align with its actual accuracy. Lower is better. Mailwoman's held-out ECE drops from 0.067 (raw) to 0.0035 (calibrated). overlap fr (é), it (ã), and pl (ó) — on top of cz/es/nl. FR is the largest trained localelocaleThe combination of language and country an address comes from. en-US and fr-FR are the locales Mailwoman ships weights for. and is exactly what the v5.1.0 "netneural networkA model made of layers of simple numeric units whose connection strengths (weights) are learned from data. The transformer encoder at Mailwoman's core is a neural network.-positive by luck" incident ran through. Accepting six localeslocaleThe combination of language and country an address comes from. en-US and fr-FR are the locales Mailwoman ships weights for. requires a fresh pre-registration with six legs, graded before promotion; that is a new gate spec, not an amendment to this one, and it is deliberately NOT rushed to fit a shift boundary. Artifacts staged for it: scratchpad/v267-cache (package-shaped, vocabvocabularyThe fixed set of tokens a tokenizer can produce. Mailwoman's SentencePiece vocabulary is tens of thousands of subword pieces, with byte fallback for anything outside it. 75,207), int8 39.9 MB (v264: 39.8 MB, +0.3%).

v267 characterization (measured, NOT a gate run — the legs it needs aren't pre-registered yet)

Ship-config parity, full per-fixture diff vs v264 (scratchpad/diff-v264-v267.mjs, untruncated):

v264v267
parity streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels.0.57300.5768 (+1 fixture)
parity house_number0.80820.8082 (flat)
parity postcodepostcodeThe country-specific postal code (US ZIP, French code postal, etc.). Mailwoman handles postcode parsing entirely by rule classifier — a regex problem, not an ML one.0.98610.9861 (flat)
PT streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels.-tag5/86/8
RO streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels.-tag4/55/5
CZ / PL / SK streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels.-tag2/3, 5/6, 1/1unchanged
ASCII-only fixtures with any output drift0 (the byte-identity guarantee holds)

Netneural networkA model made of layers of simple numeric units whose connection strengths (weights) are learned from data. The transformer encoder at Mailwoman's core is a neural network. streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels. +1 = fixed 2, broke 1. The two fixes are the exact target rows (Tv. dos Fiéis de Deus…, Splaiul Independenței 313). The break is real and worth naming:

BR v1-address.bra-1 "Rua Raul Leite Magalhães, 65, Tapiraí - SP, 18180-000, Brazil"streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels. "Rua Raul Leite Magalhães""" (emitted nowhere).

Brazilian Portuguese — a PT-family localelocaleThe combination of language and country an address comes from. en-US and fr-FR are the locales Mailwoman ships weights for. that is not in the overlap gate's --trained-samples list at all, so the gate never saw it. That is a gap in the gate's localelocaleThe combination of language and country an address comes from. en-US and fr-FR are the locales Mailwoman ships weights for. inventory, not just this candidate's problem: pt-BR (and the OA br set) should join the standing sample list before any PT-touching splice is graded again.

A methodology note worth keeping: eval parity --failing 50 initially appeared to show an ASCII US row (N FISKE AVE Port) breaking, which would have contradicted the byte-identity guarantee. It was a truncationtruncationCutting an input down to the max sequence length (or an LLM response to its token limit), discarding everything past the cap. artifact — the list is capped at 50, so fixtures shift in and out of the window between runs. The full diff shows zero ASCII drift. Never diff two runs through a truncated list.

Decision rule, fixed now

Ship only on a clean sweep: every accepted-localelocaleThe combination of language and country an address comes from. en-US and fr-FR are the locales Mailwoman ships weights for. leg within its bar, PT/RO improved, no floor or gate regression, size within budget. Any accepted-localelocaleThe combination of language and country an address comes from. en-US and fr-FR are the locales Mailwoman ships weights for. leg outside its bar = the splice does not ship as-is (the honest outcome is a narrower splice — RO-only, which has no Á/É/À/Ú/â exposure — not a relaxed bar). Bars are not editable after the first measurement; a miss is an adjudication, and the revision protocol's human-in-the-loop is the buffer, not a constant.