Repository navigation
fix(T13851): journal-stream remedy names only commands this build can run - #2348
Open
kryptobaseddev wants to merge 4 commits into
Open
kryptobaseddev wants to merge 4 commits into
kryptobaseddev wants to merge 4 commits into
Conversation
… run A build with sync.push unreleased was told to join the journal with `cleo sync enable push`, which it refuses (E_NEXUS_SYNC_REFUSED), on every journal-stream message (BEHIND, STREAM_UPGRADED, LOCAL_CHANGES, verify, status). journalStreamRemedy() now tells such a build to upgrade with `cleo self-update`; a build that ships sync.push keeps the join remedy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
journalStreamRemedy(false) sent users to `cleo self-update`, but while sync.push is in UNRELEASED_FLAGS no released CLEO ships it, so the user would loop. It now says a pre-release or allowUnreleased build started the journal, no released CLEO can push to it yet, and pull, restore and verify keep working. cloudSyncImpl's E_SYNC_DISABLED fix gets the same branch through syncDisabledRemedy(); C-1 asserts it, and a new unit test covers both branches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The unreleased branch of journalStreamRemedy dropped "which checkpoints the stream (T12999)", which the mixed v2-then-v3 lineage regression asserts (CI shard 2 on f7c355e). The clause is back, before the reason this CLEO cannot run sync.push. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
T13851 was found by the 10.19 staging gate (evidence:
t13549r/evidence/4-a-push-global.json,0-a-enable.json).Root cause
On a stream that the change journal writes, the head snapshot is checkpoint/v3. Every message about such a stream used one fixed remedy,
JOURNAL_STREAM_REMEDY, and it told the store to join withcleo sync enable push. On a build wheresync.pushis unreleased (UNRELEASED_FLAGS, which includes 10.19 and current main), that command refuses withE_NEXUS_SYNC_REFUSED. So once a newer device starts the journal on an account, an older device can't back up the global store, and the fix text it gets sends it to a command its own build refuses.Fix
journalStreamRemedy(pushReleased = !UNRELEASED_FLAGS.has('sync.push'))replaces the constant at all 9 call sites: BEHIND, STREAM_UPGRADED (both the local check and the server'sE_STREAM_VERSION), LOCAL_CHANGES, the kept-files warning, status, and the verify ahead/diverged remedies.sync.pushunreleased in this build (T13856, review of 08557cf): the message sayssync.pushis not released yet, that a pre-release orallowUnreleasedCLEO build started this journal, and that no released CLEO can push to it yet.cleo cloud pull,cleo cloud restoreandcleo cloud verifykeep working. It never namescleo self-update: whilesync.pushis inUNRELEASED_FLAGS, no released CLEO ships it, so self-update would send the user in a loop.cloud syncrefused withE_SYNC_DISABLED: its fix (syncDisabledRemedy()) follows the same branch. It namescleo sync enable pushonly in a build that shipssync.push.sync.pushreleased: the message is unchanged, including the join withcleo sync enable push.The vault does not record the writer's client version (the checkpoint carries no such field), so a v3 head is the only signal that a newer client wrote the stream. That signal is accurate here, because only a build with
sync.pushreleased writes v3.This cannot fix devices already on 10.19 or older, because that text is already shipped in those builds. It fixes every later build while
sync.pushstays unreleased.Proposed mixed-version policy (for owner and team-lead)
cloud pull,restoreandverifykeep working. A vault push onto a v3 head refuses, and its remedy only ever names a step the client can run, which in practice means an upgrade.minClientVersion, the version wheresync.pushwas released. A client below it refuses with a message that names that version, rather than inferring it from manifest v3.E_STREAM_VERSION, reasonstream-v3) already enforces this, and the client refuses before writing anything.sync.pushshould leaveUNRELEASED_FLAGSonly in a release whose notes tell every device on an account to upgrade first. Until then, any device that ran a staging orallowUnreleasedbuild counts as "the newer client". A staging orallowUnreleasedrun against a real account starts a journal that released devices can't push to: their vault pushes are refused until a release shipssync.push.Only point 1 (the remedy) is implemented here. Points 2–4 need owner decisions.
Tests
nexus-vault.test.ts: 168/168, run as a single file in a sandboxed HOME.sync.pushunreleased, and that the fix names neithercleo self-updatenorcleo sync enable push(T13851 AC3, T13856).journalStreamRemedy, and a new one checks both branches ofsyncDisabledRemedy.cloud syncwith the journal off) now expectssyncDisabledRemedy(false). That expectation changed on purpose: the behaviour changed.--base origin/main) and biome pass locally.Gates
pnpm run typecheck(tsc -b) passed, thenpnpm run buildpassed.lint-changesetspasses (838 entries).--base origin/main. Gate 39 passes.Unverified
nexus-vault.test.tsonly.🤖 Generated with Claude Code