7.0 KiB
G4 — Master presentation report
Scope and boundary
This is the G4 documentation record for commit ad10e99 (feat: complete graphical feedback pass). It covers presentation translation and feedback only:
- eight semantic event mappings;
- an immutable-at-the-presentation-boundary adapter;
- short, nonblocking feedback UI using the existing dark palette;
- ordered sequence E2E coverage and capture metrics;
- reconstructed RED evidence and final GREEN evidence.
No DCWASCII source or unrelated product area is in scope. G5 is explicitly out of scope; this report makes no G5 claims.
Eight event mappings
EventPresenter.map_event() maps each required domain category to exactly one named PresentationEvent. The source GameEvent remains the authoritative object and is not mutated by presentation.
| Domain event | Presentation kind | Feedback path | Accent |
|---|---|---|---|
damage_dealt (combat family) |
combat |
existing CombatFeedback |
coral/red |
door_opened |
door |
DoorChestFeedback |
cyan |
chest_opened |
chest |
DoorChestFeedback |
gold |
loot_taken (loot family) |
loot |
LootFeedback |
gold |
trap_triggered (trap family) |
trap |
LootFeedback |
red |
spell_cast_started (spell family) |
spell |
cast flash / combat path | violet |
quest_started (quest family) |
quest |
LootFeedback |
green |
actor_died (death family) |
death |
existing CombatFeedback |
red |
The implementation also accepts the related members of each family (for example loot_dropped, trap_disarmed, spell_effect_applied, and quest_completed) while preserving the same eight presentation kinds. Unsupported events pass through the ordered queue without a presentation effect.
Immutable presentation adapter
PresentationEvent is a display-only immutable snapshot of one source GameEvent. Its private backing fields are exposed only through getter-only properties for the normalized presentation kind, notification text, and accent color. Rather than retaining the authoritative event reference, it copies the event values and deep-copies its payload at mapping time; every source_event getter call returns another independent event snapshot. Presentation therefore cannot assign adapter properties, mutate the original GameEvent through the adapter, or alter prior mapped presentation data by changing nested source payload values later.
The mapping unit test mutates both the original event after mapping and a returned adapter snapshot (including a nested payload value), then asserts the mapped values remain captured and the source has no changes caused through the adapter. Direct assignment to a getter-only property is rejected by GDScript at compile time, so the test exercises the equivalent feasible runtime paths without embedding uncompilable code.
EventPresenter emits presentation_started for observation and then emits the original event_presented event after its short feedback interval. This keeps semantic event order visible without coupling domain resolution to rendering details.
Nonblocking feedback UI and dark palette
- Door and chest markers are asynchronous 160 ms expanding/fading diamond cues.
- Loot, trap, and quest notifications are asynchronous 160 ms floating/fading labels.
- Untargeted or starting spells receive a 120 ms cast interval rather than a silent no-op.
- Combat and death retain the existing short combat feedback path.
- Feedback is scene-owned below
EventPresenter; it does not mutate gameplay state, wait on input, or prevent the game from resolving its domain action. - Colors use the established blue-black panel treatment and existing semantic accents: cyan/gold for exploration rewards, violet for magic, green for quest state, and red for danger/death.
The UI therefore gives every required category visible feedback while keeping cues transient and nonblocking rather than introducing a modal presentation layer.
RED reconstruction and GREEN result
RED reconstruction
Before the ad10e99 implementation, EventPresenter only queued GameEvent values and sent every event to CombatFeedback. CombatFeedback had no meaningful view for door, chest, loot, trap, spell-start, or quest events. There was no explicit semantic-to-presentation mapping contract, no display-only adapter, no dedicated exploration/narrative feedback nodes, and no observable presentation sequence seam.
The G4 tests were authored against those missing contracts first:
- The mapping unit specification required
map_event()and named presentation kinds. The pre-change implementation failed to compile/type-check because that API andPresentationEventdid not exist. - The real
Game.tscnsequence specification requiredpresentation_startedand the eight ordered categories. The pre-change scene/presenter had neither the signal nor the dedicated feedback paths.
These failures establish a behavior-level RED state rather than relying on a screenshot mismatch.
GREEN implementation
ad10e99 adds PresentationEvent, the eight-family mapping table, presentation_started, DoorChestFeedback, LootFeedback, scene wiring, and the ordered real-scene E2E test. The E2E enqueues and observes this exact sequence:
combat → door → chest → loot → trap → spell → quest → death
The test asserts one presentation event per source event, preserves order, and ends with an empty presenter queue. The unit contract also asserts that each of the eight canonical domain kinds maps to one named presentation event.
E2E and capture metrics
Recorded final verification for ad10e99 (Godot 4.5.0 / GUT 9.5.0):
| Suite | Result |
|---|---|
| Unit | 186 tests / 1,423 assertions passed |
| Integration | 11 tests / 59,470 assertions passed |
| E2E | 58 tests / 573 assertions passed |
| Visual structural capture | passed |
The non-brittle capture checker validated both scripted 1280×720 captures:
| Capture | Dungeon non-black | Visible | Explored | Unknown | Explored luminance | Unknown luminance |
|---|---|---|---|---|---|---|
visual-check.png |
489,308 | 17,524 | 10,438 | 365,325 | 0.012 | 0.001 |
visual-check-exit.png |
489,252 | 17,404 | 17,146 | 439,497 | 0.012 | 0.001 |
These are structural visibility/fog metrics, not brittle pixel snapshots. The capture checker confirms the dark unexplored field, visible dungeon content, and explored-state luminance remain distinguishable.
The review remediation added one immutable-adapter mapping test. The complete post-remediation ./scripts/verify.sh run passed: unit 187/187 tests, 1,432 assertions; integration 11/11 tests, 59,470 assertions; E2E 58/58 tests, 573 assertions; and both visual structural captures. Existing GUT invalid-UID/resource-cleanup diagnostics are third-party/project warnings, not G4 assertions.
Delivery boundary
This review remediation changes only the PresentationEvent boundary, its mapping coverage, and this G4 report. A local task commit is created after verification; it is intentionally not pushed and no pull request is opened. No G5 work is included.