@mailwoman/resolver-wof-sqlite 11.2.0 → 11.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 (452) hide show
  1. package/lib/address/duplicate.ts +1 -1
  2. package/lib/address/keys/attribution.ts +6 -1
  3. package/lib/address/keys/build.ts +1 -1
  4. package/lib/address/keys/layout.ts +27 -1
  5. package/lib/address/keys/lookup.ts +2 -2
  6. package/lib/address/keys/point-lookup.ts +2 -2
  7. package/lib/address/number-forms.ts +4 -6
  8. package/lib/address/point/interpolation.ts +11 -3
  9. package/lib/address/point/schema.ts +1 -1
  10. package/lib/address/point.ts +15 -14
  11. package/lib/address/record.ts +1 -1
  12. package/lib/build/candidate.ts +136 -40
  13. package/lib/build/slim.ts +4 -1
  14. package/lib/build/sources.ts +50 -0
  15. package/lib/candidate/alias-bags.ts +22 -8
  16. package/lib/candidate/ancestors/schema.ts +1 -1
  17. package/lib/candidate/ancestors/sidecar.ts +13 -2
  18. package/lib/candidate/bare-admin-names.ts +1 -1
  19. package/lib/{capital-schema.ts → candidate/capital-schema.ts} +3 -3
  20. package/lib/{capitals.ts → candidate/capitals.ts} +1 -1
  21. package/lib/candidate/country-display-names.ts +1 -1
  22. package/lib/candidate/{extract-fold.ts → extract-rows.ts} +7 -4
  23. package/lib/candidate/importance.ts +86 -8
  24. package/lib/candidate/key-fold.ts +1 -1
  25. package/lib/candidate/lookup.ts +79 -48
  26. package/lib/candidate/name-roles.ts +1 -1
  27. package/lib/candidate/nickname-namesakes.ts +8 -1
  28. package/lib/candidate/overture-twins.ts +83 -0
  29. package/lib/candidate/place-attrs.ts +2 -2
  30. package/lib/candidate/postcode-browse.ts +173 -0
  31. package/lib/candidate/schema.ts +43 -2
  32. package/lib/candidate/scoring.ts +4 -4
  33. package/lib/convention.ts +1 -1
  34. package/lib/env.ts +15 -3
  35. package/lib/fst/builder.ts +8 -6
  36. package/lib/fst/deserialize-web.ts +1 -1
  37. package/lib/fst/freshness.ts +2 -2
  38. package/lib/fst/serialize.ts +1 -1
  39. package/lib/fts/query.ts +1 -1
  40. package/lib/{search-fetch.ts → fts/search-fetch.ts} +2 -2
  41. package/lib/geonames/aliases.ts +37 -33
  42. package/lib/geonames/postal.ts +3 -3
  43. package/lib/index.ts +20 -17
  44. package/lib/{postal/city → labels/locality/postal-city}/alias/lookup.ts +1 -1
  45. package/lib/{postal/city → labels/locality/postal-city}/candidate-schema.ts +1 -1
  46. package/lib/labels/locality.ts +6 -0
  47. package/lib/{region-keys.ts → labels/region.ts} +5 -2
  48. package/lib/{street → labels/street}/centroid/schema.ts +1 -1
  49. package/lib/{street → labels/street}/centroid.ts +7 -7
  50. package/lib/{interpolation.ts → labels/street/interpolation.ts} +12 -4
  51. package/lib/labels/street/locale.ts +117 -0
  52. package/lib/{street → labels/street}/morphology/fst/loader.ts +1 -1
  53. package/lib/{street → labels/street}/name-lookup.ts +2 -0
  54. package/lib/{street → labels/street}/normalize.ts +242 -133
  55. package/lib/{street → labels/street}/segment-schema.ts +1 -1
  56. package/lib/{street → labels/street}/table.ts +1 -1
  57. package/lib/labels/street.ts +11 -0
  58. package/lib/landmark/rows.ts +1 -1
  59. package/lib/lookup/browse.ts +304 -0
  60. package/lib/{extracts.ts → lookup/extracts.ts} +1 -1
  61. package/lib/lookup/former-divisions.ts +183 -0
  62. package/lib/{postcode-point-lookup.ts → lookup/postcode-point.ts} +5 -0
  63. package/lib/{reverse.ts → lookup/reverse.ts} +4 -4
  64. package/lib/{types.ts → lookup/types.ts} +10 -0
  65. package/lib/lookup.ts +21 -31
  66. package/lib/poi/schema.ts +1 -1
  67. package/lib/{primary-preference.ts → ranking/primary-preference.ts} +5 -0
  68. package/lib/schema/overture-match.ts +79 -0
  69. package/lib/{place-importance-schema.ts → schema/place-importance.ts} +86 -0
  70. package/lib/schema.ts +3 -3
  71. package/lib/sqlite/convention-source.ts +1 -1
  72. package/lib/uprn/existence.ts +2 -0
  73. package/lib/{weights-overlay-linker.ts → weights/overlay-linker.ts} +244 -103
  74. package/out/address/duplicate.js +1 -1
  75. package/out/address/duplicate.js.map +1 -1
  76. package/out/address/keys/attribution.d.ts +4 -0
  77. package/out/address/keys/attribution.d.ts.map +1 -1
  78. package/out/address/keys/attribution.js +5 -1
  79. package/out/address/keys/attribution.js.map +1 -1
  80. package/out/address/keys/build.d.ts.map +1 -1
  81. package/out/address/keys/build.js +1 -1
  82. package/out/address/keys/build.js.map +1 -1
  83. package/out/address/keys/layout.d.ts +18 -1
  84. package/out/address/keys/layout.d.ts.map +1 -1
  85. package/out/address/keys/layout.js +23 -1
  86. package/out/address/keys/layout.js.map +1 -1
  87. package/out/address/keys/lookup.js +2 -2
  88. package/out/address/keys/lookup.js.map +1 -1
  89. package/out/address/keys/point-lookup.d.ts.map +1 -1
  90. package/out/address/keys/point-lookup.js +2 -2
  91. package/out/address/keys/point-lookup.js.map +1 -1
  92. package/out/address/number-forms.d.ts +1 -1
  93. package/out/address/number-forms.d.ts.map +1 -1
  94. package/out/address/number-forms.js +4 -5
  95. package/out/address/number-forms.js.map +1 -1
  96. package/out/address/point/interpolation.d.ts +1 -1
  97. package/out/address/point/interpolation.d.ts.map +1 -1
  98. package/out/address/point/interpolation.js +9 -2
  99. package/out/address/point/interpolation.js.map +1 -1
  100. package/out/address/point/schema.d.ts +1 -1
  101. package/out/address/point/schema.d.ts.map +1 -1
  102. package/out/address/point.d.ts +4 -5
  103. package/out/address/point.d.ts.map +1 -1
  104. package/out/address/point.js +11 -11
  105. package/out/address/point.js.map +1 -1
  106. package/out/address/record.d.ts +1 -1
  107. package/out/address/record.d.ts.map +1 -1
  108. package/out/address/record.js +1 -1
  109. package/out/address/record.js.map +1 -1
  110. package/out/build/candidate.d.ts +26 -1
  111. package/out/build/candidate.d.ts.map +1 -1
  112. package/out/build/candidate.js +71 -32
  113. package/out/build/candidate.js.map +1 -1
  114. package/out/build/slim.d.ts.map +1 -1
  115. package/out/build/slim.js +4 -1
  116. package/out/build/slim.js.map +1 -1
  117. package/out/build/sources.d.ts +32 -0
  118. package/out/build/sources.d.ts.map +1 -0
  119. package/out/build/sources.js +35 -0
  120. package/out/build/sources.js.map +1 -0
  121. package/out/candidate/alias-bags.d.ts +0 -3
  122. package/out/candidate/alias-bags.d.ts.map +1 -1
  123. package/out/candidate/alias-bags.js +22 -7
  124. package/out/candidate/alias-bags.js.map +1 -1
  125. package/out/candidate/ancestors/schema.d.ts +1 -1
  126. package/out/candidate/ancestors/schema.d.ts.map +1 -1
  127. package/out/candidate/ancestors/sidecar.d.ts +0 -3
  128. package/out/candidate/ancestors/sidecar.d.ts.map +1 -1
  129. package/out/candidate/ancestors/sidecar.js +16 -2
  130. package/out/candidate/ancestors/sidecar.js.map +1 -1
  131. package/out/candidate/bare-admin-names.js +1 -1
  132. package/out/candidate/bare-admin-names.js.map +1 -1
  133. package/out/{capital-schema.d.ts → candidate/capital-schema.d.ts} +2 -2
  134. package/out/candidate/capital-schema.d.ts.map +1 -0
  135. package/out/{capital-schema.js → candidate/capital-schema.js} +2 -2
  136. package/out/candidate/capital-schema.js.map +1 -0
  137. package/out/candidate/capitals.d.ts.map +1 -0
  138. package/out/{capitals.js → candidate/capitals.js} +1 -1
  139. package/out/candidate/capitals.js.map +1 -0
  140. package/out/candidate/country-display-names.js +1 -1
  141. package/out/candidate/country-display-names.js.map +1 -1
  142. package/out/{coverage-manifest-schema.d.ts → candidate/coverage-manifest.d.ts} +1 -1
  143. package/out/candidate/coverage-manifest.d.ts.map +1 -0
  144. package/out/{coverage-manifest-schema.js → candidate/coverage-manifest.js} +1 -1
  145. package/out/candidate/coverage-manifest.js.map +1 -0
  146. package/out/candidate/{extract-fold.d.ts → extract-rows.d.ts} +2 -2
  147. package/out/candidate/extract-rows.d.ts.map +1 -0
  148. package/out/candidate/{extract-fold.js → extract-rows.js} +8 -5
  149. package/out/candidate/extract-rows.js.map +1 -0
  150. package/out/candidate/importance.d.ts +34 -3
  151. package/out/candidate/importance.d.ts.map +1 -1
  152. package/out/candidate/importance.js +53 -8
  153. package/out/candidate/importance.js.map +1 -1
  154. package/out/candidate/key-fold.d.ts +1 -1
  155. package/out/candidate/key-fold.d.ts.map +1 -1
  156. package/out/candidate/key-fold.js +1 -1
  157. package/out/candidate/key-fold.js.map +1 -1
  158. package/out/candidate/lookup.d.ts +5 -1
  159. package/out/candidate/lookup.d.ts.map +1 -1
  160. package/out/candidate/lookup.js +59 -43
  161. package/out/candidate/lookup.js.map +1 -1
  162. package/out/candidate/name-roles.d.ts.map +1 -1
  163. package/out/candidate/name-roles.js +1 -1
  164. package/out/candidate/name-roles.js.map +1 -1
  165. package/out/candidate/nickname-namesakes.d.ts +0 -4
  166. package/out/candidate/nickname-namesakes.d.ts.map +1 -1
  167. package/out/candidate/nickname-namesakes.js +12 -1
  168. package/out/candidate/nickname-namesakes.js.map +1 -1
  169. package/out/candidate/overture-twins.d.ts +30 -0
  170. package/out/candidate/overture-twins.d.ts.map +1 -0
  171. package/out/candidate/overture-twins.js +40 -0
  172. package/out/candidate/overture-twins.js.map +1 -0
  173. package/out/candidate/place-attrs.d.ts +2 -2
  174. package/out/candidate/postcode-browse.d.ts +36 -0
  175. package/out/candidate/postcode-browse.d.ts.map +1 -0
  176. package/out/candidate/postcode-browse.js +119 -0
  177. package/out/candidate/postcode-browse.js.map +1 -0
  178. package/out/candidate/schema.d.ts +30 -2
  179. package/out/candidate/schema.d.ts.map +1 -1
  180. package/out/candidate/schema.js +29 -0
  181. package/out/candidate/schema.js.map +1 -1
  182. package/out/candidate/scoring.d.ts +3 -3
  183. package/out/candidate/scoring.d.ts.map +1 -1
  184. package/out/candidate/scoring.js +2 -2
  185. package/out/candidate/scoring.js.map +1 -1
  186. package/out/convention.d.ts +1 -1
  187. package/out/convention.d.ts.map +1 -1
  188. package/out/env.d.ts +3 -0
  189. package/out/env.d.ts.map +1 -1
  190. package/out/env.js +14 -3
  191. package/out/env.js.map +1 -1
  192. package/out/fst/builder.d.ts.map +1 -1
  193. package/out/fst/builder.js +8 -6
  194. package/out/fst/builder.js.map +1 -1
  195. package/out/fst/deserialize-web.js +1 -1
  196. package/out/fst/deserialize-web.js.map +1 -1
  197. package/out/fst/freshness.js +2 -2
  198. package/out/fst/freshness.js.map +1 -1
  199. package/out/fst/serialize.js +1 -1
  200. package/out/fst/serialize.js.map +1 -1
  201. package/out/fts/query.d.ts +1 -1
  202. package/out/fts/query.d.ts.map +1 -1
  203. package/out/{search-fetch.d.ts → fts/search-fetch.d.ts} +2 -2
  204. package/out/fts/search-fetch.d.ts.map +1 -0
  205. package/out/fts/search-fetch.js.map +1 -0
  206. package/out/geonames/aliases.d.ts +18 -18
  207. package/out/geonames/aliases.d.ts.map +1 -1
  208. package/out/geonames/aliases.js +17 -17
  209. package/out/geonames/aliases.js.map +1 -1
  210. package/out/geonames/postal.d.ts +1 -1
  211. package/out/geonames/postal.js +3 -3
  212. package/out/index.d.ts +17 -17
  213. package/out/index.d.ts.map +1 -1
  214. package/out/index.js +12 -12
  215. package/out/index.js.map +1 -1
  216. package/out/{postal/city → labels/locality/postal-city}/alias/lookup.d.ts +1 -1
  217. package/out/labels/locality/postal-city/alias/lookup.d.ts.map +1 -0
  218. package/out/labels/locality/postal-city/alias/lookup.js.map +1 -0
  219. package/out/labels/locality/postal-city/alias/schema.d.ts.map +1 -0
  220. package/out/labels/locality/postal-city/alias/schema.js.map +1 -0
  221. package/out/{postal/city → labels/locality/postal-city}/candidate-schema.d.ts +1 -1
  222. package/out/labels/locality/postal-city/candidate-schema.d.ts.map +1 -0
  223. package/out/labels/locality/postal-city/candidate-schema.js.map +1 -0
  224. package/out/labels/locality.d.ts +4 -0
  225. package/out/labels/locality.d.ts.map +1 -0
  226. package/out/labels/locality.js +6 -0
  227. package/out/labels/locality.js.map +1 -0
  228. package/out/{region-keys.d.ts → labels/region.d.ts} +1 -1
  229. package/out/{region-keys.d.ts.map → labels/region.d.ts.map} +1 -1
  230. package/out/{region-keys.js → labels/region.js} +6 -3
  231. package/out/labels/region.js.map +1 -0
  232. package/out/{street → labels/street}/centroid/schema.d.ts +1 -1
  233. package/out/labels/street/centroid/schema.d.ts.map +1 -0
  234. package/out/labels/street/centroid/schema.js.map +1 -0
  235. package/out/{street → labels/street}/centroid.d.ts +5 -5
  236. package/out/labels/street/centroid.d.ts.map +1 -0
  237. package/out/{street → labels/street}/centroid.js +5 -5
  238. package/out/labels/street/centroid.js.map +1 -0
  239. package/out/{interpolation.d.ts → labels/street/interpolation.d.ts} +6 -1
  240. package/out/labels/street/interpolation.d.ts.map +1 -0
  241. package/out/{interpolation.js → labels/street/interpolation.js} +10 -8
  242. package/out/labels/street/interpolation.js.map +1 -0
  243. package/out/labels/street/locale.d.ts +26 -0
  244. package/out/labels/street/locale.d.ts.map +1 -0
  245. package/out/labels/street/locale.js +98 -0
  246. package/out/labels/street/locale.js.map +1 -0
  247. package/out/labels/street/morphology/fst/builder.d.ts.map +1 -0
  248. package/out/labels/street/morphology/fst/builder.js.map +1 -0
  249. package/out/labels/street/morphology/fst/loader.d.ts.map +1 -0
  250. package/out/{street → labels/street}/morphology/fst/loader.js +1 -1
  251. package/out/labels/street/morphology/fst/loader.js.map +1 -0
  252. package/out/labels/street/name-lookup.d.ts.map +1 -0
  253. package/out/{street → labels/street}/name-lookup.js +2 -0
  254. package/out/labels/street/name-lookup.js.map +1 -0
  255. package/out/{street → labels/street}/normalize.d.ts +85 -27
  256. package/out/labels/street/normalize.d.ts.map +1 -0
  257. package/out/{street → labels/street}/normalize.js +162 -119
  258. package/out/labels/street/normalize.js.map +1 -0
  259. package/out/{street → labels/street}/segment-schema.d.ts +1 -1
  260. package/out/labels/street/segment-schema.d.ts.map +1 -0
  261. package/out/labels/street/segment-schema.js.map +1 -0
  262. package/out/labels/street/table.d.ts.map +1 -0
  263. package/out/{street → labels/street}/table.js +1 -1
  264. package/out/labels/street/table.js.map +1 -0
  265. package/out/labels/street.d.ts +9 -0
  266. package/out/labels/street.d.ts.map +1 -0
  267. package/out/labels/street.js +11 -0
  268. package/out/labels/street.js.map +1 -0
  269. package/out/landmark/rows.js +1 -1
  270. package/out/landmark/rows.js.map +1 -1
  271. package/out/lookup/browse.d.ts +79 -0
  272. package/out/lookup/browse.d.ts.map +1 -0
  273. package/out/lookup/browse.js +194 -0
  274. package/out/lookup/browse.js.map +1 -0
  275. package/out/lookup/exact-match.d.ts.map +1 -0
  276. package/out/lookup/exact-match.js.map +1 -0
  277. package/out/lookup/extracts.d.ts.map +1 -0
  278. package/out/{extracts.js → lookup/extracts.js} +1 -1
  279. package/out/lookup/extracts.js.map +1 -0
  280. package/out/lookup/former-divisions.d.ts +99 -0
  281. package/out/lookup/former-divisions.d.ts.map +1 -0
  282. package/out/lookup/former-divisions.js +98 -0
  283. package/out/lookup/former-divisions.js.map +1 -0
  284. package/out/{postcode-point-lookup.d.ts → lookup/postcode-point.d.ts} +5 -1
  285. package/out/lookup/postcode-point.d.ts.map +1 -0
  286. package/out/{postcode-point-lookup.js → lookup/postcode-point.js} +1 -1
  287. package/out/lookup/postcode-point.js.map +1 -0
  288. package/out/{reverse.d.ts → lookup/reverse.d.ts} +1 -1
  289. package/out/lookup/reverse.d.ts.map +1 -0
  290. package/out/{reverse.js → lookup/reverse.js} +3 -3
  291. package/out/lookup/reverse.js.map +1 -0
  292. package/out/{types.d.ts → lookup/types.d.ts} +9 -0
  293. package/out/lookup/types.d.ts.map +1 -0
  294. package/out/lookup/types.js.map +1 -0
  295. package/out/lookup.d.ts +4 -4
  296. package/out/lookup.d.ts.map +1 -1
  297. package/out/lookup.js +14 -20
  298. package/out/lookup.js.map +1 -1
  299. package/out/poi/schema.d.ts +1 -1
  300. package/out/poi/schema.d.ts.map +1 -1
  301. package/out/ranking/name-score.d.ts.map +1 -0
  302. package/out/ranking/name-score.js.map +1 -0
  303. package/out/ranking/primary-preference.d.ts.map +1 -0
  304. package/out/{primary-preference.js → ranking/primary-preference.js} +4 -0
  305. package/out/ranking/primary-preference.js.map +1 -0
  306. package/out/ranking/proximity-rerank.d.ts.map +1 -0
  307. package/out/ranking/proximity-rerank.js.map +1 -0
  308. package/out/{ranking-weights.d.ts → ranking/weights.d.ts} +1 -1
  309. package/out/ranking/weights.d.ts.map +1 -0
  310. package/out/{ranking-weights.js → ranking/weights.js} +1 -1
  311. package/out/ranking/weights.js.map +1 -0
  312. package/out/schema/importance-source.d.ts.map +1 -0
  313. package/out/schema/importance-source.js.map +1 -0
  314. package/out/schema/overture-match.d.ts +53 -0
  315. package/out/schema/overture-match.d.ts.map +1 -0
  316. package/out/schema/overture-match.js +33 -0
  317. package/out/schema/overture-match.js.map +1 -0
  318. package/out/{place-importance-schema.d.ts → schema/place-importance.d.ts} +50 -1
  319. package/out/schema/place-importance.d.ts.map +1 -0
  320. package/out/{place-importance-schema.js → schema/place-importance.js} +34 -1
  321. package/out/schema/place-importance.js.map +1 -0
  322. package/out/{polygon-schema.d.ts → schema/polygon.d.ts} +1 -1
  323. package/out/schema/polygon.d.ts.map +1 -0
  324. package/out/{polygon-schema.js → schema/polygon.js} +1 -1
  325. package/out/schema/polygon.js.map +1 -0
  326. package/out/{unified-schema.d.ts → schema/unified.d.ts} +1 -1
  327. package/out/schema/unified.d.ts.map +1 -0
  328. package/out/{unified-schema.js → schema/unified.js} +1 -1
  329. package/out/schema/unified.js.map +1 -0
  330. package/out/schema.d.ts +3 -3
  331. package/out/sqlite/convention-source.js +1 -1
  332. package/out/sqlite/convention-source.js.map +1 -1
  333. package/out/uprn/existence.d.ts.map +1 -1
  334. package/out/uprn/existence.js +2 -0
  335. package/out/uprn/existence.js.map +1 -1
  336. package/out/{weights-overlay-linker.d.ts → weights/overlay-linker.d.ts} +43 -24
  337. package/out/weights/overlay-linker.d.ts.map +1 -0
  338. package/out/{weights-overlay-linker.js → weights/overlay-linker.js} +182 -66
  339. package/out/weights/overlay-linker.js.map +1 -0
  340. package/package.json +12 -32
  341. package/lib/postal.ts +0 -6
  342. package/lib/street/locale.ts +0 -64
  343. package/lib/street.ts +0 -11
  344. package/out/candidate/extract-fold.d.ts.map +0 -1
  345. package/out/candidate/extract-fold.js.map +0 -1
  346. package/out/capital-schema.d.ts.map +0 -1
  347. package/out/capital-schema.js.map +0 -1
  348. package/out/capitals.d.ts.map +0 -1
  349. package/out/capitals.js.map +0 -1
  350. package/out/coverage-manifest-schema.d.ts.map +0 -1
  351. package/out/coverage-manifest-schema.js.map +0 -1
  352. package/out/exact-match.d.ts.map +0 -1
  353. package/out/exact-match.js.map +0 -1
  354. package/out/extracts.d.ts.map +0 -1
  355. package/out/extracts.js.map +0 -1
  356. package/out/importance-source.d.ts.map +0 -1
  357. package/out/importance-source.js.map +0 -1
  358. package/out/interpolation.d.ts.map +0 -1
  359. package/out/interpolation.js.map +0 -1
  360. package/out/name-score.d.ts.map +0 -1
  361. package/out/name-score.js.map +0 -1
  362. package/out/place-importance-schema.d.ts.map +0 -1
  363. package/out/place-importance-schema.js.map +0 -1
  364. package/out/polygon-schema.d.ts.map +0 -1
  365. package/out/polygon-schema.js.map +0 -1
  366. package/out/postal/city/alias/lookup.d.ts.map +0 -1
  367. package/out/postal/city/alias/lookup.js.map +0 -1
  368. package/out/postal/city/alias/schema.d.ts.map +0 -1
  369. package/out/postal/city/alias/schema.js.map +0 -1
  370. package/out/postal/city/candidate-schema.d.ts.map +0 -1
  371. package/out/postal/city/candidate-schema.js.map +0 -1
  372. package/out/postal.d.ts +0 -4
  373. package/out/postal.d.ts.map +0 -1
  374. package/out/postal.js +0 -6
  375. package/out/postal.js.map +0 -1
  376. package/out/postcode-point-lookup.d.ts.map +0 -1
  377. package/out/postcode-point-lookup.js.map +0 -1
  378. package/out/primary-preference.d.ts.map +0 -1
  379. package/out/primary-preference.js.map +0 -1
  380. package/out/proximity-rerank.d.ts.map +0 -1
  381. package/out/proximity-rerank.js.map +0 -1
  382. package/out/ranking-weights.d.ts.map +0 -1
  383. package/out/ranking-weights.js.map +0 -1
  384. package/out/region-keys.js.map +0 -1
  385. package/out/reverse.d.ts.map +0 -1
  386. package/out/reverse.js.map +0 -1
  387. package/out/search-fetch.d.ts.map +0 -1
  388. package/out/search-fetch.js.map +0 -1
  389. package/out/street/centroid/schema.d.ts.map +0 -1
  390. package/out/street/centroid/schema.js.map +0 -1
  391. package/out/street/centroid.d.ts.map +0 -1
  392. package/out/street/centroid.js.map +0 -1
  393. package/out/street/locale.d.ts +0 -12
  394. package/out/street/locale.d.ts.map +0 -1
  395. package/out/street/locale.js +0 -54
  396. package/out/street/locale.js.map +0 -1
  397. package/out/street/morphology/fst/builder.d.ts.map +0 -1
  398. package/out/street/morphology/fst/builder.js.map +0 -1
  399. package/out/street/morphology/fst/loader.d.ts.map +0 -1
  400. package/out/street/morphology/fst/loader.js.map +0 -1
  401. package/out/street/name-lookup.d.ts.map +0 -1
  402. package/out/street/name-lookup.js.map +0 -1
  403. package/out/street/normalize.d.ts.map +0 -1
  404. package/out/street/normalize.js.map +0 -1
  405. package/out/street/segment-schema.d.ts.map +0 -1
  406. package/out/street/segment-schema.js.map +0 -1
  407. package/out/street/table.d.ts.map +0 -1
  408. package/out/street/table.js.map +0 -1
  409. package/out/street.d.ts +0 -9
  410. package/out/street.d.ts.map +0 -1
  411. package/out/street.js +0 -11
  412. package/out/street.js.map +0 -1
  413. package/out/types.d.ts.map +0 -1
  414. package/out/types.js.map +0 -1
  415. package/out/unified-schema.d.ts.map +0 -1
  416. package/out/unified-schema.js.map +0 -1
  417. package/out/weights-overlay-linker.d.ts.map +0 -1
  418. package/out/weights-overlay-linker.js.map +0 -1
  419. /package/lib/{coverage-manifest-schema.ts → candidate/coverage-manifest.ts} +0 -0
  420. /package/lib/{postal/city → labels/locality/postal-city}/alias/schema.ts +0 -0
  421. /package/lib/{street → labels/street}/morphology/fst/builder.ts +0 -0
  422. /package/lib/{exact-match.ts → lookup/exact-match.ts} +0 -0
  423. /package/lib/{name-score.ts → ranking/name-score.ts} +0 -0
  424. /package/lib/{proximity-rerank.ts → ranking/proximity-rerank.ts} +0 -0
  425. /package/lib/{ranking-weights.ts → ranking/weights.ts} +0 -0
  426. /package/lib/{importance-source.ts → schema/importance-source.ts} +0 -0
  427. /package/lib/{polygon-schema.ts → schema/polygon.ts} +0 -0
  428. /package/lib/{unified-schema.ts → schema/unified.ts} +0 -0
  429. /package/out/{capitals.d.ts → candidate/capitals.d.ts} +0 -0
  430. /package/out/{search-fetch.js → fts/search-fetch.js} +0 -0
  431. /package/out/{postal/city → labels/locality/postal-city}/alias/lookup.js +0 -0
  432. /package/out/{postal/city → labels/locality/postal-city}/alias/schema.d.ts +0 -0
  433. /package/out/{postal/city → labels/locality/postal-city}/alias/schema.js +0 -0
  434. /package/out/{postal/city → labels/locality/postal-city}/candidate-schema.js +0 -0
  435. /package/out/{street → labels/street}/centroid/schema.js +0 -0
  436. /package/out/{street → labels/street}/morphology/fst/builder.d.ts +0 -0
  437. /package/out/{street → labels/street}/morphology/fst/builder.js +0 -0
  438. /package/out/{street → labels/street}/morphology/fst/loader.d.ts +0 -0
  439. /package/out/{street → labels/street}/name-lookup.d.ts +0 -0
  440. /package/out/{street → labels/street}/segment-schema.js +0 -0
  441. /package/out/{street → labels/street}/table.d.ts +0 -0
  442. /package/out/{exact-match.d.ts → lookup/exact-match.d.ts} +0 -0
  443. /package/out/{exact-match.js → lookup/exact-match.js} +0 -0
  444. /package/out/{extracts.d.ts → lookup/extracts.d.ts} +0 -0
  445. /package/out/{types.js → lookup/types.js} +0 -0
  446. /package/out/{name-score.d.ts → ranking/name-score.d.ts} +0 -0
  447. /package/out/{name-score.js → ranking/name-score.js} +0 -0
  448. /package/out/{primary-preference.d.ts → ranking/primary-preference.d.ts} +0 -0
  449. /package/out/{proximity-rerank.d.ts → ranking/proximity-rerank.d.ts} +0 -0
  450. /package/out/{proximity-rerank.js → ranking/proximity-rerank.js} +0 -0
  451. /package/out/{importance-source.d.ts → schema/importance-source.d.ts} +0 -0
  452. /package/out/{importance-source.js → schema/importance-source.js} +0 -0
