Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .agents/agents/gator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The agent-root entry point is `.agents/agents/gator/run.sh`.
"Run gator on PR 1536 and keep watching until it closes or merges."
```

By default the launcher uses `.agents/agents/gator/Dockerfile` as the sandbox image source. It builds `.agents/agents/gator/` as the image context, so gator-specific image files such as `policy.yaml` and `bin/gh` stay with the gator agent. The launcher bakes a task-independent prompt template, skills, subagents, and shared runtime files into `/etc/openshell/agent-payload`, then passes the resulting image reference to `openshell sandbox create`.
By default the launcher uses `.agents/agents/gator/Dockerfile` as the sandbox image source. It builds `.agents/agents/gator/` as the image context, so gator-specific image files such as `policy.yaml` and `bin/gh` stay with the gator agent. The launcher bakes a task-independent prompt template, skills, subagents, and shared runtime files into `/etc/openshell/agent-payload`, then passes the resulting image reference to `os sandbox create`.

The PR assignment, operator test authorization, harness selection, watch mode, and polling interval are runtime inputs, not rendered image contents. The launcher supplies the non-secret assignment as `OPENSHELL_AGENT_TASK` in the canonical process command. The supervisor assembles the prompt once in memory and sends it to each harness cycle on stdin; cycles do not read task instructions from an agent-writable file. Assignment text is literal data, so shell syntax and template tokens inside it are not evaluated. Do not put credentials in assignments; use providers. Runtime command metadata can contain the assignment. This separates reusable tooling from per-run instructions; it does not make prompt instructions a security boundary.

Expand Down
6 changes: 3 additions & 3 deletions .agents/skills/build-openshell-mxc-windows/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ In scope:
- Refreshing a Windows checkout to the latest upstream GitHub `windows`.
- Maintaining `tasks/windows.toml` and `tasks/scripts/windows-msvc.ps1`.
- Running x64 and ARM64 MSVC checks.
- Building x64 and ARM64 release binaries for `openshell-gateway`, `openshell`,
- Building x64 and ARM64 release binaries for `openshell-gateway`, `os`,
`openshell-supervisor`, and `openshell-windows-sandbox`.
- Running workspace tests on a native x64 or ARM64 host.
- Running focused unsupported-driver contract tests.
Expand Down Expand Up @@ -451,7 +451,7 @@ suite, and report a verified unsupported-host rejection independently from
positive admission coverage.

The real `forwarding` E2E scenario uses a native test-only echo agent inside MXC and
`openshell forward service` to verify two exact request/reply exchanges through
`os forward service` to verify two exact request/reply exchanges through
the gateway, supervisor, and boundary. Dynamic ports and a per-workload nonce
avoid mistaking unrelated listeners for success. This is managed-ingress
coverage, not evidence that direct host ingress is fenced. Use
Expand All @@ -461,7 +461,7 @@ using `windows:build:mxc-fixtures` (or its `:x64` / `:arm64` variant). This fixt
is not one of the four production deliverables; do not package it in releases.
The `service-forwarding` scenario uses its HTTP mode to test named endpoint
exposure, two exact GET responses through gateway routing, and HTTP 404 after
endpoint deletion. This is distinct from `openshell forward service`; neither
endpoint deletion. This is distinct from `os forward service`; neither
scenario tests file upload or exclusive ingress enforcement.

The real integration HTTPS test runs the same authenticated gateway harness with
Expand Down
2 changes: 1 addition & 1 deletion .agents/skills/create-github-pr/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ gh pr create \
--body "$(cat <<'EOF'
## Summary

Add `--page-size` and `--page-token` flags to `openshell sandbox list` for continuation-token pagination.
Add `--page-size` and `--page-token` flags to `os sandbox list` for continuation-token pagination.

## Related Issue

Expand Down
18 changes: 9 additions & 9 deletions .agents/skills/helm-dev-environment/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ Both members share the single k3d node, so exercise Pod failures:

```bash
export KUBECONFIG=kubeconfig OPENSHELL_GATEWAY_ENDPOINT=https://localhost:8090
openshell sandbox create --detach --name ha-probe -- sh -c 'echo $$ > /sandbox/main.pid; exec sleep infinity'
openshell sandbox exec --name ha-probe --no-tty -- cat /sandbox/main.pid
openshell sandbox get ha-probe # note the sandbox ID
os sandbox create --detach --name ha-probe -- sh -c 'echo $$ > /sandbox/main.pid; exec sleep infinity'
os sandbox exec --name ha-probe --no-tty -- cat /sandbox/main.pid
os sandbox get ha-probe # note the sandbox ID
# Supervisor logs name the instance by its route, not its sandbox ID.
kubectl get sandboxes.agents.x-k8s.io -A -l openshell.ai/sandbox-name=ha-probe \
-o jsonpath='{.items[0].metadata.annotations.openshell\.ai/sandbox-runtime-supervisor-session}'
Expand All @@ -238,7 +238,7 @@ kubectl -n openshell logs -l app.kubernetes.io/name=openshell,app.kubernetes.io/
-c openshell-gateway --prefix --tail=200 | grep 'taking over a shared sandbox instance'
kubectl -n openshell logs -l openshell.ai/sandbox-id=<sandbox-id>,openshell.ai/boundary-role=workload \
--tail=200 | grep -E 'sandbox-supervisor-|Supervisor takeover confirmed'
openshell sandbox exec --name ha-probe --no-tty -- cat /sandbox/main.pid # same PID
os sandbox exec --name ha-probe --no-tty -- cat /sandbox/main.pid # same PID
```

A plain `kubectl delete pod` exercises the graceful leave instead: the member
Expand Down Expand Up @@ -387,13 +387,13 @@ active, so the forwarding task uses local port `8090` for the gateway. In a
second terminal, confirm that the gateway is registered and active:

```bash
openshell gateway list
os gateway list
```

**Plaintext (default Skaffold deploy):**

```bash
openshell sandbox list
os sandbox list
```

**With mTLS enabled** — extract the client cert the PKI hook wrote to the cluster,
Expand All @@ -413,7 +413,7 @@ The server cert SANs include `localhost` and `127.0.0.1`, so hostname verificati
passes over a port-forward without any extra flags:

```bash
openshell sandbox list --gateway-endpoint https://localhost:8090
os sandbox list --gateway-endpoint https://localhost:8090
```

---
Expand Down Expand Up @@ -481,12 +481,12 @@ KUBECONFIG=kubeconfig kubectl get svc -A \
-l gateway.envoyproxy.io/owning-gateway-name=openshell
KUBECONFIG=kubeconfig kubectl -n <envoy-service-namespace> port-forward \
svc/<envoy-service-name> 8080:80
openshell gateway add http://127.0.0.1:8080 --name openshell --local
os gateway add http://127.0.0.1:8080 --name openshell --local
```

