@mailwoman/core 4.16.1 → 5.0.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 (316) hide show
  1. package/data/chromium-i18n/ssl-address-download.ts +110 -0
  2. package/data/libpostal/resources-download.ts +121 -0
  3. package/out/api/APIClient.d.ts +2 -2
  4. package/out/api/APIClient.d.ts.map +1 -1
  5. package/out/api/APIClient.js +2 -2
  6. package/out/api/APIClient.js.map +1 -1
  7. package/out/api/responses.d.ts.map +1 -1
  8. package/out/api/responses.js.map +1 -1
  9. package/out/classification/Classification.d.ts +3 -4
  10. package/out/classification/Classification.d.ts.map +1 -1
  11. package/out/classification/Classification.js.map +1 -1
  12. package/out/classification/CompositeClassifier.d.ts +1 -1
  13. package/out/classification/CompositeClassifier.d.ts.map +1 -1
  14. package/out/classification/CompositeClassifier.js +1 -1
  15. package/out/classification/CompositeClassifier.js.map +1 -1
  16. package/out/classification/PhraseClassifier.d.ts.map +1 -1
  17. package/out/classification/PhraseClassifier.js.map +1 -1
  18. package/out/classification/SectionClassifier.d.ts.map +1 -1
  19. package/out/classification/SectionClassifier.js.map +1 -1
  20. package/out/classification/WordClassifier.d.ts.map +1 -1
  21. package/out/classification/WordClassifier.js.map +1 -1
  22. package/out/classification/scheme.d.ts.map +1 -1
  23. package/out/classification/scheme.js.map +1 -1
  24. package/out/coarse-placer/coarse-placer.d.ts +28 -34
  25. package/out/coarse-placer/coarse-placer.d.ts.map +1 -1
  26. package/out/coarse-placer/coarse-placer.js +17 -20
  27. package/out/coarse-placer/coarse-placer.js.map +1 -1
  28. package/out/coarse-placer/featurize.d.ts +17 -19
  29. package/out/coarse-placer/featurize.d.ts.map +1 -1
  30. package/out/coarse-placer/featurize.js +17 -19
  31. package/out/coarse-placer/featurize.js.map +1 -1
  32. package/out/collections.d.ts +1 -2
  33. package/out/collections.d.ts.map +1 -1
  34. package/out/collections.js +1 -2
  35. package/out/collections.js.map +1 -1
  36. package/out/data/chromium-i18n/ssl-address-download.d.ts +30 -0
  37. package/out/data/chromium-i18n/ssl-address-download.d.ts.map +1 -0
  38. package/out/data/chromium-i18n/ssl-address-download.js +98 -0
  39. package/out/data/chromium-i18n/ssl-address-download.js.map +1 -0
  40. package/out/data/libpostal/resources-download.d.ts +29 -0
  41. package/out/data/libpostal/resources-download.d.ts.map +1 -0
  42. package/out/data/libpostal/resources-download.js +107 -0
  43. package/out/data/libpostal/resources-download.js.map +1 -0
  44. package/out/db/schema.d.ts +2 -2
  45. package/out/decoder/arbitrate-tree.d.ts +3 -3
  46. package/out/decoder/arbitrate-tree.d.ts.map +1 -1
  47. package/out/decoder/arbitrate-tree.js +5 -5
  48. package/out/decoder/arbitrate-tree.js.map +1 -1
  49. package/out/decoder/build-tree.d.ts +12 -14
  50. package/out/decoder/build-tree.d.ts.map +1 -1
  51. package/out/decoder/build-tree.js +4 -5
  52. package/out/decoder/build-tree.js.map +1 -1
  53. package/out/decoder/calibration.d.ts +3 -4
  54. package/out/decoder/calibration.d.ts.map +1 -1
  55. package/out/decoder/calibration.js +3 -4
  56. package/out/decoder/calibration.js.map +1 -1
  57. package/out/decoder/containment.d.ts +5 -6
  58. package/out/decoder/containment.d.ts.map +1 -1
  59. package/out/decoder/containment.js +5 -6
  60. package/out/decoder/containment.js.map +1 -1
  61. package/out/decoder/index.d.ts +1 -0
  62. package/out/decoder/index.d.ts.map +1 -1
  63. package/out/decoder/index.js +1 -0
  64. package/out/decoder/index.js.map +1 -1
  65. package/out/decoder/proposals-to-tree.d.ts +9 -9
  66. package/out/decoder/proposals-to-tree.d.ts.map +1 -1
  67. package/out/decoder/proposals-to-tree.js +11 -11
  68. package/out/decoder/proposals-to-tree.js.map +1 -1
  69. package/out/decoder/resolve-proposal-overlaps.d.ts +3 -5
  70. package/out/decoder/resolve-proposal-overlaps.d.ts.map +1 -1
  71. package/out/decoder/resolve-proposal-overlaps.js +5 -6
  72. package/out/decoder/resolve-proposal-overlaps.js.map +1 -1
  73. package/out/decoder/serialize-json.d.ts +13 -1
  74. package/out/decoder/serialize-json.d.ts.map +1 -1
  75. package/out/decoder/serialize-json.js +6 -2
  76. package/out/decoder/serialize-json.js.map +1 -1
  77. package/out/decoder/serialize-tuples.d.ts +10 -1
  78. package/out/decoder/serialize-tuples.d.ts.map +1 -1
  79. package/out/decoder/serialize-tuples.js +13 -5
  80. package/out/decoder/serialize-tuples.js.map +1 -1
  81. package/out/decoder/serialize-xml.d.ts +15 -9
  82. package/out/decoder/serialize-xml.d.ts.map +1 -1
  83. package/out/decoder/serialize-xml.js +29 -12
  84. package/out/decoder/serialize-xml.js.map +1 -1
  85. package/out/decoder/types.d.ts +52 -61
  86. package/out/decoder/types.d.ts.map +1 -1
  87. package/out/decoder/types.js +2 -2
  88. package/out/decoder/unknown-spans.d.ts +46 -0
  89. package/out/decoder/unknown-spans.d.ts.map +1 -0
  90. package/out/decoder/unknown-spans.js +56 -0
  91. package/out/decoder/unknown-spans.js.map +1 -0
  92. package/out/decoder/validate-tree.d.ts.map +1 -1
  93. package/out/decoder/validate-tree.js +2 -3
  94. package/out/decoder/validate-tree.js.map +1 -1
  95. package/out/errors/schema.d.ts +1 -2
  96. package/out/errors/schema.d.ts.map +1 -1
  97. package/out/errors/schema.js +1 -2
  98. package/out/errors/schema.js.map +1 -1
  99. package/out/filters/RelationshipFilter.d.ts.map +1 -1
  100. package/out/filters/RelationshipFilter.js.map +1 -1
  101. package/out/formatter/index.d.ts.map +1 -1
  102. package/out/formatter/index.js.map +1 -1
  103. package/out/identifiers.d.ts.map +1 -1
  104. package/out/identifiers.js.map +1 -1
  105. package/out/kysley/client.d.ts +3 -4
  106. package/out/kysley/client.d.ts.map +1 -1
  107. package/out/kysley/client.js +3 -4
  108. package/out/kysley/client.js.map +1 -1
  109. package/out/kysley/dialect-config.d.ts +1 -1
  110. package/out/kysley/dialect-config.d.ts.map +1 -1
  111. package/out/kysley/dialect.d.ts +4 -4
  112. package/out/kysley/dialect.js +4 -4
  113. package/out/kysley/driver.d.ts.map +1 -1
  114. package/out/kysley/driver.js +1 -1
  115. package/out/kysley/driver.js.map +1 -1
  116. package/out/lifecycle/ServiceSymbol.d.ts +2 -4
  117. package/out/lifecycle/ServiceSymbol.d.ts.map +1 -1
  118. package/out/lifecycle/ServiceSymbol.js +2 -4
  119. package/out/lifecycle/ServiceSymbol.js.map +1 -1
  120. package/out/lifecycle/services.d.ts +7 -8
  121. package/out/lifecycle/services.d.ts.map +1 -1
  122. package/out/lifecycle/services.js +5 -4
  123. package/out/lifecycle/services.js.map +1 -1
  124. package/out/locale/locale.d.ts +5 -6
  125. package/out/locale/locale.d.ts.map +1 -1
  126. package/out/locale/registry.d.ts.map +1 -1
  127. package/out/locale/registry.js.map +1 -1
  128. package/out/logging/index.d.ts +1 -0
  129. package/out/logging/index.d.ts.map +1 -1
  130. package/out/logging/index.js +1 -0
  131. package/out/logging/index.js.map +1 -1
  132. package/out/logging/shared.d.ts +2 -2
  133. package/out/logging/shared.js +2 -2
  134. package/out/logging/utils.d.ts +30 -0
  135. package/out/logging/utils.d.ts.map +1 -0
  136. package/out/logging/utils.js +30 -0
  137. package/out/logging/utils.js.map +1 -0
  138. package/out/objects.d.ts +3 -4
  139. package/out/objects.d.ts.map +1 -1
  140. package/out/objects.js +1 -2
  141. package/out/objects.js.map +1 -1
  142. package/out/parser/AddressParser.d.ts +12 -16
  143. package/out/parser/AddressParser.d.ts.map +1 -1
  144. package/out/parser/AddressParser.js.map +1 -1
  145. package/out/parser/proposal-pipeline.d.ts +12 -12
  146. package/out/parser/proposal-pipeline.d.ts.map +1 -1
  147. package/out/parser/proposal-pipeline.js +12 -12
  148. package/out/parser/proposal-pipeline.js.map +1 -1
  149. package/out/parser/solution-to-proposals.d.ts +4 -4
  150. package/out/parser/solution-to-proposals.d.ts.map +1 -1
  151. package/out/parser/solution-to-proposals.js +5 -5
  152. package/out/parser/solution-to-proposals.js.map +1 -1
  153. package/out/pipeline/index.d.ts +1 -1
  154. package/out/pipeline/reconcile-lookups.d.ts +4 -4
  155. package/out/pipeline/reconcile-lookups.d.ts.map +1 -1
  156. package/out/pipeline/reconcile-lookups.js +4 -4
  157. package/out/pipeline/reconcile-lookups.js.map +1 -1
  158. package/out/pipeline/reconcile.d.ts +21 -23
  159. package/out/pipeline/reconcile.d.ts.map +1 -1
  160. package/out/pipeline/reconcile.js +49 -51
  161. package/out/pipeline/reconcile.js.map +1 -1
  162. package/out/pipeline/runtime-pipeline.d.ts +14 -16
  163. package/out/pipeline/runtime-pipeline.d.ts.map +1 -1
  164. package/out/pipeline/runtime-pipeline.js +33 -37
  165. package/out/pipeline/runtime-pipeline.js.map +1 -1
  166. package/out/pipeline/span-logit-aggregation.d.ts +5 -6
  167. package/out/pipeline/span-logit-aggregation.d.ts.map +1 -1
  168. package/out/pipeline/span-logit-aggregation.js +7 -8
  169. package/out/pipeline/span-logit-aggregation.js.map +1 -1
  170. package/out/pipeline/span-proposer.d.ts +18 -22
  171. package/out/pipeline/span-proposer.d.ts.map +1 -1
  172. package/out/pipeline/span-proposer.js +21 -22
  173. package/out/pipeline/span-proposer.js.map +1 -1
  174. package/out/pipeline/types.d.ts +77 -86
  175. package/out/pipeline/types.d.ts.map +1 -1
  176. package/out/policy/defaults.d.ts +5 -6
  177. package/out/policy/defaults.d.ts.map +1 -1
  178. package/out/policy/defaults.js +5 -6
  179. package/out/policy/defaults.js.map +1 -1
  180. package/out/policy/from-config.d.ts +8 -9
  181. package/out/policy/from-config.d.ts.map +1 -1
  182. package/out/policy/from-config.js +8 -9
  183. package/out/policy/from-config.js.map +1 -1
  184. package/out/policy/input-shape-router.d.ts +15 -19
  185. package/out/policy/input-shape-router.d.ts.map +1 -1
  186. package/out/policy/input-shape-router.js +11 -14
  187. package/out/policy/input-shape-router.js.map +1 -1
  188. package/out/policy/policy.d.ts +10 -13
  189. package/out/policy/policy.d.ts.map +1 -1
  190. package/out/policy/registry.d.ts +4 -5
  191. package/out/policy/registry.d.ts.map +1 -1
  192. package/out/policy/registry.js +6 -7
  193. package/out/policy/registry.js.map +1 -1
  194. package/out/resolver/index.d.ts +1 -1
  195. package/out/resolver/index.js +1 -1
  196. package/out/resolver/types.d.ts +212 -216
  197. package/out/resolver/types.d.ts.map +1 -1
  198. package/out/resolver/types.js +32 -39
  199. package/out/resolver/types.js.map +1 -1
  200. package/out/resources/LocaleIndex.d.ts +1 -2
  201. package/out/resources/LocaleIndex.d.ts.map +1 -1
  202. package/out/resources/LocaleIndex.js +1 -2
  203. package/out/resources/LocaleIndex.js.map +1 -1
  204. package/out/resources/ResourceMapCache.d.ts.map +1 -1
  205. package/out/resources/ResourceMapCache.js.map +1 -1
  206. package/out/resources/collections.d.ts +1 -2
  207. package/out/resources/collections.d.ts.map +1 -1
  208. package/out/resources/collections.js +1 -2
  209. package/out/resources/collections.js.map +1 -1
  210. package/out/resources/fs.d.ts.map +1 -1
  211. package/out/resources/fs.js.map +1 -1
  212. package/out/resources/git.d.ts.map +1 -1
  213. package/out/resources/git.js.map +1 -1
  214. package/out/resources/libaddressinput.d.ts +2 -2
  215. package/out/resources/libaddressinput.js +2 -2
  216. package/out/resources/libpostal.d.ts +4 -5
  217. package/out/resources/libpostal.d.ts.map +1 -1
  218. package/out/resources/libpostal.js +6 -7
  219. package/out/resources/libpostal.js.map +1 -1
  220. package/out/resources/set.d.ts +1 -2
  221. package/out/resources/set.d.ts.map +1 -1
  222. package/out/resources/set.js +1 -2
  223. package/out/resources/set.js.map +1 -1
  224. package/out/resources/whosonfirst/DataSourceCache.d.ts.map +1 -1
  225. package/out/resources/whosonfirst/DataSourceCache.js.map +1 -1
  226. package/out/resources/whosonfirst/PlacetypeDataSource.d.ts +1 -1
  227. package/out/resources/whosonfirst/PlacetypeDataSource.d.ts.map +1 -1
  228. package/out/resources/whosonfirst/PlacetypeDataSource.js +1 -1
  229. package/out/resources/whosonfirst/PlacetypeDataSource.js.map +1 -1
  230. package/out/resources/whosonfirst/loader.d.ts +1 -2
  231. package/out/resources/whosonfirst/loader.d.ts.map +1 -1
  232. package/out/resources/whosonfirst/loader.js.map +1 -1
  233. package/out/resources/whosonfirst/placetypes/Placetype.d.ts +6 -9
  234. package/out/resources/whosonfirst/placetypes/Placetype.d.ts.map +1 -1
  235. package/out/resources/whosonfirst/placetypes/Placetype.js +7 -10
  236. package/out/resources/whosonfirst/placetypes/Placetype.js.map +1 -1
  237. package/out/resources/whosonfirst/placetypes/admin.d.ts +1 -2
  238. package/out/resources/whosonfirst/placetypes/admin.d.ts.map +1 -1
  239. package/out/resources/whosonfirst/placetypes/admin.js +1 -2
  240. package/out/resources/whosonfirst/placetypes/admin.js.map +1 -1
  241. package/out/resources/whosonfirst/placetypes/graph.d.ts +10 -10
  242. package/out/resources/whosonfirst/placetypes/graph.d.ts.map +1 -1
  243. package/out/resources/whosonfirst/placetypes/graph.js +0 -0
  244. package/out/resources/whosonfirst/placetypes/graph.js.map +1 -1
  245. package/out/resources/whosonfirst/placetypes/mermaid.d.ts +16 -19
  246. package/out/resources/whosonfirst/placetypes/mermaid.d.ts.map +1 -1
  247. package/out/resources/whosonfirst/placetypes/mermaid.js +15 -16
  248. package/out/resources/whosonfirst/placetypes/mermaid.js.map +1 -1
  249. package/out/resources/whosonfirst/placetypes/tree.d.ts +6 -7
  250. package/out/resources/whosonfirst/placetypes/tree.d.ts.map +1 -1
  251. package/out/resources/whosonfirst/placetypes/tree.js +3 -4
  252. package/out/resources/whosonfirst/placetypes/tree.js.map +1 -1
  253. package/out/routing/index.d.ts +2 -3
  254. package/out/routing/index.d.ts.map +1 -1
  255. package/out/routing/index.js +1 -1
  256. package/out/routing/index.js.map +1 -1
  257. package/out/solver/HashMapSolver.d.ts.map +1 -1
  258. package/out/solver/HashMapSolver.js.map +1 -1
  259. package/out/solver/Solution.d.ts +2 -2
  260. package/out/solver/Solution.d.ts.map +1 -1
  261. package/out/solver/Solution.js +2 -2
  262. package/out/solver/Solution.js.map +1 -1
  263. package/out/solver/mask.d.ts.map +1 -1
  264. package/out/solver/mask.js.map +1 -1
  265. package/out/solvers/LeadingAreaDeclassifier.d.ts.map +1 -1
  266. package/out/solvers/LeadingAreaDeclassifier.js.map +1 -1
  267. package/out/solvers/MultiStreetSolver.d.ts +10 -15
  268. package/out/solvers/MultiStreetSolver.d.ts.map +1 -1
  269. package/out/solvers/MultiStreetSolver.js +10 -15
  270. package/out/solvers/MultiStreetSolver.js.map +1 -1
  271. package/out/solvers/PostcodePositionPenalty.d.ts +2 -2
  272. package/out/solvers/PostcodePositionPenalty.d.ts.map +1 -1
  273. package/out/solvers/PostcodePositionPenalty.js +2 -2
  274. package/out/solvers/PostcodePositionPenalty.js.map +1 -1
  275. package/out/tokenization/Span.d.ts +1 -3
  276. package/out/tokenization/Span.d.ts.map +1 -1
  277. package/out/tokenization/Span.js +1 -3
  278. package/out/tokenization/Span.js.map +1 -1
  279. package/out/tokenization/context.d.ts +1 -2
  280. package/out/tokenization/context.d.ts.map +1 -1
  281. package/out/tokenization/context.js +1 -2
  282. package/out/tokenization/context.js.map +1 -1
  283. package/out/tokenization/normalizer.js +2 -2
  284. package/out/tokenization/permutate.d.ts +2 -3
  285. package/out/tokenization/permutate.d.ts.map +1 -1
  286. package/out/tokenization/permutate.js +4 -5
  287. package/out/tokenization/permutate.js.map +1 -1
  288. package/out/types/classifier.d.ts +21 -23
  289. package/out/types/classifier.d.ts.map +1 -1
  290. package/out/types/component.d.ts +6 -7
  291. package/out/types/component.d.ts.map +1 -1
  292. package/out/types/component.js +5 -6
  293. package/out/types/component.js.map +1 -1
  294. package/out/types/mapping.d.ts +8 -8
  295. package/out/types/mapping.d.ts.map +1 -1
  296. package/out/types/mapping.js +13 -13
  297. package/out/types/mapping.js.map +1 -1
  298. package/out/utils/data-root.d.ts +5 -5
  299. package/out/utils/data-root.js +7 -7
  300. package/out/utils/repo.d.ts +3 -3
  301. package/out/utils/repo.d.ts.map +1 -1
  302. package/out/utils/repo.js +16 -19
  303. package/out/utils/repo.js.map +1 -1
  304. package/out/vitest.config.d.ts.map +1 -1
  305. package/out/vitest.config.js.map +1 -1
  306. package/package.json +18 -18
  307. package/data/chromium-i18n/ssl-address-download.sh +0 -15
  308. package/data/libpostal/resources-download.sh +0 -44
  309. package/out/logging/tables.d.ts +0 -7
  310. package/out/logging/tables.d.ts.map +0 -1
  311. package/out/logging/tables.js +0 -75
  312. package/out/logging/tables.js.map +0 -1
  313. package/out/sets.d.ts +0 -2
  314. package/out/sets.d.ts.map +0 -1
  315. package/out/sets.js +0 -2
  316. package/out/sets.js.map +0 -1
@@ -14,9 +14,9 @@
14
14
  */
15
15
  import type { AddressTree, ComponentTag } from "../decoder/types.js";
16
16
  /**
17
- * One candidate place returned by a resolver. Mirrors the shape used by
18
- * `@mailwoman/core/resolver-wof-sqlite`'s `PlaceCandidate` — kept structurally compatible so a
19
- * callsite holding a `PlaceCandidate` can be passed where a `ResolvedPlace` is expected.
17
+ * One candidate place returned by a resolver. Mirrors the shape used by `@mailwoman/core/resolver-wof-sqlite`'s
18
+ * `PlaceCandidate` — kept structurally compatible so a callsite holding a `PlaceCandidate` can be passed where a
19
+ * `ResolvedPlace` is expected.
20
20
  */
21
21
  export interface ResolvedPlace {
22
22
  /** Resolver-specific place identifier (e.g. WOF id). */
@@ -34,72 +34,67 @@ export interface ResolvedPlace {
34
34
  /** Parent place id within the resolver's hierarchy, if any. */
35
35
  parent_id?: number | string;
36
36
  /**
37
- * Resolver-defined ranking score. Higher = better fit for the query. Scale is implementation-
38
- * defined; callers should treat as ordinal.
37
+ * Resolver-defined ranking score. Higher = better fit for the query. Scale is implementation- defined; callers should
38
+ * treat as ordinal.
39
39
  */
40
40
  score: number;
41
41
  /**
42
- * Set by the backend when this candidate is an EXACT name/alias match for the query (vs a partial
43
- * token match). The postcode-anchor re-rank (#369) uses it as the PRIMARY key so a country
44
- * posterior can pin the country WITHOUT crossing the exact-match tier: "ME" under a confident US
45
- * posterior stays Maine (US exact) rather than promoting the more-populous Missouri (US partial),
46
- * and still beats Messina (IT exact) on the posterior WITHIN the exact tier. Absent → treated as
47
- * non-exact (backends that don't tier omit it; the re-rank degrades to a plain score+posterior).
42
+ * Set by the backend when this candidate is an EXACT name/alias match for the query (vs a partial token match). The
43
+ * postcode-anchor re-rank (#369) uses it as the PRIMARY key so a country posterior can pin the country WITHOUT
44
+ * crossing the exact-match tier: "ME" under a confident US posterior stays Maine (US exact) rather than promoting the
45
+ * more-populous Missouri (US partial), and still beats Messina (IT exact) on the posterior WITHIN the exact tier.
46
+ * Absent → treated as non-exact (backends that don't tier omit it; the re-rank degrades to a plain score+posterior).
48
47
  */
49
48
  exactMatch?: boolean;
50
49
  /**
51
- * Set when the resolver detected that the address's postcode and its parsed locality name point
52
- * to geographically different places (a transposed / wrong-for-the-city postcode). Surfaced onto
53
- * the resolved node's metadata as `postcode_city_mismatch` so callers can lower confidence or
54
- * flag the conflict instead of silently mislocating.
50
+ * Set when the resolver detected that the address's postcode and its parsed locality name point to geographically
51
+ * different places (a transposed / wrong-for-the-city postcode). Surfaced onto the resolved node's metadata as
52
+ * `postcode_city_mismatch` so callers can lower confidence or flag the conflict instead of silently mislocating.
55
53
  */
56
54
  mismatch?: boolean;
57
55
  /**
58
- * Fallback-observability marker (#718). Set to `"fallback"` by the resolver when this span
59
- * resolved to a placetype-EQUIVALENCE-GROUP member (a macro-type — `macroregion`/`macrocounty`)
60
- * because no candidate of the EXACT requested placetype (`region`/`county`) existed. It does NOT
61
- * change the resolved identity or coordinate — it only annotates that a broader admin tier stood
62
- * in for the true one, so a downstream consumer / QA pass can see a macroregion was used in lieu
63
- * of a region. Surfaced onto the resolved node's metadata as `resolution_quality`. Absent when
64
- * the exact placetype matched (the normal case).
56
+ * Fallback-observability marker (#718). Set to `"fallback"` by the resolver when this span resolved to a
57
+ * placetype-EQUIVALENCE-GROUP member (a macro-type — `macroregion`/`macrocounty`) because no candidate of the EXACT
58
+ * requested placetype (`region`/`county`) existed. It does NOT change the resolved identity or coordinate — it only
59
+ * annotates that a broader admin tier stood in for the true one, so a downstream consumer / QA pass can see a
60
+ * macroregion was used in lieu of a region. Surfaced onto the resolved node's metadata as `resolution_quality`.
61
+ * Absent when the exact placetype matched (the normal case).
65
62
  */
66
63
  resolutionQuality?: "fallback";
67
64
  }
68
65
  /**
69
- * Pull-based contract for a single resolver query. The resolver knows nothing about `AddressTree` —
70
- * it just answers "what place is named X, optionally constrained by Y?"
66
+ * Pull-based contract for a single resolver query. The resolver knows nothing about `AddressTree` — it just answers
67
+ * "what place is named X, optionally constrained by Y?"
71
68
  *
72
- * Structurally compatible with `PlaceLookup` from `@mailwoman/core/resolver-wof-sqlite` so the
73
- * latter satisfies this interface without an adapter shim.
69
+ * Structurally compatible with `PlaceLookup` from `@mailwoman/core/resolver-wof-sqlite` so the latter satisfies this
70
+ * interface without an adapter shim.
74
71
  */
75
72
  export interface ResolverBackend {
76
73
  findPlace(query: {
77
74
  text: string;
78
75
  placetype?: string | string[];
79
76
  country?: string;
80
- parentId?: number | string;
77
+ parentID?: number | string;
81
78
  /**
82
- * Sibling postcode string, when the address carries one. A coordinate-first backend uses it to
83
- * inject postcode-proximal locality candidates (the postcode→locality table) and soft-score
84
- * them against the parsed name — recovering localities the name-match alone misses. Backends
85
- * without postcode support ignore it.
79
+ * Sibling postcode string, when the address carries one. A coordinate-first backend uses it to inject
80
+ * postcode-proximal locality candidates (the postcode→locality table) and soft-score them against the parsed name —
81
+ * recovering localities the name-match alone misses. Backends without postcode support ignore it.
86
82
  */
87
83
  postcode?: string;
88
84
  limit?: number;
89
85
  }): Promise<ResolvedPlace[]>;
90
86
  /**
91
- * The dual-role locality (or localities) coincident with an admin place id, from the precomputed
92
- * coincident-roles relation (#403). Drives {@link ResolveOpts.hierarchyCompletion}: when the parse
93
- * drops the locality of a city-state / capital-seat region, the resolver completes it from here
94
- * instead of re-querying. OPTIONAL — backends without the relation omit it, and completion
95
- * no-ops. Synchronous: it's an in-memory map lookup once the relation is loaded.
87
+ * The dual-role locality (or localities) coincident with an admin place id, from the precomputed coincident-roles
88
+ * relation (#403). Drives {@link ResolveOpts.hierarchyCompletion}: when the parse drops the locality of a city-state /
89
+ * capital-seat region, the resolver completes it from here instead of re-querying. OPTIONAL — backends without the
90
+ * relation omit it, and completion no-ops. Synchronous: it's an in-memory map lookup once the relation is loaded.
96
91
  */
97
- coincidentLocalitiesFor?(adminId: number | string): CoincidentLocality[];
92
+ coincidentLocalitiesFor?(adminID: number | string): CoincidentLocality[];
98
93
  /**
99
- * The ancestor lineage of a resolved place — its containment chain (county → region → country),
100
- * nearest-first. Backs {@link ResolveOpts.includeAncestors} (#404): the Pelias/Nominatim
101
- * "always-attach-the-hierarchy" enrichment. OPTIONAL — backends without it omit it, and the
102
- * attachment is skipped. Synchronous: a memoized read of the gazetteer's `ancestors` table.
94
+ * The ancestor lineage of a resolved place — its containment chain (county → region → country), nearest-first. Backs
95
+ * {@link ResolveOpts.includeAncestors} (#404): the Pelias/Nominatim "always-attach-the-hierarchy" enrichment. OPTIONAL
96
+ * — backends without it omit it, and the attachment is skipped. Synchronous: a memoized read of the gazetteer's
97
+ * `ancestors` table.
103
98
  */
104
99
  ancestors?(id: number | string): Ancestor[];
105
100
  }
@@ -110,14 +105,12 @@ export interface Ancestor {
110
105
  name: string;
111
106
  }
112
107
  /**
113
- * A dual-role locality returned by {@link ResolverBackend.coincidentLocalitiesFor} — a resolved
114
- * place (so it can decorate a node directly) plus the relation metadata the completion step
115
- * disambiguates on.
108
+ * A dual-role locality returned by {@link ResolverBackend.coincidentLocalitiesFor} — a resolved place (so it can
109
+ * decorate a node directly) plus the relation metadata the completion step disambiguates on.
116
110
  */
117
111
  export interface CoincidentLocality extends ResolvedPlace {
118
112
  /**
119
- * `city-state` / `capital-seat` / `consolidated-county` — surfaced as
120
- * `metadata.relationship_type`.
113
+ * `city-state` / `capital-seat` / `consolidated-county` — surfaced as `metadata.relationship_type`.
121
114
  */
122
115
  relationshipType: string;
123
116
  /** Locality population (0 when unknown) — the PRIMARY disambiguator when an admin has several. */
@@ -129,8 +122,8 @@ export interface CoincidentLocality extends ResolvedPlace {
129
122
  * Options for `resolveTree`. All optional with sensible defaults.
130
123
  */
131
124
  /**
132
- * One exact address-point hit (#476): a real situs coordinate for `(street, number)` within a
133
- * postcode/locality scope — the street-level tier in front of admin-centroid resolution.
125
+ * One exact address-point hit (#476): a real situs coordinate for `(street, number)` within a postcode/locality scope —
126
+ * the street-level tier in front of admin-centroid resolution.
134
127
  */
135
128
  export interface AddressPointHit {
136
129
  lat: number;
@@ -141,9 +134,9 @@ export interface AddressPointHit {
141
134
  release: string;
142
135
  }
143
136
  /**
144
- * Street-level exact-point lookup (#476). Implementations own their normalization — both the shard
145
- * build and this lookup must apply the SAME normalizer (see
146
- * `resolver-wof-sqlite/street-normalize.ts`). Core depends only on this contract.
137
+ * Street-level exact-point lookup (#476). Implementations own their normalization — both the shard build and this
138
+ * lookup must apply the SAME normalizer (see `resolver-wof-sqlite/street-normalize.ts`). Core depends only on this
139
+ * contract.
147
140
  */
148
141
  export interface AddressPointLookup {
149
142
  find(query: {
@@ -151,13 +144,23 @@ export interface AddressPointLookup {
151
144
  number: string;
152
145
  postcode?: string;
153
146
  locality?: string;
147
+ /**
148
+ * Optional bbox scope (`minLat`/`maxLat`/`minLon`/`maxLon`), tried AFTER postcode/locality. For shards whose points
149
+ * carry no postcode/locality of their own (OSM addr nodes often don't) but DO carry a coordinate — the resolved
150
+ * locality's bounding box scopes the `(street, number)` probe instead. US situs never passes it (byte-stable).
151
+ */
152
+ bbox?: {
153
+ minLat: number;
154
+ maxLat: number;
155
+ minLon: number;
156
+ maxLon: number;
157
+ };
154
158
  }): AddressPointHit | null;
155
159
  }
156
160
  /**
157
- * One interpolated coordinate estimate (#483) — NEVER an exact situs point (`uncertaintyM` prices
158
- * the estimate honestly). Structural mirror of `InterpolatedHit` in
159
- * `resolver-wof-sqlite/interpolation.ts`; keep this a SUBSET of that shape so the concrete
160
- * `StreetInterpolator`/`AddressPointInterpolator` satisfy {@link InterpolationLookup} with no
161
+ * One interpolated coordinate estimate (#483) — NEVER an exact situs point (`uncertaintyM` prices the estimate
162
+ * honestly). Structural mirror of `InterpolatedHit` in `resolver-wof-sqlite/interpolation.ts`; keep this a SUBSET of
163
+ * that shape so the concrete `StreetInterpolator`/`AddressPointInterpolator` satisfy {@link InterpolationLookup} with no
161
164
  * adapter (the {@link AddressPointHit} precedent).
162
165
  */
163
166
  export interface InterpolatedPointHit {
@@ -165,8 +168,7 @@ export interface InterpolatedPointHit {
165
168
  lon: number;
166
169
  interpolated: true;
167
170
  /**
168
- * `address_point` = bracketed between real neighbor points; `tiger_range` = linear within a
169
- * segment range.
171
+ * `address_point` = bracketed between real neighbor points; `tiger_range` = linear within a segment range.
170
172
  */
171
173
  method: "address_point" | "tiger_range";
172
174
  /** False when only the opposite side's range contained the number (right block, wrong side). */
@@ -179,10 +181,9 @@ export interface InterpolatedPointHit {
179
181
  release: string;
180
182
  }
181
183
  /**
182
- * House-number interpolation lookup (#483). Like {@link AddressPointLookup}, implementations own
183
- * their normalization (the shared `resolver-wof-sqlite/street-normalize.ts`); core depends only on
184
- * this contract. Postcode-scoped (no locality field) — the tier abstains statewide without a
185
- * postcode.
184
+ * House-number interpolation lookup (#483). Like {@link AddressPointLookup}, implementations own their normalization
185
+ * (the shared `resolver-wof-sqlite/street-normalize.ts`); core depends only on this contract. Postcode-scoped (no
186
+ * locality field) — the tier abstains statewide without a postcode.
186
187
  */
187
188
  export interface InterpolationLookup {
188
189
  find(query: {
@@ -193,251 +194,246 @@ export interface InterpolationLookup {
193
194
  }
194
195
  export interface ResolveOpts {
195
196
  /**
196
- * Hard cap on how many backend lookups one tree may issue. Default 10. Prevents a tree with
197
- * dozens of candidate nodes from triggering dozens of queries.
197
+ * Hard cap on how many backend lookups one tree may issue. Default 10. Prevents a tree with dozens of candidate nodes
198
+ * from triggering dozens of queries.
198
199
  */
199
200
  maxLookups?: number;
200
201
  /**
201
- * Minimum candidate score before resolver attribution wins over the classifier's. Default 0. A
202
- * higher threshold makes the resolver more conservative — it leaves more nodes with classifier
203
- * provenance. Score scale is implementation-defined; tune per backend.
202
+ * Minimum candidate score before resolver attribution wins over the classifier's. Default 0. A higher threshold makes
203
+ * the resolver more conservative — it leaves more nodes with classifier provenance. Score scale is
204
+ * implementation-defined; tune per backend.
204
205
  */
205
206
  minWinningScore?: number;
206
207
  /**
207
- * Maximum candidates to request from the backend per lookup. Default 5 — we only use the top
208
- * candidate after post-scoring, but the backend may benefit from over-fetching for ranking.
208
+ * Maximum candidates to request from the backend per lookup. Default 5 — we only use the top candidate after
209
+ * post-scoring, but the backend may benefit from over-fetching for ranking.
209
210
  */
210
211
  candidatesPerLookup?: number;
211
212
  /**
212
- * Default ISO-3166 alpha-2 country to constrain top-level lookups to, when no resolved parent has
213
- * supplied a country yet. Without it, a bare component over a multi-country gazetteer (e.g. "IL")
214
- * can fuzzy-match a foreign place. Callers should set this from the detected locale (the
215
- * pipeline's locale-gate). A resolved parent's country still overrides it deeper in the tree.
213
+ * Default ISO-3166 alpha-2 country to constrain top-level lookups to, when no resolved parent has supplied a country
214
+ * yet. Without it, a bare component over a multi-country gazetteer (e.g. "IL") can fuzzy-match a foreign place.
215
+ * Callers should set this from the detected locale (the pipeline's locale-gate). A resolved parent's country still
216
+ * overrides it deeper in the tree.
216
217
  */
217
218
  defaultCountry?: string;
218
219
  /**
219
- * When a resolved parent constrains a child lookup (`parentId` is passed to the backend as a hard
220
- * descendant filter) and that filtered lookup returns NOTHING, retry the lookup once without the
221
- * parent constraint. Guards against an incomplete gazetteer hierarchy (a real locality whose
222
- * ancestor chain is missing its region) or a mis-resolved parent silently turning a resolvable
223
- * node unresolved. The country constraint is retained on the retry, so resolution still can't
224
- * wander cross-border. Default true. Set false to measure the strict-parent baseline.
220
+ * When a resolved parent constrains a child lookup (`parentID` is passed to the backend as a hard descendant filter)
221
+ * and that filtered lookup returns NOTHING, retry the lookup once without the parent constraint. Guards against an
222
+ * incomplete gazetteer hierarchy (a real locality whose ancestor chain is missing its region) or a mis-resolved
223
+ * parent silently turning a resolvable node unresolved. The country constraint is retained on the retry, so
224
+ * resolution still can't wander cross-border. Default true. Set false to measure the strict-parent baseline.
225
225
  */
226
226
  parentFallback?: boolean;
227
227
  /**
228
- * Override the default ComponentTag → resolver-placetype mapping. When set, this map FULLY
229
- * REPLACES `DEFAULT_PLACETYPE_MAP` — start from the default by spreading it (`{
230
- * ...DEFAULT_PLACETYPE_MAP, ... }`) if you want to extend rather than replace. The fully-
231
- * replacing semantics let callers narrow the resolver scope (e.g. drop `locality` if the backend
232
- * doesn't ship locality data for the current locale) without awkward `undefined`-as-delete
228
+ * Override the default ComponentTag → resolver-placetype mapping. When set, this map FULLY REPLACES
229
+ * `DEFAULT_PLACETYPE_MAP` — start from the default by spreading it (`{ ...DEFAULT_PLACETYPE_MAP, ... }`) if you want
230
+ * to extend rather than replace. The fully- replacing semantics let callers narrow the resolver scope (e.g. drop
231
+ * `locality` if the backend doesn't ship locality data for the current locale) without awkward `undefined`-as-delete
233
232
  * tricks.
234
233
  */
235
234
  placetypeMap?: PlacetypeMap;
236
235
  /**
237
- * Optional locale hint. Currently unused by the v1 resolver but reserved so the contract doesn't
238
- * break when locale-aware resolvers land in 4.4+.
236
+ * Optional locale hint. Currently unused by the v1 resolver but reserved so the contract doesn't break when
237
+ * locale-aware resolvers land in 4.4+.
239
238
  */
240
239
  locale?: string;
241
240
  /**
242
- * Optional postcode-anchor country posterior (#369) — a `{ countryCode: probability }` map
243
- * derived from the address's postcode (e.g. `@mailwoman/neural`'s `extractPostcodeAnchors`). When
244
- * provided, LOCALITY candidates are re-ranked by `score + anchorWeight *
245
- * posterior[candidate.country]` before the top is picked, so a postcode that pins the country can
246
- * pull the right-country place over a higher-BM25 foreign namesake (the "Berlin DE vs Berlin US"
247
- * class the #59 anchor→resolver harness measured). OFF by default — omit it and resolution is
248
- * byte-identical. Country signal only, so it touches locality lookups only; admin parents already
249
- * carry country via `parentId`.
241
+ * Optional postcode-anchor country posterior (#369) — a `{ countryCode: probability }` map derived from the address's
242
+ * postcode (e.g. `@mailwoman/neural`'s `extractPostcodeAnchors`). When provided, LOCALITY candidates are re-ranked by
243
+ * `score + anchorWeight * posterior[candidate.country]` before the top is picked, so a postcode that pins the country
244
+ * can pull the right-country place over a higher-BM25 foreign namesake (the "Berlin DE vs Berlin US" class the #59
245
+ * anchor→resolver harness measured). OFF by default — omit it and resolution is byte-identical. Country signal only,
246
+ * so it touches locality lookups only; admin parents already carry country via `parentID`.
250
247
  */
251
248
  anchorPosterior?: Record<string, number>;
252
249
  /**
253
- * Weight on the anchor's country posterior in the locality re-rank (#369). Default 2.0 (the value
254
- * the harness swept). Only consulted when `anchorPosterior` is set.
250
+ * Weight on the anchor's country posterior in the locality re-rank (#369). Default 2.0 (the value the harness swept).
251
+ * Only consulted when `anchorPosterior` is set.
255
252
  */
256
253
  anchorWeight?: number;
257
254
  /**
258
- * #743/#194 — a CONFIDENT coarse-placer country applied as a HARD candidate filter
259
- * (`query.country`), not the soft {@link anchorPosterior} boost. This collapses the off-continent
260
- * tail for LOW-population places the soft prior can't move (FI/PL — their towns lose to a
261
- * high-pop namesake in the population-first gazetteer even when the country is pinned). On a miss
262
- * the node is left UNRESOLVED ("in-region or unresolved") rather than re-resolved globally — the
263
- * off-continent rows are precisely the ones whose locality isn't in the country's gazetteer
264
- * slice, so a global fallback just re-admits the wrong-continent guess (measured: it collapses
265
- * back to the soft-prior baseline). The win is coverage-bounded: tail collapse at a recall cost
266
- * set by how complete the country's gazetteer is (PL −9.5pp, FI −32pp). Undefined (default) →
267
- * byte-stable. Ignored when a resolved parent or {@link defaultCountry} already pins the country.
255
+ * #743/#194 — a CONFIDENT coarse-placer country applied as a HARD candidate filter (`query.country`), not the soft
256
+ * {@link anchorPosterior} boost. This collapses the off-continent tail for LOW-population places the soft prior can't
257
+ * move (FI/PL — their towns lose to a high-pop namesake in the population-first gazetteer even when the country is
258
+ * pinned). On a miss the node is left UNRESOLVED ("in-region or unresolved") rather than re-resolved globally — the
259
+ * off-continent rows are precisely the ones whose locality isn't in the country's gazetteer slice, so a global
260
+ * fallback just re-admits the wrong-continent guess (measured: it collapses back to the soft-prior baseline). The win
261
+ * is coverage-bounded: tail collapse at a recall cost set by how complete the country's gazetteer is (PL −9.5pp, FI
262
+ * −32pp). Undefined (default) → byte-stable. Ignored when a resolved parent or {@link defaultCountry} already pins
263
+ * the country.
268
264
  */
269
265
  hardCountry?: string;
270
266
  /**
271
- * Recover the dropped locality in a DUAL-ROLE-place address (#405, epic #402). Many places occupy
272
- * multiple admin tiers under one name — city-states (Berlin/Hamburg/Bremen = city == state),
273
- * capital-seat provinces (Milano, Madrid), UK unitary authorities — and in the
274
- * international-order layout `…, Berlin, Berlin <PC>` the parser labels one token the region and
275
- * drops the locality entirely, leaving a region but no locality (955/1500 Berlin rows resolved to
276
- * nothing on v0.9.4).
267
+ * Recover the dropped locality in a DUAL-ROLE-place address (#405, epic #402). Many places occupy multiple admin
268
+ * tiers under one name — city-states (Berlin/Hamburg/Bremen = city == state), capital-seat provinces (Milano,
269
+ * Madrid), UK unitary authorities — and in the international-order layout `…, Berlin, Berlin <PC>` the parser labels
270
+ * one token the region and drops the locality entirely, leaving a region but no locality (955/1500 Berlin rows
271
+ * resolved to nothing on v0.9.4).
277
272
  *
278
- * When this is on AND a region resolved AND the tree has NO locality node, the resolver consults
279
- * the backend's precomputed coincident-roles relation
280
- * ({@link ResolverBackend.coincidentLocalitiesFor}, #403) for a same-name coincident locality and
281
- * synthesizes a node from it. The relation is the gazetteer's own structure (same name +
282
- * descendant + centroid-coincidence, derived at build time), so the runtime is an O(1) membership
283
- * lookup — no magic distance constant. When an admin maps to several same-name localities, the
284
- * most populous wins (the principal city), nearest-centroid breaks a population tie, and a
285
- * genuine tie ABSTAINS (no completion) rather than guess. The synthesized node carries
286
- * `metadata.resolver_synthesized = true` (+ `relationship_type`) — it has no span in the raw
287
- * input. ON by default (#402): it only fires for a dual-role region whose locality the parser
288
- * dropped, and no-ops entirely when the backend has no relation (the browser WASM resolver, or a
289
- * gazetteer without the `coincident_roles` table). Pass `false` to opt out.
273
+ * When this is on AND a region resolved AND the tree has NO locality node, the resolver consults the backend's
274
+ * precomputed coincident-roles relation ({@link ResolverBackend.coincidentLocalitiesFor}, #403) for a same-name
275
+ * coincident locality and synthesizes a node from it. The relation is the gazetteer's own structure (same name +
276
+ * descendant + centroid-coincidence, derived at build time), so the runtime is an O(1) membership lookup — no magic
277
+ * distance constant. When an admin maps to several same-name localities, the most populous wins (the principal city),
278
+ * nearest-centroid breaks a population tie, and a genuine tie ABSTAINS (no completion) rather than guess. The
279
+ * synthesized node carries `metadata.resolver_synthesized = true` (+ `relationship_type`) — it has no span in the raw
280
+ * input. ON by default (#402): it only fires for a dual-role region whose locality the parser dropped, and no-ops
281
+ * entirely when the backend has no relation (the browser WASM resolver, or a gazetteer without the `coincident_roles`
282
+ * table). Pass `false` to opt out.
290
283
  */
291
284
  /**
292
- * Street-level address-point tier (#476): when the tree carries `street` + `house_number`,
293
- * consult this lookup and (on hit) stamp the exact point onto the street node's metadata
294
- * (`address_point`, `resolution_tier: "address_point"`). Opt-in; absent = byte-stable.
285
+ * Street-level address-point tier (#476): when the tree carries `street` + `house_number`, consult this lookup and
286
+ * (on hit) stamp the exact point onto the street node's metadata (`address_point`, `resolution_tier:
287
+ * "address_point"`). Opt-in; absent = byte-stable.
295
288
  */
296
289
  addressPoints?: AddressPointLookup;
297
290
  /**
298
- * House-number interpolation tier (#483): consulted ONLY when the exact address-point tier
299
- * ({@link addressPoints}) did NOT stamp the street node — the "after the exact-point fall-through"
300
- * semantics. On hit, stamps the estimate onto the street node's metadata under a DISTINCT key
301
- * (`interpolated_point`, `resolution_tier: "interpolated"`, `uncertainty_m`) — never
302
- * `address_point`, so a consumer reading the exact key never gets an estimate mislabeled as
303
- * exact. Opt-in; absent = byte-stable. Independent of {@link addressPoints} (either, both, or
304
- * neither may be passed).
291
+ * Pass the resolved locality's BBOX to the address-point lookup as a final scope (#247). For shards whose points
292
+ * carry no postcode/locality of their own (OSM addr nodes often don't), the postcode/locality probes miss and the
293
+ * lookup falls through to a `(street, number)` probe within the box. OFF by default — US situs never sets it, so the
294
+ * bbox arg is simply never supplied and its postcode/locality probes are byte-identical.
295
+ */
296
+ addressPointBboxFallback?: boolean;
297
+ /**
298
+ * House-number interpolation tier (#483): consulted ONLY when the exact address-point tier ({@link addressPoints})
299
+ * did NOT stamp the street node — the "after the exact-point fall-through" semantics. On hit, stamps the estimate
300
+ * onto the street node's metadata under a DISTINCT key (`interpolated_point`, `resolution_tier: "interpolated"`,
301
+ * `uncertainty_m`) — never `address_point`, so a consumer reading the exact key never gets an estimate mislabeled as
302
+ * exact. Opt-in; absent = byte-stable. Independent of {@link addressPoints} (either, both, or neither may be
303
+ * passed).
305
304
  */
306
305
  interpolation?: InterpolationLookup;
307
306
  /**
308
- * Conformal calibration multiplier for the interpolation tier's `uncertainty_m` (#374). The raw
309
- * radius is half the matched TIGER segment length — an honest-but-TIGHT prior: a split-conformal
310
- * calibration on 1562 Travis-County interp hits (2026-06-14) found it covers only ~72% of true
311
- * errors, and that multiplying by **Q̂ ≈ 1.70** yields a calibrated 90% bound (91.5% empirical).
312
- * When set, `applyInterpolation` reports `uncertainty_m = round(raw × this)` and preserves the
313
- * raw value under `uncertainty_raw_m`. Absent = raw heuristic (byte-stable). The factor is the
314
- * CALLER's (it's a property of the calibration set, not the geometry); the geocode CLI passes the
315
- * TX-derived 1.70. Re-calibrate on a multi-region holdout before treating it as national-exact.
316
- * Report: docs/articles/evals/2026-06-14-interp-radius-calibration.md.
307
+ * Conformal calibration multiplier for the interpolation tier's `uncertainty_m` (#374). The raw radius is half the
308
+ * matched TIGER segment length — an honest-but-TIGHT prior: a split-conformal calibration on 1562 Travis-County
309
+ * interp hits (2026-06-14) found it covers only ~72% of true errors, and that multiplying by **Q̂ ≈ 1.70** yields a
310
+ * calibrated 90% bound (91.5% empirical). When set, `applyInterpolation` reports `uncertainty_m = round(raw × this)`
311
+ * and preserves the raw value under `uncertainty_raw_m`. Absent = raw heuristic (byte-stable). The factor is the
312
+ * CALLER's (it's a property of the calibration set, not the geometry); the geocode CLI passes the TX-derived 1.70.
313
+ * Re-calibrate on a multi-region holdout before treating it as national-exact. Report:
314
+ * docs/articles/evals/2026-06-14-interp-radius-calibration.md.
317
315
  */
318
316
  interpolationRadiusCalibration?: number;
319
317
  /**
320
- * Span-rescore tier (#370). When the tree resolved nothing, recover a dropped/fragmented locality
321
- * from the raw text: enumerate raw-token spans, exact-match the same-country gazetteer
322
- * (longest-wins + postcode-consistency gate), and inject the recovered locality as a resolved
323
- * node. Targets the EU no-result tail the model leaves when it fragments an accented locality
324
- * token ("Grudziądz" → "Grudzi"+"dz", #555). **Default-ON** (promoted 2026-06-25 — same-harness
325
- * EU+AU +1pp @25km, zero regressions); set `false` to opt out (byte-stable then). Never disturbs
326
- * a tree that already resolved (the #685 brake). Validated in
327
- * `docs/articles/evals/2026-06-23-370-span-rescore.mdx` +
318
+ * Span-rescore tier (#370). When the tree resolved nothing, recover a dropped/fragmented locality from the raw text:
319
+ * enumerate raw-token spans, exact-match the same-country gazetteer (longest-wins + postcode-consistency gate), and
320
+ * inject the recovered locality as a resolved node. Targets the EU no-result tail the model leaves when it fragments
321
+ * an accented locality token ("Grudziądz" → "Grudzi"+"dz", #555). **Default-ON** (promoted 2026-06-25 — same-harness
322
+ * EU+AU +1pp @25km, zero regressions); set `false` to opt out (byte-stable then). Never disturbs a tree that already
323
+ * resolved (the #685 brake). Validated in `docs/articles/evals/2026-06-23-370-span-rescore.mdx` +
328
324
  * `2026-06-25-eu-competitive-standing.md`.
329
325
  */
330
326
  spanRescore?: boolean;
331
327
  /**
332
- * Postcode-consistency gate radius (km) for the span-rescore tier — reject a recovered locality
333
- * farther than this from where the postcode resolves. Only bites when the backend has postcode
334
- * coverage (else no anchor, no gate). Default 50.
328
+ * Postcode-consistency gate radius (km) for the span-rescore tier — reject a recovered locality farther than this
329
+ * from where the postcode resolves. Only bites when the backend has postcode coverage (else no anchor, no gate).
330
+ * Default 50.
335
331
  */
336
332
  spanRescoreGateKm?: number;
337
333
  /**
338
- * Postcode-disambiguated locality selection (#370 "Lever A"). When set, AND a locality resolves
339
- * far from a resolved sibling postcode, re-pick the same-named candidate (from the lookup's
340
- * already- captured `alternatives`) nearest the postcode; if none reconciles within the gate,
341
- * fall the coordinate back to the postcode point and flag `postcode_city_mismatch`. Targets the
342
- * dominant failure mode on the EU/AU panel — a same-named town resolved to the wrong instance
343
- * while the postcode that would disambiguate it sits resolved in the same tree (e.g. "06260
344
- * Saint-Pierre" → 617 km off, postcode 06260 correct). Only bites where the backend resolved the
345
- * postcode to a point (so it composes with postcode coverage, #193). Default-off + byte-stable
346
- * when unset.
334
+ * Postcode-disambiguated locality selection (#370 "Lever A"). When set, AND a locality resolves far from a resolved
335
+ * sibling postcode, re-pick the same-named candidate (from the lookup's already- captured `alternatives`) nearest the
336
+ * postcode; if none reconciles within the gate, fall the coordinate back to the postcode point and flag
337
+ * `postcode_city_mismatch`. Targets the dominant failure mode on the EU/AU panel — a same-named town resolved to the
338
+ * wrong instance while the postcode that would disambiguate it sits resolved in the same tree (e.g. "06260
339
+ * Saint-Pierre" → 617 km off, postcode 06260 correct). Only bites where the backend resolved the postcode to a point
340
+ * (so it composes with postcode coverage, #193). Default-off + byte-stable when unset.
347
341
  */
348
342
  postcodeConsistency?: boolean;
349
343
  /**
350
- * Gate radius (km) for {@link postcodeConsistency} — a locality farther than this from the
351
- * resolved postcode is re-picked or demoted. Default 50.
344
+ * Gate radius (km) for {@link postcodeConsistency} — a locality farther than this from the resolved postcode is
345
+ * re-picked or demoted. Default 50.
352
346
  */
353
347
  postcodeConsistencyGateKm?: number;
348
+ /**
349
+ * Admin descendant-consistency (#263). When a region resolved but its child locality did NOT — the greedy region pick
350
+ * (name + population) chose a foreign namesake whose descendants hold no such locality ("Portland, ME" → Messina IT;
351
+ * "Portland" then finds nothing beneath it and falls back to the region centroid) — re-pick the (region, locality)
352
+ * pair JOINTLY against the gazetteer's containment graph: the best same-named locality that descends from one of the
353
+ * region's same-named candidates. "Portland" descends from Maine, not Messina, so the pair resolves to (Maine,
354
+ * Portland-Maine). Generalizes to every country with no country prior and no list. Costs ONE unscoped locality lookup
355
+ * per triggering admin pair; only fires where a locality fell through, so the well-resolved path is byte-identical.
356
+ * Needs {@link ResolverBackend.ancestors}; no-op without it. Default-off + byte-stable when unset.
357
+ */
358
+ adminCoherence?: boolean;
354
359
  hierarchyCompletion?: boolean;
355
360
  /** @deprecated Renamed to {@link hierarchyCompletion} (#405 generalized #387). Still honored. */
356
361
  cityStateFallback?: boolean;
357
362
  /**
358
- * Attach each resolved node's ancestor lineage (#404) — the containment chain (county → region →
359
- * country) the backend's {@link ResolverBackend.ancestors} returns — onto `metadata.ancestors`.
360
- * The Pelias/Nominatim "always-attach-the-hierarchy" enrichment, so a consumer gets the full
361
- * admin ladder from a single resolved place. OFF by default: omit it and resolution is
362
- * byte-identical (and there's no extra query). Only attaches to nodes the resolver actually
363
- * resolved.
363
+ * Attach each resolved node's ancestor lineage (#404) — the containment chain (county → region → country) the
364
+ * backend's {@link ResolverBackend.ancestors} returns — onto `metadata.ancestors`. The Pelias/Nominatim
365
+ * "always-attach-the-hierarchy" enrichment, so a consumer gets the full admin ladder from a single resolved place.
366
+ * OFF by default: omit it and resolution is byte-identical (and there's no extra query). Only attaches to nodes the
367
+ * resolver actually resolved.
364
368
  */
365
369
  includeAncestors?: boolean;
366
370
  }
367
371
  /**
368
- * Mapping from mailwoman's address-component tags to the resolver's placetype taxonomy. Components
369
- * not present in the map are NOT queried — the resolver pass leaves their classifier attribution
370
- * untouched.
372
+ * Mapping from mailwoman's address-component tags to the resolver's placetype taxonomy. Components not present in the
373
+ * map are NOT queried — the resolver pass leaves their classifier attribution untouched.
371
374
  *
372
- * Phase 4.3 default ships the obvious admin-level mappings; other tags (postcode, street, venue,
373
- * dependent_locality, prefecture, etc.) are explicitly omitted because:
375
+ * Phase 4.3 default ships the obvious admin-level mappings; other tags (postcode, street, venue, dependent_locality,
376
+ * prefecture, etc.) are explicitly omitted because:
374
377
  *
375
378
  * - `postcode` lives in a separate WOF shard (Phase 4.3.x follow-up via the postalcode loader).
376
- * - `street` / `house_number` aren't in WOF admin — would need OSM / OpenAddresses gazetteers and
377
- * license diligence (Phase 4.4 candidate).
379
+ * - `street` / `house_number` aren't in WOF admin — would need OSM / OpenAddresses gazetteers and license diligence
380
+ * (Phase 4.4 candidate).
378
381
  * - Non-US JP-specific tags wait on a different shard entirely.
379
382
  */
380
383
  export type PlacetypeMap = Partial<Record<ComponentTag, string>>;
381
384
  export declare const DEFAULT_PLACETYPE_MAP: PlacetypeMap;
382
385
  /**
383
- * Placetype-equivalence groups for lookup FILTERING. WOF splits a single addressing tier across
384
- * several placetypes, but an address's span can name ANY of them. A backend that filters to the one
385
- * "obvious" placetype makes the equivalents unreachable, so a fuzzy same-name place in the wrong
386
- * tier wins instead.
386
+ * Placetype-equivalence groups for lookup FILTERING. WOF splits a single addressing tier across several placetypes, but
387
+ * an address's span can name ANY of them. A backend that filters to the one "obvious" placetype makes the equivalents
388
+ * unreachable, so a fuzzy same-name place in the wrong tier wins instead.
387
389
  *
388
- * Three tiers are affected (the value of each entry is the set the SQL filter should accept; the
389
- * FIRST entry is the canonical/requested type, which shard routing keys off):
390
+ * Three tiers are affected (the value of each entry is the set the SQL filter should accept; the FIRST entry is the
391
+ * canonical/requested type, which shard routing keys off):
390
392
  *
391
- * - **`locality`** — `locality` (most cities), `borough` (Brooklyn, the Paris arrondissements, the
392
- * London boroughs), and `localadmin` (FR communes, US towns/townships in New England). Without
393
- * the group, Brooklyn-the-borough (pop 2.5M) was unreachable and the fuzzy "Brooklyn Park, MN"
394
- * won.
395
- * - **`region`** — `region` + `macroregion` (#718). WOF does NOT model every country's top-level
396
- * civil division as `region`: Italian regions (Lombardia, Veneto, Toscana…) are `macroregion`
397
- * (their PROVINCES are `region`), and the post-2016 French régions (Île-de-France) are
398
- * `macroregion` too. An address's `region` span names exactly those, so a `region`-only filter
399
- * resolved them to NOTHING (confirmed against the IT/FR eval rows). US states / DE Bundesländer /
400
- * ES provincias are genuine `region`, so the EXACT-type match is preferred in ranking (see the
393
+ * - **`locality`** — `locality` (most cities), `borough` (Brooklyn, the Paris arrondissements, the London boroughs), and
394
+ * `localadmin` (FR communes, US towns/townships in New England). Without the group, Brooklyn-the-borough (pop 2.5M)
395
+ * was unreachable and the fuzzy "Brooklyn Park, MN" won.
396
+ * - **`region`** — `region` + `macroregion` (#718). WOF does NOT model every country's top-level civil division as
397
+ * `region`: Italian regions (Lombardia, Veneto, Toscana…) are `macroregion` (their PROVINCES are `region`), and the
398
+ * post-2016 French régions (Île-de-France) are `macroregion` too. An address's `region` span names exactly those, so
399
+ * a `region`-only filter resolved them to NOTHING (confirmed against the IT/FR eval rows). US states / DE
400
+ * Bundesländer / ES provincias are genuine `region`, so the EXACT-type match is preferred in ranking (see the
401
401
  * resolve.ts fallback-quality annotation) — the macro is the recall safety net, not a demotion.
402
402
  * - **`county`** — `county` + `macrocounty` (#718). The `subregion` ComponentTag maps to `county` via
403
- * {@link DEFAULT_PLACETYPE_MAP}; WOF carries `macrocounty` for FR départements-grouping / DE / GB
404
- * tiers above the county. Proactive (no eval row exercises `subregion` today) but symmetric with
405
- * `region` — biasing to inclusion, since a missed resolution costs more than a too-broad
406
- * candidate (which is QA-visible). Same exact-type preference applies.
403
+ * {@link DEFAULT_PLACETYPE_MAP}; WOF carries `macrocounty` for FR départements-grouping / DE / GB tiers above the
404
+ * county. Proactive (no eval row exercises `subregion` today) but symmetric with `region` — biasing to inclusion,
405
+ * since a missed resolution costs more than a too-broad candidate (which is QA-visible). Same exact-type preference
406
+ * applies.
407
407
  *
408
408
  * This table is the single source of truth for that expansion, shared by every lookup backend
409
- * (`@mailwoman/core/resolver-wof-sqlite`, `@mailwoman/core/resolver-wof-wasm`, and the demo's
410
- * httpvfs lookup) so the Node and browser resolvers can't drift. Keyed by the REQUESTED placetype.
411
- * Placetypes without an entry pass through unchanged — an explicit `placetype: "borough"` query
412
- * stays narrow.
409
+ * (`@mailwoman/core/resolver-wof-sqlite`, `@mailwoman/core/resolver-wof-wasm`, and the demo's httpvfs lookup) so the
410
+ * Node and browser resolvers can't drift. Keyed by the REQUESTED placetype. Placetypes without an entry pass through
411
+ * unchanged — an explicit `placetype: "borough"` query stays narrow.
413
412
  */
414
413
  export declare const PLACETYPE_FILTER_GROUPS: Readonly<Record<string, readonly string[]>>;
415
414
  /**
416
- * Expand a placetype filter through {@link PLACETYPE_FILTER_GROUPS}, deduplicated and
417
- * order-preserving (the first entry stays first — shard routing keys off it). `null`/`undefined`
418
- * (no filter) passes through untouched.
415
+ * Expand a placetype filter through {@link PLACETYPE_FILTER_GROUPS}, deduplicated and order-preserving (the first entry
416
+ * stays first — shard routing keys off it). `null`/`undefined` (no filter) passes through untouched.
419
417
  */
420
418
  export declare function expandPlacetypeFilter(placetypes: null): null;
421
419
  export declare function expandPlacetypeFilter(placetypes: readonly string[]): string[];
422
420
  export declare function expandPlacetypeFilter(placetypes: readonly string[] | null): string[] | null;
423
421
  /**
424
- * Did `candidatePlacetype` resolve `requestedPlacetype` only via a BROADER admin tier (a macro-type
425
- * fallback within the {@link PLACETYPE_FILTER_GROUPS} expansion), rather than the exact type
426
- * (#718)?
422
+ * Did `candidatePlacetype` resolve `requestedPlacetype` only via a BROADER admin tier (a macro-type fallback within the
423
+ * {@link PLACETYPE_FILTER_GROUPS} expansion), rather than the exact type (#718)?
427
424
  *
428
- * `region` → `region` is exact (false); `region` → `macroregion` is a fallback (true). Scoped to
429
- * the `macro*` tiers (see {@link MACRO_FALLBACK_PLACETYPES}) so the `locality` group's
430
- * borough/localadmin peers stay exact. The resolver uses this to (a) prefer an exact-type candidate
431
- * in ranking and (b) annotate `resolutionQuality: "fallback"` when only a macro-type matched. A
432
- * placetype outside the requested group, or any non-macro member, is treated as exact (false).
425
+ * `region` → `region` is exact (false); `region` → `macroregion` is a fallback (true). Scoped to the `macro*` tiers
426
+ * (see {@link MACRO_FALLBACK_PLACETYPES}) so the `locality` group's borough/localadmin peers stay exact. The resolver
427
+ * uses this to (a) prefer an exact-type candidate in ranking and (b) annotate `resolutionQuality: "fallback"` when only
428
+ * a macro-type matched. A placetype outside the requested group, or any non-macro member, is treated as exact (false).
433
429
  */
434
430
  export declare function isPlacetypeFallback(requestedPlacetype: string, candidatePlacetype: string): boolean;
435
431
  /**
436
- * The interface implemented by `createWofResolver` and any future resolver factories.
432
+ * The interface implemented by `createWOFResolver` and any future resolver factories.
437
433
  *
438
- * `resolveTree` returns a NEW `AddressTree` rather than mutating — keeps the input safe to inspect
439
- * after the call. The new tree's `roots` are fresh `AddressNode` objects; nodes the resolver didn't
440
- * touch are structurally cloned with their classifier attribution preserved.
434
+ * `resolveTree` returns a NEW `AddressTree` rather than mutating — keeps the input safe to inspect after the call. The
435
+ * new tree's `roots` are fresh `AddressNode` objects; nodes the resolver didn't touch are structurally cloned with
436
+ * their classifier attribution preserved.
441
437
  */
442
438
  export interface Resolver {
443
439
  resolveTree(tree: AddressTree, opts?: ResolveOpts): Promise<AddressTree>;