refactor(schema): rename biome_summary to planet_class (D-188)
"Biome" describes per-zone vegetation classification (Whittaker table). "Planet class" describes overall planetary character. The conflation caused the planet generator to misclassify ~270 bodies as barren. Scope: systems.db column, schema SQL, Rust atlas code, wiki table headers (Biome → Class), atlas proposal JSONs, all docs/decisions, tooling scripts. Also normalizes atmosphere vocabulary (breathable → standard) and expands planet class mapping to all 26 wiki values. Unknown classes default to temperate for modder safety. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -21,7 +21,7 @@ pub struct ProposalBody {
|
||||
pub orbital_period_days: Option<f64>,
|
||||
pub rotation_period_hours: Option<f64>,
|
||||
pub atmosphere: Option<String>,
|
||||
pub biome_summary: Option<String>,
|
||||
pub planet_class: Option<String>,
|
||||
pub hydrosphere: Option<String>,
|
||||
pub economic_role: Option<String>,
|
||||
pub settlement_pattern: Option<String>,
|
||||
@@ -173,7 +173,7 @@ pub fn generate_body_matrix(
|
||||
orbital_period_days: Some(88.0),
|
||||
rotation_period_hours: Some(1408.0),
|
||||
atmosphere: Some("none".into()),
|
||||
biome_summary: Some("barren".into()),
|
||||
planet_class: Some("barren".into()),
|
||||
hydrosphere: None,
|
||||
economic_role: None,
|
||||
settlement_pattern: None,
|
||||
@@ -204,7 +204,7 @@ pub fn generate_body_matrix(
|
||||
orbital_period_days: Some(365.0),
|
||||
rotation_period_hours: Some(24.0),
|
||||
atmosphere: Some("standard".into()),
|
||||
biome_summary: Some("temperate".into()),
|
||||
planet_class: Some("temperate".into()),
|
||||
hydrosphere: None,
|
||||
economic_role: None,
|
||||
settlement_pattern: None,
|
||||
@@ -236,7 +236,7 @@ pub fn generate_body_matrix(
|
||||
orbital_period_days: Some(400.0),
|
||||
rotation_period_hours: Some(26.0),
|
||||
atmosphere: Some("standard".into()),
|
||||
biome_summary: Some("temperate".into()),
|
||||
planet_class: Some("temperate".into()),
|
||||
hydrosphere: None,
|
||||
economic_role: None,
|
||||
settlement_pattern: None,
|
||||
@@ -269,7 +269,7 @@ pub fn generate_body_matrix(
|
||||
orbital_period_days: Some(2000.0),
|
||||
rotation_period_hours: Some(18.0),
|
||||
atmosphere: Some("thin".into()),
|
||||
biome_summary: Some("frozen".into()),
|
||||
planet_class: Some("frozen".into()),
|
||||
hydrosphere: None,
|
||||
economic_role: None,
|
||||
settlement_pattern: None,
|
||||
@@ -294,7 +294,7 @@ pub fn generate_body_matrix(
|
||||
orbital_period_days: None,
|
||||
rotation_period_hours: None,
|
||||
atmosphere: None,
|
||||
biome_summary: None,
|
||||
planet_class: None,
|
||||
hydrosphere: None,
|
||||
economic_role: None,
|
||||
settlement_pattern: None,
|
||||
@@ -325,7 +325,7 @@ pub fn generate_body_matrix(
|
||||
orbital_period_days: Some(4300.0),
|
||||
rotation_period_hours: Some(10.0),
|
||||
atmosphere: Some("dense".into()),
|
||||
biome_summary: None,
|
||||
planet_class: None,
|
||||
hydrosphere: None,
|
||||
economic_role: None,
|
||||
settlement_pattern: None,
|
||||
@@ -347,7 +347,7 @@ pub fn generate_body_matrix(
|
||||
orbital_period_days: Some(3.5 * m as f64),
|
||||
rotation_period_hours: Some(3.5 * 24.0 * m as f64),
|
||||
atmosphere: Some("none".into()),
|
||||
biome_summary: Some("barren".into()),
|
||||
planet_class: Some("barren".into()),
|
||||
hydrosphere: None,
|
||||
economic_role: None,
|
||||
settlement_pattern: None,
|
||||
@@ -373,7 +373,7 @@ pub fn generate_body_matrix(
|
||||
orbital_period_days: None,
|
||||
rotation_period_hours: None,
|
||||
atmosphere: None,
|
||||
biome_summary: None,
|
||||
planet_class: None,
|
||||
hydrosphere: None,
|
||||
economic_role: None,
|
||||
settlement_pattern: None,
|
||||
@@ -525,7 +525,7 @@ pub fn cmd_commit_system(conn: &Connection, path: &str) {
|
||||
"INSERT INTO bodies (body_id, system_id, parent_body_id, body_type, orbit_index,
|
||||
proper_name, inhabited, population, mass_class, surface_gravity,
|
||||
orbital_period_days, rotation_period_hours, atmosphere,
|
||||
biome_summary, hydrosphere, economic_role, settlement_pattern,
|
||||
planet_class, hydrosphere, economic_role, settlement_pattern,
|
||||
industrial_corridor)
|
||||
VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12, ?13, ?14, ?15, ?16, ?17, ?18)",
|
||||
params![
|
||||
@@ -542,7 +542,7 @@ pub fn cmd_commit_system(conn: &Connection, path: &str) {
|
||||
body.orbital_period_days,
|
||||
body.rotation_period_hours,
|
||||
body.atmosphere,
|
||||
body.biome_summary,
|
||||
body.planet_class,
|
||||
body.hydrosphere,
|
||||
body.economic_role,
|
||||
body.settlement_pattern,
|
||||
|
||||
@@ -19,7 +19,7 @@ pub struct BodyRow {
|
||||
pub mass_class: Option<String>,
|
||||
pub atmosphere: Option<String>,
|
||||
pub surface_gravity: Option<f64>,
|
||||
pub biome_summary: Option<String>,
|
||||
pub planet_class: Option<String>,
|
||||
pub hydrosphere: Option<String>,
|
||||
pub inhabited: bool,
|
||||
pub population: i64,
|
||||
@@ -102,7 +102,7 @@ pub fn query_bodies(
|
||||
let mut sql = String::from(
|
||||
"SELECT body_id, system_id, parent_body_id, body_type, orbit_index,
|
||||
proper_name, mass_class, atmosphere, surface_gravity,
|
||||
biome_summary, hydrosphere, inhabited, population,
|
||||
planet_class, hydrosphere, inhabited, population,
|
||||
economic_role, cultural_corridor, industrial_corridor
|
||||
FROM bodies WHERE 1=1",
|
||||
);
|
||||
@@ -138,7 +138,7 @@ pub fn query_bodies(
|
||||
mass_class: row.get(6)?,
|
||||
atmosphere: row.get(7)?,
|
||||
surface_gravity: row.get(8)?,
|
||||
biome_summary: row.get(9)?,
|
||||
planet_class: row.get(9)?,
|
||||
hydrosphere: row.get(10)?,
|
||||
inhabited: row.get::<_, i32>(11)? != 0,
|
||||
population: row.get::<_, Option<i64>>(12)?.unwrap_or(0),
|
||||
|
||||
@@ -22,7 +22,7 @@ pub fn cmd_add_body(
|
||||
conn.execute(
|
||||
"INSERT INTO bodies (body_id, system_id, parent_body_id, body_type, orbit_index,
|
||||
proper_name, mass_class, atmosphere, surface_gravity,
|
||||
biome_summary, inhabited, population)
|
||||
planet_class, inhabited, population)
|
||||
VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9, ?10, ?11, ?12)",
|
||||
params![
|
||||
id,
|
||||
|
||||
@@ -47,7 +47,7 @@ pub fn cmd_show_body(conn: &Connection, body_id: &str) {
|
||||
.query_row(
|
||||
"SELECT body_id, system_id, parent_body_id, body_type, orbit_index,
|
||||
proper_name, mass_class, atmosphere, surface_gravity,
|
||||
biome_summary, hydrosphere, inhabited, population,
|
||||
planet_class, hydrosphere, inhabited, population,
|
||||
economic_role, cultural_corridor, industrial_corridor
|
||||
FROM bodies WHERE body_id = ?1",
|
||||
params![body_id],
|
||||
@@ -62,7 +62,7 @@ pub fn cmd_show_body(conn: &Connection, body_id: &str) {
|
||||
mass_class: row.get(6)?,
|
||||
atmosphere: row.get(7)?,
|
||||
surface_gravity: row.get(8)?,
|
||||
biome_summary: row.get(9)?,
|
||||
planet_class: row.get(9)?,
|
||||
hydrosphere: row.get(10)?,
|
||||
inhabited: row.get::<_, i32>(11)? != 0,
|
||||
population: row.get::<_, Option<i64>>(12)?.unwrap_or(0),
|
||||
|
||||
@@ -35,7 +35,7 @@ pub fn cmd_sync_wiki(conn: &Connection, system_id: Option<&str>, wiki_dir: &str)
|
||||
"SELECT body_id, proper_name, body_type, orbit_index, parent_body_id,
|
||||
inhabited, population, mass_class, atmosphere, surface_gravity,
|
||||
orbital_period_days, rotation_period_hours,
|
||||
biome_summary, hydrosphere, economic_role, settlement_pattern,
|
||||
planet_class, hydrosphere, economic_role, settlement_pattern,
|
||||
industrial_corridor
|
||||
FROM bodies WHERE system_id = ?1
|
||||
ORDER BY CASE WHEN parent_body_id IS NULL THEN orbit_index ELSE 1000 + orbit_index END",
|
||||
|
||||
Reference in New Issue
Block a user