Sprint 3.4: War Exhaustion & Status Quo — enforcement, forced peace, and UX transparency#106
Merged
Merged
Conversation
- config/combat_config.php: add WAR_EXHAUSTION_PRESSURE_THRESHOLD (80) and WAR_ENDED_VISIBILITY_SECONDS (48h) - api/war.php: war_list_active() now includes recently-ended wars (48h window) with ended_reason + ended_at - api/war.php: respond_peace sets ended_reason='status_quo' when white_peace term is accepted - api/war.php: new force_status_quo action (ends war with status_quo when own exhaustion >= 80) - js/network/api.js: add forceStatusQuo() API client method - RuntimeWarController.js: fix pressure display bug (was treating object as number) - RuntimeWarController.js: fix primaryGoal display bug (was rendering [object Object]) - RuntimeWarController.js: add exhaustionColor/Badge helpers with HIGH/MAX warnings - RuntimeWarController.js: add endedReasonLabel() helper (status_quo, forced_peace, peace_treaty) - RuntimeWarController.js: show ended wars with reason in list (with dimmed row style) - RuntimeWarController.js: show recently-ended count in section title - RuntimeWarController.js: add exhaustion progress bars in detail view with warning messages - RuntimeWarController.js: add Force Status Quo button in detail when own exhaustion >= 80 - RuntimeWarController.js: wire Force Status Quo listener with confirm dialog - tests/js/war-events.test.js: 14 new tests covering all new features (34 total, all passing) Agent-Logs-Url: https://github.com/makr-code/GalaxyQuest/sessions/5c95e5e2-93e4-4740-baa5-a103b7bebc55 Co-authored-by: makr-code <150588092+makr-code@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refine war exhaustion and status quo mechanics
Sprint 3.4: War Exhaustion & Status Quo — enforcement, forced peace, and UX transparency
Apr 12, 2026
makr-code
marked this pull request as ready for review
April 12, 2026 07:11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
War endings by exhaustion were invisible to players, status quo had no player-triggerable path, and two silent rendering bugs corrupted the war list display.
Backend
war_list_active(): now includes recently-ended wars (48h window) withended_reason+ended_at; ended wars skip expensive goal enrichmentrespond_peace: setsended_reason = "status_quo"when accepted offer contains awhite_peaceterm (previously always"peace_accepted")force_status_quoaction: ends war withended_reason = "status_quo"when requester's side exhaustion ≥WAR_EXHAUSTION_PRESSURE_THRESHOLD(80); rejects with 403 if threshold not metcombat_config.php:WAR_EXHAUSTION_PRESSURE_THRESHOLD = 80,WAR_ENDED_VISIBILITY_SECONDS = 172800Frontend (
RuntimeWarController.js)Bug fixes:
summary.pressureis an object{own_exhaustion, enemy_exhaustion, …}— was being passed toNumber(), producingNaNin the Pressure columnsummary.primary_goalis an object — was rendered as[object Object]in the Goal column; now usesprimaryGoal.labelExhaustion UX:
⚠ HIGHbadge (≥80) → red+⚠ MAXbadge (≥100)⚡ Force Status Quobutton appears in detail toolbar when own exhaustion ≥ 80 (active wars only)Ended wars visibility:
⚖ Status Quo,🕊 Peace Treaty,😮 Forced Peace (Exhaustion))Active Wars (+ N recently ended)when mixedAPI client
forceStatusQuo({ war_id })added toapi.js→POST api/war.php?action=force_status_quoTests
14 new tests added to
war-events.test.js(34 total); covers exhaustion badges, force-status-quo button visibility, ended-war list rendering, and primaryGoal label fix.