@mailwoman/registry 10.1.0 → 10.2.1

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 (101) hide show
  1. package/README.md +1 -4
  2. package/lib/geocode-handler.ts +1 -1
  3. package/lib/geojson.ts +2 -1
  4. package/lib/ingest.ts +18 -14
  5. package/lib/map-html.ts +2 -2
  6. package/lib/reconcile.ts +4 -3
  7. package/lib/resolve.ts +12 -11
  8. package/lib/types.ts +17 -17
  9. package/out/geocode-handler.js +1 -1
  10. package/out/geocode-handler.js.map +1 -1
  11. package/out/geojson.d.ts.map +1 -1
  12. package/out/geojson.js +2 -1
  13. package/out/geojson.js.map +1 -1
  14. package/out/ingest.d.ts +6 -4
  15. package/out/ingest.d.ts.map +1 -1
  16. package/out/ingest.js +13 -11
  17. package/out/ingest.js.map +1 -1
  18. package/out/map-html.js +2 -2
  19. package/out/map-html.js.map +1 -1
  20. package/out/reconcile.d.ts +3 -2
  21. package/out/reconcile.d.ts.map +1 -1
  22. package/out/reconcile.js +1 -1
  23. package/out/reconcile.js.map +1 -1
  24. package/out/resolve.d.ts +7 -6
  25. package/out/resolve.d.ts.map +1 -1
  26. package/out/resolve.js +5 -5
  27. package/out/resolve.js.map +1 -1
  28. package/out/tools/coverage-reconciliation.d.ts +3 -3
  29. package/out/tools/cross/dataset-correlation.d.ts +7 -4
  30. package/out/tools/cross/dataset-correlation.d.ts.map +1 -1
  31. package/out/tools/cross/dataset-correlation.js.map +1 -1
  32. package/out/tools/cross/source-threshold-sweep.d.ts +3 -3
  33. package/out/tools/dedup-ceiling.d.ts +4 -4
  34. package/out/tools/eval-geocoder.d.ts +5 -3
  35. package/out/tools/eval-geocoder.d.ts.map +1 -1
  36. package/out/tools/geocoder/vs-provided-coords.d.ts +2 -2
  37. package/out/tools/geocoder/vs-provided-coords.js.map +1 -1
  38. package/out/tools/gold-set-sample.d.ts +5 -5
  39. package/out/tools/learned/scorer/clustering-eval.d.ts +6 -6
  40. package/out/tools/learned/scorer/crossstate-eval.d.ts +4 -4
  41. package/out/tools/learned/scorer/eval.d.ts +9 -5
  42. package/out/tools/learned/scorer/eval.d.ts.map +1 -1
  43. package/out/tools/learned/scorer/eval.js.map +1 -1
  44. package/out/tools/nppes/dedup-benchmark.d.ts +3 -2
  45. package/out/tools/nppes/dedup-benchmark.d.ts.map +1 -1
  46. package/out/tools/nppes/dedup-benchmark.js +2 -2
  47. package/out/tools/nppes/dedup-benchmark.js.map +1 -1
  48. package/out/tools/nppes/org-name.d.ts +0 -7
  49. package/out/tools/nppes/org-name.d.ts.map +1 -1
  50. package/out/tools/nppes/org-name.js +0 -7
  51. package/out/tools/nppes/org-name.js.map +1 -1
  52. package/out/tools/nppes/overmerge-packet.js +1 -1
  53. package/out/tools/nppes/overmerge-packet.js.map +1 -1
  54. package/out/tools/nppes/sample.d.ts +1 -1
  55. package/out/tools/nppes/sample.d.ts.map +1 -1
  56. package/out/tools/nppes/sample.js +1 -2
  57. package/out/tools/nppes/sample.js.map +1 -1
  58. package/out/tools/shared.d.ts +6 -14
  59. package/out/tools/shared.d.ts.map +1 -1
  60. package/out/tools/shared.js +1 -1
  61. package/out/tools/shared.js.map +1 -1
  62. package/out/tools/train/cross-gbt.d.ts +8 -7
  63. package/out/tools/train/cross-gbt.d.ts.map +1 -1
  64. package/out/tools/train/cross-gbt.js.map +1 -1
  65. package/out/tools/train/gbt.d.ts +6 -6
  66. package/out/tools/train/org-cross-gbt.d.ts +7 -6
  67. package/out/tools/train/org-cross-gbt.d.ts.map +1 -1
  68. package/out/tools/train/org-cross-gbt.js.map +1 -1
  69. package/out/tools/txhhsc-to-oarow.d.ts +2 -2
  70. package/out/tools/viz/cross-dataset-map.d.ts +2 -2
  71. package/out/tools/viz/geocode-first-surface.d.ts +3 -2
  72. package/out/tools/viz/geocode-first-surface.d.ts.map +1 -1
  73. package/out/tools/viz/geocode-first-surface.js.map +1 -1
  74. package/out/tools/viz/render.d.ts +2 -2
  75. package/out/tools/viz/source-provenance-map.d.ts +6 -6
  76. package/out/types.d.ts +18 -18
  77. package/out/types.d.ts.map +1 -1
  78. package/package.json +11 -11
  79. package/tools/coverage-reconciliation.ts +3 -3
  80. package/tools/cross/dataset-correlation.ts +8 -5
  81. package/tools/cross/source-threshold-sweep.ts +3 -3
  82. package/tools/dedup-ceiling.ts +4 -4
  83. package/tools/eval-geocoder.ts +6 -3
  84. package/tools/geocoder/vs-provided-coords.ts +3 -3
  85. package/tools/gold-set-sample.ts +5 -5
  86. package/tools/learned/scorer/clustering-eval.ts +6 -6
  87. package/tools/learned/scorer/crossstate-eval.ts +4 -4
  88. package/tools/learned/scorer/eval.ts +9 -5
  89. package/tools/nppes/dedup-benchmark.ts +5 -4
  90. package/tools/nppes/org-name.ts +0 -9
  91. package/tools/nppes/overmerge-packet.ts +1 -1
  92. package/tools/nppes/sample.ts +2 -2
  93. package/tools/shared.ts +7 -16
  94. package/tools/train/cross-gbt.ts +8 -7
  95. package/tools/train/gbt.ts +6 -6
  96. package/tools/train/org-cross-gbt.ts +7 -6
  97. package/tools/txhhsc-to-oarow.ts +2 -2
  98. package/tools/viz/cross-dataset-map.ts +2 -2
  99. package/tools/viz/geocode-first-surface.ts +3 -2
  100. package/tools/viz/render.ts +2 -2
  101. package/tools/viz/source-provenance-map.ts +6 -6
package/tools/shared.ts CHANGED
@@ -10,7 +10,7 @@ import { makeDirectories, writeLocalFile } from "@mailwoman/core/fs/writers"
10
10
  import { stringifyJSON } from "@mailwoman/core/json"
11
11
  import { isPresent } from "@mailwoman/core/objects"
12
12
  import { makeLcg } from "@mailwoman/core/random"
13
- import { block, gbtScore, trainGBT, type TermFrequencyTable } from "@mailwoman/match"
13
+ import { block, gbtScore, trainGBT, type GBTOpts, type TermFrequencyTable } from "@mailwoman/match"
14
14
  import { dirname } from "path-ts"
15
15
 
16
16
  import {
@@ -43,15 +43,16 @@ export interface SourceSpec {
43
43
  inState: (row: Record<string, string>) => boolean
44
44
  /**
45
45
  * Optional: a row carrying ≥1 addressable entity yields each as its own row.
46
- * Default identity.
46
+ *
47
+ * @defaultValue identity.
47
48
  */
48
49
  explode?: (row: Record<string, string>) => Record<string, string>[]
49
50
  }
50
51
 
51
52
  /**
52
- * Trim, treating `undefined` as empty — the shape every probe's raw CSV columns arrive in.
53
+ * Trim, treating `null` or `undefined` as empty — the shape every probe's raw CSV columns arrive in.
53
54
  */
54
- export const norm = (s: string | undefined): string => (s ?? "").trim()
55
+ export const norm = (s: string | null | undefined): string => (s ?? "").trim()
55
56
 
56
57
  /**
57
58
  * Corporate-form suffixes and function words that add no identity — dropped from an organization name
@@ -505,17 +506,7 @@ export const buildSpecs = (S: string, STATE: string): SourceSpec[] => [
505
506
  },
506
507
  ]
507
508
 
508
- /**
509
- * The GBT hyperparameter shape the trainers stamp into their model meta.
510
- */
511
- export interface GBTHyperparameters {
512
- rounds: number
513
- depth: number
514
- lr: number
515
- minLeaf: number
516
- }
517
-
518
- const CROSS_SOURCE_HYPERPARAMS: GBTHyperparameters = { rounds: 120, depth: 3, lr: 0.3, minLeaf: 20 }
509
+ const CROSS_SOURCE_HYPERPARAMS: GBTOpts = { rounds: 120, depth: 3, lr: 0.3, minLeaf: 20 }
519
510
 
520
511
  const FIT_SPLIT_FRACTION = 0.8
521
512
 
@@ -544,7 +535,7 @@ export interface CrossSourceTrainingFigures {
544
535
  f1Max: number
545
536
  recommendedThreshold: number
546
537
  features: number
547
- hyperparams: GBTHyperparameters
538
+ hyperparams: GBTOpts
548
539
  }
549
540
 
550
541
  /**
@@ -45,42 +45,43 @@ export interface TrainCrossSourceGBTOptions {
45
45
  /**
46
46
  * Record-matcher sources directory.
47
47
  *
48
- * Default `$MAILWOMAN_DATA_ROOT/record-matcher/sources`.
48
+ * @defaultValue `$MAILWOMAN_DATA_ROOT/record-matcher/sources`
49
49
  */
50
50
  sources?: PathBuilderLike
51
51
  /**
52
52
  * State filter.
53
53
  *
54
- * Default TX.
54
+ * @defaultValue TX.
55
55
  */
56
56
  state?: string
57
57
  /**
58
58
  * NPIs sampled.
59
59
  *
60
- * Default 2000.
60
+ * @defaultValue `2000`
61
61
  */
62
62
  npis?: number
63
63
  /**
64
64
  * Output TS module path.
65
65
  *
66
- * Default `registry/models/crosssource-gbt-en-us.ts`.
66
+ * @defaultValue `registry/models/crosssource-gbt-en-us.ts`
67
67
  */
68
68
  out?: string
69
69
  /**
70
70
  * Locale recorded in the model meta.
71
71
  *
72
- * Default en-US.
72
+ * @defaultValue `"en-US"`
73
73
  */
74
74
  locale?: string
75
75
  /**
76
76
  * Max cross-source recall subject to this held-out pairwise precision.
77
- * Default 0.95.
77
+ *
78
+ * @defaultValue `0.95`
78
79
  */
79
80
  precisionBar?: number
80
81
  /**
81
82
  * The training date stored in the metadata.
82
83
  *
83
- * Default today.
84
+ * @defaultValue today.
84
85
  */
85
86
  date?: string
86
87
  }
