Repository navigation
native-files: share the file-request fingerprints and guest key - #1362
Merged
Merged
Conversation
This was referenced Nov 3, 2026
nikhilbirmiwal-pplx
approved these changes
Nov 3, 2026
nikhilbirmiwal-pplx
left a comment
Member
There was a problem hiding this comment.
Checked that the write/write_batch/mkdir/remove/rename fingerprints, RequestDigest framing, and native-file- guest key move byte-for-byte into pplx-space-native-files, and FingerprintError maps to the same internal error.
Move RequestDigest, the per-operation request fingerprints and the guest-key derivation out of space-api's files handlers into a new pplx-space-native-files crate, so a second server answering Native files:* requests derives the same binding fingerprint and the same key the sandbox replays by. The crate sits in crates/l40_api: the request handling that follows it needs common-grpc's status markers and, later, axum, both fenced from l20_domain. No behaviour change: the encodings move byte for byte, and the_sandbox_key_changes_with_the_request moves with them.
NancyKwongPerplexity
force-pushed
the
native-files-shared-request
branch
from
November 3, 2026 19:39
619f917 to
cbe1c6a
Compare
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
Moves what a Native
files:*request means to itsIdempotency-Keyout of space-api's files handlers into a new crate,pplx-space-native-files:RequestDigest, the per-operation request fingerprints (write, write_batch, mkdir, remove, rename) and the guest-key derivation (native-file-<digest>). A second server answering these routes, the data plane later in this stack, must derive byte-identical values, because a client retry can land on either server: the binding lives inpublic_idempotency_recordsand the sandbox replays writes and renames by the guest key.The crate sits in
crates/l40_api/native/files, the first crate in a layer directory.l20_domainwould fit this PR alone, but the next PR adds request handling that needspplx-space-common-grpc's status markers, and the one after it renders errors with axum. Both are fenced froml20_domain([rules.layers.domain_fences]), so the crate starts inl40_apirather than moving later. The name avoids the banned catch-all tokens ([rules.crate_names]).No behaviour change. The encodings move byte for byte, and
the_sandbox_key_changes_with_the_requestmoves into the new crate with them. The crate's errors are a smallFingerprintError, which space-api maps to the sameinternalerror as before.Validation
At this head (
cbe1c6a1), onmainat0271415a:mainat0271415a. The only conflict wasCargo.lock: I tookmain's and let Cargo re-add this crate, which gives the same two lock entries as before. The commit is otherwise unchanged.cargo fmt --all -- --check,scripts/generate-env-contract.sh --check,scripts/check-rust-error-policy.shandscripts/source_guards/env_test_hook_boundary.pypass.cargo clippy --locked --all-targets --all-features -p pplx-space-native-files -p pplx-space-api -- -D warningspasses.cargo check --workspace --all-targets --lockedpasses.cargo archagainstmain's baseline, renames andARCHITECTURE.toml: 0 required findings and 112 advisory, the same findings asmain.cargo nextest run --config 'profile.test.package.pplx-space-api.opt-level=0' --all-features --all-targets, one package at a time, with Postgres and Redis from the nextest setup scripts andSPACE_CI_REQUIRE_TEST_DEPS=1:pplx-space-api2193 passed, 1 skipped;pplx-space-native-files1 passed.scripts/check_no_inline_rust_test_modules.pyfails onmainalready, on twopplx-space-observabilityfiles this change does not touch.Severity and risk
Severity: does not apply (refactor).
Risk: a change in any fingerprint or guest-key encoding would turn retries into 409s for up to 10 minutes after a deploy, and could let a different request reach another one's guest record. The move is verbatim, and the existing idempotency tests in
files/tests.rspass unchanged. To roll back, revert this PR.Stack
This is PR 1 of 5. Merge in order:
native-files-shared-handling)native-error-rendering-shared)native-file-access-rpcs)data-plane-native-file-access-authz)AI assistance: Claude Code drafted the code, tests, and this description; the author reviewed them.