[codex] Add first-class node delivery contracts

Merged
WI
5mo ago
+4632-1548

Summary

This PR makes nodes first-class delivery hosts instead of treating fleet WebSocket placement as the only node shape.

  • Adds node kind, delivery_adapter, and redacted delivery configuration storage.
  • Adds explicit agent_node_bindings so agents can be bound to a node delivery contract.
  • Adds HTTP push node delivery with bearer, static header, and HMAC-SHA256 auth modes.
  • Adds HTTP push ack modes: manual, on_2xx, and response.
  • Records route node, adapter, dispatch attempts, next retry time, and last dispatch error on delivery rows.
  • Updates the TypeScript SDK, shared delivery schema, OpenAPI, and README.
  • Updates the Rust, Python, and Swift SDKs with node creation, node-agent bindings, delivery route metadata, and flexible adapter delivery config models.

Why

An HTTP endpoint is a node with its own delivery contract. Modeling it this way keeps broker-controlled fleet nodes, one-agent HTTP endpoints, and future adapters behind the same node and binding model while allowing each node to declare special send requirements such as HMAC headers.

Notes

HTTP push failures now record dispatch metadata and leave the delivery queued with next_attempt_at. A background retry worker is intentionally left for a follow-up slice.

Validation

  • npm --workspace packages/engine run build
  • npm --workspace packages/engine test -- --run src/__tests__/conformance/delivery.test.ts src/__tests__/conformance/nodeDeliveryContracts.test.ts
  • npm --workspace packages/types test -- --run src/__tests__/sdk-openapi-sync.test.ts src/__tests__/types.test.ts
  • npm --workspace packages/sdk-typescript run build
  • npm --workspace packages/sdk-typescript test -- --run src/__tests__/type-safety.test.ts
  • npx turbo lint --filter=@relaycast/engine --filter=@relaycast/sdk --filter=@relaycast/types
  • cargo test --test parity
  • .venv/bin/python -m pytest
  • swift test
  • npm --workspace packages/types test -- --run src/__tests__/sdk-openapi-sync.test.ts
  • git diff --check