@mailwoman/resolver-wof-sqlite 9.2.0 → 9.3.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 (488) hide show
  1. package/README.md +16 -19
  2. package/lib/address/index.ts +9 -0
  3. package/{address-point-interpolation.ts → lib/address/point-interpolation.ts} +24 -22
  4. package/{address-point-schema.ts → lib/address/point-schema.ts} +18 -4
  5. package/{address-point.ts → lib/address/point.ts} +89 -27
  6. package/{ancestry-backfill.ts → lib/ancestry/backfill.ts} +14 -19
  7. package/{ancestry.ts → lib/ancestry/index.ts} +5 -3
  8. package/{build-candidate.ts → lib/build-candidate.ts} +84 -77
  9. package/{build-slim.ts → lib/build-slim.ts} +150 -165
  10. package/{candidate → lib/candidate}/alias-bags.ts +8 -6
  11. package/{candidate → lib/candidate}/ancestors-sidecar.ts +13 -15
  12. package/{candidate → lib/candidate}/country-display-names.ts +2 -2
  13. package/{candidate/shard-fold.ts → lib/candidate/extract-fold.ts} +26 -25
  14. package/{candidate → lib/candidate}/name-roles.ts +17 -16
  15. package/{candidate → lib/candidate}/own-name.ts +1 -1
  16. package/{candidate → lib/candidate}/place-attrs.ts +3 -3
  17. package/{candidate-ancestors-schema.ts → lib/candidate-ancestors-schema.ts} +4 -4
  18. package/{candidate-fts.ts → lib/candidate-fts.ts} +3 -3
  19. package/{candidate-importance.ts → lib/candidate-importance.ts} +53 -57
  20. package/{candidate-lookup.ts → lib/candidate-lookup.ts} +76 -73
  21. package/{candidate-schema.ts → lib/candidate-schema.ts} +5 -5
  22. package/{candidate-scoring.ts → lib/candidate-scoring.ts} +15 -22
  23. package/{capital-schema.ts → lib/capital-schema.ts} +5 -6
  24. package/{capitals.ts → lib/capitals.ts} +2 -2
  25. package/{coincident-roles.ts → lib/coincident-roles.ts} +8 -11
  26. package/{convention.ts → lib/convention/index.ts} +3 -3
  27. package/{convention-schema.ts → lib/convention/schema.ts} +2 -2
  28. package/{coverage-manifest-schema.ts → lib/coverage-manifest-schema.ts} +9 -10
  29. package/{currency-backfill.ts → lib/currency-backfill.ts} +126 -41
  30. package/lib/env.ts +50 -0
  31. package/{exact-match.ts → lib/exact-match.ts} +23 -14
  32. package/{sharding.ts → lib/extracts.ts} +61 -58
  33. package/{fst-autocomplete.ts → lib/fst/autocomplete.ts} +4 -4
  34. package/{fst-builder.ts → lib/fst/builder.ts} +17 -16
  35. package/{fst-deserialize-web.ts → lib/fst/deserialize-web.ts} +27 -87
  36. package/lib/fst/format.ts +106 -0
  37. package/{fst-freshness.ts → lib/fst/freshness.ts} +41 -74
  38. package/lib/fst/index.ts +14 -0
  39. package/{fst-matcher.ts → lib/fst/matcher.ts} +1 -1
  40. package/{fst-serialize.ts → lib/fst/serialize.ts} +37 -115
  41. package/{fst-types.ts → lib/fst/types.ts} +4 -2
  42. package/{fts.ts → lib/fts/index.ts} +24 -19
  43. package/{fts-query.ts → lib/fts/query.ts} +1 -1
  44. package/{geonames-aliases.ts → lib/geonames/aliases.ts} +13 -13
  45. package/lib/geonames/index.ts +8 -0
  46. package/{geonames-postal.ts → lib/geonames/postal.ts} +14 -13
  47. package/{index.ts → lib/index.ts} +37 -37
  48. package/{interpolation.ts → lib/interpolation.ts} +27 -25
  49. package/{lookup.ts → lib/lookup.ts} +129 -141
  50. package/lib/nsul/index.ts +8 -0
  51. package/lib/nsul/lookup.ts +144 -0
  52. package/lib/nsul/schema.ts +130 -0
  53. package/{place-importance-schema.ts → lib/place-importance-schema.ts} +7 -8
  54. package/lib/poi/index.ts +8 -0
  55. package/{poi-lookup.ts → lib/poi/lookup.ts} +22 -28
  56. package/{poi-schema.ts → lib/poi/schema.ts} +3 -4
  57. package/{postal-city-alias-lookup.ts → lib/postal/city-alias-lookup.ts} +14 -20
  58. package/{postal-city-candidate-schema.ts → lib/postal/city-candidate-schema.ts} +2 -2
  59. package/lib/postal/index.ts +9 -0
  60. package/{postcode-point-lookup.ts → lib/postcode-point-lookup.ts} +17 -15
  61. package/{primary-preference.ts → lib/primary-preference.ts} +29 -10
  62. package/{proximity-rerank.ts → lib/proximity-rerank.ts} +2 -2
  63. package/{ranking-weights.ts → lib/ranking-weights.ts} +30 -4
  64. package/{region-keys.ts → lib/region-keys.ts} +9 -9
  65. package/{reverse.ts → lib/reverse.ts} +34 -46
  66. package/{schema.ts → lib/schema.ts} +10 -0
  67. package/{search-fetch.ts → lib/search-fetch.ts} +29 -28
  68. package/{sqlite-convention-source.ts → lib/sqlite-convention-source.ts} +9 -10
  69. package/{sqlite-utils.ts → lib/sqlite-utils.ts} +14 -18
  70. package/{street-centroid-schema.ts → lib/street/centroid-schema.ts} +5 -5
  71. package/{street-centroid.ts → lib/street/centroid.ts} +14 -21
  72. package/lib/street/index.ts +13 -0
  73. package/{street-morphology-fst-builder.ts → lib/street/morphology-fst-builder.ts} +24 -14
  74. package/{street-morphology-fst-loader.ts → lib/street/morphology-fst-loader.ts} +14 -12
  75. package/{street-name-lookup.ts → lib/street/name-lookup.ts} +14 -30
  76. package/{street-normalize.ts → lib/street/normalize.ts} +44 -19
  77. package/{street-segment-schema.ts → lib/street/segment-schema.ts} +7 -7
  78. package/{types.ts → lib/types.ts} +18 -12
  79. package/{unified-schema.ts → lib/unified-schema.ts} +20 -24
  80. package/lib/uprn/existence.ts +84 -0
  81. package/lib/uprn/index.ts +9 -0
  82. package/{uprn-lookup.ts → lib/uprn/lookup.ts} +14 -18
  83. package/{uprn-schema.ts → lib/uprn/schema.ts} +3 -3
  84. package/lib/weights-overlay-linker.ts +878 -0
  85. package/out/address/index.d.ts +9 -0
  86. package/out/address/index.d.ts.map +1 -0
  87. package/out/address/index.js +9 -0
  88. package/out/address/index.js.map +1 -0
  89. package/out/{address-point-interpolation.d.ts → address/point-interpolation.d.ts} +11 -10
  90. package/out/address/point-interpolation.d.ts.map +1 -0
  91. package/out/{address-point-interpolation.js → address/point-interpolation.js} +18 -18
  92. package/out/address/point-interpolation.js.map +1 -0
  93. package/out/{address-point-schema.d.ts → address/point-schema.d.ts} +16 -6
  94. package/out/address/point-schema.d.ts.map +1 -0
  95. package/out/{address-point-schema.js → address/point-schema.js} +7 -3
  96. package/out/address/point-schema.js.map +1 -0
  97. package/out/{address-point.d.ts → address/point.d.ts} +16 -8
  98. package/out/address/point.d.ts.map +1 -0
  99. package/out/{address-point.js → address/point.js} +71 -20
  100. package/out/address/point.js.map +1 -0
  101. package/out/{ancestry-backfill.d.ts → ancestry/backfill.d.ts} +7 -5
  102. package/out/ancestry/backfill.d.ts.map +1 -0
  103. package/out/{ancestry-backfill.js → ancestry/backfill.js} +12 -16
  104. package/out/ancestry/backfill.js.map +1 -0
  105. package/out/{ancestry.d.ts → ancestry/index.d.ts} +4 -3
  106. package/out/ancestry/index.d.ts.map +1 -0
  107. package/out/{ancestry.js → ancestry/index.js} +3 -2
  108. package/out/ancestry/index.js.map +1 -0
  109. package/out/build-candidate.d.ts +30 -24
  110. package/out/build-candidate.d.ts.map +1 -1
  111. package/out/build-candidate.js +50 -52
  112. package/out/build-candidate.js.map +1 -1
  113. package/out/build-slim.d.ts +4 -4
  114. package/out/build-slim.d.ts.map +1 -1
  115. package/out/build-slim.js +124 -139
  116. package/out/build-slim.js.map +1 -1
  117. package/out/candidate/alias-bags.d.ts +5 -3
  118. package/out/candidate/alias-bags.d.ts.map +1 -1
  119. package/out/candidate/alias-bags.js +2 -2
  120. package/out/candidate/alias-bags.js.map +1 -1
  121. package/out/candidate/ancestors-sidecar.d.ts +9 -10
  122. package/out/candidate/ancestors-sidecar.d.ts.map +1 -1
  123. package/out/candidate/ancestors-sidecar.js +7 -7
  124. package/out/candidate/ancestors-sidecar.js.map +1 -1
  125. package/out/candidate/country-display-names.d.ts +1 -1
  126. package/out/candidate/country-display-names.d.ts.map +1 -1
  127. package/out/candidate/country-display-names.js +1 -1
  128. package/out/candidate/country-display-names.js.map +1 -1
  129. package/out/candidate/extract-fold.d.ts +32 -0
  130. package/out/candidate/extract-fold.d.ts.map +1 -0
  131. package/out/candidate/{shard-fold.js → extract-fold.js} +20 -20
  132. package/out/candidate/extract-fold.js.map +1 -0
  133. package/out/candidate/name-roles.d.ts +13 -11
  134. package/out/candidate/name-roles.d.ts.map +1 -1
  135. package/out/candidate/name-roles.js +11 -10
  136. package/out/candidate/name-roles.js.map +1 -1
  137. package/out/candidate/own-name.d.ts +1 -1
  138. package/out/candidate/own-name.d.ts.map +1 -1
  139. package/out/candidate/own-name.js +1 -1
  140. package/out/candidate/own-name.js.map +1 -1
  141. package/out/candidate/place-attrs.d.ts +3 -3
  142. package/out/candidate/place-attrs.d.ts.map +1 -1
  143. package/out/candidate/place-attrs.js +1 -1
  144. package/out/candidate/place-attrs.js.map +1 -1
  145. package/out/candidate-ancestors-schema.d.ts +4 -4
  146. package/out/candidate-ancestors-schema.d.ts.map +1 -1
  147. package/out/candidate-ancestors-schema.js +2 -2
  148. package/out/candidate-ancestors-schema.js.map +1 -1
  149. package/out/candidate-fts.d.ts +3 -3
  150. package/out/candidate-fts.d.ts.map +1 -1
  151. package/out/candidate-fts.js +1 -1
  152. package/out/candidate-fts.js.map +1 -1
  153. package/out/candidate-importance.d.ts +16 -16
  154. package/out/candidate-importance.d.ts.map +1 -1
  155. package/out/candidate-importance.js +46 -51
  156. package/out/candidate-importance.js.map +1 -1
  157. package/out/candidate-lookup.d.ts +11 -9
  158. package/out/candidate-lookup.d.ts.map +1 -1
  159. package/out/candidate-lookup.js +61 -58
  160. package/out/candidate-lookup.js.map +1 -1
  161. package/out/candidate-schema.d.ts +5 -5
  162. package/out/candidate-schema.d.ts.map +1 -1
  163. package/out/candidate-schema.js.map +1 -1
  164. package/out/candidate-scoring.d.ts +7 -7
  165. package/out/candidate-scoring.d.ts.map +1 -1
  166. package/out/candidate-scoring.js +10 -14
  167. package/out/candidate-scoring.js.map +1 -1
  168. package/out/capital-schema.d.ts +3 -3
  169. package/out/capital-schema.d.ts.map +1 -1
  170. package/out/capital-schema.js +2 -2
  171. package/out/capital-schema.js.map +1 -1
  172. package/out/capitals.d.ts +1 -1
  173. package/out/capitals.d.ts.map +1 -1
  174. package/out/capitals.js +2 -2
  175. package/out/capitals.js.map +1 -1
  176. package/out/coincident-roles.d.ts +6 -5
  177. package/out/coincident-roles.d.ts.map +1 -1
  178. package/out/coincident-roles.js +2 -4
  179. package/out/coincident-roles.js.map +1 -1
  180. package/out/{convention.d.ts → convention/index.d.ts} +4 -4
  181. package/out/convention/index.d.ts.map +1 -0
  182. package/out/{convention.js → convention/index.js} +2 -2
  183. package/out/convention/index.js.map +1 -0
  184. package/out/{convention-schema.d.ts → convention/schema.d.ts} +2 -2
  185. package/out/convention/schema.d.ts.map +1 -0
  186. package/out/{convention-schema.js → convention/schema.js} +3 -3
  187. package/out/convention/schema.js.map +1 -0
  188. package/out/coverage-manifest-schema.d.ts +8 -8
  189. package/out/coverage-manifest-schema.d.ts.map +1 -1
  190. package/out/coverage-manifest-schema.js +4 -4
  191. package/out/coverage-manifest-schema.js.map +1 -1
  192. package/out/currency-backfill.d.ts +51 -7
  193. package/out/currency-backfill.d.ts.map +1 -1
  194. package/out/currency-backfill.js +65 -49
  195. package/out/currency-backfill.js.map +1 -1
  196. package/out/env.d.ts +43 -0
  197. package/out/env.d.ts.map +1 -0
  198. package/out/env.js +48 -0
  199. package/out/env.js.map +1 -0
  200. package/out/exact-match.d.ts +5 -5
  201. package/out/exact-match.d.ts.map +1 -1
  202. package/out/exact-match.js +10 -11
  203. package/out/exact-match.js.map +1 -1
  204. package/out/extracts.d.ts +114 -0
  205. package/out/extracts.d.ts.map +1 -0
  206. package/out/{sharding.js → extracts.js} +38 -38
  207. package/out/extracts.js.map +1 -0
  208. package/out/{fst-autocomplete.d.ts → fst/autocomplete.d.ts} +2 -2
  209. package/out/fst/autocomplete.d.ts.map +1 -0
  210. package/out/{fst-autocomplete.js → fst/autocomplete.js} +3 -3
  211. package/out/fst/autocomplete.js.map +1 -0
  212. package/out/{fst-builder.d.ts → fst/builder.d.ts} +5 -5
  213. package/out/fst/builder.d.ts.map +1 -0
  214. package/out/{fst-builder.js → fst/builder.js} +14 -13
  215. package/out/fst/builder.js.map +1 -0
  216. package/out/{fst-deserialize-web.d.ts → fst/deserialize-web.d.ts} +3 -3
  217. package/out/fst/deserialize-web.d.ts.map +1 -0
  218. package/out/{fst-deserialize-web.js → fst/deserialize-web.js} +10 -74
  219. package/out/fst/deserialize-web.js.map +1 -0
  220. package/out/fst/format.d.ts +80 -0
  221. package/out/fst/format.d.ts.map +1 -0
  222. package/out/fst/format.js +91 -0
  223. package/out/fst/format.js.map +1 -0
  224. package/out/{fst-freshness.d.ts → fst/freshness.d.ts} +10 -13
  225. package/out/fst/freshness.d.ts.map +1 -0
  226. package/out/{fst-freshness.js → fst/freshness.js} +41 -73
  227. package/out/fst/freshness.js.map +1 -0
  228. package/out/fst/index.d.ts +14 -0
  229. package/out/fst/index.d.ts.map +1 -0
  230. package/out/fst/index.js +14 -0
  231. package/out/fst/index.js.map +1 -0
  232. package/out/{fst-matcher.d.ts → fst/matcher.d.ts} +2 -2
  233. package/out/fst/matcher.d.ts.map +1 -0
  234. package/out/{fst-matcher.js → fst/matcher.js} +1 -1
  235. package/out/fst/matcher.js.map +1 -0
  236. package/out/{fst-serialize.d.ts → fst/serialize.d.ts} +5 -10
  237. package/out/fst/serialize.d.ts.map +1 -0
  238. package/out/{fst-serialize.js → fst/serialize.js} +18 -98
  239. package/out/fst/serialize.js.map +1 -0
  240. package/out/{fst-types.d.ts → fst/types.d.ts} +4 -3
  241. package/out/fst/types.d.ts.map +1 -0
  242. package/out/{fst-types.js → fst/types.js} +1 -1
  243. package/out/fst/types.js.map +1 -0
  244. package/out/{fts.d.ts → fts/index.d.ts} +16 -9
  245. package/out/fts/index.d.ts.map +1 -0
  246. package/out/{fts.js → fts/index.js} +16 -11
  247. package/out/fts/index.js.map +1 -0
  248. package/out/{fts-query.d.ts → fts/query.d.ts} +2 -2
  249. package/out/fts/query.d.ts.map +1 -0
  250. package/out/{fts-query.js → fts/query.js} +1 -1
  251. package/out/fts/query.js.map +1 -0
  252. package/out/{geonames-aliases.d.ts → geonames/aliases.d.ts} +8 -6
  253. package/out/geonames/aliases.d.ts.map +1 -0
  254. package/out/{geonames-aliases.js → geonames/aliases.js} +7 -7
  255. package/out/geonames/aliases.js.map +1 -0
  256. package/out/geonames/index.d.ts +8 -0
  257. package/out/geonames/index.d.ts.map +1 -0
  258. package/out/geonames/index.js +8 -0
  259. package/out/geonames/index.js.map +1 -0
  260. package/out/{geonames-postal.d.ts → geonames/postal.d.ts} +10 -8
  261. package/out/geonames/postal.d.ts.map +1 -0
  262. package/out/{geonames-postal.js → geonames/postal.js} +9 -9
  263. package/out/geonames/postal.js.map +1 -0
  264. package/out/index.d.ts +32 -32
  265. package/out/index.d.ts.map +1 -1
  266. package/out/index.js +24 -24
  267. package/out/index.js.map +1 -1
  268. package/out/interpolation.d.ts +10 -9
  269. package/out/interpolation.d.ts.map +1 -1
  270. package/out/interpolation.js +20 -20
  271. package/out/interpolation.js.map +1 -1
  272. package/out/lookup.d.ts +21 -20
  273. package/out/lookup.d.ts.map +1 -1
  274. package/out/lookup.js +102 -112
  275. package/out/lookup.js.map +1 -1
  276. package/out/name-score.d.ts.map +1 -1
  277. package/out/name-score.js.map +1 -1
  278. package/out/nsul/index.d.ts +8 -0
  279. package/out/nsul/index.d.ts.map +1 -0
  280. package/out/nsul/index.js +8 -0
  281. package/out/nsul/index.js.map +1 -0
  282. package/out/nsul/lookup.d.ts +83 -0
  283. package/out/nsul/lookup.d.ts.map +1 -0
  284. package/out/nsul/lookup.js +80 -0
  285. package/out/nsul/lookup.js.map +1 -0
  286. package/out/nsul/schema.d.ts +100 -0
  287. package/out/nsul/schema.d.ts.map +1 -0
  288. package/out/nsul/schema.js +78 -0
  289. package/out/nsul/schema.js.map +1 -0
  290. package/out/place-importance-schema.d.ts +5 -5
  291. package/out/place-importance-schema.d.ts.map +1 -1
  292. package/out/place-importance-schema.js +3 -3
  293. package/out/place-importance-schema.js.map +1 -1
  294. package/out/poi/index.d.ts +8 -0
  295. package/out/poi/index.d.ts.map +1 -0
  296. package/out/poi/index.js +8 -0
  297. package/out/poi/index.js.map +1 -0
  298. package/out/{poi-lookup.d.ts → poi/lookup.d.ts} +8 -10
  299. package/out/poi/lookup.d.ts.map +1 -0
  300. package/out/{poi-lookup.js → poi/lookup.js} +14 -18
  301. package/out/poi/lookup.js.map +1 -0
  302. package/out/{poi-schema.d.ts → poi/schema.d.ts} +4 -4
  303. package/out/poi/schema.d.ts.map +1 -0
  304. package/out/{poi-schema.js → poi/schema.js} +1 -1
  305. package/out/poi/schema.js.map +1 -0
  306. package/out/polygon-schema.d.ts.map +1 -1
  307. package/out/polygon-schema.js.map +1 -1
  308. package/out/{postal-city-alias-lookup.d.ts → postal/city-alias-lookup.d.ts} +6 -5
  309. package/out/postal/city-alias-lookup.d.ts.map +1 -0
  310. package/out/{postal-city-alias-lookup.js → postal/city-alias-lookup.js} +11 -15
  311. package/out/postal/city-alias-lookup.js.map +1 -0
  312. package/out/{postal-city-alias-schema.d.ts → postal/city-alias-schema.d.ts} +1 -1
  313. package/out/{postal-city-alias-schema.d.ts.map → postal/city-alias-schema.d.ts.map} +1 -1
  314. package/out/{postal-city-alias-schema.js → postal/city-alias-schema.js} +1 -1
  315. package/out/{postal-city-alias-schema.js.map → postal/city-alias-schema.js.map} +1 -1
  316. package/out/{postal-city-candidate-schema.d.ts → postal/city-candidate-schema.d.ts} +3 -3
  317. package/out/{postal-city-candidate-schema.d.ts.map → postal/city-candidate-schema.d.ts.map} +1 -1
  318. package/out/{postal-city-candidate-schema.js → postal/city-candidate-schema.js} +2 -2
  319. package/out/{postal-city-candidate-schema.js.map → postal/city-candidate-schema.js.map} +1 -1
  320. package/out/postal/index.d.ts +9 -0
  321. package/out/postal/index.d.ts.map +1 -0
  322. package/out/postal/index.js +9 -0
  323. package/out/postal/index.js.map +1 -0
  324. package/out/postcode-point-lookup.d.ts +10 -10
  325. package/out/postcode-point-lookup.d.ts.map +1 -1
  326. package/out/postcode-point-lookup.js +13 -13
  327. package/out/postcode-point-lookup.js.map +1 -1
  328. package/out/primary-preference.d.ts +13 -5
  329. package/out/primary-preference.d.ts.map +1 -1
  330. package/out/primary-preference.js +16 -8
  331. package/out/primary-preference.js.map +1 -1
  332. package/out/proximity-rerank.d.ts +2 -2
  333. package/out/proximity-rerank.d.ts.map +1 -1
  334. package/out/proximity-rerank.js +2 -2
  335. package/out/proximity-rerank.js.map +1 -1
  336. package/out/ranking-weights.d.ts +15 -3
  337. package/out/ranking-weights.d.ts.map +1 -1
  338. package/out/ranking-weights.js +21 -3
  339. package/out/ranking-weights.js.map +1 -1
  340. package/out/region-keys.d.ts +8 -8
  341. package/out/region-keys.d.ts.map +1 -1
  342. package/out/region-keys.js +9 -9
  343. package/out/region-keys.js.map +1 -1
  344. package/out/reverse.d.ts +6 -6
  345. package/out/reverse.d.ts.map +1 -1
  346. package/out/reverse.js +20 -29
  347. package/out/reverse.js.map +1 -1
  348. package/out/schema.d.ts +9 -0
  349. package/out/schema.d.ts.map +1 -1
  350. package/out/schema.js.map +1 -1
  351. package/out/search-fetch.d.ts +12 -10
  352. package/out/search-fetch.d.ts.map +1 -1
  353. package/out/search-fetch.js +21 -20
  354. package/out/search-fetch.js.map +1 -1
  355. package/out/sqlite-convention-source.d.ts +7 -7
  356. package/out/sqlite-convention-source.d.ts.map +1 -1
  357. package/out/sqlite-convention-source.js +5 -5
  358. package/out/sqlite-convention-source.js.map +1 -1
  359. package/out/sqlite-utils.d.ts +8 -8
  360. package/out/sqlite-utils.d.ts.map +1 -1
  361. package/out/sqlite-utils.js +7 -8
  362. package/out/sqlite-utils.js.map +1 -1
  363. package/out/{street-centroid-schema.d.ts → street/centroid-schema.d.ts} +6 -6
  364. package/out/{street-centroid-schema.d.ts.map → street/centroid-schema.d.ts.map} +1 -1
  365. package/out/{street-centroid-schema.js → street/centroid-schema.js} +5 -5
  366. package/out/{street-centroid-schema.js.map → street/centroid-schema.js.map} +1 -1
  367. package/out/{street-centroid.d.ts → street/centroid.d.ts} +6 -6
  368. package/out/street/centroid.d.ts.map +1 -0
  369. package/out/{street-centroid.js → street/centroid.js} +13 -19
  370. package/out/street/centroid.js.map +1 -0
  371. package/out/street/index.d.ts +13 -0
  372. package/out/street/index.d.ts.map +1 -0
  373. package/out/street/index.js +13 -0
  374. package/out/street/index.js.map +1 -0
  375. package/out/{street-morphology-fst-builder.d.ts → street/morphology-fst-builder.d.ts} +4 -4
  376. package/out/street/morphology-fst-builder.d.ts.map +1 -0
  377. package/out/{street-morphology-fst-builder.js → street/morphology-fst-builder.js} +18 -13
  378. package/out/street/morphology-fst-builder.js.map +1 -0
  379. package/out/{street-morphology-fst-loader.d.ts → street/morphology-fst-loader.d.ts} +5 -5
  380. package/out/street/morphology-fst-loader.d.ts.map +1 -0
  381. package/out/{street-morphology-fst-loader.js → street/morphology-fst-loader.js} +11 -10
  382. package/out/street/morphology-fst-loader.js.map +1 -0
  383. package/out/{street-name-lookup.d.ts → street/name-lookup.d.ts} +4 -7
  384. package/out/street/name-lookup.d.ts.map +1 -0
  385. package/out/{street-name-lookup.js → street/name-lookup.js} +9 -23
  386. package/out/street/name-lookup.js.map +1 -0
  387. package/out/{street-normalize.d.ts → street/normalize.d.ts} +25 -14
  388. package/out/street/normalize.d.ts.map +1 -0
  389. package/out/{street-normalize.js → street/normalize.js} +36 -17
  390. package/out/street/normalize.js.map +1 -0
  391. package/out/{street-segment-schema.d.ts → street/segment-schema.d.ts} +8 -8
  392. package/out/{street-segment-schema.d.ts.map → street/segment-schema.d.ts.map} +1 -1
  393. package/out/{street-segment-schema.js → street/segment-schema.js} +4 -4
  394. package/out/{street-segment-schema.js.map → street/segment-schema.js.map} +1 -1
  395. package/out/types.d.ts +18 -12
  396. package/out/types.d.ts.map +1 -1
  397. package/out/types.js.map +1 -1
  398. package/out/unified-schema.d.ts +5 -4
  399. package/out/unified-schema.d.ts.map +1 -1
  400. package/out/unified-schema.js +15 -18
  401. package/out/unified-schema.js.map +1 -1
  402. package/out/uprn/existence.d.ts +53 -0
  403. package/out/uprn/existence.d.ts.map +1 -0
  404. package/out/uprn/existence.js +61 -0
  405. package/out/uprn/existence.js.map +1 -0
  406. package/out/uprn/index.d.ts +9 -0
  407. package/out/uprn/index.d.ts.map +1 -0
  408. package/out/uprn/index.js +9 -0
  409. package/out/uprn/index.js.map +1 -0
  410. package/out/{uprn-lookup.d.ts → uprn/lookup.d.ts} +4 -4
  411. package/out/uprn/lookup.d.ts.map +1 -0
  412. package/out/{uprn-lookup.js → uprn/lookup.js} +11 -14
  413. package/out/uprn/lookup.js.map +1 -0
  414. package/out/{uprn-schema.d.ts → uprn/schema.d.ts} +4 -4
  415. package/out/uprn/schema.d.ts.map +1 -0
  416. package/out/{uprn-schema.js → uprn/schema.js} +4 -4
  417. package/out/uprn/schema.js.map +1 -0
  418. package/out/weights-overlay-linker.d.ts +184 -26
  419. package/out/weights-overlay-linker.d.ts.map +1 -1
  420. package/out/weights-overlay-linker.js +338 -86
  421. package/out/weights-overlay-linker.js.map +1 -1
  422. package/package.json +465 -269
  423. package/out/address-point-interpolation.d.ts.map +0 -1
  424. package/out/address-point-interpolation.js.map +0 -1
  425. package/out/address-point-schema.d.ts.map +0 -1
  426. package/out/address-point-schema.js.map +0 -1
  427. package/out/address-point.d.ts.map +0 -1
  428. package/out/address-point.js.map +0 -1
  429. package/out/ancestry-backfill.d.ts.map +0 -1
  430. package/out/ancestry-backfill.js.map +0 -1
  431. package/out/ancestry.d.ts.map +0 -1
  432. package/out/ancestry.js.map +0 -1
  433. package/out/candidate/shard-fold.d.ts +0 -31
  434. package/out/candidate/shard-fold.d.ts.map +0 -1
  435. package/out/candidate/shard-fold.js.map +0 -1
  436. package/out/convention-schema.d.ts.map +0 -1
  437. package/out/convention-schema.js.map +0 -1
  438. package/out/convention.d.ts.map +0 -1
  439. package/out/convention.js.map +0 -1
  440. package/out/fst-autocomplete.d.ts.map +0 -1
  441. package/out/fst-autocomplete.js.map +0 -1
  442. package/out/fst-builder.d.ts.map +0 -1
  443. package/out/fst-builder.js.map +0 -1
  444. package/out/fst-deserialize-web.d.ts.map +0 -1
  445. package/out/fst-deserialize-web.js.map +0 -1
  446. package/out/fst-freshness.d.ts.map +0 -1
  447. package/out/fst-freshness.js.map +0 -1
  448. package/out/fst-matcher.d.ts.map +0 -1
  449. package/out/fst-matcher.js.map +0 -1
  450. package/out/fst-serialize.d.ts.map +0 -1
  451. package/out/fst-serialize.js.map +0 -1
  452. package/out/fst-types.d.ts.map +0 -1
  453. package/out/fst-types.js.map +0 -1
  454. package/out/fts-query.d.ts.map +0 -1
  455. package/out/fts-query.js.map +0 -1
  456. package/out/fts.d.ts.map +0 -1
  457. package/out/fts.js.map +0 -1
  458. package/out/geonames-aliases.d.ts.map +0 -1
  459. package/out/geonames-aliases.js.map +0 -1
  460. package/out/geonames-postal.d.ts.map +0 -1
  461. package/out/geonames-postal.js.map +0 -1
  462. package/out/poi-lookup.d.ts.map +0 -1
  463. package/out/poi-lookup.js.map +0 -1
  464. package/out/poi-schema.d.ts.map +0 -1
  465. package/out/poi-schema.js.map +0 -1
  466. package/out/postal-city-alias-lookup.d.ts.map +0 -1
  467. package/out/postal-city-alias-lookup.js.map +0 -1
  468. package/out/sharding.d.ts +0 -114
  469. package/out/sharding.d.ts.map +0 -1
  470. package/out/sharding.js.map +0 -1
  471. package/out/street-centroid.d.ts.map +0 -1
  472. package/out/street-centroid.js.map +0 -1
  473. package/out/street-morphology-fst-builder.d.ts.map +0 -1
  474. package/out/street-morphology-fst-builder.js.map +0 -1
  475. package/out/street-morphology-fst-loader.d.ts.map +0 -1
  476. package/out/street-morphology-fst-loader.js.map +0 -1
  477. package/out/street-name-lookup.d.ts.map +0 -1
  478. package/out/street-name-lookup.js.map +0 -1
  479. package/out/street-normalize.d.ts.map +0 -1
  480. package/out/street-normalize.js.map +0 -1
  481. package/out/uprn-lookup.d.ts.map +0 -1
  482. package/out/uprn-lookup.js.map +0 -1
  483. package/out/uprn-schema.d.ts.map +0 -1
  484. package/out/uprn-schema.js.map +0 -1
  485. package/weights-overlay-linker.ts +0 -377
  486. /package/{name-score.ts → lib/name-score.ts} +0 -0
  487. /package/{polygon-schema.ts → lib/polygon-schema.ts} +0 -0
  488. /package/{postal-city-alias-schema.ts → lib/postal/city-alias-schema.ts} +0 -0
