Skip to content

fix(batch): record held VAD evidence on provider failed_held settles - #24249

Merged
Git-on-my-level merged 1 commit into
mainfrom
lane/planc-provider-proof
Nov 1, 2026
Merged

Git-on-my-level merged 1 commit into
mainfrom
lane/planc-provider-proof

Conversation

@Git-on-my-level

@Git-on-my-level Git-on-my-level commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

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_seconds from the job. Quarantine recovery writes it, but a provider-cause failed_held unit never had it, so every such unit counted as VAD-unknown and T2 could never read CLEAN. ProviderSttProtocol.settle now records the CPU Silero measurement from the stage's own inspection on the failed_held branch, through held_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} and provider_intent{service, token, settled_at>0}, with no failure on 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=provider safe; F3/F4 vendor_held exclusions) 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 on provider_stt.py: 0 errors.

Product invariants affected

  • INV-DATA-1: no audio is deleted or stranded. The change adds one evidence field on a terminal failed_held settle and changes no state transition, so held units keep their retained audio and their existing dispositions.

Failure-Class: none

🤖 Generated with Claude Code

View guided diff Turn on auto-fix

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]>
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-01T14:33:29.144954Z
We couldn’t complete this review. Comment @codex review to try again.
6b83674 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files

Confidence score: 4/5

  • test_batch_provider_stt.py does not verify the required absence of evidence for abandoned running intents. Add the same absence assertion to test_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')

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

@Git-on-my-level
Git-on-my-level merged commit 5e24873 into main Nov 1, 2026
65 checks passed
@Git-on-my-level
Git-on-my-level deleted the lane/planc-provider-proof branch November 1, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant