Skip to content

refactor: delete WaitCommandResult/AlertCommandResult mirror types — Phase 2c#946

Merged
thymikee merged 1 commit into
mainfrom
refactor/phase2c-delete-result-mirror
Jun 30, 2026
Merged

refactor: delete WaitCommandResult/AlertCommandResult mirror types — Phase 2c#946
thymikee merged 1 commit into
mainfrom
refactor/phase2c-delete-result-mirror

Conversation

@thymikee

Copy link
Copy Markdown
Member

What (breaking — intentional)

Phase 2(c): removes the last two hand-written result-type mirrors from client-types.ts. wait and alert are genuinely dynamic — wait's daemon data is toDaemonWaitData's Record, and alert's iOS path is a generic runner Record — so per the typed-result doctrine they should be the untyped CommandRequestResult, not an invented closed shape.

  • Delete WaitCommandResult / AlertCommandResult; client.command.wait/alert now return CommandRequestResult.
  • Drop their public exports from index.ts and the now-unused AlertInfo import.
  • One integration test that read the typed alert.alert.source now casts the untyped bag.

This is a breaking public-API removal (those two exported type names disappear) — done now that you've green-lit breaking changes in this pass. It completes the result-type half of the mirror deletion; the 13 closed commands already live in src/contracts/* via CommandResultMap. The Options-type half (deriving from inputSchema) is a separate follow-up.

Verification

  • tsc --noEmit 0; oxfmt + oxlint --deny-warnings clean; fallow audit --base origin/main clean; vitest client/contracts/mcp → 476 pass; Layering Guard empty.

…s — Phase 2c

BREAKING (intentional, approved): removes the last two hand-written result-type
mirrors from client-types.ts. wait and alert are genuinely dynamic — wait's
daemon data is toDaemonWaitData's Record, and alert's iOS path is a generic
runner Record — so per the typed-result doctrine they should be the untyped
CommandRequestResult, not an invented closed shape.

- delete WaitCommandResult and AlertCommandResult from client-types.ts; the
  client.command.wait/alert methods now return CommandRequestResult.
- drop their public exports from index.ts and the now-unused AlertInfo import.
- the android-lifecycle integration test that read the typed alert.alert.source
  now casts the untyped bag.

This completes the result-type half of the client-types.ts mirror deletion (the
13 closed commands already live in src/contracts/* via CommandResultMap). The
Options-type half (deriving from inputSchema) is a separate follow-up.

Verified: tsc, oxfmt + oxlint --deny-warnings, fallow audit clean, Layering
Guard empty, 476 client/contracts/mcp tests pass.
@github-actions

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
JS raw 1.4 MB 1.4 MB 0 B
JS gzip 455.5 kB 455.5 kB 0 B
npm tarball 561.0 kB 560.9 kB -118 B
npm unpacked 2.0 MB 2.0 MB -546 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 18.6 ms 19.7 ms +1.1 ms
CLI --help 31.3 ms 31.7 ms +0.5 ms

Top changed chunks: no changes in the largest emitted chunks.

@thymikee

Copy link
Copy Markdown
Member Author

Reviewed current head c3a7cdf directly against plans/perfect-shape.md Phase 2 typed-result guidance. This is a narrow public type cleanup: it removes only the hand-written SDK mirror aliases WaitCommandResult / AlertCommandResult, makes client.command.wait and client.command.alert return the untyped CommandRequestResult bag, and leaves the internal runtime-owned wait/system-alert result types in their command modules.

That matches the seeded CommandResultMap doctrine: closed results stay in src/contracts/*; dynamic handler/runner records do not get invented closed shapes. The breaking export removal is called out in the PR body, the one affected integration assertion now narrows the untyped alert bag locally, git diff --check is clean, and all 21 checks are passing. No actionable blockers from my side; labeling ready-for-human for maintainer judgment.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Jun 30, 2026
@thymikee thymikee merged commit f67b72d into main Jun 30, 2026
21 checks passed
@thymikee thymikee deleted the refactor/phase2c-delete-result-mirror branch June 30, 2026 06:21
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-06-30 06:22 UTC

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.

1 participant