test(runtime-e2e): add x-client-id/ parity with the other 4 SDKs#41
Merged
Merged
Conversation
Mirrors the runtime-e2e/x-client-id/ runners shipped in workstream B of Epic getaxonflow/axonflow-enterprise#2230 across Go/Python/TS/Java — the Rust SDK was the one outlier, verifying v9 X-Client-ID via wiremock-only unit tests with no live-agent companion. runtime-e2e/x-client-id/test.sh boots the community docker-compose stack (same shape as runtime-e2e/anthropic_interceptor/test.sh), then builds + runs runtime-e2e/x-client-id/helper/, a small tokio-based forwarding proxy that points the SDK at a 127.0.0.1 listener, captures the SDK's outbound headers off the wire, forwards the request to the real agent via reqwest, and asserts: X-Client-ID == AXONFLOW_TENANT_ID, X-Axonflow-Client starts with sdk-rust/, Authorization starts with 'Basic ', and X-Tenant-ID is absent. This is the wire-level companion to tests/x_client_id_header_test.rs (which uses wiremock) — both must pass for the v9 identity contract to be held. Bumps to v0.3.1 (patch — test infrastructure only, no SDK code change). Signed-off-by: Saurabh Jain <saurabh.jain@getaxonflow.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the post-merge coherence gap caught by master-tracker review of workstream B of Epic #2230: the Rust SDK was missing the
runtime-e2e/x-client-id/runner shipped by the other 4 SDKs (Go #168, Python #195, TS #227, Java #177).This PR adds the runner. No SDK code change —
src/client.rsis unchanged from v0.3.0. Pure test infrastructure.Bumps to v0.3.1 (patch).
Files
runtime-e2e/x-client-id/README.md— what the test verifies + how to run + parity contextruntime-e2e/x-client-id/test.sh— bash entry point: boots community docker-compose stack, runs the helper, asserts. Same shape asruntime-e2e/anthropic_interceptor/test.sh.runtime-e2e/x-client-id/helper/— small Rust cargo project (binary,publish = false) implementing an in-process forwarding-proxy: binds tokioTcpListeneron127.0.0.1:0, captures the SDK's outbound headers off the wire, forwards the request toAXONFLOW_AGENT_URLvia reqwest, asserts the 4 v9 invariants.CHANGELOG.md— v0.3.1 entryCargo.toml—version = "0.3.1"R1 — mechanical
cargo build --releasecleancargo clippy --all-targets -- -D warningsclean (SDK)cargo clippy --all-targets -- -D warnings --manifest-path runtime-e2e/x-client-id/helper/Cargo.tomlcleancargo fmt --checkclean (SDK + helper)cargo test --quiet— 23 passed, 0 failed (existing v0.3.0 wiremock unit tests still pass — additive change)R2 — functional (real-wire helper run)
Disclosure: Docker Desktop on the session host returned HTTP 500 from its API socket regardless of API version, so
test.sh's full docker-compose path could not run end-to-end in this session. CI will exercise that path. To prove the helper logic itself is correct end-to-end, I ran the helper against a Python stand-in HTTP upstream on127.0.0.1:18081with full request-capture.Helper stdout (PASS):
Wire-level headers as received by the upstream (these are the exact bytes the agent would see):
Decoding
Basic ZGVtby1jbGllbnQ6ZGVtby1zZWNyZXQ=→demo-client:demo-secret✓ matchesAXONFLOW_TENANT_ID:AXONFLOW_TENANT_SECRET.x-tenant-idis absent ✓ — agent'sapiAuthMiddlewarestill accepts it as an alias for back-compat through v9, but SDK-side we standardize onx-client-id.7db1d76(post-feat(identity): emit X-Client-ID + X-Axonflow-Client headers (v9) #40 merge)R3 — hostile self-review (per
feedback_mutation_test_to_prove_assertion_not_tautological.md)Mutation test:
src/client.rs→/tmp/client_rs_baselineheaders.insert(\"X-Client-ID\", val);with// MUTATION-TEST: removed X-Client-IDFAIL: X-Client-ID: want \"demo-client\", got Nonesrc/client.rsfrom baseline✅ Mutation confirmed: the runtime-e2e assertion fails iff the SDK does not emit
X-Client-ID. Assertion is not tautological.Hostile review pass also checked:
git diff origin/main -- src/is emptymain.go, Python hastest.py, TS hastest.mjs, Java hasSdkXClientIdTest.java, Rust now hastest.sh + helper/(matching Rust's existinganthropic_interceptorstyle)Cargo.lockof helper not committed (helper-local.gitignore) — same justification as the comment in that fileFull R3 doc kept at
/tmp/v9-rust-e2e-20260519T221516Z/r3.md(not committed perfeedback_evidence_bundles_never_in_git.md).Coordination
feedback_sub_sessions_admin_merge_when_ci_green_r3_done.md, admin-merging on green CI + R3 done; no master-tracker gating.