Files
opengenesislinkserver/tools/ci/verify_ogl_feature_policy_routing.py
T
OpenGenesis (MPL 2.0) 8eb11eee17 fix(feature): route node policies correctly and stop heartbeat log flood (#218)
* fix(feature): share exact node identity resolution and prefilter foreign policies

* fix(feature): use NodeAgent-compatible machine fallback for empty NodeId

* fix(feature): ignore foreign-node broadcast policies and rate-limit own-node warnings

* test(feature): verify fallback NodeId and foreign-node broadcast selection

* ci(feature): reject foreign-node warning regressions and identity mismatch

* docs(ci): clarify feature policy routing regression intent

* ci(feature): enforce node-scoped policy logs and verification

* docs(feature): explain repeated policy warnings and separate HG purchase regression
2026-10-14 23:56:55 +02:00

30 lines
1.5 KiB
Python

#!/usr/bin/env python3
"""Check feature-policy routing ignores foreign-node updates and preserves own-node validation."""
from pathlib import Path
root = Path(__file__).resolve().parents[2]
read = lambda p: (root / p).read_text(encoding="utf-8")
gate = read("OpenSim/Framework/OglArchiveFeatureGate.cs")
simulator = read("OpenSim/Region/Application/OpenSim.cs")
agent = read("NexVerse/RegionModules/NodeAgent/NexVerseNodeAgentModule.cs")
checks = [
('public static string ResolveNodeId(', gate),
('public static bool IsForConfiguredNode(', gate),
('string.Equals(nodeId, s_NodeId, StringComparison.Ordinal)', gate),
('OglArchiveFeatureGate.ResolveNodeId(', agent),
('OglArchiveFeatureGate.ResolveNodeId(', simulator),
('OglArchiveFeatureGate.IsForConfiguredNode(node)', agent),
('Interlocked.CompareExchange(', agent),
('OglArchiveFeatureGate.Apply(node, revision, expires, flags, signature)', agent),
]
for value, body in checks:
assert value in body, value
policy = agent.split("private void HandleFeaturePolicy(", 1)[1].split(
"private void PublishHeartbeatSafe()", 1)[0]
assert policy.index("IsForConfiguredNode(node)") < policy.index("OglArchiveFeatureGate.Apply(")
assert "Ungültige, fremde oder abgelaufene Richtlinie verworfen." not in policy
assert "m_Log.WarnFormat(" in policy
assert "m_Log.DebugFormat(" in policy
assert "m_LastOwnFeaturePolicyWarningSeconds" in policy
print("Feature policy node routing and warning throttling: OK")