Repository navigation
Commit fc65a83
spike(eval): M17 Phase C — multimodal LLM judge gates (script + report stub) (#113)
* spike(eval): M17 Phase C — multimodal LLM judge gates (script + report stub)
Mirrors the Phase A spike protocol (scripts/m17_phase_a_validation.py +
docs/m17_phase_a_validation_report.md) for E5 — the Multimodal LLM Judge
evaluator from docs/automated_eval_design.md §E5. This unlocks the eval
loop that issues #92 and #97 are currently blocked on (both require
native-speaker listening which doesn't scale).
Script (scripts/m17_phase_c_validation.py):
- 6-clip set: 4 corpus typology spans (SV/IT/NEG/NEU, all M2a-wettest
agg_m_30-45_001) + 2 degraded variants of sp_sv_a_0001_00 (white noise
at +10 dB and -10 dB SNR, RMS-matched to the clean source so the
judge is scoring spectral content, not amplitude).
- Two models: gemini-2.5-pro (audio input) and gpt-4o-audio-preview.
- Two reruns per (clip, model) for within-model variance measurement.
- Structured JSON output via a fixed schema (8 quality dimensions on a
1-5 scale + artifacts_detected + confidence_in_assessment + summary).
- Four gate outcomes per model:
refusal_gate ≥ 5/6 clips scored under DV-research framing
discrimination_gate mean(corpus) − mean(severe-degraded) ≥ 0.5
variance_gate per-dim std across 2 reruns ≤ 0.5
shay_correlation_gate Spearman ρ ≥ 0.3 vs encoded expected ranking
- Gemini BLOCK_NONE safety per design doc §E5 content-sensitivity
guidance (research framing only — DV-content tolerance is required to
avoid refusals on the metadata; the audio is entirely synthetic and
contains no real persons).
- Hard budget cap via SYNTHBANSHEE_LLM_SPIKE_BUDGET_USD (default $5);
aborts pre-flight on estimate, aborts mid-run on cumulative actual.
- --dry-run flag prints the prompt + schema without calling any API,
for pre-flight prompt audit.
- Lazy imports for google-genai / openai so the module is cheap to
import even without the deps installed.
Report stub (docs/m17_phase_c_validation_report.md):
- Same structure as the Phase A report (TL;DR gate table, Reproduce,
Clip-set manifest, Gate definitions, Per-model results, Failure-mode
notes, Recommendation matrix, Limitations, Cost report).
- All numeric cells marked TBD pending real-run results.
- Recommendation matrix is pre-filled per gate-outcome scenario so the
go/no-go decision is mechanical once the script runs.
Cost estimate at default settings: ~$3.05 total ($0.35 Gemini + $2.70
GPT-4o), well within the $5 cap. Dry-run verified end-to-end.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* fix(spike/m17-phase-c): address all critical+high review findings before running
Critical:
- Replace wn_snr_+10db mid-anchor with synth_rate_slow_0.7x — tests synthesis
defect detection (unnatural tempo + pitch-shift + truncated arc) instead of
measuring only whether the model can hear noise
- Add --probe-metadata-bias flag: runs a no_arc prompt variant on corpus clips
to measure whether emotional_expression / escalation_arc are scored from audio
or inferred from the intensity-arc label; delta is reported per-clip per-dim
in both results.json and report_auto.md
High:
- Add failure_reason field to JudgeResult ("ok" / "content_refusal" /
"json_parse_error" / "api_error") so only content refusals count against the
refusal gate; api_error and json_parse_error are retried, not penalised
- Incremental write: results_partial.jsonl is appended after each call;
--resume loads prior results and skips completed (clip, model, run, variant)
tuples — an API failure or budget-cap abort no longer loses all spend
- Drop shay_correlation and variance from overall_pass (advisory only);
add notes: variance is trivially PASS at TEMPERATURE=0 greedy decoding,
Shay rho is not statistically significant at n=4
- Discrimination gate now tests two independent arms — noise_corruption and
synth_failure — reporting both separations; passing either arm clears the gate
Low:
- Fix report stub: gate table columns aligned with report_auto.md output,
hand-written per-run tables removed (replaced with pointers to auto-report),
limitations section updated to reflect all of the above
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
* docs(spike/m17-phase-c): fix module docstring — reflect two-arm discrimination gate
Update the gate bullet-list in the module docstring to match what the code
actually does after the review-fixes commit: two discrimination arms
(noise_corruption comparability + synth_failure real target), advisory notes
on variance and Shay-correlation, failure_reason semantics for refusal gate.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>1 parent 1ea48f3 commit fc65a83
2 files changed
Lines changed: 1444 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
0 commit comments