RFC: PTY process attachment (terminal spawns + local fd handover)#33
Open
joshuajbouw wants to merge 3 commits into
Open
RFC: PTY process attachment (terminal spawns + local fd handover)#33joshuajbouw wants to merge 3 commits into
joshuajbouw wants to merge 3 commits into
Conversation
…r re-check The original gate composition was contradictory: gate 2 restricts attach-terminal to the uplink-capability proxy, while gate 3 required the caller to be the process creator (principal AND capsule). The proxy never creates agent processes, and as a run-loop capsule its effective principal is its load-time owner, not the client it bridges — so as written, no caller could ever satisfy both gates. Fix: attach-terminal takes the acting principal as an explicit parameter, following the publish-as trusted-uplink assertion precedent, checked against the process owner. Creator-capsule scoping stays unchanged for every other id-keyed call. Forward-compatible with kernel-owned per-connection binding (astrid#852) replacing the per-call assertion.
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
PTY-backed host-owned processes plus a local fd-handover attachment contract: an uplink (e.g. the CLI) can drive a full-screen interactive program that Astrid spawns, sandboxes, audits, and keeps alive independently of the attached terminal. Builds on the persistent-process tier (rfcs#22); the interactive complement to capsule-contributed CLI verbs (astrid#891).
Contract changes (additive amendment to astrid:process@1.0.0)
spawn-request.terminal: option<terminal-config>— PTY allocation, childsetsid'd with the slave as controlling terminal; merged output feeds the existing ring-buffer machinery, soread-since/write-stdin/watchdrive a PTY process programmatically without any attachment. Valid onspawn-background/spawn-persistentonly.resize(id, rows, cols)— TIOCSWINSZ + SIGWINCH.attach-terminal(id, stream, principal)— host dups the PTY master and passes it over the uplink's Unix-domain stream via SCM_RIGHTS; zero per-keystroke traffic through the bus or WASM. Gated:uplinkcapability, asserted-principal owner check (publish-as trust precedent; forward-compatible with astrid#852 kernel-owned binding), PTY-backed + running, AF_UNIX only. Audited per attach. The rejected alternative (uplink exec'ing binaries directly) and the remote-transport non-goal are written up.Unresolved questions
astrid:processborrowingastrid:net'stcp-streamneeds WIT-level confirmation (alternative: opaque proxy-minted stream token).TERMstays with the existing env mechanism; geometry-onlyterminal-config.