Repository navigation
feat(host): expose platform shell selection through the bus #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
115 commits
Select commit
Hold shift + click to select a range
22b2034
feat(bus): add platform shell selection to the host contract
senamakel 6111075
feat(tinybus): add SelectShell method for platform shell discovery
senamakel aa07097
test(tinybox-bus): cover shell selection wire defaults and contract bump
senamakel 4beca81
chore: files changed crates/tinybox-bus/src/shell_selection.rs
senamakel 71f4fb4
Merge branch 'shrink-core-sandbox-7390' of https://github.com/tinyhum…
senamakel 2dfea5f
test(tinybox-module): rename grant discovery e2e test
senamakel d97c464
Merge branch 'shrink-core-sandbox-7390' of https://github.com/tinyhum…
senamakel fcd5da1
Merge branch 'shrink-core-sandbox-7390' of https://github.com/tinyhum…
senamakel 6334937
Merge remote-tracking branch 'origin/shrink-core-sandbox-7390' into t…
senamakel 041943b
test(local): cover cmd quoting and shell startup flags
senamakel 15bad6f
fix(host): harden shell selection for cmd and posix
senamakel 8a89701
Merge remote-tracking branch 'origin/shrink-core-sandbox-7390' into t…
senamakel 114679e
docs: record shell-selection contract and verification sequence
senamakel e0c8cee
test(shell): cover bash startup environment isolation
senamakel 1322ae2
feat(shell): harden shell startup environment and cmd flags
senamakel d917523
Merge remote-tracking branch 'origin/shrink-core-sandbox-7390' into t…
senamakel 855c81c
chore: files changed crates/tinybox-module/tests/grants_manifest_e2e.rs
senamakel 996c75a
docs: add native shell execution plan and spec
senamakel 59787fc
feat(bus): add native shell execution contract
senamakel 3f37d57
chore: files changed crates/tinybox-bus/src/lib.rs,crates/tinybox-bus…
senamakel 651a806
fix(tinybus-module): correct match arms for stream execution result
senamakel dc91f45
Merge branch 'shrink-core-sandbox-7390' of https://github.com/tinyhum…
senamakel 00adb9d
test(shell): cover inherited bash options not aborting payload
senamakel 6fe8ee2
test(tinybox-module): cover native shell replay, budget and timeout p…
senamakel 24a9eea
fix(host): strip inherited SHELLOPTS and BASHOPTS from shell environment
senamakel dde0188
test(tinybus): update execution state assertions to struct variants
senamakel f44c028
refactor(tinybox-module): extract execution collector selection
senamakel e198ea2
Merge branch 'tinybox-shell-selection-7391' of https://github.com/tin…
senamakel 64911ab
refactor(tinybox-module): extract owned collector check into helper
senamakel 4eab081
test(native_shell): add test module for native shell
senamakel 1ed18e3
fix(tinybox-module): validate spawn request ids before use
senamakel cd0e19c
docs: document native shell execution contract 1.11
senamakel c6dac81
refactor(native_shell): inject jail backend into shell context
senamakel 2464f89
refactor(native_shell): move shell context types into a types module
senamakel fe26fa6
Merge branch 'shrink-core-sandbox-7390' of https://github.com/tinyhum…
senamakel b55f24a
docs(tinybus-module): document StartShellExec in the interface table
senamakel b7103f8
Merge branch 'tinybox-shell-selection-7391' of https://github.com/tin…
senamakel 6c5fe06
test(tinybox-module): cover shell output limit termination and reaping
senamakel 1e7aa0f
docs: update native shell execution status to implemented
senamakel 118fb6e
test(grants-manifest): extract discovery checks into a helper
senamakel a3a2654
Merge branch 'tinybox-shell-selection-7391' of https://github.com/tin…
senamakel 3de4381
Merge remote-tracking branch 'refs/remotes/upstream/shrink-core-sandb…
senamakel 477d55d
test(tinybus-module): cover retryable close after failed scratch dele…
senamakel 4f9b118
test(tinybus-module): cover native shell selection and execution over…
senamakel 2618710
fix(native_shell): retry scratch cleanup after deletion failure
senamakel ba7ed28
fix(tinybus_module): read cleanup acknowledgement from the stream jou…
senamakel 78249af
test(tinybox-module): include mode and status in descendant cleanup a…
senamakel 6b577f6
test(tinybus-module): cover shell admission rejection for nonlocal an…
senamakel c9fce8e
test(shell): cover exported bash functions hiding pipeline failures
senamakel c8c4c96
fix(local): run bash with -p to ignore exported functions
senamakel 88fdcd0
refactor(local): drop caching from bash path discovery
senamakel 3250982
test(grants-manifest): relax shell argument assertions
senamakel e5a2a41
test(grants): cover shell execution through the compiled manifest
senamakel e285a0b
feat(bus): add supervised native shell execution
senamakel 86ef52a
feat(tinybus): add StartShellExec for supervised native shell execution
senamakel 5e06baf
test(tinybox-module): cover scratch retention for cancelled native shell
senamakel e38bd4c
test: update wire snapshot and stream fixtures for new fields
senamakel 4ee9721
fix(native_shell): run scratch cleanup off the async worker
senamakel 1badd56
fix(native_shell): run scratch cleanup on a blocking worker
senamakel 801f727
refactor(tinybus-module): extract shell execution preparation
senamakel 1af93d7
test(grants): use explicit BTreeMap default for env
senamakel 6a2d6de
refactor(native_shell): use captured scratch handle in cleanup task
senamakel 6755908
chore: files changed crates/tinybox-module/src/tinybus_module/mod_tes…
senamakel e2bf015
test(grants-manifest): build dynamic module under checkout target
senamakel 4272dc5
chore: files changed crates/tinybox-host/src/local/shell.rs,crates/ti…
senamakel d9cfe26
fix(shell): use absolute /bin/sh for the posix fallback
senamakel 9e3b9c6
Merge shell selection updates into native shell execution
senamakel ba6e2ff
Merge main and preserve additive shell contract ordering
senamakel 8360865
test(shell): cover cmd selection and payload path isolation
senamakel 85f1c4d
fix(local): resolve cmd.exe from SystemRoot instead of PATH
senamakel b07c281
refactor: use map_or_else for fallible path defaults
senamakel 9779e16
docs(tinybus-module): document windows cmd.exe resolution
senamakel 4d79180
test(tinybox-jail): canonicalize paths in git config grant assertions
senamakel 1f37982
test(grants): isolate git config fixtures from xdg override
senamakel dff1091
chore: files changed crates/tinybox-module/tests/grants_manifest_e2e.rs
senamakel 294c5fe
Merge latest base and preserve the existing shell execution contract
senamakel b2ebf59
test(git_config): canonicalize paths in xdg config home assertions
senamakel e88d382
test(tinybox-module): cover shell discovery and docker deadline valid…
senamakel e95d96a
Merge remote-tracking branch 'upstream/tinybox-shell-selection-7391' …
senamakel 52fc1f9
Merge pull request #53 from tinyhumansai/tinybox-native-shell-7391
senamakel 29880f0
test(tinybox-module): cover timeout status surviving failed cleanup
senamakel c3a6ea9
test(tinybox-module): remove unused timeout wait from fault host
senamakel 53507c5
fix(tinybus): report timed out executions as timed out
senamakel b73cd91
docs(specs): clarify timeout outcome retention on cleanup retry
senamakel f728ea4
fix(native_shell): run scratch preparation off the async worker
senamakel 049954e
fix(native-shell): run preparation on blocking workers
senamakel fa3f11d
fix(tinybus-module): reject unsupported providers before preparing ex…
senamakel b511bb7
Merge pull request #58 from tinyhumansai/tinybox-native-shell-7391
senamakel a46978e
test(host): cover bash discovery and posix mode edge cases
senamakel 3f3c4d0
chore: files changed crates/tinybox-host/Cargo.toml,crates/tinybox-ho…
senamakel caa0ff4
fix(native_shell): run shell preparation on the blocking pool
senamakel ac3d305
test(tinybus): retry fake docker cli writes on etxtbsy
senamakel 5756cf2
docs(shell-selection): document POSIXLY_CORRECT removal on unix
senamakel a9bf8b0
test(grants): expect POSIXLY_CORRECT in removed environment
senamakel f8438e7
test(native_shell): cover refused scratch preparation paths
senamakel 1ef5d85
fix(tinybox-module): fence admission before shell preparation completes
senamakel 9f0aae8
fix(tinybox-module): release resource lock during execution preparation
senamakel 0822c5a
refactor(tinybox-module): box shell preparation and borrow replay inputs
senamakel 7a1a10e
test(tinybox-module): use explicit BTreeMap default in stream test
senamakel db53a34
test(tinybox-module): cover replay ignoring rediscovered program
senamakel 07a019d
fix(tinybus-module): treat native shell requests as unchanged across …
senamakel 9b8ce06
Merge main and preserve hermetic Git grant tests
senamakel 93ab2fa
test(tinybox-module): assert rejected preparation disposes scratch
senamakel cef2ae0
fix(tinybus): dispose rejected shell scratch on close and shutdown
senamakel 0f03686
test(tinybox-module): cover rejected shell scratch cleanup retry
senamakel 5309db5
test(tinybox-module): cover fixture probe retry behaviour
senamakel b87bb9a
refactor(tinybus): extract rejected collector disposal helper
senamakel 6e5cb49
test(native_shell): add hook to inject scratch deletion failures
senamakel 6bc60c8
refactor(native_shell): extract runtime validation into a helper
senamakel 433a7d2
test(tinybus): cover shell env overrides and rejected scratch cleanup
senamakel f0ee6da
fix(native_shell): include resource env in shell environment
senamakel 27dedcd
test(tinybus-module): cover bounded admission for concurrent preparat…
senamakel 297c539
refactor(native_shell): extract environment name comparison helper
senamakel f614a38
chore: files changed crates/tinybox-module/src/tinybus_module/README.md
senamakel 7649277
Merge branch 'main' into tinybox-shell-selection-7391
senamakel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| //! Reserved native shell execution; authorization remains caller-owned. | ||
| use crate::{NativeJailConfig, ResourceId, SelectShellRequest}; | ||
| use serde::{Deserialize, Serialize}; | ||
| use std::collections::BTreeMap; | ||
|
|
||
| /// Start a local shell under module-owned supervision and output replay. | ||
| #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] | ||
| pub struct ShellExecRequest { | ||
| /// Caller-known process reservation. | ||
| pub process: ResourceId, | ||
| /// Existing local passthrough resource. | ||
| pub resource: ResourceId, | ||
| /// Shell payload and pipeline-status convention. | ||
| pub shell: SelectShellRequest, | ||
| /// Working directory inside the resource; absent means its root. | ||
| #[serde(default)] | ||
| pub cwd: Option<String>, | ||
| /// Approved overrides on the module's safe parent environment snapshot. | ||
| #[serde(default)] | ||
| pub extra_env: BTreeMap<String, String>, | ||
| /// Approved existing absolute private state directory for owned scratch. | ||
| pub state_dir: String, | ||
| /// Positive runtime budget, default thirty seconds, at most twenty-four hours. | ||
| #[serde(default = "default_timeout")] | ||
| pub timeout_ms: u64, | ||
| /// Binary input; absent closes stdin. | ||
| #[serde(default)] | ||
| pub stdin: Option<Vec<u8>>, | ||
| /// Explicit native confinement; absent is ordinary local execution. | ||
| #[serde(default)] | ||
| pub jail: Option<NativeJailConfig>, | ||
| } | ||
| const fn default_timeout() -> u64 { | ||
| 30_000 | ||
| } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| //! Platform shell invocation vocabulary; selecting a shell grants no execution access. | ||
|
|
||
| use serde::{Deserialize, Serialize}; | ||
|
|
||
| /// Command text and the desired pipeline exit-status convention. | ||
| #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] | ||
| pub struct SelectShellRequest { | ||
| /// Text interpreted by the platform shell. | ||
| pub command: String, | ||
| /// Preserve the shell's ordinary last-stage pipeline status rather than | ||
| /// enabling Bash pipefail. Windows cmd has no pipefail mode. | ||
| #[serde(default)] | ||
| pub preserve_pipeline_status: bool, | ||
| } | ||
|
|
||
| /// Shell syntax used by the module machine. | ||
| #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] | ||
| #[serde(rename_all = "snake_case")] | ||
| pub enum ShellFlavor { | ||
| /// Windows cmd syntax, including percent-variable expansion. | ||
| Cmd, | ||
| /// POSIX shell syntax, using Bash when available. | ||
| Posix, | ||
| } | ||
|
|
||
| /// Selected invocation, returned for discovery and consumed inside `TinyBox`. | ||
| /// Hosts execute commands through the module rather than spawning this plan. | ||
| #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] | ||
| pub struct ShellInvocation { | ||
| /// Syntax understood by the selected shell. | ||
| pub flavor: ShellFlavor, | ||
| /// Shell executable on the module machine. | ||
| pub program: String, | ||
| /// Ordinary process arguments, excluding the executable. | ||
| pub arguments: Vec<String>, | ||
| /// Windows command payload appended verbatim after ordinary arguments. | ||
| /// Rust's ordinary argument escaping is incompatible with cmd quotes. | ||
| pub raw_arguments: Option<String>, | ||
| /// Parent environment names needed to bootstrap Windows child tools. | ||
| /// Values are never returned by shell discovery. | ||
| pub bootstrap_environment: Vec<String>, | ||
| /// Remove these startup-hook variables after applying the approved environment. | ||
| #[serde(default)] | ||
| pub remove_environment: Vec<String>, | ||
| } |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.