@mailwoman/registry 10.0.0 → 10.2.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 (231) hide show
  1. package/README.md +11 -14
  2. package/lib/address-key.ts +14 -10
  3. package/lib/geocode-handler.ts +7 -5
  4. package/lib/geojson.ts +13 -7
  5. package/lib/ingest.ts +70 -92
  6. package/lib/learned-scorer.ts +38 -44
  7. package/lib/map-html.ts +26 -72
  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 -54
  12. package/lib/resolve.ts +187 -130
  13. package/lib/types.ts +35 -29
  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 +7 -5
  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 -7
  25. package/out/geojson.js.map +1 -1
  26. package/out/ingest.d.ts +49 -76
  27. package/out/ingest.d.ts.map +1 -1
  28. package/out/ingest.js +37 -62
  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 +11 -64
  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 +36 -50
  51. package/out/reconcile.d.ts.map +1 -1
  52. package/out/reconcile.js +18 -42
  53. package/out/reconcile.js.map +1 -1
  54. package/out/resolve.d.ts +152 -91
  55. package/out/resolve.d.ts.map +1 -1
  56. package/out/resolve.js +67 -68
  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 +23 -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 +25 -16
  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 +26 -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 +22 -41
  107. package/out/tools/nppes/dedup-benchmark.d.ts.map +1 -1
  108. package/out/tools/nppes/dedup-benchmark.js +21 -67
  109. package/out/tools/nppes/dedup-benchmark.js.map +1 -1
  110. package/out/tools/nppes/org-name.d.ts +5 -11
  111. package/out/tools/nppes/org-name.d.ts.map +1 -1
  112. package/out/tools/nppes/org-name.js +2 -9
  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 +6 -7
  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 +29 -18
  123. package/out/tools/nppes/sample.d.ts.map +1 -1
  124. package/out/tools/nppes/sample.js +24 -28
  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 +68 -72
  139. package/out/tools/shared.d.ts.map +1 -1
  140. package/out/tools/shared.js +50 -67
  141. package/out/tools/shared.js.map +1 -1
  142. package/out/tools/train/cross-gbt.d.ts +37 -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 +38 -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 +11 -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 +35 -29
  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 +42 -185
  191. package/{lib/tools → tools}/coverage-reconciliation.ts +27 -30
  192. package/{lib/tools → tools}/cross/dataset-correlation.ts +35 -73
  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 +77 -0
  196. package/{lib/tools → tools}/geocoder/namesake-probe.ts +9 -8
  197. package/{lib/tools → tools}/geocoder/vs-provided-coords.ts +40 -31
  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 +39 -78
  202. package/{lib/tools → tools}/matcher-scale.ts +21 -33
  203. package/{lib/tools → tools}/nppes/dedup-benchmark.ts +39 -83
  204. package/tools/nppes/org-name.ts +15 -0
  205. package/{lib/tools → tools}/nppes/overmerge-packet.ts +16 -12
  206. package/{lib/tools → tools}/nppes/report.ts +32 -25
  207. package/{lib/tools → tools}/nppes/sample.ts +43 -38
  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 +79 -98
  212. package/{lib/tools → tools}/train/cross-gbt.ts +39 -34
  213. package/{lib/tools → tools}/train/gbt.ts +55 -41
  214. package/{lib/tools → tools}/train/org-cross-gbt.ts +40 -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 +29 -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/lib/tools/nppes/org-name.ts +0 -23
  226. package/out/tools/index.d.ts +0 -31
  227. package/out/tools/index.d.ts.map +0 -1
  228. package/out/tools/index.js +0 -31
  229. package/out/tools/index.js.map +0 -1
  230. package/out/tools/viz/render/index.d.ts.map +0 -1
  231. package/out/tools/viz/render/index.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mailwoman/registry",
3
- "version": "10.0.0",
3
+ "version": "10.2.0",
4
4
  "description": "The geocode-first record-matching application: resolve messy contact/organization records into canonical, geocoded entities (block → score → cluster) and export them as GeoJSON for spatial analysis. The clinic-funding use case mailwoman was built for.",
5
5
  "license": "AGPL-3.0-only OR LicenseRef-Commercial",
6
6
  "repository": {
@@ -13,19 +13,20 @@
13
13
  "out/**/*.js.map",
14
14
  "out/**/*.d.ts",
15
15
  "out/**/*.d.ts.map",
16
- "*.ts",
17
- "*.tsx",
18
- "**/*.ts",
19
- "**/*.tsx",
20
- "!*.test.ts",
21
- "!*.test.tsx",
16
+ "lib/**/*.ts",
17
+ "lib/**/*.tsx",
18
+ "tools/**/*.ts",
22
19
  "!**/*.test.ts",
23
- "!**/*.test.tsx",
24
- "!test/**"
20
+ "!**/*.test.tsx"
25
21
  ],
26
22
  "type": "module",
27
23
  "sideEffects": false,
28
24
  "imports": {
25
+ "#tools/*": {
26
+ "types": "./out/tools/*.d.ts",
27
+ "node": "./out/tools/*.js",
28
+ "default": "./out/tools/*.js"
29
+ },
29
30
  "#index": {
30
31
  "types": "./out/index.d.ts",
31
32
  "node": "./out/index.js",
@@ -44,90 +45,15 @@
44
45
  "node": "./out/index.js",
45
46
  "default": "./out/index.js"
46
47
  },
47
- "./resolve": {
48
- "types": "./out/resolve.d.ts",
49
- "node": "./out/resolve.js",
50
- "default": "./out/resolve.js"
51
- },
52
- "./geojson": {
53
- "types": "./out/geojson.d.ts",
54
- "node": "./out/geojson.js",
55
- "default": "./out/geojson.js"
56
- },
57
- "./ingest": {
58
- "types": "./out/ingest.d.ts",
59
- "node": "./out/ingest.js",
60
- "default": "./out/ingest.js"
61
- },
62
- "./tools": {
63
- "types": "./out/tools/index.d.ts",
64
- "node": "./out/tools/index.js",
65
- "default": "./out/tools/index.js"
66
- },
67
- "./address-key": {
68
- "types": "./out/address-key.d.ts",
69
- "node": "./out/address-key.js",
70
- "default": "./out/address-key.js"
71
- },
72
- "./types": {
73
- "types": "./out/types.d.ts",
74
- "node": "./out/types.js",
75
- "default": "./out/types.js"
76
- },
77
- "./geocode-handler": {
78
- "types": "./out/geocode-handler.d.ts",
79
- "node": "./out/geocode-handler.js",
80
- "default": "./out/geocode-handler.js"
81
- },
82
- "./learned-scorer": {
83
- "types": "./out/learned-scorer.d.ts",
84
- "node": "./out/learned-scorer.js",
85
- "default": "./out/learned-scorer.js"
86
- },
87
- "./map-html": {
88
- "types": "./out/map-html.d.ts",
89
- "node": "./out/map-html.js",
90
- "default": "./out/map-html.js"
91
- },
92
- "./reconcile": {
93
- "types": "./out/reconcile.d.ts",
94
- "node": "./out/reconcile.js",
95
- "default": "./out/reconcile.js"
48
+ "./tools/*": {
49
+ "types": "./out/tools/*.d.ts",
50
+ "node": "./out/tools/*.js",
51
+ "default": "./out/tools/*.js"
96
52
  },
97
- "./tools/nppes/org-name": {
98
- "types": "./out/tools/nppes/org-name.d.ts",
99
- "node": "./out/tools/nppes/org-name.js",
100
- "default": "./out/tools/nppes/org-name.js"
101
- },
102
- "./tools/nppes/overmerge-packet": {
103
- "types": "./out/tools/nppes/overmerge-packet.d.ts",
104
- "node": "./out/tools/nppes/overmerge-packet.js",
105
- "default": "./out/tools/nppes/overmerge-packet.js"
106
- },
107
- "./tools/nppes/report": {
108
- "types": "./out/tools/nppes/report.d.ts",
109
- "node": "./out/tools/nppes/report.js",
110
- "default": "./out/tools/nppes/report.js"
111
- },
112
- "./tools/nppes/sample": {
113
- "types": "./out/tools/nppes/sample.d.ts",
114
- "node": "./out/tools/nppes/sample.js",
115
- "default": "./out/tools/nppes/sample.js"
116
- },
117
- "./tools/nppes/scoring": {
118
- "types": "./out/tools/nppes/scoring.d.ts",
119
- "node": "./out/tools/nppes/scoring.js",
120
- "default": "./out/tools/nppes/scoring.js"
121
- },
122
- "./tools/nppes/settings": {
123
- "types": "./out/tools/nppes/settings.d.ts",
124
- "node": "./out/tools/nppes/settings.js",
125
- "default": "./out/tools/nppes/settings.js"
126
- },
127
- "./tools/nppes/truth-grains": {
128
- "types": "./out/tools/nppes/truth-grains.d.ts",
129
- "node": "./out/tools/nppes/truth-grains.js",
130
- "default": "./out/tools/nppes/truth-grains.js"
53
+ "./*": {
54
+ "types": "./out/*.d.ts",
55
+ "node": "./out/*.js",
56
+ "default": "./out/*.js"
131
57
  }
132
58
  },
133
59
  "publishConfig": {
@@ -139,93 +65,23 @@
139
65
  "node": "./out/index.js",
140
66
  "default": "./out/index.js"
141
67
  },
142
- "./resolve": {
143
- "types": "./out/resolve.d.ts",
144
- "node": "./out/resolve.js",
145
- "default": "./out/resolve.js"
68
+ "./tools/*": {
69
+ "types": "./out/tools/*.d.ts",
70
+ "node": "./out/tools/*.js",
71
+ "default": "./out/tools/*.js"
146
72
  },
147
- "./geojson": {
148
- "types": "./out/geojson.d.ts",
149
- "node": "./out/geojson.js",
150
- "default": "./out/geojson.js"
151
- },
152
- "./ingest": {
153
- "types": "./out/ingest.d.ts",
154
- "node": "./out/ingest.js",
155
- "default": "./out/ingest.js"
156
- },
157
- "./tools": {
158
- "types": "./out/tools/index.d.ts",
159
- "node": "./out/tools/index.js",
160
- "default": "./out/tools/index.js"
161
- },
162
- "./address-key": {
163
- "types": "./out/address-key.d.ts",
164
- "node": "./out/address-key.js",
165
- "default": "./out/address-key.js"
166
- },
167
- "./types": {
168
- "types": "./out/types.d.ts",
169
- "node": "./out/types.js",
170
- "default": "./out/types.js"
171
- },
172
- "./geocode-handler": {
173
- "types": "./out/geocode-handler.d.ts",
174
- "node": "./out/geocode-handler.js",
175
- "default": "./out/geocode-handler.js"
176
- },
177
- "./learned-scorer": {
178
- "types": "./out/learned-scorer.d.ts",
179
- "node": "./out/learned-scorer.js",
180
- "default": "./out/learned-scorer.js"
181
- },
182
- "./map-html": {
183
- "types": "./out/map-html.d.ts",
184
- "node": "./out/map-html.js",
185
- "default": "./out/map-html.js"
186
- },
187
- "./reconcile": {
188
- "types": "./out/reconcile.d.ts",
189
- "node": "./out/reconcile.js",
190
- "default": "./out/reconcile.js"
191
- },
192
- "./tools/nppes/org-name": {
193
- "types": "./out/tools/nppes/org-name.d.ts",
194
- "node": "./out/tools/nppes/org-name.js",
195
- "default": "./out/tools/nppes/org-name.js"
196
- },
197
- "./tools/nppes/overmerge-packet": {
198
- "types": "./out/tools/nppes/overmerge-packet.d.ts",
199
- "node": "./out/tools/nppes/overmerge-packet.js",
200
- "default": "./out/tools/nppes/overmerge-packet.js"
201
- },
202
- "./tools/nppes/report": {
203
- "types": "./out/tools/nppes/report.d.ts",
204
- "node": "./out/tools/nppes/report.js",
205
- "default": "./out/tools/nppes/report.js"
206
- },
207
- "./tools/nppes/sample": {
208
- "types": "./out/tools/nppes/sample.d.ts",
209
- "node": "./out/tools/nppes/sample.js",
210
- "default": "./out/tools/nppes/sample.js"
211
- },
212
- "./tools/nppes/scoring": {
213
- "types": "./out/tools/nppes/scoring.d.ts",
214
- "node": "./out/tools/nppes/scoring.js",
215
- "default": "./out/tools/nppes/scoring.js"
216
- },
217
- "./tools/nppes/settings": {
218
- "types": "./out/tools/nppes/settings.d.ts",
219
- "node": "./out/tools/nppes/settings.js",
220
- "default": "./out/tools/nppes/settings.js"
221
- },
222
- "./tools/nppes/truth-grains": {
223
- "types": "./out/tools/nppes/truth-grains.d.ts",
224
- "node": "./out/tools/nppes/truth-grains.js",
225
- "default": "./out/tools/nppes/truth-grains.js"
73
+ "./*": {
74
+ "types": "./out/*.d.ts",
75
+ "node": "./out/*.js",
76
+ "default": "./out/*.js"
226
77
  }
227
78
  },
228
79
  "imports": {
80
+ "#tools/*": {
81
+ "types": "./out/tools/*.d.ts",
82
+ "node": "./out/tools/*.js",
83
+ "default": "./out/tools/*.js"
84
+ },
229
85
  "#index": {
230
86
  "types": "./out/index.d.ts",
231
87
  "node": "./out/index.js",
@@ -239,20 +95,21 @@
239
95
  }
240
96
  },
241
97
  "dependencies": {
242
- "@mailwoman/address-id": "10.0.0",
243
- "@mailwoman/core": "10.0.0",
244
- "@mailwoman/match": "10.0.0",
245
- "@mailwoman/record": "10.0.0",
246
- "@mailwoman/resolver-wof-sqlite": "10.0.0",
247
- "@mailwoman/spatial": "10.0.0",
248
- "@mailwoman/sqlite": "10.0.0",
98
+ "@mailwoman/address-id": "10.2.0",
99
+ "@mailwoman/annotations": "10.2.0",
100
+ "@mailwoman/core": "10.2.0",
101
+ "@mailwoman/match": "10.2.0",
102
+ "@mailwoman/record": "10.2.0",
103
+ "@mailwoman/resolver-wof-sqlite": "10.2.0",
104
+ "@mailwoman/spatial": "10.2.0",
105
+ "@mailwoman/sqlite": "10.2.0",
249
106
  "@protomaps/basemaps": "^5.7.2",
250
107
  "h3-js": "^4.5.0",
251
- "spliterator": "^7.5.1"
108
+ "spliterator": "^9.2.0"
252
109
  },
253
110
  "devDependencies": {
254
- "@types/node": "^26.4.1",
255
- "path-ts": "^2.3.0",
111
+ "@types/node": "^26.6.4",
112
+ "path-ts": "^2.5.0",
256
113
  "playwright": "^1.63.0"
257
114
  }
258
115
  }
@@ -3,27 +3,18 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * Coverage reconciliation (#621) — THE PRODUCT OUTPUT: what replaces inspecting the map by eye.
6
+ * Coverage reconciliation, the product output that replaces inspecting the map by eye.
7
7
  *
8
- * Over the entities resolved across sources (#618), classify each by which KIND of source its
9
- * records come from:
8
+ * Each resolved entity is classified by the kind of source its records come from. An eligibility
9
+ * source holds providers and facilities, such as NPPES org NPIs or TX HHSC nursing facilities. A
10
+ * funding source holds entities enrolled in a funding program, such as FCC Rural Health Care
11
+ * filings.
10
12
  *
11
- * - **eligibility** sources — entities that exist as providers / facilities: NPPES org NPIs, TX HHSC
12
- * nursing facilities.
13
- * - **funding** source — entities enrolled in a funding program: FCC Rural Health Care filings.
13
+ * The buckets are enrolled (both an eligibility and a funding record), eligible rather than
14
+ * enrolled (an eligibility record with no funding record resolving to it), and funded rather than
15
+ * in the eligibility set (a funding record with no eligibility record resolving to it).
14
16
  *
15
- * Three buckets fall out:
16
- *
17
- * - **enrolled** — resolves to BOTH an eligibility and a funding record.
18
- * - **eligible, not enrolled** — an eligibility record with NO funding record resolving to it (the
19
- * ANTI-JOIN: the set you currently find by eye).
20
- * - **funded, not in the eligibility set** — a funding record with no eligibility record resolving to
21
- * it.
22
- *
23
- * Output: GeoJSON (drops on the same map) + a table, each entity tagged with its bucket + source
24
- * memberships. We produce the reconciled join; what a gap MEANS — and whether it's real or a
25
- * sampling artifact — is the consumer's call, not ours. This is strictly a set-membership
26
- * reconciliation, never an allegation.
17
+ * This is strictly a set-membership reconciliation, never an allegation.
27
18
  *
28
19
  * Run: `mailwoman registry scorer-eval coverage-reconciliation [--cap 2000] [--wof <admin.db>]
29
20
  * [--data-root <dir>] [--out-md <md>] [--out-geojson <geojson>]`
@@ -51,19 +42,27 @@ import { buildSpecs, stateOption } from "#tools/shared"
51
42
  */
52
43
  export interface CoverageReconciliationOptions {
53
44
  /**
54
- * The injected geocoder factory (the command wires `mailwoman/geocode-core`; see `./eval-geocoder.ts`).
45
+ * The injected geocoder factory.
46
+ *
47
+ * The command wires `mailwoman/geocode-core`, as `./eval-geocoder.ts` does.
55
48
  */
56
49
  createGeocoder: EvalGeocoderFactory
57
50
  /**
58
- * Record-matcher sources directory. Default `$MAILWOMAN_DATA_ROOT/record-matcher/sources`.
51
+ * Record-matcher sources directory.
52
+ *
53
+ * @defaultValue `$MAILWOMAN_DATA_ROOT/record-matcher/sources`
59
54
  */
60
55
  sources?: string
61
56
  /**
62
- * Rows kept per source. Default 2000.
57
+ * Rows kept per source.
58
+ *
59
+ * @defaultValue `2000`
63
60
  */
64
61
  cap?: number
65
62
  /**
66
- * State filter. Default TX.
63
+ * State filter.
64
+ *
65
+ * @defaultValue TX.
67
66
  */
68
67
  state?: string
69
68
  /**
@@ -83,7 +82,8 @@ const ELIGIBILITY = new Set(["nppes", "txhhsc-nursing"])
83
82
  const FUNDING = new Set(["fcc-rhc"])
84
83
 
85
84
  /**
86
- * Coverage reconciliation (#621) — see the module doc. Emits the markdown report to stdout.
85
+ * Reconcile eligibility and funding sources.
86
+ * Emit the markdown report to stdout.
87
87
  */
88
88
  export async function coverageReconciliation(
89
89
  options: CoverageReconciliationOptions,
@@ -96,7 +96,6 @@ export async function coverageReconciliation(
96
96
  const OUT_GEOJSON = options.outGeojson || ""
97
97
  const SPECS = buildSpecs(`${SOURCES}`, STATE)
98
98
 
99
- // Ingest every source into one combined, geo-resolved record set.
100
99
  const rawBySource = new Map<string, Record<string, string>[]>()
101
100
 
102
101
  for (const spec of SPECS) {
@@ -120,7 +119,6 @@ export async function coverageReconciliation(
120
119
  let geo = 0
121
120
  let total = 0
122
121
 
123
- // Count placements at the boundary (parity with the retired in-script counter).
124
122
  const geocodeForIngest: GeocodeAddress = async (raw) => {
125
123
  const g = await geocoder.geocodeAddress(raw)
126
124
 
@@ -150,13 +148,12 @@ export async function coverageReconciliation(
150
148
  report?.(` ${records.length} records; geocoded ${geo}/${total} (${((100 * geo) / total).toFixed(1)}%)`)
151
149
 
152
150
  report?.("[D] resolving + reconciling…")
153
- // learnedScorer:false — reconciliation joins eligibility ↔ funding ACROSS datasets (recall-oriented):
154
- // the same facility under different operational names is the signal we want, which the dedup-calibrated
155
- // GBT default rejects (measured: "enrolled" overlap 22→6). Use the FS baseline for this cross-dataset join.
151
+ // Use the Fellegi-Sunter baseline for this cross-dataset join.
152
+ // It is recall-oriented because the signal is the same facility under a different operational name.
153
+ // The dedup-calibrated GBT default rejects that pair.
156
154
  const { entities } = resolveEntities(records, { trainEM: true, collapseSpatial: true, learnedScorer: false })
157
155
 
158
- // Reconcile sources through the shared @mailwoman/registry code path.
159
- // `mailwoman registry --reconcile`, so the script and the CLI can't drift. ---
156
+ // Reconcile through the shared @mailwoman/registry code path, so the script and the CLI agree.
160
157
  const config: ReconcileConfig = { eligibilitySources: [...ELIGIBILITY], fundingSources: [...FUNDING] }
161
158
  const result = reconcileCoverage(entities, config)
162
159
  const geojson = reconciliationGeoJSON(result)
@@ -2,21 +2,6 @@
2
2
  * @copyright Sister Software
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
- *
6
- * Cross-dataset correlation (#618) — the marquee proof: resolve ONE record set across datasets that
7
- * share NO key. NPPES (the national provider registry), FCC Rural Health Care filings, and TX
8
- * HHSC facility registries each describe overlapping physical entities under different names,
9
- * formats, and schemas. Geo-first blocking is what makes resolving them tractable.
10
- *
11
- * We ingest each source under its own {@link ColumnMapping} + a `source` provenance label into ONE
12
- * combined record set, geocode every address through mailwoman's real parser + resolver, resolve
13
- * to canonical entities, and report the entities whose members span ≥2 sources — those are the
14
- * cross-dataset links. We surface the correlation; interpretation is the consumer's.
15
- *
16
- * Tractable slice: TX-scoped, capped per source. Streams the 4.8 GB NPPES registry via `streamRows`.
17
- *
18
- * Run: `mailwoman registry scorer-eval cross-dataset [--cap 300] [--wof <admin.db>]
19
- * [--data-root <dir>] [--out-md docs/articles/evals/matcher-dedup/<date>-...md]`
20
5
  */
21
6
 
22
7
  import { dataRootPath } from "@mailwoman/core/data-root"
@@ -36,9 +21,6 @@ import {
36
21
  import type { EvalGeocoderFactory } from "#tools/eval-geocoder"
37
22
  import { buildSpecs, norm, pct, stateOption, type SourceSpec } from "#tools/shared"
38
23
 
39
- /**
40
- * Distinct sources an entity needs to count toward the triple-corroborated tally.
41
- */
42
24
  const MIN_TRIPLE_SOURCES = 3
43
25
 
44
26
  /**
@@ -46,45 +28,53 @@ const MIN_TRIPLE_SOURCES = 3
46
28
  */
47
29
  export interface CrossDatasetCorrelationOptions {
48
30
  /**
49
- * The injected geocoder factory (the command wires `mailwoman/geocode-core`; see `./eval-geocoder.ts`).
31
+ * Creates the geocoder that resolves the sampled rows.
50
32
  */
51
33
  createGeocoder: EvalGeocoderFactory
34
+
52
35
  /**
53
- * Record-matcher sources directory. Default `$MAILWOMAN_DATA_ROOT/record-matcher/sources`.
36
+ * The record-matcher sources directory.
37
+ *
38
+ * @defaultValue `$MAILWOMAN_DATA_ROOT/record-matcher/sources`
54
39
  */
55
40
  sources?: string
41
+
56
42
  /**
57
- * Rows kept per source for geocoding (state-scoped). Default 300.
43
+ * The number of in-state rows sampled per source for geocoding.
44
+ *
45
+ * @defaultValue `300`
58
46
  */
59
47
  cap?: number
48
+
60
49
  /**
61
- * State filter. Default TX.
50
+ * The state filter.
51
+ *
52
+ * @defaultValue {@linkcode TX}
62
53
  */
63
54
  state?: string
55
+
64
56
  /**
65
- * The inverse-address-frequency change is a CORPUS statistic — it can't be synthesized from the geocoded sample. By
66
- * default we scan the FULL files (cheap, parse-free) for an in-state corpus-wide frequency table and feed it to the
67
- * matcher, so the proven #617 change actually bites on a sub-sampled run. The scan adds a full pass over the 4.8 GB
68
- * NPPES file (~5 min); `--no-corpus-frequency` skips it and falls back to resolveEntities' zero-config input-scoped
69
- * default (#86). Default true.
57
+ * Whether to scan every in-state row to build a corpus-wide address-frequency table.
58
+ *
59
+ * The scan reads the full source files, including the multi-gigabyte NPPES file.
60
+ * When it is false, `resolveEntities` computes frequencies from the sample only.
61
+ *
62
+ * @defaultValue `true`
70
63
  */
71
64
  corpusFrequency?: boolean
65
+
72
66
  /**
73
- * Also write the markdown report here.
67
+ * An optional path for the Markdown report.
74
68
  */
75
69
  outMd?: string
70
+
76
71
  /**
77
- * Also write the entity FeatureCollection here (the reconciliation artifact, QGIS-ready).
72
+ * An optional path for the entity GeoJSON FeatureCollection.
78
73
  */
79
74
  outGeojson?: string
80
75
  }
81
76
 
82
- /**
83
- * Compose a row's address for the corpus-wide frequency table. {@link ingestRows} joins the mapped address columns with
84
- * `", "` (the #694 flip) while this join uses a space — the two agree once `addressFrequencyKey` folds punctuation to
85
- * spaces, so a frequency key built here matches the geocoded record's `address.raw`.
86
- */
87
- function composeAddress(row: Record<string, string>, columns: string | string[] | undefined): string {
77
+ function composeAddress(row: Record<string, string>, columns: string | string[] | null | undefined): string {
88
78
  if (!columns) return ""
89
79
  const list = Array.isArray(columns) ? columns : [columns]
90
80
 
@@ -95,11 +85,6 @@ function composeAddress(row: Record<string, string>, columns: string | string[]
95
85
  .trim()
96
86
  }
97
87
 
98
- /**
99
- * FCC RHC funding commitments — TWO addressable entities per row (a Filing HCP and a Participating HCP), each exploded
100
- * into its own record (the #618 B1 two-entity-per-row case). Composed after the shared {@link buildSpecs} trio, which
101
- * this probe correlates against.
102
- */
103
88
  const commitmentsSpec = (S: string, STATE: string): SourceSpec => ({
104
89
  source: "fcc-rhc-commitments",
105
90
  path: `${S}/fcc-rhc_commitments-disbursements_form462-466-466a_20260615.tsv`,
@@ -138,25 +123,24 @@ const commitmentsSpec = (S: string, STATE: string): SourceSpec => ({
138
123
  })
139
124
 
140
125
  /**
141
- * Cross-dataset correlation (#618) — see the module doc. Emits the markdown report to stdout.
126
+ * Geocodes a sample of each source dataset in one state, resolves the records into entities across sources.
127
+ * It returns a Markdown report of the cross-source links.
128
+ *
129
+ * Progress lines go to `report`.
130
+ * The function also writes the report and GeoJSON when `outMd` or `outGeojson` is set.
142
131
  */
143
132
  export async function crossDatasetCorrelation(
144
133
  options: CrossDatasetCorrelationOptions,
145
134
  report?: (line: string) => void
146
135
  ): Promise<{ markdown: string }> {
147
136
  const SOURCES = options.sources || dataRootPath("record-matcher", "sources")
148
- const CAP = options.cap ?? 300 // rows kept per source for geocoding (state-scoped)
137
+ const CAP = options.cap ?? 300
149
138
  const STATE = stateOption(options)
150
139
  const OUT_MD = options.outMd || ""
151
- const OUT_GEOJSON = options.outGeojson || "" // the reconciliation artifact (FeatureCollection, QGIS-ready)
140
+ const OUT_GEOJSON = options.outGeojson || ""
152
141
  const CORPUS_FREQ = options.corpusFrequency ?? true
153
142
  const SPECS = [...buildSpecs(`${SOURCES}`, STATE), commitmentsSpec(`${SOURCES}`, STATE)]
154
143
 
155
- // Stream each source, filter Texas rows, and retain the first capped rows for geocoding.
156
- // (when --corpus-frequency, the default) count EVERY in-state address into a corpus-wide table. The
157
- // sample is the matched set; the frequency table reflects the full TX population, so the proven
158
- // inverse-frequency change down-weights a genuinely-crowded shared campus even when it appears once in
159
- // the geocoded sample. ---
160
144
  const rawBySource = new Map<string, Record<string, string>[]>()
161
145
  const addrCounts = new Map<string, number>()
162
146
  let addrTotal = 0
@@ -186,7 +170,6 @@ export async function crossDatasetCorrelation(
186
170
  }
187
171
  }
188
172
 
189
- // Stop early only when we DON'T need the full frequency pass (otherwise scan to EOF).
190
173
  if (!CORPUS_FREQ && kept.length >= CAP) break
191
174
  }
192
175
 
@@ -194,7 +177,6 @@ export async function crossDatasetCorrelation(
194
177
  report?.(` ${spec.source}: ${kept.length} sampled`)
195
178
  }
196
179
 
197
- // The in-state corpus-wide address-frequency table (the #617 change, fed to the matcher below).
198
180
  const addressFrequency = CORPUS_FREQ
199
181
  ? {
200
182
  total: addrTotal,
@@ -207,14 +189,12 @@ export async function crossDatasetCorrelation(
207
189
  report?.(` address-frequency table: ${addrCounts.size} distinct over ${addrTotal} ${STATE} addresses`)
208
190
  }
209
191
 
210
- // Construct the injected geocoder used by this evaluation.
211
192
  report?.("[B] building the geocoder…")
212
193
  const geocoder = await options.createGeocoder()
213
194
 
214
195
  let geo = 0
215
196
  let total = 0
216
197
 
217
- // Count placements at the boundary (parity with the retired in-script counter).
218
198
  const geocodeForIngest: GeocodeAddress = async (raw) => {
219
199
  const g = await geocoder.geocodeAddress(raw)
220
200
 
@@ -227,14 +207,12 @@ export async function crossDatasetCorrelation(
227
207
  return g
228
208
  }
229
209
 
230
- // Ingest each mapped source into one combined labeled record set.
231
210
  report?.("[C] geocoding + ingesting all sources…")
232
211
  const records: SourceRecord[] = []
233
212
 
234
213
  for (const spec of SPECS) {
235
214
  const rows = rawBySource.get(spec.source)!
236
- // Per-source geocode-rate snapshot (#694 diagnostic): the boundary counters are global, so delta
237
- // them across each source to see WHERE nulls concentrate in the aggregate run.
215
+
238
216
  const g0 = geo
239
217
  const t0 = total
240
218
  const recs = await ingestRows(rows, spec.mapping, { geocodeAddress: geocodeForIngest })
@@ -242,7 +220,6 @@ export async function crossDatasetCorrelation(
242
220
  const dt = total - t0
243
221
  report?.(` ${spec.source}: geocoded ${dg}/${dt} (${dt ? ((100 * dg) / dt).toFixed(1) : "0"}%)`)
244
222
 
245
- // Namespace ids by source so cross-source ids never collide.
246
223
  for (const r of recs) {
247
224
  r.id = `${spec.source}:${r.id}`
248
225
  }
@@ -253,24 +230,14 @@ export async function crossDatasetCorrelation(
253
230
  geocoder[Symbol.dispose]()
254
231
  report?.(` ${records.length} records; geocoded ${geo}/${total} (${((100 * geo) / total).toFixed(1)}%)`)
255
232
 
256
- // Resolve records to canonical entities using the default-on proven changes.
257
- // spatial (A1) + inverse-address-frequency. We feed the corpus-wide table when we built one; otherwise
258
- // resolveEntities auto-computes the input-scoped default. ---
259
233
  report?.("[D] resolving across sources…")
260
234
 
261
- // learnedScorer:false — the GBT default is calibrated for same-dataset DEDUP, where "same address +
262
- // different name" means distinct co-located providers (reject). CROSS-dataset linkage is the opposite
263
- // objective: "same address + different name" is the prototypical signal of the SAME facility under a
264
- // different operational name across sources. The dedup GBT rejects exactly those true cross-source
265
- // links (measured: cross-source 219→166, triple-source 10→1), so this flow uses the recall-appropriate
266
- // FS baseline. (A cross-objective GBT threshold is the documented follow-up — #655.)
267
235
  const { entities, candidatePairs } = resolveEntities(records, {
268
236
  trainEM: true,
269
237
  learnedScorer: false,
270
238
  ...(addressFrequency ? { addressFrequency } : {}),
271
239
  })
272
240
 
273
- // Find entities whose members span at least two distinct sources.
274
241
  const sourceOf = (r: SourceRecord) => r.source ?? "?"
275
242
 
276
243
  const crossSource = entities
@@ -278,7 +245,6 @@ export async function crossDatasetCorrelation(
278
245
  .filter((x) => x.sources.size >= 2)
279
246
  .toSorted((a, b) => b.sources.size - a.sources.size || b.e.records.length - a.e.records.length)
280
247
 
281
- // Source-pair co-occurrence matrix.
282
248
  const pairCounts = new Map<string, number>()
283
249
 
284
250
  for (const { sources } of crossSource) {
@@ -292,7 +258,6 @@ export async function crossDatasetCorrelation(
292
258
  }
293
259
  }
294
260
 
295
- // Report the resulting cross-source correlations.
296
261
  const lines: string[] = [
297
262
  `# Cross-dataset correlation (#618 / #87 real-data run)`,
298
263
  "",
@@ -389,8 +354,8 @@ export async function crossDatasetCorrelation(
389
354
  `${SPECS.length} datasets with no shared key — a provider registry, a federal funding program (two of its forms, ` +
390
355
  `the commitments form exploded into its Filing + Participating HCP per row), and a state facility registry — ` +
391
356
  `resolve into a single entity model where ${crossSource.length} entities are corroborated by ≥2 independent ` +
392
- `sources (${triple} by all three kinds), purely on geocoded location + name/org agreement, in pure Node (no ` +
393
- `Elasticsearch, no server). Each cross-source entity is a candidate "same place, multiple records" surfaced for ` +
357
+ `sources (${triple} by all three kinds), purely on geocoded location + name/org agreement, in pure Node without ` +
358
+ `Elasticsearch or a server. Each cross-source entity is a candidate "same place, multiple records" surfaced for ` +
394
359
  `review; whether a correlation means anything is the data consumer's call, not ours.`
395
360
  )
396
361
 
@@ -405,9 +370,6 @@ export async function crossDatasetCorrelation(
405
370
  report?.(`\n[written] ${OUT_MD}`)
406
371
  }
407
372
 
408
- // Emit a GeoJSON FeatureCollection for every resolved entity.
409
- // carries `sources` + `sourceIDs` (so an analyst filters the cross-dataset links by `sources` length ≥ 2)
410
- // and the geocode tier. QGIS-ready; this is the operator-verifiable output of the matcher. ---
411
373
  if (OUT_GEOJSON) {
412
374
  const fc = toGeoJSON(entities)
413
375
  await writeLocalJSONFile(fc, OUT_GEOJSON)