2026-07-18 — Phase-4c wired: the k-best name-evidence rerank, and the collateral the board missed
Day-shift continuation of the #727 stagestageOne of the dataflow stages in the runtime pipeline (normalize, locale gate, kind classify, phrase group, token classify, sequence correct, reconcile, resolve). Distinct from tier (model vocabulary) and phase (plan milestone).-2 arc. The night landed three 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). on main — the spanspanA contiguous range of characters or tokens in the input string, tagged with an address component type (street, locality, postcode, etc.). Parsed addresses are represented as collections of spans, possibly nested in a tree.
decode surface (#1154), the StreetLocalityEvidence arbiter (#1156), the P1 design (#1152) — and
measured the name-evidence rerank at +6.0pp 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 on the FR fragment board. This is the wiring:
compose them into one production entry point, rerankByStreetEvidence, and — the part the board
did not do — check what the rerank costs the REST of the 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..
The board measured street in isolation; the wiring measured the whole tree
The night's board scored the 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 alone. Wiring it into a real 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. (segmentation → tree) surfaced a hazard the board could not see: the spanspanA contiguous range of characters or tokens in the input string, tagged with an address component type (street, locality, postcode, etc.). Parsed addresses are represented as collections of spans, possibly nested in a tree. headattention headOne of several parallel attention computations in a layer, each free to focus on a different kind of relationship between tokens. Their outputs are concatenated — 'multi-head attention'. Mailwoman uses 4 heads. is a streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels.-boundary specialist, and its full segmentation decode is far worse than the BIO argmax headattention headOne of several parallel attention computations in a layer, each free to focus on a different kind of relationship between tokens. Their outputs are concatenated — 'multi-head attention'. Mailwoman uses 4 heads. on every other tag. Replacing the argmax tree with the segmentation decode:
| golden | argmax exact | seg-decode exact | fr localitylocalityThe city / town / settlement component of an address: a populated place sitting between region and neighbourhood in the hierarchy. | fr 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. |
|---|---|---|---|---|
| us | 0.724 | 0.661 (−6.4pp) | — | — |
| fr | 0.828 | 0.478 (−35.0pp) | 0.855 → 0.506 | 0.996 → 0.946 |
A −35pp fr collapse. The +6pp streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels. win, taken naively, would have shipped a localitylocalityThe city / town / settlement component of an address: a populated place sitting between region and neighbourhood in the hierarchy./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. disaster. The board's number was real but partial.
The fix: splice the street only, and only when the atlas confirms it
Two design moves, each measured:
- StreetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels.-splice, not tree-replace. Override only the 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. the winning segmentation labelscomponent tagOne of the 33 labels in Mailwoman's address schema — street, locality, region, postcode, house_number, unit, po_box, country, venue, intersection, and others. Each parsed span carries exactly one component tag. streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels.-family; argmax owns localitylocalityThe city / town / settlement component of an address: a populated place sitting between region and neighbourhood in the hierarchy./regionregionThe first-level administrative subdivision of a country — a US state, a French region, a province. The component between country and locality./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./house_number. This alone recovered most of the lossloss functionA number measuring how wrong the model's predictions are on a batch of examples. Training minimizes it. Mailwoman's loss combines per-token negative log-likelihood with the CRF sequence loss. (fr exact −1.4pp) but still cost fr streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels. −2.7pp — the spanspanA contiguous range of characters or tokens in the input string, tagged with an address component type (street, locality, postcode, etc.). Parsed addresses are represented as collections of spans, possibly nested in a tree. headattention headOne of several parallel attention computations in a layer, each free to focus on a different kind of relationship between tokens. Their outputs are concatenated — 'multi-head attention'. Mailwoman uses 4 heads. over/under-extends the streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels. on clean multi-component inputs where the BIO headattention headOne of several parallel attention computations in a layer, each free to focus on a different kind of relationship between tokens. Their outputs are concatenated — 'multi-head attention'. Mailwoman uses 4 heads. is better.
- Positive-evidence gate. Splice only a streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels. the atlas CONFIRMS exists. On a clean address the argmax streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels. is already right + confirmed → the splice is a no-op; on a fragment the argmax streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels. is wrong/absent and the confirmed segmentation streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels. replaces it. An unconfirmed streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels. never overrides 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.'.
Result — the honest production delta (vs argmax, the baseline production runs)
| board (evidence-gated streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels.-splice) | argmax baseline | reranked | delta |
|---|---|---|---|
| golden us exact | 0.724 | 0.724 | +0.000 |
| golden fr exact | 0.828 | 0.828 | +0.000 |
| golden — every tag (us+fr) | — | — | unchanged |
| FR fragment 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 | 0.673 | 0.841 | +16.9pp |
| — bare-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.770 | 0.950 | +18.0pp |
| — date-name | 0.133 | 0.540 | +40.7pp |
| — streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels.-particle | 0.858 | 0.935 | +7.7pp |
273 fixes / 3 breaks on the fragment board. Zero golden regression, +16.9pp on FR fragments. Note the framing: the night's "+6.0pp" was measured against the spanspanA contiguous range of characters or tokens in the input string, tagged with an address component type (street, locality, postcode, etc.). Parsed addresses are represented as collections of spans, possibly nested in a tree.-headattention headOne of several parallel attention computations in a layer, each free to focus on a different kind of relationship between tokens. Their outputs are concatenated — 'multi-head attention'. Mailwoman uses 4 heads.'s own seg@1; against 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.' production actually runs (argmax), the fragment-streetstreetThe named linear feature along which house numbers are ordered. Decomposes into a name plus street affixes; one of the Tier 2 fine labels. win is +16.9pp — the argmax baseline was much lower on fragments than the segmentation seg@1 the board used.
Status + what's next
mailwoman/kbest-street-rerank.ts—rerankByStreetEvidence(classifier, text, evidence, grammar, opts), PURE composition (injected evidence), byte-stable fallback for spanspanA contiguous range of characters or tokens in the input string, tagged with an address component type (street, locality, postcode, etc.). Parsed addresses are represented as collections of spans, possibly nested in a tree.-less modelsneural 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.'. UnitunitA subdivision of a building — apartment, suite, floor — that refines a street address. Mailwoman's unit component; a designator plus identifier forms a subpremise. tested;SQLiteStreetNameLookupnow exported from the 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.-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.-sqlite barrel (a gap #1156 left).- Not yet in the runtime pipelinestaged pipelineMailwoman's runtime architecture: a sequence of pure-function stages (normalize → query-shape → locale-gate → kind-classifier → phrase-grouper → classifier → decoder) connected by typed handoffs. Each stage is published as its own npm package. / CLI. The function is the wired primitive; threading it into
createRuntimePipelinebehind a flag (so the CLI + drop-in servers exercise it) is the next step, along with the full CLI promote battery (gauntlet, metamorphic) — the golden guard here is the headline gate and it passes at 0.000. - FR index rebuild (BANBAN (Base Adresse Nationale). France's authoritative open national address register — the highest-quality training source for French addresses, with full component structure. sdk):
street-centroids-fr.dbpredates the contract fold; rebuilding it withfoldStreetSurface+ astreet_normindex closes the last few fragment misses (3 breaks) and makes the production lookup fast. - The rerank changes only the 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, only on atlas-confirmed evidence — the anti-PeliasPeliasAn open-source geocoder, Mailwoman's spiritual predecessor. discipline held end to end: one bit of evidence, no score blending, 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.' owns every uncertain call.