Repository navigation
Conversation
Brings the provider stack, including the EdgeZero cutover (#1506), into the cross-adapter health and startup-failure contract, and keeps the contract on every adapter. Core: the probe pre-dispatch hook takes EdgeZero's PreDispatchRequest, and its tests drive the hook through a router with run_pre_dispatch_hook, because PreDispatchRequest cannot be built outside EdgeZero. Fastly: the cutover's handle_request, assemble_app and finalize_response stay. Liveness is built from the shared probe response and sent natively. A new initialize_dispatch runs the sandbox initialization, answers GET and HEAD /ready from its result, and answers a failed assembly on the seven publisher fallback methods with the fixed 503, logging the assembly error that EdgeZero's assembly-error response would have logged. Other methods keep EdgeZero's assembly-error response. finalize_response skips operational responses as it skips trace responses. The retained router wraps the trace hook in the probe hook. Fastly needs no failure router, so the PR's Fastly startup_error_router and its matrix test go; the matrix moves to main.rs and runs through initialize_dispatch and the native conversion. Axum, Cloudflare and Spin: Hooks::routes logs the report and returns the PR's failure router instead of failing assembly, so liveness stays 200 and /ready and every supported route answer the fixed 503. The routers keep the cutover's middleware and Axum's received-head preparer, with the probe hook around the trace hook. The cutover's EdgeZero managed logger already gives Cloudflare and Spin a production log sink, so the PR's adapter loggers are dropped. Tests: the cutover's startup tests are moved to the contract. Fastly's missing-blob test checks the fixed 503 for GET, the assembly error for TRACE, then recovery. The Cloudflare and Spin routes() tests serve the failure router. The Axum binary test now requires the binary to keep listening with live health and a 503 /ready and page, in place of a non-zero exit. The two Axum connection-entry tests move from /health, which now bypasses configured response headers, to the identify preflight. The probe parity test takes the cutover's forbidden-router tuple and also asserts that probes send no outbound request. Docs: the API reference, adapter guides, READMEs, AGENTS.md and CHANGELOG keep both sides. Startup statements now describe the contract: no Axum exit, no Spin /health 503, no Cloudflare JSON 500, with the Fastly logger-failure case and the Fastly assembly error for unsupported methods kept. The smoke-axum.sh negative cases stay on the PR's 503 contract with EdgeZero's port variable.
Brings the identity integration chain, now including the health and startup contract (#1617) on the EdgeZero cutover (#1506), into the creative proxy disclosure policy, and keeps the policy on every adapter's proxy path. Core proxy: proxy_request keeps the cutover's EdgeZero outbound client and redirect follower. The creative identity policy now runs at the cutover's two check points. The first target passes check_proxy_target, then CreativeHops rejects userinfo, rewrites the reserved ts-ec query to the authorized identity or to none, and picks the hop's cache policy. Each followed redirect goes through redirect_policy, which, on the creative route, takes EdgeZero's prepared request, applies the same per-hop decision with the raw Location path check, and follows the rewritten request. Identity endpoints bypass upstream caches. The chain state is shared with the policy, because EdgeZero keeps the policy for the whole chain, and the final response becomes private once an identity endpoint was visited. A final 3xx with a Location on the creative route is an error, and creative responses strip the first-party passthrough headers. The creative route sends the fixed creative header profile through a header-profile choice in proxy_outbound_request. append_ec_id is gone, and ProxyRequestConfig carries query_identity and disclosure in place of forward_ec_id. Target logging drops the query, as the PR does. Adapters: every adapter prepares the proxy policy when it builds state, alongside the cutover's identity-provider rejection, and passes the request's EcContext into handle_first_party_proxy. The finalize middleware keeps the cutover's handler-error rendering and Fastly's RequestGeo, and marks 4xx and 5xx creative proxy responses terminal-private. Fastly's test-only service injection in build_per_request_services is not needed on the cutover, so it is not carried. Core settings, config and consent: both sides' fields, checks, warnings and test imports are kept. Testlight keeps the base's response cap and uses without_ec_id. Tests: the PR's core proxy policy tests, its parity module and its Fastly named-route test run on ScriptedHttpClient in place of the removed platform HTTP stubs, and read each hop's URI and cache policy from the recorded requests. The parity origin answers by path through a request observer. The Fastly named-route test routes with the cutover's outbound client and a held US geo and runs the real entry-point finalize_response. The Fastly network fixture uses EdgeZero's Fastly client. The cutover's first-party proxy readback test now expects the creative header profile. The CLI proxy test keeps the cutover's in-process Axum fixture. The CLI proxy explain tests create the `[proxy]` table, which the cutover dropped from the integration fixture, so the appended endpoint tables still parse. Docs: the first-party proxy redirect list combines EdgeZero's redirect rules with the per-hop identity policy and the creative terminal-redirect rejection, and the proxy settings table keeps both sides' rows.
|
For the identity integration chain (#1608), this PR now stacks on #1489, and its base is This PR's health and startup contract wins over the cutover's startup behavior on every adapter, so once both land these cutover statements no longer hold:
How the port fits the cutover:
Checked locally at |
Summary
/health) and application-initialization readiness (/ready) probes, so monitoring can distinguish a running handler from a usable application.503responses while enabling application-wide warn/error logging to the Worker console and Spin stderr, including startup diagnostics; keep probes independent of application authentication, cookies, and configured response headers.Compatibility: GET/HEAD
/readybecomes reserved everywhere, and Cloudflare gains local GET/HEAD/health. Move traffic-admission checks to/ready; Axum/healthnow remains live after caught startup failures. Fastly/Axum/Cloudflare startup statuses become503. Readiness does not poll runtime dependencies; ordinary errors after successful startup retain their existing mapping.Changes
.github/workflows/health-startup-contract.ymlAGENTS.md.tool-versionsCHANGELOG.mdcrates/trusted-server-adapter-axum/README.mdcrates/trusted-server-adapter-axum/src/app.rscrates/trusted-server-adapter-cloudflare/README.mdcrates/trusted-server-adapter-cloudflare/src/app.rscrates/trusted-server-adapter-cloudflare/src/lib.rscrates/trusted-server-adapter-fastly/src/app.rscrates/trusted-server-adapter-fastly/src/main.rscrates/trusted-server-adapter-fastly/src/sandbox.rscrates/trusted-server-adapter-spin/README.mdcrates/trusted-server-adapter-spin/src/app.rscrates/trusted-server-adapter-spin/src/lib.rscrates/trusted-server-cli/src/commands/dev/sandbox_probe.rscrates/trusted-server-core/src/health.rscrates/trusted-server-core/src/lib.rscrates/trusted-server-integration-tests/browser/helpers/infra.tscrates/trusted-server-integration-tests/tests/common/trace_boundary.rscrates/trusted-server-integration-tests/tests/environments/axum.rscrates/trusted-server-integration-tests/tests/environments/cloudflare.rscrates/trusted-server-integration-tests/tests/environments/fastly.rscrates/trusted-server-integration-tests/tests/environments/mod.rscrates/trusted-server-integration-tests/tests/html_eof_runtime.rscrates/trusted-server-integration-tests/tests/parity.rsdocs/guide/api-reference.mddocs/guide/axum-dev.mddocs/guide/cloudflare.mddocs/guide/fastly.mddocs/guide/integrations-overview.mddocs/guide/spin.mddocs/superpowers/plans/2026-11-16-1142-health-startup-contract.mddocs/superpowers/specs/2026-11-16-1142-health-startup-contract-design.mdscripts/README.mdscripts/smoke-axum.shscripts/smoke-cloudflare.shscripts/smoke-common.shscripts/smoke-fastly.shscripts/smoke-spin.shCloses
Closes #1142
Spec
Spec: Health and startup-failure contract, including two review rounds.
Implementation and verification: Plan.
Test plan
cargo test-fastly && cargo test-axumcargo test-fastly-reuse && cargo test-cloudflare && cargo test-spinAGENTS.mdcargo fmt --all -- --checkfastly compute servesmoke with Fastly 16.0.0 / Viceroy 0.21.0test-utils; exact GET and raw-wire HEAD, auth/header controls, diagnostic assertions, and publisher sentinel/rewrite controlsLocal baseline checks passed with Rust 1.98.1 and Node 24.20.0. The review correction in
1a801939eadditionally passed fresh Fastly tests in both modes, target-matched Clippy, real deadline fixtures, Rust/Markdown/docs formatting, README contract-link checks, and added-line domain lint. All 35 hosted checks passed on the prior headdba90aa; hosted results for the updated head are separate. Existing ignored tests are not counted as passing runtime smokes.Checklist
unwrap()in production codelogmacros for production diagnostics