@mailwoman/resolver 9.2.0 → 9.4.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 (143) hide show
  1. package/README.md +5 -5
  2. package/{admin-coherence-passes.ts → lib/admin/coherence-passes.ts} +87 -9
  3. package/{admin-containment.ts → lib/admin/containment.ts} +5 -14
  4. package/lib/admin/index.ts +10 -0
  5. package/lib/admin/jp-municipality.ts +97 -0
  6. package/{admin-winner.ts → lib/admin/winner.ts} +18 -2
  7. package/{backend-capabilities.ts → lib/backend-capabilities.ts} +3 -3
  8. package/{bare-toponym-race.ts → lib/bare-toponym-race.ts} +1 -1
  9. package/{decorate-node.ts → lib/decorate-node.ts} +2 -2
  10. package/{fold-name.ts → lib/fold-name.ts} +2 -2
  11. package/{index.ts → lib/index.ts} +16 -22
  12. package/{plausibility.ts → lib/plausibility.ts} +5 -4
  13. package/{postcode-country-coherence.ts → lib/postcode/country-coherence.ts} +27 -32
  14. package/lib/postcode/index.ts +9 -0
  15. package/{postcode-prefix.ts → lib/postcode/prefix.ts} +4 -4
  16. package/{postcode-shape-coherence.ts → lib/postcode/shape-coherence.ts} +10 -24
  17. package/{remote-resolver.ts → lib/remote-resolver.ts} +13 -4
  18. package/{rerank.ts → lib/rerank.ts} +2 -2
  19. package/{resolve.ts → lib/resolve/index.ts} +133 -602
  20. package/lib/resolve/passes.ts +544 -0
  21. package/{span-rescore.ts → lib/span-rescore.ts} +63 -97
  22. package/{street-evidence.ts → lib/street/evidence.ts} +39 -6
  23. package/lib/street/index.ts +8 -0
  24. package/{street-tier.ts → lib/street/tier.ts} +131 -110
  25. package/{toponym-prior.ts → lib/toponym-prior.ts} +8 -8
  26. package/out/{admin-coherence-passes.d.ts → admin/coherence-passes.d.ts} +29 -7
  27. package/out/admin/coherence-passes.d.ts.map +1 -0
  28. package/out/{admin-coherence-passes.js → admin/coherence-passes.js} +73 -9
  29. package/out/admin/coherence-passes.js.map +1 -0
  30. package/out/{admin-containment.d.ts → admin/containment.d.ts} +5 -5
  31. package/out/admin/containment.d.ts.map +1 -0
  32. package/out/{admin-containment.js → admin/containment.js} +6 -12
  33. package/out/admin/containment.js.map +1 -0
  34. package/out/admin/index.d.ts +10 -0
  35. package/out/admin/index.d.ts.map +1 -0
  36. package/out/admin/index.js +10 -0
  37. package/out/admin/index.js.map +1 -0
  38. package/out/admin/jp-municipality.d.ts +50 -0
  39. package/out/admin/jp-municipality.d.ts.map +1 -0
  40. package/out/admin/jp-municipality.js +54 -0
  41. package/out/admin/jp-municipality.js.map +1 -0
  42. package/out/{admin-winner.d.ts → admin/winner.d.ts} +11 -3
  43. package/out/admin/winner.d.ts.map +1 -0
  44. package/out/{admin-winner.js → admin/winner.js} +19 -3
  45. package/out/admin/winner.js.map +1 -0
  46. package/out/backend-capabilities.d.ts.map +1 -1
  47. package/out/backend-capabilities.js +3 -3
  48. package/out/backend-capabilities.js.map +1 -1
  49. package/out/bare-toponym-race.d.ts.map +1 -1
  50. package/out/bare-toponym-race.js +1 -1
  51. package/out/bare-toponym-race.js.map +1 -1
  52. package/out/decorate-node.d.ts +1 -1
  53. package/out/decorate-node.d.ts.map +1 -1
  54. package/out/decorate-node.js +1 -1
  55. package/out/decorate-node.js.map +1 -1
  56. package/out/fold-name.d.ts +2 -2
  57. package/out/fold-name.d.ts.map +1 -1
  58. package/out/fold-name.js +2 -2
  59. package/out/fold-name.js.map +1 -1
  60. package/out/index.d.ts +15 -16
  61. package/out/index.d.ts.map +1 -1
  62. package/out/index.js +9 -10
  63. package/out/index.js.map +1 -1
  64. package/out/plausibility.d.ts +5 -4
  65. package/out/plausibility.d.ts.map +1 -1
  66. package/out/plausibility.js +5 -4
  67. package/out/plausibility.js.map +1 -1
  68. package/out/{postcode-country-coherence.d.ts → postcode/country-coherence.d.ts} +16 -16
  69. package/out/postcode/country-coherence.d.ts.map +1 -0
  70. package/out/{postcode-country-coherence.js → postcode/country-coherence.js} +24 -25
  71. package/out/postcode/country-coherence.js.map +1 -0
  72. package/out/postcode/index.d.ts +9 -0
  73. package/out/postcode/index.d.ts.map +1 -0
  74. package/out/postcode/index.js +9 -0
  75. package/out/postcode/index.js.map +1 -0
  76. package/out/{postcode-prefix.d.ts → postcode/prefix.d.ts} +4 -4
  77. package/out/postcode/prefix.d.ts.map +1 -0
  78. package/out/{postcode-prefix.js → postcode/prefix.js} +4 -4
  79. package/out/postcode/prefix.js.map +1 -0
  80. package/out/{postcode-shape-coherence.d.ts → postcode/shape-coherence.d.ts} +3 -3
  81. package/out/postcode/shape-coherence.d.ts.map +1 -0
  82. package/out/{postcode-shape-coherence.js → postcode/shape-coherence.js} +11 -20
  83. package/out/postcode/shape-coherence.js.map +1 -0
  84. package/out/remote-resolver.d.ts +18 -3
  85. package/out/remote-resolver.d.ts.map +1 -1
  86. package/out/remote-resolver.js +2 -2
  87. package/out/remote-resolver.js.map +1 -1
  88. package/out/rerank.d.ts +1 -1
  89. package/out/rerank.d.ts.map +1 -1
  90. package/out/rerank.js +2 -2
  91. package/out/rerank.js.map +1 -1
  92. package/out/{resolve.d.ts → resolve/index.d.ts} +1 -1
  93. package/out/resolve/index.d.ts.map +1 -0
  94. package/out/{resolve.js → resolve/index.js} +100 -387
  95. package/out/resolve/index.js.map +1 -0
  96. package/out/resolve/passes.d.ts +218 -0
  97. package/out/resolve/passes.d.ts.map +1 -0
  98. package/out/resolve/passes.js +333 -0
  99. package/out/resolve/passes.js.map +1 -0
  100. package/out/span-rescore.d.ts +16 -16
  101. package/out/span-rescore.d.ts.map +1 -1
  102. package/out/span-rescore.js +43 -69
  103. package/out/span-rescore.js.map +1 -1
  104. package/out/{street-evidence.d.ts → street/evidence.d.ts} +18 -3
  105. package/out/street/evidence.d.ts.map +1 -0
  106. package/out/{street-evidence.js → street/evidence.js} +22 -6
  107. package/out/street/evidence.js.map +1 -0
  108. package/out/street/index.d.ts +8 -0
  109. package/out/street/index.d.ts.map +1 -0
  110. package/out/street/index.js +8 -0
  111. package/out/street/index.js.map +1 -0
  112. package/out/{street-tier.d.ts → street/tier.d.ts} +14 -3
  113. package/out/street/tier.d.ts.map +1 -0
  114. package/out/{street-tier.js → street/tier.js} +121 -99
  115. package/out/street/tier.js.map +1 -0
  116. package/out/toponym-prior.d.ts +8 -8
  117. package/out/toponym-prior.d.ts.map +1 -1
  118. package/out/toponym-prior.js +8 -8
  119. package/out/toponym-prior.js.map +1 -1
  120. package/package.json +116 -59
  121. package/vitest.config.ts +5 -6
  122. package/out/admin-coherence-passes.d.ts.map +0 -1
  123. package/out/admin-coherence-passes.js.map +0 -1
  124. package/out/admin-containment.d.ts.map +0 -1
  125. package/out/admin-containment.js.map +0 -1
  126. package/out/admin-winner.d.ts.map +0 -1
  127. package/out/admin-winner.js.map +0 -1
  128. package/out/postcode-country-coherence.d.ts.map +0 -1
  129. package/out/postcode-country-coherence.js.map +0 -1
  130. package/out/postcode-prefix.d.ts.map +0 -1
  131. package/out/postcode-prefix.js.map +0 -1
  132. package/out/postcode-shape-coherence.d.ts.map +0 -1
  133. package/out/postcode-shape-coherence.js.map +0 -1
  134. package/out/resolve.d.ts.map +0 -1
  135. package/out/resolve.js.map +0 -1
  136. package/out/street-evidence.d.ts.map +0 -1
  137. package/out/street-evidence.js.map +0 -1
  138. package/out/street-tier.d.ts.map +0 -1
  139. package/out/street-tier.js.map +0 -1
  140. package/out/vitest.config.d.ts +0 -16
  141. package/out/vitest.config.d.ts.map +0 -1
  142. package/out/vitest.config.js +0 -36
  143. package/out/vitest.config.js.map +0 -1
