The response-compression negotiator always selects gzip when it has a positive quality, even if deflate has a higher quality. For example, gzip;q=0.2, deflate;q=0.8 currently produces gzip. Invalid weights such as gzip;q=bogus also become an implicit quality of 1.
This is the upstream selection portion of stacksjs/stacks#2462. RFC 9110 sections 12.4.2 and 12.5.3 specify quality values and preference ordering: https://www.rfc-editor.org/rfc/rfc9110.html#section-12.5.3.
Acceptance for this small chunk:
- Choose the highest supported nonzero quality; retain gzip before deflate for ties.
- Respect explicit identity preference and explicit coding weights over wildcard weights.
- Match complete tokens and parse HTTP quality syntax. Treat malformed named offers as unavailable rather than silently promoting them or falling back to wildcard for that name.
- Verify known and unknown-length response bytes, and real HTTP generic/native dispatch.
- Preserve the synchronous response path and measure common-offer CPU against the original parser.
Baseline at 272f696: the added regression cases fail in four groups (32 existing tests pass). Full identity-exclusion enforcement, skipped/small representations, and the Stacks brotli layer remain tracked in stacksjs/stacks#2462 and are outside this selection-only chunk.