Skip to content

Self-improving AI Employees for everyone

ci: strip workflows back to the simple shape

trohitg5b967171d4ae
diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml
index 51cebb46..a703bd30 100644
--- a/.github/actions/setup/action.yml
+++ b/.github/actions/setup/action.yml
@@ -1,19 +1,6 @@
-# Composite action for shared environment setup across all workflows.
-# Eliminates duplicated Node/Python/uv setup.
-#
-# Python version comes from the repo-root ``.python-version`` file
-# (single source of truth, also honoured by uv / pyenv / asdf). To
-# bump Python, change that file -- the composite action picks it up
-# automatically.
-#
-# Usage:
-# - uses: ./.github/actions/setup
-# - uses: ./.github/actions/setup
-# with:
-# node-version: '20' # override Node only; Python tracks .python-version
-
+# Shared environment setup: Node, Python, uv, CLI deps.
name: 'Setup MachinaOS Environment'
-description: 'Setup Node.js, Python, and uv for cross-platform builds.'
+description: 'Setup Node.js, Python, uv, and the supervisor CLI.'
inputs:
node-version:
@@ -23,58 +10,17 @@ inputs:
runs:
using: composite
steps:
- # Action versions are pinned to commit SHAs per the supply-chain
- # hardening pass (see docs-internal/ci_cd.md). Dependabot updates
- # these via the github-actions ecosystem group in dependabot.yml;
- # zizmor (.github/workflows/check-zizmor.yml) enforces SHA pinning
- # on every PR to prevent regression.
- - name: Setup pnpm
- uses: pnpm/action-setup@f40ffcd9367d9f12939873eb1018b921a783ffaa # v4
-
- - name: Setup Node.js
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
+ - uses: pnpm/action-setup@v4
+ - uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'pnpm'
-
- - name: Setup Python
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
+ - uses: actions/setup-python@v5
with:
- # Sourced from repo-root .python-version (https://docs.astral.sh/uv/concepts/python-versions/#requesting-a-version).
- # Single literal lives in that file; bump there and CI follows.
- python-version-file: .python-version
-
- # setup-uv v8 — the canonical uv installer (pdm, prefect, uv itself
- # all use it). ``enable-cache: false`` because v8's default cache
- # behaviour fails the post-job step with a ``Path Validation Error``
- # whenever the resolved ``UV_CACHE_DIR`` doesn't exist on disk
- # (e.g., when ``uv sync`` ran in a working-directory other than
- # the cached one, or another concurrent job already pruned the
- # cache). The save failure marks every dependent job red even
- # though the actual test step passed. Re-enable here once
- # ``astral-sh/setup-uv`` 8.2+ ships the ``ignore-nothing-to-cache``
- # flag.
- - name: Install uv
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
+ python-version: '3.12'
+ - uses: astral-sh/setup-uv@v8
with:
enable-cache: false
-
- # The supervisor CLI lives at <repo>/cli/ and is invoked by pnpm
- # scripts as `python -m cli ...` from the runner's system Python.
- # Install its runtime deps eagerly via the root pyproject.toml so
- # the first `pnpm run build` doesn't trip the self-bootstrap path.
- # User-facing entry-point is named `machina` (see [project.scripts]
- # in pyproject.toml) — module name is `cli`.
- - name: Install supervisor CLI dependencies
+ - name: Install supervisor CLI
shell: bash
run: uv pip install --system -e .
-
- - name: Verify installations
- shell: bash
- run: |
- echo "Node.js: $(node --version)"
- echo "pnpm: $(pnpm --version)"
- echo "npm: $(npm --version)"
- echo "Python: $(python --version)"
- echo "uv: $(uv --version)"
- echo "cli: $(python -c 'import cli; print(cli.__version__)' 2>/dev/null || echo 'failed to import')"
diff --git a/.github/workflows/check-zizmor.yml b/.github/workflows/check-zizmor.yml
deleted file mode 100644
index 3a6568ab..00000000
--- a/.github/workflows/check-zizmor.yml
+++ /dev/null
@@ -1,102 +0,0 @@
-# zizmor — static-analysis linter for GitHub Actions workflows.
-#
-# Catches:
-# - Over-granted `permissions:` (e.g., a job that doesn't need
-# `contents: write` but inherits it from the workflow default).
-# - Unpinned third-party action `uses:` (floating major-version
-# tags like `@v4` instead of pinned commit SHAs).
-# - Insecure `${{ ... }}` template expansion in `run:` blocks
-# (script-injection vectors).
-# - Reusable-workflow caller-callee permission mismatches.
-# - `pull_request_target` + checkout-of-PR-ref combinations
-# (the well-known privilege-escalation foot-gun).
-#
-# Pattern lifted from https://github.com/astral-sh/uv/blob/main/.github/workflows/check-zizmor.yml
-# Project home: https://github.com/woodruffw/zizmor
-#
-# Runs on every push/PR + weekly schedule so a regression introduced
-# between zizmor releases (their query pack expands) is caught
-# without anyone running it locally.
-
-name: Check zizmor
-
-on:
- push:
- branches: [main]
- paths:
- - '.github/workflows/**'
- - '.github/actions/**'
- - '.github/dependabot.yml'
- pull_request:
- branches: [main]
- paths:
- - '.github/workflows/**'
- - '.github/actions/**'
- - '.github/dependabot.yml'
- schedule:
- # Mondays 07:00 UTC — runs before the weekly Dependabot batch
- # so action-version bumps already in flight don't trip new
- # zizmor checks on their merge.
- - cron: '0 7 * * 1'
-
-permissions:
- contents: read
-
-# zizmor/concurrency-limits — cancel an in-flight zizmor run on the same
-# ref when a new push arrives (PRs typically push multiple times; only
-# the latest matters).
-concurrency:
- group: check-zizmor-${{ github.ref }}
- cancel-in-progress: true
-
-jobs:
- zizmor:
- name: Lint workflows
- runs-on: ubuntu-latest
-
- # zizmor's static analysis emits SARIF that GitHub renders in the
- # Security → Code scanning tab. ``security-events: write`` is the
- # minimum scope for that upload; ``contents``/``actions: read``
- # cover repository + workflow metadata the analyzer reads.
- permissions:
- security-events: write
- contents: read
- actions: read
-
- steps:
- - name: Checkout
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- with:
- persist-credentials: false # zizmor/artipacked — read-only checkout
-
- - name: Setup Python
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
- with:
- python-version: '3.12'
-
- - name: Install zizmor
- # zizmor ships as a PyPI wheel; pip install gives us the
- # binary on PATH without compiling Rust locally.
- run: pip install zizmor
-
- - name: Run zizmor
- # --format sarif lets the Security tab ingest results.
- # --persona auditor enables stricter checks (recommended
- # for production CI; relaxed by default).
- run: |
- zizmor \
- --format sarif \
- --persona auditor \
- .github/workflows/ \
- .github/actions/ \
- > zizmor.sarif
- # SARIF upload happens unconditionally so findings still
- # post even on a non-zero exit. Failing the job comes from
- # the SARIF upload's threshold setting, not zizmor's exit.
- continue-on-error: true
-
- - name: Upload SARIF to Security tab
- uses: github/codeql-action/upload-sarif@458d36d7d4f47d0dd16ca424c1d3cda0060f1360 # v3
- with:
- sarif_file: zizmor.sarif
- category: zizmor
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index fcc3bdc7..b428d7f2 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,6 +1,4 @@
-# CI workflow - validates on every push and PR to main
-# Delegates all validation to predeploy.yml
-
+# CI on every push and PR to main. Delegates to predeploy.yml.
name: CI
on:
@@ -9,12 +7,6 @@ on:
pull_request:
branches: [main]
-# Minimum-privilege GITHUB_TOKEN for the implicit calls inside
-# actions (checkout, etc.). Reusable workflows called below declare
-# their own permissions; this one needs read-only at most.
-permissions:
- contents: read
-
jobs:
predeploy:
uses: ./.github/workflows/predeploy.yml
diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml
index a39b0473..efdc5ac4 100644
--- a/.github/workflows/docs.yml
+++ b/.github/workflows/docs.yml
@@ -1,6 +1,4 @@
-# Deploy Mintlify documentation
-# Triggers on push to docs-MachinaOs/ or manual dispatch
-
+# Deploy Mintlify docs on push to docs-MachinaOs/.
name: Deploy Docs
on:
@@ -10,41 +8,16 @@ on:
- 'docs-MachinaOs/**'
workflow_dispatch:
-permissions:
- contents: read
-
-# zizmor/concurrency-limits — coalesce in-flight deploys to the latest
-# commit so a fast-pushed docs change doesn't deploy a stale revision
-# after a fresh one. Mintlify's deploy endpoint is idempotent.
-concurrency:
- group: docs-${{ github.ref }}
- cancel-in-progress: true
-
jobs:
deploy:
- name: Deploy to Mintlify
runs-on: ubuntu-latest
- # zizmor/secrets-outside-env — pin secret access to a deployment
- # environment so ``MINTLIFY_TOKEN`` is only available to runs that
- # pass the ``docs`` environment's protection rules (configure on
- # the repo Settings → Environments page).
- environment: docs
steps:
- - name: Checkout
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- with:
- persist-credentials: false # zizmor/artipacked — read-only checkout
-
- - name: Setup Node.js
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
with:
node-version: '22'
-
- - name: Install Mintlify CLI
- run: npm install -g mintlify
-
- - name: Deploy to Mintlify
- working-directory: docs-MachinaOs
+ - run: npm install -g mintlify
+ - working-directory: docs-MachinaOs
env:
MINTLIFY_TOKEN: ${{ secrets.MINTLIFY_TOKEN }}
run: mintlify deploy
diff --git a/.github/workflows/predeploy.yml b/.github/workflows/predeploy.yml
index 5f56433e..c21414a7 100644
--- a/.github/workflows/predeploy.yml
+++ b/.github/workflows/predeploy.yml
@@ -1,218 +1,58 @@
-# Reusable validation workflow called by ci.yml and release.yml.
-#
-# Job graph:
-# plan ─┬─> build-and-lint (gated on should_lint_or_test_frontend)
-# ├─> backend-tests (matrix: domain shards, gated on should_test_backend)
-# ├─> cli-tests (gated on should_test_cli)
-# ├─> test-build-start (matrix: OS, gated on should_full_build)
-# └─> ci-passed (alls-green aggregator — branch protection target)
-#
-# Patterns (Tier 3 of the CI/CD plan):
-# - `plan` job: change-detection booleans via dorny/paths-filter
-# (lifted from astral-sh/uv ci.yml). Doc-only PRs skip the heavy
-# suites; cli-only PRs skip the backend tests; etc.
-# - Domain-sharded test matrix (lifted from prefect's python-tests.yaml):
-# parallelises 1376 pytest cases by test-tree subdir so one slow
-# shard doesn't gate the others' results.
-# - `ci-passed` job using re-actors/alls-green (lifted from hatch):
-# single required-check job name for branch protection that doesn't
-# break when matrix dimensions change.
+# Reusable validation workflow. Called by ci.yml and release.yml.
+# Three jobs: client build + lint, backend tests, cross-OS smoke test.
name: Predeploy
on:
workflow_call:
-permissions:
- contents: read
-
jobs:
- # ----------------------------------------------------------------------
- # plan -- change-detection booleans gate the downstream graph.
- # ----------------------------------------------------------------------
- plan:
- name: Plan
- runs-on: ubuntu-latest
- outputs:
- backend_changed: ${{ steps.filter.outputs.backend }}
- frontend_changed: ${{ steps.filter.outputs.frontend }}
- cli_changed: ${{ steps.filter.outputs.cli }}
- workflows_changed: ${{ steps.filter.outputs.workflows }}
- docs_only: ${{ steps.filter.outputs.docs_only }}
- steps:
- - name: Checkout
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- with:
- persist-credentials: false # zizmor/artipacked — read-only checkout
-
- - name: Detect changed paths
- id: filter
- uses: dorny/paths-filter@6852f92c20ea7fd3b0c25de3b5112db3a98da050 # v3
- with:
- # On `workflow_call`, paths-filter compares against the base
- # branch automatically. For push events, it compares with the
- # previous SHA. No `base:` needed in the workflow_call case.
- filters: |
- backend:
- - 'server/**'
- - 'pyproject.toml'
- - 'pnpm-workspace.yaml'
- frontend:
- - 'client/**'
- - 'pnpm-workspace.yaml'
- cli:
- - 'cli/**'
- - 'pyproject.toml'
- workflows:
- - '.github/**'
- docs_only:
- - 'docs-MachinaOs/**'
- - '**/*.md'
-
- # ----------------------------------------------------------------------
- # build-and-lint -- client build + frontend tests + lint + tsgo
- # ----------------------------------------------------------------------
build-and-lint:
name: Build + lint
- needs: plan
- # Frontend changes / workflow changes / full pushes to main always
- # trigger this. Doc-only PRs skip.
- if: needs.plan.outputs.docs_only != 'true'
runs-on: ubuntu-latest
steps:
- - name: Checkout
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- with:
- persist-credentials: false # zizmor/artipacked — read-only checkout
-
- - name: Setup environment
- uses: ./.github/actions/setup
-
- - name: Install dependencies
- run: pnpm install --frozen-lockfile
-
- - name: Build all services
- run: pnpm run build
+ - uses: actions/checkout@v4
+ - uses: ./.github/actions/setup
+ - run: pnpm install --frozen-lockfile
+ - run: pnpm run build
+ - run: pnpm --filter react-flow-client run lint
+ - run: pnpm --filter react-flow-client run typecheck
+ - run: pnpm --filter react-flow-client run test
- - name: Lint client
- run: pnpm --filter react-flow-client run lint
-
- - name: TypeScript check
- # Uses tsgo (`@typescript/native-preview`, pinned in client/package.json).
- # ~5x faster than tsc on this codebase; both pass identically.
- # `typecheck:tsc` script remains available as a fallback if tsgo regresses.
- run: pnpm --filter react-flow-client run typecheck
-
- - name: Frontend tests (vitest)
- # 148 tests covering hooks, contexts, components. Uses jsdom +
- # @testing-library/react. Must stay green for canvas state, auth
- # bootstrap, and credentials flows to ship.
- run: pnpm --filter react-flow-client run test
-
- # ----------------------------------------------------------------------
- # backend-tests -- pytest sharded by domain (prefect pattern)
- # ----------------------------------------------------------------------
backend-tests:
- name: Backend tests (${{ matrix.shard }})
- needs: plan
- if: needs.plan.outputs.backend_changed == 'true' || needs.plan.outputs.workflows_changed == 'true'
+ name: Backend tests
runs-on: ubuntu-latest
- strategy:
- fail-fast: false
- matrix:
- # Three shards balance parallelism vs. matrix-dispatch overhead.
- # Add new shards by carving subdirs out of `backend-root` as
- # the test tree grows.
- include:
- - shard: nodes
- paths: tests/nodes/
- - shard: services
- # Pulls tests/services + tests/temporal + tests/llm +
- # tests/credentials together because they share the same
- # heavy setup (DI container + auth_service init).
- paths: tests/services/ tests/temporal/ tests/llm/ tests/credentials/
- - shard: root
- # Root-level cross-cutting invariants (plugin self-containment,
- # broadcast contracts, no-raw-prints, etc.). Cheap to run
- # but logically distinct from per-domain tests.
- paths: tests/ --ignore=tests/nodes/ --ignore=tests/services/ --ignore=tests/temporal/ --ignore=tests/llm/ --ignore=tests/credentials/
steps:
- - name: Checkout
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- with:
- persist-credentials: false # zizmor/artipacked — read-only checkout
-
- - name: Setup environment
- uses: ./.github/actions/setup
-
- - name: Backend tests (server pytest, shard=${{ matrix.shard }})
- # ``uv sync`` (no flag) includes the PEP 735 ``[dependency-groups].dev``
- # bundle by default — pytest, pytest-asyncio, pytest-mock, respx, ruff.
+ - uses: actions/checkout@v4
+ - uses: ./.github/actions/setup
+ - name: pytest
working-directory: server
run: |
uv sync
- uv run pytest ${{ matrix.paths }} -v
+ uv run pytest tests/ -v
- # ----------------------------------------------------------------------
- # cli-tests -- supervisor CLI pytest (small, fast, separate from backend)
- # ----------------------------------------------------------------------
cli-tests:
name: CLI tests
- needs: plan
- if: needs.plan.outputs.cli_changed == 'true' || needs.plan.outputs.workflows_changed == 'true'
runs-on: ubuntu-latest
steps:
- - name: Checkout
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- with:
- persist-credentials: false # zizmor/artipacked — read-only checkout
-
- - name: Setup environment
- uses: ./.github/actions/setup
-
- - name: Supervisor CLI tests (pytest)
- # 106 tests covering build/start/stop pipelines, daemon, ports,
- # docs, release config, clean. Run from repo root — tests
- # resolve workspace paths via `pnpm list --json`.
- # `pyyaml` is needed by test_release_pipeline_config.py to parse
- # the workflow files; not a CLI runtime dep, only a test-time one.
+ - uses: actions/checkout@v4
+ - uses: ./.github/actions/setup
+ - name: pytest
run: |
uv pip install --system pytest pytest-asyncio pyyaml
python -m pytest cli/tests/ -v
- # ----------------------------------------------------------------------
- # test-build-start -- cross-OS build + start smoke test
- # ----------------------------------------------------------------------
test-build-start:
name: Build + start (${{ matrix.os }})
- needs: plan
- # Always runs unless the change is doc-only -- catches platform-
- # specific build regressions (Windows path handling, macOS arm
- # binary fallbacks, etc.) that can't be ID'd from Linux alone.
- if: needs.plan.outputs.docs_only != 'true'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- - name: Checkout
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- with:
- persist-credentials: false # zizmor/artipacked — read-only checkout
-
- - name: Setup environment
- uses: ./.github/actions/setup
-
- - name: Build
- run: pnpm run build
-
- - name: Verify build artifacts
- shell: bash
- run: |
- test -d "client/dist" && echo "client/dist/ exists" || (echo "client/dist/ missing" && exit 1)
- test -d "server/.venv" && echo "server/.venv/ exists" || (echo "server/.venv/ missing" && exit 1)
- # edgymeow binary checked in test-install.yml (CI skips binary download)
+ - uses: actions/checkout@v4
+ - uses: ./.github/actions/setup
+ - run: pnpm run build
- name: Test start (Unix)
if: runner.os != 'Windows'
@@ -220,72 +60,17 @@ jobs:
run: |
pnpm run start &
PID=$!
-
for i in {1..15}; do
- if curl -sf http://localhost:3010/health > /dev/null 2>&1; then
- echo "Backend healthy after $((i*2))s"
- break
- fi
+ curl -sf http://localhost:3010/health > /dev/null 2>&1 && break
sleep 2
done
-
- if kill -0 $PID 2>/dev/null; then
- echo "pnpm run start: OK"
- pnpm run stop || kill $PID 2>/dev/null || true
- else
- echo "pnpm run start: FAILED"
- exit 1
- fi
+ kill -0 $PID 2>/dev/null && pnpm run stop || (echo FAILED; exit 1)
- name: Test start (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
- $job = Start-Job -ScriptBlock {
- Set-Location $using:PWD
- pnpm run start
- }
+ $job = Start-Job -ScriptBlock { Set-Location $using:PWD; pnpm run start }
Start-Sleep -Seconds 15
-
- try {
- $response = Invoke-WebRequest -Uri "http://localhost:3010/health" -UseBasicParsing -TimeoutSec 5
- Write-Host "Backend healthy: $($response.StatusCode)"
- } catch {
- Write-Host "Backend not responding"
- }
-
- if ($job.State -eq "Running") {
- Write-Host "pnpm run start: OK"
- Stop-Job $job
- Remove-Job $job
- } else {
- Write-Host "pnpm run start: FAILED"
- Receive-Job $job
- exit 1
- }
-
- # ----------------------------------------------------------------------
- # ci-passed -- single aggregator job; the one branch protection rule
- # points at. Matrix dimensions can grow/shrink without breaking
- # protection (hatch pattern).
- # ----------------------------------------------------------------------
- ci-passed:
- name: CI passed
- if: always()
- needs:
- - plan
- - build-and-lint
- - backend-tests
- - cli-tests
- - test-build-start
- runs-on: ubuntu-latest
- steps:
- - name: Check all jobs passed (or were skipped intentionally)
- # alls-green treats `skipped` as success when listed in
- # `allowed-skips`. Without this, a doc-only PR that skips
- # backend-tests would fail the aggregator -- defeating the
- # plan-job optimisation.
- uses: re-actors/alls-green@afee1c1eac2a506084c274e9c02c8e0687b48d9e # v1.2.2
- with:
- allowed-skips: build-and-lint, backend-tests, cli-tests, test-build-start
- jobs: ${{ toJSON(needs) }}
+ if ($job.State -eq "Running") { Stop-Job $job; Remove-Job $job }
+ else { Receive-Job $job; exit 1 }
diff --git a/.github/workflows/publish-pypi.yml b/.github/workflows/publish-pypi.yml
deleted file mode 100644
index 43cd53bb..00000000
--- a/.github/workflows/publish-pypi.yml
+++ /dev/null
@@ -1,158 +0,0 @@
-# Reusable workflow: publish machinaos-server to PyPI via OIDC.
-#
-# Called from release.yml after the npm publish step succeeds. Uses
-# PyPI Trusted Publishing (https://docs.pypi.org/trusted-publishers/)
-# so no PYPI_TOKEN secret is needed -- the workflow's OIDC token is
-# exchanged for a short-lived publish token at PyPI's side.
-#
-# One-time admin step to enable this:
-# 1. On PyPI -> Account -> Publishing -> "Add a new pending
-# publisher", set:
-# repo: zeenie-ai/MachinaOS
-# workflow file: publish-pypi.yml
-# environment: pypi
-# 2. Push a tag to trigger the first release -- PyPI promotes the
-# pending publisher to active on first successful exchange.
-#
-# Pattern lifted from PrefectHQ/prefect + pypa/hatch. uv itself uses
-# `uv publish` directly; we prefer pypa/gh-action-pypi-publish for
-# cleaner OIDC integration + audit-tab visibility.
-
-name: Publish to PyPI
-
-on:
- workflow_call:
- inputs:
- package_dir:
- description: 'Directory containing the package to publish (relative to repo root).'
- type: string
- default: 'server'
- dry_run:
- description: 'Build the wheel but skip the upload step.'
- type: boolean
- default: false
-
-permissions:
- contents: read
-
-jobs:
- build:
- name: Build wheel + sdist
- runs-on: ubuntu-latest
- outputs:
- dist_path: ${{ steps.locate.outputs.dist_path }}
- steps:
- - name: Checkout
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- with:
- persist-credentials: false # zizmor/artipacked — read-only checkout
-
- - name: Setup Python
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
- with:
- python-version: '3.12'
- # cache: false in release jobs (wrangler hardening) -- a
- # poisoned pip cache would taint the wheel.
- cache: ''
-
- - name: Install uv
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
-
- - name: Build wheel + sdist
- # `uv build` produces both wheel + sdist by default. Outputs
- # land in `<package_dir>/dist/`. The release flow uses
- # `--no-sources` to ensure no editable-install metadata
- # leaks into the published artifact.
- working-directory: ${{ inputs.package_dir }}
- run: uv build --no-sources
-
- - name: Locate dist directory
- id: locate
- # Reusable-workflow input read via env per the zizmor
- # template-injection check -- caller-controlled string would
- # otherwise execute shell when interpolated directly.
- env:
- PACKAGE_DIR: ${{ inputs.package_dir }}
- run: |
- echo "dist_path=${PACKAGE_DIR}/dist" >> "$GITHUB_OUTPUT"
-
- - name: Upload dist artifact
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
- with:
- name: pypi-dist
- path: ${{ inputs.package_dir }}/dist/
- retention-days: 1
-
- attest:
- name: Generate SLSA build provenance
- needs: build
- runs-on: ubuntu-latest
- # ``actions/attest-build-provenance`` needs ``id-token: write``
- # (OIDC token exchanged for a Sigstore signing key) and
- # ``attestations: write`` (POST to the GitHub attestations
- # endpoint). ``contents: read`` covers tarball checkout.
- permissions:
- id-token: write
- attestations: write
- contents: read
- steps:
- - name: Download dist
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
- with:
- name: pypi-dist
- path: dist/
-
- - name: Attest build provenance
- # Pattern from astral-sh/uv's release workflow. Each wheel +
- # sdist gets its own attestation in the GitHub transparency
- # log; verifiable via `gh attestation verify`.
- uses: actions/attest-build-provenance@96b4a1ef7235a096b17240c259729fdd70c83d45 # v2
- with:
- subject-path: 'dist/*'
-
- publish:
- name: Publish to PyPI
- needs: [build, attest]
- if: inputs.dry_run != true
- runs-on: ubuntu-latest
-
- # Environment binds the OIDC subject claim to a PyPI trusted
- # publisher named "pypi" (configured on PyPI's side -- see
- # docstring). PyPI rejects exchange attempts from any other env.
- environment:
- name: pypi
- url: https://pypi.org/p/machinaos-server
-
- # ``id-token: write`` is the OIDC scope ``pypa/gh-action-pypi-publish``
- # exchanges for a short-lived PyPI upload token. No other scope is
- # needed: the artifact comes from the prior job's upload-artifact.
- permissions:
- id-token: write
-
- steps:
- - name: Download dist
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
- with:
- name: pypi-dist
- path: dist/
-
- - name: Publish to PyPI
- # pypa/gh-action-pypi-publish handles the OIDC exchange + upload.
- # `print-hash: true` writes the SHA-256 of each artifact to the
- # job log so reviewers can cross-check what landed on PyPI
- # against what the build job produced.
- uses: pypa/gh-action-pypi-publish@6733eb7d741f0b11ec6a39b58540dab7590f9b7d # v1.14.0
- with:
- packages-dir: dist/
- print-hash: true
- # Skip-existing avoids a failure when a tag is re-run after
- # PyPI already has the version (e.g. partial-success replay).
- skip-existing: true
-
- publish-dry-run-notice:
- name: Dry-run notice
- needs: build
- if: inputs.dry_run == true
- runs-on: ubuntu-latest
- steps:
- - run: echo "::notice::publish-pypi.yml dry_run=true -- PyPI upload skipped. Build + attest succeeded."
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 74160144..a2608afd 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,20 +1,5 @@
-# Release workflow - predeploy gate, publish, GitHub release, then test install
-#
-# Hardening (May 2026, lifted from gh CLI / vercel / wrangler / uv):
-# - workflow_dispatch defaults to dry-run; pushes need explicit
-# dry_run=false (gemini-cli pattern; reduces accidental
-# publications from an admin clicking Run workflow).
-# - NPM_CONFIG_PROVENANCE=true via env (idiom from vercel) instead
-# of the per-command --provenance flag; survives any future
-# npm publish callsite change.
-# - SLSA build provenance attestation via actions/attest-build-
-# provenance@v2 (uv + gh CLI pattern). Renders on the GitHub
-# release as a verifiable supply-chain claim.
-# - Cache disabled in release-only setup steps (wrangler pattern)
-# to prevent a poisoned cache from previous CI runs from
-# contaminating the release tarball.
-# - pnpm audit is now BLOCKING; the old `|| true` swallowed
-# vulnerabilities.
+# Release workflow: predeploy gate, publish npm + GitHub Packages.
+# Triggers on version tag push.
name: Release
@@ -22,216 +7,48 @@ on:
push:
tags: ['v*.*.*']
workflow_dispatch:
- inputs:
- dry_run:
- description: 'Skip the publish step (validate only).'
- type: boolean
- default: true
-# Workflow-level permissions are deliberately narrow (least-privilege).
-# Each publish job grants only what it needs at the job level -- per
-# the zizmor ``excessive-permissions`` audit, write scopes at the
-# workflow level apply to every job and to reusable workflows called
-# via ``uses:`` (including ``predeploy.yml``), which is broader than
-# any single job's actual needs.
permissions:
contents: read
-
-# zizmor/concurrency-limits — DO NOT cancel an in-flight release.
-# Concurrent releases against the same tag would race on npm publish
-# anyway; the group key here is purely so two operators can't manually
-# dispatch the workflow twice in the same minute and both hit npm.
-concurrency:
- group: release-${{ github.ref }}
- cancel-in-progress: false
-
-# `dry_run` is only meaningful on workflow_dispatch; tag-pushed
-# releases always publish. Computed once and surfaced to each
-# publish job via `if:` gates below.
-env:
- IS_DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run == true }}
- # Enables npm provenance for every `npm publish` in this workflow
- # (https://docs.npmjs.com/generating-provenance-statements). Vercel
- # pattern -- supersedes --provenance per-command flag so any future
- # publish callsite picks it up automatically.
- NPM_CONFIG_PROVENANCE: 'true'
+ id-token: write
+ packages: write
jobs:
predeploy:
uses: ./.github/workflows/predeploy.yml
- # Audit production dependencies before publishing
- audit:
- name: Security Audit
- needs: predeploy
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- with:
- persist-credentials: false # zizmor/artipacked — read-only checkout
-
- - name: Setup environment
- uses: ./.github/actions/setup
-
- - name: Audit production dependencies
- # BLOCKING: a vulnerability in a prod dep must stop the release
- # (previous `|| true` masked everything). To temporarily bypass,
- # bump the audit-level threshold rather than re-introducing the
- # silent fail.
- run: pnpm audit --prod --audit-level moderate
-
- # Build client once after predeploy passes, share with publish jobs
- build-for-publish:
- name: Build for Publishing
- needs: [predeploy, audit]
- runs-on: ubuntu-latest
- steps:
- - name: Checkout
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- with:
- persist-credentials: false # zizmor/artipacked — read-only checkout
-
- - name: Setup environment
- uses: ./.github/actions/setup
-
- - name: Install and build client
- run: |
- pnpm install --frozen-lockfile
- pnpm --filter react-flow-client run build
-
- - name: Upload built client
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
- with:
- name: client-dist
- path: client/dist
- retention-days: 1
-
publish-npm:
- name: Publish to npm (with provenance)
- needs: build-for-publish
+ name: Publish to npm
+ needs: predeploy
runs-on: ubuntu-latest
- # zizmor/secrets-outside-env — pin ``NPM_TOKEN`` access to the
- # ``npm`` environment so it's only available to runs that pass
- # the environment's protection rules (manual approval / branch
- # restrictions configured on Settings → Environments).
- environment:
- name: npm
- url: https://www.npmjs.com/package/machinaos
- # ``id-token: write`` powers npm provenance (Sigstore-signed
- # publish via OIDC exchange) AND the ``attest-build-provenance``
- # action below; ``contents: read`` for the source-tree
- # checkout. ``NPM_TOKEN`` is read from secrets at the env-var
- # level, so no extra scope.
- permissions:
- contents: read
- id-token: write
steps:
- - name: Checkout
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- with:
- persist-credentials: false # zizmor/artipacked — read-only checkout
-
- - name: Setup Node.js
- # ``cache:`` key intentionally omitted (release-job hardening).
- # A poisoned cache from a previous CI run cannot taint the
- # tarball when caching is disabled outright; zizmor's
- # ``cache-poisoning`` audit requires the input absent, not just
- # set to an empty string.
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
+ - uses: actions/checkout@v4
+ - uses: ./.github/actions/setup
+ - uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'
-
- - name: Download built client
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
- with:
- name: client-dist
- path: client/dist
-
- - name: Install dependencies (skip scripts)
- run: npm install --ignore-scripts
-
- - name: Setup Python
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
- with:
- python-version-file: .python-version
-
- - name: Sync versions from git tag
- run: python -m cli version sync
-
- - name: Verify package contents (and pack for attestation)
- # `npm pack` (without --dry-run) writes the tarball to disk so
- # we can attest it. The tarball name pattern is
- # `<scoped-name-with-dash>-<version>.tgz`, e.g. `machinaos-0.0.72.tgz`.
- run: npm pack
-
- - name: Generate SLSA build provenance for the npm tarball
- # Pattern from gh CLI + uv: attest-build-provenance signs the
- # artifact via the workflow's OIDC token, publishes the
- # attestation to GitHub's transparency log + Sigstore, and
- # links it to the release. Verifiable via
- # `gh attestation verify <tarball> --repo <owner>/<repo>`.
- if: env.IS_DRY_RUN != 'true'
- uses: actions/attest-build-provenance@96b4a1ef7235a096b17240c259729fdd70c83d45 # v2
- with:
- subject-path: '*.tgz'
-
- - name: Publish to npm
- # NPM_CONFIG_PROVENANCE env (top of workflow) enables provenance
- # for `npm publish` -- no per-command flag needed.
- if: env.IS_DRY_RUN != 'true'
- run: npm publish --access public
+ - run: pnpm install --frozen-lockfile
+ - run: pnpm run build
+ - run: python -m cli version sync
+ - run: npm publish --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- - name: Dry-run -- skipping npm publish
- if: env.IS_DRY_RUN == 'true'
- run: echo "::notice::workflow_dispatch dry_run=true -- publish step skipped. Re-run with dry_run=false to publish."
-
publish-github-packages:
name: Publish to GitHub Packages
- needs: build-for-publish
+ needs: predeploy
runs-on: ubuntu-latest
- # ``packages: write`` is the scope ``npm publish`` against
- # npm.pkg.github.com needs; ``contents: read`` for the source-tree
- # checkout. No ``id-token`` because GHCR uses the workflow's
- # default ``GITHUB_TOKEN`` rather than OIDC.
- permissions:
- contents: read
- packages: write
steps:
- - name: Checkout
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- with:
- persist-credentials: false # zizmor/artipacked — read-only checkout
-
- - name: Setup Node.js
- # ``cache:`` key intentionally omitted (release-job hardening
- # -- matches the publish-npm job above; zizmor's
- # ``cache-poisoning`` audit requires the input absent).
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
+ - uses: actions/checkout@v4
+ - uses: ./.github/actions/setup
+ - uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://npm.pkg.github.com'
-
- - name: Download built client
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
- with:
- name: client-dist
- path: client/dist
-
- - name: Install dependencies (skip scripts)
- run: npm install --ignore-scripts
-
- - name: Setup Python
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
- with:
- python-version-file: .python-version
-
- - name: Sync versions from git tag
- run: python -m cli version sync
-
+ - run: pnpm install --frozen-lockfile
+ - run: pnpm run build
+ - run: python -m cli version sync
- name: Configure scoped package
run: |
node -e "
@@ -240,77 +57,6 @@ jobs:
pkg.publishConfig = { registry: 'https://npm.pkg.github.com' };
require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, 2));
"
-
- - name: Publish to GitHub Packages
- if: env.IS_DRY_RUN != 'true'
- run: npm publish
+ - run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-
- - name: Dry-run -- skipping GitHub Packages publish
- if: env.IS_DRY_RUN == 'true'
- run: echo "::notice::workflow_dispatch dry_run=true -- GitHub Packages publish step skipped."
-
- # Publish machinaos-server to PyPI via OIDC trusted publishing.
- # Runs in parallel with the npm publish jobs after the build-for-publish
- # step succeeds. Dry-run propagates from this workflow's input.
- publish-pypi:
- name: Publish to PyPI
- needs: [predeploy, audit]
- # The reusable ``publish-pypi.yml`` workflow declares its own
- # ``id-token: write`` at the job level (the only scope OIDC needs);
- # the caller passes through ``contents: read`` for source checkout.
- permissions:
- contents: read
- id-token: write
- attestations: write
- uses: ./.github/workflows/publish-pypi.yml
- with:
- package_dir: server
- dry_run: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run == true }}
-
- # Create GitHub Release with auto-generated notes
- create-github-release:
- name: Create GitHub Release
- needs: [publish-npm, publish-github-packages, publish-pypi]
- # Skipped during dry-run -- there's no published release to point at
- # and we don't want to leave stale release notes around.
- if: needs.publish-npm.result == 'success' && github.event.inputs.dry_run != 'true'
- runs-on: ubuntu-latest
- # ``contents: write`` is the scope ``gh release create`` needs to
- # publish the release notes back to the repo. No other scope; this
- # job neither pushes commits nor reads secrets.
- permissions:
- contents: write
- steps:
- - name: Checkout
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- with:
- fetch-depth: 0
- persist-credentials: false # zizmor/artipacked — gh release uses GH_TOKEN env, no git push
-
- - name: Extract version from tag
- id: version
- run: echo "version=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
-
- - name: Create GitHub Release
- # ``github.ref_name`` + step output read via env (not direct
- # ``${{ }}`` interpolation) per the zizmor template-injection
- # check -- tag names are user-controllable via push and would
- # otherwise execute attacker-controlled shell inside ``run:``.
- env:
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- REF_NAME: ${{ github.ref_name }}
- VERSION: ${{ steps.version.outputs.version }}
- run: |
- gh release create "${REF_NAME}" \
- --title "MachinaOS ${VERSION}" \
- --generate-notes \
- --verify-tag
-
- # Test user installation after publishing (skipped on dry-run since
- # there's nothing newly published to install).
- test-install:
- needs: [create-github-release]
- if: needs.create-github-release.result == 'success'
- uses: ./.github/workflows/test-install.yml
diff --git a/.github/workflows/rollback.yml b/.github/workflows/rollback.yml
deleted file mode 100644
index cc5a5e93..00000000
--- a/.github/workflows/rollback.yml
+++ /dev/null
@@ -1,221 +0,0 @@
-# Release rollback workflow.
-#
-# Manual `workflow_dispatch`. Given a published version, marks the
-# corresponding npm tarball as deprecated with a stable message and
-# (optionally) opens a revert-the-release-commit PR so subsequent
-# CI can ship a fixed version. Pattern lifted from vercel/vercel +
-# google-gemini/gemini-cli rollback workflows.
-#
-# What this DOESN'T do (deliberate):
-# - It does not delete the npm publication. npm policy disallows
-# un-publishing public packages older than 72 hours; for fresh
-# publications, `npm unpublish` is permitted but breaks every
-# downstream consumer relying on the version. `npm deprecate`
-# is the standard rollback verb -- the install still works for
-# anyone with a lockfile, but new installs surface a warning.
-# - It does not yank from PyPI. PyPI has `pip install` shim for
-# a yank semantic but it requires manual action through the
-# PyPI admin UI -- see https://docs.pypi.org/help/#yanked.
-# - It does not delete the GitHub release. We keep the tag for
-# forensics; rollback adds a stable note to the release body.
-#
-# Inputs (only `version` is required):
-# version — semver tag to roll back, e.g. "v0.0.72"
-# deprecate_msg — message npm shows during install/list. Defaults
-# to a security-conservative template.
-# open_revert_pr — if true, also open a PR reverting the release
-# commit. Default false; usually you want to ship
-# a forward fix.
-
-name: Rollback Release
-
-on:
- workflow_dispatch:
- inputs:
- version:
- description: 'Version to roll back (e.g. v0.0.72).'
- type: string
- required: true
- deprecate_msg:
- description: 'npm deprecation notice shown to installers.'
- type: string
- default: 'This version has been deprecated by the maintainers. Please install the latest version.'
- open_revert_pr:
- description: 'Open a PR reverting the release commit.'
- type: boolean
- default: false
-
-permissions:
- contents: read
-
-# zizmor/concurrency-limits — serialize rollbacks on the same version
-# so two operators can't double-deprecate the same npm tarball or
-# open duplicate revert PRs. ``cancel-in-progress: false`` because
-# rolling back a rollback would leave the registry in an inconsistent
-# state.
-concurrency:
- group: rollback-${{ inputs.version }}
- cancel-in-progress: false
-
-jobs:
- deprecate-npm:
- name: npm deprecate
- runs-on: ubuntu-latest
- # zizmor/secrets-outside-env — share the ``npm`` environment with
- # publish-npm so ``NPM_TOKEN`` is gated by the same protection
- # rules.
- environment:
- name: npm
- url: https://www.npmjs.com/package/machinaos
- # No id-token needed -- this uses NPM_TOKEN, not OIDC, because
- # `npm deprecate` is not in the trusted-publisher allowlist.
- permissions:
- contents: read
- steps:
- - name: Checkout
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- with:
- persist-credentials: false # zizmor/artipacked — read-only checkout
-
- - name: Setup Node.js
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
- with:
- node-version: '22'
- registry-url: 'https://registry.npmjs.org'
- cache: ''
-
- - name: Normalise version
- id: ver
- # `npm deprecate` wants a bare semver (e.g. 0.0.72), not a tag
- # (e.g. v0.0.72). Strip the leading `v` if present. Read input
- # via env to keep zizmor template-injection check happy --
- # ``${{ inputs.X }}`` directly inside ``run:`` lets an attacker
- # who can dispatch the workflow inject shell metacharacters.
- env:
- INPUT_VERSION: ${{ inputs.version }}
- run: |
- v="${INPUT_VERSION#v}"
- echo "semver=${v}" >> "$GITHUB_OUTPUT"
-
- - name: Deprecate on npm (unscoped)
- env:
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- SEMVER: ${{ steps.ver.outputs.semver }}
- DEPRECATE_MSG: ${{ inputs.deprecate_msg }}
- run: |
- npm deprecate "machinaos@${SEMVER}" "${DEPRECATE_MSG}"
-
- - name: Deprecate on GitHub Packages (scoped)
- env:
- NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- SEMVER: ${{ steps.ver.outputs.semver }}
- DEPRECATE_MSG: ${{ inputs.deprecate_msg }}
- run: |
- npm config set @zeenie-ai:registry https://npm.pkg.github.com
- npm deprecate "@zeenie-ai/machinaos@${SEMVER}" "${DEPRECATE_MSG}"
-
- yank-pypi-notice:
- name: PyPI yank reminder
- runs-on: ubuntu-latest
- permissions:
- contents: read
- steps:
- - name: Print PyPI yank instructions
- # PyPI yank is gated on UI access -- no API path that the
- # release token can take. Emit a notice so the operator
- # remembers to do this by hand. Input read via env (not direct
- # ``${{ }}`` interpolation) per the zizmor template-injection
- # check -- ``::notice::`` is rendered into the workflow log
- # and would otherwise execute attacker-controlled shell.
- env:
- INPUT_VERSION: ${{ inputs.version }}
- run: |
- echo "::notice title=Manual PyPI yank required::Yank machinaos-server@${INPUT_VERSION} via https://pypi.org/manage/project/machinaos-server/release/${INPUT_VERSION}/ -- 'Options' -> 'Yank'."
-
- open-revert-pr:
- name: Open revert PR
- needs: deprecate-npm
- if: inputs.open_revert_pr == true
- runs-on: ubuntu-latest
- # ``contents: write`` for ``git push`` of the revert branch;
- # ``pull-requests: write`` for ``gh pr create``. The
- # ``persist-credentials: true`` on the checkout below is
- # intentional and audited by zizmor accordingly.
- permissions:
- contents: write
- pull-requests: write
- steps:
- - name: Checkout
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- with:
- fetch-depth: 0
-
- - name: Resolve release commit
- id: commit
- # The release commit is the one the tag points at. `git
- # rev-list -n1 <tag>` works regardless of whether the tag
- # is annotated or lightweight. Input read via env per the
- # zizmor template-injection check.
- env:
- INPUT_VERSION: ${{ inputs.version }}
- run: |
- sha=$(git rev-list -n1 "${INPUT_VERSION}")
- echo "sha=${sha}" >> "$GITHUB_OUTPUT"
-
- - name: Create revert branch + commit
- env:
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- INPUT_VERSION: ${{ inputs.version }}
- INPUT_DEPRECATE_MSG: ${{ inputs.deprecate_msg }}
- REVERT_SHA: ${{ steps.commit.outputs.sha }}
- run: |
- branch="rollback/${INPUT_VERSION}"
- git config user.name "github-actions[bot]"
- git config user.email "github-actions[bot]@users.noreply.github.com"
- git checkout -b "${branch}"
- git revert --no-edit "${REVERT_SHA}"
- git push origin "${branch}"
-
- gh pr create \
- --base main \
- --head "${branch}" \
- --title "Revert: ${INPUT_VERSION} (rollback)" \
- --body "Automated revert of ${INPUT_VERSION}.
-
- npm package deprecated via rollback.yml.
- PyPI yank pending manual action -- see https://pypi.org/manage/project/machinaos-server/.
-
- Reason: ${INPUT_DEPRECATE_MSG}"
-
- summary:
- name: Rollback summary
- needs: [deprecate-npm, yank-pypi-notice]
- if: always()
- runs-on: ubuntu-latest
- steps:
- - name: Print summary
- # Inputs + job results read via env per the zizmor
- # template-injection check. ``$GITHUB_STEP_SUMMARY`` is markdown
- # rendered in the GitHub UI -- attacker-controlled inputs
- # would otherwise be rendered as raw HTML.
- env:
- INPUT_VERSION: ${{ inputs.version }}
- NPM_DEPRECATE_RESULT: ${{ needs.deprecate-npm.result }}
- YANK_REMINDER_RESULT: ${{ needs.yank-pypi-notice.result }}
- REVERT_PR_STATUS: ${{ inputs.open_revert_pr == true && 'requested' || 'skipped (open_revert_pr=false)' }}
- run: |
- {
- echo "## Rollback summary for ${INPUT_VERSION}"
- echo ""
- echo "| Step | Status |"
- echo "|---|---|"
- echo "| npm deprecate | ${NPM_DEPRECATE_RESULT} |"
- echo "| PyPI yank reminder | ${YANK_REMINDER_RESULT} |"
- echo "| Revert PR | ${REVERT_PR_STATUS} |"
- echo ""
- echo "Next steps:"
- echo ""
- echo "1. Manually yank \`machinaos-server@${INPUT_VERSION}\` from PyPI."
- echo "2. If shipping a forward fix, bump version and re-run release.yml."
- echo "3. If reverting, merge the rollback PR (if requested)."
- } >> "$GITHUB_STEP_SUMMARY"
diff --git a/.github/workflows/test-install.yml b/.github/workflows/test-install.yml
deleted file mode 100644
index a2d6b71b..00000000
--- a/.github/workflows/test-install.yml
+++ /dev/null
@@ -1,265 +0,0 @@
-# Test user installation scenarios
-# Runs on: manual trigger, after release publish
-
-name: Test Install
-
-on:
- workflow_dispatch:
- workflow_call:
-
-permissions:
- contents: read
-
-# zizmor/concurrency-limits — coalesce in-flight test-install runs
-# against the same ref (and the workflow_call invocation from
-# release.yml). Latest run wins.
-concurrency:
- group: test-install-${{ github.ref }}
- cancel-in-progress: true
-
-jobs:
- # Test npm install from registry (post-release)
- test-npm-install:
- name: npm install (${{ matrix.os }})
- runs-on: ${{ matrix.os }}
- strategy:
- fail-fast: false
- matrix:
- os: [ubuntu-latest, macos-latest, windows-latest]
- steps:
- - name: Checkout
- # Required so .python-version is on disk for setup-python below.
- # The actual MachinaOS install under test comes from npm / a
- # separate git clone -- this checkout is only used to source
- # the toolchain version file (single source of truth).
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- with:
- persist-credentials: false # zizmor/artipacked — read-only checkout
-
- - name: Setup pnpm
- uses: pnpm/action-setup@f40ffcd9367d9f12939873eb1018b921a783ffaa # v4
- with:
- version: 9
-
- - name: Setup Node.js
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
- with:
- node-version: '22'
-
- - name: Setup Python
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
- with:
- python-version-file: .python-version
-
- - name: Install uv
- run: pip install uv
-
- - name: Install machinaos from npm
- run: npm install -g machinaos
-
- - name: Verify installation
- shell: bash
- run: |
- machina --help
- machina --version
-
- - name: Check edgymeow binary
- shell: bash
- run: |
- INSTALL_PATH=$(npm root -g)/machinaos
- echo "Install path: $INSTALL_PATH"
- ls -la "$INSTALL_PATH/node_modules/edgymeow/bin/" || echo "edgymeow bin/ not found"
-
- - name: Setup Python venv
- shell: bash
- run: |
- INSTALL_PATH=$(npm root -g)/machinaos
- cd "$INSTALL_PATH/server"
- uv venv
- uv sync
-
- - name: Test start (Unix)
- if: runner.os != 'Windows'
- shell: bash
- run: |
- machina start &
- PID=$!
-
- for i in {1..15}; do
- if curl -sf http://localhost:3010/health > /dev/null 2>&1; then
- echo "Backend healthy after $((i*2))s"
- break
- fi
- sleep 2
- done
-
- if kill -0 $PID 2>/dev/null; then
- echo "machina start: OK"
- machina stop || kill $PID 2>/dev/null || true
- else
- echo "machina start: FAILED"
- exit 1
- fi
-
- - name: Test start (Windows)
- if: runner.os == 'Windows'
- shell: pwsh
- run: |
- $job = Start-Job -ScriptBlock { machina start }
- Start-Sleep -Seconds 15
-
- try {
- $response = Invoke-WebRequest -Uri "http://localhost:3010/health" -UseBasicParsing -TimeoutSec 5
- Write-Host "Backend healthy: $($response.StatusCode)"
- } catch {
- Write-Host "Backend not responding"
- }
-
- if ($job.State -eq "Running") {
- Write-Host "machina start: OK"
- Stop-Job $job
- Remove-Job $job
- } else {
- Write-Host "machina start: FAILED"
- Receive-Job $job
- exit 1
- }
-
- # Test git clone + pnpm run build (source contributor path)
- test-git-clone:
- name: git clone + build (${{ matrix.os }})
- runs-on: ${{ matrix.os }}
- strategy:
- fail-fast: false
- matrix:
- os: [ubuntu-latest, macos-latest, windows-latest]
- steps:
- - name: Checkout
- # Required so .python-version is on disk for setup-python below.
- # The actual MachinaOS install under test comes from npm / a
- # separate git clone -- this checkout is only used to source
- # the toolchain version file (single source of truth).
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
- with:
- persist-credentials: false # zizmor/artipacked — read-only checkout
-
- - name: Setup pnpm
- uses: pnpm/action-setup@f40ffcd9367d9f12939873eb1018b921a783ffaa # v4
- with:
- version: 9
-
- - name: Setup Node.js
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
- with:
- node-version: '22'
-
- - name: Setup Python
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
- with:
- python-version-file: .python-version
-
- - name: Install uv
- run: pip install uv
-
- - name: Clone repository
- run: git clone https://github.com/zeenie-ai/MachinaOS.git
-
- - name: Build
- shell: bash
- working-directory: MachinaOS
- run: |
- # Retry up to 3 times for transient GitHub CDN failures (HTTP 502)
- for i in 1 2 3; do
- pnpm run build && break
- echo "Attempt $i failed, retrying in 10s..."
- sleep 10
- done
-
- - name: Check edgymeow binary
- shell: bash
- working-directory: MachinaOS
- run: |
- ls -la node_modules/.pnpm/edgymeow@*/node_modules/edgymeow/bin/ || echo "edgymeow bin/ not found"
-
- - name: Test start (Unix)
- if: runner.os != 'Windows'
- shell: bash
- working-directory: MachinaOS
- run: |
- pnpm run start &
- PID=$!
-
- for i in {1..15}; do
- if curl -sf http://localhost:3010/health > /dev/null 2>&1; then
- echo "Backend healthy after $((i*2))s"
- break
- fi
- sleep 2
- done
-
- if kill -0 $PID 2>/dev/null; then
- echo "pnpm run start: OK"
- pnpm run stop || kill $PID 2>/dev/null || true
- else
- echo "pnpm run start: FAILED"
- exit 1
- fi
-
- - name: Test start (Windows)
- if: runner.os == 'Windows'
- shell: pwsh
- working-directory: MachinaOS
- run: |
- $job = Start-Job -ScriptBlock {
- Set-Location $using:PWD
- pnpm run start
- }
- Start-Sleep -Seconds 15
-
- try {
- $response = Invoke-WebRequest -Uri "http://localhost:3010/health" -UseBasicParsing -TimeoutSec 5
- Write-Host "Backend healthy: $($response.StatusCode)"
- } catch {
- Write-Host "Backend not responding"
- }
-
- if ($job.State -eq "Running") {
- Write-Host "pnpm run start: OK"
- Stop-Job $job
- Remove-Job $job
- } else {
- Write-Host "pnpm run start: FAILED"
- Receive-Job $job
- exit 1
- }
-
- # Test install.sh script (Linux/macOS)
- test-install-script-unix:
- name: install.sh (${{ matrix.os }})
- runs-on: ${{ matrix.os }}
- strategy:
- fail-fast: false
- matrix:
- os: [ubuntu-latest, macos-latest]
- steps:
- - name: Run install script
- run: curl -fsSL https://raw.githubusercontent.com/zeenie-ai/MachinaOS/main/install.sh | bash
-
- - name: Verify installation
- run: |
- machina --help
- machina --version
-
- # Test install.ps1 script (Windows)
- test-install-script-windows:
- name: install.ps1 (windows)
- runs-on: windows-latest
- steps:
- - name: Run install script
- shell: pwsh
- run: iwr -useb https://raw.githubusercontent.com/zeenie-ai/MachinaOS/main/install.ps1 | iex
-
- - name: Verify installation
- run: |
- machina --help
- machina --version
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
deleted file mode 100644
index b747d7fc..00000000
--- a/.pre-commit-config.yaml
+++ /dev/null
@@ -1,56 +0,0 @@
-# pre-commit hooks — Python (ruff-format) + workflow validation (actionlint).
-#
-# Install once with: pre-commit install
-# Run on all files: pre-commit run --all-files
-#
-# Scope is deliberately narrow: only validators (yaml/toml/json shape,
-# merge-conflict markers, oversized files, private keys, workflow
-# schema) plus ruff-format. The frontend ``prettier`` / ``eslint``
-# hooks and the ``ruff check`` lint pass were dropped because they
-# produced multi-hundred-file format diffs against an already-shipped
-# tree -- the team runs ``pnpm --filter react-flow-client run lint``
-# in ``predeploy.yml`` for the real lint gate, and ``ruff check`` is
-# available ad hoc.
-#
-# Likewise the stdlib ``end-of-file-fixer`` / ``trailing-whitespace``
-# hooks are off: they flag editor artefacts uniformly across vendored
-# SVG / JSON / .env files and the noise outweighs the signal.
-
-default_install_hook_types:
- - pre-commit
- - commit-msg
-
-default_stages: [pre-commit]
-
-repos:
- # ---------------------------------------------------------------- validators
- - repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v5.0.0
- hooks:
- - id: check-yaml
- args: ['--allow-multiple-documents']
- - id: check-toml
- - id: check-json
- # Workflow JSON exports keep wide whitespace + trailing comma
- # tolerance for the React Flow round-trip. Validators against
- # strict JSON have flagged them historically; the schema
- # validator inside ``services.workflow_import`` is the real
- # gate.
- exclude: '^\.machina/workflows/.*\.json$'
- - id: check-merge-conflict
- - id: check-added-large-files
- args: ['--maxkb=500']
- - id: detect-private-key
-
- # ---------------------------------------------------------------- Python: ruff-format
- - repo: https://github.com/astral-sh/ruff-pre-commit
- rev: v0.8.4
- hooks:
- - id: ruff-format
- types_or: [python, pyi]
-
- # ---------------------------------------------------------------- Workflows: actionlint
- - repo: https://github.com/rhysd/actionlint
- rev: v1.7.4
- hooks:
- - id: actionlint