Skip to content

Resolve confirmed correctness and architecture audit findings #26

Closed

Description

@jimeh

Reconcile the correctness and architecture audit against current source, then resolve accepted material findings before adopting the supported profile in #27.

The original audit covered 011fc999. This disposition ledger was refreshed against merged main 1b4870e on 2026-11-07, after #39, #40, #41, #42, #43 and #44, and updated on 2026-11-16 for #47, #48, #50, #61, #79, #81, #84, #87 and #96. Every finding now has a final disposition: all are resolved except L12, an accepted and disclosed Rack adapter limitation recorded in #27. Historical severity labels identify report entries; they are not a count of defects independently reproduced on current main. Current source inspection and old runtime evidence are distinguished below.

Acceptance

  • Reconcile every original correctness finding against current source, separating resolved items, remaining source findings, runtime evidence gaps and policy decisions.
  • Record a final disposition for each accepted finding, including its trigger, impact, ownership boundary and regression evidence.
  • Fix blocking defects in bounded PRs. Preserve failing evidence and demonstrate the intended regression assertion where proportionate.
  • Revalidate affected protocols, hosts, installed consumers and types without weakening processing, delivery, cancellation or cleanup contracts.
  • Document any explicitly accepted residual limitations in Define the supported 0.x protocol, host and public API contract #27. Source triage alone does not establish release readiness.

Current disposition ledger

Audit ID Finding and current disposition
H1 Native gRPC 405/415 lifecycle failure: resolved by #39. Preflight precedes processing ownership; lifecycle regressions cover host-supplied handles.
M1 Ambient rescued exceptions attributed to a successful call. Core paths resolved by #39; host remnants resolved by #96, merged as 358e3e1 on 2026-11-16. Every Async and Falcon host site now passes the exception from its own unwind instead of reading $ERROR_INFO. The only site that could see an unrelated ambient exception was async-http's HTTP/1 fail_request, which writes its 400 from inside rescue BadRequest; a real Falcon probe showed no live RPC exchange there, so nothing was misattributed. The other sites run in fresh host task fibers, which start with a nil $!. Falcon CompletionBody#close keeps its $ERROR_INFO default by design, because protocol-rack closes a rejected Rack response from its own rescue clause without passing the exception.
M2 Rack throw loses terminal lifecycle completion: resolved by #39, with transfer/unwind and SDK regressions.
M3 Resolved by #47, merged as 073f95a on 2026-11-08. Fallback caching defaults off, with boolean explicit opt-in through Server/environment options. A real pre-fix custom-header regression received the previous caller's cached response; focused checks passed both Ruby lanes, full local verification passed, and exact-head CI/internal/external reviews accepted the repair. Native RPC still bypasses fallback middleware. Opt-in retains the documented upstream cache limitations.
M4 Resolved by #50, merged as 95ecf9f on 2026-11-11. Each Host listener retries the named transient accept errors with bounded backoff. The sixth consecutive failure, or any other listener error, stops the Host, and Host#wait raises the original cause after cleanup. Startup is guarded against overlapping starts. This is separate from #28 client resilience and does not explain historical client H2 failures.
L1 Resolved by #84, merged as 712aace on 2026-11-16. Every error core normalizes from a rescued exception (unary client and server, GET base64) now has no cause; lifecycle observers still receive the original. The Rails controller follows the same rule since #87, merged as 66a03a3.
L2 Resolved by #84 (breaking SPI, fix!). Transports receive a read-only CallCancellation::View (cancelled?, reason, check!, on_cancel) for unary, Connect streams and gRPC streams; with_request passes a view through without a second arbiter. Migration notes are in the PR and docs/design.md.
L3 Resolved by #84. The ArgumentError rescue now covers only response header acceptance; other binding exceptions propagate unchanged.
L4 Resolved by #61, merged as 544d320 on 2026-11-15. The defect was on the gRPC client, not the server: rejecting a non-gRPC response content type drained the whole body to reach trailers. The drain now stops at Streaming::RECOVERY_LIMIT (256 KiB). A body that ends within the limit keeps its previous classification; a larger body is classified from the response head and its stream is reset by normal call cleanup.
L5 Resolved by #84. The session claims the send side before calling the exchange, so core calls close_send at most once; transports need not make it idempotent.
L6 Resolved by #84. A nil server response is internal "Nil response message" on every server protocol; a client sending nil stays invalid_argument.
L7 Resolved by #61, merged as 544d320 on 2026-11-15. Unary gRPC and the shared Connect single-request stream path check the next envelope header instead of decoding a second message. A surplus envelope is rejected with unimplemented before its payload is read; an oversized envelope still gets resource_exhausted.
L8 Resolved by #81, merged as 54d55fb on 2026-11-16. Servers record application request metadata once, when processing begins, so early native gRPC, gRPC-Web and Connect-stream failures and Connect unary header-validation failures no longer report empty request metadata.
L9 Resolved by #81, merged as 54d55fb. The behavior was wrong and the documentation right: every server Context now keeps mutable request metadata, while stream readers keep their own frozen header snapshot.
L10 Resolved by #96, merged as 358e3e1 on 2026-11-16. A real run reproduced RST_STREAM(INTERNAL_ERROR) when an Async H2 unary call was cancelled, reached its deadline or had its task stopped while its upload waited for flow-control credit, because async-http maps the cancelled output task to INTERNAL_ERROR. The client now resets with CANCEL (also covering ThreadedTransport); a 3-case spec observes the code on the wire and fails without the fix. Stream uploads blocked on credit take the same path, established by inspection. Servers send no cancellation reset: handler cancellation is an ordinary canceled response, and a client CANCEL or lost connection closes the stream without another frame.
L11 Resolved by #81, merged as 54d55fb. OTel error.type uppercases only gRPC and gRPC-Web status codes; local classifications are lowercase on every protocol, following OTel semantic conventions 1.44.
L12 Accepted adapter limitation, disclosed. Rack env normalization cannot preserve the distinction between underscore and hyphen request metadata names; docs/support.md and the Rack README document it, and native hosts are unaffected. Valid native metadata is not rejected. Recorded in #27 as an accepted residual limitation.
L13 Resolved by #79, merged as 915af39 on 2026-11-16. Reproduced with real generated callers: a top-level message Zlib broke gzip calls and URI broke WEBrick loading. The generator now reserves the 21 stdlib top-level roots the core runtime loads, and a spec fails if a future runtime require adds an unreserved root. Package roots with those names are rejected. Optional-gem roots and Bundler stay unreserved, disclosed in the support guide.
L14 Resolved by #79, merged as 915af39. The native runner exited 0 with no cases for an unknown selector; it and the gRPC-Web runner now fail before starting the runner. The core runner was already correct.
L15 Resolved by #79, merged as 915af39. Hosted CI logs showed root setup installing the Async and Falcon Gemfiles into the root bundle. The gRPC and keepalive interop tasks now run through their backend bundles, and a CI runtime spec fails if a backend job's task closure reaches root setup.
L16 Resolved by #79, merged as 915af39. 9 of 11 gemspecs globbed relative to the working directory, so a direct gem build from the repo root packaged the wrong files. Globs now use the gemspec's directory, and a wrong-directory build fails instead of packaging wrong content.
L17 Noncanonical archive modes under umask 002: resolved by #40's private canonical staging and archive matrix. A residual assertion message is cosmetic.
L18 Current documentation inventories and capability drift addressed by #46, merged as 805bb80. The support guide and owning guides now distinguish delivered capabilities, selected evidence and unresolved adoption gates; this documentation repair does not close the remaining correctness findings.

