feat(cli): cutover-aware ao update (bridge 0.9.6)#2143
Open
harshitsinghbhandari wants to merge 4 commits into
Open
feat(cli): cutover-aware ao update (bridge 0.9.6)#2143harshitsinghbhandari wants to merge 4 commits into
harshitsinghbhandari wants to merge 4 commits into
Conversation
Contributor
Test Coverage Report
Per-file breakdown
Uncovered lines
|
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.
Cutover-aware
ao update(bridge 0.9.6)Teaches the existing
ao updatecommand to perform the legacy-to-rewrite cutover while leaving its normal-update behavior byte-for-byte unchanged. Scope is only theao updatecommand.When a rewrite build is published under the npm
nextdist-tag (orAO_CUTOVER_VERSIONis set) and the current install is still legacy (major.minor < 0.10),ao updatemigrates the user's data viaao migrate(#2129) and installs the rewrite at the exact pinned version instead of running the normal channel update. Migration runs before the install because the migrate command is legacy-side and disappears once the rewrite overwrites the binary.What landed
update-check.tsresolveCutoverTarget()—AO_CUTOVER_VERSIONoverride wins, elsedist-tags.nextfrom the registry; returnsnull(no cutover) on any network/parse error, never throws.isLegacyVersion(version)— true whenmajor.minor < 0.10.getCutoverInstallCommand(method, version)— exact-pin install for npm/pnpm/bun;nullfor homebrew/git/unknown (manual instructions instead).update.tsswitch (method): fires only when a target exists and the install is legacy and target != current.handleCutover()follows the mandatory order: worker-busy guard (orchestrator never blocks; it gets migrated) → confirmation/non-interactive gate (api-invoked spawns are refused, never auto-confirmed) → stop daemon (no restore) → migrate → install rewrite → verify → finish without restarting the legacy daemon.stopAoAndVerifyDown()refactored out ofpauseAoForUpdate()and reused by the cutover stop.--checknow also reportscutoverAvailableandcutoverTarget.ao migrate --jsonagainst the documented contract ({ dbCreated, schemaVersion, projects, orchestrators }); a non-zero exit aborts before any install (user stays on legacy).Regression budget
With no cutover target (the common case), every existing handler (git/npm/homebrew/unknown), flag (
--skip-smoke/--smoke-only/--no-restore/--check), and the stop/restore lifecycle are unchanged. All spawns keepshell: isWindows()+windowsHide: truevia the existing helpers.Tests
New coverage for
resolveCutoverTarget,getCutoverInstallCommand,isLegacyVersion, cutover gating, the worker-busy guard (real-shaped sessions withrole), api-invoked refusal, migration abort, per-method install, the homebrew/git/unknown manual path, and the success path (cache invalidated, no restart). Full gate green:pnpm build && pnpm typecheck && pnpm lint && pnpm test.Explicitly out of scope (not touched)
ao migrate(feat(cli): unified OFFLINEao migrate— port legacy projects + sessions into the rewrite (direct-DB), with Claude transcript relocation #2129 — sibling worker; called here only via its--jsoncontract)/api/updateroute +UpdateBannerao startcutover noticeRefs #2129