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
14 changes: 14 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ jobs:
node: ${{ steps.groups.outputs.node }}
eval: ${{ steps.groups.outputs.eval }}
execution: ${{ steps.groups.outputs.execution }}
debug: ${{ steps.groups.outputs.debug }}
web: ${{ steps.groups.outputs.web }}
scripts: ${{ steps.groups.outputs.scripts }}
macos_scripts: ${{ steps.groups.outputs.macos_scripts }}
Expand Down Expand Up @@ -357,6 +358,19 @@ jobs:
echo "Workspace tests: DIM_TEST_JOBS=$test_jobs --test-threads=$test_threads"
DIM_TEST_JOBS="$test_jobs" node scripts/run-rust-test.mjs target/test-artifacts.jsonl --workspace "--test-threads=$test_threads"
cargo test --workspace --doc --locked ${{ needs.changes.outputs.eval == 'true' && '--features xtask/eval-tests' || '' }}
- name: Verify debug-only CLI tests
if: needs.changes.outputs.debug == 'true'
shell: bash
env:
DIM_TEST_TIMEOUT_MS: "600000"
run: |
set -euo pipefail
cargo clippy --locked -p dimcode --all-targets --features dev-tests -- -D warnings
cargo build --locked -p dimcode --features dev-tests --test cli_daemon_flow --test cli_flow --message-format=json > target/debug-test-artifacts.jsonl
node scripts/run-rust-test.mjs target/debug-test-artifacts.jsonl cli_daemon_flow daemon_startup_progress --test-threads=2
node scripts/run-rust-test.mjs target/debug-test-artifacts.jsonl cli_daemon_flow daemon_replace::build_identity --test-threads=2
node scripts/run-rust-test.mjs target/debug-test-artifacts.jsonl cli_flow staged_update::recovery --test-threads=2
node scripts/run-rust-test.mjs target/debug-test-artifacts.jsonl cli_flow staged_update::tui_update --test-threads=2
- 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
Expand Down
3 changes: 3 additions & 0 deletions crates/dimcode/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ path = "tests/ui_leaf.rs"
[features]
# Compile the Web workspace into the executable (dim-app-server's feature).
embedded-web = ["dim-app-server/embedded-web"]
# Debug-build acceptances that a release binary cannot run. CI enables this
# only for the paths that own them; ordinary workspace tests leave them out.
dev-tests = []

