@mailwoman/resolver-wof-sqlite 10.0.0 → 10.2.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 (477) hide show
  1. package/README.md +9 -8
  2. package/lib/address/point/interpolation.ts +45 -39
  3. package/lib/address/point/schema.ts +17 -40
  4. package/lib/address/point.ts +316 -0
  5. package/lib/{address/index.ts → address.ts} +1 -1
  6. package/lib/ancestry/backfill.ts +20 -86
  7. package/lib/{ancestry/index.ts → ancestry.ts} +19 -15
  8. package/lib/build/candidate.ts +122 -174
  9. package/lib/build/population-corrections.ts +64 -0
  10. package/lib/build/slim.ts +44 -114
  11. package/lib/candidate/alias-bags.ts +16 -17
  12. package/lib/candidate/ancestors/schema.ts +77 -61
  13. package/lib/candidate/ancestors/sidecar.ts +15 -22
  14. package/lib/candidate/country-display-names.ts +6 -20
  15. package/lib/candidate/extract-fold.ts +10 -55
  16. package/lib/candidate/fts.ts +5 -23
  17. package/lib/candidate/importance.ts +65 -68
  18. package/lib/candidate/lookup.ts +124 -415
  19. package/lib/candidate/name-roles.ts +15 -33
  20. package/lib/candidate/own-name.ts +35 -32
  21. package/lib/candidate/place-attrs.ts +20 -13
  22. package/lib/candidate/schema.ts +29 -65
  23. package/lib/candidate/scoring.ts +54 -93
  24. package/lib/capital-schema.ts +21 -17
  25. package/lib/capitals.ts +29 -27
  26. package/lib/coincident-roles.ts +85 -55
  27. package/lib/convention/schema.ts +15 -16
  28. package/lib/convention.ts +144 -0
  29. package/lib/coverage-manifest-schema.ts +40 -45
  30. package/lib/currency-backfill.ts +34 -79
  31. package/lib/env.ts +1 -1
  32. package/lib/exact-match.ts +32 -21
  33. package/lib/extracts.ts +97 -74
  34. package/lib/fst/autocomplete.ts +54 -37
  35. package/lib/fst/builder.ts +37 -41
  36. package/lib/fst/deserialize-web.ts +16 -17
  37. package/lib/fst/format.ts +41 -23
  38. package/lib/fst/freshness.ts +43 -120
  39. package/lib/fst/matcher.ts +7 -5
  40. package/lib/fst/serialize.ts +54 -74
  41. package/lib/fst/types.ts +78 -75
  42. package/lib/{fst/index.ts → fst.ts} +1 -0
  43. package/lib/fts/query.ts +5 -36
  44. package/lib/fts.ts +280 -0
  45. package/lib/geonames/aliases.ts +73 -144
  46. package/lib/geonames/postal.ts +162 -71
  47. package/lib/index.ts +9 -8
  48. package/lib/interpolation.ts +48 -100
  49. package/lib/lookup.ts +155 -270
  50. package/lib/name-score.ts +9 -7
  51. package/lib/nsul/lookup.ts +37 -54
  52. package/lib/nsul/schema.ts +16 -43
  53. package/lib/paths.ts +159 -0
  54. package/lib/place-importance-schema.ts +62 -169
  55. package/lib/poi/lookup.ts +104 -121
  56. package/lib/poi/schema.ts +42 -26
  57. package/lib/polygon-schema.ts +10 -6
  58. package/lib/postal/city/alias/lookup.ts +22 -40
  59. package/lib/postal/city/alias/schema.ts +14 -10
  60. package/lib/postal/city/candidate-schema.ts +26 -20
  61. package/lib/postcode-point-lookup.ts +8 -27
  62. package/lib/primary-preference.ts +46 -126
  63. package/lib/proximity-rerank.ts +44 -33
  64. package/lib/ranking-weights.ts +105 -78
  65. package/lib/region-keys.ts +70 -42
  66. package/lib/reverse.ts +149 -86
  67. package/lib/schema.ts +73 -50
  68. package/lib/search-fetch.ts +90 -68
  69. package/lib/sqlite/convention-source.ts +15 -23
  70. package/lib/sqlite/utils.ts +19 -22
  71. package/lib/street/centroid/schema.ts +37 -42
  72. package/lib/street/{centroid/index.ts → centroid.ts} +16 -25
  73. package/lib/street/morphology/fst/builder.ts +60 -42
  74. package/lib/street/morphology/fst/loader.ts +40 -32
  75. package/lib/street/name-lookup.ts +45 -41
  76. package/lib/street/normalize.ts +88 -219
  77. package/lib/street/segment-schema.ts +116 -43
  78. package/lib/{street/index.ts → street.ts} +1 -1
  79. package/lib/types.ts +109 -150
  80. package/lib/unified-schema.ts +29 -29
  81. package/lib/uprn/existence.ts +30 -19
  82. package/lib/uprn/lookup.ts +29 -68
  83. package/lib/uprn/schema.ts +18 -40
  84. package/lib/weights-overlay-linker.ts +236 -252
  85. package/out/address/point/interpolation.d.ts +20 -23
  86. package/out/address/point/interpolation.d.ts.map +1 -1
  87. package/out/address/point/interpolation.js +42 -39
  88. package/out/address/point/interpolation.js.map +1 -1
  89. package/out/address/point/schema.d.ts +12 -35
  90. package/out/address/point/schema.d.ts.map +1 -1
  91. package/out/address/point/schema.js +3 -19
  92. package/out/address/point/schema.js.map +1 -1
  93. package/out/address/point.d.ts +57 -0
  94. package/out/address/point.d.ts.map +1 -0
  95. package/out/address/point.js +206 -0
  96. package/out/address/point.js.map +1 -0
  97. package/out/{address/index.js → address.d.ts} +2 -2
  98. package/out/address.d.ts.map +1 -0
  99. package/out/{address/index.d.ts → address.js} +2 -2
  100. package/out/address.js.map +1 -0
  101. package/out/ancestry/backfill.d.ts +11 -64
  102. package/out/ancestry/backfill.d.ts.map +1 -1
  103. package/out/ancestry/backfill.js +14 -74
  104. package/out/ancestry/backfill.js.map +1 -1
  105. package/out/ancestry.d.ts +49 -0
  106. package/out/ancestry.d.ts.map +1 -0
  107. package/out/ancestry.js +59 -0
  108. package/out/ancestry.js.map +1 -0
  109. package/out/build/candidate.d.ts +82 -112
  110. package/out/build/candidate.d.ts.map +1 -1
  111. package/out/build/candidate.js +17 -100
  112. package/out/build/candidate.js.map +1 -1
  113. package/out/build/population-corrections.d.ts +52 -0
  114. package/out/build/population-corrections.d.ts.map +1 -0
  115. package/out/build/population-corrections.js +40 -0
  116. package/out/build/population-corrections.js.map +1 -0
  117. package/out/build/slim.d.ts +8 -44
  118. package/out/build/slim.d.ts.map +1 -1
  119. package/out/build/slim.js +33 -94
  120. package/out/build/slim.js.map +1 -1
  121. package/out/candidate/alias-bags.d.ts +6 -6
  122. package/out/candidate/alias-bags.d.ts.map +1 -1
  123. package/out/candidate/alias-bags.js +16 -17
  124. package/out/candidate/alias-bags.js.map +1 -1
  125. package/out/candidate/ancestors/schema.d.ts +73 -57
  126. package/out/candidate/ancestors/schema.d.ts.map +1 -1
  127. package/out/candidate/ancestors/schema.js +56 -48
  128. package/out/candidate/ancestors/schema.js.map +1 -1
  129. package/out/candidate/ancestors/sidecar.d.ts +3 -8
  130. package/out/candidate/ancestors/sidecar.d.ts.map +1 -1
  131. package/out/candidate/ancestors/sidecar.js +15 -22
  132. package/out/candidate/ancestors/sidecar.js.map +1 -1
  133. package/out/candidate/country-display-names.d.ts +5 -15
  134. package/out/candidate/country-display-names.d.ts.map +1 -1
  135. package/out/candidate/country-display-names.js +6 -20
  136. package/out/candidate/country-display-names.js.map +1 -1
  137. package/out/candidate/extract-fold.d.ts +7 -15
  138. package/out/candidate/extract-fold.d.ts.map +1 -1
  139. package/out/candidate/extract-fold.js +5 -47
  140. package/out/candidate/extract-fold.js.map +1 -1
  141. package/out/candidate/fts.d.ts +5 -23
  142. package/out/candidate/fts.d.ts.map +1 -1
  143. package/out/candidate/fts.js +5 -23
  144. package/out/candidate/fts.js.map +1 -1
  145. package/out/candidate/importance.d.ts +60 -65
  146. package/out/candidate/importance.d.ts.map +1 -1
  147. package/out/candidate/importance.js +56 -63
  148. package/out/candidate/importance.js.map +1 -1
  149. package/out/candidate/lookup.d.ts +18 -55
  150. package/out/candidate/lookup.d.ts.map +1 -1
  151. package/out/candidate/lookup.js +82 -385
  152. package/out/candidate/lookup.js.map +1 -1
  153. package/out/candidate/name-roles.d.ts +9 -21
  154. package/out/candidate/name-roles.d.ts.map +1 -1
  155. package/out/candidate/name-roles.js +15 -33
  156. package/out/candidate/name-roles.js.map +1 -1
  157. package/out/candidate/own-name.d.ts +23 -25
  158. package/out/candidate/own-name.d.ts.map +1 -1
  159. package/out/candidate/own-name.js +35 -32
  160. package/out/candidate/own-name.js.map +1 -1
  161. package/out/candidate/place-attrs.d.ts +20 -13
  162. package/out/candidate/place-attrs.d.ts.map +1 -1
  163. package/out/candidate/place-attrs.js +4 -5
  164. package/out/candidate/place-attrs.js.map +1 -1
  165. package/out/candidate/schema.d.ts +27 -62
  166. package/out/candidate/schema.d.ts.map +1 -1
  167. package/out/candidate/schema.js +10 -22
  168. package/out/candidate/schema.js.map +1 -1
  169. package/out/candidate/scoring.d.ts +7 -8
  170. package/out/candidate/scoring.d.ts.map +1 -1
  171. package/out/candidate/scoring.js +52 -89
  172. package/out/candidate/scoring.js.map +1 -1
  173. package/out/capital-schema.d.ts +21 -17
  174. package/out/capital-schema.d.ts.map +1 -1
  175. package/out/capital-schema.js +17 -15
  176. package/out/capital-schema.js.map +1 -1
  177. package/out/capitals.d.ts +27 -25
  178. package/out/capitals.d.ts.map +1 -1
  179. package/out/capitals.js +23 -21
  180. package/out/capitals.js.map +1 -1
  181. package/out/coincident-roles.d.ts +60 -43
  182. package/out/coincident-roles.d.ts.map +1 -1
  183. package/out/coincident-roles.js +72 -50
  184. package/out/coincident-roles.js.map +1 -1
  185. package/out/convention/schema.d.ts +14 -14
  186. package/out/convention/schema.d.ts.map +1 -1
  187. package/out/convention/schema.js +6 -4
  188. package/out/convention/schema.js.map +1 -1
  189. package/out/convention.d.ts +97 -0
  190. package/out/convention.d.ts.map +1 -0
  191. package/out/convention.js +81 -0
  192. package/out/convention.js.map +1 -0
  193. package/out/coverage-manifest-schema.d.ts +34 -39
  194. package/out/coverage-manifest-schema.d.ts.map +1 -1
  195. package/out/coverage-manifest-schema.js +25 -34
  196. package/out/coverage-manifest-schema.js.map +1 -1
  197. package/out/currency-backfill.d.ts +16 -38
  198. package/out/currency-backfill.d.ts.map +1 -1
  199. package/out/currency-backfill.js +19 -46
  200. package/out/currency-backfill.js.map +1 -1
  201. package/out/env.d.ts +1 -1
  202. package/out/env.js +1 -1
  203. package/out/exact-match.d.ts +19 -10
  204. package/out/exact-match.d.ts.map +1 -1
  205. package/out/exact-match.js +32 -21
  206. package/out/exact-match.js.map +1 -1
  207. package/out/extracts.d.ts +66 -55
  208. package/out/extracts.d.ts.map +1 -1
  209. package/out/extracts.js +63 -55
  210. package/out/extracts.js.map +1 -1
  211. package/out/fst/autocomplete.d.ts +29 -21
  212. package/out/fst/autocomplete.d.ts.map +1 -1
  213. package/out/fst/autocomplete.js +39 -28
  214. package/out/fst/autocomplete.js.map +1 -1
  215. package/out/fst/builder.d.ts.map +1 -1
  216. package/out/fst/builder.js +37 -41
  217. package/out/fst/builder.js.map +1 -1
  218. package/out/fst/deserialize-web.d.ts +4 -4
  219. package/out/fst/deserialize-web.d.ts.map +1 -1
  220. package/out/fst/deserialize-web.js +15 -16
  221. package/out/fst/deserialize-web.js.map +1 -1
  222. package/out/fst/format.d.ts +41 -23
  223. package/out/fst/format.d.ts.map +1 -1
  224. package/out/fst/format.js +41 -23
  225. package/out/fst/format.js.map +1 -1
  226. package/out/fst/freshness.d.ts +19 -81
  227. package/out/fst/freshness.d.ts.map +1 -1
  228. package/out/fst/freshness.js +31 -94
  229. package/out/fst/freshness.js.map +1 -1
  230. package/out/fst/matcher.d.ts +5 -4
  231. package/out/fst/matcher.d.ts.map +1 -1
  232. package/out/fst/matcher.js +2 -2
  233. package/out/fst/matcher.js.map +1 -1
  234. package/out/fst/serialize.d.ts +28 -28
  235. package/out/fst/serialize.d.ts.map +1 -1
  236. package/out/fst/serialize.js +53 -71
  237. package/out/fst/serialize.js.map +1 -1
  238. package/out/fst/types.d.ts +78 -74
  239. package/out/fst/types.d.ts.map +1 -1
  240. package/out/fst/types.js +1 -4
  241. package/out/fst/types.js.map +1 -1
  242. package/out/{fst/index.js → fst.d.ts} +2 -1
  243. package/out/fst.d.ts.map +1 -0
  244. package/out/{fst/index.d.ts → fst.js} +2 -1
  245. package/out/fst.js.map +1 -0
  246. package/out/fts/query.d.ts +2 -27
  247. package/out/fts/query.d.ts.map +1 -1
  248. package/out/fts/query.js +5 -36
  249. package/out/fts/query.js.map +1 -1
  250. package/out/fts.d.ts +126 -0
  251. package/out/fts.d.ts.map +1 -0
  252. package/out/fts.js +188 -0
  253. package/out/fts.js.map +1 -0
  254. package/out/geonames/aliases.d.ts +26 -62
  255. package/out/geonames/aliases.d.ts.map +1 -1
  256. package/out/geonames/aliases.js +45 -117
  257. package/out/geonames/aliases.js.map +1 -1
  258. package/out/geonames/postal.d.ts +84 -44
  259. package/out/geonames/postal.d.ts.map +1 -1
  260. package/out/geonames/postal.js +115 -73
  261. package/out/geonames/postal.js.map +1 -1
  262. package/out/{geonames/index.js → geonames.d.ts} +1 -1
  263. package/out/geonames.d.ts.map +1 -0
  264. package/out/{geonames/index.d.ts → geonames.js} +1 -1
  265. package/out/geonames.js.map +1 -0
  266. package/out/index.d.ts +9 -8
  267. package/out/index.d.ts.map +1 -1
  268. package/out/index.js +6 -5
  269. package/out/index.js.map +1 -1
  270. package/out/interpolation.d.ts +18 -55
  271. package/out/interpolation.d.ts.map +1 -1
  272. package/out/interpolation.js +27 -69
  273. package/out/interpolation.js.map +1 -1
  274. package/out/lookup.d.ts +23 -51
  275. package/out/lookup.d.ts.map +1 -1
  276. package/out/lookup.js +136 -234
  277. package/out/lookup.js.map +1 -1
  278. package/out/name-score.d.ts +2 -2
  279. package/out/name-score.d.ts.map +1 -1
  280. package/out/name-score.js +9 -7
  281. package/out/name-score.js.map +1 -1
  282. package/out/nsul/lookup.d.ts +33 -34
  283. package/out/nsul/lookup.d.ts.map +1 -1
  284. package/out/nsul/lookup.js +26 -40
  285. package/out/nsul/lookup.js.map +1 -1
  286. package/out/nsul/schema.d.ts +16 -43
  287. package/out/nsul/schema.d.ts.map +1 -1
  288. package/out/nsul/schema.js +9 -35
  289. package/out/nsul/schema.js.map +1 -1
  290. package/out/{nsul/index.d.ts → nsul.d.ts} +1 -1
  291. package/out/nsul.d.ts.map +1 -0
  292. package/out/{nsul/index.js → nsul.js} +1 -1
  293. package/out/nsul.js.map +1 -0
  294. package/out/paths.d.ts +124 -0
  295. package/out/paths.d.ts.map +1 -0
  296. package/out/paths.js +104 -0
  297. package/out/paths.js.map +1 -0
  298. package/out/place-importance-schema.d.ts +51 -143
  299. package/out/place-importance-schema.d.ts.map +1 -1
  300. package/out/place-importance-schema.js +28 -143
  301. package/out/place-importance-schema.js.map +1 -1
  302. package/out/poi/lookup.d.ts +40 -47
  303. package/out/poi/lookup.d.ts.map +1 -1
  304. package/out/poi/lookup.js +69 -96
  305. package/out/poi/lookup.js.map +1 -1
  306. package/out/poi/schema.d.ts +41 -25
  307. package/out/poi/schema.d.ts.map +1 -1
  308. package/out/poi/schema.js +25 -17
  309. package/out/poi/schema.js.map +1 -1
  310. package/out/{poi/index.js → poi.d.ts} +1 -1
  311. package/out/poi.d.ts.map +1 -0
  312. package/out/{poi/index.d.ts → poi.js} +1 -1
  313. package/out/poi.js.map +1 -0
  314. package/out/polygon-schema.d.ts +10 -6
  315. package/out/polygon-schema.d.ts.map +1 -1
  316. package/out/polygon-schema.js +2 -2
  317. package/out/polygon-schema.js.map +1 -1
  318. package/out/postal/city/alias/lookup.d.ts +20 -23
  319. package/out/postal/city/alias/lookup.d.ts.map +1 -1
  320. package/out/postal/city/alias/lookup.js +17 -30
  321. package/out/postal/city/alias/lookup.js.map +1 -1
  322. package/out/postal/city/alias/schema.d.ts +14 -10
  323. package/out/postal/city/alias/schema.d.ts.map +1 -1
  324. package/out/postal/city/alias/schema.js +10 -8
  325. package/out/postal/city/alias/schema.js.map +1 -1
  326. package/out/postal/city/candidate-schema.d.ts +25 -19
  327. package/out/postal/city/candidate-schema.d.ts.map +1 -1
  328. package/out/postal/city/candidate-schema.js +21 -17
  329. package/out/postal/city/candidate-schema.js.map +1 -1
  330. package/out/{postal/index.d.ts → postal.d.ts} +1 -1
  331. package/out/postal.d.ts.map +1 -0
  332. package/out/{postal/index.js → postal.js} +1 -1
  333. package/out/postal.js.map +1 -0
  334. package/out/postcode-point-lookup.d.ts +6 -24
  335. package/out/postcode-point-lookup.d.ts.map +1 -1
  336. package/out/postcode-point-lookup.js +5 -17
  337. package/out/postcode-point-lookup.js.map +1 -1
  338. package/out/primary-preference.d.ts +38 -92
  339. package/out/primary-preference.d.ts.map +1 -1
  340. package/out/primary-preference.js +15 -99
  341. package/out/primary-preference.js.map +1 -1
  342. package/out/proximity-rerank.d.ts +41 -30
  343. package/out/proximity-rerank.d.ts.map +1 -1
  344. package/out/proximity-rerank.js +38 -29
  345. package/out/proximity-rerank.js.map +1 -1
  346. package/out/ranking-weights.d.ts +98 -64
  347. package/out/ranking-weights.d.ts.map +1 -1
  348. package/out/ranking-weights.js +26 -25
  349. package/out/ranking-weights.js.map +1 -1
  350. package/out/region-keys.d.ts +50 -31
  351. package/out/region-keys.d.ts.map +1 -1
  352. package/out/region-keys.js +68 -40
  353. package/out/region-keys.js.map +1 -1
  354. package/out/reverse.d.ts +78 -50
  355. package/out/reverse.d.ts.map +1 -1
  356. package/out/reverse.js +98 -61
  357. package/out/reverse.js.map +1 -1
  358. package/out/schema.d.ts +72 -49
  359. package/out/schema.d.ts.map +1 -1
  360. package/out/schema.js +4 -5
  361. package/out/schema.js.map +1 -1
  362. package/out/search-fetch.d.ts +16 -12
  363. package/out/search-fetch.d.ts.map +1 -1
  364. package/out/search-fetch.js +83 -63
  365. package/out/search-fetch.js.map +1 -1
  366. package/out/sqlite/convention-source.d.ts +12 -16
  367. package/out/sqlite/convention-source.d.ts.map +1 -1
  368. package/out/sqlite/convention-source.js +13 -22
  369. package/out/sqlite/convention-source.js.map +1 -1
  370. package/out/sqlite/utils.d.ts +19 -19
  371. package/out/sqlite/utils.d.ts.map +1 -1
  372. package/out/sqlite/utils.js +14 -15
  373. package/out/sqlite/utils.js.map +1 -1
  374. package/out/street/centroid/schema.d.ts +37 -42
  375. package/out/street/centroid/schema.d.ts.map +1 -1
  376. package/out/street/centroid/schema.js +9 -21
  377. package/out/street/centroid/schema.js.map +1 -1
  378. package/out/street/centroid.d.ts +30 -0
  379. package/out/street/centroid.d.ts.map +1 -0
  380. package/out/street/{centroid/index.js → centroid.js} +13 -24
  381. package/out/street/centroid.js.map +1 -0
  382. package/out/street/morphology/fst/builder.d.ts +20 -10
  383. package/out/street/morphology/fst/builder.d.ts.map +1 -1
  384. package/out/street/morphology/fst/builder.js +44 -34
  385. package/out/street/morphology/fst/builder.js.map +1 -1
  386. package/out/street/morphology/fst/loader.d.ts +33 -26
  387. package/out/street/morphology/fst/loader.d.ts.map +1 -1
  388. package/out/street/morphology/fst/loader.js +23 -22
  389. package/out/street/morphology/fst/loader.js.map +1 -1
  390. package/out/street/name-lookup.d.ts +24 -18
  391. package/out/street/name-lookup.d.ts.map +1 -1
  392. package/out/street/name-lookup.js +34 -35
  393. package/out/street/name-lookup.js.map +1 -1
  394. package/out/street/normalize.d.ts +35 -136
  395. package/out/street/normalize.d.ts.map +1 -1
  396. package/out/street/normalize.js +77 -194
  397. package/out/street/normalize.js.map +1 -1
  398. package/out/street/segment-schema.d.ts +79 -39
  399. package/out/street/segment-schema.d.ts.map +1 -1
  400. package/out/street/segment-schema.js +71 -21
  401. package/out/street/segment-schema.js.map +1 -1
  402. package/out/{street/index.js → street.d.ts} +2 -2
  403. package/out/street.d.ts.map +1 -0
  404. package/out/{street/index.d.ts → street.js} +2 -2
  405. package/out/street.js.map +1 -0
  406. package/out/types.d.ts +84 -149
  407. package/out/types.d.ts.map +1 -1
  408. package/out/types.js +0 -6
  409. package/out/types.js.map +1 -1
  410. package/out/unified-schema.d.ts +8 -12
  411. package/out/unified-schema.d.ts.map +1 -1
  412. package/out/unified-schema.js +29 -29
  413. package/out/unified-schema.js.map +1 -1
  414. package/out/uprn/existence.d.ts +28 -17
  415. package/out/uprn/existence.d.ts.map +1 -1
  416. package/out/uprn/existence.js +26 -16
  417. package/out/uprn/existence.js.map +1 -1
  418. package/out/uprn/lookup.d.ts +14 -44
  419. package/out/uprn/lookup.d.ts.map +1 -1
  420. package/out/uprn/lookup.js +21 -57
  421. package/out/uprn/lookup.js.map +1 -1
  422. package/out/uprn/schema.d.ts +18 -40
  423. package/out/uprn/schema.d.ts.map +1 -1
  424. package/out/uprn/schema.js +10 -32
  425. package/out/uprn/schema.js.map +1 -1
  426. package/out/{uprn/index.d.ts → uprn.d.ts} +1 -1
  427. package/out/uprn.d.ts.map +1 -0
  428. package/out/{uprn/index.js → uprn.js} +1 -1
  429. package/out/uprn.js.map +1 -0
  430. package/out/weights-overlay-linker.d.ts +138 -144
  431. package/out/weights-overlay-linker.d.ts.map +1 -1
  432. package/out/weights-overlay-linker.js +105 -159
  433. package/out/weights-overlay-linker.js.map +1 -1
  434. package/package.json +91 -596
  435. package/lib/address/point/index.ts +0 -328
  436. package/lib/convention/index.ts +0 -154
  437. package/lib/fts/index.ts +0 -361
  438. package/out/address/index.d.ts.map +0 -1
  439. package/out/address/index.js.map +0 -1
  440. package/out/address/point/index.d.ts +0 -53
  441. package/out/address/point/index.d.ts.map +0 -1
  442. package/out/address/point/index.js +0 -222
  443. package/out/address/point/index.js.map +0 -1
  444. package/out/ancestry/index.d.ts +0 -45
  445. package/out/ancestry/index.d.ts.map +0 -1
  446. package/out/ancestry/index.js +0 -55
  447. package/out/ancestry/index.js.map +0 -1
  448. package/out/convention/index.d.ts +0 -106
  449. package/out/convention/index.d.ts.map +0 -1
  450. package/out/convention/index.js +0 -93
  451. package/out/convention/index.js.map +0 -1
  452. package/out/fst/index.d.ts.map +0 -1
  453. package/out/fst/index.js.map +0 -1
  454. package/out/fts/index.d.ts +0 -184
  455. package/out/fts/index.d.ts.map +0 -1
  456. package/out/fts/index.js +0 -277
  457. package/out/fts/index.js.map +0 -1
  458. package/out/geonames/index.d.ts.map +0 -1
  459. package/out/geonames/index.js.map +0 -1
  460. package/out/nsul/index.d.ts.map +0 -1
  461. package/out/nsul/index.js.map +0 -1
  462. package/out/poi/index.d.ts.map +0 -1
  463. package/out/poi/index.js.map +0 -1
  464. package/out/postal/index.d.ts.map +0 -1
  465. package/out/postal/index.js.map +0 -1
  466. package/out/street/centroid/index.d.ts +0 -40
  467. package/out/street/centroid/index.d.ts.map +0 -1
  468. package/out/street/centroid/index.js.map +0 -1
  469. package/out/street/index.d.ts.map +0 -1
  470. package/out/street/index.js.map +0 -1
  471. package/out/uprn/index.d.ts.map +0 -1
  472. package/out/uprn/index.js.map +0 -1
  473. /package/lib/{geonames/index.ts → geonames.ts} +0 -0
  474. /package/lib/{nsul/index.ts → nsul.ts} +0 -0
  475. /package/lib/{poi/index.ts → poi.ts} +0 -0
  476. /package/lib/{postal/index.ts → postal.ts} +0 -0
  477. /package/lib/{uprn/index.ts → uprn.ts} +0 -0
package/out/fst/format.js CHANGED
@@ -4,22 +4,29 @@
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
6
  * The FST binary-format constants, shared by the Node serializer/deserializer (`fst-serialize.ts`)
7
- * and the browser deserializer (`fst-deserialize-web.ts`). Platform-free by design — no Buffer at
8
- * module scope; both runtimes convert {@link FST_MAGIC_BYTES} themselves.
7
+ * and the browser deserializer (`fst-deserialize-web.ts`). This module stays platform-free.
8
+ * It uses no Buffer at module scope. Both runtimes convert {@link FST_MAGIC_BYTES} themselves.
9
9
  */
10
10
  /**
11
- * Format version this tree WRITES and the maximum either deserializer accepts, published so a freshness guard can call
12
- * an older artifact format-stale without re-typing the number (mirrors `REQUIRED_PAIR_INDEX_SCHEMA`'s role for PIX1 —
13
- * see `fst-freshness.ts`).
11
+ * Format version this tree writes and the maximum either deserializer accepts, published
12
+ * so a freshness guard can call an older artifact format-stale without re-typing the number
13
+ * (mirrors `REQUIRED_PAIR_INDEX_SCHEMA`'s role for PIX1 — see `fst-freshness.ts`).
14
14
  *
15
- * ONE constant for the writer and both readers, deliberately. The browser reader's acceptance criterion was a SEPARATE
16
- * `MAX_VERSION` number from the layout branches, and it drifted twice: left stale at 2 when the v4 wide-state layout
17
- * shipped (rejecting every real artifact), and stale again at 4 through the v5 two-score split until the line moved by
18
- * hand. A check that is the writer's version cannot drift from it.
15
+ * One constant for the writer and both readers, deliberately.
16
+ * The browser reader once kept a separate `MAX_VERSION` from the layout branches.
17
+ *
18
+ * It drifted twice.
19
+ * It stayed at 2 after the v4 wide-state layout shipped and rejected every real artifact.
20
+ *
21
+ * It later stayed at 4 through the v5 two-score split until someone updated it by hand.
22
+ *
23
+ * A check that is the writer's version cannot drift from it.
19
24
  */
20
25
  export const FST_FORMAT_VERSION = 5;
21
26
  /**
22
- * Fixed header size in bytes: magic, version, and the section offsets that follow it.
27
+ * Fixed header size in bytes.
28
+ *
29
+ * It stores the magic and version, followed by section offsets.
23
30
  */
24
31
  export const HEADER_SIZE = 32;
25
32
  /**
@@ -27,8 +34,10 @@ export const HEADER_SIZE = 32;
27
34
  */
28
35
  export const EDGE_ENTRY_SIZE = 8;
29
36
  /**
30
- * Format version that widened the per-state edge and place counters from 16 to 32 bits, growing the state entry from 12
31
- * to 16 bytes. Readers branch on it to stay backward-compatible with v2/v3 files.
37
+ * Format version that widened the per-state edge and place counters from 16 to 32 bits,
38
+ * growing the state entry from 12 to 16 bytes.
39
+ *
40
+ * Readers branch on it to stay backward-compatible with v2/v3 files.
32
41
  */
33
42
  export const VERSION_WIDE_STATE_COUNTERS = 4;
34
43
  /**
@@ -40,13 +49,14 @@ export const WIDE_STATE_ENTRY_SIZE = 16;
40
49
  */
41
50
  export const NARROW_STATE_ENTRY_SIZE = 12;
