fix(ui): PR #203 review round — total retirement + bin decode + wired reset

Tyre finding: the orphaned AtlasViewer cluster is now actually deleted
(atlas_viewer, atlas_marker_overlay, atlas_descend_geometry,
atlas_legend_panel — a sixth orphan found beyond the review list —
atlas_generation_proxy, atlas_generation_state; ~2,497 lines), with
reachability re-verified across preload/class_name/res:// strings,
every .tscn, and the standalone companion app. Test suites triaged,
not blanket-deleted: 5 pure AtlasOverlayColors tests relocated into
test_atlas_window_colors, the live type-identity regression guard
relocated into test_step_canvas_viewer, dead coverage deleted. A real
harness gap surfaced during diligence and RULED, not patched:
visual_scenarios/visual_capture golden shots call retired
continuous-zoom API — no shim (would resurrect what D-255 kills);
inventory recorded on re-scoped T-1157 (gate-invisible, manual
targets only).

Hoshe finding 1: decode_png_field now detects the [Error,
PackedByteArray] bin-shape from messagepack.gd explicitly — a genuine
msgpack bin payload decodes correctly instead of silently collapsing
to [0,0]; test built from a real round-tripped bin decode.

Hoshe finding 2: the hard zoom-out reset is wired — ascend at rung 0
with a drifted view triggers _reset_to_global (the restored HARD
condition), behavioral tests through the real input path.

Notes folded: refloat + edge-scroll test coverage, legend smoke suite,
Vector2i narrowing-safety comment with computed headroom.

gdlint clean on touched files; full client suite 3364/3364.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-25 09:32:52 +02:00
co-authored by Claude Fable 5
parent d7fc26bd2a
commit 76d82a6a51
16 changed files with 528 additions and 3831 deletions
+34
View File
@@ -210,3 +210,37 @@ func test_decode_png_field_malformed_input_returns_empty_packed_byte_array() ->
assert_that(Protocol._scp().decode_png_field({"png_bytes": "not an array"})).is_equal(
PackedByteArray()
)
## PR #203 review (Hoshe finding 1) — the genuine msgpack `bin_8`/`bin_16`/
## `bin_32` decode path. messagepack.gd's own decoder returns
## `StreamPeerBuffer.get_partial_data()`'s `[Error, PackedByteArray]` pair for
## a bin-typed field — which passes decode_png_field()'s `is Array` guard
## just as readily as the real (today's) array-of-ints shape, so this must be
## exercised with the REAL bin-shaped decode output, not a hand-built
## Dictionary, to prove the fix actually detects it. Built by round-tripping
## a genuine PackedByteArray value through Messagepack.encode()/decode()
## directly (bypassing step_canvas_protocol.gd's own encoder, which never
## sends a PackedByteArray for png_bytes today) — this is exactly the shape
## a future serde_bytes-annotated server would produce.
func test_decode_png_field_handles_the_genuine_bin_type_shape() -> void:
var real_png_bytes := PackedByteArray([0x89, 0x50, 0x4e, 0x47, 1, 2, 3, 4])
var encoded = Messagepack.encode(real_png_bytes)
assert_that(encoded.status).is_null()
var decoded = Messagepack.decode(encoded.value)
assert_that(decoded.status).is_null()
# Sanity: this really is the [error, data] pair shape, not the plain-array
# shape the rest of this suite exercises — if messagepack.gd's own
# behavior ever changes, this assertion fails loudly instead of the test
# silently exercising the wrong code path.
var bin_shape: Variant = decoded.value
assert_bool(bin_shape is Array).is_true()
assert_int((bin_shape as Array).size()).is_equal(2)
assert_bool((bin_shape as Array)[0] is int).is_true()
assert_bool((bin_shape as Array)[1] is PackedByteArray).is_true()
var result: PackedByteArray = Protocol._scp().decode_png_field({"png_bytes": bin_shape})
assert_that(result).override_failure_message(
"bin-shaped png_bytes must decode to the REAL inner bytes, not silently"
+ " collapse to [0, 0] via PackedByteArray([int, PackedByteArray]) coercion"
).is_equal(real_png_bytes)