chore(meta): activate T-1074/T-1075 settlement-dataset batch — Si refinement + gap resolutions appended

This commit is contained in:
2026-07-16 09:04:41 +02:00
parent 4113107121
commit 1f958962cc
2 changed files with 118 additions and 0 deletions
+50
View File
@@ -1280,3 +1280,53 @@ INSERT INTO ticket_history (ticket_record_id, field, old_value, new_value, chang
INSERT INTO ticket_history (ticket_record_id, field, old_value, new_value, changed_by, changed_at, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FB0TNSRZ8BFVNWDH17CMH1YM', 'status', 'review', 'done', NULL, '2026-07-14 16:03:22', '2026-07-14 16:03:22.069', '2026-07-14 16:03:22.069', NULL, 'b754b491146d3be5d46c4bd83eccb4dd', 2) ON CONFLICT(hash) DO NOTHING;
INSERT INTO ticket_history (ticket_record_id, field, old_value, new_value, changed_by, changed_at, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FB0TNSRYEJ0G4F0SBHG379YR', 'status', 'review', 'done', NULL, '2026-07-14 16:03:22', '2026-07-14 16:03:22.074', '2026-07-14 16:03:22.074', NULL, '08a20f24aa5ecd449aabaca49017d2af', 2) ON CONFLICT(hash) DO NOTHING;
INSERT INTO ticket_history (ticket_record_id, field, old_value, new_value, changed_by, changed_at, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FB0TNSRW2ZSPJ3D9NEZ6JBW8', 'status', 'review', 'done', NULL, '2026-07-14 16:03:22', '2026-07-14 16:03:22.075', '2026-07-14 16:03:22.075', NULL, '28e7a1cd73d82111ebd5d537666e03a2', 2) ON CONFLICT(hash) DO NOTHING;
INSERT INTO ticket_history (ticket_record_id, field, old_value, new_value, changed_by, changed_at, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FCDG73NW7SNCA5Y8JN905QMR', 'description', 'Per D-242. Corp HQs are not cities and must leave atlas_city_names.
1. Remove the D-207/D-223 reserved=1 corp-HQ cross-reference (populate_atlas_city_names_corps, tooling/economy-db/economy_import/atlas.py) it inserts one atlas_city_names row per corp HQ, creating duplicate co-named cities (e.g. 10 Groombridge rows on GJ380c).
2. Author a source-canonical specialization -> HQ-placement map ({CityTenant, Standalone}). corp_type is degenerate (corporation/combine only); key on corporations.specialization (and/or supply_chain_role). Install-baked.
3. CityTenant HQs: a corp->city link, no new settlement (many corps may tenant one city).
4. Standalone HQs (extraction/heavy-industry/shipyards): emit their own settlement (body + position) into the cascade settlement list. Requires resolving headquarters_body (today 0/165 set; only headquarters_system + a most-populated-body heuristic).
5. Cascade settlement input becomes: city pool + standalone-HQ settlements, merged.
Amends D-207, D-223. Blocks the road-graph hub refinement.', 'Per D-242. Corp HQs are not cities and must leave atlas_city_names.
1. Remove the D-207/D-223 reserved=1 corp-HQ cross-reference (populate_atlas_city_names_corps, tooling/economy-db/economy_import/atlas.py) it inserts one atlas_city_names row per corp HQ, creating duplicate co-named cities (e.g. 10 Groombridge rows on GJ380c).
2. Author a source-canonical specialization -> HQ-placement map ({CityTenant, Standalone}). corp_type is degenerate (corporation/combine only); key on corporations.specialization (and/or supply_chain_role). Install-baked.
3. CityTenant HQs: a corp->city link, no new settlement (many corps may tenant one city).
4. Standalone HQs (extraction/heavy-industry/shipyards): emit their own settlement (body + position) into the cascade settlement list. Requires resolving headquarters_body (today 0/165 set; only headquarters_system + a most-populated-body heuristic).
5. Cascade settlement input becomes: city pool + standalone-HQ settlements, merged.
Amends D-207, D-223. Blocks the road-graph hub refinement.
---
Refinement (2026-07-16, /whats-next Si review + gap resolution):
1. Specialization key-space (gap): corporations.specialization is unconstrained free text 20/165 rows hand-seeded prose via the ORPHANED tooling/populate-corporations.sh (raw sqlite3 INSERTs, single commit e05444f70, not in the Makefile or generator_sources.py; nothing in import_economics writes the column). supply_chain_role is 100% NULL, never wired. RESOLUTION: author a corp_specialization controlled vocabulary + source-canonical TOML (mirror the D-237 wiki/economics/specialization_vocabulary.toml pattern), backfill all 165 corps, and key the {CityTenant, Standalone} placement map on it all in this ticket. Retire/supersede the orphaned populate-corporations.sh as part of the cleanup (hand-seeded DB values violate the source-canonical rule).
2. headquarters_body resolution (gap): RESOLUTION explicitly reuse the most-populated-body-in-system heuristic from populate_atlas_city_names_corps (tooling/economy-db/economy_import/atlas.py:229-233) at import/bake time to backfill headquarters_body for Standalone HQs. Deterministic, install-baked.
Si verification notes: all 30 duplicate-name groups in atlas_city_names are 100% reserved=1 rows (zero duplicates among reserved=0) removal is cleanly scoped. corp_type confirmed degenerate (158 corporation / 7 combine). Consumption side has zero corp/Standalone/Tenant scaffolding: the merge point is greenfield, natural seam is read_body_settlements (server/src/atlas/city_context_reader.rs:268) feeding match_cities (server/src/atlas/attractor_matching.rs).', NULL, '2026-07-16 07:03:52', '2026-07-16 07:03:52.010', '2026-07-16 07:03:52.010', NULL, '706219100a3778e1bb684e56f261852b', 2) ON CONFLICT(hash) DO NOTHING;
INSERT INTO ticket_history (ticket_record_id, field, old_value, new_value, changed_by, changed_at, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FCDG73S4ET8KKTK62Z5KFEQM', 'description', 'Per D-242. population + settlement_class are install-baked, not seed-derived.
Today: body-level population is baked (273/3240 bodies > 0), but per-city population is 0 and settlement_class NULL for all 463 atlas_city_names rows. D-223 deferred these ''to placement (T-955)'', but match_cities only READS them for tiering nothing assigns them, so the pop-from-seed step was never built and all cities fall to synthetic placement.
Bake the per-settlement population spread + settlement_class into the source data (importer/source TOMLs). Only POSITION stays seed-derived (D-211). Drop the never-built seed-population idea.
Supersedes the D-223 deferred-pop/class note. Enables significance-ranked hub selection.', 'Per D-242. population + settlement_class are install-baked, not seed-derived.
Today: body-level population is baked (273/3240 bodies > 0), but per-city population is 0 and settlement_class NULL for all 463 atlas_city_names rows. D-223 deferred these ''to placement (T-955)'', but match_cities only READS them for tiering nothing assigns them, so the pop-from-seed step was never built and all cities fall to synthetic placement.
Bake the per-settlement population spread + settlement_class into the source data (importer/source TOMLs). Only POSITION stays seed-derived (D-211). Drop the never-built seed-population idea.
Supersedes the D-223 deferred-pop/class note. Enables significance-ranked hub selection.
---
Refinement (2026-07-16, /whats-next Si review + gap resolution):
1. Population source (gap): RESOLUTION pure importer derivation. import_economics computes the per-city population spread from the authored bodies.population on every regen-db run via a documented rank-size (Zipf-style) curve; no per-city population source file. Keep the curve constants named + documented in the importer tuning is a code change by design. Only POSITION stays seed-derived (D-211). Amend D-242''s "carried down into the city/settlement source data" wording while implementing, to record the derivation rule (derivation-at-import, not hand-authoring).
2. settlement_class assignment (gap): RESOLUTION default every pooled city to PopulationBudget; the D-196 thresholds (>=50k active / <5k ghost) decide state from the baked population. An authored NameLocked override list (small new source TOML) pins hero cities. EconomicTriggered and OrganicGrowth are simulation-time classes per D-196 out of bake scope.
Si verification notes: 463 atlas_city_names rows, all population=0 / settlement_class NULL claim exact. match_cities (server/src/atlas/attractor_matching.rs) only READS these fields for tiering; nothing assigns them. D-242/D-223/D-211/D-196 chain is consistent; no conflicting open Q-records. Importer entry point: populate_atlas_city_names (tooling/economy-db/economy_import/atlas.py:61-141).', NULL, '2026-07-16 07:03:59', '2026-07-16 07:03:59.490', '2026-07-16 07:03:59.490', NULL, 'c16f372b083f55eb7320bd4e69176176', 2) ON CONFLICT(hash) DO NOTHING;
INSERT INTO ticket_history (ticket_record_id, field, old_value, new_value, changed_by, changed_at, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FCDG73NW7SNCA5Y8JN905QMR', 'status', 'backlog', 'in_progress', NULL, '2026-07-16 07:04:05', '2026-07-16 07:04:05.817', '2026-07-16 07:04:05.817', NULL, '35123526cb22e5bb041d10a5101cc9c0', 2) ON CONFLICT(hash) DO NOTHING;
INSERT INTO ticket_history (ticket_record_id, field, old_value, new_value, changed_by, changed_at, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FCDG73S4ET8KKTK62Z5KFEQM', 'status', 'backlog', 'in_progress', NULL, '2026-07-16 07:04:05', '2026-07-16 07:04:05.825', '2026-07-16 07:04:05.825', NULL, 'f63fd497fc86304e59dba4e30630f1de', 2) ON CONFLICT(hash) DO NOTHING;
+68
View File
@@ -1510,3 +1510,71 @@ CURRENT READ INVENTORY (verified 2026-07-13):
3. OUT OF SCOPE (deliberate, D-225): reliefmap.png / wiki globe image loads stay client-side.
PROTOCOL PATTERN: structural disambiguation on the existing IPC stream (Inbound enum: Inputs vs AtlasRequest). Reach-level star-map data is not per-body/cascade-shaped add NEW request/response types (e.g. StarMapRequest StarMapResponse), do not shoehorn into AtlasLayerResponse. Per-body names ride the atlas path.', 'done', 'medium', NULL, 'client', NULL, '2026-05-03 14:14:23', '2026-07-14 16:03:22.075', NULL, '2bc4ee40e5c80f41fd705d1d3081995c', 2) ON CONFLICT(record_id) DO UPDATE SET type=excluded.type, parent_record_id=excluded.parent_record_id, title=excluded.title, description=excluded.description, status=excluded.status, priority=excluded.priority, assigned_to=excluded.assigned_to, team=excluded.team, decision_ref=excluded.decision_ref, updated_at=excluded.updated_at, deleted_at=excluded.deleted_at, hash=excluded.hash, canonical_version=excluded.canonical_version WHERE excluded.updated_at > tickets.updated_at OR (excluded.updated_at = tickets.updated_at AND excluded.hash > tickets.hash);
INSERT INTO tickets (record_id, type, parent_record_id, title, description, status, priority, assigned_to, team, decision_ref, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FCDG73NW7SNCA5Y8JN905QMR', 'story', '06FB0TNSRZXCHGS16BFHSSGSV4', 'Corp HQ settlement model — remove HQs from the city pool; specialization-keyed standalone-vs-tenant; install-baked', 'Per D-242. Corp HQs are not cities and must leave atlas_city_names.
1. Remove the D-207/D-223 reserved=1 corp-HQ cross-reference (populate_atlas_city_names_corps, tooling/economy-db/economy_import/atlas.py) it inserts one atlas_city_names row per corp HQ, creating duplicate co-named cities (e.g. 10 Groombridge rows on GJ380c).
2. Author a source-canonical specialization -> HQ-placement map ({CityTenant, Standalone}). corp_type is degenerate (corporation/combine only); key on corporations.specialization (and/or supply_chain_role). Install-baked.
3. CityTenant HQs: a corp->city link, no new settlement (many corps may tenant one city).
4. Standalone HQs (extraction/heavy-industry/shipyards): emit their own settlement (body + position) into the cascade settlement list. Requires resolving headquarters_body (today 0/165 set; only headquarters_system + a most-populated-body heuristic).
5. Cascade settlement input becomes: city pool + standalone-HQ settlements, merged.
Amends D-207, D-223. Blocks the road-graph hub refinement.
---
Refinement (2026-07-16, /whats-next Si review + gap resolution):
1. Specialization key-space (gap): corporations.specialization is unconstrained free text 20/165 rows hand-seeded prose via the ORPHANED tooling/populate-corporations.sh (raw sqlite3 INSERTs, single commit e05444f70, not in the Makefile or generator_sources.py; nothing in import_economics writes the column). supply_chain_role is 100% NULL, never wired. RESOLUTION: author a corp_specialization controlled vocabulary + source-canonical TOML (mirror the D-237 wiki/economics/specialization_vocabulary.toml pattern), backfill all 165 corps, and key the {CityTenant, Standalone} placement map on it all in this ticket. Retire/supersede the orphaned populate-corporations.sh as part of the cleanup (hand-seeded DB values violate the source-canonical rule).
2. headquarters_body resolution (gap): RESOLUTION explicitly reuse the most-populated-body-in-system heuristic from populate_atlas_city_names_corps (tooling/economy-db/economy_import/atlas.py:229-233) at import/bake time to backfill headquarters_body for Standalone HQs. Deterministic, install-baked.
Si verification notes: all 30 duplicate-name groups in atlas_city_names are 100% reserved=1 rows (zero duplicates among reserved=0) removal is cleanly scoped. corp_type confirmed degenerate (158 corporation / 7 combine). Consumption side has zero corp/Standalone/Tenant scaffolding: the merge point is greenfield, natural seam is read_body_settlements (server/src/atlas/city_context_reader.rs:268) feeding match_cities (server/src/atlas/attractor_matching.rs).', 'backlog', 'high', NULL, 'server', 'D-242', '2026-06-14 15:29:50', '2026-07-16 07:03:52.010', NULL, '03be4eea746c4a92aa89aae7b14635a1', 2) ON CONFLICT(record_id) DO UPDATE SET type=excluded.type, parent_record_id=excluded.parent_record_id, title=excluded.title, description=excluded.description, status=excluded.status, priority=excluded.priority, assigned_to=excluded.assigned_to, team=excluded.team, decision_ref=excluded.decision_ref, updated_at=excluded.updated_at, deleted_at=excluded.deleted_at, hash=excluded.hash, canonical_version=excluded.canonical_version WHERE excluded.updated_at > tickets.updated_at OR (excluded.updated_at = tickets.updated_at AND excluded.hash > tickets.hash);
INSERT INTO tickets (record_id, type, parent_record_id, title, description, status, priority, assigned_to, team, decision_ref, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FCDG73S4ET8KKTK62Z5KFEQM', 'story', '06FB0TNSRZXCHGS16BFHSSGSV4', 'Bake per-settlement population + settlement_class into the install dataset (only position stays seed-derived)', 'Per D-242. population + settlement_class are install-baked, not seed-derived.
Today: body-level population is baked (273/3240 bodies > 0), but per-city population is 0 and settlement_class NULL for all 463 atlas_city_names rows. D-223 deferred these ''to placement (T-955)'', but match_cities only READS them for tiering nothing assigns them, so the pop-from-seed step was never built and all cities fall to synthetic placement.
Bake the per-settlement population spread + settlement_class into the source data (importer/source TOMLs). Only POSITION stays seed-derived (D-211). Drop the never-built seed-population idea.
Supersedes the D-223 deferred-pop/class note. Enables significance-ranked hub selection.
---
Refinement (2026-07-16, /whats-next Si review + gap resolution):
1. Population source (gap): RESOLUTION pure importer derivation. import_economics computes the per-city population spread from the authored bodies.population on every regen-db run via a documented rank-size (Zipf-style) curve; no per-city population source file. Keep the curve constants named + documented in the importer tuning is a code change by design. Only POSITION stays seed-derived (D-211). Amend D-242''s "carried down into the city/settlement source data" wording while implementing, to record the derivation rule (derivation-at-import, not hand-authoring).
2. settlement_class assignment (gap): RESOLUTION default every pooled city to PopulationBudget; the D-196 thresholds (>=50k active / <5k ghost) decide state from the baked population. An authored NameLocked override list (small new source TOML) pins hero cities. EconomicTriggered and OrganicGrowth are simulation-time classes per D-196 out of bake scope.
Si verification notes: 463 atlas_city_names rows, all population=0 / settlement_class NULL claim exact. match_cities (server/src/atlas/attractor_matching.rs) only READS these fields for tiering; nothing assigns them. D-242/D-223/D-211/D-196 chain is consistent; no conflicting open Q-records. Importer entry point: populate_atlas_city_names (tooling/economy-db/economy_import/atlas.py:61-141).', 'backlog', 'high', NULL, 'server', 'D-242', '2026-06-14 15:29:50', '2026-07-16 07:03:59.490', NULL, '206469dde5fea12542027c54be683226', 2) ON CONFLICT(record_id) DO UPDATE SET type=excluded.type, parent_record_id=excluded.parent_record_id, title=excluded.title, description=excluded.description, status=excluded.status, priority=excluded.priority, assigned_to=excluded.assigned_to, team=excluded.team, decision_ref=excluded.decision_ref, updated_at=excluded.updated_at, deleted_at=excluded.deleted_at, hash=excluded.hash, canonical_version=excluded.canonical_version WHERE excluded.updated_at > tickets.updated_at OR (excluded.updated_at = tickets.updated_at AND excluded.hash > tickets.hash);
INSERT INTO tickets (record_id, type, parent_record_id, title, description, status, priority, assigned_to, team, decision_ref, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FCDG73NW7SNCA5Y8JN905QMR', 'story', '06FB0TNSRZXCHGS16BFHSSGSV4', 'Corp HQ settlement model — remove HQs from the city pool; specialization-keyed standalone-vs-tenant; install-baked', 'Per D-242. Corp HQs are not cities and must leave atlas_city_names.
1. Remove the D-207/D-223 reserved=1 corp-HQ cross-reference (populate_atlas_city_names_corps, tooling/economy-db/economy_import/atlas.py) it inserts one atlas_city_names row per corp HQ, creating duplicate co-named cities (e.g. 10 Groombridge rows on GJ380c).
2. Author a source-canonical specialization -> HQ-placement map ({CityTenant, Standalone}). corp_type is degenerate (corporation/combine only); key on corporations.specialization (and/or supply_chain_role). Install-baked.
3. CityTenant HQs: a corp->city link, no new settlement (many corps may tenant one city).
4. Standalone HQs (extraction/heavy-industry/shipyards): emit their own settlement (body + position) into the cascade settlement list. Requires resolving headquarters_body (today 0/165 set; only headquarters_system + a most-populated-body heuristic).
5. Cascade settlement input becomes: city pool + standalone-HQ settlements, merged.
Amends D-207, D-223. Blocks the road-graph hub refinement.
---
Refinement (2026-07-16, /whats-next Si review + gap resolution):
1. Specialization key-space (gap): corporations.specialization is unconstrained free text 20/165 rows hand-seeded prose via the ORPHANED tooling/populate-corporations.sh (raw sqlite3 INSERTs, single commit e05444f70, not in the Makefile or generator_sources.py; nothing in import_economics writes the column). supply_chain_role is 100% NULL, never wired. RESOLUTION: author a corp_specialization controlled vocabulary + source-canonical TOML (mirror the D-237 wiki/economics/specialization_vocabulary.toml pattern), backfill all 165 corps, and key the {CityTenant, Standalone} placement map on it all in this ticket. Retire/supersede the orphaned populate-corporations.sh as part of the cleanup (hand-seeded DB values violate the source-canonical rule).
2. headquarters_body resolution (gap): RESOLUTION explicitly reuse the most-populated-body-in-system heuristic from populate_atlas_city_names_corps (tooling/economy-db/economy_import/atlas.py:229-233) at import/bake time to backfill headquarters_body for Standalone HQs. Deterministic, install-baked.
Si verification notes: all 30 duplicate-name groups in atlas_city_names are 100% reserved=1 rows (zero duplicates among reserved=0) removal is cleanly scoped. corp_type confirmed degenerate (158 corporation / 7 combine). Consumption side has zero corp/Standalone/Tenant scaffolding: the merge point is greenfield, natural seam is read_body_settlements (server/src/atlas/city_context_reader.rs:268) feeding match_cities (server/src/atlas/attractor_matching.rs).', 'in_progress', 'high', NULL, 'server', 'D-242', '2026-06-14 15:29:50', '2026-07-16 07:04:05.817', NULL, 'a72fe7f08d9e3b0b3231d654d5693fc0', 2) ON CONFLICT(record_id) DO UPDATE SET type=excluded.type, parent_record_id=excluded.parent_record_id, title=excluded.title, description=excluded.description, status=excluded.status, priority=excluded.priority, assigned_to=excluded.assigned_to, team=excluded.team, decision_ref=excluded.decision_ref, updated_at=excluded.updated_at, deleted_at=excluded.deleted_at, hash=excluded.hash, canonical_version=excluded.canonical_version WHERE excluded.updated_at > tickets.updated_at OR (excluded.updated_at = tickets.updated_at AND excluded.hash > tickets.hash);
INSERT INTO tickets (record_id, type, parent_record_id, title, description, status, priority, assigned_to, team, decision_ref, created_at, updated_at, deleted_at, hash, canonical_version) VALUES ('06FCDG73S4ET8KKTK62Z5KFEQM', 'story', '06FB0TNSRZXCHGS16BFHSSGSV4', 'Bake per-settlement population + settlement_class into the install dataset (only position stays seed-derived)', 'Per D-242. population + settlement_class are install-baked, not seed-derived.
Today: body-level population is baked (273/3240 bodies > 0), but per-city population is 0 and settlement_class NULL for all 463 atlas_city_names rows. D-223 deferred these ''to placement (T-955)'', but match_cities only READS them for tiering nothing assigns them, so the pop-from-seed step was never built and all cities fall to synthetic placement.
Bake the per-settlement population spread + settlement_class into the source data (importer/source TOMLs). Only POSITION stays seed-derived (D-211). Drop the never-built seed-population idea.
Supersedes the D-223 deferred-pop/class note. Enables significance-ranked hub selection.
---
Refinement (2026-07-16, /whats-next Si review + gap resolution):
1. Population source (gap): RESOLUTION pure importer derivation. import_economics computes the per-city population spread from the authored bodies.population on every regen-db run via a documented rank-size (Zipf-style) curve; no per-city population source file. Keep the curve constants named + documented in the importer tuning is a code change by design. Only POSITION stays seed-derived (D-211). Amend D-242''s "carried down into the city/settlement source data" wording while implementing, to record the derivation rule (derivation-at-import, not hand-authoring).
2. settlement_class assignment (gap): RESOLUTION default every pooled city to PopulationBudget; the D-196 thresholds (>=50k active / <5k ghost) decide state from the baked population. An authored NameLocked override list (small new source TOML) pins hero cities. EconomicTriggered and OrganicGrowth are simulation-time classes per D-196 out of bake scope.
Si verification notes: 463 atlas_city_names rows, all population=0 / settlement_class NULL claim exact. match_cities (server/src/atlas/attractor_matching.rs) only READS these fields for tiering; nothing assigns them. D-242/D-223/D-211/D-196 chain is consistent; no conflicting open Q-records. Importer entry point: populate_atlas_city_names (tooling/economy-db/economy_import/atlas.py:61-141).', 'in_progress', 'high', NULL, 'server', 'D-242', '2026-06-14 15:29:50', '2026-07-16 07:04:05.825', NULL, '9c034b37c1de54fe0049e6c37769aa66', 2) ON CONFLICT(record_id) DO UPDATE SET type=excluded.type, parent_record_id=excluded.parent_record_id, title=excluded.title, description=excluded.description, status=excluded.status, priority=excluded.priority, assigned_to=excluded.assigned_to, team=excluded.team, decision_ref=excluded.decision_ref, updated_at=excluded.updated_at, deleted_at=excluded.deleted_at, hash=excluded.hash, canonical_version=excluded.canonical_version WHERE excluded.updated_at > tickets.updated_at OR (excluded.updated_at = tickets.updated_at AND excluded.hash > tickets.hash);