42
51
  /**
43
- * First format version carrying the trailing metadata block; older files simply have none.
52
+ * First format version carrying the trailing metadata block.
53
+ * Older files simply have none.
44
54
  */
45
55
  export const VERSION_WITH_METADATA = 3;
46
56
  /**
47
- * Format version that split the single `importance` float into `referential` + `encyclopedic` (ROAD_TO_V9 §2 R1),
48
- * growing the place entry from 56 to 60 bytes and claiming the previously-reserved `pp+7` byte as
49
- * {@link PLACE_FLAG_HAS_ENCYCLOPEDIC}.
57
+ * Format version that split the single `importance` float into `referential` +
58
+ * `encyclopedic` (ROAD_TO_V9 §2 R1), growing the place entry from 56 to 60 bytes
59
+ * and claiming the previously-reserved `pp+7` byte as {@link PLACE_FLAG_HAS_ENCYCLOPEDIC}.
50
60
  */
51
61
  export const VERSION_TWO_SCORE_SPLIT = 5;
52
62
  /**
@@ -58,22 +68,30 @@ export const SPLIT_PLACE_ENTRY_SIZE = 60;
58
68
  */
59
69
  export const LEGACY_PLACE_ENTRY_SIZE = 56;
60
70
  /**
61
- * Byte offset of the encyclopedic float inside a v5 place entry — immediately after the 8-slot parent chain.
71
+ * Byte offset of the encyclopedic float inside a v5 place entry — immediately
72
+ * after the 8-slot parent chain.
62
73
  */
63
74
  export const ENCYCLOPEDIC_OFFSET = 56;
64
75
  /**
65
- * `placeFlags` bit 0 (byte `pp+7`, v5+): this place carries an encyclopedic score. Per-PLACE rather than per-file
66
- * because absence is the common case — roughly 89% of the 2026-08-05 gazetteer has no Wikipedia article — and a
67
- * file-level flag would force every one of those rows to claim a 0 it never had.
76
+ * `placeFlags` bit 0 (byte `pp+7`, v5+): this place has an encyclopedic score.
77
+ *
78
+ * Per-place rather than per-file because absence is the common case — roughly 89% of
79
+ * the 2026-08-05 gazetteer has no Wikipedia article — and a file-level flag would
80
+ * force every one of those rows to claim a 0 it never had.
68
81
  */
69
82
  export const PLACE_FLAG_HAS_ENCYCLOPEDIC = 1;
70
83
  /**
71
- * File magic, "FST\0" as bytes. A reader rejects anything not starting with these four bytes before parsing further.
84
+ * File magic, "FST\0" as bytes.
85
+ *
86
+ * A reader rejects anything not starting with these four bytes before parsing further.
72
87
  */
73
88
  export const FST_MAGIC_BYTES = [0x46, 0x53, 0x54, 0x00];
74
89
  /**
75
- * Placetypes in hierarchy order, largest first. The index into this array is what gets written into a place entry, so
76
- * REORDERING IT BREAKS EVERY EXISTING FILE — append instead, and bump the version.
90
+ * Placetypes in hierarchy order, largest first.
91
+ *
92
+ * The writer stores each placetype's index in a place entry.
93
+ * A different array order invalidates every existing file.
94
+ * Append entries and bump the version.
77
95
  */
78
96
  export const PLACETYPE_ORDER = [
79
97
  "country",
@@ -1 +1 @@
1
- {"version":3,"file":"format.js","sourceRoot":"","sources":["../../lib/fst/format.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAA;AAEnC;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,G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AG,CAAC,CAAA;AAEhC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAA;AAE5C;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAA;AAEvC;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAA;AAEzC;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAA;AAEtC;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAA;AAExC;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAA;AAExC;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAA;AAEzC;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,EAAE,CAAA;AAErC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAA;AAE5C;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAsB,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AAE1E;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,eAAe,GAA2B;IACtD,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,SAAS;IACT,eAAe;IACf,YAAY;IACZ,QAAQ;IACR,YAAY;IACZ,cAAc;CACd,CAAA"}
@@ -3,43 +3,17 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * Does an `fst-*.bin` still match the gazetteer it was built from?
7
- *
8
- * WHY THIS EXISTS. Every FST artifact is a projection of one WOF admin database, and the admin
9
- * database is a sealed readonly artifact that a rebuild REPLACES. Nothing mechanically tied the two
10
- * together: the 2026-08-04 admin swap (4.87M rows, ancestry repaired, macrohood/microhood ingested)
11
- * left `fst-global-priority.bin` at its 2026-05-28 build and the per-locale set at 2026-07-26, and
12
- * the only way to notice was to compare mtimes by hand. The artifacts kept loading, kept answering
13
- * queries, and answered them from a gazetteer that no longer exists.
14
- *
15
- * `FSTProvenance` already recorded `sourceDB` — the source's PATH, which is exactly the field that
16
- * cannot change when the bytes behind it do. So the stamp gains the source's IDENTITY (md5 + byte
17
- * size) and this module compares it. The shape deliberately mirrors
18
- * `@mailwoman/resolver-wof-sqlite/weights-overlay-linker`'s `pairIndexStaleReason`: one function returning a reason
19
- * string or `undefined`, so a fact added to the stamp cannot be checked by some callers and not
20
- * others — which is how three of the four base linkers ended up unable to notice a PIX1 schema bump.
21
- *
22
- * FORMAT IS PART OF FRESHNESS. The check compares the serializer version too, not just the source
23
- * md5. A guard that checks only the source reads a format-obsolete binary as "current" (the R5
24
- * freshness-guard lesson, format edition), and a file below {@link MIN_STAMPED_FORMAT_VERSION}
25
- * cannot carry a stamp at all — reported as its own reason rather than silently passing.
26
- *
27
- * STALE IS A WARNING, NOT A FAULT. A dev tree with an old FST must still run; the artifact is a
28
- * decode-time bias list, not a correctness dependency. Callers print {@link formatFSTStaleWarning}
29
- * and continue.
6
+ * Does an `fst-*.bin` still match the gazetteer it was built from?
30
7
  */
31
8
  import { type PathBuilderLike } from "path-ts";
32
9
  import type { FSTProvenance } from "#fst/types";
33
10
  /**
34
- * First serializer version carrying the trailing provenance block. Below this a file has no place to put a stamp, so
35
- * "unstamped" is a statement about the FORMAT, not about the builder.
11
+ * First serializer version carrying the trailing provenance block. below it
12
+ * a file has no place to put a stamp.
36
13
  */
37
14
  export declare const MIN_STAMPED_FORMAT_VERSION = 3;
38
15
  /**
39
16
  * What an FST was built from, recorded so a later reader can tell whether that thing still exists.
40
- *
41
- * `bytes` is not redundant with `md5` — it is the field that survives a truncated or half-written source and makes the
42
- * mismatch legible in the warning ("5,273,722,880 → 5,372,076,032" names the rebuild; a hex delta does not).
43
17
  */
44
18
  export interface FSTSourceIdentity {
45
19
  md5: string;
@@ -47,87 +21,51 @@ export interface FSTSourceIdentity {
47
21
  }
48
22
  /**
49
23
  * The stamp fields a freshness guard reads off an artifact, plus the format version it was written at.
50
- *
51
- * Every field is optional because every one of them can be legitimately absent on an artifact that predates it, and the
52
- * meaning-of-zero rule applies to all of them: absent is a distinct state from "matches", and the reasons below say so
53
- * in different words.
54
24
  */
55
25
  export interface FSTStampFields {
56
26
  formatVersion: number;
57
- provenance: FSTProvenance | undefined;
27
+ provenance: FSTProvenance | null;
58
28
  }
59
29
  /**
60
30
  * What a caller expects the artifact to have been built from.
61
- *
62
- * `exclusionPolicy` is optional and caller-supplied on purpose. The policy id lives in
63
- * `mailwoman/gazetteer-pipeline/fst.ts` (which depends on this package, not the other way round), so only the caller
64
- * knows which policy it means — the same split as the pair-index guard, where the format+magnitude half is shared and
65
- * the source-md5 half stays with the script that knows its sources.
66
31
  */
67
32
  export interface FSTExpectation {
68
33
  source: FSTSourceIdentity;
69
34
  /**
70
- * Serializer version to require. Defaults to {@link FST_FORMAT_VERSION} — the version this tree writes — so a caller
71
- * cannot forget the format half of the comparison. Override only to check against a specific older floor.
35
+ * Serializer version to require, defaulting to {@link FST_FORMAT_VERSION}.
72
36
  */
73
- formatVersion?: number;
74
- exclusionPolicy?: string;
37
+ formatVersion?: number | null;
38
+ exclusionPolicy?: string | null;
75
39
  }
76
40
  /**
77
- * Read an artifact's stamp WITHOUT deserializing it — a header seek plus the trailer, three reads totalling a few
78
- * kilobytes. The distinction matters: `fst-global-priority.bin` is 317 MB and this runs on every `yarn test` via the
79
- * weights linkers, so `readFileSync` + `readFSTProvenance` would trade a freshness guard for a slower test suite and
80
- * nobody would keep it.
81
- *
82
- * Returns `undefined` for a file that is absent, too small, or not an FST at all — none of which is this function's
83
- * business to diagnose.
84
- */
85
- export declare function peekFSTStampFields(path: string): Promise<FSTStampFields | undefined>;
86
- /**
87
- * Re-exported from `@mailwoman/core/hash`. This package's own test imports it from here, and the sidecar convention
88
- * below is what it is for.
41
+ * Read an artifact's stamp without deserializing it.
89
42
  */
43
+ export declare function peekFSTStampFields(path: PathBuilderLike): Promise<FSTStampFields | null>;
90
44
  /**
91
45
  * The source identity an FST build should stamp, or a check should compare against.
92
- *
93
- * Uses the `.md5` sidecar convention the weights linkers already established on this exact file: `<path>.md5` in
94
- * md5sum(1) format (`<hash> <filename>`), trusted only while its mtime is at least the source's. An older sidecar is
95
- * recomputed. Without it the admin DB costs 7.3 s per call and the guard would be quietly disabled by whoever noticed
96
- * `yarn test` got slower.
97
- *
98
- * `refreshSidecar` writes the recomputed digest back. Best-effort: a sealed data root or a read-only mount fails the
99
- * write and the caller still gets its answer, because refusing to check freshness on a read-only tree would be the
100
- * wrong trade.
101
46
  */
102
47
  export declare function readWOFSourceIdentity(source: PathBuilderLike, { refreshSidecar }?: {
103
48
  refreshSidecar?: boolean | undefined;
104
49
  }): Promise<FSTSourceIdentity>;
105
50
  /**
106
- * Why an FST artifact is stale against `expected`, or `undefined` when it still matches.
107
- *
108
- * The order is deliberate: FORMAT first (a version-obsolete file is stale whatever its source says), then the presence
109
- * of a stamp, then the source identity, then the build policy. Each returns prose a reader can act on — the reasons are
110
- * printed verbatim into {@link formatFSTStaleWarning}.
51
+ * Why an FST artifact is stale against `expected`, or `null` when it still matches.
111
52
  */
112
- export declare function fstStaleReason(fields: FSTStampFields | undefined, expected: FSTExpectation): string | undefined;
53
+ export declare function fstStaleReason(fields: FSTStampFields | null, expected: FSTExpectation): string | null;
113
54
  /**
114
- * The whole check, for a caller that has a path and a source DB and wants a warning string or nothing.
115
- *
116
- * Returns `undefined` when the artifact is current OR when it is absent — an absent artifact is a different problem
117
- * with a different message, and every existing caller already reports it in place.
55
+ * The whole check, for a caller with a path and a source DB that wants a warning string or none.
118
56
  */
119
57
  export declare function fstFreshnessWarning({ fstPath, sourceDBPath, formatVersion, exclusionPolicy, rebuildCommand, }: {
120
- fstPath: string;
121
- sourceDBPath: string;
122
- formatVersion?: number;
123
- exclusionPolicy?: string;
58
+ fstPath: PathBuilderLike;
59
+ sourceDBPath: PathBuilderLike;
60
+ formatVersion?: number | null;
61
+ exclusionPolicy?: string | null;
124
62
  rebuildCommand: string;
125
- }): Promise<string | undefined>;
63
+ }): Promise<string | null>;
126
64
  /**
127
- * The one warning format, so `grep -r "FST STALE"` finds every site that can emit one.
65
+ * The one warning format, so `grep -r "FST stale"` finds every site that emits one.
128
66
  */
