Skip to content

@blazetrails/msgpack ​

MessagePack serialization, mirroring Ruby's msgpack gem

MeasureValue
Rails counterpartmsgpack v1.8.0
API methods matched100% (35 of 35)
Rails tests matched100% (220 of 220) (10 permanent)
Ruby files ported8
Ruby files unported0
Measured atfe89b44726

Gaps by file ​

No gaps recorded for this package.

Missing methods ​

None recorded for this package.

Unported Ruby files ​

Every compared Ruby file has a TypeScript file.

Deviation receipts ​

JSDoc receipt tags in the package's source, by the receipt each carries.

TagPERMANENTCONVERGEABLEnone
@noRailsEquivalent300
@missingRailsCall100
@internal0014

Permanently skipped tests ​

No section cited (18)
A String has no encoding tag either (5)
Ruby Strings are JS string primitives (no mutable String carrier) (3)

Ratified deviations ​

Each rule below is ratified in the repository's CLAUDE.md files. The first paragraph is quoted; the link opens the full section at this build's commit.

Ruby Strings are JS string primitives (no mutable String carrier) ​

A Ruby String is a mutable object with identity. str << "x" and str.replace("y") change the receiver in place, str.dup is a second object with the same content, and frozen? is a per-object fact. ActiveModel leans on all three:

CLAUDE.md →

A String has no encoding tag either ​

str.encoding, force_encoding and String#b read or change a per-object encoding. A JS string has none, and trails adds none: the carrier that would hold it is the carrier this section rejects. ruby-compat tags a Uint8Array only. A Rails body that branches on a String's encoding ports the UTF-8 arm, and a test asserting str.encoding is permanently unportable for that assertion.

CLAUDE.md →

A read answers new bytes; the out String is not written (Buffer#read's out) ​

Buffer#read and #read_all take an optional out String (vendor/msgpack/v1.8.0/ext/msgpack/buffer_class.c:430-533), which the C extension resizes in place and appends the read bytes to. _msgpack_buffer_read_from_io_to_string (vendor/msgpack/v1.8.0/ext/msgpack/buffer.c:627-655) reads straight into an empty out String and copies through io_buffer otherwise.

packages/msgpack/CLAUDE.md →

The unpacker is its own read loop (read_primitive) ​

Unpacker ports read_primitive, msgpack_unpacker_read and msgpack_unpacker_skip (vendor/msgpack/v1.8.0/ext/msgpack/unpacker.c:438-896) line for line, with the head byte, stack and partial raw body kept on the instance as the C struct keeps them. It does not decode through @msgpack/msgpack. The read state lives in one uk object, because a pool freezes its unpackers and Ruby's freeze leaves the C struct writable. A map reads as a plain object while every key is a String and becomes a Hash at the first other key. Ruled by the operator on 2026-11-16, amending RFC 0184's "no porting ext/msgpack/*.c" non-goal for the unpacker.

packages/msgpack/CLAUDE.md →

A :-prefixed String packs as a Symbol (Packer#write's T_SYMBOL arm) ​

A Ruby Symbol is a JS string with a leading colon (root CLAUDE.md), so Packer#write takes the T_SYMBOL arm for every string isSymbol answers. A call site that packs arbitrary text where Rails packs a String (IPAddr#to_s in ActiveSupport's write_ipaddr) calls writeString, so "::1" keeps Rails' str bytes. Ruled by the operator on 2026-11-16.

packages/msgpack/CLAUDE.md →

Source ​

packages/msgpack on GitHub →