From 0020d597f69f5fbb772d9eabfdeb6f9771234ac1 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 19 Sep 2026 17:28:32 +0200 Subject: [PATCH] Fire control Cut 5b.1: pin ConstantWeapon's PowerRequest arc gate, not just Execute's ConstantWeaponObeysArc only asserted PowerRequest()==0 after Zone.Update had already run Execute, which safes _firing off for its own (also-correct) reason first. PowerRequest short-circuits on _firing regardless of what ArcAllowsFire mutates to, so a mutation dropping ArcAllowsFire from PowerRequest alone was an unpinned survivor even though the harness's own Execute-line mutation was already caught. Added the same assertion before Zone.Update, while _firing is still true and StanceAllowsFire is true, so ArcAllowsFire is the only thing it can be testing. Co-Authored-By: Claude Sonnet 5 --- tests/Aetheria.Shared.Tests/FireControlCut5Tests.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/Aetheria.Shared.Tests/FireControlCut5Tests.cs b/tests/Aetheria.Shared.Tests/FireControlCut5Tests.cs index 8863d5531..c294b59fe 100644 --- a/tests/Aetheria.Shared.Tests/FireControlCut5Tests.cs +++ b/tests/Aetheria.Shared.Tests/FireControlCut5Tests.cs @@ -362,12 +362,21 @@ public sealed class FireControlCut5Tests : IDisposable e.Weapon.Activate(); Assert.True(e.Weapon.Firing); // Activate() sets _firing unconditionally, same as InstantWeapon.Trigger + // Cut 5b (5b.1): pin PowerRequest's own arc term here, before Execute ever runs. _firing is still true + // and StanceAllowsFire is true, so ArcAllowsFire is the only thing this call can be testing -- asking + // only after Zone.Update (below) would be vacuous, because Execute's own gate already drives _firing + // to false first, and PowerRequest short-circuits on _firing regardless of what ArcAllowsFire mutates + // to. Without this line, a mutation that drops ArcAllowsFire from PowerRequest alone was a survivor: + // Execute's separate, correct gate still zeroed Firing and resolvedCount by the time the old + // post-Update PowerRequest assertion ran, so that assertion was trivially satisfied either way. + Assert.Equal(0f, e.Weapon.PowerRequest(.1f)); + var resolvedCount = 0; e.Zone.ShotResolved.Subscribe(_ => resolvedCount++); - e.Zone.Update(.1f); // ConstantWeapon.Execute runs -- the arc gate should safe it off on this tick + e.Zone.Update(.1f); // ConstantWeapon.Execute runs -- its own arc gate should safe it off on this tick Assert.False(e.Weapon.Firing); - Assert.Equal(0f, e.Weapon.PowerRequest(.1f)); + Assert.Equal(0f, e.Weapon.PowerRequest(.1f)); // trivially 0 now (_firing is false) -- kept as a sanity check Assert.Equal(0, resolvedCount); }