From 0f39e89cea5791ac9f114799f886b7182ffb6a10 Mon Sep 17 00:00:00 2001 From: jhuang-tw <77732008+jhuang-tw@users.noreply.github.com> Date: Mon, 17 Aug 2026 23:39:19 -0700 Subject: [PATCH] test(p0): assert Force cannot bypass scope gate --- skills/scripts/test-p0-friction.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/skills/scripts/test-p0-friction.ps1 b/skills/scripts/test-p0-friction.ps1 index c22f9a5..96b542d 100644 --- a/skills/scripts/test-p0-friction.ps1 +++ b/skills/scripts/test-p0-friction.ps1 @@ -145,7 +145,7 @@ foreach ($zc in $zhCases) { else { Bad ("zh route miss {0}: {1}" -f $zc.Expect, ($raw.Substring(0, [Math]::Min(120, $raw.Length)))) } } -# 9) case-guard: ready case exits 0; bare pending exits 2 +# 9) case-guard: ready case exits 0; bare pending exits 2 even with -Force $cg = Join-Path $scriptDir 'case-guard.ps1' & powershell -NoProfile -ExecutionPolicy Bypass -File $cg -CaseRoot $caseRoot 2>&1 | Out-Null if ($LASTEXITCODE -eq 0) { Ok 'case-guard ready exit 0' } else { Bad "case-guard ready exit $LASTEXITCODE" } @@ -153,7 +153,7 @@ $bareRoot = Join-Path $PackageRoot ("work\{0}" -f $bareName) & powershell -NoProfile -ExecutionPolicy Bypass -File $cg -CaseRoot $bareRoot 2>&1 | Out-Null if ($LASTEXITCODE -eq 2) { Ok 'case-guard pending exit 2' } else { Bad "case-guard pending expected 2 got $LASTEXITCODE" } & powershell -NoProfile -ExecutionPolicy Bypass -File $cg -CaseRoot $bareRoot -Force 2>&1 | Out-Null -if ($LASTEXITCODE -eq 0) { Ok 'case-guard -Force exit 0' } else { Bad "case-guard -Force exit $LASTEXITCODE" } +if ($LASTEXITCODE -eq 2) { Ok 'case-guard -Force cannot bypass hard gate' } else { Bad "case-guard -Force expected 2 got $LASTEXITCODE" } # 10) AuthGranted must not be clobbered by junk AuthStatus / multi-asset lab init # Note: -ProjectRoot is passed explicitly to prevent the -InScopeAssets array @@ -402,4 +402,4 @@ if ($fail.Count -gt 0) { exit 1 } Write-Host 'OVERALL: ALL PASS' -ForegroundColor Green -exit 0 +exit 0 \ No newline at end of file