@mailwoman/core 10.0.0 → 10.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1067) hide show
  1. package/README.md +2 -2
  2. package/THIRD_PARTY_NOTICES.md +45 -5
  3. package/data/PROVENANCE.md +99 -0
  4. package/data/chromium-i18n/LICENSE +4 -4
  5. package/data/libpostal/LICENSE +1 -1
  6. package/data/libpostal/README.md +8 -8
  7. package/data/libpostal/dictionaries/README.md +8 -8
  8. package/data/libpostal/dictionaries/all/surnames.txt +6 -6
  9. package/lib/api/APIClient.ts +184 -115
  10. package/lib/api/arcgis.ts +10 -8
  11. package/lib/api/ckan.ts +27 -24
  12. package/lib/api/clock.ts +30 -13
  13. package/lib/api/defaults.ts +14 -8
  14. package/lib/api/disk-storage.ts +84 -75
  15. package/lib/api/host.ts +21 -11
  16. package/lib/api/ogc.ts +427 -41
  17. package/lib/api/paced-client.ts +8 -6
  18. package/lib/api/pacer.ts +69 -39
  19. package/lib/api/responses.ts +85 -59
  20. package/lib/api/retry.ts +71 -71
  21. package/lib/api/test/clocks.ts +106 -69
  22. package/lib/api/test/transport.ts +91 -42
  23. package/lib/{api/index.ts → api.ts} +3 -3
  24. package/lib/coarse-placer/coarse-placer.ts +63 -77
  25. package/lib/coarse-placer/featurize.ts +21 -29
  26. package/lib/coarse-placer/fnv-hash.ts +4 -2
  27. package/lib/coarse-placer/math.ts +10 -7
  28. package/lib/crypto/digest.ts +1 -1
  29. package/lib/crypto/ed25519.ts +22 -18
  30. package/lib/crypto/node.ts +6 -3
  31. package/lib/data-root.ts +52 -137
  32. package/lib/decoder/build-tree.ts +51 -42
  33. package/lib/decoder/calibration.ts +19 -19
  34. package/lib/decoder/containment.ts +28 -19
  35. package/lib/decoder/parse-diff.ts +37 -44
  36. package/lib/decoder/proposals-to-tree.ts +15 -22
  37. package/lib/decoder/resolve-proposal-overlaps.ts +11 -45
  38. package/lib/decoder/serialize/json.ts +34 -23
  39. package/lib/decoder/serialize/tuples.ts +4 -2
  40. package/lib/decoder/serialize/xml.ts +66 -46
  41. package/lib/decoder/tree/shape.ts +38 -36
  42. package/lib/decoder/tree/walk.ts +58 -30
  43. package/lib/decoder/types.ts +36 -88
  44. package/lib/decoder/unknown-spans.ts +15 -16
  45. package/lib/decoder/validate-tree.ts +26 -28
  46. package/lib/env/paths.ts +4 -2
  47. package/lib/env/schema.ts +23 -12
  48. package/lib/env/utils.ts +5 -7
  49. package/lib/{env/index.ts → env.ts} +36 -17
  50. package/lib/errors/schema.ts +7 -5
  51. package/lib/fs/compression.ts +62 -6
  52. package/lib/fs/delimited.ts +127 -0
  53. package/lib/fs/formatters.ts +25 -14
  54. package/lib/fs/readers/stat.ts +119 -48
  55. package/lib/fs/readers.ts +30 -18
  56. package/lib/fs/streams.ts +35 -23
  57. package/lib/fs/temporary.ts +17 -22
  58. package/lib/fs/writers.ts +188 -59
  59. package/lib/fs/zip.ts +79 -57
  60. package/lib/git.ts +192 -35
  61. package/lib/hash.ts +38 -13
  62. package/lib/html/document.ts +56 -32
  63. package/lib/html/elements.ts +304 -0
  64. package/lib/html/tables.ts +16 -35
  65. package/lib/html/text.ts +33 -22
  66. package/lib/index.ts +5 -6
  67. package/lib/json.ts +67 -19
  68. package/lib/layers/build-command.ts +28 -0
  69. package/lib/layers/coverage.ts +49 -35
  70. package/lib/layers/feature-count.ts +12 -10
  71. package/lib/layers/manifest.ts +72 -95
  72. package/lib/layers/publication.ts +185 -0
  73. package/lib/layers/schema.ts +61 -33
  74. package/lib/layers.ts +15 -0
  75. package/lib/license/configured.ts +2 -2
  76. package/lib/license/key/file.ts +38 -24
  77. package/lib/license/{key/index.ts → key.ts} +39 -37
  78. package/lib/license/obligations.ts +87 -46
  79. package/lib/license/publication.ts +15 -15
  80. package/lib/license/record.ts +277 -0
  81. package/lib/license/register.ts +14 -9
  82. package/lib/license/stamp.ts +16 -25
  83. package/lib/license/status.ts +22 -11
  84. package/lib/{license/index.ts → license.ts} +5 -4
  85. package/lib/locale/locale.ts +12 -16
  86. package/lib/locale/profiles/en-us.ts +2 -40
  87. package/lib/locale/profiles/fr-fr.ts +3 -44
  88. package/lib/locale/profiles/ja-jp.ts +4 -12
  89. package/lib/locale/registry.ts +7 -5
  90. package/lib/locale/zh-cn-units.ts +29 -41
  91. package/lib/{locale/index.ts → locale.ts} +1 -1
  92. package/lib/logging/shared.ts +17 -42
  93. package/lib/module/clean.ts +151 -0
  94. package/lib/module/compiled-freshness.ts +175 -0
  95. package/lib/module/file-url.ts +3 -5
  96. package/lib/module/package-command.ts +44 -0
  97. package/lib/module/packaged-data.ts +4 -4
  98. package/lib/module/resolve-from.ts +31 -23
  99. package/lib/module/resolvers.ts +23 -21
  100. package/lib/module/runtime.ts +3 -2
  101. package/lib/module/workspace.ts +106 -0
  102. package/lib/numeric.ts +14 -9
  103. package/lib/objects.ts +13 -7
  104. package/lib/overture-pins.ts +7 -7
  105. package/lib/paths.ts +72 -66
  106. package/lib/pipeline/client-result.ts +15 -10
  107. package/lib/pipeline/preferences.ts +3 -1
  108. package/lib/pipeline/result.ts +26 -24
  109. package/lib/pipeline/runtime-pipeline.ts +59 -178
  110. package/lib/pipeline/span-proposer.ts +81 -141
  111. package/lib/pipeline/types.ts +138 -242
  112. package/lib/{pipeline/index.ts → pipeline.ts} +1 -1
  113. package/lib/policy/defaults.ts +13 -11
  114. package/lib/policy/policy.ts +12 -21
  115. package/lib/policy/proposal-collection.ts +5 -18
  116. package/lib/policy/registry.ts +19 -62
  117. package/lib/process.ts +65 -46
  118. package/lib/promises.ts +41 -0
  119. package/lib/random.ts +75 -43
  120. package/lib/release-config.ts +76 -21
  121. package/lib/resolver/authoritative-provider.ts +43 -64
  122. package/lib/resolver/coverage-facts.ts +39 -23
  123. package/lib/resolver/fixture-authoritative-provider.ts +22 -19
  124. package/lib/resolver/lookup-types.ts +110 -58
  125. package/lib/resolver/postcode-format.ts +73 -43
  126. package/lib/resolver/referential.ts +57 -35
  127. package/lib/resolver/region-database-provider.ts +57 -0
  128. package/lib/resolver/synthetic-id-ranges.ts +17 -11
  129. package/lib/resolver/types.ts +98 -543
  130. package/lib/{resolver/index.ts → resolver.ts} +11 -11
  131. package/lib/resources/git.ts +6 -5
  132. package/lib/resources/libpostal.ts +3 -4
  133. package/lib/resources/whosonfirst/PlacetypeDataSource.ts +16 -9
  134. package/lib/resources/whosonfirst/backoff.ts +2 -5
  135. package/lib/resources/whosonfirst/extract-repo.ts +34 -25
  136. package/lib/resources/whosonfirst/placetypes/Placetype.ts +28 -22
  137. package/lib/resources/whosonfirst/placetypes/admin.ts +20 -11
  138. package/lib/resources/whosonfirst/placetypes/graph.ts +21 -12
  139. package/lib/resources/whosonfirst/placetypes/mermaid.ts +21 -31
  140. package/lib/resources/whosonfirst/placetypes/specificity.ts +31 -38
  141. package/lib/resources/whosonfirst/placetypes/tree.ts +10 -6
  142. package/lib/resources/{whosonfirst/index.ts → whosonfirst.ts} +1 -1
  143. package/lib/{resources/index.ts → resources.ts} +2 -2
  144. package/lib/{routing/index.ts → routing.ts} +5 -5
  145. package/lib/scope-config.ts +165 -0
  146. package/lib/scripting/arguments.ts +79 -35
  147. package/lib/scripting/command.ts +11 -4
  148. package/lib/scripting/ingest-chunk-script.ts +20 -22
  149. package/lib/scripting/operation.ts +102 -0
  150. package/lib/scripting/{utils/index.ts → utils.ts} +15 -9
  151. package/lib/{scripting/index.ts → scripting.ts} +8 -5
  152. package/lib/stats.ts +8 -9
  153. package/lib/strings/compare.ts +3 -2
  154. package/lib/strings/escape.ts +1 -1
  155. package/lib/strings/format.ts +11 -5
  156. package/lib/strings/markdown-table.ts +50 -0
  157. package/lib/strings/python-json.ts +14 -11
  158. package/lib/tokenization/Graph.ts +3 -0
  159. package/lib/tokenization/Span.ts +7 -4
  160. package/lib/tokenization/normalizer.ts +16 -13
  161. package/lib/trust-policies.ts +37 -22
  162. package/lib/types/Classification.ts +3 -3
  163. package/lib/types/classifier.ts +47 -49
  164. package/lib/types/mapping.ts +22 -19
  165. package/lib/utils/chunk-process.ts +21 -28
  166. package/lib/utils/collections.ts +4 -2
  167. package/lib/utils/events.ts +2 -1
  168. package/lib/utils/geodatabase-archive.ts +28 -31
  169. package/lib/utils/sleep.ts +2 -2
  170. package/lib/utils/sqlite-rows.ts +11 -19
  171. package/lib/utils/stream-to-disk.ts +27 -40
  172. package/lib/utils/system.ts +14 -2
  173. package/lib/utils/time.ts +8 -6
  174. package/lib/utils/union-find.ts +7 -3
  175. package/lib/{utils/index.ts → utils.ts} +0 -2
  176. package/lib/vale.ts +41 -29
  177. package/lib/workspaces.ts +57 -14
  178. package/out/api/APIClient.d.ts +75 -57
  179. package/out/api/APIClient.d.ts.map +1 -1
  180. package/out/api/APIClient.js +133 -84
  181. package/out/api/APIClient.js.map +1 -1
  182. package/out/api/arcgis.d.ts +10 -8
  183. package/out/api/arcgis.d.ts.map +1 -1
  184. package/out/api/arcgis.js +7 -8
  185. package/out/api/arcgis.js.map +1 -1
  186. package/out/api/ckan.d.ts +24 -21
  187. package/out/api/ckan.d.ts.map +1 -1
  188. package/out/api/ckan.js +11 -13
  189. package/out/api/ckan.js.map +1 -1
  190. package/out/api/clock.d.ts +15 -10
  191. package/out/api/clock.d.ts.map +1 -1
  192. package/out/api/clock.js +16 -8
  193. package/out/api/clock.js.map +1 -1
  194. package/out/api/defaults.d.ts +14 -8
  195. package/out/api/defaults.d.ts.map +1 -1
  196. package/out/api/defaults.js +14 -8
  197. package/out/api/defaults.js.map +1 -1
  198. package/out/api/disk-storage.d.ts +44 -33
  199. package/out/api/disk-storage.d.ts.map +1 -1
  200. package/out/api/disk-storage.js +70 -67
  201. package/out/api/disk-storage.js.map +1 -1
  202. package/out/api/host.d.ts +18 -10
  203. package/out/api/host.d.ts.map +1 -1
  204. package/out/api/host.js +15 -8
  205. package/out/api/host.js.map +1 -1
  206. package/out/api/ogc.d.ts +140 -20
  207. package/out/api/ogc.d.ts.map +1 -1
  208. package/out/api/ogc.js +327 -38
  209. package/out/api/ogc.js.map +1 -1
  210. package/out/api/paced-client.d.ts +7 -5
  211. package/out/api/paced-client.d.ts.map +1 -1
  212. package/out/api/paced-client.js +6 -5
  213. package/out/api/paced-client.js.map +1 -1
  214. package/out/api/pacer.d.ts +64 -38
  215. package/out/api/pacer.d.ts.map +1 -1
  216. package/out/api/pacer.js +67 -39
  217. package/out/api/pacer.js.map +1 -1
  218. package/out/api/responses.d.ts +65 -43
  219. package/out/api/responses.d.ts.map +1 -1
  220. package/out/api/responses.js +85 -59
  221. package/out/api/responses.js.map +1 -1
  222. package/out/api/retry.d.ts +61 -55
  223. package/out/api/retry.d.ts.map +1 -1
  224. package/out/api/retry.js +46 -58
  225. package/out/api/retry.js.map +1 -1
  226. package/out/api/test/clocks.d.ts +67 -41
  227. package/out/api/test/clocks.d.ts.map +1 -1
  228. package/out/api/test/clocks.js +100 -67
  229. package/out/api/test/clocks.js.map +1 -1
  230. package/out/api/test/transport.d.ts +66 -36
  231. package/out/api/test/transport.d.ts.map +1 -1
  232. package/out/api/test/transport.js +56 -26
  233. package/out/api/test/transport.js.map +1 -1
  234. package/out/{api/index.d.ts → api.d.ts} +1 -1
  235. package/out/api.d.ts.map +1 -0
  236. package/out/{api/index.js → api.js} +4 -4
  237. package/out/api.js.map +1 -0
  238. package/out/coarse-placer/coarse-placer.d.ts +53 -64
  239. package/out/coarse-placer/coarse-placer.d.ts.map +1 -1
  240. package/out/coarse-placer/coarse-placer.js +31 -46
  241. package/out/coarse-placer/coarse-placer.js.map +1 -1
  242. package/out/coarse-placer/featurize.d.ts +21 -25
  243. package/out/coarse-placer/featurize.d.ts.map +1 -1
  244. package/out/coarse-placer/featurize.js +21 -29
  245. package/out/coarse-placer/featurize.js.map +1 -1
  246. package/out/coarse-placer/fnv-hash.d.ts +4 -2
  247. package/out/coarse-placer/fnv-hash.d.ts.map +1 -1
  248. package/out/coarse-placer/fnv-hash.js +4 -2
  249. package/out/coarse-placer/fnv-hash.js.map +1 -1
  250. package/out/coarse-placer/math.d.ts +10 -7
  251. package/out/coarse-placer/math.d.ts.map +1 -1
  252. package/out/coarse-placer/math.js +10 -7
  253. package/out/coarse-placer/math.js.map +1 -1
  254. package/out/crypto/digest.d.ts +1 -1
  255. package/out/crypto/digest.js +1 -1
  256. package/out/crypto/ed25519.d.ts +14 -12
  257. package/out/crypto/ed25519.d.ts.map +1 -1
  258. package/out/crypto/ed25519.js +22 -18
  259. package/out/crypto/ed25519.js.map +1 -1
  260. package/out/crypto/node.d.ts +6 -3
  261. package/out/crypto/node.d.ts.map +1 -1
  262. package/out/crypto/node.js +2 -1
  263. package/out/crypto/node.js.map +1 -1
  264. package/out/data-root.d.ts +46 -94
  265. package/out/data-root.d.ts.map +1 -1
  266. package/out/data-root.js +51 -90
  267. package/out/data-root.js.map +1 -1
  268. package/out/decoder/build-tree.d.ts +18 -12
  269. package/out/decoder/build-tree.d.ts.map +1 -1
  270. package/out/decoder/build-tree.js +36 -33
  271. package/out/decoder/build-tree.js.map +1 -1
  272. package/out/decoder/calibration.d.ts +18 -16
  273. package/out/decoder/calibration.d.ts.map +1 -1
  274. package/out/decoder/calibration.js +19 -19
  275. package/out/decoder/calibration.js.map +1 -1
  276. package/out/decoder/containment.d.ts +13 -8
  277. package/out/decoder/containment.d.ts.map +1 -1
  278. package/out/decoder/containment.js +28 -19
  279. package/out/decoder/containment.js.map +1 -1
  280. package/out/decoder/parse-diff.d.ts +31 -35
  281. package/out/decoder/parse-diff.d.ts.map +1 -1
  282. package/out/decoder/parse-diff.js +23 -36
  283. package/out/decoder/parse-diff.js.map +1 -1
  284. package/out/decoder/proposals-to-tree.d.ts +14 -21
  285. package/out/decoder/proposals-to-tree.d.ts.map +1 -1
  286. package/out/decoder/proposals-to-tree.js +12 -19
  287. package/out/decoder/proposals-to-tree.js.map +1 -1
  288. package/out/decoder/resolve-proposal-overlaps.d.ts +6 -39
  289. package/out/decoder/resolve-proposal-overlaps.d.ts.map +1 -1
  290. package/out/decoder/resolve-proposal-overlaps.js +10 -44
  291. package/out/decoder/resolve-proposal-overlaps.js.map +1 -1
  292. package/out/decoder/serialize/json.d.ts +26 -16
  293. package/out/decoder/serialize/json.d.ts.map +1 -1
  294. package/out/decoder/serialize/json.js +15 -12
  295. package/out/decoder/serialize/json.js.map +1 -1
  296. package/out/decoder/serialize/tuples.d.ts +4 -2
  297. package/out/decoder/serialize/tuples.d.ts.map +1 -1
  298. package/out/decoder/serialize/tuples.js.map +1 -1
  299. package/out/decoder/serialize/xml.d.ts +47 -35
  300. package/out/decoder/serialize/xml.d.ts.map +1 -1
  301. package/out/decoder/serialize/xml.js +36 -32
  302. package/out/decoder/serialize/xml.js.map +1 -1
  303. package/out/decoder/tree/shape.d.ts +38 -36
  304. package/out/decoder/tree/shape.d.ts.map +1 -1
  305. package/out/decoder/tree/shape.js +23 -27
  306. package/out/decoder/tree/shape.js.map +1 -1
  307. package/out/decoder/tree/walk.d.ts +43 -26
  308. package/out/decoder/tree/walk.d.ts.map +1 -1
  309. package/out/decoder/tree/walk.js +53 -28
  310. package/out/decoder/tree/walk.js.map +1 -1
  311. package/out/decoder/types.d.ts +36 -88
  312. package/out/decoder/types.d.ts.map +1 -1
  313. package/out/decoder/types.js +1 -21
  314. package/out/decoder/types.js.map +1 -1
  315. package/out/decoder/unknown-spans.d.ts +9 -6
  316. package/out/decoder/unknown-spans.d.ts.map +1 -1
  317. package/out/decoder/unknown-spans.js +15 -16
  318. package/out/decoder/unknown-spans.js.map +1 -1
  319. package/out/decoder/validate-tree.d.ts +22 -19
  320. package/out/decoder/validate-tree.d.ts.map +1 -1
  321. package/out/decoder/validate-tree.js +22 -21
  322. package/out/decoder/validate-tree.js.map +1 -1
  323. package/out/{decoder/index.js → decoder.d.ts} +1 -1
  324. package/out/decoder.d.ts.map +1 -0
  325. package/out/{decoder/index.d.ts → decoder.js} +1 -1
  326. package/out/decoder.js.map +1 -0
  327. package/out/env/paths.d.ts +4 -2
  328. package/out/env/paths.d.ts.map +1 -1
  329. package/out/env/paths.js +4 -2
  330. package/out/env/paths.js.map +1 -1
  331. package/out/env/schema.d.ts +7 -4
  332. package/out/env/schema.d.ts.map +1 -1
  333. package/out/env/schema.js +23 -12
  334. package/out/env/schema.js.map +1 -1
  335. package/out/env/utils.d.ts +5 -7
  336. package/out/env/utils.d.ts.map +1 -1
  337. package/out/env/utils.js +5 -7
  338. package/out/env/utils.js.map +1 -1
  339. package/out/{env/index.d.ts → env.d.ts} +26 -11
  340. package/out/env.d.ts.map +1 -0
  341. package/out/{env/index.js → env.js} +37 -18
  342. package/out/env.js.map +1 -0
  343. package/out/errors/schema.d.ts +7 -5
  344. package/out/errors/schema.d.ts.map +1 -1
  345. package/out/errors/schema.js +7 -5
  346. package/out/errors/schema.js.map +1 -1
  347. package/out/fs/compression.d.ts +35 -2
  348. package/out/fs/compression.d.ts.map +1 -1
  349. package/out/fs/compression.js +44 -6
  350. package/out/fs/compression.js.map +1 -1
  351. package/out/fs/delimited.d.ts +68 -0
  352. package/out/fs/delimited.d.ts.map +1 -0
  353. package/out/fs/delimited.js +108 -0
  354. package/out/fs/delimited.js.map +1 -0
  355. package/out/fs/formatters.d.ts +25 -14
  356. package/out/fs/formatters.d.ts.map +1 -1
  357. package/out/fs/formatters.js +21 -12
  358. package/out/fs/formatters.js.map +1 -1
  359. package/out/fs/readers/stat.d.ts +43 -35
  360. package/out/fs/readers/stat.d.ts.map +1 -1
  361. package/out/fs/readers/stat.js +93 -39
  362. package/out/fs/readers/stat.js.map +1 -1
  363. package/out/fs/readers.d.ts +24 -15
  364. package/out/fs/readers.d.ts.map +1 -1
  365. package/out/fs/readers.js +27 -16
  366. package/out/fs/readers.js.map +1 -1
  367. package/out/fs/streams.d.ts +35 -23
  368. package/out/fs/streams.d.ts.map +1 -1
  369. package/out/fs/streams.js +35 -23
  370. package/out/fs/streams.js.map +1 -1
  371. package/out/fs/temporary.d.ts +12 -15
  372. package/out/fs/temporary.d.ts.map +1 -1
  373. package/out/fs/temporary.js +6 -8
  374. package/out/fs/temporary.js.map +1 -1
  375. package/out/fs/writers.d.ts +90 -48
  376. package/out/fs/writers.d.ts.map +1 -1
  377. package/out/fs/writers.js +131 -63
  378. package/out/fs/writers.js.map +1 -1
  379. package/out/fs/zip.d.ts +55 -37
  380. package/out/fs/zip.d.ts.map +1 -1
  381. package/out/fs/zip.js +55 -46
  382. package/out/fs/zip.js.map +1 -1
  383. package/out/git.d.ts +94 -22
  384. package/out/git.d.ts.map +1 -1
  385. package/out/git.js +145 -35
  386. package/out/git.js.map +1 -1
  387. package/out/hash.d.ts +34 -13
  388. package/out/hash.d.ts.map +1 -1
  389. package/out/hash.js +33 -11
  390. package/out/hash.js.map +1 -1
  391. package/out/html/document.d.ts +45 -26
  392. package/out/html/document.d.ts.map +1 -1
  393. package/out/html/document.js +38 -23
  394. package/out/html/document.js.map +1 -1
  395. package/out/html/elements.d.ts +113 -0
  396. package/out/html/elements.d.ts.map +1 -0
  397. package/out/html/elements.js +204 -0
  398. package/out/html/elements.js.map +1 -0
  399. package/out/html/tables.d.ts +12 -25
  400. package/out/html/tables.d.ts.map +1 -1
  401. package/out/html/tables.js +13 -31
  402. package/out/html/tables.js.map +1 -1
  403. package/out/html/text.d.ts +35 -24
  404. package/out/html/text.d.ts.map +1 -1
  405. package/out/html/text.js +33 -22
  406. package/out/html/text.js.map +1 -1
  407. package/out/index.d.ts +5 -6
  408. package/out/index.d.ts.map +1 -1
  409. package/out/index.js +5 -6
  410. package/out/index.js.map +1 -1
  411. package/out/json.d.ts +59 -15
  412. package/out/json.d.ts.map +1 -1
  413. package/out/json.js +53 -13
  414. package/out/json.js.map +1 -1
  415. package/out/layers/build-command.d.ts +21 -0
  416. package/out/layers/build-command.d.ts.map +1 -0
  417. package/out/layers/build-command.js +26 -0
  418. package/out/layers/build-command.js.map +1 -0
  419. package/out/layers/coverage.d.ts +47 -31
  420. package/out/layers/coverage.d.ts.map +1 -1
  421. package/out/layers/coverage.js +38 -29
  422. package/out/layers/coverage.js.map +1 -1
  423. package/out/layers/feature-count.d.ts +12 -10
  424. package/out/layers/feature-count.d.ts.map +1 -1
  425. package/out/layers/feature-count.js +7 -7
  426. package/out/layers/feature-count.js.map +1 -1
  427. package/out/layers/manifest.d.ts +50 -79
  428. package/out/layers/manifest.d.ts.map +1 -1
  429. package/out/layers/manifest.js +36 -69
  430. package/out/layers/manifest.js.map +1 -1
  431. package/out/layers/publication.d.ts +89 -0
  432. package/out/layers/publication.d.ts.map +1 -0
  433. package/out/layers/publication.js +118 -0
  434. package/out/layers/publication.js.map +1 -0
  435. package/out/layers/schema.d.ts +52 -28
  436. package/out/layers/schema.d.ts.map +1 -1
  437. package/out/layers/schema.js +22 -15
  438. package/out/layers/schema.js.map +1 -1
  439. package/out/layers.d.ts +15 -0
  440. package/out/layers.d.ts.map +1 -0
  441. package/out/layers.js +15 -0
  442. package/out/layers.js.map +1 -0
  443. package/out/license/configured.d.ts +2 -2
  444. package/out/license/configured.d.ts.map +1 -1
  445. package/out/license/configured.js +2 -2
  446. package/out/license/configured.js.map +1 -1
  447. package/out/license/key/file.d.ts +31 -14
  448. package/out/license/key/file.d.ts.map +1 -1
  449. package/out/license/key/file.js +36 -22
  450. package/out/license/key/file.js.map +1 -1
  451. package/out/license/key.d.ts +98 -0
  452. package/out/license/key.d.ts.map +1 -0
  453. package/out/license/{key/index.js → key.js} +33 -35
  454. package/out/license/key.js.map +1 -0
  455. package/out/license/obligations.d.ts +44 -32
  456. package/out/license/obligations.d.ts.map +1 -1
  457. package/out/license/obligations.js +71 -39
  458. package/out/license/obligations.js.map +1 -1
  459. package/out/license/publication.d.ts +10 -10
  460. package/out/license/publication.d.ts.map +1 -1
  461. package/out/license/publication.js +10 -11
  462. package/out/license/publication.js.map +1 -1
  463. package/out/license/record.d.ts +139 -0
  464. package/out/license/record.d.ts.map +1 -0
  465. package/out/license/record.js +223 -0
  466. package/out/license/record.js.map +1 -0
  467. package/out/license/register.d.ts +14 -9
  468. package/out/license/register.d.ts.map +1 -1
  469. package/out/license/register.js +12 -8
  470. package/out/license/register.js.map +1 -1
  471. package/out/license/stamp.d.ts +14 -23
  472. package/out/license/stamp.d.ts.map +1 -1
  473. package/out/license/stamp.js +12 -18
  474. package/out/license/stamp.js.map +1 -1
  475. package/out/license/status.d.ts +17 -8
  476. package/out/license/status.d.ts.map +1 -1
  477. package/out/license/status.js +22 -11
  478. package/out/license/status.js.map +1 -1
  479. package/out/{license/index.js → license.d.ts} +6 -5
  480. package/out/license.d.ts.map +1 -0
  481. package/out/{license/index.d.ts → license.js} +6 -5
  482. package/out/license.js.map +1 -0
  483. package/out/locale/locale.d.ts +12 -15
  484. package/out/locale/locale.d.ts.map +1 -1
  485. package/out/locale/locale.js +5 -7
  486. package/out/locale/locale.js.map +1 -1
  487. package/out/locale/profiles/en-us.d.ts +2 -3
  488. package/out/locale/profiles/en-us.d.ts.map +1 -1
  489. package/out/locale/profiles/en-us.js +2 -40
  490. package/out/locale/profiles/en-us.js.map +1 -1
  491. package/out/locale/profiles/fr-fr.d.ts +3 -6
  492. package/out/locale/profiles/fr-fr.d.ts.map +1 -1
  493. package/out/locale/profiles/fr-fr.js +3 -44
  494. package/out/locale/profiles/fr-fr.js.map +1 -1
  495. package/out/locale/profiles/ja-jp.d.ts +2 -9
  496. package/out/locale/profiles/ja-jp.d.ts.map +1 -1
  497. package/out/locale/profiles/ja-jp.js +4 -12
  498. package/out/locale/profiles/ja-jp.js.map +1 -1
  499. package/out/locale/{profiles/index.js → profiles.d.ts} +1 -1
  500. package/out/locale/profiles.d.ts.map +1 -0
  501. package/out/locale/{profiles/index.d.ts → profiles.js} +1 -1
  502. package/out/locale/profiles.js.map +1 -0
  503. package/out/locale/registry.d.ts +4 -3
  504. package/out/locale/registry.d.ts.map +1 -1
  505. package/out/locale/registry.js +7 -5
  506. package/out/locale/registry.js.map +1 -1
  507. package/out/locale/zh-cn-units.d.ts +22 -30
  508. package/out/locale/zh-cn-units.d.ts.map +1 -1
  509. package/out/locale/zh-cn-units.js +27 -34
  510. package/out/locale/zh-cn-units.js.map +1 -1
  511. package/out/{locale/index.js → locale.d.ts} +2 -2
  512. package/out/locale.d.ts.map +1 -0
  513. package/out/{locale/index.d.ts → locale.js} +2 -2
  514. package/out/locale.js.map +1 -0
  515. package/out/logging/shared.d.ts +5 -22
  516. package/out/logging/shared.d.ts.map +1 -1
  517. package/out/logging/shared.js +17 -42
  518. package/out/logging/shared.js.map +1 -1
  519. package/out/{logging/index.d.ts → logging.d.ts} +1 -1
  520. package/out/logging.d.ts.map +1 -0
  521. package/out/{logging/index.js → logging.js} +1 -1
  522. package/out/logging.js.map +1 -0
  523. package/out/module/clean.d.ts +56 -0
  524. package/out/module/clean.d.ts.map +1 -0
  525. package/out/module/clean.js +84 -0
  526. package/out/module/clean.js.map +1 -0
  527. package/out/module/compiled-freshness.d.ts +43 -0
  528. package/out/module/compiled-freshness.d.ts.map +1 -0
  529. package/out/module/compiled-freshness.js +118 -0
  530. package/out/module/compiled-freshness.js.map +1 -0
  531. package/out/module/file-url.d.ts +3 -5
  532. package/out/module/file-url.d.ts.map +1 -1
  533. package/out/module/file-url.js +3 -5
  534. package/out/module/file-url.js.map +1 -1
  535. package/out/module/package-command.d.ts +20 -0
  536. package/out/module/package-command.d.ts.map +1 -0
  537. package/out/module/package-command.js +27 -0
  538. package/out/module/package-command.js.map +1 -0
  539. package/out/module/packaged-data.d.ts +4 -4
  540. package/out/module/packaged-data.js +4 -4
  541. package/out/module/resolve-from.d.ts +23 -20
  542. package/out/module/resolve-from.d.ts.map +1 -1
  543. package/out/module/resolve-from.js +19 -16
  544. package/out/module/resolve-from.js.map +1 -1
  545. package/out/module/resolvers.d.ts +23 -21
  546. package/out/module/resolvers.d.ts.map +1 -1
  547. package/out/module/resolvers.js +23 -21
  548. package/out/module/resolvers.js.map +1 -1
  549. package/out/module/runtime.d.ts +3 -2
  550. package/out/module/runtime.d.ts.map +1 -1
  551. package/out/module/runtime.js +3 -2
  552. package/out/module/runtime.js.map +1 -1
  553. package/out/module/workspace.d.ts +43 -0
  554. package/out/module/workspace.d.ts.map +1 -0
  555. package/out/module/workspace.js +79 -0
  556. package/out/module/workspace.js.map +1 -0
  557. package/out/numeric.d.ts +7 -5
  558. package/out/numeric.d.ts.map +1 -1
  559. package/out/numeric.js +14 -9
  560. package/out/numeric.js.map +1 -1
  561. package/out/objects.d.ts +13 -7
  562. package/out/objects.d.ts.map +1 -1
  563. package/out/objects.js +7 -3
  564. package/out/objects.js.map +1 -1
  565. package/out/overture-pins.d.ts +7 -7
  566. package/out/overture-pins.js +7 -7
  567. package/out/paths.d.ts +27 -36
  568. package/out/paths.d.ts.map +1 -1
  569. package/out/paths.js +66 -55
  570. package/out/paths.js.map +1 -1
  571. package/out/pipeline/client-result.d.ts +15 -10
  572. package/out/pipeline/client-result.d.ts.map +1 -1
  573. package/out/pipeline/client-result.js +4 -4
  574. package/out/pipeline/preferences.d.ts +3 -1
  575. package/out/pipeline/preferences.d.ts.map +1 -1
  576. package/out/pipeline/result.d.ts +26 -24
  577. package/out/pipeline/result.d.ts.map +1 -1
  578. package/out/pipeline/result.js +0 -1
  579. package/out/pipeline/result.js.map +1 -1
  580. package/out/pipeline/runtime-pipeline.d.ts +21 -75
  581. package/out/pipeline/runtime-pipeline.d.ts.map +1 -1
  582. package/out/pipeline/runtime-pipeline.js +59 -178
  583. package/out/pipeline/runtime-pipeline.js.map +1 -1
  584. package/out/pipeline/span-proposer.d.ts +36 -74
  585. package/out/pipeline/span-proposer.d.ts.map +1 -1
  586. package/out/pipeline/span-proposer.js +49 -100
  587. package/out/pipeline/span-proposer.js.map +1 -1
  588. package/out/pipeline/types.d.ts +148 -242
  589. package/out/pipeline/types.d.ts.map +1 -1
  590. package/out/pipeline/types.js +16 -45
  591. package/out/pipeline/types.js.map +1 -1
  592. package/out/{pipeline/index.d.ts → pipeline.d.ts} +2 -2
  593. package/out/pipeline.d.ts.map +1 -0
  594. package/out/{pipeline/index.js → pipeline.js} +2 -2
  595. package/out/pipeline.js.map +1 -0
  596. package/out/policy/defaults.d.ts +11 -9
  597. package/out/policy/defaults.d.ts.map +1 -1
  598. package/out/policy/defaults.js +13 -11
  599. package/out/policy/defaults.js.map +1 -1
  600. package/out/policy/policy.d.ts +12 -21
  601. package/out/policy/policy.d.ts.map +1 -1
  602. package/out/policy/policy.js +1 -4
  603. package/out/policy/policy.js.map +1 -1
  604. package/out/policy/proposal-collection.d.ts +5 -18
  605. package/out/policy/proposal-collection.d.ts.map +1 -1
  606. package/out/policy/proposal-collection.js +4 -17
  607. package/out/policy/proposal-collection.js.map +1 -1
  608. package/out/policy/registry.d.ts +11 -6
  609. package/out/policy/registry.d.ts.map +1 -1
  610. package/out/policy/registry.js +19 -47
  611. package/out/policy/registry.js.map +1 -1
  612. package/out/{policy/index.d.ts → policy.d.ts} +1 -1
  613. package/out/policy.d.ts.map +1 -0
  614. package/out/{policy/index.js → policy.js} +1 -1
  615. package/out/policy.js.map +1 -0
  616. package/out/process.d.ts +32 -33
  617. package/out/process.d.ts.map +1 -1
  618. package/out/process.js +20 -22
  619. package/out/process.js.map +1 -1
  620. package/out/promises.d.ts +20 -0
  621. package/out/promises.d.ts.map +1 -0
  622. package/out/promises.js +27 -0
  623. package/out/promises.js.map +1 -0
  624. package/out/random.d.ts +40 -36
  625. package/out/random.d.ts.map +1 -1
  626. package/out/random.js +66 -43
  627. package/out/random.js.map +1 -1
  628. package/out/release-config.d.ts +51 -20
  629. package/out/release-config.d.ts.map +1 -1
  630. package/out/release-config.js +41 -11
  631. package/out/release-config.js.map +1 -1
  632. package/out/resolver/authoritative-provider.d.ts +43 -64
  633. package/out/resolver/authoritative-provider.d.ts.map +1 -1
  634. package/out/resolver/authoritative-provider.js +15 -23
  635. package/out/resolver/authoritative-provider.js.map +1 -1
  636. package/out/resolver/coverage-facts.d.ts +39 -23
  637. package/out/resolver/coverage-facts.d.ts.map +1 -1
  638. package/out/resolver/coverage-facts.js +6 -4
  639. package/out/resolver/coverage-facts.js.map +1 -1
  640. package/out/resolver/fixture-authoritative-provider.d.ts +22 -19
  641. package/out/resolver/fixture-authoritative-provider.d.ts.map +1 -1
  642. package/out/resolver/fixture-authoritative-provider.js +14 -13
  643. package/out/resolver/fixture-authoritative-provider.js.map +1 -1
  644. package/out/resolver/lookup-types.d.ts +110 -58
  645. package/out/resolver/lookup-types.d.ts.map +1 -1
  646. package/out/resolver/lookup-types.js +5 -3
  647. package/out/resolver/lookup-types.js.map +1 -1
  648. package/out/resolver/postcode-format.d.ts +25 -25
  649. package/out/resolver/postcode-format.d.ts.map +1 -1
  650. package/out/resolver/postcode-format.js +69 -43
  651. package/out/resolver/postcode-format.js.map +1 -1
  652. package/out/resolver/referential.d.ts +57 -35
  653. package/out/resolver/referential.d.ts.map +1 -1
  654. package/out/resolver/referential.js +51 -33
  655. package/out/resolver/referential.js.map +1 -1
  656. package/out/resolver/region-database-provider.d.ts +51 -0
  657. package/out/resolver/region-database-provider.d.ts.map +1 -0
  658. package/out/resolver/region-database-provider.js +8 -0
  659. package/out/resolver/region-database-provider.js.map +1 -0
  660. package/out/resolver/synthetic-id-ranges.d.ts +17 -11
  661. package/out/resolver/synthetic-id-ranges.d.ts.map +1 -1
  662. package/out/resolver/synthetic-id-ranges.js +17 -11
  663. package/out/resolver/synthetic-id-ranges.js.map +1 -1
  664. package/out/resolver/types.d.ts +98 -542
  665. package/out/resolver/types.d.ts.map +1 -1
  666. package/out/resolver/types.js +0 -12
  667. package/out/resolver/types.js.map +1 -1
  668. package/out/{resolver/index.d.ts → resolver.d.ts} +11 -9
  669. package/out/resolver.d.ts.map +1 -0
  670. package/out/resolver.js +19 -0
  671. package/out/resolver.js.map +1 -0
  672. package/out/resources/git.d.ts +3 -2
  673. package/out/resources/git.d.ts.map +1 -1
  674. package/out/resources/git.js +3 -3
  675. package/out/resources/git.js.map +1 -1
  676. package/out/resources/{languages/index.d.ts → languages.d.ts} +1 -1
  677. package/out/resources/languages.d.ts.map +1 -0
  678. package/out/resources/{languages/index.js → languages.js} +1 -1
  679. package/out/resources/languages.js.map +1 -0
  680. package/out/resources/libpostal.d.ts +3 -4
  681. package/out/resources/libpostal.d.ts.map +1 -1
  682. package/out/resources/libpostal.js +3 -4
  683. package/out/resources/libpostal.js.map +1 -1
  684. package/out/resources/whosonfirst/PlacetypeDataSource.d.ts +7 -3
  685. package/out/resources/whosonfirst/PlacetypeDataSource.d.ts.map +1 -1
  686. package/out/resources/whosonfirst/PlacetypeDataSource.js +9 -6
  687. package/out/resources/whosonfirst/PlacetypeDataSource.js.map +1 -1
  688. package/out/resources/whosonfirst/backoff.d.ts +1 -4
  689. package/out/resources/whosonfirst/backoff.d.ts.map +1 -1
  690. package/out/resources/whosonfirst/backoff.js +2 -5
  691. package/out/resources/whosonfirst/backoff.js.map +1 -1
  692. package/out/resources/whosonfirst/extract-repo.d.ts +26 -18
  693. package/out/resources/whosonfirst/extract-repo.d.ts.map +1 -1
  694. package/out/resources/whosonfirst/extract-repo.js +33 -24
  695. package/out/resources/whosonfirst/extract-repo.js.map +1 -1
  696. package/out/resources/whosonfirst/placetypes/Placetype.d.ts +9 -6
  697. package/out/resources/whosonfirst/placetypes/Placetype.d.ts.map +1 -1
  698. package/out/resources/whosonfirst/placetypes/Placetype.js +28 -22
  699. package/out/resources/whosonfirst/placetypes/Placetype.js.map +1 -1
  700. package/out/resources/whosonfirst/placetypes/admin.d.ts +20 -11
  701. package/out/resources/whosonfirst/placetypes/admin.d.ts.map +1 -1
  702. package/out/resources/whosonfirst/placetypes/admin.js +4 -2
  703. package/out/resources/whosonfirst/placetypes/admin.js.map +1 -1
  704. package/out/resources/whosonfirst/placetypes/graph.d.ts +21 -12
  705. package/out/resources/whosonfirst/placetypes/graph.d.ts.map +1 -1
  706. package/out/resources/whosonfirst/placetypes/graph.js +9 -6
  707. package/out/resources/whosonfirst/placetypes/graph.js.map +1 -1
  708. package/out/resources/whosonfirst/placetypes/mermaid.d.ts +14 -21
  709. package/out/resources/whosonfirst/placetypes/mermaid.d.ts.map +1 -1
  710. package/out/resources/whosonfirst/placetypes/mermaid.js +13 -21
  711. package/out/resources/whosonfirst/placetypes/mermaid.js.map +1 -1
  712. package/out/resources/whosonfirst/placetypes/specificity.d.ts +31 -38
  713. package/out/resources/whosonfirst/placetypes/specificity.d.ts.map +1 -1
  714. package/out/resources/whosonfirst/placetypes/specificity.js +31 -38
  715. package/out/resources/whosonfirst/placetypes/specificity.js.map +1 -1
  716. package/out/resources/whosonfirst/placetypes/tree.d.ts +10 -6
  717. package/out/resources/whosonfirst/placetypes/tree.d.ts.map +1 -1
  718. package/out/resources/whosonfirst/placetypes/tree.js +6 -3
  719. package/out/resources/whosonfirst/placetypes/tree.js.map +1 -1
  720. package/out/resources/whosonfirst/{placetypes/index.js → placetypes.d.ts} +1 -1
  721. package/out/resources/whosonfirst/placetypes.d.ts.map +1 -0
  722. package/out/resources/whosonfirst/{placetypes/index.d.ts → placetypes.js} +1 -1
  723. package/out/resources/whosonfirst/placetypes.js.map +1 -0
  724. package/out/resources/{whosonfirst/index.d.ts → whosonfirst.d.ts} +2 -2
  725. package/out/resources/whosonfirst.d.ts.map +1 -0
  726. package/out/resources/{whosonfirst/index.js → whosonfirst.js} +2 -2
  727. package/out/resources/whosonfirst.js.map +1 -0
  728. package/out/{resources/index.js → resources.d.ts} +3 -3
  729. package/out/resources.d.ts.map +1 -0
  730. package/out/{resources/index.d.ts → resources.js} +3 -3
  731. package/out/resources.js.map +1 -0
  732. package/out/{routing/index.d.ts → routing.d.ts} +1 -1
  733. package/out/routing.d.ts.map +1 -0
  734. package/out/{routing/index.js → routing.js} +4 -4
  735. package/out/routing.js.map +1 -0
  736. package/out/scope-config.d.ts +108 -0
  737. package/out/scope-config.d.ts.map +1 -0
  738. package/out/scope-config.js +85 -0
  739. package/out/scope-config.js.map +1 -0
  740. package/out/scripting/arguments.d.ts +50 -14
  741. package/out/scripting/arguments.d.ts.map +1 -1
  742. package/out/scripting/arguments.js +52 -36
  743. package/out/scripting/arguments.js.map +1 -1
  744. package/out/scripting/command.d.ts +10 -2
  745. package/out/scripting/command.d.ts.map +1 -1
  746. package/out/scripting/command.js +3 -1
  747. package/out/scripting/command.js.map +1 -1
  748. package/out/scripting/ingest-chunk-script.d.ts +16 -17
  749. package/out/scripting/ingest-chunk-script.d.ts.map +1 -1
  750. package/out/scripting/ingest-chunk-script.js +16 -18
  751. package/out/scripting/ingest-chunk-script.js.map +1 -1
  752. package/out/scripting/operation.d.ts +77 -0
  753. package/out/scripting/operation.d.ts.map +1 -0
  754. package/out/scripting/operation.js +38 -0
  755. package/out/scripting/operation.js.map +1 -0
  756. package/out/scripting/{utils/index.d.ts → utils.d.ts} +14 -9
  757. package/out/scripting/utils.d.ts.map +1 -0
  758. package/out/scripting/{utils/index.js → utils.js} +16 -10
  759. package/out/scripting/utils.js.map +1 -0
  760. package/out/{scripting/index.d.ts → scripting.d.ts} +6 -4
  761. package/out/scripting.d.ts.map +1 -0
  762. package/out/{scripting/index.js → scripting.js} +7 -5
  763. package/out/scripting.js.map +1 -0
  764. package/out/stats.d.ts +8 -9
  765. package/out/stats.d.ts.map +1 -1
  766. package/out/stats.js +8 -9
  767. package/out/stats.js.map +1 -1
  768. package/out/strings/compare.d.ts +3 -2
  769. package/out/strings/compare.d.ts.map +1 -1
  770. package/out/strings/compare.js +3 -2
  771. package/out/strings/compare.js.map +1 -1
  772. package/out/strings/escape.d.ts +1 -1
  773. package/out/strings/escape.js +1 -1
  774. package/out/strings/format.d.ts +11 -5
  775. package/out/strings/format.d.ts.map +1 -1
  776. package/out/strings/format.js +11 -5
  777. package/out/strings/format.js.map +1 -1
  778. package/out/strings/markdown-table.d.ts +22 -0
  779. package/out/strings/markdown-table.d.ts.map +1 -0
  780. package/out/strings/markdown-table.js +43 -0
  781. package/out/strings/markdown-table.js.map +1 -0
  782. package/out/strings/python-json.d.ts +3 -28
  783. package/out/strings/python-json.d.ts.map +1 -1
  784. package/out/strings/python-json.js +13 -11
  785. package/out/strings/python-json.js.map +1 -1
  786. package/out/tokenization/Graph.d.ts +3 -0
  787. package/out/tokenization/Graph.d.ts.map +1 -1
  788. package/out/tokenization/Graph.js +3 -0
  789. package/out/tokenization/Graph.js.map +1 -1
  790. package/out/tokenization/Span.d.ts +4 -1
  791. package/out/tokenization/Span.d.ts.map +1 -1
  792. package/out/tokenization/Span.js +6 -3
  793. package/out/tokenization/Span.js.map +1 -1
  794. package/out/tokenization/normalizer.d.ts +4 -1
  795. package/out/tokenization/normalizer.d.ts.map +1 -1
  796. package/out/tokenization/normalizer.js +16 -13
  797. package/out/tokenization/normalizer.js.map +1 -1
  798. package/out/{tokenization/index.js → tokenization.d.ts} +1 -1
  799. package/out/tokenization.d.ts.map +1 -0
  800. package/out/{tokenization/index.d.ts → tokenization.js} +1 -1
  801. package/out/tokenization.js.map +1 -0
  802. package/out/tools/coarse-placer/build/dataset.d.ts +38 -0
  803. package/out/tools/coarse-placer/build/dataset.d.ts.map +1 -0
  804. package/out/{coarse-placer/tools → tools/coarse-placer}/build/dataset.js +25 -37
  805. package/out/tools/coarse-placer/build/dataset.js.map +1 -0
  806. package/out/tools/coarse-placer/build/outlier/exposure.d.ts +48 -0
  807. package/out/tools/coarse-placer/build/outlier/exposure.d.ts.map +1 -0
  808. package/out/{coarse-placer/tools → tools/coarse-placer}/build/outlier/exposure.js +45 -33
  809. package/out/tools/coarse-placer/build/outlier/exposure.js.map +1 -0
  810. package/out/tools/coarse-placer/build/outlier/latin.d.ts +61 -0
  811. package/out/tools/coarse-placer/build/outlier/latin.d.ts.map +1 -0
  812. package/out/{coarse-placer/tools → tools/coarse-placer}/build/outlier/latin.js +29 -29
  813. package/out/tools/coarse-placer/build/outlier/latin.js.map +1 -0
  814. package/out/tools/coarse-placer/build/outlier/oa.d.ts +68 -0
  815. package/out/tools/coarse-placer/build/outlier/oa.d.ts.map +1 -0
  816. package/out/{coarse-placer/tools → tools/coarse-placer}/build/outlier/oa.js +44 -38
  817. package/out/tools/coarse-placer/build/outlier/oa.js.map +1 -0
  818. package/out/tools/coarse-placer/country-sets.d.ts +33 -0
  819. package/out/tools/coarse-placer/country-sets.d.ts.map +1 -0
  820. package/out/tools/coarse-placer/country-sets.js +50 -0
  821. package/out/tools/coarse-placer/country-sets.js.map +1 -0
  822. package/out/tools/coarse-placer/eval/latin-offmap.d.ts +52 -0
  823. package/out/tools/coarse-placer/eval/latin-offmap.d.ts.map +1 -0
  824. package/out/{coarse-placer/tools → tools/coarse-placer}/eval/latin-offmap.js +10 -8
  825. package/out/tools/coarse-placer/eval/latin-offmap.js.map +1 -0
  826. package/out/tools/coarse-placer/eval/openset.d.ts +46 -0
  827. package/out/tools/coarse-placer/eval/openset.d.ts.map +1 -0
  828. package/out/{coarse-placer/tools → tools/coarse-placer}/eval/openset.js +32 -63
  829. package/out/tools/coarse-placer/eval/openset.js.map +1 -0
  830. package/out/{coarse-placer/tools → tools/coarse-placer}/eval/quant-compare.d.ts +20 -9
  831. package/out/tools/coarse-placer/eval/quant-compare.d.ts.map +1 -0
  832. package/out/{coarse-placer/tools → tools/coarse-placer}/eval/quant-compare.js +9 -6
  833. package/out/tools/coarse-placer/eval/quant-compare.js.map +1 -0
  834. package/out/{coarse-placer/tools → tools/coarse-placer}/eval.d.ts +17 -8
  835. package/out/tools/coarse-placer/eval.d.ts.map +1 -0
  836. package/out/{coarse-placer/tools → tools/coarse-placer}/eval.js +14 -13
  837. package/out/tools/coarse-placer/eval.js.map +1 -0
  838. package/out/{coarse-placer/tools → tools/coarse-placer}/outlier-rows.d.ts +10 -8
  839. package/out/tools/coarse-placer/outlier-rows.d.ts.map +1 -0
  840. package/out/{coarse-placer/tools → tools/coarse-placer}/outlier-rows.js +17 -16
  841. package/out/tools/coarse-placer/outlier-rows.js.map +1 -0
  842. package/out/{coarse-placer/tools → tools/coarse-placer}/paths.d.ts +10 -9
  843. package/out/tools/coarse-placer/paths.d.ts.map +1 -0
  844. package/out/{coarse-placer/tools → tools/coarse-placer}/paths.js +16 -11
  845. package/out/tools/coarse-placer/paths.js.map +1 -0
  846. package/out/tools/coarse-placer/probe-frontier.d.ts +63 -0
  847. package/out/tools/coarse-placer/probe-frontier.d.ts.map +1 -0
  848. package/out/{coarse-placer/tools → tools/coarse-placer}/probe-frontier.js +24 -19
  849. package/out/tools/coarse-placer/probe-frontier.js.map +1 -0
  850. package/out/tools/coarse-placer/quantize.d.ts +49 -0
  851. package/out/tools/coarse-placer/quantize.d.ts.map +1 -0
  852. package/out/{coarse-placer/tools → tools/coarse-placer}/quantize.js +10 -11
  853. package/out/tools/coarse-placer/quantize.js.map +1 -0
  854. package/out/{coarse-placer/tools → tools/coarse-placer}/train.d.ts +22 -10
  855. package/out/tools/coarse-placer/train.d.ts.map +1 -0
  856. package/out/{coarse-placer/tools → tools/coarse-placer}/train.js +17 -21
  857. package/out/tools/coarse-placer/train.js.map +1 -0
  858. package/out/tools/download/libpostal-resources.d.ts +12 -8
  859. package/out/tools/download/libpostal-resources.d.ts.map +1 -1
  860. package/out/tools/download/libpostal-resources.js +21 -16
  861. package/out/tools/download/libpostal-resources.js.map +1 -1
  862. package/out/tools/download/ssl-address.d.ts +18 -11
  863. package/out/tools/download/ssl-address.d.ts.map +1 -1
  864. package/out/tools/download/ssl-address.js +26 -20
  865. package/out/tools/download/ssl-address.js.map +1 -1
  866. package/out/tools/generate-language-types.d.ts +15 -15
  867. package/out/tools/generate-language-types.d.ts.map +1 -1
  868. package/out/tools/generate-language-types.js +30 -35
  869. package/out/tools/generate-language-types.js.map +1 -1
  870. package/out/trust-policies.d.ts +32 -19
  871. package/out/trust-policies.d.ts.map +1 -1
  872. package/out/trust-policies.js +37 -22
  873. package/out/trust-policies.js.map +1 -1
  874. package/out/types/Classification.d.ts +3 -3
  875. package/out/types/Classification.d.ts.map +1 -1
  876. package/out/types/classifier.d.ts +47 -48
  877. package/out/types/classifier.d.ts.map +1 -1
  878. package/out/types/classifier.js +5 -10
  879. package/out/types/classifier.js.map +1 -1
  880. package/out/types/mapping.d.ts +14 -14
  881. package/out/types/mapping.d.ts.map +1 -1
  882. package/out/types/mapping.js +22 -19
  883. package/out/types/mapping.js.map +1 -1
  884. package/out/{types/index.d.ts → types.d.ts} +1 -1
  885. package/out/types.d.ts.map +1 -0
  886. package/out/{types/index.js → types.js} +1 -1
  887. package/out/types.js.map +1 -0
  888. package/out/utils/chunk-process.d.ts +21 -28
  889. package/out/utils/chunk-process.d.ts.map +1 -1
  890. package/out/utils/chunk-process.js +16 -23
  891. package/out/utils/chunk-process.js.map +1 -1
  892. package/out/utils/collections.d.ts +4 -2
  893. package/out/utils/collections.d.ts.map +1 -1
  894. package/out/utils/collections.js +4 -2
  895. package/out/utils/collections.js.map +1 -1
  896. package/out/utils/events.d.ts +2 -1
  897. package/out/utils/events.d.ts.map +1 -1
  898. package/out/utils/events.js +2 -1
  899. package/out/utils/events.js.map +1 -1
  900. package/out/utils/geodatabase-archive.d.ts +23 -25
  901. package/out/utils/geodatabase-archive.d.ts.map +1 -1
  902. package/out/utils/geodatabase-archive.js +15 -23
  903. package/out/utils/geodatabase-archive.js.map +1 -1
  904. package/out/utils/sleep.d.ts +2 -2
  905. package/out/utils/sleep.js +2 -2
  906. package/out/utils/sqlite-rows.d.ts +11 -19
  907. package/out/utils/sqlite-rows.d.ts.map +1 -1
  908. package/out/utils/sqlite-rows.js +11 -19
  909. package/out/utils/sqlite-rows.js.map +1 -1
  910. package/out/utils/stream-to-disk.d.ts +23 -37
  911. package/out/utils/stream-to-disk.d.ts.map +1 -1
  912. package/out/utils/stream-to-disk.js +8 -24
  913. package/out/utils/stream-to-disk.js.map +1 -1
  914. package/out/utils/system.d.ts +10 -2
  915. package/out/utils/system.d.ts.map +1 -1
  916. package/out/utils/system.js +13 -2
  917. package/out/utils/system.js.map +1 -1
  918. package/out/utils/time.d.ts +8 -6
  919. package/out/utils/time.d.ts.map +1 -1
  920. package/out/utils/time.js +8 -6
  921. package/out/utils/time.js.map +1 -1
  922. package/out/utils/union-find.d.ts +7 -3
  923. package/out/utils/union-find.d.ts.map +1 -1
  924. package/out/utils/union-find.js +4 -2
  925. package/out/utils/union-find.js.map +1 -1
  926. package/out/{utils/index.js → utils.d.ts} +1 -3
  927. package/out/utils.d.ts.map +1 -0
  928. package/out/{utils/index.d.ts → utils.js} +1 -3
  929. package/out/utils.js.map +1 -0
  930. package/out/vale.d.ts +10 -14
  931. package/out/vale.d.ts.map +1 -1
  932. package/out/vale.js +30 -12
  933. package/out/vale.js.map +1 -1
  934. package/out/workspaces.d.ts +16 -9
  935. package/out/workspaces.d.ts.map +1 -1
  936. package/out/workspaces.js +47 -12
  937. package/out/workspaces.js.map +1 -1
  938. package/package.json +256 -210
  939. package/{lib/coarse-placer/tools → tools/coarse-placer}/build/dataset.ts +30 -40
  940. package/{lib/coarse-placer/tools → tools/coarse-placer}/build/outlier/exposure.ts +56 -45
  941. package/{lib/coarse-placer/tools → tools/coarse-placer}/build/outlier/latin.ts +38 -36
  942. package/{lib/coarse-placer/tools → tools/coarse-placer}/build/outlier/oa.ts +53 -44
  943. package/tools/coarse-placer/country-sets.ts +52 -0
  944. package/{lib/coarse-placer/tools → tools/coarse-placer}/eval/latin-offmap.ts +19 -11
  945. package/{lib/coarse-placer/tools → tools/coarse-placer}/eval/openset.ts +37 -74
  946. package/{lib/coarse-placer/tools → tools/coarse-placer}/eval/quant-compare.ts +21 -10
  947. package/{lib/coarse-placer/tools → tools/coarse-placer}/eval.ts +23 -16
  948. package/{lib/coarse-placer/tools → tools/coarse-placer}/outlier-rows.ts +21 -21
  949. package/{lib/coarse-placer/tools → tools/coarse-placer}/paths.ts +21 -16
  950. package/{lib/coarse-placer/tools → tools/coarse-placer}/probe-frontier.ts +31 -22
  951. package/{lib/coarse-placer/tools → tools/coarse-placer}/quantize.ts +16 -13
  952. package/{lib/coarse-placer/tools → tools/coarse-placer}/train.ts +32 -27
  953. package/{lib/tools → tools}/download/libpostal-resources.ts +23 -17
  954. package/{lib/tools → tools}/download/ssl-address.ts +34 -24
  955. package/{lib/tools → tools}/generate-language-types.ts +33 -41
  956. package/lib/coarse-placer/tools/country-sets.ts +0 -47
  957. package/lib/coarse-placer/tools/index.ts +0 -24
  958. package/lib/layers/index.ts +0 -14
  959. package/lib/strings/case.ts +0 -126
  960. package/lib/tools/index.ts +0 -12
  961. package/out/api/index.d.ts.map +0 -1
  962. package/out/api/index.js.map +0 -1
  963. package/out/coarse-placer/tools/build/dataset.d.ts +0 -47
  964. package/out/coarse-placer/tools/build/dataset.d.ts.map +0 -1
  965. package/out/coarse-placer/tools/build/dataset.js.map +0 -1
  966. package/out/coarse-placer/tools/build/outlier/exposure.d.ts +0 -46
  967. package/out/coarse-placer/tools/build/outlier/exposure.d.ts.map +0 -1
  968. package/out/coarse-placer/tools/build/outlier/exposure.js.map +0 -1
  969. package/out/coarse-placer/tools/build/outlier/latin.d.ts +0 -55
  970. package/out/coarse-placer/tools/build/outlier/latin.d.ts.map +0 -1
  971. package/out/coarse-placer/tools/build/outlier/latin.js.map +0 -1
  972. package/out/coarse-placer/tools/build/outlier/oa.d.ts +0 -63
  973. package/out/coarse-placer/tools/build/outlier/oa.d.ts.map +0 -1
  974. package/out/coarse-placer/tools/build/outlier/oa.js.map +0 -1
  975. package/out/coarse-placer/tools/country-sets.d.ts +0 -28
  976. package/out/coarse-placer/tools/country-sets.d.ts.map +0 -1
  977. package/out/coarse-placer/tools/country-sets.js +0 -45
  978. package/out/coarse-placer/tools/country-sets.js.map +0 -1
  979. package/out/coarse-placer/tools/eval/latin-offmap.d.ts +0 -44
  980. package/out/coarse-placer/tools/eval/latin-offmap.d.ts.map +0 -1
  981. package/out/coarse-placer/tools/eval/latin-offmap.js.map +0 -1
  982. package/out/coarse-placer/tools/eval/openset.d.ts +0 -72
  983. package/out/coarse-placer/tools/eval/openset.d.ts.map +0 -1
  984. package/out/coarse-placer/tools/eval/openset.js.map +0 -1
  985. package/out/coarse-placer/tools/eval/quant-compare.d.ts.map +0 -1
  986. package/out/coarse-placer/tools/eval/quant-compare.js.map +0 -1
  987. package/out/coarse-placer/tools/eval.d.ts.map +0 -1
  988. package/out/coarse-placer/tools/eval.js.map +0 -1
  989. package/out/coarse-placer/tools/index.d.ts +0 -24
  990. package/out/coarse-placer/tools/index.d.ts.map +0 -1
  991. package/out/coarse-placer/tools/index.js +0 -24
  992. package/out/coarse-placer/tools/index.js.map +0 -1
  993. package/out/coarse-placer/tools/outlier-rows.d.ts.map +0 -1
  994. package/out/coarse-placer/tools/outlier-rows.js.map +0 -1
  995. package/out/coarse-placer/tools/paths.d.ts.map +0 -1
  996. package/out/coarse-placer/tools/paths.js.map +0 -1
  997. package/out/coarse-placer/tools/probe-frontier.d.ts +0 -54
  998. package/out/coarse-placer/tools/probe-frontier.d.ts.map +0 -1
  999. package/out/coarse-placer/tools/probe-frontier.js.map +0 -1
  1000. package/out/coarse-placer/tools/quantize.d.ts +0 -46
  1001. package/out/coarse-placer/tools/quantize.d.ts.map +0 -1
  1002. package/out/coarse-placer/tools/quantize.js.map +0 -1
  1003. package/out/coarse-placer/tools/train.d.ts.map +0 -1
  1004. package/out/coarse-placer/tools/train.js.map +0 -1
  1005. package/out/decoder/index.d.ts.map +0 -1
  1006. package/out/decoder/index.js.map +0 -1
  1007. package/out/env/index.d.ts.map +0 -1
  1008. package/out/env/index.js.map +0 -1
  1009. package/out/layers/index.d.ts +0 -14
  1010. package/out/layers/index.d.ts.map +0 -1
  1011. package/out/layers/index.js +0 -14
  1012. package/out/layers/index.js.map +0 -1
  1013. package/out/license/index.d.ts.map +0 -1
  1014. package/out/license/index.js.map +0 -1
  1015. package/out/license/key/index.d.ts +0 -96
  1016. package/out/license/key/index.d.ts.map +0 -1
  1017. package/out/license/key/index.js.map +0 -1
  1018. package/out/locale/index.d.ts.map +0 -1
  1019. package/out/locale/index.js.map +0 -1
  1020. package/out/locale/profiles/index.d.ts.map +0 -1
  1021. package/out/locale/profiles/index.js.map +0 -1
  1022. package/out/logging/index.d.ts.map +0 -1
  1023. package/out/logging/index.js.map +0 -1
  1024. package/out/pipeline/index.d.ts.map +0 -1
  1025. package/out/pipeline/index.js.map +0 -1
  1026. package/out/policy/index.d.ts.map +0 -1
  1027. package/out/policy/index.js.map +0 -1
  1028. package/out/resolver/index.d.ts.map +0 -1
  1029. package/out/resolver/index.js +0 -18
  1030. package/out/resolver/index.js.map +0 -1
  1031. package/out/resources/index.d.ts.map +0 -1
  1032. package/out/resources/index.js.map +0 -1
  1033. package/out/resources/languages/index.d.ts.map +0 -1
  1034. package/out/resources/languages/index.js.map +0 -1
  1035. package/out/resources/whosonfirst/index.d.ts.map +0 -1
  1036. package/out/resources/whosonfirst/index.js.map +0 -1
  1037. package/out/resources/whosonfirst/placetypes/index.d.ts.map +0 -1
  1038. package/out/resources/whosonfirst/placetypes/index.js.map +0 -1
  1039. package/out/routing/index.d.ts.map +0 -1
  1040. package/out/routing/index.js.map +0 -1
  1041. package/out/scripting/index.d.ts.map +0 -1
  1042. package/out/scripting/index.js.map +0 -1
  1043. package/out/scripting/utils/index.d.ts.map +0 -1
  1044. package/out/scripting/utils/index.js.map +0 -1
  1045. package/out/strings/case.d.ts +0 -48
  1046. package/out/strings/case.d.ts.map +0 -1
  1047. package/out/strings/case.js +0 -105
  1048. package/out/strings/case.js.map +0 -1
  1049. package/out/tokenization/index.d.ts.map +0 -1
  1050. package/out/tokenization/index.js.map +0 -1
  1051. package/out/tools/index.d.ts +0 -12
  1052. package/out/tools/index.d.ts.map +0 -1
  1053. package/out/tools/index.js +0 -12
  1054. package/out/tools/index.js.map +0 -1
  1055. package/out/types/index.d.ts.map +0 -1
  1056. package/out/types/index.js.map +0 -1
  1057. package/out/utils/index.d.ts.map +0 -1
  1058. package/out/utils/index.js.map +0 -1
  1059. package/vitest.config.ts +0 -54
  1060. /package/lib/{decoder/index.ts → decoder.ts} +0 -0
  1061. /package/lib/locale/{profiles/index.ts → profiles.ts} +0 -0
  1062. /package/lib/{logging/index.ts → logging.ts} +0 -0
  1063. /package/lib/{policy/index.ts → policy.ts} +0 -0
  1064. /package/lib/resources/{languages/index.ts → languages.ts} +0 -0
  1065. /package/lib/resources/whosonfirst/{placetypes/index.ts → placetypes.ts} +0 -0
  1066. /package/lib/{tokenization/index.ts → tokenization.ts} +0 -0
  1067. /package/lib/{types/index.ts → types.ts} +0 -0
