From 90a68634da27042a0edfe91b07b2290803cf74e7 Mon Sep 17 00:00:00 2001 From: Scott Lowe Date: Wed, 2 Dec 2026 12:35:13 -0800 Subject: [PATCH] feat(check): run recording replays in PR checks, report replay and latency results, and label runs - sim: the verdict reads results.transcriptEvaluation and results.latencyEvaluations. A replay or latency budget counts as scored, failures list the metric, inexact required key values and budgets over threshold, skipped (chat) budgets are ignored as on the platform, and an item with no detail shows its failureReason. Shared by npm run sim and the PR check. - check: a transcriptReplay scenario is sent by its saved UUID (the run API rejects inline replays), voice and own org only. Before a live run the check reads each saved replay scenario and stops, sending nothing, when the branch's replay settings differ from it. - check: an optional per-check label names every entry, with VAPI_CHECK_LABEL_CONTEXT appended (PR #N in CI), so the dashboard's runs table stops showing "API run". - validate: stock personality UUIDs no longer warn reference-by-uuid. - docs: replays, latency budgets, caller background noise and every backgroundSound bed. Refs TEST-291 Co-Authored-By: Claude Opus 5.5 --- .github/workflows/vapi-checks.yml | 4 + docs/guides/configuration.md | 1 + docs/guides/pr-checks.md | 32 +++- docs/guides/resource-reference.md | 2 +- docs/learnings/simulations.md | 100 +++++++++- improvements.md | 56 ++++++ src/check-build.ts | 1 + src/check-config.ts | 25 +++ src/check-mocks.ts | 40 ++-- src/check-payload.ts | 172 ++++++++++++++++- src/check-run.ts | 67 ++++++- src/resource-parse.ts | 8 + src/sim-result.ts | 161 ++++++++++++++-- src/validate-refs.ts | 10 +- tests/check-config.test.ts | 10 +- tests/check-mocks.test.ts | 10 +- tests/check-payload.test.ts | 174 ++++++++++++++++- tests/check-run.test.ts | 69 +++++++ tests/sim-result.test.ts | 297 +++++++++++++++++++++++++++++ tests/validate-refs.test.ts | 17 ++ tests/vapi-checks-workflow.test.ts | 9 + vapi-checks.example.yml | 1 + 22 files changed, 1209 insertions(+), 57 deletions(-) diff --git a/.github/workflows/vapi-checks.yml b/.github/workflows/vapi-checks.yml index 0477d15..03b556f 100644 --- a/.github/workflows/vapi-checks.yml +++ b/.github/workflows/vapi-checks.yml @@ -97,6 +97,10 @@ jobs: CHECK: ${{ inputs.check }} BASE_REF: ${{ github.base_ref }} GITHUB_TOKEN: ${{ github.token }} + # Appended to each check's label, so the dashboard's runs table + # says which PR a run came from. Keep it quoted: unquoted, YAML + # cuts the value at " #". + VAPI_CHECK_LABEL_CONTEXT: "${{ github.event.pull_request.number && format('PR #{0}', github.event.pull_request.number) || 'manual run' }}" VAPI_CHECK_TOKENS: ${{ steps.mode.outputs.live == 'true' && secrets.VAPI_CHECK_TOKENS || '' }} VAPI_PRIVATE_API_KEY: ${{ steps.mode.outputs.live == 'true' && secrets.VAPI_PRIVATE_API_KEY || '' }} run: | diff --git a/docs/guides/configuration.md b/docs/guides/configuration.md index 9ccd16e..c530fd6 100644 --- a/docs/guides/configuration.md +++ b/docs/guides/configuration.md @@ -67,4 +67,5 @@ These are hand-written. The files the engine writes live apart from them, in | --- | --- | | `CI=true` | Suppresses interactive warnings, such as the one `pull --force` prints. Set automatically by most CI systems. | | `VAPI_CALL_DEBUG=1` | Makes `npm run call` log message types it would otherwise ignore. | +| `VAPI_CHECK_LABEL_CONTEXT` | Appended to a check's `label` in its run names, as `