Self-improving AI Employees for everyone
Python ai-agentsai-employeeai-employeesassistantautonomous-agentsco-employeescompanygrok-botinstinctloop-agentsmuseown-your-datapersonalself-hosted
ci: run the server suite on every OS with the pinned Temporal CLI
trohitga9ee66755078
diff --git a/.github/workflows/predeploy.yml b/.github/workflows/predeploy.ymlindex cf6259c9..18862e9a 100644--- a/.github/workflows/predeploy.yml+++ b/.github/workflows/predeploy.yml@@ -1,6 +1,7 @@# Reusable validation workflow. Called by ci.yml and release.yml.# Jobs: build-and-lint (client build, lint, tests, JS dependency audit),-# backend-tests, cli-tests, test-build-start (cross-OS build + start smoke test).+# backend-tests (cross-OS, with the pinned Temporal CLI), cli-tests,+# test-build-start (cross-OS build + start smoke test).name: Predeploy@@ -48,26 +49,48 @@ jobs:working-directory: desktoprun: bun run audit:deps+ # The whole server suite runs on every OS the desktop app ships for, with+ # the Temporal CLI the app pins, so the real-server tests (TEMPORAL_TEST_CLI)+ # run instead of skipping.backend-tests:- name: Backend tests- runs-on: ubuntu-latest+ name: Backend tests (${{ matrix.os }})+ runs-on: ${{ matrix.os }}+ strategy:+ fail-fast: false+ matrix:+ os: [ubuntu-latest, windows-latest, macos-latest]steps:- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1with:persist-credentials: false+ # Replay tests run workflow code from older commits (git show).+ fetch-depth: 0- uses: ./.github/actions/setup- name: Lockfile is current+ if: runner.os == 'Linux'working-directory: server# server/uv.lock is what the desktop build installs with --frozen;# a stale lock would ship a different dependency tree than CI tested.run: uv lock --check- name: Audit Python dependencies+ if: runner.os == 'Linux'working-directory: serverrun: |uv export --locked --all-extras --no-hashes --no-emit-project --output-file "${RUNNER_TEMP}/opencompany-audit.txt" > /dev/nulluvx --from pip-audit==2.10.1 pip-audit --strict --disable-pip --no-deps -r "${RUNNER_TEMP}/opencompany-audit.txt"+ - name: Pinned Temporal CLI+ working-directory: server+ shell: bash+ # The app's own installer (server/config/temporal_cli.json, checked+ # against its SHA-256) into a throwaway data directory.+ env:+ DATA_DIR: ${{ runner.temp }}/opencompany-data+ run: |+ uv sync+ uv run python -c "import asyncio, os; from services.temporal._install import ensure_temporal_binaries; cli = asyncio.run(ensure_temporal_binaries())['temporal']; open(os.environ['GITHUB_ENV'], 'a', encoding='utf-8').write(f'TEMPORAL_TEST_CLI={cli}\n')"- name: pytestworking-directory: server+ shell: bashrun: |bun --cwd=pi install --frozen-lockfilebun --cwd=pi run builddiff --git a/RFC-0005-EVENT-OS-ON-TEMPORAL.md b/RFC-0005-EVENT-OS-ON-TEMPORAL.mdindex 7879e713..f676bd85 100644--- a/RFC-0005-EVENT-OS-ON-TEMPORAL.md+++ b/RFC-0005-EVENT-OS-ON-TEMPORAL.md@@ -1085,6 +1085,7 @@ Commit hashes are filled in when the phase ends.| Step | Commit | Notes ||---|---|---|| 1.1 Pinned CLI | — | CLI v1.9.1 (server 1.32.0) is pinned in `server/config/temporal_cli.json` and verified with pooch's `known_hash`. It is installed under `packages/temporal/<version>/`, and every other CLI file there is deleted. `_install.prepare_database` deletes a `temporal.db` without the pinned server minor's marker. **Release note:** the first release with the pin starts every install on an empty Temporal database, so every employee needs Reset and Start. |+| 1.2 CI | — | `backend-tests` runs on ubuntu, windows and macos with full history. The app's installer puts the pinned CLI into a throwaway `DATA_DIR` and exports it as `TEMPORAL_TEST_CLI`, so the real-server tests run instead of skipping. Locally on Windows, all 8 of those items passed against the pinned binary. The first CI run on macOS is the first on that OS. |## 25. Defaults chosen and open itemsdiff --git a/cli/tests/test_release_pipeline_config.py b/cli/tests/test_release_pipeline_config.pyindex e9ccb7c6..560403cf 100644--- a/cli/tests/test_release_pipeline_config.py+++ b/cli/tests/test_release_pipeline_config.py@@ -422,6 +422,28 @@ def test_predeploy_checks_executor_types(predeploy_yml: dict, sidecar_pkg: dict)assert f"bun run --filter {SIDECAR_PKG_NAME} typecheck" in commands+def test_backend_tests_run_on_every_os_with_the_pinned_temporal_cli(predeploy_yml: dict):+ """RFC-0005 Phase 1: the whole server suite runs on Linux, Windows and+ macOS, and its real-server tests get the CLI the app pins, installed by+ the app's own installer, as ``TEMPORAL_TEST_CLI``. Without it every one+ of them skips. Two replay tests run workflow code from older commits+ with ``git show``, so the checkout carries full history.+ """+ job = predeploy_yml["jobs"]["backend-tests"]+ assert job["runs-on"] == "${{ matrix.os }}"+ assert job["strategy"]["fail-fast"] is False+ assert set(job["strategy"]["matrix"]["os"]) == {"ubuntu-latest", "windows-latest", "macos-latest"}+ checkout = job["steps"][0]+ assert checkout["uses"].startswith("actions/checkout@")+ assert checkout["with"]["fetch-depth"] == 0+ names = [step.get("name") for step in job["steps"]]+ cli = _step_by_name(job, "Pinned Temporal CLI")+ assert cli is not None, "backend-tests must install the pinned Temporal CLI"+ assert "ensure_temporal_binaries" in cli["run"]+ assert "TEMPORAL_TEST_CLI=" in cli["run"] and "GITHUB_ENV" in cli["run"]+ assert names.index("Pinned Temporal CLI") < names.index("pytest")++# ---------------------------------------------------------------------------# Release publication — package.json, release.yml, preinstall.js# ---------------------------------------------------------------------------diff --git a/docs-internal/TEMPORAL_ARCHITECTURE.md b/docs-internal/TEMPORAL_ARCHITECTURE.mdindex a3d4e771..27b4b0d9 100644--- a/docs-internal/TEMPORAL_ARCHITECTURE.md+++ b/docs-internal/TEMPORAL_ARCHITECTURE.md@@ -770,6 +770,13 @@ Activities are controlled fixtures. Set `TEMPORAL_TEST_CLI` to a provisionednative Temporal executable to run the owner-routing, Continue-As-New,cancellation/cleanup and SDK replay gate. Old replay fixtures remain required.+CI's `backend-tests` job sets `TEMPORAL_TEST_CLI` to the pinned CLI on Linux,+Windows and macOS. To run these tests locally against that same binary, install it into a+scratch data directory, never your own:+`DATA_DIR=<scratch> uv run python -m services.temporal._install`. Then run pytest with+`TEMPORAL_TEST_CLI=<the printed path>` and the same `DATA_DIR`, because the+tests' child processes write under it.+What the user sees is documented in [Mobile workspace](../docs/mobile-workspace.md#resetting-phone-tasks)and [Browser workspace](browser_workspace.md#direct-browser-tasks).diff --git a/docs-internal/ci_cd.md b/docs-internal/ci_cd.mdindex f29cc426..1bcd0bda 100644--- a/docs-internal/ci_cd.md+++ b/docs-internal/ci_cd.md@@ -94,7 +94,11 @@ After tool install the composite installs the supervisor CLI editably (`uv pip iReusable `workflow_call` workflow with four independent jobs (no plan/change-detection gate, no aggregator — every job runs on every call):- `build-and-lint` — `bun install --frozen-lockfile` + `bun run build`, then client lint (`bun run --filter react-flow-client lint`), TypeScript check (`... typecheck`), frontend tests (`... test`, vitest), and the JS dependency audit (`bun run audit:deps` at the root and in `desktop/`; see "Dependency update policy" below). Runs on `ubuntu-latest`.-- `backend-tests` — `uv lock --check` (the committed `server/uv.lock` must match `pyproject.toml`; the desktop app installs from it with `--frozen`), a pinned `pip-audit` check of the locked Python dependencies including all extras, then `uv sync` + `uv run pytest tests/ -v` in `server/`. Whole suite, unsharded. Runs on `ubuntu-latest`.+- `backend-tests` — cross-OS matrix (`ubuntu-latest`, `windows-latest`, `macos-latest`, `fail-fast: false`; RFC-0005 Phase 1). On Linux only, `uv lock --check` (the committed `server/uv.lock` must match `pyproject.toml`; the desktop app installs from it with `--frozen`) and a pinned `pip-audit` check of the locked Python dependencies including all extras. Then, on every OS:+ - **Pinned Temporal CLI.** The app's own installer (`services.temporal._install.ensure_temporal_binaries`) puts the CLI pinned in `server/config/temporal_cli.json` into a throwaway `DATA_DIR`, and the step writes its path to `$GITHUB_ENV` as `TEMPORAL_TEST_CLI`. The real-server tests that skip without it then run.+ - **Full history.** The checkout uses `fetch-depth: 0`, because two replay tests `git show` older commits.+ - **Tests.** `uv sync` + `uv run pytest tests/ -v` in `server/`, the whole suite, unsharded, under `shell: bash` on every OS.+ - **Lock.** `test_backend_tests_run_on_every_os_with_the_pinned_temporal_cli` locks this.- `cli-tests` — `uv pip install --system pytest pytest-asyncio pyyaml` + `python -m pytest cli/tests/ -v`. Runs on `ubuntu-latest`.- `test-build-start` — cross-OS matrix (`ubuntu-latest`, `macos-latest`, `windows-latest`, `fail-fast: false`). Runs `bun run build`, then `bun run tsc --version` (proves the per-platform TypeScript 7 Go binary delivered via `optionalDependencies` resolves on every OS — the type-check gate itself runs on ubuntu only; `bun run`, never `bunx`, so it resolves strictly from the root `node_modules/.bin`), then a start smoke test. On Unix it backgrounds `bun run start`, reads `PYTHON_BACKEND_PORT` out of `.env.template` and polls `http://localhost:${APP_PORT}/health` (`curl -sf -m 5`, every 2 s) for up to 90 s, giving up early if the start process exits. It always runs `bun run stop` afterwards, then fails unless `/health` answered. On Windows it starts the supervisor as a background job, waits 15 s, and fails if the job already exited.diff --git a/docs-internal/temporal-workflow-control.md b/docs-internal/temporal-workflow-control.mdindex 02d747d0..7529423e 100644--- a/docs-internal/temporal-workflow-control.md+++ b/docs-internal/temporal-workflow-control.md@@ -617,8 +617,9 @@ The native integration gate inorchestration and two owner workers against a native Temporal test server.It covers an absent owner, owner routing with worker pools disabled,Continue-As-New, cancellation waiting for cleanup, artifact preservation and-SDK replay. Set `TEMPORAL_TEST_CLI` to a native Temporal binary to enable it;-the Activities are controlled fixtures and access no external accounts.+SDK replay. Set `TEMPORAL_TEST_CLI` to a native Temporal binary to enable it.+CI sets it to the pinned CLI on every OS; see TEMPORAL_ARCHITECTURE.md for a+local run. The Activities are controlled fixtures and access no external accounts.Existing replay fixtures continue to cover unversioned graph, agent andinvocation histories.