@@ -2,39 +2,46 @@
2
2
  * @copyright Sister Software
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
- * Shared development tooling for weights overlays: the symlink primitives every overlay linker uses, and the
6
- * placetype-pair index build.
5
+ * Shared development tooling for weights overlays: the symlink primitives every overlay linker uses, the
6
+ * placetype-pair index build, and the manifest form ({@link materializeDevOverlay}) each locale's
7
+ * `scripts/link-dev-weights.ts` declares itself in.
7
8
  */
8
- import { spawnSync } from "node:child_process";
9
- import { existsSync, lstatSync, mkdirSync, readFileSync, renameSync, statSync, symlinkSync, unlinkSync, writeFileSync, } from "node:fs";
10
- import { resolve } from "node:path";
11
- import { parseJSONStrict } from "@mailwoman/core/objects";
12
- import { dataRootPath, md5File, weightsOverlayPath, workspacePath } from "@mailwoman/core/utils";
13
- import { fstFreshnessWarning } from "./fst-freshness.js";
9
+ import { dataRootPath } from "@mailwoman/core/data-root";
10
+ import { pathExists, readLocalJSONFile, readLocalTextFile, statPath, readLocalBuffer, statLink, } from "@mailwoman/core/fs/readers";
11
+ import { createSymbolicLink, makeDirectories, movePath, removePath, writeLocalTextFile, } from "@mailwoman/core/fs/writers";
12
+ import { md5File } from "@mailwoman/core/hash";
13
+ import { parseJSONStrict } from "@mailwoman/core/json";
14
+ import { repoRootPath, workspacePath } from "@mailwoman/core/paths";
15
+ import { spawnProcessSync } from "@mailwoman/core/process";
16
+ import { readReleaseConfig, repoCommittedSoftFeedSources } from "@mailwoman/core/release-config";
17
+ import { weightsOverlayPath } from "@mailwoman/core/utils";
18
+ import { resolvePath } from "path-ts";
19
+ import { $public } from "#env";
20
+ import { fstFreshnessWarning } from "#fst/freshness";
14
21
  /**
15
22
  * Replicate `ln -sf SRC DEST` ATOMICALLY: symlink under a temp name, then rename over the destination. A plain
16
23
  * unlink-then-symlink leaves a no-file window that concurrent vitest workers can hit mid-suite — bit CI on 2026-07-24.
17
24
  * rename(2) replaces the destination atomically.
18
25
  */
19
- export function linkForce(src, dest) {
26
+ export async function linkForce(src, dest) {
20
27
  const tmp = `${dest}.tmp-link`;
21
- if (existsSync(tmp)) {
22
- unlinkSync(tmp);
28
+ if (await pathExists(tmp)) {
29
+ await removePath(tmp);
23
30
  }
24
- symlinkSync(src, tmp);
25
- renameSync(tmp, dest);
31
+ await createSymbolicLink(src, tmp);
32
+ await movePath(tmp, dest);
26
33
  }
27
34
  /**
28
35
  * Remove a leftover local file/symlink so the #1179 base-weights fallback engages.
29
36
  */
30
- export function removeIfPresent(dest) {
37
+ export async function removeIfPresent(dest) {
31
38
  try {
32
- lstatSync(dest);
39
+ await statLink(dest);
33
40
  }
34
41
  catch {
35
42
  return;
36
43
  }
37
- unlinkSync(dest);
44
+ await removePath(dest);
38
45
  console.log(`removed stale local ${dest} (base fallback to en-us engages)`);
39
46
  }
40
47
  /**
@@ -44,15 +51,32 @@ export function removeIfPresent(dest) {
44
51
  * has not built the gazetteer still geocodes. That is why the miss prints the consequence instead of throwing: the
45
52
  * operator needs to know which channel just resolved OFF, not to have the link step abort.
46
53
  */
47
- export function linkSoftFeedSibling(source, destination, consequenceIfMissing) {
48
- if (!existsSync(source)) {
54
+ export async function linkSoftFeedSibling(source, destination, consequenceIfMissing) {
55
+ if (!(await pathExists(source))) {
49
56
  console.error(`WARNING: missing ${source} — ${consequenceIfMissing}`);
50
57
  return false;
51
58
  }
52
- linkForce(source, destination);
59
+ await linkForce(source, destination);
53
60
  console.log(`linked ${destination} \u2190 ${source}`);
54
61
  return true;
55
62
  }
63
+ /**
64
+ * The calibrated pair-index emission bias every shipped artifact is built at today — the R5/R6/R9/R10/R11 bars were all
65
+ * measured at δ=10 (each linker's own docstring carries its locale's receipt).
66
+ */
67
+ export const PAIR_INDEX_DELTA = 10;
68
+ /**
69
+ * The decoder transition-entry bonus (TRANSITION-BETA build, 2026-07-24 — operator-approved β=5 from the
70
+ * transition-level probe). en-nz deliberately builds WITHOUT one (unmeasured there): the two magnitudes are calibrated
71
+ * independently, and a locale earning one says nothing about the other.
72
+ */
73
+ export const PAIR_INDEX_TRANSITION_BETA = 5;
74
+ /**
75
+ * The WHOLE-EDGE parent-bias magnitude (#46, default-on 2026-08-04) at the verdict's recommended δ=5 — see
76
+ * `docs/records/evals/2026-08-04-pix1-whole-edge-verdict.md`. Only the measured locales (us/gb/nz/fr) pass it; the
77
+ * D-rule's answer to an unmeasured locale is a per-locale absence, not an inherited magnitude.
78
+ */
79
+ export const PAIR_INDEX_PARENT_DELTA = 5;
56
80
  /**
57
81
  * Minimal PIX1 header reader — magic + header only, reimplemented so a data-only weights package gains no dependency on
58
82
  * `@mailwoman/neural` (which pulls onnxruntime-node) to read a few fields. `neural/pair-index-resolver.ts`'s own header
@@ -63,8 +87,8 @@ export function linkSoftFeedSibling(source, destination, consequenceIfMissing) {
63
87
  * before 2026-08-04 — the ×5 clone the taste audit named, and the reason three of them were schema-blind while this one
64
88
  * was not.
65
89
  */
66
- export function peekPairIndexHeaderFields(path) {
67
- const bytes = readFileSync(path);
90
+ export async function peekPairIndexHeaderFields(path) {
91
+ const bytes = await readLocalBuffer(path);
68
92
  const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
69
93
  // "PIX1" little-endian.
70
94
  const MAGIC = 0x31_58_49_50;
@@ -94,11 +118,11 @@ const MD5_HEX_LENGTH = 32;
94
118
  */
95
119
  export async function md5FileWithSidecar(path) {
96
120
  const sidecarPath = `${path}.md5`;
97
- const sourceStats = statSync(path);
98
- if (existsSync(sidecarPath)) {
121
+ const sourceStats = await statPath(path);
122
+ if (await pathExists(sidecarPath)) {
99
123
  try {
100
- if (statSync(sidecarPath).mtime >= sourceStats.mtime) {
101
- const [hash] = readFileSync(sidecarPath, "utf8").trim().split(/\s+/);
124
+ if ((await statPath(sidecarPath)).mtime >= sourceStats.mtime) {
125
+ const [hash] = (await readLocalTextFile(sidecarPath)).trim().split(/\s+/);
102
126
  if (hash && hash.length === MD5_HEX_LENGTH)
103
127
  return hash;
104
128
  }
@@ -109,7 +133,7 @@ export async function md5FileWithSidecar(path) {
109
133
  }
110
134
  const hash = await md5File(path);
111
135
  const filename = path.split(/[/\\]/).pop() || path;
112
- writeFileSync(sidecarPath, `${hash} ${filename}\n`);
136
+ await writeLocalTextFile(`${hash} ${filename}\n`, sidecarPath);
113
137
  return hash;
114
138
  }
115
139
  /**
@@ -152,90 +176,140 @@ export const REQUIRED_PAIR_INDEX_SCHEMA = 3;
152
176
  *
153
177
  * WHY IT WARNS RATHER THAN REBUILDS, unlike its pair-index sibling above. A pair index is seconds of work and the
154
178
  * linker owns its whole recipe. A locale FST is a multi-minute build whose output goes to a STAGING dir on purpose —
155
- * the swap into `fst-per-locale/` is operator-gated after the battery, because an FST changes decoder behaviour and the
156
- * D-rule does not let that land unmeasured. So the guard's job is to make the drift impossible to miss, and to name the
157
- * command that starts fixing it. It is also why a stale FST is never fatal: the artifact is a decode-time bias list,
158
- * and a dev tree must still run.
179
+ * the swap into `fst-per-locale/` is operator-approved after the battery, because an FST changes decoder behaviour and
180
+ * the D-rule does not let that land unmeasured. So the guard's job is to make the drift impossible to miss, and to name
181
+ * the command that starts fixing it. It is also why a stale FST is never fatal: the artifact is a decode-time bias
182
+ * list, and a dev tree must still run.
159
183
  *
160
184
  * The source-side half of the comparison lives here rather than in `fst-freshness.ts` for the same reason
161
185
  * `pairIndexStaleReason` splits: only the caller knows which database it built against. All three FST-linking base
162
186
  * packages build against the same one, so they share this rather than each pinning it.
163
187
  */
164
- export function warnIfFSTStale(fstPath, locale) {
165
- const warning = fstFreshnessWarning({
188
+ export async function warnIfFSTStale(fstPath, locale) {
189
+ const warning = await fstFreshnessWarning({
166
190
  fstPath,
167
191
  sourceDBPath: String(dataRootPath("wof", "admin-global-priority.db")),
168
- rebuildCommand: `node packages/mailwoman/out/cli.js gazetteer build fst --locales ${locale} (writes to a staging dir; swap is operator-gated)`,
192
+ rebuildCommand: `node packages/mailwoman/out/cli.js gazetteer build fst --locales ${locale} (writes to a staging dir; swap is operator-conditional)`,
169
193
  });
170
194
  if (warning) {
171
195
  console.error(warning);
172
196
  }
173
197
  }
198
+ /**
199
+ * Symlink the per-locale FST gazetteer (`fst-<locale>.bin`) from the shared build area
200
+ * (`$MAILWOMAN_DATA_ROOT/wof/fst-per-locale/`) into an overlay so `resolveWeights` surfaces `fstPath` in dev and the
201
+ * runtime pipeline can auto-wire the gazetteer + street-context check, then run {@link warnIfFSTStale} on the linked
202
+ * artifact. The publish flow stages the real binary (release-sequenced).
203
+ */
204
+ export async function linkLocaleFST(destDir, locale) {
205
+ const source = String(dataRootPath("wof", "fst-per-locale", `fst-${locale}.bin`));
206
+ const linked = await linkSoftFeedSibling(source, resolvePath(destDir, `fst-${locale}.bin`), "the FST gazetteer default will resolve OFF for this locale.");
207
+ if (linked) {
208
+ await warnIfFSTStale(source, locale);
209
+ }
210
+ }
211
+ /**
212
+ * Symlink the sealed locale-general street-morphology FST (`$MAILWOMAN_DATA_ROOT/wof/fst-street-morphology.bin`,
213
+ * `mailwoman gazetteer build street-morphology`) into an overlay so `resolveWeights` surfaces `streetMorphologyPath` in
214
+ * dev and the street-context check (#1315) deserializes the artifact instead of rebuilding from the libpostal
215
+ * dictionaries per process. Missing is non-fatal — the runtime loader's dictionary-build fallback covers it.
216
+ */
217
+ export async function linkStreetMorphologyFST(destDir) {
218
+ await linkSoftFeedSibling(String(dataRootPath("wof", "fst-street-morphology.bin")), resolvePath(destDir, "fst-street-morphology.bin"), "the street-context check falls back to the per-process dictionary build.");
219
+ }
220
+ /**
221
+ * Why an existing artifact may be TRUSTED without a rebuild, or `undefined` when it must be rebuilt (with the reason
222
+ * already printed). The skip requires both halves (#1734): the header magnitudes + format (`pairIndexStaleReason`) AND
223
+ * the header's `sourceMD5s` against the current sources' md5s. Magnitudes alone read a source change as "current"
224
+ * whenever pair counts happen not to move the calibrated numbers — the R5 freshness-guard lesson, which resurfaced in
225
+ * the 2026-08-18 admin swap. A source that is not on disk to re-hash leaves the magnitudes as the best available answer
226
+ * (the "missing source, can't build" branch below would fire anyway if a rebuild were needed).
227
+ */
228
+ async function pairIndexIsFresh(dest, artifact, expected, sources, minimumPlausibleBytes) {
229
+ try {
230
+ const header = await peekPairIndexHeaderFields(dest);
231
+ const staleReason = pairIndexStaleReason(header, expected);
232
+ if (staleReason) {
233
+ console.log(`rebuilding ${artifact} — ${staleReason}`);
234
+ return false;
235
+ }
236
+ if (minimumPlausibleBytes !== undefined && (await statPath(dest)).size < minimumPlausibleBytes) {
237
+ console.log(`rebuilding ${artifact} — ${(await statPath(dest)).size.toLocaleString()} bytes is implausibly small ` +
238
+ `for this recipe (wrong-source clobber)`);
239
+ return false;
240
+ }
241
+ if (!sources.length) {
242
+ console.log(`skipped ${artifact} build — ${dest} is current (magnitudes match; no file-hashable source)`);
243
+ return true;
244
+ }
245
+ for (const source of sources) {
246
+ if (!(await pathExists(source))) {
247
+ console.log(`skipped ${artifact} build — ${dest} has matching header magnitudes (${source} absent, md5 freshness unverifiable)`);
248
+ return true;
249
+ }
250
+ }
251
+ if (header.sourceMD5s.length !== sources.length) {
252
+ console.log(`rebuilding ${artifact} — header records ${header.sourceMD5s.length} source md5s ` +
253
+ `[${header.sourceMD5s.join(", ") || "(none recorded)"}], but this build reads ${sources.length}`);
254
+ return false;
255
+ }
256
+ const currentMD5s = [];
257
+ for (const source of sources) {
258
+ currentMD5s.push(await md5FileWithSidecar(source));
259
+ }
260
+ if (currentMD5s.every((md5, i) => md5 === header.sourceMD5s[i])) {
261
+ console.log(`skipped ${artifact} build — ${dest} is current (magnitudes + all ${sources.length} source md5s match)`);
262
+ return true;
263
+ }
264
+ console.log(`rebuilding ${artifact} — header source md5s [${header.sourceMD5s.join(", ")}] != current [${currentMD5s.join(", ")}]`);
265
+ return false;
266
+ }
267
+ catch (error) {
268
+ console.log(`rebuilding ${artifact} — freshness unverifiable (${error.message})`);
269
+ return false;
270
+ }
271
+ }
174
272
  /**
175
273
  * Build `pair-index-<country>.bin` into the overlay, skipping the work when the artifact on disk was already built at
176
- * these magnitudes FROM the admin database on disk.
177
- *
178
- * The skip requires both halves (#1734): the header magnitudes (`pairIndexStaleReason`) AND the header's `sourceMD5s`
179
- * against the current admin DB's md5. Magnitudes alone read a source change as "current" whenever pair counts happen
180
- * not to move the calibrated numbers — the R5 freshness-guard lesson, which resurfaced in the 2026-08-18 admin swap
181
- * when all four overlay locales skipped while the md5-checking base linkers rebuilt. This build's ONE source is the
182
- * admin DB it passes as `--borough-db`, so the comparison is exactly one md5; a linker with a different source list
183
- * (fr's BAN directory) owns its own guard and must never be pointed at this one.
274
+ * these magnitudes FROM the sources on disk (see {@link pairIndexIsFresh}). The calibration object drives both the
275
+ * staleness expectation and the CLI flags, so a magnitude cannot be checked by the guard and dropped from the build.
184
276
  *
185
- * Exits non-zero on a failed build. Missing INPUTS (an unbuilt CLI, an absent WOF database) warn and return instead: a
186
- * fresh clone has neither, and `yarn test` invokes this to verify auto-resolve, so a hard failure there would be a
187
- * failure to have run a build yet rather than a real fault.
277
+ * Exits non-zero on a failed build. Missing INPUTS (an unbuilt CLI, an absent source) warn and return instead: a fresh
278
+ * clone has neither, and `yarn test` invokes this to verify auto-resolve, so a hard failure there would be a failure to
279
+ * have run a build yet rather than a real fault.
188
280
  */
189
- export async function buildPairIndexOverlay({ packageDir, country, delta, transitionBeta, }) {
281
+ export async function buildPairIndexOverlay(overlay) {
282
+ const { packageDir, country, delta, transitionBeta, parentDelta } = overlay;
190
283
  const CLI = String(workspacePath("mailwoman", "out", "cli.js"));
191
284
  const ARTIFACT = `pair-index-${country}.bin`;
192
285
  // Built into the data-root OVERLAY, not into the tracked package. The locale is recovered from the
193
286
  // workspace name (`neural-weights-en-gb` → `en-gb`) so callers keep passing the one identifier they
194
- // already had; the alternative was a second parameter every caller would have to keep in step with the
195
- // first, which is the drift this whole rollout is removing.
287
+ // already had.
196
288
  const PKG_DIR = String(weightsOverlayPath(packageDir.replace(/^neural-weights-/, "")));
197
- const DEST = resolve(PKG_DIR, ARTIFACT);
198
- mkdirSync(PKG_DIR, { recursive: true });
289
+ const DEST = resolvePath(PKG_DIR, ARTIFACT);
290
+ await makeDirectories(PKG_DIR);
199
291
  /**
200
- * Checked-in WOF-derived admin pairs — the same posture as the GB secondary sources.
292
+ * Checked-in WOF-derived admin pairs — the default source, and the whole source list for the small overlays.
201
293
  */
202
294
  const WOF_ADMIN_DB = String(dataRootPath("wof", "admin-global-priority.db"));
203
- if (!existsSync(CLI)) {
295
+ const sources = overlay.sources ?? [WOF_ADMIN_DB];
296
+ const inputs = overlay.inputs ?? sources;
297
+ const extraArgs = overlay.extraArgs ?? ["--borough-db", WOF_ADMIN_DB];
298
+ if (!(await pathExists(CLI))) {
204
299
  console.error(`WARNING: ${CLI} not built — run \`yarn compile\` first, then re-run for ${ARTIFACT}.`);
205
300
  return;
206
301
  }
207
- if (!existsSync(WOF_ADMIN_DB)) {
208
- console.error(`WARNING: missing ${WOF_ADMIN_DB} — ${ARTIFACT} not built.`);
302
+ if ((await pathExists(DEST)) &&
303
+ (await pairIndexIsFresh(DEST, ARTIFACT, { delta, transitionBeta, parentDelta }, sources, overlay.minimumPlausibleBytes))) {
209
304
  return;
210
305
  }
211
- if (existsSync(DEST)) {
212
- try {
213
- // No `parentDelta` in the expectation: the overlay locales (de/in/es/it) ship WITHOUT the whole-edge
214
- // parent bias — unmeasured there, and the D-rule's answer to an unmeasured locale is a per-locale
215
- // gate, not an inherited magnitude. `PairIndexOverlay` therefore has no `parentDelta` field to pass;
216
- // adding one is a deliberate act that should arrive with a board.
217
- const header = peekPairIndexHeaderFields(DEST);
218
- const reason = pairIndexStaleReason(header, { delta, transitionBeta });
219
- if (reason) {
220
- console.log(`rebuilding ${ARTIFACT} — ${reason}`);
221
- }
222
- else {
223
- // The source-md5 half (#1734). This build reads exactly one source, so one md5; an artifact that
224
- // recorded none, or a different count, predates the stamp and is stale by that fact alone.
225
- const adminMD5 = await md5FileWithSidecar(WOF_ADMIN_DB);
226
- if (header.sourceMD5s.length === 1 && header.sourceMD5s[0] === adminMD5) {
227
- console.log(`skipped ${ARTIFACT} build — ${DEST} is current (magnitudes + source md5 match)`);
228
- return;
229
- }
230
- console.log(`rebuilding ${ARTIFACT} — header source md5s [${header.sourceMD5s.join(", ") || "(none recorded)"}] != ` +
231
- `current admin DB [${adminMD5}]`);
232
- }
233
- }
234
- catch (error) {
235
- console.log(`rebuilding ${ARTIFACT} — header unreadable (${error.message})`);
236
- }
306
+ for (const input of inputs) {
307
+ if (await pathExists(input))
308
+ continue;
309
+ console.error(`WARNING: missing ${input} — ${ARTIFACT} not built; the placetype-pair prior stays inert for ${country.toUpperCase()}.`);
310
+ return;
237
311
  }
238
- const result = spawnSync(process.execPath, [
312
+ const result = spawnProcessSync(process.execPath, [
239
313
  CLI,
240
314
  "gazetteer",
241
315
  "pair-index",
@@ -245,15 +319,193 @@ export async function buildPairIndexOverlay({ packageDir, country, delta, transi
245
319
  country,
246
320
  "--delta",
247
321
  String(delta),
248
- "--transition-beta",
249
- String(transitionBeta),
250
- "--borough-db",
251
- WOF_ADMIN_DB,
322
+ ...(transitionBeta === undefined ? [] : ["--transition-beta", String(transitionBeta)]),
323
+ ...(parentDelta === undefined ? [] : ["--parent-delta", String(parentDelta)]),
324
+ ...extraArgs,
252
325
  ], { stdio: "inherit" });
253
- if (result.status !== 0 || !existsSync(DEST)) {
326
+ if (result.status !== 0 || !(await pathExists(DEST))) {
254
327
  console.error(`FAILED: gazetteer pair-index --country ${country} (exit ${result.status})`);
255
328
  process.exit(1);
256
329
  }
257
- console.log(`built ${ARTIFACT} ← ${WOF_ADMIN_DB}`);
330
+ console.log(`built ${ARTIFACT}`);
331
+ }
332
+ /**
333
+ * The committed soft-feed lexicons as links, by channel, read from `release.config.json` so the filename a manifest
334
+ * links is the one the release ships. `streetType` is offered for completeness; the manifests link the evidence
335
+ * lexicons by the generation their CARD names instead (`evidenceLexiconsFromCard`).
336
+ */
337
+ export async function committedSoftFeedLinks() {
338
+ const config = await readReleaseConfig();
339
+ const sources = repoCommittedSoftFeedSources(repoRootPath(), config.softFeed ?? {});
340
+ const link = (name, consequenceIfMissing) => {
341
+ const source = sources.get(name);
342
+ return source ? { source, name, consequenceIfMissing } : undefined;
343
+ };
344
+ const anchor = link("anchor-lexicon-v1.json", "gazetteer channel will resolve OFF in this worktree.");
345
+ const country = link("country-surface-lexicon-v1.json", "country channel will resolve OFF in this worktree.");
346
+ if (!anchor || !country) {
347
+ throw new Error("release.config.json names no softFeed.gazetteerLexicon / softFeed.countryLexicon — the overlays cannot link them.");
348
+ }
349
+ const streetType = link("street-type-lexicon-v3.json", "the street_type channel will resolve OFF in this worktree.");
350
+ return { anchor, country, ...(streetType ? { streetType } : {}) };
351
+ }
352
+ /**
353
+ * Where each evidence channel's lexicon is found, by the name the card declares.
354
+ */
355
+ const EVIDENCE_LEXICON_SOURCES = [
356
+ { channel: "street_type", source: (name) => String(repoRootPath("data", "gazetteer", name)) },
357
+ { channel: "locality_surface", source: (name) => String(dataRootPath("gazetteer", name)) },
358
+ ];
359
+ /**
360
+ * Read a weights workspace's committed card, or `undefined` when the workspace carries none.
361
+ */
362
+ async function readWeightsCard(workspace) {
363
+ const path = resolvePath(String(workspacePath(workspace)), "model-card.json");
364
+ if (!(await pathExists(path)))
365
+ return undefined;
366
+ return readLocalJSONFile(path);
367
+ }
368
+ /**
369
+ * Link the base model pair from the release recipe and, when a digest card is named, hold the linked default bytes to
370
+ * that card's `files_md5`. The recipe and the card are the two registers a ship bumps in lockstep; a path bumped
371
+ * without the card, or the reverse, fails here rather than after an eval shift graded against the wrong weights.
372
+ */
373
+ /**
374
+ * A char-path base (#2164): the graph and its sealed vocabulary from `release.config.json`'s `charWeights[family]`, no
375
+ * tokenizer. The dev overlay carries both so `resolveWeights` finds the package whole.
376
+ */
377
+ async function linkCharModel(destDir, family) {
378
+ const recipe = (await readReleaseConfig()).charWeights?.[family];
379
+ if (!recipe) {
380
+ throw new Error(`release.config.json declares no charWeights.${family} — nothing to link for the ${family} base`);
381
+ }
382
+ const dataRoot = String(dataRootPath());
383
+ for (const [name, relative] of [
384
+ ["model.onnx", recipe.model],
385
+ ["char-vocab.json", recipe.charVocab],
386
+ ]) {
387
+ const source = resolvePath(dataRoot, relative);
388
+ if (!(await pathExists(source))) {
389
+ throw new Error(`missing char-path source ${name} for ${family}: ${source}`);
390
+ }
391
+ await linkForce(source, resolvePath(destDir, name));
392
+ console.log(`linked ${resolvePath(destDir, name)} ← ${source}`);
393
+ }
394
+ // The card is what tells `resolveWeights` this package owes a vocabulary rather than a tokenizer (its `encoder`
395
+ // block), so the overlay carries the workspace's committed card beside the two binaries.
396
+ const card = resolvePath(String(workspacePath(`neural-weights-${family}`)), "model-card.json");
397
+ await linkForce(card, resolvePath(destDir, "model-card.json"));
398
+ await removeIfPresent(resolvePath(destDir, "tokenizer.model"));
399
+ }
400
+ async function linkBaseModelPair(destDir, digestCard) {
401
+ const recipe = await readReleaseConfig();
402
+ const dataRoot = String(dataRootPath());
403
+ const digests = digestCard ? (await readWeightsCard(digestCard))?.files_md5 : undefined;
404
+ const pair = [
405
+ { label: "model", name: "model.onnx", override: $public.MAILWOMAN_DEV_MODEL, recipe: recipe.weights.model },
406
+ {
407
+ label: "tokenizer",
408
+ name: "tokenizer.model",
409
+ override: $public.MAILWOMAN_DEV_TOKENIZER,
410
+ recipe: recipe.weights.tokenizer,
411
+ },
412
+ ];
413
+ for (const { label, name, override, recipe: recipePath } of pair) {
414
+ const source = override || resolvePath(dataRoot, recipePath);
415
+ if (!(await pathExists(source))) {
416
+ throw new Error(`missing source ${label}: ${source} — set MAILWOMAN_DEV_${label.toUpperCase()} to override`);
417
+ }
418
+ const dest = resolvePath(destDir, name);
419
+ await linkForce(source, dest);
420
+ console.log(`linked ${dest} ← ${source}`);
421
+ if (!digestCard)
422
+ continue;
423
+ if (override) {
424
+ console.error(` (${label} override active — skipping the #397 default-digest check)`);
425
+ continue;
426
+ }
427
+ const expected = digests?.[name];
428
+ if (!expected) {
429
+ throw new Error(`#397 guard: ${digestCard}/model-card.json has no files_md5 entry for ${name} — cannot verify the dev pin.`);
430
+ }
431
+ const actual = await md5File(dest);
432
+ if (actual !== expected) {
433
+ throw new Error(`#397 guard: linked default ${label} md5 ${actual} != shipped ${expected} (${digestCard} model-card files_md5). ` +
434
+ `The dev link has drifted from the shipped default: bump release.config.json weights.${label} and the card's ` +
435
+ `files_md5 in lockstep.`);
436
+ }
437
+ console.log(` ${name} digest ok`);
438
+ }
439
+ }
440
+ /**
441
+ * Build a postcode binary from a WOF postcode extract, skip-if-present. A missing CLI or extract is a warning (the
442
+ * anchor channel resolves OFF for that country); a build that runs and fails is an error.
443
+ */
444
+ async function buildPostcodeBinary(destDir, cli, { country, database }) {
445
+ const artifact = `postcode-${country.toLowerCase()}.bin`;
446
+ const dest = resolvePath(destDir, artifact);
447
+ if (await pathExists(dest)) {
448
+ console.log(`skipped ${artifact} build — ${dest} already present`);
449
+ return;
450
+ }
451
+ if (!(await pathExists(cli))) {
452
+ console.error(`WARNING: ${cli} not built — run \`yarn compile\` first, then re-run this script to build ${artifact}.`);
453
+ return;
454
+ }
455
+ if (!(await pathExists(database))) {
456
+ console.error(`WARNING: missing ${database} — ${artifact} not built; the anchor channel will resolve OFF for ${country.toUpperCase()}.`);
457
+ return;
458
+ }
459
+ const result = spawnProcessSync(process.execPath, [cli, "gazetteer", "postcode-binary", "--out", destDir, "--locale", `${country.toUpperCase()}:${database}`], { stdio: "inherit" });
460
+ if (result.status !== 0 || !(await pathExists(dest))) {
461
+ throw new Error(`failed to build ${dest} (exit ${result.status})`);
462
+ }
463
+ console.log(`built ${dest}`);
464
+ }
465
+ /**
466
+ * Materialize one locale's dev overlay from its manifest. The steps run in the order {@link DevOverlayManifest}
467
+ * documents, each independent on disk, and the result carries what a locale-specific step needs afterwards.
468
+ */
469
+ export async function materializeDevOverlay(manifest) {
470
+ const destDir = String(weightsOverlayPath(manifest.locale));
471
+ const cli = String(workspacePath("mailwoman", "out", "cli.js"));
472
+ const card = await readWeightsCard(`neural-weights-${manifest.locale}`);
473
+ await makeDirectories(destDir);
474
+ if (manifest.model?.kind === "inherit") {
475
+ await removeIfPresent(resolvePath(destDir, "model.onnx"));
476
+ await removeIfPresent(resolvePath(destDir, "tokenizer.model"));
477
+ }
478
+ else if (manifest.model?.kind === "link") {
479
+ await linkBaseModelPair(destDir, manifest.model.digestCard);
480
+ }
481
+ else if (manifest.model?.kind === "char") {
482
+ await linkCharModel(destDir, manifest.model.family);
483
+ }
484
+ for (const { source, name, consequenceIfMissing } of manifest.softFeed ?? []) {
485
+ await linkSoftFeedSibling(source, resolvePath(destDir, name), consequenceIfMissing);
486
+ }
487
+ if (manifest.evidenceLexiconsFromCard) {
488
+ for (const { channel, source } of EVIDENCE_LEXICON_SOURCES) {
489
+ const declared = card?.requires?.[channel]?.lexicon;
490
+ if (!declared) {
491
+ console.error(`WARNING: model-card declares no requires.${channel}.lexicon — the ${channel} channel stays OFF.`);
492
+ continue;
493
+ }
494
+ await linkSoftFeedSibling(source(declared), resolvePath(destDir, declared), `the ${channel} channel will resolve OFF in this worktree.`);
495
+ }
496
+ }
497
+ if (manifest.postcodeBinary) {
498
+ await buildPostcodeBinary(destDir, cli, manifest.postcodeBinary);
499
+ }
500
+ if (manifest.pairIndex) {
501
+ await buildPairIndexOverlay({ packageDir: `neural-weights-${manifest.locale}`, ...manifest.pairIndex });
502
+ }
503
+ if (manifest.localeFST) {
504
+ await linkLocaleFST(destDir, manifest.locale);
505
+ }
506
+ if (manifest.streetMorphologyFST) {
507
+ await linkStreetMorphologyFST(destDir);
508
+ }
509
+ return { destDir, cli, card };
258
510
  }
259
511
  //# sourceMappingURL=weights-overlay-linker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"weights-overlay-linker.js","sourceRoot":"","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