This commit is contained in:
rain
2026-07-24 18:03:02 +08:00
parent c7f278fe79
commit ec8486b035
86 changed files with 7943 additions and 1841 deletions
+14 -75
View File
@@ -5,94 +5,33 @@ function Assert-Contains {
if ($Content -notmatch [regex]::Escape($Expected)) { throw $Message }
}
function Assert-NoCssSurface {
param([string]$Content, [string]$ClassName)
foreach ($property in @('border', 'border-radius')) {
if ($Content -match "(?s)\\.$ClassName\\s*\\{[^}]*\\b$property\\s*:") {
throw "Application flow must not construct .$ClassName with CSS $property"
}
}
}
$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
$profiles = Get-Content -LiteralPath (Join-Path $root 'styles/adaptive-frame-profiles.scss') -Raw -Encoding utf8
foreach ($page in @($g08, $g09, $g10)) {
if ($page -match '<ModulePage') { throw 'G08-G10 must not retain the generic ModulePage shell' }
Assert-Contains $page '<GenealogyPageBackground />' 'G08-G10 must use the accepted shared genealogy background'
if ($page -match "@/utils/api\.js|\bappApi\b") { throw 'G08-G10 design phase must not connect the API layer' }
Assert-Contains $page '<GenealogyPageBackground />' '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 @(
'const joinState = ref("form")',
'join-state--form',
'join-state--success',
'join-state--error',
'adaptive.adaptive-genealogy-state-panel',
'adaptive.adaptive-genealogy-form-field',
'a01-scroll-primary-v3.png',
'findGenealogyFixture',
'query.genealogyId',
'const source = ref("search")',
'const sourceContract = computed(() =>',
'const fieldErrors = reactive({'
)) { Assert-Contains $g08 $required "Missing G08 join contract: $required" }
foreach ($assetName in @('g01-empty-panel-frame.png', 'g-form-field-frame.png')) {
Assert-Contains $profiles $assetName "Adaptive genealogy profile must own: $assetName"
foreach ($required in @('appApi.applyToJoin', 'createRequestController', 'applicantName', 'phone', 'relationDesc', 'applyReason', 'inviterUserId')) {
Assert-Contains $g08 $required "G08 must submit the APP join-application contract field: $required"
}
foreach ($nativeUi in @('uni.showToast', 'uni.showModal', 'uni.showLoading', 'uni.showActionSheet')) {
if ($g08 -match [regex]::Escape($nativeUi)) { throw "G08 must not use native UniApp UI: $nativeUi" }
}
if ($g08 -notmatch '(?s)\.join-field-error\s*\{[^}]*font-size:\s*24rpx;[^}]*line-height:\s*34rpx;') {
throw 'G08 inline validation must remain readable over the illustrated panel'
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 @(
'const applicationState = ref("loading")',
'application-state--list',
'application-state--empty',
'application-state--error',
'adaptive.adaptive-genealogy-list-card',
'"PENDING"',
'"APPROVED"',
'"REJECTED"',
'"LOCAL_WITHDRAWN"',
'const applicationSamples',
'const actionFor = (item) =>',
'const withdrawTarget = ref(null)',
'<AppDialog'
)) { Assert-Contains $g09 $required "Missing G09 application contract: $required" }
Assert-Contains $profiles 'list-slip-frame.png' 'Adaptive genealogy list profile must own the G09 card asset'
foreach ($nativeUi in @('uni.showToast', 'uni.showModal', 'uni.showLoading', 'uni.showActionSheet')) {
if ($g09 -match [regex]::Escape($nativeUi)) { throw "G09 must not use native UniApp UI: $nativeUi" }
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 @(
'const reviewState = ref("loading")',
'review-state--list',
'review-state--empty',
'review-state--error',
'adaptive.adaptive-genealogy-list-card',
'a01-scroll-primary-v3.png',
'a01-scroll-secondary-v3.png',
'const reviewSamples',
'const confirmation = ref(null)',
'const helpVisible = ref(false)',
'<AppDialog',
'review-state--no-permission'
)) { Assert-Contains $g10 $required "Missing G10 review contract: $required" }
foreach ($nativeUi in @('uni.showToast', 'uni.showModal', 'uni.showLoading', 'uni.showActionSheet')) {
if ($g10 -match [regex]::Escape($nativeUi)) { throw "G10 must not use native UniApp UI: $nativeUi" }
foreach ($required in @('appApi.getPendingApplications', 'createRequestController', 'AppLoading', 'applications.value.length')) {
Assert-Contains $g10 $required "G10 must read real pending applications: $required"
}
foreach ($className in @('join-panel', 'join-action', 'application-card', 'review-action')) {
foreach ($page in @($g08, $g09, $g10)) { Assert-NoCssSurface $page $className }
}
$statusAsset = Join-Path $root 'static/assets/modules/genealogy/transparent/list-slip-frame.png'
if (-not (Test-Path -LiteralPath $statusAsset)) { throw 'G09-G10 cards and application empty states require list-slip-frame.png' }
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'