moverules: door close pushes overlapped tokens aside (valid-side check, blocked only if no side valid); Push list; tests; mutations m-o

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-08 18:56:06 +01:00
co-authored by Claude Sonnet 5.5
parent 153ff6cd18
commit a29bb0bb46
4 changed files with 150 additions and 33 deletions
+7
View File
@@ -7,6 +7,7 @@
# e: cellsTouched without the fill spans | f: escape rule without the crossing check | g: GM moves checked against walls
# h: capsule reduced to centre path + destination circle (prototype H10) | i: no step cap | j: blocked trigger needs centre-on-wall
# k: wall removal / door open clears blocked unconditionally (no KEEP) | l: GM moves never set/clear blocked
# m: door push goes to the wrong side first | n: door push skips the validity check | o: push ignores the previous-position rule
# Log: results/mutation.log
cd "$(dirname "$0")/.." || exit 1
mkdir -p results
@@ -22,6 +23,9 @@ I="step cap|over-cap, blocked-by-wall|P1:|P2:"
J="wall added within r of the circle|Q14: a door closed"
K="KEEP:|GM manual clear inside|Q14: a door closed"
L="GM moves a stuck token|GM drops a token|GM manual clear inside|GM: ignores walls"
M="Q14: a door closed|push: centre on the door line|push: one side blocked|doorway: token in an open doorway|GM drops a token"
N="push: one side blocked|push: both sides invalid"
O="push: centre on the door line"
rc=0
: > "$LOG"
run() { # $1 id $2 title $3 file to mutate $4 sed script ("" = control) $5 expected-failure regex
@@ -63,5 +67,8 @@ run i "no step cap" server/moverules.nim '/if hypot(dd.x, dd.y) > stepCap(sc, sc
run j "blocked trigger needs the centre on the wall" server/moverules.nim 's/segDist(t.pos, w.a, w.b) < sc.tokenRadius/segDist(t.pos, w.a, w.b) < 1e-9/' "$J"
run k "removal/open clears blocked unconditionally (no KEEP)" server/moverules.nim 's/sc.tokens\[i\].blocked = overlapsAny(sc, sc.tokens\[i\])/sc.tokens[i].blocked = false/' "$K"
run l "GM moves never set or clear blocked" server/moverules.nim '/^ if who.role == roleGM: sc.tokens\[ti\].blocked = /d' "$L"
run m "door push: wrong side first" server/moverules.nim 's/for sg in \[(if side > 0: 1.0 else: -1.0), (if side > 0: -1.0 else: 1.0)\]:/for sg in [(if side > 0: -1.0 else: 1.0), (if side > 0: 1.0 else: -1.0)]:/' "$M"
run n "door push: no validity check" server/moverules.nim 's/if inBounds(sc, p) and not overlapsAny(sc, tt): return (true, p)/return (true, p)/' "$N"
run o "door push: previous position ignored on the line" server/moverules.nim 's/side = if t.hasPrev: dot(t.prev - w.a, n) else: 0.0/side = 0.0/' "$O"
echo "exit=$rc" | tee -a "$LOG"
exit $rc