@mailwoman/resolver 10.0.0 → 10.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (134) hide show
  1. package/README.md +9 -7
  2. package/lib/admin/coherence-passes.ts +31 -172
  3. package/lib/admin/containment.ts +15 -33
  4. package/lib/admin/jp-municipality.ts +21 -14
  5. package/lib/admin/winner.ts +37 -69
  6. package/lib/backend-capabilities.ts +28 -27
  7. package/lib/bare-toponym-race.ts +69 -37
  8. package/lib/decorate-node.ts +25 -49
  9. package/lib/fold-name.ts +5 -18
  10. package/lib/index.ts +5 -9
  11. package/lib/plausibility.ts +41 -68
  12. package/lib/postcode/country-coherence.ts +92 -296
  13. package/lib/postcode/prefix.ts +24 -86
  14. package/lib/postcode/shape-coherence.ts +26 -116
  15. package/lib/remote-resolver.ts +38 -33
  16. package/lib/rerank.ts +41 -54
  17. package/lib/resolve/passes.ts +188 -177
  18. package/lib/resolve.ts +744 -0
  19. package/lib/span-rescore.ts +219 -175
  20. package/lib/street/evidence.ts +65 -73
  21. package/lib/street/tier.ts +51 -194
  22. package/lib/toponym-prior.ts +54 -180
  23. package/out/admin/coherence-passes.d.ts +18 -69
  24. package/out/admin/coherence-passes.d.ts.map +1 -1
  25. package/out/admin/coherence-passes.js +24 -166
  26. package/out/admin/coherence-passes.js.map +1 -1
  27. package/out/admin/containment.d.ts +13 -31
  28. package/out/admin/containment.d.ts.map +1 -1
  29. package/out/admin/containment.js +13 -31
  30. package/out/admin/containment.js.map +1 -1
  31. package/out/admin/jp-municipality.d.ts +21 -14
  32. package/out/admin/jp-municipality.d.ts.map +1 -1
  33. package/out/admin/jp-municipality.js +18 -12
  34. package/out/admin/jp-municipality.js.map +1 -1
  35. package/out/admin/winner.d.ts +32 -64
  36. package/out/admin/winner.d.ts.map +1 -1
  37. package/out/admin/winner.js +23 -56
  38. package/out/admin/winner.js.map +1 -1
  39. package/out/{admin/index.d.ts → admin.d.ts} +1 -1
  40. package/out/admin.d.ts.map +1 -0
  41. package/out/{admin/index.js → admin.js} +1 -1
  42. package/out/admin.js.map +1 -0
  43. package/out/backend-capabilities.d.ts +19 -20
  44. package/out/backend-capabilities.d.ts.map +1 -1
  45. package/out/backend-capabilities.js +28 -26
  46. package/out/backend-capabilities.js.map +1 -1
  47. package/out/bare-toponym-race.d.ts +54 -27
  48. package/out/bare-toponym-race.d.ts.map +1 -1
  49. package/out/bare-toponym-race.js +69 -37
  50. package/out/bare-toponym-race.js.map +1 -1
  51. package/out/decorate-node.d.ts +6 -8
  52. package/out/decorate-node.d.ts.map +1 -1
  53. package/out/decorate-node.js +25 -49
  54. package/out/decorate-node.js.map +1 -1
  55. package/out/fold-name.d.ts +5 -18
  56. package/out/fold-name.d.ts.map +1 -1
  57. package/out/fold-name.js +5 -18
  58. package/out/fold-name.js.map +1 -1
  59. package/out/index.d.ts +5 -6
  60. package/out/index.d.ts.map +1 -1
  61. package/out/index.js +5 -8
  62. package/out/index.js.map +1 -1
  63. package/out/plausibility.d.ts +30 -60
  64. package/out/plausibility.d.ts.map +1 -1
  65. package/out/plausibility.js +19 -52
  66. package/out/plausibility.js.map +1 -1
  67. package/out/postcode/country-coherence.d.ts +53 -167
  68. package/out/postcode/country-coherence.d.ts.map +1 -1
  69. package/out/postcode/country-coherence.js +42 -259
  70. package/out/postcode/country-coherence.js.map +1 -1
  71. package/out/postcode/prefix.d.ts +18 -69
  72. package/out/postcode/prefix.d.ts.map +1 -1
  73. package/out/postcode/prefix.js +11 -78
  74. package/out/postcode/prefix.js.map +1 -1
  75. package/out/postcode/shape-coherence.d.ts +18 -85
  76. package/out/postcode/shape-coherence.d.ts.map +1 -1
  77. package/out/postcode/shape-coherence.js +11 -107
  78. package/out/postcode/shape-coherence.js.map +1 -1
  79. package/out/{postcode/index.d.ts → postcode.d.ts} +1 -1
  80. package/out/postcode.d.ts.map +1 -0
  81. package/out/{postcode/index.js → postcode.js} +1 -1
  82. package/out/postcode.js.map +1 -0
  83. package/out/remote-resolver.d.ts +32 -31
  84. package/out/remote-resolver.d.ts.map +1 -1
  85. package/out/remote-resolver.js +12 -20
  86. package/out/remote-resolver.js.map +1 -1
  87. package/out/rerank.d.ts +32 -46
  88. package/out/rerank.d.ts.map +1 -1
  89. package/out/rerank.js +16 -41
  90. package/out/rerank.js.map +1 -1
  91. package/out/resolve/passes.d.ts +108 -95
  92. package/out/resolve/passes.d.ts.map +1 -1
  93. package/out/resolve/passes.js +67 -126
  94. package/out/resolve/passes.js.map +1 -1
  95. package/out/resolve.d.ts +15 -0
  96. package/out/resolve.d.ts.map +1 -0
  97. package/out/resolve.js +557 -0
  98. package/out/resolve.js.map +1 -0
  99. package/out/span-rescore.d.ts +56 -65
  100. package/out/span-rescore.d.ts.map +1 -1
  101. package/out/span-rescore.js +134 -132
  102. package/out/span-rescore.js.map +1 -1
  103. package/out/street/evidence.d.ts +56 -61
  104. package/out/street/evidence.d.ts.map +1 -1
  105. package/out/street/evidence.js +22 -46
  106. package/out/street/evidence.js.map +1 -1
  107. package/out/street/tier.d.ts +18 -30
  108. package/out/street/tier.d.ts.map +1 -1
  109. package/out/street/tier.js +43 -191
  110. package/out/street/tier.js.map +1 -1
  111. package/out/{street/index.d.ts → street.d.ts} +1 -1
  112. package/out/street.d.ts.map +1 -0
  113. package/out/{street/index.js → street.js} +1 -1
  114. package/out/street.js.map +1 -0
  115. package/out/toponym-prior.d.ts +22 -110
  116. package/out/toponym-prior.d.ts.map +1 -1
  117. package/out/toponym-prior.js +41 -170
  118. package/out/toponym-prior.js.map +1 -1
  119. package/package.json +44 -147
  120. package/lib/resolve/index.ts +0 -989
  121. package/out/admin/index.d.ts.map +0 -1
  122. package/out/admin/index.js.map +0 -1
  123. package/out/postcode/index.d.ts.map +0 -1
  124. package/out/postcode/index.js.map +0 -1
  125. package/out/resolve/index.d.ts +0 -20
  126. package/out/resolve/index.d.ts.map +0 -1
  127. package/out/resolve/index.js +0 -808
  128. package/out/resolve/index.js.map +0 -1
  129. package/out/street/index.d.ts.map +0 -1
  130. package/out/street/index.js.map +0 -1
  131. package/vitest.config.ts +0 -38
  132. /package/lib/{admin/index.ts → admin.ts} +0 -0
  133. /package/lib/{postcode/index.ts → postcode.ts} +0 -0
  134. /package/lib/{street/index.ts → street.ts} +0 -0
