Repository navigation
Migrate the remaining 28 hand-authored MCP output schemas to their owning command modules #2819
Copy link
Copy link
Closed
Labels
Description
Purpose
src/mcp/command-output-schemas.ts is still ~863 lines of hand-authored per-command MCP
outputSchemas. #2810 landed the seam that lets a command family author its result schema beside its
command descriptor and project it into this map, and migrated the first family (replay: replay,
test). 28 entries remain, so 28 commands still have their published result shape declared three
layers from the code that produces it — which is why the file churned 11 times in the last 200 commits.
Required behavior
For each migrated command family:
- Export a frozen schema map from the family's owning command module, keyed by command name.
- Register that module in the seam's projection list in
src/mcp/command-output-schemas.ts, and delete
the hand-authored entries it replaces. The map'ssatisfies Record<keyof CommandResultMap, JsonSchema>
totality check must stay intact — do not route composition through a generic helper whose members are
constrained toRecord<string, JsonSchema>, because the resulting index signature stops the map from
proving per-command coverage. - Add the family to
PROJECTED_FAMILIESin
src/mcp/__tests__/command-tools-replay-schemas.test.ts. That is the guard against silent
last-winsshadowing between two projected families; a family that skips registration is unchecked,
and registration is the step that makes it checked. - Move the family's shape assertions with it, keeping the reference-equality proof that the published
entry is the module's object and not a copy.
Remaining entries, grouped by owning module
Measured from COMMAND_OUTPUT_SCHEMAS (30 keys, 2 projected) with ownerFilesForCommand:
| entries | owning module | commands |
|---|---|---|
| 10 | src/commands/system/index.ts |
back, home, orientation, app-switcher, fold, action-button, tv-remote, clipboard, appstate, keyboard |
| 6 | src/commands/interaction/index.ts |
press, click, fill, longpress, hover, find |
| 2 | src/commands/management/device.ts |
boot, shutdown |
| 2 | src/commands/management/push.ts |
push, trigger-app-event |
| 2 | src/commands/recording/index.ts |
record, trace |
| 1 | src/commands/management/viewport.ts |
viewport |
| 1 | src/commands/capture/wait.ts |
wait |
| 1 | src/commands/management/prepare.ts |
prepare |
| 1 | src/commands/management/doctor.ts |
doctor |
| 1 | src/commands/capture/diff.ts |
diff |
Observable completion conditions
- Every migrated command's published schema is reference-equal to the entry its own module exports, and
the composed map is unchanged for all 30 keys (byte-compare the published schemas against the base). PROJECTED_FAMILIEScovers every family the seam spreads; a planted second family claiming a
migrated command fails the disjointness test.- No new production export beyond the schema map each family needs, and no allowlist or baseline added.
Dependencies and sequencing
- Blocked by: nothing. refactor(mcp): project command output schemas from their owning family #2810 supplies the seam.
- Prerequisite question for
scroll: it resolves nosrc/commands/**owner file at all, so it is the
one entry the seam cannot project even in principle. Decide whether that is an owner-file gap to repair
first or a deliberate placement, then schedulescrollaccordingly. src/commands/system/index.tsowns 10 of the 28 and also carries the interactor members that refactor(contracts): make the alert legs optional members and drop their denials #2807,
refactor(contracts): drop the Limrun iOS denials its facts already make #2815 and refactor(interactors): stop handing web and Vega a full wall of refusals #2816 just made optional. Do that family's schema migration and its fact-cell pass together
rather than visiting the module twice.- Land per command family, not one sweep.
Reactions are currently unavailable
Activity
refactor(mcp): project interaction family output schemas from their o…
refactor(mcp): project interaction family output schemas from their o…
refactor(mcp): project interaction family output schemas from their o…
refactor(mcp): project system family output schemas from their owning…
refactor(mcp): project interaction family output schemas from their o…
refactor(mcp): project device management family output schemas from t…
refactor(mcp): project push management family output schemas from the…
refactor(mcp): project recording family output schemas from their own…
refactor(mcp): project viewport family output schema from its owning …
refactor(mcp): project wait family output schema from its owning module
refactor(mcp): project prepare family output schema from its owning m…
refactor(mcp): project doctor family output schema from its owning mo…
refactor(mcp): project diff family output schema from its owning module
refactor(mcp): project system family output schemas from their owning…
refactor(mcp): project interaction family output schemas from their o…
refactor(mcp): project device management family output schemas from t…
refactor(mcp): project push management family output schemas from the…
refactor(mcp): project recording family output schemas from their own…
refactor(mcp): project viewport family output schema from its owning …
refactor(mcp): project wait family output schema from its owning modu…
refactor(mcp): project prepare family output schema from its owning m…
refactor(mcp): project doctor family output schema from its owning mo…
refactor(mcp): project diff family output schema from its owning modu…