Skip to content

SWI-11363 feat(translate): expand finite loop= and warn on dropped Dial attrs#10

Merged
kshahbw merged 1 commit into
mainfrom
adapter/loop-and-dial-warnings
Jul 8, 2026
Merged

SWI-11363 feat(translate): expand finite loop= and warn on dropped Dial attrs#10
kshahbw merged 1 commit into
mainfrom
adapter/loop-and-dial-warnings

Conversation

@kshahbw

@kshahbw kshahbw commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

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. loop now actually loops

Say/Play with loop="N" previously emitted the verb once and warned — a looped greeting silently became a single play. BXML has no loop attribute, so a finite count is now expanded into the verb repeated N times.

  • loop="N" (N≥2) → verb repeated N times, no warning
  • loop="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 collapsing

2. Dial stops dropping attributes silently

timeLimit, hangupOnStar, ringTone, and answerOnBridge were 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 loop notes in src/matrix/twilio-voice.json so 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 unit
  • test/translate-dial.test.ts — warns on each dropped attr; no warning when absent
  • 264 tests pass (9 new), typecheck clean. Built test-first (TDD).

🤖 Generated with Claude Code

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>
@kshahbw
kshahbw requested review from a team as code owners June 29, 2026 20:37
@kshahbw kshahbw changed the title feat(translate): expand finite loop= and warn on dropped Dial attrs SWI-11363 feat(translate): expand finite loop= and warn on dropped Dial attrs Jul 6, 2026
@kshahbw
kshahbw merged commit 155e8b4 into main Jul 8, 2026
3 checks passed
@kshahbw
kshahbw deleted the adapter/loop-and-dial-warnings branch July 8, 2026 20:15
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