Skip to content

feat(validate): catch undefined squad variables and Liquid transfer numbers - #99

Merged
dhruva-vapi merged 4 commits into
feat/blocksfrom
feat/validate-undefined-variables
Nov 21, 2026
Merged

dhruva-vapi merged 4 commits into
feat/blocksfrom
feat/validate-undefined-variables

Conversation

@dhruva-vapi

@dhruva-vapi dhruva-vapi commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Two offline validate rules for sharing one assistant set across many practice squads (PRISM-2684). Stacked on #94, so prompt blocks are expanded before the checks run.

variable-undefined (warn; blocking with --strict)

On a live call, Vapi leaves an undefined Liquid variable in the text as the literal {{name}} (PRISM-2672). A squad that forgets practice_mailbox would read {{practice_mailbox}} to a caller. For each squad member, the rule checks the effective assistant (base merged with member assistantOverrides, then squad membersOverrides):

  • Texts checked: system prompt/messages, firstMessage, voicemailMessage, endCallMessage, and string fields of attached tools (model.toolIds, inline model.tools, tools:append, transfer destinations). Tool code is not checked.
  • Treated as defined:
    • member and squad variableValues
    • Vapi built-ins: customer, phoneNumber, transport, call, now, currentDateTime, date, time, year, month, day, from vapi assistantDefaultOverridesBuild.ts and variableUtil.ts
    • names any squad tool's variableExtractionPlan sets
    • Liquid assign/capture/for locals
  • Ignored: raw/comment blocks, filter names, and dotted paths, which are checked by their root name.
  • Output: one finding per squad member, listing the missing names.
  • Not checked: standalone assistants, which get their values at call time.

It is a warning, not an error, because values can also come at call time (API assistantOverrides, phone-number overrides), which files can't see. Only this rule is promoted by --strict; other warnings behave as before.

transfer-number-liquid (error)

This was found on the live run: POST /tool returns 400 when a transferCall destinations[].number holds {{urgent_handover_number}}. Setting numberE164CheckEnabled: false doesn't help, because the API still requires ^\+?[a-zA-Z0-9]+$ (vapi transferCallTool.types.ts). The rule flags {{ or {% in transfer numbers wherever the tool is defined: standalone tools, inline model.tools, and member/squad tools:append. Its message points to a per-practice literal number in the squad's membersOverrides["tools:append"] (see #100).

Tests: tests/validate-variables.test.ts (12 cases, including two squads sharing one assistant where only one is missing a value) and tests/validate-transfer-numbers.test.ts (8 cases). Results: npm test 733 pass / 0 fail, tsc clean, biome clean.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access that start with 'Devin'.

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Devin Review

🟢 Devin Review found nothing to fix · View findings

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration devin-ai-integration Bot changed the title feat(validate): warn on undefined squad variables feat(validate): catch undefined squad variables and Liquid transfer numbers Nov 20, 2026
dhruva-vapi and others added 2 commits November 21, 2026 00:18
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@dhruva-vapi
dhruva-vapi merged commit be939df into feat/blocks Nov 21, 2026
6 checks passed
devin-ai-integration Bot added a commit that referenced this pull request Nov 21, 2026
…umbers (#99)

* feat(validate): warn on undefined squad variables

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* fix(validate): reject Liquid transfer destination numbers

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* docs: explain squad variable and transfer number validation

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

* docs: link NHS example across stacked PR branches

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.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.

1 participant