Additional bounded lifecycle finding

Resolved by #48, merged as 63b70f4 on 2026-11-10. The custom-observer detach interruption reported during #44 was separate from the original audit. Every successful observer attachment now gets one reverse-order detach attempt, even when another detach raises a fatal exception or throws. Fatal and nonlocal exits still propagate, and the repair does not claim to fix private state inside a failing observer.

Repair sequence and boundaries

  1. Falcon fallback cache default/configuration (M3). Done in fix: disable Falcon fallback caching by default #47.
  2. Observer-detach unwind, independently of Falcon. Done in fix: unwind observer tokens after escaping detach callbacks #48.
  3. Async Host accept failure diagnosis/policy (M4), then a bounded repair if established. Done in fix: recover transient Async Host accept failures #50.
  4. Core normalization (L1/L3/L6) and cancellation SPI ownership (L2/L5). Done in fix!: resolve audit normalization and transport SPI findings L1-L3, L5 and L6 #84. gRPC bounds (L4/L7) done in fix(grpc): bound rejected-media drains and surplus unary requests #61; lifecycle metadata and OTel (L8/L9/L11) done in fix: preserve lifecycle request metadata and caller baggage #81.
  5. Generator/tooling/package fixes (L13–L16). Done in fix: resolve audit generator, tooling and packaging findings L13-L16 #79.
  6. L10 wire verification and M1 host remnants. Done in fix: reset cancelled H2 uploads with CANCEL and pass host errors explicitly #96.

This sequence is a working priority order, not permission to combine unrelated changes or pre-accept every proposed fix. Remaining source-only claims must be validated in their owning repair. No optional architecture refactor is required merely because the audit suggested it. Shared dispatch rewrites, transport unification and other structural recommendations stay separate.

New repair PRs use the selected ship-feature-pr workflow with independent Codex/Claude review and CodeRabbit after internal acceptance. No release, publication, deployment, guard removal or merge is authorized by this issue.


Written on behalf of jimeh by claude-opus-5-5 using Claude Code via T3 Code.

Activity

  1. jimeh commented on Nov 16, 2026

    @jimeh
    OwnerAuthor

    Posted on behalf of jimeh by claude-opus-5-5 using Claude Code via T3 Code.

    Closing: every audit finding now has a final disposition. #96 resolved the last two, L10 (cancelled H2 uploads now reset with CANCEL) and the M1 host remnants (explicit error passing in the Async and Falcon hosts). L12 stays an accepted, disclosed Rack adapter limitation and is recorded in #27's new "Accepted residual limitations" section. The table above has the per-finding detail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions