diff --git a/docs/atlas/proposals/GJ144.json b/docs/atlas/proposals/GJ144.json new file mode 100644 index 000000000..e486dc5cb --- /dev/null +++ b/docs/atlas/proposals/GJ144.json @@ -0,0 +1,280 @@ +{ + "system_id": "GJ 144", + "proper_name": "Ran", + "star_type": "K", + "spectral_class": "K2V", + "wiki_data": { + "habitable_count": 2, + "inhabited_count": 2, + "has_gas_giant": true, + "has_asteroid_belt": true, + "has_horizon_station": true, + "raw_bodies_line": "| **Bodies** | 2 habitable · 2 inhabited |" + }, + "bodies": [ + { + "body_id": "GJ144b", + "proper_name": null, + "body_type": "planet", + "orbit_index": 1, + "parent_body_id": null, + "inhabited": false, + "population": 0, + "mass_class": "terrestrial", + "surface_gravity": 0.32, + "orbital_period_days": 30, + "rotation_period_hours": 720, + "atmosphere": "none", + "biome_summary": "barren", + "hydrosphere": "none", + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "inner scorched" + }, + { + "body_id": "GJ144c", + "proper_name": null, + "body_type": "planet", + "orbit_index": 2, + "parent_body_id": null, + "inhabited": false, + "population": 0, + "mass_class": "terrestrial", + "surface_gravity": 0.55, + "orbital_period_days": 110, + "rotation_period_hours": 2800, + "atmosphere": "toxic", + "biome_summary": "barren", + "hydrosphere": "none", + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "dense atmosphere, Venus-analog" + }, + { + "body_id": "GJ144d", + "proper_name": "Kallast", + "body_type": "planet", + "orbit_index": 3, + "parent_body_id": null, + "inhabited": true, + "population": 2000000000, + "mass_class": "terrestrial", + "surface_gravity": 0.95, + "orbital_period_days": 280, + "rotation_period_hours": 23.5, + "atmosphere": "breathable", + "biome_summary": "temperate", + "hydrosphere": "ocean", + "economic_role": "agricultural", + "settlement_pattern": "urban_concentrated", + "industrial_corridor": "Agricultural_Syndic", + "notes": "grain belt, irrigation channels visible from orbit" + }, + { + "body_id": "GJ144d-1", + "proper_name": null, + "body_type": "moon", + "orbit_index": 1, + "parent_body_id": "GJ144d", + "inhabited": false, + "population": 0, + "mass_class": "dwarf", + "surface_gravity": 0.08, + "orbital_period_days": 18.5, + "rotation_period_hours": 444, + "atmosphere": "none", + "biome_summary": "barren", + "hydrosphere": "none", + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "tidally locked" + }, + { + "body_id": "GJ144e", + "proper_name": "Vethis", + "body_type": "planet", + "orbit_index": 4, + "parent_body_id": null, + "inhabited": true, + "population": 1200000000, + "mass_class": "terrestrial", + "surface_gravity": 0.82, + "orbital_period_days": 480, + "rotation_period_hours": 26.8, + "atmosphere": "breathable", + "biome_summary": "temperate", + "hydrosphere": "ocean", + "economic_role": "agricultural", + "settlement_pattern": "dispersed_rural", + "industrial_corridor": "Agricultural_Syndic", + "notes": "cooler, aquaculture, specialty crops" + }, + { + "body_id": "GJ144e-1", + "proper_name": null, + "body_type": "moon", + "orbit_index": 1, + "parent_body_id": "GJ144e", + "inhabited": false, + "population": 0, + "mass_class": "dwarf", + "surface_gravity": 0.06, + "orbital_period_days": 12.3, + "rotation_period_hours": 295, + "atmosphere": "none", + "biome_summary": "barren", + "hydrosphere": "none", + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "" + }, + { + "body_id": "GJ144f", + "proper_name": null, + "body_type": "planet", + "orbit_index": 5, + "parent_body_id": null, + "inhabited": false, + "population": 0, + "mass_class": "terrestrial", + "surface_gravity": 0.40, + "orbital_period_days": 1200, + "rotation_period_hours": 18.0, + "atmosphere": "thin", + "biome_summary": "frozen", + "hydrosphere": "ice", + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "outer rocky" + }, + { + "body_id": "GJ144-belt", + "proper_name": null, + "body_type": "asteroid_belt", + "orbit_index": 6, + "parent_body_id": null, + "inhabited": false, + "population": 0, + "mass_class": null, + "surface_gravity": null, + "orbital_period_days": null, + "rotation_period_hours": null, + "atmosphere": null, + "biome_summary": null, + "hydrosphere": null, + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "debris disk (confirmed real)" + }, + { + "body_id": "GJ144g", + "proper_name": null, + "body_type": "gas_giant", + "orbit_index": 7, + "parent_body_id": null, + "inhabited": false, + "population": 0, + "mass_class": "gas_giant", + "surface_gravity": null, + "orbital_period_days": 2500, + "rotation_period_hours": 11.2, + "atmosphere": "dense", + "biome_summary": null, + "hydrosphere": null, + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "Epsilon Eridani b (confirmed Jupiter-mass)" + }, + { + "body_id": "GJ144g-1", + "proper_name": null, + "body_type": "moon", + "orbit_index": 1, + "parent_body_id": "GJ144g", + "inhabited": false, + "population": 0, + "mass_class": "dwarf", + "surface_gravity": 0.12, + "orbital_period_days": 4.0, + "rotation_period_hours": 96, + "atmosphere": "none", + "biome_summary": "barren", + "hydrosphere": "none", + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "" + }, + { + "body_id": "GJ144g-2", + "proper_name": null, + "body_type": "moon", + "orbit_index": 2, + "parent_body_id": "GJ144g", + "inhabited": false, + "population": 0, + "mass_class": "dwarf", + "surface_gravity": 0.08, + "orbital_period_days": 9.5, + "rotation_period_hours": 228, + "atmosphere": "none", + "biome_summary": "frozen", + "hydrosphere": "ice", + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "" + }, + { + "body_id": "GJ144-oort", + "proper_name": null, + "body_type": "oort_cloud", + "orbit_index": 8, + "parent_body_id": null, + "inhabited": false, + "population": 0, + "mass_class": null, + "surface_gravity": null, + "orbital_period_days": null, + "rotation_period_hours": null, + "atmosphere": null, + "biome_summary": null, + "hydrosphere": null, + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "" + } + ], + "stations": [ + { + "station_id": "GJ144d-S1", + "proper_name": "Kallast Freight Terminal", + "orbits_body_id": "GJ144d", + "station_type": "commercial", + "population": 5000000, + "economic_role": "agricultural", + "docking_class": "major", + "has_gate_infrastructure": false, + "notes": "bulk grain export hub" + }, + { + "station_id": "GJ144-oort-S1", + "proper_name": "Horizon Station", + "orbits_body_id": "GJ144-oort", + "station_type": "horizon", + "population": 0, + "economic_role": "transit", + "docking_class": "major", + "has_gate_infrastructure": true, + "notes": "" + } + ] +} diff --git a/docs/atlas/proposals/GJ244A.json b/docs/atlas/proposals/GJ244A.json new file mode 100644 index 000000000..cbb734677 --- /dev/null +++ b/docs/atlas/proposals/GJ244A.json @@ -0,0 +1,233 @@ +{ + "system_id": "GJ 244A", + "proper_name": "Sirius", + "star_type": "binary", + "spectral_class": "A1V + DA2", + "wiki_data": { + "habitable_count": 1, + "inhabited_count": 1, + "has_gas_giant": true, + "has_asteroid_belt": true, + "has_horizon_station": true, + "raw_bodies_line": "| **Bodies** | 1 habitable · 1 inhabited |" + }, + "bodies": [ + { + "body_id": "GJ244Ab", + "proper_name": null, + "body_type": "planet", + "orbit_index": 1, + "parent_body_id": null, + "inhabited": false, + "population": 0, + "mass_class": "terrestrial", + "surface_gravity": 0.25, + "orbital_period_days": 45, + "rotation_period_hours": 580, + "atmosphere": "none", + "biome_summary": "barren", + "hydrosphere": "none", + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "inner scorched, high UV" + }, + { + "body_id": "GJ244Ac", + "proper_name": null, + "body_type": "planet", + "orbit_index": 2, + "parent_body_id": null, + "inhabited": false, + "population": 0, + "mass_class": "terrestrial", + "surface_gravity": 0.70, + "orbital_period_days": 320, + "rotation_period_hours": 40, + "atmosphere": "toxic", + "biome_summary": "barren", + "hydrosphere": "none", + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "hot rocky" + }, + { + "body_id": "GJ244Ad", + "proper_name": "Edict", + "body_type": "planet", + "orbit_index": 3, + "parent_body_id": null, + "inhabited": true, + "population": 400000000, + "mass_class": "terrestrial", + "surface_gravity": 1.10, + "orbital_period_days": 1800, + "rotation_period_hours": 20.5, + "atmosphere": "breathable", + "biome_summary": "frozen", + "hydrosphere": "ice", + "economic_role": "service_mixed", + "settlement_pattern": "cave", + "industrial_corridor": null, + "notes": "marginal habitable, thick UV atmosphere, city mostly below-grade" + }, + { + "body_id": "GJ244Ae", + "proper_name": null, + "body_type": "gas_giant", + "orbit_index": 4, + "parent_body_id": null, + "inhabited": false, + "population": 0, + "mass_class": "gas_giant", + "surface_gravity": null, + "orbital_period_days": 4500, + "rotation_period_hours": 12.0, + "atmosphere": "dense", + "biome_summary": null, + "hydrosphere": null, + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "atmospheric gas extraction platforms" + }, + { + "body_id": "GJ244Ae-1", + "proper_name": null, + "body_type": "moon", + "orbit_index": 1, + "parent_body_id": "GJ244Ae", + "inhabited": false, + "population": 0, + "mass_class": "dwarf", + "surface_gravity": 0.10, + "orbital_period_days": 3.2, + "rotation_period_hours": 77, + "atmosphere": "none", + "biome_summary": "frozen", + "hydrosphere": "ice", + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "" + }, + { + "body_id": "GJ244Ae-2", + "proper_name": null, + "body_type": "moon", + "orbit_index": 2, + "parent_body_id": "GJ244Ae", + "inhabited": false, + "population": 0, + "mass_class": "dwarf", + "surface_gravity": 0.07, + "orbital_period_days": 8.0, + "rotation_period_hours": 192, + "atmosphere": "none", + "biome_summary": "barren", + "hydrosphere": "none", + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "" + }, + { + "body_id": "GJ244A-belt", + "proper_name": null, + "body_type": "asteroid_belt", + "orbit_index": 5, + "parent_body_id": null, + "inhabited": false, + "population": 0, + "mass_class": null, + "surface_gravity": null, + "orbital_period_days": null, + "rotation_period_hours": null, + "atmosphere": null, + "biome_summary": null, + "hydrosphere": null, + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "water ice source" + }, + { + "body_id": "GJ244A-oort", + "proper_name": null, + "body_type": "oort_cloud", + "orbit_index": 6, + "parent_body_id": null, + "inhabited": false, + "population": 0, + "mass_class": null, + "surface_gravity": null, + "orbital_period_days": null, + "rotation_period_hours": null, + "atmosphere": null, + "biome_summary": null, + "hydrosphere": null, + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "" + } + ], + "stations": [ + { + "station_id": "GJ244Ad-S1", + "proper_name": "Conclave", + "orbits_body_id": "GJ244Ad", + "station_type": "commercial", + "population": 50000, + "economic_role": "service_mixed", + "docking_class": "restricted", + "has_gate_infrastructure": false, + "notes": "Assembly facilities, institutional core" + }, + { + "station_id": "GJ244Ad-S2", + "proper_name": "Aperture", + "orbits_body_id": "GJ244Ad", + "station_type": "transit", + "population": 490000000, + "economic_role": "transit", + "docking_class": "major", + "has_gate_infrastructure": false, + "notes": "transit hub, docking" + }, + { + "station_id": "GJ244Ad-S3", + "proper_name": "Leverage", + "orbits_body_id": "GJ244Ad", + "station_type": "commercial", + "population": 300000000, + "economic_role": "service_mixed", + "docking_class": "major", + "has_gate_infrastructure": false, + "notes": "commercial, Syndic district" + }, + { + "station_id": "GJ244Ad-S4", + "proper_name": "Quorum", + "orbits_body_id": "GJ244Ad", + "station_type": "commercial", + "population": 1610000000, + "economic_role": "service_mixed", + "docking_class": "standard", + "has_gate_infrastructure": false, + "notes": "residential belt" + }, + { + "station_id": "GJ244A-oort-S1", + "proper_name": "Horizon Station", + "orbits_body_id": "GJ244A-oort", + "station_type": "horizon", + "population": 0, + "economic_role": "transit", + "docking_class": "major", + "has_gate_infrastructure": true, + "notes": "" + } + ] +} diff --git a/docs/atlas/proposals/GJ559B.json b/docs/atlas/proposals/GJ559B.json new file mode 100644 index 000000000..1948539b1 --- /dev/null +++ b/docs/atlas/proposals/GJ559B.json @@ -0,0 +1,140 @@ +{ + "system_id": "GJ 559B", + "proper_name": "ACB", + "star_type": "K", + "spectral_class": "K1V", + "wiki_data": { + "habitable_count": 1, + "inhabited_count": 2, + "has_gas_giant": false, + "has_asteroid_belt": false, + "has_horizon_station": true, + "raw_bodies_line": "| **Bodies** | 1 habitable · 2 inhabited |" + }, + "bodies": [ + { + "body_id": "GJ559Bb", + "proper_name": null, + "body_type": "planet", + "orbit_index": 1, + "parent_body_id": null, + "inhabited": false, + "population": 0, + "mass_class": "terrestrial", + "surface_gravity": 0.30, + "orbital_period_days": 40, + "rotation_period_hours": 900, + "atmosphere": "none", + "biome_summary": "barren", + "hydrosphere": "none", + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "inner rocky" + }, + { + "body_id": "GJ559Bc", + "proper_name": "Sede", + "body_type": "planet", + "orbit_index": 2, + "parent_body_id": null, + "inhabited": true, + "population": 750000000, + "mass_class": "terrestrial", + "surface_gravity": 0.91, + "orbital_period_days": 320, + "rotation_period_hours": 25.2, + "atmosphere": "breathable", + "biome_summary": "temperate", + "hydrosphere": "rivers", + "economic_role": "service_mixed", + "settlement_pattern": "urban_concentrated", + "industrial_corridor": null, + "notes": "Commission HQ, support economy" + }, + { + "body_id": "GJ559Bc-1", + "proper_name": null, + "body_type": "moon", + "orbit_index": 1, + "parent_body_id": "GJ559Bc", + "inhabited": false, + "population": 0, + "mass_class": "dwarf", + "surface_gravity": 0.05, + "orbital_period_days": 15.0, + "rotation_period_hours": 360, + "atmosphere": "none", + "biome_summary": "barren", + "hydrosphere": "none", + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "" + }, + { + "body_id": "GJ559Bd", + "proper_name": null, + "body_type": "planet", + "orbit_index": 3, + "parent_body_id": null, + "inhabited": false, + "population": 0, + "mass_class": "terrestrial", + "surface_gravity": 0.45, + "orbital_period_days": 800, + "rotation_period_hours": 19.0, + "atmosphere": "thin", + "biome_summary": "frozen", + "hydrosphere": "ice", + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "outer rocky" + }, + { + "body_id": "GJ559B-oort", + "proper_name": null, + "body_type": "oort_cloud", + "orbit_index": 4, + "parent_body_id": null, + "inhabited": false, + "population": 0, + "mass_class": null, + "surface_gravity": null, + "orbital_period_days": null, + "rotation_period_hours": null, + "atmosphere": null, + "biome_summary": null, + "hydrosphere": null, + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "" + } + ], + "stations": [ + { + "station_id": "GJ559Bc-S1", + "proper_name": "The Stack", + "orbits_body_id": "GJ559Bc", + "station_type": "commercial", + "population": 50000000, + "economic_role": "service_mixed", + "docking_class": "restricted", + "has_gate_infrastructure": false, + "notes": "Commission orbital archive complex, not publicly accessible" + }, + { + "station_id": "GJ559B-oort-S1", + "proper_name": "Horizon Station", + "orbits_body_id": "GJ559B-oort", + "station_type": "horizon", + "population": 0, + "economic_role": "transit", + "docking_class": "major", + "has_gate_infrastructure": true, + "notes": "" + } + ] +} diff --git a/docs/atlas/proposals/GJ725B.json b/docs/atlas/proposals/GJ725B.json new file mode 100644 index 000000000..242fa2a02 --- /dev/null +++ b/docs/atlas/proposals/GJ725B.json @@ -0,0 +1,189 @@ +{ + "system_id": "GJ 725B", + "proper_name": "Struve", + "star_type": "M", + "spectral_class": "K5", + "wiki_data": { + "habitable_count": 1, + "inhabited_count": 1, + "has_gas_giant": false, + "has_asteroid_belt": true, + "has_horizon_station": true, + "raw_bodies_line": "| **Bodies** | 1 habitable · 1 inhabited |" + }, + "bodies": [ + { + "body_id": "GJ725Bb", + "proper_name": null, + "body_type": "planet", + "orbit_index": 1, + "parent_body_id": null, + "inhabited": false, + "population": 0, + "mass_class": "terrestrial", + "surface_gravity": 0.28, + "orbital_period_days": 25, + "rotation_period_hours": 620, + "atmosphere": "none", + "biome_summary": "barren", + "hydrosphere": "none", + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "inner scorched" + }, + { + "body_id": "GJ725Bc", + "proper_name": "Rush", + "body_type": "planet", + "orbit_index": 2, + "parent_body_id": null, + "inhabited": true, + "population": 120000000, + "mass_class": "terrestrial", + "surface_gravity": 0.78, + "orbital_period_days": 250, + "rotation_period_hours": 28.4, + "atmosphere": "breathable", + "biome_summary": "temperate", + "hydrosphere": "rivers", + "economic_role": "extraction", + "settlement_pattern": "dispersed_rural", + "industrial_corridor": null, + "notes": "early colony, can't self-feed yet" + }, + { + "body_id": "GJ725Bc-1", + "proper_name": null, + "body_type": "moon", + "orbit_index": 1, + "parent_body_id": "GJ725Bc", + "inhabited": false, + "population": 0, + "mass_class": "dwarf", + "surface_gravity": 0.04, + "orbital_period_days": 10.5, + "rotation_period_hours": 252, + "atmosphere": "none", + "biome_summary": "barren", + "hydrosphere": "none", + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "" + }, + { + "body_id": "GJ725Bd", + "proper_name": null, + "body_type": "planet", + "orbit_index": 3, + "parent_body_id": null, + "inhabited": false, + "population": 0, + "mass_class": "terrestrial", + "surface_gravity": 0.42, + "orbital_period_days": 520, + "rotation_period_hours": 22.0, + "atmosphere": "thin", + "biome_summary": "arid", + "hydrosphere": "none", + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "Mars-analog" + }, + { + "body_id": "GJ725B-belt", + "proper_name": null, + "body_type": "asteroid_belt", + "orbit_index": 4, + "parent_body_id": null, + "inhabited": false, + "population": 0, + "mass_class": null, + "surface_gravity": null, + "orbital_period_days": null, + "rotation_period_hours": null, + "atmosphere": null, + "biome_summary": null, + "hydrosphere": null, + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "mineral wealth, extraction operations" + }, + { + "body_id": "GJ725Be", + "proper_name": null, + "body_type": "gas_giant", + "orbit_index": 5, + "parent_body_id": null, + "inhabited": false, + "population": 0, + "mass_class": "ice_giant", + "surface_gravity": null, + "orbital_period_days": 1800, + "rotation_period_hours": 14.5, + "atmosphere": "dense", + "biome_summary": null, + "hydrosphere": null, + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "small ice giant" + }, + { + "body_id": "GJ725Be-1", + "proper_name": null, + "body_type": "moon", + "orbit_index": 1, + "parent_body_id": "GJ725Be", + "inhabited": false, + "population": 0, + "mass_class": "dwarf", + "surface_gravity": 0.06, + "orbital_period_days": 5.0, + "rotation_period_hours": 120, + "atmosphere": "none", + "biome_summary": "frozen", + "hydrosphere": "ice", + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "" + }, + { + "body_id": "GJ725B-oort", + "proper_name": null, + "body_type": "oort_cloud", + "orbit_index": 6, + "parent_body_id": null, + "inhabited": false, + "population": 0, + "mass_class": null, + "surface_gravity": null, + "orbital_period_days": null, + "rotation_period_hours": null, + "atmosphere": null, + "biome_summary": null, + "hydrosphere": null, + "economic_role": null, + "settlement_pattern": null, + "industrial_corridor": null, + "notes": "" + } + ], + "stations": [ + { + "station_id": "GJ725B-oort-S1", + "proper_name": "Horizon Station", + "orbits_body_id": "GJ725B-oort", + "station_type": "horizon", + "population": 0, + "economic_role": "transit", + "docking_class": "major", + "has_gate_infrastructure": true, + "notes": "dormant 2nd aperture activated 40 years ago" + } + ] +} diff --git a/server/src/bin/atlas.rs b/server/src/bin/atlas.rs index afc1a14d6..751e07325 100644 --- a/server/src/bin/atlas.rs +++ b/server/src/bin/atlas.rs @@ -147,6 +147,11 @@ enum Commands { }, /// List systems that have no bodies yet Unfinished, + /// List unfinished systems at a specific hop distance (or next available hop) + Next { + /// Hop distance (omit to find the lowest hop with unfinished systems) + hop: Option, + }, /// Sync body/station data into wiki page for a system (or all systems) SyncWiki { /// System ID (omit for all systems with bodies) @@ -1187,6 +1192,51 @@ fn cmd_commit_system(conn: &Connection, path: &str) { }); } + // Update star_systems counts from the actual body data + let habitable_count: i32 = proposal + .bodies + .iter() + .filter(|b| { + b.atmosphere.as_deref() == Some("breathable") + && (b.body_type == "planet" || b.body_type == "moon") + }) + .count() as i32; + + let inhabited_count: i32 = proposal + .bodies + .iter() + .filter(|b| b.inhabited) + .count() as i32 + + proposal.stations.iter().filter(|s| { + s.population.unwrap_or(0) > 0 || s.station_type == "horizon" + }).count() as i32; + + let has_gas_giant: i32 = proposal + .bodies + .iter() + .any(|b| b.body_type == "gas_giant") + as i32; + + let has_belt: i32 = proposal + .bodies + .iter() + .any(|b| b.body_type == "asteroid_belt") + as i32; + + tx.execute( + "UPDATE star_systems SET habitable_planet_count = ?1, inhabited_planet_count = ?2, + gas_giant = ?3, asteroid_belt = ?4 + WHERE system_id = ?5", + params![ + habitable_count, + inhabited_count, + has_gas_giant, + has_belt, + proposal.system_id, + ], + ) + .unwrap(); + tx.commit().unwrap(); #[derive(Serialize)] @@ -1194,11 +1244,15 @@ fn cmd_commit_system(conn: &Connection, path: &str) { system_id: String, bodies_created: usize, stations_created: usize, + habitable_count: i32, + inhabited_count: i32, } let result = CommitResult { system_id: proposal.system_id, bodies_created: proposal.bodies.len(), stations_created: proposal.stations.len(), + habitable_count, + inhabited_count, }; println!("{}", serde_json::to_string_pretty(&result).unwrap()); } @@ -1272,6 +1326,89 @@ fn cmd_unfinished(conn: &Connection) { println!("{}", serde_json::to_string_pretty(&result).unwrap()); } +fn cmd_next(conn: &Connection, hop: Option) { + // Find the target hop — either specified or the lowest with unfinished systems + let target_hop: i32 = if let Some(h) = hop { + h + } else { + conn.query_row( + "SELECT MIN(g.hop_distance_from_gateway) + FROM star_systems s + JOIN system_gates g ON s.system_id = g.system_id + WHERE s.system_id NOT IN (SELECT DISTINCT system_id FROM bodies)", + [], + |r| r.get::<_, Option>(0), + ) + .unwrap() + .unwrap_or(-1) + }; + + if target_hop < 0 { + println!(r#"{{"hop": null, "count": 0, "systems": [], "message": "all systems have bodies"}}"#); + return; + } + + #[derive(Serialize)] + struct NextSystem { + system_id: String, + proper_name: Option, + star_type: Option, + spectral_class: Option, + gate_topology: Option, + geographic_sector: Option, + habitable_planet_count: Option, + inhabited_planet_count: Option, + population: Option, + } + + let mut stmt = conn + .prepare( + "SELECT s.system_id, s.proper_name, s.star_type, s.spectral_class, + g.gate_topology, s.geographic_sector, + s.habitable_planet_count, s.inhabited_planet_count, + e.population + FROM star_systems s + JOIN system_gates g ON s.system_id = g.system_id + LEFT JOIN system_economy e ON s.system_id = e.system_id + WHERE g.hop_distance_from_gateway = ?1 + AND s.system_id NOT IN (SELECT DISTINCT system_id FROM bodies) + ORDER BY s.system_id", + ) + .unwrap(); + + let systems: Vec = stmt + .query_map(params![target_hop], |row| { + Ok(NextSystem { + system_id: row.get(0)?, + proper_name: row.get(1)?, + star_type: row.get(2)?, + spectral_class: row.get(3)?, + gate_topology: row.get(4)?, + geographic_sector: row.get(5)?, + habitable_planet_count: row.get(6)?, + inhabited_planet_count: row.get(7)?, + population: row.get(8)?, + }) + }) + .unwrap() + .filter_map(|r| r.ok()) + .collect(); + + #[derive(Serialize)] + struct NextResult { + hop: i32, + count: usize, + systems: Vec, + } + + let result = NextResult { + hop: target_hop, + count: systems.len(), + systems, + }; + println!("{}", serde_json::to_string_pretty(&result).unwrap()); +} + fn cmd_sync_wiki(conn: &Connection, system_id: Option<&str>, wiki_dir: &str) { // Get list of systems to sync let system_ids: Vec = if let Some(sid) = system_id { @@ -1609,6 +1746,7 @@ fn main() { Commands::CommitSystem { path } => cmd_commit_system(&conn, path), Commands::WipeSystem { system_id } => cmd_wipe_system(&conn, system_id), Commands::Unfinished => cmd_unfinished(&conn), + Commands::Next { hop } => cmd_next(&conn, *hop), Commands::SyncWiki { system_id, wiki } => { cmd_sync_wiki(&conn, system_id.as_deref(), wiki) } diff --git a/wiki/star-systems/GJ-144/index.md b/wiki/star-systems/GJ-144/index.md index 1a11944ee..52b8170f1 100644 --- a/wiki/star-systems/GJ-144/index.md +++ b/wiki/star-systems/GJ-144/index.md @@ -72,3 +72,29 @@ The system that feeds the Reach has not had a labor dispute in sixty years; the - **Hop Distance from Gateway:** 1 - **Adjacent Systems:** GJ 71, GJ 764, GJ 702B + +## Celestial Bodies + + +| Orbit | ID | Name | Type | Inhabited | Pop | Mass | Gravity | Year (d) | Day (h) | Atmo | Biome | Hydro | Economy | Settlement | Industrial | +|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| +| 1 | `GJ144b` | — | planet | no | — | terrestrial | 0.32g | 30 | 720.0 | none | barren | none | — | — | — | +| 2 | `GJ144c` | — | planet | no | — | terrestrial | 0.55g | 110 | 2800.0 | toxic | barren | none | — | — | — | +| 3 | `GJ144d` | Kallast | planet | yes | 2.0B | terrestrial | 0.95g | 280 | 23.5 | breathable | temperate | ocean | agricultural | urban_concentrated | Agricultural_Syndic | +| ↳ 3.1 | `GJ144d-1` | — | moon | no | — | dwarf | 0.08g | 18 | 444.0 | none | barren | none | — | — | — | +| 4 | `GJ144e` | Vethis | planet | yes | 1.2B | terrestrial | 0.82g | 480 | 26.8 | breathable | temperate | ocean | agricultural | dispersed_rural | Agricultural_Syndic | +| ↳ 4.1 | `GJ144e-1` | — | moon | no | — | dwarf | 0.06g | 12 | 295.0 | none | barren | none | — | — | — | +| 5 | `GJ144f` | — | planet | no | — | terrestrial | 0.40g | 1200 | 18.0 | thin | frozen | ice | — | — | — | +| 6 | `GJ144-belt` | — | asteroid_belt | no | — | — | — | — | — | — | — | — | — | — | — | +| 7 | `GJ144g` | — | gas_giant | no | — | gas_giant | — | 2500 | 11.2 | dense | — | — | — | — | — | +| ↳ 7.1 | `GJ144g-1` | — | moon | no | — | dwarf | 0.12g | 4 | 96.0 | none | barren | none | — | — | — | +| ↳ 7.2 | `GJ144g-2` | — | moon | no | — | dwarf | 0.08g | 10 | 228.0 | none | frozen | ice | — | — | — | +| 8 | `GJ144-oort` | — | oort_cloud | no | — | — | — | — | — | — | — | — | — | — | — | + +### Stations & Facilities + +| ID | Name | Type | Orbits | Population | Economy | Governance | Docking | Gate | Districts | +|---|---|---|---|---|---|---|---|---|---| +| `GJ144-oort-S1` | Horizon Station | horizon | `GJ144-oort` | — | transit | — | major | yes | 1 | +| `GJ144d-S1` | Kallast Freight Terminal | commercial | `GJ144d` | 5M | agricultural | — | major | no | 1 | + diff --git a/wiki/star-systems/GJ-244A/gttr.md b/wiki/star-systems/GJ-244A/gttr.md index 2ef398d5d..830383c1f 100644 --- a/wiki/star-systems/GJ-244A/gttr.md +++ b/wiki/star-systems/GJ-244A/gttr.md @@ -46,7 +46,7 @@ The official atmospheric descriptor for Sirius is "cosmopolitan bustle / institu Sirius is one hop from Gateway and two from Sol. It has five gate apertures. The food is imported, expensive, and occasionally excellent in the way that food is excellent when an entire civilization's logistics network is optimized to bring it to you. -The underground city on the habitable world is worth visiting if you enjoy architecture that communicates the sentence "we chose this on purpose and we would like you to stop asking why." The orbital stations are efficient, clean, and have the faintly antiseptic atmosphere of a hospital that has been running smoothly for so long that no one remembers it is a hospital. +The underground city on the habitable world is worth visiting if you enjoy architecture that communicates the sentence "we chose this on purpose and we would like you to stop asking why." The planet is called Edict, because when Conclave station came online the founding Assembly issued an edict that the frozen rock below would be colonized as a monument to their resolve. They named the planet after the paperwork. This is, in retrospect, on brand. The orbital stations are efficient, clean, and have the faintly antiseptic atmosphere of a hospital that has been running smoothly for so long that no one remembers it is a hospital. Do not ask about the founding Assembly members. Do not ask how long they have been here. Do not ask how long they will continue to be here. They are aware of the question. They have been aware of it for longer than you have been alive. diff --git a/wiki/star-systems/GJ-244A/index.md b/wiki/star-systems/GJ-244A/index.md index e595d418b..798be3cc1 100644 --- a/wiki/star-systems/GJ-244A/index.md +++ b/wiki/star-systems/GJ-244A/index.md @@ -30,7 +30,7 @@ That is the leverage point. The Assembly runs the Reach's transit policy. The As ## Faction Notes -The Concord Assembly is not a faction in the way the Syndics or the Commission are factions. It is the governing body of the Reach — the institution all other institutions formally answer to or formally negotiate with. Its physical presence at Sirius means the system is not so much Assembly-controlled as Assembly-constituted: the distinction between the Assembly's institutional interest and the system's civic interest has never been fully established, because the Assembly was here first. +The Concord Assembly is not a faction in the way the Syndics or the Commission are factions. It is the governing body of the Reach — the institution all other institutions formally answer to or formally negotiate with. Its physical presence at Sirius means the system is not so much Assembly-controlled as Assembly-constituted: the distinction between the Assembly's institutional interest and the system's civic interest has never been fully established, because the Assembly was here first. The station Conclave — the Assembly's original orbital core — was the first permanent structure brought online in the system. Upon its activation, the founding Assembly issued an edict that the harsh planet below would be colonized as a monument to the strength of the new institution. The planet has been named Edict ever since. That the capital world of the Reach is named after a bureaucratic pronouncement is either the most honest thing about the Reach's founding or the most revealing, depending on who you ask. The Lattice Commission's Sirius presence is its most senior and least visible. The Commission's regulatory architecture was originally designed here, drafted by people who are still in the Commission's upper tier. Its Sirius offices are not operational enforcement centers — those are distributed across the Reach — but they are where the framework documents are authored and where the quieter accreditation and appeals processes run. What the Commission monitors at Sirius, and for whom, is one of the system's more carefully managed ambiguities. @@ -64,3 +64,28 @@ The same people who declared independence from an institution that would not let - **Hop Distance from Gateway:** 1 - **Adjacent Systems:** GJ 71, GJ 820B, GJ 338B, GJ 380, GJ 570A + +## Celestial Bodies + + +| Orbit | ID | Name | Type | Inhabited | Pop | Mass | Gravity | Year (d) | Day (h) | Atmo | Biome | Hydro | Economy | Settlement | Industrial | +|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| +| 1 | `GJ244Ab` | — | planet | no | — | terrestrial | 0.25g | 45 | 580.0 | none | barren | none | — | — | — | +| 2 | `GJ244Ac` | — | planet | no | — | terrestrial | 0.70g | 320 | 40.0 | toxic | barren | none | — | — | — | +| 3 | `GJ244Ad` | Edict | planet | yes | 400M | terrestrial | 1.10g | 1800 | 20.5 | breathable | frozen | ice | service_mixed | cave | — | +| 4 | `GJ244Ae` | — | gas_giant | no | — | gas_giant | — | 4500 | 12.0 | dense | — | — | — | — | — | +| ↳ 4.1 | `GJ244Ae-1` | — | moon | no | — | dwarf | 0.10g | 3 | 77.0 | none | frozen | ice | — | — | — | +| ↳ 4.2 | `GJ244Ae-2` | — | moon | no | — | dwarf | 0.07g | 8 | 192.0 | none | barren | none | — | — | — | +| 5 | `GJ244A-belt` | — | asteroid_belt | no | — | — | — | — | — | — | — | — | — | — | — | +| 6 | `GJ244A-oort` | — | oort_cloud | no | — | — | — | — | — | — | — | — | — | — | — | + +### Stations & Facilities + +| ID | Name | Type | Orbits | Population | Economy | Governance | Docking | Gate | Districts | +|---|---|---|---|---|---|---|---|---|---| +| `GJ244A-oort-S1` | Horizon Station | horizon | `GJ244A-oort` | — | transit | — | major | yes | 1 | +| `GJ244Ad-S1` | Conclave | commercial | `GJ244Ad` | 50K | service_mixed | — | restricted | no | 1 | +| `GJ244Ad-S2` | Aperture | transit | `GJ244Ad` | 490M | transit | — | major | no | 1 | +| `GJ244Ad-S3` | Leverage | commercial | `GJ244Ad` | 300M | service_mixed | — | major | no | 1 | +| `GJ244Ad-S4` | Quorum | commercial | `GJ244Ad` | 1.6B | service_mixed | — | standard | no | 1 | + diff --git a/wiki/star-systems/GJ-559B/index.md b/wiki/star-systems/GJ-559B/index.md index e9f0fa478..19f2f2319 100644 --- a/wiki/star-systems/GJ-559B/index.md +++ b/wiki/star-systems/GJ-559B/index.md @@ -66,3 +66,22 @@ The agency that sets the rules for the Reach also sets the rules for assessing c - **Hop Distance from Gateway:** 1 - **Adjacent Systems:** GJ 71, GJ 820B, GJ 251, GJ 845, GJ 570A + +## Celestial Bodies + + +| Orbit | ID | Name | Type | Inhabited | Pop | Mass | Gravity | Year (d) | Day (h) | Atmo | Biome | Hydro | Economy | Settlement | Industrial | +|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| +| 1 | `GJ559Bb` | — | planet | no | — | terrestrial | 0.30g | 40 | 900.0 | none | barren | none | — | — | — | +| 2 | `GJ559Bc` | Sede | planet | yes | 750M | terrestrial | 0.91g | 320 | 25.2 | breathable | temperate | rivers | service_mixed | urban_concentrated | — | +| ↳ 2.1 | `GJ559Bc-1` | — | moon | no | — | dwarf | 0.05g | 15 | 360.0 | none | barren | none | — | — | — | +| 3 | `GJ559Bd` | — | planet | no | — | terrestrial | 0.45g | 800 | 19.0 | thin | frozen | ice | — | — | — | +| 4 | `GJ559B-oort` | — | oort_cloud | no | — | — | — | — | — | — | — | — | — | — | — | + +### Stations & Facilities + +| ID | Name | Type | Orbits | Population | Economy | Governance | Docking | Gate | Districts | +|---|---|---|---|---|---|---|---|---|---| +| `GJ559B-oort-S1` | Horizon Station | horizon | `GJ559B-oort` | — | transit | — | major | yes | 1 | +| `GJ559Bc-S1` | The Stack | commercial | `GJ559Bc` | 50M | service_mixed | — | restricted | no | 1 | + diff --git a/wiki/star-systems/GJ-725B/index.md b/wiki/star-systems/GJ-725B/index.md index cb268536e..a5172d694 100644 --- a/wiki/star-systems/GJ-725B/index.md +++ b/wiki/star-systems/GJ-725B/index.md @@ -66,3 +66,24 @@ A gate nobody was watching activated forty years ago, one hop from the border wi - **Hop Distance from Gateway:** 1 - **Adjacent Systems:** GJ 71, GJ 764, GJ 674 + +## Celestial Bodies + + +| Orbit | ID | Name | Type | Inhabited | Pop | Mass | Gravity | Year (d) | Day (h) | Atmo | Biome | Hydro | Economy | Settlement | Industrial | +|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| +| 1 | `GJ725Bb` | — | planet | no | — | terrestrial | 0.28g | 25 | 620.0 | none | barren | none | — | — | — | +| 2 | `GJ725Bc` | Rush | planet | yes | 120M | terrestrial | 0.78g | 250 | 28.4 | breathable | temperate | rivers | extraction | dispersed_rural | — | +| ↳ 2.1 | `GJ725Bc-1` | — | moon | no | — | dwarf | 0.04g | 10 | 252.0 | none | barren | none | — | — | — | +| 3 | `GJ725Bd` | — | planet | no | — | terrestrial | 0.42g | 520 | 22.0 | thin | arid | none | — | — | — | +| 4 | `GJ725B-belt` | — | asteroid_belt | no | — | — | — | — | — | — | — | — | — | — | — | +| 5 | `GJ725Be` | — | gas_giant | no | — | ice_giant | — | 1800 | 14.5 | dense | — | — | — | — | — | +| ↳ 5.1 | `GJ725Be-1` | — | moon | no | — | dwarf | 0.06g | 5 | 120.0 | none | frozen | ice | — | — | — | +| 6 | `GJ725B-oort` | — | oort_cloud | no | — | — | — | — | — | — | — | — | — | — | — | + +### Stations & Facilities + +| ID | Name | Type | Orbits | Population | Economy | Governance | Docking | Gate | Districts | +|---|---|---|---|---|---|---|---|---|---| +| `GJ725B-oort-S1` | Horizon Station | horizon | `GJ725B-oort` | — | transit | — | major | yes | 1 | +