@@ -1,23 +1,33 @@
1
1
  // SPDX-FileCopyrightText: Teffen Ellis and Mailwoman contributors
2
2
  // SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Commercial
3
3
 
4
+ /**
5
+ * The development weights overlay linker: it links or builds each artifact a weights
6
+ * package declares, from the data root into that package's directory.
7
+ *
8
+ * Each weights package's `scripts/link-dev-weights.ts` is a manifest
9
+ * and a call to `materializeDevOverlay`.
10
+ */
11
+
12
+ import { newestPostcodePrefixFiles, shippedPostcodePrefixName } from "@mailwoman/core/asset/postcode-prefix-files"
13
+ import { md5File } from "@mailwoman/core/crypto/hash"
4
14
  import { dataRootPath, weightsOverlayPath } from "@mailwoman/core/data-root"
5
15
  import { readLocalJSONFile, readLocalTextFile, readLocalBuffer } from "@mailwoman/core/fs/readers"
6
- import { pathExists, statPath, statLink } from "@mailwoman/core/fs/readers/stat"
16
+ import { pathExists, statPath } from "@mailwoman/core/fs/readers/stat"
7
17
  import {
8
18
  createSymbolicLink,
9
19
  makeDirectories,
10
20
  movePath,
11
21
  removePath,
22
+ replaceFileAtomically,
12
23
  writeLocalTextFile,
13
24
  } from "@mailwoman/core/fs/writers"
14
- import { md5File } from "@mailwoman/core/hash"
15
- import { parseJSONStrict } from "@mailwoman/core/json"
16
25
  import { repoRootPath, repoRootPathBuilder, workspacePathBuilder } from "@mailwoman/core/paths"
17
- import { newestPostcodePrefixFiles, shippedPostcodePrefixName } from "@mailwoman/core/postcode-prefix-files"
18
- import { spawnProcessSync } from "@mailwoman/core/process"
19
- import { readReleaseConfig, repoCommittedSoftFeedSources } from "@mailwoman/core/release-config"
26
+ import { readReleaseConfig, repoCommittedSoftFeedSources } from "@mailwoman/core/repo/release-config"
27
+ import { spawnProcessSync } from "@mailwoman/core/scripting/process"
28
+ import { parseJSONStrict } from "@mailwoman/core/values/json"
20
29
  import type { PathBuilder, PathBuilderLike } from "path-ts"
30
+ import { Globerator } from "spliterator/node/fs"
21
31
 
22
32
  import { $public } from "#env"
23
33
  import { fstFreshnessWarning } from "#fst/freshness"
@@ -39,21 +49,6 @@ export async function linkForce(src: PathBuilderLike, dest: PathBuilderLike): Pr
39
49
  await movePath(tmp, dest)
40
50
  }
41
51
 
42
- /**
43
- * Removes a file or symlink at `dest` so that the runtime falls back to the base en-us weights.
44
- */
45
- export async function removeIfPresent(dest: PathBuilder): Promise<void> {
46
- try {
47
- await statLink(dest)
48
- } catch {
49
- return
50
- }
51
-
52
- await removePath(dest)
53
-
54
- console.log(`removed stale local ${dest} (base fallback to en-us engages)`)
55
- }
56
-
57
52
  /**
58
53
  * Symlinks one optional soft-feed artifact into an overlay and returns whether the source existed.
59
54
  *
@@ -310,8 +305,10 @@ export async function warnIfFSTStale(fstPath: PathBuilder, locale: string): Prom
310
305
  /**
311
306
  * Symlinks the per-locale FST gazetteer `fst-<locale>.bin` into an overlay
312
307
  * and checks it with {@link warnIfFSTStale}.
308
+ *
309
+ * @returns Whether the source existed and was linked.
313
310
  */
314
- export async function linkLocaleFST(destDir: PathBuilder, locale: string): Promise<void> {
311
+ export async function linkLocaleFST(destDir: PathBuilder, locale: string): Promise<boolean> {
315
312
  const source = wofDatabasePath("fst-per-locale", `fst-${locale}.bin`)
316
313
 
317
314
  const linked = await linkSoftFeedSibling(
@@ -323,14 +320,19 @@ export async function linkLocaleFST(destDir: PathBuilder, locale: string): Promi
323
320
  if (linked) {
324
321
  await warnIfFSTStale(source, locale)
325
322
  }
323
+
324
+ return linked
326
325
  }
327
326
 
328
327
  /**
329
328
  * Symlinks the newest dated PFX1 postcode-prefix index of each scope into an overlay under
330
329
  * the scope's shipped name, so the anchor-region prior reads the file the package would ship.
330
+ *
331
+ * @returns The overlay names it linked.
331
332
  */
332
- export async function linkPostcodePrefixIndexes(destDir: PathBuilder, scopes: readonly string[]): Promise<void> {
333
+ export async function linkPostcodePrefixIndexes(destDir: PathBuilder, scopes: readonly string[]): Promise<string[]> {
333
334
  const newest = await newestPostcodePrefixFiles()
335
+ const linkedNames: string[] = []
334
336
 
335
337
  for (const scope of scopes) {
336
338
  const file = newest.get(scope)
@@ -345,20 +347,28 @@ export async function linkPostcodePrefixIndexes(destDir: PathBuilder, scopes: re
345
347
  continue
346
348
  }
347
349
 
348
- await linkSoftFeedSibling(
350
+ const linked = await linkSoftFeedSibling(
349
351
  file.path,
350
352
  destDir(name),
351
353
  "the anchor-region prior reads the data-root directory instead."
352
354
  )
355
+
356
+ if (linked) {
357
+ linkedNames.push(name)
358
+ }
353
359
  }
360
+
361
+ return linkedNames
354
362
  }
355
363
 
356
364
  /**
357
365
  * Symlinks the prebuilt street-morphology FST into an overlay so that the
358
366
  * street-context check doesn't rebuild it from dictionaries.
367
+ *
368
+ * @returns Whether the source existed and was linked.
359
369
  */
360
- export async function linkStreetMorphologyFST(destDir: PathBuilder): Promise<void> {
361
- await linkSoftFeedSibling(
370
+ export async function linkStreetMorphologyFST(destDir: PathBuilder): Promise<boolean> {
371
+ return linkSoftFeedSibling(
362
372
  wofDatabasePath("fst-street-morphology.bin"),
363
373
  destDir("fst-street-morphology.bin"),
364
374
  "the street-context check falls back to the per-process dictionary build."
@@ -539,6 +549,7 @@ export async function committedSoftFeedLinks(): Promise<{
539
549
  anchor: SoftFeedLink
540
550
  country: SoftFeedLink
541
551
  streetType: SoftFeedLink | null
552
+ calibration: SoftFeedLink[]
542
553
  }> {
543
554
  const config = await readReleaseConfig()
544
555
  const sources = repoCommittedSoftFeedSources(repoRootPath(), config.softFeed ?? {})
@@ -560,7 +571,14 @@ export async function committedSoftFeedLinks(): Promise<{
560
571
 
561
572
  const streetType = link("street-type-lexicon-v3.json", "the street_type channel will resolve OFF in this worktree.")
562
573
 
563
- return { anchor, country, streetType }
574
+ // The base graph's confidence calibration tables, committed in en-us and shipped by both Latin bases.
575
+ const calibration = ["calibration.json", "calibration-per-locale.json"].map((name) => ({
576
+ source: workspacePathBuilder("neural-weights-en-us", name).toString(),
577
+ name,
578
+ consequenceIfMissing: `the weights overlay lacks ${name}, which the package ships.`,
579
+ }))
580
+
581
+ return { anchor, country, streetType, calibration }
564
582
  }
565
583
 
566
584
  /**
@@ -574,21 +592,23 @@ export interface WeightsCard {
574
592
  /**
575
593
  * Declares what one locale's dev overlay contains. {@link materializeDevOverlay}
576
594
  * runs the steps in the order the fields are listed.
595
+ *
596
+ * The linker owns the overlay directory: it also writes the workspace's `model-card.json`
597
+ * and links every evidence lexicon that card declares under `requires.<channel>.lexicon`,
598
+ * and it removes every entry no step produced.
577
599
  */
578
600
  export interface DevOverlayManifest {
579
601
  /**
580
602
  * The overlay's lowercase locale tag.
581
603
  * The workspace is `neural-weights-<locale>`.
582
604
  *
583
- * Artifacts go to the data root's `weights/<locale>/` overlay because the binaries are kept out of git.
605
+ * Artifacts go to the overlay root's `<locale>/` directory because the binaries are kept out of git.
584
606
  */
585
607
  locale: string
586
608
 
587
609
  /**
588
610
  * How the overlay gets its model files.
589
611
  *
590
- * When it is omitted, `link-weights-overlay.ts` in release-kit handles them.
591
- *
592
612
  * The `link` kind symlinks `model.onnx` and `tokenizer.model` from the
593
613
  * `release.config.json` weights paths under the data root.
594
614
  * The `$MAILWOMAN_DEV_MODEL` and `$MAILWOMAN_DEV_TOKENIZER` variables override those paths.
@@ -596,11 +616,12 @@ export interface DevOverlayManifest {
596
616
  * With `digestCard`, the linked default files must match the `files_md5` of that workspace's card.
597
617
  * An override skips this check.
598
618
  *
599
- * The `inherit` kind removes any local pair, because the package declares
600
- * `mailwoman.baseWeights` and a local file would shadow the base.
619
+ * The `inherit` kind links no graph, because the package declares `mailwoman.baseWeights`
620
+ * and `resolveWeights` reads the base's graph.
621
+ * A package that declares `mailwoman.baseWeights` inherits when the field is omitted,
622
+ * and any other kind is refused.
601
623
  *
602
- * The `char` kind links the `charWeights.<family>` model, character vocabulary and model card.
603
- * It removes any tokenizer.
624
+ * The `char` kind links the `charWeights.<family>` model and character vocabulary.
604
625
  */
605
626
  model?: { kind: "link"; digestCard?: string } | { kind: "inherit" } | { kind: "char"; family: string }
606
627
 
@@ -610,16 +631,6 @@ export interface DevOverlayManifest {
610
631
  */
611
632
  softFeed?: ReadonlyArray<SoftFeedLink>
612
633
 
613
- /**
614
- * Whether to link the evidence lexicons listed under `requires.<channel>.lexicon`
615
- * in the overlay's model card.
616
- * A card update then changes the linked file too.
617
- *
618
- * The street-type lexicon comes from the repo's `data/gazetteer/`.
619
- * The locality-surface lexicon comes from the data root.
620
- */
621
- evidenceLexiconsFromCard?: boolean
622
-
623
634
  /**
624
635
  * The PFX1 postcode-prefix scopes to link as `postcode-prefix-<scope>.bin`, such as `["gb-esw"]`.
625
636
  *
@@ -648,6 +659,13 @@ export interface DevOverlayManifest {
648
659
  * Whether to link the shared street-morphology FST.
649
660
  */
650
661
  streetMorphologyFST?: boolean
662
+
663
+ /**
664
+ * Overlay entries the calling script writes itself after this call,
665
+ * such as en-gb's card-conditional `postcode-gb.bin`.
666
+ * The prune keeps them.
667
+ */
668
+ alsoManages?: readonly string[]
651
669
  }
652
670
 
653
671
  /**
@@ -690,7 +708,12 @@ async function readWeightsCard(workspace: string): Promise<WeightsCard | null> {
690
708
  return readLocalJSONFile<WeightsCard>(path)
691
709
  }
692
710
 
693
- async function linkCharModel(destDir: PathBuilder, family: string): Promise<void> {
711
+ /**
712
+ * Links the character-path family's model and vocabulary, each held to the md5 the family's card records.
713
+ *
714
+ * @returns The overlay names it linked.
715
+ */
716
+ async function linkCharModel(destDir: PathBuilder, family: string): Promise<string[]> {
694
717
  const recipe = (await readReleaseConfig()).charWeights?.[family]
695
718
 
696
719
  if (!recipe) {
@@ -698,6 +721,8 @@ async function linkCharModel(destDir: PathBuilder, family: string): Promise<void
698
721
  }
699
722
 
700
723
  const dataRoot = dataRootPath()
724
+ const digests = (await readWeightsCard(`neural-weights-${family}`))?.files_md5 ?? {}
725
+ const names = ["model.onnx", "char-vocab.json"]
701
726
 
702
727
  for (const [name, relative] of [
703
728
  ["model.onnx", recipe.model],
@@ -709,18 +734,25 @@ async function linkCharModel(destDir: PathBuilder, family: string): Promise<void
709
734
  throw new Error(`missing char-path source ${name} for ${family}: ${source}`)
710
735
  }
711
736
 
737
+ const expected = digests[name]
738
+ const actual = expected ? await md5File(source) : null
739
+
740
+ if (expected && actual !== expected) {
741
+ throw new Error(
742
+ `char-path ${name} md5 ${actual} != ${expected}, the digest neural-weights-${family}/model-card.json records — ` +
743
+ `release.config.json charWeights.${family} and the card name different artifacts.`
744
+ )
745
+ }
746
+
712
747
  await linkForce(source, destDir(name))
713
748
 
714
749
  console.log(`linked ${destDir(name)} ← ${source}`)
715
750
  }
716
751
 
717
- const card = workspacePathBuilder(`neural-weights-${family}`, "model-card.json")
718
-
719
- await linkForce(card, destDir("model-card.json"))
720
- await removeIfPresent(destDir("tokenizer.model"))
752
+ return names
721
753
  }
722
754
 
723
- async function linkBaseModelPair(destDir: PathBuilder, digestCard: string | null): Promise<void> {
755
+ async function linkBaseModelPair(destDir: PathBuilder, digestCard: string | null): Promise<string[]> {
724
756
  const recipe = await readReleaseConfig()
725
757
 
726
758
  const dataRoot = dataRootPath()
@@ -745,38 +777,35 @@ async function linkBaseModelPair(destDir: PathBuilder, digestCard: string | null
745
777
 
746
778
  const dest = destDir(name)
747
779
 
748
- await linkForce(source, dest)
749
-
750
- console.log(`linked ${dest} ← ${source}`)
751
-
752
- if (!digestCard) continue
753
-
754
- if (override) {
780
+ // The digest is checked before the link, so a refused graph never replaces the weights overlay's prior graph.
781
+ if (digestCard && override) {
755
782
  console.error(` (${label} override active — skipping the #397 default-digest check)`)
783
+ } else if (digestCard) {
784
+ const expected = digests?.[name]
756
785
 
757
- continue
758
- }
786
+ if (!expected) {
787
+ throw new Error(
788
+ `#397 guard: ${digestCard}/model-card.json has no files_md5 entry for ${name} — cannot verify the dev pin.`
789
+ )
790
+ }
759
791
 
760
- const expected = digests?.[name]
792
+ const actual = await md5File(source)
761
793
 
762
- if (!expected) {
763
- throw new Error(
764
- `#397 guard: ${digestCard}/model-card.json has no files_md5 entry for ${name} — cannot verify the dev pin.`
765
- )
794
+ if (actual !== expected) {
795
+ throw new Error(
796
+ `#397 guard: default ${label} ${source} md5 ${actual} != shipped ${expected} (${digestCard} model-card files_md5). ` +
797
+ `The dev link has drifted from the shipped default: bump release.config.json weights.${label} and the card's ` +
798
+ `files_md5 in lockstep.`
799
+ )
800
+ }
766
801
  }
767
802
 
768
- const actual = await md5File(dest)
769
-
770
- if (actual !== expected) {
771
- throw new Error(
772
- `#397 guard: linked default ${label} md5 ${actual} != shipped ${expected} (${digestCard} model-card files_md5). ` +
773
- `The dev link has drifted from the shipped default: bump release.config.json weights.${label} and the card's ` +
774
- `files_md5 in lockstep.`
775
- )
776
- }
803
+ await linkForce(source, dest)
777
804
 
778
- console.log(` ${name} digest ok`)
805
+ console.log(`linked ${dest} ← ${source}${digestCard && !override ? " (digest ok)" : ""}`)
779
806
  }
807
+
808
+ return pair.map(({ name }) => name)
780
809
  }
781
810
 
782
811
  async function buildPostcodeBinary(
@@ -830,70 +859,182 @@ async function buildPostcodeBinary(
830
859
  console.log(`built ${dest}`)
831
860
  }
832
861
 
862
+ /**
863
+ * Copies the workspace's `model-card.json` into the overlay.
864
+ *
865
+ * The card is copied rather than linked, so removing the checkout that ran the linker leaves no
866
+ * dangling card, and each run replaces whatever card an earlier run or another checkout left.
867
+ *
868
+ * @returns Whether the workspace has a card.
869
+ */
870
+ async function writeOverlayCard(destDir: PathBuilder, locale: string): Promise<boolean> {
871
+ const source = workspacePathBuilder(`neural-weights-${locale}`, "model-card.json")
872
+
873
+ if (!(await pathExists(source))) return false
874
+
875
+ await replaceFileAtomically(source, destDir("model-card.json"))
876
+
877
+ console.log(`wrote ${destDir("model-card.json")} ← ${source}`)
878
+
879
+ return true
880
+ }
881
+
882
+ /**
883
+ * The literal filenames in a weights workspace's `package.json` `files` list.
884
+ *
885
+ * Globs, negations and the committed documentation and rights files are left out.
886
+ */
887
+ async function declaredArtifacts(locale: string): Promise<string[]> {
888
+ const path = workspacePathBuilder(`neural-weights-${locale}`, "package.json")
889
+
890
+ if (!(await pathExists(path))) return []
891
+
892
+ const { files } = await readLocalJSONFile<{ files?: string[] }>(path)
893
+ const committed = new Set(["README.md", "LICENSE.md", "PROVENANCE.json"])
894
+
895
+ return (files ?? []).filter((name) => !/[*!/]/.test(name) && !committed.has(name))
896
+ }
897
+
898
+ /**
899
+ * Whether an overlay entry is another linker's write still in progress:
900
+ * a {@link linkForce} temporary link or a `replaceFileAtomically` staging file.
901
+ */
902
+ function isInFlightWrite(name: string): boolean {
903
+ return name.endsWith(".tmp-link") || name.includes(".staging-")
904
+ }
905
+
906
+ /**
907
+ * Removes every overlay entry outside `managed`, dangling links included.
908
+ *
909
+ * An entry this run didn't produce is stale, whether an earlier recipe,
910
+ * another checkout or a CI job wrote it.
911
+ * After the prune, the weights overlay directory holds only the files this linker wrote.
912
+ *
913
+ * @returns The removed entry names.
914
+ */
915
+ export async function pruneUnmanagedEntries(destDir: PathBuilder, managed: ReadonlySet<string>): Promise<string[]> {
916
+ const removed: string[] = []
917
+
918
+ for (const pattern of ["*", ".*"]) {
919
+ const names = await Globerator.from(pattern, { cwd: destDir.toString(), onlyFiles: false }).toArray()
920
+
921
+ for (const name of names) {
922
+ if (managed.has(name) || isInFlightWrite(name)) continue
923
+
924
+ await removePath(destDir(name))
925
+
926
+ removed.push(name)
927
+
928
+ console.log(`removed ${destDir(name)} — no step of this linker produces it`)
929
+ }
930
+ }
931
+
932
+ return removed
933
+ }
934
+
833
935
  /**
834
936
  * Materializes one locale's dev weights overlay from its manifest.
937
+ *
938
+ * The linker owns the weights overlay directory.
939
+ * It writes the workspace's card and links every evidence lexicon the card declares.
940
+ *
941
+ * It then removes every entry no step produced.
942
+ * The card and the graph therefore come from the checkout that ran it.
835
943
  */
836
944
  export async function materializeDevOverlay(manifest: DevOverlayManifest): Promise<DevOverlay> {
945
+ // The self-hosted runners share the lab host's data root with every developer checkout,
946
+ // so a CI job that wrote its overlay there would leave links into its own `_work` checkout.
947
+ if ($public.GITHUB_ACTIONS && !$public.MAILWOMAN_WEIGHTS_OVERLAY_ROOT) {
948
+ throw new Error(
949
+ `refusing to link the ${manifest.locale} dev overlay into the shared ${weightsOverlayPath(manifest.locale)} ` +
950
+ `from a CI job: set MAILWOMAN_WEIGHTS_OVERLAY_ROOT to a per-job directory, such as $RUNNER_TEMP/weights-overlay.`
951
+ )
952
+ }
953
+
837
954
  const destDir = weightsOverlayPath(manifest.locale)
838
955
  const cli = workspacePathBuilder("mailwoman", "out", "cli", "main.js")
839
956
  const card = await readWeightsCard(`neural-weights-${manifest.locale}`)
957
+ const managed = new Set<string>(manifest.alsoManages)
840
958
 
841
959
  await makeDirectories(destDir)
842
960
 
843
- // A package that declares `mailwoman.baseWeights` inherits its graph whatever the manifest lists,
844
- // because `resolveWeights` takes the base's graph over a file in the overlay directory.
845
- const inherits =
846
- manifest.model?.kind === "inherit" || (!manifest.model && (await declaresBaseWeights(manifest.locale)))
847
-
848
- if (inherits) {
849
- await removeIfPresent(destDir("model.onnx"))
850
- await removeIfPresent(destDir("tokenizer.model"))
961
+ // `resolveWeights` takes the base's graph over a file in the overlay directory,
962
+ // so a graph linked here would never be read.
963
+ if (await declaresBaseWeights(manifest.locale)) {
964
+ if (manifest.model && manifest.model.kind !== "inherit") {
965
+ throw new Error(
966
+ `neural-weights-${manifest.locale} declares mailwoman.baseWeights, so its overlay inherits the base's graph; ` +
967
+ `its manifest asks for model kind "${manifest.model.kind}".`
968
+ )
969
+ }
851
970
  } else if (manifest.model?.kind === "link") {
852
- await linkBaseModelPair(destDir, manifest.model.digestCard ?? null)
971
+ for (const name of await linkBaseModelPair(destDir, manifest.model.digestCard ?? null)) {
972
+ managed.add(name)
973
+ }
853
974
  } else if (manifest.model?.kind === "char") {
854
- await linkCharModel(destDir, manifest.model.family)
975
+ for (const name of await linkCharModel(destDir, manifest.model.family)) {
976
+ managed.add(name)
977
+ }
855
978
  }
856
979
 
857
- for (const { source, name, consequenceIfMissing } of manifest.softFeed ?? []) {
858
- await linkSoftFeedSibling(source, destDir(name), consequenceIfMissing)
980
+ if (await writeOverlayCard(destDir, manifest.locale)) {
981
+ managed.add("model-card.json")
859
982
  }
860
983
 
861
- if (manifest.evidenceLexiconsFromCard) {
862
- for (const { channel, source } of EVIDENCE_LEXICON_SOURCES) {
863
- const declared = card?.requires?.[channel]?.lexicon
984
+ const links: SoftFeedLink[] = [...(manifest.softFeed ?? [])]
864
985
 
865
- if (!declared) {
866
- console.error(`WARNING: model-card declares no requires.${channel}.lexicon — the ${channel} channel stays OFF.`)
986
+ for (const { channel, source } of EVIDENCE_LEXICON_SOURCES) {
987
+ const declared = card?.requires?.[channel]?.lexicon
867
988
 
868
- continue
869
- }
989
+ if (declared) {
990
+ links.push({
991
+ source: source(declared).toString(),
992
+ name: declared,
993
+ consequenceIfMissing: `the ${channel} channel will resolve OFF in this worktree.`,
994
+ })
995
+ }
996
+ }
870
997
 
871
- await linkSoftFeedSibling(
872
- source(declared),
873
- destDir(declared),
874
- `the ${channel} channel will resolve OFF in this worktree.`
875
- )
998
+ for (const { source, name, consequenceIfMissing } of links) {
999
+ if (await linkSoftFeedSibling(source, destDir(name), consequenceIfMissing)) {
1000
+ managed.add(name)
876
1001
  }
877
1002
  }
878
1003
 
879
1004
  if (manifest.postcodeBinary) {
1005
+ managed.add(`postcode-${manifest.postcodeBinary.country.toLowerCase()}.bin`)
1006
+
880
1007
  await buildPostcodeBinary(destDir, cli, manifest.postcodeBinary)
881
1008
  }
882
1009
 
883
1010
  if (manifest.pairIndex) {
1011
+ managed.add(`pair-index-${manifest.pairIndex.country}.bin`)
1012
+
884
1013
  await buildPairIndexOverlay({ packageDir: `neural-weights-${manifest.locale}`, ...manifest.pairIndex })
885
1014
  }
886
1015
 
887
- if (manifest.localeFST) {
888
- await linkLocaleFST(destDir, manifest.locale)
1016
+ if (manifest.localeFST && (await linkLocaleFST(destDir, manifest.locale))) {
1017
+ managed.add(`fst-${manifest.locale}.bin`)
889
1018
  }
890
1019
 
891
- if (manifest.streetMorphologyFST) {
892
- await linkStreetMorphologyFST(destDir)
1020
+ if (manifest.streetMorphologyFST && (await linkStreetMorphologyFST(destDir))) {
1021
+ managed.add("fst-street-morphology.bin")
893
1022
  }
894
1023
 
895
1024
  if (manifest.postcodePrefixScopes?.length) {
896
- await linkPostcodePrefixIndexes(destDir, manifest.postcodePrefixScopes)
1025
+ for (const name of await linkPostcodePrefixIndexes(destDir, manifest.postcodePrefixScopes)) {
1026
+ managed.add(name)
1027
+ }
1028
+ }
1029
+
1030
+ await pruneUnmanagedEntries(destDir, managed)
1031
+
1032
+ const undelivered = (await declaredArtifacts(manifest.locale)).filter((name) => !managed.has(name))
1033
+
1034
+ if (undelivered.length) {
1035
+ console.error(
1036
+ `WARNING: neural-weights-${manifest.locale} ships ${undelivered.join(", ")}, and this overlay holds none of them.`
1037
+ )
897
1038
  }
898
1039
 
899
1040
  return { destDir, cli, card }
@@ -5,7 +5,7 @@
5
5
  * the same postcode, street and number, so the layer build may drop it.
6
6
  */
7
7
  import { haversine } from "@mailwoman/spatial/geometries/point/distance";
8
- import { normalizeLocalityForKey } from "#street/normalize";
8
+ import { normalizeLocalityForKey } from "#labels/street/normalize";
9
9
  /**
10
10
  * The farthest apart two records' points may lie, in kilometers, while their localities disagree.
11
11
  */
@@ -1 +1 @@
1
- {"version":3,"file":"duplicate.js","sourceRoot":"","sources":["../../lib/address/duplicate.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;;GAGG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,8CAA8C,CAAA;AAExE,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAA;AAE3D;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAA;AAE9C;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAA;AAmC9C;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAA6B;IAChE,OAAO,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC,C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AA0B,EAAE,KAAyB;IACnF,MAAM,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC,CAAA;IAC9B,MAAM,CAAC,GAAG,YAAY,CAAC,KAAK,CAAC,CAAA;IAC7B,MAAM,QAAQ,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;IAEhF,IAAI,CAAC,QAAQ;QAAE,OAAO,IAAI,CAAA;IAE1B,IAAI,MAAM,CAAC,KAAK,GAAG,6BAA6B,IAAI,KAAK,CAAC,KAAK,GAAG,6BAA6B;QAAE,OAAO,IAAI,CAAA;IAE5G,OAAO,SAAS,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,CAAC,IAAI,6BAA6B,CAAA;AAChG,CAAC"}
@@ -1,4 +1,8 @@
1
1
  import { type PathBuilder, type PathBuilderLike } from "path-ts";
2
+ /**
3
+ * The name of the ledger file beside each region's `lookup.db`.
4
+ */
5
+ export declare const ADDRESS_LAYER_ATTRIBUTION_FILE = "ATTRIBUTION.json";
2
6
  /**
3
7
  * One source and authority of a region's rows, with the terms the source records.
4
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"attribution.d.ts","sourceRoot":"","sources":["../../../lib/address/keys/attribution.ts"],"names":[],"mappings":"AAUA,OAAO,EAA+B,KAAK,WAAW,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAK7F;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACvC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,OAAO,EAAE,MAAM,CAAA;IACf;;;OAGG;IACH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GAChD,OAAO,CAAC;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,uBAAuB,EAAE,CAAA;CAAE,CAAC,CA8CpE"}
@@ -8,6 +8,10 @@ import { DatabaseClient } from "@mailwoman/sqlite/client";
8
8
  import { sql } from "kysely";
9
9
  import { dirname, resolvePathBuilder } from "path-ts";
10
10
  import { addressLayerFiles } from "#address/keys/layout";
11
+ /**
12
+ * The name of the ledger file beside each region's `lookup.db`.
13
+ */
14
+ export const ADDRESS_LAYER_ATTRIBUTION_FILE = "ATTRIBUTION.json";
11
15
  /**
12
16
  * The share of a source's rows that may each state an authority value no other row shares
13
17
  * before the source's authority values are read as record identifiers.
@@ -57,7 +61,7 @@ export async function writeAddressLayerAttribution(root, region, version, record
57
61
  return rows.map((row) => ({ ...base, authority: row.authority, records: Number(row.records) }));
58
62
  })
59
63
  .toSorted((left, right) => right.records - left.records);
60
- const path = resolvePathBuilder(dirname(files.lookup), "ATTRIBUTION.json");
64
+ const path = resolvePathBuilder(dirname(files.lookup), ADDRESS_LAYER_ATTRIBUTION_FILE);
61
65
  await writeLocalJSONFile(entries, path);
62
66
  return { path, entries };
63
67
  }
@@ -1 +1 @@
1
- {"version":3,"file":"attribution.js","sourceRoot":"","sources":["../../../lib/address/keys/attribution.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,kEAAkE;AAElE;;GAEG;AAEH,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AACzD,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAA0C,MAAM,SAAS,CAAA;AAE7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAmCxD;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,GAAG,CAAA;AAE5C;;;;;;;GAOG;AACH,MAAM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IAC9B;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,qBAAqB,EAAE,CAAA;IACzC,UAAU,EAAE,eAAe,CAAA;IAC3B,UAAU,EAAE,eAAe,CAAA;IAC3B;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,eAAe,CAAA;IAClC;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IACtC;;;;OAIG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,MAAM,GAAG,IAAI,CAAA;IACvD;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,oBAAoB,CAAA;CACjC;AAED;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,OAAO,CAAA;AAE7C;;;GAGG;AACH,MAAM,WAAW,wBAAwB;IACxC,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAA;IACjC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B;;OAEG;IACH,sBAAsB,EAAE,MAAM,CAAA;IAC9B;;OAEG;IACH,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACrC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;CAC/C;AAwBD;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAoC5G"}
@@ -10,10 +10,10 @@
10
10
  import { ByteFormatter } from "@mailwoman/core/fs/formatters";
11
11
  import { readFilesystemSpace, statPath } from "@mailwoman/core/fs/readers/stat";
12
12
  import { makeDirectories, removePathIfPresent } from "@mailwoman/core/fs/writers";
13
- import { parseJSONStrict, stringifyJSON } from "@mailwoman/core/json";
14
13
  import { sourcePresentCoverageCells } from "@mailwoman/core/layers";
15
14
  import { writeLayerCoverage, writeLayerManifest } from "@mailwoman/core/layers/manifest";
16
15
  import { createLayerCoverageTable, createLayerManifestTable } from "@mailwoman/core/layers/schema";
16
+ import { parseJSONStrict, stringifyJSON } from "@mailwoman/core/values/json";
17
17
  import { shortCellToInt } from "@mailwoman/spatial";
18
18
  import { DatabaseClient } from "@mailwoman/sqlite/client";
19
19
  import { buildSealedArtifact } from "@mailwoman/sqlite/sealed/build";