Repository navigation
Initialize native TS from prepared immutable stores - #1528
ChristianPavilonis wants to merge 4 commits into
Conversation
prk-Jr
left a comment
There was a problem hiding this comment.
Summary
Verdict: REQUEST_CHANGES at ea779fb47. Two introduced issues are documented inline: incomplete migration of existing native harnesses and a macOS portability failure in gateway acceptance.
Cross-cutting / body-level findings
🔧 Required verification remains blocked. Current-head CI also has CLI/parity compilation failures and other failed gates. The disclosed credential-forwarding incompatibility remains unresolved. The SDK compatibility problems are inherited from the base; they still prevent readiness. Resolve the compatibility scope and required gate failures before treating the change as ready.
Local validation
With pinned Rust/Node: formatting, five provider-runner tests, 17 library tests, four binary tests, 11 HTTP tests, 32 route tests, and six startup tests passed. Acceptance had six passes, the macOS failure described inline, and one ignored real Next.js case. Docker provider runtime and the full cross-adapter matrix remain unverified locally. No fixes were implemented.
CI status
- CodeQL: FAIL
- Analyze (python): PASS
- Analyze (javascript-typescript): PASS
- Analyze (rust): PASS
- Analyze (javascript-typescript): PASS
- Analyze (actions): PASS
- browser integration tests: FAIL
- integration tests (Fastly EC lifecycle): FAIL
- trace runtime and browser acceptance: FAIL
- integration tests: FAIL
- cargo test (cross-adapter parity): FAIL
- cargo test (ts CLI, native) (ubuntu-latest): FAIL
- vitest: PASS
- cargo check (cloudflare native + wasm32-unknown-unknown): PASS
- ts dev lint domains (changed lines): FAIL
- cargo test: FAIL (branch-protection required)
- cargo test (ts CLI, native) (macos-latest): FAIL
- CI Node pin guard: PASS
- cargo check/build/test (spin native + wasm32-wasip1): PASS
- cargo test (axum native): FAIL
- HTML EOF runtime (Fastly): FAIL
- worker-deadlines (spin): FAIL
- prepare integration artifacts: PASS
- worker-deadlines (cloudflare): FAIL
- CLAUDE.md symlink guard: PASS
- format-typescript: PASS (branch-protection required)
- docs-proposal scripts: PASS
- format-docs: PASS (branch-protection required)
- cargo fmt: FAIL (branch-protection required)
Per the user, every feature is built once and works on every adapter in platform order, with platform gaps sent to EdgeZero (DEC-16, SH-5). T21 moves the identity routes, EC lifecycle, providers and write-back into one router in core that each adapter mounts; A2, A10, T8, T9, T17 and T18 shrink to turning it on per adapter and passing the conformance suite, and T7, T14 and A11 fold into A2 and A10. EZI-2a adds EdgeZero's local store for Axum development and EZI-4 binds Axum's geo provider from the manifest. Restack the Axum RC units on #1506: #1531 carries A1 in place of #1528, #1533 and #1534 close as copies of #1525 and #1526, and the image and Terraform units sit directly on #1532 so A6 and A7 stop waiting on A2. Record #1566, refresh the provider stack's fixes at their current heads, and flag #1535 as unplanned.
ea779fb to
420bfc4
Compare
|
Updated
|
6f4f6bc to
ba93d11
Compare
dhruv8sh
left a comment
There was a problem hiding this comment.
Summary
This PR moves native Axum startup off environment-variable-backed config and secret stores. Startup now runs through EdgeZero's run_production_app_with_initializer. It reads the config envelope and the required secrets with bounded reads, checks the envelope's structure, builds AppState, and installs immutable read-only snapshots before the listener starts. Handlers and middleware now resolve typed state from the request instead of capturing it, and checked NativeIngressMetadata normalises RequestInfo, the URI and Host together. The design is sound: there is no legacy fallback, unsupported signing and dynamic DataDome CIDR sources are rejected before readiness, and test seams stay separate from the production path. I found nothing blocking. The comments below cover a small inconsistency in how the client IP is derived, a loss of detail in startup diagnostics, and a stale SDK revision in the new guide.
1 of the inline comments below carries a one-click GitHub
suggestion. Use Commit suggestion to apply it as a commit on the PR branch. The other comments describe the fix in prose because it spans several lines that a single-line suggestion can't cover.
Non-blocking
🤔 thinking / ♻ refactor / 📝 note
- Trace client IP and runtime-services client IP fall back differently — see inline at
crates/trusted-server-adapter-axum/src/app.rs:839 - Missing-secret startup errors no longer name the reference — see inline at
crates/trusted-server-adapter-axum/src/startup.rs:244 - Guide cites an SDK revision the workspace doesn't pin — see inline at
docs/guide/native-rc-demo.md:6
👍 praise
VerifiedConfigBlobsplits verification and required-key collection from resolution cleanly, so native startup can await finite provider reads without ablock_on. The oldsettings_from_config_blobpath keeps its behaviour by delegating to the same pipeline.apply_native_ingressrewritesRequestInfo, URI andHostfrom the same checked facts, which closes the absolute-form-target scheme override. The unmanaged-request test checks that rawForwardedheaders are ignored.
| let client_ip = request | ||
| .extensions | ||
| .get::<NativeIngressMetadata>() | ||
| .map(NativeIngressMetadata::effective_client) |
There was a problem hiding this comment.
🤔 thinking: This uses .map(NativeIngressMetadata::effective_client).unwrap_or_else(...), so when NativeIngressMetadata is present but effective_client() returns None, the trace client IP becomes None. build_runtime_services in platform.rs (lines 93–102) uses .and_then(effective_client).or_else(...), so in the same case it falls back to the raw socket peer. One request can then show a client IP to the trace hook that differs from what handlers see through RuntimeServices::client_info.
Pick one rule and use it in both places. If a present-but-empty ingress record should mean "unknown" (fail closed), platform.rs should stop falling back. If falling back to the peer is intended, align this side:
let client_ip = request
.extensions
.get::<NativeIngressMetadata>()
.and_then(NativeIngressMetadata::effective_client)
.or_else(|| {
request
.extensions
.get::<AxumRequestContext>()
.and_then(|context| context.remote_addr)
.map(|peer| peer.ip())
});The cleanest fix is probably one shared native_client_ip(&Extensions) helper that both call. Apply manually: the change spans two lines here plus the matching code in platform.rs, so it can't be a single-line suggestion.
| remaining = remaining.checked_sub(read.backend_bytes).ok_or_else(|| { | ||
| configuration_error("native secret extraction exceeds the total byte budget") | ||
| })?; | ||
| let value = read.value.ok_or_else(|| configuration_error( |
There was a problem hiding this comment.
♻ refactor: The old resolver reported which reference failed (failed to resolve secret reference at `handlers[0].password` ). The native path now reports only "a required app-config secret is missing in trusted_server_secrets". The bounded-read failure on line 238 is just as generic. smoke-axum.sh had to weaken three distinct assertions to the same string because of this. An operator with several references can't tell which one to publish.
The key is a reference name, not a secret value (the core resolver already prints paths), so including it doesn't conflict with the no-secret-in-diagnostics rule in settings_error:
let value = read.value.ok_or_else(|| configuration_error(&format!(
"required app-config secret `{key}` is missing in trusted_server_secrets; publish every active reference before starting",
)))?;Do the same for the get_bytes_bounded error message on line 238, and restore the per-case smoke assertions. Apply manually: the replacement spans lines 244–246 plus line 238.
| This extracts the existing native demo onto the reviewed EdgeZero stack. It is | ||
| not production certification or an AWS deployment. The extraction starts from TS | ||
| main `6fbe64aa056a17d32b272d67df3dd89b21ce895f` and uses one exact public SDK revision, | ||
| `456313675b6a85e11acea870240f6a6d869f1137`. The original demo RC remains preserved. |
There was a problem hiding this comment.
📝 note: The guide says the extraction "uses one exact public SDK revision" 456313675b6a…. The workspace Cargo.toml and Cargo.lock in this PR pin every EdgeZero crate to 1619078a665188c1c282375ec9c11cd1b4f64ee7, and the commits say they target EdgeZero 1619078a. The superseding banner in docs/superpowers/specs/2026-10-20-edgezero-431-compatibility-design.md (line 1) repeats the same stale SHA. Operators following the guide would look for the wrong SDK revision.
| `456313675b6a85e11acea870240f6a6d869f1137`. The original demo RC remains preserved. | |
| `1619078a665188c1c282375ec9c11cd1b4f64ee7`. The original demo RC remains preserved. |
The spec banner needs the same SHA fixed by hand.
prk-Jr
left a comment
There was a problem hiding this comment.
Summary
Follow-up pass at ba93d111. Native Axum startup now reads a bounded, verified config envelope and only the secrets it actually references before the listener starts, then serves from immutable snapshots. Handlers, middleware and the trace hook take their state from the initialized App instead of capturing it. My two blocking findings from ea779fb47 are fixed, and all 25 checks pass at this head, so I'm approving. Everything below is non-blocking.
1 of the inline comments below carries a one-click GitHub
suggestion. The CI change in the body can't be a suggestion because.github/workflows/format.ymlis outside this diff.
Earlier findings
- Harness migration (P2): fixed.
environments/axum.rs,integration.rs,html_eof_runtime.rsandsmoke-axum.shnow launch with a prepared config dir andEDGEZERO__SECRETS__*. At this headintegration tests,cargo test (axum native)(which also runs the nativehtml_eof_runtimetest and the Axum EOF/auction script) and the parity suite all pass.smoke-axum.shisn't in CI; that rests on your local run. - macOS gateway portability (P2): fixed. On Apple Silicon macOS (rustc 1.98.1)
native_acceptancepasses 7 of 7, with the real Next.js case ignored as before. The untrusted-peer case keeps its meaning: proxy trust is on (198.51.100.1/32) and a direct127.0.0.1request with spoofedForwardedis still rewritten to the listener origin. - Blocked verification (body): resolved. No check fails at this head. The
cargo fmtjob also runs every clippy alias, includingclippy-axum --all-features, so both AWS features are linted in CI. - Forwarding incompatibility: resolved for this SDK. At EdgeZero
1619078athe Axum service callsprepare_received_headbeforestrip_forwarding_headers(service.rs:468then:485), soForwarderPreparation::capturestill sees the forwarder headers. The parity suite'strusted_forwarder_axum_boundary_*cases pass at this head.
Non-blocking
- 🤔 The guide's logging warning names
RUST_LOG, which the binary doesn't read. See inline atdocs/guide/native-rc-demo.md:140. - ⛏ A startup test name overstates what it checks. See inline at
crates/trusted-server-adapter-axum/tests/startup.rs:246.
Cross-cutting / body-level findings
-
🏕 No CI job runs
scripts/tests/test-native-providers.test.mjs. The guide lists it under checks, and it passes locally (5 of 5, about 2 s, Node only), but no workflow runs it. A small job next to the existing script-test jobs would keep the harness helpers from rotting:native-provider-harness: name: Native provider harness script runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Use Node.js uses: actions/setup-node@v4 with: node-version-file: .tool-versions - name: Test the native provider harness helpers run: node --test scripts/tests/test-native-providers.test.mjs
actionlintadds no new warnings and the CI Node pin guard still passes with this job. Apply manually: the workflow isn't part of this diff. -
📝 About the open client-IP thread on
app.rs:839. The two paths can only disagree whenNativeIngressMetadata::effective_client()isNone. At EdgeZero1619078athat happens only when the connection has no socket peer (trusted_proxy.rs:322), and then the peer fallback isNoneas well. So the inconsistency is real in the code's shape but not reachable today. Sharing one helper is still the cleaner fix. -
📝 The PR description is out of date. It still says "Draft", names head
ea779fb47, says required checks have failed, and describes execution as paused at the forwarding compatibility stop. None of that holds at this head.
Verification
cargo test -p trusted-server-adapter-axum, native on macOS: lib 23, bin 1,native_acceptance7 (1 ignored),native_http11,routes44,startup6 — all pass.- Negative controls:
- Removing
apply_native_ingressfromexecute_handlermakesabsolute_request_target_cannot_override_checked_public_schemeand the two-gateway isolation test fail. - Removing the
validate_snapshot_consumerscall frominitialize_nativemakesmissing_prepared_inputs_and_invalid_runtime_config_exit_before_listenfail.
- Removing
node --test scripts/tests/test-native-providers.test.mjspasses 5 of 5 locally (Node 24.12; the repo pins 24.20).- Not run: the AWS-feature provider acceptance (
scripts/test-native-providers.mjs), the ignored real Next.js case, andsmoke-axum.sh.
CI Status
All 25 checks reported at ba93d111 pass, including cargo test, cargo test (axum native), cargo test (cross-adapter parity), integration tests, integration tests (Fastly EC lifecycle), browser integration tests, HTML EOF runtime (Fastly), trace runtime and browser acceptance, both worker-deadline jobs, both CLI jobs, cargo fmt (with all clippy steps), vitest, format-docs, format-typescript and ts dev lint domains (changed lines).
| cloud, publisher, auction, fleet, production security or image acceptance. | ||
| Historical qualification reports are not packaged as current approval. | ||
|
|
||
| Keep `RUST_LOG` at `info` or quieter around operator inputs. AWS dependency |
There was a problem hiding this comment.
🤔 thinking — This warning names a variable the native binary doesn't read. trusted-server-axum takes its log level from EDGEZERO__LOGGING__LEVEL (see the doc comment in src/main.rs; EdgeZero 1619078a resolves only that variable, and has no RUST_LOG lookup). The warning itself is real: with both AWS features on, cargo tree -e features -i tracing shows tracing's log feature enabled, so AWS SDK DEBUG/TRACE events are forwarded as log records into the EdgeZero logger. An operator who follows this line and sets RUST_LOG=info still exposes them if EDGEZERO__LOGGING__LEVEL=debug. scripts/test-native-providers.mjs already sets both, so only the guide is affected.
| Keep `RUST_LOG` at `info` or quieter around operator inputs. AWS dependency | |
| Keep `EDGEZERO__LOGGING__LEVEL` at `info` or quieter around operator inputs. AWS dependency |
Docs Prettier (docs/.prettierrc, proseWrap: preserve) passes with this line.
| } | ||
|
|
||
| #[test] | ||
| fn valid_prepared_inputs_serve_real_routes_and_ignore_changed_config_until_restart() { |
There was a problem hiding this comment.
⛏ nitpick — The test name says changed config is ignored until restart, but after replacing the config file it only re-checks /health, which never reads application state, so it would pass even if the app re-read the file. The real immutability evidence is running_snapshot_is_immutable_and_restart_adopts_config_and_secret in native_acceptance.rs (page origin and admin password both stay on the old snapshot, then switch after restart). Either rename this to what it checks (..._and_keep_serving_after_the_input_changes) or drop the claim. No change to behaviour.
The native binary reads its log level from EDGEZERO__LOGGING__LEVEL; RUST_LOG has no effect on it. AWS SDK tracing events reach that logger through tracing's log feature, so the warning must name the variable that actually controls them.
The guide lists scripts/tests/test-native-providers.test.mjs as a check, but no workflow ran it. Add a Node-only job, matching the existing script-test jobs, so the harness helpers cannot silently rot.
Summary
Draft. Required current-head checks have failed. The current-main forwarding/provenance incompatibility below is not waived.
Stack and exact input
Head:
ea779fb47c0d20bb53f66ef342ff1367d7ede7f6. Base:review/edgezero-compatibility.Retain the original demo RC #1424 and its dirty worktrees. No source from excluded #1499 or the independent #1506 implementation is imported or coordinated. Relay/privacy work remains separate. No deployment, live input change, main merge, old-RC retirement or recovery deletion is part of this PR.
Changes
Closes
Closes #1524.
Spec
Preserved original native contract and two-round review, with an explicit historical-identity/delivery preface. Current startup guide identifies the selected SDK, caller port and current scope. Later combined-source proof is separate.
Test plan
Compatibility stop: selected SDK4563136 removes X-Forwarded-Host/Proto before
app.begin_ingress, while current TS main's credential-authenticatedForwarderPreparationneeds those assertions afterward. The isolated test-only constructor correction compiles and strict CLI Clippy passes, but real proxy regressions still return403 instead of200 and lose the browser authority/port. No trust policy, SDK hook/order change, raw-header fallback or assertion relaxation was implemented. Execution is paused for the scope choice between compatible-baseline demo cleanup and separately scoped current-main forwarding/provenance compatibility.Source: SDK native boundary. Native proxy regression output is retained privately with exact tested patches. Parity API compile and earlier Fastly EOF failures remain open. Narrow local fixture/profile work is preserved but unpublished; it is not a full current-head pass.
The inherited HTTP fixture now uses
pbs.example.cominstead of a TEST-NET IP rejected by the repository domain linter. All27 focused auction-plan tests and strict Core Clippy passed on that test-only correction; no allowlist/suppression, behavior or assertion was relaxed. Other unchanged-input results below remain bounded to their recorded source.Current source: Core3386 passed/2 existing ignores; native17 lib +4 binary +7 acceptance/1 ignored +11 HTTP +32 routes +6 startup, with1 ignored doctest; provider-runner Node5 passed; strict Core/Axum Clippy and formatting pass. Final Fastly/Cloudflare/Spin compile checks pass on this head. The ignored real Next.js case, independent account-free provider runtime, required broader/Fastly/deadline/EOF gates, image and cloud acceptance are not claimed passed. SDK draft462 separately discloses an unclassified parallel hosting-fixture failure; the focused pass does not waive it.
Checklist