Skip to content

Add pre-dispatch hooks and explicit request ingress fidelity #402

Closed

Description

@prk-Jr

Description

Applications need a local interception seam before method/path routing and ordinary middleware, while preserving the concrete RouterService used by all adapter entry points. Runtime transformations and parser rejection must remain explicit so consumers do not mistake a copied runtime request for original wire preservation.

Add a shared asynchronous pre-dispatch hook and bounded, confidential ingress metadata across Fastly, Cloudflare, Axum, and Spin. Preserve the runtime-visible method token and headers, expose trusted origin facts separately from target fidelity, and document unavailable or unknown capabilities.

Acceptance criteria

  • Hooks can return terminal responses, mutate continuing requests, and stop dispatch on errors before router matching/state/introspection/context/middleware.
  • All four converters attach ingress metadata; missing or transformed original facts are explicit and never logged or serialized by default.
  • Cloudflare conversion preserves Web Request extension-method tokens and UTF-8 header bytes; runtime-level parser rejection remains a distinct result.
  • Fastly supports snapshots captured before native mutation without cloning request handles or changing client provenance.
  • Locked native/browser/WASM tests and raw local-runtime fixtures validate supported and unsupported outcomes, including origin provenance and process cleanup.
  • Required Rust/docs gates pass; capability documentation does not claim production-wire preservation, raw Fastly targets, bounded transport allocation, or consumer compliance.

Verification

Workspace strict format/lint/tests and feature/WASM checks; adapter runtime/browser contracts; 54 source-built fixed raw HTTP cases; isolated fixture/runner format/lint/tests; docs lint/format/build.

Activity

  1. self-assigned this
    on Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions