Skip to content

Commit 757fff6

Browse files
committed
chore: merge main into terminal delete branch
Signed-off-by: Drew Newberry <anewberry@nvidia.com>
2 parents dfc6871 + 8ffc6c2 commit 757fff6

112 files changed

Lines changed: 5842 additions & 2489 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/debug-openshell-cluster/SKILL.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ kubectl -n openshell get pod -l app.kubernetes.io/name=helm-chart -o jsonpath="{
392392
```
393393

394394
Sandbox pods using provider token grants should have an
395-
`openshell.io/sandbox-id` annotation, an `openshell.ai/managed-by=openshell`
395+
`openshell.ai/sandbox-id` annotation, an `openshell.ai/managed-by=openshell`
396396
label, supervisor env vars `OPENSHELL_K8S_SA_TOKEN_FILE` and
397397
`OPENSHELL_PROVIDER_SPIFFE_WORKLOAD_API_SOCKET`, plus both the projected
398398
`openshell-sa-token` volume and the `spiffe-workload-api` CSI volume.
@@ -467,7 +467,10 @@ Then inspect sandbox resources in that namespace.
467467
Check the configured sandbox service account when TokenReview bootstrap or
468468
sandbox registration fails. Helm creates a dedicated sandbox service account by
469469
default and writes it to `[openshell.drivers.kubernetes].service_account_name`;
470-
the gateway rejects projected tokens from other service accounts.
470+
the selected Kubernetes compute driver rejects projected tokens from other
471+
service accounts. For an external driver, inspect its logs and confirm it
472+
advertises `supports_sandbox_authentication`; the gateway delegates the opaque
473+
credential over the driver socket and never interprets Kubernetes settings.
471474

472475
```bash
473476
helm -n openshell get values openshell | grep -A3 sandboxServiceAccount

‎.agents/skills/helm-dev-environment/SKILL.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,9 @@ annotations to `spiffe://openshell.local/openshell/sandbox/<sandbox-id>`.
259259
OpenShell mounts the SPIFFE CSI Workload API socket at
260260
`/spiffe-workload-api/spire-agent.sock` into sandbox pods for provider token
261261
grants. Supervisor-to-gateway authentication remains on the Kubernetes
262-
ServiceAccount bootstrap and gateway-minted sandbox JWT path.
262+
ServiceAccount bootstrap and gateway-minted sandbox JWT path; the selected
263+
Kubernetes compute driver validates the projected token before the gateway
264+
mints its JWT.
263265

264266
---
265267

‎.agents/skills/openshell-cli/SKILL.md‎

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ This creates a sandbox whose canonical main process is `/bin/bash -l` and
7474
attaches your terminal to that retained process. Add `--detach` to return after
7575
the sandbox becomes ready without attaching.
7676

77+
An explicit trailing command is foreground even when stdin or stdout is not a
78+
terminal. The CLI streams its stdout and stderr and returns its exact exit
79+
status. Exit code 0 leaves a retained sandbox in `Completed`; nonzero leaves it
80+
in `Error` with `MainProcessFailed`. Use `--no-keep` to delete either result
81+
after output drains, or `--detach` for a long-running service.
82+
7783
When supplying `--name`, use a portable DNS-1123 label: at most 63 lowercase alphanumeric or `-` characters, beginning and ending with an alphanumeric character. The Kubernetes driver rejects uppercase letters, underscores, dots, and other names that cannot become Kubernetes resource labels.
7884

7985
**Shortcut for known tools**: When the trailing command is a recognized tool, the CLI auto-creates the required provider from local credentials:
@@ -248,11 +254,16 @@ Key flags:
248254
- `--approval-mode manual|auto`: Control handling of agent-authored policy proposals; `manual` is the default
249255
- `--upload <PATH>[:<DEST>]`: Upload local files into the container working directory or an explicit destination
250256
- `--no-git-ignore`: Disable `.gitignore` filtering for uploads
251-
- `--no-keep`: Delete the sandbox after the initial command or shell exits
257+
- `--no-keep`: Delete the sandbox after main output and the exit result drain
252258
- `--detach`: Start the canonical main process without attaching
253259
- `--forward [BIND_ADDRESS:]PORT`: Forward a local port and keep the sandbox alive
254260
- `--editor vscode|cursor`: Open a remote editor after creation and keep the sandbox alive
255261

262+
`--detach` adds no attachment grace period. When the canonical process exits,
263+
its terminal phase is reported immediately. A foreground create declares one
264+
expected main-process SSH attachment; cleanup finalizes after that connection
265+
closes naturally.
266+
256267
Do not combine `--upload` with a trailing main command. Uploads currently finish
257268
after the canonical process starts; create a scratch sandbox and use
258269
`sandbox exec`, or build the files into the image.
@@ -371,7 +382,10 @@ openshell sandbox start [name]
371382
Both commands default to the last-used sandbox. Stop stops background
372383
forwards and waits for `Stopped`; start waits for `Ready`. Connect, exec,
373384
file transfer, forwarding, and exposed services are unavailable while
374-
stopped. Delete remains the operation that removes retained state.
385+
stopped or completed. Starting a retained `Completed` or
386+
`Error/MainProcessFailed` sandbox launches a fresh canonical-main instance and
387+
invalidates SSH sessions from the previous runtime generation. Delete remains
388+
the operation that removes retained state.
375389

376390
---
377391

‎.agents/skills/openshell-cli/cli-reference.md‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,18 +208,28 @@ identity provider. Requires an authenticated gateway connection.
208208
Create a sandbox through the selected gateway and launch its canonical main
209209
process. By default, the CLI attaches to that retained process after the
210210
sandbox becomes ready. A trailing command defines the canonical main process;
211-
without one, the default is `/bin/bash -l` with a PTY.
211+
without one, the default is `/bin/bash -l` with a PTY. Explicit commands remain
212+
foreground in non-interactive automation: stdout and stderr stream to the
213+
caller and the CLI returns the command's exact status. Exit 0 leaves
214+
`Completed`; nonzero leaves `Error/MainProcessFailed`.
215+
Starting either retained terminal result invalidates SSH sessions from the
216+
previous runtime generation.
212217

213218
| Flag | Description |
214219
|------|-------------|
215220
| `--name <NAME>` | Sandbox name (auto-generated if omitted) |
216221
| `--from <SOURCE>` | Community name, Dockerfile path, directory, or image reference (BYOC) |
217-
| `--no-keep` | Delete the sandbox after the initial command or shell exits |
222+
| `--no-keep` | Delete the sandbox after main output and the result drain |
218223
| `--detach` | Start the canonical main process without attaching |
219224
| `--editor vscode|cursor` | Launch a remote editor and keep the sandbox alive |
220225
| `--gpu [COUNT]` | Request the driver's default GPU selection or a specific count |
221226
| `--cpu <QUANTITY>` | CPU limit (for example: `500m`, `1`, `2.5`) |
222227
| `--memory <QUANTITY>` | Memory limit (for example: `512Mi`, `4Gi`, `8G`) |
228+
229+
`--detach` adds no attachment grace period: the sandbox reports the canonical
230+
process result immediately when it exits. Foreground creation declares one
231+
expected main-process SSH attachment; cleanup finalizes after that connection
232+
drains and closes naturally.
223233
| `--driver-config-json <JSON>` | Experimental driver-keyed configuration object |
224234
| `--provider <NAME>` | Provider to attach (repeatable) |
225235
| `--policy <PATH>` | Custom policy YAML; overrides the built-in default and `OPENSHELL_SANDBOX_POLICY` |
@@ -277,8 +287,9 @@ and waits for the `Stopped` phase.
277287

278288
### `openshell sandbox start [name]`
279289

280-
Start a stopped sandbox and wait for `Ready`. The name defaults to the
281-
last-used sandbox.
290+
Start a stopped, failed, or completed sandbox and wait for `Ready`. This
291+
launches a fresh canonical-main instance. The name defaults to the last-used
292+
sandbox.
282293

283294
### `openshell sandbox exec [OPTIONS] -- COMMAND...`
284295

‎.github/actions/build-rust-binary/action.yml‎

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,36 @@ runs:
7171
INPUTS_EXTRA_CARGO_FLAGS: ${{ inputs.extra-cargo-flags }}
7272
run: GIT_DIR=/nonexistent cargo auditable build --release --package "${INPUTS_PACKAGE}" --bin "${INPUTS_BINARY}" ${INPUTS_EXTRA_CARGO_FLAGS}
7373

74+
- name: Normalize Darwin dynamic binary
75+
if: endsWith(inputs.triple, '-apple-darwin')
76+
shell: bash -euo pipefail {0}
77+
env:
78+
INPUTS_BINARY: ${{ inputs.binary }}
79+
run: |
80+
binary=target/release/${INPUTS_BINARY}
81+
nix_iconv_paths=$(otool -L "$binary" | awk '$1 ~ "^/nix/store/.*/lib/libiconv\\.2\\.dylib$" { print $1 }')
82+
if [[ -n "$nix_iconv_paths" ]]; then
83+
while IFS= read -r nix_iconv_path; do
84+
install_name_tool -change "$nix_iconv_path" /usr/lib/libiconv.2.dylib "$binary"
85+
done <<< "$nix_iconv_paths"
86+
codesign --force --sign - "$binary"
87+
fi
88+
89+
- name: Verify Darwin portability
90+
if: endsWith(inputs.triple, '-apple-darwin')
91+
shell: bash -euo pipefail {0}
92+
env:
93+
INPUTS_BINARY: ${{ inputs.binary }}
94+
run: |
95+
binary=target/release/${INPUTS_BINARY}
96+
nix_dependencies=$(otool -L "$binary" | awk '$1 ~ "^/nix/store/" { print $1 }')
97+
if [[ -n "$nix_dependencies" ]]; then
98+
echo "error: $binary has non-portable Nix store dependencies:" >&2
99+
printf ' %s\n' "$nix_dependencies" >&2
100+
exit 1
101+
fi
102+
codesign --verify --verbose=2 "$binary"
103+
74104
- name: Verify ${{ inputs.binary }}
75105
shell: nix develop ${{ inputs.dev-shell }} -c bash -euo pipefail {0}
76106
env:

‎.github/codeql/codeql-config.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@ paths:
1111
- python/openshell
1212

