From 0123d673e6e3f2455725dfd58e33a6976ef1d356 Mon Sep 17 00:00:00 2001 From: JohnnyT Date: Wed, 30 Sep 2026 04:43:52 -0600 Subject: [PATCH] Lets the wait's no-timer-edge check fail The map test "a wait carries the clock mark and hears no timer edge" built its wait from config alone. A wait's schema has no event field, so the wait could never pair with the delayed send even if the map counted core.wait among its timer targets, and the edge half of the test could not go red. The test now gives the wait the send's event on its form before drawing the graph, so a wait that joined the timer targets would hear the send and the timers assertion fails. Sabotaged: adding core.wait to the map's timer targets turns the test red. Test-only; no lib change. Gate: full mix quality green on this staged tree (3,951 of 3,951 tests, 95.3% coverage, dialyzer clean, ADR cites green). Refs: sb-jpo8 --- test/statifier_blocks/map_test.exs | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/test/statifier_blocks/map_test.exs b/test/statifier_blocks/map_test.exs index a10d028e..9ed36e5e 100644 --- a/test/statifier_blocks/map_test.exs +++ b/test/statifier_blocks/map_test.exs @@ -629,8 +629,16 @@ defmodule StatifierBlocks.MapTest do # timer edge still runs to the await that hears its event, and nothing # runs to the wait. # + # A wait's schema has no event field, so a wait built from config alone + # could never pair with the send even if the map counted it a timer + # target. The wait is given the send's event on its form here, so the + # edge half bites: a wait that joined the timer targets would hear it. + # # Sabotage: made mark/1 answer "wait" for core.wait; this went red. # Reverted from a copy. + # + # Sabotage: added core.wait to @timer_targets; this went red. + # Reverted from a copy. test "a wait carries the clock mark and hears no timer edge" do root = Block.new("core.sequence", @@ -647,7 +655,23 @@ defmodule StatifierBlocks.MapTest do } ) - graph = root |> Document.new() |> build() |> BlockMap.graph() + view_model = root |> Document.new() |> build() + [%{children: [send, wait, await]} = body] = view_model.root.slots + + event = %ViewModel.Field{ + key: "event", + type: :string, + label: "Event", + required?: false, + default: nil, + value: "loan.overdue" + } + + heard = %{wait | form: %{wait.form | fields: [event | wait.form.fields]}} + body = %{body | children: [send, heard, await]} + view_model = %{view_model | root: %{view_model.root | slots: [body]}} + + graph = BlockMap.graph(view_model) assert marks(graph) == %{ "reminder" => "clock",