git-remote-entire: take a pack without side-band after a single ACK #3135
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
hiddeco
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, sorelaySingleACKRound's done round runspktline.PeekLineon thePACKheader, fails (invalid pkt-len found), and git reportsprotocol 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 intopeekRoundLine(EOF, the server's ERR, the raw pack, or a line) to keeprelaySingleACKRoundunder the complexity limit. Its behavior is otherwise unchanged.Tests
TestRelaySingleACKRoundhas 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 seesPACK.TestGitFetchConnectRoundsreruns the single-ACK cases withside-bandandside-band-64ktaken out of the advertisement (GITHELPER_TEST_NO_SIDE_BANDin the stub). Those four fail on main withbad pack header. The multi_ack cases are not rerun: that path is a plainio.Copy.This path isn't reachable against entire.com today. The server's v0 advertisement always includes
multi_ack,multi_ack_detailedandside-band-64k, and git asks for them whenever they're offered, so fetches never reachrelaySingleACKRound.Verification
go test ./internal/remotehelper/...(git 2.43.0)golangci-lint run ./internal/remotehelper/...: 0 issuescc @hiddeco