@mailwoman/registry 9.4.0 → 10.1.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.
Files changed (263) hide show
  1. package/README.md +10 -10
  2. package/lib/address-key.ts +14 -10
  3. package/lib/geocode-handler.ts +6 -4
  4. package/lib/geojson.ts +13 -17
  5. package/lib/ingest.ts +57 -83
  6. package/lib/learned-scorer.ts +38 -44
  7. package/lib/map-html.ts +24 -70
  8. package/lib/models/crosssource-gbt-en-us.ts +9 -7
  9. package/lib/models/dedup-gbt-en-us.ts +9 -8
  10. package/lib/models/org-crosssource-gbt-en-us.ts +10 -8
  11. package/lib/reconcile.ts +45 -55
  12. package/lib/resolve.ts +180 -124
  13. package/lib/types.ts +18 -12
  14. package/out/address-key.d.ts +14 -10
  15. package/out/address-key.d.ts.map +1 -1
  16. package/out/address-key.js +14 -10
  17. package/out/address-key.js.map +1 -1
  18. package/out/geocode-handler.d.ts +6 -4
  19. package/out/geocode-handler.d.ts.map +1 -1
  20. package/out/geocode-handler.js +6 -4
  21. package/out/geocode-handler.js.map +1 -1
  22. package/out/geojson.d.ts +9 -5
  23. package/out/geojson.d.ts.map +1 -1
  24. package/out/geojson.js +13 -15
  25. package/out/geojson.js.map +1 -1
  26. package/out/ingest.d.ts +46 -75
  27. package/out/ingest.d.ts.map +1 -1
  28. package/out/ingest.js +27 -54
  29. package/out/ingest.js.map +1 -1
  30. package/out/learned-scorer.d.ts +29 -26
  31. package/out/learned-scorer.d.ts.map +1 -1
  32. package/out/learned-scorer.js +31 -39
  33. package/out/learned-scorer.js.map +1 -1
  34. package/out/map-html.d.ts +13 -32
  35. package/out/map-html.d.ts.map +1 -1
  36. package/out/map-html.js +9 -62
  37. package/out/map-html.js.map +1 -1
  38. package/out/models/crosssource-gbt-en-us.d.ts +9 -7
  39. package/out/models/crosssource-gbt-en-us.d.ts.map +1 -1
  40. package/out/models/crosssource-gbt-en-us.js +9 -7
  41. package/out/models/crosssource-gbt-en-us.js.map +1 -1
  42. package/out/models/dedup-gbt-en-us.d.ts +9 -8
  43. package/out/models/dedup-gbt-en-us.d.ts.map +1 -1
  44. package/out/models/dedup-gbt-en-us.js +9 -8
  45. package/out/models/dedup-gbt-en-us.js.map +1 -1
  46. package/out/models/org-crosssource-gbt-en-us.d.ts +10 -8
  47. package/out/models/org-crosssource-gbt-en-us.d.ts.map +1 -1
  48. package/out/models/org-crosssource-gbt-en-us.js +10 -8
  49. package/out/models/org-crosssource-gbt-en-us.js.map +1 -1
  50. package/out/reconcile.d.ts +35 -50
  51. package/out/reconcile.d.ts.map +1 -1
  52. package/out/reconcile.js +19 -43
  53. package/out/reconcile.js.map +1 -1
  54. package/out/resolve.d.ts +150 -90
  55. package/out/resolve.d.ts.map +1 -1
  56. package/out/resolve.js +62 -63
  57. package/out/resolve.js.map +1 -1
  58. package/out/tools/coverage-reconciliation.d.ts +23 -23
  59. package/out/tools/coverage-reconciliation.d.ts.map +1 -1
  60. package/out/tools/coverage-reconciliation.js +15 -26
  61. package/out/tools/coverage-reconciliation.js.map +1 -1
  62. package/out/tools/cross/dataset-correlation.d.ts +58 -0
  63. package/out/tools/cross/dataset-correlation.d.ts.map +1 -0
  64. package/out/tools/{cross-dataset-correlation.js → cross/dataset-correlation.js} +10 -62
  65. package/out/tools/cross/dataset-correlation.js.map +1 -0
  66. package/out/tools/cross/source-threshold-sweep.d.ts +60 -0
  67. package/out/tools/cross/source-threshold-sweep.d.ts.map +1 -0
  68. package/out/tools/{cross-source-threshold-sweep.js → cross/source-threshold-sweep.js} +15 -41
  69. package/out/tools/cross/source-threshold-sweep.js.map +1 -0
  70. package/out/tools/dedup-ceiling.d.ts +23 -26
  71. package/out/tools/dedup-ceiling.d.ts.map +1 -1
  72. package/out/tools/dedup-ceiling.js +22 -41
  73. package/out/tools/dedup-ceiling.js.map +1 -1
  74. package/out/tools/eval-geocoder.d.ts +22 -15
  75. package/out/tools/eval-geocoder.d.ts.map +1 -1
  76. package/out/tools/eval-geocoder.js +5 -6
  77. package/out/tools/eval-geocoder.js.map +1 -1
  78. package/out/tools/geocoder/namesake-probe.d.ts +33 -0
  79. package/out/tools/geocoder/namesake-probe.d.ts.map +1 -0
  80. package/out/tools/{geocoder-namesake-probe.js → geocoder/namesake-probe.js} +7 -8
  81. package/out/tools/geocoder/namesake-probe.js.map +1 -0
  82. package/out/tools/geocoder/vs-provided-coords.d.ts +53 -0
  83. package/out/tools/geocoder/vs-provided-coords.d.ts.map +1 -0
  84. package/out/tools/{geocoder-vs-provided-coords.js → geocoder/vs-provided-coords.js} +31 -28
  85. package/out/tools/geocoder/vs-provided-coords.js.map +1 -0
  86. package/out/tools/gold-set-sample.d.ts +27 -18
  87. package/out/tools/gold-set-sample.d.ts.map +1 -1
  88. package/out/tools/gold-set-sample.js +18 -22
  89. package/out/tools/gold-set-sample.js.map +1 -1
  90. package/out/tools/learned/scorer/clustering-eval.d.ts +77 -0
  91. package/out/tools/learned/scorer/clustering-eval.d.ts.map +1 -0
  92. package/out/tools/{learned-scorer-clustering-eval.js → learned/scorer/clustering-eval.js} +29 -39
  93. package/out/tools/learned/scorer/clustering-eval.js.map +1 -0
  94. package/out/tools/learned/scorer/crossstate-eval.d.ts +65 -0
  95. package/out/tools/learned/scorer/crossstate-eval.d.ts.map +1 -0
  96. package/out/tools/{learned-scorer-crossstate-eval.js → learned/scorer/crossstate-eval.js} +20 -26
  97. package/out/tools/learned/scorer/crossstate-eval.js.map +1 -0
  98. package/out/tools/learned/scorer/eval.d.ts +60 -0
  99. package/out/tools/learned/scorer/eval.d.ts.map +1 -0
  100. package/out/tools/{learned-scorer-eval.js → learned/scorer/eval.js} +12 -72
  101. package/out/tools/learned/scorer/eval.js.map +1 -0
  102. package/out/tools/matcher-scale.d.ts +12 -17
  103. package/out/tools/matcher-scale.d.ts.map +1 -1
  104. package/out/tools/matcher-scale.js +11 -29
  105. package/out/tools/matcher-scale.js.map +1 -1
  106. package/out/tools/nppes/dedup-benchmark.d.ts +81 -0
  107. package/out/tools/nppes/dedup-benchmark.d.ts.map +1 -0
  108. package/out/tools/{nppes-dedup-benchmark.js → nppes/dedup-benchmark.js} +21 -67
  109. package/out/tools/nppes/dedup-benchmark.js.map +1 -0
  110. package/out/tools/nppes/org-name.d.ts +5 -4
  111. package/out/tools/nppes/org-name.d.ts.map +1 -1
  112. package/out/tools/nppes/org-name.js +2 -2
  113. package/out/tools/nppes/org-name.js.map +1 -1
  114. package/out/tools/nppes/overmerge-packet.d.ts +15 -11
  115. package/out/tools/nppes/overmerge-packet.d.ts.map +1 -1
  116. package/out/tools/nppes/overmerge-packet.js +7 -8
  117. package/out/tools/nppes/overmerge-packet.js.map +1 -1
  118. package/out/tools/nppes/report.d.ts +17 -13
  119. package/out/tools/nppes/report.d.ts.map +1 -1
  120. package/out/tools/nppes/report.js +6 -14
  121. package/out/tools/nppes/report.js.map +1 -1
  122. package/out/tools/nppes/sample.d.ts +28 -17
  123. package/out/tools/nppes/sample.d.ts.map +1 -1
  124. package/out/tools/nppes/sample.js +23 -26
  125. package/out/tools/nppes/sample.js.map +1 -1
  126. package/out/tools/nppes/scoring.d.ts +7 -6
  127. package/out/tools/nppes/scoring.d.ts.map +1 -1
  128. package/out/tools/nppes/scoring.js +6 -5
  129. package/out/tools/nppes/scoring.js.map +1 -1
  130. package/out/tools/nppes/settings.d.ts +10 -7
  131. package/out/tools/nppes/settings.d.ts.map +1 -1
  132. package/out/tools/nppes/settings.js +16 -16
  133. package/out/tools/nppes/settings.js.map +1 -1
  134. package/out/tools/nppes/truth-grains.d.ts +36 -23
  135. package/out/tools/nppes/truth-grains.d.ts.map +1 -1
  136. package/out/tools/nppes/truth-grains.js +36 -20
  137. package/out/tools/nppes/truth-grains.js.map +1 -1
  138. package/out/tools/shared.d.ts +63 -59
  139. package/out/tools/shared.d.ts.map +1 -1
  140. package/out/tools/shared.js +49 -66
  141. package/out/tools/shared.js.map +1 -1
  142. package/out/tools/train/cross-gbt.d.ts +88 -0
  143. package/out/tools/train/cross-gbt.d.ts.map +1 -0
  144. package/out/tools/{train-cross-gbt.js → train/cross-gbt.js} +15 -26
  145. package/out/tools/train/cross-gbt.js.map +1 -0
  146. package/out/tools/train/gbt.d.ts +85 -0
  147. package/out/tools/train/gbt.d.ts.map +1 -0
  148. package/out/tools/{train-gbt.js → train/gbt.js} +28 -32
  149. package/out/tools/train/gbt.js.map +1 -0
  150. package/out/tools/train/org-cross-gbt.d.ts +84 -0
  151. package/out/tools/train/org-cross-gbt.d.ts.map +1 -0
  152. package/out/tools/{train-org-cross-gbt.js → train/org-cross-gbt.js} +19 -23
  153. package/out/tools/train/org-cross-gbt.js.map +1 -0
  154. package/out/tools/txhhsc-to-oarow.d.ts +14 -9
  155. package/out/tools/txhhsc-to-oarow.d.ts.map +1 -1
  156. package/out/tools/txhhsc-to-oarow.js +16 -15
  157. package/out/tools/txhhsc-to-oarow.js.map +1 -1
  158. package/out/tools/viz/browser.d.ts +6 -5
  159. package/out/tools/viz/browser.d.ts.map +1 -1
  160. package/out/tools/viz/browser.js +6 -5
  161. package/out/tools/viz/browser.js.map +1 -1
  162. package/out/tools/viz/cross-dataset-map.d.ts +7 -4
  163. package/out/tools/viz/cross-dataset-map.d.ts.map +1 -1
  164. package/out/tools/viz/cross-dataset-map.js +9 -6
  165. package/out/tools/viz/cross-dataset-map.js.map +1 -1
  166. package/out/tools/viz/geocode-first-surface.d.ts +10 -5
  167. package/out/tools/viz/geocode-first-surface.d.ts.map +1 -1
  168. package/out/tools/viz/geocode-first-surface.js +16 -11
  169. package/out/tools/viz/geocode-first-surface.js.map +1 -1
  170. package/out/tools/viz/{render-map.d.ts → render/map.d.ts} +6 -6
  171. package/out/tools/viz/render/map.d.ts.map +1 -0
  172. package/out/tools/viz/{render-map.js → render/map.js} +7 -6
  173. package/out/tools/viz/render/map.js.map +1 -0
  174. package/out/tools/viz/render.d.ts +12 -8
  175. package/out/tools/viz/render.d.ts.map +1 -1
  176. package/out/tools/viz/render.js +8 -7
  177. package/out/tools/viz/render.js.map +1 -1
  178. package/out/tools/viz/source-provenance-map.d.ts +19 -7
  179. package/out/tools/viz/source-provenance-map.d.ts.map +1 -1
  180. package/out/tools/viz/source-provenance-map.js +11 -8
  181. package/out/tools/viz/source-provenance-map.js.map +1 -1
  182. package/out/tools/viz/yardstick-figure.d.ts +2 -21
  183. package/out/tools/viz/yardstick-figure.d.ts.map +1 -1
  184. package/out/tools/viz/yardstick-figure.js +3 -39
  185. package/out/tools/viz/yardstick-figure.js.map +1 -1
  186. package/out/types.d.ts +17 -11
  187. package/out/types.d.ts.map +1 -1
  188. package/out/types.js +2 -2
  189. package/out/types.js.map +1 -1
  190. package/package.json +41 -184
  191. package/{lib/tools → tools}/coverage-reconciliation.ts +27 -30
  192. package/{lib/tools/cross-dataset-correlation.ts → tools/cross/dataset-correlation.ts} +31 -72
  193. package/{lib/tools/cross-source-threshold-sweep.ts → tools/cross/source-threshold-sweep.ts} +29 -46
  194. package/{lib/tools → tools}/dedup-ceiling.ts +34 -45
  195. package/tools/eval-geocoder.ts +74 -0
  196. package/{lib/tools/geocoder-namesake-probe.ts → tools/geocoder/namesake-probe.ts} +9 -8
  197. package/{lib/tools/geocoder-vs-provided-coords.ts → tools/geocoder/vs-provided-coords.ts} +39 -30
  198. package/{lib/tools → tools}/gold-set-sample.ts +35 -29
  199. package/{lib/tools/learned-scorer-clustering-eval.ts → tools/learned/scorer/clustering-eval.ts} +49 -45
  200. package/{lib/tools/learned-scorer-crossstate-eval.ts → tools/learned/scorer/crossstate-eval.ts} +34 -30
  201. package/{lib/tools/learned-scorer-eval.ts → tools/learned/scorer/eval.ts} +35 -78
  202. package/{lib/tools → tools}/matcher-scale.ts +21 -33
  203. package/{lib/tools/nppes-dedup-benchmark.ts → tools/nppes/dedup-benchmark.ts} +37 -82
  204. package/{lib/tools → tools}/nppes/org-name.ts +5 -4
  205. package/{lib/tools → tools}/nppes/overmerge-packet.ts +17 -13
  206. package/{lib/tools → tools}/nppes/report.ts +32 -25
  207. package/{lib/tools → tools}/nppes/sample.ts +41 -36
  208. package/{lib/tools → tools}/nppes/scoring.ts +7 -6
  209. package/{lib/tools → tools}/nppes/settings.ts +16 -16
  210. package/{lib/tools → tools}/nppes/truth-grains.ts +46 -26
  211. package/{lib/tools → tools}/shared.ts +73 -83
  212. package/{lib/tools/train-cross-gbt.ts → tools/train/cross-gbt.ts} +38 -34
  213. package/{lib/tools/train-gbt.ts → tools/train/gbt.ts} +55 -41
  214. package/{lib/tools/train-org-cross-gbt.ts → tools/train/org-cross-gbt.ts} +39 -30
  215. package/{lib/tools → tools}/txhhsc-to-oarow.ts +24 -18
  216. package/{lib/tools → tools}/viz/browser.ts +6 -5
  217. package/{lib/tools → tools}/viz/cross-dataset-map.ts +15 -9
  218. package/{lib/tools → tools}/viz/geocode-first-surface.ts +28 -17
  219. package/{lib/tools/viz/render-map.ts → tools/viz/render/map.ts} +7 -6
  220. package/{lib/tools → tools}/viz/render.ts +16 -11
  221. package/{lib/tools → tools}/viz/source-provenance-map.ts +30 -15
  222. package/{lib/tools → tools}/viz/yardstick-figure.ts +6 -43
  223. package/lib/tools/eval-geocoder.ts +0 -67
  224. package/lib/tools/index.ts +0 -31
  225. package/out/tools/cross-dataset-correlation.d.ts +0 -65
  226. package/out/tools/cross-dataset-correlation.d.ts.map +0 -1
  227. package/out/tools/cross-dataset-correlation.js.map +0 -1
  228. package/out/tools/cross-source-threshold-sweep.d.ts +0 -66
  229. package/out/tools/cross-source-threshold-sweep.d.ts.map +0 -1
  230. package/out/tools/cross-source-threshold-sweep.js.map +0 -1
  231. package/out/tools/geocoder-namesake-probe.d.ts +0 -32
  232. package/out/tools/geocoder-namesake-probe.d.ts.map +0 -1
  233. package/out/tools/geocoder-namesake-probe.js.map +0 -1
  234. package/out/tools/geocoder-vs-provided-coords.d.ts +0 -50
  235. package/out/tools/geocoder-vs-provided-coords.d.ts.map +0 -1
  236. package/out/tools/geocoder-vs-provided-coords.js.map +0 -1
  237. package/out/tools/index.d.ts +0 -31
  238. package/out/tools/index.d.ts.map +0 -1
  239. package/out/tools/index.js +0 -31
  240. package/out/tools/index.js.map +0 -1
  241. package/out/tools/learned-scorer-clustering-eval.d.ts +0 -74
  242. package/out/tools/learned-scorer-clustering-eval.d.ts.map +0 -1
  243. package/out/tools/learned-scorer-clustering-eval.js.map +0 -1
  244. package/out/tools/learned-scorer-crossstate-eval.d.ts +0 -59
  245. package/out/tools/learned-scorer-crossstate-eval.d.ts.map +0 -1
  246. package/out/tools/learned-scorer-crossstate-eval.js.map +0 -1
  247. package/out/tools/learned-scorer-eval.d.ts +0 -77
  248. package/out/tools/learned-scorer-eval.d.ts.map +0 -1
  249. package/out/tools/learned-scorer-eval.js.map +0 -1
  250. package/out/tools/nppes-dedup-benchmark.d.ts +0 -101
  251. package/out/tools/nppes-dedup-benchmark.d.ts.map +0 -1
  252. package/out/tools/nppes-dedup-benchmark.js.map +0 -1
  253. package/out/tools/train-cross-gbt.d.ts +0 -78
  254. package/out/tools/train-cross-gbt.d.ts.map +0 -1
  255. package/out/tools/train-cross-gbt.js.map +0 -1
  256. package/out/tools/train-gbt.d.ts +0 -69
  257. package/out/tools/train-gbt.d.ts.map +0 -1
  258. package/out/tools/train-gbt.js.map +0 -1
  259. package/out/tools/train-org-cross-gbt.d.ts +0 -71
  260. package/out/tools/train-org-cross-gbt.d.ts.map +0 -1
  261. package/out/tools/train-org-cross-gbt.js.map +0 -1
  262. package/out/tools/viz/render-map.d.ts.map +0 -1
  263. package/out/tools/viz/render-map.js.map +0 -1