@@ -3,76 +3,84 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * Outlier-exposure data for the #244 coarse-placer's explicit "OTHER" (off-map) class — milestone
7
- * 2. The closed-set model is confidently wrong on scripts it never saw (Cyrillic→DE@0.71). The
8
- * fix is to TRAIN an "off my loaded map" class on those scripts. Source: the WOF `names` table,
9
- * which carries native-script alternate names in dozens of languages
10
- * (rus/ukr/ara/ell/heb/hin/tha/kat/hye/…) — i.e. exactly the off-map scripts we want the model to
11
- * learn to abstain on. Balanced per-language for script diversity, filtered to a genuinely
12
- * off-map dominant script (not Latin, not CJK — those are the in-map countries), then APPENDED to
13
- * the train/val/test splits as `country: "OTHER"`.
6
+ * Builds training rows for the coarse placer's `OTHER` class from scripts outside the model's countries.
14
7
  *
15
- * Run AFTER build-dataset. Run: `mailwoman placer build-dataset --outliers exposure [--per-lang
16
- * 2500]`
8
+ * Without these rows the model assigns unseen scripts to an in-map country with high confidence. The rows come
9
+ * from native-script names in the WOF `names` table, sampled evenly per language and kept only when the name is
10
+ * mostly in a script other than Latin or CJK. They are appended to the existing splits, so run this after
11
+ * `mailwoman placer build-dataset`.
17
12
  */