1313
paths-ignore:
14+
# Integration-test targets are not removed by the Rust cfg override.
15+
- crates/*/tests
1416
- python/openshell/_proto
1517
- sdk/typescript/src/gen

‎.github/workflows/build-vm-driver.yml‎

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -67,31 +67,17 @@ jobs:
6767
- name: Build VM runtime
6868
run: nix build .#vm-runtime
6969

70-
- name: Compress Linux VM runtime
71-
if: runner.os == 'Linux'
70+
- name: Assemble compressed VM runtime
7271
run: |
73-
install -d target/vm-runtime-compressed
74-
zstd -19 -T0 result/libkrun.so -o target/vm-runtime-compressed/libkrun.so.zst
75-
zstd -19 -T0 result/libkrunfw.so.5 -o target/vm-runtime-compressed/libkrunfw.so.5.zst
76-
zstd -19 -T0 result/gvproxy -o target/vm-runtime-compressed/gvproxy.zst
77-
zstd -19 -T0 result/umoci -o target/vm-runtime-compressed/umoci.zst
78-
79-
- name: Compress macOS VM runtime
80-
if: runner.os == 'macOS'
81-
run: |
82-
install -d target/vm-runtime-compressed
83-
zstd -19 -T0 result/libkrun.dylib -o target/vm-runtime-compressed/libkrun.dylib.zst
84-
zstd -19 -T0 result/libkrunfw.5.dylib -o target/vm-runtime-compressed/libkrunfw.5.dylib.zst
85-
zstd -19 -T0 result/gvproxy -o target/vm-runtime-compressed/gvproxy.zst
86-
zstd -19 -T0 result/umoci -o target/vm-runtime-compressed/umoci.zst
87-
88-
- name: Add openshell-sandbox to VM runtime
89-
run: zstd -19 -T0 sandbox/openshell-sandbox -o target/vm-runtime-compressed/openshell-sandbox.zst
72+
compressed_dir="${RUNNER_TEMP}/vm-runtime-compressed"
73+
install -d "$compressed_dir"
74+
cp result/compressed/*.zst "$compressed_dir/"
75+
zstd -19 -T1 sandbox/openshell-sandbox -o "$compressed_dir/openshell-sandbox.zst"
9076
9177
- name: Build openshell-driver-vm
9278
uses: ./.github/actions/build-rust-binary
9379
env:
94-
OPENSHELL_VM_RUNTIME_COMPRESSED_DIR: ${{ github.workspace }}/target/vm-runtime-compressed
80+
OPENSHELL_VM_RUNTIME_COMPRESSED_DIR: ${{ runner.temp }}/vm-runtime-compressed
9581
with:
9682
package: openshell-driver-vm
9783
binary: openshell-driver-vm

‎.github/workflows/codeql.yml‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,8 @@
44
name: CodeQL
55

66
on:
7-
pull_request:
8-
merge_group:
9-
types: [checks_requested]
10-
push:
11-
branches: [main]
127
schedule:
13-
- cron: "29 5 * * 6"
8+
- cron: "29 5 * * *"
149
workflow_dispatch:
1510

1611
permissions:
@@ -26,6 +21,9 @@ jobs:
2621
name: CodeQL (${{ matrix.language }})
2722
runs-on: ubuntu-latest
2823
timeout-minutes: 90
24+
env:
25+
# Keep Rust test fixtures out of production-focused security results.
26+
CODEQL_EXTRACTOR_RUST_OPTION_CARGO_CFG_OVERRIDES: "-test"
2927
strategy:
3028
fail-fast: false
3129
matrix:

‎.github/workflows/release-auto-tag.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ name: Release Auto-Tag
55

66
on:
77
workflow_dispatch: {}
8-
schedule:
9-
- cron: "0 14 * * 1-5" # 7 AM PDT, weekdays only
8+
# schedule:
9+
# - cron: "0 14 * * 1-5" # 7 AM PDT, weekdays only
1010

1111
permissions:
1212
contents: write

‎AGENTS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ These pipelines connect skills into end-to-end workflows. Individual skill files
3636
| `crates/openshell-router/` | Privacy router | Privacy-aware LLM routing |
3737
| `crates/openshell-bootstrap/` | Gateway metadata | Gateway registration metadata, auth token storage, mTLS bundle storage |
3838
| `crates/openshell-gateway-interceptors/` | Gateway interceptors | Intercepts and transforms configured gRPC requests at the gateway routing boundary |
39-
| `crates/openshell-ocsf/` | OCSF logging | OCSF v1.7.0 event types, builders, shorthand/JSONL formatters, tracing layers |
39+
| `crates/openshell-ocsf/` | OCSF logging | OCSF v1.8.0 event types, builders, shorthand/JSONL formatters, tracing layers |
4040
| `crates/openshell-otel/` | OpenTelemetry support | Shared OTLP trace provider, resource, and tracing-layer construction |
4141
| `crates/openshell-otel-test-support/` | OpenTelemetry test support | Shared loopback OTLP collector fixture for tracing tests |
4242
| `crates/openshell-core/` | Shared core | Common types, configuration, error handling |

0 commit comments

Comments
 (0)