Skip to content
Merged
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
41 changes: 34 additions & 7 deletions .agents/skills/manage-ci/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,45 @@ skill and the inventory in the same change.

## Testing MeshLLM against a Skippy change

Lint and the Rust tests always use the Skippy crates.io release pinned in `Cargo.toml`.
The smoke job can use another one:
Lint, all three OS Rust test jobs, the website CLI generator and Linux smoke
use the same Skippy revision.
By default it is the crates.io release in `Cargo.toml`/`Cargo.lock`, with
the matching runtime source commit in `scripts/skippy-pin.sh`. For test-only
cross-repository work, select another one:

- In a pull request, add a line `Skippy-Ref: pull/123` (or a branch, tag or
full commit SHA) to the description. Editing the description starts a run.
- From the Actions page, run `ci.yml` with the `skippy_ref` input.

`scripts/ci-resolve-skippy.sh` turns the ref into a repository and commit. A
branch or pull request is resolved once per run, so re-run the workflow after
a new Skippy push. A named ref is always built fresh and never written to the
runtime cache that pinned runs read. Running the workflow on `main` with a
Skippy ref means you trust that code.
The selection job parses the directive with `scripts/ci-skippy-ref.sh` and
resolves it once with `scripts/ci-resolve-skippy.sh`. For an override,
`ci-pin-skippy.sh` temporarily replaces the manifest's Skippy registry dependencies
with exact Git revisions (dropping the old release version constraints). Cargo
resolves one lockfile. The exact manifest/lockfile artifact is shared by lint,
tests, website and smoke, which still use `--locked`. Do not commit these
temporary CI files. Only smoke
builds the native CPU runtime, from that same SHA. The macOS/Windows CPU
install smokes are skipped for overrides because they need published packages;
they must pass in the fresh pinned run before merging. Ordinary runs download the
pinned release runtime and use the committed manifest and lockfile unchanged.

A branch or PR is resolved once per run; start a fresh full run after a new
Skippy push. A failed-jobs rerun can reuse the previous selection and artifact;
it does not select a new branch head. If its short-lived artifact has expired,
start a full run. Running on `main` with a Skippy ref means you trust that code.

**An override run is never merge-ready.** The existing required `PR / Quality`,
`PR / Linux`, `PR / macOS`, `PR / Windows` and `PR / Website` checks fail while
an override was selected, without stopping the test jobs. They also read the
current PR description before passing, rejecting a directive added while an
older pinned run was finishing. Blank or duplicate directives fail closed.

Before merging, land the Skippy change, update Mesh's committed pin/lockfile
to the intended supported revision/release as needed, remove the directive,
and wait for a fresh full pinned run to pass. Removing the directive cannot
turn an old override run green. Do not merge using stale checks while an edited
description's run is queued, and do not bypass the required checks. These are
CI merge checks, not an atomic server-side rule on PR-description contents.

## Validation

Expand Down
40 changes: 25 additions & 15 deletions .agents/skills/manage-ci/references/current-inventory.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,39 @@ runners.

| Job | Runner | Command |
|---|---|---|
| Lint | `ubuntu-24.04` | `just lint` |
| Select Skippy revision | `ubuntu-24.04` | Parse/resolve once; share temporary manifest/lockfile for overrides |
| Lint | `ubuntu-24.04` | `just lint --locked` |
| Test | `ubuntu-24.04`, `macos-15`, `windows-2022` | `just test-rust --locked --no-fail-fast` |
| Console | `ubuntu-24.04` | `just test-ui` |
| Public website | `ubuntu-24.04` | `scripts/ci-website.sh` |
| Inference smoke (CPU) | `ubuntu-24.04` | `scripts/ci-resolve-skippy.sh`, `scripts/fetch-skippy-runtime.sh` (pinned release) or `scripts/ci-skippy-runtime.sh` (named ref), `just mesh`, `just smoke`, `just test-with-runtime` |
| CPU host smoke | `macos-15`, `windows-2022` | `just mesh`, `scripts/ci-cpu-host-smoke.py` (published CPU runtime) |
| Inference smoke (CPU) | `ubuntu-24.04` | Download release runtime or `scripts/ci-skippy-runtime.sh`; `just mesh`, `just smoke`, `just test-with-runtime --locked` |
| CPU host smoke | `macos-15`, `windows-2022` | Pinned runs only: `just mesh`, `scripts/ci-cpu-host-smoke.py` (published CPU runtime) |
| PR / Quality, Linux, macOS, Windows, Website | `ubuntu-24.04` | All seven prerequisite jobs succeeded, selected pin (no override), and current PR description has no override |

`just lint` is `cargo fmt --all -- --check`, Clippy on the workspace with
warnings denied, ShellCheck on `scripts/*.sh`, `scripts/tests/*.sh` and
`mesh/scripts/*.sh`, and the script tests in `scripts/tests/`.

The smoke job downloads the pinned release's CPU runtime, a pinned test model,
and checks the model SHA-256. A named Skippy ref instead checks source out under
`.deps/skippy` and builds its CPU runtime. The model is cached; the compiler
cache is sccache's GitHub backend.
The macOS and Windows CPU smokes always use the pinned release, including when
the Linux smoke tests a named Skippy ref. They exercise MeshLLM's runtime
install and serving boundary with one request.

The workflow has `contents: read` and uses no secret or variable. A pull
request cancels its own earlier run.
All five required PR checks include the CPU host smoke matrix as well as the
existing jobs.
For overrides, the selection job freezes a Git SHA plus a temporary root
`Cargo.toml` and `Cargo.lock` in a three-day artifact. Lint, all OS tests,
the website CLI generator and Linux smoke download that exact artifact ID
and retain `--locked`. Ordinary runs use the committed files. Only override smoke checks out `.deps/skippy` and
builds a CPU runtime; ordinary smoke downloads the pinned release runtime.
The test model is SHA-256 checked and cached. Compiler caching uses sccache's
GitHub backend; override runtimes are not placed in a shared runtime cache.

The workflow has `contents: read`; the required-check job also has
`pull-requests: read` to check the current description using `GITHUB_TOKEN`.
It uses no configured secret or variable. A PR cancels its earlier run.
The existing five `PR / ...` names remain the required checks; they deliberately
fail for test-only overrides even when all tests pass. No ruleset change is
needed for repositories already requiring those five names.

The macOS and Windows CPU install/serving smokes run only against the pinned
release: an arbitrary source revision has no published packages to install.
Override runs skip that matrix rather than compile hosts against a different
Skippy revision. All five required PR checks still require it, and the public
website job, to pass in the fresh pinned run before merging.

## `release.yml` jobs

Expand Down
3 changes: 2 additions & 1 deletion .github/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ The workflows are plain. Keep them that way.
where it can be run locally, not in workflow YAML.
- Skippy is built, tested and released in its own repository. Do not add Skippy
builds, GPU runtimes or Skippy tests here. CPU smokes use the pinned release;
only the Linux smoke builds a named Skippy ref from source.
only the Linux smoke builds a named Skippy ref from source. Test-only overrides
skip the macOS/Windows package-install smokes; fresh pinned CI must pass them.
- Pin every action to a full commit SHA. Run `actionlint` before pushing.
170 changes: 122 additions & 48 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,55 @@ env:
MODEL_SHA256: c4a3dd037301b6ecea31d6da37f5cd793ead920dd5ddfe6d589294628d6ce66a

jobs:
skippy:
name: Select Skippy revision
runs-on: ubuntu-24.04
timeout-minutes: 15
outputs:
repository: ${{ steps.skippy.outputs.repository }}
sha: ${{ steps.skippy.outputs.sha }}
override: ${{ steps.skippy.outputs.override }}
artifact: ${{ steps.inputs.outputs.artifact-id }}
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
with:
persist-credentials: false
- name: Resolve the Skippy commit once for every Rust job
id: skippy
env:
INPUT_REF: ${{ inputs.skippy_ref }}
PR_BODY: ${{ github.event.pull_request.body }}
run: |
ref="${INPUT_REF:-$(scripts/ci-skippy-ref.sh)}"
scripts/ci-resolve-skippy.sh "$ref" | tee -a "$GITHUB_OUTPUT"
if [[ -n "$ref" ]]; then
echo 'override=true' >> "$GITHUB_OUTPUT"
else
echo 'override=false' >> "$GITHUB_OUTPUT"
fi
- uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable 2026-08-20
if: steps.skippy.outputs.override == 'true'
- name: Resolve the temporary manifest and lockfile once
if: steps.skippy.outputs.override == 'true'
env:
SKIPPY_SHA: ${{ steps.skippy.outputs.sha }}
RUSTC_WRAPPER: ""
run: |
scripts/ci-pin-skippy.sh "$SKIPPY_SHA"
cargo metadata --format-version 1 > /dev/null
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
id: inputs
if: steps.skippy.outputs.override == 'true'
with:
name: skippy-inputs-${{ github.run_attempt }}
path: |
Cargo.toml
Cargo.lock
retention-days: 3
if-no-files-found: error

lint:
needs: skippy
name: Lint
runs-on: ubuntu-24.04
timeout-minutes: 30
Expand All @@ -37,9 +85,21 @@ jobs:
with:
persist-credentials: false
- uses: ./.github/actions/setup
- run: just lint
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
if: needs.skippy.outputs.override == 'true'
with:
artifact-ids: ${{ needs.skippy.outputs.artifact }}
merge-multiple: true
- name: Record the selected Skippy revision
shell: bash
env:
SKIPPY_SHA: ${{ needs.skippy.outputs.sha }}
SKIPPY_REPOSITORY: ${{ needs.skippy.outputs.repository }}
run: echo "Skippy source = $SKIPPY_REPOSITORY@$SKIPPY_SHA" | tee -a "$GITHUB_STEP_SUMMARY"
- run: just lint --locked

test:
needs: skippy
name: Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 60
Expand All @@ -52,6 +112,17 @@ jobs:
with:
persist-credentials: false
- uses: ./.github/actions/setup
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
if: needs.skippy.outputs.override == 'true'
with:
artifact-ids: ${{ needs.skippy.outputs.artifact }}
merge-multiple: true
- name: Record the selected Skippy revision
shell: bash
env:
SKIPPY_SHA: ${{ needs.skippy.outputs.sha }}
SKIPPY_REPOSITORY: ${{ needs.skippy.outputs.repository }}
run: echo "Skippy source = $SKIPPY_REPOSITORY@$SKIPPY_SHA" | tee -a "$GITHUB_STEP_SUMMARY"
- run: just test-rust --locked --no-fail-fast

ui:
Expand All @@ -72,6 +143,7 @@ jobs:
- run: just test-ui

website:
needs: skippy
name: Public website
runs-on: ubuntu-24.04
timeout-minutes: 30
Expand All @@ -80,26 +152,20 @@ jobs:
with:
persist-credentials: false
- uses: ./.github/actions/setup
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
if: needs.skippy.outputs.override == 'true'
with:
artifact-ids: ${{ needs.skippy.outputs.artifact }}
merge-multiple: true
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 24.20.0
- run: scripts/ci-website.sh

# Real inference through MeshLLM on Skippy's CPU runtime.
#
# By default this uses the Skippy crates.io release pinned in Cargo.toml. To test a
# MeshLLM pull request against a Skippy branch or pull request, add a line
# to the pull request description:
#
# Skippy-Ref: pull/123
#
# This job then builds the runtime and MeshLLM from that Skippy source. Lint
# and the Rust tests still use the pinned crates. With no such line the
# runtime is the one the pinned Skippy release published. Either way the
# runtime comes from the same commit this job compiles MeshLLM against. A branch or pull
# request is resolved once per run: after a new Skippy push, re-run this
# workflow, or name a full commit SHA.
# Override builds use the same frozen Cargo inputs as lint and tests.
# Only smoke builds a native CPU runtime; ordinary runs download the release.
smoke:
needs: skippy
name: Inference smoke (CPU)
runs-on: ubuntu-24.04
timeout-minutes: 60
Expand All @@ -108,45 +174,39 @@ jobs:
with:
persist-credentials: false
- uses: ./.github/actions/setup

- name: Resolve the Skippy commit
id: skippy
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
if: needs.skippy.outputs.override == 'true'
with:
artifact-ids: ${{ needs.skippy.outputs.artifact }}
merge-multiple: true
- name: Record the selected Skippy revision
shell: bash
env:
INPUT_REF: ${{ inputs.skippy_ref }}
PR_BODY: ${{ github.event.pull_request.body }}
run: |
ref="$INPUT_REF"
if [[ -z "$ref" ]]; then
ref="$(sed -n 's/^Skippy-Ref:[[:space:]]*\([^[:space:]]*\).*/\1/p' <<<"$PR_BODY" | head -1)"
fi
scripts/ci-resolve-skippy.sh "$ref" | tee -a "$GITHUB_OUTPUT"
echo "override=${ref:+true}" >> "$GITHUB_OUTPUT"
SKIPPY_SHA: ${{ needs.skippy.outputs.sha }}
SKIPPY_REPOSITORY: ${{ needs.skippy.outputs.repository }}
run: echo "Skippy source = $SKIPPY_REPOSITORY@$SKIPPY_SHA" | tee -a "$GITHUB_STEP_SUMMARY"

# The pinned Skippy release publishes the runtime; a named ref has
# none, so it is built here from that ref's source. Dispatching this
# workflow on main with a Skippy ref means you trust that code.
- name: Download the CPU runtime of the pinned Skippy release
if: steps.skippy.outputs.override != 'true'
if: needs.skippy.outputs.override != 'true'
run: scripts/fetch-skippy-runtime.sh skippy-runtime cpu

- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
if: steps.skippy.outputs.override == 'true'
if: needs.skippy.outputs.override == 'true'
with:
repository: ${{ steps.skippy.outputs.repository }}
ref: ${{ steps.skippy.outputs.sha }}
repository: ${{ needs.skippy.outputs.repository }}
ref: ${{ needs.skippy.outputs.sha }}
path: .deps/skippy
persist-credentials: false

- name: Build the CPU runtime from the named Skippy source
if: steps.skippy.outputs.override == 'true'
if: needs.skippy.outputs.override == 'true'
env:
SKIPPY_SHA: ${{ steps.skippy.outputs.sha }}
SKIPPY_SHA: ${{ needs.skippy.outputs.sha }}
run: scripts/ci-skippy-runtime.sh .deps/skippy "$SKIPPY_SHA" skippy-runtime

- name: Build MeshLLM against the named Skippy source
if: steps.skippy.outputs.override == 'true'
run: scripts/skippy-source.sh .deps/skippy

- name: Restore the test model
id: model
uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5.1.0
Expand Down Expand Up @@ -178,14 +238,14 @@ jobs:
run: scripts/ci-two-node-client-serving-smoke.sh target/debug/mesh-llm target/debug smoke-model.gguf

- name: Run the tests that need a runtime
run: just test-with-runtime skippy-runtime
run: just test-with-runtime skippy-runtime --locked

- name: Record what was tested
if: always()
env:
SKIPPY_REPOSITORY: ${{ steps.skippy.outputs.repository }}
SKIPPY_SHA: ${{ steps.skippy.outputs.sha }}
OVERRIDE: ${{ steps.skippy.outputs.override }}
SKIPPY_REPOSITORY: ${{ needs.skippy.outputs.repository }}
SKIPPY_SHA: ${{ needs.skippy.outputs.sha }}
OVERRIDE: ${{ needs.skippy.outputs.override }}
run: |
{
echo "Skippy source: $SKIPPY_REPOSITORY@$SKIPPY_SHA"
Expand All @@ -198,6 +258,10 @@ jobs:
# Exercise the MeshLLM host/runtime boundary with Skippy's published CPU
# package on the other desktop platforms. Skippy qualifies its own backend.
cpu_smoke_platforms:
needs: skippy
# An arbitrary source ref has no published CPU packages for these platforms.
# These install-boundary checks remain mandatory in fresh pinned CI.
if: needs.skippy.outputs.override == 'false'
name: CPU host smoke (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 60
Expand Down Expand Up @@ -236,21 +300,31 @@ jobs:
run: ${{ matrix.python }} scripts/ci-cpu-host-smoke.py ${{ matrix.binary }} smoke-model.gguf

# The merge rule for main requires these five check names, which the old
# per-platform workflows used to report. Each one passes only when every
# job above passed. If the rule is changed to name the jobs above, delete
# this job.
# per-platform workflows used to report. Keep the test-only override guard
# required as well as successful tests if those required names ever change.
required:
permissions:
contents: read
pull-requests: read
name: PR / ${{ matrix.lane }}
if: ${{ always() && github.event_name == 'pull_request' }}
needs: [lint, test, ui, website, smoke, cpu_smoke_platforms]
needs: [skippy, lint, test, ui, website, smoke, cpu_smoke_platforms]
runs-on: ubuntu-24.04
timeout-minutes: 5
strategy:
matrix:
lane: [Quality, Linux, macOS, Windows, Website]
steps:
- env:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5.1.0
with:
persist-credentials: false
- name: Require successful pinned CI and no current override
env:
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ github.event.pull_request.number }}
OVERRIDE: ${{ needs.skippy.outputs.override }}
RESULTS: ${{ join(needs.*.result, ' ') }}
run: |
echo "lint, test, ui, website, smoke, CPU host smokes: $RESULTS"
[[ "$RESULTS" == "success success success success success success" ]]
PR_BODY="$(gh api "repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER" --jq '.body // ""')"
export PR_BODY
scripts/ci-skippy-ref.sh --merge-ready
2 changes: 2 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Always use `just`. Never build manually. Bare `just` (or `just build`) downloads

To build against a local Skippy checkout instead of the pinned release, run `scripts/skippy-source.sh <checkout>`, or `scripts/skippy-source.sh --ref <branch|tag|commit|pull/N> [repository-url]` to have it fetched; `scripts/skippy-source.sh --pinned` goes back. The override is `.cargo/skippy-local.toml`, which is not committed. A checkout at another version temporarily changes `Cargo.toml`; do not commit it or the `Cargo.lock` it produces.

For CI cross-repository testing, put `Skippy-Ref: <branch|tag|full-SHA|pull/N>` in the PR description. All Rust checks use that revision, but it is **test-only**: required merge checks stay red until the directive is removed and fresh CI passes against the committed pin. See `.agents/skills/manage-ci/SKILL.md` before using or changing this flow.

### Distribution builds

Packagers build MeshLLM from source in a clean environment and install them as system packages. Keep that possible:
Expand Down
Loading
Loading