@mailwoman/registry 9.1.0 → 9.3.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 (228) hide show
  1. package/README.md +2 -2
  2. package/{address-key.ts → lib/address-key.ts} +1 -1
  3. package/{geocode-handler.ts → lib/geocode-handler.ts} +7 -7
  4. package/{geojson.ts → lib/geojson.ts} +12 -6
  5. package/{index.ts → lib/index.ts} +10 -10
  6. package/{ingest.ts → lib/ingest.ts} +77 -69
  7. package/{learned-scorer.ts → lib/learned-scorer.ts} +1 -1
  8. package/{map-html.ts → lib/map-html.ts} +10 -16
  9. package/{reconcile.ts → lib/reconcile.ts} +9 -24
  10. package/{resolve.ts → lib/resolve.ts} +31 -13
  11. package/{tools → lib/tools}/coverage-reconciliation.ts +13 -15
  12. package/{tools → lib/tools}/cross-dataset-correlation.ts +64 -139
  13. package/{tools → lib/tools}/cross-source-threshold-sweep.ts +21 -32
  14. package/{tools → lib/tools}/dedup-ceiling.ts +33 -144
  15. package/{tools → lib/tools}/eval-geocoder.ts +10 -11
  16. package/{tools → lib/tools}/geocoder-namesake-probe.ts +5 -12
  17. package/{tools → lib/tools}/geocoder-vs-provided-coords.ts +12 -11
  18. package/lib/tools/gold-set-sample.ts +141 -0
  19. package/lib/tools/index.ts +31 -0
  20. package/{tools → lib/tools}/learned-scorer-clustering-eval.ts +71 -260
  21. package/{tools → lib/tools}/learned-scorer-crossstate-eval.ts +62 -245
  22. package/{tools → lib/tools}/learned-scorer-eval.ts +64 -263
  23. package/{tools → lib/tools}/matcher-scale.ts +5 -5
  24. package/lib/tools/nppes/org-name.ts +23 -0
  25. package/lib/tools/nppes/overmerge-packet.ts +94 -0
  26. package/lib/tools/nppes/report.ts +373 -0
  27. package/lib/tools/nppes/sample.ts +245 -0
  28. package/lib/tools/nppes/scoring.ts +114 -0
  29. package/lib/tools/nppes/settings.ts +102 -0
  30. package/lib/tools/nppes/truth-grains.ts +161 -0
  31. package/lib/tools/nppes-dedup-benchmark.ts +408 -0
  32. package/lib/tools/shared.ts +763 -0
  33. package/lib/tools/train-cross-gbt.ts +209 -0
  34. package/{tools → lib/tools}/train-gbt.ts +38 -156
  35. package/lib/tools/train-org-cross-gbt.ts +179 -0
  36. package/{tools → lib/tools}/txhhsc-to-oarow.ts +10 -28
  37. package/lib/tools/viz/browser.ts +50 -0
  38. package/{tools → lib/tools}/viz/cross-dataset-map.ts +16 -39
  39. package/{tools → lib/tools}/viz/geocode-first-surface.ts +13 -39
  40. package/{tools → lib/tools}/viz/render-map.ts +10 -23
  41. package/lib/tools/viz/render.ts +98 -0
  42. package/{tools → lib/tools}/viz/source-provenance-map.ts +20 -39
  43. package/{tools → lib/tools}/viz/yardstick-figure.ts +6 -5
  44. package/{types.ts → lib/types.ts} +10 -1
  45. package/out/address-key.d.ts +1 -1
  46. package/out/address-key.d.ts.map +1 -1
  47. package/out/address-key.js.map +1 -1
  48. package/out/geocode-handler.d.ts +6 -6
  49. package/out/geocode-handler.d.ts.map +1 -1
  50. package/out/geocode-handler.js +6 -6
  51. package/out/geocode-handler.js.map +1 -1
  52. package/out/geojson.d.ts +7 -2
  53. package/out/geojson.d.ts.map +1 -1
  54. package/out/geojson.js +8 -5
  55. package/out/geojson.js.map +1 -1
  56. package/out/index.d.ts +10 -10
  57. package/out/index.d.ts.map +1 -1
  58. package/out/index.js +10 -10
  59. package/out/index.js.map +1 -1
  60. package/out/ingest.d.ts +64 -46
  61. package/out/ingest.d.ts.map +1 -1
  62. package/out/ingest.js +33 -46
  63. package/out/ingest.js.map +1 -1
  64. package/out/learned-scorer.d.ts +1 -1
  65. package/out/learned-scorer.d.ts.map +1 -1
  66. package/out/learned-scorer.js.map +1 -1
  67. package/out/map-html.d.ts +4 -4
  68. package/out/map-html.d.ts.map +1 -1
  69. package/out/map-html.js +6 -11
  70. package/out/map-html.js.map +1 -1
  71. package/out/models/crosssource-gbt-en-us.d.ts.map +1 -1
  72. package/out/models/crosssource-gbt-en-us.js.map +1 -1
  73. package/out/models/dedup-gbt-en-us.d.ts.map +1 -1
  74. package/out/models/dedup-gbt-en-us.js.map +1 -1
  75. package/out/models/org-crosssource-gbt-en-us.d.ts.map +1 -1
  76. package/out/models/org-crosssource-gbt-en-us.js.map +1 -1
  77. package/out/reconcile.d.ts +6 -1
  78. package/out/reconcile.d.ts.map +1 -1
  79. package/out/reconcile.js +7 -21
  80. package/out/reconcile.js.map +1 -1
  81. package/out/resolve.d.ts +19 -7
  82. package/out/resolve.d.ts.map +1 -1
  83. package/out/resolve.js +20 -6
  84. package/out/resolve.js.map +1 -1
  85. package/out/tools/coverage-reconciliation.d.ts +1 -1
  86. package/out/tools/coverage-reconciliation.d.ts.map +1 -1
  87. package/out/tools/coverage-reconciliation.js +12 -12
  88. package/out/tools/coverage-reconciliation.js.map +1 -1
  89. package/out/tools/cross-dataset-correlation.d.ts +4 -4
  90. package/out/tools/cross-dataset-correlation.d.ts.map +1 -1
  91. package/out/tools/cross-dataset-correlation.js +60 -111
  92. package/out/tools/cross-dataset-correlation.js.map +1 -1
  93. package/out/tools/cross-source-threshold-sweep.d.ts +2 -2
  94. package/out/tools/cross-source-threshold-sweep.d.ts.map +1 -1
  95. package/out/tools/cross-source-threshold-sweep.js +19 -27
  96. package/out/tools/cross-source-threshold-sweep.js.map +1 -1
  97. package/out/tools/dedup-ceiling.d.ts.map +1 -1
  98. package/out/tools/dedup-ceiling.js +36 -118
  99. package/out/tools/dedup-ceiling.js.map +1 -1
  100. package/out/tools/eval-geocoder.d.ts +9 -13
  101. package/out/tools/eval-geocoder.d.ts.map +1 -1
  102. package/out/tools/eval-geocoder.js +2 -2
  103. package/out/tools/eval-geocoder.js.map +1 -1
  104. package/out/tools/geocoder-namesake-probe.d.ts +2 -2
  105. package/out/tools/geocoder-namesake-probe.d.ts.map +1 -1
  106. package/out/tools/geocoder-namesake-probe.js +4 -8
  107. package/out/tools/geocoder-namesake-probe.js.map +1 -1
  108. package/out/tools/geocoder-vs-provided-coords.d.ts +1 -1
  109. package/out/tools/geocoder-vs-provided-coords.d.ts.map +1 -1
  110. package/out/tools/geocoder-vs-provided-coords.js +11 -9
  111. package/out/tools/geocoder-vs-provided-coords.js.map +1 -1
  112. package/out/tools/gold-set-sample.d.ts +5 -5
  113. package/out/tools/gold-set-sample.d.ts.map +1 -1
  114. package/out/tools/gold-set-sample.js +37 -121
  115. package/out/tools/gold-set-sample.js.map +1 -1
  116. package/out/tools/index.d.ts +24 -29
  117. package/out/tools/index.d.ts.map +1 -1
  118. package/out/tools/index.js +24 -29
  119. package/out/tools/index.js.map +1 -1
  120. package/out/tools/learned-scorer-clustering-eval.d.ts +1 -1
  121. package/out/tools/learned-scorer-clustering-eval.d.ts.map +1 -1
  122. package/out/tools/learned-scorer-clustering-eval.js +35 -170
  123. package/out/tools/learned-scorer-clustering-eval.js.map +1 -1
  124. package/out/tools/learned-scorer-crossstate-eval.d.ts +5 -5
  125. package/out/tools/learned-scorer-crossstate-eval.d.ts.map +1 -1
  126. package/out/tools/learned-scorer-crossstate-eval.js +44 -166
  127. package/out/tools/learned-scorer-crossstate-eval.js.map +1 -1
  128. package/out/tools/learned-scorer-eval.d.ts +1 -1
  129. package/out/tools/learned-scorer-eval.d.ts.map +1 -1
  130. package/out/tools/learned-scorer-eval.js +37 -173
  131. package/out/tools/learned-scorer-eval.js.map +1 -1
  132. package/out/tools/matcher-scale.d.ts.map +1 -1
  133. package/out/tools/matcher-scale.js +5 -5
  134. package/out/tools/matcher-scale.js.map +1 -1
  135. package/out/tools/nppes/org-name.d.ts +21 -0
  136. package/out/tools/nppes/org-name.d.ts.map +1 -0
  137. package/out/tools/nppes/org-name.js +13 -0
  138. package/out/tools/nppes/org-name.js.map +1 -0
  139. package/out/tools/nppes/overmerge-packet.d.ts +39 -0
  140. package/out/tools/nppes/overmerge-packet.d.ts.map +1 -0
  141. package/out/tools/nppes/overmerge-packet.js +55 -0
  142. package/out/tools/nppes/overmerge-packet.js.map +1 -0
  143. package/out/tools/nppes/report.d.ts +93 -0
  144. package/out/tools/nppes/report.d.ts.map +1 -0
  145. package/out/tools/nppes/report.js +186 -0
  146. package/out/tools/nppes/report.js.map +1 -0
  147. package/out/tools/nppes/sample.d.ts +90 -0
  148. package/out/tools/nppes/sample.d.ts.map +1 -0
  149. package/out/tools/nppes/sample.js +131 -0
  150. package/out/tools/nppes/sample.js.map +1 -0
  151. package/out/tools/nppes/scoring.d.ts +36 -0
  152. package/out/tools/nppes/scoring.d.ts.map +1 -0
  153. package/out/tools/nppes/scoring.js +80 -0
  154. package/out/tools/nppes/scoring.js.map +1 -0
  155. package/out/tools/nppes/settings.d.ts +38 -0
  156. package/out/tools/nppes/settings.d.ts.map +1 -0
  157. package/out/tools/nppes/settings.js +79 -0
  158. package/out/tools/nppes/settings.js.map +1 -0
  159. package/out/tools/nppes/truth-grains.d.ts +50 -0
  160. package/out/tools/nppes/truth-grains.d.ts.map +1 -0
  161. package/out/tools/nppes/truth-grains.js +123 -0
  162. package/out/tools/nppes/truth-grains.js.map +1 -0
  163. package/out/tools/nppes-dedup-benchmark.d.ts +7 -3
  164. package/out/tools/nppes-dedup-benchmark.d.ts.map +1 -1
  165. package/out/tools/nppes-dedup-benchmark.js +106 -673
  166. package/out/tools/nppes-dedup-benchmark.js.map +1 -1
  167. package/out/tools/shared.d.ts +244 -7
  168. package/out/tools/shared.d.ts.map +1 -1
  169. package/out/tools/shared.js +353 -21
  170. package/out/tools/shared.js.map +1 -1
  171. package/out/tools/train-cross-gbt.d.ts +7 -7
  172. package/out/tools/train-cross-gbt.d.ts.map +1 -1
  173. package/out/tools/train-cross-gbt.js +47 -145
  174. package/out/tools/train-cross-gbt.js.map +1 -1
  175. package/out/tools/train-gbt.d.ts +7 -7
  176. package/out/tools/train-gbt.d.ts.map +1 -1
  177. package/out/tools/train-gbt.js +31 -111
  178. package/out/tools/train-gbt.js.map +1 -1
  179. package/out/tools/train-org-cross-gbt.d.ts +7 -5
  180. package/out/tools/train-org-cross-gbt.d.ts.map +1 -1
  181. package/out/tools/train-org-cross-gbt.js +45 -141
  182. package/out/tools/train-org-cross-gbt.js.map +1 -1
  183. package/out/tools/txhhsc-to-oarow.d.ts +2 -2
  184. package/out/tools/txhhsc-to-oarow.d.ts.map +1 -1
  185. package/out/tools/txhhsc-to-oarow.js +9 -23
  186. package/out/tools/txhhsc-to-oarow.js.map +1 -1
  187. package/out/tools/viz/browser.d.ts +34 -0
  188. package/out/tools/viz/browser.d.ts.map +1 -0
  189. package/out/tools/viz/browser.js +33 -0
  190. package/out/tools/viz/browser.js.map +1 -0
  191. package/out/tools/viz/cross-dataset-map.d.ts +4 -25
  192. package/out/tools/viz/cross-dataset-map.d.ts.map +1 -1
  193. package/out/tools/viz/cross-dataset-map.js +12 -33
  194. package/out/tools/viz/cross-dataset-map.js.map +1 -1
  195. package/out/tools/viz/geocode-first-surface.d.ts +6 -35
  196. package/out/tools/viz/geocode-first-surface.d.ts.map +1 -1
  197. package/out/tools/viz/geocode-first-surface.js +10 -37
  198. package/out/tools/viz/geocode-first-surface.js.map +1 -1
  199. package/out/tools/viz/render-map.d.ts +3 -6
  200. package/out/tools/viz/render-map.d.ts.map +1 -1
  201. package/out/tools/viz/render-map.js +9 -19
  202. package/out/tools/viz/render-map.js.map +1 -1
  203. package/out/tools/viz/render.d.ts +4 -9
  204. package/out/tools/viz/render.d.ts.map +1 -1
  205. package/out/tools/viz/render.js +24 -39
  206. package/out/tools/viz/render.js.map +1 -1
  207. package/out/tools/viz/source-provenance-map.d.ts +4 -24
  208. package/out/tools/viz/source-provenance-map.d.ts.map +1 -1
  209. package/out/tools/viz/source-provenance-map.js +12 -32
  210. package/out/tools/viz/source-provenance-map.js.map +1 -1
  211. package/out/tools/viz/yardstick-figure.d.ts +2 -2
  212. package/out/tools/viz/yardstick-figure.d.ts.map +1 -1
  213. package/out/tools/viz/yardstick-figure.js +5 -4
  214. package/out/tools/viz/yardstick-figure.js.map +1 -1
  215. package/out/types.d.ts +11 -1
  216. package/out/types.d.ts.map +1 -1
  217. package/out/types.js.map +1 -1
  218. package/package.json +180 -11
  219. package/tools/gold-set-sample.ts +0 -252
  220. package/tools/index.ts +0 -36
  221. package/tools/nppes-dedup-benchmark.ts +0 -1180
  222. package/tools/shared.ts +0 -160
  223. package/tools/train-cross-gbt.ts +0 -358
  224. package/tools/train-org-cross-gbt.ts +0 -329
  225. package/tools/viz/render.ts +0 -113
  226. /package/{models → lib/models}/crosssource-gbt-en-us.ts +0 -0
  227. /package/{models → lib/models}/dedup-gbt-en-us.ts +0 -0
  228. /package/{models → lib/models}/org-crosssource-gbt-en-us.ts +0 -0
@@ -14,30 +14,12 @@
14
14
  * Run: `mailwoman registry convert tx-hhsc [--src <tsv>] [--out /tmp/txhhsc-oarow.jsonl]`
15
15
  */
16
16
 
17
- import { readFileSync, writeFileSync } from "node:fs"
18
-
19
- import { dataRootPath } from "@mailwoman/core/utils"
17
+ import { dataRootPath, tempRootPath } from "@mailwoman/core/data-root"
18
+ import { readLocalTextFile } from "@mailwoman/core/fs/readers"
19
+ import { writeLocalTextFile } from "@mailwoman/core/fs/writers"
20
20
  import { TSVSpliterator } from "spliterator"
21
21
 
22
- /**
23
- * Texas bounding box, used to reject rows whose coordinates landed in the wrong state.
24
- */
25
- const TX_MIN_LATITUDE = 25
26
-
27
- /**
28
- * See {@link TX_MIN_LATITUDE}.
29
- */
30
- const TX_MAX_LATITUDE = 37
31
-
32
- /**
33
- * See {@link TX_MIN_LATITUDE}.
34
- */
35
- const TX_MIN_LONGITUDE = -107
36
-
37
- /**
38
- * See {@link TX_MIN_LATITUDE}.
39
- */
40
- const TX_MAX_LONGITUDE = -93
22
+ import { inTXBBOX } from "#tools/shared"
41
23
 
