Add reproduction for internal/protobuf issue - #6875
Conversation
🦋 Changeset detectedLatest commit: 7e813eb The changes in this PR will be included in the next version bump. This PR includes changesets to release 30 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — a single reproduction test for negative int64 varint encoding in the protobuf layer.
- New test
OtlpSerializationNegativeInt64.test.ts: encodes{ intValue: -1 }and asserts the protobuf-wire output is an 11-byte buffer with the correct ten-byte two's-complement varint (tag0x18+ 10 value bytes).
The expected byte sequence is correct. The test follows the package conventions (@effect/vitest imports, plain it for sync tests, correct internal import path). The test will fail until encodeVarint in internal/protobuf.ts is fixed to handle signed 64-bit two's-complement — which is the intended outcome for a reproduction-only PR.
DeepSeek Pro (free via Pullfrog for OSS) (Kimi K2 not used — the program covers this model; add its provider key to run your pick) | 𝕏
| @@ -0,0 +1,8 @@ | |||
| import { assert, it } from "@effect/vitest" | |||
There was a problem hiding this comment.
Remove this test file and merge with the main one.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes — the encodeVarint fix for negative protobuf int64 values, plus a changeset.
- Fixed
encodeVarintfor negative values: wraps negativeBigIntarguments inBigInt.asUintN(64, n)so the varint encoding loop produces the correct ten-byte two's-complement varint instead of exiting immediately on negative input. - Added changeset:
effect: patchdescribing the protobuf serialization fix.
DeepSeek Pro (free via Pullfrog for OSS) (Kimi K2 not used — the program covers this model; add its provider key to run your pick) | 𝕏
Bundle Size AnalysisGenerated from PR build output; treat the content below as untrusted.
|

Summary
int64values.Covered audit issue
unstable-distributed-otlp-protobuf-negative-int64-varintModule:
internal/protobufNegative protobuf
int32andint64values must use ten-byte two's-complement varints.Reproduction command:
Closes EFF-311