@@ -9,25 +9,19 @@
9
9
  * before the limit window (so a contained candidate can reach the walk at all), and the resolver
10
10
  * walk partitions AGAIN after its fame/anchor re-ranks (so `rankByImportance` cannot hand the top
11
11
  * slot back to a more-famous uncontained namesake — Richmond VA outscores Richmond, North
12
- * Yorkshire on importance, and without the second partition the lever loses exactly where fame
12
+ * Yorkshire on importance, and without the second partition the change loses exactly where fame
13
13
  * disagrees with the qualifier). Two call sites, one function, one ordering.
14
14
  */
15
+ import { firstNodeWhere } from "@mailwoman/core/decoder";
15
16
  /**
16
17
  * Find the first non-empty region-tagged span anywhere in a tree — the qualifier the walk threads onto locality
17
- * lookups. Deliberately the same node the admin-coherence VERDICTS read (the first `region` node), so the lever's
18
+ * lookups. Deliberately the same node the admin-coherence VERDICTS read (the first `region` node), so the change's
18
19
  * firing population and the flag's `contradicted` population are the same rows. A `region` slot can hold a country name
19
20
  * the parser mislabeled ("Moscow, Russia" parses region="Russia") — the backend's qualifier probe answers that too,
20
21
  * because containment is containment whatever tier the container sits at.
21
22
  */
22
23
  export function firstRegionQualifier(roots) {
23
- const stack = [...roots];
24
- while (stack.length) {
25
- const n = stack.pop();
26
- if (n.tag === "region" && n.value.trim().length)
27
- return n.value.trim();
28
- stack.push(...n.children);
29
- }
30
- return undefined;
24
+ return firstNodeWhere(roots, (n) => n.tag === "region" && n.value.trim().length > 0)?.value.trim();
31
25
  }
32
26
  /**
33
27
  * Stable, TIER-SAFE partition: within each match tier, candidates the containment source vouched for (`isContained`)
@@ -62,7 +56,7 @@ export function partitionByContainment(rows, isContained, isExact) {
62
56
  return out;
63
57
  }
64
58
  /**
65
- * The trace verdict for one locality pick under the lever — stamped as `metadata.admin_containment` so an inert
59
+ * The trace verdict for one locality pick under the change — stamped as `metadata.admin_containment` so an inert
66
60
  * mechanism is visible in the result rather than silently dead (#1719's rule). Derived from the candidates'
67
61
  * `containedByQualifier` stamps: any `true` → `"contained"`; stamps present but none true → `"no_contained_candidate"`;
68
62
  * no stamps at all → `"unavailable"` (the backend or artifact cannot answer — a pre-sidecar candidate.db, the FTS or
@@ -79,4 +73,4 @@ export function adminContainmentVerdict(candidates) {
79
73
  }
80
74
  return evaluated ? "no_contained_candidate" : "unavailable";
81
75
  }
82
- //# sourceMappingURL=admin-containment.js.map
76
+ //# sourceMappingURL=containment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"containment.js","sourceRoot":"","sources":["../../lib/admin/containment.ts"],"names":[],"mappings":"AAAA;;;;;;;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AAK,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;YACzC,GAAG,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC,CAAE,CAAA;QAC1B,CAAC;IACF,CAAC;IAED,OAAO,GAAG,CAAA;AACX,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,uBAAuB,CACtC,UAAyE;IAEzE,IAAI,SAAS,GAAG,KAAK,CAAA;IAErB,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACpC,IAAI,SAAS,CAAC,oBAAoB,KAAK,IAAI;YAAE,OAAO,WAAW,CAAA;QAE/D,IAAI,SAAS,CAAC,oBAAoB,KAAK,SAAS,EAAE,CAAC;YAClD,SAAS,GAAG,IAAI,CAAA;QACjB,CAAC;IACF,CAAC;IAED,OAAO,SAAS,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,aAAa,CAAA;AAC5D,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ */
6
+ export * from "#admin/coherence-passes";
7
+ export * from "#admin/containment";
8
+ export * from "#admin/jp-municipality";
9
+ export * from "#admin/winner";
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/admin/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,yBAAyB,CAAA;AACvC,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,eAAe,CAAA"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ */
6
+ export * from "#admin/coherence-passes";
7
+ export * from "#admin/containment";
8
+ export * from "#admin/jp-municipality";
9
+ export * from "#admin/winner";
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../lib/admin/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,yBAAyB,CAAA;AACvC,cAAc,oBAAoB,CAAA;AAClC,cAAc,wBAAwB,CAAA;AACtC,cAAc,eAAe,CAAA"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ * @file A compound Japanese municipality split into the two units the gazetteer keys separately.
6
+ *
7
+ * The JP model tags `神戸市西区` (city + ward) and `猿島郡五霞町` (county + town) as ONE `municipality` span, which is
8
+ * the postal form, and WOF keys the city, the ward and the town — never the compound. Probed whole, the span misses
9
+ * and the coordinate falls to the prefecture centroid (25–52 km on the JP board). Probed as its trailing unit
10
+ * UNSCOPED it does worse: a bare `西区` resolves a namesake ward in another city (Kobe's answered Fukuoka's, 407 km;
11
+ * 251 of 300 rows against 271 whole). The split is therefore consumed by the resolver walk as a SCOPED pair: the
12
+ * head resolves first, the tail probes as its child, and a namesake outside the head is not admissible.
13
+ */
14
+ export interface CompoundMunicipality {
15
+ /**
16
+ * The containing unit: the city (`神戸市`) or the county (`猿島郡`).
17
+ */
18
+ head: string;
19
+ /**
20
+ * The contained unit: the ward (`西区`) or the town / village (`五霞町`).
21
+ */
22
+ tail: string;
23
+ shape: "city_ward" | "county_town";
24
+ }
25
+ /**
26
+ * The head and tail of a compound municipality, or null for a plain one (`都城市`, `千代田区`, `東村山市`).
27
+ */
28
+ export declare function compoundMunicipality(value: string): CompoundMunicipality | null;
29
+ /**
30
+ * One probe of the gazetteer as the walk makes it: `value` under `scope`, with the parent fallback allowed or withheld.
31
+ */
32
+ export type CompoundMunicipalityProbe<Place, Pick extends {
33
+ top: Place;
34
+ metadata?: Record<string, unknown>;
35
+ }> = (value: string, scope: Place | null, parentFallback: boolean) => Promise<Pick | null>;
36
+ /**
37
+ * A compound municipality probed as a SCOPED pair after the whole span missed: the head under the node's own parent
38
+ * with the walk's ordinary fallback, then the tail as the head's child with the parent fallback WITHHELD, so a namesake
39
+ * ward or town outside the head is never admissible — including one the backend re-admits through its own region-scope
40
+ * fallback (`regionScopeMiss`). A county head usually has no key; the tail then probes under the parent the walk
41
+ * already holds. Answers the tail when it hits, else the head, else null. Two probes at most, each drawn from the
42
+ * caller's budget (`hasBudget`).
43
+ */
44
+ export declare function resolveCompoundMunicipality<Place extends {
45
+ regionScopeMiss?: boolean;
46
+ }, Pick extends {
47
+ top: Place;
48
+ metadata?: Record<string, unknown>;
49
+ }>(value: string, parent: Place | null, hasBudget: () => boolean, probe: CompoundMunicipalityProbe<Place, Pick>): Promise<Pick | null>;
50
+ //# sourceMappingURL=jp-municipality.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jp-municipality.d.ts","sourceRoot":"","sources":["../../lib/admin/jp-municipality.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,oBAAoB;IACpC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,WAAW,GAAG,aAAa,CAAA;CAClC;AAKD;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,oBAAoB,GAAG,IAAI,CAe/E;AAED;;GAEG;AACH,MAAM,MAAM,yBAAyB,CAAC,KAAK,EAAE,IAAI,SAAS;IAAE,GAAG,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,IAAI,CAC/G,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,KAAK,GAAG,IAAI,EACnB,cAAc,EAAE,OAAO,KACnB,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CAAA;AAUzB;;;;;;;GAOG;AACH,wBAAsB,2BAA2B,CAChD,KAAK,SAAS;IAAE,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,EAC3C,IAAI,SAAS;IAAE,GAAG,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,EAE/D,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,KAAK,GAAG,IAAI,EACpB,SAAS,EAAE,MAAM,OAAO,EACxB,KAAK,EAAE,yBAAyB,CAAC,KAAK,EAAE,IAAI,CAAC,GAC3C,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,CActB"}
@@ -0,0 +1,54 @@
1
+ /**
2
+ * @copyright Sister Software
3
+ * @license AGPL-3.0
4
+ * @author Teffen Ellis, et al.
5
+ * @file A compound Japanese municipality split into the two units the gazetteer keys separately.
6
+ *
7
+ * The JP model tags `神戸市西区` (city + ward) and `猿島郡五霞町` (county + town) as ONE `municipality` span, which is
8
+ * the postal form, and WOF keys the city, the ward and the town — never the compound. Probed whole, the span misses
9
+ * and the coordinate falls to the prefecture centroid (25–52 km on the JP board). Probed as its trailing unit
10
+ * UNSCOPED it does worse: a bare `西区` resolves a namesake ward in another city (Kobe's answered Fukuoka's, 407 km;
11
+ * 251 of 300 rows against 271 whole). The split is therefore consumed by the resolver walk as a SCOPED pair: the
12
+ * head resolves first, the tail probes as its child, and a namesake outside the head is not admissible.
13
+ */
14
+ const CITY_WARD = /^(.+?市)(.+区)$/u;
15
+ const COUNTY_TOWN = /^(.+?郡)(.+[町村])$/u;
16
+ /**
17
+ * The head and tail of a compound municipality, or null for a plain one (`都城市`, `千代田区`, `東村山市`).
18
+ */
19
+ export function compoundMunicipality(value) {
20
+ const trimmed = value.trim();
21
+ const cityWard = CITY_WARD.exec(trimmed);
22
+ if (cityWard) {
23
+ return { head: cityWard[1], tail: cityWard[2], shape: "city_ward" };
24
+ }
25
+ const countyTown = COUNTY_TOWN.exec(trimmed);
26
+ if (countyTown) {
27
+ return { head: countyTown[1], tail: countyTown[2], shape: "county_town" };
28
+ }
29
+ return null;
30
+ }
31
+ function stamp(pick, split, answered) {
32
+ return pick ? { ...pick, metadata: { ...pick.metadata, municipality_split: { ...split, answered } } } : null;
33
+ }
34
+ /**
35
+ * A compound municipality probed as a SCOPED pair after the whole span missed: the head under the node's own parent
36
+ * with the walk's ordinary fallback, then the tail as the head's child with the parent fallback WITHHELD, so a namesake
37
+ * ward or town outside the head is never admissible — including one the backend re-admits through its own region-scope
38
+ * fallback (`regionScopeMiss`). A county head usually has no key; the tail then probes under the parent the walk
39
+ * already holds. Answers the tail when it hits, else the head, else null. Two probes at most, each drawn from the
40
+ * caller's budget (`hasBudget`).
41
+ */
42
+ export async function resolveCompoundMunicipality(value, parent, hasBudget, probe) {
43
+ const split = compoundMunicipality(value);
44
+ if (!split || !hasBudget())
45
+ return null;
46
+ const head = await probe(split.head, parent, true);
47
+ if (!hasBudget())
48
+ return stamp(head, split, "head");
49
+ const tail = await probe(split.tail, head?.top ?? parent, false);
50
+ if (tail && !tail.top.regionScopeMiss)
51
+ return stamp(tail, split, "tail");
52
+ return stamp(head, split, "head");
53
+ }
54
+ //# sourceMappingURL=jp-municipality.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jp-municipality.js","sourceRoot":"","sources":["../../lib/admin/jp-municipality.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAcH,MAAM,SAAS,GAAG,gBAAgB,CAAA;AAClC,MAAM,WAAW,GAAG,mBAAmB,CAAA;AAEvC;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAAa;IACjD,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAA;IAC5B,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAExC,IAAI,QAAQ,EAAE,CAAC;QACd,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAE,EAAE,KAAK,E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,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;IAExE,OAAO,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;AAClC,CAAC"}
@@ -16,13 +16,21 @@ import type { AddressNode } from "@mailwoman/core/decoder";
16
16
  /**
17
17
  * The admin fallback order when the postcode leads — a unit-grade exact hit, or an address system whose area-grade code
18
18
  * is still finer than its locality ({@link areaPostcodeLeadsLocality}).
19
+ *
20
+ * The JP rungs (`municipality`, `district`, `prefecture`) sit beside their Latin counterparts, and `municipality`
21
+ * stands ABOVE `district` on purpose. `subregion` (a county, a Korean 시군구) sits between the postcode and `region`:
22
+ * finer than the region it belongs to, coarser than any postcode. Absent from the ladder it was never the answer, and
23
+ * `부산광역시 해운대구 반송로 910-1` resolved both nodes and reported Busan's point, 3.3 km from the address, over Haeundae's. It
24
+ * stands ABOVE `district` on purpose: a district (大字 / 町名) resolves without its municipality as a parent more often
25
+ * than not, and the unscoped namesake it then picks can be another prefecture's (`市原市大作` → 921 km). Measured on 300 JP
26
+ * board rows @15 km: district-first 202 accepted, municipality-first 271.
19
27
  */
