"""Extract unchanged hash dependencies into an own-allocation-only test host."""
from pathlib import Path
import subprocess
source=Path('Native/ManagedPlugin/Navigation.GalaxyFilterFacts.cs').read_text(encoding='utf8')
start=source.index('    static ulong GalaxyFactHash(')
end=source.index('    static bool GalaxyFactFindTree(',start)
body=source[start:end]
out=Path('artifacts/galaxy-state-facts-probe');out.mkdir(parents=True,exist_ok=True)
(out/'GeneratedFactHash.cs').write_text('namespace XFEEDToolBox.Plugin;\ninternal static unsafe partial class Navigation\n{\n'+body+'}\n',encoding='utf8')
raise SystemExit(subprocess.call(['dotnet','run','--project','research/GalaxyStateFactsProbe','--artifacts-path','artifacts/galaxy-state-facts-probe-build']))
