fix(doctor): report a fail-closed checkpoint sync election - #2369
Open
Soph wants to merge 2 commits into
Open
Conversation
The checkpoint-destination note narrated the election's rules from static text instead of asking the election what it decided, so a repo whose `checkpoint_push_remote` names a missing remote — where the resolver fails closed and checkpoints sync nowhere — was told they "sync to a single elected remote" and to run `entire status` to see which one. It also said nothing at all when such a repo had only one remote, because the note fired only on remote ambiguity. `remoteTopology` now consults `strategy.ResolveCheckpointSyncRemote` and reports the disabled state instead of the destination narration, regardless of ambiguity. The two conditions are exclusive: while sync is off there is no destination to describe. `entire enable` shares the note and so stops making the same claim. The fail-closed return becomes `CheckpointPushRemoteNotConfiguredError` (message byte-identical, so `entire status` output is unchanged) to separate the misconfigured setting from the other fail-closed outcome, an unreadable settings file. The remedy is gated on `errors.As`, so an unmatched cause gets none. A remote pinned to a dedicated `checkpoint_remote` URL is exempt, because the pre-push gate exempts it from the election before consulting it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 01M27WP3N6VVS58MFCFY2GJKB1
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Three moderate findings remain around partial-sync reporting, probe-error classification, and dedicated-remote status consistency.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates checkpoint-sync diagnostics so doctor and enable report fail-closed elections instead of implying checkpoints are syncing.
Changes:
- Adds typed missing-remote election handling.
- Updates topology, doctor, and enable diagnostics.
- Adds unit/integration tests and documentation.
File summaries
| File | Summary |
|---|---|
cmd/entire/cli/strategy/checkpoint_sync_remote.go |
Adds typed election errors. Moderate findings remain regarding probe-error classification and dedicated-remote status consistency. |
cmd/entire/cli/setup.go |
Updates enable-time diagnostic output. |
cmd/entire/cli/remote_topology.go |
Adds resolver-backed diagnostics. A moderate finding remains regarding overstatement for partially affected remotes. |
cmd/entire/cli/remote_topology_test.go |
Adds topology diagnostic and edge-case tests. |
cmd/entire/cli/integration_test/checkpoint_sync_remote_test.go |
Verifies doctor wiring for fail-closed elections. |
cmd/entire/cli/doctor.go |
Integrates checkpoint diagnostics. |
CLAUDE.md |
Documents the new fail-closed reporting behavior. |
Review details
Suppressed comments (2)
cmd/entire/cli/strategy/checkpoint_sync_remote.go:107
isConfiguredRemotecurrently turns every non-zerogit remote get-urlresult intofalse, not just “remote is absent” (seestrategy/manual_commit_push.go:373-380). Wrapping that result inCheckpointPushRemoteNotConfiguredErrormakeserrors.Asselect the new “remove or rename the setting” remedy for config/readability failures too, so the diagnostic can misidentify why election failed. Preserve probe errors as an opaque cause and reserve this typed error for positive evidence that the named remote is missing.
if name := s.GetCheckpointPushRemote(); name != "" {
if !isConfiguredRemote(ctx, name) {
return CheckpointSyncRemote{}, &CheckpointPushRemoteNotConfiguredError{Remote: name}
cmd/entire/cli/strategy/checkpoint_sync_remote.go:63
Error()is still used verbatim byentire status, but this resolver can return it alongside a validcheckpoint_remote. In that mode the pre-push hook bypasses this election and sends checkpoints to the dedicated URL, while status prints! Checkpoints NOT syncing; the new doctor path even treats all pinned remotes as healthy. Please make status account for the dedicated mode (or avoid presenting this as a global disabled result) so the commands do not contradict actual delivery.
"checkpoint_push_remote %q is not a configured git remote; checkpoint sync disabled until fixed",
e.Remote)
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Entire-Checkpoint: 01M27Y28F1CPN6CN5RKNYK0YM1
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.
https://entire.io/gh/entireio/cli/trails/1303
Summary
When
checkpoint_push_remotenames a missing remote, checkpoint sync fails closed.entire doctorpreviously either claimed a remote was elected or, in single-remote repos, said nothing.This change makes the shared doctor/enable note consult the actual election result and report
Checkpoint sync: DISABLEDwith targeted guidance. A typed error distinguishes a missing configured remote from other settings failures, while dedicatedcheckpoint_remotedestinations remain exempt because they bypass election.Tests
mise run checkGOOS=windows go vet ./...