← Back to Pull requests

git-remote-entire: take a pack without side-band after a single ACK #3135

Open
unknown opened this pull request with 232 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 11, 2026 21:55 UTC
Author

Fixes #3134

The bug

Without multi_ack, upload-pack ACKs the first common have and sends the pack right after it. Without side-band that pack is raw, so relaySingleACKRound's done round runs pktline.PeekLine on the PACK header, fails (invalid pkt-len found), and git reports protocol error: bad pack header. With side-band the pack's first packet ends the loop, which is the only case the tests ran. The issue has the details.

The fix

The done round now stops when the next bytes are a pack header (PACK, which can't be a pkt-line length) and copies the rest unchanged. The peek moved into peekRoundLine (EOF, the server's ERR, the raw pack, or a line) to keep relaySingleACKRound under the complexity limit. Its behavior is otherwise unchanged.

Tests

  • TestRelaySingleACKRound has raw-pack rounds: one after an ACK, one where the first ACK arrives in the done round, one with several ACKs across rounds before the raw pack, and one with nothing in common. The first three fail on main; the nothing-common case already passed, because the done round's NAK ends the loop before it sees PACK.

  • TestGitFetchConnectRounds reruns the single-ACK cases with side-band and side-band-64k taken out of the advertisement (GITHELPER_TEST_NO_SIDE_BAND in the stub). Those four fail on main with bad pack header. The multi_ack cases are not rerun: that path is a plain io.Copy.
  • This path isn't reachable against entire.com today. The server's v0 advertisement always includes multi_ack, multi_ack_detailed and side-band-64k, and git asks for them whenever they're offered, so fetches never reach relaySingleACKRound.

    Verification

  • go test ./internal/remotehelper/... (git 2.43.0)

  • golangci-lint run ./internal/remotehelper/...: 0 issues

  • complexity gate: no new or worsened function over 30
  • cc @hiddeco

    Diff: 232 lines (+174 / -58) across 2 files Reviewer: hiddeco Review duration: 27439m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.37) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.37 · 232 lines diff across 2 files
    0.37
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.326
    Real PR Conversation Timeline
    1 comments
    "Review active on #3135"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 37.1% (MEDIUM) · Higher = larger blast radius
    37.1%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.8% · Safe to merge
    19.8%
    Repository