|
|
|
@@ -2127,3 +2127,95 @@ tooling/economy-db/import_economics.py (2,617 lines, 31 top-level defs) owns sch
|
|
|
|
|
Fix: extract one shared tooling/generator_sources.py imported by the script + stamp checker and read by /pr-push; then split importers/validators into modules under tooling/economy-db/; finish type hints during the split. Also fold in S-25''s connector dedup: move CONFIG_PATH/load_config/get_base_url into tooling/db/common.py (currently copy-pasted across audio/trellis/image connectors).
|
|
|
|
|
|
|
|
|
|
Closed 2026-06-12, commits 4f73624ef + 3c3fd0d0d (DB stamp regen). import_economics.py 2,620→309 (thin orchestrator, exact CLI/transaction/exit-code contract); 13 modules under tooling/economy-db/economy_import/; tooling/generator_sources.py is the single registry (self-stamping, fail-closed module globbing) consumed by the importer, check-systems-db-stamp, and the pr-process watch list via --list. Connector config helpers centralized in tooling/db/common.py. Byte-identical proof: empty full-import dump diff (107,843 lines / 37 tables), dry-run parity, brands TOML sha unchanged. Gate green incl. test-tooling + stamp check on the regenerated DB.', 'done', 'medium', NULL, NULL, NULL, '2026-06-12 10:40:59', '2026-06-12 18:15:04', NULL, 'e41a21e215fc14cfd3471d1a7d01a960', 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 ('06FBPQ02F02JDDBSFMGPX0XASR', 'story', '06FB0TNSRZXCHGS16BFHSSGSV4', 'Layer 2 — inter-settlement road/rail graph (MST + A* over terrain cost, MaintenanceAuthority, named-route identity)', 'Workshopped-but-unticketed cascade work captured 2026-06-12 (cascade-refocus grounding pass). Full grounded scope follows.
|
|
|
|
|
|
|
|
|
|
Generate the inter-settlement road/rail graph at Layer 2 — the workshopped-but-never-ticketed link between settlement placement (T-955/T-956, done) and everything that consumes transport topology. No road code exists today (zero RoadGraph/road_segment hits in server/src; TerritorialStatus shipped without its road-coverage inputs).
|
|
|
|
|
|
|
|
|
|
Scope (algorithm fully decided, docs/workshops/planet-down-cascade/tyre-round1.md:274-299):
|
|
|
|
|
1. MST force-connect all CityPlacements (Euclidean), then secondary direct links for city pairs within 30-60% of body scale whose MST path exceeds 1.5x Euclidean.
|
|
|
|
|
2. Route each edge with A* over the L1 terrain-cost field (terrain_modification_cost, D-210, server/src/atlas/subbiome.rs; cost spec: water impassable, roughness>0.7 = 10.0, river corridor = 0.5, flat = 1.0 — rivers as preferred valley routes). Budget ~30ms/body (round-1-notes.md:348).
|
|
|
|
|
3. Assign MaintenanceAuthority per edge from endpoint relationships (5-value enum Administrative/Corporate/Communal/Trade/Abandoned — generation-cascade/workshop-outcomes.md:177, resolution :257; player-readable in road condition per ozzie-round1.md:86-92).
|
|
|
|
|
4. Place waypoint sub-settlement nodes at midpoints of edges > ~12 regional cells (tyre-round1.md:267-272).
|
|
|
|
|
5. Named-route identity assignment: post-generation join of generated edges to systems.db named highway routes via optional named_route_id FK (paula-round1.md:107,:140; round-1-notes.md:322 L2-Q3 resolution under Amendment 3).
|
|
|
|
|
6. RailHeadFacing second pass: settlements at high-connectivity road/rail junctions get FoundingOrientation::RailHeadFacing, overriding AdminFacing-from-Synthetic (paula-round3.md:218-236) — wire into attractor_matching.rs.
|
|
|
|
|
|
|
|
|
|
Storage: RoadGraph{nodes,edges} on BodyWorldState (round-1-notes.md:257-267), session-cached, never serialized — runtime Rust, not systems.db (the atlas_road_nodes/atlas_road_edges schema shape carries forward per tyre-round1.md:42 but lives in session memory).
|
|
|
|
|
|
|
|
|
|
Downstream consumers (do NOT scope in, but design the output for them): road_entry_directions per city (see road-entry-octants ticket; generation-cascade/round-3-notes.md:104), TerritorialStatus quantitative road-coverage thresholds (round-1-notes.md:329-338), per-economic_role hinterland fill (round-1-notes.md:324-327, BRIEF.md:279), prosperity/atlas overlays.
|
|
|
|
|
|
|
|
|
|
Cascade-first fit: this is direction step (2) — the econ layer drawn onto the world between settlements. Parent: T-750. Suggested deps: blocks the road-entry-octants ticket; references D-205 (provinces), D-210, D-211, D-212, D-213.', 'in_progress', 'high', NULL, 'server', 'D-211', '2026-06-12 10:23:49', '2026-06-13 20:44:09', NULL, 'e178b187eaa605cf4d6edccf77304487', 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 ('06FBPQ02F02JDDBSFMGPX0XASR', 'story', '06FB0TNSRZXCHGS16BFHSSGSV4', 'Layer 2 — inter-settlement road/rail graph (MST + A* over terrain cost, MaintenanceAuthority, named-route identity)', 'Workshopped-but-unticketed cascade work captured 2026-06-12 (cascade-refocus grounding pass). Full grounded scope follows.
|
|
|
|
|
|
|
|
|
|
Generate the inter-settlement road/rail graph at Layer 2 — the workshopped-but-never-ticketed link between settlement placement (T-955/T-956, done) and everything that consumes transport topology. No road code exists today (zero RoadGraph/road_segment hits in server/src; TerritorialStatus shipped without its road-coverage inputs).
|
|
|
|
|
|
|
|
|
|
Scope (algorithm fully decided, docs/workshops/planet-down-cascade/tyre-round1.md:274-299):
|
|
|
|
|
1. MST force-connect all CityPlacements (Euclidean), then secondary direct links for city pairs within 30-60% of body scale whose MST path exceeds 1.5x Euclidean.
|
|
|
|
|
2. Route each edge with A* over the L1 terrain-cost field (terrain_modification_cost, D-210, server/src/atlas/subbiome.rs; cost spec: water impassable, roughness>0.7 = 10.0, river corridor = 0.5, flat = 1.0 — rivers as preferred valley routes). Budget ~30ms/body (round-1-notes.md:348).
|
|
|
|
|
3. Assign MaintenanceAuthority per edge from endpoint relationships (5-value enum Administrative/Corporate/Communal/Trade/Abandoned — generation-cascade/workshop-outcomes.md:177, resolution :257; player-readable in road condition per ozzie-round1.md:86-92).
|
|
|
|
|
4. Place waypoint sub-settlement nodes at midpoints of edges > ~12 regional cells (tyre-round1.md:267-272).
|
|
|
|
|
5. Named-route identity assignment: post-generation join of generated edges to systems.db named highway routes via optional named_route_id FK (paula-round1.md:107,:140; round-1-notes.md:322 L2-Q3 resolution under Amendment 3).
|
|
|
|
|
6. RailHeadFacing second pass: settlements at high-connectivity road/rail junctions get FoundingOrientation::RailHeadFacing, overriding AdminFacing-from-Synthetic (paula-round3.md:218-236) — wire into attractor_matching.rs.
|
|
|
|
|
|
|
|
|
|
Storage: RoadGraph{nodes,edges} on BodyWorldState (round-1-notes.md:257-267), session-cached, never serialized — runtime Rust, not systems.db (the atlas_road_nodes/atlas_road_edges schema shape carries forward per tyre-round1.md:42 but lives in session memory).
|
|
|
|
|
|
|
|
|
|
Downstream consumers (do NOT scope in, but design the output for them): road_entry_directions per city (see road-entry-octants ticket; generation-cascade/round-3-notes.md:104), TerritorialStatus quantitative road-coverage thresholds (round-1-notes.md:329-338), per-economic_role hinterland fill (round-1-notes.md:324-327, BRIEF.md:279), prosperity/atlas overlays.
|
|
|
|
|
|
|
|
|
|
Cascade-first fit: this is direction step (2) — the econ layer drawn onto the world between settlements. Parent: T-750. Suggested deps: blocks the road-entry-octants ticket; references D-205 (provinces), D-210, D-211, D-212, D-213.', 'in_progress', 'high', NULL, 'server', 'D-211', '2026-06-12 10:23:49', '2026-06-13 20:44:30', NULL, '591936c6e539ddf25905176ce059b676', 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.', 'backlog', 'high', NULL, 'server', 'D-242', '2026-06-14 15:29:50', '2026-06-14 15:29:50', NULL, '9176515b9f67459f2dcee6c58de1e0fa', 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.', 'backlog', 'high', NULL, 'server', 'D-242', '2026-06-14 15:29:50', '2026-06-14 15:29:50', NULL, 'a3e992272c50209fb1dfffbcfe6ea28c', 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 ('06FCDG73V9R6N024QSFDEJ4R68', 'story', '06FB0TNSRZXCHGS16BFHSSGSV4', 'Road-graph hub refinement — scaled-cap hubs + co-location collapse + hybrid minor attach + RailHeadFacing junction pass', 'Follow-on to T-1038 (road-graph core shipped). Hub-selection refinement, gated on the resolved settlement model (D-242).
|
|
|
|
|
|
|
|
|
|
Build on server/src/atlas/road_graph.rs:
|
|
|
|
|
1. Hub selection: ''real cities, scaled cap'' — wiki cities anchor the MST; cap scales with body size; standalone HQs/minor settlements are non-hub.
|
|
|
|
|
2. Co-location collapse: group same-named settlements (defensive; the D-242 corp-HQ fix removes most at source).
|
|
|
|
|
3. Hybrid minor-settlement attach: snap to nearest existing road edge if close, else spur to nearest hub (add edge-split-at-attach).
|
|
|
|
|
4. RailHeadFacing junction pass (T-1038 step 6, deferred): junction settlements (RoadGraph::high_connectivity_junctions already computed) get FoundingOrientation::RailHeadFacing. REQUIRES a D-213 amendment (adopted enum has no RailHeadFacing) + Layer-4 skeleton_gen handling.
|
|
|
|
|
|
|
|
|
|
Needs population ranking — blocked on the corp-HQ-model + population-bake tickets.', 'backlog', 'medium', NULL, 'server', 'D-242', '2026-06-14 15:29:50', '2026-06-14 15:29:50', NULL, 'a9b2ff68ee5d9208cffb0a1ebe63bbe2', 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 ('06FBPQ02F02JDDBSFMGPX0XASR', 'story', '06FB0TNSRZXCHGS16BFHSSGSV4', 'Layer 2 — inter-settlement road/rail graph (MST + A* over terrain cost, MaintenanceAuthority, named-route identity)', 'Workshopped-but-unticketed cascade work captured 2026-06-12 (cascade-refocus grounding pass). Full grounded scope follows.
|
|
|
|
|
|
|
|
|
|
Generate the inter-settlement road/rail graph at Layer 2 — the workshopped-but-never-ticketed link between settlement placement (T-955/T-956, done) and everything that consumes transport topology. No road code exists today (zero RoadGraph/road_segment hits in server/src; TerritorialStatus shipped without its road-coverage inputs).
|
|
|
|
|
|
|
|
|
|
Scope (algorithm fully decided, docs/workshops/planet-down-cascade/tyre-round1.md:274-299):
|
|
|
|
|
1. MST force-connect all CityPlacements (Euclidean), then secondary direct links for city pairs within 30-60% of body scale whose MST path exceeds 1.5x Euclidean.
|
|
|
|
|
2. Route each edge with A* over the L1 terrain-cost field (terrain_modification_cost, D-210, server/src/atlas/subbiome.rs; cost spec: water impassable, roughness>0.7 = 10.0, river corridor = 0.5, flat = 1.0 — rivers as preferred valley routes). Budget ~30ms/body (round-1-notes.md:348).
|
|
|
|
|
3. Assign MaintenanceAuthority per edge from endpoint relationships (5-value enum Administrative/Corporate/Communal/Trade/Abandoned — generation-cascade/workshop-outcomes.md:177, resolution :257; player-readable in road condition per ozzie-round1.md:86-92).
|
|
|
|
|
4. Place waypoint sub-settlement nodes at midpoints of edges > ~12 regional cells (tyre-round1.md:267-272).
|
|
|
|
|
5. Named-route identity assignment: post-generation join of generated edges to systems.db named highway routes via optional named_route_id FK (paula-round1.md:107,:140; round-1-notes.md:322 L2-Q3 resolution under Amendment 3).
|
|
|
|
|
6. RailHeadFacing second pass: settlements at high-connectivity road/rail junctions get FoundingOrientation::RailHeadFacing, overriding AdminFacing-from-Synthetic (paula-round3.md:218-236) — wire into attractor_matching.rs.
|
|
|
|
|
|
|
|
|
|
Storage: RoadGraph{nodes,edges} on BodyWorldState (round-1-notes.md:257-267), session-cached, never serialized — runtime Rust, not systems.db (the atlas_road_nodes/atlas_road_edges schema shape carries forward per tyre-round1.md:42 but lives in session memory).
|
|
|
|
|
|
|
|
|
|
Downstream consumers (do NOT scope in, but design the output for them): road_entry_directions per city (see road-entry-octants ticket; generation-cascade/round-3-notes.md:104), TerritorialStatus quantitative road-coverage thresholds (round-1-notes.md:329-338), per-economic_role hinterland fill (round-1-notes.md:324-327, BRIEF.md:279), prosperity/atlas overlays.
|
|
|
|
|
|
|
|
|
|
Cascade-first fit: this is direction step (2) — the econ layer drawn onto the world between settlements. Parent: T-750. Suggested deps: blocks the road-entry-octants ticket; references D-205 (provinces), D-210, D-211, D-212, D-213.
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
Implementation (2026-06-14):
|
|
|
|
|
SHIPPED — deterministic road-graph CORE in server/src/atlas/road_graph.rs (CascadeLayer::RoadGraph, stored on BodyWorldState.road_graph, never serialized):
|
|
|
|
|
1. MST force-connect (strict Kruskal over dist^2) + secondary links (30-60% body-scale band, >1.5x MST detour).
|
|
|
|
|
2. A* over the L1 terrain-cost field (ocean/lake impassable, river 1/2 cost, slope>=35deg 10x, else D-210 terrain_modification_cost) on a coarse 64-wide routing grid; equirectangular column wrap.
|
|
|
|
|
3. MaintenanceAuthority per edge (new generator.rs enum: Administrative/Corporate/Communal/Trade/Abandoned) from endpoint political archetypes + haul length.
|
|
|
|
|
4. Waypoint nodes at midpoints of edges > 12 routing cells.
|
|
|
|
|
5. Named-route identity join (named_route_id, designed-for; pool empty post-D-223 -> no-op).
|
|
|
|
|
+ junction detection (RoadGraph::high_connectivity_junctions, degree>=3).
|
|
|
|
|
Wired into the cascade (gen_queue requests CascadeLayer::RoadGraph) + BodyWorldState. 10 road_graph unit tests + a cascade e2e test; full lib suite green.
|
|
|
|
|
|
|
|
|
|
DEFERRED (-> T-1076, gated on the D-242 settlement model T-1074/T-1075):
|
|
|
|
|
- step 6 RailHeadFacing second pass — the adopted FoundingOrientation enum (D-213) has no RailHeadFacing; needs a D-213 amendment + Layer-4 skeleton_gen handling. Junction data is already exposed for it.
|
|
|
|
|
- hub-selection refinement (scaled-cap hubs, co-location collapse, hybrid minor-settlement attach) — needs baked population/specialization (D-242).
|
|
|
|
|
Decision D-242 filed (corp-HQ settlement model) — resolves why corp HQs were polluting the city pool as duplicate settlements.', 'in_progress', 'high', NULL, 'server', 'D-211', '2026-06-12 10:23:49', '2026-06-14 15:30:58', NULL, '55c0e158089122497cf34e9574595d50', 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);
|
|
|
|
|