fix: preserve confirmed followup snapshots and expand flow checks
This commit is contained in:
@@ -182,10 +182,12 @@ final class FollowupAudioProbe extends Command
|
||||
/** Checks synthetic audio-only canaries, tail event, and distinct normalized temporal facts. */
|
||||
public static function verifyExtraction(array $result, array $expected): array
|
||||
{
|
||||
$transcript = preg_replace('/\s+/u', '', (string) ($result['transcript'] ?? ''));
|
||||
// ASR punctuation/spacing is not a lexical error; changed words still fail.
|
||||
$spokenWords = static fn (string $text): string => preg_replace('/[\p{P}\p{Z}\s]+/u', '', $text);
|
||||
$transcript = $spokenWords((string) ($result['transcript'] ?? ''));
|
||||
$canaries = true;
|
||||
foreach ($expected['canaries'] ?? [] as $canary) {
|
||||
$canaries = $canaries && is_string($canary) && $canary !== '' && str_contains($transcript, preg_replace('/\s+/u', '', $canary));
|
||||
$canaries = $canaries && is_string($canary) && $canary !== '' && str_contains($transcript, $spokenWords($canary));
|
||||
}
|
||||
$matched = [];
|
||||
foreach ($expected['facts'] ?? [] as $index => $fact) {
|
||||
|
||||
Reference in New Issue
Block a user