42
24
  /**
43
25
  * Options for {@linkcode convertTXHHSC}.
@@ -58,12 +40,12 @@ const GEO = /^\s*(-?\d+\.\d+)\s*,\s*(-?\d+\.\d+)\s*$/
58
40
  /**
59
41
  * Convert the TX HHSC nursing-facilities TSV into OaRow JSONL for `oa-resolver-eval`.
60
42
  */
61
- export function convertTXHHSC(
43
+ export async function convertTXHHSC(
62
44
  options: TXHHSCConvertOptions = {},
63
45
  report?: (line: string) => void
64
- ): { written: number; skipped: number; out: string } {
46
+ ): Promise<{ written: number; skipped: number; out: string }> {
65
47
  const src = options.src || String(dataRootPath("record-matcher", "sources", "txhhsc_nursing-facilities_20260611.tsv"))
66
- const out = options.out || "/tmp/txhhsc-oarow.jsonl"
48
+ const out = options.out || tempRootPath("txhhsc-oarow.jsonl")
67
49
 
68
50
  const records: string[] = []
69
51
  let skipped = 0
@@ -76,7 +58,7 @@ export function convertTXHHSC(
76
58
  let cGeo = -1
77
59
  let sawHeader = false
78
60
 
79
- for (const f of TSVSpliterator.from(readFileSync(src, "utf8"), { header: false })) {
61
+ for (const f of TSVSpliterator.from(await readLocalTextFile(src), { header: false })) {
80
62
  if (f.every((value) => !value.trim())) continue
81
63
 
82
64
  if (!sawHeader) {
@@ -105,7 +87,7 @@ export function convertTXHHSC(
105
87
  const lon = Number(m[2])
106
88
 
107
89
  // Sanity: TX bounding box (rejects swapped/garbage coords).
108
- if (lat < TX_MIN_LATITUDE || lat > TX_MAX_LATITUDE || lon > TX_MAX_LONGITUDE || lon < TX_MIN_LONGITUDE) {
90
+ if (!inTXBBOX(lat, lon)) {
109
91
  skipped++
110
92
 
111
93
  continue
@@ -123,7 +105,7 @@ export function convertTXHHSC(
123
105
  )
124
106
  }
125
107
 
126
- writeFileSync(out, records.join("\n") + "\n")
108
+ await writeLocalTextFile(records.join("\n") + "\n", out)
127
109
  report?.(`wrote ${records.length} rows (skipped ${skipped}) → ${out}`)
128
110
 
129
111
  return { written: records.length, skipped, out }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * The shared headless-Chromium harness behind the `registry viz` renderers (an internal helper,
7
+ * not a command). The WebGL consumers (Plotly 3D, MapLibre) get no GPU in headless Chromium, so
8
+ * the browser launches on ANGLE's SwiftShader software rasterizer (`--use-gl=angle
9
+ * --use-angle=swiftshader --enable-unsafe-swiftshader`); each caller owns its own navigation +
10
+ * wait strategy and screenshots inside the callback.
11
+ *
12
+ * Playwright (headless Chromium) is a heavy dev-only dependency — lazy-imported at call time (the
13
+ * corpus-tools lazy-import convention), so importing `@mailwoman/registry/tools` never pays for
14
+ * it.
15
+ */
16
+
17
+ import type { Page } from "playwright"
18
+
19
+ /**
20
+ * Options for {@linkcode withChromiumPage}.
21
+ */
22
+ export interface ChromiumPageOptions {
23
+ viewport: { width: number; height: number }
24
+ }
25
+
26
+ /**
27
+ * Launch headless Chromium (SwiftShader WebGL), open one page at `deviceScaleFactor: 2`, collect console + page errors,
28
+ * run `fn`, and dispose the browser. The callback owns navigation, waits, and the screenshot.
29
+ */
30
+ export async function withChromiumPage<T>(
31
+ options: ChromiumPageOptions,
32
+ fn: (page: Page) => Promise<T>
33
+ ): Promise<{ result: T; consoleErrors: string[] }> {
34
+ const { chromium } = await import("playwright")
35
+
36
+ const browser = await chromium.launch({
37
+ args: ["--use-gl=angle", "--use-angle=swiftshader", "--enable-unsafe-swiftshader", "--ignore-gpu-blocklist"],
38
+ })
39
+
40
+ const page = await browser.newPage({ viewport: options.viewport, deviceScaleFactor: 2 })
41
+
42
+ const errors: string[] = []
43
+ page.on("console", (m) => m.type() === "error" && errors.push(m.text()))
44
+ page.on("pageerror", (e) => errors.push(String(e)))
45
+
46
+ const result = await fn(page)
47
+ await browser[Symbol.asyncDispose]()
48
+
49
+ return { result, consoleErrors: errors }
50
+ }
@@ -3,36 +3,16 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * The cross-dataset linking map — the marquee record-matcher proof, on a map.
7
- *
8
- * The matcher resolves entities ACROSS independent sources (NPPES provider registry, FCC RHC
9
- * funding, TX HHSC facility licensing) with NO shared key — purely on the geocoded location +
10
- * name agreement. This renders the `cross-dataset-links` GeoJSON (every entity that resolved
11
- * across ≥2 sources) on the HOUSE map stack via {@link toMapHTML} (MapLibre GL + a Protomaps
12
- * basemap). Each entity is colored by its SOURCE COMBINATION (a synthesized `bucket`), so the
13
- * entities spanning all three sources stand out from the two-source links.
14
- *
15
- * Neutral entity-resolution view: it shows what resolved to what and how confidently (cohesion
16
- * sizes the marker). It does NOT interpret coverage/eligibility — that is the consumer's call.
17
- *
18
- * SERVE THE OUTPUT OVER LOCALHOST (the house tile server CORS-restricts to localhost + the docs
19
- * domains; a file:// page shows accurate markers on a blank basemap). e.g. `python3 -m
20
- * http.server -d <dir>` then open the page; or use `renderServedMapToPNG` (`./render-map.ts`)
21
- * against the served URL.
22
- *
23
- * `--cross-agency-only` keeps just the entities whose sources span >1 AGENCY (the two FCC datasets
24
- * count as one) — the harder cross-agency slice; most raw links are FCC-internal (RHC ↔
25
- * commitments).
26
- *
27
- * Run: `mailwoman registry viz cross-dataset-map [--in <links.geojson>]
28
- * [--out-html /tmp/cross-dataset-map.html] [--cross-agency-only]`
6
+ * Render linked entities from a GeoJSON file in MapLibre, colored by source combination.
7
+ * `crossAgencyOnly` removes links whose sources belong to one agency.
29
8
  */
30
9
 
31
- import { readFileSync, writeFileSync } from "node:fs"
10
+ import { dataRootPath, tempRootPath } from "@mailwoman/core/data-root"
11
+ import { readLocalJSONFile } from "@mailwoman/core/fs/readers"
12
+ import { writeLocalFile } from "@mailwoman/core/fs/writers"
13
+ import type { GeoFeature, GeoFeatureCollection, PointLiteral } from "@mailwoman/spatial"
32
14
 
33
- import { parseJSONStrict } from "@mailwoman/core/objects"
34
- import { dataRootPath } from "@mailwoman/core/utils"
35
- import { toMapHTML } from "@mailwoman/registry"
15
+ import { type MapFeatureData, toMapHTML } from "#index"
36
16
 
37
17
  /**
38
18
  * Distinct agencies a combination needs before it is plotted as a cross-agency cluster.
@@ -82,24 +62,21 @@ const SOURCE_AGENCY: Record<string, string> = {
82
62
 
83
63
  const agencyOf = (s: string) => SOURCE_AGENCY[s] ?? s
84
64
 
85
- const sourcesOf = (f: { properties: Record<string, unknown> | null }) =>
86
- Array.isArray(f.properties?.["sources"]) ? (f.properties!["sources"] as string[]) : []
65
+ const sourcesOf = (f: GeoFeature<PointLiteral, MapFeatureData>): string[] =>
66
+ Array.isArray(f.properties?.sources) ? f.properties.sources : []
87
67
 
88
68
  /**
89
69
  * Render the cross-dataset-links GeoJSON to a bucket-colored MapLibre HTML page.
90
70
  */
91
- export function crossDatasetMap(
71
+ export async function crossDatasetMap(
92
72
  options: CrossDatasetMapOptions = {},
93
73
  report?: (line: string) => void
94
- ): { outHTML: string; kept: number; total: number; triple: number } {
74
+ ): Promise<{ outHTML: string; kept: number; total: number; triple: number }> {
95
75
  const IN = options.in || dataRootPath("record-matcher", "2026-06-16-cross-dataset-links.geojson")
96
- const OUT = options.outHTML || "/tmp/cross-dataset-map.html"
76
+ const OUT = options.outHTML || tempRootPath("cross-dataset-map.html")
97
77
  const CROSS_AGENCY_ONLY = options.crossAgencyOnly ?? false
98
78
 
99
- const parsed = parseJSONStrict<{
100
- type: "FeatureCollection"
101
- features: Array<{ properties: Record<string, unknown> | null }>
102
- }>(readFileSync(IN, "utf8"))
79
+ const parsed = await readLocalJSONFile<GeoFeatureCollection<PointLiteral, MapFeatureData>>(IN)
103
80
 
104
81
  const total = parsed.features.length
105
82
 
@@ -117,7 +94,7 @@ export function crossDatasetMap(
117
94
  const bucket = combo.map(label).join(" + ") || "unlinked"
118
95
 
119
96
  if (f.properties) {
120
- f.properties["bucket"] = bucket
97
+ f.properties.bucket = bucket
121
98
  }
122
99
 
123
100
  if (new Set(combo.map(agencyOf)).size >= MIN_DISTINCT_AGENCIES) {
@@ -130,13 +107,13 @@ export function crossDatasetMap(
130
107
  const kept = geojson.features.length
131
108
  const scope = CROSS_AGENCY_ONLY ? "across agencies" : "across sources"
132
109
 
133
- const html = toMapHTML(geojson as never, {
110
+ const html = toMapHTML(geojson, {
134
111
  title: `Cross-dataset entity links — ${kept} resolved ${scope} (no shared key)`,
135
112
  flavor: "light",
136
113
  colorBy: "bucket",
137
114
  })
138
115
 
139
- writeFileSync(OUT, html)
116
+ await writeLocalFile(html, OUT)
140
117
  report?.(`[written] ${OUT} (${kept}${CROSS_AGENCY_ONLY ? ` of ${total} cross-AGENCY` : ""} entities)`)
141
118
  report?.(` source combinations:`)
142
119
 
@@ -3,41 +3,12 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * The geocode-first decision surface — the headline concept figure for the record matcher.
7
- *
8
- * What a reader should walk away with: **geography is the primary key; string similarity only
9
- * refines within a place.** The figure makes that legible as a _landscape_. Two surfaces of
10
- * P(match) over the same record-pair space (string similarity × geographic distance), scored by
11
- * the SAME Fellegi-Sunter machinery, differing only in which evidence each model is allowed to
12
- * see:
13
- *
14
- * - **String-first** sees the name agreement only → its decision boundary is _vertical_: high string
15
- * similarity ⇒ match, at any distance. It fuses `Springfield General (IL)` with `Springfield
16
- * General (MA)` (identical name, ~1500 km apart) and still misses `123 Main St` ↔ `123 Main
17
- * Street Apt 2` when the strings drift.
18
- * - **Geocode-first** also sees the distance agreement → its boundary _bends with geography_: near
19
- * the same coordinate a modest name match suffices; far apart, even an exact name is
20
- * rejected. It gets both traps right.
21
- *
22
- * Honesty notes (so the figure can't mislead):
23
- *
24
- * - The per-level weights are the REAL Bayes factors from the codebase — `NAME_LEVELS`
25
- * (`registry/resolve.ts`) and `DEFAULT_DISTANCE_LEVELS` (`match/distance.ts`). Geography
26
- * simply carries the heaviest evidence: ±9.45 bits at the same-building grain vs ±6.32 for an
27
- * exact name.
28
- * - The PRIOR is illustrative (λ shown in the caption), not production's λ=1e-4. Production is even
29
- * more conservative and leans on additional corroboration (phone, the spatial exact-key) that
30
- * this two-axis slice deliberately omits — the point here is the _shape of the boundary_, not
31
- * a reproduction of a production score. The caption says so.
32
- *
33
- * Emits a self-contained Plotly HTML (twin 3D landscapes + an annotated 2D contour). Render to PNG
34
- * with `renderPlotlyHTMLToPNG` (`./render.ts` — Playwright + swiftshader for headless WebGL).
35
- *
36
- * Run: `mailwoman registry viz geocode-first-surface [--lambda 0.02]
37
- * [--out-html /tmp/geocode-first-surface.html]`
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.
38
8
  */
39
9
 
40
- import { writeFileSync } from "node:fs"
10
+ import { tempRootPath } from "@mailwoman/core/data-root"
11
+ import { writeLocalFile } from "@mailwoman/core/fs/writers"
41
12
 
42
13
  /**
43
14
  * Options for {@linkcode geocodeFirstSurface}.
@@ -45,7 +16,8 @@ import { writeFileSync } from "node:fs"
45
16
  export interface GeocodeFirstSurfaceOptions {
46
17
  /**
47
18
  * Illustrative prior λ. Production's record matcher uses λ=1e-4 (calibrated for the full multi-field model with phone
48
- * + spatial exact-key); here we want the boundary visible in a two-axis slice. Default 0.02.
19
+ *
20
+ * - Spatial exact-key); here we want the boundary visible in a two-axis slice. Default 0.02.
49
21
  */
50
22
  lambda?: number
51
23
  /**
@@ -110,12 +82,12 @@ function distanceWeight(km: number): number {
110
82
  /**
111
83
  * Emit the geocode-first decision-surface Plotly HTML — see the module doc.
112
84
  */
113
- export function geocodeFirstSurface(
85
+ export async function geocodeFirstSurface(
114
86
  options: GeocodeFirstSurfaceOptions = {},
115
87
  report?: (line: string) => void
116
- ): { outHTML: string } {
88
+ ): Promise<{ outHTML: string }> {
117
89
  const LAMBDA = options.lambda ?? 0.02
118
- const OUT_HTML = options.outHTML || "/tmp/geocode-first-surface.html"
90
+ const OUT_HTML = options.outHTML || tempRootPath("geocode-first-surface.html")
119
91
 
120
92
  const PRIOR = priorWeight(LAMBDA)
121
93
 
@@ -199,7 +171,9 @@ export function geocodeFirstSurface(
199
171
  prior: PRIOR,
200
172
  }
201
173
 
202
- const safe = JSON.stringify(data).replaceAll(/<\/script>/gi, "<\\/script>")
174
+ // EVERY `<`, not only `</script>`: `<!--` also leaves script-data state in the HTML tokenizer, after which a
175
+ // later `</script>` no longer ends the element. `\u003c` is the same string to a JSON reader.
176
+ const safe = JSON.stringify(data).replaceAll("<", "\\u003c")
203
177
 
204
178
  const html = `<!doctype html><html><head><meta charset="utf-8"/>
205
179
  <script src="https://cdn.plot.ly/plotly-2.35.2.min.js"></script>
@@ -305,7 +279,7 @@ document.getElementByID("cap").innerHTML =
305
279
  </script>
306
280
  </body></html>`
307
281
 
308
- writeFileSync(OUT_HTML, html)
282
+ await writeLocalFile(html, OUT_HTML)
309
283
  report?.(`[written] ${OUT_HTML}`)
310
284
  report?.(`λ=${LAMBDA} prior=${PRIOR.toFixed(2)} bits`)
311
285
 
@@ -9,20 +9,19 @@
9
9
  *
10
10
  * Two house-stack constraints make this fiddlier than the Plotly/SVG renderers:
11
11
  *
12
- * - MapLibre needs a real WebGL context → ANGLE's SwiftShader software rasterizer (the same flags the
13
- * 3D Plotly render uses).
14
- * - The basemap tiles come from `tiles.sister.software`, which CORS-restricts to localhost + the docs
12
+ * - MapLibre needs a real WebGL context — the shared harness (`./browser.ts`) provides one through
13
+ * SwiftShader.
14
+ * - The basemap tiles come from `tiles.mailwoman.ai`, which CORS-restricts to localhost + the docs
15
15
  * domains — so the page MUST be SERVED OVER LOCALHOST, not opened as a file (a file:// page
16
16
  * renders accurate markers on a blank basemap). Serve the output dir first, e.g. `python3 -m
17
17
  * http.server 8899 -d <dir>`, then point this at `http://localhost:8899/<page>.html`.
18
18
  *
19
19
  * The map paints asynchronously after the network settles; we wait for networkidle, then a fixed
20
20
  * beat for the basemap tiles + marker layer to finish compositing.
21
- *
22
- * Playwright (headless Chromium) is a heavy dev-only dependency — lazy-imported inside the entry
23
- * fn (the corpus-tools lazy-import convention).
24
21
  */
25
22
 
23
+ import { withChromiumPage } from "#tools/viz/browser"
24
+
26
25
  /**
27
26
  * Options for {@linkcode renderServedMapToPNG}.
28
27
  */
@@ -44,25 +43,13 @@ export async function renderServedMapToPNG(
44
43
  options: RenderMapOptions,
45
44
  report?: (line: string) => void
46
45
  ): Promise<{ outPNG: string; consoleErrors: string[] }> {
47
- // playwright + Chromium are heavy — lazy import (the pipeline convention).
48
- const { chromium } = await import("playwright")
49
-
50
- const browser = await chromium.launch({
51
- args: ["--use-gl=angle", "--use-angle=swiftshader", "--enable-unsafe-swiftshader", "--ignore-gpu-blocklist"],
46
+ const { consoleErrors: errors } = await withChromiumPage({ viewport: { width: 1100, height: 760 } }, async (page) => {
47
+ await page.goto(options.url, { waitUntil: "networkidle", timeout: 30_000 })
48
+ // MapLibre composites tiles + the marker layer async after the network settles; give it a beat.
49
+ await page.waitForTimeout(4000)
50
+ await page.screenshot({ path: options.outPNG })
52
51
  })
53
52
 
54
- const page = await browser.newPage({ viewport: { width: 1100, height: 760 }, deviceScaleFactor: 2 })
55
-
56
- const errors: string[] = []
57
- page.on("console", (m) => m.type() === "error" && errors.push(m.text()))
58
- page.on("pageerror", (e) => errors.push(String(e)))
59
-
60
- await page.goto(options.url, { waitUntil: "networkidle", timeout: 30_000 })
61
- // MapLibre composites tiles + the marker layer async after the network settles; give it a beat.
62
- await page.waitForTimeout(4000)
63
- await page.screenshot({ path: options.outPNG })
64
- await browser.close()
65
-
66
53
  report?.(`[map-render] ${options.outPNG}; console errors=${errors.length}`)
67
54
 
68
55
  for (const e of errors.slice(0, 6)) {
@@ -0,0 +1,98 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Render a self-contained Plotly HTML to a PNG via headless Chromium — the shared renderer behind
7
+ * the `registry viz` figures (an internal helper, not a command).
8
+ *
9
+ * Plotly 3D (`surface`/`scatter3d`) needs a real WebGL context, which the shared harness
10
+ * (`./browser.ts`) provides through SwiftShader; 2D traces (`contour`/`heatmap`) render on the 2D
11
+ * canvas regardless. We wait for Plotly's `plotly_afterplot` to fire on every graph div rather
12
+ * than a fixed sleep, so the screenshot can't race the (async) WebGL paint.
13
+ */
14
+
15
+ import { pathToFileURL } from "@mailwoman/core/module/file-url"
16
+ import { resolvePath as resolve } from "path-ts"
17
+
18
+ import { withChromiumPage } from "#tools/viz/browser"
19
+
20
+ /**
21
+ * Options for {@linkcode renderPlotlyHTMLToPNG}.
22
+ */
23
+ export interface RenderPlotlyOptions {
24
+ /**
25
+ * The self-contained Plotly HTML file.
26
+ */
27
+ inHTML: string
28
+ /**
29
+ * Output PNG path.
30
+ */
31
+ outPNG: string
32
+ /**
33
+ * Viewport width. Default 1160.
34
+ */
35
+ width?: number
36
+ /**
37
+ * Viewport height. Default 1000.
38
+ */
39
+ height?: number
40
+ }
41
+
42
+ /**
43
+ * Screenshot a Plotly HTML page after every graph div's `plotly_afterplot` fires.
44
+ */
45
+ export async function renderPlotlyHTMLToPNG(
46
+ options: RenderPlotlyOptions,
47
+ report?: (line: string) => void
48
+ ): Promise<{ outPNG: string; consoleErrors: string[] }> {
49
+ const { consoleErrors: errors } = await withChromiumPage(
50
+ { viewport: { width: options.width ?? 1160, height: options.height ?? 1000 } },
51
+ async (page) => {
52
+ await page.goto(pathToFileURL(resolve(options.inHTML)).href, { waitUntil: "networkidle" })
53
+
54
+ // Resolve once every Plotly graph div has fired plotly_afterplot (3D paints land async, after
55
+ // newPlot's promise resolves), with a per-div fallback so an already-painted div can't hang us.
56
+ await page.evaluate(async () => {
57
+ // Runs in the BROWSER — reach DOM/Plotly globals via globalThis so the script needs no DOM lib.
58
+ interface PlotlyDiv {
59
+ _fullLayout?: unknown
60
+ on?: (event: string, cb: () => void) => void
61
+ }
62
+
63
+ const doc = Reflect.get(globalThis, "document") as { querySelectorAll(s: string): Iterable<unknown> }
64
+
65
+ const divs = [...doc.querySelectorAll("div")]
66
+ .map((d) => d as PlotlyDiv)
67
+ .filter((d) => d._fullLayout && typeof d.on === "function")
68
+
69
+ await Promise.all(
70
+ divs.map(
71
+ (d) =>
72
+ new Promise<void>((res) => {
73
+ d.on!("plotly_afterplot", () => res())
74
+ setTimeout(() => res(), 2000)
75
+ })
76
+ )
77
+ )
78
+ })
79
+
80
+ // Final settle for the software WebGL rasterizer.
81
+ await page.waitForTimeout(800)
82
+
83
+ await page.screenshot({ path: resolve(options.outPNG), fullPage: true })
84
+ }
85
+ )
86
+
87
+ if (errors.length) {
88
+ report?.(`[render] ${errors.length} console error(s):`)
89
+
90
+ for (const e of errors.slice(0, 8)) {
91
+ report?.(" " + e)
92
+ }
93
+ }
94
+
95
+ report?.(`[render] ${options.outPNG}`)
96
+
97
+ return { outPNG: options.outPNG, consoleErrors: errors }
98
+ }
@@ -3,35 +3,18 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * The address-point provenance map — the "show your work" proof, on a map.
7
- *
8
- * Every coordinate Mailwoman resolves to comes from an open dataset, and we keep the provenance on
9
- * the point. This samples the per-state address-point DB (`address_point.source`) and renders it
10
- * on the house MapLibre + Protomaps stack via {@link toMapHTML}, each dot COLORED BY its upstream
11
- * open-data source — the National Address Database (a federal release) vs OpenAddresses (county /
12
- * municipal open-data publishers). New York is the clean example: NAD blankets the state, and New
13
- * York City arrives separately from NYC Open Data, so the source split is visible as a
14
- * geography.
15
- *
16
- * No competitor in this space will tell you which open dataset a given coordinate came from — for
17
- * them the assembled pipeline is the moat. Here the provenance is the point of the map.
18
- *
19
- * Streets without a rooftop point are covered by TIGER interpolation (`tiger:edges`), a separate
20
- * layer not plotted here; this map is the rooftop-point sources only.
21
- *
22
- * SERVE THE OUTPUT OVER LOCALHOST (the house tile server CORS-restricts to localhost + the docs
23
- * domains). e.g. `python3 -m http.server -d <dir>`, or `renderServedMapToPNG` (`./render-map.ts`)
24
- * against the served URL.
25
- *
26
- * Run: `mailwoman registry viz source-provenance-map [--state ny] [--db <address-points-us-XX.db>]
27
- * [--out-html /tmp/source-provenance.html] [--nad-mod 700] [--oa-mod 120] [--cap 7000]`
6
+ * Sample `address_point.source` rows from a state database and render them by source in MapLibre.
7
+ * The output requires an HTTP origin because the tile server does not serve `file:` origins.
28
8
  */
29
9
 
30
- import { writeFileSync } from "node:fs"
31
- import { DatabaseSync } from "node:sqlite"
10
+ import { dataRootPath, tempRootPath } from "@mailwoman/core/data-root"
11
+ import { writeLocalFile } from "@mailwoman/core/fs/writers"
12
+ import { isPresent } from "@mailwoman/core/objects"
13
+ import type { AddressPointDatabase } from "@mailwoman/resolver-wof-sqlite/address"
14
+ import type { GeoFeature, GeoFeatureCollection, PointLiteral } from "@mailwoman/spatial"
15
+ import { DatabaseClient } from "@mailwoman/sqlite/client"
32
16
 
33
- import { dataRootPath } from "@mailwoman/core/utils"
34
- import { toMapHTML } from "@mailwoman/registry"
17
+ import { type MapFeatureData, toMapHTML } from "#index"
35
18
 
36
19
  /**
37
20
  * Options for {@linkcode sourceProvenanceMap}.
@@ -87,18 +70,18 @@ type Row = { lat: number; lon: number; source: string; number: string | null; st
87
70
  /**
88
71
  * Render the per-state address-point provenance map — see the module doc.
89
72
  */
90
- export function sourceProvenanceMap(
73
+ export async function sourceProvenanceMap(
91
74
  options: SourceProvenanceMapOptions = {},
92
75
  report?: (line: string) => void
93
- ): { outHTML: string; points: number } {
76
+ ): Promise<{ outHTML: string; points: number }> {
94
77
  const STATE = (options.state || "ny").toLowerCase()
95
78
  const DB = options.db || String(dataRootPath("address-points", `address-points-us-${STATE}.db`))
96
- const OUT = options.outHTML || "/tmp/source-provenance.html"
79
+ const OUT = options.outHTML || tempRootPath("source-provenance.html")
97
80
  const NAD_MOD = options.nadMod ?? 700 // keep ~1/700 of NAD points
98
81
  const OA_MOD = options.oaMod ?? 120 // keep ~1/120 of OpenAddresses points
99
82
  const CAP = options.cap ?? 7000 // per-source marker cap
100
83
 
101
- const db = new DatabaseSync(DB, { readOnly: true })
84
+ using db = new DatabaseClient<AddressPointDatabase>(DB, { readOnly: true })
102
85
 
103
86
  // Two stratified samples so the smaller source (OpenAddresses, ~1/6 of NY) stays visible next to NAD.
104
87
  // abs(random()) % mod == 0 keeps a spatially-uniform ~1/mod fraction; LIMIT caps the marker count.
@@ -116,18 +99,16 @@ export function sourceProvenanceMap(
116
99
  ...sample("source LIKE 'overture:OpenAddresses%'", OA_MOD),
117
100
  ]
118
101
 
119
- db.close()
120
-
121
102
  const counts = new Map<string, number>()
122
103
 
123
- const features = rows.map((r) => {
104
+ const features: GeoFeature<PointLiteral, MapFeatureData>[] = rows.map((r) => {
124
105
  const { bucket, publisher } = categorize(r.source)
125
106
  counts.set(bucket, (counts.get(bucket) ?? 0) + 1)
126
- const addr = [r.number, r.street_raw].filter(Boolean).join(" ").trim()
107
+ const addr = [r.number, r.street_raw].filter(isPresent).join(" ").trim()
127
108
 
128
109
  return {
129
- type: "Feature" as const,
130
- geometry: { type: "Point" as const, coordinates: [r.lon, r.lat] },
110
+ type: "Feature",
111
+ geometry: { type: "Point", coordinates: [r.lon, r.lat] },
131
112
  properties: {
132
113
  bucket,
133
114
  sources: [bucket],
@@ -139,15 +120,15 @@ export function sourceProvenanceMap(
139
120
  }
140
121
  })
141
122
 
142
- const geojson = { type: "FeatureCollection" as const, features }
123
+ const geojson: GeoFeatureCollection<PointLiteral, MapFeatureData> = { type: "FeatureCollection", features }
143
124
 
144
- const html = toMapHTML(geojson as never, {
125
+ const html = toMapHTML(geojson, {
145
126
  title: `Address-point provenance — ${STATE.toUpperCase()}, every point colored by its open-data source`,
146
127
  flavor: "light",
147
128
  colorBy: "bucket",
148
129
  })
149
130
 
150
- writeFileSync(OUT, html)
131
+ await writeLocalFile(html, OUT)
151
132
  report?.(`[written] ${OUT} (${features.length} points)`)
152
133
 
153
134
  for (const [bucket, n] of [...counts.entries()].toSorted((a, b) => b[1] - a[1])) {
@@ -24,7 +24,8 @@
24
24
  * [--out-svg docs/records/evals/charts/dedup-yardstick.svg]`
25
25
  */
26
26
 
27
- import { writeFileSync } from "node:fs"
27
+ import { writeLocalTextFile } from "@mailwoman/core/fs/writers"
28
+ import { escapeHTML } from "@mailwoman/core/strings/escape"
28
29
 
29
30
  /**
30
31
  * Options for {@linkcode yardstickFigure}.
@@ -93,15 +94,15 @@ const MODELS = [
93
94
  { key: "FS", label: "FS full stack", color: "#9ca3af", width: 2, dash: "5 4" },
94
95
  ]
95
96
 
96
- const esc = (s: string) => s.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;")
97
+ const esc = escapeHTML
97
98
 
98
99
  /**
99
100
  * Emit the dedup-yardstick slope chart as a self-contained SVG — see the module doc.
100
101
  */
101
- export function yardstickFigure(
102
+ export async function yardstickFigure(
102
103
  options: YardstickFigureOptions = {},
103
104
  report?: (line: string) => void
104
- ): { outSVG: string } {
105
+ ): Promise<{ outSVG: string }> {
105
106
  const OUT = options.outSVG || "docs/records/evals/charts/dedup-yardstick.svg"
106
107
 
107
108
  const parts: string[] = []
@@ -220,7 +221,7 @@ export function yardstickFigure(
220
221
 
221
222
  push(`</svg>`)
222
223
 
223
- writeFileSync(OUT, parts.join(""))
224
+ await writeLocalTextFile(parts.join(""), OUT)
224
225
  report?.(`[written] ${OUT}`)
225
226
 
226
227
  report?.(
@@ -81,7 +81,7 @@ export type ReconciliationBucket = "enrolled" | "eligible-not-enrolled" | "funde
81
81
 
82
82
  export interface EntityGeoData {
83
83
  entityID: string
84
- sourceIds?: string[]
84
+ sourceIDs?: string[]
85
85
  recordCount?: number
86
86
  cohesion?: number | null
87
87
  sources: string[]
@@ -92,4 +92,13 @@ export interface EntityGeoData {
92
92
  bucket?: ReconciliationBucket
93
93
  }
94
94
 
95
+ /**
96
+ * Feature properties the map renderer consumes — {@link EntityGeoData} with every field optional, plus an unconstrained
97
+ * `bucket`. The renderer assigns a color per DISTINCT bucket value in first-seen order and builds its legend from that
98
+ * set, so a bucket is any categorical label, not only a {@link ReconciliationBucket}; and a collection assembled from
99
+ * something other than resolved entities (raw address points, links read back from a file) carries no entity id or
100
+ * display name.
101
+ */
102
+ export type MapFeatureData = Partial<Omit<EntityGeoData, "bucket">> & { bucket?: string }
103
+
95
104
  //#endregion
@@ -15,7 +15,7 @@
15
15
  */
16
16
  import { type PostalAddressID } from "@mailwoman/address-id";
17
17
  import { type BlockingKey } from "@mailwoman/match";
18
- import type { SourceRecord } from "./types.ts";
18
+ import type { SourceRecord } from "#types";
19
19
  /**
20
20
  * The stable address primary key for a record, or null when it isn't geocoded (no coordinate → no locality cell) or
21
21
  * carries no raw address to hash. Uses the resolved coordinate + the raw address; the state prefix is plucked from the
@@ -1 +1 @@
1
- {"version":3,"file":"address-key.d.ts","sourceRoot":"","sources":["../address-key.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACnF,OAAO,EAAE,KAAK,WAAW,EAAY,MAAM,kBAAkB,CAAA;AAE7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,eAAe,GAAG,IAAI,CAO5E;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,WAAW,CAAC,YAAY,CAAC,CAEhE"}
1
+ {"version":3,"file":"address-key.d.ts","sourceRoot":"","sources":["../lib/address-key.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACnF,OAAO,EAAE,KAAK,WAAW,EAAY,MAAM,kBAAkB,CAAA;AAE7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAE1C;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,YAAY,GAAG,eAAe,GAAG,IAAI,CAO5E;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,WAAW,CAAC,YAAY,CAAC,CAEhE"}