Repository navigation
refactor(session): replace MigrationEngine and isolate migrate command - #1195
Merged
jeff-r2026 merged 2 commits intoOct 17, 2026
Merged
Conversation
Keep session command modules below the production file-size limit without changing CLI behavior.
|
No findings in the specified PR diff.
Review was read-only; I did not run, build, or install PR code. |
Contributor
Author
|
Validation on |
jeff-r2026
approved these changes
Oct 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace the one-method
MigrationEnginewithpreviewMigration(session, sourcePlatform, targetPlatform)besidefidelityFromSession. The migration command calls the function directly; copy behavior still lives inAgentSession.copy.Move migration command registration into its own module and shared session helpers into another, leaving
session-cmd.tsfocused on the remaining commands. The extracted command bodies are unchanged apart from imports, exports, and the preview call.Type of Change
Test Plan
npx tsc --noEmitpassesnpm run lintpassesnpx vitest runpassesA new contract test failed on the unmodified base (
previewMigration is not a function: 1 failed, 6 passed). With the implementation, both focused suites passed (72 tests). Reverting the implementation reproduced the same failure. This RED verifies the requested refactor contract; it is not evidence of a pre-existing user-facing bug.On the final commit, 72 focused tests and the real CLI migration E2E with OpenCode 2 passed. The changed executable logic has 17/17 covered lines; exact code moves were audited separately.
Full local
run-ci.sh(baseline comparison): lint, typecheck, and build pass. The host suite has 6 failures on both base and PR; the only PR-only failure passed on isolated rerun and with its entire 166-test file. Every Node 20/22 failure in this run also occurred in at least one of the base branch’s Node 20/22 runs; Node 22 has 224 versus 225 on base. The full E2E suite has the same single failing test on base and PR (1 failed, 150 passed, 6 skipped test files on each).Related Issues
Refs #1140, proposal 3 only. Proposals 1, 2, and 4 remain open.
Notes for Reviewers
The second commit moves the existing migration command and shared helpers out of
session-cmd.ts; it does not rewrite their behavior. The API surface change is the removal ofMigrationEnginein favor ofpreviewMigration.