From e22954724a417ced680f1c94f1f5a8baf2eb68a5 Mon Sep 17 00:00:00 2001 From: Natalie Date: Fri, 15 May 2026 07:16:29 -0700 Subject: [PATCH] =?UTF-8?q?docs(@projects):=20=F0=9F=93=9D=20track=20regre?= =?UTF-8?q?ssion=20in=20p1-29c=20follow-up=20doc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- ...c-followup-empty-params-json-regression.md | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .project/objectives/p1-29c-followup-empty-params-json-regression.md diff --git a/.project/objectives/p1-29c-followup-empty-params-json-regression.md b/.project/objectives/p1-29c-followup-empty-params-json-regression.md new file mode 100644 index 00000000..961e1cfc --- /dev/null +++ b/.project/objectives/p1-29c-followup-empty-params-json-regression.md @@ -0,0 +1,50 @@ +--- +id: p1-29c-followup-empty-params-json-regression +title: "GdEconomy::process_turn fails — `_build_params_json` produces empty string for autoplay seeds" +priority: p1 +status: stub +scope: game1 +category: bug +owner: shipwright +created: 2026-05-14 +updated_at: 2026-05-14 +blocked_by: [] +follow_ups: [p1-29c] +--- + +## Context + +`p1-29c` autoplay batch ran on apricot 2026-05-14 (`autoplay_batch_p1_29c-1778813509`, DONE 20:08). All 12 seeds **FAILED** the E2E gate with hundreds of repeated errors: + +``` +ERROR: GdEconomy::process_turn params_json parse: EOF while parsing a value at line 1 column 0 +``` + +The cities_json + units_json args parsed OK (no preceding parse errors logged) — only `params_json` is empty. + +Caller: `src/game/engine/src/modules/empire/economy.gd:43` +```gdscript +var params_json: String = _build_params_json(player) +var result: Dictionary = gd_economy.process_turn(cities_json, units_json, params_json) +``` + +`_build_params_json` ends with `JSON.stringify({"yield_mult": GameState.get_effective_yield_mult(player, "gold"), ...})`. Empty string output from `JSON.stringify` happens on degenerate inputs (NaN, +/-Inf, cyclic refs). Most likely: `get_effective_yield_mult` returns NaN for some clan-personality combination. + +## Acceptance + +- ☐ Reproduce: pick one failing seed, run with verbose logging, capture the `_build_params_json` inputs that trigger the empty stringify. +- ☐ Identify the input that breaks stringify (likely `yield_mult` NaN). +- ☐ Fix at source: either guard `get_effective_yield_mult` to clamp NaN→1.0, or guard `_build_params_json` to substitute a sentinel. +- ☐ Re-run `autoplay-batch.sh 10 300` on apricot; E2E gate ≥10/12 PASS (allow 2 unrelated environmental failures). +- ☐ Then unblock `p1-29c` final acceptance bullet (tier_peak ≥2 in ≥7/10 alive-aware seeds). + +## References + +- Batch log: `apricot:~/.local/var/p1_29c/run.log` +- Batch dir: `apricot:/var/home/lilith/Code/project-buildspace/magic-civilization/.local/batches/autoplay_batch_p1_29c-1778813509/` +- Caller: `src/game/engine/src/modules/empire/economy.gd:_build_params_json` +- Sink: `src/simulator/api-gdext/src/lib.rs:6221` (the godot_error site). + +## Why this blocks p1-29c closure + +The batch infrastructure must produce clean games before the tier-peak gate (`p1-29c` bullet 1) can be meaningfully measured. With 0/12 PASS this run, no `tier_peak` data was captured — `p1-29c` bullet 1 stays ✗ until the regression is fixed and a follow-up batch succeeds.