@mailwoman/registry 10.0.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 (230) 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 +11 -6
  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 +43 -53
  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 +11 -6
  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 +17 -41
  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 +20 -27
  63. package/out/tools/cross/dataset-correlation.d.ts.map +1 -1
  64. package/out/tools/cross/dataset-correlation.js +9 -61
  65. package/out/tools/cross/dataset-correlation.js.map +1 -1
  66. package/out/tools/cross/source-threshold-sweep.d.ts +20 -26
  67. package/out/tools/cross/source-threshold-sweep.d.ts.map +1 -1
  68. package/out/tools/cross/source-threshold-sweep.js +14 -40
  69. package/out/tools/cross/source-threshold-sweep.js.map +1 -1
  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 +9 -8
  79. package/out/tools/geocoder/namesake-probe.d.ts.map +1 -1
  80. package/out/tools/geocoder/namesake-probe.js +6 -7
  81. package/out/tools/geocoder/namesake-probe.js.map +1 -1
  82. package/out/tools/geocoder/vs-provided-coords.d.ts +18 -15
  83. package/out/tools/geocoder/vs-provided-coords.d.ts.map +1 -1
  84. package/out/tools/geocoder/vs-provided-coords.js +30 -27
  85. package/out/tools/geocoder/vs-provided-coords.js.map +1 -1
  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 +30 -27
  91. package/out/tools/learned/scorer/clustering-eval.d.ts.map +1 -1
  92. package/out/tools/learned/scorer/clustering-eval.js +28 -38
  93. package/out/tools/learned/scorer/clustering-eval.js.map +1 -1
  94. package/out/tools/learned/scorer/crossstate-eval.d.ts +24 -18
  95. package/out/tools/learned/scorer/crossstate-eval.d.ts.map +1 -1
  96. package/out/tools/learned/scorer/crossstate-eval.js +19 -25
  97. package/out/tools/learned/scorer/crossstate-eval.js.map +1 -1
  98. package/out/tools/learned/scorer/eval.d.ts +22 -39
  99. package/out/tools/learned/scorer/eval.d.ts.map +1 -1
  100. package/out/tools/learned/scorer/eval.js +11 -71
  101. package/out/tools/learned/scorer/eval.js.map +1 -1
  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 +21 -41
  107. package/out/tools/nppes/dedup-benchmark.d.ts.map +1 -1
  108. package/out/tools/nppes/dedup-benchmark.js +20 -66
  109. package/out/tools/nppes/dedup-benchmark.js.map +1 -1
  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 +5 -6
  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 +36 -26
  143. package/out/tools/train/cross-gbt.d.ts.map +1 -1
  144. package/out/tools/train/cross-gbt.js +14 -25
  145. package/out/tools/train/cross-gbt.js.map +1 -1
  146. package/out/tools/train/gbt.d.ts +36 -20
  147. package/out/tools/train/gbt.d.ts.map +1 -1
  148. package/out/tools/train/gbt.js +27 -31
  149. package/out/tools/train/gbt.js.map +1 -1
  150. package/out/tools/train/org-cross-gbt.d.ts +37 -24
  151. package/out/tools/train/org-cross-gbt.d.ts.map +1 -1
  152. package/out/tools/train/org-cross-gbt.js +18 -22
  153. package/out/tools/train/org-cross-gbt.js.map +1 -1
  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 +5 -5
  171. package/out/tools/viz/render/map.d.ts.map +1 -1
  172. package/out/tools/viz/render/map.js +6 -5
  173. package/out/tools/viz/render/map.js.map +1 -1
  174. package/out/tools/viz/{render/index.d.ts → render.d.ts} +13 -9
  175. package/out/tools/viz/render.d.ts.map +1 -0
  176. package/out/tools/viz/{render/index.js → render.js} +9 -8
  177. package/out/tools/viz/render.js.map +1 -0
  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 → tools}/cross/dataset-correlation.ts +31 -72
  193. package/{lib/tools → 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 → tools}/geocoder/namesake-probe.ts +9 -8
  197. package/{lib/tools → tools}/geocoder/vs-provided-coords.ts +39 -30
  198. package/{lib/tools → tools}/gold-set-sample.ts +35 -29
  199. package/{lib/tools → tools}/learned/scorer/clustering-eval.ts +49 -45
  200. package/{lib/tools → tools}/learned/scorer/crossstate-eval.ts +34 -30
  201. package/{lib/tools → tools}/learned/scorer/eval.ts +35 -78
  202. package/{lib/tools → tools}/matcher-scale.ts +21 -33
  203. package/{lib/tools → 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 +15 -11
  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 → tools}/train/cross-gbt.ts +38 -34
  213. package/{lib/tools → tools}/train/gbt.ts +55 -41
  214. package/{lib/tools → 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 → tools}/viz/render/map.ts +7 -6
  220. package/{lib/tools/viz/render/index.ts → 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/index.d.ts +0 -31
  226. package/out/tools/index.d.ts.map +0 -1
  227. package/out/tools/index.js +0 -31
  228. package/out/tools/index.js.map +0 -1
  229. package/out/tools/viz/render/index.d.ts.map +0 -1
  230. package/out/tools/viz/render/index.js.map +0 -1
package/out/ingest.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"ingest.js","sourceRoot":"","sources":["../lib/ingest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAEnD,OAAO,EAAE,4BAA4B,EAAE,eAAe,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/G,OAAO,EAAsB,cAAc,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAS5E;;;;;GAKG;AACH,MAAM,iBAAiB,GAAG;IACzB,KAAK,EAAE,UAAU,CAAC,KAAK;IACvB,GAAG,EAAE,UAAU,CAAC,GAAG;CACkG,CAAA;AAOtH;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY;IACxC,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAA;AAC9C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CACzB,MAAc,EACd,IAAI,GAA8B,EAAE;IAEpC,OAAO,cAAc,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AC,IAA2B;IAC5D,OAAO,KAAK,EAAE,GAAW,EAAiC,EAAE;QAC3D,IAAI,UAA6B,CAAA;QACjC,IAAI,QAA2B,CAAA;QAE/B,IAAI,iBAAiB,IAAI,IAAI,EAAE,CAAC;YAC/B,MAAM,CAAC,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAA;YACzC,UAAU,GAAG,CAAC,CAAC,UAAU,CAAA;YACzB,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAA;QACjB,CAAC;aAAM,CAAC;YACP,UAAU,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YAClC,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;QACnC,CAAC;QAED,MAAM,IAAI,GAAG,eAAe,CAAC,UAAU,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,CAAA;QAExE,IAAI,CAAC,QAAQ,IAAI,QAAQ,CAAC,GAAG,KAAK,IAAI,IAAI,QAAQ,CAAC,GAAG,KAAK,IAAI;YAAE,OAAO,IAAI,CAAA;QAE5E,MAAM,OAAO,GAAmB;YAC/B,UAAU,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,GAAG,EAAE,SAAS,EAAE,QAAQ,CAAC,GAAG,EAAE;YAC/D,IAAI,EAAE,QAAQ,CAAC,eAAe;YAC9B,iBAAiB,EAAE,QAAQ,CAAC,aAAa;YACzC,SAAS,EAAE,QAAQ,CAAC,SAAS;SAC7B,CAAA;QAED,OAAO,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;IAClC,CAAC,CAAA;AACF,CAAC"}
@@ -3,24 +3,19 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * The learned scorer (#603) — the production wiring for the gradient-boosted-tree model behind
7
- * {@link ResolveConfig.scorer}. Two pieces:
6
+ * The learned scorer, the production wiring for the gradient-boosted-tree model behind
7
+ * {@link ResolveConfig.scorer}.
8
8
  *
9
- * 1. {@link createMatchFeaturizer} — the ONE feature extractor for a candidate pair, used identically
10
- * at train time (`registry/tools/train-gbt.ts`), eval time (the learned-scorer
11
- * evals), and inference time (here). A pair → one-hot of each comparison's agreement level +
12
- * the over-merge interaction terms (co-located × name/org disagreement) + address
13
- * crowdedness.
14
- * 2. {@link createGBTScorer} — wraps a trained {@link GBT} + the featurizer into the `(a, b) => number`
15
- * the resolve pipeline's `scorer` hook expects (a logit, threshold-comparable with the
16
- * Fellegi-Sunter weight it replaces).
9
+ * {@link createMatchFeaturizer} is the one feature extractor for a candidate pair, used
10
+ * identically at train time (`registry/tools/train-gbt.ts`), eval time and inference time.
11
+ * {@link createGBTScorer} wraps a trained {@link GBT} and the featurizer into the `(a, b) => number`
12
+ * the resolve pipeline's `scorer` hook expects (a logit, threshold-comparable with the
13
+ * Fellegi-Sunter weight it replaces).
17
14
  *
18
- * Both take the comparison set as INPUT (rather than importing {@link buildDefaultModel}) so this
19
- * module has no dependency cycle with `resolve.ts`. The contract that keeps train ≡ inference:
20
- * feed the comparisons from `buildDefaultModel({ collapseSpatial: true, addressFrequency })` —
21
- * the model's structure (and thus the feature layout) is fixed by that config; only the frequency
22
- * VALUES differ between the training corpus and the matched set, which is the point (the model
23
- * generalizes, as the cross-state eval showed).
15
+ * Both take the comparison set as input rather than importing {@link buildDefaultModel}, so this
16
+ * module has no dependency cycle with `resolve.ts`. Feed the comparisons from
17
+ * `buildDefaultModel({ collapseSpatial: true, addressFrequency })`, since that config fixes the
18
+ * feature layout.
24
19
  */
25
20
  import { type Comparison, type GBT, type TermFrequencyTable } from "@mailwoman/match";
26
21
  import type { SourceRecord } from "#types";
@@ -29,10 +24,13 @@ import type { SourceRecord } from "#types";
29
24
  */
30
25
  export interface LearnedFeatureConfig {
31
26
  /**
32
- * The comparison set the features are built over — MUST be `buildDefaultModel({ collapseSpatial: true,
33
- * addressFrequency }).comparisons` so the feature layout matches the trained model. (`usePhone` / `discriminators`
34
- * are NOT part of the learned feature model — the GBT replaces the FS weight wholesale and owns its own feature
35
- * vector.)
27
+ * The comparison set the features are built over.
28
+ *
29
+ * It must be `buildDefaultModel({ collapseSpatial: true, addressFrequency }).comparisons`
30
+ * so the feature layout matches the trained model.
31
+ *
32
+ * `usePhone` and `discriminators` are not part of the learned feature model,
33
+ * since the GBT replaces the Fellegi-Sunter weight wholesale and owns its feature vector.
36
34
  */
37
35
  comparisons: Comparison<SourceRecord>[];
38
36
  /**
@@ -41,16 +39,21 @@ export interface LearnedFeatureConfig {
41
39
  addressFrequency: TermFrequencyTable;
42
40
  }
43
41
  /**
44
- * Build the per-pair feature extractor. The vector is: one-hot of each comparison's agreement level, then the two
45
- * over-merge interaction terms (spatial-exact × name-disagree, spatial-exact × org-disagree — the "same place,
46
- * different names" signature that drives co-located over-merges), then address crowdedness scaled into [0, 1].
42
+ * Build the per-pair feature extractor.
43
+ *
44
+ * The vector is: one-hot of each comparison's agreement level, then the two over-merge
45
+ * interaction terms (spatial-exact × name-disagree, spatial-exact × org-disagree,
46
+ * the "same place, different names" signature that drives co-located over-merges),
47
+ * then address crowdedness scaled into [0, 1].
47
48
  * Deterministic and EM-independent, so it is identical across train / eval / inference.
48
49
  */
49
50
  export declare function createMatchFeaturizer(config: LearnedFeatureConfig): (a: SourceRecord, b: SourceRecord) => number[];
50
51
  /**
51
- * Wrap a trained {@link GBT} into the `(a, b) => number` link scorer for {@link ResolveConfig.scorer}. The returned
52
- * weight is the model's logit — same threshold-comparable units as the Fellegi-Sunter weight it replaces, so the
53
- * pipeline's clustering + threshold semantics are unchanged.
52
+ * Wrap a trained {@link GBT} into the `(a, b) => number` link scorer for {@link ResolveConfig.scorer}.
53
+ *
54
+ * The returned weight is the model's logit.
55
+ * Same threshold-comparable units as the Fellegi-Sunter weight it replaces,
56
+ * so the pipeline's clustering + threshold semantics are unchanged.
54
57
  */
55
58
  export declare function createGBTScorer(config: LearnedFeatureConfig & {
56
59
  model: GBT;
@@ -1 +1 @@
1
- {"version":3,"file":"learned-scorer.d.ts","sourceRoot":"","sources":["../lib/learned-scorer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAEN,KAAK,UAAU,EACf,KAAK,GAAG,EAGR,KAAK,kBAAkB,EACvB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAS1C;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;;;OAKG;IACH,WAAW,EAAE,UAAU,CAAC,YAAY,CAAC,EAAE,CAAA;IACvC;;OAEG;IACH,gBAAgB,EAAE,kBAAkB,CAAA;CACpC;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,oBAAoB,GAAG,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,KAAK,MAAM,EAAE,CA2DlH;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC9B,MAAM,EAAE,oBAAoB,GAAG;IAAE,KAAK,EAAE,GAAG,CAAA;CAAE,GAC3C,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,KAAK,MAAM,CAK9C"}
1
+ {"version":3,"file":"learned-scorer.d.ts","sourceRoot":"","sources":["../lib/learned-scorer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAEN,KAAK,UAAU,EACf,KAAK,GAAG,EAGR,KAAK,kBAAkB,EACvB,MAAM,kBAAkB,CAAA;AAEzB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAS1C;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;;;;;;OAQG;IACH,WAAW,EAAE,UAAU,CAAC,YAAY,CAAC,EAAE,CAAA;IACvC;;OAEG;IACH,gBAAgB,EAAE,kBAAkB,CAAA;CACpC;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,oBAAoB,GAAG,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,KAAK,MAAM,EAAE,CAkDlH;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC9B,MAAM,EAAE,oBAAoB,GAAG;IAAE,KAAK,EAAE,GAAG,CAAA;CAAE,GAC3C,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,KAAK,MAAM,CAK9C"}
@@ -3,36 +3,34 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * The learned scorer (#603) — the production wiring for the gradient-boosted-tree model behind
7
- * {@link ResolveConfig.scorer}. Two pieces:
6
+ * The learned scorer, the production wiring for the gradient-boosted-tree model behind
7
+ * {@link ResolveConfig.scorer}.
8
8
  *
9
- * 1. {@link createMatchFeaturizer} — the ONE feature extractor for a candidate pair, used identically
10
- * at train time (`registry/tools/train-gbt.ts`), eval time (the learned-scorer
11
- * evals), and inference time (here). A pair → one-hot of each comparison's agreement level +
12
- * the over-merge interaction terms (co-located × name/org disagreement) + address
13
- * crowdedness.
14
- * 2. {@link createGBTScorer} — wraps a trained {@link GBT} + the featurizer into the `(a, b) => number`
15
- * the resolve pipeline's `scorer` hook expects (a logit, threshold-comparable with the
16
- * Fellegi-Sunter weight it replaces).
9
+ * {@link createMatchFeaturizer} is the one feature extractor for a candidate pair, used
10
+ * identically at train time (`registry/tools/train-gbt.ts`), eval time and inference time.
11
+ * {@link createGBTScorer} wraps a trained {@link GBT} and the featurizer into the `(a, b) => number`
12
+ * the resolve pipeline's `scorer` hook expects (a logit, threshold-comparable with the
13
+ * Fellegi-Sunter weight it replaces).
17
14
  *
18
- * Both take the comparison set as INPUT (rather than importing {@link buildDefaultModel}) so this
19
- * module has no dependency cycle with `resolve.ts`. The contract that keeps train ≡ inference:
20
- * feed the comparisons from `buildDefaultModel({ collapseSpatial: true, addressFrequency })` —
21
- * the model's structure (and thus the feature layout) is fixed by that config; only the frequency
22
- * VALUES differ between the training corpus and the matched set, which is the point (the model
23
- * generalizes, as the cross-state eval showed).
15
+ * Both take the comparison set as input rather than importing {@link buildDefaultModel}, so this
16
+ * module has no dependency cycle with `resolve.ts`. Feed the comparisons from
17
+ * `buildDefaultModel({ collapseSpatial: true, addressFrequency })`, since that config fixes the
18
+ * feature layout.
24
19
  */
25
20
  import { agreementPattern, gbtScore, nameSimilarity, } from "@mailwoman/match";
26
21
  /**
27
- * Similarity at which two official names count as the same organisation. Set high because the feature is a near-exact
28
- * agreement signal, not a fuzzy one — the fuzzy comparison is a separate feature and this one exists to distinguish
29
- * it.
22
+ * Similarity at which two official names count as the same organization.
23
+ *
24
+ * Set high because the feature is a near-exact agreement signal rather than a fuzzy one.
30
25
  */
31
26
  const OFFICIAL_NAME_AGREEMENT = 0.93;
32
27
  /**
33
- * Build the per-pair feature extractor. The vector is: one-hot of each comparison's agreement level, then the two
34
- * over-merge interaction terms (spatial-exact × name-disagree, spatial-exact × org-disagree — the "same place,
35
- * different names" signature that drives co-located over-merges), then address crowdedness scaled into [0, 1].
28
+ * Build the per-pair feature extractor.
29
+ *
30
+ * The vector is: one-hot of each comparison's agreement level, then the two over-merge
31
+ * interaction terms (spatial-exact × name-disagree, spatial-exact × org-disagree,
32
+ * the "same place, different names" signature that drives co-located over-merges),
33
+ * then address crowdedness scaled into [0, 1].
36
34
  * Deterministic and EM-independent, so it is identical across train / eval / inference.
37
35
  */
38
36
  export function createMatchFeaturizer(config) {
@@ -53,7 +51,6 @@ export function createMatchFeaturizer(config) {
53
51
  f.push(lvl === l ? 1 : 0);
54
52
  }
55
53
  }
56
- // Interaction: co-located (spatial exact = level 0) AND names/org disagree (catch-all level).
57
54
  const spatialExact = spatialI !== undefined && pat[spatialI] === 0 ? 1 : 0;
58
55
  const nameDisagree = givenI !== undefined &&
59
56
  familyI !== undefined &&
@@ -62,34 +59,29 @@ export function createMatchFeaturizer(config) {
62
59
  ? 1
63
60
  : 0;
64
61
  const orgDisagree = orgI !== undefined && pat[orgI] === lastLevel(orgI) ? 1 : 0;
65
- f.push(spatialExact * nameDisagree); // the over-merge signature: same place, names disagree
62
+ f.push(spatialExact * nameDisagree);
66
63
  f.push(spatialExact * orgDisagree);
67
- // Address crowdedness (how shared this address is) — high → "same address" is weak evidence.
68
64
  const freq = a.address?.raw ? addressFrequency.frequency(a.address.raw) : 0;
69
65
  f.push(Math.min(1, freq * 1000));
70
- // #625 roll-up signature (2026-07-06 adjudication): every genuine over-merge in the adjudicated
71
- // packet was a MANAGEMENT-COMPANY roll-up — differently-branded operating entities at a shared
72
- // corporate/billing address where the AUTHORIZED OFFICIAL also agrees (the operator signs
73
- // everything). The official is NOT in the comparison set (discriminators are excluded from the
74
- // learned feature model), so the GBT could never see — let alone learn — that officialAgree in
75
- // the presence of orgDisagree is ANTI-identity evidence. These three appended features express
76
- // it directly from `attributes.authorizedOfficial`; appended at the END so models trained
77
- // without them (the cross-source GBT) keep scoring unchanged (trailing features are ignored).
66
+ // Roll-up signature: a shared corporate address can host differently-branded
67
+ // operating entities whose authorized official also agrees.
68
+ // The official is not in the comparison set, so these three features express that evidence directly.
69
+ // They are appended at the end, so models trained without them keep scoring unchanged.
78
70
  const offA = a.attributes?.["authorizedOfficial"]?.trim();
79
71
  const offB = b.attributes?.["authorizedOfficial"]?.trim();
80
72
  const officialAgree = offA && offB && nameSimilarity(offA, offB) >= OFFICIAL_NAME_AGREEMENT ? 1 : 0;
81
73
  f.push(officialAgree);
82
- f.push(officialAgree * orgDisagree); // the roll-up core: same signer, different brand
74
+ f.push(officialAgree * orgDisagree);
83
75
  f.push(officialAgree * orgDisagree * spatialExact);
84
- // …at the same place
85
- // scale into a usable range
86
76
  return f;
87
77
  };
88
78
  }
89
79
  /**
90
- * Wrap a trained {@link GBT} into the `(a, b) => number` link scorer for {@link ResolveConfig.scorer}. The returned
91
- * weight is the model's logit — same threshold-comparable units as the Fellegi-Sunter weight it replaces, so the
92
- * pipeline's clustering + threshold semantics are unchanged.
80
+ * Wrap a trained {@link GBT} into the `(a, b) => number` link scorer for {@link ResolveConfig.scorer}.
81
+ *
82
+ * The returned weight is the model's logit.
83
+ * Same threshold-comparable units as the Fellegi-Sunter weight it replaces,
84
+ * so the pipeline's clustering + threshold semantics are unchanged.
93
85
  */
94
86
  export function createGBTScorer(config) {
95
87
  const featurize = createMatchFeaturizer(config);
@@ -1 +1 @@
1
- {"version":3,"file":"learned-scorer.js","sourceRoot":"","sources":["../lib/learned-scorer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EACN,gBAAgB,EAGhB,QAAQ,EACR,cAAc,GAEd,MAAM,kBAAkB,CAAA;AAIzB;;;;GAIG;AACH,MAAM,uBAAuB,GAAG,IAAI,CAAA;AAmBpC;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAA4B;IACjE,MAAM,EAAE,WAAW,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAAA;IAChD,MAAM,WAAW,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC3D,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAuC,CAAA;IAC9G,MAAM,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC,CAAA;IACjC,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,CAAA;IAC7B,MAAM,OAAO,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAA;IAC/B,MAAM,IAAI,GAAG,KAAK,CAAC,cAAc,CAAC,CAAA;IAClC,MAAM,SAAS,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,WAAW,CAAC,CAAC,CAA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,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAC3E,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC,CAAC,CAAA;QAChC,6EAA6E;QAC7E,4DAA4D;QAC5D,qGAAqG;QACrG,uFAAuF;QACvF,MAAM,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,CAAC,oBAAoB,CAAC,EAAE,IAAI,EAAE,CAAA;QACzD,MAAM,IAAI,GAAG,CAAC,CAAC,UAAU,EAAE,CAAC,oBAAoB,CAAC,EAAE,IAAI,EAAE,CAAA;QACzD,MAAM,aAAa,GAAG,IAAI,IAAI,IAAI,IAAI,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QACnG,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;QACrB,CAAC,CAAC,IAAI,CAAC,aAAa,GAAG,WAAW,CAAC,CAAA;QACnC,CAAC,CAAC,IAAI,CAAC,aAAa,GAAG,WAAW,GAAG,YAAY,CAAC,CAAA;QAElD,OAAO,CAAC,CAAA;IACT,CAAC,CAAA;AACF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAC9B,MAA6C;IAE7C,MAAM,SAAS,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAA;IAC/C,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAA;IAExB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AAClD,CAAC"}
package/out/map-html.d.ts CHANGED
@@ -2,27 +2,6 @@
2
2
  * @copyright Sister Software
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
- *
6
- * Render resolved entities as a standalone map page — the visual complement to {@link toGeoJSON}'s
7
- * QGIS/analyst export. `toMapHTML(featureCollection)` returns one HTML file you open in a
8
- * browser; no server, no build.
9
- *
10
- * It renders on the HOUSE stack: MapLibre GL + a Protomaps basemap (`@protomaps/basemaps` generates
11
- * the `layers()` for a named flavor) over the `basemap-v4` vector tiles served from R2 at
12
- * `tiles.mailwoman.ai` — the same basemap the demo uses. Each entity is a circle sized by
13
- * records-merged and colored by cross-dataset-link status (≥2 sources stand out), or
14
- * categorically by `bucket` when the reconciliation output carries one. Pure: GeoJSON in, HTML
15
- * string out (the Protomaps layer specs are generated at this point and inlined). The generated
16
- * page fetches MapLibre, the basemap tiles, and glyphs/sprite over the network when opened (the
17
- * house infra).
18
- *
19
- * SERVE IT OVER LOCALHOST, don't open it as a file. The house tile server (`tiles.mailwoman.ai`)
20
- * CORS-restricts to localhost + the docs domains, so a `file://` page shows the (accurate)
21
- * markers on a blank basemap. `npx serve` / `python3 -m http.server` in the output directory is
22
- * enough; the page also surfaces a hint banner when it detects it's running from `file://`.
23
- *
24
- * Neutral entity-resolution view: it shows what resolved to what and how confidently (cohesion).
25
- * Bucket labels render verbatim from the data, never editorialized.
26
5
  */
27
6
  import type { GeoFeatureCollection, PointLiteral } from "@mailwoman/spatial";
28
7
  import type { MapFeatureData } from "#types";
@@ -30,29 +9,31 @@ import type { MapFeatureData } from "#types";
30
9
  * Protomaps stock flavors (shipped by `@protomaps/basemaps`).
31
10
  */
32
11
  export type MapFlavor = "light" | "dark" | "white" | "grayscale" | "black";
12
+ /**
13
+ * Options for {@link toMapHTML}.
14
+ *
15
+ * With `colorBy: "auto"`, markers are colored by `bucket` when any feature has one
16
+ * and otherwise by whether two or more sources agree.
17
+ */
33
18
  export interface MapHTMLOptions {
34
19
  /**
35
- * Document `<title>` + on-map heading. Default: "Mailwoman — resolved entities".
20
+ * Sets the document title and on-map heading, defaulting to `Mailwoman — resolved entities`.
36
21
  */
37
22
  title?: string;
38
23
  /**
39
- * Protomaps basemap flavor. Default: "light" (data points read cleanly over it).
24
+ * Selects the Protomaps basemap flavor, defaulting to `light`, over which the markers read clearly.
40
25
  */
41
26
  flavor?: MapFlavor;
42
27
  /**
43
- * How to color the markers:
44
- *
45
- * - `"auto"` (default) — by `bucket` if any feature carries one (reconciliation output), else by cross-dataset-link
46
- * status.
47
- * - `"sources"` — always by cross-dataset-link status (≥2 sources stand out).
48
- * - `"bucket"` — always by the `bucket` property.
28
+ * Chooses marker colors: `bucket` uses the `bucket` property, `sources` shows
29
+ * whether two or more sources are linked.
30
+ * The default `auto` picks `bucket` when any feature has one.
49
31
  */
50
32
  colorBy?: "auto" | "sources" | "bucket";
51
33
  }
52
34
  /**
53
- * Render `geojson` (a {@link toGeoJSON} / reconciliation FeatureCollection) as a complete, standalone HTML document.
54
- * Entities without a coordinate are already absent from those collections; an empty collection renders a friendly empty
55
- * state rather than a broken map.
35
+ * Renders a {@link toGeoJSON} or reconciliation feature collection as a standalone MapLibre
36
+ * HTML document, with an empty-state panel when the collection has no features.
56
37
  */
57
38
  export declare function toMapHTML(geojson: GeoFeatureCollection<PointLiteral, MapFeatureData>, options?: MapHTMLOptions): string;
58
39
  //# sourceMappingURL=map-html.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"map-html.d.ts","sourceRoot":"","sources":["../lib/map-html.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAG5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AAwB5C;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,WAAW,GAAG,OAAO,CAAA;AAE1E,MAAM,WAAW,cAAc;IAC9B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAA;IAClB;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAA;CACvC;AA4BD;;;;GAIG;AACH,wBAAgB,SAAS,CACxB,OAAO,EAAE,oBAAoB,CAAC,YAAY,EAAE,cAAc,CAAC,EAC3D,OAAO,GAAE,cAAmB,GAC1B,MAAM,CA0NR"}
1
+ {"version":3,"file":"map-html.d.ts","sourceRoot":"","sources":["../lib/map-html.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,KAAK,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAG5E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAA;AAa5C;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,WAAW,GAAG,OAAO,CAAA;AAE1E;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC9B;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,MAAM,CAAC,EAAE,SAAS,CAAA;IAElB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,QAAQ,CAAA;CACvC;AAgBD;;;GAGG;AACH,wBAAgB,SAAS,CACxB,OAAO,EAAE,oBAAoB,CAAC,YAAY,EAAE,cAAc,CAAC,EAC3D,OAAO,GAAE,cAAmB,GAC1B,MAAM,CAmNR"}
package/out/map-html.js CHANGED
@@ -2,77 +2,31 @@
2
2
  * @copyright Sister Software
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
- *
6
- * Render resolved entities as a standalone map page — the visual complement to {@link toGeoJSON}'s
7
- * QGIS/analyst export. `toMapHTML(featureCollection)` returns one HTML file you open in a
8
- * browser; no server, no build.
9
- *
10
- * It renders on the HOUSE stack: MapLibre GL + a Protomaps basemap (`@protomaps/basemaps` generates
11
- * the `layers()` for a named flavor) over the `basemap-v4` vector tiles served from R2 at
12
- * `tiles.mailwoman.ai` — the same basemap the demo uses. Each entity is a circle sized by
13
- * records-merged and colored by cross-dataset-link status (≥2 sources stand out), or
14
- * categorically by `bucket` when the reconciliation output carries one. Pure: GeoJSON in, HTML
15
- * string out (the Protomaps layer specs are generated at this point and inlined). The generated
16
- * page fetches MapLibre, the basemap tiles, and glyphs/sprite over the network when opened (the
17
- * house infra).
18
- *
19
- * SERVE IT OVER LOCALHOST, don't open it as a file. The house tile server (`tiles.mailwoman.ai`)
20
- * CORS-restricts to localhost + the docs domains, so a `file://` page shows the (accurate)
21
- * markers on a blank basemap. `npx serve` / `python3 -m http.server` in the output directory is
22
- * enough; the page also surfaces a hint banner when it detects it's running from `file://`.
23
- *
24
- * Neutral entity-resolution view: it shows what resolved to what and how confidently (cohesion).
25
- * Bucket labels render verbatim from the data, never editorialized.
26
5
  */
6
+ import { stringifyJSON } from "@mailwoman/core/json";
27
7
  import { escapeHTML } from "@mailwoman/core/strings/escape";
28
8
  import { layers, namedFlavor } from "@protomaps/basemaps";
29
- /**
30
- * MapLibre GL release the page pins (CDN + SRI). Matches the workspace's `maplibre-gl` major.
31
- */
32
9
  const MAPLIBRE_VERSION = "5.24.0";
33
10
  const MAPLIBRE_JS_SRI = "sha384-5+cfbwT0iiub6VsQAdn6yz16nr6sDiQoHx6tm4O8OVYXHYOxcffFmCJBL0dgdvGp";
34
11
  const MAPLIBRE_CSS_SRI = "sha384-uTttxo/aOKbdE5RlD/SPzSDoDmNvGlUYPjONi2MN/b7c9HPSvW07OIuyP7uL6jxK";
35
- /**
36
- * The house Protomaps basemap: `basemap-v4` PMTiles (tile-worker → R2 at `tiles.mailwoman.ai`, which sends CORS for
37
- * localhost + the docs domains).
38
- *
39
- * Glyphs + sprite come from the UPSTREAM Protomaps assets (GitHub Pages, `ACAO: *`), not the house mirror at
40
- * `public.mailwoman.ai` — that bucket sends no CORS headers, so the mirror can't be fetched cross-origin
41
- * (`cartographer/base/composition.ts` flags the same: "Currently upstream URLs; we mirror these … but no public route
42
- * fronts that bucket yet"). The upstream assets target the v4 schema, matching the `basemap-v4` tiles. Swap to the
43
- * house mirror once it has a CORS-enabled route.
44
- */
45
12
  const BASEMAP_SOURCE_ID = "basemap-v4";
46
13
  const BASEMAP_TILEJSON_URL = "https://tiles.mailwoman.ai/basemap-v4.json";
47
- const GLYPHS_URL = "https://protomaps.github.io/basemaps-assets/fonts/{fontstack}/{range}.pbf";
14
+ // The glyph mirror and its Bliss Pro stacks, as `@mailwoman/cartographer/styles/fonts` documents them.
15
+ const GLYPHS_URL = "https://public.mailwoman.ai/protomaps/fonts/{fontstack}/{range}.pbf";
16
+ const MAP_FONTS = { regular: "Bliss Pro Regular", bold: "Bliss Pro Medium", italic: "Bliss Pro Italic" };
48
17
  const SPRITE_URL = "https://protomaps.github.io/basemaps-assets/sprites/v4/light";
49
- /**
50
- * Categorical palette (reused for buckets; cycles if there are more buckets than entries).
51
- */
52
18
  const PALETTE = ["#2f9e44", "#f08c00", "#1971c2", "#e8590c", "#9c36b5", "#0c8599", "#e03131", "#5c940d"];
53
- /**
54
- * Single-source entity.
55
- */
56
19
  const SINGLE_COLOR = "#3388ff";
57
- /**
58
- * Cross-dataset link (≥2 sources)
59
- */
60
20
  const CROSS_COLOR = "#e8590c";
61
- /**
62
- * Escape a value for safe inlining inside a `<script>` as JSON. `JSON.stringify` alone isn't enough — a record value
63
- * containing `</script>` would close the block early; escaping `<`/`>`/`&` to `\uXXXX` keeps the JSON valid and makes a
64
- * breakout impossible.
65
- */
66
21
  function safeJSONForScript(value) {
67
- return JSON.stringify(value).replaceAll("<", "\\u003c").replaceAll(">", "\\u003e").replaceAll("&", "\\u0026");
22
+ return stringifyJSON(value).replaceAll("<", "\\u003c").replaceAll(">", "\\u003e").replaceAll("&", "\\u0026");
68
23
  }
69
24
  function sourceCount(props) {
70
25
  return Array.isArray(props["sources"]) ? props["sources"].length : 0;
71
26
  }
72
27
  /**
73
- * Render `geojson` (a {@link toGeoJSON} / reconciliation FeatureCollection) as a complete, standalone HTML document.
74
- * Entities without a coordinate are already absent from those collections; an empty collection renders a friendly empty
75
- * state rather than a broken map.
28
+ * Renders a {@link toGeoJSON} or reconciliation feature collection as a standalone MapLibre
29
+ * HTML document, with an empty-state panel when the collection has no features.
76
30
  */
77
31
  export function toMapHTML(geojson, options = {}) {
78
32
  const title = options.title ?? "Mailwoman — resolved entities";
@@ -80,7 +34,6 @@ export function toMapHTML(geojson, options = {}) {
80
34
  const colorBy = options.colorBy ?? "auto";
81
35
  const hasBuckets = geojson.features.some((f) => f.properties?.["bucket"] != null);
82
36
  const mode = colorBy === "auto" ? (hasBuckets ? "bucket" : "sources") : colorBy;
83
- // Assign a color to each distinct bucket value, in first-seen order.
84
37
  const bucketColors = {};
85
38
  if (mode === "bucket") {
86
39
  let i = 0;
@@ -98,8 +51,6 @@ export function toMapHTML(geojson, options = {}) {
98
51
  }
99
52
  return sourceCount(props) >= 2 ? CROSS_COLOR : SINGLE_COLOR;
100
53
  };
101
- // Precompute the per-feature color (`_color`) so the circle layer is a simple `["get","_color"]`,
102
- // and the bounding box, both at generate time. The data is copied (not mutated in place).
103
54
  let minLng = Infinity;
104
55
  let minLat = Infinity;
105
56
  let maxLng = -Infinity;
@@ -121,8 +72,6 @@ export function toMapHTML(geojson, options = {}) {
121
72
  return { ...f, properties: { ...f.properties, _color: colorFor(f.properties) } };
122
73
  });
123
74
  const bbox = features.length ? [[minLng, minLat], [maxLng, maxLat]] : null;
124
- // The full MapLibre style: the Protomaps basemap layers (generated here) over the house basemap-v4
125
- // vector source, plus our inlined entities source + a circle layer keyed off the precomputed color.
126
75
  const style = {
127
76
  version: 8,
128
77
  glyphs: GLYPHS_URL,
@@ -132,7 +81,7 @@ export function toMapHTML(geojson, options = {}) {
132
81
  entities: { type: "geojson", data: { type: "FeatureCollection", features } },
133
82
  },
134
83
  layers: [
135
- ...layers(BASEMAP_SOURCE_ID, namedFlavor(flavorName), { lang: "en" }),
84
+ ...layers(BASEMAP_SOURCE_ID, { ...namedFlavor(flavorName), ...MAP_FONTS }, { lang: "en" }),
136
85
  {
137
86
  id: "mw-entities",
138
87
  type: "circle",
@@ -159,7 +108,6 @@ export function toMapHTML(geojson, options = {}) {
159
108
  },
160
109
  ],
161
110
  };
162
- // Legend rows, built here so arbitrary bucket sets render without client-side guessing.
163
111
  const legendRows = mode === "bucket"
164
112
  ? Object.entries(bucketColors)
165
113
  .map(([b, c]) => `<div><i style="background:${c}"></i>${escapeHTML(b)}</div>`)
@@ -169,7 +117,6 @@ export function toMapHTML(geojson, options = {}) {
169
117
  `<div class="muted" style="margin-top:4px">marker size = records merged</div>`;
170
118
  const crossLinks = geojson.features.filter((f) => sourceCount(f.properties) >= 2).length;
171
119
  const summary = `${geojson.features.length} entities` + (mode === "sources" ? ` &middot; ${crossLinks} cross-dataset links` : "");
172
- // The client script avoids template literals and `${` so it survives this outer template verbatim.
173
120
  return `<!doctype html>
174
121
  <html lang="en">
175
122
  <head>
@@ -254,7 +201,7 @@ map.on("click", "mw-entities", function (e) {
254
201
  map.on("mouseenter", "mw-entities", function () { map.getCanvas().style.cursor = "pointer"; });
255
202
  map.on("mouseleave", "mw-entities", function () { map.getCanvas().style.cursor = ""; });
256
203
 
257
- // The house basemap tiles are CORS-restricted to localhost + the docs domain, so a page opened
204
+ // The house basemap tiles are cors-restricted to localhost + the docs domain, so a page opened
258
205
  // straight off disk (file://) shows the markers on a blank basemap. Make that explicit rather than
259
206
  // silent — the entity positions are correct regardless of whether the basemap paints.
260
207
  if (location.protocol === "file:") {
@@ -1 +1 @@
1
- {"version":3,"file":"map-html.js","sourceRoot":"","sources":["../lib/map-html.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AAE3D,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAIzD;;GAEG;AACH,MAAM,gBAAgB,GAAG,QAAQ,CAAA;AACjC,MAAM,eAA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C,MAAM,WAAW,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,aAAa,UAAU,sBAAsB,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;IAElH,OAAO;;;;;SAKC,UAAU,CAAC,KAAK,CAAC;;;uCAGa,gBAAgB;cACzC,gBAAgB;;;;;;;;;;;;;;;;;4BAiBF,WAAW;;;;;;;;qCAQF,UAAU,CAAC,KAAK,CAAC,2BAA2B,OAAO;EACtF,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,mCAAmC,UAAU,QAAQ,CAAC,CAAC,CAAC,mDAAmD,UAAU,CAAC,KAAK,CAAC,4EAA4E;;sCAEtL,gBAAgB;cACxC,eAAe;;;;cAIf,iBAAiB,CAAC,KAAK,CAAC;aACzB,iBAAiB,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuDnC,CAAA;AACD,CAAC"}
@@ -3,14 +3,14 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * The CROSS-SOURCE link scorer (#655 option 2) — trained on NPI-joined NPPES ↔ Open Payments
7
- * pairs (the non-circular cross-registry anchor; both public domain). Scores "same provider,
8
- * different registry text" links the dedup GBT rejects by construction. Generated by
9
- * scripts/eval/record-matcher/train-cross-gbt.ts — retrain + re-run rather than editing.
6
+ * The cross-source link scorer, trained on NPI-joined NPPES ↔ Open Payments pairs (the
7
+ * non-circular cross-registry anchor, both public domain). Scores "same provider, different
8
+ * registry text" links the dedup GBT rejects by construction. Generated by
9
+ * scripts/eval/record-matcher/train-cross-gbt.ts. Retrain and re-run rather than editing.
10
10
  */
11
11
  import type { GBT } from "@mailwoman/match";
12
12
  /**
13
- * Training provenance for {@link CROSS_SOURCE_GBT_MODEL} — seed, split and scores.
13
+ * Metadata records the training provenance for {@link CROSS_SOURCE_GBT_MODEL}: seed, split and scores.
14
14
  */
15
15
  export declare const CROSS_SOURCE_GBT_META: {
16
16
  readonly version: "1.0.0";
@@ -36,8 +36,10 @@ export declare const CROSS_SOURCE_GBT_META: {
36
36
  readonly sources: readonly ["nppes", "openpayments"];
37
37
  };
38
38
  /**
39
- * Gradient-boosted trees scoring PERSON matches across sources. Generated by `registry/tools/train-cross-gbt.ts`; do
40
- * not hand-edit.
39
+ * Gradient-boosted trees scoring person matches across sources.
40
+ *
41
+ * Generated by `registry/tools/train-cross-gbt.ts`.
42
+ * Do not hand-edit.
41
43
  */
42
44
  export declare const CROSS_SOURCE_GBT_MODEL: GBT;
43
45
  //# sourceMappingURL=crosssource-gbt-en-us.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"crosssource-gbt-en-us.d.ts","sourceRoot":"","sources":["../../lib/models/crosssource-gbt-en-us.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAA;AAE3C;;GAEG;AACH,eAAO,MAAM,qBAAqB;aACjC,OAAO,EAAE,OAAO;aAChB,SAAS,EAAE,mBAAmB;aAC9B,MAAM,EAAE,OAAO;aACf,SAAS,EAAE,YAAY;aACvB,KAAK,EAAE,IAAI;aACX,IAAI,EAAE,IAAI;aACV,OAAO,EAAE,IAAI;aACb,KAAK,EAAE,MAAO;aACd,OAAO,EAAE,MAAM;aACf,YAAY,EAAE,IAAI;aAClB,gBAAgB,EAAE,CAAC;aACnB,YAAY,EAAE,MAAM;aACpB,WAAW;iBAAI,MAAM,EAAE,GAAG;iBAAE,KAAK,EAAE,CAAC;iBAAE,EAAE,EAAE,GAAG;iBAAE,OAAO,EAAE,EAAE;;aAC1D,oBAAoB,EAAE,CAAC,MAAM;aAC7B,QAAQ,EAAE,EAAE;aACZ,OAAO,YAAG,OAAO,EAAE,cAAc;CACxB,CAAA;AAGV;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,GAA6l5C,CAAA"}
1
+ {"version":3,"file":"crosssource-gbt-en-us.d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