Repository navigation
feat(cloud): cleo cloud sync - seal, push, pull and apply each attached stream (T12996) - #1962
Open
kryptobaseddev wants to merge 5 commits into
Open
kryptobaseddev wants to merge 5 commits into
kryptobaseddev wants to merge 5 commits into
Conversation
…ed stream (T12996) cloudSync (cloud/nexus-vault.ts) runs pushSyncStream then pullSyncStream for each attached stream (the project's and the account's global store, or the one --scope names) and returns one CloudSyncResult: per stream a status (synced, disabled, paused, not-attached, refused) and sealed, sent, received, staged, applied, held and conflict counts with the staged position against the server's head. E_SYNC_DISABLED names `cleo sync enable push` when no attached stream has a journal flag on; pull now refuses on sync.pull before it looks for a position. An interrupted run resumes without sending or applying anything twice. `cleo cloud sync [--scope]` is the CLI verb. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # packages/core/src/cloud/__tests__/nexus-vault.test.ts # packages/core/src/cloud/nexus-vault.ts
…le legs (T12996 review) review-hotfix LOWs on #1962: - LOW-1: any error on a stream is reported on that stream (status 'failed', with its code), never thrown, so the next stream still syncs. - LOW-2: one connection and one account-key unlock serve every stream of a run (push and pull take a shared session) instead of five connects and four keychain reads. - LOW-3: a flag off, or push before this store has its own genesis, is reported in `skipped`, not as `refused`, so a store that only pulls shows synced. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Task: T12996 (C-1 core; the two-device AC lands with the T12999 JOIN, as proposed to team-lead)
Stacked on #1959.
sync.pushandsync.pullstay unreleased: the CLI never opts in.What
cloudSync(opts)(cloud/nexus-vault.ts) runs, for each attached stream (the project's and the account's global store, or the one--scopenames),pushSyncStreamthenpullSyncStream, and returns oneCloudSyncResult.status:synced;disabled(both flags off);paused(clock ahead);not-attached(E_NEXUS_VAULT_NOT_LINKED/E_NEXUS_NOT_A_PROJECT); orrefused, with the reason;E_SYNC_DISABLED(a new code), with the fixcleo sync enable push, is returned when no attached stream did work and at least one isdisabled.pullSyncStreamnow looks for a pull position only whensync.pullis on, so a store with pull off reportsdisabledinstead of "no position".CLI:
cleo cloud sync [--scope project|global] [--api-url]gives one envelope and a one-line summary per stream.Contracts:
CloudSyncResult,CloudSyncStreamResult, andE_SYNC_DISABLEDinNEXUS_ACCOUNT_ERROR_CODES.T12996 ACs
E_SYNC_DISABLEDnamingcleo sync enable): this PR.Tests
nexus-vault.test.ts, "C-1", against the fake server:cloudSyncseals, pushes, pulls and applies:synced, sent 1, received 1, applied 1, after equal to head. A rerun does nothing.E_SYNC_DISABLED, withcleo sync enable pushin the fix.CLI (
nexus-vault-cli.test.ts): the API URL passes through, and a scope is passed only when one is given.Mutations (3, all killed): the
E_SYNC_DISABLEDrefusal dropped, the pull flag check before the position dropped,sentmisreported.Checks
--base origin/feat/T12343-pull;🤖 Generated with Claude Code