@mailwoman/neural-weights-en-us 7.5.0 → 7.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/model-card.json +119 -11
- package/package.json +1 -1
- package/postcode-us.bin +0 -0
- package/scripts/link-dev-weights.ts +71 -5
package/model-card.json
CHANGED
|
@@ -1,21 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neural-weights-en-us",
|
|
3
|
-
"version": "6.6.
|
|
4
|
-
"model_lineage": "v3.
|
|
5
|
-
"phase": "
|
|
3
|
+
"version": "6.6.1",
|
|
4
|
+
"model_lineage": "v3.11.0-deploc-feed step-8000 (\"feed-8k\") — init_from v385 (6.6.0) step-8000, same-vocab fine-tune, `--resume none`, 8k steps (2k probe → 8k resume), LR 1.0e-5 constant. ONE escalation over the probe-2 checkpoint (v3.10.1-gb-probe2): dependent_locality training mass split across FOUR locales (GB 6.1% + NZ 2.4% + ES 3.0% + FR-lieudit 1.8% of stream; combined ≈6.66%, matching probe-2's 6.6% total but at a MUCH lower max single-locale share — 20.2%→6.1% — the diversity fix for probe-2's skew costs) instead of GB alone. THREE resurrection levers, bundled (each alone is a known no-op per #456/#1100): (1) `reinit_label_rows: [B-dependent_locality, I-dependent_locality]` — mean-of-live re-init of the baked-dead classifier rows; (2) `classifier_learning_rate: 1.0e-3` — a dedicated hot Adam param group on `classifier.*` (Adam's update is scale-invariant, so only a real param group moves a baked-negative row); (3) `class_weights` B-/I-dependent_locality 0.3→1.0 (Task 4a's third suppressor: re-init + hot LR are useless under a downweight). Tokenizer v0.9.0-multisplice (73,143) UNCHANGED; every lexicon UNCHANGED; architecture identical. Weights-only vs 6.6.0.",
|
|
5
|
+
"phase": "SHIPPED (6.6.1, 2026-07-24) — bundle revision on UNCHANGED model bytes (v385, model.onnx md5 700f3cf4c08f31536f0bc053c281b19e, same files_md5 as 6.6.0): the en-gb overlay's pair-index-gb.bin is re-cut at δ=10 and @mailwoman/neural 7.7.0's auto probe chain activates GB dependent_locality on this shipped model (see neural-weights-en-gb/model-card.json 6.6.1 for the capability record). The 6.7.0 staged-candidate lineage is CLOSED: no checkpoint of v3.10–v3.13 passed the Gauntlet's metamorphic layer; five mechanisms falsified (starvation, encoder drift, save anomaly, comma-share, LR-hold/anneal); stop rule executed three times; the break is established in the first ≤1k steps of encoder+head co-training and is stable. Model-side redesign is unhurried research — the dep-loc capability no longer depends on it. Falsification record: docs/superpowers/plans/2026-07-23-deploc-redesign-dossier.md + .superpowers/sdd/task-8-report.md.",
|
|
6
6
|
"license": "AGPL-3.0-only OR LicenseRef-Commercial",
|
|
7
7
|
"locale": "en-us",
|
|
8
8
|
"training": {
|
|
9
|
-
"corpus_version": "v0.
|
|
9
|
+
"corpus_version": "v0.15.0-deploc (v0.14.0-gb base + synth-nz-v2 + synth-es-pedania + synth-fr-lieudit) — the FOUR-locale dependent_locality feed. synth-gb-v1 (800k rows, 32.8% B-dependent_locality) at source weight 10.0 (down from probe-2's 36.0 — the diversity fix), synth-nz-v2 at 4.0 (79.2% dep-loc density), synth-es-pedania-v1 at 5.0 (30.3% density), synth-fr-lieudit-v1 at 3.0 (100% density — every row IS a lieu-dit). overture-latam (CA/MX, 6.6.0) unchanged at weight 6.0.",
|
|
10
10
|
"tokenizer_version": "0.9.0-multisplice",
|
|
11
11
|
"steps": 8000,
|
|
12
12
|
"best_step": 8000,
|
|
13
13
|
"hardware": "NVIDIA A100-SXM4-40GB (Modal cloud)",
|
|
14
|
-
"recipe": "v3.
|
|
15
|
-
"tokenizer_splice": "tokenizer_splice.py build-tokenizer --locales fr --per-file-cap 2000000 over OA fr/countrywide.csv (seed 42, 350k-line corpus, unigram vocab 24000) -> splice 2406 non-ASCII FR pieces into v0.7.1-nsplice (English byte-identity asserted). UNCHANGED from v240 (md5 04995524).
|
|
14
|
+
"recipe": "v3.11.0-deploc-feed.yaml — init_from v385 (6.6.0) step-8000, `--resume none` REQUIRED (reinit_label_rows lives in the init_from branch; --resume auto silently no-ops it), LR 1.0e-5 constant, 8k (2k probe → 8k resume). The THREE bundled resurrection levers over 6.6.0: reinit_label_rows [B-/I-dependent_locality], classifier_learning_rate 1.0e-3 (dedicated `classifier.*` param group), class_weights B-/I-dependent_locality 0.3→1.0 — plus the FOUR-locale corpus feed above.",
|
|
15
|
+
"tokenizer_splice": "tokenizer_splice.py build-tokenizer --locales fr --per-file-cap 2000000 over OA fr/countrywide.csv (seed 42, 350k-line corpus, unigram vocab 24000) -> splice 2406 non-ASCII FR pieces into v0.7.1-nsplice (English byte-identity asserted). UNCHANGED from v240 (md5 04995524).",
|
|
16
16
|
"data_attribution": [
|
|
17
|
-
"
|
|
18
|
-
"
|
|
17
|
+
"HM Land Registry — Price Paid Data (OGL v3.0): the `synth-gb-v1` training shard (800,000 rows) NEW in 6.7.0, and the `pair-index-gb.bin` placetype-pair index (`neural-weights-en-gb`, this same task). Crown copyright, attribution required.",
|
|
18
|
+
"LINZ-derived OpenAddresses NZ (CC-BY 4.0): the `synth-nz-v2` training shard (800,000 rows) NEW in 6.7.0.",
|
|
19
|
+
"OpenAddresses ES tuples (CC-BY per OA source): the `synth-es-pedania-v1` training shard (800,000 rows, below-municipio pedanía place names) NEW in 6.7.0.",
|
|
20
|
+
"BAN — Base Adresse Nationale (DINUM / IGN, Licence Ouverte 2.0): the `synth-fr-lieudit-v1` training shard (`nom_ld` lieu-dit field) NEW in 6.7.0, additional to the existing `synth-fr-fragment` shard (144,865 rows, 6.4.0).",
|
|
21
|
+
"Overture Maps Foundation — Addresses theme (CDLA-Permissive-2.0): the `overture-latam` CA/MX training shard (456,230 rows, 6.6.0). Attribution-only, not share-alike.",
|
|
19
22
|
"OpenAddresses CZ — ČÚZK RÚIAN (CC-BY 4.0): tokenizer-splice training text + the oa-cz coord eval sets",
|
|
20
23
|
"OpenAddresses PL — GUGiK / PRG (public, BDOT-derived): tokenizer-splice training text + the oa-pl coord eval sets",
|
|
21
24
|
"OpenAddresses SK — MINV/ZBGIS (CC-0/CC-BY per OA source): oa-sk coord eval set (free-rider validation)",
|
|
@@ -109,7 +112,7 @@
|
|
|
109
112
|
"intersection_a",
|
|
110
113
|
"intersection_b"
|
|
111
114
|
],
|
|
112
|
-
"notes": "v3.
|
|
115
|
+
"notes": "v3.11.0-deploc-feed step-8000 (\"feed-8k\"), STAGED not promoted. Escalates the confirmed-but-skewed probe-2 mechanism (v3.10.1-gb-probe2: first-ever decode-layer dependent_locality emissions, GB 1/69, NZ 3/246) by feeding FOUR locales at once (GB+NZ+ES+FR-lieudit) instead of GB alone, holding total dep-loc stream density constant (~6.66%) while dropping the max single-locale share 20.2%→6.1% — the fix for probe-2's golden-us/FR-fragment/val skew costs. THE WIN, measured with the placetype-pair prior ON at its calibrated δ (a sibling arc, not this one): GB dependent_locality full-pipeline recall 67/69 (97.1%) — but the three-way ablation (below) shows this is almost entirely the PRIOR's contribution, not the checkpoint's own resurrected classifier row (raw decode-layer GB emission without the prior is 0/69 for feed-8k — see the ablation table). NZ, ES, and FR-lieudit have no equivalent prior to lean on and show the checkpoint's own resurrection is weak: NZ 0/246 (STILL zero, despite being the arc's original target locale), ES 7/65 (10.8%), FR-lieudit 1/80 (1.25%). All six pre-registered guards pass at feed-8k: golden us −0.5pp / fr +1.2pp (both within-or-favorable), FR-fragment bare-locality 0.988 (PASS, beats v385's own 0.983 — feed-2k FAILS this outright at 0.665, the reason feed-8k not feed-2k is the ratified ship checkpoint), val macro_f1 +1.29pp (favorable), 6 demo presets byte-identical, error-analysis no tag >2pp (worst: street −1.5pp). DIGIT GATE REVISION (operator-ratified 2026-07-23, Teffen Ellis): the pre-registered digit bar was originally read against the v3.10/v3.10.1 GB-probe lineage's OWN prior 8k checkpoint (bare-street-hn 0.902, a same-lineage probe-run number, not a real ship baseline) — that comparison is not apples-to-apples for THIS feed-8k checkpoint, which forked from v385 (6.6.0), not from a GB-probe ancestor. The bar is RESTATED against v385's own fresh-measured baseline (0.755, same session, same board): feed-8k scores 0.868, a +11.3pp gain over the correct baseline — PASS. The 0.902 probe-anchor number is retained here as historical context only, not as the active bar. GAUNTLET: FAILS (Task 8, 2026-07-23) — see phase field above; this is the one open ship blocker. CALIBRATION: the isotonic tables carry from the v5.3.0 lineage unchanged; opt-in, default output unaffected; re-fit is a tracked follow-up.",
|
|
113
116
|
"format": {
|
|
114
117
|
"model": "ONNX int8 dynamic (quantized from fp32, opset 17)",
|
|
115
118
|
"tokenizer": "SentencePiece unigram, byte_fallback=true, vocab_size=73143 (v0.9.0-multisplice; ships WITH the model, both runtimes load it from this bundle)",
|
|
@@ -131,8 +134,112 @@
|
|
|
131
134
|
"held_out_ece_calibrated": 0.0017,
|
|
132
135
|
"note": "RE-FIT on v5.3.0 (2026-07-04): calibration.json + calibration-per-locale.json are now fitted on THIS model's confidence distribution (35,600 spans over the 8k held-out set), not carried from v4.x. The from-scratch model was under-confident (meanConf 0.913 vs acc 0.980, gap -0.067); the fit corrects held-out OA ECE 0.0698→0.0017 (overall 0.0677→0.0028, per-locale NL 0.166→0.000 / DE 0.114→0.003). Reproduce: collect-span-confidences.ts → fit-isotonic-calibration.py --model-version 5.3.0. Apply via @mailwoman/core/decoder's createCalibrator; default parse output is byte-stable when omitted."
|
|
133
136
|
},
|
|
134
|
-
"base_relpath": "models/quantized/model-
|
|
137
|
+
"base_relpath": "models/quantized/model-v3110-deploc-feed-step-008000-int8.onnx under $MAILWOMAN_DATA_ROOT; training output on Modal volume mailwoman-training:/output-v3110-deploc-feed-s42/checkpoints/step-008000",
|
|
135
138
|
"eval": {
|
|
139
|
+
"gate_2026_07_23_v3110_deploc_feed_8k": {
|
|
140
|
+
"$comment": "Task 8 (placetype-pair-prior arc, ship-prep) full battery + Gauntlet, feed-8k vs v385 (6.6.0), all measured fresh this session (ONNX CPU int8). Full transcript: .superpowers/sdd/task-8-prep-report.md; the calibration + checkpoint-choice battery this gate builds on: .superpowers/sdd/task-7-report.md.",
|
|
141
|
+
"verdict": "SHIP-BLOCKED — every pre-registered guard PASSES; the Gauntlet (a standing ship-gate requirement, not one of the six pre-registered guards) FAILS on its metamorphic layer. Not promoted pending operator triage.",
|
|
142
|
+
"golden_us_fr": {
|
|
143
|
+
"us_micro_f1": {
|
|
144
|
+
"v385_fresh": 0.867,
|
|
145
|
+
"feed_8k": 0.862,
|
|
146
|
+
"delta_pp": -0.5,
|
|
147
|
+
"bar": "±0.7pp of v385",
|
|
148
|
+
"result": "PASS"
|
|
149
|
+
},
|
|
150
|
+
"fr_micro_f1": {
|
|
151
|
+
"v385_fresh": 0.899,
|
|
152
|
+
"feed_8k": 0.911,
|
|
153
|
+
"delta_pp": 1.2,
|
|
154
|
+
"bar": "±0.7pp of v385",
|
|
155
|
+
"result": "outside magnitude, favorable direction"
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"fr_fragment_bare_locality": {
|
|
159
|
+
"v385_fresh": [0.983, [0.964, 0.991]],
|
|
160
|
+
"feed_8k": [0.988, [0.971, 0.995]],
|
|
161
|
+
"feed_2k_for_contrast": [0.665, [0.617, 0.709]],
|
|
162
|
+
"bar": ">= 0.90",
|
|
163
|
+
"result": "PASS (feed-8k); feed-2k FAILS outright — the deciding reason feed-8k is the ratified ship checkpoint over feed-2k"
|
|
164
|
+
},
|
|
165
|
+
"digit_bare_street_hn_gate_revision": {
|
|
166
|
+
"$comment": "Operator-ratified 2026-07-23 (Teffen Ellis). The pre-registered bar (0.902) was a same-lineage GB-probe checkpoint's own number, not a real ship baseline for a v385-forked checkpoint. Restated against v385's own fresh baseline, measured same session same board.",
|
|
167
|
+
"v385_fresh_baseline": 0.755,
|
|
168
|
+
"feed_8k": [0.868, [0.831, 0.897]],
|
|
169
|
+
"delta_pp": 11.3,
|
|
170
|
+
"old_bar_0_902_probe_anchor": "historical context only, not the active bar — CI [0.831,0.897] excludes it",
|
|
171
|
+
"result": "PASS (bar restated against 0.755; +11.3pp)"
|
|
172
|
+
},
|
|
173
|
+
"val_macro_f1": {
|
|
174
|
+
"v385": 0.7047,
|
|
175
|
+
"feed_8k": 0.7176,
|
|
176
|
+
"delta_pp": 1.29,
|
|
177
|
+
"bar": "±1.0pp of v385",
|
|
178
|
+
"result": "outside magnitude, favorable direction"
|
|
179
|
+
},
|
|
180
|
+
"dependent_locality_boards": {
|
|
181
|
+
"gb_prior_on_at_delta_5": {
|
|
182
|
+
"n": 69,
|
|
183
|
+
"emit": 69,
|
|
184
|
+
"tag_correct": 67,
|
|
185
|
+
"tag_correct_pct": 97.1
|
|
186
|
+
},
|
|
187
|
+
"nz_checkpoint_only": {
|
|
188
|
+
"n": 246,
|
|
189
|
+
"emit": 0,
|
|
190
|
+
"tag_correct": 0
|
|
191
|
+
},
|
|
192
|
+
"es_checkpoint_only": {
|
|
193
|
+
"n": 65,
|
|
194
|
+
"emit": 9,
|
|
195
|
+
"tag_correct": 7,
|
|
196
|
+
"tag_correct_pct": 10.8
|
|
197
|
+
},
|
|
198
|
+
"fr_lieudit_checkpoint_only": {
|
|
199
|
+
"n": 80,
|
|
200
|
+
"emit": 2,
|
|
201
|
+
"tag_correct": 1,
|
|
202
|
+
"tag_correct_pct": 1.25
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
"dependent_locality_ablation": {
|
|
206
|
+
"$comment": "The prior — not the checkpoint's own resurrected classifier row — carries nearly all of GB's measured recall. NZ/ES/FR-lieudit have no equivalent prior and show the checkpoint's own resurrection is weak-to-absent.",
|
|
207
|
+
"v385_plus_prior_at_delta_6_rung3_control": {
|
|
208
|
+
"n": 69,
|
|
209
|
+
"emit_tag_correct": "3/69",
|
|
210
|
+
"note": "weights matter"
|
|
211
|
+
},
|
|
212
|
+
"feed_checkpoint_prior_off": {
|
|
213
|
+
"n": 69,
|
|
214
|
+
"emit_tag_correct": "0/69",
|
|
215
|
+
"note": "prior matters (either checkpoint)"
|
|
216
|
+
},
|
|
217
|
+
"feed_checkpoint_prior_on_at_delta_star": {
|
|
218
|
+
"n": 69,
|
|
219
|
+
"emit": "69/69",
|
|
220
|
+
"tag_correct": "67/69 (97.1%)",
|
|
221
|
+
"note": "together: +67pp"
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"venue_confound_fp": {
|
|
225
|
+
"delta_star": 5.0,
|
|
226
|
+
"fp": "48/6500",
|
|
227
|
+
"fp_pct": 0.738,
|
|
228
|
+
"floor": "<= 122/6500 (the retired δ=6.0 working number)"
|
|
229
|
+
},
|
|
230
|
+
"demo_presets": "6/6 byte-identical (both weights worlds — en-us control path AND en-gb weights with the prior wired)",
|
|
231
|
+
"error_analysis_2pp_rule": {
|
|
232
|
+
"worst_mover": "street -1.5pp",
|
|
233
|
+
"no_tag_regresses_gt_2pp": true,
|
|
234
|
+
"result": "PASS"
|
|
235
|
+
},
|
|
236
|
+
"gauntlet": {
|
|
237
|
+
"regression": "PASS (33/33 gated; 1 tracked known_fail now passes and should be promoted to status=pass — fr-chat-qui-peche-street-swallows-locality)",
|
|
238
|
+
"metamorphic": "FAIL — NEW gate-failing violation: INV[comma-drop] '1600 Pennsylvania Ave NW, Washington DC 20500' -> comma-dropped form loses the rooftop resolution entirely (38.8977,-77.0365 -> 0,0). v385 HOLDS this exact case (confirmed same session). feed-2k independently FAILS the same layer with DIFFERENT violations on '350 Fifth Avenue, New York, NY' (283.5km off) — reads as a lineage-wide v3.11.0-deploc-feed robustness regression on NY/DC-class admin resolution, not a single-checkpoint fluke. Neither Task 6 nor Task 7 ran the Gauntlet; this is a NEW finding from Task 8.",
|
|
239
|
+
"held_out": "PASS — z=0.00 (candidate not significantly worse), n=300 fresh FR/BAN draw",
|
|
240
|
+
"combined_verdict": "FAIL — do not ship (until the metamorphic regression above is triaged)"
|
|
241
|
+
}
|
|
242
|
+
},
|
|
136
243
|
"gate_2026_07_18_v710_camx": "v6.0.0-shipped-baseline gate + golden 2pp gate (v385 vs shipped v381, channels-on, same run): PASS. Golden: exact-match 24.2% (1105 vs 1104, +1 row), country 89.8 vs 91.4 (−1.6, small-N 220/245, sub-threshold — the only mover >0.5pp down), region 78.1 vs 78.6 (−0.5), locality/postcode/street/house_number flat. NO tag >2pp down. Native-order held-out board: MX locality 74.0→82.7 (+8.7), CA neutral. Gauntlet (eval gauntlet --candidate): regression 33/33 PASS; metamorphic INV 62/63, DIR 3/3, BAND 16/21 — identical known-xfail profile to shipped v381 (the 1 INV[comma-drop] xfail is the pre-existing FR #1101 case; US comma-drop held). No new regression. Grade: docs/articles/evals/2026-07-18-v710-camx-latam-grade.md.",
|
|
137
244
|
"gate_2026_07_17_v650_punct_digit": "v6.0.0-shipped-baseline gate: PASS, 0 tags >2pp below shipped v310, +2.3pp us.country_homograph_f1 (only >2pp mover). Gauntlet: PASS — clear to ship (regression 33/33; metamorphic INV[comma-drop] 9/10 held — the US '1600 Pennsylvania Ave NW Washington DC' comma-free rooftop RESTORED, the FR 'Rue du Chevaleret' remains the tracked #1101 xfail; held-out FR/BAN n=300 not significantly worse). Digit ownership (NO board 3): bare-street-hn 0.693->0.733 (+4pp), bare-pc guard held 1.000. Grade: package-shaped --weights-cache (#718), int8 candidate vs int8 shipped, on 2026-07-17.",
|
|
138
245
|
"gate_2026_07_16_v640_fr_fragment": {
|
|
@@ -411,11 +518,12 @@
|
|
|
411
518
|
}
|
|
412
519
|
},
|
|
413
520
|
"files_md5": {
|
|
414
|
-
"$comment": "
|
|
521
|
+
"$comment": "The SHIPPED artifact's md5 — this is the identity `neural-weights-en-us/scripts/link-dev-weights.ts`'s #397 guard and `mailwoman eval gauntlet`'s self-check (#1024 drift guard) verify the dev symlink / materialized tarball against, repo-wide. Deliberately LEFT AT v385 (6.6.0): 6.7.0 is a STAGED, NOT-PROMOTED candidate (see phase) — flipping this to the candidate's md5 before the operator actually promotes would silently repoint every other branch's `yarn test`/local dev at unshipped bytes. The candidate's own identity is `staged_candidate_files_md5` below; only THAT flips to feed-8k. Bump this block (and the two DEFAULT_* paths in link-dev-weights.ts) together, in lockstep, at actual promotion time.",
|
|
415
522
|
"model.onnx": "700f3cf4c08f31536f0bc053c281b19e",
|
|
416
523
|
"tokenizer.model": "5c01cdcd4ae25849c5cb26b69fd3dde9"
|
|
417
524
|
},
|
|
418
525
|
"capabilities": {
|
|
526
|
+
"$carried_forward_comment": "NOT regenerated for 6.7.0 (Task 8 ship-prep did not re-run `mailwoman eval capability-manifest`) — these numbers are the 6.6.0/v385 measurement, carried forward as the best available reference. Flagged explicitly rather than silently reused; a fresh manifest is a tracked follow-up if 6.7.0 promotes.",
|
|
419
527
|
"server": {
|
|
420
528
|
"us": {
|
|
421
529
|
"street_prefix": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailwoman/neural-weights-en-us",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.7.0",
|
|
4
4
|
"description": "Mailwoman neural-classifier weights for locale 'en-us'. Data-only package — loaded by @mailwoman/neural at runtime.",
|
|
5
5
|
"license": "AGPL-3.0-only OR LicenseRef-Commercial",
|
|
6
6
|
"repository": {
|
package/postcode-us.bin
CHANGED
|
Binary file
|
|
@@ -39,8 +39,9 @@
|
|
|
39
39
|
* ---------------------------------------------------------------------------
|
|
40
40
|
*/
|
|
41
41
|
|
|
42
|
+
import { spawnSync } from "node:child_process"
|
|
42
43
|
import { createHash } from "node:crypto"
|
|
43
|
-
import { existsSync, readFileSync, symlinkSync, unlinkSync } from "node:fs"
|
|
44
|
+
import { existsSync, readFileSync, renameSync, symlinkSync, unlinkSync } from "node:fs"
|
|
44
45
|
import { resolve } from "node:path"
|
|
45
46
|
|
|
46
47
|
import { $public } from "@mailwoman/core/env"
|
|
@@ -90,13 +91,21 @@ if (!existsSync(SRC_TOKENIZER)) {
|
|
|
90
91
|
process.exit(1)
|
|
91
92
|
}
|
|
92
93
|
|
|
93
|
-
/**
|
|
94
|
+
/**
|
|
95
|
+
* Replicate `ln -sf SRC DEST` ATOMICALLY: symlink under a temp name, then rename over the destination. A plain
|
|
96
|
+
* unlink-then-symlink leaves a no-file window that concurrent vitest workers (weights.test.ts + every other suite
|
|
97
|
+
* resolving weights on the lab runners) can hit mid-suite — bit CI on 2026-07-24 (v1-parse-gate: "missing model files"
|
|
98
|
+
* while the materialize step had verifiably succeeded). rename(2) replaces the destination atomically.
|
|
99
|
+
*/
|
|
94
100
|
function linkForce(src: string, dest: string): void {
|
|
95
|
-
|
|
96
|
-
|
|
101
|
+
const tmp = `${dest}.tmp-link`
|
|
102
|
+
|
|
103
|
+
if (existsSync(tmp)) {
|
|
104
|
+
unlinkSync(tmp)
|
|
97
105
|
}
|
|
98
106
|
|
|
99
|
-
symlinkSync(src,
|
|
107
|
+
symlinkSync(src, tmp)
|
|
108
|
+
renameSync(tmp, dest)
|
|
100
109
|
}
|
|
101
110
|
|
|
102
111
|
const MODEL_DEST = resolve(PKG_DIR, "model.onnx")
|
|
@@ -137,3 +146,60 @@ if (!TOKENIZER_OVERRIDDEN) {
|
|
|
137
146
|
} else {
|
|
138
147
|
console.error(" (tokenizer override active — skipping #397 default-hash check)")
|
|
139
148
|
}
|
|
149
|
+
|
|
150
|
+
// --- soft-feed siblings (the fresh-worktree anchor-OFF gap; mirrors en-gb's script) ------
|
|
151
|
+
//
|
|
152
|
+
// Historically this script linked only model+tokenizer, leaving `anchor-lexicon-v1.json` /
|
|
153
|
+
// `country-surface-lexicon-v1.json` / `postcode-us.bin` absent in a fresh worktree — the CLI
|
|
154
|
+
// then parses anchor-OFF/gazetteer-OFF/country-OFF with only stderr warnings (train/inference
|
|
155
|
+
// mismatch, visibly degraded parses: the 2026-07-23 CI unit-leg failure was "Paris, TX"
|
|
156
|
+
// resolving to Paris FRANCE on the self-hosted runners' fresh checkouts for exactly this
|
|
157
|
+
// reason). The two lexicons are checked-in repo files (`data/gazetteer/…` — the same source
|
|
158
|
+
// `release.config.json`'s `softFeed.*` names and `scripts/copy-weights.ts` copies at publish
|
|
159
|
+
// time); `postcode-us.bin` is derived from the WOF US postcode shard, built in place via the
|
|
160
|
+
// compiled `gazetteer postcode-binary` CLI (skip-if-exists — it rebuilds in seconds, and the
|
|
161
|
+
// shard is versionless on disk, unlike en-gb's md5-guarded pair index).
|
|
162
|
+
const SRC_GAZETTEER_LEXICON = repoRootPath("data", "gazetteer", "anchor-lexicon-v1.json")
|
|
163
|
+
const SRC_COUNTRY_LEXICON = repoRootPath("data", "gazetteer", "country-surface-lexicon-v1.json")
|
|
164
|
+
|
|
165
|
+
if (existsSync(SRC_GAZETTEER_LEXICON)) {
|
|
166
|
+
linkForce(SRC_GAZETTEER_LEXICON, resolve(PKG_DIR, "anchor-lexicon-v1.json"))
|
|
167
|
+
console.log(`linked ${PKG_DIR}/anchor-lexicon-v1.json`)
|
|
168
|
+
} else {
|
|
169
|
+
console.error(`WARNING: missing ${SRC_GAZETTEER_LEXICON} — gazetteer channel will resolve OFF in this worktree.`)
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
if (existsSync(SRC_COUNTRY_LEXICON)) {
|
|
173
|
+
linkForce(SRC_COUNTRY_LEXICON, resolve(PKG_DIR, "country-surface-lexicon-v1.json"))
|
|
174
|
+
console.log(`linked ${PKG_DIR}/country-surface-lexicon-v1.json`)
|
|
175
|
+
} else {
|
|
176
|
+
console.error(`WARNING: missing ${SRC_COUNTRY_LEXICON} — country channel will resolve OFF in this worktree.`)
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const US_WOF_DB = dataRootPath("wof", "postalcode-us.db")
|
|
180
|
+
const CLI = repoRootPath("mailwoman", "out", "cli.js")
|
|
181
|
+
const POSTCODE_BIN_DEST = resolve(PKG_DIR, "postcode-us.bin")
|
|
182
|
+
|
|
183
|
+
if (existsSync(POSTCODE_BIN_DEST)) {
|
|
184
|
+
console.log(`skipped postcode-us.bin build — ${POSTCODE_BIN_DEST} already present`)
|
|
185
|
+
} else if (!existsSync(CLI)) {
|
|
186
|
+
console.error(
|
|
187
|
+
`WARNING: ${CLI} not built — run \`yarn compile\` first, then re-run this script to build postcode-us.bin.`
|
|
188
|
+
)
|
|
189
|
+
} else if (!existsSync(US_WOF_DB)) {
|
|
190
|
+
console.error(
|
|
191
|
+
`WARNING: missing ${US_WOF_DB} — postcode-us.bin not built; the anchor channel will resolve OFF for US.`
|
|
192
|
+
)
|
|
193
|
+
} else {
|
|
194
|
+
const result = spawnSync(
|
|
195
|
+
process.execPath,
|
|
196
|
+
[CLI, "gazetteer", "postcode-binary", "--out", PKG_DIR, "--locale", `US:${US_WOF_DB}`],
|
|
197
|
+
{ stdio: "inherit" }
|
|
198
|
+
)
|
|
199
|
+
|
|
200
|
+
if (result.status !== 0 || !existsSync(POSTCODE_BIN_DEST)) {
|
|
201
|
+
console.error(`ERROR: failed to build ${POSTCODE_BIN_DEST} (exit ${result.status})`)
|
|
202
|
+
process.exit(1)
|
|
203
|
+
}
|
|
204
|
+
console.log(`built ${POSTCODE_BIN_DEST}`)
|
|
205
|
+
}
|