@@ -57,31 +57,31 @@ export interface TrainDedupGBTOptions {
57
57
  /**
58
58
  * Record-matcher sources directory.
59
59
  *
60
- * Default `$MAILWOMAN_DATA_ROOT/record-matcher/sources`.
60
+ * @defaultValue `$MAILWOMAN_DATA_ROOT/record-matcher/sources`
61
61
  */
62
62
  sources?: string
63
63
  /**
64
64
  * State filter.
65
65
  *
66
- * Default TX.
66
+ * @defaultValue TX.
67
67
  */
68
68
  state?: string
69
69
  /**
70
70
  * NPIs sampled.
71
71
  *
72
- * Default 3000.
72
+ * @defaultValue `3000`
73
73
  */
74
74
  npis?: number
75
75
  /**
76
76
  * Output TS module path.
77
77
  *
78
- * Default `registry/models/dedup-gbt-en-us.ts`.
78
+ * @defaultValue `registry/models/dedup-gbt-en-us.ts`
79
79
  */
80
80
  out?: string
81
81
  /**
82
82
  * Locale recorded in the model meta (the command's factory loads the matching weights).
83
83
  *
84
- * Default en-US.
84
+ * @defaultValue `"en-US"`
85
85
  */
86
86
  locale?: string
87
87
  /**
@@ -97,7 +97,7 @@ export interface TrainDedupGBTOptions {
97
97
  /**
98
98
  * The training date stored in the metadata (overridable for reproducible commits).
99
99
  *
100
- * Default today.
100
+ * @defaultValue today.
101
101
  */
102
102
  date?: string
103
103
  }
@@ -44,36 +44,37 @@ export interface TrainOrgCrossSourceGBTOptions {
44
44
  /**
45
45
  * Record-matcher sources directory.
46
46
  *
47
- * Default `$MAILWOMAN_DATA_ROOT/record-matcher/sources`.
47
+ * @defaultValue `$MAILWOMAN_DATA_ROOT/record-matcher/sources`
48
48
  */
49
49
  sources?: PathBuilderLike
50
50
  /**
51
51
  * Care Compare facilities sampled.
52
52
  *
53
- * Default 6000.
53
+ * @defaultValue `6000`
54
54
  */
55
55
  cap?: number
56
56
  /**
57
57
  * Output TS module path.
58
58
  *
59
- * Default `registry/models/org-crosssource-gbt-en-us.ts`.
59
+ * @defaultValue `registry/models/org-crosssource-gbt-en-us.ts`
60
60
  */
61
61
  out?: string
62
62
  /**
63
63
  * Locale recorded in the model meta.
64
64
  *
65
- * Default en-US.
65
+ * @defaultValue `"en-US"`
66
66
  */
67
67
  locale?: string
68
68
  /**
69
69
  * Max cross-source recall subject to this held-out pairwise precision.
70
- * Default 0.95.
70
+ *
71
+ * @defaultValue `0.95`
71
72
  */
72
73
  precisionBar?: number
73
74
  /**
74
75
  * The training date stored in the metadata.
75
76
  *
76
- * Default today.
77
+ * @defaultValue today.
77
78
  */
78
79
  date?: string
79
80
  }
@@ -30,13 +30,13 @@ export interface TXHHSCConvertOptions {
30
30
  /**
31
31
  * The TX hhsc nursing-facilities TSV.
32
32
  *
33
- * Default `$MAILWOMAN_DATA_ROOT/record-matcher/sources/…`.
33
+ * @defaultValue `$MAILWOMAN_DATA_ROOT/record-matcher/sources/…`
34
34
  */
35
35
  src?: PathBuilderLike
36
36
  /**
37
37
  * Output OaRow jsonl path.
38
38
  *
39
- * Default `/tmp/txhhsc-oarow.jsonl`.
39
+ * @defaultValue `/tmp/txhhsc-oarow.jsonl`
40
40
  */
41
41
  out?: string
42
42
  }
@@ -26,13 +26,13 @@ export interface CrossDatasetMapOptions {
26
26
  /**
27
27
  * The `cross-dataset-links` GeoJSON.
28
28
  *
29
- * Default `$MAILWOMAN_DATA_ROOT/record-matcher/2026-06-16-cross-dataset-links.geojson`.
29
+ * @defaultValue `$MAILWOMAN_DATA_ROOT/record-matcher/2026-06-16-cross-dataset-links.geojson`
30
30
  */
31
31
  in?: string
32
32
  /**
33
33
  * Output html path.
34
34
  *
35
- * Default `/tmp/cross-dataset-map.html`.
35
+ * @defaultValue `/tmp/cross-dataset-map.html`
36
36
  */
37
37
  outHTML?: string
38
38
  /**
@@ -21,13 +21,14 @@ export interface GeocodeFirstSurfaceOptions {
21
21
  * Production's record matcher uses λ=1e-4 (calibrated for the full multi-field model with phone
22
22
  *
23
23
  * - Spatial exact-key); here we want the boundary visible in a two-axis projection.
24
- * Default 0.02.
24
+ *
25
+ * @defaultValue `0.02`
25
26
  */
26
27
  lambda?: number
27
28
  /**
28
29
  * Output html path.
29
30
  *
30
- * Default `/tmp/geocode-first-surface.html`.
31
+ * @defaultValue `/tmp/geocode-first-surface.html`
31
32
  */
32
33
  outHTML?: string
33
34
  }
@@ -32,13 +32,13 @@ export interface RenderPlotlyOptions {
32
32
  /**
33
33
  * Viewport width.
34
34
  *
35
- * Default 1160.
35
+ * @defaultValue `1160`
36
36
  */
37
37
  width?: number
38
38
  /**
39
39
  * Viewport height.
40
40
  *
41
- * Default 1000.
41
+ * @defaultValue `1000`
42
42
  */
43
43
  height?: number
44
44
  }
@@ -24,37 +24,37 @@ export interface SourceProvenanceMapOptions {
24
24
  /**
25
25
  * State (lowercase postal).
26
26
  *
27
- * Default ny.
27
+ * @defaultValue `"ny"`
28
28
  */
29
29
  state?: string
30
30
  /**
31
31
  * Address-point DB path.
32
32
  *
33
- * Default `$MAILWOMAN_DATA_ROOT/db/address-points/address-points-us-<state>.db`.
33
+ * @defaultValue `$MAILWOMAN_DATA_ROOT/db/address-points/address-points-us-<state>.db`
34
34
  */
35
35
  db?: string
36
36
  /**
37
37
  * Output html path.
38
38
  *
39
- * Default `/tmp/source-provenance.html`.
39
+ * @defaultValue `/tmp/source-provenance.html`
40
40
  */
41
41
  outHTML?: string
42
42
  /**
43
43
  * Keep ~1/N of NAD points.
44
44
  *
45
- * Default 700.
45
+ * @defaultValue `700`
46
46
  */
47
47
  nadMod?: number
48
48
  /**
49
49
  * Keep ~1/N of OpenAddresses points.
50
50
  *
51
- * Default 120.
51
+ * @defaultValue `120`
52
52
  */
53
53
  oaMod?: number
54
54
  /**
55
55
  * Per-source marker cap.
56
56
  *
57
- * Default 7000.
57
+ * @defaultValue `7000`
58
58
  */
59
59
  cap?: number
60
60
  }