$ErrorActionPreference = 'Stop' $activeFiles = @( 'pages/genealogy/g01-my-genealogies.vue', 'pages/genealogy/g06-search-genealogies.vue' ) foreach ($file in $activeFiles) { $source = Get-Content $file -Raw -Encoding UTF8 foreach ($forbidden in @('location.hash', 'new URLSearchParams', 'hashchange')) { if ($source.Contains($forbidden)) { throw "$file must not read native route state through $forbidden" } } if ($source -notmatch 'onLoad\s*\(\s*\(?\s*query\b') { throw "$file must consume its native query through onLoad(query)" } } $g01 = Get-Content 'pages/genealogy/g01-my-genealogies.vue' -Raw -Encoding UTF8 $g06 = Get-Content 'pages/genealogy/g06-search-genealogies.vue' -Raw -Encoding UTF8 if ($g01 -notmatch 'query\?\.state') { throw 'G01 must normalize presentation state from onLoad query' } if ($g06 -notmatch 'query\?\.mode\s*===\s*"invite"') { throw 'G06 must whitelist invite mode from onLoad query' } $g03 = Get-Content 'pages/genealogy/g03-create-genealogy.vue' -Raw -Encoding UTF8 if ($g03 -match 'onLoad\s*\(|query\?\.(?:step|genealogyId)|step=ancestor') { throw 'G03 has no route parameters; its ancestor transition must remain internal' } Write-Output 'NATIVE-ROUTE-QUERY-CONTRACT PASS'