E is claimed by InputMap "interact" action — InputMapper consumes
it before _unhandled_key_input. N is free, adjacent to M (star map),
reads as "Numbers" for the economics monitor.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Widen EventPort tick methods from u32 to u64 (prevents overflow)
- Add is_identity() guard on hot-path String allocation in modifiers
- Replace Vec::remove(0) with VecDeque::pop_front() in price history
- Add .after(tick_economy_simulation) ordering for debug commands
- Fix stale PROTOCOL_VERSION assertion (20 → 21) in serialization test
- Add D-181 Phase 2 visibility scope comment on serve_econ_state_query
- Eliminate double lookup in rebuild_signals via single-pass extraction
- Track economy seed TODO with backlog ticket reference
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Economics panel: replace dead _gui_input LEFT/RIGHT with public
navigate() method, wire [ ] keys in main.gd (avoids movement
key conflict, fixes focus_mode=NONE issue)
- Debug console: add explicit effect guard in econ inject no-commodity
branch so invalid effects don't fall to commodity-form error
- Snapshot consumer: null-clear GameState.economy_snapshot after
consuming (matches one-shot consumer invariant)
- Star map: remove duplicate doc comment above set_insert_active()
- Generate script: remove stale comment, dead _WORKTREE_PARENT var,
dead field extraction in parse_wiki_index, add try/except around
DB queries
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Three new econ subcommands in the debug console: inject (supply
shocks/boosts), param (α/β/friction mutation), inspect (all 7
D-181 signals). Command parsing and validation complete; dispatch
wired through existing DebugCommand IPC flow. Server handler
ships with #823.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
New implant panel at implant/economics: system selector, 6-commodity
price table with trend indicators, GDP strip. Composed from D-169
component library. Ring buffer caches last 20 ticks per system.
Snapshot routing wired through snapshot_handler → GameState →
snapshot_consumers → economics_panel. Placeholder prices shown
until server ships EconomySnapshot (#822).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Star map popup now shows POPULATION and GDP rows when data is present.
Generation script updated to compute GDP from population × tier-based
per-capita schedule. 275/301 systems have GDP data (26 uninhabited
correctly omitted).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Expand overheard.ron from 5 zone types (16 conversations) to full
coverage of all 31 zone types with 94 new conversations. Each zone
type has 2-4 role-pair conversations following D-078 occlusion-
resilient authoring rules. Conversations carry investigative
knowledge payloads where appropriate — institutional cover-ups,
manifest discrepancies, suppressed inspections, and cultural signals
players can follow.
Zone types added: administrative_civil, administrative_judicial,
archaeological_site, commercial_market, commercial_transit,
detention_facility, diplomatic_elite, entertainment_venue,
extraction_platform, extraction_space, extraction_surface,
industrial_manufacturing, industrial_processing, medical_facility,
military_garrison, port_fishing, port_maritime, port_space,
port_surface, research_station, residential_surface, rural_aquaculture,
rural_orbital, rural_pastoral, security_checkpoint, wilderness_frontier.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- HashMap → BTreeMap throughout econ-sim for deterministic iteration (D-010)
- Fix cost_factor: multiplicative gate×zone instead of additive (trade.rs)
- Extract derive_seed to shared prng.rs, consolidate FNV-1a implementation
- Rename run_shock_test → run_no_explosion_check (not D-179 Test 3)
- Deduplicate cross-zone FX rate collection in Test 4
- Replace ORDER BY RANDOM() with deterministic ordering + ChaCha8Rng
- Make commodity coverage failure a hard error consistent with D-175
- Fix gap-fill off-by-one (4 corps → 3 when coverage = 0)
- Correct test report: EconEvent exists, location_type is body/station
All four D-179 stability tests still pass.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add D-180 EconEvent struct (target, effect, duration, visibility enums)
with no-op handler to satisfy #809 spec. Import MARK_PRIMARY and MIXED
currency zone assignments from wiki/economics/currency_zones.toml (D-172).
All four D-179 stability tests now pass.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
import_corp_presence() was inserting system IDs with location_type='system',
violating the schema which expects body/station IDs (location_type='body'|'station').
Fix:
- import_economics.py: add _resolve_hq_location() that picks the most-populated
body in the HQ system (falling back to any body, then any station)
- econ-sim/db.rs: load_corp_presences() now JOINs bodies/stations to recover
system_id from body/station location_ids, dropping the 'system' filter
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements the 6 behavioral archetypes from D-175 (Burnelli-Sheldon):
Producer — 1.15× production scale, neutral price signal
Distributor — 0.9× production, −3% price discount to move volume
Specialist — 1.0× production, +10% price premium for expertise
Monopolist — 0.8× production, withholds 25% of output, +20% premium
Cooperative — 1.0× production, −5% community discount
Intermediary — 0.7× production, relies on traded goods
Archetype loading:
- Reads from corporations.behavioral_archetype (currently NULL for all corps)
- Falls back to heuristic inference from specialization text (freight → Distributor,
extraction → Producer, luxury goods → Specialist, etc.)
- 48 corps loaded on current DB, all inferred (DB column to be populated when
wiki corp frontmatter is extended with the behavioral_archetype field)
Applied in model.rs step():
- Per-corp effective_capacity = BASELINE_CAPACITY × production_scale
- Monopolist supply_withheld fraction reduces net output to stockpile
- Price premium: small ALPHA-scaled nudge to node price for primary commodity
All D-179 stability checks still pass with archetypes active.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Custom pipeline for GJ-0 (Sol) that imports real NASA/USGS
planetary data instead of procedural generation. Produces the
same output format (heightmap.png, globe.png, markers.json).
Real data bodies:
- Earth: ETOPO2022 elevation + WorldClim climate + 14 rivers
- Mars: MOLA DEM + ferric biome classes + terraformed water
- Luna: LOLA DEM + lunar biome palette
Procedural fallback for Mercury, Venus, Phobos, Deimos.
Synthetic elevation from albedo for Io, Europa, Ganymede,
Callisto, Titan, Enceladus. Gas giants use existing renderer.
New biome classes 34-36 (ferric_dust/highland/lowland) for
Mars iron oxide surface. Earth features: 50 cities (smart
scatter by continent), 15 named rivers, oceans, mountains.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
arctan2(hz, hx) wrapped longitude counter-clockwise, mirroring
east and west on the globe. Changed to arctan2(hx, hz) which
increases eastward (right on screen). Added +0.5 offset to center
the view on 0° longitude, keeping the dateline seam on the back.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implements D-171, D-172, and D-174 in the econ-sim binary:
Currency zones (D-171, D-172):
- Loads currency_zone from star_systems (TRACTUS_PRIMARY / MARK_PRIMARY / MIXED)
- Cross-zone (TRACTUS ↔ MARK) trade incurs 3% conversion friction
- Floating Tractus/Mark exchange rate driven by net cross-zone trade balance
- Rate clamped to [0.5, 2.0]; ALPHA_FX=0.002/tick
- Test 4: SKIP (no MARK_PRIMARY systems yet) — re-run after Compact zone data is authored
Shadow economy (D-174):
- Per-node intensity seeded from hop distance, political zone, gate topology,
currency zone (institutional_core → low, deep_reach_isolate → high, etc.)
- Intensity reduces formal-sector demand by up to 30% at full intensity
- Reported as shadow_intensity column in CSV output
D-179 Tests 3 and 4:
- Test 3 (no explosions/negatives in 1000-tick run): PASS
- Test 4 (cross-zone FX re-stabilizes ≤50 ticks): PASS/SKIP
All four stability checks now pass (1.05% max dev on convergence, 0.00% drift).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Test plan covering #806, #807, #808, #809 acceptance criteria aligned
with D-179 stability tests and Phase 2 economics deliverable requirements.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds server/src/bin/generate_corporations and tooling/generate-corporations
wrapper. Generates ~5,000 Tier-3 corp instances from Tier-1/2 template
archetypes with seeded name generation (FNV-1a + corridor-weighted PRNG).
Writes wiki markdown stubs for each generated corporation.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extends import_economics.py from 6-step to 8-step pipeline:
- Loads wiki corporation markdown frontmatter as authoritative source
- Syncs corporations table (hard error on proper_name divergence per D-182)
- Populates corp_presence table (one row per corp × headquarters system)
- Splits validation: structural checks block commit; coverage checks post-commit
- D-175 Phase 2 gate: 3+ corps per commodity, 1+ corp per system with pop > 100K
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extends systems.db schema with gate_links, commodities, production_chains,
chain_inputs, corp_presence, and currency_zones tables required for the
Phase 2 economics layer.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
GJ 624 is Halvøy (aquaculture world), not Freiholt. Freiholt is GJ 453.
Fixed both cross-reference occurrences in compact-of-westphalia.md.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All 36 commodity stubs fleshed out with lore context, production chain
descriptions, and economic intelligence briefing voice. Key treatments:
fusion_fuel (D-187 8:1 ratio), services (location-bound mechanics),
brands distinguished from commodities per D-185.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Per-system-type intensity bands (core 0.0-0.2 through frontier 0.6-0.9),
6 seeding modifiers, 10 named system overrides. Compact framing as
principled economic resistance per D-174. Feeds server #808.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
32 MARK_PRIMARY systems (Compact members, west_reach hops 7-17),
14 MIXED systems (Compact-sympathetic, hops 5-6), with rationale
comments per D-172 political affiliation rules. Feeds server #805.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>