Ariver
2026-07-12 3797b4105ecd1f5af071a337dd67718cd3776c0d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/env bash
set -euo pipefail
 
if [[ $# -ne 1 ]]; then
  echo "Usage: $0 /path/to/qa-evidence-YYYYMMDD-HHMMSS.zip" >&2
  exit 2
fi
 
evidence_zip="$1"
if [[ ! -f "$evidence_zip" ]]; then
  echo "Evidence zip not found: $evidence_zip" >&2
  exit 2
fi
 
workdir="$(mktemp -d)"
cleanup() {
  rm -rf "$workdir"
}
trap cleanup EXIT
 
unzip -q "$evidence_zip" -d "$workdir"
 
find_one() {
  local name="$1"
  find "$workdir" -type f -name "$name" -print -quit
}
 
require_file() {
  local name="$1"
  local path
  path="$(find_one "$name")"
  if [[ -z "$path" ]]; then
    echo "FAIL missing $name" >&2
    return 1
  fi
  echo "$path"
}
 
check_pattern() {
  local label="$1"
  local file="$2"
  local pattern="$3"
  if rg -q "$pattern" "$file"; then
    echo "PASS $label"
    return 0
  fi
  echo "FAIL $label"
  return 1
}
 
failures=0
 
qa_results="$(require_file "qa-results.tsv")" || failures=$((failures + 1))
app_log="$(require_file "app.log")" || failures=$((failures + 1))
target_text="$(require_file "qa-target-dictation-text.txt")" || failures=$((failures + 1))
system_info="$(require_file "system-info.txt")" || failures=$((failures + 1))
 
if [[ -n "${qa_results:-}" ]]; then
  if rg -q '^NEEDS_EVIDENCE' "$qa_results"; then
    echo "FAIL qa-results.tsv contains NEEDS_EVIDENCE"
    rg '^NEEDS_EVIDENCE' "$qa_results" || true
    failures=$((failures + 1))
  else
    echo "PASS qa-results.tsv has no NEEDS_EVIDENCE"
  fi
fi
 
if [[ -n "${app_log:-}" ]]; then
  check_pattern "startup log" "$app_log" 'PrivateVoice Dictation starting' || failures=$((failures + 1))
  check_pattern "engine ready log" "$app_log" 'ASR engine ready|Engine initialized' || failures=$((failures + 1))
  check_pattern "recording log" "$app_log" 'Recording started' || failures=$((failures + 1))
  check_pattern "recognized text log" "$app_log" 'Recognized:' || failures=$((failures + 1))
  check_pattern "paste success log" "$app_log" 'PERF paste_done.*result=success|PERF fallback_type_done.*result=success' || failures=$((failures + 1))
fi
 
if [[ -n "${target_text:-}" ]]; then
  if [[ -s "$target_text" ]] && [[ -n "$(tr -d '[:space:]' < "$target_text")" ]]; then
    echo "PASS Notepad target text captured"
  else
    echo "FAIL Notepad target text is empty"
    failures=$((failures + 1))
  fi
fi
 
if [[ -n "${system_info:-}" ]]; then
  check_pattern "Windows system info" "$system_info" 'Windows|Microsoft|CsSystemType|WindowsProductName' || failures=$((failures + 1))
fi
 
echo
if [[ "$failures" -eq 0 ]]; then
  echo "WINDOWS_QA_EVIDENCE_PASS"
  exit 0
fi
 
echo "WINDOWS_QA_EVIDENCE_FAIL failures=$failures"
exit 1