When running e2e tests manually through Envoy, register gateway metadata (as
above) instead of relying only on `OPENSHELL_GATEWAY_ENDPOINT`; some tests call
`openshell gateway info` and expect metadata for the active gateway.
`os gateway info` and expect metadata for the active gateway.

### Kubernetes E2E Notes

Expand Down
24 changes: 12 additions & 12 deletions .agents/skills/launch-openshell-gator/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ command -v jq
command -v ruby
```

The local `openshell` wrapper may recompile the CLI. If that fails, fix the local build or ask the operator before changing unrelated source.
The local `os` wrapper may recompile the CLI. If that fails, fix the local build or ask the operator before changing unrelated source.

### Step 3: Verify GitHub Auth

Expand Down Expand Up @@ -103,13 +103,13 @@ the runtime task contract; legacy baked-task images fail startup. See
Use the target gateway from the operator request or current session context. Do not assume a gateway name. If the operator did not specify one, list registered gateways and ask before launching when the correct target is ambiguous.

```bash
openshell gateway list
os gateway list

gateway_name="<selected-gateway-name>"
[[ "$gateway_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid gateway name" >&2; exit 1; }

openshell --gateway "$gateway_name" status
openshell --gateway "$gateway_name" sandbox list
os --gateway "$gateway_name" status
os --gateway "$gateway_name" sandbox list
```

Expected result: status returns successfully and sandbox listing completes. If the gateway is unreachable, the runtime cannot create sandboxes, or sandbox listing hangs, switch to `debug-openshell-cluster` and fix the gateway before launching gator.
Expand All @@ -122,7 +122,7 @@ Avoid duplicate gators for the same PR unless intentionally replacing a stuck or
gateway_name="<selected-gateway-name>"
[[ "$gateway_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid gateway name" >&2; exit 1; }

openshell --gateway "$gateway_name" sandbox list
os --gateway "$gateway_name" sandbox list
```

Look for names like `gtr-pr-<number>-watch`. If one exists, inspect its log before deleting or relaunching.
Expand All @@ -131,7 +131,7 @@ Look for names like `gtr-pr-<number>-watch`. If one exists, inspect its log befo

Never paste raw operator text into shell arguments such as `--gateway`, `--name`, `--from`, issue numbers, or PR numbers. Normalize values before constructing launch commands.

Use the operator-specified gateway or a gateway selected from `openshell gateway list`:
Use the operator-specified gateway or a gateway selected from `os gateway list`:

```bash
gateway_name="<selected-gateway-name>"
Expand Down Expand Up @@ -180,7 +180,7 @@ sandbox_name="gtr-pr-${pr_number}-watch"

The launcher queries the gateway's selected compute driver and prepares the image through the selected build/import/publish or prebuilt path before importing provider profiles, configuring provider credentials and refresh, and starting the agent supervisor as the sandbox's canonical main process. The detached main process survives loss of the host CLI connection and reconnects to a restarted gateway. Unless `--keep` is set, the sandbox is marked ephemeral so the gateway deletes it after the canonical main process exits and its terminal result is finalized. `CONTAINER_ENGINE`, when set, must match Docker/Podman gateways or Docker for k3d imports; registry builds for Kubernetes may use either local engine.

The launcher streams image-build and provisioning output until the detached workload is ready, then exits. Use `openshell logs <sandbox-name>` or the TUI for runtime output.
The launcher streams image-build and provisioning output until the detached workload is ready, then exits. Use `os logs <sandbox-name>` or the TUI for runtime output.

### Launch An Issue Or Issue/PR Pair

Expand Down Expand Up @@ -325,11 +325,11 @@ sandbox_name="<safe-sandbox-name>"
[[ "$gateway_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid gateway name" >&2; exit 1; }
[[ "$sandbox_name" =~ ^[a-z0-9]([a-z0-9-]{0,17}[a-z0-9])?$ ]] || { echo "invalid sandbox name" >&2; exit 1; }

openshell --gateway "$gateway_name" sandbox list
openshell --gateway "$gateway_name" sandbox get "$sandbox_name"
os --gateway "$gateway_name" sandbox list
os --gateway "$gateway_name" sandbox get "$sandbox_name"
```

If `sandbox get` is not supported by the local CLI shape, use `openshell sandbox --help` and follow the current command help.
If `sandbox get` is not supported by the local CLI shape, use `os sandbox --help` and follow the current command help.

### Interpret Common Sentinels

Expand Down Expand Up @@ -365,7 +365,7 @@ sandbox_name="<safe-sandbox-name>"
[[ "$gateway_name" =~ ^[A-Za-z0-9_.-]+$ ]] || { echo "invalid gateway name" >&2; exit 1; }
[[ "$sandbox_name" =~ ^[a-z0-9]([a-z0-9-]{0,17}[a-z0-9])?$ ]] || { echo "invalid sandbox name" >&2; exit 1; }

openshell --gateway "$gateway_name" sandbox delete "$sandbox_name"
os --gateway "$gateway_name" sandbox delete "$sandbox_name"
./.agents/agents/gator/run.sh \
--gateway "$gateway_name" \
--name "$sandbox_name" \
Expand All @@ -379,7 +379,7 @@ When relaunching after a same-SHA infrastructure failure, say that the prior att

### Gateway Unreachable

Symptoms: `openshell status` fails, `sandbox list` fails, sandbox remains pending, image build never starts.
Symptoms: `os status` fails, `sandbox list` fails, sandbox remains pending, image build never starts.

Action: load `debug-openshell-cluster` and diagnose the gateway/driver. Do not keep retrying gator launches against a dead gateway.

Expand Down
8 changes: 4 additions & 4 deletions .agents/skills/test-release-canary/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ kubectl wait --namespace openshell \
--timeout=300s

kubectl port-forward --namespace openshell svc/openshell 8080:8080 &
openshell gateway add http://127.0.0.1:8080 --local --name kind
openshell status
os gateway add http://127.0.0.1:8080 --local --name kind
os status
```

Keep `pkiInitJob.enabled=true` (the chart default), even when
Expand All @@ -137,13 +137,13 @@ Loopback registration auto-derives the gateway name to `openshell` if `--name` i
|---|---|---|
| `macos`/`ubuntu-deb`/`fedora` job fails on `install.sh` | Dev release missing an asset, checksum mismatch, or `install.sh` regression on this branch. | Job log around the `curl … install.sh \| sh` step. |
| Sandbox create or exec fails | Published sandbox and supervisor artifacts are missing, incompatible, or cannot establish the protected runtime channel. | Gateway logs plus Docker, Podman, VM, snap, or Kubernetes runtime diagnostics for the job. |
| `macos`/`ubuntu-deb`/`fedora` job fails on `openshell status` | Local gateway service did not start (systemd/brew/podman). Often a driver issue. | Service logs in the job log; `OPENSHELL_COMPUTE_DRIVER` env in the "Ensure …" step. |
| `macos`/`ubuntu-deb`/`fedora` job fails on `os status` | Local gateway service did not start (systemd/brew/podman). Often a driver issue. | Service logs in the job log; `OPENSHELL_COMPUTE_DRIVER` env in the "Ensure …" step. |
| `ubuntu-snap-system-docker` fails during `install.sh` | System Docker was unavailable to the runner user, the edge revision or automatic interfaces were unavailable, or the user gateway did not become reachable. | Failure diagnostics dump system Docker, snap service/connection/change state, user and legacy gateway journals, snap logs, and port 17670 listeners. |
| `ubuntu-snap-system-docker` fails during the prover checks | The prover artifact is missing or packaged for the wrong architecture, `openshell.prover` is not exposed, missing the alias to `openshell-prover`, or not permitted to read the test policies, or its solver linkage is not runnable. | The `Install and check status` and `Check a policy boundary with the snap prover` steps, plus `snap info openshell` and `snap connections openshell`. |
| `ubuntu-snap-docker-preflight` unexpectedly succeeds | The installer no longer fails before installing the OpenShell snap when Docker is absent or supplied by the Docker snap. | Inspect `install.log`, `docker-snap.log`, `snap list`, and snapd changes. |
| `kubernetes` job fails on `helm install --wait` | Chart did not deploy in 5 min — usually image pull failure or readiness probe failing. | "Diagnostics on failure" step dumps `helm status`, manifest, pod describe, pod logs. |
| `kubernetes` job fails on `kubectl wait` | Gateway pod stuck `CrashLoopBackOff` or `ImagePullBackOff`. | Diagnostics dump; check `:dev` image existence at `quay.io/ai-openshell/gateway`. |
| `kubernetes` job fails on `openshell gateway add` or `status` | Port-forward not reachable, or CLI/gateway proto mismatch. | `port-forward.log` and `openshell gateway list` in the diagnostics dump. |
| `kubernetes` job fails on `os gateway add` or `status` | Port-forward not reachable, or CLI/gateway proto mismatch. | `port-forward.log` and `os gateway list` in the diagnostics dump. |

The `kubernetes` job's diagnostics step (only runs `if: failure()`) emits, in order: helm status, rendered manifest, `kubectl get all`, pod descriptions, pod logs (200 lines per container), port-forward log, gateway list, CLI version. Read it top-to-bottom — most failures fall out by the manifest or pod logs.

Expand Down
24 changes: 12 additions & 12 deletions .agents/skills/tui-development/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Comprehensive reference for any agent working on the OpenShell TUI.

The OpenShell TUI is a ratatui-based terminal UI for the OpenShell platform. It provides a keyboard-driven interface for managing gateways, sandboxes, and logs — the same operations available via the `openshell` CLI, but with a live, interactive dashboard.

- **Launched via:** `openshell term` or `mise run term`
- **Launched via:** `os term` or `mise run term`
- **Crate:** `crates/openshell-tui/`
- **Key dependencies:**
- `ratatui` (workspace version) — uses `frame.area()` for the drawable terminal area
Expand Down Expand Up @@ -170,7 +170,7 @@ Phase 1: GetSandboxLogs → 500 initial lines → send via Event::LogLines
Phase 2: WatchSandbox(follow_logs: true) → live tail → send via Event::LogLines
```

**Sandboxes**: Fetched via `ListSandboxes` in a background collection-refresh task scheduled from the 2-second tick, scoped to the current workspace (or all workspaces). Follow `next_page_token` until empty so the dashboard reflects the complete collection. The NOTES column summarizes active `ConfigurationInvalid` readiness conditions as `Invalid config` before port forwards and clears the note on refresh after repair. Full diagnostics remain available through `openshell sandbox get <name> -o json`. Timed-out provisioning attempts show `Provisioning timed out` with cleanup pending or compute reclaimed, preserving port forwards. The sandbox detail pane wraps the full configuration error in its Notes field.
**Sandboxes**: Fetched via `ListSandboxes` in a background collection-refresh task scheduled from the 2-second tick, scoped to the current workspace (or all workspaces). Follow `next_page_token` until empty so the dashboard reflects the complete collection. The NOTES column summarizes active `ConfigurationInvalid` readiness conditions as `Invalid config` before port forwards and clears the note on refresh after repair. Full diagnostics remain available through `os sandbox get <name> -o json`. Timed-out provisioning attempts show `Provisioning timed out` with cleanup pending or compute reclaimed, preserving port forwards. The sandbox detail pane wraps the full configuration error in its Notes field.

**Providers**: Fetched via `ListProviders` in the background collection-refresh task. Provider profiles are fetched per-workspace via `ListProviderProfiles` and cached in a `ProviderProfileCache` keyed by `(workspace, profile_id)`. Follow each list RPC's `next_page_token` until empty.

Expand Down Expand Up @@ -232,7 +232,7 @@ Colors and styles are defined in `crates/openshell-tui/src/theme.rs` via the `Th

Theme mode is controlled by three mechanisms (highest priority first):

1. `--theme dark|light|auto` CLI flag on `openshell term`
1. `--theme dark|light|auto` CLI flag on `os term`
2. `OPENSHELL_THEME` environment variable
3. Auto-detection via `COLORFGBG` env var (falls back to dark)

Expand Down Expand Up @@ -315,18 +315,18 @@ The `confirm_delete` flag in `App` gates destructive key handling — while true

### CLI parity

TUI actions should parallel `openshell` CLI commands so users have familiar mental models:
TUI actions should parallel `os` CLI commands so users have familiar mental models:

| CLI Command | TUI Equivalent |
| --- | --- |
| `openshell sandbox list` | Sandbox table on Dashboard |
| `openshell sandbox delete <name>` | `[d]` on sandbox detail, then `[y]` to confirm |
| `openshell sandbox create` | `[c]` on sandbox panel to open create form |
| `openshell sandbox connect` | `[s]` on sandbox policy view to launch SSH shell |
| `openshell logs <name>` | `[l]` on sandbox detail to open log viewer |
| `openshell provider list` | Provider table on Dashboard (middle pane) |
| `openshell provider create` | `[c]` on provider panel |
| `openshell status` | Status in title bar + gateway list |
| `os sandbox list` | Sandbox table on Dashboard |
| `os sandbox delete <name>` | `[d]` on sandbox detail, then `[y]` to confirm |
| `os sandbox create` | `[c]` on sandbox panel to open create form |
| `os sandbox connect` | `[s]` on sandbox policy view to launch SSH shell |
| `os logs <name>` | `[l]` on sandbox detail to open log viewer |
| `os provider list` | Provider table on Dashboard (middle pane) |
| `os provider create` | `[c]` on provider panel |
| `os status` | Status in title bar + gateway list |

When adding new TUI features, check what the CLI offers and maintain consistency.

Expand Down
Loading
Loading