Skip to content

refactor(mcp): project viewport family output schema from its owning module - #3033

Merged
thymikee merged 1 commit into
refactor/mcp-output-schemas-2819-recording-index-schemasfrom
refactor/mcp-output-schemas-2819-management-viewport-schema
Sep 29, 2026
Merged

thymikee merged 1 commit into
refactor/mcp-output-schemas-2819-recording-index-schemasfrom
refactor/mcp-output-schemas-2819-management-viewport-schema

Conversation

@thymikee

@thymikee thymikee commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Summary

Moves the viewport command family's MCP output schema out of the shared command-output-schemas.ts grab-bag and into src/commands/management/viewport.ts, its owning module, matching the pattern already applied to interaction, device-management, push-management, and recording families earlier in this stack.

Part of #2819. Touches 4 files. Stacked on refactor/mcp-output-schemas-2819-recording-index-schemas (the next PR in the #2819 sequence).

Validation

Tested commit: 8faeba26d038808be6295c76cd0d1c6fba801321.

pnpm check:affected --run: 161 test files / 1352 tests passed, no failures, no retries needed.

No device needed — pure MCP schema move. Proved the published outputSchema is byte-identical before/after: dumped JSON.stringify(COMMAND_OUTPUT_SCHEMAS.viewport) via a throwaway vitest test on origin/main (fresh pnpm install --frozen-lockfile in a scratch worktree, removed afterward) and on this branch's HEAD. Both produced:

{"type":"object","properties":{"width":{"type":"number"},"height":{"type":"number"},"message":{"type":"string"}},"required":["width","height","message"]}

No unresolved risk: this is a structural move with an unchanged public schema, confirmed by the diff above (import/re-export churn only).

Review in cubic

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Size Report

Metric Base Current Diff
Installed (including dependencies) 4.88 MB 4.88 MB +22 B
Package (unpacked) 4.88 MB 4.88 MB +22 B
Package (download) 1.46 MB 1.46 MB +22 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 21.8 ms 21.3 ms -0.5 ms
CLI --help 62.3 ms 61.7 ms -0.6 ms

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 4 files

Re-trigger cubic

@thymikee
thymikee added this pull request to stack #3043 September 28, 2026 13:44
@thymikee

Copy link
Copy Markdown
Member Author

Reviewed at 8faeba2. This looks good: the viewport output schema now lives in src/commands/management/viewport.ts, it matches the removed hand-authored schema, and the MCP schema tests follow it.

The failing Smoke Tests job is a live iOS simulator wait timeout ("wait for Agent Device Tester"). This diff does not touch that path, so it looks unrelated. The Coverage failure is the eager-closure budget check that fails the same way on the other PRs in this stack, through src/commands/system/index.ts and src/commands/recording/index.ts, which this diff does not change.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Sep 28, 2026
…module

Moves the single hand-authored MCP outputSchema entry for viewport out of
command-output-schemas.ts into a frozen VIEWPORT_COMMAND_OUTPUT_SCHEMAS map
exported from src/commands/management/viewport.ts, following the #2810
projection seam already used by the replay, system, interaction,
device-management, push-management, and recording families on this stack.
Registers the family in the PROJECTED_FAMILIES disjointness check and adds
command-tools-management-viewport-schemas.test.ts with a reference-equality
proof against the module object and an owner-file check, matching the
pattern from the other projected families. viewport does not carry the
post-action observation trait (#1652), so no settle-graft copy applies here.

The moved code is byte-identical to what command-output-schemas.ts held:
same objectSchema/numberSchema/stringSchema call and field order. Verified
the published outputSchema for viewport is byte-identical to origin/main by
dumping COMMAND_OUTPUT_SCHEMAS.viewport as JSON on both refs.

Part of #2819.
@thymikee
thymikee force-pushed the refactor/mcp-output-schemas-2819-management-viewport-schema branch from 8faeba2 to f32c4ca Compare September 29, 2026 05:59
@thymikee

Copy link
Copy Markdown
Member Author

Rebased onto the updated base (recording/index schemas); new head f32c4ca. Resolved one import conflict in the MCP output schema registry, keeping the viewport family together with the interaction and recording modules. No review findings were open. Coverage failures seen earlier came from the lower links' eager-closure change, which the base now fixes; local checks (pnpm check:affected) pass.

@thymikee

Copy link
Copy Markdown
Member Author

I found no problems in the change at f32c4ca. The earlier note on 8faeba2 still holds, and the viewport output schema now comes from its owning module with the same content. I confirmed that by reading the two hunks, not by dumping COMMAND_OUTPUT_SCHEMAS.viewport on both refs.

I did not run the eager-closure budget check locally. I relied on the diff's import edges and the passing test in the Coverage log.

Two CI jobs failed, and neither touches this patch. Coverage failed one test, "delayed restart health probe stops at the RPC deadline without retrying" in src/daemon-client/tests/daemon-client-transport.test.ts. It looks like a timing-sensitive loopback test under load, and the daemon-client code comes from the rebased base. Smoke Tests failed at "wait text Automation lab" because the lab app was not running on the iOS simulator. That is the Apple runner and daemon wait route, and this patch only changes MCP output-schema advertisement. I did not re-run either job, so this rests on the routes not overlapping, not on a green rerun.

Please rerun Smoke Tests and Coverage before merge. I did not re-review the rebased base, only the delta.

@thymikee
thymikee merged commit 14f280d into main Sep 29, 2026
29 of 32 checks passed
@thymikee
thymikee deleted the refactor/mcp-output-schemas-2819-management-viewport-schema branch September 29, 2026 09:52
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