From bbb86e72e4b2ec78c40379f2356e076b3cfa0daf Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 28 Jun 2026 23:32:49 +0100 Subject: [PATCH] Forbid public Observe state accessors --- Aetheria.State.Verify/Program.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index 498b12aea..84bca700f 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -15775,6 +15775,20 @@ static void RequireRuntimeStateReaderOwnsUnityStateAcquisition(string root) string.Join(", ", clientStateSessionWrapperHits)); } + var publicObserveAccessorHits = System.Text.RegularExpressions.Regex + .Matches( + aetheriaClientState, + @"public\s+[^{;=]+\s+Observe[A-Za-z0-9_]*\s*\(", + System.Text.RegularExpressions.RegexOptions.CultureInvariant) + .Select(match => match.Value.Trim()) + .ToArray(); + if (publicObserveAccessorHits.Length > 0) + { + throw new InvalidOperationException( + "AetheriaClientState reintroduced public Observe* state accessors; expose direct Reactive* typed documents instead: " + + string.Join(", ", publicObserveAccessorHits)); + } + var runtimeStateSessionsPath = Path.Combine(root, "Packages", "org.gamecult.aetheria.state", "Runtime", "AetheriaRuntimeStateSessions.cs"); if (File.Exists(runtimeStateSessionsPath)) {