Repository navigation
feat(host): expose platform shell selection through the bus - #52
Merged
Merged
Conversation
Introduce a SelectShell method and shell selection types in tinybox-bus, bumping the contract version to 1.10, and expose shell discovery and command construction from the local host so callers can pick the right platform shell. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Expose a SelectShell module method that returns the host's shell flavor and invocation plan, selecting Bash with pipefail on Unix or cmd /C on Windows without executing anything. The README documents the new contract and an end-to-end test covers both platform branches. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a test asserting that SelectShellRequest defaults preserve_pipeline_status to false and that ShellInvocation round-trips its flavor, raw arguments, and bootstrap environment. Update the existing contract assertions to version 1.10 and the new SelectShell method, and add tinybox-bus as a dev dependency of the crate under test. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…ansai/tinybox into tinybox-shell-selection-7391
Rename the compiled manifest end-to-end test to reflect that it covers both grant and shell discovery, not just local grant discovery. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
|
Warning Review limit reached
This review includes 33 billable files and costs up to $8.25. Or wait 38 minutes for your next included review. View limit details
📝 Walkthrough
|
Move platform shell selection into TinyBox and expose supervised shell execution through the compiled module. After preserving the merged Docker and grant-discovery methods, contract 1.12 appends
SelectShell; 1.13 appendsStartShellExec(SpawnRequest, SelectShellRequest) -> ProcessRef.Unix discovers Bash at standard paths on each call, otherwise uses /bin/sh. Bash ignores imported functions and defaults to pipefail; preservation retains ordinary pipeline status. Startup removes BASH_ENV, ENV, SHELLOPTS and BASHOPTS after approved environment overrides. Windows selects SystemRoot/System32/cmd.exe from the parent environment independently of payload PATH/COMSPEC, uses /D /E:ON /V:OFF /S /C, and preserves the raw payload through supervised execution. Payload PATH overrides remain available inside the shell.
StartShellExec accepts empty argv and local passthrough resources only. It preserves cwd, approved environment and stdin, and reuses bounded output journals, request identity, cancellation, reservations and cleanup barriers. Unsupported providers are rejected before consuming admission. Discovery returns bootstrap environment names without values.
Part of tinyhumansai/openhuman#7391; dependency #51 is merged.
Validation:
cargo fmt --all -- --check,cargo clippy --all-targets --all-features -- -D warnings,cargo build --all-targets --all-features,cargo test --all-features.