$ErrorActionPreference = 'Stop' function Assert-Contains { param([string]$Content, [string]$Expected, [string]$Message) if ($Content -notmatch [regex]::Escape($Expected)) { throw $Message } } function Assert-NoCssSurface { param([string]$Content, [string]$ClassName) foreach ($property in @('border', 'background', 'border-radius')) { if ($Content -match "(?s)\\.$ClassName\\s*\\{[^}]*\\b$property\\s*:") { throw "G05 must not construct .$ClassName with CSS $property" } } } $root = Split-Path -Parent $PSScriptRoot $g01 = Get-Content -LiteralPath (Join-Path $root 'pages/genealogy/g01-my-genealogies.vue') -Raw -Encoding utf8 $g05 = Get-Content -LiteralPath (Join-Path $root 'pages/genealogy/g05-genealogy-overview.vue') -Raw -Encoding utf8 $asset = Join-Path $root 'static/assets/modules/genealogy/opaque/g05-overview-surface.png' Assert-Contains $g01 'g05-genealogy-overview?genealogyId=' 'G01 must open G05 with the genealogyId query contract' if ($g01 -match 'g05-genealogy-overview\?id=') { throw 'G01 must not retain the obsolete G05 id query key' } foreach ($required in @( "const overviewState = ref('loading')", "query.genealogyId", 'overview-ready', 'overview-state--empty', 'overview-state--error', 'g05-overview-surface.png', '/pages/genealogy/g03-create-genealogy?step=ancestor&genealogyId=', '/pages/tree/t01-tree-overview?genealogyId=', '/pages/genealogy/g10-application-review?genealogyId=', '/pages/genealogy/g11-genealogy-settings?genealogyId=', '/pages/genealogy/g12-generation-poems?genealogyId=', '/pages/family/f01-family-feed' )) { Assert-Contains $g05 $required "Missing G05 overview contract: $required" } if ($g05 -match 'g04-first-ancestor') { throw 'G05 must not navigate to the removed G04 route' } if ($g05 -match 'toJoinApplication') { throw 'G05 must not mislabel the applicant join form as an owner invitation action' } foreach ($className in @('overview-surface', 'overview-action', 'overview-state-panel')) { Assert-NoCssSurface $g05 $className } if (-not (Test-Path -LiteralPath $asset)) { throw 'G05 requires final opaque asset: g05-overview-surface.png' } Write-Output 'G05-OVERVIEW-CONTRACT PASS'