46 lines
2.8 KiB
Markdown
46 lines
2.8 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`.
|
|
|
|
## B1 P1 — mutable `FloorState.entities` compatibility
|
|
|
|
### Root cause and resolution
|
|
|
|
`FloorState.entities` was aggregating `enemies` and `npcs` into a newly allocated dictionary on every read. Consequently, normal legacy operations such as `floor.entities[id] = actor` and `floor.entities.erase(id)` modified only that temporary dictionary.
|
|
|
|
The compatibility property now returns the real `enemies` dictionary. `enemies` and `npcs` remain explicit canonical collections; floor serialization continues to write separate `enemies` and `npcs` dictionaries, and the existing lossless `explored_cells` value serialization is unchanged. `GameState` continues to use the canonical `enemies` API.
|
|
|
|
### Compatibility coverage
|
|
|
|
`test_floor_state_entities_remains_a_mutable_legacy_enemy_alias` assigns the legacy dictionary, performs an indexed set through `entities`, verifies both actors exist in canonical `enemies`, then erases through `entities` and verifies the canonical store is updated.
|
|
|
|
### Verification
|
|
|
|
- `scripts/test-unit.sh`: passed — 62 tests, 546 assertions.
|
|
- `scripts/verify.sh`: passed — unit (62 tests, 546 assertions), integration (1 test, 13 assertions), E2E (18 tests, 199 assertions), and visual checks.
|