# Sprint 37: Sweep — Client Tasks **Goal:** Spring-clean accumulated debt: asset pipeline discipline, PROTOCOL_VERSION removal, D-167/D-032 dead-code purge, New Game regression fix, copy wiki residue, bookmark save-state, and generator quality patches. **Branch:** `sprint-37/client` **Agents:** Stig (dev), Hoshe (QA) ## New Tickets | # | Title | Priority | Blocked by | |---|-------|----------|------------| | #872 | New Game flow hangs on 'connecting' after sprint-36 Option A handoff | high | — | | #873 | Scene-level merge-path UI flow tests (gdUnit4) | high | — | | #866 | dialogue_box _escape_bbcode chained replace corrupts [lb] escapes | high | — | | #869 | Fix MetaScreen test helper regression — anti_tedium suite (7 fails) | high | — | | #870 | Delete or revive 8 parse-error test files | medium | — | | #875 | Drop PROTOCOL_VERSION on client (D-192) | medium | #874 (server) | | #882 | Strip archetype-driven client code (follow-up to #878) | medium | #878 (server) | Use `tooling/db/ticket show ` for full details. ## Key Decisions - `decisions/architecture.md` — D-192 (drop PROTOCOL_VERSION lockstep handshake), D-005 (IPC protocol) ## Notes **#872 — New Game flow hangs on 'connecting' (motivating regression)** - Manual repro during Sprint 36 PR #134 smoke test: main menu → New Game → loading screen shows 'connecting' and never progresses. - Likely suspects: 1. `client/ui/meta/screens/main_menu/main_menu.gd` — `_process()` polls `SimBridge.poll_snapshot()` while `_waiting_for_catalog` is true. If `bookmark_catalog` never arrives (or arrives but the flag isn't cleared), the loop runs forever. 2. `client/ui/meta/screens/loading/loading_screen.gd` — opaque BG + `MOUSE_FILTER_STOP` means a never-dismissed loading state looks identical to 'hung connecting'. 3. `client/scripts/protocol/protocol.gd` — `bookmark_catalog` decode landed in v23 (commit 41e89579). Verify server is actually sending `bookmark_catalog` in the first snapshot after connect. 4. Option A scene handoff race — confirm `main_menu → character_creation` triggers on a signal, not a polled flag. - Suggested investigation order: add trace prints in `main_menu._process` to confirm `SimBridge.state` and `GameState.bookmark_catalog` contents during the hang. That will disambiguate suspects 1 vs 3 in minutes. **#873 — Scene-level merge-path UI flow tests (gdUnit4)** - Add gdUnit4 scene-level tests for merge-path UI flows so regressions like #872 are caught pre-merge instead of post-merge. - Scope — one test per flow: - main menu → new game → character creation → confirm → connected state - main menu → load game → save picker → selected - character creation → submit → `sim_bridge` receives correct payload - bookmark tab → select location → confirm → server gets bookmark action - Tests must run headless via `tests/run-godot`. Pattern: load scene → simulate input via `_input()` or `button.pressed.emit()` → await signals or poll state with timeout → assert terminal state. - NOT pixel/screenshot diffing. NOT RPA/xdotool. NOT CI integration (existing `make test-client` already covers this). - Reference pattern: `test_character_creation_sprint28.gd`. - These tests are the mechanism the `pr-review` merge-path gate (added Sprint 36 retro) assumes exists. **#866 — _escape_bbcode chained replace corruption** - `dialogue_box.gd:628` chains `.replace('[', '[lb]').replace(']', '[rb]')`. The second replace turns `[lb]` into `[lb[rb]`, corrupting the escape. BBCode injection guard is effectively broken for server-sourced text. - Fix: escape only `[` (not `]`), since unmatched `]` in RichTextLabel renders as literal. - Test: `test_escape_bbcode_brackets_in_server_text` in `test_dialogue_sprint18.gd` (currently skipped) — unskip and make it pass. **#869 — MetaScreen test helper regression (7 fails)** - Sprint 36 migrated `bug_report_dialog.gd` from `extends Control` to `extends MetaScreen`. `test_anti_tedium.gd:94` builds the dialog via `Control.new() + set_script(BugReportDialogScript)`, which no longer satisfies the MetaScreen base contract. - Every call to `dialog.start_capture()` fails with `Nonexistent function in base Control`. 7 failing tests in the anti_tedium suite. - Fix: instantiate the `.tscn` (preserves the MetaScreen runtime stack) instead of building from script, OR have the test instantiate a MetaScreen-rooted node. **#870 — Delete or revive 8 parse-error test files** - These 8 files fail to parse (not just fail tests), contributing to gdUnit error counts: `test_debug_overlay_sprint19.gd`, `test_entanglement_sprint22.gd`, `test_fog_sprint22.gd`, `test_journal_sprint18.gd`, `test_minimap_sprint18.gd`, `test_session_manager_sprint19.gd`, `test_sprint30.gd`, `test_sprite_integration.gd`. - They reference removed/renamed APIs from prior sprints. - Default: delete. File a fresh ticket if/when the underlying coverage is needed again. If any file is worth reviving, rewrite it against the current API. **#875 — Drop PROTOCOL_VERSION on client (D-192)** - Blocked by server ticket #874 — merge server PR first. - Remove: `version` field read in `client/scripts/protocol/protocol.gd` (`Protocol.decode_snapshot`), the `PROTOCOL_VERSION` constant, and the version-mismatch guard. - Update any fixture-replay paths that read `version`. - Keep all field-presence and roundtrip behavioral tests. **#882 — Strip archetype-driven client code (follow-up to server #878)** - Added 2026-04-21. Blocked by server #878 (removes `character_archetype` from StartupMessage; rides #874's PROTOCOL_VERSION break). - Per lead direction: the CharacterArchetype trace is Phase 6 filler, not production. Keep character-creation UI and insert screens; strip everything else. - Strip: `character_archetype` field in `game_state.gd` (line 100), `lattice_profile` derivation (line 47); `session_manager.gd` `save_character_archetype()`, `_read_archetype_file()`, character.txt save/load (lines 58, 172–192); `protocol.gd` `character_archetype` on StartupMessage; `sim_bridge.gd` archetype wire-up; any monologue color-palette code keyed on `lattice_augmented`/`lattice_baseline`; audit `tests/client/test_signal_sprint24.gd`. - Verify: client launches, character creation UI loads, insert screens render, session starts. Grep `character_archetype`, `lattice_profile`, `smuggler`, `detective` in `client/` — only character-creation UI references remain. - Context: server-side audit at `docs/architecture/sprint-37-878-audit.md` (on server branch until #878 merges). ## Dependency Chain ``` #874 (server) → #875 (client PROTOCOL_VERSION drop) #878 (server) → #882 (client archetype strip) #872 (New Game regression fix) → #873 (merge-path tests add coverage for this flow) #866, #869, #870 → standalone, parallel ``` ## PR Workflow ```bash tea pr create --repo jpmschweitzer/settled-reach --login schweitz \ --title "fix(client): sprint 37 — New Game regression, test cleanup, PROTOCOL_VERSION drop" \ --description "body" \ --base main --head sprint-37/client ```