@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
@@ -0,0 +1,101 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Build a parquet shard from the DeepSeek-generated kryptonite JSONL and emit the corpus-v0.4.0
7
+ * MANIFEST. corpus-v0.4.0 is a pure adapter-addition revision: it points at every shard from
8
+ * v0.3.0 plus the new kryptonite shard(s). No v0.3.0 bytes are touched or re-shuffled.
9
+ *
10
+ * See docs/articles/plan/reference/CORPUS_V0_4_0_GENERATION.md for the why; that doc also pins the
11
+ * DeepSeek model version + prompt versions used to produce the JSONL.
12
+ *
13
+ * Invoke via `mailwoman corpus shard kryptonite \
14
+ * --jsonl /data/corpus/versioned/v0.4.0/kryptonite/canonical-kryptonite.jsonl \
15
+ * --base-manifest /data/corpus/versioned/v0.3.0/corpus-v0.3.0/MANIFEST.json \
16
+ * --out-dir /data/corpus/versioned/v0.4.0`
17
+ */
18
+ import { existsSync, readFileSync, writeFileSync } from "node:fs";
19
+ import { mkdir } from "node:fs/promises";
20
+ import { join } from "node:path";
21
+ import { iterateJSONL } from "@mailwoman/core/utils";
22
+ import { alignRow } from "../align.js";
23
+ import { PARQUET_COLUMNS, ROW_GROUP_SIZE, SHARD_COMPRESSION, writeShards } from "../parquet.js";
24
+ async function* canonicalRows(jsonl, corpusVersion) {
25
+ for await (const raw of iterateJSONL(jsonl)) {
26
+ // Strip sidecar underscore-prefixed fields the generator left behind for debugging.
27
+ const components = raw["components"];
28
+ yield {
29
+ raw: raw["raw"],
30
+ components,
31
+ country: raw["country"] ?? "US",
32
+ locale: raw["locale"] ?? undefined,
33
+ source: raw["source"] ?? "deepseek-kryptonite",
34
+ source_id: raw["source_id"],
35
+ corpus_version: corpusVersion,
36
+ license: raw["license"] ?? "Synthetic (DeepSeek-v4-flash, AGPL-compatible)",
37
+ synth: raw["synth"],
38
+ };
39
+ }
40
+ }
41
+ async function* labeledRows(jsonl, corpusVersion, quarantineLog) {
42
+ for await (const row of canonicalRows(jsonl, corpusVersion)) {
43
+ const result = alignRow(row);
44
+ if (result.kind === "labeled") {
45
+ yield result.row;
46
+ }
47
+ else {
48
+ quarantineLog.push(`${row.source_id}\t${result.row.reason}`);
49
+ }
50
+ }
51
+ }
52
+ export async function buildKryptoniteShard(options, report) {
53
+ const corpusVersion = options.corpusVersion ?? "0.4.0";
54
+ const source = options.source ?? "deepseek-kryptonite";
55
+ if (!existsSync(options.jsonl))
56
+ throw new Error(`jsonl not found: ${options.jsonl}`);
57
+ if (!existsSync(options.baseManifest))
58
+ throw new Error(`base-manifest not found: ${options.baseManifest}`);
59
+ await mkdir(options.outDir, { recursive: true });
60
+ const quarantine = [];
61
+ const newManifest = await writeShards({ train: labeledRows(options.jsonl, corpusVersion, quarantine) }, { outputDir: options.outDir, corpusVersion });
62
+ report?.(`wrote ${newManifest.total_rows} rows into ${newManifest.shards.length} shard(s); ` +
63
+ `quarantined ${quarantine.length}`);
64
+ if (quarantine.length > 0) {
65
+ const qPath = join(options.outDir, `corpus-v${corpusVersion}`, "quarantine-kryptonite.tsv");
66
+ writeFileSync(qPath, quarantine.join("\n") + "\n", "utf8");
67
+ report?.(`quarantine log → ${qPath}`);
68
+ }
69
+ // Stamp the new shard's source field for audit.ts (which prefers shard.source over
70
+ // first_source_id-prefix inference). Without this, deepseek-kryptonite IDs would have
71
+ // to match a prefix in KNOWN_SOURCE_PREFIXES — we add it there too as a belt-and-braces.
72
+ for (const sh of newManifest.shards) {
73
+ ;
74
+ sh.source = source;
75
+ }
76
+ // Compose the final corpus-v0.4.0 manifest: every shard from base + the new shard(s).
77
+ const base = JSON.parse(readFileSync(options.baseManifest, "utf8"));
78
+ const combined = {
79
+ corpus_version: corpusVersion,
80
+ schema: PARQUET_COLUMNS,
81
+ rows_per_shard: base.rows_per_shard,
82
+ row_group_size: base.row_group_size ?? ROW_GROUP_SIZE,
83
+ shards: [...base.shards, ...newManifest.shards],
84
+ counts: {
85
+ train: base.counts.train + (newManifest.counts.train ?? 0),
86
+ val: base.counts.val,
87
+ test: base.counts.test,
88
+ },
89
+ total_rows: base.total_rows + newManifest.total_rows,
90
+ };
91
+ // Stamp source on the legacy v0.3.0 shards too, so audit's shard.source path is the
92
+ // authoritative one. v0.3.0 shards mix sources; we use the first_source_id-prefix
93
+ // inference for them (audit.ts will re-derive on its own when shard.source is absent).
94
+ const combinedPath = join(options.outDir, `corpus-v${corpusVersion}`, "MANIFEST.json");
95
+ writeFileSync(combinedPath, JSON.stringify(combined, null, 2) + "\n", "utf8");
96
+ report?.(`wrote combined manifest → ${combinedPath}`);
97
+ report?.(` total_rows=${combined.total_rows} (base=${base.total_rows}, added=${newManifest.total_rows})`);
98
+ report?.(` shards=${combined.shards.length} (base=${base.shards.length}, added=${newManifest.shards.length})`);
99
+ report?.(` compression=${SHARD_COMPRESSION}`);
100
+ }
101
+ //# sourceMappingURL=shard-kryptonite.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shard-kryptonite.js","sourceRoot":"","sources":["../../../src/tools/shard-kryptonite.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAEpD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAa/F,KAAK,SAAS,CAAC,CAAC,aAAa,CAAC,KAAa,EAAE,aAAqB;IACjE,IAAI,KAAK,EAAE,MAAM,GAAG,IAAI,YAAY,CAA0B,KAAK,CAAC,EAAE,CAAC;QACtE,oFAAoF;QACpF,MAAM,UAAU,GAAG,GAAG,CAAC,YAAY,CAA2B,CAAA;QAC9D,MAAM;YACL,GAAG,EAAE,GAAG,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AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Build per-script parquet shards from the DeepSeek-generated transliteration JSONL and emit the
7
+ * corpus-v0.4.0 MANIFEST that combines them with the existing kryptonite + v0.3.0 shards.
8
+ *
9
+ * Sibling to `shard-kryptonite.ts`. The two modules share the same composition pattern: take a
10
+ * base MANIFEST, append new shards, write a combined MANIFEST. Differences specific to
11
+ * transliteration:
12
+ *
13
+ * - One JSONL contains rows from N target scripts (source = `deepseek-translit-<slug>`). We bucket by
14
+ * `source` and write one shard per script so `audit.ts` can attribute each shard to its
15
+ * synthetic source without relying on filename-prefix inference.
16
+ * - Each shard is written to `train/part-translit-<slug>.parquet` (distinct from kryptonite's
17
+ * `part-0000.parquet`, which v0.4.0's first builder already produced).
18
+ * - Inherits the path-canonicalization fix flagged in Thread B's postmortem: v0.3.0 shard paths are
19
+ * rewritten from `/mnt/playpen/mailwoman-data/...` to `/data/...` in the combined MANIFEST so
20
+ * all paths share one container-friendly form.
21
+ *
22
+ * See docs/articles/plan/reference/CORPUS_V0_4_0_GENERATION.md for prompts, model, and the
23
+ * reproducibility contract.
24
+ *
25
+ * Invoke via `mailwoman corpus shard translit \
26
+ * --jsonl /data/corpus/versioned/v0.4.0/transliteration/canonical-transliteration.jsonl \
27
+ * --base-manifest /data/corpus/versioned/v0.4.0/corpus-v0.4.0/MANIFEST.json \
28
+ * --out-dir /data/corpus/versioned/v0.4.0`
29
+ */
30
+ export interface ShardTranslitOptions {
31
+ jsonl: string;
32
+ baseManifest: string;
33
+ outDir: string;
34
+ /** Default `"0.4.0"`. */
35
+ corpusVersion?: string;
36
+ /** Default `"/data/"`. */
37
+ canonicalPathPrefix?: string;
38
+ /** Default `"/mnt/playpen/mailwoman-data/"`. */
39
+ legacyPathPrefix?: string;
40
+ }
41
+ export declare function buildTranslitShard(options: ShardTranslitOptions, report?: (line: string) => void): Promise<void>;
42
+ //# sourceMappingURL=shard-translit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shard-translit.d.ts","sourceRoot":"","sources":["../../../src/tools/shard-translit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAcH,MAAM,WAAW,oBAAoB;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,yBAAyB;IACzB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,0BAA0B;IAC1B,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,gDAAgD;IAChD,gBAAgB,CAAC,EAAE,MAAM,CAAA;CACzB;AAmGD,wBAAsB,kBAAkB,CACvC,OAAO,EAAE,oBAAoB,EAC7B,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC,IAAI,CAAC,CAyFf"}
@@ -0,0 +1,196 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Build per-script parquet shards from the DeepSeek-generated transliteration JSONL and emit the
7
+ * corpus-v0.4.0 MANIFEST that combines them with the existing kryptonite + v0.3.0 shards.
8
+ *
9
+ * Sibling to `shard-kryptonite.ts`. The two modules share the same composition pattern: take a
10
+ * base MANIFEST, append new shards, write a combined MANIFEST. Differences specific to
11
+ * transliteration:
12
+ *
13
+ * - One JSONL contains rows from N target scripts (source = `deepseek-translit-<slug>`). We bucket by
14
+ * `source` and write one shard per script so `audit.ts` can attribute each shard to its
15
+ * synthetic source without relying on filename-prefix inference.
16
+ * - Each shard is written to `train/part-translit-<slug>.parquet` (distinct from kryptonite's
17
+ * `part-0000.parquet`, which v0.4.0's first builder already produced).
18
+ * - Inherits the path-canonicalization fix flagged in Thread B's postmortem: v0.3.0 shard paths are
19
+ * rewritten from `/mnt/playpen/mailwoman-data/...` to `/data/...` in the combined MANIFEST so
20
+ * all paths share one container-friendly form.
21
+ *
22
+ * See docs/articles/plan/reference/CORPUS_V0_4_0_GENERATION.md for prompts, model, and the
23
+ * reproducibility contract.
24
+ *
25
+ * Invoke via `mailwoman corpus shard translit \
26
+ * --jsonl /data/corpus/versioned/v0.4.0/transliteration/canonical-transliteration.jsonl \
27
+ * --base-manifest /data/corpus/versioned/v0.4.0/corpus-v0.4.0/MANIFEST.json \
28
+ * --out-dir /data/corpus/versioned/v0.4.0`
29
+ */
30
+ import { existsSync, readFileSync, writeFileSync } from "node:fs";
31
+ import { mkdir, stat } from "node:fs/promises";
32
+ import { join } from "node:path";
33
+ import { iterateJSONL, sha256File } from "@mailwoman/core/utils";
34
+ import { alignRow } from "../align.js";
35
+ import { ParquetWriter } from "../parquet-wrapper/index.js";
36
+ import { LABELED_ROW_SCHEMA, PARQUET_COLUMNS, ROW_GROUP_SIZE, rowToParquet, SHARD_COMPRESSION } from "../parquet.js";
37
+ function toCanonicalRow(raw, corpusVersion) {
38
+ return {
39
+ raw: raw["raw"],
40
+ components: raw["components"],
41
+ country: raw["country"] ?? "US",
42
+ locale: raw["locale"] ?? undefined,
43
+ source: raw["source"],
44
+ source_id: raw["source_id"],
45
+ corpus_version: corpusVersion,
46
+ license: raw["license"] ?? "Synthetic (DeepSeek-v4-flash, AGPL-compatible)",
47
+ synth: raw["synth"],
48
+ };
49
+ }
50
+ function appendShape(row) {
51
+ const out = {
52
+ raw: row.raw,
53
+ tokens: row.tokens,
54
+ labels: row.labels,
55
+ country: row.country,
56
+ source: row.source,
57
+ source_id: row.source_id,
58
+ corpus_version: row.corpus_version,
59
+ license: row.license,
60
+ };
61
+ if (row.locale !== null) {
62
+ out.locale = row.locale;
63
+ }
64
+ if (row.synth_method !== null) {
65
+ out.synth_method = row.synth_method;
66
+ }
67
+ if (row.synth_base_id !== null) {
68
+ out.synth_base_id = row.synth_base_id;
69
+ }
70
+ return out;
71
+ }
72
+ /**
73
+ * Write one shard for a single source slug. Returns the populated ShardDescriptor + a list of quarantine reasons for
74
+ * rows that failed alignment.
75
+ */
76
+ async function writeOneShard(rows, outPath, source, corpusVersion) {
77
+ const writer = await ParquetWriter.openFile(LABELED_ROW_SCHEMA, outPath, {
78
+ rowGroupSize: ROW_GROUP_SIZE,
79
+ });
80
+ writer.setMetadata("mailwoman.corpus_version", corpusVersion);
81
+ writer.setMetadata("mailwoman.split", "train");
82
+ writer.setMetadata("mailwoman.shard_source", source);
83
+ let firstSourceID = "";
84
+ let lastSourceID = "";
85
+ for (const row of rows) {
86
+ const pq = rowToParquet(row);
87
+ await writer.appendRow(appendShape(pq));
88
+ if (firstSourceID === "") {
89
+ firstSourceID = row.source_id;
90
+ }
91
+ lastSourceID = row.source_id;
92
+ }
93
+ await writer.close();
94
+ const fileStat = await stat(outPath);
95
+ const sha256 = await sha256File(outPath);
96
+ return {
97
+ split: "train",
98
+ path: outPath,
99
+ format: "parquet",
100
+ compression: SHARD_COMPRESSION,
101
+ rows: rows.length,
102
+ bytes: fileStat.size,
103
+ sha256,
104
+ first_source_id: firstSourceID,
105
+ last_source_id: lastSourceID,
106
+ // Stamp source so audit.ts attributes the shard without falling back to filename-prefix
107
+ // inference. Cast widens ShardDescriptor; the field is read by audit.ts.
108
+ ...{ source },
109
+ };
110
+ }
111
+ function canonicalizeShardPath(path, legacyPrefix, canonicalPrefix) {
112
+ if (path.startsWith(legacyPrefix))
113
+ return canonicalPrefix + path.slice(legacyPrefix.length);
114
+ return path;
115
+ }
116
+ export async function buildTranslitShard(options, report) {
117
+ const corpusVersion = options.corpusVersion ?? "0.4.0";
118
+ const canonicalPathPrefix = options.canonicalPathPrefix ?? "/data/";
119
+ const legacyPathPrefix = options.legacyPathPrefix ?? "/mnt/playpen/mailwoman-data/";
120
+ if (!existsSync(options.jsonl))
121
+ throw new Error(`jsonl not found: ${options.jsonl}`);
122
+ if (!existsSync(options.baseManifest))
123
+ throw new Error(`base-manifest not found: ${options.baseManifest}`);
124
+ const corpusDir = join(options.outDir, `corpus-v${corpusVersion}`);
125
+ const trainDir = join(corpusDir, "train");
126
+ await mkdir(trainDir, { recursive: true });
127
+ // Bucket canonical rows by source. Quarantined rows are logged.
128
+ const buckets = new Map();
129
+ const quarantine = [];
130
+ let totalIn = 0;
131
+ for await (const raw of iterateJSONL(options.jsonl)) {
132
+ totalIn++;
133
+ const canon = toCanonicalRow(raw, corpusVersion);
134
+ const result = alignRow(canon);
135
+ if (result.kind !== "labeled") {
136
+ quarantine.push(`${canon.source_id}\t${result.row.reason}`);
137
+ continue;
138
+ }
139
+ const bucket = buckets.get(canon.source);
140
+ if (bucket) {
141
+ bucket.push(result.row);
142
+ }
143
+ else {
144
+ buckets.set(canon.source, [result.row]);
145
+ }
146
+ }
147
+ report?.(`read ${totalIn} rows; ${quarantine.length} quarantined; ${buckets.size} script buckets`);
148
+ const newShards = [];
149
+ const sortedKeys = [...buckets.keys()].sort();
150
+ for (const source of sortedKeys) {
151
+ const rows = buckets.get(source);
152
+ const slug = source.startsWith("deepseek-translit-") ? source.slice("deepseek-translit-".length) : source;
153
+ const outPath = join(trainDir, `part-translit-${slug}.parquet`);
154
+ const descriptor = await writeOneShard(rows, outPath, source, corpusVersion);
155
+ newShards.push(descriptor);
156
+ report?.(` ${source}: ${descriptor.rows} rows → ${outPath} (${descriptor.bytes} bytes)`);
157
+ }
158
+ if (quarantine.length > 0) {
159
+ const qPath = join(corpusDir, "quarantine-transliteration.tsv");
160
+ writeFileSync(qPath, quarantine.join("\n") + "\n", "utf8");
161
+ report?.(`quarantine log → ${qPath} (${quarantine.length} rows)`);
162
+ }
163
+ // Compose final MANIFEST: rewrite base.shards paths from /mnt/playpen/... → /data/... and append
164
+ // the new translit shards. Kryptonite shard already lives in the base manifest (it was written
165
+ // there by Thread B).
166
+ const base = JSON.parse(readFileSync(options.baseManifest, "utf8"));
167
+ const rewrittenBase = base.shards.map((sh) => ({
168
+ ...sh,
169
+ path: canonicalizeShardPath(sh.path, legacyPathPrefix, canonicalPathPrefix),
170
+ }));
171
+ const newTrainRows = newShards.reduce((sum, sh) => sum + sh.rows, 0);
172
+ const combined = {
173
+ corpus_version: corpusVersion,
174
+ schema: PARQUET_COLUMNS,
175
+ rows_per_shard: base.rows_per_shard,
176
+ row_group_size: base.row_group_size ?? ROW_GROUP_SIZE,
177
+ shards: [...rewrittenBase, ...newShards],
178
+ counts: {
179
+ train: base.counts.train + newTrainRows,
180
+ val: base.counts.val,
181
+ test: base.counts.test,
182
+ },
183
+ total_rows: base.total_rows + newTrainRows,
184
+ };
185
+ const combinedPath = join(corpusDir, "MANIFEST.json");
186
+ writeFileSync(combinedPath, JSON.stringify(combined, null, 2) + "\n", "utf8");
187
+ report?.(`wrote combined manifest → ${combinedPath}`);
188
+ report?.(` total_rows=${combined.total_rows} (base=${base.total_rows}, added=${newTrainRows})`);
189
+ report?.(` shards=${combined.shards.length} (base=${base.shards.length}, added=${newShards.length})`);
190
+ report?.(` compression=${SHARD_COMPRESSION}`);
191
+ const pathFix = rewrittenBase.filter((s, i) => s.path !== base.shards[i].path).length;
192
+ if (pathFix > 0) {
193
+ report?.(` path-canonicalized base shards: ${pathFix} (legacy '${legacyPathPrefix}' → '${canonicalPathPrefix}')`);
194
+ }
195
+ }
196
+ //# sourceMappingURL=shard-translit.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shard-translit.js","sourceRoot":"","sources":["../../../src/tools/shard-translit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACjE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;A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AM,CAAA;IAEtF,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;QACjB,MAAM,EAAE,CAAC,qCAAqC,OAAO,aAAa,gBAAgB,QAAQ,mBAAmB,IAAI,CAAC,CAAA;IACnH,CAAC;AACF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mailwoman/corpus",
3
- "version": "5.9.0",
3
+ "version": "5.10.0",
4
4
  "description": "Mailwoman corpus pipeline: BIO-labeled dataset builder for the neural classifier.",
5
5
  "license": "AGPL-3.0-only OR LicenseRef-Commercial",
6
6
  "repository": {
@@ -17,18 +17,74 @@
17
17
  "type": "module",
18
18
  "exports": {
19
19
  "./package.json": "./package.json",
20
- ".": "./out/src/index.js",
21
- "./types": "./out/src/types.js",
22
- "./format": "./out/src/format.js"
20
+ ".": {
21
+ "types": "./out/src/index.d.ts",
22
+ "default": "./out/src/index.js"
23
+ },
24
+ "./types": {
25
+ "types": "./out/src/types.d.ts",
26
+ "default": "./out/src/types.js"
27
+ },
28
+ "./format": {
29
+ "types": "./out/src/format.d.ts",
30
+ "default": "./out/src/format.js"
31
+ },
32
+ "./license": {
33
+ "types": "./out/src/license.d.ts",
34
+ "default": "./out/src/license.js"
35
+ },
36
+ "./build": {
37
+ "types": "./out/src/build.d.ts",
38
+ "default": "./out/src/build.js"
39
+ },
40
+ "./adapters": {
41
+ "types": "./out/src/adapters/index.d.ts",
42
+ "default": "./out/src/adapters/index.js"
43
+ },
44
+ "./tools": {
45
+ "types": "./out/src/tools/index.d.ts",
46
+ "default": "./out/src/tools/index.js"
47
+ }
23
48
  },
24
49
  "publishConfig": {
50
+ "exports": {
51
+ "./package.json": "./package.json",
52
+ ".": {
53
+ "types": "./out/src/index.d.ts",
54
+ "default": "./out/src/index.js"
55
+ },
56
+ "./types": {
57
+ "types": "./out/src/types.d.ts",
58
+ "default": "./out/src/types.js"
59
+ },
60
+ "./format": {
61
+ "types": "./out/src/format.d.ts",
62
+ "default": "./out/src/format.js"
63
+ },
64
+ "./license": {
65
+ "types": "./out/src/license.d.ts",
66
+ "default": "./out/src/license.js"
67
+ },
68
+ "./build": {
69
+ "types": "./out/src/build.d.ts",
70
+ "default": "./out/src/build.js"
71
+ },
72
+ "./adapters": {
73
+ "types": "./out/src/adapters/index.d.ts",
74
+ "default": "./out/src/adapters/index.js"
75
+ },
76
+ "./tools": {
77
+ "types": "./out/src/tools/index.d.ts",
78
+ "default": "./out/src/tools/index.js"
79
+ }
80
+ },
25
81
  "access": "public"
26
82
  },
27
83
  "dependencies": {
28
84
  "@dsnp/parquetjs": "1.8.7",
29
- "@mailwoman/codex": "5.9.0",
30
- "@mailwoman/core": "5.9.0",
31
- "@mailwoman/formatter": "5.9.0",
85
+ "@mailwoman/codex": "5.10.0",
86
+ "@mailwoman/core": "5.10.0",
87
+ "@mailwoman/formatter": "5.10.0",
32
88
  "csv-parse": "^5.6.0",
33
89
  "fast-glob": "^3.3.3",
34
90
  "fastest-levenshtein": "^1.0.16",