Git Remote e2e Test Coverage Plan

Claude Code·Fable 5·Soph·2mo ago·31min·1 Checkpoint·3 file changes·+101/-11·26.9K tokens

A session-scoped Stop hook is now active with condition: "Can you take a look at the repo and the existing e2e tests targeting individual agents. What we are missing is tests that handle upstream git resolution properly and cover various talking to git remotes. Can you gather data, also look at earlier PRs / bugfixes and develop a test plan so we have proper coverage for git operations for both storage backends". Briefly acknowledge the goal, then immediately start (or continue) working toward it — treat the condition itself as your directive and do not pause to ask the user what to do. The hook will block stopping until the condition holds. It auto-clears once the condition is met — do not tell the user to run /goal clear after success; that's only for clearing a goal early.

2mo ago

A session-scoped Stop hook is now active with condition: "Can you take a look at the repo and the existing e2e tests targeting individual agents. What we are missing is tests that handle upstream git resolution properly and cover various talking to git remotes. Can you gather data, also look at earlier PRs / bugfixes and develop a test plan so we have proper coverage for git operations for both storage backends". Briefly acknowledge the goal, then immediately start (or continue) working toward it — treat the condition itself as your directive and do not pause to ask the user what to do. The hook will block stopping until the condition holds. It auto-clears once the condition is met — do not tell the user to run /goal clear after success; that's only for clearing a goal early.

2mo ago·2m

All three research agents are running in the background; the synthesis task is queued behind them. I'll pick up as each report lands and then write the test plan.

2mo ago·18.5s

Marked the inventory task done. Two research agents still running — I'll synthesize the test plan as soon as their reports arrive.

2mo ago·15.0s

Waiting on the final research agent (PR/bugfix history) before writing the test plan.

2mo ago·3m

Done — I gathered data from three angles (existing test inventory, production remote code paths, and PR/bugfix history) and delivered the full test plan as a document above. The TLDR:

The two biggest structural gaps:

  1. The real pre-push hook is never asserted end-to-end. Integration tests invoke entire hooks git pre-push with nil stdin (real git feeds refspec lines), and GitPush in the test env always passes --no-verify. E2E pushes do run the installed hook, but every remote-flavored e2e test then calls PushCheckpointRefs explicitly — so a completely broken hook would still pass the suite.
  2. Integration tests have zero git-refs parameterization. The e2e suite has the E2E_CHECKPOINT_STORE axis, but the entire remote-operations integration surface (bare-remote pre-push, HTTPS/token, divergence recovery, clone+resume) runs only against git-branch. The git-refs push queue, fast-forward-only batch push, and fetch-and-replay recovery are covered only by strategy unit tests — and the single hook-driven e2e test (TestAlternates) skips under git-refs.

Other notable gaps: the read/fetch side hardcodes origin everywhere while the push side follows the hook's $1 remote (a push to upstream strands checkpoints where no read will find them — untested and arguably a product bug); OPF pre-push rewrite has no integration/e2e coverage at all; no worktree+remote tests despite the git-refs queue living in the shared common dir; and three past fixes shipped without tests (no-op-commit tree clobber 743c43f4c, >1000-commit replay cap 4cf01edb3, ls-remote TOCTOU 1e8628ade).

History strongly favors one area: destructive moves of the local entire/checkpoints/v1 ref (ahead/behind/diverged/disconnected × resume/explain/doctor/pre-push) is the most re-broken code in the repo — #953, #1251, #1252, #1260 all patched variants of it. The plan turns that into a systematic table-driven matrix run under both backends.

The plan itself has ~40 test cases in 8 groups (real-hook e2e, remote-name/upstream resolution, cross-machine clone flows, divergence matrix, OPF, degraded remotes, e2e additions, explicit non-goals like real sshd), each tagged with layer, backend, and the past bug it regresses. It leads with infrastructure enablers — an integration backend matrix (ENTIRE_CHECKPOINTS_PRIMARY on TestEnv), a GitPushWithHooks helper, realistic hook stdin, and a hermeticity tripwire (tests have previously hit live github.com and the macOS keychain) — and sequences the work as 5 PRs, with the first three carrying most of the risk reduction. It also flags three product decisions to make before pinning behavior: non-origin reads, git-refs queue clearing with multiple remotes, and the GHE/forge-map story.