SWI-11363 feat(translate): expand finite loop= and warn on dropped Dial attrs#10
Merged
Merged
Conversation
Two translation-fidelity fixes that close gaps in the "no silent degradation" contract. loop: Say/Play with loop="N" previously emitted once and warned. BXML has no loop attribute, so a finite count is now expanded into the verb repeated N times. loop="0" (infinite) and invalid counts can't be expressed inline, so they emit once and warn rather than silently collapsing a looped prompt to a single play. Dial: timeLimit, hangupOnStar, ringTone, and answerOnBridge were passed through silently. Each present attribute now emits a specific warning so the migration report surfaces exactly what won't carry over. Matrix loop notes for Say/Play updated to match the runtime (the preflight report reads the same matrix). 264 tests pass (9 new), typecheck clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
michaela-band
approved these changes
Jul 1, 2026
joshraub-bw
approved these changes
Jul 8, 2026
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.
What & why
Two translation-fidelity fixes that close gaps in the adapter's no-silent-degradation contract — the property that anything the adapter can't carry over should be surfaced loudly, never dropped quietly.
1.
loopnow actually loopsSay/Playwithloop="N"previously emitted the verb once and warned — a looped greeting silently became a single play. BXML has noloopattribute, so a finite count is now expanded into the verb repeated N times.loop="N"(N≥2) → verb repeated N times, no warningloop="1"/ absent → single emit (unchanged)loop="0"(Twilio's "infinite") and invalid counts → can't be expressed inline in BXML, so emit once and warn instead of silently collapsing2.
Dialstops dropping attributes silentlytimeLimit,hangupOnStar,ringTone, andanswerOnBridgewere passed through with no signal. Each present attribute now produces a specific warning so the pre-flight migration report tells the customer exactly what won't carry over. Absent attributes produce nothing.Also updated the
loopnotes insrc/matrix/twilio-voice.jsonso the matrix (read by both the runtime and the pre-flight report) matches the new behavior.Tests
test/translate-loop.test.ts(new) — finite expansion,loop=1/absent,loop=0, invalid, and Play repeating PlayAudio+SendDtmf as a unittest/translate-dial.test.ts— warns on each dropped attr; no warning when absent🤖 Generated with Claude Code