20
28
  export declare const ADMIN_LADDER_POSTCODE_FIRST: ReadonlyArray<string>;
21
29
  /**
22
30
  * The admin fallback order everywhere else: the locality tiers lead and the postcode sits between them and `region`.
23
31
  *
24
- * This is the #945 epoch convention, and it is the DEFAULT rather than the universal answer — which address systems
25
- * leave it is `AREA_POSTCODE_FINER_THAN_LOCALITY`'s question, and that table carries the per-country measurement.
32
+ * This is the #945 epoch convention and the DEFAULT rather than the universal answer — which address systems leave it
33
+ * is `AREA_POSTCODE_FINER_THAN_LOCALITY`'s question, and that table carries the per-country measurement.
26
34
  */
27
35
  export declare const ADMIN_LADDER_LOCALITY_FIRST: ReadonlyArray<string>;
28
36
  /**
@@ -106,4 +114,4 @@ export declare function resolvedSpecificity(candidate: ResolvedSpecificityInput)
106
114
  * site is where that mapping is visible.
107
115
  */
108
116
  export declare function mostSpecificResolved<T>(candidates: readonly T[], toInput: (candidate: T) => ResolvedSpecificityInput): T | null;
109
- //# sourceMappingURL=admin-winner.d.ts.map
117
+ //# sourceMappingURL=winner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"winner.d.ts","sourceRoot":"","sources":["../../lib/admin/winner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAG1D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,2BAA2B,EAAE,aAAa,CAAC,MAAM,CAU7D,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,EAAE,aAAa,CAAC,MAAM,CAU7D,CAAA;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,GAAG,SAAS,CAAA;IAChC;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,mBAAmB,GAAG,SAAS,GAAG,aAAa,CAAC,MAAM,CAAC,CAO/F;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,GAAG,aAAa,CAAC,MAAM,CAAC,CAYxF;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,iCAAiC,MAAM,CAAA;AAEpD;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACxC,SAAS,EAAE,MAAM,CAAA;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,wBAAwB,GAAG,MAAM,CAU/E;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EACrC,UAAU,EAAE,SAAS,CAAC,EAAE,EACxB,OAAO,EAAE,CAAC,SAAS,EAAE,CAAC,KAAK,wBAAwB,GACjD,CAAC,GAAG,IAAI,CAcV"}
@@ -17,25 +17,41 @@ import { PLACETYPE_SPECIFICITY } from "@mailwoman/core/resources/whosonfirst/spe
17
17
  /**
18
18
  * The admin fallback order when the postcode leads — a unit-grade exact hit, or an address system whose area-grade code
19
19
  * is still finer than its locality ({@link areaPostcodeLeadsLocality}).
20
+ *
21
+ * The JP rungs (`municipality`, `district`, `prefecture`) sit beside their Latin counterparts, and `municipality`
22
+ * stands ABOVE `district` on purpose. `subregion` (a county, a Korean 시군구) sits between the postcode and `region`:
23
+ * finer than the region it belongs to, coarser than any postcode. Absent from the ladder it was never the answer, and
24
+ * `부산광역시 해운대구 반송로 910-1` resolved both nodes and reported Busan's point, 3.3 km from the address, over Haeundae's. It
25
+ * stands ABOVE `district` on purpose: a district (大字 / 町名) resolves without its municipality as a parent more often
26
+ * than not, and the unscoped namesake it then picks can be another prefecture's (`市原市大作` → 921 km). Measured on 300 JP
27
+ * board rows @15 km: district-first 202 accepted, municipality-first 271.
20
28
  */
21
29
  export const ADMIN_LADDER_POSTCODE_FIRST = [
22
30
  "postcode",
23
31
  "locality",
32
+ "municipality",
24
33
  "dependent_locality",
34
+ "district",
35
+ "subregion",
25
36
  "region",
37
+ "prefecture",
26
38
  "country",
27
39
  ];
28
40
  /**
29
41
  * The admin fallback order everywhere else: the locality tiers lead and the postcode sits between them and `region`.
30
42
  *
31
- * This is the #945 epoch convention, and it is the DEFAULT rather than the universal answer — which address systems
32
- * leave it is `AREA_POSTCODE_FINER_THAN_LOCALITY`'s question, and that table carries the per-country measurement.
43
+ * This is the #945 epoch convention and the DEFAULT rather than the universal answer — which address systems leave it
44
+ * is `AREA_POSTCODE_FINER_THAN_LOCALITY`'s question, and that table carries the per-country measurement.
33
45
  */
34
46
  export const ADMIN_LADDER_LOCALITY_FIRST = [
35
47
  "locality",
48
+ "municipality",
36
49
  "dependent_locality",
50
+ "district",
37
51
  "postcode",
52
+ "subregion",
38
53
  "region",
54
+ "prefecture",
39
55
  "country",
40
56
  ];
