Skip to content
Open
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
3 changes: 1 addition & 2 deletions .agents/skills/update-docs/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ git log -50 --oneline --no-merges
Filter to commits that are likely to affect docs. Look for these signals:

1. **Commit type**: `feat`, `fix`, `refactor`, `perf` commits often change behavior. `docs` commits are already doc changes. `chore`, `ci`, `test` commits rarely need doc updates.
2. **Files changed**: Changes to `crates/openshell-cli/`, `python/`, `proto/`, `deploy/`, gateway config parsing, driver config structs, or policy-related code are high-signal.
2. **Files changed**: Changes to `crates/openshell-cli/`, `proto/`, `deploy/`, gateway config parsing, driver config structs, or policy-related code are high-signal.
3. **Ignore**: Changes limited to `tests/`, `e2e/`, `.github/`, `tasks/`, or internal-only modules.

```bash
Expand All @@ -60,7 +60,6 @@ For each relevant commit, determine which doc page(s) it affects. Use this mappi
| `deploy/helm/openshell/templates/gateway-config.yaml` | `docs/how-it-works/gateways/configuration.mdx`, `docs/how-it-works/sandboxes/runtimes.mdx`, Helm docs if values change |
| Proxy or policy code | `docs/how-it-works/policies/overview.mdx`, `docs/how-it-works/policies/schema.mdx` |
| Inference code | `docs/inference/configure.mdx` |
| `python/` (SDK changes) | `docs/reference/` or `docs/get-started/quickstart.mdx` |
| `proto/` (API changes) | `docs/reference/` |
| `deploy/` (Dockerfile, Helm) | `docs/how-it-works/gateways/overview.mdx`, `docs/about/architecture.mdx` |
| Sandbox image behavior | `docs/how-it-works/sandboxes/overview.mdx` |
Expand Down
5 changes: 0 additions & 5 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
# Mark auto-generated protobuf files so GitHub linguist ignores them in
# diffs, stats, and language detection.

# Generated Python protobuf stubs
python/openshell/_proto/*_pb2.py linguist-generated
python/openshell/_proto/*_pb2_grpc.py linguist-generated
python/openshell/_proto/*_pb2.pyi linguist-generated

# Generated Rust protobuf code (excludes hand-written mod.rs)
crates/openshell-core/src/proto/openshell.*.rs linguist-generated

Expand Down
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ contact_links:
about: >
Install the public OpenShell skills for CLI usage, cluster and inference
debugging, and policy generation. See CONTRIBUTING.md for details.
- name: Python SDK issue?
url: https://github.com/ai-openshell/sdk-python/issues
about: >
The Python SDK (the `openshell` package on PyPI) lives in
ai-openshell/sdk-python. Report SDK bugs and requests there.
- name: Security vulnerability?
url: https://github.com/ai-openshell/openshell/blob/main/SECURITY.md
about: >
Expand Down
2 changes: 0 additions & 2 deletions .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ name: OpenShell Rust and SDKs
paths:
- crates
- examples
- python/openshell

paths-ignore:
# Integration-test targets are not removed by the Rust cfg override.
- crates/*/tests
- python/openshell/_proto
11 changes: 0 additions & 11 deletions .github/frozen-paths.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,3 @@ paths = [
"tasks/scripts/vm",
".github/workflows/release-vm-kernel.yml",
]

# The Python SDK moved to ai-openshell/sdk-python, which imported it at v0.1.7.
# Its files stay only until core removes them. The shared root pyproject.toml
# and uv.lock stay editable.
[[freeze]]
name = "python-sdk"
message = "The Python SDK moved to https://github.com/ai-openshell/sdk-python. Drop the Python SDK changes from this PR and open SDK changes there. Regenerated bindings are not needed here; sdk-python regenerates them from core releases."
paths = [
"python",
"tasks/scripts/generate_python_proto.py",
]
8 changes: 4 additions & 4 deletions .github/prompts/compatibility-review.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ needed.

## Required surfaces

Account for every surface: `rust-sdk`, `python-sdk`, `api-behavior`, `cli`,
`configuration`, `policy`, `helm`, and `state`. The Go SDK moved to
ai-openshell/sdk-go and is not a surface of this repository. The TypeScript SDK
moved to ai-openshell/sdk-typescript and is not a surface of this repository.
Account for every surface: `rust-sdk`, `api-behavior`, `cli`, `configuration`,
`policy`, `helm`, and `state`. The Go SDK moved to ai-openshell/sdk-go, the
TypeScript SDK to ai-openshell/sdk-typescript, and the Python SDK to
ai-openshell/sdk-python; none is a surface of this repository.

Scope `rust-sdk` to the public API reachable through `openshell-sdk`, including
its `raw` module and transitive public re-exports. Trace the export path before
Expand Down
29 changes: 1 addition & 28 deletions .github/workflows/branch-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ jobs:
sdk/conformance/oidc-token-bundle.json
exclude: >-
target/* e2e/rust/target/* plans/* architecture/plans/*
.cache/* .venv/* python/openshell/_proto/*
.cache/* .venv/*
.github/* .agents/* .claude/* :(glob)**/node_modules/**
.gitlab-ci.yml */.gitlab-ci.yml
base: ${{ github.event.merge_group.base_sha || github.event.pull_request.base.sha }}
Expand Down Expand Up @@ -622,9 +622,6 @@ jobs:
- name: Typecheck
run: mise run python:typecheck

- name: Test
run: mise run test:python

- name: Test Python scripts
run: mise run test:python-scripts

Expand All @@ -642,30 +639,6 @@ jobs:
- name: Test labeling agent
run: mise run test:labeling-agent

python-sdk-freeze:
# The Python SDK moved to ai-openshell/sdk-python (#5287). PRs must not add
# or change its files; deleting them is allowed (the removal PR). The paths
# and message live in .github/frozen-paths.toml ("python-sdk" freeze).
# Merge queue runs skip this job; the PR already passed it.
name: Python SDK Freeze
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false

- name: Reject changes to the Python SDK
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
# Compare against the PR head, not the checked-out merge commit: the
# recorded base SHA can lag main, and diffing the merge commit would
# then report main's own changes as the PR's.
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: python3 tasks/scripts/check_frozen_paths.py --group python-sdk --base "$BASE_SHA" --head "$HEAD_SHA"

markdown:
name: Markdown
runs-on: ubuntu-24.04
Expand Down
5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ share/python-wheels/
*.egg
MANIFEST

python/*.data

# Virtual environments
.venv/
Expand Down Expand Up @@ -104,10 +103,6 @@ dmypy.json
# Cython debug symbols
cython_debug/

# Generated Python protobuf stubs (keep package marker)
python/openshell/_proto/*
!python/openshell/_proto/__init__.py

# =============================================================================
# IDE / Editor
# =============================================================================
Expand Down
5 changes: 2 additions & 3 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@ actions:
- 'bash -c "sed -i -r \"s/^%global openshell_version .*/%global openshell_version ${PACKIT_RPMSPEC_VERSION}/\" openshell.spec"'
# Update Release
- 'bash -c "RELEASE=${OPENSHELL_RPM_RELEASE:-${PACKIT_RPMSPEC_RELEASE}} && sed -i -r \"s/^Release:(\\s*)\\S+/Release:\\1${RELEASE}%{?dist}/\" openshell.spec"'
# Keep embedded binary metadata aligned with the release workflow. Python
# dist-info stays at the RPM Version; dev build identity is carried by
# Release so Fedora's Python RPM post-processing can normalize metadata.
# Keep embedded binary metadata aligned with the release workflow. Dev
# build identity is carried by Release.
- 'bash -c "if [ -n \"${OPENSHELL_CARGO_VERSION:-}\" ]; then sed -i -r \"s/^%global openshell_cargo_version .*/%global openshell_cargo_version ${OPENSHELL_CARGO_VERSION}/\" openshell.spec; fi"'

jobs:
Expand Down
6 changes: 2 additions & 4 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ Do not rely on this file for a full inventory. The detailed public and contribut
| `crates/openshell-supervisor-network/` | Network supervisor | Proxying, L7 enforcement, policy evaluation, and provider credential injection |
| `crates/openshell-supervisor-process/` | Process supervisor | Process lifecycle, namespace, and bypass monitoring |
| `crates/openshell-vfio/` | VFIO support | PCI and GPU passthrough preparation and lifecycle |
| `python/openshell/` | Python SDK (frozen) | Moved to ai-openshell/sdk-python; kept until removal |
| `proto/` | Protobuf definitions | gRPC service contracts |
| `tests/testkit/` | E2E testkit | Support library and `#[testkit::test]` attribute for SDK-driven E2E suites |
| `tests/suites/` | E2E suites | One directory per test family, such as `conformance` |
Expand Down Expand Up @@ -216,10 +215,9 @@ Create PRs with `gh pr create`, which enables "Allow edits by maintainers" by de

- The Go SDK lives in [ai-openshell/sdk-go](https://github.com/ai-openshell/sdk-go) (module `github.com/ai-openshell/sdk-go`). Open SDK changes, including dependency and security updates, there; proto changes here need no Go bindings.

## Python SDK (`python/openshell/`)
## Python SDK

- The Python SDK moved to [ai-openshell/sdk-python](https://github.com/ai-openshell/sdk-python), which publishes `openshell` to PyPI. Open SDK changes there.
- `python/` and the SDK build script `tasks/scripts/generate_python_proto.py` are frozen until core removes them; Branch Checks fails PRs that change them. Put tests for core Python scripts next to the scripts, not under `python/`.
- The Python SDK lives in [ai-openshell/sdk-python](https://github.com/ai-openshell/sdk-python), which publishes `openshell` to PyPI. Open SDK changes there; proto changes here need no Python bindings.

## Python

Expand Down
7 changes: 2 additions & 5 deletions CI.md
Original file line number Diff line number Diff line change
Expand Up @@ -685,10 +685,7 @@ and reads the changed files through the API, so a pull request cannot edit its
own rules.

`.github/frozen-paths.toml` is the one place that lists frozen paths, each freeze
with its own failure message. It also holds the `python-sdk` freeze, which the
`Python SDK Freeze` job in `Branch Checks` enforces through the same script
(`--group python-sdk`); that job has no label bypass. Edit the file as moves
are decided.
with its own failure message. Edit the file as moves are decided.

To bypass the check for a porting or removal pull request, a maintainer applies
the `tmp:migrate` label; the check re-runs and passes. Run it
Expand Down Expand Up @@ -789,7 +786,7 @@ Maintainers should add ready PRs to the queue rather than pressing a direct merg
| `.github/workflows/review-readiness.yml` | Labels newly opened accepted-work PRs using the shared read-only acceptance library, including drafts; routes matching reviewers when a PR is ready and classified. |
| `.github/workflows/workflow-security.yml` | Runs informational Actionlint and High-severity Zizmor reports on GitHub-hosted runners. |
| `.github/workflows/dependency-review.yml` | Reports dependency changes when GitHub Dependency Graph is available; otherwise publishes a neutral warning. |
| `.github/workflows/codeql.yml` | Runs nightly informational CodeQL analysis on `main` for Rust and the Python SDK and retains SARIF artifacts. |
| `.github/workflows/codeql.yml` | Runs nightly informational CodeQL analysis on `main` for Rust, Python and JavaScript/TypeScript and retains SARIF artifacts. |
| `.github/workflows/codex-security.yml` | Advisory scan during prerelease qualification; scans the stable-to-candidate diff and publishes train-scoped SARIF on `main`. |
| `.github/workflows/codex-compatibility.yml` | Reviews branch and cumulative tagged-release compatibility with Codex and retains advisory findings, PR acknowledgements, and coverage; it does not gate merging or publication. |
| `.github/workflows/trivy-changes.yml` | Blocks pull requests and merge groups that introduce new High or Critical Helm or Dockerfile misconfigurations. |
Expand Down
1 change: 0 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,6 @@ These are the primary `mise` tasks for day-to-day development:
| `crates/openshell-policy-cedar-runtime/` | Cedar implementation of the shared runtime contracts, selected by supervisor composition |
| `crates/openshell-policy-runtime-interface/` | Shared policy decisions, request metadata, snapshots, and staged reload contracts; no engine implementations |
| `crates/openshell-prover-cli/` | Standalone local policy boundary checker |
| `python/` | Python SDK (frozen, moved to ai-openshell/sdk-python) |
| `proto/` | Protocol buffer definitions and [public API conventions](proto/README.md) |
| `tasks/` | `mise` task definitions and build scripts |
| `tests/testkit/` | Support library for SDK-driven end-to-end suites |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ SDKs connect applications to an OpenShell gateway. They do not install the CLI.

| Language | Install | Docs |
|---|---|---|
| Python | `uv add openshell` | [README](python/openshell/) |
| Python | `uv add openshell` | [ai-openshell/sdk-python](https://github.com/ai-openshell/sdk-python) |
| TypeScript | `npm install @ai-openshell/sdk` | [ai-openshell/sdk-typescript](https://github.com/ai-openshell/sdk-typescript) |
| Go | `go get github.com/ai-openshell/sdk-go@vX.Y.Z` | [ai-openshell/sdk-go](https://github.com/ai-openshell/sdk-go) |
| Rust | `cargo add openshell-sdk --git https://github.com/ai-openshell/openshell --tag <release-tag>` | [Installation and usage](docs/sdk/rust.mdx) |
Expand Down
30 changes: 6 additions & 24 deletions TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Running Tests

```bash
mise run test # Rust + Python unit tests
mise run test # Rust unit tests and Python script tests
mise run e2e # End-to-end tests (starts a Docker-backed gateway)
mise run ci # Everything: lint, compile checks, and tests
```
Expand All @@ -13,7 +13,6 @@ mise run ci # Everything: lint, compile checks, and tests
```text
crates/*/src/ # Inline #[cfg(test)] modules
crates/*/tests/ # Rust integration tests
python/openshell/ # Python unit tests (*_test.py suffix)
e2e/workload/ # E2E Python image the sandboxes run python3, curl, and git from
e2e/rust/ # Rust CLI E2E tests
tests/testkit/ # Support library for SDK-driven E2E suites
Expand Down Expand Up @@ -188,29 +187,12 @@ Windows token-file tests explicitly skip POSIX
mode-bit assertions; those skips do not establish Windows ACL protection.
Use a checkout with LF text files when running Unix-shell fixture checks.

## Python Unit Tests
## Python Script Tests

Python unit tests use the `*_test.py` suffix convention (not `test_*` prefix)
and live alongside the source in `python/openshell/`. They use mock-based
patterns with fake gRPC stubs:

```python
def test_exec_python_serializes_callable_payload() -> None:
stub = _FakeStub()
client = _client_with_fake_stub(stub)

def add(a: int, b: int) -> int:
return a + b

result = client.exec_python("sandbox-1", add, args=(2, 3))
assert result.exit_code == 0
```

Run Python unit tests only:

```bash
mise run test:python # uv run pytest python/
```
Tests for the repository's Python scripts use the `*_test.py` suffix and live
next to the script they test. `mise run test:python-scripts` runs the release,
RPM, E2E gateway config, and license header script tests; other script tests
have their own `test:*` tasks in `tasks/test.toml`.

## E2E Tests

Expand Down
4 changes: 3 additions & 1 deletion docs/sdk/python.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ when possible.

## Install the SDK

The package requires Python 3.11 or later. Add it to your project with `uv`:
The package requires Python 3.11 or later. It is developed in
[ai-openshell/sdk-python](https://github.com/ai-openshell/sdk-python) and
published to PyPI. Add it to your project with `uv`:

```shell
uv add openshell
Expand Down
2 changes: 1 addition & 1 deletion mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ DOCKER_BUILDKIT = "1"

[vars]
# Python paths to include in formatting/linting
python_paths = "python/ tasks/scripts/*.py e2e/mcp-conformance/*.py e2e/kubernetes/app-listener/*.py deploy/sbom/*.py deploy/rpm/*.py e2e/configs/gateway/*.py"
python_paths = "tasks/scripts/*.py e2e/mcp-conformance/*.py e2e/kubernetes/app-listener/*.py deploy/sbom/*.py deploy/rpm/*.py e2e/configs/gateway/*.py"

[task_config]
includes = ["tasks/*.toml"]
Loading
Loading