@mailwoman/registry 4.16.2 → 5.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.
- package/out/address-key.d.ts +9 -10
- package/out/address-key.d.ts.map +1 -1
- package/out/address-key.js +10 -11
- package/out/address-key.js.map +1 -1
- package/out/geocode-handler.d.ts +18 -0
- package/out/geocode-handler.d.ts.map +1 -0
- package/out/geocode-handler.js +27 -0
- package/out/geocode-handler.js.map +1 -0
- package/out/geojson.d.ts +2 -2
- package/out/geojson.d.ts.map +1 -1
- package/out/geojson.js +3 -3
- package/out/geojson.js.map +1 -1
- package/out/index.d.ts +1 -0
- package/out/index.d.ts.map +1 -1
- package/out/index.js +1 -0
- package/out/index.js.map +1 -1
- package/out/ingest.d.ts +78 -51
- package/out/ingest.d.ts.map +1 -1
- package/out/ingest.js +96 -63
- package/out/ingest.js.map +1 -1
- package/out/learned-scorer.d.ts +12 -15
- package/out/learned-scorer.d.ts.map +1 -1
- package/out/learned-scorer.js +9 -10
- package/out/learned-scorer.js.map +1 -1
- package/out/map-html.d.ts +5 -5
- package/out/map-html.d.ts.map +1 -1
- package/out/map-html.js +21 -22
- package/out/map-html.js.map +1 -1
- package/out/reconcile.d.ts +9 -11
- package/out/reconcile.d.ts.map +1 -1
- package/out/reconcile.js +10 -12
- package/out/reconcile.js.map +1 -1
- package/out/resolve.d.ts +60 -70
- package/out/resolve.d.ts.map +1 -1
- package/out/resolve.js +14 -17
- package/out/resolve.js.map +1 -1
- package/out/types.d.ts +6 -7
- package/out/types.d.ts.map +1 -1
- package/out/types.js.map +1 -1
- package/package.json +15 -15
package/out/reconcile.js
CHANGED
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
* which the map auto-detects and colors categorically.
|
|
28
28
|
*/
|
|
29
29
|
/**
|
|
30
|
-
* Bucket an entity from the source labels its records span. Returns `null` when the entity carries
|
|
31
|
-
*
|
|
32
|
-
*
|
|
30
|
+
* Bucket an entity from the source labels its records span. Returns `null` when the entity carries NO eligibility- or
|
|
31
|
+
* funding-tagged source (it is outside this reconciliation — e.g. a source the caller didn't assign a role) so callers
|
|
32
|
+
* can exclude it rather than silently miscount it.
|
|
33
33
|
*/
|
|
34
34
|
export function bucketOf(sources, config) {
|
|
35
35
|
const elig = new Set(config.eligibilitySources);
|
|
@@ -51,8 +51,8 @@ export function bucketOf(sources, config) {
|
|
|
51
51
|
return null;
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
|
-
* Classify resolved entities into reconciliation buckets. Entities with no eligibility- or
|
|
55
|
-
*
|
|
54
|
+
* Classify resolved entities into reconciliation buckets. Entities with no eligibility- or funding-tagged source are
|
|
55
|
+
* excluded (see {@link bucketOf}).
|
|
56
56
|
*/
|
|
57
57
|
export function reconcileCoverage(entities, config) {
|
|
58
58
|
const reconciled = [];
|
|
@@ -78,9 +78,8 @@ function repName(entity) {
|
|
|
78
78
|
return rep.organization?.canonical ?? (person || rep.id);
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
|
-
* GeoJSON of every located reconciled entity, each feature tagged with its `bucket` + `sources` —
|
|
82
|
-
*
|
|
83
|
-
* skipped.
|
|
81
|
+
* GeoJSON of every located reconciled entity, each feature tagged with its `bucket` + `sources` — the shape
|
|
82
|
+
* {@link toMapHTML} colors categorically by bucket. Entities without a coordinate are skipped.
|
|
84
83
|
*/
|
|
85
84
|
export function reconciliationGeoJSON(result) {
|
|
86
85
|
return {
|
|
@@ -96,7 +95,7 @@ export function reconciliationGeoJSON(result) {
|
|
|
96
95
|
coordinates: [c.entity.coordinate.longitude, c.entity.coordinate.latitude],
|
|
97
96
|
},
|
|
98
97
|
properties: {
|
|
99
|
-
|
|
98
|
+
entityID: c.entity.id,
|
|
100
99
|
bucket: c.bucket,
|
|
101
100
|
sources: c.sources,
|
|
102
101
|
name: repName(c.entity),
|
|
@@ -108,9 +107,8 @@ export function reconciliationGeoJSON(result) {
|
|
|
108
107
|
};
|
|
109
108
|
}
|
|
110
109
|
/**
|
|
111
|
-
* A markdown reconciliation report: the bucket counts, the enrolled-rate floor, an anti-join
|
|
112
|
-
*
|
|
113
|
-
* SET, not a rate, and never an allegation.
|
|
110
|
+
* A markdown reconciliation report: the bucket counts, the enrolled-rate floor, an anti-join spot-check, and — always,
|
|
111
|
+
* by construction — the neutral caveat. The deliverable is the anti-join SET, not a rate, and never an allegation.
|
|
114
112
|
*/
|
|
115
113
|
export function reconciliationReport(result, options = {}) {
|
|
116
114
|
const { counts, reconciled } = result;
|
package/out/reconcile.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reconcile.js","sourceRoot":"","sources":["../reconcile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;
|
|
1
|
+
{"version":3,"file":"reconcile.js","sourceRoot":"","sources":["../reconcile.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AA4BH;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAyB,EAAE,MAAuB;IAC1E,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,kBAAkB,CAAC,CAAA;IAC/C,MAAM,IAAI,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,CAAA;IAC3C,IAAI,cAAc,GAAG,KAAK,CAAA;IAC1B,IAAI,UAAU,GAAG,KAAK,CAAA;IAEtB,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;YAAE,cAAc,GAAG,IAAI,CAAA;QAEtC,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;YAAE,UAAU,GAAG,IAAI,CAAA;IACnC,CAAC;IAED,IAAI,cAAc,IAAI,UAAU;QAAE,OAAO,UAAU,CAAA;IAEnD,IAAI,cAAc;QAAE,OAAO,uBAAuB,CAAA;IAElD,IAAI,UAAU;QAAE,OAAO,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,8GAA8G;QAC9G,qEAAqE,CACtE,CAAA;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAEd,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACxB,CAAC"}
|
package/out/resolve.d.ts
CHANGED
|
@@ -19,51 +19,47 @@
|
|
|
19
19
|
import { type BlockingKey, type FellegiSunterModel, type GBT, type TermFrequencyTable } from "@mailwoman/match";
|
|
20
20
|
import type { ResolvedEntity, SourceRecord } from "./types.js";
|
|
21
21
|
/**
|
|
22
|
-
* Cheap, parse-free normalization for the address-frequency key — uppercase, collapse whitespace,
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* of identity; a lonely address is strong. (See
|
|
22
|
+
* Cheap, parse-free normalization for the address-frequency key — uppercase, collapse whitespace, drop punctuation.
|
|
23
|
+
* Used to count how many distinct entities share an address across the WHOLE corpus (computable over millions of rows
|
|
24
|
+
* without geocoding) and to look that frequency up at match time. It's the inverse-frequency signal: a crowded
|
|
25
|
+
* clinic/billing address is weak evidence of identity; a lonely address is strong. (See
|
|
27
26
|
* docs/articles/evals/2026-06-15-nppes-dedup-benchmark.md.)
|
|
28
27
|
*/
|
|
29
28
|
export declare function addressFrequencyKey(raw: string): string;
|
|
30
29
|
/**
|
|
31
|
-
* Options for {@link buildDefaultModel}. Each lever is default-off, so the base model is
|
|
32
|
-
* byte-stable.
|
|
30
|
+
* Options for {@link buildDefaultModel}. Each lever is default-off, so the base model is byte-stable.
|
|
33
31
|
*/
|
|
34
32
|
export interface DefaultModelOptions {
|
|
35
33
|
/**
|
|
36
|
-
* Corpus-wide address-frequency table (over {@link addressFrequencyKey}) — makes the address-
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
* string.
|
|
34
|
+
* Corpus-wide address-frequency table (over {@link addressFrequencyKey}) — makes the address- agreement weight
|
|
35
|
+
* **inverse to how shared the address is** (a building with 50 providers makes "same address" near-worthless
|
|
36
|
+
* evidence). The table's `value` is the record's raw address string.
|
|
40
37
|
*/
|
|
41
38
|
addressFrequency?: TermFrequencyTable;
|
|
42
39
|
/**
|
|
43
40
|
* **A1 (#625):** collapse the redundant address-key + great-circle-distance comparisons into ONE
|
|
44
|
-
* {@link spatialComparison spatial-agreement} signal — an exact-key tier (where
|
|
45
|
-
*
|
|
46
|
-
*
|
|
41
|
+
* {@link spatialComparison spatial-agreement} signal — an exact-key tier (where `addressFrequency`, if set, rides)
|
|
42
|
+
* over distance buckets. Removes the double-count that over-merges co-located providers (an exact key match already
|
|
43
|
+
* implies distance ≈ 0).
|
|
47
44
|
*/
|
|
48
45
|
collapseSpatial?: boolean;
|
|
49
46
|
/**
|
|
50
|
-
* **A3 (#625):** add a normalized-phone exact-match comparison — a shared line is strong evidence
|
|
51
|
-
*
|
|
47
|
+
* **A3 (#625):** add a normalized-phone exact-match comparison — a shared line is strong evidence and the secondary
|
|
48
|
+
* corroborator that lets a true same-entity link survive name drift under A2.
|
|
52
49
|
*/
|
|
53
50
|
usePhone?: boolean;
|
|
54
51
|
/**
|
|
55
|
-
* Extra secondary-identifier comparisons drawn from {@link SourceRecord.attributes} (e.g.
|
|
56
|
-
*
|
|
57
|
-
*
|
|
52
|
+
* Extra secondary-identifier comparisons drawn from {@link SourceRecord.attributes} (e.g. `["authorizedOfficial"]`).
|
|
53
|
+
* Each becomes an `attr:<key>` comparison AND counts toward A2 corroboration — a more reliable discriminator than
|
|
54
|
+
* phone where the data has one (#625).
|
|
58
55
|
*/
|
|
59
56
|
discriminators?: string[];
|
|
60
57
|
}
|
|
61
58
|
/**
|
|
62
|
-
* The default geocode-first scoring model: name + organization + a spatial signal. The spatial
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
* way.
|
|
59
|
+
* The default geocode-first scoring model: name + organization + a spatial signal. The spatial signal is either two
|
|
60
|
+
* comparisons (address-key similarity + great-circle distance — the legacy default, which double-counts) or, with
|
|
61
|
+
* {@link DefaultModelOptions.collapseSpatial}, one collapsed {@link spatialComparison}. `addressFrequency` down-weights
|
|
62
|
+
* agreement on a crowded address either way.
|
|
67
63
|
*/
|
|
68
64
|
export declare function buildDefaultModel(opts?: DefaultModelOptions): FellegiSunterModel<SourceRecord>;
|
|
69
65
|
/** The default blocking keys: a union of location, canonical address, phone, and email. */
|
|
@@ -79,75 +75,69 @@ export interface ResolveConfig {
|
|
|
79
75
|
/** Skip and report blocks larger than this rather than scanning them. */
|
|
80
76
|
maxBlockSize?: number;
|
|
81
77
|
/**
|
|
82
|
-
* Fit the model's `m`/`u` to the candidate pairs with EM before scoring (label-free). Default
|
|
83
|
-
* false.
|
|
78
|
+
* Fit the model's `m`/`u` to the candidate pairs with EM before scoring (label-free). Default false.
|
|
84
79
|
*/
|
|
85
80
|
trainEM?: boolean;
|
|
86
81
|
/**
|
|
87
|
-
* Address-frequency table (over {@link addressFrequencyKey}) — down-weights address agreement by
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
* or `false` to disable (the legacy bare baseline). Ignored if `model` is supplied.
|
|
82
|
+
* Address-frequency table (over {@link addressFrequencyKey}) — down-weights address agreement by how shared the
|
|
83
|
+
* address is (a crowded clinic/billing address is weak identity evidence). **Default-on (#625):** when omitted,
|
|
84
|
+
* `resolveEntities` AUTO-COMPUTES the table over the INPUT records' addresses (the right scope for a single dataset —
|
|
85
|
+
* a crowded address within the data is down-weighted). Pass your own {@link TermFrequencyTable} (e.g. a corpus-wide
|
|
86
|
+
* one) to override, or `false` to disable (the legacy bare baseline). Ignored if `model` is supplied.
|
|
93
87
|
*/
|
|
94
88
|
addressFrequency?: TermFrequencyTable | false;
|
|
95
89
|
/**
|
|
96
|
-
* A1 (#625): collapse the redundant address-key + distance pair into one
|
|
97
|
-
*
|
|
98
|
-
*
|
|
90
|
+
* A1 (#625): collapse the redundant address-key + distance pair into one {@link spatialComparison}. **Default-on
|
|
91
|
+
* (true)** — the cleaner, less-over-merging spatial model. Set `false` for the legacy two-signal baseline. Ignored if
|
|
92
|
+
* `model` is supplied.
|
|
99
93
|
*/
|
|
100
94
|
collapseSpatial?: boolean;
|
|
101
95
|
/**
|
|
102
|
-
* A2 (#625): require positive name OR org corroboration ({@link CORROBORATING_FIELDS}) for a link
|
|
103
|
-
*
|
|
104
|
-
*
|
|
96
|
+
* A2 (#625): require positive name OR org corroboration ({@link CORROBORATING_FIELDS}) for a link — a shared address
|
|
97
|
+
* alone cannot merge two records. Suppresses the spatial-only links that fuse distinct co-located providers. Default
|
|
98
|
+
* false.
|
|
105
99
|
*/
|
|
106
100
|
requireCorroboration?: boolean;
|
|
107
101
|
/**
|
|
108
|
-
* A3 (#625): add a normalized-phone comparison to the default model — strong evidence and the
|
|
109
|
-
*
|
|
110
|
-
* supplied.
|
|
102
|
+
* A3 (#625): add a normalized-phone comparison to the default model — strong evidence and the secondary corroborator
|
|
103
|
+
* that keeps A2 from killing name-drift recall. Ignored if `model` is supplied.
|
|
111
104
|
*/
|
|
112
105
|
usePhone?: boolean;
|
|
113
106
|
/**
|
|
114
|
-
* A4 (#625): clustering linkage. `"single"` (default) = connected components; `"average"` =
|
|
115
|
-
*
|
|
116
|
-
*
|
|
107
|
+
* A4 (#625): clustering linkage. `"single"` (default) = connected components; `"average"` = average-linkage
|
|
108
|
+
* refinement that splits a component whose sub-clusters are joined only by a weak bridge — the principled over-merge
|
|
109
|
+
* fix.
|
|
117
110
|
*/
|
|
118
111
|
linkage?: "single" | "average";
|
|
119
112
|
/**
|
|
120
|
-
* Extra secondary-identifier keys (from {@link SourceRecord.attributes}) to add as comparisons +
|
|
121
|
-
*
|
|
113
|
+
* Extra secondary-identifier keys (from {@link SourceRecord.attributes}) to add as comparisons + corroborators — e.g.
|
|
114
|
+
* `["authorizedOfficial"]`. Ignored if `model` is supplied.
|
|
122
115
|
*/
|
|
123
116
|
discriminators?: string[];
|
|
124
117
|
/**
|
|
125
|
-
* Override the Fellegi-Sunter link weight with a LEARNED score (#603). When set, a candidate
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
* pattern, which is EM-independent, plus any corpus statistics it captured).
|
|
118
|
+
* Override the Fellegi-Sunter link weight with a LEARNED score (#603). When set, a candidate pair's match weight is
|
|
119
|
+
* this function's return value (same threshold-comparable units as the FS weight) instead of {@link scorePair}'s.
|
|
120
|
+
* Default undefined (pure FS). The blocking + clustering are unchanged, so a trained scorer can be A/B'd against the
|
|
121
|
+
* FS baseline on the identical pipeline. The function is responsible for its own feature computation (e.g. the
|
|
122
|
+
* agreement pattern, which is EM-independent, plus any corpus statistics it captured).
|
|
131
123
|
*
|
|
132
|
-
* INTERACTION with {@link requireCorroboration}: the two are independent and compose, but the
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
124
|
+
* INTERACTION with {@link requireCorroboration}: the two are independent and compose, but the corroboration gate is
|
|
125
|
+
* still evaluated on the Fellegi-Sunter `contributions` (NOT the learned score) — so a learned-high pair with no
|
|
126
|
+
* positive FS name/org/phone agreement is still gated out. A learned scorer is normally trained to subsume
|
|
127
|
+
* corroboration, so use ONE or the other; combining them lets the FS gate veto the learned score, which is rarely
|
|
128
|
+
* what you want.
|
|
137
129
|
*/
|
|
138
130
|
scorer?: (a: SourceRecord, b: SourceRecord) => number;
|
|
139
131
|
/**
|
|
140
|
-
* **#603: the LEARNED gradient-boosted-tree scorer — DEFAULT-ON.** Omitted or `true` uses the
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
* so 0 would over-merge. The model is NPPES/US-trained; for a very different domain, A/B it or
|
|
150
|
-
* pass `false`.
|
|
132
|
+
* **#603: the LEARNED gradient-boosted-tree scorer — DEFAULT-ON.** Omitted or `true` uses the bundled
|
|
133
|
+
* {@link DEDUP_GBT_MODEL} (trained on the NPPES NPI-truth set; beats the Fellegi-Sunter baseline ~+5pp dedup F1
|
|
134
|
+
* held-out within a state and ~+22pp on states it never trained on, cutting the co-located over-merge). `false` opts
|
|
135
|
+
* out to the pure FS baseline; pass your own {@link GBT} for a custom model. The scorer is built over the SAME
|
|
136
|
+
* collapsed-spatial + address-frequency feature model as training (via the resolved {@link addressFrequency}),
|
|
137
|
+
* independent of this call's comparison config. An explicit {@link scorer} takes precedence. When the bundled model
|
|
138
|
+
* is active and you don't set {@link threshold}, its CALIBRATED link threshold
|
|
139
|
+
* ({@link DEDUP_GBT_META}.recommendedThreshold) is used — the GBT logit isn't in FS-weight units, so 0 would
|
|
140
|
+
* over-merge. The model is NPPES/US-trained; for a very different domain, A/B it or pass `false`.
|
|
151
141
|
*/
|
|
152
142
|
learnedScorer?: boolean | GBT;
|
|
153
143
|
}
|
|
@@ -163,8 +153,8 @@ export interface ResolveResult {
|
|
|
163
153
|
}>;
|
|
164
154
|
}
|
|
165
155
|
/**
|
|
166
|
-
* Resolve source records into canonical entities: block → score → cluster. Every record lands in
|
|
167
|
-
*
|
|
156
|
+
* Resolve source records into canonical entities: block → score → cluster. Every record lands in exactly one entity (a
|
|
157
|
+
* record with no confident link is its own singleton entity).
|
|
168
158
|
*/
|
|
169
159
|
export declare function resolveEntities(records: readonly SourceRecord[], config?: ResolveConfig): ResolveResult;
|
|
170
160
|
//# sourceMappingURL=resolve.d.ts.map
|
package/out/resolve.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../resolve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EACN,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,GAAG,EAER,KAAK,kBAAkB,EAgBvB,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../resolve.ts"],"names":[],"mappings":"A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AAC,EAAE,OAAO,CAAA;IAC9B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;;OAIG;IACH,OAAO,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;IAC9B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IACzB;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,YAAY,EAAE,CAAC,EAAE,YAAY,KAAK,MAAM,CAAA;IACrD;;;;;;;;;;OAUG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,GAAG,CAAA;CAC7B;AAED,qCAAqC;AACrC,MAAM,WAAW,aAAa;IAC7B,QAAQ,EAAE,cAAc,EAAE,CAAA;IAC1B,mDAAmD;IACnD,cAAc,EAAE,MAAM,CAAA;IACtB,yEAAyE;IACzE,aAAa,EAAE,KAAK,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACnD;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,EAAE,MAAM,GAAE,aAAkB,GAAG,aAAa,CA0G3G"}
|
package/out/resolve.js
CHANGED
|
@@ -20,11 +20,10 @@ import { DEFAULT_DISTANCE_LEVELS, DEFAULT_SPATIAL_LEVELS, agreementPattern, bloc
|
|
|
20
20
|
import { createGbtScorer } from "./learned-scorer.js";
|
|
21
21
|
import { DEDUP_GBT_META, DEDUP_GBT_MODEL } from "./models/dedup-gbt-en-us.js";
|
|
22
22
|
/**
|
|
23
|
-
* Cheap, parse-free normalization for the address-frequency key — uppercase, collapse whitespace,
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
* of identity; a lonely address is strong. (See
|
|
23
|
+
* Cheap, parse-free normalization for the address-frequency key — uppercase, collapse whitespace, drop punctuation.
|
|
24
|
+
* Used to count how many distinct entities share an address across the WHOLE corpus (computable over millions of rows
|
|
25
|
+
* without geocoding) and to look that frequency up at match time. It's the inverse-frequency signal: a crowded
|
|
26
|
+
* clinic/billing address is weak evidence of identity; a lonely address is strong. (See
|
|
28
27
|
* docs/articles/evals/2026-06-15-nppes-dedup-benchmark.md.)
|
|
29
28
|
*/
|
|
30
29
|
export function addressFrequencyKey(raw) {
|
|
@@ -41,8 +40,7 @@ const NAME_LEVELS = [
|
|
|
41
40
|
{ label: "different", minSimilarity: 0, m: 0.05, u: 0.96 },
|
|
42
41
|
];
|
|
43
42
|
/**
|
|
44
|
-
* Exact-vs-different levels for a normalized phone. A shared line is strong, rarely-coincidental
|
|
45
|
-
* evidence.
|
|
43
|
+
* Exact-vs-different levels for a normalized phone. A shared line is strong, rarely-coincidental evidence.
|
|
46
44
|
*/
|
|
47
45
|
const PHONE_LEVELS = [
|
|
48
46
|
{ label: "exact", minSimilarity: 1.0, m: 0.6, u: 0.002 },
|
|
@@ -57,17 +55,16 @@ function normalizePhone(raw) {
|
|
|
57
55
|
}
|
|
58
56
|
/**
|
|
59
57
|
* The identity-corroborating comparisons (person name, organization, phone). A2 (#625,
|
|
60
|
-
* {@link ResolveConfig.requireCorroboration}) requires at least one of these to _positively_ agree
|
|
61
|
-
*
|
|
62
|
-
*
|
|
58
|
+
* {@link ResolveConfig.requireCorroboration}) requires at least one of these to _positively_ agree before a pair may
|
|
59
|
+
* link — a shared address alone is not identity. Phone (A3) is the secondary identifier that rescues a true same-entity
|
|
60
|
+
* link across name drift.
|
|
63
61
|
*/
|
|
64
62
|
const CORROBORATING_FIELDS = new Set(["given", "family", "organization", "phone"]);
|
|
65
63
|
/**
|
|
66
|
-
* The default geocode-first scoring model: name + organization + a spatial signal. The spatial
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
* way.
|
|
64
|
+
* The default geocode-first scoring model: name + organization + a spatial signal. The spatial signal is either two
|
|
65
|
+
* comparisons (address-key similarity + great-circle distance — the legacy default, which double-counts) or, with
|
|
66
|
+
* {@link DefaultModelOptions.collapseSpatial}, one collapsed {@link spatialComparison}. `addressFrequency` down-weights
|
|
67
|
+
* agreement on a crowded address either way.
|
|
71
68
|
*/
|
|
72
69
|
export function buildDefaultModel(opts = {}) {
|
|
73
70
|
const identity = [
|
|
@@ -142,8 +139,8 @@ export function defaultBlockingKeys() {
|
|
|
142
139
|
];
|
|
143
140
|
}
|
|
144
141
|
/**
|
|
145
|
-
* Resolve source records into canonical entities: block → score → cluster. Every record lands in
|
|
146
|
-
*
|
|
142
|
+
* Resolve source records into canonical entities: block → score → cluster. Every record lands in exactly one entity (a
|
|
143
|
+
* record with no confident link is its own singleton entity).
|
|
147
144
|
*/
|
|
148
145
|
export function resolveEntities(records, config = {}) {
|
|
149
146
|
// The proven levers are DEFAULT-ON (#625): the address-frequency down-weight (auto-computed over the
|
package/out/resolve.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../resolve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAMN,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,EAChB,KAAK,EACL,uBAAuB,EACvB,OAAO,EACP,kBAAkB,EAClB,kBAAkB,EAClB,QAAQ,EACR,UAAU,EACV,cAAc,EACd,SAAS,EACT,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,GACjB,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../resolve.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAMN,uBAAuB,EACvB,sBAAsB,EACtB,gBAAgB,EAChB,KAAK,EACL,uBAAuB,EACvB,OAAO,EACP,kBAAkB,EAClB,kBAAkB,EAClB,QAAQ,EACR,UAAU,EACV,cAAc,EACd,SAAS,EACT,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,GACjB,MAAM,kBAAkB,CA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AC,CAAC,CAAE,CAAA;QAE9C,OAAO;YACN,EAAE,EAAE,UAAU,CAAC,EAAE;YACjB,OAAO,EAAE,KAAK;YACd,cAAc,EAAE,GAAG;YACnB,UAAU,EAAE,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,IAAI,SAAS;YACzD,QAAQ,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,cAAc,CAAC,CAAC,CAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAE,CAAC,CAAC,CAAC,IAAI;SACzF,CAAA;IACF,CAAC,CAAC,CAAA;IAEF,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,KAAK,CAAC,MAAM,EAAE,aAAa,EAAE,CAAA;AACjE,CAAC"}
|
package/out/types.d.ts
CHANGED
|
@@ -22,10 +22,10 @@ export interface SourceRecord {
|
|
|
22
22
|
phone?: string | null;
|
|
23
23
|
email?: string | null;
|
|
24
24
|
/**
|
|
25
|
-
* Additional secondary-identifier fields, normalized — anything that helps tell two records apart
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
25
|
+
* Additional secondary-identifier fields, normalized — anything that helps tell two records apart or confirm they're
|
|
26
|
+
* the same beyond name/org/address/phone (an authorized-official name, a provider taxonomy, a license number…). Used
|
|
27
|
+
* as extra comparisons + corroborators when the model is built with matching `discriminators`. Keyed by a stable
|
|
28
|
+
* field name the model references.
|
|
29
29
|
*/
|
|
30
30
|
attributes?: Record<string, string>;
|
|
31
31
|
/** The original row, verbatim, for audit. */
|
|
@@ -45,8 +45,7 @@ export interface ResolvedEntity {
|
|
|
45
45
|
longitude: number;
|
|
46
46
|
};
|
|
47
47
|
/**
|
|
48
|
-
* Weakest within-cluster link weight in bits (how tightly it holds together); `null` for a
|
|
49
|
-
* singleton.
|
|
48
|
+
* Weakest within-cluster link weight in bits (how tightly it holds together); `null` for a singleton.
|
|
50
49
|
*/
|
|
51
50
|
cohesion: number | null;
|
|
52
51
|
}
|
|
@@ -55,7 +54,7 @@ export interface ResolvedEntity {
|
|
|
55
54
|
*/
|
|
56
55
|
export type ReconciliationBucket = "enrolled" | "eligible-not-enrolled" | "funded-not-eligible";
|
|
57
56
|
export interface EntityGeoData {
|
|
58
|
-
|
|
57
|
+
entityID: string;
|
|
59
58
|
sourceIds?: string[];
|
|
60
59
|
recordCount?: number;
|
|
61
60
|
cohesion?: number | null;
|
package/out/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAEpG,oGAAoG;AACpG,MAAM,WAAW,YAAY;IAC5B,iEAAiE;IACjE,EAAE,EAAE,MAAM,CAAA;IACV,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,wDAAwD;IACxD,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI,CAAA;IACxB,kEAAkE;IAClE,YAAY,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAA;IACtC,oDAAoD;IACpD,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAAA;IAC9B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACnC,6CAA6C;IAC7C,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC5B;AAED,uGAAuG;AACvG,MAAM,WAAW,cAAc;IAC9B,yCAAyC;IACzC,EAAE,EAAE,MAAM,CAAA;IACV,uDAAuD;IACvD,OAAO,EAAE,YAAY,EAAE,CAAA;IACvB,q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AA;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"}
|
package/out/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;;AA+DH,YAAY"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailwoman/registry",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.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",
|
|
6
6
|
"repository": {
|
|
@@ -8,6 +8,12 @@
|
|
|
8
8
|
"url": "https://github.com/sister-software/mailwoman.git",
|
|
9
9
|
"directory": "registry"
|
|
10
10
|
},
|
|
11
|
+
"files": [
|
|
12
|
+
"out/**/*.js",
|
|
13
|
+
"out/**/*.js.map",
|
|
14
|
+
"out/**/*.d.ts",
|
|
15
|
+
"out/**/*.d.ts.map"
|
|
16
|
+
],
|
|
11
17
|
"type": "module",
|
|
12
18
|
"exports": {
|
|
13
19
|
"./package.json": "./package.json",
|
|
@@ -16,25 +22,19 @@
|
|
|
16
22
|
"./geojson": "./out/geojson.js",
|
|
17
23
|
"./ingest": "./out/ingest.js"
|
|
18
24
|
},
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
19
28
|
"dependencies": {
|
|
20
|
-
"@mailwoman/address-id": "
|
|
21
|
-
"@mailwoman/match": "
|
|
22
|
-
"@mailwoman/record": "
|
|
23
|
-
"@mailwoman/spatial": "
|
|
29
|
+
"@mailwoman/address-id": "5.0.0",
|
|
30
|
+
"@mailwoman/match": "5.0.0",
|
|
31
|
+
"@mailwoman/record": "5.0.0",
|
|
32
|
+
"@mailwoman/spatial": "5.0.0",
|
|
24
33
|
"@protomaps/basemaps": "^5.7.2",
|
|
25
34
|
"csv-parse": "^5.6.0",
|
|
26
|
-
"spliterator": "^
|
|
35
|
+
"spliterator": "^3.1.0"
|
|
27
36
|
},
|
|
28
37
|
"devDependencies": {
|
|
29
38
|
"@types/node": ">=26.0.1"
|
|
30
|
-
},
|
|
31
|
-
"files": [
|
|
32
|
-
"out/**/*.js",
|
|
33
|
-
"out/**/*.js.map",
|
|
34
|
-
"out/**/*.d.ts",
|
|
35
|
-
"out/**/*.d.ts.map"
|
|
36
|
-
],
|
|
37
|
-
"publishConfig": {
|
|
38
|
-
"access": "public"
|
|
39
39
|
}
|
|
40
40
|
}
|