Files
prop-ai-hr/scripts/tests/package-aug1-release.test.ps1

64 lines
2.8 KiB
PowerShell

$ErrorActionPreference = 'Stop'
$projectRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
$scriptPath = Join-Path $projectRoot 'scripts\package-aug1-release.ps1'
$devSetupPath = Join-Path $projectRoot 'docs\DEV_SETUP.md'
$source = Get-Content -Raw -Encoding UTF8 -LiteralPath $scriptPath
$requiredFragments = @(
"output\aug1-rc\0.1.13-113-af8af2f6-frozen",
'af8af2f6dd169e4616a4ca0ca724e8b809502ab3',
'Runtime commit must be an ancestor of the operations commit',
'Frozen evidence is not release eligible',
'Frozen APK hash mismatch',
'Frozen backend JAR hash mismatch',
'Content candidate hash mismatch',
'Release approval candidate hash mismatch',
'Release approval APK signer mismatch',
"'operations/release-backend.sh'",
"'operations/release-preflight.sh'",
"'operations/verify-aug1-production-api-readonly.sh'",
"'operations/verify-aug1-authenticated-production.sh'",
"'operations/verify-aug1-content-candidates.mjs'",
"'operations/verify-aug1-formal-content.mjs'",
"'operations/verify-aug1-release-readiness.sh'",
"'operations/capture-android-acceptance.ps1'",
"'operations/go-no-go.md'",
"'operations/business-content-and-five-channel-signoff.md'",
'Release package already exists and will not be overwritten',
'Go/No-Go snapshot does not contain the release-package table row',
'archive cannot embed its own final hash',
'Release package expected 20 files',
'ZIP verification expected 20 entries',
'ZIP entry hash mismatch',
'package_verified=true',
'authenticatedFixedCodeSmokePassed = $true',
'fixedCodeNoRealSmsConfirmed = $true',
'deployPlanSmsOrLoginTriggered = $false',
"artifact = 'aug1-release-approval.json'",
'approvedPolicyQuestions = $approvedQuestionCount',
'approvedDirectChannels = $approvedChannelCount',
'controlledDistributionStatus = $distributionApprovalStatus'
)
foreach ($fragment in $requiredFragments) {
if (-not $source.Contains($fragment)) {
throw "August 1 packager is missing required fragment: $fragment"
}
}
if ($source -match 'Compress-Archive') {
throw 'August 1 packager must use sorted entries and a fixed timestamp, not Compress-Archive.'
}
if ($source -match '\[switch\]\$Force') {
throw 'August 1 packager must not expose an overwrite switch.'
}
if ($source.Contains('manualPrivacyChoicePending') -or $source.Contains('authenticated business, content')) {
throw 'August 1 packager still describes completed fixed-code authentication as a pending gate.'
}
$devSetup = Get-Content -Raw -Encoding UTF8 -LiteralPath $devSetupPath
if (-not $devSetup.Contains('.\scripts\package-aug1-release.ps1')) {
throw 'DEV_SETUP is missing the August 1 release packaging command.'
}
Write-Output 'PASS: August 1 release packager freezes runtime and operations separately without overwriting prior packages'