Verify all approved voice PCM directly in actual APK with negative controls

This commit is contained in:
NINI
2026-10-06 23:33:24 +09:00
parent 8b2f2d6489
commit 931b5f42e7
4 changed files with 181 additions and 2 deletions
+6 -2
View File
@@ -13,12 +13,16 @@ try {
Check 'final-and-deliverable-apk-identical' ((Get-FileHash -LiteralPath $standard).Hash-eq$record.apkSha256) $standard
$adoption=Get-Content -LiteralPath (Join-Path $projectRoot 'SourceAssets/Audio/Voice/active-adoption.json') -Raw|ConvertFrom-Json
Check 'approved44-active-voices' ($adoption.approvedCount-eq44-and$adoption.draftCount-eq0-and$adoption.clips.Count-eq44-and@($adoption.clips.id|Sort-Object -Unique).Count-eq44) 'All active voices approved, no draft'
$packed=@(Get-Content -LiteralPath ($ApkPath+'.packed-assets.txt'))
& pwsh -NoProfile -File (Join-Path $PSScriptRoot 'inspect-voice-payload.ps1') -ApkPath $ApkPath -EvidenceDir (Join-Path $EvidenceDir 'VoicePayload')
$voiceExit=$LASTEXITCODE;$voicePayload=Get-Content -LiteralPath (Join-Path $EvidenceDir 'VoicePayload/apk-voice-payload.json') -Raw|ConvertFrom-Json
Check 'actual-apk44-voice-payloads' ($voiceExit-eq0-and$voicePayload.status-eq'passed'-and$voicePayload.apkSha256-eq$record.apkSha256-and$voicePayload.actualClipCount-eq44-and$voicePayload.checks.Count-eq44-and@($voicePayload.checks|Where-Object passed -ne $true).Count-eq0) 'Exact actual APK PCM bytes for all44, independent of incremental BuildReport'
& (Join-Path $projectRoot 'artifacts/tools/apk-inspector/Scripts/python.exe') -I (Join-Path $PSScriptRoot 'test-voice-payload-negative.py') --apk $ApkPath --project $projectRoot --evidence (Join-Path $EvidenceDir 'VoicePayloadNegative')
Check 'actual-apk-payload-negative-controls' ($LASTEXITCODE-eq0) 'Same inspector accepts actual44; rejects missing serialized clips and altered actual PCM copies'
foreach($clip in $adoption.clips){
foreach($entry in @(@{kind='source';path=(Join-Path $projectRoot ('SourceAssets/Audio/Voice/'+$clip.sourceFile));expected=$clip.sourceSha256},@{kind='edited';path=(Join-Path $projectRoot ('SourceAssets/Audio/Voice/'+$clip.editedFile));expected=$clip.editedSha256},@{kind='runtime';path=(Join-Path $projectRoot $clip.runtimeFile);expected=$clip.runtimeSha256})){
Check "voice-$($clip.id)-$($entry.kind)-exact-sha" ((Get-FileHash -LiteralPath $entry.path).Hash-eq$entry.expected) $entry.expected
}
Check "voice-$($clip.id)-packed-in-built-apk" ($packed-contains$clip.runtimeFile) 'BuildReport packedAssets contains adopted runtime clip; Unity imported representation, not original WAV byte identity'
Check "voice-$($clip.id)-packed-in-built-apk" (@($voicePayload.checks|Where-Object {$_.id-eq$clip.id-and$_.passed-and$_.runtimeSha256-eq$clip.runtimeSha256}).Count-eq1) 'Deserialized actual APK AudioClip PCM and format exactly match approved runtime WAV'
}
$zip=[IO.Compression.ZipFile]::OpenRead($ApkPath)
try {