41
57
  /**
@@ -116,4 +132,4 @@ export function mostSpecificResolved(candidates, toInput) {
116
132
  }
117
133
  return best;
118
134
  }
119
- //# sourceMappingURL=admin-winner.js.map
135
+ //# sourceMappingURL=winner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"winner.js","sourceRoot":"","sources":["../../lib/admin/winner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAEpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAA;AAEzF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAA0B;IACjE,UAAU;IACV,UAAU;IACV,cAAc;IACd,oBAAoB;IACpB,UAAU;IACV,WAAW;IACX,QAAQ;IACR,YAAY;IACZ,SAAS;CACT,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAA0B;IACjE,UAAU;IACV,cAAc;IACd,oBAAoB;IACpB,UAAU;IACV,UAAU;IACV,WAAW;IACX,QAAQ;IACR,YAAY;IACZ,SAAS;CACT,CAAA;AAoBD;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,CAAC,QAAyC;IACvE,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,2BAA2B,CAAA;IAE9D,MAAM,KAAK,GACV,sBAAsB,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,YAAY,CAAC,IAAI,yBAAyB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;IAE7G,OAAO,KAAK,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,2BAA2B,CAAA;AACzE,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CA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AAmD;IAEnD,IAAI,IAAI,GAAa,IAAI,CAAA;IACzB,IAAI,QAAQ,GAAG,MAAM,CAAC,iBAAiB,CAAA;IAEvC,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE,CAAC;QACpC,MAAM,IAAI,GAAG,mBAAmB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAA;QAEpD,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI,GAAG,QAAQ,EAAE,CAAC;YACtC,IAAI,GAAG,SAAS,CAAA;YAChB,QAAQ,GAAG,IAAI,CAAA;QAChB,CAAC;IACF,CAAC;IAED,OAAO,IAAI,CAAA;AACZ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"backend-capabilities.d.ts","sourceRoot":"","sources":["../backend-capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAwBrF;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS,oBAAoB,EAAE,CAMhG;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,oBAAoB,EAAE,GAAG,MAAM,CAOlF;AAQD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,oBAAoB,EAAE,GAAG,IAAI,CAOhF"}
1
+ {"version":3,"file":"backend-capabilities.d.ts","sourceRoot":"","sources":["../lib/backend-capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAwBrF;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,eAAe,GAAG,SAAS,oBAAoB,EAAE,CAMhG;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,oBAAoB,EAAE,GAAG,MAAM,CAOlF;AAQD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,SAAS,oBAAoB,EAAE,GAAG,IAAI,CAOhF"}
@@ -24,13 +24,13 @@
24
24
  const CONSEQUENTIAL_CAPABILITIES = [
25
25
  {
26
26
  capability: "ancestors",
27
- gates: "hierarchyCompletion",
27
+ option: "hierarchyCompletion",
28
28
  defaultOn: true,
29
29
  degrades: "the containment lineage is never read: a parse that drops the locality of a city-state or dependent locality keeps the gap, and `metadata.ancestors` (the lineage the Nominatim and Photon drop-ins expose) is never populated",
30
30
  },
31
31
  {
32
32
  capability: "coincidentLocalitiesFor",
33
- gates: "hierarchyCompletion",
33
+ option: "hierarchyCompletion",
34
34
  defaultOn: true,
35
35
  degrades: "the dual-role pass never runs: a region that is also a locality under the same name resolves to one role only",
36
36
  },
@@ -51,7 +51,7 @@ export function describeCapabilityGaps(backend) {
51
51
  export function formatCapabilityGaps(gaps) {
52
52
  const [first] = gaps;
53
53
  const names = gaps.map((g) => `${g.capability}()`).join(", ");
54
- const options = [...new Set(gaps.map((g) => g.gates))].join(", ");
54
+ const options = [...new Set(gaps.map((g) => g.option))].join(", ");
55
55
  const posture = gaps.some((g) => g.defaultOn) ? "default-ON" : "opt-in";
56
56
  return `[resolver] ${first?.backend} lacks ${names} — ${options} (${posture}) silently no-ops; see docs/engineering/reference/resolver-backends.mdx`;
57
57
  }
@@ -1 +1 @@
1
- {"version":3,"file":"backend-capabilities.js","sourceRoot":"","sources":["../backend-capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAIH;;;;GAIG;AACH,MAAM,0BAA0B,GAAyD;IACxF;QACC,UAAU,EAAE,WAAW;QACvB,KAAK,EAAE,qBAAqB;QAC5B,SAAS,EAAE,IAAI;QACf,QAAQ,EACP,gOAAgO;KACjO;IACD;QACC,UAAU,EAAE,yBAAyB;QACrC,KAAK,EAAE,qBAAqB;QAC5B,SAAS,E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GAEG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI,GAAG,aAAa,GAAG,IAAI,CAMjH;AAUD;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACzC,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,GAAG,SAAS,GAC/B,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAoB/B;AAED;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACxC,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,GAAG,SAAS,GAC/B,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAkB/B"}
@@ -72,7 +72,7 @@ export async function bareCountryCandidate(backend, text, scopedCountry) {
72
72
  ...(scopedCountry ? { country: scopedCountry } : {}),
73
73
  });
74
74
  const top = hits[0];
75
- // The placetype check is load-bearing, not paranoia: a backend that ignores the filter
75
+ // The placetype check is required, not paranoia: a backend that ignores the filter
76
76
  // (several test stubs, and any future partial implementation) would otherwise hand this
77
77
  // race a LOCALITY row wearing a country costume, and the repick would demote the real pick.
78
78
  return top && top.placetype === "country" && top.exactMatch !== false ? top : null;
@@ -1 +1 @@
1
- {"version":3,"file":"bare-toponym-race.js","sourceRoot":"","sources":["../bare-toponym-race.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAG9D;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAiB,EAAE,YAA0B;IACjF,IAAI,YAAY,CAAC,UAA0B,CAAC,KAAK,UAAU;QAAE,OAAO,IAAI,CAAA;IACxE,MAAM,IAAI,GAAG,oBAAoB,CAAC,IAAI,CAAC,CAAA;IAEvC,OAAO,IAAI,EAAE,GAAG,KAAK,UAAU,CAAC,CAAC,CAAC,IAAI,CAA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,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAA;IACnF,CAAC;IAAC,MAAM,CAAC;QACR,uFAAuF;QACvF,OAAO,IAAI,CAAA;IACZ,CAAC;AACF,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACxC,OAAwB,EACxB,IAAY,EACZ,aAAiC;IAEjC,IAAI,CAAC;QACJ,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,SAAS,CAAC;YACpC,IAAI;YACJ,SAAS,EAAE,QAAQ;YACnB,KAAK,EAAE,CAAC;YACR,gBAAgB,EAAE,6BAA6B;YAC/C,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACpD,CAAC,CAAA;QAEF,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;QAEnB,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,KAAK,QAAQ,IAAI,GAAG,CAAC,SAAS,KAAK,aAAa,CAAC,IAAI,GAAG,CAAC,UAAU,KAAK,KAAK;YACxG,CAAC,CAAC,GAAG;YACL,CAAC,CAAC,IAAI,CAAA;IACR,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,IAAI,CAAA;IACZ,CAAC;AACF,CAAC"}
@@ -9,7 +9,7 @@
9
9
  */
10
10
  import type { AddressNode } from "@mailwoman/core/decoder";
11
11
  import type { ResolvedPlace } from "@mailwoman/core/resolver";
