32 lines
1.4 KiB
PowerShell
32 lines
1.4 KiB
PowerShell
$ErrorActionPreference = 'Stop'
|
|
$root = Split-Path -Parent $PSScriptRoot
|
|
$page = Get-Content -LiteralPath (Join-Path $root 'pages/genealogy/g12-generation-poems.vue') -Raw -Encoding UTF8
|
|
foreach ($token in @(
|
|
'MAX_GENERATION_COUNT',
|
|
'MAX_GENERATION_TEXT_LENGTH',
|
|
'MAX_GENERATION_POEM_INPUT_LENGTH',
|
|
'validateGenerationPoemText',
|
|
'findFirstGenerationGap',
|
|
'mergeGenerationPoemRows',
|
|
':maxlength="MAX_GENERATION_POEM_INPUT_LENGTH * 2"',
|
|
'disableMissing.value',
|
|
'const disableMissing = ref(false)',
|
|
'const POEM_RENDER_BATCH_SIZE = 50',
|
|
'const visiblePoemRows = computed',
|
|
'const loadMorePoems = () =>',
|
|
'v-for="item in visiblePoemRows"',
|
|
'GENERATION_POEM_STATUS.DISABLED',
|
|
'const activeRows = nextRows.filter',
|
|
'const firstGap = lastActiveGeneration === null',
|
|
'if (firstGap !== null)',
|
|
'overflow-wrap: anywhere',
|
|
'word-break: break-word'
|
|
)) {
|
|
if (-not $page.Contains($token)) { throw "G12 capacity contract missing: $token" }
|
|
}
|
|
foreach ($forbidden in @('stopMissingOldGeneration', 'MAX_GENERATION_POEM_LENGTH', 'query.startGeneration', 'query.currentGeneration', 'maxlength="50"', ':maxlength="MAX_GENERATION_POEM_INPUT_LENGTH"', ':maxlength="-1"')) {
|
|
if ($page.Contains($forbidden)) { throw "G12 retains an unsafe generation contract: $forbidden" }
|
|
}
|
|
if ($page -match '\.slice\(0,\s*4\)') { throw 'G12 must not truncate poem data to four generations' }
|
|
Write-Output 'G12-GENERATION-POEM-CAPACITY-CONTRACT PASS'
|