fix(probes): Bound responses with a ten-byte compatibility ceiling - #46
Merged
Conversation
Reject empty and oversized probe responses before they can distort latency or drain arbitrary payloads against a fixed accounting estimate. Accept complete 1-10 byte bodies to preserve Apple and Cloudflare compatibility. Retain valid idle samples, report bounded size warnings per phase and probe kind, and preserve shared HTTP/2 load streams on rejection. Document the read limit separately from estimated costs and transport buffering. Add real HTTP/1.1 and HTTP/2 boundary, cancellation, isolation, accounting, warning and CLI coverage, with matching specs and matrix rows. Closes #40 Co-Authored-By: GPT-6 <noreply@openai.com>
State that the ten-byte response ceiling has no caller override and that load measurements continue when probes fail. Keep the approved runtime policy. Separate the compatibility change from the bounded-read fix in release notes. Record dated config and small-response observations for Apple and Cloudflare, with commands to repeat the checks without generating load traffic. Co-Authored-By: GPT-6 <noreply@openai.com>
The truncation-output test required a 1 MB transfer within a 300 ms deadline. On a contended Windows race runner, the duration cap won and the correct CLI output failed the byte-cap assertion. Use a one-byte accounting cap with a five-second watchdog so the assertion checks truncation reporting without a minimum transfer-rate requirement. Keep the exact byte-cap reason and warning checks. Co-Authored-By: GPT-6 <noreply@openai.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Misconfigured probe endpoints can consume arbitrary response bodies while reporting valid latency samples and charging only a fixed traffic estimate.
An endpoint returning 1 MiB is currently drained as a successful probe despite a 5000-byte foreign or 1000-byte self estimate. Empty responses also count as measurements.
Solution
Accept only complete probe bodies of 1–10 bytes, discard invalid samples, and report bounded warnings while retaining valid measurements and continuing load.
Ten bytes preserves Cloudflare's deployed endpoint alongside the draft's one-byte response. The ceiling is fixed, with no caller override; the compatibility change is called out under Changed in the changelog. LAT-11 and the README record the deviation. Dated config and bounded-GET checks confirm Apple returned one byte and Cloudflare ten on 2026-09-10; these observations are not vendor guarantees.
Closing a rejected self-probe body preserves the shared HTTP/2 load stream. Size warnings are limited to one for idle and one per foreign/self kind in each direction; an idle timeout and size failure share one diagnostic. Parent cancellation retains precedence. Load continues within the configured budgets even if all probes fail, retaining capacity measurements with absent loaded latency and zero RPM. Failed loaded attempts still charge their fixed estimates, which remain separate from throughput. LIM-2 and LIM-10 explicitly describe transport buffering and the absence of an exact wire-byte cap.
Validation:
go test -race -count=3 ./...passed, including soak tests; the added byte-cap regression also passed with three race-enabled repetitions. Build, vet, formatting and golangci-lint passed. Real HTTP/1.1 and HTTP/2 tests cover known/unknown sizes, stalls, truncation, status precedence, multiplexed load survival, partial results, warning deduplication, accounting and CLI JSON/human/events output. Result schema and algorithm cost fixtures remain unchanged. The CLI byte-cap output case now uses a one-byte accounting cap and a separate five-second watchdog, removing its previous 1 MB / 300 ms transfer-rate assumption. That case passed 30 race-enabled repetitions; the complete CLI package passed three repetitions.The built CLI was exercised against the same local fixture before and after: one valid one-byte response followed by two eleven-byte responses. The new build keeps one idle sample, warns, and completes download with exit 0. Screenshots render the captured CLI transcript.
Known pre-existing CLI limitation found during end-to-end validation: when a throughput lower-bound window exists without any completed loaded probes, human output can print
<= 0 RPMas an upper bound; JSON omits the unavailable bound. This formatter issue remains a separate follow-up.Related: