$ErrorActionPreference = 'Stop' function Assert-Contains { param([string]$Content, [string]$Expected, [string]$Message) if ($Content -notmatch [regex]::Escape($Expected)) { throw $Message } } $root = Split-Path -Parent $PSScriptRoot $g08 = Get-Content -LiteralPath (Join-Path $root 'pages/genealogy/g08-join-application.vue') -Raw -Encoding utf8 $g09 = Get-Content -LiteralPath (Join-Path $root 'pages/genealogy/g09-my-applications.vue') -Raw -Encoding utf8 $g10 = Get-Content -LiteralPath (Join-Path $root 'pages/genealogy/g10-application-review.vue') -Raw -Encoding utf8 foreach ($page in @($g08, $g09, $g10)) { Assert-Contains $page '' 'G08-G10 must use the shared genealogy background' foreach ($nativeUi in @('uni.showToast', 'uni.showModal', 'uni.showLoading', 'uni.showActionSheet')) { if ($page -match [regex]::Escape($nativeUi)) { throw "G08-G10 must not use native UniApp UI: $nativeUi" } } } foreach ($required in @('appApi.applyToJoin', 'createRequestController', 'applicantName', 'phone', 'relationDesc', 'applyReason')) { Assert-Contains $g08 $required "G08 must submit the APP join-application contract field: $required" } if ($g08 -match [regex]::Escape('inviterUserId')) { throw 'G08 must not expose a raw inviter user ID without a candidate selector' } foreach ($retired in @('findGenealogyFixture', 'joinSamples', 'LOCAL_WITHDRAWN', 'applicationSamples')) { if ($g08 -match [regex]::Escape($retired)) { throw "G08 must not retain local application fixture state: $retired" } } foreach ($required in @('appApi.getMyJoinApplications', 'createRequestController', 'AppLoading', 'applications.value.length')) { Assert-Contains $g09 $required "G09 must read real application records: $required" } if ($g09 -match 'applicationSamples|findGenealogyFixture') { throw 'G09 must not display local application fixtures' } foreach ($required in @('appApi.getPendingApplications', 'createRequestController', 'AppLoading', 'applications.value.length')) { Assert-Contains $g10 $required "G10 must read real pending applications: $required" } if ($g10 -match 'reviewSamples|findGenealogyFixture|auditApplication') { throw 'G10 must not invent audit semantics or local review fixtures' } Write-Output 'G08-G10-APPLICATION-FLOW-CONTRACT PASS'