refactor(mcp): project doctor family output schema from its owning module - #3040
Conversation
Size Report
Startup median (7 runs, lower is better):
|
There was a problem hiding this comment.
All reported issues were addressed across 4 files
Reply with feedback, questions, or to request a fix.
Fix all with cubic | Re-trigger cubic
|
Reviewed at ad91cc3. This looks good: the doctor output schema moves to its owning module with the same text. The one new edge, The Coverage failure is the same eager-closure budget check as on the rest of this stack, through |
…dule Moves the single hand-authored MCP outputSchema entry for doctor out of command-output-schemas.ts into a frozen DOCTOR_COMMAND_OUTPUT_SCHEMAS map exported from src/commands/management/doctor.ts, following the #2810 projection seam already used by the other projected families on this stack. Registers the family in the PROJECTED_FAMILIES disjointness check and adds command-tools-management-doctor-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. The moved code is byte-identical to what command-output-schemas.ts held: same objectSchema/enumSchema/stringSchema/numberSchema/looseObjectSchema calls and field order. Verified the published outputSchema for doctor is byte-identical to origin/main by dumping COMMAND_OUTPUT_SCHEMAS.doctor as JSON in a temporary detached worktree of origin/main and diffing against this branch's head; both dumps matched byte-for-byte. Part of #2819.
|
The code at ad91cc3 is unchanged since the last review, and that review stays clean. The branch now conflicts with its base, |
|
Rebased onto the updated prepare-schema base; new head is 8cb0ff5.
|
ad91cc3 to
8cb0ff5
Compare
|
Thanks for the update. The conflict from the earlier review (ad91cc3) is fixed, and I found no problems in 8cb0ff5. The doctor family output schema now comes from its owning module, and the checks are green. I did not run the tests locally and relied on the passing checks. I also did not check whether the remaining schema imports in command-output-schemas.ts are all still used, but lint would catch an unused import. Nothing else is needed before merge. |
Summary
Projects the MCP output schema for the
doctorcommand family out of the centralcommand-output-schemas.tsregistry and intodoctor.ts, its owning module, following thesame pattern applied to the other command families in this stacked series. No behavior change:
the published MCP
outputSchemafordoctoris unchanged, only its declaration site moves.Part of #2819. Touches 4 files. Stacked on
refactor/mcp-output-schemas-2819-management-prepare-schema.Validation
Tested commit:
ad91cc368ec88b8d7cc05767cd20cd2ad51f3cfepnpm check:affected --run: 165 test files, 1371 tests passed, 0 failed.outputSchemafordoctoris byte-identical before/after: built a temporary detached worktree of
origin/main(with
node_modulessymlinked from this branch to resolve workspace packages), then rannode -e "import('.../src/mcp/command-output-schemas.ts').then(m => console.log(JSON.stringify(m.COMMAND_OUTPUT_SCHEMAS.doctor)))"on both
origin/mainand this branch's HEAD.diffreported no difference, and astructural-equality check on the parsed JSON also returned true. The verification worktree
was removed afterward.
No unresolved risk: this is a pure move with no schema-shape or Swift changes.