Give each error class one identity across subpaths and accept piped input in Rust (0.8.0) - #23
Merged
Merged
Conversation
…nput in Rust (0.8.0) - The build splits shared modules into chunks, so ControlSocketError, ProtectedInputError and the custody errors have one class each; an error thrown through one subpath passes instanceof against another. The packed smoke asserts it. - Rust read_protected_descriptor accepts pipes and sockets like the TypeScript reader, so piped login --stdin works in Rust CLIs. Regular files keep the owner and 0600 checks; other kinds are still refused. - The sidecar refuses descriptors 0-2 and read_protected_stdin with kind, because its stdio carries the protocol. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Review follow-up: a pipe from a slow writer can block long enough for a signal without SA_RESTART to interrupt read(2); the reader now retries EINTR like std::io::Read, including the over-bound probe. The Rust terminal refusal now matches the TypeScript copy (pipe or redirect). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.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
Wave B (B6) carry-over from Wave A's local-custody gaps.
ControlSocketError,ProtectedInputErrorand the custody errors, soerror instanceof ControlSocketErrorfailed when the class came from the root and the error from/control-socket. The build now uses Bun's code splitting (chunk-[hash].jsindist), so each class exists once. Determinism still holds across absolute roots (13 artifacts), and the packed-consumer smoke asserts class equality and a cross-subpathinstanceof.read_protected_descriptoraccepted regular files only, sopbpaste | <rust-cli> login --stdinfailed withkind. It now accepts pipes and sockets like the TypeScript reader. Regular files keep the owner and no-group/other checks; directories and devices are still refused (kind). The spec says the same.read_protected_descriptorwith fd 0–2 andread_protected_stdinare refused withkind. That matches the old observable result; new spec vectors cover both. The TypeScript engine never sends either request.Test plan
bun run check(inventory, error copy, lint, typecheck, 72 tests, Rust fmt/clippy/test, build, Rust artifacts, determinism, packed smoke)limit, empty pipe →"", directory →kindread_protected_stdin→kind🤖 Generated with Claude Code