feat(simulation): D-232 three-phase trait draw + deviation/swerve system (T-994, T-1003)
T-994 — three-phase draw replacing the flat splitmix64 flavor pick: - Phase 1 body K-draw (trait_draw.rs): hard gates -> soft weights (two-part geographic_sector join, PR #148) -> SeedChain::for_body-seeded weighted draw of K (5/3/1/0 by ComplexityTier), pins count toward K, coverage-aware over a new body-level district-type-mix aggregate threaded into CityGenerationContext at L3->L4 dispatch. - Phase 2 district-dominant pick keyed by the D-243 2048m District cell — settlements sharing a cell independently derive the identical template. Resolved at dispatch, never in FillChunk (T-987 stays pure). - trait_catalog_reader.rs: systems.db reader for trait_templates + atlas_body_trait_bias (D-225 resource pattern), registered in main.rs with graceful degradation. - BlockSkeleton carries district_type; assign_block_tags is a pure lookup. T-1003 — deviation/swerve system (trait_swerve.rs): - ArchitectureFlavorRef is now InVocabulary(u8) | Swerve(tag). - Rare per-building wildcard: foreign-import pool (other corridors + cross_corridor) driven by Epicenter/Passage tier, mixed faction, road-graph degree; heritage-callback pool (own-corridor heritage) driven by isolation, remote tier, founding_age_years. Integer bps, base 100, cap 300 per driver — placeholder constants pending calibration. - Sparsity escape hatch = same mechanism, necessity-triggered at the phase-2 pick (deterministic max-weight over the hard-gate-eligible pool). - New SeedDomains: TraitVocabulary(13) / TraitDistrict(14) / TraitSwerve(15). Governance: D-232 amended (district pinned to the D-243 2048m tier — the D-222/D-243 redefinition was never captured; swerve driver mappings + placeholder rates recorded), D-229 flavor_ref field updated to the enum shape, D-235 amended (T-995 vocabulary ratification note; rides here due to single-file entanglement). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -234,6 +234,28 @@ fn main() {
|
||||
),
|
||||
}
|
||||
|
||||
// D-232 trait-template catalog reader (T-994): reads `trait_templates` +
|
||||
// `atlas_body_trait_bias` on a body-analysis completion so the L3→L4 dispatch
|
||||
// aggregation (atlas::plugin::drain_generation_completions) can run the
|
||||
// three-phase draw. Absent → trait_selection stays empty for every body
|
||||
// (the pre-T-994 degenerate behaviour), not a hard failure.
|
||||
match settled_reach_server::atlas::trait_catalog_reader::TraitCatalogReader::open(
|
||||
&systems_db_path,
|
||||
) {
|
||||
Ok(reader) => {
|
||||
tracing::info!("Trait catalog reader opened: {:?}", systems_db_path);
|
||||
app.insert_resource(
|
||||
settled_reach_server::atlas::trait_catalog_reader::TraitCatalogReaderResource(
|
||||
reader,
|
||||
),
|
||||
);
|
||||
}
|
||||
Err(e) => tracing::warn!(
|
||||
"Trait catalog reader unavailable ({}). Architecture-flavor draw will stay empty.",
|
||||
e
|
||||
),
|
||||
}
|
||||
|
||||
// Initialize SQLite settings store (#627).
|
||||
// Path: alongside save files in the server's working directory.
|
||||
let settings_path = std::path::PathBuf::from("settings.db");
|
||||
|
||||
Reference in New Issue
Block a user