refactor: give internal/gitexec the run and output disposition, collapse the five git helpers #808

Open
opened 2026-10-19 18:26:20 +00:00 by hexajon · 0 comments
Owner

Implements the design accepted in ADR 0056 (0056-one-git-runner-owns-output-disposition).

internal/gitexec gains one run entry that owns output disposition, with an explicit mode per stream: Capture (buffer and return), Stream (to the terminal), Tee (both). The five run helpers in internal/git (RunGitAuthDirWithStderr, RunGitAuthDirCaptureStderr, RunGitAuthDirCaptureStderrOnly, RunGitAuthDirWithCredentials, RunGitDirWithStderr) become thin wrappers that pass a disposition and keep only their credential, SSH, or plain concern.

Acceptance:

  • internal/gitexec owns the run and the per-stream disposition; the five helpers no longer wire stdout and stderr themselves;
  • Capture is the default and returns the same bytes as today, so every existing parse (Fast-forward, new branches, no tracking) is unchanged;
  • the CLI pull, fetch, and clone pass Tee for stderr, so git native progress reaches the terminal, while stdout stays captured for the parse;
  • the MCP surface passes Capture for both streams and stays quiet;
  • a parity test fails the build when a production file outside internal/gitexec constructs or runs a git process;
  • the gate is green.

Refs ADR 0056. Decision recorded in #806.

Implements the design accepted in ADR 0056 (0056-one-git-runner-owns-output-disposition). internal/gitexec gains one run entry that owns output disposition, with an explicit mode per stream: Capture (buffer and return), Stream (to the terminal), Tee (both). The five run helpers in internal/git (RunGitAuthDirWithStderr, RunGitAuthDirCaptureStderr, RunGitAuthDirCaptureStderrOnly, RunGitAuthDirWithCredentials, RunGitDirWithStderr) become thin wrappers that pass a disposition and keep only their credential, SSH, or plain concern. Acceptance: - internal/gitexec owns the run and the per-stream disposition; the five helpers no longer wire stdout and stderr themselves; - Capture is the default and returns the same bytes as today, so every existing parse (Fast-forward, new branches, no tracking) is unchanged; - the CLI pull, fetch, and clone pass Tee for stderr, so git native progress reaches the terminal, while stdout stays captured for the parse; - the MCP surface passes Capture for both streams and stays quiet; - a parity test fails the build when a production file outside internal/gitexec constructs or runs a git process; - the gate is green. Refs ADR 0056. Decision recorded in #806.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sixfold-space/madtea#808
No description provided.