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
55 changes: 37 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: PR check
on:
workflow_dispatch:
schedule:
# Daily full cross-platform sweep (ADR 026 D5).
- cron: '0 19 * * *'
push:
branches: [main]
pull_request:
Expand All @@ -18,7 +21,7 @@ jobs:
# Self-hosted runners keep state between jobs, so they run only code from branches of this
# repository; fork pull requests skip every job and fail ci-ok. See docs/release/README.md.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
runs-on: self-hosted
runs-on: [self-hosted, linux, x64]
timeout-minutes: 5
outputs:
rust: ${{ steps.groups.outputs.rust }}
Expand Down Expand Up @@ -54,7 +57,7 @@ jobs:
run: node scripts/adr-check.mjs --base HEAD^1
dependencies:
needs: changes
if: needs.changes.outputs.rust == 'true' || needs.changes.outputs.dependencies == 'true'
if: needs.changes.outputs.dependencies == 'true'
runs-on: [self-hosted, windows, x64]
timeout-minutes: 15
env:
Expand Down Expand Up @@ -191,11 +194,33 @@ jobs:
run: npm.cmd run check:boundary --prefix web --workspace=@dimcode/chat-ui
- name: Build the chat-ui package
run: npm.cmd run build --prefix web --workspace=@dimcode/chat-ui
scripts:
needs: changes
if: needs.changes.outputs.scripts == 'true'
runs-on: [self-hosted, linux, x64]
timeout-minutes: 15
env:
CARGO_INCREMENTAL: "0"
RUSTC_WRAPPER: ""
steps:
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
- uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version-file: .node-version
package-manager-cache: false
- uses: actions-rust-lang/setup-rust-toolchain@c8ff772090ab9d00f7f7bd7b388f3c3032282e3b
with:
cache: false
build-warnings: ""
- name: Test development and release scripts
run: |
node --check scripts/check-acp-registry.mjs
node --test scripts/*.test.mjs
verify:
needs: changes
if: >-
needs.changes.outputs.rust == 'true' || needs.changes.outputs.xtask == 'true' ||
needs.changes.outputs.scripts == 'true'
if: needs.changes.outputs.rust == 'true' || needs.changes.outputs.xtask == 'true'
name: verify (${{ matrix.platform }})
strategy:
fail-fast: false
Expand Down Expand Up @@ -289,22 +314,17 @@ jobs:
- name: Verify wall-clock background handoff
if: needs.changes.outputs.execution == 'true'
run: node scripts/run-rust-test.mjs target/test-artifacts.jsonl integration_flow local_execution::a_long_foreground_command_moves_to_the_background_after_30_seconds --ignored --exact
- name: Test development and release scripts
if: needs.changes.outputs.scripts == 'true'
run: |
node --check scripts/check-acp-registry.mjs
node --test scripts/*.test.mjs
- name: Verify actual CLI profiles and line-mode flows
if: needs.changes.outputs.rust == 'true'
shell: bash
run: |
set -euo pipefail
npm ci --prefix runtime --ignore-scripts --registry=https://registry.npmjs.org
npm ci --prefix runtime --ignore-scripts --no-audit --no-fund --registry=https://registry.npmjs.org
# The ignored CLI flows below start the real plugins, so their
# packages are installed here, before the flows; the job's checkout
# carries them into the Node binding checks as well.
npm ci --prefix runtime/plugins/workflow --ignore-scripts --registry=https://registry.npmjs.org
(cd runtime && npm install --no-save --ignore-scripts --install-links ./plugins/workflow)
npm ci --prefix runtime/plugins/workflow --ignore-scripts --no-audit --no-fund --registry=https://registry.npmjs.org
(cd runtime && npm install --no-save --ignore-scripts --no-audit --no-fund --install-links ./plugins/workflow)
export DIM_TEST_APP_SERVER="$PWD/target/debug/dim-app-server"
# The TUI cases a tmux scenario replaces are ignored in the test
# target and run only in the local tmux suite
Expand Down Expand Up @@ -347,7 +367,6 @@ jobs:
if [[ "$RUNNER_OS" == Linux ]]; then node_threads=4; fi
node scripts/run-rust-test.mjs target/test-artifacts.jsonl transport_flow node_ --ignored --test-threads="$node_threads"
node scripts/run-rust-test.mjs target/test-artifacts.jsonl app_server_flow mcp_http_flow::node_ --ignored --test-threads="$node_threads"
node scripts/run-rust-test.mjs target/test-artifacts.jsonl migration_flow node_ --ignored --test-threads="$node_threads"
node scripts/run-rust-test.mjs target/test-artifacts.jsonl hub_flow node_ --ignored --test-threads="$node_threads"
if [[ '${{ needs.changes.outputs.eval }}' == true ]]; then
node scripts/run-rust-test.mjs target/test-artifacts.jsonl xtask node_ --ignored --test-threads="$node_threads"
Expand Down Expand Up @@ -384,7 +403,7 @@ jobs:
run: node scripts/run-rust-test.mjs target/test-artifacts.jsonl transport_flow runtime_manager::runtime_switches_from_system_to_downloaded_node --ignored --exact
macos-native:
needs: changes
if: github.event_name == 'pull_request' && (needs.changes.outputs.rust == 'true' || needs.changes.outputs.macos_scripts == 'true')
if: (github.event_name == 'pull_request' && needs.changes.outputs.rust == 'true') || needs.changes.outputs.macos_scripts == 'true'
runs-on: [self-hosted, macOS, ARM64]
timeout-minutes: 30
env:
Expand All @@ -401,7 +420,7 @@ jobs:
node-version-file: .node-version
package-manager-cache: false
- name: Test macOS native Rust flows
if: needs.changes.outputs.rust == 'true'
if: github.event_name == 'pull_request' && needs.changes.outputs.rust == 'true'
run: node scripts/test-macos-native.mjs
- name: Test macOS code layout and release packaging
if: needs.changes.outputs.macos_scripts == 'true'
Expand Down Expand Up @@ -463,9 +482,9 @@ jobs:
retention-days: 1
ci-ok:
# The one check to require: it passes when every selected job passed and skipped jobs were not needed.
needs: [changes, dependencies, static-checks, windows-cli, web, verify, macos-native, acp-registry]
needs: [changes, dependencies, static-checks, windows-cli, web, scripts, verify, macos-native, acp-registry]
if: always()
runs-on: self-hosted
runs-on: [self-hosted, linux, x64]
timeout-minutes: 5
steps:
# A skipped changes job means a fork pull request, which this workflow does not verify.
Expand Down
2 changes: 1 addition & 1 deletion docs/architecture/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ Each runner's OS/libc baseline must be recorded and verified before declaring th

Public Node provider and MCP interoperability fixtures use development dependencies declared in `runtime/package.json`. Install them with `npm ci --prefix runtime --ignore-scripts`; distribution staging uses `--omit=dev` and does not ship those SDKs.

Evaluation-tool tests are opt-in: `cargo test --locked -p xtask --features eval-tests`. CI enables them for `xtask/` changes, main pushes and manual runs. The real 30-second background handoff is also opt-in locally: `cargo test --locked -p dim-agent-integration-tests --test integration_flow local_execution::a_long_foreground_command_moves_to_the_background_after_30_seconds -- --ignored --exact`; CI runs it for execution-related paths, main pushes and manual runs. Ordinary workspace tests retain execution cancellation, cleanup and recovery flows.
Evaluation-tool tests are opt-in: `cargo test --locked -p xtask --features eval-tests`. CI enables them for `xtask/` changes, main pushes, scheduled sweeps and manual runs. The real 30-second background handoff is also opt-in locally: `cargo test --locked -p dim-agent-integration-tests --test integration_flow local_execution::a_long_foreground_command_moves_to_the_background_after_30_seconds -- --ignored --exact`; CI runs it for execution-related paths, main pushes, scheduled sweeps and manual runs. Ordinary workspace tests retain execution cancellation, cleanup and recovery flows.

`npm run build --prefix web` type-checks and bundles the frontend. Run its component and projection flows separately with `npm test --prefix web`.

Expand Down
19 changes: 10 additions & 9 deletions docs/release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ The Ubuntu preflight generates the Rust distribution notices once with the pinne

The separate PR workflow uses self-hosted macOS ARM64, Windows x64, and Linux x64 runners. Register self-hosted runners with the [OS and architecture labels](https://docs.github.com/en/actions/how-tos/manage-runners/self-hosted-runners/use-in-a-workflow). A Linux x64 runner that carries workspace verification also has the `dim-verify` label and bubblewrap installed. Keep PR runner credentials and private networks isolated as required by the [CI trust model](#ci-trust-model).

The platform-independent `changes` and `ci-ok` jobs can run on any eligible self-hosted runner.
The platform-independent `changes`, `scripts`, and `ci-ok` jobs are pinned to self-hosted Linux x64 runners so they do not claim macOS or Windows slots.

## GitHub workflows

Expand Down Expand Up @@ -178,13 +178,13 @@ failure stops packaging. An explicitly requested historical tag that predates
the builder uses its original Cargo build. Linux arm64, macOS and Windows
release packages use the ordinary Cargo executable.

`ci.yml` runs on pull requests, pushes to `main`, and manual dispatch. A pull request runs the groups its changed paths need, as decided by `scripts/ci-changes.mjs`. A push to `main` runs only `changes` and `ci-ok` when its entire push range changes only documentation paths that select no check group. Architecture pages checked by `xtask` and the native storage format document retain the full main run, as do mixed pushes and pushes whose base cannot be compared. Manual dispatch selects every group. Every push to `main` runs its selected jobs to completion: a later push does not cancel them, so each merge has its own result and the `main CI` badge in the [README](../../README.md) reports the latest finished one.
`ci.yml` runs on pull requests, pushes to `main`, a daily scheduled full sweep (`0 19 * * *` UTC), and manual dispatch. A pull request runs the groups its changed paths need, as decided by `scripts/ci-changes.mjs`. A push to `main` runs only `changes` and `ci-ok` when its entire push range changes only paths that select no check group (documentation and non-code repository metadata); pushes touching any checked path or whose base cannot be compared keep the full `main` run while the daily scheduled sweep is established (ADR 026 D5). Scheduled sweeps and manual dispatch select every group across both Linux and macOS: if a scheduled sweep fails on a cross-group regression, the maintainers triage it and bisect the `main` commit range since the previous passing sweep back to the regressing merge. Every push to `main` runs its selected jobs to completion: a later push does not cancel them, so each merge has its own result and the `main CI` badge in the [README](../../README.md) reports the latest finished one.

CI builds the workspace, checks formatting and Clippy, runs workspace tests and boundary checks, runs the packaging/development script tests, and exercises the ignored actual CLI profile and public Node-backed flows. `ci-ok` passes when every selected gating job passes, so it is the check to require. CI builds without debug info (`CARGO_PROFILE_DEV_DEBUG=0`). The [build environment](../architecture/build.md) describes test artifact reuse, concurrency limits, and target deadlines. Cargo runs documentation tests with the same features, and ignored CLI and Node flows reuse the recorded binaries without package-scoped recompilation. Web source changes, plugin pages and static generated graphs run the lightweight `static-checks` job (`xtask-check`) on Linux x64 without compiling business runtime crates, while `catalog.md` changes retain the runtime-assembled `xtask` check. Node-backed checks run for runtime, binding and service-contract paths, and CLI-only changes retain their ordinary and actual-profile flows. Evaluation tests use `xtask/eval-tests` for `xtask/` changes, and the wall-clock handoff runs for execution-related changes. PRs run `verify (linux)` for the selected groups. Rust changes also run `macos-native` on Apple Silicon, and changes affecting native packaging or code layout select its macOS script checks. Both jobs feed `ci-ok`. Full `main` pushes run `verify (macos)`, and manual dispatch runs full verification on both Linux and macOS. The `web` job runs on self-hosted Windows x64. It stages the frontend package, verifies generated declarations and bundled dependency notices, and runs the Web tests.
CI builds the workspace, checks formatting and Clippy, runs workspace tests and boundary checks, runs the packaging/development script tests in a dedicated Linux x64 `scripts` job, and exercises the ignored actual CLI profile and public Node-backed flows. `ci-ok` passes when every selected gating job passes, so it is the check to require. CI builds without debug info (`CARGO_PROFILE_DEV_DEBUG=0`). The [build environment](../architecture/build.md) describes test artifact reuse, concurrency limits, and target deadlines. Cargo runs documentation tests with the same features, and ignored CLI and Node flows reuse the recorded binaries without package-scoped recompilation. Web source changes, plugin pages and static generated graphs run the lightweight `static-checks` job (`xtask-check`) on Linux x64 without compiling business runtime crates, while `catalog.md` changes retain the runtime-assembled `xtask` check; from `scripts/`, `scripts/stage-web.mjs` and `scripts/run-rust-test.mjs` select the `web` job (the latter deliberately selects every group), while Rust files read directly by packaging scripts (`crates/dim-app-server/src/protocol.rs`, `crates/dim-app-server/src/storage/sqlite.rs`, and `crates/dim-app-server/resources/`) retain their owning packaging checks. Node-backed checks run for runtime, binding and service-contract paths, and CLI-only changes retain their ordinary and actual-profile flows. Windows client transport and CLI terminal crates (`crates/dim-cli/`, `crates/dim-client/`, `crates/dim-agent-types/`, `vendor/grok-build/`) trigger `windows-cli`. Evaluation tests use `xtask/eval-tests` for `xtask/` changes, and the wall-clock handoff runs for execution-related changes. PRs run `verify (linux)` for the selected Rust/`xtask` groups. Rust PRs also run `macos-native` on Apple Silicon, and changes affecting native packaging or code layout select its macOS script checks on PRs, `main` pushes, scheduled sweeps and manual runs. All selected jobs feed `ci-ok`. Full `main` pushes run `verify (macos)`, and scheduled sweeps and manual dispatch run full verification on both Linux and macOS. The `web` job runs on self-hosted Windows x64. It stages the frontend package, verifies generated declarations and bundled dependency notices, and runs the Web tests.

The `Verify Python plugins` step is off by default. When a Python plugin ships, set the repository Actions variable `DIM_CI_PYTHON_PLUGINS` to `true` to run it whenever the Node check group is selected. It prepares CPython for the `python_plugin_` flows and reuses the App Server test binary from the workspace build. See the [App Server verification commands](../../crates/dim-app-server/README.md#verification) to run the suites locally.

The `Verify downloaded Node runtime` step runs on full `main` push checks and manual dispatch. It switches a running system Node to the official downloaded archive and reuses the same App Server test binary. The public Node bindings check uses the installed interpreter.
The `Verify downloaded Node runtime` step runs on full `main` push checks, scheduled full sweeps, and manual dispatch. It switches a running system Node to the official downloaded archive and reuses the same App Server test binary. The public Node bindings check uses the installed interpreter.

### Action pins and updates

Expand All @@ -200,7 +200,7 @@ The release script suite rejects external Action references that are not full co

### ACP Registry checks

The `acp-registry` job runs on the trusted Linux x64 runner for full `main` push checks and manual CI runs. It installs the toolchain from `rust-toolchain.toml`, compiles `dimcode` with both OAuth client ID secrets and executes the unmodified upstream Registry authentication checker and unauthenticated protocol matrix, pinned to the revision in `ci.yml`. Missing secrets, authentication failures, skipped authentication checks or failed advertised protocol methods fail `ci-ok`. Pull requests use the ordinary Gateway/helper flow tests without client IDs.
The `acp-registry` job runs on the trusted Linux x64 runner for `main` pushes that select `rust` or `scripts`, scheduled sweeps, and manual CI runs. It installs the toolchain from `rust-toolchain.toml`, compiles `dimcode` with both OAuth client ID secrets and executes the unmodified upstream Registry authentication checker and unauthenticated protocol matrix, pinned to the revision in `ci.yml`. Missing secrets, authentication failures, skipped authentication checks or failed advertised protocol methods fail `ci-ok`. Pull requests use the ordinary Gateway/helper flow tests without client IDs.

`scripts/check-acp-registry.mjs EXECUTABLE REGISTRY_CHECKOUT REPORT_DIRECTORY` also runs locally with uv and tar available. It uses Python 3.14.2 with no added Python packages, makes a temporary binary manifest with the executable's actual version, disables browser launch to exercise terminal capability negotiation, and stops its isolated daemon on exit. Reports retain upstream/source provenance and the auth/matrix results for one day; the executable and account home are never uploaded. Update the pinned upstream revision only after running the same check against the candidate revision.

Expand All @@ -215,10 +215,11 @@ The `dependencies` job uses the `cargo-deny` version pinned in
cargo deny --locked check advisories licenses
```

Install that same tool version to run the check locally. The job runs for Rust
check groups and dependency-policy changes; `deny.toml` or root `LICENSE` edits
alone do not trigger workspace compilation. Pushes to `main` and manual CI runs
also scan. Its failure or cancellation fails the existing `ci-ok` check.
Install that same tool version to run the check locally. The job runs when
Cargo manifests, `Cargo.lock`, `deny.toml` or root `LICENSE` change;
`deny.toml` or root `LICENSE` edits alone do not trigger workspace compilation.
Full `main` pushes, daily scheduled sweeps and manual CI runs also scan. Its
failure or cancellation fails the existing `ci-ok` check.

[`deny.toml`](../../deny.toml) owns the policy. It enables all workspace features
and includes development dependencies, unpublished workspace members and all
Expand Down
Loading