@mailwoman/corpus 5.9.0 → 5.10.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 (169) hide show
  1. package/out/src/adapter.d.ts +1 -1
  2. package/out/src/adapters/ban/adapter.d.ts +1 -1
  3. package/out/src/adapters/fcc-bdc/adapter.d.ts +1 -1
  4. package/out/src/adapters/geonames/adapter.d.ts +1 -1
  5. package/out/src/adapters/geonames-postal/adapter.d.ts +1 -1
  6. package/out/src/adapters/gnaf/adapter.d.ts +1 -1
  7. package/out/src/adapters/index.d.ts +19 -19
  8. package/out/src/adapters/openaddresses/adapter.d.ts +1 -1
  9. package/out/src/adapters/overture/adapter.d.ts +1 -1
  10. package/out/src/adapters/state-hi-schools/adapter.d.ts +1 -1
  11. package/out/src/adapters/state-ia-contractors/adapter.d.ts +1 -1
  12. package/out/src/adapters/state-ny-notaries/adapter.d.ts +1 -1
  13. package/out/src/adapters/state-tx-notaries/adapter.d.ts +1 -1
  14. package/out/src/adapters/synth-po-box/adapter.d.ts +2 -2
  15. package/out/src/adapters/tiger/adapter.d.ts +1 -1
  16. package/out/src/adapters/usgov-hrsa-fqhc/adapter.d.ts +1 -1
  17. package/out/src/adapters/usgov-imls-pls/adapter.d.ts +1 -1
  18. package/out/src/adapters/usgov-irs-bmf/adapter.d.ts +1 -1
  19. package/out/src/adapters/usgov-nad/adapter.d.ts +2 -2
  20. package/out/src/adapters/usgov-nad/adapter.js +1 -1
  21. package/out/src/adapters/usgov-nppes/adapter.d.ts +1 -1
  22. package/out/src/adapters/usgov-samhsa-treatment-locator/adapter.d.ts +1 -1
  23. package/out/src/adapters/wof-admin-jp/adapter.d.ts +1 -1
  24. package/out/src/adapters/wof-admin-json/adapter.d.ts +2 -2
  25. package/out/src/adapters/wof-postalcode-json/adapter.d.ts +2 -2
  26. package/out/src/align.d.ts +2 -2
  27. package/out/src/build.d.ts +4 -4
  28. package/out/src/index.d.ts +22 -21
  29. package/out/src/index.d.ts.map +1 -1
  30. package/out/src/index.js +1 -0
  31. package/out/src/index.js.map +1 -1
  32. package/out/src/parquet-wrapper/index.d.ts +3 -3
  33. package/out/src/parquet-wrapper/reader.d.ts +1 -1
  34. package/out/src/parquet-wrapper/writer.d.ts +4 -2
  35. package/out/src/parquet-wrapper/writer.d.ts.map +1 -1
  36. package/out/src/parquet-wrapper/writer.js +3 -1
  37. package/out/src/parquet-wrapper/writer.js.map +1 -1
  38. package/out/src/parquet.d.ts +3 -3
  39. package/out/src/runner.d.ts +2 -2
  40. package/out/src/shard-recipes/anchor-absorption.d.ts +1 -1
  41. package/out/src/shard-recipes/boundary-stress.d.ts +1 -1
  42. package/out/src/shard-recipes/country-balanced.d.ts +1 -1
  43. package/out/src/shard-recipes/cz-pcfirst-preposition.d.ts +1 -1
  44. package/out/src/shard-recipes/fr-admin-split.d.ts +1 -1
  45. package/out/src/shard-recipes/fr-bare-street.d.ts +1 -1
  46. package/out/src/shard-recipes/fr-order.d.ts +1 -1
  47. package/out/src/shard-recipes/german.d.ts +1 -1
  48. package/out/src/shard-recipes/house-venue.d.ts +1 -1
  49. package/out/src/shard-recipes/index.d.ts +2 -2
  50. package/out/src/shard-recipes/intersection.d.ts +1 -1
  51. package/out/src/shard-recipes/locale.d.ts +2 -2
  52. package/out/src/shard-recipes/nl-postcode.d.ts +1 -1
  53. package/out/src/shard-recipes/no-street-led.d.ts +1 -1
  54. package/out/src/shard-recipes/no-street.d.ts +1 -1
  55. package/out/src/shard-recipes/po-box-cedex.d.ts +1 -1
  56. package/out/src/shard-recipes/po-box.d.ts +1 -1
  57. package/out/src/shard-recipes/si-bare-village.d.ts +1 -1
  58. package/out/src/shard-recipes/street-affix.d.ts +1 -1
  59. package/out/src/shard-recipes/street-bare.d.ts +1 -1
  60. package/out/src/shard-recipes/street.d.ts +1 -1
  61. package/out/src/shard-recipes/unit.d.ts +1 -1
  62. package/out/src/split.d.ts +1 -1
  63. package/out/src/split.js +1 -1
  64. package/out/src/split.js.map +1 -1
  65. package/out/src/synthesize-boundary-stress.d.ts +1 -1
  66. package/out/src/synthesize-german.d.ts +1 -1
  67. package/out/src/synthesize-house-venue.d.ts +1 -1
  68. package/out/src/synthesize-intersection.d.ts +1 -1
  69. package/out/src/synthesize-no-street.d.ts +1 -1
  70. package/out/src/synthesize-po-box.d.ts +1 -1
  71. package/out/src/synthesize-street.d.ts +1 -1
  72. package/out/src/synthesize.d.ts +2 -2
  73. package/out/src/tools/align-shard.d.ts +8 -0
  74. package/out/src/tools/align-shard.d.ts.map +1 -0
  75. package/out/src/tools/align-shard.js +58 -0
  76. package/out/src/tools/align-shard.js.map +1 -0
  77. package/out/src/tools/audit.d.ts +28 -0
  78. package/out/src/tools/audit.d.ts.map +1 -0
  79. package/out/src/tools/audit.js +273 -0
  80. package/out/src/tools/audit.js.map +1 -0
  81. package/out/src/tools/corpus-stats.d.ts +44 -0
  82. package/out/src/tools/corpus-stats.d.ts.map +1 -0
  83. package/out/src/tools/corpus-stats.js +151 -0
  84. package/out/src/tools/corpus-stats.js.map +1 -0
  85. package/out/src/tools/fetch/ban.d.ts +31 -0
  86. package/out/src/tools/fetch/ban.d.ts.map +1 -0
  87. package/out/src/tools/fetch/ban.js +248 -0
  88. package/out/src/tools/fetch/ban.js.map +1 -0
  89. package/out/src/tools/fetch/download.d.ts +49 -0
  90. package/out/src/tools/fetch/download.d.ts.map +1 -0
  91. package/out/src/tools/fetch/download.js +81 -0
  92. package/out/src/tools/fetch/download.js.map +1 -0
  93. package/out/src/tools/fetch/hrsa.d.ts +18 -0
  94. package/out/src/tools/fetch/hrsa.d.ts.map +1 -0
  95. package/out/src/tools/fetch/hrsa.js +46 -0
  96. package/out/src/tools/fetch/hrsa.js.map +1 -0
  97. package/out/src/tools/fetch/imls-pls.d.ts +25 -0
  98. package/out/src/tools/fetch/imls-pls.d.ts.map +1 -0
  99. package/out/src/tools/fetch/imls-pls.js +120 -0
  100. package/out/src/tools/fetch/imls-pls.js.map +1 -0
  101. package/out/src/tools/fetch/index.d.ts +118 -0
  102. package/out/src/tools/fetch/index.d.ts.map +1 -0
  103. package/out/src/tools/fetch/index.js +117 -0
  104. package/out/src/tools/fetch/index.js.map +1 -0
  105. package/out/src/tools/fetch/nad.d.ts +56 -0
  106. package/out/src/tools/fetch/nad.d.ts.map +1 -0
  107. package/out/src/tools/fetch/nad.js +225 -0
  108. package/out/src/tools/fetch/nad.js.map +1 -0
  109. package/out/src/tools/fetch/nppes.d.ts +26 -0
  110. package/out/src/tools/fetch/nppes.d.ts.map +1 -0
  111. package/out/src/tools/fetch/nppes.js +136 -0
  112. package/out/src/tools/fetch/nppes.js.map +1 -0
  113. package/out/src/tools/fetch/openaddresses.d.ts +59 -0
  114. package/out/src/tools/fetch/openaddresses.d.ts.map +1 -0
  115. package/out/src/tools/fetch/openaddresses.js +307 -0
  116. package/out/src/tools/fetch/openaddresses.js.map +1 -0
  117. package/out/src/tools/fetch/state-hi-schools.d.ts +25 -0
  118. package/out/src/tools/fetch/state-hi-schools.d.ts.map +1 -0
  119. package/out/src/tools/fetch/state-hi-schools.js +171 -0
  120. package/out/src/tools/fetch/state-hi-schools.js.map +1 -0
  121. package/out/src/tools/fetch/state-sources.d.ts +22 -0
  122. package/out/src/tools/fetch/state-sources.d.ts.map +1 -0
  123. package/out/src/tools/fetch/state-sources.js +110 -0
  124. package/out/src/tools/fetch/state-sources.js.map +1 -0
  125. package/out/src/tools/fetch/tiger-full.d.ts +36 -0
  126. package/out/src/tools/fetch/tiger-full.d.ts.map +1 -0
  127. package/out/src/tools/fetch/tiger-full.js +239 -0
  128. package/out/src/tools/fetch/tiger-full.js.map +1 -0
  129. package/out/src/tools/golden-expand.d.ts +74 -0
  130. package/out/src/tools/golden-expand.d.ts.map +1 -0
  131. package/out/src/tools/golden-expand.js +394 -0
  132. package/out/src/tools/golden-expand.js.map +1 -0
  133. package/out/src/tools/golden-promote.d.ts +60 -0
  134. package/out/src/tools/golden-promote.d.ts.map +1 -0
  135. package/out/src/tools/golden-promote.js +223 -0
  136. package/out/src/tools/golden-promote.js.map +1 -0
  137. package/out/src/tools/index.d.ts +24 -0
  138. package/out/src/tools/index.d.ts.map +1 -0
  139. package/out/src/tools/index.js +24 -0
  140. package/out/src/tools/index.js.map +1 -0
  141. package/out/src/tools/ingest-csv.d.ts +45 -0
  142. package/out/src/tools/ingest-csv.d.ts.map +1 -0
  143. package/out/src/tools/ingest-csv.js +309 -0
  144. package/out/src/tools/ingest-csv.js.map +1 -0
  145. package/out/src/tools/jsonl-to-parquet.d.ts +49 -0
  146. package/out/src/tools/jsonl-to-parquet.d.ts.map +1 -0
  147. package/out/src/tools/jsonl-to-parquet.js +157 -0
  148. package/out/src/tools/jsonl-to-parquet.js.map +1 -0
  149. package/out/src/tools/lint-shard-vocab.d.ts +66 -0
  150. package/out/src/tools/lint-shard-vocab.d.ts.map +1 -0
  151. package/out/src/tools/lint-shard-vocab.js +266 -0
  152. package/out/src/tools/lint-shard-vocab.js.map +1 -0
  153. package/out/src/tools/lint-shard.d.ts +73 -0
  154. package/out/src/tools/lint-shard.d.ts.map +1 -0
  155. package/out/src/tools/lint-shard.js +350 -0
  156. package/out/src/tools/lint-shard.js.map +1 -0
  157. package/out/src/tools/overlay-manifest.d.ts +35 -0
  158. package/out/src/tools/overlay-manifest.d.ts.map +1 -0
  159. package/out/src/tools/overlay-manifest.js +85 -0
  160. package/out/src/tools/overlay-manifest.js.map +1 -0
  161. package/out/src/tools/shard-kryptonite.d.ts +28 -0
  162. package/out/src/tools/shard-kryptonite.d.ts.map +1 -0
  163. package/out/src/tools/shard-kryptonite.js +101 -0
  164. package/out/src/tools/shard-kryptonite.js.map +1 -0
  165. package/out/src/tools/shard-translit.d.ts +42 -0
  166. package/out/src/tools/shard-translit.d.ts.map +1 -0
  167. package/out/src/tools/shard-translit.js +196 -0
  168. package/out/src/tools/shard-translit.js.map +1 -0
  169. package/package.json +63 -7