18
13
  import { DatabaseClient } from "@mailwoman/sqlite/client";
19
14
  import { resolvePath } from "path-ts";
20
15
  import { scriptOf } from "#coarse-placer/featurize";
21
16
  import { hashFNV1a } from "#coarse-placer/fnv-hash";
22
- import { defaultDataDir } from "#coarse-placer/tools/paths";
17
+ import { databaseRootPath, dataRootPath } from "#data-root";
23
18
  import { appendLocalTextFile } from "#fs/writers";
24
- import { dataRootPath } from "#utils";
19
+ import { stringifyJSON } from "#json";
20
+ import { defaultDataDir } from "#tools/coarse-placer/paths";
25
21
  /**
26
- * Share of a bucket that must be off-map before it is treated as an exposure case rather than noise.
22
+ * The minimum share of counted characters that must be off-map for a name to be kept.
27
23
  */
28
24
  const OFFMAP_DOMINANCE = 0.6;
29
25
  /**
30
- * Off-map languages whose `names` are written in a NON-Latin, NON-CJK script (CJK = the in-map CN/JP/KR/TW).
26
+ * Languages whose WOF names use scripts outside Latin and CJK.
27
+ *
28
+ * CJK is excluded because CN, JP, KR and TW are in-map classes.
29
+ *
30
+ * TODO: Derive this list from `@mailwoman/codex`.
31
31
  */
