refactor(mcp): project recording family output schemas from their owning module - #3031
Conversation
Size Report
Startup median (7 runs, lower is better):
|
|
Reviewed at a04c376. The code works, but the extraction copies
CI is green: Smoke Tests (both shards reported), Repo Guards, Lint, Typecheck, Integration Tests, Bundle Size, and Compatibility all pass; only Coverage and one Smoke Tests shard are still pending, with no failures so far. The diff is a same-file schema relocation exercised by the existing recording and replay schema test files, which pass. I did not rerun the full affected-package suite locally, and I'm relying on the PR's reported run plus these CI results. Nothing in the diff touches a coverage-gated or smoke-exercised runtime path beyond the schema move, so there's no reason to expect the remaining jobs to fail, but they haven't finished yet. |
…ing module Moves the 2 hand-authored MCP outputSchema entries for record and trace out of command-output-schemas.ts into a frozen RECORDING_COMMAND_OUTPUT_SCHEMAS map exported from src/commands/recording/index.ts, following the #2810 projection seam already used by the replay, system, interaction, device-management, and push-management families on this stack. Registers the family in the PROJECTED_FAMILIES disjointness check and extends the pre-existing command-tools-recording-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. Neither command carries the post-action observation trait, so no settle-graft copy applies here. The moved code is byte-identical to what command-output-schemas.ts held: same objectSchema/stringSchema/enumSchema calls and field order, with a locally duplicated constSchema helper and artifactSchema object matching the precedent from the other families' moves (artifactSchema had no other consumer in command-output-schemas.ts once record/trace moved, so it moved outright rather than staying duplicated). Part of #2819.
a04c376 to
ed6ce2e
Compare
|
Pushed ed6ce2e. The branch now sits on the updated push management base.
|
|
This PR is ready at ed6ce2e. The duplicate constSchema finding from the earlier review is fixed, and nothing from that review remains open. I reviewed the logical patch as c6c6834..ed6ce2e (two commits, five files), because the delta since a04c376 mostly holds the upstream base you rebased onto, and I did not review those upstream changes. I did not run the eager-closure budget test locally, so the closure claim rests on the importer grep and the green run. All 19 checks pass, including the eager-closure budget test and the MCP schema tests that exercise this change, and there are no conflicts. Not blocking, take it or leave it: the test 'declares exactly the commands its module owns' in command-tools-recording-schemas.test.ts only checks one direction, so a registry command that lists output-schemas.ts but has no schema entry would still pass, and you could rename the test to match what it checks or add the reverse check over the registry commands that list that file. Nothing else stands in the way, and the branch can merge once its stacked base lands. |
Summary
Projects the recording and replay MCP output schemas (
record,trace) out of the sharedcommand-output-schemas.tsmap and into their owning module,src/commands/recording/index.ts, following the pattern already used for the system, interaction, device-management, and push-management families in this stack.Behavior is unchanged: the published
outputSchemafor these MCP tools is byte-identical before and after. Part of #2819. Touches 4 files. Stacked onrefactor/mcp-output-schemas-2819-management-push-schemas.Validation
Tested commit:
a04c376fb18068caada4dd6df9d616a61683ecd8pnpm format: no changes.pnpm check:affected --run: all runnable checks passed (160 test files, 1350 tests).outputSchemais unchanged: added a temporary vitest test dumpingCOMMAND_OUTPUT_SCHEMAS.recordand.traceto JSON, ran it againstorigin/main(d3c9d052b5, via a throwawaygit worktree add .tmp-main-check refs/remotes/origin/main --detachwithnode_modulessymlinked from this worktree, removed after) and against this branch's HEAD;diff main-schemas.json head-schemas.jsonreported no differences (IDENTICAL).command-output-schemas.tsspread copies ofrecord/traceinstead of referencingRECORDING_COMMAND_OUTPUT_SCHEMASdirectly, confirmed the new reference-equality test incommand-tools-recording-schemas.test.tsfails, then reverted.No unresolved risk.