Cut 7.2: the Cut 3 harness, and the fixture that let commit-is-not-arrival slip

ShotResolvesOnArrival stepped the zone from t=4 straight to t=6, crossing both
the commit horizon (4.5s) and arrival (5s) inside one Zone.Update. A mutation
collapsing Step's arrival gate to `if (shot.Committed)` therefore survived it:
one wide tick crosses both thresholds either way, so the test could not tell
"applied on arrival" from "applied as soon as committed". R4's central
distinction -- the commit decides the outcome, arrival performs it -- was
declared in Cut 3's prose, pinned by nothing, and this is the third rule in this
campaign found undefended by a fixture too coarse to distinguish the mutant.

Adds a tick at t=4.55, past commit and short of arrival, where the durability
must still be untouched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-19 19:56:39 +02:00
commit 76758dae5d
2 changed files with 377 additions and 3 deletions

View file

@ -284,14 +284,22 @@ public sealed class FireAuthorityTests : IDisposable
public void ShotResolvesOnArrival()
{
var e = Build(TestSettings(), damage: 100, velocity: 10, accuracy: 1, resolution: 1, spread: 0, targetRange: 50);
// range 50, velocity 10 -> flight time 5s, well past the .5s commit horizon.
// range 50, velocity 10 -> flight time 5s, commit at 4.5s (.5s horizon), arrival at 5s.
FireControl.Fire(e.Weapon, e.WeaponItem, e.Shooter);
var before = e.Target.Hull.Durability;
e.Zone.Update(4f); // still short of arrival (5s)
e.Zone.Update(4f); // still short of commit (4.5s)
Assert.Equal(before, e.Target.Hull.Durability);
e.Zone.Update(2f); // now past arrival
// Cut 7 (docs/fire-control-cut.md, 7.2): an intermediate check between commit and arrival -- without
// it, jumping straight from before-commit to past-arrival lets "apply as soon as committed, not only
// once also arrived" (Step's arrival gate collapsed to just `if (shot.Committed)`) go unnoticed, since
// a single wide Zone.Update spanning both CommitTime and ArrivalTime crosses both thresholds in one
// call either way.
e.Zone.Update(.55f); // t=4.55: past commit (4.5s), still short of arrival (5s)
Assert.Equal(before, e.Target.Hull.Durability);
e.Zone.Update(1f); // now past arrival
Assert.True(e.Target.Hull.Durability < before);
}