129
67
  export declare function formatFSTStaleWarning({ fstPath, reason, rebuildCommand, }: {
130
- fstPath: string;
68
+ fstPath: PathBuilderLike;
131
69
  reason: string;
132
70
  rebuildCommand: string;
133
71
  }): string;
@@ -1 +1 @@
1
- {"version":3,"file":"freshness.d.ts","sourceRoot":"","sources":["../../lib/fst/freshness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAMH,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAGrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAmB/C;;;GAGG;AACH,eAAO,MAAM,0BAA0B,IAAI,CAAA;AAO3C;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IACjC,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;CACb;AAED;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC9B,aAAa,EAAE,MAAM,CAAA;IACrB,UAAU,EAAE,aAAa,GAAG,SAAS,CAAA;CACrC;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc;IAC9B,MAAM,EAAE,iBAAiB,CAAA;IACzB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,eAAe,CAAC,EAAE,MAAM,CAAA;CACxB;AAED;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC,CAwB1F;AAED;;;GAGG;AAEH;;;;;;;;;;;GAWG;AACH,wBAAsB,qBAAqB,CAC1C,MAAM,EAAE,eAAe,EACvB,EA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9B,MAAM,EAAE,iBAAiB,CAAA;IACzB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAC/B;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC,CAwB9F;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CAC1C,MAAM,EAAE,eAAe,EACvB,EAAE,cAAqB,EAAE;;CAAK,GAC5B,OAAO,CAAC,iBAAiB,CAAC,CAsC5B;AAID;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,GAAG,IAAI,EAAE,QAAQ,EAAE,cAAc,GAAG,MAAM,GAAG,IAAI,CAiCrG;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CAAC,EACzC,OAAO,EACP,YAAY,EACZ,aAAa,EACb,eAAe,EACf,cAAc,GACd,EAAE;IACF,OAAO,EAAE,eAAe,CAAA;IACxB,YAAY,EAAE,eAAe,CAAA;IAC7B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC7B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,cAAc,EAAE,MAAM,CAAA;CACtB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAUzB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,EACrC,OAAO,EACP,MAAM,EACN,cAAc,GACd,EAAE;IACF,OAAO,EAAE,eAAe,CAAA;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,EAAE,MAAM,CAAA;CACtB,GAAG,MAAM,CAET"}
@@ -3,107 +3,58 @@
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
5
  *
6
- * Does an `fst-*.bin` still match the gazetteer it was built from?
7
- *
8
- * WHY THIS EXISTS. Every FST artifact is a projection of one WOF admin database, and the admin
9
- * database is a sealed readonly artifact that a rebuild REPLACES. Nothing mechanically tied the two
10
- * together: the 2026-08-04 admin swap (4.87M rows, ancestry repaired, macrohood/microhood ingested)
11
- * left `fst-global-priority.bin` at its 2026-05-28 build and the per-locale set at 2026-07-26, and
12
- * the only way to notice was to compare mtimes by hand. The artifacts kept loading, kept answering
13
- * queries, and answered them from a gazetteer that no longer exists.
14
- *
15
- * `FSTProvenance` already recorded `sourceDB` — the source's PATH, which is exactly the field that
16
- * cannot change when the bytes behind it do. So the stamp gains the source's IDENTITY (md5 + byte
17
- * size) and this module compares it. The shape deliberately mirrors
18
- * `@mailwoman/resolver-wof-sqlite/weights-overlay-linker`'s `pairIndexStaleReason`: one function returning a reason
19
- * string or `undefined`, so a fact added to the stamp cannot be checked by some callers and not
20
- * others — which is how three of the four base linkers ended up unable to notice a PIX1 schema bump.
21
- *
22
- * FORMAT IS PART OF FRESHNESS. The check compares the serializer version too, not just the source
23
- * md5. A guard that checks only the source reads a format-obsolete binary as "current" (the R5
24
- * freshness-guard lesson, format edition), and a file below {@link MIN_STAMPED_FORMAT_VERSION}
25
- * cannot carry a stamp at all — reported as its own reason rather than silently passing.
26
- *
27
- * STALE IS A WARNING, NOT A FAULT. A dev tree with an old FST must still run; the artifact is a
28
- * decode-time bias list, not a correctness dependency. Callers print {@link formatFSTStaleWarning}
29
- * and continue.
6
+ * Does an `fst-*.bin` still match the gazetteer it was built from?
30
7
  */
31
- import { pathExists, readFileRange, readLocalTextFile, statPath } from "@mailwoman/core/fs/readers";
8
+ import { readFileRange, readLocalTextFile } from "@mailwoman/core/fs/readers";
9
+ import { pathExists, statPath } from "@mailwoman/core/fs/readers/stat";
32
10
  import { writeLocalTextFile } from "@mailwoman/core/fs/writers";
33
11
  import { md5File } from "@mailwoman/core/hash";
34
12
  import { tryParsingJSON } from "@mailwoman/core/json";
35
13
  import { basename, resolvePath } from "path-ts";
36
- import { FST_FORMAT_VERSION } from "#fst/serialize";
14
+ import { FST_FORMAT_VERSION } from "#fst/format";
37
15
  /**
38
- * Fixed header size in bytes — mirrors `fst-serialize.ts`'s `HEADER_SIZE`. Duplicated rather than exported across
39
- * because this module reads the header by SEEK (never buffering the file), and the serializer's constant is private to
40
- * its own read/write pair.
16
+ * Fixed header size in bytes, mirroring `fst-serialize.ts`'s private `HEADER_SIZE`.
41
17
  */
42
18
  const HEADER_SIZE = 32;
43
19
  /**
44
- * `"FST\0"` little-endian, the four magic bytes every artifact opens with.
20
+ * `"FST\0"` little-endian, the four bytes every artifact opens with.
45
21
  */
46
22
  const MAGIC = 0x00_54_53_46;
47
- /**
48
- * Byte offset of the u32 trailer offset inside the header (the last of its eight fields).
49
- */
50
23
  const PROVENANCE_OFFSET_FIELD = 28;
51
24
  /**
52
- * First serializer version carrying the trailing provenance block. Below this a file has no place to put a stamp, so
53
- * "unstamped" is a statement about the FORMAT, not about the builder.
25
+ * First serializer version carrying the trailing provenance block. below it
26
+ * a file has no place to put a stamp.
54
27
  */
55
28
  export const MIN_STAMPED_FORMAT_VERSION = 3;
56
- /**
57
- * Hex characters in an md5 digest.
58
- */
59
29
  const MD5_HEX_LENGTH = 32;
60
30
  /**
61
- * Read an artifact's stamp WITHOUT deserializing it — a header seek plus the trailer, three reads totalling a few
62
- * kilobytes. The distinction matters: `fst-global-priority.bin` is 317 MB and this runs on every `yarn test` via the
63
- * weights linkers, so `readFileSync` + `readFSTProvenance` would trade a freshness guard for a slower test suite and
64
- * nobody would keep it.
65
- *
66
- * Returns `undefined` for a file that is absent, too small, or not an FST at all — none of which is this function's
67
- * business to diagnose.
31
+ * Read an artifact's stamp without deserializing it.
68
32
  */
69
33
  export async function peekFSTStampFields(path) {
70
34
  if (!(await pathExists(path)))
71
- return undefined;
35
+ return null;
72
36
  const size = (await statPath(path)).size;
73
37
  if (size < HEADER_SIZE)
74
- return undefined;
38
+ return null;
75
39
  const header = await readFileRange(path, 0, HEADER_SIZE);
76
40
  if (header.readUInt32LE(0) !== MAGIC)
77
- return undefined;
41
+ return null;
78
42
  const formatVersion = header.readUInt16LE(4);
79
43
  if (formatVersion < MIN_STAMPED_FORMAT_VERSION)
80
- return { formatVersion, provenance: undefined };
44
+ return { formatVersion, provenance: null };
81
45
  const trailerStart = header.readUInt32LE(PROVENANCE_OFFSET_FIELD);
82
- // 0 = "this build wrote no trailer" (the serializer's own encoding); anything past EOF is a
83
- // truncated file. Both read as "no stamp", which is what the caller does with them anyway.
46
+ // 0 means this build wrote no trailer and past-EOF means truncated.
47
+ // Both read as no stamp.
84
48
  if (trailerStart === 0 || trailerStart + 4 > size)
85
- return { formatVersion, provenance: undefined };
49
+ return { formatVersion, provenance: null };
86
50
  const jsonLength = (await readFileRange(path, trailerStart, 4)).readUInt32LE(0);
87
51
  if (jsonLength === 0 || trailerStart + 4 + jsonLength > size)
88
- return { formatVersion, provenance: undefined };
52
+ return { formatVersion, provenance: null };
89
53
  const json = await readFileRange(path, trailerStart + 4, jsonLength);
90
- return { formatVersion, provenance: tryParsingJSON(json.toString("utf8")) ?? undefined };
54
+ return { formatVersion, provenance: tryParsingJSON(json.toString("utf8")) ?? null };
91
55
  }
92
- /**
93
- * Re-exported from `@mailwoman/core/hash`. This package's own test imports it from here, and the sidecar convention
94
- * below is what it is for.
95
- */
96
56
  /**
97
57
  * The source identity an FST build should stamp, or a check should compare against.
98
- *
99
- * Uses the `.md5` sidecar convention the weights linkers already established on this exact file: `<path>.md5` in
100
- * md5sum(1) format (`<hash> <filename>`), trusted only while its mtime is at least the source's. An older sidecar is
101
- * recomputed. Without it the admin DB costs 7.3 s per call and the guard would be quietly disabled by whoever noticed
102
- * `yarn test` got slower.
103
- *
104
- * `refreshSidecar` writes the recomputed digest back. Best-effort: a sealed data root or a read-only mount fails the
105
- * write and the caller still gets its answer, because refusing to check freshness on a read-only tree would be the
106
- * wrong trade.
107
58
  */
108
59
  export async function readWOFSourceIdentity(source, { refreshSidecar = true } = {}) {
109
60
  const path = resolvePath(source);
@@ -113,7 +64,7 @@ export async function readWOFSourceIdentity(source, { refreshSidecar = true } =
113
64
  if (hit)
114
65
  return hit;
115
66
  const sidecarPath = `${path}.md5`;
116
- let md5;
67
+ let md5 = null;
117
68
  if (await pathExists(sidecarPath)) {
118
69
  const sidecarStats = await statPath(sidecarPath);
119
70
  if (sidecarStats.mtimeMs >= stats.mtimeMs) {
@@ -130,7 +81,7 @@ export async function readWOFSourceIdentity(source, { refreshSidecar = true } =
130
81
  await writeLocalTextFile(`${md5} ${basename(path)}\n`, sidecarPath);
131
82
  }
132
83
  catch {
133
- // Read-only data root — the digest is still correct, it just isn't cached.
84
+ // Read-only data root: the digest is still correct, only the cache write failed.
134
85
  }
135
86
  }
136
87
  }
@@ -138,18 +89,9 @@ export async function readWOFSourceIdentity(source, { refreshSidecar = true } =
138
89
  sourceIdentityMemo.set(memoKey, identity);
139
90
  return identity;
140
91
  }
141
- /**
142
- * Memo for {@link readWOFSourceIdentity}, keyed on (path, mtimeMs, size) — NOT on path alone, for the same reason
143
- * `computeSurfaceCountryCounts` isn't: the admin DB is a sealed artifact that a rebuild REPLACES, so a path-only memo
144
- * would serve a stale digest against a new file for the life of the process.
145
- */
146
92
  const sourceIdentityMemo = new Map();
147
93
  /**
148
- * Why an FST artifact is stale against `expected`, or `undefined` when it still matches.
149
- *
150
- * The order is deliberate: FORMAT first (a version-obsolete file is stale whatever its source says), then the presence
151
- * of a stamp, then the source identity, then the build policy. Each returns prose a reader can act on — the reasons are
152
- * printed verbatim into {@link formatFSTStaleWarning}.
94
+ * Why an FST artifact is stale against `expected`, or `null` when it still matches.
153
95
  */
154
96
  export function fstStaleReason(fields, expected) {
155
97
  if (!fields)
@@ -170,36 +112,31 @@ export function fstStaleReason(fields, expected) {
170
112
  if (provenance.sourceDBMD5 !== expected.source.md5) {
171
113
  return `source db ${provenance.sourceDBMD5.slice(0, 8)} → ${expected.source.md5.slice(0, 8)} (built ${provenance.builtAt})`;
172
114
  }
173
- // Reached only when the md5s agree, so a size disagreement means one of the two was recorded
174
- // against a different file than it was hashed from. Cheap to check, and it never fires by accident.
175
- if (provenance.sourceDBBytes !== undefined && provenance.sourceDBBytes !== expected.source.bytes) {
115
+ if (provenance.sourceDBBytes != null && provenance.sourceDBBytes !== expected.source.bytes) {
176
116
  return `source db size ${provenance.sourceDBBytes} → ${expected.source.bytes} at a matching md5 — one of the two is misrecorded`;
177
117
  }
178
- if (expected.exclusionPolicy !== undefined && provenance.exclusionPolicy !== expected.exclusionPolicy) {
118
+ if (expected.exclusionPolicy && provenance.exclusionPolicy !== expected.exclusionPolicy) {
179
119
  return `exclusion policy ${provenance.exclusionPolicy ?? "(none)"} → ${expected.exclusionPolicy}`;
180
120
  }
181
- return undefined;
121
+ return null;
182
122
  }
183
123
  /**
184
- * The whole check, for a caller that has a path and a source DB and wants a warning string or nothing.
185
- *
186
- * Returns `undefined` when the artifact is current OR when it is absent — an absent artifact is a different problem
187
- * with a different message, and every existing caller already reports it in place.
124
+ * The whole check, for a caller with a path and a source DB that wants a warning string or none.
188
125
  */
189
126
  export async function fstFreshnessWarning({ fstPath, sourceDBPath, formatVersion, exclusionPolicy, rebuildCommand, }) {
190
127
  if (!(await pathExists(fstPath)) || !(await pathExists(sourceDBPath)))
191
- return undefined;
128
+ return null;
192
129
  const reason = fstStaleReason(await peekFSTStampFields(fstPath), {
193
130
  source: await readWOFSourceIdentity(sourceDBPath),
194
- ...(formatVersion === undefined ? {} : { formatVersion }),
195
- ...(exclusionPolicy === undefined ? {} : { exclusionPolicy }),
131
+ formatVersion: formatVersion ?? null,
132
+ exclusionPolicy: exclusionPolicy ?? null,
196
133
  });
197
- return reason === undefined ? undefined : formatFSTStaleWarning({ fstPath, reason, rebuildCommand });
134
+ return reason ? formatFSTStaleWarning({ fstPath, reason, rebuildCommand }) : null;
198
135
  }
199
136
  /**
200
- * The one warning format, so `grep -r "FST STALE"` finds every site that can emit one.
137
+ * The one warning format, so `grep -r "FST stale"` finds every site that emits one.
201
138
  */
202
139
  export function formatFSTStaleWarning({ fstPath, reason, rebuildCommand, }) {
203
- return `WARNING: FST STALE — ${fstPath}: ${reason}. Rebuild with: ${rebuildCommand}`;
140
+ return `WARNING: FST STALE — ${fstPath.toString()}: ${reason}. Rebuild with: ${rebuildCommand}`;
204
141
  }
205
142
  //# sourceMappingURL=freshness.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"freshness.js","sourceRoot":"","sources":["../../lib/fst/freshness.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AACnG,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAC/D,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAwB,MAAM,SAAS,CAAA;AAErE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAA;AAGnD;;;;GAIG;AACH,MAAM,WAAW,GAAG,EAAE,CAAA;AAEtB;;GAEG;AACH,MAAM,KAAK,GAAG,aAAa,CAAA;AAE3B;;GAEG;AACH,MAAM,uBAAuB,GAAG,EAAE,CAAA;AAElC;;;GAGG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,CAAA;AAE3C;;GAEG;AACH,MAAM,cAAc,GAAG,EAAE,CAAA;AA2CzB;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,IAAY;IACpD,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,IAAI,CAAC,CAAC;QAAE,OAAO,SAAS,CAAA;IAC/C,MAAM,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA;IAExC,IAAI,IAAI,GAAG,WAAW;QAAE,OAAO,SAAS,CAAA;IACxC,MAAM,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,QAAQ,MAAM,QAAQ,CAAC,eAAe,EAAE,CAAA;IAClG,CAAC;IAED,OAAO,IAAI,CAAA;AACZ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,EACzC,OAAO,EACP,YAAY,EACZ,aAAa,EACb,eAAe,EACf,cAAc,GAOd;IACA,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,YAAY,CAAC,CAAC;QAAE,OAAO,IAAI,CAAA;IAElF,MAAM,MAAM,GAAG,cAAc,CAAC,MAAM,kBAAkB,CAAC,OAAO,CAAC,EAAE;QAChE,MAAM,EAAE,MAAM,qBAAqB,CAAC,YAAY,CAAC;QACjD,aAAa,EAAE,aAAa,IAAI,IAAI;QACpC,eAAe,EAAE,eAAe,IAAI,IAAI;KACxC,CAAC,CAAA;IAEF,OAAO,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AAClF,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,qBAAqB,CAAC,EACrC,OAAO,EACP,MAAM,EACN,cAAc,GAKd;IACA,OAAO,wBAAwB,OAAO,CAAC,QAAQ,EAAE,KAAK,MAAM,mBAAmB,cAAc,EAAE,CAAA;AAChG,CAAC"}
@@ -7,7 +7,8 @@
7
7
  * introspection. The structure is a deterministic trie over normalized tokens with PlaceEntry
8
8
  * arrays at accepting states.
9
9
  */
10
- import type { FSTContinuation, FSTMatchResult, FSTQueryResult, PlaceEntry } from "#fst/types";
10
+ import type { AncestrieMatch } from "@mailwoman/ancestrie";
11
+ import type { FSTContinuation, FSTQueryResult, PlaceEntry } from "#fst/types";
11
12
  interface FSTNode {
12
13
  edges: Map<string, number>;
13
14
  places: PlaceEntry[];
@@ -17,8 +18,8 @@ export declare class FSTMatcher {
17
18
  constructor(nodes: FSTNode[]);
18
19
  get stateCount(): number;
19
20
  get placeCount(): number;
20
- walk(tokens: string[]): FSTMatchResult | null;
21
- walkFrom(prev: FSTMatchResult, token: string): FSTMatchResult | null;
21
+ walk(tokens: string[]): AncestrieMatch | null;
22
+ walkFrom(prev: AncestrieMatch, token: string): AncestrieMatch | null;
22
23
  accepting(stateID: number): PlaceEntry[];
23
24
  continuations(stateID: number): FSTContinuation[];
24
25
  query(text: string): FSTQueryResult;
@@ -30,7 +31,7 @@ export declare class FSTMatcher {
30
31
  static fromNodes(nodes: FSTNode[]): FSTMatcher;
31
32
  }
32
33
  /**
33
- * Normalize text into FST tokens: lowercase, NFKC, strip punctuation, split on whitespace.
34
+ * Normalize text into FST tokens: lowercase, nfkc, strip punctuation, split on whitespace.
34
35
  */
35
36
  export declare function normalizeTokens(text: string): string[];
36
37
  export type { FSTNode };
@@ -1 +1 @@
1
- {"version":3,"file":"matcher.d.ts","sourceRoot":"","sources":["../../lib/fst/matcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAE7F,UAAU,OAAO;IAChB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC1B,MAAM,EAAE,UAAU,EAAE,CAAA;CACpB;AAED,qBAAa,UAAU;IACtB,OAAO,CAAC,KAAK,CAAW;IAExB,YAAY,KAAK,EAAE,OAAO,EAAE,EAE3B;IAED,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,IAAI,UAAU,IAAI,MAAM,CAQvB;IAED,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,cAAc,GAAG,IAAI,CAgB5C;IAED,QAAQ,CAAC,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI,CAUnE;IAED,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,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AC,IAAI,EAAE,MAAM,GAAG,cAAc,CAmClC;IAED,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED;;OAEG;IACH,OAAO,IAAI,SAAS,OAAO,EAAE,CAE5B;IAED,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,UAAU,CAE7C;CACD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAOtD;AAED,YAAY,EAAE,OAAO,EAAE,CAAA"}
@@ -109,7 +109,7 @@ export class FSTMatcher {
109
109
  }
110
110
  }
111
111
  /**
112
- * Normalize text into FST tokens: lowercase, NFKC, strip punctuation, split on whitespace.
112
+ * Normalize text into FST tokens: lowercase, nfkc, strip punctuation, split on whitespace.
113
113
  */
114
114
  export function normalizeTokens(text) {
115
115
  return text
@@ -117,6 +117,6 @@ export function normalizeTokens(text) {
117
117
  .toLowerCase()
118
118
  .replaceAll(/[\p{P}\p{S}]/gu, "")
119
119
  .split(/\s+/)
120
- .filter((t) => t.length > 0);
120
+ .filter((t) => t.length);
121
121
  }
122
122
  //# sourceMappingURL=matcher.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"matcher.js","sourceRoot":"","sources":["../../lib/fst/matcher.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AASH,MAAM,OAAO,UAAU;IACd,KAAK,CAAW;IAExB,YAAY,KAAgB;QAC3B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACnB,CAAC;IAED,IAAI,UAAU;QACb,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAA;IACzB,CAAC;IAED,IAAI,UAAU;QACb,IAAI,KAAK,GAAG,CAAC,CAAA;QAEb,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;YAC5B,KAAK,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,CAAA;QACzB,CAAC;QAED,OAAO,KAAK,CAAA;IACb,CAAC;IAED,IAAI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