12
- import type { CoordinateOptionalPlace } from "./postcode-prefix.ts";
12
+ import type { CoordinateOptionalPlace } from "#postcode/prefix";
13
13
  /**
14
14
  * A resolved node carries a real coordinate (placeID set + non-zero lat/lon).
15
15
  */
@@ -1 +1 @@
1
- {"version":3,"file":"decorate-node.d.ts","sourceRoot":"","sources":["../decorate-node.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAE7D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAEnE;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,WAAW,GAAG,OAAO,CAE3D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC3B,IAAI,EAAE,WAAW,EACjB,QAAQ,EAAE,uBAAuB,EACjC,YAAY,EAAE,aAAa,EAAE,GAC3B,IAAI,CA8FN"}
1
+ {"version":3,"file":"decorate-node.d.ts","sourceRoot":"","sources":["../lib/decorate-node.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAA;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAE7D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAE/D;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,WAAW,GAAG,OAAO,CAE3D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC3B,IAAI,EAAE,WAAW,EACjB,QAAQ,EAAE,uBAAuB,EACjC,YAAY,EAAE,aAAa,EAAE,GAC3B,IAAI,CA8FN"}
@@ -32,7 +32,7 @@ export function decorateNode(node, resolved, alternatives) {
32
32
  }
33
33
  node.source = "resolver";
34
34
  node.sourceID = `${resolved.placetype}:${resolved.id}`;
35
- // `0,0` is the gazetteer's UNLOCATED sentinel, not a location in the Gulf of Guinea. Shards carry a lot of it —
35
+ // `0,0` is the gazetteer's UNLOCATED sentinel, not a location in the Gulf of Guinea. Extracts carry a lot of it —
36
36
  // 48,216 of 142,604 JP postcodes, 86,377 GB, 9,708 intl, 414 US — and stamping it produces a node that answers
37
37
  // "yes" to every `lat != null` guard downstream, including the admin ladder's. Absence is the representable form
38
38
  // (`AddressNode.lat` is optional and {@link isResolvedWithCoord} already reads the sentinel this way), so the
@@ -1 +1 @@
1
- {"version":3,"file":"decorate-node.js","sourceRoot":"","sources":["../decorate-node.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,CAAc;IACjD,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,CAAC,GAAG,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,GAAG,KAAK,QAAQ,IAAI,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAA;AAC/G,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAC3B,IAAiB,EACjB,QAAiC,EACjC,YAA6B;IAE7B,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC9D,MAAM,IAAI,GAAG,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAA;QAEjC,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;YAC/B,IAAI,CAAC,mBAAmB,CAAC,GAAG,IAAI,CAAC,MAAM,CAAA;QACxC,CAAC;QAED,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YACjC,IAAI,CAAC,sBAAsB,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAA;QAC7C,CAAC;QAED,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAA;IACrB,CAAC;IAED,IAAI,CAAC,MAAM,GAAG,UAAU,CAAA;IACxB,IAAI,CAAC,QAAQ,GAAG,GAAG,QAAQ,CAAC,SAAS,IAAI,QAAQ,CAAC,EAAE,EAAE,CAAA;IAEtD,gHAAgH;IAChH,+GAA+G;IAC/G,iHAAiH;IACjH,8GAA8G;IAC9G,gFAAgF;IAChF,EAAE;IACF,+GAA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,UAAU,CAAA;IAC3D,CAAC;IAED,gGAAgG;IAChG,kGAAkG;IAClG,0CAA0C;IAC1C,IAAI,QAAQ,CAAC,QAAQ,EAAE,CAAC;QACvB,IAAI,CAAC,QAAQ,CAAC,wBAAwB,CAAC,GAAG,IAAI,CAAA;IAC/C,CAAC;IAED,iGAAiG;IACjG,6FAA6F;IAC7F,+FAA+F;IAC/F,IAAI,QAAQ,CAAC,iBAAiB,EAAE,CAAC;QAChC,IAAI,CAAC,QAAQ,CAAC,oBAAoB,CAAC,GAAG,QAAQ,CAAC,iBAAiB,CAAA;IACjE,CAAC;IAED,IAAI,YAAY,CAAC,MAAM,EAAE,CAAC;QACzB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IACjC,CAAC;AACF,CAAC"}
@@ -7,7 +7,7 @@
7
7
  * locality comparison and by span-rescore's key guards. Its own module because those would
8
8
  * otherwise import each other for it.
9
9
  *
10
- * `@mailwoman/codex`'s `foldName` (`packages/codex/normalize.ts`) is a near twin and is also
10
+ * `@mailwoman/codex`'s `foldName` (`packages/codex/lib/normalize.ts`) is a near twin and is also
11
11
  * correct; it differs in collapsing every non-alphanumeric RUN, whitespace included. The two are
12
12
  * equivalent on the inputs either sees today. They are kept apart because this one answers to a
13
13
  * comparison contract the resolver owns, not because the codex copy is wrong.
@@ -18,7 +18,7 @@
18
18
  * Marks are DELETED, never spaced. `[^a-z0-9 ]` alone maps the combining cedilla that NFD has just produced to a SPACE,
19
19
  * so `Besançon` keys as `besanc on` and matches nothing it should. The gazetteer side of the same comparison deletes
20
20
  * them — 0 of 32,539 distinct `locality_base` keys in `street-centroids-fr.db` carry a mark — so spacing puts the two
21
- * halves of one comparison on different keys. Order is load-bearing: after the class filter the strip is a no-op.
21
+ * halves of one comparison on different keys. Order is required: after the class filter the strip is a no-op.
22
22
  *
23
23
  * Not fixed here, and worth knowing before trusting the fold on a non-Latin-1 name: a letter with no decomposition is
24
24
  * DROPPED rather than folded (`Łódź` → `odz`, `Đà Nẵng` → `a nang`). That needs a transliteration table, not a regex,
@@ -1 +1 @@
1
- {"version":3,"file":"fold-name.d.ts","sourceRoot":"","sources":["../fold-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAQ1C"}
1
+ {"version":3,"file":"fold-name.d.ts","sourceRoot":"","sources":["../lib/fold-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAQ1C"}
package/out/fold-name.js CHANGED
@@ -7,7 +7,7 @@
7
7
  * locality comparison and by span-rescore's key guards. Its own module because those would
8
8
  * otherwise import each other for it.
9
9
  *
10
- * `@mailwoman/codex`'s `foldName` (`packages/codex/normalize.ts`) is a near twin and is also
10
+ * `@mailwoman/codex`'s `foldName` (`packages/codex/lib/normalize.ts`) is a near twin and is also
11
11
  * correct; it differs in collapsing every non-alphanumeric RUN, whitespace included. The two are
12
12
  * equivalent on the inputs either sees today. They are kept apart because this one answers to a
13
13
  * comparison contract the resolver owns, not because the codex copy is wrong.
@@ -18,7 +18,7 @@
18
18
  * Marks are DELETED, never spaced. `[^a-z0-9 ]` alone maps the combining cedilla that NFD has just produced to a SPACE,
19
19
  * so `Besançon` keys as `besanc on` and matches nothing it should. The gazetteer side of the same comparison deletes
20
20
  * them — 0 of 32,539 distinct `locality_base` keys in `street-centroids-fr.db` carry a mark — so spacing puts the two
21
- * halves of one comparison on different keys. Order is load-bearing: after the class filter the strip is a no-op.
21
+ * halves of one comparison on different keys. Order is required: after the class filter the strip is a no-op.
22
22
  *
23
23
  * Not fixed here, and worth knowing before trusting the fold on a non-Latin-1 name: a letter with no decomposition is
24
24
  * DROPPED rather than folded (`Łódź` → `odz`, `Đà Nẵng` → `a nang`). That needs a transliteration table, not a regex,
@@ -1 +1 @@
1
- {"version":3,"file":"fold-name.js","sourceRoot":"","sources":["../fold-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,QAAQ,CAAC,CAAS;IACjC,OAAO,CAAC;SACN,WAAW,EAAE;SACb,SAAS,CAAC,KAAK,CAAC;SAChB,UAAU,CAAC,SAAS,EAAE,EAAE,CAAC;SACzB,UAAU,CAAC,aAAa,EAAE,GAAG,CAAC;SAC9B,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC;SACvB,IAAI,EAAE,CAAA;AACT,CAAC"}
1
+ {"version":3,"file":"fold-name.js","sourceRoot":"","sources":["../lib/fold-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,QAAQ,CAAC,CAAS;IACjC,OAAO,CAAC;SACN,WAAW,EAAE;SACb,SAAS,CAAC,KAAK,CAAC;SAChB,UAAU,CAAC,SAAS,EAAE,EAAE,CAAC;SACzB,UAAU,CAAC,aAAa,EAAE,GAAG,CAAC;SAC9B,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC;SACvB,IAAI,EAAE,CAAA;AACT,CAAC"}
package/out/index.d.ts CHANGED
@@ -10,20 +10,19 @@
10
10
  * package cycle); this barrel re-exports it, so `@mailwoman/resolver` is a complete drop-in for
11
11
  * what used to be `@mailwoman/core/resolver`.
12
12
  */
13
- export { RemoteResolver, serializableResolveOpts } from "./remote-resolver.ts";
14
- export type { RemoteResolverOpts, ResolveTreeRequest, ResolveTreeResponse, SerializableResolveOpts, } from "./remote-resolver.ts";
15
- export { createWOFResolver } from "./resolve.ts";
16
- export { COUNTRY_BBOX, finestResolvedCoordinate, isImplausibleResolution, outsideExpectedCountry, } from "./plausibility.ts";
17
- export type { PlausibilityOpts, PlausibilityVerdict, ResolvedCoordinate } from "./plausibility.ts";
18
- export { foldStreetSurface, isPureTypeVocabulary, pickByStreetEvidence } from "./street-evidence.ts";
19
- export type { PickByStreetEvidenceOpts, StreetCandidate, StreetEvidencePick, StreetEvidenceScope, StreetLocalityEvidence, } from "./street-evidence.ts";
20
- export { findPostcodeCountryScope, firstLocalityValue, localityValuesInDocumentOrder, POSTCODE_COUNTRY_COHERENCE_GATE_KM, stampPostcodeCountryScope, } from "./postcode-country-coherence.ts";
21
- export type { PostcodeCountryScope, PostcodeCountryScopeOpts } from "./postcode-country-coherence.ts";
22
- export { findRescoreCandidate, hasResolvedPlace } from "./span-rescore.ts";
23
- export type { RescoreCandidate, SpanRescoreOptions } from "./span-rescore.ts";
24
- export { adminContainmentVerdict, partitionByContainment } from "./admin-containment.ts";
25
- export { ADMIN_LADDER_LOCALITY_FIRST, ADMIN_LADDER_POSTCODE_FIRST, adminLadderFor, adminLadderForNodes, AREA_GRADE_POSTALCODE_SPECIFICITY, mostSpecificResolved, resolvedSpecificity, } from "./admin-winner.ts";
26
- export type { ResolvedPostcodeHit, ResolvedSpecificityInput } from "./admin-winner.ts";
27
- export * from "@mailwoman/core/resolver";
28
- export * from "./rerank.ts";
13
+ export { RemoteResolver, serializableResolveOpts } from "#remote-resolver";
14
+ export type { RemoteResolverOpts, ResolveTreeRequest, ResolveTreeResponse, SerializableResolveOpts, } from "#remote-resolver";
15
+ export { createWOFResolver } from "#resolve";
16
+ export { COUNTRY_BBOX, finestResolvedCoordinate, isImplausibleResolution, outsideExpectedCountry } from "#plausibility";
17
+ export type { PlausibilityOpts, PlausibilityVerdict, ResolvedCoordinate } from "#plausibility";
18
+ export { foldStreetSurface, isPureTypeVocabulary, pickByStreetEvidence } from "#street/evidence";
19
+ export type { PickByStreetEvidenceOpts, StreetCandidate, StreetEvidencePick, StreetEvidenceScope, StreetLocalityEvidence, } from "#street/evidence";
20
+ export { findPostcodeCountryScope, firstLocalityValue, localityValuesInDocumentOrder, POSTCODE_COUNTRY_COHERENCE_THRESHOLD_KM, stampPostcodeCountryScope, } from "#postcode/country-coherence";
21
+ export type { PostcodeCountryScope, PostcodeCountryScopeOpts } from "#postcode/country-coherence";
22
+ export { findRescoreCandidate, hasResolvedPlace } from "#span-rescore";
23
+ export type { RescoreCandidate, SpanRescoreOptions } from "#span-rescore";
24
+ export { adminContainmentVerdict, partitionByContainment } from "#admin/containment";
25
+ export { ADMIN_LADDER_LOCALITY_FIRST, ADMIN_LADDER_POSTCODE_FIRST, adminLadderFor, adminLadderForNodes, AREA_GRADE_POSTALCODE_SPECIFICITY, mostSpecificResolved, resolvedSpecificity, } from "#admin/winner";
26
+ export type { ResolvedPostcodeHit, ResolvedSpecificityInput } from "#admin/winner";
27
+ export * from "#rerank";
29
28
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAE9E,YAAY,EACX,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,GACvB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhD,OAAO,EACN,YAAY,EACZ,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,GACtB,MAAM,mBAAmB,CAAA;AAE1B,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAClG,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAEpG,YAAY,EACX,wBAAwB,EACxB,eAAe,EACf,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,GACtB,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EACN,wBAAwB,EACxB,kBAAkB,EAClB,6BAA6B,EAC7B,kCAAkC,EAClC,yBAAyB,GACzB,MAAM,iCAAiC,CAAA;AAExC,YAAY,EAA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A6B,EAC7B,uCAAuC,EACvC,yBAAyB,GACzB,MAAM,6BAA6B,CAAA;AAEpC,YAAY,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AACjG,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACtE,YAAY,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AACzE,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAA;AAEpF,OAAO,EACN,2BAA2B,EAC3B,2BAA2B,EAC3B,cAAc,EACd,mBAAmB,EACnB,iCAAiC,EACjC,oBAAoB,EACpB,mBAAmB,GACnB,MAAM,eAAe,CAAA;AAEtB,YAAY,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAA;AAKlF,cAAc,SAAS,CAAA"}
package/out/index.js CHANGED
@@ -10,16 +10,15 @@
10
10
  * package cycle); this barrel re-exports it, so `@mailwoman/resolver` is a complete drop-in for
11
11
  * what used to be `@mailwoman/core/resolver`.
12
12
  */
13
- export { RemoteResolver, serializableResolveOpts } from "./remote-resolver.js";
14
- export { createWOFResolver } from "./resolve.js";
15
- export { COUNTRY_BBOX, finestResolvedCoordinate, isImplausibleResolution, outsideExpectedCountry, } from "./plausibility.js";
16
- export { foldStreetSurface, isPureTypeVocabulary, pickByStreetEvidence } from "./street-evidence.js";
17
- export { findPostcodeCountryScope, firstLocalityValue, localityValuesInDocumentOrder, POSTCODE_COUNTRY_COHERENCE_GATE_KM, stampPostcodeCountryScope, } from "./postcode-country-coherence.js";
18
- export { findRescoreCandidate, hasResolvedPlace } from "./span-rescore.js";
19
- export { adminContainmentVerdict, partitionByContainment } from "./admin-containment.js";
20
- export { ADMIN_LADDER_LOCALITY_FIRST, ADMIN_LADDER_POSTCODE_FIRST, adminLadderFor, adminLadderForNodes, AREA_GRADE_POSTALCODE_SPECIFICITY, mostSpecificResolved, resolvedSpecificity, } from "./admin-winner.js";
13
+ export { RemoteResolver, serializableResolveOpts } from "#remote-resolver";
14
+ export { createWOFResolver } from "#resolve";
15
+ export { COUNTRY_BBOX, finestResolvedCoordinate, isImplausibleResolution, outsideExpectedCountry } from "#plausibility";
16
+ export { foldStreetSurface, isPureTypeVocabulary, pickByStreetEvidence } from "#street/evidence";
17
+ export { findPostcodeCountryScope, firstLocalityValue, localityValuesInDocumentOrder, POSTCODE_COUNTRY_COHERENCE_THRESHOLD_KM, stampPostcodeCountryScope, } from "#postcode/country-coherence";
18
+ export { findRescoreCandidate, hasResolvedPlace } from "#span-rescore";
19
+ export { adminContainmentVerdict, partitionByContainment } from "#admin/containment";
20
+ export { ADMIN_LADDER_LOCALITY_FIRST, ADMIN_LADDER_POSTCODE_FIRST, adminLadderFor, adminLadderForNodes, AREA_GRADE_POSTALCODE_SPECIFICITY, mostSpecificResolved, resolvedSpecificity, } from "#admin/winner";
21
21
  // The type contract + placetype helpers live in core (pure types, keep core a leaf). Re-export so
22
22
  // consumers get the whole surface from `@mailwoman/resolver`.
23
- export * from "@mailwoman/core/resolver";
24
- export * from "./rerank.js";
23
+ export * from "#rerank";
25
24
  //# sourceMappingURL=index.js.map
package/out/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAA;AAS9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAEhD,OAAO,EACN,YAAY,EACZ,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,GACtB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAUpG,OAAO,EACN,wBAAwB,EACxB,kBAAkB,EAClB,6BAA6B,EAC7B,kCAAkC,EAClC,yB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PlausibilityOpts {
97
97
  countryBBoxes?: ReadonlyMap<string, CountryBBoxFact>;
98
98
  }
99
99
  /**
100
- * Decide whether a resolved tree's geocode is implausible for a structured address — the cheap guard the v7 hybrid gate
101
- * runs after routing an input to the neural parser (#38). Trips when the finest resolved place is a bare `country`
102
- * centroid (guard A), or — when the caller supplies `expectedCountry` — when the served coordinate falls outside that
103
- * country's coarse bbox (guard B). An unresolved tree (nothing to serve) is plausible: there is no garbage to serve.
100
+ * Decide whether a resolved tree's geocode is implausible for a structured address — the cheap guard the v7 hybrid
101
+ * check runs after routing an input to the neural parser (#38). Trips when the finest resolved place is a bare
102
+ * `country` centroid (guard A), or — when the caller supplies `expectedCountry` — when the served coordinate falls
103
+ * outside that country's coarse bbox (guard B). An unresolved tree (nothing to serve) is plausible: there is no garbage
104
+ * to serve.
104
105
  */
105
106
  export declare function isImplausibleResolution(tree: AddressTree, opts?: PlausibilityOpts): PlausibilityVerdict;
106
107
  //# sourceMappingURL=plausibility.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plausibility.d.ts","sourceRoot":"","sources":["../plausibility.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,KAAK,EAAe,WAAW,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAA;AACrF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAqB/D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,GAAG,EAAE,YAAY,CAAA;IACjB,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;IACX;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CAChB;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,WAAW,GAAG,kBAAkB,GAAG,IAAI,CAwBrF;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,E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,kBAAkB,GAAG,IAAI,CAwBrF;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAmB5F,CAAA;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACrC,WAAW,EAAE,MAAM,EACnB,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,MAAM,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,GAC3C,OAAO,CAgBT;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC,WAAW,EAAE,OAAO,CAAA;IACpB;;;OAGG;IACH,MAAM,CAAC,EAAE,kBAAkB,GAAG,0BAA0B,CAAA;IACxD;;OAEG;IACH,UAAU,CAAC,EAAE,kBAAkB,CAAA;CAC/B;AAED,MAAM,WAAW,gBAAgB;IAChC;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB;;;;OAIG;IACH,aAAa,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,CAAA;CACpD;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,GAAE,gBAAqB,GAAG,mBAAmB,CAgB3G"}
@@ -120,10 +120,11 @@ export function outsideExpectedCountry(countryCode, lat, lon, bboxes) {
120
120
  return lat < b[0] || lat > b[1] || lon < b[2] || lon > b[3];
121
121
  }
122
122
  /**
123
- * Decide whether a resolved tree's geocode is implausible for a structured address — the cheap guard the v7 hybrid gate
124
- * runs after routing an input to the neural parser (#38). Trips when the finest resolved place is a bare `country`
125
- * centroid (guard A), or — when the caller supplies `expectedCountry` — when the served coordinate falls outside that
126
- * country's coarse bbox (guard B). An unresolved tree (nothing to serve) is plausible: there is no garbage to serve.
123
+ * Decide whether a resolved tree's geocode is implausible for a structured address — the cheap guard the v7 hybrid
124
+ * check runs after routing an input to the neural parser (#38). Trips when the finest resolved place is a bare
125
+ * `country` centroid (guard A), or — when the caller supplies `expectedCountry` — when the served coordinate falls
126
+ * outside that country's coarse bbox (guard B). An unresolved tree (nothing to serve) is plausible: there is no garbage
127
+ * to serve.
127
128
  */
128
129
  export function isImplausibleResolution(tree, opts = {}) {
129
130
  const coordinate = finestResolvedCoordinate(tree);