refactor(mcp): project diff family output schema from its owning module - #3042
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 77c002f. The moved Not blocking: the CI: the Coverage and Smoke Tests failures look unrelated to this diff. The eager-closure budget growth comes from the |
Moves the single hand-authored MCP outputSchema entry for diff out of command-output-schemas.ts into a frozen DIFF_COMMAND_OUTPUT_SCHEMAS map exported from src/commands/capture/diff.ts, following the #2819 projection seam already used by wait and the other migrated families on this stack. Registers the family in the PROJECTED_FAMILIES disjointness check and adds command-tools-capture-diff-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. diff does not carry the post-action observation trait (#1652): it reports a snapshot comparison, not an interaction, so no settle-graft copy applies here. The moved code is byte-identical to what command-output-schemas.ts held: same objectSchema/numberSchema/enumSchema/stringSchema/stringArraySchema call and field order, and the shared command-input.ts helpers are unchanged from origin/main, so the published outputSchema for diff stays byte-identical to origin/main. Part of #2819.
77c002f to
bb0cc29
Compare
|
Rebased onto the updated base (management-doctor-schema); new head is bb0cc29.
|
|
This PR is ready as of bb0cc29. The earlier review at 77c002f was also clean, and the diff family output schema now comes from its owning module with no remaining code issues. CI is green and there are no conflicts, so nothing else must happen before merge. Not blocking: the projection in src/commands/capture/diff.ts (https://github.com/callstack/agent-device/blob/bb0cc29/src/commands/capture/diff.ts#L52) widens lines.kind to include 'unchanged', which is more than a pure move, so you could mention that in the PR body or CHANGELOG, or leave it as is. I did not run the tests locally. I also did not check that the daemon emits 'unchanged' lines on the production route; I relied on the contract type. |
Summary
Moves the single hand-authored MCP
outputSchemaentry fordiffout ofcommand-output-schemas.tsinto a frozenDIFF_COMMAND_OUTPUT_SCHEMASmap exported fromsrc/commands/capture/diff.ts, following the #2819 projection seam already used bywaitand the other migrated families on this stack. Registers the family in thePROJECTED_FAMILIESdisjointness check and addscommand-tools-capture-diff-schemas.test.tswith a reference-equality proof against the module object and an owner-file check.diffdoes not carry the post-action observation trait (#1652): it reports a snapshot comparison, not an interaction, so no settle-graft copy applies here.Closes #2819.
4 files touched. Stacked on
refactor/mcp-output-schemas-2819-management-doctor-schema.Validation
Tested commit:
77c002f109b77b2f8c1bbe4aaf87c5da06a02e77pnpm check:affected --run: 166 test files / 1373 tests passed, no failures.No device needed — this is a pure MCP schema move. Proved byte-identical output two ways:
git show c58fe851e2:src/mcp/command-output-schemas.ts(origin/main tip) — thediff:entry (mode/baselineInitialized/summary/lines/warnings, sameobjectSchema/numberSchema/enumSchema/stringSchema/stringArraySchemacalls, same field order) is byte-for-byte identical.src/commands/command-input.ts(the schema-primitive helpers) between origin/main and this head — zero differences, confirming the helpersdiff.tsnow calls are unchanged.No unresolved risk: the change is a pure move with no schema-shape delta.