State machines: several named transitions between the same pair of states, repeated self transitions as rings; check total 1092 (#162)

admin committed 2026-09-19 16:30:53 +02:00
1 parent 3676ad01e6
commit c436bfc7b8
2 files changed
+12 -5

No files matched your search

+1 -1
@@ -12,7 +12,7 @@ npm run check # typecheck + lint + format:check + tests, the gate CI runs
# code is lost (tail's is reported), so a red run reads as green
npm run build # writes dist/ and regenerates index.html
./build.sh # the same under `set -o pipefail`, for callers that pipe the output
node tools/seed-e2e.mjs && node tools/e2e.mjs # 1088 editor checks, screenshots in /tmp/gm-e2e-*.png
node tools/seed-e2e.mjs && node tools/e2e.mjs # 1092 editor checks, screenshots in /tmp/gm-e2e-*.png
GM_STEPS=20 node tools/e2e.mjs # or 1-12, or 6,20 — a subset while working on one step
./e2e.sh start [GM_STEPS] # the same run detached, see below
./e2e.sh status # live progress, or the last run's result
+11 -4
@@ -28,14 +28,21 @@ therefore still *carries* an `in` and an `out` port — a port is the only ancho
editor — the editor simply never draws them and never lets them be grabbed. Between two states the
edge is a **straight arrow** rather than the usual curve, running border to border with a little
air at each end. Two transitions between the same pair are pushed apart, so a there-and-back pair
lies side by side instead of on top of each other. Two arrows the *same* way round are refused
(`Already connected`), because every transition hangs on the same two ports.
lies side by side instead of on top of each other.
There may also be **several transitions the same way round** between two states, `alarm` and
`seen` from *Patrol* to *Chase*, say. They are told apart only by their name, so a further one is
given a name of its own the moment it is made (`Transition 2`, `Transition 3`, skipping any name
already leaving that state), and the inspector refuses a rename that would make two of them alike,
the empty name included. They are drawn side by side like a there-and-back pair. In a behavior
graph a second edge between the same two ports is still refused (`Already connected`).
A transition may also lead from a state **back into itself**: after *Make transition*, click the
same state again. It is drawn as a **loop over the top edge** of the node, and the inspector lists
it once, under *out*. Taking it **re-enters** the state: `On state exited` and then
`On state entered` fire for it, which is what it is for (attack again, restart a timer). Only
states may do this; any other node connected to itself is still refused.
`On state entered` fire for it, which is what it is for (attack again, restart a timer). A state
may have more than one such loop, under different names; each further one is drawn outside the
last. Only states may do this; any other node connected to itself is still refused.
A transition can be **named**. Select a state and the inspector lists its transitions in two
groups, *out* and *in*, each row with the state at the far end, a name field and a button to