Skip to content

feat(check): parse vapi-checks.yml check configuration - #60

Open
scott-lowe-vapi wants to merge 1 commit into
refactor/config-free-engine-modulesfrom
feat/check-config
Open

scott-lowe-vapi wants to merge 1 commit into
refactor/config-free-engine-modulesfrom
feat/check-config

Conversation

@scott-lowe-vapi

Copy link
Copy Markdown
Contributor

Value

V.A.L.U.E. tier: project — PR 4 of 10 for inline simulation PR checks (TEST-141); this PR adds a config parser with no caller yet.

  • Problem: a customer needs one place to say which agents to test, with which suites, in which org, and how strictly. promotion.yml can't hold it: promotionConfigParse requires a pipeline of two or more orgs, and most customers have one.
  • Who it affects: gitops users setting up PR checks, single-org and CI-org alike. The PR check (PRs 5–8) and the promotion gate (PR 10) both read this file, so the gate runs the same tests as the PR check.
  • What changes:
    • src/check-config.ts parses a root vapi-checks.yml into typed check definitions:
      • org, plus an optional runOrg and baseUrl;
      • targets (assistants/<id> or squads/<id>, nested IDs allowed);
      • suites and/or simulations;
      • bindings (promotion's shape, via promotionBindingsParse);
      • extra paths;
      • run settings with repo-wide defaults: transport chat, 1 iteration, 20 min, toolMocks: strict, stripWebhooks: true.
    • vapi-checks.example.yml is the commented starting point: a single-org check, plus a commented CI-org check.
    • Every key is validated, and unknown keys fail, so a typo can't silently run fewer tests. A mode: key fails with a message explaining that checks always build from the branch, since a "run what's deployed" mode was deliberately left out.

Evidence of value

Check Result
Valid configs Minimal check (defaults applied, runOrg = org, credentials bind / phones omit); default and per-check overrides; a CI-org check with EU baseUrl and bindings
Rejections 31 invalid shapes, each asserted against its exact message naming the field (table in tests/check-config.test.ts)
Shipped example Parses as-is, and the commented CI-org check parses once uncommented, so the docs can't drift from the parser
npm test 398 → 404 passing; npm run build clean

Testing plan

  • tests/check-config.test.ts covers:
    • parse results for valid configs;
    • one table row per rejection: version, empty or unknown keys at each level, mode, slugs, target shape, extension and .. in IDs, duplicates, missing suites/simulations, each setting's range, baseUrl, paths, bindings;
    • the example file;
    • checksConfigLoad, which returns null when no vapi-checks.yml exists (checks are opt-in).
  • Not tested: nothing uses the config yet. Resolving targets and suites against real files is PR 5, and the baseUrl fallback order (.env.<runOrg>, $VAPI_BASE_URL, api.vapi.ai) is applied at run time in PR 7.

Stacked on #59.

Refs TEST-141

🤖 Generated with Claude Code

Add the config contract for inline simulation PR checks: a root
vapi-checks.yml declaring, per check, the org whose files to read, an
optional run org and base URL, the targets (assistants/<id> or
squads/<id>), the suites and simulations to run, credential and phone
bindings (promotion.yml's shape), extra trigger paths, and run settings
(transport, iterations, timeout, tool-mock policy, webhook stripping)
with repo-wide defaults.

It is a separate file from promotion.yml because single-org customers
can't have a valid promotion pipeline. Unknown keys are rejected,
including `mode`: checks always build the target from the branch.

Nothing reads the config yet; the dry-run CLI that uses it follows.

Refs TEST-141

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

3 participants