@mailwoman/registry 9.4.0 → 10.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/lib/address-key.ts +14 -10
- package/lib/geocode-handler.ts +6 -4
- package/lib/geojson.ts +13 -17
- package/lib/ingest.ts +57 -83
- package/lib/learned-scorer.ts +38 -44
- package/lib/map-html.ts +24 -70
- package/lib/models/crosssource-gbt-en-us.ts +9 -7
- package/lib/models/dedup-gbt-en-us.ts +9 -8
- package/lib/models/org-crosssource-gbt-en-us.ts +10 -8
- package/lib/reconcile.ts +45 -55
- package/lib/resolve.ts +180 -124
- package/lib/types.ts +18 -12
- package/out/address-key.d.ts +14 -10
- package/out/address-key.d.ts.map +1 -1
- package/out/address-key.js +14 -10
- package/out/address-key.js.map +1 -1
- package/out/geocode-handler.d.ts +6 -4
- package/out/geocode-handler.d.ts.map +1 -1
- package/out/geocode-handler.js +6 -4
- package/out/geocode-handler.js.map +1 -1
- package/out/geojson.d.ts +9 -5
- package/out/geojson.d.ts.map +1 -1
- package/out/geojson.js +13 -15
- package/out/geojson.js.map +1 -1
- package/out/ingest.d.ts +46 -75
- package/out/ingest.d.ts.map +1 -1
- package/out/ingest.js +27 -54
- package/out/ingest.js.map +1 -1
- package/out/learned-scorer.d.ts +29 -26
- package/out/learned-scorer.d.ts.map +1 -1
- package/out/learned-scorer.js +31 -39
- package/out/learned-scorer.js.map +1 -1
- package/out/map-html.d.ts +13 -32
- package/out/map-html.d.ts.map +1 -1
- package/out/map-html.js +9 -62
- package/out/map-html.js.map +1 -1
- package/out/models/crosssource-gbt-en-us.d.ts +9 -7
- package/out/models/crosssource-gbt-en-us.d.ts.map +1 -1
- package/out/models/crosssource-gbt-en-us.js +9 -7
- package/out/models/crosssource-gbt-en-us.js.map +1 -1
- package/out/models/dedup-gbt-en-us.d.ts +9 -8
- package/out/models/dedup-gbt-en-us.d.ts.map +1 -1
- package/out/models/dedup-gbt-en-us.js +9 -8
- package/out/models/dedup-gbt-en-us.js.map +1 -1
- package/out/models/org-crosssource-gbt-en-us.d.ts +10 -8
- package/out/models/org-crosssource-gbt-en-us.d.ts.map +1 -1
- package/out/models/org-crosssource-gbt-en-us.js +10 -8
- package/out/models/org-crosssource-gbt-en-us.js.map +1 -1
- package/out/reconcile.d.ts +35 -50
- package/out/reconcile.d.ts.map +1 -1
- package/out/reconcile.js +19 -43
- package/out/reconcile.js.map +1 -1
- package/out/resolve.d.ts +150 -90
- package/out/resolve.d.ts.map +1 -1
- package/out/resolve.js +62 -63
- package/out/resolve.js.map +1 -1
- package/out/tools/coverage-reconciliation.d.ts +23 -23
- package/out/tools/coverage-reconciliation.d.ts.map +1 -1
- package/out/tools/coverage-reconciliation.js +15 -26
- package/out/tools/coverage-reconciliation.js.map +1 -1
- package/out/tools/cross/dataset-correlation.d.ts +58 -0
- package/out/tools/cross/dataset-correlation.d.ts.map +1 -0
- package/out/tools/{cross-dataset-correlation.js → cross/dataset-correlation.js} +10 -62
- package/out/tools/cross/dataset-correlation.js.map +1 -0
- package/out/tools/cross/source-threshold-sweep.d.ts +60 -0
- package/out/tools/cross/source-threshold-sweep.d.ts.map +1 -0
- package/out/tools/{cross-source-threshold-sweep.js → cross/source-threshold-sweep.js} +15 -41
- package/out/tools/cross/source-threshold-sweep.js.map +1 -0
- package/out/tools/dedup-ceiling.d.ts +23 -26
- package/out/tools/dedup-ceiling.d.ts.map +1 -1
- package/out/tools/dedup-ceiling.js +22 -41
- package/out/tools/dedup-ceiling.js.map +1 -1
- package/out/tools/eval-geocoder.d.ts +22 -15
- package/out/tools/eval-geocoder.d.ts.map +1 -1
- package/out/tools/eval-geocoder.js +5 -6
- package/out/tools/eval-geocoder.js.map +1 -1
- package/out/tools/geocoder/namesake-probe.d.ts +33 -0
- package/out/tools/geocoder/namesake-probe.d.ts.map +1 -0
- package/out/tools/{geocoder-namesake-probe.js → geocoder/namesake-probe.js} +7 -8
- package/out/tools/geocoder/namesake-probe.js.map +1 -0
- package/out/tools/geocoder/vs-provided-coords.d.ts +53 -0
- package/out/tools/geocoder/vs-provided-coords.d.ts.map +1 -0
- package/out/tools/{geocoder-vs-provided-coords.js → geocoder/vs-provided-coords.js} +31 -28
- package/out/tools/geocoder/vs-provided-coords.js.map +1 -0
- package/out/tools/gold-set-sample.d.ts +27 -18
- package/out/tools/gold-set-sample.d.ts.map +1 -1
- package/out/tools/gold-set-sample.js +18 -22
- package/out/tools/gold-set-sample.js.map +1 -1
- package/out/tools/learned/scorer/clustering-eval.d.ts +77 -0
- package/out/tools/learned/scorer/clustering-eval.d.ts.map +1 -0
- package/out/tools/{learned-scorer-clustering-eval.js → learned/scorer/clustering-eval.js} +29 -39
- package/out/tools/learned/scorer/clustering-eval.js.map +1 -0
- package/out/tools/learned/scorer/crossstate-eval.d.ts +65 -0
- package/out/tools/learned/scorer/crossstate-eval.d.ts.map +1 -0
- package/out/tools/{learned-scorer-crossstate-eval.js → learned/scorer/crossstate-eval.js} +20 -26
- package/out/tools/learned/scorer/crossstate-eval.js.map +1 -0
- package/out/tools/learned/scorer/eval.d.ts +60 -0
- package/out/tools/learned/scorer/eval.d.ts.map +1 -0
- package/out/tools/{learned-scorer-eval.js → learned/scorer/eval.js} +12 -72
- package/out/tools/learned/scorer/eval.js.map +1 -0
- package/out/tools/matcher-scale.d.ts +12 -17
- package/out/tools/matcher-scale.d.ts.map +1 -1
- package/out/tools/matcher-scale.js +11 -29
- package/out/tools/matcher-scale.js.map +1 -1
- package/out/tools/nppes/dedup-benchmark.d.ts +81 -0
- package/out/tools/nppes/dedup-benchmark.d.ts.map +1 -0
- package/out/tools/{nppes-dedup-benchmark.js → nppes/dedup-benchmark.js} +21 -67
- package/out/tools/nppes/dedup-benchmark.js.map +1 -0
- package/out/tools/nppes/org-name.d.ts +5 -4
- package/out/tools/nppes/org-name.d.ts.map +1 -1
- package/out/tools/nppes/org-name.js +2 -2
- package/out/tools/nppes/org-name.js.map +1 -1
- package/out/tools/nppes/overmerge-packet.d.ts +15 -11
- package/out/tools/nppes/overmerge-packet.d.ts.map +1 -1
- package/out/tools/nppes/overmerge-packet.js +7 -8
- package/out/tools/nppes/overmerge-packet.js.map +1 -1
- package/out/tools/nppes/report.d.ts +17 -13
- package/out/tools/nppes/report.d.ts.map +1 -1
- package/out/tools/nppes/report.js +6 -14
- package/out/tools/nppes/report.js.map +1 -1
- package/out/tools/nppes/sample.d.ts +28 -17
- package/out/tools/nppes/sample.d.ts.map +1 -1
- package/out/tools/nppes/sample.js +23 -26
- package/out/tools/nppes/sample.js.map +1 -1
- package/out/tools/nppes/scoring.d.ts +7 -6
- package/out/tools/nppes/scoring.d.ts.map +1 -1
- package/out/tools/nppes/scoring.js +6 -5
- package/out/tools/nppes/scoring.js.map +1 -1
- package/out/tools/nppes/settings.d.ts +10 -7
- package/out/tools/nppes/settings.d.ts.map +1 -1
- package/out/tools/nppes/settings.js +16 -16
- package/out/tools/nppes/settings.js.map +1 -1
- package/out/tools/nppes/truth-grains.d.ts +36 -23
- package/out/tools/nppes/truth-grains.d.ts.map +1 -1
- package/out/tools/nppes/truth-grains.js +36 -20
- package/out/tools/nppes/truth-grains.js.map +1 -1
- package/out/tools/shared.d.ts +63 -59
- package/out/tools/shared.d.ts.map +1 -1
- package/out/tools/shared.js +49 -66
- package/out/tools/shared.js.map +1 -1
- package/out/tools/train/cross-gbt.d.ts +88 -0
- package/out/tools/train/cross-gbt.d.ts.map +1 -0
- package/out/tools/{train-cross-gbt.js → train/cross-gbt.js} +15 -26
- package/out/tools/train/cross-gbt.js.map +1 -0
- package/out/tools/train/gbt.d.ts +85 -0
- package/out/tools/train/gbt.d.ts.map +1 -0
- package/out/tools/{train-gbt.js → train/gbt.js} +28 -32
- package/out/tools/train/gbt.js.map +1 -0
- package/out/tools/train/org-cross-gbt.d.ts +84 -0
- package/out/tools/train/org-cross-gbt.d.ts.map +1 -0
- package/out/tools/{train-org-cross-gbt.js → train/org-cross-gbt.js} +19 -23
- package/out/tools/train/org-cross-gbt.js.map +1 -0
- package/out/tools/txhhsc-to-oarow.d.ts +14 -9
- package/out/tools/txhhsc-to-oarow.d.ts.map +1 -1
- package/out/tools/txhhsc-to-oarow.js +16 -15
- package/out/tools/txhhsc-to-oarow.js.map +1 -1
- package/out/tools/viz/browser.d.ts +6 -5
- package/out/tools/viz/browser.d.ts.map +1 -1
- package/out/tools/viz/browser.js +6 -5
- package/out/tools/viz/browser.js.map +1 -1
- package/out/tools/viz/cross-dataset-map.d.ts +7 -4
- package/out/tools/viz/cross-dataset-map.d.ts.map +1 -1
- package/out/tools/viz/cross-dataset-map.js +9 -6
- package/out/tools/viz/cross-dataset-map.js.map +1 -1
- package/out/tools/viz/geocode-first-surface.d.ts +10 -5
- package/out/tools/viz/geocode-first-surface.d.ts.map +1 -1
- package/out/tools/viz/geocode-first-surface.js +16 -11
- package/out/tools/viz/geocode-first-surface.js.map +1 -1
- package/out/tools/viz/{render-map.d.ts → render/map.d.ts} +6 -6
- package/out/tools/viz/render/map.d.ts.map +1 -0
- package/out/tools/viz/{render-map.js → render/map.js} +7 -6
- package/out/tools/viz/render/map.js.map +1 -0
- package/out/tools/viz/render.d.ts +12 -8
- package/out/tools/viz/render.d.ts.map +1 -1
- package/out/tools/viz/render.js +8 -7
- package/out/tools/viz/render.js.map +1 -1
- package/out/tools/viz/source-provenance-map.d.ts +19 -7
- package/out/tools/viz/source-provenance-map.d.ts.map +1 -1
- package/out/tools/viz/source-provenance-map.js +11 -8
- package/out/tools/viz/source-provenance-map.js.map +1 -1
- package/out/tools/viz/yardstick-figure.d.ts +2 -21
- package/out/tools/viz/yardstick-figure.d.ts.map +1 -1
- package/out/tools/viz/yardstick-figure.js +3 -39
- package/out/tools/viz/yardstick-figure.js.map +1 -1
- package/out/types.d.ts +17 -11
- package/out/types.d.ts.map +1 -1
- package/out/types.js +2 -2
- package/out/types.js.map +1 -1
- package/package.json +41 -184
- package/{lib/tools → tools}/coverage-reconciliation.ts +27 -30
- package/{lib/tools/cross-dataset-correlation.ts → tools/cross/dataset-correlation.ts} +31 -72
- package/{lib/tools/cross-source-threshold-sweep.ts → tools/cross/source-threshold-sweep.ts} +29 -46
- package/{lib/tools → tools}/dedup-ceiling.ts +34 -45
- package/tools/eval-geocoder.ts +74 -0
- package/{lib/tools/geocoder-namesake-probe.ts → tools/geocoder/namesake-probe.ts} +9 -8
- package/{lib/tools/geocoder-vs-provided-coords.ts → tools/geocoder/vs-provided-coords.ts} +39 -30
- package/{lib/tools → tools}/gold-set-sample.ts +35 -29
- package/{lib/tools/learned-scorer-clustering-eval.ts → tools/learned/scorer/clustering-eval.ts} +49 -45
- package/{lib/tools/learned-scorer-crossstate-eval.ts → tools/learned/scorer/crossstate-eval.ts} +34 -30
- package/{lib/tools/learned-scorer-eval.ts → tools/learned/scorer/eval.ts} +35 -78
- package/{lib/tools → tools}/matcher-scale.ts +21 -33
- package/{lib/tools/nppes-dedup-benchmark.ts → tools/nppes/dedup-benchmark.ts} +37 -82
- package/{lib/tools → tools}/nppes/org-name.ts +5 -4
- package/{lib/tools → tools}/nppes/overmerge-packet.ts +17 -13
- package/{lib/tools → tools}/nppes/report.ts +32 -25
- package/{lib/tools → tools}/nppes/sample.ts +41 -36
- package/{lib/tools → tools}/nppes/scoring.ts +7 -6
- package/{lib/tools → tools}/nppes/settings.ts +16 -16
- package/{lib/tools → tools}/nppes/truth-grains.ts +46 -26
- package/{lib/tools → tools}/shared.ts +73 -83
- package/{lib/tools/train-cross-gbt.ts → tools/train/cross-gbt.ts} +38 -34
- package/{lib/tools/train-gbt.ts → tools/train/gbt.ts} +55 -41
- package/{lib/tools/train-org-cross-gbt.ts → tools/train/org-cross-gbt.ts} +39 -30
- package/{lib/tools → tools}/txhhsc-to-oarow.ts +24 -18
- package/{lib/tools → tools}/viz/browser.ts +6 -5
- package/{lib/tools → tools}/viz/cross-dataset-map.ts +15 -9
- package/{lib/tools → tools}/viz/geocode-first-surface.ts +28 -17
- package/{lib/tools/viz/render-map.ts → tools/viz/render/map.ts} +7 -6
- package/{lib/tools → tools}/viz/render.ts +16 -11
- package/{lib/tools → tools}/viz/source-provenance-map.ts +30 -15
- package/{lib/tools → tools}/viz/yardstick-figure.ts +6 -43
- package/lib/tools/eval-geocoder.ts +0 -67
- package/lib/tools/index.ts +0 -31
- package/out/tools/cross-dataset-correlation.d.ts +0 -65
- package/out/tools/cross-dataset-correlation.d.ts.map +0 -1
- package/out/tools/cross-dataset-correlation.js.map +0 -1
- package/out/tools/cross-source-threshold-sweep.d.ts +0 -66
- package/out/tools/cross-source-threshold-sweep.d.ts.map +0 -1
- package/out/tools/cross-source-threshold-sweep.js.map +0 -1
- package/out/tools/geocoder-namesake-probe.d.ts +0 -32
- package/out/tools/geocoder-namesake-probe.d.ts.map +0 -1
- package/out/tools/geocoder-namesake-probe.js.map +0 -1
- package/out/tools/geocoder-vs-provided-coords.d.ts +0 -50
- package/out/tools/geocoder-vs-provided-coords.d.ts.map +0 -1
- package/out/tools/geocoder-vs-provided-coords.js.map +0 -1
- package/out/tools/index.d.ts +0 -31
- package/out/tools/index.d.ts.map +0 -1
- package/out/tools/index.js +0 -31
- package/out/tools/index.js.map +0 -1
- package/out/tools/learned-scorer-clustering-eval.d.ts +0 -74
- package/out/tools/learned-scorer-clustering-eval.d.ts.map +0 -1
- package/out/tools/learned-scorer-clustering-eval.js.map +0 -1
- package/out/tools/learned-scorer-crossstate-eval.d.ts +0 -59
- package/out/tools/learned-scorer-crossstate-eval.d.ts.map +0 -1
- package/out/tools/learned-scorer-crossstate-eval.js.map +0 -1
- package/out/tools/learned-scorer-eval.d.ts +0 -77
- package/out/tools/learned-scorer-eval.d.ts.map +0 -1
- package/out/tools/learned-scorer-eval.js.map +0 -1
- package/out/tools/nppes-dedup-benchmark.d.ts +0 -101
- package/out/tools/nppes-dedup-benchmark.d.ts.map +0 -1
- package/out/tools/nppes-dedup-benchmark.js.map +0 -1
- package/out/tools/train-cross-gbt.d.ts +0 -78
- package/out/tools/train-cross-gbt.d.ts.map +0 -1
- package/out/tools/train-cross-gbt.js.map +0 -1
- package/out/tools/train-gbt.d.ts +0 -69
- package/out/tools/train-gbt.d.ts.map +0 -1
- package/out/tools/train-gbt.js.map +0 -1
- package/out/tools/train-org-cross-gbt.d.ts +0 -71
- package/out/tools/train-org-cross-gbt.d.ts.map +0 -1
- package/out/tools/train-org-cross-gbt.js.map +0 -1
- package/out/tools/viz/render-map.d.ts.map +0 -1
- package/out/tools/viz/render-map.js.map +0 -1
|
@@ -2,26 +2,6 @@
|
|
|
2
2
|
* @copyright Sister Software
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
|
-
*
|
|
6
|
-
* The yardstick figure — "the dedup F1 climbs as the entity-truth gets honest."
|
|
7
|
-
*
|
|
8
|
-
* The #625 finding, made visual: the matcher's MEASURED dedup quality depends almost entirely on
|
|
9
|
-
* which ruler you grade it against, not on the model. NPI-as-truth OVER-SEGMENTS (one org holds
|
|
10
|
-
* many NPIs), so the matcher's correct co-located same-org merges are scored as errors. Grade the
|
|
11
|
-
* IDENTICAL clusters against a gold-set-validated org-name truth and the F1 climbs — the ruler
|
|
12
|
-
* ceasing to charge for correct merges, not the model changing — peaking when the ruler keys on
|
|
13
|
-
* the geocoded BUILDING (the geocode-first coordinate) rather than the address string (+14.5pp
|
|
14
|
-
* NPI → coord).
|
|
15
|
-
*
|
|
16
|
-
* A slope chart over four rulers (NPI → site → org-name → org-name-coord) for the shipped GBT
|
|
17
|
-
* scorer and the FS baseline. Numbers are the committed measurement in
|
|
18
|
-
* `docs/records/evals/matcher-dedup/2026-06-16-dedup-dual-level-benchmark.md` (1000 TX NPIs → 2757 records).
|
|
19
|
-
*
|
|
20
|
-
* Emits a self-contained SVG (the docs' committed-chart-asset convention — see
|
|
21
|
-
* `docs/records/evals/charts/*.svg`), no browser required.
|
|
22
|
-
*
|
|
23
|
-
* Run: `mailwoman registry viz yardstick-figure
|
|
24
|
-
* [--out-svg docs/records/evals/charts/dedup-yardstick.svg]`
|
|
25
5
|
*/
|
|
26
6
|
import { writeLocalTextFile } from "@mailwoman/core/fs/writers";
|
|
27
7
|
import { escapeHTML } from "@mailwoman/core/strings/escape";
|
|
@@ -36,21 +16,14 @@ const GRAINS = [
|
|
|
36
16
|
note: "collapse by geocoded\nBUILDING (geocode-first key)",
|
|
37
17
|
},
|
|
38
18
|
];
|
|
39
|
-
/**
|
|
40
|
-
* F1 per (model, grain), in %.
|
|
41
|
-
*/
|
|
42
19
|
const F1 = {
|
|
43
|
-
GBT: [53.6, 55.3, 60.7, 68.1],
|
|
44
|
-
FS: [45.1, 42.7, 52.3, 60.3],
|
|
20
|
+
GBT: [53.6, 55.3, 60.7, 68.1],
|
|
21
|
+
FS: [45.1, 42.7, 52.3, 60.3],
|
|
45
22
|
};
|
|
46
|
-
/**
|
|
47
|
-
* Over-merged cluster counts per (model, grain) — the genuine-precision story for GBT.
|
|
48
|
-
*/
|
|
49
23
|
const OVERMERGE = {
|
|
50
24
|
GBT: [109, 208, 92, 76],
|
|
51
25
|
FS: [144, 253, 129, 114],
|
|
52
26
|
};
|
|
53
|
-
// ── Geometry. ───────────────────────────────────────────────────────────────────────────────────
|
|
54
27
|
const W = 760;
|
|
55
28
|
const H = 430;
|
|
56
29
|
const PAD = { top: 64, right: 168, bottom: 92, left: 64 };
|
|
@@ -75,28 +48,24 @@ export async function yardstickFigure(options = {}, report) {
|
|
|
75
48
|
const parts = [];
|
|
76
49
|
const push = (s) => parts.push(s);
|
|
77
50
|
push(`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${W} ${H}" width="${W}" height="${H}" font-family="ui-sans-serif, system-ui, sans-serif" font-size="11"><rect width="${W}" height="${H}" fill="white"/>`);
|
|
78
|
-
// Title + subtitle.
|
|
79
51
|
push(`<text x="${W / 2}" y="24" text-anchor="middle" font-size="15" font-weight="600">The dedup F1 climbs as the entity-truth gets honest</text>`);
|
|
80
52
|
push(`<text x="${W / 2}" y="42" text-anchor="middle" font-size="11.5" fill="#555">Identical matcher output (the same clusters) graded against four rulers — 1000 TX NPIs → 2757 records, NPI held out</text>`);
|
|
81
|
-
// Y gridlines + labels.
|
|
82
53
|
for (let v = Y_MIN; v <= Y_MAX; v += 5) {
|
|
83
54
|
const y = yFor(v);
|
|
84
55
|
push(`<line x1="${plotL}" y1="${y.toFixed(1)}" x2="${plotR}" y2="${y.toFixed(1)}" stroke="#e5e7eb" stroke-width="1"/>`);
|
|
85
56
|
push(`<text x="${plotL - 8}" y="${(y + 3).toFixed(1)}" text-anchor="end" fill="#374151">${v}%</text>`);
|
|
86
57
|
}
|
|
87
58
|
push(`<text transform="translate(20, ${(plotT + plotB) / 2}) rotate(-90)" text-anchor="middle" font-size="12" fill="#374151">entity-resolution F1</text>`);
|
|
88
|
-
// X category ticks + labels + the class-count + note strip.
|
|
89
59
|
GRAINS.forEach((g, i) => {
|
|
90
60
|
const x = xFor(i);
|
|
91
61
|
push(`<line x1="${x.toFixed(1)}" y1="${plotT}" x2="${x.toFixed(1)}" y2="${plotB}" stroke="#f1f1f1" stroke-width="1"/>`);
|
|
92
62
|
push(`<text x="${x.toFixed(1)}" y="${plotB + 20}" text-anchor="middle" font-size="12.5" font-weight="600">${esc(g.label)}</text>`);
|
|
93
63
|
push(`<text x="${x.toFixed(1)}" y="${plotB + 36}" text-anchor="middle" font-size="10" fill="#6b7280">${g.classes} classes</text>`);
|
|
94
|
-
// oxlint-disable-next-line mailwoman/prefer-spliterator -- `g.note` is a literal label from the
|
|
64
|
+
// oxlint-disable-next-line mailwoman/prefer-spliterator -- `g.note` is a literal label from the models table rather than a file.
|
|
95
65
|
g.note.split("\n").forEach((line, k) => {
|
|
96
66
|
push(`<text x="${x.toFixed(1)}" y="${plotB + 50 + k * 12}" text-anchor="middle" font-size="9" fill="#9ca3af">${esc(line)}</text>`);
|
|
97
67
|
});
|
|
98
68
|
});
|
|
99
|
-
// Model slope lines + points.
|
|
100
69
|
for (const m of MODELS) {
|
|
101
70
|
const f1s = F1[m.key];
|
|
102
71
|
const pts = f1s.map((f, i) => `${xFor(i).toFixed(1)},${yFor(f).toFixed(1)}`).join(" ");
|
|
@@ -105,12 +74,10 @@ export async function yardstickFigure(options = {}, report) {
|
|
|
105
74
|
const x = xFor(i);
|
|
106
75
|
const y = yFor(f);
|
|
107
76
|
push(`<circle cx="${x.toFixed(1)}" cy="${y.toFixed(1)}" r="${m.key === "GBT" ? 5 : 4}" fill="${m.color}"/>`);
|
|
108
|
-
// value label: above for GBT, below for FS, to avoid collision
|
|
109
77
|
const dy = m.key === "GBT" ? -10 : 16;
|
|
110
78
|
push(`<text x="${x.toFixed(1)}" y="${(y + dy).toFixed(1)}" text-anchor="middle" font-size="11" font-weight="${m.key === "GBT" ? 700 : 400}" fill="${m.color}">${f.toFixed(1)}</text>`);
|
|
111
79
|
});
|
|
112
80
|
}
|
|
113
|
-
// Legend (top-right, in the right margin).
|
|
114
81
|
const lx = plotR + 16;
|
|
115
82
|
let ly = plotT + 6;
|
|
116
83
|
for (const m of MODELS) {
|
|
@@ -118,7 +85,6 @@ export async function yardstickFigure(options = {}, report) {
|
|
|
118
85
|
push(`<text x="${lx + 28}" y="${ly + 3.5}" font-size="10.5" fill="#374151">${esc(m.label)}</text>`);
|
|
119
86
|
ly += 18;
|
|
120
87
|
}
|
|
121
|
-
// The headline callout — the full climb for the shipped model, ending at the geocode-first key.
|
|
122
88
|
const gCoord = yFor(F1.GBT[3]);
|
|
123
89
|
const gNPI = yFor(F1.GBT[0]);
|
|
124
90
|
push(`<g font-size="10.5">` +
|
|
@@ -128,9 +94,7 @@ export async function yardstickFigure(options = {}, report) {
|
|
|
128
94
|
`<text x="${lx}" y="${ly + 64}" fill="#555">over-merge 109 → 76,</text>` +
|
|
129
95
|
`<text x="${lx}" y="${ly + 77}" fill="#555">precision 43.7% → 64.6%.</text>` +
|
|
130
96
|
`</g>`);
|
|
131
|
-
// Bracket the GBT climb on the right edge of the plot (NPI → coord, the full honest range).
|
|
132
97
|
push(`<path d="M ${(plotR - 4).toFixed(1)} ${gNPI.toFixed(1)} L ${(plotR + 2).toFixed(1)} ${gNPI.toFixed(1)} L ${(plotR + 2).toFixed(1)} ${gCoord.toFixed(1)} L ${(plotR - 4).toFixed(1)} ${gCoord.toFixed(1)}" fill="none" stroke="#3578e5" stroke-width="1" opacity="0.5"/>`);
|
|
133
|
-
// Footer caveat — the gold-set anchor.
|
|
134
98
|
push(`<text x="${plotL}" y="${H - 10}" font-size="9.5" fill="#9ca3af">Gold set (2026-06-16-dedup-gold-set-tx120): 120/120 hard co-located pairs = same org, 0 genuine over-merges. The coordinate (geocode-first building key) is the tightest honest ruler; NPI charges correct same-org merges as errors.</text>`);
|
|
135
99
|
push(`</svg>`);
|
|
136
100
|
await writeLocalTextFile(parts.join(""), OUT);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yardstick-figure.js","sourceRoot":"","sources":["../../../
|
|
1
|
+
{"version":3,"file":"yardstick-figure.js","sourceRoot":"","sources":["../../../tools/viz/yardstick-figure.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAA;AAoB3D,MAAM,MAAM,GAAY;IACvB,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,mDAAmD,EAAE;IACtG,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,kDAAkD,EAAE;IACvG,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,0CAA0C,EAAE;IACtG;QACC,GAAG,EAAE,gBAAgB;QACrB,KAAK,EAAE,kBAAkB;QACzB,OAAO,EAAE,GAAG;QACZ,IAAI,EAAE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AC,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,iEAAiE,CACzQ,CAAA;IAED,IAAI,CACH,YAAY,KAAK,QAAQ,CAAC,GAAG,EAAE,+QAA+Q,CAC9S,CAAA;IAED,IAAI,CAAC,QAAQ,CAAC,CAAA;IAEd,MAAM,kBAAkB,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAA;IAC7C,MAAM,EAAE,CAAC,aAAa,GAAG,EAAE,CAAC,CAAA;IAE5B,MAAM,EAAE,CACP,iBAAiB,EAAE,CAAC,GAAI,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,GAAI,CAAC,CAAC,CAAC,eAAe,EAAE,CAAC,GAAI,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,GAAI,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,GAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAI,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAC/I,CAAA;IAED,MAAM,EAAE,CAAC,iBAAiB,SAAS,CAAC,GAAI,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAA;IAEvD,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,CAAA;AACvB,CAAC"}
|
package/out/types.d.ts
CHANGED
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* The application's data shapes — the messy record that goes in
|
|
6
|
+
* The application's data shapes — the messy record that goes in and the canonical entity that
|
|
7
7
|
* comes out. Plain interfaces over the `@mailwoman/record` types.
|
|
8
8
|
*/
|
|
9
|
-
import type {
|
|
9
|
+
import type { ResolutionTier } from "@mailwoman/annotations/geo";
|
|
10
|
+
import type { OrganizationName, PersonName, PostalAddress } from "@mailwoman/record";
|
|
10
11
|
/**
|
|
11
12
|
* A single source record: one row of a messy contact/organization dataset, after normalization.
|
|
12
13
|
*/
|
|
@@ -34,10 +35,13 @@ export interface SourceRecord {
|
|
|
34
35
|
phone?: string | null;
|
|
35
36
|
email?: string | null;
|
|
36
37
|
/**
|
|
37
|
-
* Additional secondary-identifier fields, normalized
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
38
|
+
* Additional secondary-identifier fields, normalized.
|
|
39
|
+
*
|
|
40
|
+
* Anything that helps tell two records apart or confirm they're the same beyond
|
|
41
|
+
* name/org/address/phone (an authorized-official name, a provider taxonomy, a license number…).
|
|
42
|
+
*
|
|
43
|
+
* Used as extra comparisons + corroborators when the model is built with matching `discriminators`.
|
|
44
|
+
* Keyed by a stable field name the model references.
|
|
41
45
|
*/
|
|
42
46
|
attributes?: Record<string, string>;
|
|
43
47
|
/**
|
|
@@ -90,11 +94,13 @@ export interface EntityGeoData {
|
|
|
90
94
|
bucket?: ReconciliationBucket;
|
|
91
95
|
}
|
|
92
96
|
/**
|
|
93
|
-
* Feature properties the map renderer consumes — {@link EntityGeoData} with every
|
|
94
|
-
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
97
|
+
* Feature properties the map renderer consumes — {@link EntityGeoData} with every
|
|
98
|
+
* field optional, plus an unconstrained `bucket`.
|
|
99
|
+
*
|
|
100
|
+
* The renderer assigns a color per distinct bucket value in first-seen order and builds
|
|
101
|
+
* its legend from that set, so a bucket is any categorical label rather than only a
|
|
102
|
+
* {@link ReconciliationBucket}; and a collection assembled from something other than resolved
|
|
103
|
+
* entities (raw address points, links read back from a file) have no entity id or display name.
|
|
98
104
|
*/
|
|
99
105
|
export type MapFeatureData = Partial<Omit<EntityGeoData, "bucket">> & {
|
|
100
106
|
bucket?: string;
|
package/out/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../lib/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../lib/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEpF;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB;;OAEG;IACH,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI,CAAA;IACxB;;OAEG;IACH,YAAY,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAA;IACtC;;OAEG;IACH,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAAA;IAC9B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACnC;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAA;IACV;;OAEG;IACH,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB;;OAEG;IACH,cAAc,EAAE,YAAY,CAAA;IAC5B;;OAEG;IACH,UAAU,CAAC,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAA;IACpD;;OAEG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CACvB;AAED;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,UAAU,GAAG,uBAAuB,GAAG,qBAAqB,CAAA;AAE/F,MAAM,WAAW,aAAa;IAC7B,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,WAAW,CAAC,EAAE,cAAc,GAAG,IAAI,CAAA;IACnC,MAAM,CAAC,EAAE,oBAAoB,CAAA;CAC7B;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA"}
|
package/out/types.js
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* The application's data shapes — the messy record that goes in
|
|
6
|
+
* The application's data shapes — the messy record that goes in and the canonical entity that
|
|
7
7
|
* comes out. Plain interfaces over the `@mailwoman/record` types.
|
|
8
8
|
*/
|
|
9
9
|
export {};
|
|
10
|
-
|
|
10
|
+
// #endregion
|
|
11
11
|
//# sourceMappingURL=types.js.map
|
package/out/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../lib/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../lib/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;;AAsGH,aAAa"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailwoman/registry",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.1.0",
|
|
4
4
|
"description": "The geocode-first record-matching application: resolve messy contact/organization records into canonical, geocoded entities (block → score → cluster) and export them as GeoJSON for spatial analysis. The clinic-funding use case mailwoman was built for.",
|
|
5
5
|
"license": "AGPL-3.0-only OR LicenseRef-Commercial",
|
|
6
6
|
"repository": {
|
|
@@ -13,19 +13,20 @@
|
|
|
13
13
|
"out/**/*.js.map",
|
|
14
14
|
"out/**/*.d.ts",
|
|
15
15
|
"out/**/*.d.ts.map",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"**/*.tsx",
|
|
20
|
-
"!*.test.ts",
|
|
21
|
-
"!*.test.tsx",
|
|
16
|
+
"lib/**/*.ts",
|
|
17
|
+
"lib/**/*.tsx",
|
|
18
|
+
"tools/**/*.ts",
|
|
22
19
|
"!**/*.test.ts",
|
|
23
|
-
"!**/*.test.tsx"
|
|
24
|
-
"!test/**"
|
|
20
|
+
"!**/*.test.tsx"
|
|
25
21
|
],
|
|
26
22
|
"type": "module",
|
|
27
23
|
"sideEffects": false,
|
|
28
24
|
"imports": {
|
|
25
|
+
"#tools/*": {
|
|
26
|
+
"types": "./out/tools/*.d.ts",
|
|
27
|
+
"node": "./out/tools/*.js",
|
|
28
|
+
"default": "./out/tools/*.js"
|
|
29
|
+
},
|
|
29
30
|
"#index": {
|
|
30
31
|
"types": "./out/index.d.ts",
|
|
31
32
|
"node": "./out/index.js",
|
|
@@ -44,90 +45,15 @@
|
|
|
44
45
|
"node": "./out/index.js",
|
|
45
46
|
"default": "./out/index.js"
|
|
46
47
|
},
|
|
47
|
-
"./
|
|
48
|
-
"types": "./out/
|
|
49
|
-
"node": "./out/
|
|
50
|
-
"default": "./out/
|
|
51
|
-
},
|
|
52
|
-
"./geojson": {
|
|
53
|
-
"types": "./out/geojson.d.ts",
|
|
54
|
-
"node": "./out/geojson.js",
|
|
55
|
-
"default": "./out/geojson.js"
|
|
56
|
-
},
|
|
57
|
-
"./ingest": {
|
|
58
|
-
"types": "./out/ingest.d.ts",
|
|
59
|
-
"node": "./out/ingest.js",
|
|
60
|
-
"default": "./out/ingest.js"
|
|
61
|
-
},
|
|
62
|
-
"./tools": {
|
|
63
|
-
"types": "./out/tools/index.d.ts",
|
|
64
|
-
"node": "./out/tools/index.js",
|
|
65
|
-
"default": "./out/tools/index.js"
|
|
66
|
-
},
|
|
67
|
-
"./address-key": {
|
|
68
|
-
"types": "./out/address-key.d.ts",
|
|
69
|
-
"node": "./out/address-key.js",
|
|
70
|
-
"default": "./out/address-key.js"
|
|
71
|
-
},
|
|
72
|
-
"./types": {
|
|
73
|
-
"types": "./out/types.d.ts",
|
|
74
|
-
"node": "./out/types.js",
|
|
75
|
-
"default": "./out/types.js"
|
|
76
|
-
},
|
|
77
|
-
"./geocode-handler": {
|
|
78
|
-
"types": "./out/geocode-handler.d.ts",
|
|
79
|
-
"node": "./out/geocode-handler.js",
|
|
80
|
-
"default": "./out/geocode-handler.js"
|
|
81
|
-
},
|
|
82
|
-
"./learned-scorer": {
|
|
83
|
-
"types": "./out/learned-scorer.d.ts",
|
|
84
|
-
"node": "./out/learned-scorer.js",
|
|
85
|
-
"default": "./out/learned-scorer.js"
|
|
86
|
-
},
|
|
87
|
-
"./map-html": {
|
|
88
|
-
"types": "./out/map-html.d.ts",
|
|
89
|
-
"node": "./out/map-html.js",
|
|
90
|
-
"default": "./out/map-html.js"
|
|
91
|
-
},
|
|
92
|
-
"./reconcile": {
|
|
93
|
-
"types": "./out/reconcile.d.ts",
|
|
94
|
-
"node": "./out/reconcile.js",
|
|
95
|
-
"default": "./out/reconcile.js"
|
|
48
|
+
"./tools/*": {
|
|
49
|
+
"types": "./out/tools/*.d.ts",
|
|
50
|
+
"node": "./out/tools/*.js",
|
|
51
|
+
"default": "./out/tools/*.js"
|
|
96
52
|
},
|
|
97
|
-
"
|
|
98
|
-
"types": "./out
|
|
99
|
-
"node": "./out
|
|
100
|
-
"default": "./out
|
|
101
|
-
},
|
|
102
|
-
"./tools/nppes/overmerge-packet": {
|
|
103
|
-
"types": "./out/tools/nppes/overmerge-packet.d.ts",
|
|
104
|
-
"node": "./out/tools/nppes/overmerge-packet.js",
|
|
105
|
-
"default": "./out/tools/nppes/overmerge-packet.js"
|
|
106
|
-
},
|
|
107
|
-
"./tools/nppes/report": {
|
|
108
|
-
"types": "./out/tools/nppes/report.d.ts",
|
|
109
|
-
"node": "./out/tools/nppes/report.js",
|
|
110
|
-
"default": "./out/tools/nppes/report.js"
|
|
111
|
-
},
|
|
112
|
-
"./tools/nppes/sample": {
|
|
113
|
-
"types": "./out/tools/nppes/sample.d.ts",
|
|
114
|
-
"node": "./out/tools/nppes/sample.js",
|
|
115
|
-
"default": "./out/tools/nppes/sample.js"
|
|
116
|
-
},
|
|
117
|
-
"./tools/nppes/scoring": {
|
|
118
|
-
"types": "./out/tools/nppes/scoring.d.ts",
|
|
119
|
-
"node": "./out/tools/nppes/scoring.js",
|
|
120
|
-
"default": "./out/tools/nppes/scoring.js"
|
|
121
|
-
},
|
|
122
|
-
"./tools/nppes/settings": {
|
|
123
|
-
"types": "./out/tools/nppes/settings.d.ts",
|
|
124
|
-
"node": "./out/tools/nppes/settings.js",
|
|
125
|
-
"default": "./out/tools/nppes/settings.js"
|
|
126
|
-
},
|
|
127
|
-
"./tools/nppes/truth-grains": {
|
|
128
|
-
"types": "./out/tools/nppes/truth-grains.d.ts",
|
|
129
|
-
"node": "./out/tools/nppes/truth-grains.js",
|
|
130
|
-
"default": "./out/tools/nppes/truth-grains.js"
|
|
53
|
+
"./*": {
|
|
54
|
+
"types": "./out/*.d.ts",
|
|
55
|
+
"node": "./out/*.js",
|
|
56
|
+
"default": "./out/*.js"
|
|
131
57
|
}
|
|
132
58
|
},
|
|
133
59
|
"publishConfig": {
|
|
@@ -139,93 +65,23 @@
|
|
|
139
65
|
"node": "./out/index.js",
|
|
140
66
|
"default": "./out/index.js"
|
|
141
67
|
},
|
|
142
|
-
"./
|
|
143
|
-
"types": "./out/
|
|
144
|
-
"node": "./out/
|
|
145
|
-
"default": "./out/
|
|
68
|
+
"./tools/*": {
|
|
69
|
+
"types": "./out/tools/*.d.ts",
|
|
70
|
+
"node": "./out/tools/*.js",
|
|
71
|
+
"default": "./out/tools/*.js"
|
|
146
72
|
},
|
|
147
|
-
"
|
|
148
|
-
"types": "./out
|
|
149
|
-
"node": "./out
|
|
150
|
-
"default": "./out
|
|
151
|
-
},
|
|
152
|
-
"./ingest": {
|
|
153
|
-
"types": "./out/ingest.d.ts",
|
|
154
|
-
"node": "./out/ingest.js",
|
|
155
|
-
"default": "./out/ingest.js"
|
|
156
|
-
},
|
|
157
|
-
"./tools": {
|
|
158
|
-
"types": "./out/tools/index.d.ts",
|
|
159
|
-
"node": "./out/tools/index.js",
|
|
160
|
-
"default": "./out/tools/index.js"
|
|
161
|
-
},
|
|
162
|
-
"./address-key": {
|
|
163
|
-
"types": "./out/address-key.d.ts",
|
|
164
|
-
"node": "./out/address-key.js",
|
|
165
|
-
"default": "./out/address-key.js"
|
|
166
|
-
},
|
|
167
|
-
"./types": {
|
|
168
|
-
"types": "./out/types.d.ts",
|
|
169
|
-
"node": "./out/types.js",
|
|
170
|
-
"default": "./out/types.js"
|
|
171
|
-
},
|
|
172
|
-
"./geocode-handler": {
|
|
173
|
-
"types": "./out/geocode-handler.d.ts",
|
|
174
|
-
"node": "./out/geocode-handler.js",
|
|
175
|
-
"default": "./out/geocode-handler.js"
|
|
176
|
-
},
|
|
177
|
-
"./learned-scorer": {
|
|
178
|
-
"types": "./out/learned-scorer.d.ts",
|
|
179
|
-
"node": "./out/learned-scorer.js",
|
|
180
|
-
"default": "./out/learned-scorer.js"
|
|
181
|
-
},
|
|
182
|
-
"./map-html": {
|
|
183
|
-
"types": "./out/map-html.d.ts",
|
|
184
|
-
"node": "./out/map-html.js",
|
|
185
|
-
"default": "./out/map-html.js"
|
|
186
|
-
},
|
|
187
|
-
"./reconcile": {
|
|
188
|
-
"types": "./out/reconcile.d.ts",
|
|
189
|
-
"node": "./out/reconcile.js",
|
|
190
|
-
"default": "./out/reconcile.js"
|
|
191
|
-
},
|
|
192
|
-
"./tools/nppes/org-name": {
|
|
193
|
-
"types": "./out/tools/nppes/org-name.d.ts",
|
|
194
|
-
"node": "./out/tools/nppes/org-name.js",
|
|
195
|
-
"default": "./out/tools/nppes/org-name.js"
|
|
196
|
-
},
|
|
197
|
-
"./tools/nppes/overmerge-packet": {
|
|
198
|
-
"types": "./out/tools/nppes/overmerge-packet.d.ts",
|
|
199
|
-
"node": "./out/tools/nppes/overmerge-packet.js",
|
|
200
|
-
"default": "./out/tools/nppes/overmerge-packet.js"
|
|
201
|
-
},
|
|
202
|
-
"./tools/nppes/report": {
|
|
203
|
-
"types": "./out/tools/nppes/report.d.ts",
|
|
204
|
-
"node": "./out/tools/nppes/report.js",
|
|
205
|
-
"default": "./out/tools/nppes/report.js"
|
|
206
|
-
},
|
|
207
|
-
"./tools/nppes/sample": {
|
|
208
|
-
"types": "./out/tools/nppes/sample.d.ts",
|
|
209
|
-
"node": "./out/tools/nppes/sample.js",
|
|
210
|
-
"default": "./out/tools/nppes/sample.js"
|
|
211
|
-
},
|
|
212
|
-
"./tools/nppes/scoring": {
|
|
213
|
-
"types": "./out/tools/nppes/scoring.d.ts",
|
|
214
|
-
"node": "./out/tools/nppes/scoring.js",
|
|
215
|
-
"default": "./out/tools/nppes/scoring.js"
|
|
216
|
-
},
|
|
217
|
-
"./tools/nppes/settings": {
|
|
218
|
-
"types": "./out/tools/nppes/settings.d.ts",
|
|
219
|
-
"node": "./out/tools/nppes/settings.js",
|
|
220
|
-
"default": "./out/tools/nppes/settings.js"
|
|
221
|
-
},
|
|
222
|
-
"./tools/nppes/truth-grains": {
|
|
223
|
-
"types": "./out/tools/nppes/truth-grains.d.ts",
|
|
224
|
-
"node": "./out/tools/nppes/truth-grains.js",
|
|
225
|
-
"default": "./out/tools/nppes/truth-grains.js"
|
|
73
|
+
"./*": {
|
|
74
|
+
"types": "./out/*.d.ts",
|
|
75
|
+
"node": "./out/*.js",
|
|
76
|
+
"default": "./out/*.js"
|
|
226
77
|
}
|
|
227
78
|
},
|
|
228
79
|
"imports": {
|
|
80
|
+
"#tools/*": {
|
|
81
|
+
"types": "./out/tools/*.d.ts",
|
|
82
|
+
"node": "./out/tools/*.js",
|
|
83
|
+
"default": "./out/tools/*.js"
|
|
84
|
+
},
|
|
229
85
|
"#index": {
|
|
230
86
|
"types": "./out/index.d.ts",
|
|
231
87
|
"node": "./out/index.js",
|
|
@@ -239,20 +95,21 @@
|
|
|
239
95
|
}
|
|
240
96
|
},
|
|
241
97
|
"dependencies": {
|
|
242
|
-
"@mailwoman/address-id": "
|
|
243
|
-
"@mailwoman/
|
|
244
|
-
"@mailwoman/
|
|
245
|
-
"@mailwoman/
|
|
246
|
-
"@mailwoman/
|
|
247
|
-
"@mailwoman/
|
|
248
|
-
"@mailwoman/
|
|
98
|
+
"@mailwoman/address-id": "10.1.0",
|
|
99
|
+
"@mailwoman/annotations": "10.1.0",
|
|
100
|
+
"@mailwoman/core": "10.1.0",
|
|
101
|
+
"@mailwoman/match": "10.1.0",
|
|
102
|
+
"@mailwoman/record": "10.1.0",
|
|
103
|
+
"@mailwoman/resolver-wof-sqlite": "10.1.0",
|
|
104
|
+
"@mailwoman/spatial": "10.1.0",
|
|
105
|
+
"@mailwoman/sqlite": "10.1.0",
|
|
249
106
|
"@protomaps/basemaps": "^5.7.2",
|
|
250
107
|
"h3-js": "^4.5.0",
|
|
251
|
-
"spliterator": "^
|
|
108
|
+
"spliterator": "^8.1.0"
|
|
252
109
|
},
|
|
253
110
|
"devDependencies": {
|
|
254
111
|
"@types/node": "^26.4.1",
|
|
255
|
-
"path-ts": "^2.
|
|
112
|
+
"path-ts": "^2.5.0",
|
|
256
113
|
"playwright": "^1.63.0"
|
|
257
114
|
}
|
|
258
115
|
}
|
|
@@ -3,27 +3,18 @@
|
|
|
3
3
|
* @license AGPL-3.0
|
|
4
4
|
* @author Teffen Ellis, et al.
|
|
5
5
|
*
|
|
6
|
-
* Coverage reconciliation
|
|
6
|
+
* Coverage reconciliation, the product output that replaces inspecting the map by eye.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* Each resolved entity is classified by the kind of source its records come from. An eligibility
|
|
9
|
+
* source holds providers and facilities, such as NPPES org NPIs or TX HHSC nursing facilities. A
|
|
10
|
+
* funding source holds entities enrolled in a funding program, such as FCC Rural Health Care
|
|
11
|
+
* filings.
|
|
10
12
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
13
|
+
* The buckets are enrolled (both an eligibility and a funding record), eligible rather than
|
|
14
|
+
* enrolled (an eligibility record with no funding record resolving to it), and funded rather than
|
|
15
|
+
* in the eligibility set (a funding record with no eligibility record resolving to it).
|
|
14
16
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* - **enrolled** — resolves to BOTH an eligibility and a funding record.
|
|
18
|
-
* - **eligible, not enrolled** — an eligibility record with NO funding record resolving to it (the
|
|
19
|
-
* ANTI-JOIN: the set you currently find by eye).
|
|
20
|
-
* - **funded, not in the eligibility set** — a funding record with no eligibility record resolving to
|
|
21
|
-
* it.
|
|
22
|
-
*
|
|
23
|
-
* Output: GeoJSON (drops on the same map) + a table, each entity tagged with its bucket + source
|
|
24
|
-
* memberships. We produce the reconciled join; what a gap MEANS — and whether it's real or a
|
|
25
|
-
* sampling artifact — is the consumer's call, not ours. This is strictly a set-membership
|
|
26
|
-
* reconciliation, never an allegation.
|
|
17
|
+
* This is strictly a set-membership reconciliation, never an allegation.
|
|
27
18
|
*
|
|
28
19
|
* Run: `mailwoman registry scorer-eval coverage-reconciliation [--cap 2000] [--wof <admin.db>]
|
|
29
20
|
* [--data-root <dir>] [--out-md <md>] [--out-geojson <geojson>]`
|
|
@@ -51,19 +42,27 @@ import { buildSpecs, stateOption } from "#tools/shared"
|
|
|
51
42
|
*/
|
|
52
43
|
export interface CoverageReconciliationOptions {
|
|
53
44
|
/**
|
|
54
|
-
* The injected geocoder factory
|
|
45
|
+
* The injected geocoder factory.
|
|
46
|
+
*
|
|
47
|
+
* The command wires `mailwoman/geocode-core`, as `./eval-geocoder.ts` does.
|
|
55
48
|
*/
|
|
56
49
|
createGeocoder: EvalGeocoderFactory
|
|
57
50
|
/**
|
|
58
|
-
* Record-matcher sources directory.
|
|
51
|
+
* Record-matcher sources directory.
|
|
52
|
+
*
|
|
53
|
+
* Default `$MAILWOMAN_DATA_ROOT/record-matcher/sources`.
|
|
59
54
|
*/
|
|
60
55
|
sources?: string
|
|
61
56
|
/**
|
|
62
|
-
* Rows kept per source.
|
|
57
|
+
* Rows kept per source.
|
|
58
|
+
*
|
|
59
|
+
* Default 2000.
|
|
63
60
|
*/
|
|
64
61
|
cap?: number
|
|
65
62
|
/**
|
|
66
|
-
* State filter.
|
|
63
|
+
* State filter.
|
|
64
|
+
*
|
|
65
|
+
* Default TX.
|
|
67
66
|
*/
|
|
68
67
|
state?: string
|
|
69
68
|
/**
|
|
@@ -83,7 +82,8 @@ const ELIGIBILITY = new Set(["nppes", "txhhsc-nursing"])
|
|
|
83
82
|
const FUNDING = new Set(["fcc-rhc"])
|
|
84
83
|
|
|
85
84
|
/**
|
|
86
|
-
*
|
|
85
|
+
* Reconcile eligibility and funding sources.
|
|
86
|
+
* Emit the markdown report to stdout.
|
|
87
87
|
*/
|
|
88
88
|
export async function coverageReconciliation(
|
|
89
89
|
options: CoverageReconciliationOptions,
|
|
@@ -96,7 +96,6 @@ export async function coverageReconciliation(
|
|
|
96
96
|
const OUT_GEOJSON = options.outGeojson || ""
|
|
97
97
|
const SPECS = buildSpecs(`${SOURCES}`, STATE)
|
|
98
98
|
|
|
99
|
-
// --- Ingest each source into one combined record set (geo-first resolve). ---
|
|
100
99
|
const rawBySource = new Map<string, Record<string, string>[]>()
|
|
101
100
|
|
|
102
101
|
for (const spec of SPECS) {
|
|
@@ -120,7 +119,6 @@ export async function coverageReconciliation(
|
|
|
120
119
|
let geo = 0
|
|
121
120
|
let total = 0
|
|
122
121
|
|
|
123
|
-
// Count placements at the boundary (parity with the retired in-script counter).
|
|
124
122
|
const geocodeForIngest: GeocodeAddress = async (raw) => {
|
|
125
123
|
const g = await geocoder.geocodeAddress(raw)
|
|
126
124
|
|
|
@@ -150,13 +148,12 @@ export async function coverageReconciliation(
|
|
|
150
148
|
report?.(` ${records.length} records; geocoded ${geo}/${total} (${((100 * geo) / total).toFixed(1)}%)`)
|
|
151
149
|
|
|
152
150
|
report?.("[D] resolving + reconciling…")
|
|
153
|
-
//
|
|
154
|
-
//
|
|
155
|
-
// GBT default rejects
|
|
151
|
+
// Use the Fellegi-Sunter baseline for this cross-dataset join.
|
|
152
|
+
// It is recall-oriented because the signal is the same facility under a different operational name.
|
|
153
|
+
// The dedup-calibrated GBT default rejects that pair.
|
|
156
154
|
const { entities } = resolveEntities(records, { trainEM: true, collapseSpatial: true, learnedScorer: false })
|
|
157
155
|
|
|
158
|
-
//
|
|
159
|
-
// `mailwoman registry --reconcile`, so the script and the CLI can't drift. ---
|
|
156
|
+
// Reconcile through the shared @mailwoman/registry code path, so the script and the CLI agree.
|
|
160
157
|
const config: ReconcileConfig = { eligibilitySources: [...ELIGIBILITY], fundingSources: [...FUNDING] }
|
|
161
158
|
const result = reconcileCoverage(entities, config)
|
|
162
159
|
const geojson = reconciliationGeoJSON(result)
|