# Yunke — provider filters and local task evidence

Part of the [AI Voice Agent](/docs/modules_handbook/shared/voice-agent/readMe.md).
Built 2026-10-25. The views inspect existing local records only; runtime Yunke gates remain off.

## What it does

AI Calls now badges the provider actually stamped on each attempt and filters by
Retell/Yunke. The unified list and both profile call tabs show the same bounded local
Yunke task/result evidence. They do not query the vendor, refresh authentication,
retry a task, settle a call, send a follow-up or download audio.

An accepted parent is not labelled a dial or a confirmed queue position. Unknown
creation explicitly says **Do not resend**. An ended submitted schedule does not
become a confirmed vendor expiry, cancellation, failed call or no-answer outcome.

## How it works

### Provider filtering and visibility

`AiCallQueryRequest` validates the supported provider enum and uses the existing
**string** multi-select helper. It never coerces provider names to integer zero.
The filter is echoed to page props and retained in paginator links; invalid provider
values return validation errors instead of silently ignoring the filter. Provider
counts use the unified list's existing lead/source visibility scope, just like its
rows, status counts and total. Browser test runs remain outside this lead-call book.

`YunkeCallPresentation::map()` runs after the bounded call query. It makes one binding
query for the visible Yunke IDs and no binding query for a Retell-only collection.
The profile detail uses it over its existing bounded 50-call query. No per-row vendor
or database lookup is added. The shared `AiCallPresenter` and agent API contract remain
unchanged; this extra evidence belongs to these management views.

### Evidence without guessed associations

The projection uses the existing call ID/UUID binding, request claim, accepted parent
and recorded child/action relationship. It never discovers IDs from phone numbers,
times or a current profile. A UUID conflict, incomplete identity or recorded result
that disagrees with the local call is shown for review. No conflict is repaired here.

| Local evidence | Display |
| --- | --- |
| No binding / reserved | No task binding / submission not confirmed |
| Create outcome unknown | A task may exist; do not resend |
| Create rejected | Creation rejected |
| Accepted, unresolved | Task accepted; result unverified; acceptance is not proof of a dial |
| Frozen submitted end passed | Submission window ended; vendor expiry remains unverified |
| Complete matching result | Result recorded, with summary/action state shown separately |
| Recorded result with native timing overrun | Fixed transcript-timing warning in compact and expanded views; result/spans unchanged |
| Parked for review | Fixed per-record `review_label` in compact and expanded views, even while global collection is enabled |

Acceptance time and schedule end come from the frozen `meta.yunke_submission` evidence.
Changing a profile cannot move those timestamps. Unknown times remain unrecorded.
Last-check time/reason comes from the watchdog's local observation. Auth failure is
shown as the previous check's failure, not an empty result or proof of device outage.
Only fixed safe reason labels are rendered; unknown codes become a generic review
message. Company/user, parent/child/action IDs, hashes and raw vendor errors are not
returned by this projection.

Automatic collection being paused is distinct from a missing result. A recorded result
without analysis says its summary is not recorded. Ready unhandled aftermath shows
paused/pending processing according to its independent gates; it does not promise a
WhatsApp was sent or delivered. The existing follow-up column remains the delivery
record. Unknown cost remains null.

Known `end_exceeds_duration` metadata adds a fixed safe timing qualification only after
consistent recorded-result binding. It does not expose raw issue strings, modify text,
claim the final utterance was fully played or trigger any action. The source end times
are estimates; see [transcript timing](/docs/modules_handbook/shared/voice-agent/yunke-transcript-timing.md)
for the static evidence and the 19-segment reproduction.

`YunkeCallState.vue` provides compact row and expanded evidence views, without retry,
cancel or media controls. Existing recording players retain `preload="none"`. Blocking
an attempt's number still changes future submission policy; the page explicitly says
it does not cancel an accepted mobile task. Actual cancellation/expiry and long-running
queue behavior remain live-acceptance requirements.

## Reference usage

Open AI Calls and choose **Provider** in the filter drawer, or expand an existing
attempt. The same local evidence appears in a profile's Lead calls and on the lead's own
Channel → AI Caller sub-tab (`LeadsController::aiVoiceCallRows` adds `provider_label` and
the `yunke` state to each row from one batched query). Reading is possible
while collection and calling are disabled; no HTTP call to Yunke is needed to render it.

`YunkeCallPresentationTest` covers string filters, scoped counts, no mutation/HTTP,
unknown/rejected/reserved/conflicting records, frozen window timing, safe auth/error
labels, missing analysis/paused actions and one-query batching. Component tests verify
the no-resend advice, paused/auth states and absence of retry/media controls.

## Related files

- [YunkeCallPresentation](/src/VoiceAgent/Support/YunkeCallPresentation.php) — read-only local evidence projection.
- [AiCallQueryRequest](/app/Http/Requests/Manage/Calls/AiCallQueryRequest.php), [AiCallsController](/app/Http/Controllers/Manage/Calls/AiCallsController.php), [AiProfilesController](/app/Http/Controllers/Manage/Calls/AiProfilesController.php) — scoped filters/counts and bounded view integration.
- [YunkeCallState.vue](/resources/js/Components/YunkeCallState.vue), [AI Calls](/resources/js/Pages/Manage/Calls/AiCalls/Index.vue) — shared rendering used by the unified list and both profile call tabs.
- [YunkeCallPresentationTest](/tests/Feature/VoiceAgent/YunkeCallPresentationTest.php), [YunkeCallState.test.js](/resources/js/Components/YunkeCallState.test.js) — synthetic backend/frontend verification.
- [Watch evidence](/docs/modules_handbook/shared/voice-agent/yunke-watch.md), [Profile setup](/docs/modules_handbook/shared/voice-agent/yunke-profiles.md), [PDF ledger](/docs/modules_handbook/shared/voice-agent/yunke-pdf-progress.md) — unchanged processing contracts and remaining real acceptance.
