@mailwoman/registry 10.8.0 → 11.0.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 (399) hide show
  1. package/README.md +93 -98
  2. package/data/manifests/artifacts.json +32 -0
  3. package/data/manifests/coverage.json +56 -0
  4. package/data/manifests/sources.lock.json +48 -0
  5. package/data/normalized/iata-airports.json +126749 -0
  6. package/data/normalized/iso3166-1.json +2035 -0
  7. package/definitions/namespaces.json +63 -0
  8. package/definitions/sections.json +73 -0
  9. package/docs/data-policy.md +81 -0
  10. package/docs/performance.md +146 -0
  11. package/docs/rgy1.md +144 -0
  12. package/lib/artifacts/country-airport-collision.ts +26 -0
  13. package/lib/artifacts/iata-airport/membership.ts +26 -0
  14. package/lib/artifacts/iata-airport/records.ts +26 -0
  15. package/lib/artifacts/iso3166-1/alpha2-membership.ts +26 -0
  16. package/lib/artifacts/iso3166-1/alpha3-membership.ts +26 -0
  17. package/lib/artifacts/iso3166-1/records.ts +26 -0
  18. package/lib/errors.ts +44 -0
  19. package/lib/iata/airports/records.ts +174 -0
  20. package/lib/iata/airports/validate.ts +49 -0
  21. package/lib/index.ts +25 -15
  22. package/lib/inspect.ts +56 -0
  23. package/lib/iso3166/alpha2.ts +48 -0
  24. package/lib/iso3166/alpha3.ts +51 -0
  25. package/lib/iso3166/records.ts +149 -0
  26. package/lib/iso3166/relations.ts +30 -0
  27. package/lib/key.ts +146 -0
  28. package/lib/normalize.ts +31 -0
  29. package/lib/overlap/country-airport.ts +108 -0
  30. package/lib/rgy1/base64.ts +24 -0
  31. package/lib/rgy1/reader.ts +316 -0
  32. package/lib/rgy1/sections.generated.ts +79 -0
  33. package/lib/rgy1/views.ts +267 -0
  34. package/lib/types.ts +88 -74
  35. package/lib/wasm.ts +285 -0
  36. package/out/artifacts/country-airport-collision.d.ts +15 -0
  37. package/out/artifacts/country-airport-collision.d.ts.map +1 -0
  38. package/out/artifacts/country-airport-collision.js +21 -0
  39. package/out/artifacts/country-airport-collision.js.map +1 -0
  40. package/out/artifacts/iata-airport/membership.d.ts +15 -0
  41. package/out/artifacts/iata-airport/membership.d.ts.map +1 -0
  42. package/out/artifacts/iata-airport/membership.js +21 -0
  43. package/out/artifacts/iata-airport/membership.js.map +1 -0
  44. package/out/artifacts/iata-airport/records.d.ts +15 -0
  45. package/out/artifacts/iata-airport/records.d.ts.map +1 -0
  46. package/out/artifacts/iata-airport/records.js +21 -0
  47. package/out/artifacts/iata-airport/records.js.map +1 -0
  48. package/out/artifacts/iso3166-1/alpha2-membership.d.ts +15 -0
  49. package/out/artifacts/iso3166-1/alpha2-membership.d.ts.map +1 -0
  50. package/out/artifacts/iso3166-1/alpha2-membership.js +21 -0
  51. package/out/artifacts/iso3166-1/alpha2-membership.js.map +1 -0
  52. package/out/artifacts/iso3166-1/alpha3-membership.d.ts +15 -0
  53. package/out/artifacts/iso3166-1/alpha3-membership.d.ts.map +1 -0
  54. package/out/artifacts/iso3166-1/alpha3-membership.js +21 -0
  55. package/out/artifacts/iso3166-1/alpha3-membership.js.map +1 -0
  56. package/out/artifacts/iso3166-1/records.d.ts +15 -0
  57. package/out/artifacts/iso3166-1/records.d.ts.map +1 -0
  58. package/out/artifacts/iso3166-1/records.js +21 -0
  59. package/out/artifacts/iso3166-1/records.js.map +1 -0
  60. package/out/errors.d.ts +38 -0
  61. package/out/errors.d.ts.map +1 -0
  62. package/out/errors.js +35 -0
  63. package/out/errors.js.map +1 -0
  64. package/out/iata/airports/records.d.ts +44 -0
  65. package/out/iata/airports/records.d.ts.map +1 -0
  66. package/out/iata/airports/records.js +137 -0
  67. package/out/iata/airports/records.js.map +1 -0
  68. package/out/iata/airports/validate.d.ts +27 -0
  69. package/out/iata/airports/validate.d.ts.map +1 -0
  70. package/out/iata/airports/validate.js +42 -0
  71. package/out/iata/airports/validate.js.map +1 -0
  72. package/out/index.d.ts +19 -15
  73. package/out/index.d.ts.map +1 -1
  74. package/out/index.js +14 -15
  75. package/out/index.js.map +1 -1
  76. package/out/inspect.d.ts +38 -0
  77. package/out/inspect.d.ts.map +1 -0
  78. package/out/inspect.js +33 -0
  79. package/out/inspect.js.map +1 -0
  80. package/out/iso3166/alpha2.d.ts +24 -0
  81. package/out/iso3166/alpha2.d.ts.map +1 -0
  82. package/out/iso3166/alpha2.js +41 -0
  83. package/out/iso3166/alpha2.js.map +1 -0
  84. package/out/iso3166/alpha3.d.ts +29 -0
  85. package/out/iso3166/alpha3.d.ts.map +1 -0
  86. package/out/iso3166/alpha3.js +44 -0
  87. package/out/iso3166/alpha3.js.map +1 -0
  88. package/out/iso3166/records.d.ts +38 -0
  89. package/out/iso3166/records.d.ts.map +1 -0
  90. package/out/iso3166/records.js +105 -0
  91. package/out/iso3166/records.js.map +1 -0
  92. package/out/iso3166/relations.d.ts +20 -0
  93. package/out/iso3166/relations.d.ts.map +1 -0
  94. package/out/iso3166/relations.js +27 -0
  95. package/out/iso3166/relations.js.map +1 -0
  96. package/out/key.d.ts +68 -0
  97. package/out/key.d.ts.map +1 -0
  98. package/out/key.js +122 -0
  99. package/out/key.js.map +1 -0
  100. package/out/normalize.d.ts +25 -0
  101. package/out/normalize.d.ts.map +1 -0
  102. package/out/normalize.js +21 -0
  103. package/out/normalize.js.map +1 -0
  104. package/out/overlap/country-airport.d.ts +57 -0
  105. package/out/overlap/country-airport.d.ts.map +1 -0
  106. package/out/overlap/country-airport.js +71 -0
  107. package/out/overlap/country-airport.js.map +1 -0
  108. package/out/rgy1/base64.d.ts +15 -0
  109. package/out/rgy1/base64.d.ts.map +1 -0
  110. package/out/rgy1/base64.js +22 -0
  111. package/out/rgy1/base64.js.map +1 -0
  112. package/out/rgy1/reader.d.ts +103 -0
  113. package/out/rgy1/reader.d.ts.map +1 -0
  114. package/out/rgy1/reader.js +230 -0
  115. package/out/rgy1/reader.js.map +1 -0
  116. package/out/rgy1/sections.generated.d.ts +54 -0
  117. package/out/rgy1/sections.generated.d.ts.map +1 -0
  118. package/out/rgy1/sections.generated.js +69 -0
  119. package/out/rgy1/sections.generated.js.map +1 -0
  120. package/out/rgy1/views.d.ts +96 -0
  121. package/out/rgy1/views.d.ts.map +1 -0
  122. package/out/rgy1/views.js +218 -0
  123. package/out/rgy1/views.js.map +1 -0
  124. package/out/sdk/fetch.d.ts +53 -0
  125. package/out/sdk/fetch.d.ts.map +1 -0
  126. package/out/sdk/fetch.js +107 -0
  127. package/out/sdk/fetch.js.map +1 -0
  128. package/out/sdk/fetch.run.d.ts +14 -0
  129. package/out/sdk/fetch.run.d.ts.map +1 -0
  130. package/out/sdk/fetch.run.js +20 -0
  131. package/out/sdk/fetch.run.js.map +1 -0
  132. package/out/sdk/sources.d.ts +111 -0
  133. package/out/sdk/sources.d.ts.map +1 -0
  134. package/out/sdk/sources.js +98 -0
  135. package/out/sdk/sources.js.map +1 -0
  136. package/out/tools/artifact-path.d.ts +10 -0
  137. package/out/tools/artifact-path.d.ts.map +1 -0
  138. package/out/tools/artifact-path.js +12 -0
  139. package/out/tools/artifact-path.js.map +1 -0
  140. package/out/tools/bench.run.d.ts +19 -0
  141. package/out/tools/bench.run.d.ts.map +1 -0
  142. package/out/tools/bench.run.js +204 -0
  143. package/out/tools/bench.run.js.map +1 -0
  144. package/out/tools/build-wasm.run.d.ts +18 -0
  145. package/out/tools/build-wasm.run.d.ts.map +1 -0
  146. package/out/tools/build-wasm.run.js +71 -0
  147. package/out/tools/build-wasm.run.js.map +1 -0
  148. package/out/tools/generate-sections.run.d.ts +13 -0
  149. package/out/tools/generate-sections.run.d.ts.map +1 -0
  150. package/out/tools/generate-sections.run.js +136 -0
  151. package/out/tools/generate-sections.run.js.map +1 -0
  152. package/out/tools/generate.run.d.ts +18 -0
  153. package/out/tools/generate.run.d.ts.map +1 -0
  154. package/out/tools/generate.run.js +118 -0
  155. package/out/tools/generate.run.js.map +1 -0
  156. package/out/tools/normalize.d.ts +155 -0
  157. package/out/tools/normalize.d.ts.map +1 -0
  158. package/out/tools/normalize.js +303 -0
  159. package/out/tools/normalize.js.map +1 -0
  160. package/out/tools/normalize.run.d.ts +14 -0
  161. package/out/tools/normalize.run.d.ts.map +1 -0
  162. package/out/tools/normalize.run.js +29 -0
  163. package/out/tools/normalize.run.js.map +1 -0
  164. package/out/types.d.ts +90 -76
  165. package/out/types.d.ts.map +1 -1
  166. package/out/types.js +20 -4
  167. package/out/types.js.map +1 -1
  168. package/out/wasm.d.ts +98 -0
  169. package/out/wasm.d.ts.map +1 -0
  170. package/out/wasm.js +137 -0
  171. package/out/wasm.js.map +1 -0
  172. package/package.json +48 -27
  173. package/sdk/fetch.run.ts +24 -0
  174. package/sdk/fetch.ts +146 -0
  175. package/sdk/sources.ts +162 -0
  176. package/tools/artifact-path.ts +12 -0
  177. package/tools/bench.run.ts +265 -0
  178. package/tools/build-wasm.run.ts +82 -0
  179. package/tools/generate-sections.run.ts +152 -0
  180. package/tools/generate.run.ts +146 -0
  181. package/tools/normalize.run.ts +36 -0
  182. package/tools/normalize.ts +474 -0
  183. package/wasm/registry-simd.wasm +0 -0
  184. package/wasm/registry.wasm +0 -0
  185. package/lib/address-key.ts +0 -46
  186. package/lib/geocode-handler.ts +0 -37
  187. package/lib/geojson.ts +0 -72
  188. package/lib/ingest.ts +0 -349
  189. package/lib/learned-scorer.ts +0 -134
  190. package/lib/map-html.ts +0 -287
  191. package/lib/models/crosssource-gbt-en-us.ts +0 -43
  192. package/lib/models/dedup-gbt-en-us.ts +0 -47
  193. package/lib/models/org-crosssource-gbt-en-us.ts +0 -43
  194. package/lib/reconcile.ts +0 -239
  195. package/lib/resolve.ts +0 -569
  196. package/out/address-key.d.ts +0 -34
  197. package/out/address-key.d.ts.map +0 -1
  198. package/out/address-key.js +0 -41
  199. package/out/address-key.js.map +0 -1
  200. package/out/geocode-handler.d.ts +0 -20
  201. package/out/geocode-handler.d.ts.map +0 -1
  202. package/out/geocode-handler.js +0 -29
  203. package/out/geocode-handler.js.map +0 -1
  204. package/out/geojson.d.ts +0 -28
  205. package/out/geojson.d.ts.map +0 -1
  206. package/out/geojson.js +0 -62
  207. package/out/geojson.js.map +0 -1
  208. package/out/ingest.d.ts +0 -173
  209. package/out/ingest.d.ts.map +0 -1
  210. package/out/ingest.js +0 -185
  211. package/out/ingest.js.map +0 -1
  212. package/out/learned-scorer.d.ts +0 -61
  213. package/out/learned-scorer.d.ts.map +0 -1
  214. package/out/learned-scorer.js +0 -91
  215. package/out/learned-scorer.js.map +0 -1
  216. package/out/map-html.d.ts +0 -39
  217. package/out/map-html.d.ts.map +0 -1
  218. package/out/map-html.js +0 -220
  219. package/out/map-html.js.map +0 -1
  220. package/out/models/crosssource-gbt-en-us.d.ts +0 -45
  221. package/out/models/crosssource-gbt-en-us.d.ts.map +0 -1
  222. package/out/models/crosssource-gbt-en-us.js +0 -40
  223. package/out/models/crosssource-gbt-en-us.js.map +0 -1
  224. package/out/models/dedup-gbt-en-us.d.ts +0 -44
  225. package/out/models/dedup-gbt-en-us.d.ts.map +0 -1
  226. package/out/models/dedup-gbt-en-us.js +0 -44
  227. package/out/models/dedup-gbt-en-us.js.map +0 -1
  228. package/out/models/org-crosssource-gbt-en-us.d.ts +0 -45
  229. package/out/models/org-crosssource-gbt-en-us.d.ts.map +0 -1
  230. package/out/models/org-crosssource-gbt-en-us.js +0 -40
  231. package/out/models/org-crosssource-gbt-en-us.js.map +0 -1
  232. package/out/reconcile.d.ts +0 -96
  233. package/out/reconcile.d.ts.map +0 -1
  234. package/out/reconcile.js +0 -127
  235. package/out/reconcile.js.map +0 -1
  236. package/out/resolve.d.ts +0 -264
  237. package/out/resolve.d.ts.map +0 -1
  238. package/out/resolve.js +0 -282
  239. package/out/resolve.js.map +0 -1
  240. package/out/tools/coverage-reconciliation.d.ts +0 -67
  241. package/out/tools/coverage-reconciliation.d.ts.map +0 -1
  242. package/out/tools/coverage-reconciliation.js +0 -113
  243. package/out/tools/coverage-reconciliation.js.map +0 -1
  244. package/out/tools/cross/dataset-correlation.d.ts +0 -61
  245. package/out/tools/cross/dataset-correlation.d.ts.map +0 -1
  246. package/out/tools/cross/dataset-correlation.js +0 -244
  247. package/out/tools/cross/dataset-correlation.js.map +0 -1
  248. package/out/tools/cross/source-threshold-sweep.d.ts +0 -60
  249. package/out/tools/cross/source-threshold-sweep.d.ts.map +0 -1
  250. package/out/tools/cross/source-threshold-sweep.js +0 -264
  251. package/out/tools/cross/source-threshold-sweep.js.map +0 -1
  252. package/out/tools/dedup-ceiling.d.ts +0 -62
  253. package/out/tools/dedup-ceiling.d.ts.map +0 -1
  254. package/out/tools/dedup-ceiling.js +0 -171
  255. package/out/tools/dedup-ceiling.js.map +0 -1
  256. package/out/tools/eval-geocoder.d.ts +0 -68
  257. package/out/tools/eval-geocoder.d.ts.map +0 -1
  258. package/out/tools/eval-geocoder.js +0 -13
  259. package/out/tools/eval-geocoder.js.map +0 -1
  260. package/out/tools/geocoder/namesake-probe.d.ts +0 -33
  261. package/out/tools/geocoder/namesake-probe.d.ts.map +0 -1
  262. package/out/tools/geocoder/namesake-probe.js +0 -60
  263. package/out/tools/geocoder/namesake-probe.js.map +0 -1
  264. package/out/tools/geocoder/vs-provided-coords.d.ts +0 -53
  265. package/out/tools/geocoder/vs-provided-coords.d.ts.map +0 -1
  266. package/out/tools/geocoder/vs-provided-coords.js +0 -161
  267. package/out/tools/geocoder/vs-provided-coords.js.map +0 -1
  268. package/out/tools/gold-set-sample.d.ts +0 -67
  269. package/out/tools/gold-set-sample.d.ts.map +0 -1
  270. package/out/tools/gold-set-sample.js +0 -81
  271. package/out/tools/gold-set-sample.js.map +0 -1
  272. package/out/tools/learned/scorer/clustering-eval.d.ts +0 -77
  273. package/out/tools/learned/scorer/clustering-eval.d.ts.map +0 -1
  274. package/out/tools/learned/scorer/clustering-eval.js +0 -207
  275. package/out/tools/learned/scorer/clustering-eval.js.map +0 -1
  276. package/out/tools/learned/scorer/crossstate-eval.d.ts +0 -65
  277. package/out/tools/learned/scorer/crossstate-eval.d.ts.map +0 -1
  278. package/out/tools/learned/scorer/crossstate-eval.js +0 -168
  279. package/out/tools/learned/scorer/crossstate-eval.js.map +0 -1
  280. package/out/tools/learned/scorer/eval.d.ts +0 -64
  281. package/out/tools/learned/scorer/eval.d.ts.map +0 -1
  282. package/out/tools/learned/scorer/eval.js +0 -275
  283. package/out/tools/learned/scorer/eval.js.map +0 -1
  284. package/out/tools/matcher-scale.d.ts +0 -40
  285. package/out/tools/matcher-scale.d.ts.map +0 -1
  286. package/out/tools/matcher-scale.js +0 -111
  287. package/out/tools/matcher-scale.js.map +0 -1
  288. package/out/tools/nppes/dedup-benchmark.d.ts +0 -82
  289. package/out/tools/nppes/dedup-benchmark.d.ts.map +0 -1
  290. package/out/tools/nppes/dedup-benchmark.js +0 -226
  291. package/out/tools/nppes/dedup-benchmark.js.map +0 -1
  292. package/out/tools/nppes/org-name.d.ts +0 -15
  293. package/out/tools/nppes/org-name.d.ts.map +0 -1
  294. package/out/tools/nppes/org-name.js +0 -6
  295. package/out/tools/nppes/org-name.js.map +0 -1
  296. package/out/tools/nppes/overmerge-packet.d.ts +0 -43
  297. package/out/tools/nppes/overmerge-packet.d.ts.map +0 -1
  298. package/out/tools/nppes/overmerge-packet.js +0 -54
  299. package/out/tools/nppes/overmerge-packet.js.map +0 -1
  300. package/out/tools/nppes/report.d.ts +0 -97
  301. package/out/tools/nppes/report.d.ts.map +0 -1
  302. package/out/tools/nppes/report.js +0 -178
  303. package/out/tools/nppes/report.js.map +0 -1
  304. package/out/tools/nppes/sample.d.ts +0 -101
  305. package/out/tools/nppes/sample.d.ts.map +0 -1
  306. package/out/tools/nppes/sample.js +0 -127
  307. package/out/tools/nppes/sample.js.map +0 -1
  308. package/out/tools/nppes/scoring.d.ts +0 -37
  309. package/out/tools/nppes/scoring.d.ts.map +0 -1
  310. package/out/tools/nppes/scoring.js +0 -81
  311. package/out/tools/nppes/scoring.js.map +0 -1
  312. package/out/tools/nppes/settings.d.ts +0 -41
  313. package/out/tools/nppes/settings.d.ts.map +0 -1
  314. package/out/tools/nppes/settings.js +0 -79
  315. package/out/tools/nppes/settings.js.map +0 -1
  316. package/out/tools/nppes/truth-grains.d.ts +0 -63
  317. package/out/tools/nppes/truth-grains.d.ts.map +0 -1
  318. package/out/tools/nppes/truth-grains.js +0 -142
  319. package/out/tools/nppes/truth-grains.js.map +0 -1
  320. package/out/tools/shared.d.ts +0 -325
  321. package/out/tools/shared.d.ts.map +0 -1
  322. package/out/tools/shared.js +0 -453
  323. package/out/tools/shared.js.map +0 -1
  324. package/out/tools/train/cross-gbt.d.ts +0 -89
  325. package/out/tools/train/cross-gbt.d.ts.map +0 -1
  326. package/out/tools/train/cross-gbt.js +0 -132
  327. package/out/tools/train/cross-gbt.js.map +0 -1
  328. package/out/tools/train/gbt.d.ts +0 -85
  329. package/out/tools/train/gbt.d.ts.map +0 -1
  330. package/out/tools/train/gbt.js +0 -155
  331. package/out/tools/train/gbt.js.map +0 -1
  332. package/out/tools/train/org-cross-gbt.d.ts +0 -85
  333. package/out/tools/train/org-cross-gbt.d.ts.map +0 -1
  334. package/out/tools/train/org-cross-gbt.js +0 -122
  335. package/out/tools/train/org-cross-gbt.js.map +0 -1
  336. package/out/tools/txhhsc-to-oarow.d.ts +0 -42
  337. package/out/tools/txhhsc-to-oarow.d.ts.map +0 -1
  338. package/out/tools/txhhsc-to-oarow.js +0 -78
  339. package/out/tools/txhhsc-to-oarow.js.map +0 -1
  340. package/out/tools/viz/browser.d.ts +0 -31
  341. package/out/tools/viz/browser.d.ts.map +0 -1
  342. package/out/tools/viz/browser.js +0 -26
  343. package/out/tools/viz/browser.js.map +0 -1
  344. package/out/tools/viz/cross-dataset-map.d.ts +0 -39
  345. package/out/tools/viz/cross-dataset-map.d.ts.map +0 -1
  346. package/out/tools/viz/cross-dataset-map.js +0 -84
  347. package/out/tools/viz/cross-dataset-map.js.map +0 -1
  348. package/out/tools/viz/geocode-first-surface.d.ts +0 -36
  349. package/out/tools/viz/geocode-first-surface.d.ts.map +0 -1
  350. package/out/tools/viz/geocode-first-surface.js +0 -234
  351. package/out/tools/viz/geocode-first-surface.js.map +0 -1
  352. package/out/tools/viz/render/map.d.ts +0 -42
  353. package/out/tools/viz/render/map.d.ts.map +0 -1
  354. package/out/tools/viz/render/map.js +0 -40
  355. package/out/tools/viz/render/map.js.map +0 -1
  356. package/out/tools/viz/render.d.ts +0 -46
  357. package/out/tools/viz/render.d.ts.map +0 -1
  358. package/out/tools/viz/render.js +0 -49
  359. package/out/tools/viz/render.js.map +0 -1
  360. package/out/tools/viz/source-provenance-map.d.ts +0 -57
  361. package/out/tools/viz/source-provenance-map.d.ts.map +0 -1
  362. package/out/tools/viz/source-provenance-map.js +0 -82
  363. package/out/tools/viz/source-provenance-map.js.map +0 -1
  364. package/out/tools/viz/yardstick-figure.d.ts +0 -22
  365. package/out/tools/viz/yardstick-figure.d.ts.map +0 -1
  366. package/out/tools/viz/yardstick-figure.js +0 -106
  367. package/out/tools/viz/yardstick-figure.js.map +0 -1
  368. package/tools/coverage-reconciliation.ts +0 -192
  369. package/tools/cross/dataset-correlation.ts +0 -380
  370. package/tools/cross/source-threshold-sweep.ts +0 -416
  371. package/tools/dedup-ceiling.ts +0 -225
  372. package/tools/eval-geocoder.ts +0 -77
  373. package/tools/geocoder/namesake-probe.ts +0 -91
  374. package/tools/geocoder/vs-provided-coords.ts +0 -232
  375. package/tools/gold-set-sample.ts +0 -147
  376. package/tools/learned/scorer/clustering-eval.ts +0 -349
  377. package/tools/learned/scorer/crossstate-eval.ts +0 -280
  378. package/tools/learned/scorer/eval.ts +0 -429
  379. package/tools/matcher-scale.ts +0 -185
  380. package/tools/nppes/dedup-benchmark.ts +0 -364
  381. package/tools/nppes/org-name.ts +0 -15
  382. package/tools/nppes/overmerge-packet.ts +0 -98
  383. package/tools/nppes/report.ts +0 -380
  384. package/tools/nppes/sample.ts +0 -250
  385. package/tools/nppes/scoring.ts +0 -115
  386. package/tools/nppes/settings.ts +0 -102
  387. package/tools/nppes/truth-grains.ts +0 -185
  388. package/tools/shared.ts +0 -743
  389. package/tools/train/cross-gbt.ts +0 -214
  390. package/tools/train/gbt.ts +0 -261
  391. package/tools/train/org-cross-gbt.ts +0 -189
  392. package/tools/txhhsc-to-oarow.ts +0 -118
  393. package/tools/viz/browser.ts +0 -41
  394. package/tools/viz/cross-dataset-map.ts +0 -133
  395. package/tools/viz/geocode-first-surface.ts +0 -305
  396. package/tools/viz/render/map.ts +0 -61
  397. package/tools/viz/render.ts +0 -103
  398. package/tools/viz/source-provenance-map.ts +0 -154
  399. package/tools/viz/yardstick-figure.ts +0 -197
@@ -1,244 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- */
6
- import { dataRootPath } from "@mailwoman/core/data-root";
7
- import { writeLocalFile, writeLocalJSONFile } from "@mailwoman/core/fs/writers";
8
- import { isPresent } from "@mailwoman/core/objects";
9
- import { addressFrequencyKey, ingestRows, repName, resolveEntities, streamRows, toGeoJSON, } from "#index";
10
- import { buildSpecs, norm, pct, stateOption } from "#tools/shared";
11
- const MIN_TRIPLE_SOURCES = 3;
12
- function composeAddress(row, columns) {
13
- if (!columns)
14
- return "";
15
- const list = Array.isArray(columns) ? columns : [columns];
16
- return list
17
- .map((c) => norm(row[c]))
18
- .filter(isPresent)
19
- .join(" ")
20
- .trim();
21
- }
22
- const commitmentsSpec = (S, STATE) => ({
23
- source: "fcc-rhc-commitments",
24
- path: `${S}/fcc-rhc_commitments-disbursements_form462-466-466a_20260615.tsv`,
25
- mapping: {
26
- id: "hcpID",
27
- organization: "hcpName",
28
- address: ["hcpStreet", "hcpCity", "hcpState", "hcpZip"],
29
- source: "fcc-rhc-commitments",
30
- },
31
- inState: (r) => norm(r["Filing HCP State"]).toUpperCase() === STATE || norm(r["Participating HCP State"]).toUpperCase() === STATE,
32
- explode: (r) => {
33
- const out = [];
34
- const add = (prefix, role) => {
35
- const id = norm(r[`${prefix} HCP`]);
36
- const state = norm(r[`${prefix} HCP State`]).toUpperCase();
37
- if (id && state === STATE) {
38
- out.push({
39
- hcpID: `${role}-${id}`,
40
- hcpName: norm(r[`${prefix} HCP Name`]),
41
- hcpStreet: norm(r[`${prefix} HCP Street`]),
42
- hcpCity: norm(r[`${prefix} HCP City`]),
43
- hcpState: state,
44
- hcpZip: norm(r[`${prefix} HCP Zip Code`]),
45
- });
46
- }
47
- };
48
- add("Filing", "filing");
49
- add("Participating", "participating");
50
- return out;
51
- },
52
- });
53
- /**
54
- * Geocodes a sample of each source dataset in one state, resolves the records into entities across sources.
55
- * It returns a Markdown report of the cross-source links.
56
- *
57
- * Progress lines go to `report`.
58
- * The function also writes the report and GeoJSON when `outMd` or `outGeojson` is set.
59
- */
60
- export async function crossDatasetCorrelation(options, report) {
61
- const SOURCES = options.sources || dataRootPath("record-matcher", "sources");
62
- const CAP = options.cap ?? 300;
63
- const STATE = stateOption(options);
64
- const OUT_MD = options.outMd || "";
65
- const OUT_GEOJSON = options.outGeojson || "";
66
- const CORPUS_FREQ = options.corpusFrequency ?? true;
67
- const SPECS = [...buildSpecs(`${SOURCES}`, STATE), commitmentsSpec(`${SOURCES}`, STATE)];
68
- const rawBySource = new Map();
69
- const addrCounts = new Map();
70
- let addrTotal = 0;
71
- for (const spec of SPECS) {
72
- report?.(`[A] ${spec.source}: streaming + ${STATE} filter (sample ${CAP}${CORPUS_FREQ ? ", full freq scan" : ""})…`);
73
- const kept = [];
74
- for await (const row of streamRows(spec.path)) {
75
- if (!spec.inState(row))
76
- continue;
77
- const exploded = spec.explode ? spec.explode(row) : [row];
78
- for (const e of exploded) {
79
- if (CORPUS_FREQ) {
80
- const a = composeAddress(e, spec.mapping.address);
81
- if (a) {
82
- const k = addressFrequencyKey(a);
83
- addrCounts.set(k, (addrCounts.get(k) ?? 0) + 1);
84
- addrTotal++;
85
- }
86
- }
87
- if (kept.length < CAP) {
88
- kept.push(e);
89
- }
90
- }
91
- if (!CORPUS_FREQ && kept.length >= CAP)
92
- break;
93
- }
94
- rawBySource.set(spec.source, kept);
95
- report?.(` ${spec.source}: ${kept.length} sampled`);
96
- }
97
- const addressFrequency = CORPUS_FREQ
98
- ? {
99
- total: addrTotal,
100
- distinct: addrCounts.size,
101
- frequency: (v) => (v ? (addrCounts.get(addressFrequencyKey(v)) ?? 0) / addrTotal : 0),
102
- }
103
- : null;
104
- if (CORPUS_FREQ) {
105
- report?.(` address-frequency table: ${addrCounts.size} distinct over ${addrTotal} ${STATE} addresses`);
106
- }
107
- report?.("[B] building the geocoder…");
108
- const geocoder = await options.createGeocoder();
109
- let geo = 0;
110
- let total = 0;
111
- const geocodeForIngest = async (raw) => {
112
- const g = await geocoder.geocodeAddress(raw);
113
- total++;
114
- if (g?.geocode) {
115
- geo++;
116
- }
117
- return g;
118
- };
119
- report?.("[C] geocoding + ingesting all sources…");
120
- const records = [];
121
- for (const spec of SPECS) {
122
- const rows = rawBySource.get(spec.source);
123
- const g0 = geo;
124
- const t0 = total;
125
- const recs = await ingestRows(rows, spec.mapping, { geocodeAddress: geocodeForIngest });
126
- const dg = geo - g0;
127
- const dt = total - t0;
128
- report?.(` ${spec.source}: geocoded ${dg}/${dt} (${dt ? ((100 * dg) / dt).toFixed(1) : "0"}%)`);
129
- for (const r of recs) {
130
- r.id = `${spec.source}:${r.id}`;
131
- }
132
- records.push(...recs);
133
- }
134
- geocoder[Symbol.dispose]();
135
- report?.(` ${records.length} records; geocoded ${geo}/${total} (${((100 * geo) / total).toFixed(1)}%)`);
136
- report?.("[D] resolving across sources…");
137
- const { entities, candidatePairs } = resolveEntities(records, {
138
- trainEM: true,
139
- learnedScorer: false,
140
- ...(addressFrequency ? { addressFrequency } : {}),
141
- });
142
- const sourceOf = (r) => r.source ?? "?";
143
- const crossSource = entities
144
- .map((e) => ({ e, sources: new Set(e.records.map(sourceOf)) }))
145
- .filter((x) => x.sources.size >= 2)
146
- .toSorted((a, b) => b.sources.size - a.sources.size || b.e.records.length - a.e.records.length);
147
- const pairCounts = new Map();
148
- for (const { sources } of crossSource) {
149
- const list = [...sources].toSorted();
150
- for (let i = 0; i < list.length; i++) {
151
- for (let j = i + 1; j < list.length; j++) {
152
- const k = `${list[i]} ↔ ${list[j]}`;
153
- pairCounts.set(k, (pairCounts.get(k) ?? 0) + 1);
154
- }
155
- }
156
- }
157
- const lines = [
158
- `# Cross-dataset correlation (#618 / #87 real-data run)`,
159
- "",
160
- `_Generated by \`mailwoman registry scorer-eval cross-dataset\`. ${STATE}-scoped, ≤${CAP} rows per ` +
161
- `source geocoded, resolved BLIND across sources (geo-first block → Fellegi-Sunter + EM → cluster) with the ` +
162
- `proven changes default-on (#86). The sources share no key; an entity spanning ≥2 sources is a cross-dataset ` +
163
- `link we surface for review — interpretation is the consumer's._`,
164
- "",
165
- `## Sources`,
166
- "",
167
- ];
168
- const blurb = {
169
- "txhhsc-nursing": "TX HHSC licensed nursing facilities",
170
- "fcc-rhc": "FCC Rural Health Care posted-services filings",
171
- "fcc-rhc-commitments": "FCC RHC funding commitments (Filing + Participating HCP, exploded)",
172
- nppes: "NPPES organization NPIs",
173
- };
174
- lines.push(`| source | rows | what it is |`);
175
- lines.push(`|---|---:|---|`);
176
- for (const spec of SPECS) {
177
- lines.push(`| \`${spec.source}\` | ${rawBySource.get(spec.source).length} | ${blurb[spec.source] ?? ""} |`);
178
- }
179
- lines.push("");
180
- lines.push(`Combined: **${records.length} records**, geocoded ${pct(geo / total)}%. Resolved to ` +
181
- `**${entities.length} entities** from ${candidatePairs} candidate pairs.`);
182
- lines.push("");
183
- lines.push(addressFrequency
184
- ? `Matched with the proven changes default-on (#86): collapsed spatial (A1) + inverse-address-frequency, fed ` +
185
- `a corpus-wide table built from the full source files (**${addressFrequency.distinct.toLocaleString()}** distinct ` +
186
- `addresses over **${addressFrequency.total.toLocaleString()}** ${STATE} rows — a crowded shared campus is ` +
187
- `down-weighted as weak identity evidence).`
188
- : `Matched with the zero-config default (#86): collapsed spatial (A1) + an input-scoped address-frequency table ` +
189
- `(\`--no-corpus-frequency\`; pass nothing to build the corpus-wide table from the full files instead).`);
190
- lines.push("");
191
- lines.push(`Scored with the Fellegi-Sunter baseline (\`learnedScorer: false\`): cross-dataset link discovery is ` +
192
- `recall-oriented — the same facility under different operational names across sources is the signal — so the ` +
193
- `dedup-calibrated GBT default (#603), which is trained to REJECT "same place, different name," is pinned off ` +
194
- `here. A cross-objective GBT threshold is the follow-up (#655).`);
195
- lines.push("");
196
- lines.push(`## Cross-dataset links (entities spanning ≥2 sources)`);
197
- lines.push("");
198
- lines.push(`**${crossSource.length}** entities resolve across ≥2 sources.`);
199
- lines.push("");
200
- if (pairCounts.size) {
201
- lines.push(`| source pair | entities linked |`);
202
- lines.push(`|---|---:|`);
203
- for (const [k, v] of [...pairCounts.entries()].toSorted((a, b) => b[1] - a[1])) {
204
- lines.push(`| ${k} | ${v} |`);
205
- }
206
- lines.push("");
207
- }
208
- const triple = crossSource.filter((x) => x.sources.size >= MIN_TRIPLE_SOURCES).length;
209
- if (triple) {
210
- lines.push(`Of those, **${triple}** span all three sources.`);
211
- }
212
- lines.push("");
213
- lines.push(`## Spot-check — the first 12 cross-source entities (verify by eye)`);
214
- lines.push("");
215
- lines.push(`| entity | sources | name (representative) | coordinate |`);
216
- lines.push(`|---|---|---|---|`);
217
- for (const { e, sources } of crossSource.slice(0, 12)) {
218
- const coord = e.coordinate ? `${e.coordinate.latitude.toFixed(4)}, ${e.coordinate.longitude.toFixed(4)}` : "—";
219
- lines.push(`| ${e.id} | ${[...sources].toSorted().join(", ")} | ${repName(e)} | ${coord} |`);
220
- }
221
- lines.push("");
222
- lines.push(`## Reading`);
223
- lines.push("");
224
- lines.push(`${SPECS.length} datasets with no shared key — a provider registry, a federal funding program (two of its forms, ` +
225
- `the commitments form exploded into its Filing + Participating HCP per row), and a state facility registry — ` +
226
- `resolve into a single entity model where ${crossSource.length} entities are corroborated by ≥2 independent ` +
227
- `sources (${triple} by all three kinds), purely on geocoded location + name/org agreement, in pure Node without ` +
228
- `Elasticsearch or a server. Each cross-source entity is a candidate "same place, multiple records" surfaced for ` +
229
- `review; whether a correlation means anything is the data consumer's call, not ours.`);
230
- lines.push("");
231
- const md = lines.join("\n");
232
- console.log(md);
233
- if (OUT_MD) {
234
- await writeLocalFile(md, OUT_MD);
235
- report?.(`\n[written] ${OUT_MD}`);
236
- }
237
- if (OUT_GEOJSON) {
238
- const fc = toGeoJSON(entities);
239
- await writeLocalJSONFile(fc, OUT_GEOJSON);
240
- report?.(`[written] ${OUT_GEOJSON} — ${fc.features.length} entity features (${crossSource.length} cross-source)`);
241
- }
242
- return { markdown: md };
243
- }
244
- //# sourceMappingURL=dataset-correlation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dataset-correlation.js","sourceRoot":"","sources":["../../../tools/cross/dataset-correlation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAEnD,OAAO,EACN,mBAAmB,EACnB,UAAU,EACV,OAAO,EACP,eAAe,EACf,UAAU,EACV,SAAS,GAGT,MAAM,QAAQ,CAAA;AAEf,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,WAAW,EAAmB,MAAM,eAAe,CAAA;AAEnF,MAAM,kBAAkB,GAAG,CAAC,CAAA;AAqD5B,SAAS,cAAc,CAAC,GAA2B,EAAE,OAA6C;IACjG,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAA;IACvB,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;IAEzD,OAAO,IAAI;SACT,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;SACxB,MAAM,CAAC,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AAI,MAAM,EAAE,CAAC;QACZ,MAAM,cAAc,CAAC,EAAE,EAAE,MAAM,CAAC,CAAA;QAChC,MAAM,EAAE,CAAC,eAAe,MAAM,EAAE,CAAC,CAAA;IAClC,CAAC;IAED,IAAI,WAAW,EAAE,CAAC;QACjB,MAAM,EAAE,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAA;QAC9B,MAAM,kBAAkB,CAAC,EAAE,EAAE,WAAW,CAAC,CAAA;QACzC,MAAM,EAAE,CAAC,aAAa,WAAW,MAAM,EAAE,CAAC,QAAQ,CAAC,MAAM,qBAAqB,WAAW,CAAC,MAAM,gBAAgB,CAAC,CAAA;IAClH,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAA;AACxB,CAAC"}
@@ -1,60 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * Cross-source threshold sweep. Resolve the sources once, then compare the Fellegi-Sunter
7
- * baseline against the bundled GBT over a fine threshold sweep, scoring each arm on cross-source
8
- * links, triple-source entities, total entities and phone corroboration.
9
- *
10
- * Run: `mailwoman registry scorer-eval threshold-sweep [--cap 2000] [--state TX]
11
- * [--wof <admin.db>] [--data-root <dir>] [--out-md <md>]`
12
- */
13
- import type { EvalGeocoderFactory } from "#tools/eval-geocoder";
14
- /**
15
- * Options for {@linkcode crossSourceThresholdSweep}.
16
- */
17
- export interface CrossSourceThresholdSweepOptions {
18
- /**
19
- * The injected geocoder factory.
20
- *
21
- * The command wires `mailwoman/geocode-core`, as `./eval-geocoder.ts` does.
22
- */
23
- createGeocoder: EvalGeocoderFactory;
24
- /**
25
- * Record-matcher sources directory.
26
- *
27
- * @defaultValue `$MAILWOMAN_DATA_ROOT/record-matcher/sources`
28
- */
29
- sources?: string;
30
- /**
31
- * Rows kept per source.
32
- *
33
- * @defaultValue `2000`
34
- */
35
- cap?: number;
36
- /**
37
- * State filter.
38
- *
39
- * @defaultValue TX.
40
- */
41
- state?: string;
42
- /**
43
- * A trained cross-source GBT module (exports CROSS_SOURCE_GBT_MODEL + _META) to
44
- * grade as a third arm at its recommended threshold.
45
- * This is the model `registry train-scorer cross-gbt` emits.
46
- */
47
- candidate?: string;
48
- /**
49
- * Also write the markdown report here.
50
- */
51
- outMd?: string;
52
- }
53
- /**
54
- * Compare the FS baseline against bundled GBT over a threshold sweep.
55
- * Emit the markdown report to stdout.
56
- */
57
- export declare function crossSourceThresholdSweep(options: CrossSourceThresholdSweepOptions, report?: (line: string) => void): Promise<{
58
- markdown: string;
59
- }>;
60
- //# sourceMappingURL=source-threshold-sweep.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"source-threshold-sweep.d.ts","sourceRoot":"","sources":["../../../tools/cross/source-threshold-sweep.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAsBH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAQ/D;;GAEG;AACH,MAAM,WAAW,gCAAgC;IAChD;;;;OAIG;IACH,cAAc,EAAE,mBAAmB,CAAA;IACnC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAmGD;;;GAGG;AACH,wBAAsB,yBAAyB,CAC9C,OAAO,EAAE,gCAAgC,EACzC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAsO/B"}
@@ -1,264 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * Cross-source threshold sweep. Resolve the sources once, then compare the Fellegi-Sunter
7
- * baseline against the bundled GBT over a fine threshold sweep, scoring each arm on cross-source
8
- * links, triple-source entities, total entities and phone corroboration.
9
- *
10
- * Run: `mailwoman registry scorer-eval threshold-sweep [--cap 2000] [--state TX]
11
- * [--wof <admin.db>] [--data-root <dir>] [--out-md <md>]`
12
- */
13
- var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExtension) || function (path, preserveJsx) {
14
- if (typeof path === "string" && /^\.\.?\//.test(path)) {
15
- return path.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {
16
- return tsx ? preserveJsx ? ".jsx" : ".js" : d && (!ext || !cm) ? m : (d + ext + "." + cm.toLowerCase() + "js");
17
- });
18
- }
19
- return path;
20
- };
21
- import { dataRootPath } from "@mailwoman/core/data-root";
22
- import { writeLocalFile } from "@mailwoman/core/fs/writers";
23
- import { pathToFileURL } from "@mailwoman/core/module/file-url";
24
- import { formatPercent } from "@mailwoman/core/stats";
25
- import { resolvePath } from "path-ts";
26
- import { addressFrequencyKey, buildDefaultModel, createGBTScorer, DEDUP_GBT_META, DEDUP_GBT_MODEL, ingestRows, normalizePhoneStrict, resolveEntities, streamRows, } from "#index";
27
- import { buildSpecs, stateOption } from "#tools/shared";
28
- /**
29
- * Independent sources that must agree before a cluster counts as cross-source corroborated.
30
- */
31
- const MIN_CROSS_SOURCE_AGREEMENT = 3;
32
- const entitySources = (e) => new Set(e.records.map((r) => r.source).filter((s) => !!s));
33
- /**
34
- * Label-free precision proxy: does this cross-source entity have the same phone
35
- * in records from two different sources?
36
- *
37
- * Phone is not the join key, so a match is independent corroboration of one facility.
38
- * Entities without phone numbers on two cross-source records are unknown.
39
- * Only checkable entities count.
40
- */
41
- function phoneEvidence(e) {
42
- const bySource = new Map();
43
- for (const r of e.records) {
44
- const ph = normalizePhoneStrict(r.phone);
45
- if (!ph)
46
- continue;
47
- const s = r.source ?? "?";
48
- if (!bySource.has(s)) {
49
- bySource.set(s, new Set());
50
- }
51
- bySource.get(s).add(ph);
52
- }
53
- const sources = [...bySource.keys()];
54
- if (sources.length < 2)
55
- return "unknown";
56
- let any = false;
57
- for (let i = 0; i < sources.length; i++) {
58
- for (let j = i + 1; j < sources.length; j++) {
59
- any = true;
60
- for (const ph of bySource.get(sources[i]))
61
- if (bySource.get(sources[j]).has(ph))
62
- return "corroborated";
63
- }
64
- }
65
- return any ? "contradicted" : "unknown";
66
- }
67
- async function measure(label, threshold, entities) {
68
- let crossSource = 0;
69
- let tripleSource = 0;
70
- let phoneCorrob = 0;
71
- let phoneContradict = 0;
72
- let phoneCheckable = 0;
73
- for (const e of entities) {
74
- const n = entitySources(e).size;
75
- if (n < 2)
76
- continue;
77
- crossSource++;
78
- if (n >= MIN_CROSS_SOURCE_AGREEMENT) {
79
- tripleSource++;
80
- }
81
- const ev = phoneEvidence(e);
82
- if (ev === "corroborated") {
83
- phoneCorrob++;
84
- phoneCheckable++;
85
- }
86
- else if (ev === "contradicted") {
87
- phoneContradict++;
88
- phoneCheckable++;
89
- }
90
- }
91
- return {
92
- label,
93
- threshold,
94
- entities: entities.length,
95
- crossSource,
96
- tripleSource,
97
- phoneCorrob,
98
- phoneContradict,
99
- phoneCheckable,
100
- };
101
- }
102
- /**
103
- * Compare the FS baseline against bundled GBT over a threshold sweep.
104
- * Emit the markdown report to stdout.
105
- */
106
- export async function crossSourceThresholdSweep(options, report) {
107
- const SOURCES = options.sources || dataRootPath("record-matcher", "sources");
108
- const CAP = options.cap ?? 2000;
109
- const STATE = stateOption(options);
110
- const OUT_MD = options.outMd || "";
111
- const CANDIDATE = options.candidate || "";
112
- const SPECS = buildSpecs(`${SOURCES}`, STATE);
113
- const rawBySource = new Map();
114
- for (const spec of SPECS) {
115
- report?.(`[A] ${spec.source}: streaming + ${STATE} filter (cap ${CAP})…`);
116
- const kept = [];
117
- for await (const row of streamRows(spec.path)) {
118
- if (!spec.inState(row))
119
- continue;
120
- kept.push(row);
121
- if (kept.length >= CAP)
122
- break;
123
- }
124
- rawBySource.set(spec.source, kept);
125
- report?.(` ${spec.source}: ${kept.length} rows`);
126
- }
127
- report?.("[B] building the geocoder…");
128
- const geocoder = await options.createGeocoder();
129
- const geocodeForIngest = geocoder.geocodeAddress;
130
- report?.("[C] geocoding + ingesting…");
131
- const records = [];
132
- for (const spec of SPECS) {
133
- const recs = await ingestRows(rawBySource.get(spec.source), spec.mapping, { geocodeAddress: geocodeForIngest });
134
- for (const r of recs) {
135
- r.id = `${spec.source}:${r.id}`;
136
- }
137
- records.push(...recs);
138
- }
139
- geocoder[Symbol.dispose]();
140
- const geocoded = records.filter((r) => r.address?.geocode).length;
141
- report?.(` ${records.length} records; geocoded ${geocoded}`);
142
- const addrCounts = new Map();
143
- let addrTotal = 0;
144
- for (const r of records) {
145
- if (!r.address?.raw)
146
- continue;
147
- addrCounts.set(addressFrequencyKey(r.address.raw), (addrCounts.get(addressFrequencyKey(r.address.raw)) ?? 0) + 1);
148
- addrTotal++;
149
- }
150
- const addressFrequency = {
151
- total: addrTotal,
152
- distinct: addrCounts.size,
153
- frequency: (v) => (v ? (addrCounts.get(addressFrequencyKey(v)) ?? 0) / addrTotal : 0),
154
- };
155
- const comparisons = buildDefaultModel({ collapseSpatial: true, addressFrequency }).comparisons;
156
- const gbtScorer = createGBTScorer({ model: DEDUP_GBT_MODEL, comparisons, addressFrequency });
157
- report?.("[D] resolving — FS baseline baseline…");
158
- const fs = await measure("FS baseline", 0, resolveEntities(records, { trainEM: true, collapseSpatial: true, addressFrequency, learnedScorer: false }).entities);
159
- const SWEEP = [-8, -6, -5, -4, -3, -2, -1, 0, 1, 2, DEDUP_GBT_META.recommendedThreshold];
160
- const gbtArms = [];
161
- for (const t of SWEEP) {
162
- report?.(`[D] resolving — GBT @ threshold ${t}…`);
163
- const { entities } = resolveEntities(records, {
164
- collapseSpatial: true,
165
- addressFrequency,
166
- scorer: gbtScorer,
167
- threshold: t,
168
- });
169
- gbtArms.push(await measure(`GBT @ ${t.toFixed(2)}`, t, entities));
170
- }
171
- // A GBT arm dominates only when it matches FS cross-source links at no lower phone corroboration and
172
- // keeps at least 90% of FS entities, since a collapse means giant-blob artifacts rather than links.
173
- const pct = (n, d) => formatPercent(n, d, 0);
174
- const candidateArms = [];
175
- if (CANDIDATE) {
176
- const mod = (await import(__rewriteRelativeImportExtension(pathToFileURL(resolvePath(CANDIDATE)).href)));
177
- const candModel = mod.CROSS_SOURCE_GBT_MODEL ?? mod.ORG_CROSS_SOURCE_GBT_MODEL;
178
- if (!candModel)
179
- throw new Error(`--candidate module exports neither CROSS_SOURCE_GBT_MODEL nor ORG_CROSS_SOURCE_GBT_MODEL`);
180
- const t0 = (mod.CROSS_SOURCE_GBT_META ?? mod.ORG_CROSS_SOURCE_GBT_META)?.recommendedThreshold ?? 0;
181
- const candScorer = createGBTScorer({ model: candModel, comparisons, addressFrequency });
182
- report?.(`[E] resolving — cross-source GBT candidate @ ${t0.toFixed(3)} (±)…`);
183
- for (const t of [t0 - 1, t0, t0 + 1]) {
184
- candidateArms.push(await measure(`cross-GBT @ ${t.toFixed(2)}`, t, resolveEntities(records, {
185
- trainEM: true,
186
- collapseSpatial: true,
187
- addressFrequency,
188
- scorer: candScorer,
189
- threshold: t,
190
- }).entities));
191
- }
192
- }
193
- const rate = (a) => (a.phoneCheckable > 0 ? a.phoneCorrob / a.phoneCheckable : 0);
194
- const fsCorrobRate = rate(fs);
195
- const minEntities = Math.floor(fs.entities * 0.9);
196
- const dominating = gbtArms.find((a) => a.crossSource >= fs.crossSource && rate(a) >= fsCorrobRate && a.entities >= minEntities);
197
- // The candidate gets its own verdict scan, separate from the option-1 verdict for the dedup GBT.
198
- const candidateDominating = candidateArms.find((a) => a.crossSource >= fs.crossSource && rate(a) >= fsCorrobRate && a.entities >= minEntities);
199
- let candidateBest = null;
200
- for (const arm of candidateArms) {
201
- if (arm.entities >= minEntities && arm.crossSource > (candidateBest?.crossSource ?? -1)) {
202
- candidateBest = arm;
203
- }
204
- }
205
- const rows = [fs, ...gbtArms, ...candidateArms];
206
- const lines = [
207
- `# #655 — cross-source threshold sweep: can a re-thresholded GBT beat FS?`,
208
- "",
209
- `_TX-scoped, ≤${CAP} rows/source (NPPES org + TX HHSC nursing = eligibility-ish; FCC-RHC = funding), ` +
210
- `geocoded once then resolved per arm. **Phone-corrob** = of the cross-source entities whose records carry ` +
211
- `a phone in ≥2 different sources, the fraction where those phones MATCH — a label-free precision proxy ` +
212
- `(phone is not the join key). Higher cross-source + higher phone-corrob = better._`,
213
- "",
214
- `| arm | threshold | total entities | cross-source links | triple-source | phone-corrob (of checkable) |`,
215
- `|---|---:|---:|---:|---:|---|`,
216
- ];
217
- for (const r of rows) {
218
- lines.push(`| ${r.label} | ${r.threshold === null ? "—" : r.threshold} | ${r.entities} | ${r.crossSource} | ` +
219
- `${r.tripleSource} | ${r.phoneCorrob}/${r.phoneCheckable} (${pct(r.phoneCorrob, r.phoneCheckable)}) |`);
220
- }
221
- lines.push("");
222
- lines.push(`## Verdict`);
223
- if (CANDIDATE) {
224
- const c = candidateDominating ?? candidateBest;
225
- lines.push("");
226
- if (candidateDominating) {
227
- lines.push(`**The --candidate model DOMINATES FS**: ${candidateDominating.crossSource} cross-source links (FS ${fs.crossSource}) at phone-corrob ${(100 * rate(candidateDominating)).toFixed(0)}% ≥ FS ${(100 * fsCorrobRate).toFixed(0)}%, entities ${candidateDominating.entities} (no collapse). Un-pinning FS for this objective is supported by this run.`);
228
- }
229
- else if (c) {
230
- lines.push(`**--candidate (best non-collapsing arm)**: ${c.crossSource} cross-source links vs FS ${fs.crossSource}, phone-corrob ${(100 * rate(c)).toFixed(0)}% vs FS ${(100 * fsCorrobRate).toFixed(0)}%, entities ${c.entities}. Does not STRICTLY dominate — judge the margins (the phone proxy is one-link noisy at this n).`);
231
- }
232
- else {
233
- lines.push(`**--candidate**: no non-collapsing arm (every threshold fell below the entity floor).`);
234
- }
235
- }
236
- lines.push("");
237
- lines.push(`FS baseline: **${fs.crossSource}** cross-source links (${fs.tripleSource} triple), ` +
238
- `phone-corrob ${pct(fs.phoneCorrob, fs.phoneCheckable)} (${fs.phoneCorrob}/${fs.phoneCheckable}).`);
239
- lines.push("");
240
- if (!dominating) {
241
- lines.push(`**No GBT threshold dominates FS** — none matches FS's ${fs.crossSource} cross-source links at ≥ its ` +
242
- `${pct(fs.phoneCorrob, fs.phoneCheckable)} phone-corrob without over-merging (entity count collapsing below ` +
243
- `${minEntities}). At its dedup threshold the GBT finds FEWER cross-source links than FS; lowering the ` +
244
- `threshold to admit more only over-merges (the over-merge features REPLACE the FS weight, so true ` +
245
- `cross-source pairs share a logit band with genuine over-merges). Threshold alone (option 1) is ` +
246
- `**INSUFFICIENT** — FS stays pinned (correct + best-precision for this objective); a cross-objective ` +
247
- `retrain (option 2), conditioned on cross-source labels, is the only change. See #655.`);
248
- }
249
- else {
250
- lines.push(`**GBT @ ${dominating.threshold} dominates FS**: ${dominating.crossSource} links (vs ${fs.crossSource}) at ` +
251
- `${pct(dominating.phoneCorrob, dominating.phoneCheckable)} phone-corrob (vs ${pct(fs.phoneCorrob, fs.phoneCheckable)}), ` +
252
- `${dominating.entities} entities (vs ${fs.entities}). The threshold fix (option 1) WORKS: ship a cross-source ` +
253
- `threshold ≈ ${dominating.threshold}.`);
254
- }
255
- lines.push("");
256
- const md = lines.join("\n");
257
- console.log(md);
258
- if (OUT_MD) {
259
- await writeLocalFile(md, OUT_MD);
260
- report?.(`[written] ${OUT_MD}`);
261
- }
262
- return { markdown: md };
263
- }
264
- //# sourceMappingURL=source-threshold-sweep.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"source-threshold-sweep.js","sourceRoot":"","sources":["../../../tools/cross/source-threshold-sweep.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;;;;;;;;;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4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