32
32
  const OFF_MAP_LANGS = [
33
+ // Cyrillic
33
34
  "rus",
34
35
  "ukr",
35
36
  "bel",
36
37
  "bul",
37
38
  "srp",
38
- "mkd", // Cyrillic
39
- "ell", // Greek
39
+ "mkd",
40
+ // Greek
41
+ "ell",
42
+ // Arabic script
40
43
  "ara",
41
44
  "fas",
42
45
  "urd",
43
46
  "snd",
44
- "pus", // Arabic-script
47
+ "pus",
48
+ // Hebrew
45
49
  "heb",
46
- "yid", // Hebrew
50
+ "yid",
51
+ // Devanagari
47
52
  "hin",
48
53
  "mar",
49
54
  "nep",
50
- "san", // Devanagari
55
+ "san",
56
+ // Other Brahmic scripts
51
57
  "ben",
52
58
  "tam",
53
59
  "tel",
54
60
  "kan",
55
61
  "mal",
56
- "sin", // Brahmic
62
+ "sin",
63
+ // Southeast Asian scripts
57
64
  "tha",
58
65
  "lao",
59
66
  "khm",
60
- "mya", // SE-Asian
67
+ "mya",
68
+ // Georgian, Armenian and Ethiopic
61
69
  "kat",
62
70
  "hye",
63
- "amh", // Georgian / Armenian / Ethiopic
71
+ "amh",
64
72
  ];
65
73
  /**
66
- * Dominant script must be off-map: has chars in a non-Latin, non-CJK, non-digit block.
74
+ * Returns whether most letters in `s` belong to a script other than Latin or CJK.
67
75
  */
68
76
  function isOffMapScript(s) {
69
77
  let off = 0;
70
78
  let total = 0;
71
79
  for (const ch of s) {
72
80
  const cp = ch.codePointAt(0);
81
+ // ASCII digits, spaces and punctuation are not counted.
73
82
  if (cp <= 0x40 || (cp >= 0x5b && cp <= 0x60) || cp === 0x20)
74
83
  continue;
75
- // punct/space/digits
76
84
  total++;
77
85
  const script = scriptOf(cp);
78
86
  if (script !== "latin" && script !== "cjk" && cp > 0x2_ff) {
@@ -81,12 +89,14 @@ function isOffMapScript(s) {
81
89
  }
82
90
  return total > 0 && off / total > OFFMAP_DOMINANCE;
83
91
  }
84
- // Mimic a real off-map ADDRESS: a pure-script place name isn't what we see at inference (those carry
85
- // Latin digits + structure, e.g. "ул. Тверская, д. 1"). For each name we also emit an address-shaped
86
- // variant — name + a house number, deterministically — so the model learns "off-map script + digits =
87
- // still OTHER" and doesn't get pulled to a country by the numeric/punctuation n-grams.
92
+ /**
93
+ * Adds a house number to a name so it resembles a real off-map address such as "ул. Тверская, д. 1".
94
+ *
95
+ * These variants teach the model that digits and punctuation do not imply an in-map country.
96
+ */
88
97
  function addressVariant(name, h) {
89
- const n = (h % 4) + 1; // 1–4 digit house number
98
+ // The house number has one to four digits.
99
+ const n = (h % 4) + 1;
90
100
  const num = String(h % Math.pow(10, n) || 7);
91
101
  switch (h % 3) {
92
102
  case 0:
@@ -97,9 +107,12 @@ function addressVariant(name, h) {
97
107
  return `${name}, ${num}`;
98
108
  }
99
109
  }
110
+ /**
111
+ * Appends `OTHER` rows built from off-map WOF names to the dataset splits.
112
+ */
100
113
  export async function buildOutlierExposure(options = {}, report) {
101
114
  const PER = options.perLang ?? 2500;
102
- const wofPath = options.wof || dataRootPath("wof", "admin-global-priority.db");
115
+ const wofPath = options.wof || databaseRootPath(dataRootPath())("wof", "admin-global-priority.db");
103
116
  const dataDir = options.data || defaultDataDir();
104
117
  using db = new DatabaseClient(wofPath, { readOnly: true });
105
118
  const pool = [];
@@ -118,12 +131,11 @@ export async function buildOutlierExposure(options = {}, report) {
118
131
  seen.add(name);
119
132
  pool.push(name);
120
133
  pool.push(addressVariant(name, hashFNV1a(name)));
121
- // address-shaped sibling
122
134
  kept++;
123
135
  }
124
136
  report?.(` ${lang}: ${kept}`);
125
137
  }
126
- // Deterministic shuffle (FNV hash sort) + split 80/10/10, append as OTHER.
138
+ // Hash sorting shuffles rows deterministically before the 80/10/10 split.
127
139
  pool.sort((a, b) => hashFNV1a(a) - hashFNV1a(b));
128
140
  const nVal = Math.floor(pool.length * 0.1);
129
141
  const nTest = Math.floor(pool.length * 0.1);
@@ -133,7 +145,7 @@ export async function buildOutlierExposure(options = {}, report) {
133
145
  train: pool.slice(nVal + nTest),
134
146
  };
135
147
  for (const [split, names] of Object.entries(splits)) {
136
- const lines = names.map((raw) => JSON.stringify({ raw, country: "OTHER" })).join("\n") + "\n";
148
+ const lines = names.map((raw) => stringifyJSON({ raw, country: "OTHER" })).join("\n") + "\n";
137
149
  await appendLocalTextFile(lines, resolvePath(dataDir, `${split}.jsonl`));
138
150
  report?.(`appended ${names.length} OTHER → ${split}.jsonl`);
139
151
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exposure.js","sourceRoot":"","sources":["../../../../../tools/coarse-placer/build/outlier/exposure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAwB,WAAW,EAAE,MAAM,SAAS,CAAA;AAE3D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAA;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAE3D;;GAEG;AACH,MAAM,gBAAgB,GAAG,GAAG,CAAA;AAkC5B;;;;;;GAMG;AACH,MAAM,aAAa,GAAG;IACrB,WAAW;IACX,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IAC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EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;QAC5F,MAAM,mBAAmB,CAAC,KAAK,EAAE,WAAW,CAAC,OAAO,EAAE,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAA;QACxE,MAAM,EAAE,CAAC,YAAY,KAAK,CAAC,MAAM,YAAY,KAAK,QAAQ,CAAC,CAAA;IAC5D,CAAC;IAED,MAAM,EAAE,CAAC,qBAAqB,IAAI,CAAC,MAAM,EAAE,CAAC,CAAA;IAE5C,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,CAAA;AAC9B,CAAC"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * Latin-script off-map outlier exposure for the coarse-placer. The `other` class is trained on
7
+ * non-Latin and non-CJK scripts (Cyrillic, Arabic, …) from WOF names, so off-map countries
8
+ * written in Latin script (Poland, Brazil, Mexico, …) still mis-place to a trained Latin country,
9
+ * the "Latin-off-map residual". The fix assembles real off-map addresses from the Overture
10
+ * per-country address parquet and appends them as `country: "other"`.
11
+ *
12
+ * Discipline: countries split into train (their rows feed train/val `other`) and heldout (rows go
13
+ * only to the dedicated test file), so generalization to off-map countries the model never saw
14
+ * stays measurable. The in-map test.jsonl is left untouched so the before/after in-map regression
15
+ * check stays clean. The Latin metric lives in its own file.
16
+ *
17
+ * Run after build-dataset + the exposure outliers (it appends). Re-runnable: it rewrites the
18
+ * dedicated test file and appends fresh `other` rows (so don't run it twice onto the same splits
19
+ * without rebuilding train/val).
20
+ *
21
+ * Run: `mailwoman placer build-dataset --outliers latin [--per-country 6000] [--overture
22
+ * $MAILWOMAN_DATA_ROOT/overture/<release>]` (default: the addresses-theme pin, `OVERTURE_ADDRESSES_RELEASE`)
23
+ */
24
+ import { type PathBuilderLike } from "path-ts";
25
+ /**
26
+ * Options for {@linkcode buildOutlierLatin}.
27
+ */
28
+ export interface BuildOutlierLatinOptions {
29
+ /**
30
+ * Rows sampled per off-map country.
31
+ *
32
+ * Default 6000.
33
+ */
34
+ perCountry?: number;
35
+ /**
36
+ * Overture release dir.
37
+ *
38
+ * Default `$MAILWOMAN_DATA_ROOT/overture/<OVERTURE_ADDRESSES_RELEASE>`.
39
+ */
40
+ overture?: PathBuilderLike;
41
+ /**
42
+ * Dataset dir the `other` rows append to.
43
+ *
44
+ * Default `<repo>/data/coarse-placer`.
45
+ */
46
+ data?: PathBuilderLike;
47
+ }
48
+ /**
49
+ * Result of {@linkcode buildOutlierLatin}.
50
+ */
51
+ export interface BuildOutlierLatinResult {
52
+ train: number;
53
+ val: number;
54
+ test: number;
55
+ }
56
+ /**
57
+ * Coarse-placer Overture Latin-off-map outlier builder.
58
+ * See the module doc.
59
+ */
60
+ export declare function buildOutlierLatin(options?: BuildOutlierLatinOptions, report?: (line: string) => void): Promise<BuildOutlierLatinResult>;
61
+ //# sourceMappingURL=latin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"latin.d.ts","sourceRoot":"","sources":["../../../../../tools/coarse-placer/build/outlier/latin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAE,KAAK,eAAe,EAAe,MAAM,SAAS,CAAA;AAiB3D;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,eAAe,CAAA;IAC1B;;;;OAIG;IACH,IAAI,CAAC,EAAE,eAAe,CAAA;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;CACZ;AA8CD;;;GAGG;AACH,wBAAsB,iBAAiB,CACtC,OAAO,GAAE,wBAA6B,EACtC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC,uBAAuB,CAAC,CA8ElC"}
@@ -3,20 +3,19 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * Latin-script off-map outlier exposure for the #244 coarse-placer (milestone 3). M2's OTHER class
7
- * was trained on NON-Latin/non-CJK scripts (Cyrillic, Arabic, …) from WOF names, so off-map
8
- * COUNTRIES written in Latin script (Poland, Brazil, Mexico, …) still mis-place to a trained
9
- * Latin country (the "Latin-off-map residual"). The fix is REAL off-map addresses (not synthetic
10
- * name variants — see #564: synthetic mass fits its own quirks): assemble address strings from
11
- * the Overture per-country address parquet and append them as `country: "OTHER"`.
6
+ * Latin-script off-map outlier exposure for the coarse-placer. The `other` class is trained on
7
+ * non-Latin and non-CJK scripts (Cyrillic, Arabic, …) from WOF names, so off-map countries
8
+ * written in Latin script (Poland, Brazil, Mexico, …) still mis-place to a trained Latin country,
9
+ * the "Latin-off-map residual". The fix assembles real off-map addresses from the Overture
10
+ * per-country address parquet and appends them as `country: "other"`.
12
11
  *
13
- * Discipline: countries split into TRAIN (their rows feed train/val OTHER) and HELDOUT (rows go
14
- * ONLY to the dedicated test file), so we can measure generalization to off-map countries the
15
- * model never saw — not just memorization. The in-map test.jsonl is left UNTOUCHED so the
16
- * before/after in-map regression check stays clean; the Latin metric lives in its own file.
12
+ * Discipline: countries split into train (their rows feed train/val `other`) and heldout (rows go
13
+ * only to the dedicated test file), so generalization to off-map countries the model never saw
14
+ * stays measurable. The in-map test.jsonl is left untouched so the before/after in-map regression
15
+ * check stays clean. The Latin metric lives in its own file.
17
16
  *
18
- * Run AFTER build-dataset + the exposure outliers (it appends). Re-runnable: it rewrites the
19
- * dedicated test file and appends fresh OTHER rows (so don't run it twice onto the same splits
17
+ * Run after build-dataset + the exposure outliers (it appends). Re-runnable: it rewrites the
18
+ * dedicated test file and appends fresh `other` rows (so don't run it twice onto the same splits
20
19
  * without rebuilding train/val).
21
20
  *
22
21
  * Run: `mailwoman placer build-dataset --outliers latin [--per-country 6000] [--overture
@@ -24,25 +23,27 @@
24
23
  */
25
24
  import { resolvePath } from "path-ts";
26
25
  import { hashFNV1a } from "#coarse-placer/fnv-hash";
27
- import { assembleOutlierRow, collectOutlierRows, otherRowsJSONL } from "#coarse-placer/tools/outlier-rows";
28
- import { defaultDataDir } from "#coarse-placer/tools/paths";
26
+ import { dataRootPath } from "#data-root";
29
27
  import { errorMessage } from "#errors/schema";
30
- import { writeLocalTextFile, appendLocalTextFile } from "#fs/writers";
28
+ import { appendLocalTextFile, writeLocalJSONLFile } from "#fs/writers";
31
29
  import { OVERTURE_ADDRESSES_RELEASE } from "#overture-pins";
32
- import { dataRootPath } from "#utils";
30
+ import { assembleOutlierRow, collectOutlierRows, otherRowsJSONL } from "#tools/coarse-placer/outlier-rows";
31
+ import { defaultDataDir } from "#tools/coarse-placer/paths";
33
32
  /**
34
- * Off-map (NOT among the trained countries) and Latin-script. TRAIN feeds the OTHER class; HELDOUT is test-only — the
35
- * generalization probe (unseen off-map countries should still route OTHER). #743: PL/PT/CZ moved from OTHER to
36
- * FIRST-CLASS in-map countries (they're now in COARSE_CLASSES), so they're removed here — keeping them would feed
37
- * contradictory gold (the same address labelled both PL and OTHER). That leaves BR/MX as the Latin off-map TRAIN
38
- * exposure and CA/LI as the heldout probe (the hard near-twins of in-map US/DE — an honest worst case). The in-map
39
- * expansion itself shrinks the off-map Latin surface, and the bulk OTHER exposure is non-Latin (build-
40
- * outlier-exposure.ts), so the thinner Latin train set is acceptable; watch OTHER-Latin recall in the openset eval.
33
+ * Off-map (not among the trained countries) and Latin-script.
34
+ *
35
+ * Train feeds the `other` class.
36
+ * Heldout is test-only.
37
+ *
38
+ * BR/MX are the Latin off-map train exposure and CA/LI are the heldout probe,
39
+ * the hard near-twins of in-map US/DE.
40
+ * Watch other-Latin recall in the openset eval.
41
41
  */
42
42
  const TRAIN_COUNTRIES = ["BR", "MX"];
43
43
  const HELDOUT_COUNTRIES = ["CA", "LI"];
44
44
  /**
45
- * Address_levels arrives as a list (node-api) or its string repr; pull the value strings out.
45
+ * Address_levels arrives as a list (node-api) or its string repr.
46
+ * Pull the value strings out.
46
47
  */
47
48
  function levelValues(al) {
48
49
  if (Array.isArray(al))
@@ -67,7 +68,8 @@ function overtureLocality(r) {
67
68
  return (r.postal_city ? String(r.postal_city) : "") || levels.at(-1) || levels[0] || "";
68
69
  }
69
70
  /**
70
- * Coarse-placer Overture Latin-off-map outlier builder — see the module doc.
71
+ * Coarse-placer Overture Latin-off-map outlier builder.
72
+ * See the module doc.
71
73
  */
72
74
  export async function buildOutlierLatin(options = {}, report) {
73
75
  const PER = options.perCountry ?? 6000;
@@ -83,7 +85,7 @@ export async function buildOutlierLatin(options = {}, report) {
83
85
  res = await duck.runAndReadAll(`SELECT number, street, postcode, postal_city, address_levels FROM read_parquet('${f}') LIMIT ${PER}`);
84
86
  }
85
87
  catch (error) {
86
- // oxlint-disable-next-line mailwoman/prefer-spliterator -- An in-memory error message, not a file.
88
+ // oxlint-disable-next-line mailwoman/prefer-spliterator -- An in-memory error message rather than a file.
87
89
  report?.(` ${cc}: SKIP (${errorMessage(error).split("\n")[0]})`);
88
90
  return [];
89
91
  }
@@ -92,7 +94,6 @@ export async function buildOutlierLatin(options = {}, report) {
92
94
  const trainAppend = [];
93
95
  const valAppend = [];
94
96
  const testRows = [];
95
- // dedicated Latin off-map test: {raw, country:"OTHER", group, srcCountry}
96
97
  for (const cc of TRAIN_COUNTRIES) {
97
98
  const rows = (await rowsFor(cc)).toSorted((a, b) => hashFNV1a(a) - hashFNV1a(b));
98
99
  const nVal = Math.floor(rows.length * 0.1);
@@ -120,10 +121,9 @@ export async function buildOutlierLatin(options = {}, report) {
120
121
  }
121
122
  ;
122
123
  duck.disconnect?.();
123
- // Append OTHER rows to train/val; write the dedicated Latin off-map test file.
124
124
  await appendLocalTextFile(otherRowsJSONL(trainAppend), resolvePath(dataDir, "train.jsonl"));
125
125
  await appendLocalTextFile(otherRowsJSONL(valAppend), resolvePath(dataDir, "val.jsonl"));
126
- await writeLocalTextFile(testRows.map((r) => JSON.stringify(r)).join("\n") + "\n", resolvePath(dataDir, "test-latin-offmap-overture.jsonl"));
126
+ await writeLocalJSONLFile(testRows, resolvePath(dataDir, "test-latin-offmap-overture.jsonl"));
127
127
  report?.(`\nappended OTHER → train +${trainAppend.length}, val +${valAppend.length}`);
128
128
  report?.(`wrote test-latin-offmap-overture.jsonl: ${testRows.length} rows (indist ${testRows.filter((r) => r.group === "indist").length} / heldout ${testRows.filter((r) => r.group === "heldout").length})`);
129
129
  return { train: trainAppend.length, val: valAppend.length, test: testRows.length };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"latin.js","sourceRoot":"","sources":["../../../../../tools/coarse-placer/build/outlier/latin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,EAAwB,WAAW,EAAE,MAAM,SAAS,CAAA;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,gBAAgB,CAAA;AAC3D,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAC1G,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AA0C3D;;;;;;;;;GASG;AACH,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AACpC,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AAEtC;;;GAGG;AACH,SAAS,WAAW,CAAC,EAAW;IAC/B,IAAI,KAAK,CAA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0,0 +1,68 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ *
6
+ * OpenAddresses Latin-off-map outlier exposure for the coarse-placer. OpenAddresses covers far
7
+ * more countries than the Overture addresses theme, so this assembles address strings from OA's
8
+ * per-country CSVs and appends them as `country: "other"`.
9
+ *
10
+ * Discipline:
11
+ *
12
+ * - hold out whole language families (Nordic, Baltic, …) so a trained sibling's shared n-grams
13
+ * cannot rescue the generalization metric. Train families feed train/val/test(indist).
14
+ * Heldout families go only to the dedicated test file.
15
+ * - Schema variance: read via DuckDB read_csv_auto(..., union_by_name) so differing per-source OA
16
+ * schemas align. Assemble to the same format the in-map rows use (build-outlier-latin's
17
+ * assemble).
18
+ * - Dedup (per country) plus per-country CAP (downsample): PL/CZ dwarf others, so cap so `other`
19
+ * keeps a mixed country profile.
20
+ * - Country filter: only off-map countries (never the 11 in-map). The in-map test.jsonl is
21
+ * untouched.
22
+ *
23
+ * Run after build-dataset + the exposure outliers (it appends). Re-runnable: it rewrites the
24
+ * dedicated test file and appends fresh `other` rows. Rebuild train/val before re-running.
25
+ *
26
+ * Run: `mailwoman placer build-dataset --outliers oa --oa-dir <extracted-OA-root> [--per-country
27
+ * 6000]`
28
+ */
29
+ import { type PathBuilderLike } from "path-ts";
30
+ /**
31
+ * Options for {@linkcode buildOutlierOA}.
32
+ */
33
+ export interface BuildOutlierOAOptions {
34
+ /**
35
+ * Extracted OpenAddresses root.
36
+ *
37
+ * Default `$MAILWOMAN_DATA_ROOT/openaddresses/extracted`.
38
+ */
39
+ oaDir?: PathBuilderLike;
40
+ /**
41
+ * Row cap per off-map country.
42
+ *
43
+ * Default 6000.
44
+ */
45
+ perCountry?: number;
46
+ /**
47
+ * Dataset dir the `other` rows append to.
48
+ *
49
+ * Default `<repo>/data/coarse-placer`.
50
+ */
51
+ data?: PathBuilderLike;
52
+ }
53
+ /**
54
+ * Result of {@linkcode buildOutlierOA}.
55
+ */
56
+ export interface BuildOutlierOAResult {
57
+ train: number;
58
+ val: number;
59
+ test: number;
60
+ trainCountries: number;
61
+ heldoutCountries: number;
62
+ }
63
+ /**
64
+ * Coarse-placer OpenAddresses Latin-off-map outlier builder.
65
+ * See the module doc.
66
+ */
67
+ export declare function buildOutlierOA(options?: BuildOutlierOAOptions, report?: (line: string) => void): Promise<BuildOutlierOAResult>;
68
+ //# sourceMappingURL=oa.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oa.d.ts","sourceRoot":"","sources":["../../../../../tools/coarse-placer/build/outlier/oa.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,KAAK,eAAe,EAAe,MAAM,SAAS,CAAA;AAkB3D;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC;;;;OAIG;IACH,KAAK,CAAC,EAAE,eAAe,CAAA;IACvB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;OAIG;IACH,IAAI,CAAC,EAAE,eAAe,CAAA;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACpC,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,cAAc,EAAE,MAAM,CAAA;IACtB,gBAAgB,EAAE,MAAM,CAAA;CACxB;AA0CD;;;GAGG;AACH,wBAAsB,cAAc,CACnC,OAAO,GAAE,qBAA0B,EACnC,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAC7B,OAAO,CAAC,oBAAoB,CAAC,CAqH/B"}
@@ -3,49 +3,48 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * OpenAddresses Latin-off-map outlier exposure for the #244 coarse-placer (milestone 3, breadth).
7
- * The successor to build-outlier-latin.ts (Overture): Overture's ALPHA addresses theme only
8
- * carries real rows for ~7 off-map countries, so a model trained on them MEMORIZED rather than
9
- * learned an "off-map" boundary (night-15 finding). OpenAddresses covers far more countries —
10
- * this assembles address strings from OA's per-country CSVs and appends them as `country:
11
- * "OTHER"`.
6
+ * OpenAddresses Latin-off-map outlier exposure for the coarse-placer. OpenAddresses covers far
7
+ * more countries than the Overture addresses theme, so this assembles address strings from OA's
8
+ * per-country CSVs and appends them as `country: "other"`.
12
9
  *
13
- * Discipline (per the #244 scoping note + DeepSeek consult):
10
+ * Discipline:
14
11
  *
15
- * - LEAVE-ONE-LANGUAGE-FAMILY-OUT, not random: whole families are held out (Nordic, Baltic, …) so a
16
- * trained sibling's shared n-grams can't rescue the generalization metric. TRAIN families
17
- * feed train/val/test(indist); HELDOUT families go ONLY to the dedicated test file.
12
+ * - hold out whole language families (Nordic, Baltic, …) so a trained sibling's shared n-grams
13
+ * cannot rescue the generalization metric. Train families feed train/val/test(indist).
14
+ * Heldout families go only to the dedicated test file.
18
15
  * - Schema variance: read via DuckDB read_csv_auto(..., union_by_name) so differing per-source OA
19
- * schemas align; assemble to the SAME format the in-map rows use (build-outlier-latin's
16
+ * schemas align. Assemble to the same format the in-map rows use (build-outlier-latin's
20
17
  * assemble).
21
- * - Dedup (per country) + per-country CAP (downsample): PL/CZ dwarf others, so cap so OTHER isn't
22
- * "mostly Polish".
23
- * - Country filter: only OFF-MAP countries (never the 11 in-map); the in-map test.jsonl is untouched.
18
+ * - Dedup (per country) plus per-country CAP (downsample): PL/CZ dwarf others, so cap so `other`
19
+ * keeps a mixed country profile.
20
+ * - Country filter: only off-map countries (never the 11 in-map). The in-map test.jsonl is
21
+ * untouched.
24
22
  *
25
- * Run AFTER build-dataset + the exposure outliers (it APPENDS). Re-runnable: rewrites the
26
- * dedicated test file and appends fresh OTHER rows — rebuild train/val before re-running.
23
+ * Run after build-dataset + the exposure outliers (it appends). Re-runnable: it rewrites the
24
+ * dedicated test file and appends fresh `other` rows. Rebuild train/val before re-running.
27
25
  *
28
26
  * Run: `mailwoman placer build-dataset --outliers oa --oa-dir <extracted-OA-root> [--per-country
29
27
  * 6000]`
30
28
  */
31
29
  import { resolvePath } from "path-ts";
32
30
  import { hashFNV1a } from "#coarse-placer/fnv-hash";
33
- import { COUNTRIES } from "#coarse-placer/tools/country-sets";
34
- import { assembleOutlierRow, collectOutlierRows, otherRowsJSONL } from "#coarse-placer/tools/outlier-rows";
35
- import { defaultDataDir } from "#coarse-placer/tools/paths";
31
+ import { dataRootPath } from "#data-root";
36
32
  import { errorMessage } from "#errors/schema";
37
- import { writeLocalTextFile, appendLocalTextFile } from "#fs/writers";
38
- import { dataRootPath } from "#utils";
33
+ import { appendLocalTextFile, writeLocalJSONLFile } from "#fs/writers";
34
+ import { COUNTRIES } from "#tools/coarse-placer/country-sets";
35
+ import { assembleOutlierRow, collectOutlierRows, otherRowsJSONL } from "#tools/coarse-placer/outlier-rows";
36
+ import { defaultDataDir } from "#tools/coarse-placer/paths";
39
37
  /**
40
- * The in-map countries the coarse-placer routes to — never appear in OTHER.
38
+ * The in-map countries the coarse-placer routes to, never appear in `other`.
41
39
  */
42
40
  const IN_MAP = new Set(COUNTRIES);
43
41
  /**
44
- * Language/region families for the leave-one-family-out split. Off-map countries OA's europe+asia zips plausibly carry;
45
- * the actual TRAIN/HELDOUT set is intersected with what's on disk at runtime. HELDOUT families are the generalization
46
- * probe (the model never sees a single row from them). Off-map families, intersected at runtime with what OA's
47
- * europe+asia zips actually carry (verified on disk: ae at au be cz dk ee fi gr il is kw kz lt lu lv nc nz pl pt qa ro
48
- * sa se sg si sk).
42
+ * Language/region families for the leave-one-family-out split.
43
+ *
44
+ * Off-map countries that may appear in OA's europe+asia zips.
45
+ * The actual train/heldout set is intersected with what's on disk at runtime.
46
+ *
47
+ * Heldout families are the generalization probe, so the model never sees a row from them.
49
48
  */
50
49
  const FAMILIES = {
51
50
  slavic_latin: ["PL", "CZ", "SK", "SI"],
@@ -60,8 +59,11 @@ const FAMILIES = {
60
59
  middle_east: ["AE", "IL", "KW", "QA", "SA"],
61
60
  };
62
61
  /**
63
- * Leave-one-language-FAMILY-out probe (DeepSeek): hold out WHOLE families the model never sees a row from — Baltic
64
- * (Latin, distinct), Oceania (English-Latin, distinct), Middle-East (romanized non-Latin).
62
+ * Leave-one-language-family-out probe: hold out whole families the model never sees a row from.
63
+ *
64
+ * Baltic is distinct and uses Latin script.
65
+ * Oceania is distinct and uses English Latin script.
66
+ * The Middle East examples use romanized non-Latin scripts.
65
67
  */
66
68
  const HELDOUT_FAMILIES = new Set(["baltic", "oceania", "middle_east"]);
67
69
  /**
@@ -69,7 +71,8 @@ const HELDOUT_FAMILIES = new Set(["baltic", "oceania", "middle_east"]);
69
71
  */
70
72
  const oaLocality = (r) => (r.city ?? "").toString().trim();
71
73
  /**
72
- * Coarse-placer OpenAddresses Latin-off-map outlier builder — see the module doc.
74
+ * Coarse-placer OpenAddresses Latin-off-map outlier builder.
75
+ * See the module doc.
73
76
  */
74
77
  export async function buildOutlierOA(options = {}, report) {
75
78
  const oaDir = options.oaDir || dataRootPath("openaddresses", "extracted");
@@ -83,23 +86,26 @@ export async function buildOutlierOA(options = {}, report) {
83
86
  */
84
87
  async function rowsFor(cc) {
85
88
  const lc = cc.toLowerCase();
86
- // OA collected layout: `<cc>/[<region>/]<source>.csv` (country at root; `summary/` excluded by
87
- // rooting the glob at <cc>). `**` matches zero-or-more dirs → handles both flat + region-nested.
89
+ // OA collected layout: `<cc>/[<region>/]<source>.csv`
90
+ // (country at root; `summary/` excluded by rooting the glob at <cc>).
91
+ // `**` matches zero-or-more dirs → handles both flat + region-nested.
88
92
  const glob = resolvePath(oaDir, lc, "**", "*.csv");
89
93
  let res;
90
94
  try {
91
95
  res = await duck.runAndReadAll(
92
- // union_by_name aligns the differing per-source schemas; LOWER the header access so NUMBER /
93
- // number both resolve. Pull a generous superset, dedup+cap in JS.
96
+ // union_by_name aligns the differing per-source schemas.
97
+ // Lower the header access so number / number both resolve.
98
+ // Pull a generous superset, dedup+cap in JS.
94
99
  `SELECT COLUMNS('(?i)^(number|street|city|postcode)$') FROM read_csv_auto('${glob}', union_by_name=true, ignore_errors=true, sample_size=-1) LIMIT ${PER * 8}`);
95
100
  }
96
101
  catch (error) {
97
- // oxlint-disable-next-line mailwoman/prefer-spliterator -- An in-memory error message, not a file.
102
+ // oxlint-disable-next-line mailwoman/prefer-spliterator -- An in-memory error message rather than a file.
98
103
  report?.(` ${cc}: SKIP (${errorMessage(error).split("\n")[0]})`);
99
104
  return [];
100
105
  }
101
106
  const out = collectOutlierRows(res.getRowObjects().map((r) => {
102
- // COLUMNS() preserves source-case keys; normalize to lowercase access.
107
+ // columns() preserves source-case keys.
108
+ // Normalize to lowercase access.
103
109
  const row = {};
104
110
  for (const [k, v] of Object.entries(r)) {
105
111
  row[k.toLowerCase()] = v;
@@ -110,7 +116,7 @@ export async function buildOutlierOA(options = {}, report) {
110
116
  }
111
117
  const trainAppend = [];
112
118
  const valAppend = [];
113
- const testRows = []; // {raw, country:"OTHER", group, srcCountry, family}
119
+ const testRows = []; // {raw, country:"other", group, srcCountry, family}
114
120
  let trainCC = 0;
115
121
  let heldCC = 0;
116
122
  for (const [family, countries] of Object.entries(FAMILIES)) {
@@ -149,7 +155,7 @@ export async function buildOutlierOA(options = {}, report) {
149
155
  duck.disconnect?.();
150
156
  await appendLocalTextFile(otherRowsJSONL(trainAppend), resolvePath(dataDir, "train.jsonl"));
151
157
  await appendLocalTextFile(otherRowsJSONL(valAppend), resolvePath(dataDir, "val.jsonl"));
152
- await writeLocalTextFile(testRows.map((r) => JSON.stringify(r)).join("\n") + "\n", resolvePath(dataDir, "test-latin-offmap-oa.jsonl"));
158
+ await writeLocalJSONLFile(testRows, resolvePath(dataDir, "test-latin-offmap-oa.jsonl"));
153
159
  report?.(`\nTRAIN countries: ${trainCC} · HELDOUT countries: ${heldCC}`);
154
160
  report?.(`appended OTHER → train +${trainAppend.length}, val +${valAppend.length}`);
155
161
  report?.(`wrote test-latin-offmap-oa.jsonl: ${testRows.length} (indist ${testRows.filter((r) => r.group === "indist").length} / heldout ${testRows.filter((r) => r.group === "heldout").length})`);
@@ -0,0 +1 @@
1
+ {"version":3,"file":"oa.js","sourceRoot":"","sources":["../../../../../tools/coarse-placer/build/outlier/oa.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAwB,WAAW,EAAE,MAAM,SAAS,CAAA;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAA;AAC7D,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAC1G,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AA6C3D;;GAEG;AACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAS,SAAS,CAAC,CAAA;AAEzC;;;;;;;GAOG;AACH,MAAM,QAAQ,GAA6B;IAC1C,YAAY,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IACtC,cAAc,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;IAC5B,eAAe,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IACnC,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IAChC,QAAQ,EAAE,CAAC,IAAI,CAAC;IAChB,aAAa,EAAE,CAAC,IAAI,CAAC;IACrB,aAAa,EAAE,CAAC,IAAI,CAAC;IACrB,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;IAC1B,OAAO,EAAE,CAAC,IAAI,EAA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