@mailwoman/resolver-wof-sqlite 8.6.0 → 9.1.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.
- package/ancestry-backfill.ts +103 -64
- package/build-candidate.ts +230 -29
- package/candidate-importance.ts +227 -0
- package/candidate-lookup.ts +159 -9
- package/candidate-schema.ts +29 -0
- package/coverage-manifest-schema.ts +1 -1
- package/fst-autocomplete.ts +22 -11
- package/fst-builder.ts +76 -50
- package/fst-deserialize-web.ts +46 -8
- package/fst-freshness.ts +333 -0
- package/fst-serialize.ts +78 -13
- package/fst-types.ts +58 -1
- package/fts.ts +12 -0
- package/geo.ts +16 -41
- package/geonames-aliases.ts +105 -37
- package/geonames-postal.ts +65 -21
- package/index.ts +16 -1
- package/interpolation.ts +2 -1
- package/lookup.ts +44 -5
- package/out/ancestry-backfill.d.ts +37 -18
- package/out/ancestry-backfill.d.ts.map +1 -1
- package/out/ancestry-backfill.js +82 -52
- package/out/ancestry-backfill.js.map +1 -1
- package/out/build-candidate.d.ts +42 -0
- package/out/build-candidate.d.ts.map +1 -1
- package/out/build-candidate.js +141 -13
- package/out/build-candidate.js.map +1 -1
- package/out/candidate-importance.d.ts +132 -0
- package/out/candidate-importance.d.ts.map +1 -0
- package/out/candidate-importance.js +174 -0
- package/out/candidate-importance.js.map +1 -0
- package/out/candidate-lookup.d.ts +9 -1
- package/out/candidate-lookup.d.ts.map +1 -1
- package/out/candidate-lookup.js +127 -8
- package/out/candidate-lookup.js.map +1 -1
- package/out/candidate-schema.d.ts +25 -1
- package/out/candidate-schema.d.ts.map +1 -1
- package/out/candidate-schema.js +5 -0
- package/out/candidate-schema.js.map +1 -1
- package/out/coverage-manifest-schema.d.ts +1 -1
- package/out/coverage-manifest-schema.js +1 -1
- package/out/fst-autocomplete.d.ts +13 -3
- package/out/fst-autocomplete.d.ts.map +1 -1
- package/out/fst-autocomplete.js +10 -9
- package/out/fst-autocomplete.js.map +1 -1
- package/out/fst-builder.d.ts.map +1 -1
- package/out/fst-builder.js +64 -40
- package/out/fst-builder.js.map +1 -1
- package/out/fst-deserialize-web.d.ts.map +1 -1
- package/out/fst-deserialize-web.js +38 -8
- package/out/fst-deserialize-web.js.map +1 -1
- package/out/fst-freshness.d.ts +138 -0
- package/out/fst-freshness.d.ts.map +1 -0
- package/out/fst-freshness.js +238 -0
- package/out/fst-freshness.js.map +1 -0
- package/out/fst-serialize.d.ts +19 -3
- package/out/fst-serialize.d.ts.map +1 -1
- package/out/fst-serialize.js +68 -13
- package/out/fst-serialize.js.map +1 -1
- package/out/fst-types.d.ts +61 -1
- package/out/fst-types.d.ts.map +1 -1
- package/out/fts.d.ts +11 -0
- package/out/fts.d.ts.map +1 -1
- package/out/fts.js +11 -0
- package/out/fts.js.map +1 -1
- package/out/geo.d.ts +10 -13
- package/out/geo.d.ts.map +1 -1
- package/out/geo.js +15 -35
- package/out/geo.js.map +1 -1
- package/out/geonames-aliases.d.ts +23 -1
- package/out/geonames-aliases.d.ts.map +1 -1
- package/out/geonames-aliases.js +88 -33
- package/out/geonames-aliases.js.map +1 -1
- package/out/geonames-postal.d.ts +22 -1
- package/out/geonames-postal.d.ts.map +1 -1
- package/out/geonames-postal.js +50 -16
- package/out/geonames-postal.js.map +1 -1
- package/out/index.d.ts +3 -1
- package/out/index.d.ts.map +1 -1
- package/out/index.js +3 -1
- package/out/index.js.map +1 -1
- package/out/interpolation.d.ts.map +1 -1
- package/out/interpolation.js +2 -1
- package/out/interpolation.js.map +1 -1
- package/out/lookup.d.ts.map +1 -1
- package/out/lookup.js +37 -5
- package/out/lookup.js.map +1 -1
- package/out/place-importance-schema.d.ts +189 -0
- package/out/place-importance-schema.d.ts.map +1 -0
- package/out/place-importance-schema.js +242 -0
- package/out/place-importance-schema.js.map +1 -0
- package/out/poi-lookup.d.ts +1 -1
- package/out/poi-lookup.js +3 -3
- package/out/reverse.d.ts.map +1 -1
- package/out/reverse.js +3 -9
- package/out/reverse.js.map +1 -1
- package/out/sqlite-convention-source.d.ts.map +1 -1
- package/out/sqlite-convention-source.js +4 -3
- package/out/sqlite-convention-source.js.map +1 -1
- package/out/sqlite-utils.d.ts +12 -0
- package/out/sqlite-utils.d.ts.map +1 -1
- package/out/sqlite-utils.js +20 -0
- package/out/sqlite-utils.js.map +1 -1
- package/out/street-morphology-fst-builder.d.ts.map +1 -1
- package/out/street-morphology-fst-builder.js +7 -5
- package/out/street-morphology-fst-builder.js.map +1 -1
- package/out/street-normalize.d.ts +2 -1
- package/out/street-normalize.d.ts.map +1 -1
- package/out/street-normalize.js +2 -1
- package/out/street-normalize.js.map +1 -1
- package/out/types.d.ts +39 -0
- package/out/types.d.ts.map +1 -1
- package/package.json +24 -6
- package/place-importance-schema.ts +353 -0
- package/poi-lookup.ts +3 -3
- package/reverse.ts +4 -9
- package/sqlite-convention-source.ts +5 -3
- package/sqlite-utils.ts +21 -0
- package/street-morphology-fst-builder.ts +8 -5
- package/street-normalize.ts +3 -2
- package/types.ts +39 -0
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @copyright Sister Software
|
|
3
|
+
* @license AGPL-3.0
|
|
4
|
+
* @author Teffen Ellis, et al.
|
|
5
|
+
*
|
|
6
|
+
* The score side of the candidate build (#28) — load a WOF admin database's `place_importance` into
|
|
7
|
+
* a lookup the candidate builder can probe per place, so every candidate row can carry the
|
|
8
|
+
* toponym-fame prior a bare city name is decided on.
|
|
9
|
+
*
|
|
10
|
+
* ## Why this joins on the NAME and not on the id
|
|
11
|
+
*
|
|
12
|
+
* The obvious join is `candidate.spr_id = place_importance.id`, and it is wrong here. The score
|
|
13
|
+
* source (`admin-global-priority-importance.db`) and the candidate build's admin source are
|
|
14
|
+
* DIFFERENT SNAPSHOTS, and they disagree about ids for exactly the rows that matter: Whitby,
|
|
15
|
+
* Ontario is `8143502164401` in the shipped `candidate.db` and `8000001156384` in the score source
|
|
16
|
+
* — the Overture-sourced rows were re-keyed between the two. An id join silently drops every one of
|
|
17
|
+
* them, which means it drops precisely the FOREIGN HOMONYMS the fame prior exists to demote, and it
|
|
18
|
+
* drops them invisibly: the build succeeds, the column is populated, and the ranking is inert on
|
|
19
|
+
* the queries it was built for.
|
|
20
|
+
*
|
|
21
|
+
* So the join key is `(name_key, country, placetype)` — the same {@link normalizeLocalityForKey} the
|
|
22
|
+
* candidate build uses for its probe key, so the two sides fold identically by construction.
|
|
23
|
+
*
|
|
24
|
+
* ## Why the key alone is not enough
|
|
25
|
+
*
|
|
26
|
+
* `(warwick, US, locality)` names ELEVEN different places. Taking the group's max would give every
|
|
27
|
+
* Warwick in America the fame of Warwick, Rhode Island, which is the fan-out defect
|
|
28
|
+
* `importance-fanout.ts` documents one layer up, re-introduced at the join. So the group is
|
|
29
|
+
* disambiguated GEOGRAPHICALLY: the nearest centroid wins, and only within
|
|
30
|
+
* {@link IMPORTANCE_JOIN_GATE_KM}. Two artifacts describing the same settlement put its centroid in
|
|
31
|
+
* almost the same place; two same-named towns in one country do not.
|
|
32
|
+
*
|
|
33
|
+
* ## What lands in the column
|
|
34
|
+
*
|
|
35
|
+
* `place_importance.importance` VERBATIM — the pre-split conflation (encyclopedia-derived where
|
|
36
|
+
* the concordance matched, a population-derived proxy everywhere else). See
|
|
37
|
+
* {@link CandidateTable.importance} for why the split `encyclopedic` channel is deliberately NOT
|
|
38
|
+
* what is written here, with the measurement that settled it.
|
|
39
|
+
*
|
|
40
|
+
* A place with no match gets NULL. NULL is UNMEASURED, never zero — the consumer
|
|
41
|
+
* (`resolver/toponym-prior.ts`) leaves an unmeasured candidate exactly where population put it.
|
|
42
|
+
*/
|
|
43
|
+
import { DatabaseSync } from "node:sqlite";
|
|
44
|
+
import { haversineKm } from "./geo.js";
|
|
45
|
+
import { normalizeLocalityForKey } from "./street-normalize.js";
|
|
46
|
+
/**
|
|
47
|
+
* How far apart two artifacts may put the same place's centroid and still be read as the same place.
|
|
48
|
+
*
|
|
49
|
+
* MEASURED, not guessed (2026-08-10, `admin-global-priority.db` × `admin-global-priority-importance.db`; 4,476,245
|
|
50
|
+
* current locality-tier places against 676,790 scored ones, 1,020,099 of which matched a scored group by `(name_key,
|
|
51
|
+
* country, placetype)`). The nearest-centroid distance is **exactly 0.00 km for 577,080 of them (56.6%)** — the two
|
|
52
|
+
* snapshots agree to the bit — and 656,755 (64.4%) are inside 500 m.
|
|
53
|
+
*
|
|
54
|
+
* What sets the gate is where that mode ENDS, and the per-kilometre density says so plainly. It falls from 1,076
|
|
55
|
+
* places/km over 3–5 km to a trough of **441 places/km over 7–10 km**, then climbs back and flattens onto a plateau of
|
|
56
|
+
* 760–780 places/km from 30 km out to 100 km and beyond. That plateau is the background rate of two DIFFERENT towns
|
|
57
|
+
* wearing one name in one country, and it does not decay with distance because there is no reason it should. 10 km is
|
|
58
|
+
* the floor between the two populations. Admitting it scores 679,163 places (66.6% of the matched set); pushing the
|
|
59
|
+
* gate to 25 km buys 8,722 more, and by then better than half of each additional kilometre is the wrong town.
|
|
60
|
+
*
|
|
61
|
+
* The four-row bare-GB board is insensitive across this whole range — 5 km and 25 km were both measured and select
|
|
62
|
+
* identical rows — so the value is chosen by what the join MEANS, not by what it scores. The gate is the definition of
|
|
63
|
+
* "this is the same place"; widening it past the floor starts handing one town's fame to another.
|
|
64
|
+
*/
|
|
65
|
+
export const IMPORTANCE_JOIN_GATE_KM = 10;
|
|
66
|
+
/**
|
|
67
|
+
* `(name_key, country, placetype)` → the scored places under it. The separator is U+0000, which no WOF name carries and
|
|
68
|
+
* no fold can produce, so the three fields can't smear into one another.
|
|
69
|
+
*/
|
|
70
|
+
function groupKey(nameKey, country, placetype) {
|
|
71
|
+
return `${nameKey}\u0000${(country ?? "").toUpperCase()}\u0000${placetype ?? ""}`;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A loaded `place_importance`, probed by name + country + placetype + position.
|
|
75
|
+
*/
|
|
76
|
+
export class ImportanceIndex {
|
|
77
|
+
#groups;
|
|
78
|
+
stats;
|
|
79
|
+
/**
|
|
80
|
+
* Places {@link find} matched inside the gate.
|
|
81
|
+
*/
|
|
82
|
+
matched = 0;
|
|
83
|
+
/**
|
|
84
|
+
* Places {@link find} REFUSED — the key matched a scored group, but the nearest member of it was outside the gate, so
|
|
85
|
+
* it is a different place wearing the same name.
|
|
86
|
+
*
|
|
87
|
+
* This is the number worth watching across rebuilds. A jump means the score source and the admin source have drifted
|
|
88
|
+
* apart and the join is being asked to guess; it does not mean the gate is too tight.
|
|
89
|
+
*/
|
|
90
|
+
gated = 0;
|
|
91
|
+
constructor(groups, stats) {
|
|
92
|
+
this.#groups = groups;
|
|
93
|
+
this.stats = stats;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The importance of the scored place nearest `(lat, lon)` sharing `name`'s folded key, `country` and `placetype`, or
|
|
97
|
+
* null when there is no such place within {@link IMPORTANCE_JOIN_GATE_KM}.
|
|
98
|
+
*
|
|
99
|
+
* Null is UNMEASURED. Never substitute a zero, and never fall back to a population-derived value here — the source
|
|
100
|
+
* column already carries that fallback where it has one, and inventing a second one would make an absence
|
|
101
|
+
* indistinguishable from a measurement.
|
|
102
|
+
*/
|
|
103
|
+
find(name, country, placetype, lat, lon) {
|
|
104
|
+
const nameKey = normalizeLocalityForKey(name);
|
|
105
|
+
if (!nameKey)
|
|
106
|
+
return null;
|
|
107
|
+
const group = this.#groups.get(groupKey(nameKey, country, placetype));
|
|
108
|
+
if (!group)
|
|
109
|
+
return null;
|
|
110
|
+
let best;
|
|
111
|
+
let bestKm = Infinity;
|
|
112
|
+
for (const place of group) {
|
|
113
|
+
const km = haversineKm(lat, lon, place.lat, place.lon);
|
|
114
|
+
if (km < bestKm) {
|
|
115
|
+
bestKm = km;
|
|
116
|
+
best = place;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (!best || bestKm > IMPORTANCE_JOIN_GATE_KM) {
|
|
120
|
+
this.gated++;
|
|
121
|
+
return null;
|
|
122
|
+
}
|
|
123
|
+
this.matched++;
|
|
124
|
+
return best.importance;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Read `place_importance` (joined to `spr` for the name/country/placetype/centroid) out of a WOF admin database into an
|
|
129
|
+
* {@link ImportanceIndex}.
|
|
130
|
+
*
|
|
131
|
+
* Only CURRENT, non-deprecated places are indexed — a superseded row's score belongs to a place the gazetteer no longer
|
|
132
|
+
* carries, and letting it win the nearest-centroid contest would hand a live place a dead one's fame.
|
|
133
|
+
*
|
|
134
|
+
* The whole table is held in memory on purpose. The 2026-08-10 source holds 676,790 scored places in 544,823 groups,
|
|
135
|
+
* and the build probes it once for every one of its ~4.8 M places; the alternative is a prepared statement per place
|
|
136
|
+
* against a 3.7 GB database. Measured end to end, loading the index plus probing all 4.48 M locality-tier places takes
|
|
137
|
+
* 25 s.
|
|
138
|
+
*/
|
|
139
|
+
export function loadImportanceIndex(databasePath) {
|
|
140
|
+
const db = new DatabaseSync(databasePath, { readOnly: true });
|
|
141
|
+
try {
|
|
142
|
+
const groups = new Map();
|
|
143
|
+
let places = 0;
|
|
144
|
+
let unkeyable = 0;
|
|
145
|
+
for (const row of db
|
|
146
|
+
.prepare(`SELECT s.name AS name, s.country AS country, s.placetype AS placetype,
|
|
147
|
+
s.latitude AS latitude, s.longitude AS longitude, i.importance AS importance
|
|
148
|
+
FROM place_importance i JOIN spr s ON s.id = i.id
|
|
149
|
+
WHERE s.is_current != 0 AND s.is_deprecated = 0`)
|
|
150
|
+
.iterate()) {
|
|
151
|
+
const importance = Number(row.importance);
|
|
152
|
+
if (!Number.isFinite(importance))
|
|
153
|
+
continue;
|
|
154
|
+
const nameKey = normalizeLocalityForKey(String(row.name ?? ""));
|
|
155
|
+
if (!nameKey) {
|
|
156
|
+
unkeyable++;
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
159
|
+
const key = groupKey(nameKey, row.country, row.placetype);
|
|
160
|
+
let group = groups.get(key);
|
|
161
|
+
if (!group) {
|
|
162
|
+
group = [];
|
|
163
|
+
groups.set(key, group);
|
|
164
|
+
}
|
|
165
|
+
group.push({ lat: Number(row.latitude), lon: Number(row.longitude), importance });
|
|
166
|
+
places++;
|
|
167
|
+
}
|
|
168
|
+
return new ImportanceIndex(groups, { places, keys: groups.size, unkeyable });
|
|
169
|
+
}
|
|
170
|
+
finally {
|
|
171
|
+
db.close();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
//# sourceMappingURL=candidate-importance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"candidate-importance.js","sourceRoot":"","sources":["../candidate-importance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAE/D;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAA;AA8BzC;;;GAGG;AACH,SAAS,QAAQ,CAAC,OAAe,EAAE,OAAsB,EAAE,SAAwB;IAClF,OAAO,GAAG,OAAO,SAAS,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,SAAS,SAAS,IAAI,EAAE,EAAE,CAAA;AAClF,CAAC;AAED;;GAEG;AACH,MAAM,OAAO,eAAe;IAClB,OAAO,CAA4B;IACnC,KAAK,CAAsB;IACpC;;OAEG;IACH,OAAO,GAAG,CAAC,CAAA;IACX;;;;;;OAMG;IACH,KAAK,GAAG,CAAC,CAAA;IAET,YAAY,MAAkC,EAAE,KAA2B;QAC1E,IAAI,CAAC,OAAO,GAAG,MAAM,CAAA;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACnB,CAAC;IAED;;;;;;;OAOG;IACH,IAAI,CAAC,IAAY,EAAE,OAAsB,EAAE,S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O,CACP;;;qDAGiD,CACjD;aACA,OAAO,EAAE,EAAE,CAAC;YACb,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;YAEzC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,CAAC;gBAAE,SAAQ;YAC1C,MAAM,OAAO,GAAG,uBAAuB,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAA;YAE/D,IAAI,CAAC,OAAO,EAAE,CAAC;gBACd,SAAS,EAAE,CAAA;gBAEX,SAAQ;YACT,CAAC;YAED,MAAM,GAAG,GAAG,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,OAAwB,EAAE,GAAG,CAAC,SAA0B,CAAC,CAAA;YAC3F,IAAI,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;YAE3B,IAAI,CAAC,KAAK,EAAE,CAAC;gBACZ,KAAK,GAAG,EAAE,CAAA;gBACV,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;YACvB,CAAC;YAED,KAAK,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,UAAU,EAAE,CAAC,CAAA;YAEjF,MAAM,EAAE,CAAA;QACT,CAAC;QAED,OAAO,IAAI,eAAe,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,CAAA;IAC7E,CAAC;YAAS,CAAC;QACV,EAAE,CAAC,KAAK,EAAE,CAAA;IACX,CAAC;AACF,CAAC"}
|
|
@@ -40,7 +40,7 @@ export interface WOFCandidateTableLookupOpts {
|
|
|
40
40
|
* The candidate columns this lookup probes — a typed projection of the SHARED {@link CandidateTable}, so a column rename
|
|
41
41
|
* in `build-candidate` (the writer) is a compile error here (the reader).
|
|
42
42
|
*/
|
|
43
|
-
type CandidateRow = Pick<CandidateTable, "spr_id" | "name" | "country_id" | "placetype_id" | "latitude" | "longitude" | "min_lat" | "min_lon" | "max_lat" | "max_lon" | "neg_rank" | "is_primary"
|
|
43
|
+
type CandidateRow = Pick<CandidateTable, "spr_id" | "name" | "country_id" | "placetype_id" | "latitude" | "longitude" | "min_lat" | "min_lon" | "max_lat" | "max_lon" | "neg_rank" | "is_primary" | "population"> & Partial<Pick<CandidateTable, "importance">>;
|
|
44
44
|
/**
|
|
45
45
|
* A candidate row annotated with the {@link rankByPrimaryPreference} effective rank + the exact-tier demotion flag.
|
|
46
46
|
*/
|
|
@@ -60,6 +60,14 @@ export type RankedRow<R> = R & {
|
|
|
60
60
|
* tier, and a same-country nickname (San Francisco's "Frisco") is never touched.
|
|
61
61
|
*/
|
|
62
62
|
demoted: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* True when this row came from the TYPO-CORRECTOR tier — the FTS5-trigram fallback that fires only after the exact
|
|
65
|
+
* and qualifier-strip probes both missed. Such a row answers a query the gazetteer does not contain, so it is a fuzzy
|
|
66
|
+
* match by construction and must not claim `exactMatch` (#17). Recall is unaffected: the row is still returned, still
|
|
67
|
+
* ranked, still resolvable — it just stops asserting a match quality it does not have, which is what the FTS backend
|
|
68
|
+
* has always done and what every `exactMatch`-filtering consumer assumed.
|
|
69
|
+
*/
|
|
70
|
+
fuzzy?: boolean;
|
|
63
71
|
};
|
|
64
72
|
/**
|
|
65
73
|
* Bounded cross-country primary-name preference (see {@link PRIMARY_PREFERENCE_LOG10}). Pure + total-ordered so
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"candidate-lookup.d.ts","sourceRoot":"","sources":["../candidate-lookup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,EAAyB,KAAK,y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E,SAAS,CAAC,EAAE,EAClB,KAAK,EAAE,MAAM,EACb,KAAK,SAA2B,GAC9B,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAkCrB;AAqBD;;;GAGG;AACH,qBAAa,uBAAwB,YAAW,WAAW;;IAyB1D;;;;OAIG;IACH,QAAQ,CAAC,gBAAgB,EAAE,yBAAyB,GAAG,SAAS,CAAA;gBASpD,IAAI,EAAE,2BAA2B;IA+FvC,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAqWjE,KAAK,IAAI,IAAI;CAKb"}
|
package/out/candidate-lookup.js
CHANGED
|
@@ -28,8 +28,9 @@ import { CANDIDATE_FTS_TABLE } from "./candidate-fts.js";
|
|
|
28
28
|
import { readGazetteerCoverageManifest } from "./coverage-manifest-schema.js";
|
|
29
29
|
import { haversineKm } from "./geo.js";
|
|
30
30
|
import { trigramJaccard } from "./lookup.js";
|
|
31
|
+
import { referentialFromPopulation } from "./place-importance-schema.js";
|
|
31
32
|
import { POSTAL_CITY_CANDIDATE_TABLE } from "./postal-city-candidate-schema.js";
|
|
32
|
-
import { hasTable } from "./sqlite-utils.js";
|
|
33
|
+
import { hasColumn, hasTable } from "./sqlite-utils.js";
|
|
33
34
|
import { normalizeLocalityForKey, stripLocalityQualifier } from "./street-normalize.js";
|
|
34
35
|
/**
|
|
35
36
|
* FTS5-trigram over-fetch before the trigram-Jaccard re-rank, and the minimum similarity to count as a fuzzy hit (below
|
|
@@ -37,6 +38,13 @@ import { normalizeLocalityForKey, stripLocalityQualifier } from "./street-normal
|
|
|
37
38
|
*/
|
|
38
39
|
const FUZZY_FETCH = 40;
|
|
39
40
|
const FUZZY_MIN = 0.34;
|
|
41
|
+
/**
|
|
42
|
+
* Postcode-containment re-rank gate radius (km) — the SAME value the resolver's country pass measures at
|
|
43
|
+
* (`POSTCODE_COUNTRY_COHERENCE_GATE_KM`, resolver/postcode-country-coherence.ts): a locality within this distance of
|
|
44
|
+
* the postcode's own centroid counts as "containing" it. One number, two passes — a divergence here would make the two
|
|
45
|
+
* mechanisms disagree about what is proximal.
|
|
46
|
+
*/
|
|
47
|
+
const POSTCODE_CONTAINMENT_GATE_KM = 25;
|
|
40
48
|
/**
|
|
41
49
|
* Bounded PRIMARY-NAME preference across a CROSS-COUNTRY name collision (the `is_primary` ranking signal).
|
|
42
50
|
*
|
|
@@ -149,6 +157,13 @@ export class WOFCandidateTableLookup {
|
|
|
149
157
|
* (the hard-country coverage gate, guard-B plausibility) falls back to its code constants byte-identically.
|
|
150
158
|
*/
|
|
151
159
|
artifactCoverage;
|
|
160
|
+
/**
|
|
161
|
+
* `", importance"` when this artifact carries the #28 fame column, `""` when it does not — spliced into the probe's
|
|
162
|
+
* SELECT list. Existence-gated exactly like `#ftsProbe` and `#postalCityProbe` above, and for the same reason: a
|
|
163
|
+
* candidate.db built before the column is a valid artifact, and naming a column it lacks would turn a stale gazetteer
|
|
164
|
+
* into `no such column` on the first keystroke rather than into "no fame signal", which is what it is.
|
|
165
|
+
*/
|
|
166
|
+
#importanceSelect;
|
|
152
167
|
constructor(opts) {
|
|
153
168
|
if (opts.database) {
|
|
154
169
|
this.#db = opts.database;
|
|
@@ -185,6 +200,8 @@ export class WOFCandidateTableLookup {
|
|
|
185
200
|
this.#ftsProbe = this.#db.prepare(`SELECT name_key FROM ${CANDIDATE_FTS_TABLE} WHERE ${CANDIDATE_FTS_TABLE} MATCH ? ORDER BY bm25(${CANDIDATE_FTS_TABLE}) LIMIT ?`);
|
|
186
201
|
this.#nameKeyExistsProbe = this.#db.prepare("SELECT 1 FROM candidate WHERE name_key = ? LIMIT 1");
|
|
187
202
|
}
|
|
203
|
+
// #28 fame column: probed ONCE here (it runs a PRAGMA, and `findPlace` is per-keystroke hot).
|
|
204
|
+
this.#importanceSelect = hasColumn(this.#db, "candidate", "importance") ? ", importance" : "";
|
|
188
205
|
// Coverage manifest (survey candidate #2): the artifact's own coverage facts, existence-gated like
|
|
189
206
|
// the probes above — a candidate.db built before the manifest reads `undefined` and consumers keep
|
|
190
207
|
// their code-constant fallbacks byte-identically.
|
|
@@ -199,6 +216,33 @@ export class WOFCandidateTableLookup {
|
|
|
199
216
|
const want = Array.isArray(placetype) ? placetype : [placetype];
|
|
200
217
|
return expandPlacetypeFilter(want).includes("locality");
|
|
201
218
|
}
|
|
219
|
+
/**
|
|
220
|
+
* The postcode-containment anchor: the postcode's own centroid row in the candidate table, keyed whitespace-stripped
|
|
221
|
+
* (#920 — the same fold the build applies to postcode rows), country-scoped when the query is, first
|
|
222
|
+
* coordinate-bearing row wins. null when the candidate table carries no such postcode — the re-rank then abstains,
|
|
223
|
+
* because a recall gap is not evidence for the name match. Meaning-of-zero: a 0,0 row is the build's unlocated
|
|
224
|
+
* sentinel, never a real centroid.
|
|
225
|
+
*/
|
|
226
|
+
#postcodeAnchor(postcode, country) {
|
|
227
|
+
const placetypeID = this.#placetypeToID.get("postalcode");
|
|
228
|
+
if (placetypeID === undefined)
|
|
229
|
+
return null;
|
|
230
|
+
const conds = ["name_key = ?", "placetype_id = ?"];
|
|
231
|
+
const params = [postcode.replaceAll(/\s+/g, ""), placetypeID];
|
|
232
|
+
if (country) {
|
|
233
|
+
const countryID = this.#countryToID.get(country.toUpperCase());
|
|
234
|
+
if (countryID === undefined)
|
|
235
|
+
return null; // a country the candidate table doesn't carry
|
|
236
|
+
conds.push("country_id = ?");
|
|
237
|
+
params.push(countryID);
|
|
238
|
+
}
|
|
239
|
+
const row = this.#db
|
|
240
|
+
.prepare(`SELECT latitude, longitude FROM candidate WHERE ${conds.join(" AND ")} ORDER BY neg_rank ASC LIMIT 1`)
|
|
241
|
+
.get(...params);
|
|
242
|
+
if (!row || (Number(row.latitude) === 0 && Number(row.longitude) === 0))
|
|
243
|
+
return null;
|
|
244
|
+
return { lat: Number(row.latitude), lon: Number(row.longitude) };
|
|
245
|
+
}
|
|
202
246
|
async findPlace(query) {
|
|
203
247
|
let text = (query.text ?? "").trim();
|
|
204
248
|
if (!text)
|
|
@@ -206,7 +250,8 @@ export class WOFCandidateTableLookup {
|
|
|
206
250
|
// #920 name law, candidate-key edition: postcode rows are keyed by their whitespace-stripped
|
|
207
251
|
// form at build (the GeoNames fold normalizes '624 66' → '62466'), so a postcode-typed query
|
|
208
252
|
// strips internal whitespace before keying. Postcode-only — locality names keep their spaces.
|
|
209
|
-
|
|
253
|
+
const wantsPostcode = [query.placetype].flat().includes("postalcode");
|
|
254
|
+
if (wantsPostcode) {
|
|
210
255
|
text = text.replaceAll(/\s+/g, "");
|
|
211
256
|
}
|
|
212
257
|
const nameKey = normalizeLocalityForKey(text);
|
|
@@ -284,8 +329,15 @@ export class WOFCandidateTableLookup {
|
|
|
284
329
|
// intended primary even when a cluster of more-populous foreign aliases sits ahead of it. `is_primary`
|
|
285
330
|
// + `country_id` feed that re-rank. A single-country probe (a country filter, or all rows same
|
|
286
331
|
// country) re-ranks to the identical population order, so the common path is untouched.
|
|
287
|
-
|
|
288
|
-
|
|
332
|
+
// `population` rides along for the REFERENTIAL score on the result (ROAD_TO_V9 §2) — one more
|
|
333
|
+
// column off a clustered row the probe already reads, and it is NOT what the probe orders by:
|
|
334
|
+
// `neg_rank` remains the sort key, so this changes no ordering, only what the result reports.
|
|
335
|
+
// `importance` (#28) rides along on the same terms, and there is deliberately NO `ORDER BY` on it:
|
|
336
|
+
// the fame prior is applied by the RESOLVER (`resolver/toponym-prior.ts`), which alone knows
|
|
337
|
+
// whether the query was bare enough to deserve it. A backend that pre-sorted by fame would apply
|
|
338
|
+
// it to every lookup, including the qualified addresses the D-rule guard exists to protect.
|
|
339
|
+
const sql = "SELECT spr_id, name, country_id, placetype_id, latitude, longitude, min_lat, min_lon, max_lat, max_lon, neg_rank, is_primary, population" +
|
|
340
|
+
`${this.#importanceSelect} FROM candidate WHERE ${conds.join(" AND ")} ORDER BY neg_rank ASC LIMIT ?`;
|
|
289
341
|
const fetched = this.#db.prepare(sql).all(...params, Math.max(limit, RERANK_FETCH));
|
|
290
342
|
return rankByPrimaryPreference(fetched, limit);
|
|
291
343
|
};
|
|
@@ -314,7 +366,16 @@ export class WOFCandidateTableLookup {
|
|
|
314
366
|
// — fuzzing it scrapes an unrelated same-filter place ("Vienna, Austria" misrouted to IT would
|
|
315
367
|
// pull a tiny Italian name_key near Siena) and masks the cascade's country-agnostic retry that
|
|
316
368
|
// correctly lands population-first Vienna AT. The exact/strip probes already covered the real name.
|
|
317
|
-
|
|
369
|
+
//
|
|
370
|
+
// NEVER for postcodes: fuzzy is a typo corrector for place NAMES, and a "corrected" postcode is a
|
|
371
|
+
// DIFFERENT postcode. The 2026-08-05 Code-Point swap exposed the trap at scale: Northern Ireland's
|
|
372
|
+
// `BT3 9QQ` (absent — no permissive NI source) trigram-matched Sheffield's `S3 9QQ` (Jaccard 0.4
|
|
373
|
+
// on {39q, 9qq}) and resolved 200+ km wrong with full confidence. An unknown postcode must abstain.
|
|
374
|
+
if (!rows.length &&
|
|
375
|
+
!wantsPostcode &&
|
|
376
|
+
this.#ftsProbe &&
|
|
377
|
+
this.#nameKeyExistsProbe &&
|
|
378
|
+
!this.#nameKeyExistsProbe.get(nameKey)) {
|
|
318
379
|
const match = ftsTrigramQuery(nameKey);
|
|
319
380
|
if (match) {
|
|
320
381
|
const hits = this.#ftsProbe.all(match, FUZZY_FETCH);
|
|
@@ -328,7 +389,9 @@ export class WOFCandidateTableLookup {
|
|
|
328
389
|
if (seen.has(h.nk))
|
|
329
390
|
continue;
|
|
330
391
|
seen.add(h.nk);
|
|
331
|
-
rows
|
|
392
|
+
// #17: stamp the tier. These rows answer a name the gazetteer does not carry, so they are
|
|
393
|
+
// fuzzy matches and `exactMatch` below must say so — see `RankedRow.fuzzy`.
|
|
394
|
+
rows.push(...probe(h.nk, regionID).map((r) => ({ ...r, fuzzy: true })));
|
|
332
395
|
if (rows.length >= limit)
|
|
333
396
|
break;
|
|
334
397
|
}
|
|
@@ -344,6 +407,38 @@ export class WOFCandidateTableLookup {
|
|
|
344
407
|
if (!rows.length && regionParentID !== undefined) {
|
|
345
408
|
rows = cascade(undefined);
|
|
346
409
|
}
|
|
410
|
+
// Postcode-containment coherence (#31, Mechanism 2): re-rank the rows by proximity to the postcode's
|
|
411
|
+
// own centroid, so the locality that CONTAINS the postcode wins the name-match tie (the "Paris" that
|
|
412
|
+
// holds 75001, not the one that holds a 75001-free namesake). The resolver sends this flag on locality
|
|
413
|
+
// lookups when `ResolveOpts.postcodeContainmentCoherence` is on. Strictly beneath the #741 postal-city
|
|
414
|
+
// short-circuit above — an exact (name, postcode) hit IS the answer and outranks any re-rank — and after
|
|
415
|
+
// the region-scope fallback, so it sees the final row set. Rows within the gate sort by distance first;
|
|
416
|
+
// the out-gate tail keeps its original population-first order. No in-gate row, or no postcode row in
|
|
417
|
+
// the candidate table → unchanged (byte-identical to the flag-off path).
|
|
418
|
+
if (query.postcode &&
|
|
419
|
+
query.postcodeContainmentCoherence === true &&
|
|
420
|
+
this.#wantsLocality(query.placetype) &&
|
|
421
|
+
rows.length > 1) {
|
|
422
|
+
const anchor = this.#postcodeAnchor(query.postcode, query.country);
|
|
423
|
+
if (anchor) {
|
|
424
|
+
const inGate = [];
|
|
425
|
+
const outGate = [];
|
|
426
|
+
for (const row of rows) {
|
|
427
|
+
const distanceKm = haversineKm(anchor.lat, anchor.lon, Number(row.latitude), Number(row.longitude));
|
|
428
|
+
if (distanceKm <= POSTCODE_CONTAINMENT_GATE_KM) {
|
|
429
|
+
inGate.push({ row, distanceKm });
|
|
430
|
+
}
|
|
431
|
+
else {
|
|
432
|
+
outGate.push(row);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
if (inGate.length) {
|
|
436
|
+
// oxlint-disable-next-line unicorn/no-array-sort -- sorts a freshly-built array; toSorted would double-allocate on a hot path
|
|
437
|
+
inGate.sort((a, b) => a.distanceKm - b.distanceKm);
|
|
438
|
+
rows = [...inGate.map(({ row }) => row), ...outGate];
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
}
|
|
347
442
|
const candidates = rows.map((row) => {
|
|
348
443
|
const hasBbox = row.min_lat != null && row.max_lat != null && row.min_lon != null && row.max_lon != null;
|
|
349
444
|
return {
|
|
@@ -367,8 +462,32 @@ export class WOFCandidateTableLookup {
|
|
|
367
462
|
// Every candidate row IS an exact normalized-name (or alias/abbrev) match — the cascade's exact tier
|
|
368
463
|
// accepts alias-exact hits ("New York City" → New York) the same as canonical — EXCEPT a cross-country
|
|
369
464
|
// alias that lost the bounded contest to a same-key primary (`demoted`): it drops to the partial tier so
|
|
370
|
-
// the walk's country posterior can't cross back over the primary (see `RankedRow.demoted`)
|
|
371
|
-
|
|
465
|
+
// the walk's country posterior can't cross back over the primary (see `RankedRow.demoted`) — and
|
|
466
|
+
// EXCEPT a row the typo-corrector produced (`fuzzy`), which by definition answers a name the
|
|
467
|
+
// gazetteer does not carry (see `RankedRow.fuzzy`).
|
|
468
|
+
exactMatch: !row.demoted && !row.fuzzy,
|
|
469
|
+
// The two-score split's carry (ROAD_TO_V9 §2). `referential` names the prominence this
|
|
470
|
+
// backend has always ordered by — `neg_rank` IS `-log10(population + 1)`, so the score and
|
|
471
|
+
// the sort key are two readings of the same number.
|
|
472
|
+
...(row.population === null || row.population <= 0
|
|
473
|
+
? {}
|
|
474
|
+
: { population: row.population, referential: referentialFromPopulation(row.population) }),
|
|
475
|
+
// #28: the fame prior, from the `importance` column the candidate build joins in. Emitted ONLY
|
|
476
|
+
// when the artifact measured this place — an absent field is what `rankByImportance` reads as
|
|
477
|
+
// "does not participate", and a 0 would be a claim nobody made (meaning-of-zero).
|
|
478
|
+
//
|
|
479
|
+
// The field name matches the column because they hold the same thing: the score source's
|
|
480
|
+
// BLENDED prior — the concordance's encyclopedia-derived channel where a concordance matched, a
|
|
481
|
+
// population-derived proxy everywhere else. It is NOT the strict `encyclopedic` channel
|
|
482
|
+
// `place-importance-schema.ts` defines, and it deliberately does not land in that field: the
|
|
483
|
+
// strict channel was measured on 2026-08-10 and covers eleven countries, none of them CA/AU/RU,
|
|
484
|
+
// which makes it inert on three of the four homonym contests the prior exists to settle.
|
|
485
|
+
// `PlaceCandidate.encyclopedic` stays reserved for a strict-channel source (the FTS backend's
|
|
486
|
+
// clauses are strict and today emit NULL for everything — no shipped admin DB has the split
|
|
487
|
+
// table at all). See `candidate-schema.ts` → {@link CandidateTable.importance}.
|
|
488
|
+
...(typeof row.importance === "number" && Number.isFinite(row.importance)
|
|
489
|
+
? { importance: row.importance }
|
|
490
|
+
: {}),
|
|
372
491
|
...(hasBbox
|
|
373
492
|
? {
|
|
374
493
|
bbox: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"candidate-lookup.js","sourceRoot":"","sources":["../candidate-lookup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE1C,OAAO,EAAE,qBAAqB,EAAkC,MAAM,qBAAqB,CAAA;AAE3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAExD,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAA;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,2BAA2B,EAAiC,MAAM,mCAAmC,CAAA;AAC9G,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AAkCvF;;;GAGG;AACH,MAAM,WAAW,GAAG,EAAE,CAAA;AACtB,MAAM,SAAS,GAAG,IAAI,CAAA;AAEtB;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,wBAAwB,GAAG,CAAC,CAAA;AAElC;;;;;GAKG;AACH,MAAM,YAAY,GAAG,EAAE,CAAA;AAuBvB;;;;;;GAMG;AACH,M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AC,EAAE,CAAC,CAAC,UAAU,EAAE,CAAA;YACjC,CAAC,CAAC;gBACF,8HAA8H;iBAC7H,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;iBACtC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;QAC3C,CAAC;QAED,OAAO,UAAU,CAAA;IAClB,CAAC;IAED,KAAK;QACJ,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAA;QACjB,CAAC;IACF,CAAC;CACD"}
|
|
@@ -57,6 +57,30 @@ export interface CandidateTable {
|
|
|
57
57
|
* 1 when the row is the place's canonical name (vs an alias/abbrev).
|
|
58
58
|
*/
|
|
59
59
|
is_primary: number | null;
|
|
60
|
+
/**
|
|
61
|
+
* Blended place importance in [0, 1] — the toponym-fame prior the bare-city-name class is decided on (#28). NULL
|
|
62
|
+
* means the score source had no row for this place: UNMEASURED, never "an importance of zero" (meaning-of-zero).
|
|
63
|
+
* Constant across every row of one place — primary, alias and abbrev alike — because it is a property of the PLACE,
|
|
64
|
+
* not of the name that reached it, which is what lets a bare `Moscow` inherit Москва's score through the alias row.
|
|
65
|
+
*
|
|
66
|
+
* **THIS IS THE PRE-SPLIT CONFLATION, AND THE NAME SAYS SO.** It is `place_importance.importance` copied verbatim
|
|
67
|
+
* from the score source — a legacy blended importance whose own build already coalesced the concordance's
|
|
68
|
+
* encyclopedia-derived channel with a population-derived fallback; `place-importance-schema.ts` calls that column
|
|
69
|
+
* DEPRECATED. It is NOT the split `encyclopedic` channel, and the two must not be conflated in a future build:
|
|
70
|
+
* writing the split value here instead was measured on 2026-08-10 and makes the ranking key INERT on three of the
|
|
71
|
+
* four rows it exists to fix. The reason is coverage, not principle — the encyclopedia-concordance join in
|
|
72
|
+
* `admin-global-priority-importance.db` reaches 133,888 of 702,709 scored places and only eleven countries
|
|
73
|
+
* (US/FR/GB/DE/IT/ES/NL/JP/CN/KR/TW). CA, AU and RU have ZERO concordance rows, so Whitby CA, Windsor CA and Epping
|
|
74
|
+
* AU carry the population fallback and nothing else. Under the strict split those three become unmeasured, the
|
|
75
|
+
* consumer's positive-evidence-only rule leaves them exactly where population put them (first), and the famous GB
|
|
76
|
+
* bearer can never overtake them. The conflated column is the only one on which every bearer of a name is scored on a
|
|
77
|
+
* single comparable scale, which is the precondition for comparing them at all.
|
|
78
|
+
*
|
|
79
|
+
* So a consumer reads this as "fame, with population standing in where fame was never measured" — the legacy blended
|
|
80
|
+
* semantics — and NOT as "this place has an encyclopedia entry of this importance". When the score source grows a
|
|
81
|
+
* real `encyclopedic` column for every country, add a SECOND column rather than redefining this one.
|
|
82
|
+
*/
|
|
83
|
+
importance: number | null;
|
|
60
84
|
}
|
|
61
85
|
/**
|
|
62
86
|
* `(id → ISO country code)` dictionary.
|
|
@@ -92,7 +116,7 @@ export interface CandidateDatabase {
|
|
|
92
116
|
* cand_stage` derives its column list from this, so the two tables can't drift. Keep in sync with
|
|
93
117
|
* {@link CandidateTable}.
|
|
94
118
|
*/
|
|
95
|
-
export declare const CANDIDATE_COLUMNS: readonly ["name_key", "country_id", "region_id", "placetype_id", "neg_rank", "spr_id", "name", "latitude", "longitude", "min_lat", "min_lon", "max_lat", "max_lon", "population", "is_primary"];
|
|
119
|
+
export declare const CANDIDATE_COLUMNS: readonly ["name_key", "country_id", "region_id", "placetype_id", "neg_rank", "spr_id", "name", "latitude", "longitude", "min_lat", "min_lon", "max_lat", "max_lon", "population", "is_primary", "importance"];
|
|
96
120
|
/**
|
|
97
121
|
* Create the code dictionaries + the transient staging table — called before the build's load passes. `cand_stage`
|
|
98
122
|
* mirrors {@link CandidateTable} but every column is nullable (the loader fills them positionally). Pass a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"candidate-schema.d.ts","sourceRoot":"","sources":["../candidate-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAO,KAAK,MAAM,EAAE,MAAM,QAAQ,CAAA;AAEzC;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC9B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;IAChB;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB;;OAEG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,SAAS,EAAE,cAAc,CAAA;IACzB;;OAEG;IACH,UAAU,EAAE,cAAc,CAAA;IA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AAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IACjC;;OAEG;IACH,SAAS,EAAE,cAAc,CAAA;IACzB;;OAEG;IACH,UAAU,EAAE,cAAc,CAAA;IAC1B,aAAa,EAAE,gBAAgB,CAAA;IAC/B,eAAe,EAAE,kBAAkB,CAAA;CACnC;AAED;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,+MAmBpB,CAAA;AAEV;;;;GAIG;AACH,wBAAsB,4BAA4B,CAAC,EAAE,EAAE,MAAM,CAAC,iBAAiB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAgC/F;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,EAAE,EAAE,MAAM,CAAC,iBAAiB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CA8BvF"}
|
package/out/candidate-schema.js
CHANGED
|
@@ -36,6 +36,9 @@ export const CANDIDATE_COLUMNS = [
|
|
|
36
36
|
"max_lon",
|
|
37
37
|
"population",
|
|
38
38
|
"is_primary",
|
|
39
|
+
// Appended, never inserted mid-list: the first six entries ARE the clustered primary key, and the
|
|
40
|
+
// positional `INSERT INTO cand_stage VALUES (…)` in the builder binds by position.
|
|
41
|
+
"importance",
|
|
39
42
|
];
|
|
40
43
|
/**
|
|
41
44
|
* Create the code dictionaries + the transient staging table — called before the build's load passes. `cand_stage`
|
|
@@ -70,6 +73,7 @@ export async function createCandidateStagingTables(db) {
|
|
|
70
73
|
.addColumn("max_lon", "real")
|
|
71
74
|
.addColumn("population", "integer")
|
|
72
75
|
.addColumn("is_primary", "integer")
|
|
76
|
+
.addColumn("importance", "real")
|
|
73
77
|
.execute();
|
|
74
78
|
}
|
|
75
79
|
/**
|
|
@@ -94,6 +98,7 @@ export async function createCandidateTable(db) {
|
|
|
94
98
|
.addColumn("max_lon", "real")
|
|
95
99
|
.addColumn("population", "integer")
|
|
96
100
|
.addColumn("is_primary", "integer")
|
|
101
|
+
.addColumn("importance", "real")
|
|
97
102
|
.addPrimaryKeyConstraint("candidate_pk", [
|
|
98
103
|
"name_key",
|
|
99
104
|
"country_id",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"candidate-schema.js","sourceRoot":"","sources":["../candidate-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,GAAG,EAAe,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"candidate-schema.js","sourceRoot":"","sources":["../candidate-schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,GAAG,EAAe,MAAM,QAAQ,CAAA;AAsGzC;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAChC,UAAU;IACV,YAAY;IACZ,WAAW;IACX,cAAc;IACd,UAAU;IACV,QAAQ;IACR,MAAM;IACN,UAAU;IACV,WAAW;IACX,SAAS;IACT,SAAS;IACT,SAAS;IACT,SAAS;IACT,YAAY;IACZ,YAAY;IACZ,kGAAkG;IAClG,mFAAmF;IACnF,YAAY;CACH,CAAA;AAEV;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,EAA6B;IAC/E,MAAM,EAAE,CAAC,MAAM;SACb,WAAW,CAAC,eAAe,CAAC;SAC5B,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;SACjD,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;SAC5C,OAAO,EAAE,CAAA;IAEX,MAAM,EAAE,CAAC,MAAM;SACb,WAAW,CAAC,iBAAiB,CAAC;SAC9B,SAAS,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC;SACjD,SAAS,CAAC,WAAW,EAA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EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SACrD,SAAS,CAAC,cAAc,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SACxD,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SACjD,SAAS,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;SAClD,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;SACzB,SAAS,CAAC,UAAU,EAAE,MAAM,CAAC;SAC7B,SAAS,CAAC,WAAW,EAAE,MAAM,CAAC;SAC9B,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC;SAC5B,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC;SAC5B,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC;SAC5B,SAAS,CAAC,SAAS,EAAE,MAAM,CAAC;SAC5B,SAAS,CAAC,YAAY,EAAE,SAAS,CAAC;SAClC,SAAS,CAAC,YAAY,EAAE,SAAS,CAAC;SAClC,SAAS,CAAC,YAAY,EAAE,MAAM,CAAC;SAC/B,uBAAuB,CAAC,cAAc,EAAE;QACxC,UAAU;QACV,YAAY;QACZ,WAAW;QACX,cAAc;QACd,UAAU;QACV,QAAQ;KACR,CAAC;QACF,0FAA0F;SACzF,SAAS,CAAC,GAAG,CAAA,eAAe,CAAC;SAC7B,OAAO,EAAE,CAAA;AACZ,CAAC"}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* promote-gate verdicts + the measured hard-resolve rates that used to live in a code comment on
|
|
12
12
|
* `HARD_PLACE_COUNTRY_SAFELIST`. Presence = measured; `hard_filter_safe = 0` = measured and
|
|
13
13
|
* FAILED the gate (FI 69.5%, PL 77.8%) — distinguishable from a country never measured at all
|
|
14
|
-
* (the meaning-of-zero rule, `docs/
|
|
14
|
+
* (the meaning-of-zero rule, `docs/engineering/reference/layer-contract.mdx`).
|
|
15
15
|
* - `country_bbox`: the coarse guard-B plausibility boxes that used to live in
|
|
16
16
|
* `resolver/plausibility.ts`'s `COUNTRY_BBOX`. An absent row fails open (never trips the guard),
|
|
17
17
|
* exactly like an absent key in the constant.
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* promote-gate verdicts + the measured hard-resolve rates that used to live in a code comment on
|
|
12
12
|
* `HARD_PLACE_COUNTRY_SAFELIST`. Presence = measured; `hard_filter_safe = 0` = measured and
|
|
13
13
|
* FAILED the gate (FI 69.5%, PL 77.8%) — distinguishable from a country never measured at all
|
|
14
|
-
* (the meaning-of-zero rule, `docs/
|
|
14
|
+
* (the meaning-of-zero rule, `docs/engineering/reference/layer-contract.mdx`).
|
|
15
15
|
* - `country_bbox`: the coarse guard-B plausibility boxes that used to live in
|
|
16
16
|
* `resolver/plausibility.ts`'s `COUNTRY_BBOX`. An absent row fails open (never trips the guard),
|
|
17
17
|
* exactly like an absent key in the constant.
|