Skip to content

Split-root state sync degrades to local-only with no origin remote#364

Merged
clkao merged 1 commit into
mainfrom
spacedock-ensign/state-sync-no-origin-local-mode
Jun 13, 2026
Merged

Split-root state sync degrades to local-only with no origin remote#364
clkao merged 1 commit into
mainfrom
spacedock-ensign/state-sync-no-origin-local-mode

Conversation

@clkao

@clkao clkao commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Degrade split-root state sync to local-only when the state checkout has no origin remote, so a local-only workflow isn't told to run impossible push/pull.

What changed

  • Add a network-free stateHasOrigin probe (git remote get-url origin) shared by boot and dispatch
  • status --boot exposes remote availability — text STATE_BACKEND … remote: origin|none and JSON state_remote (split-root only)
  • dispatch build keeps the path-scoped commit but drops git push/pull --rebase for a no-origin checkout, emitting a local-only line
  • Add the no-origin carve-out to the FO/ensign split-root multi-writer-sync contract

Evidence

  • internal/status + internal/dispatch 665 passed; full go test ./... green (1344)
  • Real-git fixtures (origin / no-origin) + end-to-end --boot text+JSON on real split-root checkouts

gf

…heckout has no origin

Detection: stateHasOrigin probe (git remote get-url origin, network-free named-origin
discriminator) in internal/status/state.go (runGitCmd) and internal/dispatch/build.go
(local exec).

Boot (AC-1/AC-4): gatherBoot populates a split-root-only stateRemote field; the text
STATE_BACKEND line gains a remote: origin / remote: none — state not remotely synced
clause, and the JSON envelope gains state_remote after entity_dir_present. Single-root
omits both.

Dispatch (AC-2/AC-3): stateCommitGuidance takes a hasOrigin param; origin keeps the
push/pull-rebase reminder verbatim, no-origin replaces only the remote-sync tail with a
local-only line while keeping the path-scoped commit. Callers pass stateHasOrigin(stateCheckout).

Contract prose: no-origin carve-out added to the ensign and FO split-root Multi-writer
sync sections.

Tests: real-git fixtures (detection unit, boot text+JSON origin/none pair, dispatch
origin/no-origin pair). Existing origin-asserting fixtures gain an origin remote.
go test ./... green (1260 passed).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@clkao clkao merged commit 79284ca into main Jun 13, 2026
6 of 9 checks passed
clkao added a commit that referenced this pull request Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant