diff --git a/.agents/skills/release-captain/SKILL.md b/.agents/skills/release-captain/SKILL.md index b12a26d6e9..d64096f9fa 100644 --- a/.agents/skills/release-captain/SKILL.md +++ b/.agents/skills/release-captain/SKILL.md @@ -46,6 +46,9 @@ tag, or start a second `Pre-release` run for a tag; it has no concurrency guard. repository must exist and Actions must have a `BUF_TOKEN` secret with write access. A failed Buf push fails the release run; follow Recovery before rerunning the failed publication job. +- Pre-release and stable builds leave the `experimental` feature disabled. Release + Dev enables it through `dev-build: true`. Normal workspace builds, lint, + and tests enable `experimental` without separate CI lanes for development features. ## Setup diff --git a/.github/workflows/branch-checks.yml b/.github/workflows/branch-checks.yml index 5505a1fa1b..9530bf1a27 100644 --- a/.github/workflows/branch-checks.yml +++ b/.github/workflows/branch-checks.yml @@ -318,7 +318,7 @@ jobs: - name: Lint shell: nix develop -c bash -euo pipefail {0} run: | - cargo clippy --locked --workspace --all-targets -- -D warnings + cargo clippy --locked --workspace --all-targets --features experimental -- -D warnings cargo clippy --locked --manifest-path e2e/rust/Cargo.toml --all-targets -- -D warnings cargo clippy --locked --manifest-path examples/governance-interceptor/Cargo.toml --all-targets -- -D warnings cargo clippy --locked --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml --all-targets -- -D warnings @@ -413,7 +413,7 @@ jobs: env: OPENSHELL_TELEMETRY_ENABLED: "false" run: | - cargo nextest run --locked --profile ci --workspace --features openshell-server/test-support + cargo nextest run --locked --profile ci --workspace --features openshell-server/test-support,experimental cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path tests/testkit/Cargo.toml cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path tests/tmachine/Cargo.toml diff --git a/.github/workflows/branch-e2e.yml b/.github/workflows/branch-e2e.yml index 2fbfdc62a3..57e2a1f4c9 100644 --- a/.github/workflows/branch-e2e.yml +++ b/.github/workflows/branch-e2e.yml @@ -127,6 +127,7 @@ jobs: with: checkout-ref: ${{ needs.pr_metadata.outputs.sha }} cargo-version: ${{ needs.version.outputs.cargo }} + dev-build: true secrets: CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} @@ -138,6 +139,7 @@ jobs: with: checkout-ref: ${{ needs.pr_metadata.outputs.sha }} cargo-version: ${{ needs.version.outputs.cargo }} + dev-build: true secrets: CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} diff --git a/.github/workflows/build-binaries-linux.yml b/.github/workflows/build-binaries-linux.yml index e8bda65b6b..2a49233ca4 100644 --- a/.github/workflows/build-binaries-linux.yml +++ b/.github/workflows/build-binaries-linux.yml @@ -17,6 +17,11 @@ on: required: false type: string default: "" + dev-build: + description: Enable the gateway and supervisor experimental feature bundle + required: false + type: boolean + default: false secrets: CACHIX_AUTH_TOKEN: required: true @@ -81,6 +86,7 @@ jobs: env: PACKAGE: openshell-gateway BINARY: openshell-gateway + EXTRA_CARGO_FLAGS: ${{ inputs.dev-build && '--features experimental' || '' }} strategy: matrix: include: @@ -97,6 +103,8 @@ jobs: env: PACKAGE: ${{ matrix.package }} BINARY: ${{ matrix.binary }} + # Only supervisor entries define the experimental feature bundle. + EXTRA_CARGO_FLAGS: ${{ matrix.package == 'openshell-supervisor' && inputs.dev-build && '--features experimental' || '' }} strategy: matrix: include: diff --git a/.github/workflows/build-binaries-macos.yml b/.github/workflows/build-binaries-macos.yml index e5f7d09648..956e55b001 100644 --- a/.github/workflows/build-binaries-macos.yml +++ b/.github/workflows/build-binaries-macos.yml @@ -17,6 +17,11 @@ on: required: false type: string default: "" + dev-build: + description: Enable the gateway and supervisor experimental feature bundle + required: false + type: boolean + default: false secrets: CACHIX_AUTH_TOKEN: required: true @@ -61,3 +66,4 @@ jobs: triple: ${{ matrix.triple }} cargo-version: ${{ inputs.cargo-version }} supervisor-image-tag: ${{ inputs.supervisor-image-tag }} + extra-cargo-flags: ${{ (matrix.package == 'openshell-gateway' || matrix.package == 'openshell-supervisor') && inputs.dev-build && '--features experimental' || '' }} diff --git a/.github/workflows/release-dev.yml b/.github/workflows/release-dev.yml index 14a1ad189c..481e9ec8fc 100644 --- a/.github/workflows/release-dev.yml +++ b/.github/workflows/release-dev.yml @@ -72,6 +72,7 @@ jobs: cargo-version: ${{ needs.compute-versions.outputs.cargo_version }} supervisor-image-tag: dev checkout-ref: ${{ github.sha }} + dev-build: true secrets: CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} @@ -84,6 +85,7 @@ jobs: cargo-version: ${{ needs.compute-versions.outputs.cargo_version }} supervisor-image-tag: dev checkout-ref: ${{ github.sha }} + dev-build: true secrets: CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} diff --git a/.github/workflows/rust-cache.yml b/.github/workflows/rust-cache.yml index 7deb60d85b..3b6fef0238 100644 --- a/.github/workflows/rust-cache.yml +++ b/.github/workflows/rust-cache.yml @@ -63,7 +63,7 @@ jobs: shell: nix develop -c bash -euo pipefail {0} run: | cargo test --locked -p openshell-crypto --no-default-features --test independent_backend --no-run - cargo nextest run --locked --profile ci --workspace --features openshell-server/test-support --no-run + cargo nextest run --locked --profile ci --workspace --features openshell-server/test-support,experimental --no-run cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml --no-run cargo nextest run --locked --config-file .config/nextest.toml --profile ci --manifest-path tests/testkit/Cargo.toml --no-run diff --git a/CI.md b/CI.md index 22b7a543c0..9824731667 100644 --- a/CI.md +++ b/CI.md @@ -698,9 +698,9 @@ Maintainers should add ready PRs to the queue rather than pressing a direct merg | File | Role | |---|---| -| `.github/workflows/branch-checks.yml` | Required non-E2E checks. Triggers on `pull_request` and on `merge_group` for queued merges. | +| `.github/workflows/branch-checks.yml` | Required non-E2E checks. Triggers on `pull_request` and on `merge_group` for queued merges. Rust lint and tests run once with the development configuration (`--features experimental`). | | `.github/workflows/branch-e2e.yml` | Standard, Kubernetes HA, Kubernetes credential-driver, and continuity E2E. PRs use the `test:e2e`, `test:e2e-kubernetes`, and `test:e2e:continuity` labels; merge groups do not run E2E. Jobs load the images this run builds from workflow artifacts, so fork PRs need no registry write access. | -| `.github/workflows/build-binaries-{linux,macos}.yml`, `build-vm-driver-{linux,macos}.yml` | Shared per-platform binary matrices used by branch and release workflows. Each platform is its own workflow, so a consumer depends only on the platforms it needs. The VM driver remains separate because its build consumes the runtime binaries. Its build steps stay inline rather than in a local action because release builds check out the release tag, which may predate the action. | +| `.github/workflows/build-binaries-{linux,macos}.yml`, `build-vm-driver-{linux,macos}.yml` | Shared per-platform binary matrices used by branch and release workflows. Each platform is its own workflow, so a consumer depends only on the platforms it needs. The VM driver remains separate because its build consumes the runtime binaries. Its build steps stay inline rather than in a local action because release builds check out the release tag, which may predate the action. `dev-build: true` selects `--features experimental` for the gateway and supervisor; Release Dev and branch E2E enable it, while prerelease and stable builds use the default of `false`. | | `.github/workflows/build-images.yml` | Builds multi-platform images and uploads them as OCI archives plus per-platform Docker archives for E2E. Release callers also push them; Branch E2E Checks does not. | | `.github/actions/load-e2e-images` | Downloads the per-platform Docker archives and loads them into Docker, Podman, or kind, so E2E jobs never pull OpenShell images from a registry. | | `.github/workflows/package-release-binaries.yml` | Packages raw build artifacts into release tarballs without rebuilding them. | diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b94aa76903..d49ba91e78 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -346,6 +346,11 @@ mise trust mise run gateway ``` +The normal Rust workspace build, check, lint, and test tasks enable the +`experimental` feature bundle. CI uses the same development configuration. Use +`--features experimental` to select it in direct Cargo builds; Cargo's `dev` profile +does not enable it automatically. Prerelease and stable builds leave it off. + ## Building the `openshell` CLI Inside this repository, `openshell` is a local shortcut script at `scripts/bin/openshell`. The script will diff --git a/crates/openshell-gateway/Cargo.toml b/crates/openshell-gateway/Cargo.toml index 86249568ba..0141e39978 100644 --- a/crates/openshell-gateway/Cargo.toml +++ b/crates/openshell-gateway/Cargo.toml @@ -41,6 +41,8 @@ openshell-driver-mxc = { path = "../openshell-driver-mxc", optional = true } [features] default = ["telemetry", "in-tree-compute-drivers"] +# Opt-in bundle for experimental features; stable builds leave it off. +experimental = ["openshell-server/experimental"] in-tree-compute-drivers = [ "compute-driver-docker", "compute-driver-kubernetes", diff --git a/crates/openshell-server/Cargo.toml b/crates/openshell-server/Cargo.toml index f62f37b3a9..3dbcb57d0c 100644 --- a/crates/openshell-server/Cargo.toml +++ b/crates/openshell-server/Cargo.toml @@ -120,6 +120,8 @@ notify = "8" [features] default = ["telemetry"] +# Opt-in bundle for experimental features; stable builds leave it off. +experimental = [] ## Compile in anonymous telemetry emission (forwards to openshell-core/telemetry). ## On by default; build with `--no-default-features` for a telemetry-free gateway ## that contains no telemetry endpoint, HTTP client, or emission code. diff --git a/crates/openshell-supervisor/Cargo.toml b/crates/openshell-supervisor/Cargo.toml index 396d19e993..7167a23a81 100644 --- a/crates/openshell-supervisor/Cargo.toml +++ b/crates/openshell-supervisor/Cargo.toml @@ -62,6 +62,8 @@ uuid = { workspace = true } [features] default = ["telemetry", "bundled-ca-roots"] +# Opt-in bundle for experimental features; stable builds leave it off. +experimental = [] system-ca-roots = ["telemetry"] defaults-without-telemetry = ["bundled-ca-roots"] telemetry = ["openshell-core/telemetry"] diff --git a/tasks/ci.toml b/tasks/ci.toml index 4311191ad1..3ef05c994a 100644 --- a/tasks/ci.toml +++ b/tasks/ci.toml @@ -14,7 +14,7 @@ hide = true ["build:rust:workspace"] description = "Build all Rust crates" -run = "cargo build --workspace" +run = "cargo build --workspace --features experimental" hide = true ["build:release"] diff --git a/tasks/rust.toml b/tasks/rust.toml index 7795a6de9a..714956fe4a 100644 --- a/tasks/rust.toml +++ b/tasks/rust.toml @@ -11,7 +11,7 @@ run = "cargo run --release -p openshell-sandbox --features perf-harness --bin op description = "Check all Rust crates for errors" depends = ["rust:lockfiles:check"] run = [ - "cargo check --workspace", + "cargo check --workspace --features experimental", "cargo check -p openshell-sandbox --all-targets --features perf-harness", ] run_windows = "powershell -NoProfile -ExecutionPolicy Bypass -File tasks/scripts/windows-msvc.ps1 check native" @@ -30,7 +30,7 @@ hide = true description = "Lint Rust code with Clippy (deny warnings)" depends = ["rust:lockfiles:check"] run = [ - "cargo clippy --workspace --all-targets -- -D warnings", + "cargo clippy --workspace --all-targets --features experimental -- -D warnings", "cargo clippy -p openshell-sandbox --all-targets --features perf-harness -- -D warnings", "cargo clippy --manifest-path e2e/rust/Cargo.toml --all-targets -- -D warnings", "cargo clippy --manifest-path examples/governance-interceptor/Cargo.toml --all-targets -- -D warnings", diff --git a/tasks/test.toml b/tasks/test.toml index 07f4986002..5b9476f9af 100644 --- a/tasks/test.toml +++ b/tasks/test.toml @@ -162,8 +162,8 @@ run = [ "cargo test -p openshell-crypto --no-default-features --test independent_backend", # Run the workspace once without openshell-server so we can run that crate # with test-only helpers enabled. - "cargo test --workspace --exclude openshell-server", - "cargo test -p openshell-server --features test-support", + "cargo test --workspace --exclude openshell-server --features experimental", + "cargo test -p openshell-server --features test-support,experimental", "cargo nextest run --config-file .config/nextest.toml --manifest-path examples/supervisor-middleware-content-guard/Cargo.toml", "cargo nextest run --config-file .config/nextest.toml --manifest-path tests/testkit/Cargo.toml", "cargo nextest run --config-file .config/nextest.toml --manifest-path tests/tmachine/Cargo.toml",