ReviewOS

home-lang/home

Port gRPC server lifecycle and service registry

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

Bun corpus source

  • Position: 3995/4708
  • File: js/third_party/grpc-js/test-server.test.ts
  • Current state: unsupported module syntax during corpus preparation
  • Upstream shape: 46 ordinary cases plus 3 explicit todo/skip cases; one ordinary case is nested under a todo suite

Scope

Port the broader grpc-js server contract exercised by Bun:

  • server construction, binding validation/idempotence, credential matching, unbind, start, and shutdown lifecycle
  • service registration/removal, original method-name handling, unregister, default handlers, and unregistered-service errors
  • generic unary serialization, Echo service behavior, secure-context enable/disable, and compression across all RPC shapes
  • client visibility after unbind and actionable bind/service/lifecycle failures
  • preserve error cause, operation, target/address, method/path, lifecycle phase, and synthetic stack context

Tracked from #66. The connection-injection, drain cancellation, shutdown-stream, and NoCompress cases retain upstream todo/skip semantics unless the copied suite marks them executable.

10 days ago

Implemented and pushed in 899fe9e12 (feat(third-party): port gRPC server lifecycle).

This ports Bun corpus position 3995 (js/third_party/grpc-js/test-server.test.ts) with 45 passed and the 4 upstream todo/skip cases preserved. Coverage includes:

  • server construction plus bind validation, idempotent rebinds, credential mismatch, unbind cancellation, start, and shutdown
  • structured service/path registration, original method-name aliases, conflict detection, removal, unregister, default handlers, and unregistered-service responses
  • generic unary serialization, Math/Echo services, server credential enable/disable, and deflate/gzip flows across unary/client/server/bidi RPCs
  • 4 MB message handling and HTTP 415 for missing/invalid gRPC content type
  • balanced certificate-provider activation/deactivation across repeated binds, unbind, and shutdown

Lifecycle errors retain code, operation, address, phase, optional method, and original cause. Their stacks guarantee the original message, a synthetic Server.<operation> frame, and Caused by: chain. A permanent regression locks start, bind-validation, and service-registration diagnostics; the gRPC diagnostic suite is now 22/22.

Validation:

  • position 3995: 45 passed, 0 failed, 4 todo, 0 unsupported
  • positions 3990–3995: 114 passed, 0 failed, 4 todo, 0 unsupported
  • positions 3970–3978: 55 passed, 0 failed, 1 todo, 0 unsupported
  • positions 3979–3984: 43 passed, 0 failed, 1 todo, 0 unsupported
  • position 3985 isolated: 26 passed, 0 failed, 0 todo, 0 unsupported
  • positions 3986–3989: 72 passed, 0 failed, 4 todo, 0 unsupported
  • all permanent gates, zig fmt --check, and git diff --check: green

The known combined-shard async isolation artifact at 3985 is tracked separately in #254; it does not reproduce when the file is isolated.

Cumulative ledger through position 3995: 337 executable files, 2,905 passed, 217 todo, 0 failed, 0 unsupported, 171 allowed-empty.

Tracked from umbrella #66.

Sign in to comment on this issue.