@@ -7,8 +7,8 @@
7
7
  * `build-*-shard.mjs` script used to be; the `mailwoman corpus shard <recipe>` command dispatches
8
8
  * to them. A new shard is a new entry here, not a new script.
9
9
  */
10
- import type { ShardRecipe } from "./scaffold.js";
11
- export * from "./scaffold.js";
10
+ import type { ShardRecipe } from "./scaffold.ts";
11
+ export * from "./scaffold.ts";
12
12
  /** Recipe name → recipe. */
13
13
  export declare const SHARD_RECIPES: ReadonlyMap<string, ShardRecipe>;
14
14
  /** Look up a recipe by its `<recipe>` name. */
@@ -33,6 +33,6 @@
33
33
  * /tmp/tiger-edges)
34
34
  * - /tmp/oa-cache/us__il__cook.zip (ZIP→city tails)
35
35
  */
36
- import { type ShardRecipe } from "./scaffold.js";
36
+ import { type ShardRecipe } from "./scaffold.ts";
37
37
  export declare const intersectionRecipe: ShardRecipe;
38
38
  //# sourceMappingURL=intersection.d.ts.map
@@ -24,8 +24,8 @@
24
24
  * source shape, the rest the spaced conventional one. These draws are consumed ONLY for their
25
25
  * country, so DE/FR emit streams are unchanged for a given seed.
