feat(ui): economics insert panel and debug console econ commands #124

Closed
jpmschweitzer wants to merge 0 commits from sprint-34/client into main
Owner

Sprint 34: Pulse — Client

#785: Star map population + GDP

  • Generation script adds GDP from population × tier-based per-capita schedule
  • Star map popup shows POPULATION and GDP rows (275/301 systems)

#824: Economics Monitor insert panel

  • New implant panel at implant/economics (D-169 component library, D-170 HUD groups)
  • System selector (LEFT/RIGHT), 6-commodity price table with trend arrows (▲/▼/—), GDP strip
  • Ring buffer caches last 20 ticks per system for trend display
  • Snapshot routing: snapshot_handler → GameState → snapshot_consumers → economics_panel
  • Placeholder prices until server ships EconomySnapshot (#822)

#825: Debug console econ commands

  • econ inject <system> [commodity] <shock|boost> <magnitude> [ticks]
  • econ param <alpha|beta|friction> <value> [system_a] [system_b]
  • econ inspect <system> — displays all 7 D-181 signals
  • Wired through existing DebugCommand IPC flow; server handler ships with #823

Server blockers (not included)

  • #822 (EconomySnapshot IPC) → enables live data in #824
  • #823 (debug command handler) → enables server-side processing for #825

Test plan

  • Star map popup shows population + GDP for inhabited systems
  • Economics panel opens via E key in implant mode
  • System selector cycles through all systems
  • Placeholder commodity rows render with trend indicators
  • econ inject, econ param, econ inspect parse without error in debug console
  • Help text includes Economics section
## Sprint 34: Pulse — Client ### #785: Star map population + GDP - Generation script adds GDP from population × tier-based per-capita schedule - Star map popup shows POPULATION and GDP rows (275/301 systems) ### #824: Economics Monitor insert panel - New implant panel at `implant/economics` (D-169 component library, D-170 HUD groups) - System selector (LEFT/RIGHT), 6-commodity price table with trend arrows (▲/▼/—), GDP strip - Ring buffer caches last 20 ticks per system for trend display - Snapshot routing: snapshot_handler → GameState → snapshot_consumers → economics_panel - Placeholder prices until server ships EconomySnapshot (#822) ### #825: Debug console econ commands - `econ inject <system> [commodity] <shock|boost> <magnitude> [ticks]` - `econ param <alpha|beta|friction> <value> [system_a] [system_b]` - `econ inspect <system>` — displays all 7 D-181 signals - Wired through existing DebugCommand IPC flow; server handler ships with #823 ### Server blockers (not included) - #822 (EconomySnapshot IPC) → enables live data in #824 - #823 (debug command handler) → enables server-side processing for #825 ### Test plan - [ ] Star map popup shows population + GDP for inhabited systems - [ ] Economics panel opens via E key in implant mode - [ ] System selector cycles through all systems - [ ] Placeholder commodity rows render with trend indicators - [ ] `econ inject`, `econ param`, `econ inspect` parse without error in debug console - [ ] Help text includes Economics section
jpmschweitzer added 4 commits 2026-04-10 13:24:59 +02:00
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>
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>
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>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
Owner

Review: sprint-34/client -> main (type: code)

PR #124feat(ui): economics insert panel and debug console econ commands
3 tickets (#785, #824, #825), 13 files, 889 insertions

Process note: No runtime smoke test (make game) mentioned in commits or PR description.


Hoshe (Code Quality): REQUEST_CHANGES

Structurally sound — snapshot pipeline wiring correct, ring buffer clean, D-169/D-170 patterns followed. Four issues.

# File Issue
1 economics_panel.gd ~L240 System navigation is dead on arrival. _gui_input handles LEFT/RIGHT but the panel never calls grab_focus() and focus_mode is default FOCUS_NONE — no keyboard events received. Additionally, LEFT/RIGHT conflict with player movement in INSERT mode. Navigation should use non-movement keys in main.gd _unhandled_key_input, forwarding via navigate(-1)/navigate(1).
2 debug_console.gd ~L275 econ inject no-commodity branch gives misleading error on invalid effect. econ inject Sol badeffect 0.5 falls to commodity branch and prints commodity-form usage. Needs explicit effect not in ["shock", "boost"] guard in the no-commodity branch.
3 generate-star-map-data.py L23-27 Stale comment + dead variable. Comment says "This script lives in client/tooling/" — it's at tooling/ (repo root). _WORKTREE_PARENT defined but never used.
4 generate-star-map-data.py parse_wiki_index extracts dead fields (bodies, population discarded — DB is authoritative). Also, 3 cur.execute() calls have no error handling for schema changes.

Tyre (Architecture): REQUEST_CHANGES

Architecture solid — D-169 composition correct, D-170 registration clean, autoload parse-order respected, snapshot pipeline correctly wired. Three issues.

# File Issue
1 snapshot_consumers.gd L181 consume_economy_snapshot does not null-clear GameState.economy_snapshot after consuming. Every other one-shot consumer clears its field. Breaks documented invariant. Add GameState.economy_snapshot = null at end.
2 generate-star-map-data.py L29-32 Stale comment + dead variable. (Same as Hoshe #3.)
3 star_map.gd L138-139 Duplicate doc comment above set_insert_active(). Introduced by this branch.

Verdict: CHANGES REQUESTED

2/2 reviewers request changes. 6 unique actionable issues (1 shared).

## Review: sprint-34/client -> main (type: code) **PR #124** — `feat(ui): economics insert panel and debug console econ commands` 3 tickets (#785, #824, #825), 13 files, 889 insertions **Process note:** No runtime smoke test (`make game`) mentioned in commits or PR description. --- ### Hoshe (Code Quality): REQUEST_CHANGES Structurally sound — snapshot pipeline wiring correct, ring buffer clean, D-169/D-170 patterns followed. Four issues. | # | File | Issue | |---|------|-------| | 1 | `economics_panel.gd` ~L240 | **System navigation is dead on arrival.** `_gui_input` handles LEFT/RIGHT but the panel never calls `grab_focus()` and `focus_mode` is default `FOCUS_NONE` — no keyboard events received. Additionally, LEFT/RIGHT conflict with player movement in INSERT mode. Navigation should use non-movement keys in `main.gd` `_unhandled_key_input`, forwarding via `navigate(-1)`/`navigate(1)`. | | 2 | `debug_console.gd` ~L275 | **`econ inject` no-commodity branch gives misleading error on invalid effect.** `econ inject Sol badeffect 0.5` falls to commodity branch and prints commodity-form usage. Needs explicit `effect not in ["shock", "boost"]` guard in the no-commodity branch. | | 3 | `generate-star-map-data.py` L23-27 | **Stale comment + dead variable.** Comment says "This script lives in `client/tooling/`" — it's at `tooling/` (repo root). `_WORKTREE_PARENT` defined but never used. | | 4 | `generate-star-map-data.py` | **`parse_wiki_index` extracts dead fields** (`bodies`, `population` discarded — DB is authoritative). Also, 3 `cur.execute()` calls have no error handling for schema changes. | --- ### Tyre (Architecture): REQUEST_CHANGES Architecture solid — D-169 composition correct, D-170 registration clean, autoload parse-order respected, snapshot pipeline correctly wired. Three issues. | # | File | Issue | |---|------|-------| | 1 | `snapshot_consumers.gd` L181 | **`consume_economy_snapshot` does not null-clear `GameState.economy_snapshot` after consuming.** Every other one-shot consumer clears its field. Breaks documented invariant. Add `GameState.economy_snapshot = null` at end. | | 2 | `generate-star-map-data.py` L29-32 | **Stale comment + dead variable.** (Same as Hoshe #3.) | | 3 | `star_map.gd` L138-139 | **Duplicate doc comment** above `set_insert_active()`. Introduced by this branch. | --- ### Verdict: CHANGES REQUESTED 2/2 reviewers request changes. 6 unique actionable issues (1 shared).
jpmschweitzer added 1 commit 2026-04-10 14:04:01 +02:00
- 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>
Author
Owner

Review: sprint-34/client -> main — Round 2

Hoshe (Code Quality): REQUEST_CHANGES

5/6 fixes verified correct. One new issue found.

# File Issue
1 main.gd ~L175 E key bound to interact in InputMap. InputMapper._unhandled_input consumes the E key event before main.gd._unhandled_key_input sees it. Economics panel toggle silently fails. M works for star map because M is NOT in the InputMap. Fix: use a key not already in InputMap, or add open_economics action to InputMapper.

Tyre (Architecture): APPROVE

All 3 architectural fixes verified. Navigation pattern consistent with star map. Snapshot consumer pattern matches all peers. Script cleanup complete.

Verdict: CHANGES REQUESTED

1 issue: E key conflict with InputMap interact action. Quick fix — rebind to an unused key.

## Review: sprint-34/client -> main — Round 2 ### Hoshe (Code Quality): REQUEST_CHANGES 5/6 fixes verified correct. One new issue found. | # | File | Issue | |---|------|-------| | 1 | `main.gd` ~L175 | **E key bound to `interact` in InputMap.** `InputMapper._unhandled_input` consumes the E key event before `main.gd._unhandled_key_input` sees it. Economics panel toggle silently fails. M works for star map because M is NOT in the InputMap. Fix: use a key not already in InputMap, or add `open_economics` action to InputMapper. | ### Tyre (Architecture): APPROVE All 3 architectural fixes verified. Navigation pattern consistent with star map. Snapshot consumer pattern matches all peers. Script cleanup complete. ### Verdict: CHANGES REQUESTED 1 issue: E key conflict with InputMap `interact` action. Quick fix — rebind to an unused key.
jpmschweitzer added 1 commit 2026-04-10 14:25:17 +02:00
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>
Author
Owner

Review: sprint-34/client -> main — Round 3

Hoshe (Code Quality): APPROVE

N key fix verified. KEY_N not in InputMap. Footer matches. All round 1+2 fixes in place. No regressions.

Tyre (Architecture): APPROVE

Keybinding pattern consistent (M/J/N family). Merge clean. Minor: 2 stale "E key" .tscn comments — cosmetic, not blocking.

Verdict: APPROVED

2/2 reviewers approve. Ready to merge.

## Review: sprint-34/client -> main — Round 3 ### Hoshe (Code Quality): APPROVE N key fix verified. KEY_N not in InputMap. Footer matches. All round 1+2 fixes in place. No regressions. ### Tyre (Architecture): APPROVE Keybinding pattern consistent (M/J/N family). Merge clean. Minor: 2 stale "E key" .tscn comments — cosmetic, not blocking. ### Verdict: APPROVED 2/2 reviewers approve. Ready to merge.
jpmschweitzer closed this pull request 2026-04-10 15:20:06 +02:00

Pull request closed

This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: jpmschweitzer/settled-reach#124