Repository navigation
feat(validate): catch undefined squad variables and Liquid transfer numbers - #99
Merged
Merged
Conversation
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
|
I'll fix CI failures and address comments from users with write access that start with 'Devin'.
|
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>
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>
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>
devin-ai-integration Bot
added a commit
that referenced
this pull request
Nov 24, 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>
devin-ai-integration Bot
added a commit
that referenced
this pull request
Nov 24, 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>
dhruva-vapi
added a commit
that referenced
this pull request
Nov 24, 2026
) * feat(blocks): share prompt text and config between resources A system prompt can include a Markdown block with a line that says only "@include <name>", and any mapping can include a YAML block with a "$include" key, where the file's own keys win. Blocks are looked up in resources/<org>/templates/ first, then in templates/ at the repository root, so an org can replace or extend a shared block. The loader expands them, so validate, push, PR checks and drift hashes all see the finished resource. Liquid inside a block is passed through untouched. Pull never writes a file that uses blocks. It used to rewrite a file whenever the dashboard matched it, was ahead of it, or under --force and --resolve=theirs, and each of those would replace a marker with a copy of the block. It now leaves the file as written and saves the dashboard version beside it when the two differ. validate warns about YAML merge keys and Liquid include/render/layout tags, which the engine and Vapi drop silently. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * feat(blocks): sync a block edit to every resource that uses it A block edit changes what many resources send to Vapi without changing their files, so nothing in git said which resources still ran old text. Push now records the block content each resource went up with in resources/<org>/.vapi-blocks.json. "npm run sync-blocks" lists, across every org, the resources whose blocks changed since they were last pushed, and with --apply deploys them through apply, so the drift check still refuses a resource that was edited in the dashboard. Promotion plans those resources as "sync" entries for the destination org, the promotion workflow runs on templates/**, and a shared block edit selects every PR check. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(blocks): guide, worked example and the corrections it needs Adds docs/guides/blocks.md and examples/blocks/, two clinics that share a red-flags prompt block and a voice config block, one with its own version of the block. The examples test now copies an example's templates/ folder, so the example is validated and the guide's snippets are checked against its files. Also corrects two statements the feature depends on: YAML merge keys are not processed by the engine, and an undefined Liquid variable is left in the prompt as written, not replaced with an empty string. Logs the pull behaviour this replaces as improvements entry 39, and a drift-check gap found while testing, in orgs with no credentials, as entry 40. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * refactor(blocks): keep the blocks record in state/<org>/ Push writes the record, so it belongs with the rest of the engine's files. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(blocks): keep the blocks record where the org's commit step stages it An org whose state is still in the layout from before state/ gets its record at resources/<org>/.vapi-blocks.json. A commit step written for that layout stages resources/, so the record is committed, and a promotion run with nothing to promote no longer plans a sync for every resource that uses a block. An org whose state is in state/<org>/ keeps state/<org>/blocks.json. npm run migrate moves the record with the state file and the pin. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test: the blocks record is not a local edit to pull In the older layout a push that uses blocks rewrites resources/<org>/.vapi-blocks.json, and until that is committed git shows it as modified. The record is on the list migrate moves, so pull leaves it out of what it counts as a person's edits. This pins it with a pull in a fresh clone. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(blocks): sync-blocks takes its directory from src/base-dir.ts sync-blocks worked out the repository's directory for itself, the one module that still did. It would have worked in the repository while every other module worked in a test's temporary directory. tests/base-dir.test.ts names the line. The blocks tests import the engine sandbox first, as every engine test file does. The test that runs sync-blocks --apply gives that one call 240 seconds. It starts four commands in a row and took 72 seconds on a slow machine beside the rest of the suite. cliRun takes the limit as a parameter and keeps 60 seconds for every other call. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * feat(validate): catch undefined squad variables and Liquid transfer numbers (#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> * docs(examples): two NHS practice squads sharing one assistant set (#100) * feat(validate): warn on undefined squad variables Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * docs(examples): add shared NHS practice squads Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(examples): inline practice-specific transfer destinations 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: add shared practice quick reference 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> * fix: integrate blocks with adoption folder hashes and strict preflight Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: Dhruva Reddy <dhruva@vapi.ai> Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> Co-authored-by: Dhruva Reddy <264116857+dhruva-vapi@users.noreply.github.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 forgetspractice_mailboxwould read{{practice_mailbox}}to a caller. For each squad member, the rule checks the effective assistant (base merged with memberassistantOverrides, then squadmembersOverrides):firstMessage,voicemailMessage,endCallMessage, and string fields of attached tools (model.toolIds, inlinemodel.tools,tools:append, transferdestinations). Toolcodeis not checked.variableValuescustomer,phoneNumber,transport,call,now,currentDateTime,date,time,year,month,day, from vapiassistantDefaultOverridesBuild.tsandvariableUtil.tsvariableExtractionPlansetsassign/capture/forlocalsraw/commentblocks, filter names, and dotted paths, which are checked by their root name.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 /toolreturns 400 when a transferCalldestinations[].numberholds{{urgent_handover_number}}. SettingnumberE164CheckEnabled: falsedoesn't help, because the API still requires^\+?[a-zA-Z0-9]+$(vapitransferCallTool.types.ts). The rule flags{{or{%in transfer numbers wherever the tool is defined: standalone tools, inlinemodel.tools, and member/squadtools:append. Its message points to a per-practice literal number in the squad'smembersOverrides["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) andtests/validate-transfer-numbers.test.ts(8 cases). Results:npm test733 pass / 0 fail,tscclean, biome clean.