26
26
  */
27
- import { type LocaleBaseTuple } from "../synthesize-german.js";
28
- import { type ShardRecipe } from "./scaffold.js";
27
+ import { type LocaleBaseTuple } from "../synthesize-german.ts";
28
+ import { type ShardRecipe } from "./scaffold.ts";
29
29
  /**
30
30
  * One per-country OA source part: either a cached `zip` + `csv` member (streamed via `unzip -p`) or an extracted plain
31
31
  * `path` (streamed via `createReadStream`). Both carry the standard OA header
@@ -17,6 +17,6 @@
17
17
  * emitted so the model learns the digits-first postcode regardless of spacing; the three orders
18
18
  * keep polarity balanced (the v1.9.9 lesson).
19
19
  */
20
- import { type ShardRecipe } from "./scaffold.js";
20
+ import { type ShardRecipe } from "./scaffold.ts";
21
21
  export declare const nlPostcodeRecipe: ShardRecipe;
22
22
  //# sourceMappingURL=nl-postcode.d.ts.map
@@ -15,6 +15,6 @@
15
15
  * 2. city-first "«city», «pc», «st» «n»"
16
16
  * 3. pc-first "«pc» «city», «st» «n»" (the 7% floor — the anchor the others converge to)
17
17
  */
18
- import { type ShardRecipe } from "./scaffold.js";
18
+ import { type ShardRecipe } from "./scaffold.ts";
19
19
  export declare const noStreetLedRecipe: ShardRecipe;
20
20
  //# sourceMappingURL=no-street-led.d.ts.map
@@ -9,6 +9,6 @@
9
9
  * admin-only rows with explicit absence of any street-side component. Ported from
10
10
  * scripts/build-no-street-shard.mjs.
11
11
  */
12
- import { type ShardRecipe } from "./scaffold.js";
12
+ import { type ShardRecipe } from "./scaffold.ts";
13
13
  export declare const noStreetRecipe: ShardRecipe;
14
14
  //# sourceMappingURL=no-street.d.ts.map
@@ -29,6 +29,6 @@
29
29
  * (`makeMulberry32(opts.seed)`) and preserves the synthesis call order exactly, so `--seed N`
30
30
  * reproduces the legacy run byte-for-byte.
31
31
  */
32
- import { type ShardRecipe } from "./scaffold.js";
32
+ import { type ShardRecipe } from "./scaffold.ts";
33
33
  export declare const poBoxCedexRecipe: ShardRecipe;
34
34
  //# sourceMappingURL=po-box-cedex.d.ts.map
@@ -8,6 +8,6 @@
8
8
  * `--military-ratio`. Region is required EXCEPT region-less locales (NZ). Ported from
9
9
  * scripts/build-po-box-shard.mjs.
10
10
  */
11
- import { type ShardRecipe } from "./scaffold.js";
11
+ import { type ShardRecipe } from "./scaffold.ts";
12
12
  export declare const poBoxRecipe: ShardRecipe;
13
13
  //# sourceMappingURL=po-box.d.ts.map
@@ -23,6 +23,6 @@
23
23
  * «n» = house_number (NEVER split mid-digits), «pc» = postcode (never swallowing the neighbor),
24
24
  * trailing «V» = locality (the binding the resolver needs).
25
25
  */
26
- import { type ShardRecipe } from "./scaffold.js";
26
+ import { type ShardRecipe } from "./scaffold.ts";
27
27
  export declare const siBareVillageRecipe: ShardRecipe;
28
28
  //# sourceMappingURL=si-bare-village.d.ts.map
@@ -26,6 +26,6 @@
26
26
  * to keep the postcode-ORDER distribution multi-locale so a US-heavy affix shard doesn't dilute
27
27
  * FR/DE postcode (the v0.9.8 blemish).
28
28
  */
29
- import { type ShardRecipe } from "./scaffold.js";
29
+ import { type ShardRecipe } from "./scaffold.ts";
30
30
  export declare const streetAffixRecipe: ShardRecipe;
31
31
  //# sourceMappingURL=street-affix.d.ts.map
@@ -16,6 +16,6 @@
16
16
  * (`makeMulberry32(opts.seed)`) and preserves the synthesis call order exactly, so `--seed N`
17
17
  * reproduces the legacy run byte-for-byte.
18
18
  */
19
- import { type ShardRecipe } from "./scaffold.js";
19
+ import { type ShardRecipe } from "./scaffold.ts";
20
20
  export declare const streetBareRecipe: ShardRecipe;
21
21
  //# sourceMappingURL=street-bare.d.ts.map
@@ -6,6 +6,6 @@
6
6
  * `street` shard recipe — synthetic street-decomposition rows for Stage 3 (US-only): tuples →
7
7
  * {@link synthesizeStreetRow} → aligned LabeledRow. Ported from scripts/build-street-shard.mjs.
8
8
  */
9
- import { type ShardRecipe } from "./scaffold.js";
9
+ import { type ShardRecipe } from "./scaffold.ts";
10
10
  export declare const streetRecipe: ShardRecipe;
11
11
  //# sourceMappingURL=street.d.ts.map
@@ -20,6 +20,6 @@
20
20
  * cached OA zips) — `--count` bounds the OUTPUT, not the input. The passed `random` (the
21
21
  * framework LCG) is consumed in the exact call order the legacy script used.
22
22
  */
23
- import { type ShardRecipe } from "./scaffold.js";
23
+ import { type ShardRecipe } from "./scaffold.ts";
24
24
  export declare const unitRecipe: ShardRecipe;
25
25
  //# sourceMappingURL=unit.d.ts.map
@@ -23,7 +23,7 @@
23
23
  * The output is a `SplitManifest`: three `string[]` arrays of `source_id`. Manifests live in git
24
24
  * (under `corpus/splits/<version>/`) so reruns are reproducible bit-for-bit.
25
25
  */
26
- import type { CanonicalRow, LabeledRow } from "./types.js";
26
+ import type { CanonicalRow, LabeledRow } from "./types.ts";
27
27
  export type SplitName = "train" | "val" | "test";
