From 1360b7168452b85a4366dbb4c91c15894c828c61 Mon Sep 17 00:00:00 2001 From: Erik Date: Mon, 24 Aug 2026 13:01:33 +0200 Subject: [PATCH] =?UTF-8?q?test:=20tie=20the=20soak's=20move-truth=20grep?= =?UTF-8?q?=20to=20a=20live=20emitter=20=E2=80=94=20both=20ends=20now=20br?= =?UTF-8?q?eak=20together?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The r6 soak hard-fails without 'move-truth OUT' lines, yet the only automated guard was a text assertion that the SCRIPT sets the env var — it stayed green while #435 part 2 deleted the emitter, and the breakage would have surfaced as a misleading connected-gate failure. The new contract test asserts all four links of the chain in one place: the script greps the pattern, MovementTruthDiagnosticController still emits it, RuntimeOptions still parses the flag, and GameWindow still wires it through. Deleting any link fails here, at build time, with the reason. Co-Authored-By: Claude Fable 5 --- .../ConnectedWorldSoakRouteContractTests.cs | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/tests/AcDream.App.Tests/Diagnostics/ConnectedWorldSoakRouteContractTests.cs b/tests/AcDream.App.Tests/Diagnostics/ConnectedWorldSoakRouteContractTests.cs index 76282efb..b6faeaf0 100644 --- a/tests/AcDream.App.Tests/Diagnostics/ConnectedWorldSoakRouteContractTests.cs +++ b/tests/AcDream.App.Tests/Diagnostics/ConnectedWorldSoakRouteContractTests.cs @@ -441,6 +441,43 @@ public sealed class ConnectedWorldSoakRouteContractTests Assert.Contains("$env:ACDREAM_DUMP_MOVE_TRUTH = '1'", source, StringComparison.Ordinal); } + [Fact] + public void MoveTruthGrepPatternIsBackedByALiveEmitter() + { + // #435/#437: the soak HARD-FAILS every destination when fewer than + // two fresh 'move-truth OUT' lines appear, and this env-var text + // assertion alone stayed green while the emitter was deleted — the + // script kept setting a flag nothing read. Tie BOTH ends together: + // the script must grep the pattern, and the client must still + // contain a reachable emitter producing it, gated on the option the + // script sets. Deleting either side now fails here instead of + // failing the next connected soak with a misleading message. + string script = File.ReadAllText(Path.Combine( + FindRepoRoot(), + "tools", + "run-connected-r6-soak.ps1")); + Assert.Contains("'move-truth OUT'", script, StringComparison.Ordinal); + + string emitter = File.ReadAllText(Path.Combine( + FindRepoRoot(), + "src", "AcDream.App", "Input", + "MovementTruthDiagnosticController.cs")); + Assert.Contains("move-truth OUT", emitter, StringComparison.Ordinal); + + string options = File.ReadAllText(Path.Combine( + FindRepoRoot(), "src", "AcDream.App", "RuntimeOptions.cs")); + Assert.Contains( + @"env(""ACDREAM_DUMP_MOVE_TRUTH"")", + options, + StringComparison.Ordinal); + string window = File.ReadAllText(Path.Combine( + FindRepoRoot(), "src", "AcDream.App", "Rendering", "GameWindow.cs")); + Assert.Contains( + "options.DumpMoveTruth", + window, + StringComparison.Ordinal); + } + [Fact] public void BaselineIdentityComesFromTheMeasuredBinaryRatherThanOnlyTheCheckout() {