Files
DungeonCrawlerWorld/S4_ROUND_2_REPORT.md
T

59 lines
3.5 KiB
Markdown

# S4 round 2 — external audio ruling
## Decision
The S4 prototype may discover admitted audio filenames under the configured ASCII external roots, but it must never ask Godot to read, decode, import, or play those files. This is a safety boundary, not a codec-validation problem: a superficial signature cannot establish that a file is complete or safe for a downstream loader.
## Implementation
- `AudioLibrary` retains best-effort, error-free directory discovery for the documented roots and admitted extensions.
- The last discovered ambience/SFX paths remain diagnostic-only public getters.
- All byte-signature checks and `FileAccess` header reads were removed.
- All `AudioStream*.load_from_file` calls, stream players, and external-load helper paths were removed.
- `has_playable_ambience()` and `has_playable_sfx()` are public diagnostics and currently always return `false`.
- `set_ambience_context` and `play_sfx` still accept their supported requests and cannot block or change game-state resolution.
## Verification coverage
Unit and E2E coverage create both a structurally nominal WAV and a truncated/invalid WAV in the external layout. They assert discovery remains diagnostic-only, neither file is playable through the public API, and combat still resolves normally. The README now states that discovery does not promise readability or playback.
## S5.1 RED evidence reconstruction
On base `515cf72`, a test referencing `Game.REFERENCE_VIEWPORT` produced:
```text
SCRIPT ERROR: Parse Error: Cannot find member REFERENCE_VIEWPORT in base Game
```
The runner exited with status `1`.
## A5 RED evidence reconstruction — input pipeline and E/north-east conflict
The A5 action-router baseline (`7f35300`) had two test-quality defects: its E2E tests invoked `Game._unhandled_input()` directly rather than exercising Godot's input dispatcher, and the physical **E** binding was assigned to both `interact` and `move_northeast`. The latter made the router's action selection depend on catalog ordering, not on an unambiguous input map.
Before applying the correction, the following minimal contract was run in a detached worktree at `7f35300`. `addons/` was copied into that temporary historical worktree because it is supplied in this checkout but ignored by Git; `godot --headless --path . --import` was run first so GUT class names were registered.
```gdscript
extends GutTest
func test_e_is_reserved_for_interaction_not_northeast_movement() -> void:
var e_key := InputEventKey.new()
e_key.keycode = KEY_E
e_key.physical_keycode = KEY_E
e_key.pressed = true
assert_true(InputMap.action_has_event(&"interact", e_key))
assert_false(InputMap.action_has_event(&"move_northeast", e_key))
```
Command:
```text
/snap/bin/godot4 --headless --path . -s res://addons/gut/gut_cmdln.gd \
-gdir=res://tests/tdd_red -gexit
```
It returned status **1**, with `0/1 passed`, `Failing Tests 1`, and `Asserts 1/2`; the second assertion (line 10) failed because `move_northeast` contained `KEY_E` on the baseline. This is the explicit RED proof for the conflict.
GREEN replaces that north-east binding with `KEY_KP_9`, retaining **E** exclusively for `interact`. `tests/unit/test_action_router.gd` permanently asserts the mutually exclusive E/keypad-9 bindings. The E2E regression test now sends press and release events with `Input.parse_input_event()` and awaits a process frame after each dispatch, thereby testing the real Godot input pipeline rather than calling the handler directly. The HUD and README name keypad 9 as the north-east control.