Skip to content

M1 R13: fetch via contained git shell-out (pilot-authored)#17

Merged
hartsock merged 1 commit into
mainfrom
pilot/r13-fetch
May 31, 2026
Merged

M1 R13: fetch via contained git shell-out (pilot-authored)#17
hartsock merged 1 commit into
mainfrom
pilot/r13-fetch

Conversation

@hartsock

Copy link
Copy Markdown
Owner

Summary

The last M1 read-side primitive: fetch (the one network call), plus the
(ok, stderr) seam the repo_status roll-up needs (#11).

  • fetch_result(path, remote) -> (bool, String) and fetch(path, remote) -> bool
    — a contained git fetch shell-out (gix network fetch is the least-mature
    path per PORTING.md; the shell-out honors the user's git config / credentials /
    ssh-agent). fetch_result captures stderr so the roll-up can report why a
    fetch failed.

Pilot-authored (not a worker model): the newt-agent worker prose-scrubbed
twice on this one — the long, fully-pre-written shell-out recipe pushed it past
its whole-file-emit envelope. 12 of 13 read methods were worker-coded; this
network method is the exception (a data point for the envelope finding).

Test plan

  • cargo test --no-default-featuresfetch_updates_tracking_ref (local bare
    remote; fetch advances origin/main to a second clone's HEAD) and
    fetch_bad_remote_fails (fetch_result returns (false, non-empty stderr)).
  • clippy (core + python) -D warnings, cargo fmt --all --check — clean.

WHAT: src/repo/fetch.rs — `fetch_result(path, remote) -> (bool, stderr)` and
`fetch(path, remote) -> bool`, a contained `git fetch` shell-out. Per PORTING.md,
gix network fetch is the least-mature path; shelling out to the user's `git`
honors their config / credentials / ssh-agent. `fetch_result` exposes stderr so
the repo_status roll-up can build "Fetch failed: {stderr}" (API.md / #11).
Registered + PyO3 wrapper. Tested vs a local bare remote (fetch advances
origin/main) and a bad-remote failure.

WHY: Last read-side primitive of M1, and the (ok, stderr) seam S1 needs.

NOTE: pilot-authored. The newt-agent worker prose-scrubbed twice here (the long
pre-written shell-out recipe pushed it past its whole-file-emit envelope — see
newt-agent docs/notes/2026-05-31-newt-coder-driving-sweet-spots.md). 12 of the 13
read methods were worker-coded; this network method is the exception.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@hartsock hartsock merged commit 23370ee into main May 31, 2026
1 check passed
@hartsock hartsock deleted the pilot/r13-fetch branch May 31, 2026 18:09
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