Repository navigation
fix(batch): record held VAD evidence on provider failed_held settles - #24249
Conversation
The rollout guard's T2 held-VAD census reads measured_held_vad_speech_seconds from the job; provider units logged no worker receipt, so every provider failed_held unit was VAD-unknown and T2 could never read clean. Settle now records the CPU Silero measurement through held_vad_census, as quarantine recovery does. Pins the job-doc route proof the observer reads for F1. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
1 issue found across 2 files
Confidence score: 4/5
test_batch_provider_stt.pydoes not verify the required absence of evidence for abandoned running intents. Add the same absence assertion totest_abandoned_running_intent_settles_failed_held_without_spend.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="backend/tests/unit/test_batch_provider_stt.py">
<violation number="1" location="backend/tests/unit/test_batch_provider_stt.py:365">
P2: This assertion does not cover the other required unknown-evidence path: abandoned running intents. Add the same absence assertion to `test_abandoned_running_intent_settles_failed_held_without_spend` so the rollout guard cannot regress to treating an abandoned intent as measured silence.</violation>
</file>
Reply with feedback, questions, or to request a fix.
View guided diff | Turn on auto-fix | Re-trigger cubic
| assert vendor.calls == 0 | ||
| assert job(store, 'p1')['provider_intent']['failure'] == {'stage': 'audio_validation', 'reason': 'invalid_audio'} | ||
| # No inspection, no measurement: the held VAD census stays unknown rather than claiming silence. | ||
| assert 'measured_held_vad_speech_seconds' not in job(store, 'p1') |
There was a problem hiding this comment.
P2: This assertion does not cover the other required unknown-evidence path: abandoned running intents. Add the same absence assertion to test_abandoned_running_intent_settles_failed_held_without_spend so the rollout guard cannot regress to treating an abandoned intent as measured silence.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At backend/tests/unit/test_batch_provider_stt.py, line 365:
<comment>This assertion does not cover the other required unknown-evidence path: abandoned running intents. Add the same absence assertion to `test_abandoned_running_intent_settles_failed_held_without_spend` so the rollout guard cannot regress to treating an abandoned intent as measured silence.</comment>
<file context>
@@ -356,6 +361,8 @@ def broken(*_):
assert vendor.calls == 0
assert job(store, 'p1')['provider_intent']['failure'] == {'stage': 'audio_validation', 'reason': 'invalid_audio'}
+ # No inspection, no measurement: the held VAD census stays unknown rather than claiming silence.
+ assert 'measured_held_vad_speech_seconds' not in job(store, 'p1')
</file context>
The backend half of vroute-e F1/F2 (
swarm/state/refs/vroute-e-guard-findings-2026-11-01.md, lead ruling fa26fe). Without it, the rollout guard can't see provider-routed units, and legacy draining is held until it can.F2 (T2 blind): the guard's held-VAD census reads
measured_held_vad_speech_secondsfrom the job. Quarantine recovery writes it, but a provider-causefailed_heldunit never had it, so every such unit counted as VAD-unknown and T2 could never read CLEAN.ProviderSttProtocol.settlenow records the CPU Silero measurement from the stage's own inspection on the failed_held branch, throughheld_vad_census, the same cumulative max-with-prior rule quarantine recovery uses. If inspection itself failed (invalid audio) or the intent was abandoned, there is no measurement, and the field stays absent: unknown, never claimed silence.F1 (T4 hard): no backend change. Per vroute-e (bus 2cd2b2), observer #26 reads route proof from the job doc:
stt_route{stt_route=provider, provider_service}andprovider_intent{service, token, settled_at>0}, with nofailureon success. The existing success test now pins those fields so a later change can't silently drop them. The collector side (Cloud Run scope,route=providersafe; F3/F4vendor_heldexclusions) is lead tooling.No env, deploy, queue or flag change. The provider stage only runs once legacy is draining or dark (mode != on), so this is dormant at today's
legacy_sync=on.Verification:
test_batch_provider_stt.py,test_provider_stt_outbox.py,test_vendor_route_contracts.py: 274 passed. pyright onprovider_stt.py: 0 errors.Product invariants affected
Failure-Class: none
🤖 Generated with Claude Code