@@ -3,22 +3,21 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * Train the production learned-scorer model (#603). Builds the SAME NPI-keyed record set the dedup
7
- * benchmark + the clustering A/B use (the SHARED `buildNPPESSample`: real registry + name-drift +
8
- * address-variation), geocodes it, blocks → candidate pairs, featurizes each pair with the SHARED
9
- * `createMatchFeaturizer` (so train ≡ inference), labels by held-out NPI, and fits the
10
- * gradient-boosted-tree model. Writes the model as a committed TS module
11
- * (`registry/models/dedup-gbt-en-us.ts`) that ships in the package.
6
+ * Trains the production learned-scorer model. `buildNPPESSample` creates the same NPI-keyed records used by
7
+ * the dedup benchmark and clustering A/B. The sample uses the real registry and includes name drift plus address variation.
8
+ * The trainer geocodes records and groups them into candidate pairs. It featurizes each pair with
9
+ * `createMatchFeaturizer`. It labels pairs by NPI and fits a gradient-boosted tree model.
10
+ * It writes the model to the committed package module `registry/models/dedup-gbt-en-us.ts`.
12
11
  *
13
- * Unlike the eval, this trains on ALL sampled NPIs (no held-out split) — the held-out F1 is the
14
- * eval's job; this produces the shipped artifact. The eval (`learned-scorer-clustering-eval.ts`)
15
- * then re-measures generalization against the FS baseline.
12
+ * Unlike the eval, this trains on all sampled NPIs with no held-out split, since the held-out F1
13
+ * is the eval's job.
16
14
  *
17
15
  * Run: `mailwoman registry train-scorer gbt [--state TX] [--npis 3000] [--wof <admin.db>]
18
16
  * [--data-root <dir>] [--out registry/models/dedup-gbt-en-us.ts]`
19
17
  */
20
18
  import { dataRootPath } from "@mailwoman/core/data-root";
21
19
  import { makeDirectories, writeLocalFile } from "@mailwoman/core/fs/writers";
20
+ import { prettyJSON, stringifyJSON } from "@mailwoman/core/json";
22
21
  import { makeLcg } from "@mailwoman/core/random";
23
22
  import { isoDate } from "@mailwoman/core/utils";
24
23
  import { block, gbtScore, trainGBT } from "@mailwoman/match";
@@ -28,11 +27,12 @@ import { buildNPPESSample } from "#tools/nppes/sample";
28
27
  import { scoreEntities } from "#tools/nppes/scoring";
29
28
  import { stateOption, uniqueQuantiles } from "#tools/shared";
30
29
  /**
31
- * Share of entities assigned to fit; the rest are held out.
30
+ * Share of entities assigned to fit.
31
+ * The rest are held out.
32
32
  */
33
33
  const FIT_SPLIT_FRACTION = 0.8;
34
34
  /**
35
- * Train + emit the production dedup GBT — see the module doc.
35
+ * Train and emit the production dedup GBT.
36
36
  */
37
37
  export async function trainDedupGBT(options, report) {
38
38
  const SOURCES = options.sources || dataRootPath("record-matcher", "sources");
@@ -41,17 +41,15 @@ export async function trainDedupGBT(options, report) {
41
41
  const OUT = options.out || "packages/registry/lib/models/dedup-gbt-en-us.ts";
42
42
  const LOCALE = options.locale || "en-US";
43
43
  const COST = options.cost ?? 1;
44
- const TRAIN_DATE = options.date || isoDate(); // overridable for reproducible commits
44
+ const TRAIN_DATE = options.date || isoDate();
45
45
  const REGISTRY = `${SOURCES}/nppes_npi-registry_20260607.tsv`;
46
46
  const OTHER_NAMES = `${SOURCES}/nppes_other-names_20260607.tsv`;
47
- // --- Phases A + B: the variation-rich sample + the corpus-wide address-frequency table (the SHARED
48
- // sample builder — the same records the dedup benchmark and the learned-scorer evals see). ---
49
47
  const { rows, keptNpis, addressFrequency } = await buildNPPESSample({ registryPath: REGISTRY, otherNamesPath: OTHER_NAMES, state: STATE, maxNpis: NPIS }, report);
50
- // --- Phase C: geocode + ingest (NPI rides on record.id as the label). The heavy geocoder is
51
- // injected (see ./eval-geocoder.ts) — the registry package never imports the runtime. ---
48
+ // The geocoder is injected, since the registry package never imports the runtime.
52
49
  report?.("[C] geocoding…");
53
50
  const geocoder = await options.createGeocoder();
54
- // mapping.id = "npi" → record.id IS the NPI label (multiple records share an NPI, the ground truth).
51
+ // `record.id` supplies the NPI label.
52
+ // Multiple records can share an NPI as ground truth.
55
53
  const mapping = {
56
54
  id: "npi",
57
55
  name: "name",
@@ -65,7 +63,6 @@ export async function trainDedupGBT(options, report) {
65
63
  geocoder[Symbol.dispose]();
66
64
  const geocoded = records.filter((r) => r.address?.geocode).length;
67
65
  report?.(` ${records.length} records, ${geocoded} geocoded`);
68
- // --- Phase D: block → features (the SHARED featurizer) → labels. ---
69
66
  report?.("[D] blocking + featurizing…");
70
67
  const comparisons = buildDefaultModel({ collapseSpatial: true, addressFrequency }).comparisons;
71
68
  const featurize = createMatchFeaturizer({ comparisons, addressFrequency });
@@ -73,16 +70,16 @@ export async function trainDedupGBT(options, report) {
73
70
  const X = pairs.map(([a, b]) => featurize(a, b));
74
71
  const Y = pairs.map(([a, b]) => (a.id === b.id ? 1 : 0));
75
72
  const posRate = Y.reduce((s, v) => s + v, 0) / Math.max(1, Y.length);
76
- const W = Y.map((y) => (y === 1 ? 1 - posRate : posRate * COST)); // class-balanced; COST up-weights negatives
73
+ const W = Y.map((y) => (y === 1 ? 1 - posRate : posRate * COST));
77
74
  const hyperparams = { rounds: 120, depth: 3, lr: 0.3, minLeaf: 20 };
78
75
  if (COST !== 1) {
79
76
  report?.(` cost-sensitive: negative class weighted ×${COST} (penalize over-merge)`);
80
77
  }
81
- // --- Phase E: calibrate the default link threshold. The GBT logit is NOT in FS-weight units — it's
82
- // trained with class-balanced weights, so logit 0 (the balanced boundary) ignores the ~1% match base
83
- // rate and over-merges. Split the NPIs 80/20, fit a calibration GBT on the 80%, and sweep the
84
- // CLUSTERING threshold on the held-out 20% (the metric resolveEntities actually optimizes) for F1-max.
85
- // The shipped full-data model has near-identical logit calibration, so the threshold transfers. ---
78
+ // Calibrate the default link threshold.
79
+ // The GBT logit uses no Fellegi-Sunter weight units.
80
+ // With class-balanced weights, logit 0 ignores the roughly 1% match base rate and over-merges.
81
+ // The threshold is swept on a held-out 20% of NPIs.
82
+ // The shipped full-data model has near-identical logit calibration, so the threshold transfers.
86
83
  report?.("[E] calibrating the default link threshold on a held-out NPI split…");
87
84
  const rnd = makeLcg(20_260_615);
88
85
  const split = new Map();
@@ -112,12 +109,11 @@ export async function trainDedupGBT(options, report) {
112
109
  }
113
110
  }
114
111
  report?.(` recommended link threshold ${recommendedThreshold.toFixed(3)} (held-out clustering F1 ${(100 * bestF1).toFixed(1)}%)`);
115
- // --- Phase F: train the SHIPPED model on ALL pairs. ---
116
112
  report?.("[F] training the shipped model on all pairs…");
117
113
  const model = trainGBT(X, Y, W, hyperparams);
118
114
  report?.(` ${pairs.length} pairs (${(100 * posRate).toFixed(1)}% positive), ${model.trees.length} trees`);
119
- // --- Emit the model as a committed TS module. The literal is single-line + prettier-ignored so a
120
- // retrain produces a clean one-line diff, not a thousand reformatted lines. ---
115
+ // Emit the model as a committed TypeScript module with a prettier-stable literal,
116
+ // so a retrain produces a clean one-line diff.
121
117
  const meta = {
122
118
  version: "1.0.0",
123
119
  locale: LOCALE,
@@ -127,9 +123,9 @@ export async function trainDedupGBT(options, report) {
127
123
  records: records.length,
128
124
  pairs: pairs.length,
129
125
  posRate: Number(posRate.toFixed(4)),
130
- costNegative: COST, // cost-sensitive negative-class up-weight (1 = symmetric class-balanced)
126
+ costNegative: COST,
131
127
  hyperparams,
132
- recommendedThreshold: Number(recommendedThreshold.toFixed(4)), // F1-max link threshold (held-out); resolveEntities' default when learnedScorer is active
128
+ recommendedThreshold: Number(recommendedThreshold.toFixed(4)),
133
129
  features: X[0]?.length ?? 0,
134
130
  addressFrequencyDistinct: addressFrequency.distinct,
135
131
  addressFrequencyTotal: addressFrequency.total,
@@ -148,12 +144,12 @@ export async function trainDedupGBT(options, report) {
148
144
  ` */\n\n` +
149
145
  `import type { GBT } from "@mailwoman/match"\n\n` +
150
146
  `/** Provenance for the bundled model — what it was trained on. */\n` +
151
- `export const DEDUP_GBT_META = ${JSON.stringify(meta, null, 2)} as const\n\n` +
147
+ `export const DEDUP_GBT_META = ${prettyJSON(meta)} as const\n\n` +
152
148
  `// prettier-ignore\n` +
153
- `export const DEDUP_GBT_MODEL: GBT = ${JSON.stringify(model)}\n`;
149
+ `export const DEDUP_GBT_MODEL: GBT = ${stringifyJSON(model)}\n`;
154
150
  await makeDirectories(dirname(OUT));
155
151
  await writeLocalFile(moduleSource, OUT);
156
152
  report?.(`[written] ${OUT} (${(moduleSource.length / 1024).toFixed(0)} KB)`);
157
153
  return { out: OUT, pairs: pairs.length, recommendedThreshold, heldOutF1: bestF1 };
158
154
  }
159
- //# sourceMappingURL=train-gbt.js.map
155
+ //# sourceMappingURL=gbt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gbt.js","sourceRoot":"","sources":["../../../tools/train/gbt.ts"],"names":[],"mappings":"AAAA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A6B,KAAK,KAAK,QAAQ,CAAC,IAAI,WAAW,KAAK,CAAC,MAAM,mCAAmC;QAC9G,gGAAgG;QAChG,8FAA8F;QAC9F,SAAS;QACT,iDAAiD;QACjD,qEAAqE;QACrE,iCAAiC,UAAU,CAAC,IAAI,CAAC,eAAe;QAChE,sBAAsB;QACtB,uCAAuC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAA;IAEhE,MAAM,eAAe,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;IACnC,MAAM,cAAc,CAAC,YAAY,EAAE,GAAG,CAAC,CAAA;IACvC,MAAM,EAAE,CAAC,aAAa,GAAG,KAAK,CAAC,YAAY,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAA;IAE5E,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,EAAE,CAAA;AAClF,CAAC"}
@@ -0,0 +1,84 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Train the organization-level cross-source link scorer. The practitioner cross-source GBT does
7
+ * not transfer to organization records because its person-name features go dark. The organization
8
+ * cross-dataset flows therefore pin the FS baseline. CMS Provider of Services joins Care Compare
9
+ * by CCN. Each system represents the same facility and maintains its name and address separately.
10
+ *
11
+ * The pipeline runs a national CCN join into one record per source per facility, then the shared
12
+ * `trainCrossSourceModel` geocodes the rows and blocks the union. It keeps cross-source pairs.
13
+ * It featurizes them with the shared featurizer and labels them by CCN.
14
+ * Calibration uses held-out CCNs.
15
+ * The function emits `registry/models/org-crosssource-gbt-en-us.ts`.
16
+ *
17
+ * Sources (both public domain, direct CSVs):
18
+ *
19
+ * - `cms-pos_hospital-other_*.csv`: Provider of Services (PRVDR_NUM, FAC_NAME, ST_ADR…).
20
+ * - `cms-carecompare_hospital-general_*.csv`: Care Compare (Facility ID, Facility Name, Address…).
21
+ *
22
+ * Run: `mailwoman registry train-scorer org-cross-gbt [--cap 6000] [--precision-bar 0.95]
23
+ * [--wof <admin.db>] [--data-root <dir>] [--out registry/models/org-crosssource-gbt-en-us.ts]`
24
+ */
25
+ import { type PathBuilderLike } from "path-ts";
26
+ import type { EvalGeocoderFactory } from "#tools/eval-geocoder";
27
+ /**
28
+ * Options for {@linkcode trainOrgCrossSourceGBT}.
29
+ */
30
+ export interface TrainOrgCrossSourceGBTOptions {
31
+ /**
32
+ * The injected geocoder factory.
33
+ *
34
+ * The command wires `mailwoman/geocode-core`, as `./eval-geocoder.ts` does.
35
+ */
36
+ createGeocoder: EvalGeocoderFactory;
37
+ /**
38
+ * Record-matcher sources directory.
39
+ *
40
+ * Default `$MAILWOMAN_DATA_ROOT/record-matcher/sources`.
41
+ */
42
+ sources?: PathBuilderLike;
43
+ /**
44
+ * Care Compare facilities sampled.
45
+ *
46
+ * Default 6000.
47
+ */
48
+ cap?: number;
49
+ /**
50
+ * Output TS module path.
51
+ *
52
+ * Default `registry/models/org-crosssource-gbt-en-us.ts`.
53
+ */
54
+ out?: string;
55
+ /**
56
+ * Locale recorded in the model meta.
57
+ *
58
+ * Default en-US.
59
+ */
60
+ locale?: string;
61
+ /**
62
+ * Max cross-source recall subject to this held-out pairwise precision.
63
+ * Default 0.95.
64
+ */
65
+ precisionBar?: number;
66
+ /**
67
+ * The training date stored in the metadata.
68
+ *
69
+ * Default today.
70
+ */
71
+ date?: string;
72
+ }
73
+ /**
74
+ * Train and emit the org-level cross-source link GBT.
75
+ *
76
+ * The CCN is the cross-system facility key.
77
+ * It is stored in {@link CrossSourceRow.npi} and copied to `record.id` as the held-out label.
78
+ */
79
+ export declare function trainOrgCrossSourceGBT(options: TrainOrgCrossSourceGBTOptions, report?: (line: string) => void): Promise<{
80
+ out: string;
81
+ pairs: number;
82
+ recommendedThreshold: number;
83
+ }>;
84
+ //# sourceMappingURL=org-cross-gbt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"org-cross-gbt.d.ts","sourceRoot":"","sources":["../../../tools/train/org-cross-gbt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAIH,OAAO,EAAe,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAG3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAG/D;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC7C;;;;OAIG;IACH,cAAc,EAAE,mBAAmB,CAAA;IACnC;;;;OAIG;IACH,OAAO,CAAC,EAAE,eAAe,CAAA;IACzB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CACb;AAED;;;;;GAKG;AACH,wBAAsB,sBAAsB,CAC3C,OAAO,EAAE,6BAA6B,EACtC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,oBAAoB,EAAE,MAAM,CAAA;CAAE,CAAC,CAkGvE"}
@@ -3,47 +3,46 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * Train the ORG-LEVEL cross-source link scorer (#655 follow-on, 2026-07-06). The practitioner
7
- * cross-source GBT does not transfer to organization records (its person-name features go dark),
8
- * so the org-level cross-dataset flows pin the FS baseline. The org anchor: **CMS Provider of
9
- * Services joins Care Compare by CCN** — the same facility in two separately-maintained CMS
10
- * systems (certification vs quality reporting), each with independently-entered name + address.
11
- * Measured drift across the national join (n≈5.4k): 12.2% name, 4.9% address — the rename /
12
- * system-vs-facility / acquisition class the org objective exists for.
6
+ * Train the organization-level cross-source link scorer. The practitioner cross-source GBT does
7
+ * not transfer to organization records because its person-name features go dark. The organization
8
+ * cross-dataset flows therefore pin the FS baseline. CMS Provider of Services joins Care Compare
9
+ * by CCN. Each system represents the same facility and maintains its name and address separately.
13
10
  *
14
- * Pipeline: national CCN join → one record per source per facility (Phases A/B here), then the
15
- * SHARED `trainCrossSourceModel` runs Phases C–F — geocode → block the UNION, keep only
16
- * CROSS-source pairs → the SHARED featurizer → label by CCN → held-out-CCN calibration (max
17
- * recall s.t. precision ≥ bar) → train on all pairs → emit
18
- * `registry/models/org-crosssource-gbt-en-us.ts`.
11
+ * The pipeline runs a national CCN join into one record per source per facility, then the shared
12
+ * `trainCrossSourceModel` geocodes the rows and blocks the union. It keeps cross-source pairs.
13
+ * It featurizes them with the shared featurizer and labels them by CCN.
14
+ * Calibration uses held-out CCNs.
15
+ * The function emits `registry/models/org-crosssource-gbt-en-us.ts`.
19
16
  *
20
17
  * Sources (both public domain, direct CSVs):
21
18
  *
22
- * - `cms-pos_hospital-other_*.csv` — Provider of Services (PRVDR_NUM, FAC_NAME, ST_ADR…).
23
- * - `cms-carecompare_hospital-general_*.csv` — Care Compare (Facility ID, Facility Name, Address…).
19
+ * - `cms-pos_hospital-other_*.csv`: Provider of Services (PRVDR_NUM, FAC_NAME, ST_ADR…).
20
+ * - `cms-carecompare_hospital-general_*.csv`: Care Compare (Facility ID, Facility Name, Address…).
24
21
  *
25
22
  * Run: `mailwoman registry train-scorer org-cross-gbt [--cap 6000] [--precision-bar 0.95]
26
23
  * [--wof <admin.db>] [--data-root <dir>] [--out registry/models/org-crosssource-gbt-en-us.ts]`
27
24
  */
28
25
  import { dataRootPath } from "@mailwoman/core/data-root";
29
26
  import { isoDate } from "@mailwoman/core/utils";
27
+ import { resolvePath } from "path-ts";
30
28
  import { addressFrequencyKey, streamRows } from "#index";
31
29
  import { addr, norm, trainCrossSourceModel } from "#tools/shared";
32
30
  /**
33
- * Train + emit the org-level cross-source link GBT — see the module doc. The CCN is the cross-system facility key; it
34
- * rides {@link CrossSourceRow.npi} → `record.id` as the held-out label.
31
+ * Train and emit the org-level cross-source link GBT.
32
+ *
33
+ * The CCN is the cross-system facility key.
34
+ * It is stored in {@link CrossSourceRow.npi} and copied to `record.id` as the held-out label.
35
35
  */
36
36
  export async function trainOrgCrossSourceGBT(options, report) {
37
- const SOURCES = options.sources || String(dataRootPath("record-matcher", "sources"));
37
+ const SOURCES = resolvePath(options.sources ?? dataRootPath("record-matcher", "sources"));
38
38
  const CAP = options.cap ?? 6000;
39
39
  const OUT = options.out || "packages/registry/lib/models/org-crosssource-gbt-en-us.ts";
40
40
  const LOCALE = options.locale || "en-US";
41
- // #655 threshold rule: max cross-source recall subject to this held-out pairwise precision.
41
+ // Max cross-source recall subject to this held-out pairwise precision.
42
42
  const PRECISION_BAR = options.precisionBar ?? 0.95;
43
43
  const TRAIN_DATE = options.date || isoDate();
44
44
  const POS = `${SOURCES}/cms-pos_hospital-other_2026q1.csv`;
45
45
  const CARE_COMPARE = `${SOURCES}/cms-carecompare_hospital-general_20260706.csv`;
46
- // --- Phase A: Care Compare (Facility ID + name + address). ---
47
46
  report?.("[A] streaming Care Compare…");
48
47
  const ccByID = new Map();
49
48
  for await (const r of streamRows(CARE_COMPARE)) {
@@ -57,7 +56,6 @@ export async function trainOrgCrossSourceGBT(options, report) {
57
56
  ccByID.set(ccn, { npi: ccn, name, org: name, address, source: "care-compare" });
58
57
  }
59
58
  report?.(` ${ccByID.size} Care Compare facilities`);
60
- // --- Phase B: the SAME CCNs from the POS file + the corpus-wide address-frequency table. ---
61
59
  report?.("[B] streaming POS + building the frequency table…");
62
60
  const rows = [];
63
61
  const joined = new Set();
@@ -88,8 +86,6 @@ export async function trainOrgCrossSourceGBT(options, report) {
88
86
  frequency: (v) => (v ? (addrCounts.get(addressFrequencyKey(v)) ?? 0) / addrTotal : 0),
89
87
  };
90
88
  report?.(` ${joined.size} CCN-joined facilities → ${rows.length} records`);
91
- // --- Phases C–F: the SHARED cross-source trainer (geocode → cross-source pairs → #655 calibration
92
- // → shipped model → committed module). ---
93
89
  return trainCrossSourceModel({
94
90
  createGeocoder: options.createGeocoder,
95
91
  rows,
@@ -123,4 +119,4 @@ export async function trainOrgCrossSourceGBT(options, report) {
123
119
  report,
124
120
  });
125
121
  }
126
- //# sourceMappingURL=train-org-cross-gbt.js.map
122
+ //# sourceMappingURL=org-cross-gbt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"org-cross-gbt.js","sourceRoot":"","sources":["../../../tools/train/org-cross-gbt.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,EAAE,WAAW,EAAwB,MAAM,SAAS,CAAA;AAE3D,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAExD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,qBAAqB,EAAuB,MAAM,eAAe,CAAA;AAiDtF;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC3C,OAAsC,EACtC,MAA+B;IAE/B,MAAM,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,OAAO,IAAI,YAAY,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC,CAAA;IACzF,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,IAAI,CAAA;IAC/B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,2DAA2D,CAAA;IACtF,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,OAAO,CAAA;IACxC,uEAAuE;IACvE,MAAM,aAAa,GAAG,OAAO,CAAC,YAAY,IAAI,IAAI,CAAA;IAClD,MAAM,UA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 +3,36 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * #619: convert the TX HHSC nursing-facilities source (which ships an authoritative `Geo Location`
7
- * = `lat,lon` per facility) into the OaRow JSONL the resolver eval consumes — so our geocoder can
8
- * be graded against the provided coordinates on real facility addresses (great-circle delta, tier
9
- * breakdown via `oa-resolver-eval --address-points`).
6
+ * Convert the TX hhsc nursing-facilities source into the OaRow jsonl the resolver eval consumes.
7
+ * The source ships an authoritative `Geo Location` = `lat,lon` per facility, so the geocoder is
8
+ * graded against the provided coordinates on real facility addresses. `oa-resolver-eval
9
+ * --address-points` reports a great-circle delta and a tier breakdown.
10
10
  *
11
- * Neutral scope: this measures GEOCODER ACCURACY on real public addresses; it makes no claim about
11
+ * Neutral scope: this measures geocoder accuracy on real public addresses and makes no claim about
12
12
  * the facilities themselves.
13
13
  *
14
14
  * Run: `mailwoman registry convert tx-hhsc [--src <tsv>] [--out /tmp/txhhsc-oarow.jsonl]`
15
15
  */
16
+ import type { PathBuilderLike } from "path-ts";
16
17
  /**
17
18
  * Options for {@linkcode convertTXHHSC}.
18
19
  */
19
20
  export interface TXHHSCConvertOptions {
20
21
  /**
21
- * The TX HHSC nursing-facilities TSV. Default `$MAILWOMAN_DATA_ROOT/record-matcher/sources/…`.
22
+ * The TX hhsc nursing-facilities TSV.
23
+ *
24
+ * Default `$MAILWOMAN_DATA_ROOT/record-matcher/sources/…`.
22
25
  */
23
- src?: string;
26
+ src?: PathBuilderLike;
24
27
  /**
25
- * Output OaRow JSONL path. Default `/tmp/txhhsc-oarow.jsonl`.
28
+ * Output OaRow jsonl path.
29
+ *
30
+ * Default `/tmp/txhhsc-oarow.jsonl`.
26
31
  */
27
32
  out?: string;
28
33
  }
29
34
  /**
30
- * Convert the TX HHSC nursing-facilities TSV into OaRow JSONL for `oa-resolver-eval`.
35
+ * Convert the TX hhsc nursing-facilities TSV into OaRow jsonl for `oa-resolver-eval`.
31
36
  */
32
37
  export declare function convertTXHHSC(options?: TXHHSCConvertOptions, report?: (line: string) => void): Promise<{
33
38
  written: number;
@@ -1 +1 @@
1
- {"version":3,"file":"txhhsc-to-oarow.d.ts","sourceRoot":"","sources":["../../lib/tools/txhhsc-to-oarow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AASH;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;CACZ;AAID;;GAEG;AACH,wBAAsB,aAAa,CAClC,OAAO,GAAE,oBAAyB,EAClC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAkE5D"}
1
+ {"version":3,"file":"txhhsc-to-oarow.d.ts","sourceRoot":"","sources":["../../tools/txhhsc-to-oarow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAK9C;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;;OAIG;IACH,GAAG,CAAC,EAAE,eAAe,CAAA;IACrB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;CACZ;AAID;;GAEG;AACH,wBAAsB,aAAa,CAClC,OAAO,GAAE,oBAAyB,EAClC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAkE5D"}
@@ -3,12 +3,12 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * #619: convert the TX HHSC nursing-facilities source (which ships an authoritative `Geo Location`
7
- * = `lat,lon` per facility) into the OaRow JSONL the resolver eval consumes — so our geocoder can
8
- * be graded against the provided coordinates on real facility addresses (great-circle delta, tier
9
- * breakdown via `oa-resolver-eval --address-points`).
6
+ * Convert the TX hhsc nursing-facilities source into the OaRow jsonl the resolver eval consumes.
7
+ * The source ships an authoritative `Geo Location` = `lat,lon` per facility, so the geocoder is
8
+ * graded against the provided coordinates on real facility addresses. `oa-resolver-eval
9
+ * --address-points` reports a great-circle delta and a tier breakdown.
10
10
  *
11
- * Neutral scope: this measures GEOCODER ACCURACY on real public addresses; it makes no claim about
11
+ * Neutral scope: this measures geocoder accuracy on real public addresses and makes no claim about
12
12
  * the facilities themselves.
13
13
  *
14
14
  * Run: `mailwoman registry convert tx-hhsc [--src <tsv>] [--out /tmp/txhhsc-oarow.jsonl]`
@@ -16,26 +16,27 @@
16
16
  import { dataRootPath, tempRootPath } from "@mailwoman/core/data-root";
17
17
  import { readLocalTextFile } from "@mailwoman/core/fs/readers";
18
18
  import { writeLocalTextFile } from "@mailwoman/core/fs/writers";
19
+ import { stringifyJSON } from "@mailwoman/core/json";
19
20
  import { TSVSpliterator } from "spliterator";
20
21
  import { inTXBBOX } from "#tools/shared";
21
22
  const GEO = /^\s*(-?\d+\.\d+)\s*,\s*(-?\d+\.\d+)\s*$/;
22
23
  /**
23
- * Convert the TX HHSC nursing-facilities TSV into OaRow JSONL for `oa-resolver-eval`.
24
+ * Convert the TX hhsc nursing-facilities TSV into OaRow jsonl for `oa-resolver-eval`.
24
25
  */
25
26
  export async function convertTXHHSC(options = {}, report) {
26
- const src = options.src || String(dataRootPath("record-matcher", "sources", "txhhsc_nursing-facilities_20260611.tsv"));
27
+ const src = options.src ?? dataRootPath("record-matcher", "sources", "txhhsc_nursing-facilities_20260611.tsv");
27
28
  const out = options.out || tempRootPath("txhhsc-oarow.jsonl");
28
29
  const records = [];
29
30
  let skipped = 0;
30
- // Column indices, captured from the first non-blank row. `header: false` keeps that row in the stream so the
31
- // blank-row guard below applies to it too.
31
+ // Column indices come from the first non-blank row.
32
+ // `header: false` keeps that row in the stream, so the blank-row guard below applies to it.
32
33
  let cAddr = -1;
33
34
  let cCity = -1;
34
35
  let cZip = -1;
35
36
  let cGeo = -1;
36
37
  let sawHeader = false;
37
38
  for (const f of TSVSpliterator.from(await readLocalTextFile(src), { header: false })) {
38
- if (f.every((value) => !value.trim()))
39
+ if (f.every((value) => !value))
39
40
  continue;
40
41
  if (!sawHeader) {
41
42
  sawHeader = true;
@@ -46,9 +47,9 @@ export async function convertTXHHSC(options = {}, report) {
46
47
  cGeo = col("Geo Location");
47
48
  continue;
48
49
  }
49
- const addr = (f[cAddr] ?? "").trim();
50
- const city = (f[cCity] ?? "").trim();
51
- const zip = (f[cZip] ?? "").trim();
50
+ const addr = f[cAddr] ?? "";
51
+ const city = f[cCity] ?? "";
52
+ const zip = f[cZip] ?? "";
52
53
  const m = GEO.exec(f[cGeo] ?? "");
53
54
  if (!addr || !city || !m) {
54
55
  skipped++;
@@ -61,7 +62,7 @@ export async function convertTXHHSC(options = {}, report) {
61
62
  skipped++;
62
63
  continue;
63
64
  }
64
- records.push(JSON.stringify({
65
+ records.push(stringifyJSON({
65
66
  input: `${addr}, ${city}, TX ${zip}`,
66
67
  lat,
67
68
  lon,
@@ -70,7 +71,7 @@ export async function convertTXHHSC(options = {}, report) {
70
71
  source: "txhhsc:nursing-facilities",
71
72
  }));
72
73
  }
73
- await writeLocalTextFile(records.join("\n") + "\n", out);
74
+ await writeLocalTextFile(records, out);
74
75
  report?.(`wrote ${records.length} rows (skipped ${skipped}) → ${out}`);
75
76
  return { written: records.length, skipped, out };
76
77
  }
@@ -1 +1 @@
1
- {"version":3,"file":"txhhsc-to-oarow.js","sourceRoot":"","sources":["../../lib/tools/txhhsc-to-oarow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EA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,CAAC,CAAC,EAAE,CAAC;YAC1B,OAAO,EAAE,CAAA;YAET,SAAQ;QACT,CAAC;QAED,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QACxB,MAAM,GAAG,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAExB,4DAA4D;QAC5D,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC;YACzB,OAAO,EAAE,CAAA;YAET,SAAQ;QACT,CAAC;QAED,OAAO,CAAC,IAAI,CACX,aAAa,CAAC;YACb,KAAK,EAAE,GAAG,IAAI,KAAK,IAAI,QAAQ,GAAG,EAAE;YACpC,GAAG;YACH,GAAG;YACH,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE;YACzD,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,2BAA2B;SACnC,CAAC,CACF,CAAA;IACF,CAAC;IAED,MAAM,kBAAkB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;IACtC,MAAM,EAAE,CAAC,SAAS,OAAO,CAAC,MAAM,kBAAkB,OAAO,OAAO,GAAG,EAAE,CAAC,CAAA;IAEtE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAA;AACjD,CAAC"}
@@ -3,9 +3,8 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * The shared headless-Chromium harness behind the `registry viz` renderers (an internal helper,
7
- * not a command). The WebGL consumers (Plotly 3D, MapLibre) get no GPU in headless Chromium, so
8
- * the browser launches on ANGLE's SwiftShader software rasterizer (`--use-gl=angle
6
+ * The shared headless-Chromium harness behind the `registry viz` renderers (an internal helper rather than a command). The WebGL consumers (Plotly 3D, MapLibre) get no GPU in headless Chromium, so
7
+ * the browser launches on angle's SwiftShader software rasterizer (`--use-gl=angle
9
8
  * --use-angle=swiftshader --enable-unsafe-swiftshader`); each caller owns its own navigation +
10
9
  * wait strategy and screenshots inside the callback.
11
10
  *
@@ -24,8 +23,10 @@ export interface ChromiumPageOptions {
24
23
  };
25
24
  }
26
25
  /**
27
- * Launch headless Chromium (SwiftShader WebGL), open one page at `deviceScaleFactor: 2`, collect console + page errors,
28
- * run `fn`, and dispose the browser. The callback owns navigation, waits, and the screenshot.
26
+ * Launch headless Chromium (SwiftShader WebGL), open one page at `deviceScaleFactor: 2`,
27
+ * collect console + page errors, run `fn`, and dispose the browser.
28
+ *
29
+ * The callback owns navigation, waits and the screenshot.
29
30
  */
30
31
  export declare function withChromiumPage<T>(options: ChromiumPageOptions, fn: (page: Page) => Promise<T>): Promise<{
31
32
  result: T;
@@ -1 +1 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../lib/tools/viz/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEtC;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;CAC3C;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACvC,OAAO,EAAE,mBAAmB,EAC5B,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,GAC5B,OAAO,CAAC;IAAE,MAAM,EAAE,CAAC,CAAC;IAAC,aAAa,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAiBjD"}
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../tools/viz/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEtC;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;CAC3C;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACvC,OAAO,EAAE,mBAAmB,EAC5B,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,GAC5B,OAAO,CAAC;IAAE,MAAM,EAAE,CAAC,CAAC;IAAC,aAAa,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAiBjD"}
@@ -3,9 +3,8 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * The shared headless-Chromium harness behind the `registry viz` renderers (an internal helper,
7
- * not a command). The WebGL consumers (Plotly 3D, MapLibre) get no GPU in headless Chromium, so
8
- * the browser launches on ANGLE's SwiftShader software rasterizer (`--use-gl=angle
6
+ * The shared headless-Chromium harness behind the `registry viz` renderers (an internal helper rather than a command). The WebGL consumers (Plotly 3D, MapLibre) get no GPU in headless Chromium, so
7
+ * the browser launches on angle's SwiftShader software rasterizer (`--use-gl=angle
9
8
  * --use-angle=swiftshader --enable-unsafe-swiftshader`); each caller owns its own navigation +
10
9
  * wait strategy and screenshots inside the callback.
11
10
  *
@@ -14,8 +13,10 @@
14
13
  * it.
15
14
  */
16
15
  /**
17
- * Launch headless Chromium (SwiftShader WebGL), open one page at `deviceScaleFactor: 2`, collect console + page errors,
18
- * run `fn`, and dispose the browser. The callback owns navigation, waits, and the screenshot.
16
+ * Launch headless Chromium (SwiftShader WebGL), open one page at `deviceScaleFactor: 2`,
17
+ * collect console + page errors, run `fn`, and dispose the browser.
18
+ *
19
+ * The callback owns navigation, waits and the screenshot.
19
20
  */
20
21
  export async function withChromiumPage(options, fn) {
21
22
  const { chromium } = await import("playwright");
@@ -1 +1 @@
1
- {"version":3,"file":"browser.js","sourceRoot":"","sources":["../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AC5B,EAA8B;IAE9B,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,CAAA;IAE/C,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,MAAM,CAAC;QACrC,IAAI,EAAE,CAAC,gBAAgB,EAAE,yBAAyB,EAAE,6BAA6B,EAAE,wBAAwB,CAAC;KAC5G,CAAC,CAAA;IAEF,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,iBAAiB,EAAE,CAAC,EAAE,CAAC,CAAA;IAExF,MAAM,MAAM,GAAa,EAAE,CAAA;IAC3B,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;IACxE,IAAI,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAEnD,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,CAAA;IAC7B,MAAM,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAA;IAEpC,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,CAAA;AACzC,CAAC"}
@@ -11,12 +11,15 @@
11
11
  */
12
12
  export interface CrossDatasetMapOptions {
13
13
  /**
14
- * The `cross-dataset-links` GeoJSON. Default
15
- * `$MAILWOMAN_DATA_ROOT/record-matcher/2026-06-16-cross-dataset-links.geojson`.
14
+ * The `cross-dataset-links` GeoJSON.
15
+ *
16
+ * Default `$MAILWOMAN_DATA_ROOT/record-matcher/2026-06-16-cross-dataset-links.geojson`.
16
17
  */
17
18
  in?: string;
18
19
  /**
19
- * Output HTML path. Default `/tmp/cross-dataset-map.html`.
20
+ * Output html path.
21
+ *
22
+ * Default `/tmp/cross-dataset-map.html`.
20
23
  */
21
24
  outHTML?: string;
22
25
  /**
@@ -25,7 +28,7 @@ export interface CrossDatasetMapOptions {
25
28
  crossAgencyOnly?: boolean;
26
29
  }
27
30
  /**
28
- * Render the cross-dataset-links GeoJSON to a bucket-colored MapLibre HTML page.
31
+ * Render the cross-dataset-links GeoJSON to a bucket-colored MapLibre html page.
29
32
  */
30
33
  export declare function crossDatasetMap(options?: CrossDatasetMapOptions, report?: (line: string) => void): Promise<{
31
34
  outHTML: string;
@@ -1 +1 @@
1
- {"version":3,"file":"cross-dataset-map.d.ts","sourceRoot":"","sources":["../../../lib/tools/viz/cross-dataset-map.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAcH;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;CACzB;AA6BD;;GAEG;AACH,wBAAsB,eAAe,CACpC,OAAO,GAAE,sBAA2B,EACpC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAqD3E"}
1
+ {"version":3,"file":"cross-dataset-map.d.ts","sourceRoot":"","sources":["../../../tools/viz/cross-dataset-map.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAcH;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC;;;;OAIG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IACX;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;CACzB;AAgCD;;GAEG;AACH,wBAAsB,eAAe,CACpC,OAAO,GAAE,sBAA2B,EACpC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAqD3E"}