Skip to content

Give each error class one identity across subpaths and accept piped input in Rust (0.8.0) - #23

Merged
0thernet merged 2 commits into
mainfrom
claude/ux-b-custody-identity-20260926
Sep 27, 2026
Merged

0thernet merged 2 commits into
mainfrom
claude/ux-b-custody-identity-20260926

Conversation

@0thernet

Copy link
Copy Markdown
Member

Summary

Wave B (B6) carry-over from Wave A's local-custody gaps.

  • One error identity across subpaths. Each subpath used to bundle its own copy of ControlSocketError, ProtectedInputError and the custody errors, so error instanceof ControlSocketError failed when the class came from the root and the error from /control-socket. The build now uses Bun's code splitting (chunk-[hash].js in dist), so each class exists once. Determinism still holds across absolute roots (13 artifacts), and the packed-consumer smoke asserts class equality and a cross-subpath instanceof.
  • Pipe input in Rust. read_protected_descriptor accepted regular files only, so pbpaste | <rust-cli> login --stdin failed with kind. 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.
  • Sidecar guard. The sidecar's stdio carries its protocol, and a pipe is now readable, so read_protected_descriptor with fd 0–2 and read_protected_stdin are refused with kind. That matches the old observable result; new spec vectors cover both. The TypeScript engine never sends either request.
  • Version 0.8.0 (package, crate, inventory). README notes both changes.

Test plan

  • bun run check (inventory, error copy, lint, typecheck, 72 tests, Rust fmt/clippy/test, build, Rust artifacts, determinism, packed smoke)
  • New Rust tests: piped content, piped over-bound → limit, empty pipe → "", directory → kind
  • New vector: sidecar read_protected_stdin → kind

🤖 Generated with Claude Code

0thernet and others added 2 commits September 26, 2026 22:58
…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>
@0thernet
0thernet merged commit 8264263 into main Sep 27, 2026
7 checks passed
@0thernet
0thernet deleted the claude/ux-b-custody-identity-20260926 branch September 27, 2026 03:05
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.

1 participant