[dependencies]
dim-cli = { path = "../dim-cli" }
Expand Down
1 change: 1 addition & 0 deletions crates/dimcode/tests/cli_daemon_flow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ mod catalog;
mod context;
#[path = "cli_flow/daemon_replace.rs"]
mod daemon_replace;
#[cfg(feature = "dev-tests")]
#[path = "cli_flow/daemon_startup_progress.rs"]
mod daemon_startup_progress;
#[path = "cli_flow/migration.rs"]
Expand Down
2 changes: 1 addition & 1 deletion crates/dimcode/tests/cli_flow/daemon_replace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ fn the_daemon_notice_never_reaches_json_stdout() {
/// with one notice and no shutdown, whether or not it is idle, and a matching
/// stamp says nothing. `DIM_TEST_BUILD_ID` is a debug-build stand-in for the
/// stamp a distributable build embeds, so this is a debug-build check.
#[cfg(debug_assertions)]
#[cfg(all(debug_assertions, feature = "dev-tests"))]
mod build_identity {
use super::*;

Expand Down
18 changes: 15 additions & 3 deletions crates/dimcode/tests/cli_flow/staged_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,11 @@ fn an_interrupted_check_ends_every_process_it_started() {
);
}

#[cfg(all(debug_assertions, any(target_os = "macos", target_os = "linux")))]
#[cfg(all(
debug_assertions,
feature = "dev-tests",
any(target_os = "macos", target_os = "linux")
))]
fn target_platform() -> Option<&'static str> {
match (std::env::consts::OS, std::env::consts::ARCH) {
("macos", "aarch64") => Some("darwin-arm64"),
Expand All @@ -915,7 +919,11 @@ fn target_platform() -> Option<&'static str> {
/// Startup recovery when the store format is newer than this daemon. Uses the
/// debug-only `DIM_TEST_RELEASE_BUILD=1` override so these flows run against
/// the already-compiled debug binary without recompiling the workspace.
#[cfg(all(debug_assertions, any(target_os = "macos", target_os = "linux")))]
#[cfg(all(
debug_assertions,
feature = "dev-tests",
any(target_os = "macos", target_os = "linux")
))]
mod recovery {
use super::*;

Expand Down Expand Up @@ -1274,7 +1282,11 @@ mod recovery {
/// `Update now` in the terminal UI. Uses the debug-only
/// `DIM_TEST_RELEASE_BUILD=1` override so these flows run against the
/// already-compiled debug binary without recompiling the workspace.
#[cfg(all(debug_assertions, any(target_os = "macos", target_os = "linux")))]
#[cfg(all(
debug_assertions,
feature = "dev-tests",
any(target_os = "macos", target_os = "linux")
))]
mod tui_update {
use super::*;

Expand Down
11 changes: 10 additions & 1 deletion docs/architecture/build.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,16 @@ 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, 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.
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. Debug-build CLI acceptances are also opt-in. Run all 39 with:

```sh
cargo test --locked -p dimcode --features dev-tests --test cli_daemon_flow daemon_startup_progress
cargo test --locked -p dimcode --features dev-tests --test cli_daemon_flow daemon_replace::build_identity
cargo test --locked -p dimcode --features dev-tests --test cli_flow staged_update::recovery
cargo test --locked -p dimcode --features dev-tests --test cli_flow staged_update::tui_update
```

Ordinary workspace tests compile without `dev-tests`; CI selects the dedicated step for changes to those owning test files and to the production paths that implement the behaviors they assert: `dim-cli/src/client.rs`, `dim-cli/src/lib.rs`, `dim-cli/src/update.rs`, `dim-cli/src/update/staged.rs`, `dim-cli/src/plugins.rs`, `dim-cli/src/session_host.rs`, `dim-cli/src/ui/`, `dim-agent-capabilities/src/build.rs`, `dim-app-server/src/cli.rs`, `dim-app-server/src/transport.rs`, `dim-app-server/src/storage/sqlite.rs` and `dimcode/src/main.rs`. The owning test files, `dimcode/tests/support/cli_harness.rs`, `dimcode/tests/support/daemon.rs` and `dimcode/Cargo.toml` also select it. 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
16 changes: 10 additions & 6 deletions docs/architecture/tui-e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -429,12 +429,16 @@ component and protocol tests do not already cover.
CI keeps:

- Ordinary workspace tests: the `dim-cli` component render and keyboard tests,
`dim-app-server` protocol and transport flows, the 422 non-TUI `cli_flow*`
cases (`--no-tui`, `exec`, piped prompts, ACP, `staged_update::recovery::`,
and the scripted daemon flows), and the 287 TUI cases #1810 still tracks
(including the 6 `staged_update::tui_update::` cases, which use the debug-only
`DIM_TEST_RELEASE_BUILD=1` override instead of a separate release-stamped
build step).
`dim-app-server` protocol and transport flows, the 389 non-TUI `cli_flow*`
cases (`--no-tui`, `exec`, piped prompts, ACP, and the scripted daemon flows),
and the 281 TUI cases #1810 still tracks.
- The dedicated `dev-tests` step: the 7 `staged_update::recovery::`, 6
`staged_update::tui_update::`, 6 `daemon_replace::build_identity::` and 20
`daemon_startup_progress::` cases. It runs when their owning test files or
the production paths they protect change. The `tui_update` cases use the
debug-only `DIM_TEST_RELEASE_BUILD=1` override instead of a separate
release-stamped build step. When the dedicated step is selected, the two
runs together keep the original 422 non-TUI and 287 TUI `cli_flow*` cases.
- The explicit `cli_flow` step that names the 12 `--ignored` production and
line-mode flows one by one: the production App Server, the account and
permission presets, the real-owner MCP/hooks/workflow writes, and the
Expand Down
2 changes: 1 addition & 1 deletion docs/release/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ release packages use the ordinary Cargo executable.

`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 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 run the lightweight `static-checks` job (`xtask-check`) on Linux x64 without compiling business runtime crates. Plugin pages select 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`. Windows storage, host-platform, named-pipe and worktree-removal paths (`crates/dim-agent-capabilities/src/file_storage*`, `crates/dim-agent-capabilities/src/host_platform*`, `crates/dim-app-server/src/lib.rs`, `transport.rs`, `pipe_client.rs`, `cli.rs`, `worktrees.rs` and the test files that hold those flows, including `worktree_removal_flow.rs`) also run its Windows-native boundary step, which `main` pushes that select the job, scheduled sweeps and manual dispatch execute as well. 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.
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 run the lightweight `static-checks` job (`xtask-check`) on Linux x64 without compiling business runtime crates. Plugin pages select 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`. Windows storage, host-platform, named-pipe and worktree-removal paths (`crates/dim-agent-capabilities/src/file_storage*`, `crates/dim-agent-capabilities/src/host_platform*`, `crates/dim-app-server/src/lib.rs`, `transport.rs`, `pipe_client.rs`, `cli.rs`, `worktrees.rs` and the test files that hold those flows, including `worktree_removal_flow.rs`) also run its Windows-native boundary step, which `main` pushes that select the job, scheduled sweeps and manual dispatch execute as well. Evaluation tests use `xtask/eval-tests` for `xtask/` changes, debug-build CLI acceptances use `dimcode`'s `dev-tests` feature for their owning test files, 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.

Expand Down
16 changes: 14 additions & 2 deletions scripts/ci-changes.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {execFileSync,spawnSync} from 'node:child_process';
import {appendFileSync} from 'node:fs';

export const groups=['rust','windows','windows_native','static','xtask','node','eval','execution','web','scripts','macos_scripts','dependencies'];
export const groups=['rust','windows','windows_native','static','xtask','node','eval','execution','debug','web','scripts','macos_scripts','dependencies'];
const everything=Object.fromEntries(groups.map(group=>[group,true]));
const documentation=/^docs\/|^[^/]+\.md$/;
const cargoManifest=/(?:^|\/)Cargo\.toml$/;
Expand Down Expand Up @@ -50,12 +50,24 @@ const rules=[
[/^scripts\/(stage-release|pack-release|native-binary|store-formats|release\.test)\.mjs$/,['scripts','macos_scripts']],
[/^scripts\//,['scripts']],
[/^docker\//,['scripts']],
// The startup, replacement and update paths these acceptances protect.
[/^crates\/dim-cli\/src\/(?:client\.rs|update(?:\.rs|\/))/,['rust','windows','debug']],
[/^crates\/dim-cli\/src\/(?:lib\.rs|plugins\.rs|session_host(?:\.rs|\/)|ui\/)/,['rust','windows','debug']],
[/^crates\/dim-cli\//,['rust','windows']],
[/^crates\/dim-client\//,['rust','windows','node']],
[/^crates\/dim-agent-types\//,['rust','windows','node']],
// Debug-build acceptances (#2218) leave ordinary workspace tests. The owning
// test files and the production paths they protect select the dedicated step.
[/^crates\/dimcode\/tests\/(?:cli_flow|cli_daemon_flow)\.rs$/,['rust','debug']],
[/^crates\/dimcode\/tests\/cli_flow\/(?:daemon_startup_progress|daemon_replace|staged_update)\.rs$/,['rust','debug']],
[/^crates\/dimcode\/tests\/support\/(?:cli_harness|daemon)\.rs$/,['rust','node','debug']],
[/^crates\/dimcode\/(?:Cargo\.toml|src\/main\.rs)$/,['rust','debug']],
[/^crates\/dimcode\//,['rust']],
[/^crates\/dim-agent-capabilities\/src\/build\.rs$/,['rust','node','debug']],
[/^crates\/dim-app-server\/src\/transport\.rs$/,['rust','node','debug']],
[/^crates\/dim-app-server\/src\/protocol\.rs$/,['rust','node','web','scripts']],
[/^crates\/dim-app-server\/src\/storage\/sqlite\.rs$/,['rust','node','scripts','macos_scripts']],
[/^crates\/dim-app-server\/src\/storage\/sqlite\.rs$/,['rust','node','scripts','macos_scripts','debug']],
[/^crates\/dim-app-server\/src\/cli\.rs$/,['rust','node','debug']],
[/^crates\/dim-app-server\/resources\//,['rust','node','scripts']],
[/^crates\/dim-agent-capabilities\/src\/(workspace_tools\/(background|exec)|host_platform)/,['rust','node','execution']],
[/^tests\/integration\/tests\/(local_execution|local_support|minimal_execution)/,['rust','node','execution']],
Expand Down
Loading