Skip to content

Audit: contract fidelity against @askrjs/server's adapter requirements #32

Description

@smiggleworth

Purpose

Audit task, not a bug report — produces a contract table, doesn't fix anything.

askr-node's entire job is to faithfully implement whatever transport contract @askrjs/server expects (Request/Response translation, streaming, abort propagation). This is the adapter-side counterpart to askr-server's own cross-package audit task — the two should converge on the same contract, so cross-reference that issue once it exists.

Procedure

  1. Read @askrjs/server's adapter-facing contract (whatever interface/type it expects a transport to implement — check AGENTS.md/docs for "adapter-author guidance," referenced in askr-server's closed docs: complete public API documentation #20).
  2. For each requirement in that contract, verify askr-node's implementation actually satisfies it (stream cancellation on abort, timeout enforcement, header fidelity, etc. — closed issue askr-node#23 "real-socket adapter cancellation and timeout conformance guard" is directly relevant prior art here, confirm its fix still holds).
  3. File a gap issue for any mismatch.

Definition of Done

  • Table: contract requirement | ✅ verified satisfied / 🔗 gap filed.
  • Every requirement in server's adapter-author guidance has a row.
  • No row left unmarked.

Audit results (2026-08-24)

Contract source: askr-server/README.md “Writing transport adapters” and @askrjs/server/testing.

Adapter contract requirement Evidence Result
Convert Node input to a Web Request without losing method, URL, headers, or streaming body tests/node.test.ts request translation, DELETE body, repeated header tests
Write Web Response status, status text, repeated cookies, body, and backpressure faithfully response fidelity/backpressure tests
Cancel a streaming response when the client socket closes shared runAdapterConformance real-socket test and early-disconnect test
Abort the Web request when the client disconnects during input should abort the Web Request when the Node request closes
Configure finite header/request timeouts for incomplete input shared conformance test; native timeout option/validation tests
Preserve adapter/application cleanup and wait for transport completion in-flight shutdown, concurrent close, and startup-abort tests
Reject untrusted Host/absolute authorities before dispatch host and request-target tests
Keep WebSocket upgrade lifecycle and abort propagation transport-owned WebSocket rejection, disconnect, timeout, and shutdown tests

Closed #23 conformance remains enforced by the shared runner. No server/adapter contract mismatch was found.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions