ReviewOS

home-lang/home

Port complete gRPC Metadata semantics

#242
Closed chris opened this 10 days ago ·
10 days ago

Scope

Port Bun corpus position 3984, js/third_party/grpc-js/test-metadata.test.ts (29 active tests).

Required contracts

  • validate and normalize metadata keys
  • require strings for ordinary keys and Buffers for -bin keys
  • reject non-ASCII ordinary values
  • implement set/add/remove/get/getMap
  • clone metadata without sharing binary buffers
  • merge without mutating the source
  • convert to and from HTTP/2 headers, including base64 binary values
  • preserve validation/conversion causes with operation, key, and source-module stack context

Verification

  • all 29 focused upstream tests pass without unsupported cases
  • permanent diagnostics cover validation context and binary clone isolation
  • existing gRPC, SQL adapter, and third-party gates remain green
10 days ago

Implemented and pushed in cb3dc9144.

Completed contracts:

  • normalized and validated metadata keys
  • enforced string values for ordinary keys and Buffers for -bin keys
  • rejected non-ASCII ordinary values
  • implemented set/add/remove/get/getMap and metadata options
  • deep-cloned binary buffers
  • merged metadata without mutating the source
  • converted to/from HTTP/2 headers with base64 binary values
  • added the missing Node assert.notDeepStrictEqual primitive used to verify clone isolation
  • validation/conversion errors retain causes and add metadata operation, key, and source-module stack context

Verification:

  • focused Bun corpus: 29 passed, 0 failed, 0 todo, 0 unsupported
  • permanent gRPC diagnostics: 11 passed
  • SQL adapter contracts: passed
  • permanent third-party JWT/utility mini-suite: passed
  • zig fmt --check and git diff --check: passed

Cumulative through position 3984: 326 files, 2,693 passed, 209 todo, 0 failed, 0 unsupported, 171 allowed-empty.

Sign in to comment on this issue.