完成40%

This commit is contained in:
rain
2026-07-23 17:21:27 +08:00
parent f1edc6b533
commit bb6431b319
114 changed files with 10931 additions and 877 deletions
+3 -2
View File
@@ -4,7 +4,7 @@ $page = Get-Content -LiteralPath (Join-Path $root 'pages/genealogy/g01-my-geneal
$mock = Get-Content -LiteralPath (Join-Path $root 'data/mock.js') -Raw -Encoding UTF8
$api = Get-Content -LiteralPath (Join-Path $root 'utils/api.js') -Raw -Encoding UTF8
$context = Get-Content -LiteralPath (Join-Path $root 'utils/genealogy-context.js') -Raw -Encoding UTF8
foreach ($token in @('genealogyContext', 'setCurrentGenealogyId', 'reconcileCurrentGenealogyId', 'invalidateCurrentGenealogyId', 'isCurrentGenealogyInvalidated', 'reconcilePageGenealogyContext', 'getGenealogyFixtureAccess(item.id).accessRole === "owner"', 'getGenealogyFixtureAccess(item.id).accessRole === "member"', 'String(query?.genealogyId || "")', 'contextInvalidated', 'state-panel--context', ') || null,', '<button', ':aria-pressed=')) {
foreach ($token in @('genealogyContext', 'setCurrentGenealogyId', 'reconcileCurrentGenealogyId', 'invalidateCurrentGenealogyId', 'isCurrentGenealogyInvalidated', 'reconcilePageGenealogyContext', 'item.accessRole === "owner"', 'item.accessRole === "member"', 'String(query?.genealogyId || "")', 'contextInvalidated', 'state-panel--context', ') || null,', '<button', ':aria-pressed=', 'appApi.getMyGenealogies', 'createRequestController', 'listRequestController.abort()', 'onUnload')) {
if (-not $page.Contains($token)) { throw "G01 context contract missing: $token" }
}
foreach ($token in @('CURRENT_GENEALOGY_INVALIDATED_KEY', 'normalizeGenealogyId', 'getCurrentGenealogyId: readCurrentGenealogyId', 'invalidateCurrentGenealogyId:', 'isCurrentGenealogyInvalidated:', 'new Set(normalizedIds).size !== normalizedIds.length', 'normalizedIds.includes(normalizedPreferredId)', 'normalizedIds.includes(storedId)', 'if (normalizedPreferredId)', 'if (storedId)')) {
@@ -12,7 +12,8 @@ foreach ($token in @('CURRENT_GENEALOGY_INVALIDATED_KEY', 'normalizeGenealogyId'
}
if ($page.Contains('Number(query?.genealogyId)')) { throw 'G01 must not coerce a genealogy ID to Number' }
if ($page -match 'currentGenealogy\s*=\s*computed\([\s\S]*?\|\|\s*availableGenealogies\.value\[0\]') { throw 'G01 must not silently fall back to the first genealogy after permission loss' }
if ($page -notmatch '(?s)const retryLoad = \(\) => \{.*?reconcilePageGenealogyContext\(\)') { throw 'G01 context failure retry must rerun reconciliation instead of exposing a dead button' }
if ($page -notmatch '(?s)const retryLoad = \(\) => \{\s*loadGenealogies\(\)') { throw 'G01 retry must rerun the remote list owner instead of exposing a dead button' }
if ($page -match '@/data/mock\.js|getGenealogyFixtureAccess|listNotificationFixtures') { throw 'G01 remote page must not retain fixture data owners' }
foreach ($membership in @("membership: 'created'", "membership: 'joined'")) {
if (-not $mock.Contains($membership)) { throw "Genealogy mock ownership missing: $membership" }
}