entire status: report whether the current clone points at a mirror - #1882
entire status: report whether the current clone points at a mirror#1882gtrrz-victor wants to merge 3 commits into
Conversation
`entire status` now reports if this clone's git remote targets an Entire mirror and, when logged in, that mirror's live state — and hints how to switch a direct-forge clone to a mirror. - Local detection (offline): scan the clone's remotes for an entire:// URL → mirror cluster + owner/repo. - State (only when a mirror remote exists): best-effort, time-bounded control-plane lookup, gated on being logged in. Logged out → `unknown` with an `entire login` hint. Non-mirror clones trigger no network. - Direct-forge clone (a mirrorable host, gated on gitremote.IsSupportedForge): print a hint naming the host read from the remote URL (e.g. github.com) and pointing at `entire repo mirror use`. The hint states only the local fact — this clone isn't using a mirror — and does NOT claim the repo has no mirror (a server-side fact status doesn't look up); `mirror use` resolves an existing mirror or tells the user to `mirror create` when there is none. - Surfaced in short + `--detailed` text and as the `mirror` object in `status --json` (null when not mirrored; the hint is human-output only). Adds gitremote.ListRemotesInDir to enumerate remotes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 01KYVW65KNJ4PFNDQ3PCSK4TRP
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 7d249d6. Configure here.
There was a problem hiding this comment.
Pull request overview
This PR extends entire status to detect whether the current clone is configured to pull from an Entire mirror (entire:// remote), and (when authenticated) to do a best-effort, time-bounded control-plane lookup to report the mirror’s live status. It also adds stable remote-order scanning support and documents the behavior.
Changes:
- Add mirror detection and reporting to
entire status(short,--detailed, and--json) with a 4s-capped live status lookup for mirror remotes. - Add
gitremote.ListRemotesInDirand origin-first remote ordering to make remote scanning stable and predictable. - Document mirror-reporting behavior in
CLAUDE.md.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/status.go | Plumbs repo root through status paths and adds mirror status output + JSON field. |
| cmd/entire/cli/status_mirror.go | Implements mirror remote detection, optional live status lookup, human output, and JSON shaping. |
| cmd/entire/cli/status_mirror_test.go | Adds unit tests for mirror detection, hinting behavior, and JSON output. |
| cmd/entire/cli/gitremote/gitremote.go | Adds ListRemotesInDir helper for enumerating git remotes within a directory. |
| cmd/entire/cli/gitremote/gitremote_test.go | Adds tests validating ListRemotesInDir behavior. |
| CLAUDE.md | Documents the new status mirror reporting behavior and its network/auth constraints. |
statusLoggedIn resolved the full control-plane target just to get a boolean, which builds a keychain-backed refreshing token source — potentially slow and able to touch the OS keychain, contradicting its "no prompt, no network" contract. Decide from an active context in contexts.json instead (auth.Contexts reads only that file). Addresses PR review: heavyweight login check in status mirror lookup. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 01KYVXJE9PXZMVJ6ZM26VG1K2W
The mirror section is gated behind the not-set-up early return, so a repo that hasn't run `entire enable` shows only the setup funnel. Document that gating (and the absent --json mirror field pre-enable) so the described behavior matches the code. Addresses trail finding: mirror info gated behind entire enable. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 01KYVZZTQRD0S3JG198Z0XSVEM

https://entire.io/gh/entireio/cli/trails/960
This draft pull request was opened by Entire after CI was requested for the linked trail. Feel free to edit the title or body — the link above is what keeps the trail and PR connected.
Adds mirror reporting to
entire status: whether this clone points at an Entire mirror and, when logged in, that mirror's live state — plus a hint on how to switch a direct-GitHub clone to a mirror.The matrix
Three independent inputs decide the mirror section of
entire status:session(logged in:ENTIRE_TOKENset, or an active login context) /no session(logged out)created(a mirror exists server-side) /not createdmirrored(this clone's git remote is anentire://URL) /not mirrored yet(remote points straight at GitHub)Output codes (exact strings in the legend below): M-LIVE, M-UNKNOWN, M-LOGIN, HINT, NONE.
entire statusoutputWhat the matrix shows
mirrored(remote isentire://), the output is the Mirror line; its state depends on auth and on whether the mirror still exists server-side:not mirrored yet(remote is GitHub), the output is always the HINT — it does not depend on auth or on whether a mirror was created.entire statusreads only local git config, so it cannot see a server-side mirror from a forge clone. That is deliberate: the hint states only the local fact and points atentire repo mirror use, which does the server-side resolution (uses an existing mirror, or tells you tomirror create).not mirrored yetand the remote is not a mirrorable host (e.g. GitLab, or no remote at all), the output is NONE.Output legend (exact rendered lines)
Pre-conditions (short-circuit before the mirror section)
✕ not a git repository○ not set up (run \entire enable` to get started)`Once set up (enabled or disabled), the mirror section renders in both short and
--detailed.JSON (
entire status --json)mirrorfield on the top-level object: an object when the clone ismirrored, otherwise omitted /null(the HINT is human-output only).{ "remote": "origin", "cluster": "aws-us-east-2.entire.io", "owner": "octocat", "repo": "hello-world", "url": "entire://aws-us-east-2.entire.io/gh/octocat/hello-world", "status": "ready", "logged_in": true }status:ready/processing/failed/suspended/unknown(unknown= logged out, or lookup failed).logged_in: the auth check.Note on the
mirror usereferenceThe HINT names
entire repo mirror use, introduced by the repo-mirror-use PR (#1875) and not yet onmain. This branch is based onmain, so it is intended to merge after #1875, at which point the command is registered and the hint resolves.Note
Medium Risk
Adds a best-effort, time-bounded control-plane call on
statuswhen a mirror remote exists and the user is authenticated; failures degrade to unknown without blocking status.Overview
entire statusnow surfaces how this clone is wired to git remotes: mirror detection from localentire://URLs (short, detailed, and--json), plus guidance when the clone talks to a mirrorable forge (e.g. GitHub) directly.For mirror remotes, output includes cluster, remote name, and—when logged in—a 4s-capped control-plane lookup for live mirror status (
ready, etc.); logged-out or failed lookups showunknown(with anentire loginhint when appropriate). Direct forge clones get a human-only nudge towardentire repo mirror use(no network, no JSON field).Adds
gitremote.ListRemotesInDirand origin-first remote ordering for stable scans;CLAUDE.mddocuments the behavior.Reviewed by Cursor Bugbot for commit 7d249d6. Configure here.