Skip to content

Parity with AX f3e6ecc: Gateways and rax --trace - #18

Merged
h0ffmann merged 2 commits into
mainfrom
claude/project-thread-jd0d0f
Nov 13, 2026
Merged

h0ffmann merged 2 commits into
mainfrom
claude/project-thread-jd0d0f

Conversation

@h0ffmann

Copy link
Copy Markdown
Collaborator

Requested by Hoffmann · project thread

Brings RAX from AX dcdfd0a to AX f3e6ecc (2026-11-12).

Gateways

AX added a Gateway kind, whose egress rules are Agent Substrate's EgressRule, along with five RPCs and TaskSpec.gateway.

  • protos: gateway.proto, ax.proto and task.proto are copied unchanged. Substrate's ateapi.proto moves to proto/substrate/api/ateapi/v1 so that the import in gateway.proto resolves. rax-api generates only the Substrate messages, not its service. buf formats and lints only AX's protos (--path proto/pkg/apis), the same way AX's make generate does.
  • rax-api: adds the Gateway manifest and validate_gateway, with AX's rules: exactly one kind per rule; no *, IP addresses or localhost; credentials only on https rules without wildcards; ports required on tlsPassthrough. spec.gateway must have a name.
  • rax-store: Gateway records in the memory and PostgreSQL stores, plus AX's gateways table.
  • rax-server: Get, List, Create (AlreadyExists), Update (NotFound) and DeleteGateway. CreateTask refuses spec.gateway with Unimplemented, as AX does until gateway rules are enforced.
  • rax-cli: apply, get, describe and delete work on gateways, with AX's output.

rax --trace

  • With the flag, the command gets a sampled root span and prints its trace ID to stderr. Resolving the server address is a child span. Each AX RPC is a client span that sends a W3C traceparent.
  • Without the flag, no tracer is created and no trace context is sent.
  • Spans are exported once over OTLP, and only when an OTLP endpoint is set. The export waits at most 2 s (200 ms after a double Ctrl-C in ssh) and does not retry. A failed export prints a warning that names the endpoint.
  • The OTEL_*_EXPORTER rules and the telemetry resource move into a new rax-otelenv crate shared by rax-server and the CLI, mirroring AX's otelenv.

Not ported

These AX changes are CI and repository settings with no RAX feature: golangci-lint / make verify, rulesets managed as code, and skipping E2E on docs-only changes. RAX already lints with clippy. AX's labeled break fix in the reconciler has no Rust counterpart, because the Rust retry loop has no such bug.

Testing

  • cargo fmt --check, cargo clippy --all-targets -D warnings, cargo test --all: 201 tests pass, up from 191. buf format and lint are clean.
  • New tests cover gateway YAML round trips, egress validation, store conformance, the RPCs, the CLI output, the E2E gateway CRUD replay, and --trace (the traceparent header, export to a fake OTLP collector, and the warning when the collector is unreachable).
  • PostgreSQL tests were skipped locally because no database was available; CI runs them.
  • The mixed runs against AX's Go binaries were not repeated this time.

Generated by Claude Code

Gateways: AX's new gateway.proto (copied unchanged, with ax.proto and
task.proto) adds the Gateway kind, its five RPCs and TaskSpec.gateway. Its
egress rules are Agent Substrate's EgressRule, so Substrate's ateapi.proto
moves to proto/substrate/api/ateapi/v1, where gateway.proto's import finds
it, and rax-api generates its messages (not its service) into
rax_api::substrate::ateapi::v1. buf formats and lints only AX's own protos,
as AX's make generate does.

- rax-api: the Gateway manifest, validate_gateway (one kind per rule; no
  `*`, IP addresses or localhost; credentials only on https rules without
  wildcards; ports required on tlsPassthrough) and spec.gateway needing a
  name.
- rax-store: Gateway records in both stores, and AX's gateways table.
- rax-server: Get, List, Create (AlreadyExists when present), Update
  (NotFound when missing) and DeleteGateway under the gateway lock.
  CreateTask refuses spec.gateway with Unimplemented until gateway rules are
  enforced, since a task is immutable.
- rax-cli: apply, get, describe and delete gateways, with AX's output.

--trace: the command gets a sampled root span whose trace ID goes to
stderr, resolving the server address is a child span, and each AX RPC is a
client span that sends a W3C traceparent. Without the flag no tracer is made
and no trace context is sent. Spans are kept and exported once over OTLP,
only when an OTLP endpoint is set, within 2 s (200 ms on a double Ctrl-C in
ssh) and without retries; a failed export is a warning naming the endpoint.
The OTEL_*_EXPORTER rules and the resource move from rax-server into a new
rax-otelenv crate, which both use, as AX moved them into otelenv.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0193yhp36oDAu6CBMYsbPxH8
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0193yhp36oDAu6CBMYsbPxH8
@h0ffmann
h0ffmann merged commit 5e0f3c5 into main Nov 13, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants