@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,42 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * Convert the TX hhsc nursing-facilities source into the OaRow jsonl the resolver eval consumes.
7
- * The source ships an authoritative `Geo Location` = `lat,lon` per facility, so the geocoder is
8
- * graded against the provided coordinates on real facility addresses. `oa-resolver-eval
9
- * --address-points` reports a great-circle delta and a tier breakdown.
10
- *
11
- * Neutral scope: this measures geocoder accuracy on real public addresses and makes no claim about
12
- * the facilities themselves.
13
- *
14
- * Run: `mailwoman registry convert tx-hhsc [--src <tsv>] [--out /tmp/txhhsc-oarow.jsonl]`
15
- */
16
- import type { PathBuilderLike } from "path-ts";
17
- /**
18
- * Options for {@linkcode convertTXHHSC}.
19
- */
20
- export interface TXHHSCConvertOptions {
21
- /**
22
- * The TX hhsc nursing-facilities TSV.
23
- *
24
- * @defaultValue `$MAILWOMAN_DATA_ROOT/record-matcher/sources/…`
25
- */
26
- src?: PathBuilderLike;
27
- /**
28
- * Output OaRow jsonl path.
29
- *
30
- * @defaultValue `/tmp/txhhsc-oarow.jsonl`
31
- */
32
- out?: string;
33
- }
34
- /**
35
- * Convert the TX hhsc nursing-facilities TSV into OaRow jsonl for `oa-resolver-eval`.
36
- */
37
- export declare function convertTXHHSC(options?: TXHHSCConvertOptions, report?: (line: string) => void): Promise<{
38
- written: number;
39
- skipped: number;
40
- out: string;
41
- }>;
42
- //# sourceMappingURL=txhhsc-to-oarow.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"txhhsc-to-oarow.d.ts","sourceRoot":"","sources":["../../tools/txhhsc-to-oarow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAK9C;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC;;;;OAIG;IACH,GAAG,CAAC,EAAE,eAAe,CAAA;IACrB;;;;OAIG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;CACZ;AAID;;GAEG;AACH,wBAAsB,aAAa,CAClC,OAAO,GAAE,oBAAyB,EAClC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAkE5D"}
@@ -1,78 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * Convert the TX hhsc nursing-facilities source into the OaRow jsonl the resolver eval consumes.
7
- * The source ships an authoritative `Geo Location` = `lat,lon` per facility, so the geocoder is
8
- * graded against the provided coordinates on real facility addresses. `oa-resolver-eval
9
- * --address-points` reports a great-circle delta and a tier breakdown.
10
- *
11
- * Neutral scope: this measures geocoder accuracy on real public addresses and makes no claim about
12
- * the facilities themselves.
13
- *
14
- * Run: `mailwoman registry convert tx-hhsc [--src <tsv>] [--out /tmp/txhhsc-oarow.jsonl]`
15
- */
16
- import { dataRootPath, tempRootPath } from "@mailwoman/core/data-root";
17
- import { readLocalTextFile } from "@mailwoman/core/fs/readers";
18
- import { writeLocalTextFile } from "@mailwoman/core/fs/writers";
19
- import { stringifyJSON } from "@mailwoman/core/json";
20
- import { TSVSpliterator } from "spliterator";
21
- import { inTXBBOX } from "#tools/shared";
22
- const GEO = /^\s*(-?\d+\.\d+)\s*,\s*(-?\d+\.\d+)\s*$/;
23
- /**
24
- * Convert the TX hhsc nursing-facilities TSV into OaRow jsonl for `oa-resolver-eval`.
25
- */
26
- export async function convertTXHHSC(options = {}, report) {
27
- const src = options.src ?? dataRootPath("record-matcher", "sources", "txhhsc_nursing-facilities_20260611.tsv");
28
- const out = options.out || tempRootPath("txhhsc-oarow.jsonl");
29
- const records = [];
30
- let skipped = 0;
31
- // Column indices come from the first non-blank row.
32
- // `header: false` keeps that row in the stream, so the blank-row guard below applies to it.
33
- let cAddr = -1;
34
- let cCity = -1;
35
- let cZip = -1;
36
- let cGeo = -1;
37
- let sawHeader = false;
38
- for (const f of TSVSpliterator.from(await readLocalTextFile(src), { header: false })) {
39
- if (f.every((value) => !value))
40
- continue;
41
- if (!sawHeader) {
42
- sawHeader = true;
43
- const col = (name) => f.indexOf(name);
44
- cAddr = col("Physical Address");
45
- cCity = col("Physical Address CITY");
46
- cZip = col("Physical Address Zipcode");
47
- cGeo = col("Geo Location");
48
- continue;
49
- }
50
- const addr = f[cAddr] ?? "";
51
- const city = f[cCity] ?? "";
52
- const zip = f[cZip] ?? "";
53
- const m = GEO.exec(f[cGeo] ?? "");
54
- if (!addr || !city || !m) {
55
- skipped++;
56
- continue;
57
- }
58
- const lat = Number(m[1]);
59
- const lon = Number(m[2]);
60
- // Sanity: TX bounding box (rejects swapped/garbage coords).
61
- if (!inTXBBOX(lat, lon)) {
62
- skipped++;
63
- continue;
64
- }
65
- records.push(stringifyJSON({
66
- input: `${addr}, ${city}, TX ${zip}`,
67
- lat,
68
- lon,
69
- expected: { locality: city, region: "TX", postcode: zip },
70
- state: "TX",
71
- source: "txhhsc:nursing-facilities",
72
- }));
73
- }
74
- await writeLocalTextFile(records, out);
75
- report?.(`wrote ${records.length} rows (skipped ${skipped}) → ${out}`);
76
- return { written: records.length, skipped, out };
77
- }
78
- //# sourceMappingURL=txhhsc-to-oarow.js.map
@@ -1 +0,0 @@
1
- {"version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AAE;YACpC,GAAG;YACH,GAAG;YACH,QAAQ,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE;YACzD,KAAK,EAAE,IAAI;YACX,MAAM,EAAE,2BAA2B;SACnC,CAAC,CACF,CAAA;IACF,CAAC;IAED,MAAM,kBAAkB,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;IACtC,MAAM,EAAE,CAAC,SAAS,OAAO,CAAC,MAAM,kBAAkB,OAAO,OAAO,GAAG,EAAE,CAAC,CAAA;IAEtE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,CAAA;AACjD,CAAC"}
@@ -1,31 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * This module configures the shared browser for Plotly and MapLibre rendering.
7
- * SwiftShader supplies WebGL without a hardware GPU.
8
- * Each caller owns navigation, readiness checks, and screenshots.
9
- * The browser package loads Playwright and stealth plugins when a session starts.
10
- */
11
- import type { Page } from "playwright";
12
- /**
13
- * Options for {@linkcode withChromiumPage}.
14
- */
15
- export interface ChromiumPageOptions {
16
- viewport: {
17
- width: number;
18
- height: number;
19
- };
20
- }
21
- /**
22
- * Launch headless Chromium (SwiftShader WebGL), open one page at `deviceScaleFactor: 2`,
23
- * collect console + page errors, run `fn`, and dispose the browser.
24
- *
25
- * The callback owns navigation, waits and the screenshot.
26
- */
27
- export declare function withChromiumPage<T>(options: ChromiumPageOptions, fn: (page: Page) => Promise<T>): Promise<{
28
- result: T;
29
- consoleErrors: string[];
30
- }>;
31
- //# sourceMappingURL=browser.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../tools/viz/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEtC;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;CAC3C;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACvC,OAAO,EAAE,mBAAmB,EAC5B,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,GAC5B,OAAO,CAAC;IAAE,MAAM,EAAE,CAAC,CAAC;IAAC,aAAa,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAUjD"}
@@ -1,26 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * This module configures the shared browser for Plotly and MapLibre rendering.
7
- * SwiftShader supplies WebGL without a hardware GPU.
8
- * Each caller owns navigation, readiness checks, and screenshots.
9
- * The browser package loads Playwright and stealth plugins when a session starts.
10
- */
11
- import { withBrowserPage } from "@mailwoman/browser";
12
- /**
13
- * Launch headless Chromium (SwiftShader WebGL), open one page at `deviceScaleFactor: 2`,
14
- * collect console + page errors, run `fn`, and dispose the browser.
15
- *
16
- * The callback owns navigation, waits and the screenshot.
17
- */
18
- export async function withChromiumPage(options, fn) {
19
- return withBrowserPage({
20
- launchOptions: {
21
- args: ["--use-gl=angle", "--use-angle=swiftshader", "--enable-unsafe-swiftshader", "--ignore-gpu-blocklist"],
22
- },
23
- contextOptions: { viewport: options.viewport, deviceScaleFactor: 2 },
24
- }, fn);
25
- }
26
- //# sourceMappingURL=browser.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"browser.js","sourceRoot":"","sources":["../../../tools/viz/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAUpD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACrC,OAA4B,EAC5B,EAA8B;IAE9B,OAAO,eAAe,CACrB;QACC,aAAa,EAAE;YACd,IAAI,EAAE,CAAC,gBAAgB,EAAE,yBAAyB,EAAE,6BAA6B,EAAE,wBAAwB,CAAC;SAC5G;QACD,cAAc,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,iBAAiB,EAAE,CAAC,EAAE;KACpE,EACD,EAAE,CACF,CAAA;AACF,CAAC"}
@@ -1,39 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * Render linked entities from a GeoJSON file in MapLibre, colored by source combination.
7
- * `crossAgencyOnly` removes links whose sources belong to one agency.
8
- */
9
- /**
10
- * Options for {@linkcode crossDatasetMap}.
11
- */
12
- export interface CrossDatasetMapOptions {
13
- /**
14
- * The `cross-dataset-links` GeoJSON.
15
- *
16
- * @defaultValue `$MAILWOMAN_DATA_ROOT/record-matcher/2026-06-16-cross-dataset-links.geojson`
17
- */
18
- in?: string;
19
- /**
20
- * Output html path.
21
- *
22
- * @defaultValue `/tmp/cross-dataset-map.html`
23
- */
24
- outHTML?: string;
25
- /**
26
- * Keep only entities whose sources span >1 agency (the two FCC datasets count as one).
27
- */
28
- crossAgencyOnly?: boolean;
29
- }
30
- /**
31
- * Render the cross-dataset-links GeoJSON to a bucket-colored MapLibre html page.
32
- */
33
- export declare function crossDatasetMap(options?: CrossDatasetMapOptions, report?: (line: string) => void): Promise<{
34
- outHTML: string;
35
- kept: number;
36
- total: number;
37
- triple: number;
38
- }>;
39
- //# sourceMappingURL=cross-dataset-map.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cross-dataset-map.d.ts","sourceRoot":"","sources":["../../../tools/viz/cross-dataset-map.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAcH;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC;;;;OAIG;IACH,EAAE,CAAC,EAAE,MAAM,CAAA;IACX;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;CACzB;AAgCD;;GAEG;AACH,wBAAsB,eAAe,CACpC,OAAO,GAAE,sBAA2B,EACpC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAqD3E"}
@@ -1,84 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * Render linked entities from a GeoJSON file in MapLibre, colored by source combination.
7
- * `crossAgencyOnly` removes links whose sources belong to one agency.
8
- */
9
- import { dataRootPath, tempRootPath } from "@mailwoman/core/data-root";
10
- import { readLocalJSONFile } from "@mailwoman/core/fs/readers";
11
- import { writeLocalFile } from "@mailwoman/core/fs/writers";
12
- import { toMapHTML } from "#index";
13
- /**
14
- * Distinct agencies a combination needs before it is plotted as a cross-agency cluster.
15
- */
16
- const MIN_DISTINCT_AGENCIES = 3;
17
- const SOURCE_LABELS = {
18
- nppes: "NPPES",
19
- "fcc-rhc": "FCC RHC",
20
- "fcc-rhc-commitments": "FCC commitments",
21
- "txhhsc-nursing": "TX HHSC",
22
- };
23
- const label = (s) => SOURCE_LABELS[s] ?? s;
24
- /**
25
- * Which agency each source belongs to.
26
- *
27
- * The two FCC datasets (RHC posted-services + commitments) are one agency.
28
- * So an NPPES↔FCC or FCC↔TX link is cross-agency, but an RHC↔commitments link is not.
29
- *
30
- * `--cross-agency-only` keeps only the entities whose sources span >1 agency: the harder,
31
- * more striking "no shared key across agencies" subset (most of the raw links are FCC-internal).
32
- */
33
- const SOURCE_AGENCY = {
34
- nppes: "CMS",
35
- "fcc-rhc": "FCC",
36
- "fcc-rhc-commitments": "FCC",
37
- "txhhsc-nursing": "TX HHSC",
38
- };
39
- const agencyOf = (s) => SOURCE_AGENCY[s] ?? s;
40
- const sourcesOf = (f) => Array.isArray(f.properties?.sources) ? f.properties.sources : [];
41
- /**
42
- * Render the cross-dataset-links GeoJSON to a bucket-colored MapLibre html page.
43
- */
44
- export async function crossDatasetMap(options = {}, report) {
45
- const IN = options.in || dataRootPath("record-matcher", "2026-06-16-cross-dataset-links.geojson");
46
- const OUT = options.outHTML || tempRootPath("cross-dataset-map.html");
47
- const CROSS_AGENCY_ONLY = options.crossAgencyOnly ?? false;
48
- const parsed = await readLocalJSONFile(IN);
49
- const total = parsed.features.length;
50
- const geojson = CROSS_AGENCY_ONLY
51
- ? { ...parsed, features: parsed.features.filter((f) => new Set(sourcesOf(f).map(agencyOf)).size > 1) }
52
- : parsed;
53
- // Synthesize a `bucket` per entity = its sorted source-combination, so toMapHTML colors by the link
54
- // type (two-source vs the rarer all-three-source spans) rather than the binary cross/single status.
55
- let triple = 0;
56
- const comboCounts = new Map();
57
- for (const f of geojson.features) {
58
- const combo = [...new Set(sourcesOf(f))].toSorted();
59
- const bucket = combo.map(label).join(" + ") || "unlinked";
60
- if (f.properties) {
61
- f.properties.bucket = bucket;
62
- }
63
- if (new Set(combo.map(agencyOf)).size >= MIN_DISTINCT_AGENCIES) {
64
- triple++;
65
- }
66
- comboCounts.set(bucket, (comboCounts.get(bucket) ?? 0) + 1);
67
- }
68
- const kept = geojson.features.length;
69
- const scope = CROSS_AGENCY_ONLY ? "across agencies" : "across sources";
70
- const html = toMapHTML(geojson, {
71
- title: `Cross-dataset entity links — ${kept} resolved ${scope} (no shared key)`,
72
- flavor: "light",
73
- colorBy: "bucket",
74
- });
75
- await writeLocalFile(html, OUT);
76
- report?.(`[written] ${OUT} (${kept}${CROSS_AGENCY_ONLY ? ` of ${total} cross-AGENCY` : ""} entities)`);
77
- report?.(` source combinations:`);
78
- for (const [combo, n] of [...comboCounts.entries()].toSorted((a, b) => b[1] - a[1])) {
79
- report?.(` ${n.toString().padStart(4)} ${combo}`);
80
- }
81
- report?.(` spanning all three agencies: ${triple}`);
82
- return { outHTML: OUT, kept, total, triple };
83
- }
84
- //# sourceMappingURL=cross-dataset-map.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cross-dataset-map.js","sourceRoot":"","sources":["../../../tools/viz/cross-dataset-map.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAG3D,OAAO,EAAuB,SAAS,EAAE,MAAM,QAAQ,CAAA;AAEvD;;GAEG;AACH,MAAM,qBAAqB,GAAG,CAAC,CAAA;AAwB/B,MAAM,aAAa,GAA2B;IAC7C,KAAK,EAAE,OAAO;IACd,SAAS,EAAE,SAAS;IACpB,qBAAqB,EAAE,iBAAiB;IACxC,gBAAgB,EAAE,SAAS;CAC3B,CAAA;AAED,MAAM,KAAK,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;AAElD;;;;;;;;GAQG;AACH,MAAM,aAAa,GAA2B;IAC7C,KAAK,EAAE,KAAK;IACZ,SAAS,EAAE,KAAK;IAChB,qBAAqB,EAAE,KAAK;IAC5B,gBAAgB,EAAE,SAAS;CAC3B,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;AAErD,MAAM,SAAS,GAAG,CAAC,CAA2C,EAAY,EAAE,CAC3E,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EA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AAA;IACtD,CAAC;IAED,MAAM,EAAE,CAAC,kCAAkC,MAAM,EAAE,CAAC,CAAA;IAEpD,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,CAAA;AAC7C,CAAC"}
@@ -1,36 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * Plot string-only and string-plus-distance match probabilities using the record matcher's
7
- * Fellegi-Sunter weights. The supplied prior is illustrative and the output is self-contained html.
8
- */
9
- /**
10
- * Options for {@linkcode geocodeFirstSurface}.
11
- */
12
- export interface GeocodeFirstSurfaceOptions {
13
- /**
14
- * Illustrative prior λ.
15
- *
16
- * Production's record matcher uses λ=1e-4 (calibrated for the full multi-field model with phone
17
- *
18
- * - Spatial exact-key); here we want the boundary visible in a two-axis projection.
19
- *
20
- * @defaultValue `0.02`
21
- */
22
- lambda?: number;
23
- /**
24
- * Output html path.
25
- *
26
- * @defaultValue `/tmp/geocode-first-surface.html`
27
- */
28
- outHTML?: string;
29
- }
30
- /**
31
- * Emit the geocode-first decision-surface Plotly html — see the module doc.
32
- */
33
- export declare function geocodeFirstSurface(options?: GeocodeFirstSurfaceOptions, report?: (line: string) => void): Promise<{
34
- outHTML: string;
35
- }>;
36
- //# sourceMappingURL=geocode-first-surface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"geocode-first-surface.d.ts","sourceRoot":"","sources":["../../../tools/viz/geocode-first-surface.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH;;GAEG;AACH,MAAM,WAAW,0BAA0B;IAC1C;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CAChB;AAuDD;;GAEG;AACH,wBAAsB,mBAAmB,CACxC,OAAO,GAAE,0BAA+B,EACxC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC,CAkN9B"}
@@ -1,234 +0,0 @@
1
- /**
2
- * @copyright Sister Software
3
- * @license AGPL-3.0
4
- * @author Teffen Ellis, et al.
5
- *
6
- * Plot string-only and string-plus-distance match probabilities using the record matcher's
7
- * Fellegi-Sunter weights. The supplied prior is illustrative and the output is self-contained html.
8
- */
9
- import { tempRootPath } from "@mailwoman/core/data-root";
10
- import { writeLocalFile } from "@mailwoman/core/fs/writers";
11
- import { stringifyJSON } from "@mailwoman/core/json";
12
- /**
13
- * Registry/resolve.ts → NAME_LEVELS.
14
- */
15
- const NAME_LEVELS = [
16
- { label: "exact", minSimilarity: 1, m: 0.8, u: 0.01 },
17
- { label: "high", minSimilarity: 0.88, m: 0.15, u: 0.03 },
18
- { label: "different", minSimilarity: 0, m: 0.05, u: 0.96 },
19
- ];
20
- /**
21
- * Match/distance.ts → DEFAULT_DISTANCE_LEVELS.
22
- */
23
- const DISTANCE_LEVELS = [
24
- { label: "same-building", maxKm: 0.05, m: 0.7, u: 0.001 },
25
- { label: "same-block", maxKm: 0.5, m: 0.2, u: 0.02 },
26
- { label: "same-area", maxKm: 5, m: 0.08, u: 0.2 },
27
- { label: "far", m: 0.02, u: 0.779 },
28
- ];
29
- // match/fellegi-sunter.ts → levelWeight / priorWeight / probabilityFromWeight
30
- const levelWeight = (lvl) => (lvl.u <= 0 ? (lvl.m > 0 ? Infinity : 0) : Math.log2(lvl.m / lvl.u));
31
- const priorWeight = (lambda) => Math.log2(lambda / (1 - lambda));
32
- const probabilityFromWeight = (w) => 1 / (1 + 2 ** -w);
33
- /**
34
- * Assign a name-similarity score to its agreement-level weight (levels ordered high→low sim).
35
- */
36
- function nameWeight(sim) {
37
- for (const lvl of NAME_LEVELS)
38
- if (sim >= (lvl.minSimilarity ?? 0))
39
- return levelWeight(lvl);
40
- return levelWeight(NAME_LEVELS.at(-1));
41
- }
42
- /**
43
- * Assign a distance (km) to its agreement-level weight (levels ordered near→far).
44
- */
45
- function distanceWeight(km) {
46
- for (const lvl of DISTANCE_LEVELS)
47
- if (km <= (lvl.maxKm ?? Infinity))
48
- return levelWeight(lvl);
49
- return levelWeight(DISTANCE_LEVELS.at(-1));
50
- }
51
- /**
52
- * Emit the geocode-first decision-surface Plotly html — see the module doc.
53
- */
54
- export async function geocodeFirstSurface(options = {}, report) {
55
- const LAMBDA = options.lambda ?? 0.02;
56
- const OUT_HTML = options.outHTML || tempRootPath("geocode-first-surface.html");
57
- const PRIOR = priorWeight(LAMBDA);
58
- /**
59
- * String-first model: name evidence only — distance is invisible to it.
60
- */
61
- const pStringFirst = (sim, _km) => probabilityFromWeight(PRIOR + nameWeight(sim));
62
- /**
63
- * Geocode-first model: name + distance evidence.
64
- */
65
- const pGeocodeFirst = (sim, km) => probabilityFromWeight(PRIOR + nameWeight(sim) + distanceWeight(km));
66
- // ── Grid.
67
- // X = string similarity 0→1.
68
- // Y = geographic distance, sampled denser near 0 (log-ish) so the meaningful same-building
69
- // / same-block transitions aren't a single pixel. ────────────────
70
- const NX = 60;
71
- const NY = 60;
72
- const KM_MAX = 50; // 0 → 50 km, log-spaced
73
- const simAxis = Array.from({ length: NX }, (_, i) => i / (NX - 1));
74
- // log-spaced distance: 0.005 km (5 m) → 50 km, plus a literal 0 at the front
75
- const kmAxis = Array.from({ length: NY }, (_, j) => {
76
- const t = j / (NY - 1);
77
- return 0.005 * Math.pow(KM_MAX / 0.005, t);
78
- });
79
- function surface(p) {
80
- // Plotly z is row-major over y (distance), each row across x (similarity).
81
- return kmAxis.map((km) => simAxis.map((sim) => p(sim, km)));
82
- }
83
- const zString = surface(pStringFirst);
84
- const zGeo = surface(pGeocodeFirst);
85
- const TRAPS = [
86
- {
87
- label: "Springfield General — IL vs MA",
88
- detail: "identical name, ~1500 km apart",
89
- sim: 1,
90
- km: 15, // plotted on the far plateau (real distance ~1500 km. clamped into view)
91
- },
92
- {
93
- // "St" → "Street" canonicalizes to a high (not exact) name agreement.
94
- // The trailing "Apt 2" keeps it off 1.0.
95
- // Lands in the 0.88 "high" tier — same place, drifted-but-recognizable string.
96
- label: "123 Main St vs 123 Main Street Apt 2",
97
- detail: "same building, drifted string",
98
- sim: 0.9,
99
- km: 0.01,
100
- },
101
- ];
102
- // Decision verdicts at each trap (for the annotation text).
103
- const verdict = (p) => (p >= 0.5 ? "MATCH" : "no");
104
- const trapRows = TRAPS.map((t) => ({
105
- ...t,
106
- stringP: pStringFirst(t.sim, t.km),
107
- geoP: pGeocodeFirst(t.sim, t.km),
108
- }));
109
- // ── html. ───────────────────────────────────────────────────────────────────────────────────────
110
- const data = {
111
- simAxis,
112
- kmAxis,
113
- zString,
114
- zGeo,
115
- traps: trapRows,
116
- lambda: LAMBDA,
117
- prior: PRIOR,
118
- };
119
- // Every `<`, not only `</script>`: `<!--` also leaves script-data state in the html
120
- // tokenizer, after which a later `</script>` no longer ends the element.
121
- // `\u003c` is the same string to a JSON reader.
122
- const safe = stringifyJSON(data).replaceAll("<", "\\u003c");
123
- const html = `<!doctype html><html><head><meta charset="utf-8"/>
124
- <script src="https://cdn.plot.ly/plotly-2.35.2.min.js"></script>
125
- <style>
126
- body{margin:0;font-family:system-ui,-apple-system,sans-serif;background:#fff;color:#111}
127
- h1{font-size:18px;margin:14px 0 2px 20px}
128
- h2{font-size:14px;margin:14px 0 0 20px;font-weight:600}
129
- p.sub{margin:2px 20px 0;color:#555;font-size:12px;max-width:1100px;line-height:1.45}
130
- #pair{width:1120px;height:440px}
131
- #contour{width:1120px;height:520px}
132
- .cap{margin:6px 20px 14px;color:#666;font-size:11px;max-width:1100px;line-height:1.4}
133
- </style></head><body>
134
- <h1>Two ways to draw the line — string-first vs geocode-first</h1>
135
- <p class="sub">P(match) over the same record-pair space: string similarity (x) × geographic distance (y).
136
- Same Fellegi-Sunter scorer, real per-level Bayes factors; the only difference is which evidence each
137
- model may see. <b>String-first</b> sees the name only — its boundary is a vertical wall at high
138
- similarity, blind to where the records are. <b>Geocode-first</b> also sees distance — the wall bends,
139
- becoming a basin you can only climb out of <i>near a shared place</i>.</p>
140
- <div id="pair"></div>
141
- <h2>The decision boundary, read from above</h2>
142
- <p class="sub">The geocode-first P(match) contour with the string-first boundary (dashed) drawn for
143
- contrast, and the two traps string matching was built to fall into. Geocode-first puts the far-apart
144
- namesakes in the reject basin and pulls the same-building pair across the line — string-first inverts
145
- both.</p>
146
- <div id="contour"></div>
147
- <p class="cap" id="cap"></p>
148
- <script>
149
- const D = ${safe};
150
- const COMMON_SCENE = (title) => ({
151
- xaxis:{title:"string similarity", range:[0,1], backgroundcolor:"#fafafa", gridcolor:"#e5e5e5"},
152
- yaxis:{title:"distance (km, log)", type:"log", backgroundcolor:"#fafafa", gridcolor:"#e5e5e5"},
153
- zaxis:{title:"P(match)", range:[0,1], gridcolor:"#e5e5e5"},
154
- camera:{eye:{x:-1.6,y:-1.5,z:0.9}},
155
- aspectratio:{x:1,y:1,z:0.6}
156
- });
157
- const surfFor = (z, name, colorscale) => ({
158
- type:"surface", z:z, x:D.simAxis, y:D.kmAxis, name:name,
159
- colorscale:colorscale, cmin:0, cmax:1, showscale:false,
160
- contours:{z:{show:true, usecolormap:true, project:{z:true}, start:0, end:1, size:0.1}},
161
- lighting:{ambient:0.75, diffuse:0.6, roughness:0.9}, opacity:1
162
- });
163
- Plotly.newPlot("pair", [
164
- Object.assign(surfFor(D.zString, "string-first", "YlOrRd"), {scene:"scene"}),
165
- Object.assign(surfFor(D.zGeo, "geocode-first", "Viridis"), {scene:"scene2"})
166
- ], {
167
- margin:{l:0,r:0,t:24,b:0},
168
- scene:Object.assign(COMMON_SCENE(), {domain:{x:[0,0.48]}}),
169
- scene2:Object.assign(COMMON_SCENE(), {domain:{x:[0.52,1]}}),
170
- annotations:[],
171
- showlegend:false
172
- }, {displayModeBar:false, responsive:false}).then(()=>{
173
- // titles over each scene
174
- Plotly.relayout("pair", {
175
- "annotations":[
176
- {text:"<b>STRING-FIRST</b> — name only (vertical wall)", x:0.22, y:1.04, xref:"paper", yref:"paper", showarrow:false, font:{size:13, color:"#b3402a"}},
177
- {text:"<b>GEOCODE-FIRST</b> — name + distance (basin)", x:0.78, y:1.04, xref:"paper", yref:"paper", showarrow:false, font:{size:13, color:"#2a6b6b"}}
178
- ]
179
- });
180
- });
181
-
182
- // 2D contour of geocode-first, traps annotated.
183
- const trapX = D.traps.map(t=>t.sim);
184
- const trapY = D.traps.map(t=>Math.max(t.km, D.kmAxis[0]));
185
- Plotly.newPlot("contour", [
186
- {type:"contour", z:D.zGeo, x:D.simAxis, y:D.kmAxis, colorscale:"Viridis", zmin:0, zmax:1,
187
- contours:{coloring:"heatmap", showlines:true, start:0, end:1, size:0.1,
188
- // emphasize the P=0.5 decision isocline
189
- }, colorbar:{title:"P(match)", thickness:12, len:0.8}},
190
- // string-first boundary: vertical line where name alone crosses 0.5
191
- {type:"scatter", mode:"lines", x:[0.985,0.985], y:[D.kmAxis[0], D.kmAxis[D.kmAxis.length-1]],
192
- line:{color:"#b3402a", width:2, dash:"dash"}, name:"string-first boundary", hoverinfo:"name"},
193
- {type:"scatter", mode:"markers+text", x:trapX, y:trapY,
194
- marker:{size:13, color:"#fff", line:{color:"#111", width:2}, symbol:"x-thin", "line.width":3},
195
- text:D.traps.map((t,i)=> (i===0?"①":"②")), textposition:"middle center",
196
- textfont:{size:13,color:"#111"}, name:"traps", hoverinfo:"text",
197
- hovertext:D.traps.map(t=>t.label)}
198
- ], {
199
- margin:{l:70,r:20,t:10,b:50},
200
- yaxis:{title:"geographic distance (km, log)", type:"log", range:[Math.log10(D.kmAxis[0]), Math.log10(D.kmAxis[D.kmAxis.length-1])], autorange:false},
201
- xaxis:{title:"string similarity", range:[0,1]},
202
- showlegend:true, legend:{x:0.62, y:0.06, bgcolor:"rgba(255,255,255,0.85)", font:{size:11}},
203
- shapes:[0.05,0.5,5].map((km)=>({type:"line", xref:"paper", x0:0, x1:1, yref:"y", y0:km, y1:km, line:{color:"rgba(255,255,255,0.45)", width:1, dash:"dot"}})),
204
- annotations:[
205
- {x:0.015, y:0.05, text:"same-building", showarrow:false, font:{size:9,color:"#eee"}, xanchor:"left", yanchor:"bottom"},
206
- {x:0.015, y:0.5, text:"same-block", showarrow:false, font:{size:9,color:"#eee"}, xanchor:"left", yanchor:"bottom"},
207
- {x:0.015, y:5, text:"same-area", showarrow:false, font:{size:9,color:"#ddd"}, xanchor:"left", yanchor:"bottom"},
208
- // Paper-anchored callout boxes (stable placement), each tied to its ①/② marker, with a paper→data arrow.
209
- {xref:"paper", yref:"paper", x:0.30, y:0.86, ax:trapX[0], ay:trapY[0], axref:"x", ayref:"y",
210
- text:"① "+D.traps[0].label+"<br>"+D.traps[0].detail+"<br><b>string-first: MATCH ✗ · geocode-first: reject ✓</b>",
211
- showarrow:true, arrowhead:2, arrowcolor:"#b3402a", align:"left", font:{size:10,color:"#111"}, bgcolor:"rgba(255,255,255,0.94)", bordercolor:"#b3402a", borderpad:3},
212
- {xref:"paper", yref:"paper", x:0.30, y:0.30, ax:trapX[1], ay:trapY[1], axref:"x", ayref:"y",
213
- text:"② "+D.traps[1].label+"<br>"+D.traps[1].detail+"<br><b>string-first: reject ✗ · geocode-first: MATCH ✓</b>",
214
- showarrow:true, arrowhead:2, arrowcolor:"#2a6b6b", align:"left", font:{size:10,color:"#111"}, bgcolor:"rgba(255,255,255,0.94)", bordercolor:"#2a6b6b", borderpad:3}
215
- ]
216
- }, {displayModeBar:false, responsive:false});
217
-
218
- const fmt = (p)=> (p*100).toFixed(p>=0.5?0:1)+"%";
219
- document.getElementByID("cap").innerHTML =
220
- "Real per-level Bayes factors (NAME_LEVELS, DEFAULT_DISTANCE_LEVELS); illustrative prior λ="+D.lambda+
221
- " (production λ=1e-4 + phone/spatial-key corroboration, omitted here to isolate the two-axis boundary). "+
222
- "Trap ① string-first="+fmt(D.traps[0].stringP)+" (MATCH ✗) · geocode-first="+fmt(D.traps[0].geoP)+" (reject ✓). "+
223
- "Trap ② string-first="+fmt(D.traps[1].stringP)+" (reject ✗) · geocode-first="+fmt(D.traps[1].geoP)+" (MATCH ✓).";
224
- </script>
225
- </body></html>`;
226
- await writeLocalFile(html, OUT_HTML);
227
- report?.(`[written] ${OUT_HTML}`);
228
- report?.(`λ=${LAMBDA} prior=${PRIOR.toFixed(2)} bits`);
229
- for (const t of trapRows) {
230
- report?.(` ${t.label}: string-first ${(t.stringP * 100).toFixed(1)}% (${verdict(t.stringP)}) | geocode-first ${(t.geoP * 100).toFixed(1)}% (${verdict(t.geoP)})`);
231
- }
232
- return { outHTML: OUT_HTML };
233
- }
234
- //# sourceMappingURL=geocode-first-surface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"geocode-first-surface.js","sourceRoot":"","sources":["../../../tools/viz/geocode-first-surface.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAmCpD;;GAEG;AACH,MAAM,WAAW,GAAY;IAC5B,EAAE,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,IAAI,EAAE;IACrD,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE;IACxD,EAAE,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE;CAC1D,CAAA;AAED;;GAEG;AACH,MAAM,eAAe,GAAY;IAChC,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE;IACzD,EAAE,KAAK,EAAE,YAAY,EA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