Skip to content

Resolve the task base in one Git fetch - #1963

Merged
mergify[bot] merged 5 commits into
mainfrom
lean178/575-single-start-fetch
Nov 26, 2026
Merged

mergify[bot] merged 5 commits into
mainfrom
lean178/575-single-start-fetch

Conversation

@eowca

@eowca eowca commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Resolve the task base in one Git fetch

Context and goal

Acceptance

  • Fetch a valid ordinary base branch once on Git versions with machine-readable fetch output, using its returned SHA for the worktree and handoff even after an interleaved fetch.
  • Preserve the existing path for Git without machine-readable fetch output, symbolic tracking refs, initialized submodules and invalid base ref names. Continue to support single-branch clones and show actionable Git failures.
  • Keep the receipt, sandbox, task template and workflow interfaces unchanged.

Notes

The architecture guide still applies. Start verifies the remote base and makes its objects available before checkout. The fast path reads the current Git invocation's output and only updates the existing direct tracking ref. The existing exact-SHA path covers symbolic tracking refs, initialized submodules and older Git.

Base

main @ f06e494
Base: f06e494

Validation

Recorded for ba6d73495e1f

  • uv run --group dev ruff check src tests: exit 0
  • uv run --group dev tach check: exit 0
  • uv run --python 3.14 python scripts/check_architecture_docs.py: exit 0
  • scripts/size_budget.sh: exit 0
  • uv run --group dev pytest -q: exit 0

Review


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

  • primary, claude, ba6d734, approve

eowca and others added 5 commits November 26, 2026 16:06
Architecture-Review: unchanged; start still verifies the remote base and checks out the exact fetched commit without using shared FETCH_HEAD.
Co-Authored-By: Codex <noreply@openai.com>
Architecture-Review: unchanged; base resolution still validates origin and materializes the exact commit before checkout.
Co-Authored-By: Codex <noreply@openai.com>
Architecture-Review: unchanged; worktrees with initialized submodules keep the previous exact-SHA fetch and its recursion.
Co-Authored-By: Codex <noreply@openai.com>

@loopzero-feder-positronics loopzero-feder-positronics Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loopzero primary review by claude on ba6d73495e1fce2170e793e30d01f1469bfe6692, 60.6s: approve (0 critical, 0 important, 2 suggestion)

Settings per native call (launch configuration and CLI claims, not backend attestation):

  • Call 1: requested model claude-opus-5-5 (effort medium); CLI-reported model claude-opus-5-5 (effort unknown); configured model claude-opus-5-5 (effort medium)

Native Claude output is retained in the restricted local review receipt.

Comment thread tests/test_worktree.py


@pytest.mark.parametrize("branch", [None, "feature/ci+release", "symbolic"])
@pytest.mark.parametrize("branch", [None, "feature/ci+release", "symbolic", "legacy"])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: No tests for the initialized-submodule and invalid-ref-name fallbacks

The acceptance criteria say three cases must keep using the existing ls-remote + exact-SHA fetch path: initialized submodules, invalid base ref names and symbolic tracking refs. The parametrized test covers symbolic tracking refs and the legacy-Git 129 fallback, but nothing exercises modules.exists() (the point of commit 3684a7d) or a check-ref-format failure. A later refactor could drop either guard without any test failing. Smallest fix: add a submodule case that creates $(git rev-parse --git-path modules) before start, and assert through the existing run monkeypatch that no git fetch --porcelain call was made and that ls-remote ran. Optionally, add a case that passes a base name check-ref-format rejects and assert the command reported in the GitError is ls-remote.

Comment thread tests/test_worktree.py
with pytest.raises(worktree.GitError) as info:
worktree.start(repo, "nobase", "does-not-exist")
assert info.value.command[:2] == ("git", "ls-remote")
assert info.value.command[0] == "git"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Failure-command assertion was loosened to accept either path

test_start_reports_git_failure_with_command now accepts either fetch or ls-remote. On the test's Git version the outcome is deterministic, so this no longer checks which path produced the error. A regression that sends a valid missing branch down the fallback path would still pass. Smallest fix: assert command[:3] == ("git", "fetch", "--porcelain") when the installed Git supports --porcelain, and ls-remote otherwise. Alternatively, parametrize the test with the existing legacy monkeypatch so both paths are pinned.

@eowca
eowca marked this pull request as ready for review November 26, 2026 15:17
@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

@Mergifyio queue

@mergify

mergify Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

✅ Merged into main as b3efa7b at 15:23 UTC

5 min in the queue, 4 min of it CI.

So far

  • ✅ Entered the queue Thu 26 Nov, 15:18 · rule main · triggered by @eowca with the @mergifyio queue command
  • ✅ Passed · draft #1967
  • ✅ Merged 15:23 · b3efa7b · squash
3 merge conditions met
  • github-review-approved · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required
  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-success = checks
    • check-neutral = checks
    • check-skipped = checks
  • any of · required by GitHub repository ruleset rule main: PR only, Mergify queue, existing checks required:
    • check-success = Loop-zero Eligibility
    • check-neutral = Loop-zero Eligibility
    • check-skipped = Loop-zero Eligibility

Times in UTC · dashboard · how the merge queue works

@eowca

eowca commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

No description provided.

@mergify
mergify Bot merged commit b3efa7b into main Nov 26, 2026
18 checks passed
@mergify mergify Bot removed the queued label Nov 26, 2026
@eowca
eowca deleted the lean178/575-single-start-fetch branch November 26, 2026 15:24
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