Skip to content

refactor(contracts): move telephony input parsing out of device-rotation - #3812

Merged
thymikee merged 1 commit into
callstack:mainfrom
mikolajadamowicz:refactor/telephony-input-module
Oct 19, 2026
Merged

thymikee merged 1 commit into
callstack:mainfrom
mikolajadamowicz:refactor/telephony-input-module

Conversation

@mikolajadamowicz

@mikolajadamowicz mikolajadamowicz commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Moves the telephony input parsing out of packages/contracts/src/device-rotation.ts into a new packages/contracts/src/telephony-input.ts. That covers TELEPHONY_ACTIONS, TELEPHONY_CALL_ACTIONS, TELEPHONY_USAGE, TelephonyEventInput, and the parsers parseTelephonyEventInput, parseTelephonyPositionals, and telephonyPositionals.

#3724 put this code in device-rotation.ts because a new module would have grown the CLI and session-journal eager closures past scripts/__tests__/eager-closure-budgets.ts. That was true while the code was new. Now that it is on main, the move is a pure split, and the split tolerance in closure-growth-rule.ts accepts it: the closure gains one new module, and the statement weight stays flat. The comment explaining the old placement is removed.

7 files touched. @agent-device/contracts/device exports the same names, so no callers outside contracts change. device-rotation-telephony.test.ts is renamed to telephony-input.test.ts. There is no behavior change.

Validation

Tested SHA 98be21d (same tree as head 959bd6a, which only changes the author).

pnpm check:affected --run --head HEAD: format, lint, typecheck, layering, fallow, and build passed. vitest-related ran 5,239 tests with 3 failures:

  • app-log-session-resource.test.ts › unwritable tombstone plus rejecting cleanup blocks same-process replacement
  • daemon-session-idle-expiry.test.ts › a held-back settle leaves a repair transaction uncommitted…
  • daemon-session-idle-expiry.test.ts › a settle that cannot confirm the claim gone keeps the session record standing

The same 3 fail on base eef1a3f in the same container, which runs as root. eager-closure-budgets.test.ts passed. No device run, because no dispatch, capture, interaction, or console code changed.

View guided diff

The telephony constants, TelephonyEventInput, and its parsers lived in
device-rotation.ts only to keep the CLI and session-journal eager closures
flat when telephony was added. Now that the code is on main, moving it to
its own module is a pure split that the eager-closure no-growth rule
tolerates, so telephony-input.ts owns it. Callers of
@agent-device/contracts/device are unchanged.
@thymikee

Copy link
Copy Markdown
Member

The code in 959bd6a looks good to me. The change is a clean move of the telephony input parsing out of device-rotation, and I found nothing to fix.

CI is still pending: all checks were queued or in progress when I looked, so there is no failure to attribute yet. I did not run typecheck or tests locally, and I did not run the eager-closure budget guard. The removed comment said a separate module would grow the CLI and session-journal import closures, and this PR treats that growth as acceptable. That stays unverified until Repo Guards passes, since this diff adds one module to that graph.

I know of no conflicts. Before merge, Repo Guards & Compatibility (the eager-closure budget) and the other in-progress checks must pass.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Oct 19, 2026
@thymikee
thymikee merged commit 112d291 into callstack:main Oct 19, 2026
12 checks passed
@mikolajadamowicz
mikolajadamowicz deleted the refactor/telephony-input-module branch October 19, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants