refactor(upgrade): route plan/check/apply through in-repo Core (P6) - #711
Merged
Conversation
Move CLI upgrade orchestration into an in-repo Core executor while keeping src/self domain modules and the CLI/self production bridge. Freeze JSON, --check, error codes, aliases, and the unpublished SDK surface.
Keep --channel on the frozen upgrade contract alongside --check, dry-run, JSON, aliases, exit codes, state v2, and #700 error codes. JSON still must not leak engine or route.
Drswith
marked this pull request as ready for review
September 6, 2026 13:42
This was referenced Sep 6, 2026
Drswith
added a commit
that referenced
this pull request
Sep 6, 2026
Remove the completed change from openspec/changes after #711. Living specs already hold the accepted deltas. Skip committing the working-tree archive folder. Co-authored-by: Cursor Agent <cursoragent@cursor.com>
25 tasks
Drswith
added a commit
that referenced
this pull request
Sep 6, 2026
Re-scan services barrel, src/self, production bridges, and upgrade wrappers after P6 (#711). No zero-ref or pure pass-through modules remain; lock the KEEP inventory in comments and ownership tests. Co-authored-by: Cursor Agent <cursoragent@cursor.com>
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
P6 first knife: route
quantex upgrade/qtx upgradeplan, check, and apply through an in-repo Core self-upgrade engine with a thin CLI projection. Domain planning, providers, binary replacement, and locks stay insrc/self. The publishedquantex-coreSDK does not gainupgrade(). Frozen 1.x contracts are unchanged, including--channel. Changelog framing is internal.Before / after path map
Before (P5
main):After:
Apply moved with plan/check because it is the same invocation (
executeCoreSelfUpgradeplans first and mutates only when status isupdate-availableand neither--checknor dry-run). Splitting apply would have created a second engine.DELETE vs KEEP
src/self/application.tssrc/core/self-upgrade-executor.ts. Zero remaining importers.src/core/self-upgrade-production.tssrc/selfand failtest/architecture/core-boundary.test.ts.src/services/self-upgrade-production.tssrc/selfport injection into Core. Importer:src/commands/upgrade.ts.src/selfdomain (planning,facts, providers,binary,lock, recovery, registry, persistence)src/commands/upgrade.tsContract freeze checklist
NETWORK_ERROR,MANUAL_ACTION_REQUIREDUPGRADE_FAILEDmapping unchangedupgradeonly; binariesqtx/quantex--jsonenvelope and data fields unchanged--jsondoes not exposeengine/route--checkstill exit 1 with statusupdate-availableand no mutation--channelstill forwardsstable/betainto planning; JSONdata.channelmatches--channelvalues stay rejected at option resolution (no new error shape)--check --channeland dry-run--channelstay plan-onlyDRY_RUNwarning, no mutationupgrade()methodrelease-core.yml/ protect-main untouchedconfig/capabilities/commands/schemaLinked Artifacts
Validation
bun run memory:checkbun run lintbun run format:checkbun run typecheckbun run test(upgrade/ownership/architecture plus full suite)Release Intent
Release Summary
BEGIN_COMMIT_OVERRIDE
refactor(upgrade): route CLI upgrade through in-repo Core
Move plan, check, and apply orchestration for quantex upgrade / qtx upgrade
into an in-repo Core engine behind the frozen CLI contract, including --channel.
The published quantex-core SDK does not gain an upgrade method.
END_COMMIT_OVERRIDE
Docs Updated
openspec/...README.md/README.zh-CN.md/packages/core/README.mdScope Check
Closure Check
Notes
Core executor is generic over the self-upgrade plan/result so
src/core/**stays free ofsrc/selfimports. Product-path files undersrc/keep classify on the full ubuntu/windows/macos test matrix. Squash framing isrefactorso this knife stays an internal improvement and does not independently bump 1.x.