28
28
  export interface SplitOptions {
29
29
  /**
package/out/src/split.js CHANGED
@@ -28,7 +28,7 @@ import { createHash } from "node:crypto";
28
28
  import { createWriteStream } from "node:fs";
29
29
  import { mkdir, unlink, writeFile } from "node:fs/promises";
30
30
  import { join } from "node:path";
31
- import { childEnv } from "@mailwoman/core/utils";
31
+ import { childEnv } from "@mailwoman/core/scripting/utils";
32
32
  import { JSONSpliterator } from "spliterator";
33
33
  /**
34
34
  * Phase 1 default holdouts (per plan).
@@ -1 +1 @@
1
- {"version":3,"file":"split.js","sourceRoot":"","sources":["../../src/split.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AA4B7C;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe;IAC9B,OAAO;QACN,EAAE,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC;QAC5D,EAAE,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAC;QAC3C,EAAE,EAAE,CAAC,UAAU,EAAE,IAAI,EAAE,wBAAwB,EAAE,IAAI,CAAC;KACtD,CAAA;AACF,CAAC;AAID;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAC1B,GAAgE,EAChE,WAA8C,eAAe,EAAE;IAE/D,MAAM,MAAM,GAAG,GAAG,CAAC,UAAU,CAAC,MAAM,CAAA;IACpC,MAAM,eAAe,GAAG,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAA;IACnD,MAAM,SAAS,GAAG,MAAM,KAAK,SAAS,IAAI,eAAe,CAAC,QAAQ,CAAC,MAAM,C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E,EAAE;QAC3C,wEAAwE;QACxE,MAAM,IAAI,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,YAAY,EAAE,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,GAAG,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,CAAA;QAC7F,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;QACxB,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;YACxB,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;gBAChB,OAAO,EAAE,CAAA;YACV,CAAC;iBAAM,CAAC;gBACP,MAAM,CAAC,IAAI,KAAK,CAAC,yBAAyB,IAAI,EAAE,CAAC,CAAC,CAAA;YACnD,CAAC;QACF,CAAC,CAAC,CAAA;IACH,CAAC,CAAC,CAAA;IACF,MAAM,MAAM,CAAC,YAAY,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAA;AAC3C,CAAC"}
@@ -48,7 +48,7 @@
48
48
  * separately-scoped AU/NZ/UK boundary-coverage shard that ALSO adds AU base coverage, not in this
49
49
  * base-locale shard. `synthesize-boundary-stress.test.ts` proves the alignments.
50
50
  */
51
- import type { CanonicalRow } from "./types.js";
51
+ import type { CanonicalRow } from "./types.ts";
52
52
  export type BoundaryStressTemplate = "street-eats-affix" | "comma-less-city-state" | "fr-prefix" | "house-number-after-street" | "bare-locality" | "house-number-before-street";
53
53
  export interface BoundaryStressBaseTuple {
54
54
  locality: string;
@@ -21,7 +21,7 @@
21
21
  * aligner turns the row into BIO labels; every emitted component surface form occurs verbatim in
22
22
  * `raw` so alignment lands.
23
23
  */
24
- import type { CanonicalRow } from "./types.js";
24
+ import type { CanonicalRow } from "./types.ts";
25
25
  /** A real address tuple (e.g. one OpenAddresses row): street + locality required, rest optional. */
26
26
  export interface LocaleBaseTuple {
27
27
  house_number?: string;
@@ -27,7 +27,7 @@
27
27
  * are deliberately NOT used here — the point is to teach co-occurrence, not to re-introduce
28
28
  * decompose-mode pressure.
29
29
  */
30
- import type { CanonicalRow } from "./types.js";
30
+ import type { CanonicalRow } from "./types.ts";
31
31
  export interface HouseVenueBaseTuple {
32
32
  locality: string;
33
33
  region: string;
@@ -18,7 +18,7 @@
18
18
  *
19
19
  * US-idiomatic only (the harness intersection cases are US: "X & Y, City, ST ZIP").
20
20
  */
21
- import type { CanonicalRow } from "./types.js";
21
+ import type { CanonicalRow } from "./types.ts";
22
22
  export interface IntersectionBaseTuple {
23
23
  locality: string;
24
24
  region: string;
@@ -36,7 +36,7 @@
36
36
  * This complements (does not replace) the existing US-base-tuple source used by
37
37
  * `synthesize-po-box.ts`; the same `NoStreetBaseTuple` shape is consumed.
38
38
  */
39
- import type { CanonicalRow } from "./types.js";
39
+ import type { CanonicalRow } from "./types.ts";
40
40
  export interface NoStreetBaseTuple {
41
41
  locality: string;
42
42
  region: string;
@@ -23,7 +23,7 @@
23
23
  * - USPS Pub 28 §28C2.040 — Private Mailbox formatting
24
24
  * - USPS DMM 508 §4.1.4 / §4.5.4 — PO Box and street-addressed PO Box
25
25
  */
26
- import type { CanonicalRow } from "./types.js";
26
+ import type { CanonicalRow } from "./types.ts";
27
27
  export interface PoBoxBaseTuple {
28
28
  locality: string;
29
29
  region: string;
@@ -18,7 +18,7 @@
18
18
  * distribution matches what the model would see if/when TIGER shards are rebuilt with the new
19
19
  * adapter.
20
20
  */
21
- import type { CanonicalRow } from "./types.js";
21
+ import type { CanonicalRow } from "./types.ts";
22
22
  export interface StreetBaseTuple {
23
23
  locality: string;
24
24
  region: string;
@@ -25,8 +25,8 @@
25
25
  * is kept OUT of the default set ({@link defaultAugmentationsForCountry}) until its on-model
26
26
  * effect is measured; see the note there.
27
27
  */
28
- import { type Tokenizer } from "./tokenize.js";
29
- import type { CanonicalRow, LabeledRow, QuarantinedRow } from "./types.js";
28
+ import { type Tokenizer } from "./tokenize.ts";
29
+ import type { CanonicalRow, LabeledRow, QuarantinedRow } from "./types.ts";
30
30
  /**
31
31
  * An augmentation transforms a single row. Return `null` if the augmentation doesn't apply (e.g. accent-strip on a row
32
32
  * that has no accents; particle-strip on a US row).
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+ export interface AlignShardOptions {
3
+ input: string;
4
+ output: string;
5
+ corpusVersion: string;
6
+ }
7
+ export declare function alignCanonicalShard(args: AlignShardOptions): Promise<void>;
8
+ //# sourceMappingURL=align-shard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"align-shard.d.ts","sourceRoot":"","sources":["../../../src/tools/align-shard.ts"],"names":[],"mappings":";AA+BA,MAAM,WAAW,iBAAiB;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,MAAM,CAAA;CACrB;AAED,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CA6BhF"}
@@ -0,0 +1,58 @@
1
+ #!/usr/bin/env node
2
+ import { createWriteStream } from "node:fs";
3
+ /**
4
+ * Re-emit a CANONICAL jsonl ({raw, components, country, source, ...}) as a LABELED jsonl in the CURRENT align format,
5
+ * by running every row through `alignRow` (corpus/src/align.ts).
6
+ *
7
+ * ## Why this exists
8
+ *
9
+ * Most synthetic shards are GENERATED on demand by a `build-*-shard` recipe (parametrized by --count), so re-emitting
10
+ * them in a new label format is just a re-run. A few shards are FIXED corpora with a hand/DeepSeek-authored canonical
11
+ * source that is never regenerated — notably `deepseek-kryptonite` (the adversarial hard-case set) and the
12
+ * `deepseek-translit-*` variants. Their committed parquets carry whatever label format was current when they were first
13
+ * built.
14
+ *
15
+ * When the corpus label format changes (the v0.5.0 char-offset triple, #519), those fixed shards must be RE-ALIGNED,
16
+ * not regenerated — feed the canonical source back through the same `alignRow` the from-source build uses, so the spans
17
+ * land in the new format with zero drift. That is exactly what this does: canonical jsonl in → labeled jsonl out, one
18
+ * `alignRow` per row, quarantine on miss.
19
+ *
20
+ * It is the uniform counterpart to corpus/src/tools/shard-kryptonite.ts (which couples to a base manifest and writes
21
+ * parquet directly). Output goes to jsonl so it joins the SAME jsonl-to-parquet path every other overlay shard uses.
22
+ *
23
+ * Usage: node scripts/align-canonical-shard.ts\
24
+ * --input /path/canonical-kryptonite.jsonl\
25
+ * --output /tmp/kryptonite-labeled.jsonl\
26
+ * --corpus-version 0.5.0
27
+ */
28
+ import { alignRow } from "@mailwoman/corpus";
29
+ import { TextSpliterator } from "spliterator";
30
+ export async function alignCanonicalShard(args) {
31
+ // Read phase only — the write path stays on createWriteStream. TextSpliterator + JSON.parse keeps the
32
+ // original tolerance: the `!line.trim()` guard skips blank lines and a trailing CR is valid JSON whitespace.
33
+ const outStream = createWriteStream(args.output, { encoding: "utf8" });
34
+ let labeled = 0;
35
+ let quarantined = 0;
36
+ const quarantineReasons = {};
37
+ for await (const line of TextSpliterator.fromAsync(args.input)) {
38
+ if (!line.trim())
39
+ continue;
40
+ const canonical = JSON.parse(line);
41
+ // Stamp the target corpus version so the emitted row's provenance matches the run it joins.
42
+ canonical.corpus_version = args.corpusVersion;
43
+ const result = alignRow(canonical);
44
+ if (result.kind === "labeled") {
45
+ outStream.write(JSON.stringify(result.row) + "\n");
46
+ labeled++;
47
+ }
48
+ else {
49
+ quarantined++;
50
+ const r = result.row.reason ?? "unknown";
51
+ quarantineReasons[r] = (quarantineReasons[r] ?? 0) + 1;
52
+ }
53
+ }
54
+ await new Promise((res) => outStream.end(res));
55
+ console.error(`align-canonical-shard: ${labeled} labeled, ${quarantined} quarantined → ${args.output}\n` +
56
+ ` quarantine reasons: ${JSON.stringify(quarantineReasons)}`);
57
+ }
58
+ //# sourceMappingURL=align-shard.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"align-shard.js","sourceRoot":"","sources":["../../../src/tools/align-shard.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CA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,MAAM,IAAI,OAAO,CAAO,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAA;IACpD,OAAO,CAAC,KAAK,CACZ,0BAA0B,OAAO,aAAa,WAAW,kBAAkB,IAAI,CAAC,MAAM,IAAI;QACzF,yBAAyB,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,CAC7D,CAAA;AACF,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * `mailwoman corpus audit` — per-source shard-count vs source_weight diagnostic.
7
+ *
8
+ * Reads a corpus dir's MANIFEST.json (or scans shards directly), counts shards per source,
9
+ * optionally loads a training config to pair the counts with the configured source_weights, and
10
+ * reports the estimated sampled-row distribution at training time.
11
+ *
12
+ * Would have caught v0.3.0's "NAD = 411/674 train shards × 2.0 weight = ~75% of sampled mix"
13
+ * finding before the v0.3.0 retrospective surfaced it.
14
+ *
15
+ * Emits warnings to stderr and the audit table to stdout; never throws on an empty corpus.
16
+ */
17
+ export interface AuditOpts {
18
+ corpusDir: string;
19
+ configPath?: string;
20
+ /**
21
+ * Sample at most N shards per split when counting sources. Default 100 for speed; bump to read the full set on a slow
22
+ * run. The first row of each shard determines its source — corpus-v0.2.0+ shards are 100% source-segregated, so a
23
+ * one-row read is authoritative.
24
+ */
25
+ sampleShardCount?: number;
26
+ }
27
+ export declare function audit(opts: AuditOpts): void;
28
+ //# sourceMappingURL=audit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../../src/tools/audit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,MAAM,WAAW,SAAS;IACzB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAA;CACzB;AAyTD,wBAAgB,KAAK,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAS3C"}
@@ -0,0 +1,273 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * `mailwoman corpus audit` — per-source shard-count vs source_weight diagnostic.
7
+ *
8
+ * Reads a corpus dir's MANIFEST.json (or scans shards directly), counts shards per source,
9
+ * optionally loads a training config to pair the counts with the configured source_weights, and
10
+ * reports the estimated sampled-row distribution at training time.
11
+ *
12
+ * Would have caught v0.3.0's "NAD = 411/674 train shards × 2.0 weight = ~75% of sampled mix"
13
+ * finding before the v0.3.0 retrospective surfaced it.
14
+ *
15
+ * Emits warnings to stderr and the audit table to stdout; never throws on an empty corpus.
16
+ */
17
+ import { existsSync, readFileSync, readdirSync } from "node:fs";
18
+ import { basename, join } from "node:path";
19
+ /**
20
+ * Try parsing a training YAML's source_weights as a minimal regex-based extract. We don't pull in a YAML lib for this
21
+ * script — the syntax is so small that a regex over the source_weights block is sufficient + keeps the script
22
+ * dep-free.
23
+ */
24
+ function parseConfig(configPath) {
25
+ if (!existsSync(configPath))
26
+ return null;
27
+ const text = readFileSync(configPath, "utf8");
28
+ const lines = text.split("\n");
29
+ const weights = {};
30
+ let inBlock = false;
31
+ let blockIndent = -1;
32
+ for (const raw of lines) {
33
+ const sourceWeightsMatch = raw.match(/^([\t ]*)source_weights:\s*$/);
34
+ if (sourceWeightsMatch) {
35
+ inBlock = true;
36
+ blockIndent = sourceWeightsMatch[1].length;
37
+ continue;
38
+ }
39
+ if (!inBlock)
40
+ continue;
41
+ // Skip blank lines and comments.
42
+ if (/^[\t ]*(#|$)/.test(raw))
43
+ continue;
44
+ // Lines indented MORE than `source_weights:` are entries; lines with ≤ indent end the block.
45
+ const indent = raw.match(/^[\t ]*/)[0].length;
46
+ if (indent <= blockIndent) {
47
+ inBlock = false;
48
+ continue;
49
+ }
50
+ const m = raw.match(/^[\t ]+([\w-]+):\s*([\d.]+)/);
51
+ if (m) {
52
+ weights[m[1]] = parseFloat(m[2]);
53
+ }
54
+ }
55
+ return { sourceWeights: weights };
56
+ }
57
+ /**
58
+ * Scan a corpus directory's shards (typically under <corpus_dir>/train, /val, /test) and count shards per source per
59
+ * split.
60
+ */
61
+ function scanShards(corpusDir, sampleCount) {
62
+ const stats = { bySplit: {}, totalShards: 0, totalFiles: 0 };
63
+ for (const split of ["train", "val", "test"]) {
64
+ const splitDir = join(corpusDir, split);
65
+ if (!existsSync(splitDir))
66
+ continue;
67
+ const files = readdirSync(splitDir)
68
+ .filter((f) => f.endsWith(".parquet"))
69
+ .sort();
70
+ stats.totalFiles += files.length;
71
+ const sampleEvery = Math.max(1, Math.floor(files.length / sampleCount));
72
+ const sampled = files.filter((_, i) => i % sampleEvery === 0).slice(0, sampleCount);
73
+ const splitMap = {};
74
+ // We can't read parquet without a dep, so we infer source from filenames where possible.
75
+ // The corpus build typically writes deterministically by source — fall back to "<unknown>"
76
+ // when filename gives no hint. For accurate per-source counts on real corpora, the
77
+ // MANIFEST.json route below is preferred.
78
+ for (const f of sampled) {
79
+ const inferred = inferSourceFromFilename(f);
80
+ splitMap[inferred] = (splitMap[inferred] ?? 0) + 1;
81
+ }
82
+ // Scale to estimated full-shard counts.
83
+ const scale = files.length / Math.max(sampled.length, 1);
84
+ for (const k of Object.keys(splitMap)) {
85
+ splitMap[k] = Math.round(splitMap[k] * scale);
86
+ }
87
+ stats.bySplit[split] = splitMap;
88
+ stats.totalShards += files.length;
89
+ }
90
+ return stats;
91
+ }
92
+ function inferSourceFromFilename(filename) {
93
+ // Many corpus builds write part-<source>-<n>.parquet or part-<n>.parquet. The latter (current
94
+ // build at corpus-v0.3.0) gives no source signal in the filename — see manifestScan() for the
95
+ // authoritative path. Return "<unknown>" so the caller flags this case.
96
+ const m = basename(filename).match(/part-([\w-]+)-\d+\.parquet$/);
97
+ if (m && m[1] !== undefined)
98
+ return m[1];
99
+ return "<unknown>";
100
+ }
101
+ /**
102
+ * Known source name prefixes. Corpus-v0.3.0 uses these as `source_id` prefixes; matching against the longest prefix
103
+ * that fits a given `first_source_id` recovers the canonical source name.
104
+ *
105
+ * Order matters: longer prefixes must be tried first so `usgov-nad-...` matches `usgov-nad` rather than `usgov`. Sorted
106
+ * descending by length at use site.
107
+ */
108
+ const KNOWN_SOURCE_PREFIXES = [
109
+ "wof-admin",
110
+ "wof-postalcode",
111
+ "ban",
112
+ "tiger",
113
+ "usgov-nad",
114
+ "usgov-nppes",
115
+ "usgov-hrsa-fqhc",
116
+ "usgov-imls-pls",
117
+ "state-ia-contractors",
118
+ "state-tx-notaries",
119
+ "state-ny-notaries",
120
+ "openaddresses",
121
+ // Synthetic adversarial sources (corpus-v0.4.0+, Thread B).
122
+ "deepseek-kryptonite",
123
+ "deepseek-translit-cyrl",
124
+ "deepseek-translit-jpan",
125
+ "deepseek-translit-hans",
126
+ "deepseek-translit-hang",
127
+ "deepseek-translit-armn",
128
+ ];
129
+ /** Extract the source-name prefix from a `first_source_id` value. */
130
+ function sourceFromID(sourceID, knownPrefixes) {
131
+ // Sort longest-first so usgov-nad beats usgov, wof-admin beats wof.
132
+ const sorted = [...knownPrefixes].sort((a, b) => b.length - a.length);
133
+ for (const prefix of sorted) {
134
+ if (sourceID.startsWith(prefix + "-") || sourceID === prefix)
135
+ return prefix;
136
+ }
137
+ return "<unknown>";
138
+ }
139
+ /**
140
+ * Prefer reading MANIFEST.json when present — uses each shard's `first_source_id` + prefix matching to recover the
141
+ * source name. Falls back to scanShards when MANIFEST is absent.
142
+ *
143
+ * NOTE: corpus-v0.3.0 shards can mix sources (see `last_source_id` differing from `first_source_id`). The first-row
144
+ * source is an approximation; reading the parquet's full source column would be authoritative but requires a parquet
145
+ * dep. For audit purposes the first-row approximation is accurate within ~5% for the corpus-v0.3.0 shape (most shards
146
+ * are >95% one source).
147
+ */
148
+ function manifestScan(corpusDir, knownPrefixes) {
149
+ const manifestPath = join(corpusDir, "MANIFEST.json");
150
+ if (!existsSync(manifestPath))
151
+ return null;
152
+ const manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
153
+ if (!Array.isArray(manifest.shards))
154
+ return null;
155
+ const bySplit = {};
156
+ for (const shard of manifest.shards) {
157
+ const split = shard.split;
158
+ const src = shard.source ?? sourceFromID(shard.first_source_id ?? "", knownPrefixes);
159
+ bySplit[split] ??= {};
160
+ bySplit[split][src] = (bySplit[split][src] ?? 0) + 1;
161
+ }
162
+ const total = Object.values(bySplit).reduce((sum, m) => sum + Object.values(m).reduce((a, b) => a + b, 0), 0);
163
+ return { bySplit, totalShards: total, totalFiles: total };
164
+ }
165
+ function buildAuditRows(stats, weights) {
166
+ const totalShards = Object.values(stats).reduce((a, b) => a + b, 0);
167
+ const allSources = new Set([...Object.keys(stats), ...Object.keys(weights)]);
168
+ const rows = [];
169
+ // Compute effective sample weight: shard_count × source_weight. Sources with no weight get the
170
+ // "—" marker (loader skips them).
171
+ const sampleWeights = [];
172
+ for (const src of allSources) {
173
+ const shards = stats[src] ?? 0;
174
+ const weight = weights[src];
175
+ const effective = weight !== undefined ? shards * weight : 0;
176
+ sampleWeights.push([src, effective]);
177
+ }
178
+ const totalSampleWeight = sampleWeights.reduce((a, [, w]) => a + w, 0);
179
+ for (const src of allSources) {
180
+ const shards = stats[src] ?? 0;
181
+ const weight = weights[src] ?? "—";
182
+ const effective = typeof weight === "number" ? (shards * weight) / Math.max(totalSampleWeight, 1) : "—";
183
+ rows.push({
184
+ source: src,
185
+ shards,
186
+ shardPct: totalShards > 0 ? shards / totalShards : 0,
187
+ weight,
188
+ effectiveSamplePct: typeof effective === "number" ? effective : "—",
189
+ });
190
+ }
191
+ // Flag the dominator: empirically calibrated against the v0.3.0 → v0.4.0 retrospective.
192
+ // v0.3.0 had usgov-nad at 52% effective sample (1.9× ban); the resulting label-space dilution
193
+ // was responsible for the coarse-F1 regression. So flag a source as "concentration warning"
194
+ // when it's above 40% effective sample OR more than 1.5× the next-highest.
195
+ const numeric = rows.filter((r) => typeof r.effectiveSamplePct === "number");
196
+ numeric.sort((a, b) => b.effectiveSamplePct - a.effectiveSamplePct);
197
+ if (numeric.length >= 1) {
198
+ const top = numeric[0];
199
+ const next = numeric[1]?.effectiveSamplePct ?? 0;
200
+ if (top.effectiveSamplePct > 0.4 || (next > 0 && top.effectiveSamplePct / next > 1.5)) {
201
+ top.overweightFactor = next > 0 ? top.effectiveSamplePct / next : Infinity;
202
+ }
203
+ }
204
+ rows.sort((a, b) => b.shards - a.shards);
205
+ return rows;
206
+ }
207
+ function formatPct(v) {
208
+ if (v === "—")
209
+ return "—";
210
+ return `${(v * 100).toFixed(1)}%`;
211
+ }
212
+ function printReport(corpusDir, configPath, stats, rows) {
213
+ console.log(`\nCorpus audit — ${corpusDir}`);
214
+ if (configPath) {
215
+ console.log(`Config: ${configPath}`);
216
+ }
217
+ console.log(`Total shards: ${stats.totalShards}${stats.totalFiles !== stats.totalShards ? ` (${stats.totalFiles} files on disk)` : ""}`);
218
+ console.log("");
219
+ const trainStats = stats.bySplit["train"];
220
+ if (trainStats) {
221
+ const total = Object.values(trainStats).reduce((a, b) => a + b, 0);
222
+ console.log(`Train split: ${total} shards`);
223
+ console.log("");
224
+ const headers = ["source", "shards", "shard %", "weight", "eff. sample %"];
225
+ const widths = [22, 8, 10, 8, 14];
226
+ const fmtRow = (cells) => cells.map((c, i) => c.padEnd(widths[i])).join(" ");
227
+ console.log(fmtRow(headers));
228
+ console.log(fmtRow(widths.map((w) => "─".repeat(w))));
229
+ for (const row of rows) {
230
+ console.log(fmtRow([
231
+ row.source,
232
+ String(row.shards),
233
+ formatPct(row.shardPct),
234
+ typeof row.weight === "number" ? row.weight.toFixed(2) : "—",
235
+ formatPct(row.effectiveSamplePct),
236
+ ]));
237
+ }
238
+ console.log("");
239
+ const dominator = rows.find((r) => r.overweightFactor !== undefined);
240
+ if (dominator) {
241
+ const factor = dominator.overweightFactor;
242
+ const factorStr = factor === Infinity ? "∞" : factor?.toFixed(1);
243
+ console.error(`⚠ Concentration: ${dominator.source} would sample ${formatPct(dominator.effectiveSamplePct)} ` +
244
+ `of training rows (${factorStr}× the next-highest). ` +
245
+ `Past lesson: v0.3.0's NAD at ~52% caused the 21-label coarse regression. ` +
246
+ `Consider lowering this source's weight or boosting others.`);
247
+ }
248
+ else {
249
+ console.log("✓ No single-source concentration (top source < 40% effective sample AND < 1.5× next).");
250
+ }
251
+ const missingWeights = rows.filter((r) => r.weight === "—" && r.shards > 0);
252
+ if (missingWeights.length > 0 && configPath) {
253
+ console.error(`⚠ Sources present in corpus but absent from config.source_weights ` +
254
+ `(loader will skip them): ${missingWeights.map((r) => r.source).join(", ")}`);
255
+ }
256
+ const orphanWeights = rows.filter((r) => typeof r.weight === "number" && r.shards === 0);
257
+ if (orphanWeights.length > 0) {
258
+ console.error(`⚠ Sources weighted in config but no shards found in corpus ` +
259
+ `(no-op weights): ${orphanWeights.map((r) => r.source).join(", ")}`);
260
+ }
261
+ }
262
+ }
263
+ export function audit(opts) {
264
+ const config = opts.configPath ? parseConfig(opts.configPath) : null;
265
+ // Compose the known-prefix list from both the hardcoded set and any extra names in the config
266
+ // (forward-compat for future adapters added before this file is updated).
267
+ const prefixes = [...new Set([...KNOWN_SOURCE_PREFIXES, ...Object.keys(config?.sourceWeights ?? {})])];
268
+ const stats = manifestScan(opts.corpusDir, prefixes) ?? scanShards(opts.corpusDir, opts.sampleShardCount ?? 100);
269
+ const trainStats = stats.bySplit["train"] ?? {};
270
+ const rows = buildAuditRows(trainStats, config?.sourceWeights ?? {});
271
+ printReport(opts.corpusDir, opts.configPath, stats, rows);
272
+ }
273
+ //# sourceMappingURL=audit.js.map