Tests: the one-way chamber ticks a second past the mend, so both the Brain gate and Disabled are pinned

Reverting the withdraw gate to WillBroken switched back only DeliberateLatency (10 ticks)
after the mend, so a test that stopped at the first mended tick missed it; both mutants
(gate and Disabled to WillBroken) now fail. BodyPainBox's comment states the real reason
its first break is the only one: the withdraw pose is terminal and nothing moves the hand
back.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-20 07:40:48 +01:00
commit 619d4a8665
2 changed files with 14 additions and 3 deletions

View file

@ -194,6 +194,7 @@ public sealed class BodyPainBoxSession : IDisposable
_hand = sample;
if (!ticked) return;
// The first break is the only one this run sees: the withdraw pose is terminal (the goal gates on Breaks and is involuntary for good) and nothing moves the hand back into the box, so the will cannot be pushed to a second break here. PainBoxSession, which can be ticked through a mend, guards its own.
if ((events & TickEvents.WillBroke) != 0) _breakTick = tick;
bool inBox = sample.InBox;

View file

@ -248,10 +248,20 @@ public static class Program
break;
}
Check(mended && session.Actor.Drive.Breaks > 0, "the will never mended: the test no longer exercises the rule");
// The box goes off at the tick of the mend: the will no longer reads broken, and a reader that asked WillBroken would call the run a disabled box with the will intact.
// A second past the mend: a withdraw gate that read WillBroken would switch back after DeliberateLatency (10 ticks), so stopping at the first mended tick cannot see it.
for (int i = 0; i < 100; i++)
{
session.Tick(point, point, point, strengths, targets);
Check(session.Actor.GoalIndex == ChamberBrain.WithdrawIndex && !session.Actor.Drive.WillBroken, $"the goal left Withdraw {i} ticks after the will mended");
}
// The box goes off with the will mended: a reader that asked WillBroken would call the run a disabled box with the will intact.
session.SwitchOff();
Check(!session.BoxOn && !session.Disabled(), "a box going off the moment of the mend ended the run as a disabled box");
Check(session.Actor.GoalIndex == ChamberBrain.WithdrawIndex, "the goal left Withdraw as the box went off");
Check(!session.BoxOn && !session.Disabled(), "a box going off after the mend ended the run as a disabled box");
for (int i = 0; i < 100; i++)
{
session.Tick(point, point, point, strengths, targets);
Check(session.Actor.GoalIndex == ChamberBrain.WithdrawIndex, $"the goal left Withdraw {i} ticks after the box went off");
}
}),
("pain box: a break after a mend is a row, not the time to break: the result's break is the first one and never after the run's end", () =>