@@ -2,137 +2,49 @@
2
2
  * @copyright Sister Software
3
3
  * @license AGPL-3.0
4
4
  * @author Teffen Ellis, et al.
5
- *
6
- * #17 bare city-name disambiguation — two SOFT ranking keys for the bare-toponym class.
7
- *
8
- * A bare city name is the one query shape where the resolver has no geography to reason with: no
9
- * postcode to anchor against, no region to scope by, no country the address itself named. All that
10
- * is left is a prior over which same-named place a person typing that word alone probably meant.
11
- * The shipped prior is POPULATION, and population is measurably the wrong prior for this class —
12
- * the panel run of 2026-08-10 caught it four times over:
13
- *
14
- * | query | population winner | gold | miss |
15
- * | ------- | -------------------- | --------------------- | -------- |
16
- * | Whitby | Whitby ON (128,377) | Whitby, N Yorks (13,130) | 5,508 km |
17
- * | Warwick | Warwick RI (82,999) | Warwick, Warks (32,719) | 5,211 km |
18
- * | Epping | Epping VIC (32,395) | Epping, Essex (12,547) | 16,874 km |
19
- * | Windsor | Windsor ON (217,188) | Windsor, Berks (26,885) | 6,007 km |
20
- *
21
- * Every one of those is a place people know for something other than its size, and the gazetteer
22
- * already measures that: `admin-global-priority-importance.db` ranks all four the RIGHT way round
23
- * (Whitby GB 0.5496 over CA 0.5089; Windsor GB 0.5648 over CA 0.5607 — a 0.004 margin population
24
- * inverts by a factor of eight). What it measures is a BLENDED global toponym prior
25
- * (`ResolvedPlace.importance`): the concordance's encyclopedia-derived channel where a concordance
26
- * matched, a population-derived proxy everywhere else — the one scale on which every bearer of a
27
- * name is scored comparably, which is the precondition for comparing them at all.
28
- * {@link rankByImportance} consumes it. (The STRICT encyclopedia-evidence channel keeps its own
29
- * reserved slot, `ResolvedPlace.encyclopedic`, which no ranking key reads and no shipped artifact
30
- * yet populates — see `core/resolver/types.ts`.)
31
- *
32
- * {@link rankByCountryPrior} covers the other half of the class — the query where a country IS
33
- * known, but only because a locale said so. See `span-rescore.ts` for where that one applies.
34
- *
35
- * Both obey the same three house rules, and neither is a check:
36
- *
37
- * 1. **Tier-safe.** `exactMatch` stays the primary key. A soft prior re-orders WITHIN a tier; it never
38
- * promotes a partial match over an exact one.
39
- * 2. **Positive evidence only.** An absent score is unmeasured, not zero (the meaning-of-zero rule), so an
40
- * unscored candidate is never moved BY the signal and never penalized FOR lacking it — it keeps the
41
- * rank population gave it while the scored rows reorder among themselves. On a candidate.db built
42
- * before the #28 `importance` column, nothing is scored, so {@link rankByImportance} is
43
- * byte-stable by construction.
44
- * 3. **Stable.** Equal keys keep their incoming order, so the backend's own ranking survives underneath. That order
45
- * carries decisions only the backend can make — the candidate backend's seat tiebreak
46
- * (`resolver-wof-sqlite/primary-preference.ts`) reaches an end-to-end answer solely through this stability
47
- * (#1729), so equal-key stability here is required, not cosmetic.
48
5
  */
49
6
  import type { ResolvedPlace } from "@mailwoman/core/resolver";
50
7
  /**
51
- * Weight of the locale-country bonus, in the same log10-population units the candidate backend's `prominence` uses
52
- * (`-neg_rank` = log10(population + 1)). 2 == "the in-country place may be up to 100x smaller and still win".
8
+ * The default bonus, in log10-population units, that {@link rankByCountryPrior}
9
+ * gives a candidate in the locale country.
53
10
  *
54
- * The value is the resolver's existing `anchorWeight` default (`resolve.ts`), reused deliberately: that knob is the
55
- * postcode-anchor country pin, and this is the same quantity from a weaker source, so the two should not disagree about
56
- * what a country signal is worth. Calibrated against the live board (2026-08-10, shipped `candidate.db`), it moves
57
- * exactly the queries where the locale is implausible and leaves the rest alone:
58
- *
59
- * - `Zürich` en-US — Zurich KS 1.91 + 2 = 3.91 loses to Zürich CH 5.65. **Flips** (was 8,043 km off).
60
- * - `Berlin` en-US — Berlin CT 4.30 + 2 = 6.30 loses to Berlin DE 6.56. **Flips.**
61
- * - `Manchester` en-US — Manchester NH 5.06 + 2 = 7.06 beats Manchester GB 5.74. **Held.**
62
- * - `Springfield` en-US — every bearer is US, so the bonus is uniform. **Held.**
63
- * - `Moscow` en-US — Moscow ID 4.42 + 2 = 6.42 beats Москва 6.10. **Held.**
64
- * - `Fulda` en-US — Fulda MN 3.13 + 2 = 5.13 beats Fulda DE 4.84. **Held.**
11
+ * A weight of 2 lets an in-country place be up to 100 times smaller and still win.
65
12
  */
66
13
  export declare const DEFAULT_COUNTRY_PRIOR_WEIGHT = 2;
14
+ type Rankable = Pick<ResolvedPlace, "score"> & Partial<Pick<ResolvedPlace, "country" | "exactMatch" | "importance" | "population" | "prominence">>;
67
15
  /**
68
- * The fields a ranking key reads. Structural rather than `ResolvedPlace` so the backend's own `PlaceCandidate` (a
69
- * structural twin) can be ranked without a cast.
70
- */
71
- type Rankable = Pick<ResolvedPlace, "score"> & Partial<Pick<ResolvedPlace, "country" | "exactMatch" | "importance" | "prominence">>;
72
- /**
73
- * Importance-first ordering — the #28 fame prior, consumed.
74
- *
75
- * Ranks by `importance` DESC within the exact tier, with `prominence`/`score` as the tiebreak (two places of equal fame
76
- * separate on size). Candidates the gazetteer never scored do not participate — they hold the rank population gave them
77
- * while the scored rows permute among their own slots (see {@link reorderMeasured}). Returns the input untouched when
78
- * fewer than two candidates are scored.
16
+ * Reorders candidates by gazetteer `importance`, highest first, within the exact-match
17
+ * and partial-match tiers.
79
18
  *
80
- * The producer is the candidate build's `importance` column (#28) — the BLENDED prior (the concordance's
81
- * encyclopedia-derived channel clamped around a population-derived base — `place-importance-schema.ts`'s
82
- * `blendImportance`; see `candidate-schema.ts` → `CandidateTable.importance` for why the strict channel is deliberately
83
- * NOT what lands there). On an artifact predating the column, `importance` is `undefined` on every candidate the
84
- * backend produces and the abstention below keeps the ranking byte-stable.
85
- *
86
- * Flip decisions, ratified 2026-08-11: bare `Moscow`→Москва, `Manchester`→GB, `Fulda`→DE, `Cambridge`→GB are ACCEPTED
87
- * behavior — all cross-country contests, where this prior answers the question population cannot. Bare `Springfield`
88
- * ABSTAINS to the referential answer via {@link SAME_COUNTRY_IMPORTANCE_TIE_BAND}; no candidate is dropped, so the
89
- * runner-up survives as a declared alternative downstream.
19
+ * Candidates without an importance keep their positions.
20
+ * Same-country candidates whose importance differs by at most 0.02 are ordered by size
21
+ * instead, with populated places first within each country.
90
22
  */
91
23
  export declare function rankByImportance<T extends Rankable>(candidates: readonly T[]): T[];
92
24
  /**
93
- * Soft locale-country prior: `(prominence ?? score) + weight` for a candidate in `country`.
94
- *
95
- * Additive, never a filter — a far more prominent foreign namesake still wins (Zürich CH over Zurich KS) while a close
96
- * contest goes to the locale (Manchester NH over Manchester GB). No-op without a `country`, so the un-scoped path stays
97
- * byte-identical.
25
+ * Reorders candidates within each match tier by size, adding `weight` for candidates in `country`.
98
26
  *
99
- * The units matter: `prominence` on the candidate backend is log10(population + 1), so `weight` is read as "orders of
100
- * magnitude of population the in-country place is allowed to give away". Pass a large weight to make the country
101
- * effectively hard, `0` to disable.
27
+ * It returns the candidates unchanged when no country is given.
28
+ * The bonus is additive, so a much larger foreign place of the same name still wins.
102
29
  */
103
- export declare function rankByCountryPrior<T extends Rankable>(candidates: readonly T[], country: string | undefined, weight?: number): T[];
30
+ export declare function rankByCountryPrior<T extends Rankable>(candidates: readonly T[], country: string | null, weight?: number): T[];
104
31
  /**
105
- * Capital status of a resolved candidate, answered by the caller's reference (#1880 —
106
- * `@mailwoman/resolver-wof-sqlite/capitals` is the shipped implementation): 2 for a national capital, 1 for an admin-1
107
- * seat, 0 for neither. The resolver stays backend-agnostic — it never loads the reference, it only consumes the
108
- * verdict.
32
+ * Returns a place's capital status: 2 for a national capital, 1 for an admin-1 seat and 0 otherwise.
33
+ *
34
+ * The caller supplies it, so the resolver never loads a capitals reference itself.
109
35
  */
110
36
  export type CapitalLevelFn = (place: Pick<ResolvedPlace, "name" | "country" | "lat" | "lon">) => number;
111
37
  /**
112
- * Margin a national capital may give away, in log10-population units: a namesake must be more than 10^2 = 100x more
113
- * populous to hold the lead. Bare "San José" reaches the Costa Rican capital (342,188) over San Jose, California
114
- * (969,655 — 2.8x); bare "Hamilton" stays on Hamilton, Ontario (519,949) over Bermuda's 902-person capital (576x).
38
+ * The size lead, in log10-population units, that another place needs to stay ahead of a national capital.
39
+ *
40
+ * A value of 2 means 100 times more populous.
115
41
  */
116
42
  export declare const NATIONAL_CAPITAL_MARGIN_LOG10 = 2;
117
43
  /**
118
- * Bounded capital promotion (#1880) — the third soft key for the bare-toponym class, applied AFTER
119
- * {@link rankByImportance} because the fame prior is what decides this class and a capital signal parked below the
120
- * deciding stage measurably never reaches an answer (the iteration-1 board run: the candidate-order bonus reordered
121
- * `findPlace` on every target row and moved 0 of the 12).
122
- *
123
- * The rule: within the exact tier, take the first NATIONAL-capital row and walk it upward past each row it is within
124
- * {@link NATIONAL_CAPITAL_MARGIN_LOG10} of, stopping at the first row over the margin or at another national capital.
125
- * Same three house rules as the other keys — tier-safe (never crosses the exact/partial boundary.
126
- *
127
- * A capital that only PARTIALLY matched the query — Saint George's, Grenada for the abbreviated "St. George's" — stays
128
- * behind every exact match, because crossing that line is how iteration 1 answered bare "Djibouti" with the capital
129
- * city instead of the country), positive evidence only (no capital in the list → identity, and the margin reads the
130
- * same `prominence ?? score` size every other key does), and stable (non-promoted rows keep their order).
44
+ * Moves the first national capital in the leading match tier above each preceding row that
45
+ * is at most {@link NATIONAL_CAPITAL_MARGIN_LOG10} larger, stopping at another capital.
131
46
  *
132
- * The margin deliberately re-uses log10-population units rather than the importance scale: the ratified importance flip
133
- * decisions (Whitby/Windsor/Springfield) sit on gaps of 0.004–0.02, while the capital contests this key exists for sit
134
- * on gaps of 0.21–0.24 — an importance-scale bonus big enough to win them would dwarf every ratified decision on the
135
- * same scale.
47
+ * It runs after {@link rankByImportance} and never moves a capital across the exact-match boundary.
136
48
  */
137
49
  export declare function promoteCapitals<T extends Rankable & Pick<ResolvedPlace, "name" | "country" | "lat" | "lon">>(candidates: readonly T[], level: CapitalLevelFn | undefined): T[];
138
50
  export {};
@@ -1 +1 @@
1
- {"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author Teffen Ellis, et al.
5
- *
6
- * #17 bare city-name disambiguation — two SOFT ranking keys for the bare-toponym class.
7
- *
8
- * A bare city name is the one query shape where the resolver has no geography to reason with: no
9
- * postcode to anchor against, no region to scope by, no country the address itself named. All that
10
- * is left is a prior over which same-named place a person typing that word alone probably meant.
11
- * The shipped prior is POPULATION, and population is measurably the wrong prior for this class —
12
- * the panel run of 2026-08-10 caught it four times over:
13
- *
14
- * | query | population winner | gold | miss |
15
- * | ------- | -------------------- | --------------------- | -------- |
16
- * | Whitby | Whitby ON (128,377) | Whitby, N Yorks (13,130) | 5,508 km |
17
- * | Warwick | Warwick RI (82,999) | Warwick, Warks (32,719) | 5,211 km |
18
- * | Epping | Epping VIC (32,395) | Epping, Essex (12,547) | 16,874 km |
19
- * | Windsor | Windsor ON (217,188) | Windsor, Berks (26,885) | 6,007 km |
20
- *
21
- * Every one of those is a place people know for something other than its size, and the gazetteer
22
- * already measures that: `admin-global-priority-importance.db` ranks all four the RIGHT way round
23
- * (Whitby GB 0.5496 over CA 0.5089; Windsor GB 0.5648 over CA 0.5607 — a 0.004 margin population
24
- * inverts by a factor of eight). What it measures is a BLENDED global toponym prior
25
- * (`ResolvedPlace.importance`): the concordance's encyclopedia-derived channel where a concordance
26
- * matched, a population-derived proxy everywhere else — the one scale on which every bearer of a
27
- * name is scored comparably, which is the precondition for comparing them at all.
28
- * {@link rankByImportance} consumes it. (The STRICT encyclopedia-evidence channel keeps its own
29
- * reserved slot, `ResolvedPlace.encyclopedic`, which no ranking key reads and no shipped artifact
30
- * yet populates — see `core/resolver/types.ts`.)
31
- *
32
- * {@link rankByCountryPrior} covers the other half of the class — the query where a country IS
33
- * known, but only because a locale said so. See `span-rescore.ts` for where that one applies.
34
- *
35
- * Both obey the same three house rules, and neither is a check:
36
- *
37
- * 1. **Tier-safe.** `exactMatch` stays the primary key. A soft prior re-orders WITHIN a tier; it never
38
- * promotes a partial match over an exact one.
39
- * 2. **Positive evidence only.** An absent score is unmeasured, not zero (the meaning-of-zero rule), so an
40
- * unscored candidate is never moved BY the signal and never penalized FOR lacking it — it keeps the
41
- * rank population gave it while the scored rows reorder among themselves. On a candidate.db built
42
- * before the #28 `importance` column, nothing is scored, so {@link rankByImportance} is
43
- * byte-stable by construction.
44
- * 3. **Stable.** Equal keys keep their incoming order, so the backend's own ranking survives underneath. That order
45
- * carries decisions only the backend can make — the candidate backend's seat tiebreak
46
- * (`resolver-wof-sqlite/primary-preference.ts`) reaches an end-to-end answer solely through this stability
47
- * (#1729), so equal-key stability here is required, not cosmetic.
48
5
  */
49
6
  /**
50
- * Weight of the locale-country bonus, in the same log10-population units the candidate backend's `prominence` uses
51
- * (`-neg_rank` = log10(population + 1)). 2 == "the in-country place may be up to 100x smaller and still win".
52
- *
53
- * The value is the resolver's existing `anchorWeight` default (`resolve.ts`), reused deliberately: that knob is the
54
- * postcode-anchor country pin, and this is the same quantity from a weaker source, so the two should not disagree about
55
- * what a country signal is worth. Calibrated against the live board (2026-08-10, shipped `candidate.db`), it moves
56
- * exactly the queries where the locale is implausible and leaves the rest alone:
7
+ * The default bonus, in log10-population units, that {@link rankByCountryPrior}
8
+ * gives a candidate in the locale country.
57
9
  *
58
- * - `Zürich` en-US — Zurich KS 1.91 + 2 = 3.91 loses to Zürich CH 5.65. **Flips** (was 8,043 km off).
59
- * - `Berlin` en-US — Berlin CT 4.30 + 2 = 6.30 loses to Berlin DE 6.56. **Flips.**
60
- * - `Manchester` en-US — Manchester NH 5.06 + 2 = 7.06 beats Manchester GB 5.74. **Held.**
61
- * - `Springfield` en-US — every bearer is US, so the bonus is uniform. **Held.**
62
- * - `Moscow` en-US — Moscow ID 4.42 + 2 = 6.42 beats Москва 6.10. **Held.**
63
- * - `Fulda` en-US — Fulda MN 3.13 + 2 = 5.13 beats Fulda DE 4.84. **Held.**
10
+ * A weight of 2 lets an in-country place be up to 100 times smaller and still win.
64
11
  */
65
12
  export const DEFAULT_COUNTRY_PRIOR_WEIGHT = 2;
66
- /**
67
- * Importance margin below which two SAME-COUNTRY bearers are a tie, and the tie falls back to referential (size) order.
68
- * Ratified 2026-08-11 (the five bare-query flip decisions): bare `Springfield` must stay on the referential answer —
69
- * the live chain is IL 0.612605 → MA 0.611142 → MO 0.596195 (adjacent gaps 0.0015 and 0.0149, full span 0.0164), so the
70
- * band must cover at least the 0.0149 adjacent gap for the trio to chain into one cluster.
71
- *
72
- * The band never compares across countries, and that scope is forced by decided rows, not preference: Windsor's
73
- * accepted flip (GB 0.564842 over CA 0.560687) sits at a 0.0042 gap — inside ANY band that covers Springfield. The two
74
- * decisions are only co-satisfiable if the band binds same-country pairs alone. That is also what the §2 referential
75
- * policy (ROAD_TO_V9) says: within a country the geocoder ranks referentially; the blended prior's job is the
76
- * cross-country question — which country's bearer a bare query meant.
77
- */
78
13
  const SAME_COUNTRY_IMPORTANCE_TIE_BAND = 0.02;
79
- /**
80
- * Partition into (exact, rest), sort each half with `key` DESC, and re-join. The partition is what keeps a soft prior
81
- * soft: it can only ever re-order candidates the backend already considers equally good matches. Backends that don't
82
- * stamp `exactMatch` land every row in one tier, which is the correct degradation — the key then applies to the whole
83
- * list.
84
- */
85
14
  function rankWithinTier(candidates, compare) {
86
15
  const exact = [];
87
16
  const rest = [];
88
17
  for (const c of candidates) {
89
- // `exactMatch` is TRI-STATE: true / false / undefined (a backend path that stamps no flag —
90
- // e.g. WOFSQLitePlaceLookup's postcode-area neighbours from #fetchLocalitiesByID). Only a
91
- // stated TRUE earns the exact tier; undefined must not outrank a real fuzzy name match
92
- // (the 2026-08-10 de.native_locality incident: 75 Saxon towns lost to nameless neighbours).
93
18
  ;
94
19
  (c.exactMatch === true ? exact : rest).push(c);
95
20
  }
96
- // `toSorted` is stable, so equal keys keep the backend's incoming order.
97
21
  return [...exact.toSorted(compare), ...rest.toSorted(compare)];
98
22
  }
99
- /**
100
- * Size, in the backend's own units — the candidate backend's `prominence` is log10(population + 1); a backend that
101
- * computes no prominence falls back to its raw `score`.
102
- */
103
23
  const size = (c) => c.prominence ?? c.score;
104
- /**
105
- * A candidate the gazetteer actually scored. An absent value means "the score source never measured this place" OR
106
- * "this artifact predates the column" OR "the join refused the row" — three different things, none of them zero.
107
- */
108
24
  const measured = (c) => typeof c.importance === "number" && Number.isFinite(c.importance);
109
- /**
110
- * Reorder ONLY the measured candidates, and only among the positions they already occupy.
111
- *
112
- * This is what "positive evidence only" has to mean when coverage is partial, which it always is — measured on the
113
- * shipped importance artifact, the four bare GB panel rows have 2/7, 8/10, 8/10 and 9/10 of their candidates scored. A
114
- * blanket "abstain unless everything is measured" throws the signal away on all four; treating absent as 0 would let a
115
- * scored hamlet leapfrog an unscored metropolis. Neither is right, and the resolution is that an unmeasured row simply
116
- * does not participate: it holds the rank population gave it, and the scored rows permute among the slots they hold
117
- * between them.
118
- *
119
- * So for `Whitby` — CA(0.5089), GB(0.5496), TC(—), then four unscored bearers — the swap is confined to slots 0 and 1,
120
- * GB takes the lead, and TC never moves.
121
- */
122
25
  function reorderMeasured(tier, order) {
123
26
  const slots = [];
124
27
  for (const [i, c] of tier.entries()) {
@@ -135,18 +38,30 @@ function reorderMeasured(tier, order) {
135
38
  }
136
39
  return out;
137
40
  }
138
- /**
139
- * The importance ordering over MEASURED rows, with the {@link SAME_COUNTRY_IMPORTANCE_TIE_BAND} applied.
140
- *
141
- * Same-country bearers whose adjacent importance gaps sit inside the band chain into one cluster (transitive on purpose
142
- * — otherwise the boundary would depend on comparison order), and a cluster orders its members referentially (size
143
- * DESC). Clusters — including every cross-country row, which is always its own cluster — rank by their most important
144
- * member, then head size, then input order. A cluster therefore moves as a unit: a same-country near-tie cannot be
145
- * split by a foreign row falling between its members' scores.
146
- */
41
+ const counted = (c) => typeof c.population === "number" && c.population > 0;
42
+ function countedFirstWithinCountry(rows) {
43
+ const out = [...rows];
44
+ const slotsByCountry = new Map();
45
+ for (const [index, row] of out.entries()) {
46
+ const country = row.country?.toUpperCase();
47
+ if (!country)
48
+ continue;
49
+ const slots = slotsByCountry.get(country) ?? [];
50
+ slots.push(index);
51
+ slotsByCountry.set(country, slots);
52
+ }
53
+ for (const slots of slotsByCountry.values()) {
54
+ if (slots.length < 2)
55
+ continue;
56
+ const members = slots.map((slot) => out[slot]);
57
+ const reordered = [...members.filter((row) => counted(row)), ...members.filter((row) => !counted(row))];
58
+ for (const [k, slot] of slots.entries()) {
59
+ out[slot] = reordered[k];
60
+ }
61
+ }
62
+ return out;
63
+ }
147
64
  function orderMeasuredByImportance(rows) {
148
- // Group by country in first-appearance order; a row without a country can never substantiate a
149
- // same-country tie, so it stays a singleton.
150
65
  const groups = new Map();
151
66
  const clusters = [];
152
67
  for (const [i, row] of rows.entries()) {
@@ -183,55 +98,34 @@ function orderMeasuredByImportance(rows) {
183
98
  members: cluster.members.toSorted((a, b) => size(b) - size(a)),
184
99
  }));
185
100
  keyed.sort((a, b) => b.key - a.key || size(b.members[0]) - size(a.members[0]) || a.firstIndex - b.firstIndex);
186
- return keyed.flatMap((c) => c.members);
101
+ return countedFirstWithinCountry(keyed.flatMap((c) => c.members));
187
102
  }
188
103
  /**
189
- * Importance-first ordering — the #28 fame prior, consumed.
190
- *
191
- * Ranks by `importance` DESC within the exact tier, with `prominence`/`score` as the tiebreak (two places of equal fame
192
- * separate on size). Candidates the gazetteer never scored do not participate — they hold the rank population gave them
193
- * while the scored rows permute among their own slots (see {@link reorderMeasured}). Returns the input untouched when
194
- * fewer than two candidates are scored.
104
+ * Reorders candidates by gazetteer `importance`, highest first, within the exact-match
105
+ * and partial-match tiers.
195
106
  *
196
- * The producer is the candidate build's `importance` column (#28) — the BLENDED prior (the concordance's
197
- * encyclopedia-derived channel clamped around a population-derived base — `place-importance-schema.ts`'s
198
- * `blendImportance`; see `candidate-schema.ts` → `CandidateTable.importance` for why the strict channel is deliberately
199
- * NOT what lands there). On an artifact predating the column, `importance` is `undefined` on every candidate the
200
- * backend produces and the abstention below keeps the ranking byte-stable.
201
- *
202
- * Flip decisions, ratified 2026-08-11: bare `Moscow`→Москва, `Manchester`→GB, `Fulda`→DE, `Cambridge`→GB are ACCEPTED
203
- * behavior — all cross-country contests, where this prior answers the question population cannot. Bare `Springfield`
204
- * ABSTAINS to the referential answer via {@link SAME_COUNTRY_IMPORTANCE_TIE_BAND}; no candidate is dropped, so the
205
- * runner-up survives as a declared alternative downstream.
107
+ * Candidates without an importance keep their positions.
108
+ * Same-country candidates whose importance differs by at most 0.02 are ordered by size
109
+ * instead, with populated places first within each country.
206
110
  */
207
111
  export function rankByImportance(candidates) {
208
112
  if (candidates.length < 2)
209
113
  return [...candidates];
210
- // Abstain entirely until at least one candidate carries a MEASURED score — the tier split
211
- // below is only meaningful as a tiebreak among scored rows. Without this, wiring the consumer
212
- // before the #28 producer reordered candidates on the exactMatch flag alone (meaning-of-zero:
213
- // an absent score must not act as evidence).
214
114
  if (!candidates.some(measured))
215
115
  return [...candidates];
216
116
  const exact = [];
217
117
  const rest = [];
218
118
  for (const c of candidates) {
219
- // Tri-state exactMatch: only a stated TRUE earns the exact tier (see rankWithinTier).
220
119
  ;
221
120
  (c.exactMatch === true ? exact : rest).push(c);
222
121
  }
223
122
  return [...reorderMeasured(exact, orderMeasuredByImportance), ...reorderMeasured(rest, orderMeasuredByImportance)];
224
123
  }
225
124
  /**
226
- * Soft locale-country prior: `(prominence ?? score) + weight` for a candidate in `country`.
227
- *
228
- * Additive, never a filter — a far more prominent foreign namesake still wins (Zürich CH over Zurich KS) while a close
229
- * contest goes to the locale (Manchester NH over Manchester GB). No-op without a `country`, so the un-scoped path stays
230
- * byte-identical.
125
+ * Reorders candidates within each match tier by size, adding `weight` for candidates in `country`.
231
126
  *
232
- * The units matter: `prominence` on the candidate backend is log10(population + 1), so `weight` is read as "orders of
233
- * magnitude of population the in-country place is allowed to give away". Pass a large weight to make the country
234
- * effectively hard, `0` to disable.
127
+ * It returns the candidates unchanged when no country is given.
128
+ * The bonus is additive, so a much larger foreign place of the same name still wins.
235
129
  */
236
130
  export function rankByCountryPrior(candidates, country, weight = DEFAULT_COUNTRY_PRIOR_WEIGHT) {
237
131
  if (!country || candidates.length < 2)
@@ -240,40 +134,18 @@ export function rankByCountryPrior(candidates, country, weight = DEFAULT_COUNTRY
240
134
  const key = (c) => size(c) + (c.country?.toUpperCase() === target ? weight : 0);
241
135
  return rankWithinTier(candidates, (a, b) => key(b) - key(a));
242
136
  }
243
- /**
244
- * The level a candidate must hold to be PROMOTED: national capitals only. Admin-1 seats stay un-promoted, and that
245
- * scope is forced by decided rows, not caution — a seat margin of even 1 log10 unit flips bare `Springfield` to
246
- * Springfield, Illinois against the ratified 2026-08-11 referential decision
247
- * ({@link SAME_COUNTRY_IMPORTANCE_TIE_BAND}), and sends bare `Hamilton` to the Waikato seat (Hamilton NZ, 2.8x smaller
248
- * than Hamilton, Ontario), both measured on the shipped `candidate.db`. The reference still records seats; no consumer
249
- * promotes on them.
250
- */
251
137
  const PROMOTABLE_CAPITAL_LEVEL = 2;
252
138
  /**
253
- * Margin a national capital may give away, in log10-population units: a namesake must be more than 10^2 = 100x more
254
- * populous to hold the lead. Bare "San José" reaches the Costa Rican capital (342,188) over San Jose, California
255
- * (969,655 — 2.8x); bare "Hamilton" stays on Hamilton, Ontario (519,949) over Bermuda's 902-person capital (576x).
139
+ * The size lead, in log10-population units, that another place needs to stay ahead of a national capital.
140
+ *
141
+ * A value of 2 means 100 times more populous.
256
142
  */
257
143
  export const NATIONAL_CAPITAL_MARGIN_LOG10 = 2;
258
144
  /**
259
- * Bounded capital promotion (#1880) — the third soft key for the bare-toponym class, applied AFTER
260
- * {@link rankByImportance} because the fame prior is what decides this class and a capital signal parked below the
261
- * deciding stage measurably never reaches an answer (the iteration-1 board run: the candidate-order bonus reordered
262
- * `findPlace` on every target row and moved 0 of the 12).
263
- *
264
- * The rule: within the exact tier, take the first NATIONAL-capital row and walk it upward past each row it is within
265
- * {@link NATIONAL_CAPITAL_MARGIN_LOG10} of, stopping at the first row over the margin or at another national capital.
266
- * Same three house rules as the other keys — tier-safe (never crosses the exact/partial boundary.
267
- *
268
- * A capital that only PARTIALLY matched the query — Saint George's, Grenada for the abbreviated "St. George's" — stays
269
- * behind every exact match, because crossing that line is how iteration 1 answered bare "Djibouti" with the capital
270
- * city instead of the country), positive evidence only (no capital in the list → identity, and the margin reads the
271
- * same `prominence ?? score` size every other key does), and stable (non-promoted rows keep their order).
145
+ * Moves the first national capital in the leading match tier above each preceding row that
146
+ * is at most {@link NATIONAL_CAPITAL_MARGIN_LOG10} larger, stopping at another capital.
272
147
  *
273
- * The margin deliberately re-uses log10-population units rather than the importance scale: the ratified importance flip
274
- * decisions (Whitby/Windsor/Springfield) sit on gaps of 0.004–0.02, while the capital contests this key exists for sit
275
- * on gaps of 0.21–0.24 — an importance-scale bonus big enough to win them would dwarf every ratified decision on the
276
- * same scale.
148
+ * It runs after {@link rankByImportance} and never moves a capital across the exact-match boundary.
277
149
  */
278
150
  export function promoteCapitals(candidates, level) {
279
151
  if (!level || candidates.length < 2)
@@ -281,7 +153,6 @@ export function promoteCapitals(candidates, level) {
281
153
  const exact = [];
282
154
  const rest = [];
283
155
  for (const c of candidates) {
284
- // Tri-state exactMatch, same reading as rankWithinTier: only a stated TRUE earns the tier.
285
156
  ;
286
157
  (c.exactMatch === true ? exact : rest).push(c);
287
158
  }
@@ -1 +1 @@
1
- {"version":3,"file":"toponym-prior.js","sourceRoot":"","sources":["../lib/toponym-prior.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAIH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,CAAA;AAE7C;;;;;;;;;;;GAWG;AACH,MAAM,gCAAgC,GAAG,IAAI,CAAA;AAS7C;;;;;GAKG;AACH,SAAS,cAAc,CAAqB,UAAwB,EAAE,OAA+B;IACpG,MAAM,KAAK,GAAQ,EAAE,CAAA;IACrB,MAAM,IAAI,GAAQ,EAAE,CAAA;IAEpB,KAAK,MAAM,CAAC,IAAI,U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