diff --git a/client/scripts/autoloads/sim_bridge.gd b/client/scripts/autoloads/sim_bridge.gd index 0c297e519..e82566693 100644 --- a/client/scripts/autoloads/sim_bridge.gd +++ b/client/scripts/autoloads/sim_bridge.gd @@ -3,7 +3,7 @@ extends Node # Signals signal connection_state_changed(old_state: ConnectionState, new_state: ConnectionState) signal snapshot_received(snapshot: Dictionary) -signal handshake_complete(protocol_version: int) +signal handshake_complete signal handshake_failed(reason: String) # Connection states @@ -281,7 +281,7 @@ func _process(delta: float) -> void: # gdlint:disable=max-returns _set_state(ConnectionState.ERROR) return - handshake_complete.emit(0) # D-192: protocol_version field dropped; signal kept for API compat + handshake_complete.emit() _set_state(ConnectionState.CONNECTED) # #646: Request full settings dump on connect — hydrates GameState.ai_enhanced_dialogue_enabled # from server SQLite so the client reflects the authoritative persisted state (D-138). diff --git a/client/tests/test_merge_path_flows_sprint37.gd b/client/tests/test_merge_path_flows_sprint37.gd index 1d4b8eebf..d46d3505d 100644 --- a/client/tests/test_merge_path_flows_sprint37.gd +++ b/client/tests/test_merge_path_flows_sprint37.gd @@ -49,18 +49,22 @@ func after_test() -> void: func _load_main_menu() -> void: var packed := load(MAIN_MENU_SCENE_PATH) as PackedScene - if packed == null: - push_warning("TestMergePathFlowsSprint37: main_menu.tscn not found — skipping") - return + # Hard-fail on missing scene (PR #135 review T3): silent skip turns a broken + # merge-path test into a uselessly green one. + assert_that(packed).override_failure_message( + "main_menu.tscn missing — merge-path coverage is broken, not skipped" + ).is_not_null() _scene = packed.instantiate() add_child(_scene) func _load_char_create() -> void: var packed := load(CHAR_CREATE_SCENE_PATH) as PackedScene - if packed == null: - push_warning("TestMergePathFlowsSprint37: character_creation.tscn not found — skipping") - return + # Hard-fail on missing scene (PR #135 review T3): silent skip turns a broken + # merge-path test into a uselessly green one. + assert_that(packed).override_failure_message( + "character_creation.tscn missing — merge-path coverage is broken, not skipped" + ).is_not_null() _scene = packed.instantiate() # Seed required state so Start is not disabled (guard added in PR #134 / R2-Hoshe-1). # Individual tests override these as needed. add_child() must run first so @@ -75,9 +79,9 @@ func _load_char_create() -> void: func _make_catalog_snapshot() -> Dictionary: ## Minimal valid snapshot with a bookmark_catalog for flow-1 testing. + ## D-192: no version field required; decode accepts snapshots with or without. return { "tick": 0, - "version": 23, "entities": [], "game_time": {"day": 0, "time_of_day": 0, "day_phase": "Morning", "tick_rate": "Full"}, "player_facing": "North", @@ -164,6 +168,13 @@ func test_new_game_catalog_snapshot_resolves_loading_state() -> void: assert_bool(_scene._waiting_for_catalog).override_failure_message( "_waiting_for_catalog must be false after catalog snapshot delivered — #872 regression" ).is_false() + # PR #135 review H4: assert the SimBridge terminus, not just the loading flag. + # In test mode connect_to_sim() jumps state to CONNECTED synchronously; this + # guarantees the flow reached its terminal state, not merely that the catalog + # flag cleared. + assert_int(SimBridge.state).override_failure_message( + "SimBridge must be in CONNECTED terminus after catalog resolves — flow completion guard" + ).is_equal(SimBridge.ConnectionState.CONNECTED) assert_bool(GameState.bookmark_catalog.size() > 0).override_failure_message( "GameState.bookmark_catalog must be populated after catalog snapshot applied" ).is_true() diff --git a/client/tests/test_p0_regressions.gd b/client/tests/test_p0_regressions.gd index 3b4855da0..90605fd25 100644 --- a/client/tests/test_p0_regressions.gd +++ b/client/tests/test_p0_regressions.gd @@ -43,12 +43,13 @@ func after_test() -> void: # -- Helpers ------------------------------------------------------------------- ## Encode a minimal valid snapshot as MessagePack bytes. -## Protocol.decode_snapshot() requires: tick, version, entities (with kind as -## bare string for unit enum variants per rmp_serde wire format). +## Protocol.decode_snapshot() requires: tick, entities (with kind as bare string +## for unit enum variants per rmp_serde wire format). D-192 dropped the version +## field — kept here inertly in existing fixtures so decode still accepts either +## shape while older tests migrate. func _make_snapshot_bytes(overrides: Dictionary = {}) -> PackedByteArray: var snapshot := { "tick": overrides.get("tick", 1), - "version": 23, "entities": overrides.get("entities", [{ "entity_id": 1, "x": 10.0, diff --git a/client/tests/test_protocol_bridge.gd b/client/tests/test_protocol_bridge.gd index 91b9b393d..2f436a999 100644 --- a/client/tests/test_protocol_bridge.gd +++ b/client/tests/test_protocol_bridge.gd @@ -1,8 +1,8 @@ ## D-030 Layer 1: Protocol bridge tests for ObserverSnapshot features. ## Validates player_stance (D-053) and player_inventory (D-065) decode, ## GameState storage, SimBridge test mode, input encoding for stance toggles, -## protocol version checks, and fixture round-trips. -## Spec refs: D-053, D-065, D-020, #449 +## and fixture round-trips. Protocol version checks removed per D-192. +## Spec refs: D-053, D-065, D-020, #449, D-192 class_name TestProtocolBridge extends GdUnitTestSuite