From 5e20ef2ac46df8a38daa9b9cd447f2ab6fc09c16 Mon Sep 17 00:00:00 2001 From: eric8810 Date: Fri, 20 Nov 2026 17:35:38 +0800 Subject: [PATCH 1/3] ci: tighten path routing, isolate scripts job, add daily sweep, and remove dead step Tighten CI routing and workflow topology per ADR 026 D4/D5: - Classify `.agents/**`, `skills/**`, `.github/ISSUE_TEMPLATE/**`, and `.github/pull_request_template.md` explicitly in `scripts/ci-changes.mjs` so non-code repository metadata runs no build/test groups (on both pull requests and `main` pushes). - Trigger `dependencies` (`cargo-deny`) only when Cargo manifests (`Cargo.toml` / `**/Cargo.toml`), `Cargo.lock`, `deny.toml`, or `LICENSE` change (plus full `main` pushes, scheduled sweeps and manual runs) instead of every Rust edit. - Move `scripts` tests into a dedicated `[self-hosted, linux, x64]` job, limit `scripts/` -> `web` routing to `scripts/stage-web.mjs`, keep `macos-native` running macOS script checks whenever `macos_scripts` is selected, and route Windows client/terminal crates (`crates/dim-client/`, `vendor/grok-build/`) to `windows` and Rust sources read by packaging scripts (`crates/dim-app-server/src/protocol.rs`, `storage/sqlite.rs`, `resources/`) to their owning packaging groups. - Pin `changes` and `ci-ok` to `[self-hosted, linux, x64]`. - Add the daily scheduled full cross-platform sweep (`0 19 * * *` UTC across Linux and macOS) while keeping code pushes on `main` full until the sweep is verified active per ADR 026 D5. - Remove the 0-test `migration_flow node_` invocation from `Verify public Node bindings` and add `--no-audit --no-fund` to the runtime `npm ci`/`npm install` commands in `Verify actual CLI profiles and line-mode flows`. Refs #1931 --- .github/workflows/ci.yml | 55 +++++++++++++++++++++++++------------ docs/architecture/build.md | 2 +- docs/release/README.md | 17 ++++++------ scripts/ci-changes.mjs | 22 +++++++++++---- scripts/ci-changes.test.mjs | 50 ++++++++++++++++++++++++++++----- 5 files changed, 107 insertions(+), 39 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3501a8b6b1..f9534f7788 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: @@ -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 }} @@ -53,7 +56,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: @@ -138,11 +141,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 @@ -207,22 +232,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 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 @@ -268,7 +288,6 @@ jobs: export DIM_TEST_RUTIS_SDK="$PWD/runtime/node_modules/@arcships/rutis/src/index.mjs" node scripts/run-rust-test.mjs target/test-artifacts.jsonl transport_flow node_ --ignored --test-threads=2 node scripts/run-rust-test.mjs target/test-artifacts.jsonl mcp_http_flow node_ --ignored --test-threads=2 - node scripts/run-rust-test.mjs target/test-artifacts.jsonl migration_flow node_ --ignored --test-threads=2 node scripts/run-rust-test.mjs target/test-artifacts.jsonl hub_flow node_ --ignored --test-threads=2 if [[ '${{ needs.changes.outputs.eval }}' == true ]]; then node scripts/run-rust-test.mjs target/test-artifacts.jsonl xtask node_ --ignored --test-threads=2 @@ -305,7 +324,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: @@ -322,7 +341,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' @@ -384,9 +403,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, windows-cli, web, verify, macos-native, acp-registry] + needs: [changes, dependencies, 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. diff --git a/docs/architecture/build.md b/docs/architecture/build.md index 54530aa497..f73029d4c2 100644 --- a/docs/architecture/build.md +++ b/docs/architecture/build.md @@ -345,7 +345,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 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, full `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 local_execution a_long_foreground_command_moves_to_the_background_after_30_seconds -- --ignored --exact`; CI runs it for execution-related paths, full `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`. diff --git a/docs/release/README.md b/docs/release/README.md index 6413c43644..526c2bdac3 100644 --- a/docs/release/README.md +++ b/docs/release/README.md @@ -143,7 +143,7 @@ The Ubuntu preflight generates the Rust distribution notices once with cargo-abo 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 @@ -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 also run the `xtask` check, which reads them for branch id literals. 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 also run the `xtask` check, which reads them for branch id literals; from `scripts/`, only `scripts/stage-web.mjs` triggers the `web` job, 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. Both 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 @@ -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 diff --git a/scripts/ci-changes.mjs b/scripts/ci-changes.mjs index fc6a4b54f0..3208b6fb85 100644 --- a/scripts/ci-changes.mjs +++ b/scripts/ci-changes.mjs @@ -4,9 +4,11 @@ import {appendFileSync} from 'node:fs'; export const groups=['rust','windows','xtask','node','eval','execution','web','scripts','macos_scripts','dependencies']; const everything=Object.fromEntries(groups.map(group=>[group,true])); const documentation=/^docs\/|^[^/]+\.md$/; +const cargoManifest=/(?:^|\/)Cargo\.toml$/; const rules=[ [/^benchmarks\/baselines\/[^/]+\.json$/,[]], + [/^\.agents\/|^skills\/|^\.github\/(?:ISSUE_TEMPLATE\/|pull_request_template\.md$|PULL_REQUEST_TEMPLATE\.md$)/,[]], [/^docs\/architecture\/rust-agent\/(plugins|generated)\//,['xtask']], [/^docs\/design\/appserver\/native-storage-format\.md$/,['rust']], // The ADR check runs in the changes job; docs alone need no build group. @@ -16,16 +18,22 @@ const rules=[ [/^web\/src\/.*\.(ts|vue|mjs|js)$/,['web','xtask']], [/^web\//,['web']], [/^scripts\/run-rust-test\.mjs$/,groups], - [/^scripts\/test-macos-native(?:\.test)?\.mjs$/,['rust','scripts','web']], - [/^scripts\/(code-layout\/|code-layout-darwin\.test\.mjs$)/,['scripts','web','macos_scripts']], - [/^scripts\/(stage-release|pack-release|native-binary|store-formats|release\.test)\.mjs$/,['scripts','web','macos_scripts']], - [/^scripts\//,['scripts','web']], + [/^scripts\/test-macos-native(?:\.test)?\.mjs$/,['rust','scripts']], + [/^scripts\/stage-web\.mjs$/,['scripts','web']], + [/^scripts\/(code-layout\/|code-layout-darwin\.test\.mjs$)/,['scripts','macos_scripts']], + [/^scripts\/(stage-release|pack-release|native-binary|store-formats|release\.test)\.mjs$/,['scripts','macos_scripts']], + [/^scripts\//,['scripts']], [/^docker\//,['scripts']], [/^crates\/dim-cli\//,['rust','windows']], + [/^crates\/dim-client\//,['rust','windows','node']], [/^crates\/dim-agent-types\//,['rust','windows','node']], [/^crates\/dimcode\//,['rust']], + [/^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\/resources\//,['rust','node','scripts']], [/^crates\/dim-agent-capabilities\/src\/(background_exec|workspace_tools\/exec|host_platform)/,['rust','node','execution']], [/^tests\/integration\/tests\/(local_execution|local_support|minimal_execution)/,['rust','node','execution']], + [/^vendor\/grok-build\//,['rust','windows','node']], [/^xtask\//,['rust','node','eval']], [/^(crates|tests|vendor|runtime|npm)\//,['rust','node']], ]; @@ -35,6 +43,7 @@ export function classify(files) { for (const file of files) { const rule=rules.find(([pattern])=>pattern.test(file)); for (const group of rule?rule[1]:groups) needed.add(group); + if (cargoManifest.test(file)) needed.add('dependencies'); } return Object.fromEntries(groups.map(group=>[group,needed.has(group)])); } @@ -57,8 +66,11 @@ if (import.meta.main) { execFileSync('git',['fetch','--no-tags','--depth=1','origin',base],{stdio:'pipe',timeout:30_000}); } const files=changedFiles(base); - if (files.length && files.every(file=>documentation.test(file))) { + if (files.length) { + console.log(JSON.stringify(files)); const selected=classify(files); + // Stage ADR 026 D5 rollout: skip main pushes that select no check + // group, and keep code pushes full until the daily sweep is verified. if (!Object.values(selected).includes(true)) result=selected; } } catch { diff --git a/scripts/ci-changes.test.mjs b/scripts/ci-changes.test.mjs index 9bdbecadc9..7e4c7bf929 100644 --- a/scripts/ci-changes.test.mjs +++ b/scripts/ci-changes.test.mjs @@ -25,10 +25,17 @@ const runSelector=(cwd,event,before='')=>{ })); }; -test('documentation-only changes need no build group',()=>{ +test('documentation and non-code repository metadata need no build group',()=>{ assert.deepEqual(classify(['docs/adr/006-plugin-contract.md','docs/zh/INDEX.md']),only()); assert.deepEqual(classify(['README.md','AGENTS.md']),only()); assert.deepEqual(classify(['benchmarks/baselines/result.json']),only()); + assert.deepEqual(classify([ + '.agents/skills/dim-release/SKILL.md', + 'skills/dim-alpha-release/SKILL.md', + '.github/ISSUE_TEMPLATE/bug.yml', + '.github/pull_request_template.md', + '.github/PULL_REQUEST_TEMPLATE.md', + ]),only()); }); test('documents that code reads keep their checks',()=>{ @@ -41,25 +48,36 @@ test('Web sources that xtask reads keep its check',()=>{ assert.deepEqual(classify([file]),only('web','xtask'),file); }); -test('dependency policy changes select the scan without compiling the workspace',()=>{ +test('dependency checks follow Cargo manifests, lockfile and policy files',()=>{ assert.deepEqual(classify(['deny.toml','LICENSE']),only('dependencies')); + assert.deepEqual(classify(['crates/dim-cli/Cargo.toml']),only('rust','windows','dependencies')); + assert.deepEqual(classify(['crates/dim-app-server/Cargo.toml']),only('rust','node','dependencies')); + assert.deepEqual(classify(['xtask/Cargo.toml']),only('rust','node','eval','dependencies')); + assert.deepEqual(classify(['Cargo.toml']),only(...groups)); + assert.deepEqual(classify(['Cargo.lock']),only(...groups)); }); test('source areas select their groups',()=>{ assert.deepEqual(classify(['web/package.json','web/src/styles/base.css']),only('web')); assert.deepEqual(classify(['web/src/features/chat/quote-cases.json']),only('web','rust','windows')); assert.deepEqual(classify(['scripts/stage-web.mjs']),only('scripts','web')); + assert.deepEqual(classify(['scripts/check-acp-registry.mjs']),only('scripts')); assert.deepEqual(classify(['docker/Dockerfile']),only('scripts')); assert.deepEqual(classify(['crates/dim-app-server/src/lib.rs','runtime/fixtures/session-part.json']),only('rust','node')); + assert.deepEqual(classify(['crates/dim-app-server/src/protocol.rs']),only('rust','node','web','scripts')); + assert.deepEqual(classify(['crates/dim-app-server/src/storage/sqlite.rs']),only('rust','node','scripts','macos_scripts')); + assert.deepEqual(classify(['crates/dim-app-server/resources/default-catalog.json']),only('rust','node','scripts')); assert.deepEqual(classify(['crates/dim-cli/src/main.rs']),only('rust','windows')); + assert.deepEqual(classify(['crates/dim-client/src/lib.rs']),only('rust','windows','node')); + assert.deepEqual(classify(['vendor/grok-build/xai-ratatui-textarea/src/lib.rs']),only('rust','windows','node')); assert.deepEqual(classify(['docs/notes.md','crates/dim-cli/src/notes.rs']),only('rust','windows')); }); test('native macOS CI follows its runner, packaging and Mach-O layout sources',()=>{ - assert.deepEqual(classify(['scripts/test-macos-native.mjs']),only('rust','scripts','web')); + assert.deepEqual(classify(['scripts/test-macos-native.mjs']),only('rust','scripts')); for (const name of ['release.test.mjs','stage-release.mjs','pack-release.mjs','native-binary.mjs','store-formats.mjs', 'code-layout-darwin.test.mjs','code-layout/macho.py','code-layout/link_capture.rs']) { - assert.deepEqual(classify([`scripts/${name}`]),only('scripts','web','macos_scripts'),name); + assert.deepEqual(classify([`scripts/${name}`]),only('scripts','macos_scripts'),name); } }); @@ -76,7 +94,7 @@ test('bridge, evaluation and wall-clock flows follow their owning paths',()=>{ }); test('workspace, toolchain, workflow and unknown paths run everything',()=>{ - for (const file of ['Cargo.lock','rust-toolchain.toml','.github/workflows/ci.yml','.node-version','dev','skills/x/SKILL.md','benchmarks/runner/main.py']) + for (const file of ['Cargo.lock','rust-toolchain.toml','.github/workflows/ci.yml','.node-version','dev','benchmarks/runner/main.py']) assert.deepEqual(classify([file]),only(...groups),file); }); @@ -121,15 +139,33 @@ test('main push checks use the whole push range in a shallow checkout',{skip:!ha assert.notEqual(spawnSync('git',['cat-file','-e',docsBase],{cwd:checkout}).status,0); assert.deepEqual(runSelector(checkout,'push',docsBase),only(),'a docs-only range skips all build groups'); - assert.deepEqual(runSelector(checkout,'push',initial),only(...groups),'an earlier code commit keeps the full run'); + assert.deepEqual(runSelector(checkout,'push',initial),only(...groups),'an earlier root Cargo.toml commit keeps the full run'); assert.deepEqual(runSelector(checkout,'push','f'.repeat(40)),only(...groups),'an unavailable base keeps the full run'); + assert.deepEqual(runSelector(checkout,'schedule',docsBase),only(...groups),'scheduled sweeps stay full'); assert.deepEqual(runSelector(checkout,'workflow_dispatch',docsBase),only(...groups),'manual runs stay full'); const head=git(checkout,'rev-parse','HEAD').trim(); + const skills=path.join(checkout,'.agents/skills/demo'); + mkdirSync(skills,{recursive:true}); + writeFileSync(path.join(skills,'SKILL.md'),'# Demo skill\n'); + git(checkout,'add','-A'); + git(checkout,'commit','-q','-m','skill doc'); + assert.deepEqual(runSelector(checkout,'push',head),only(),'non-code metadata pushes skip all build groups'); + + const generatedBase=git(checkout,'rev-parse','HEAD').trim(); const generated=path.join(checkout,'docs/architecture/rust-agent/generated'); mkdirSync(generated,{recursive:true}); writeFileSync(path.join(generated,'catalog.md'),'# Catalog\n'); git(checkout,'add','-A'); git(checkout,'commit','-q','-m','generated architecture'); - assert.deepEqual(runSelector(checkout,'push',head),only(...groups),'architecture documents keep the full main run'); + assert.deepEqual(runSelector(checkout,'push',generatedBase),only(...groups),'checked architecture documents keep the full main run'); + + const clientBase=git(checkout,'rev-parse','HEAD').trim(); + mkdirSync(path.join(checkout,'crates/dim-client/src'),{recursive:true}); + writeFileSync(path.join(checkout,'crates/dim-client/src/lib.rs'),'pub fn connect() {}\n'); + git(checkout,'add','-A'); + git(checkout,'commit','-q','-m','windows client transport'); + const clientPush=runSelector(checkout,'push',clientBase); + assert.equal(clientPush.windows,true,'a push changing crates/dim-client/src/lib.rs keeps Windows verification'); + assert.deepEqual(clientPush,only(...groups),'code pushes keep the full main run until the scheduled sweep is verified'); }); From ba8b3f334e479f40bf33261be2841f996e9e6acf Mon Sep 17 00:00:00 2001 From: eric8810 Date: Sat, 21 Nov 2026 08:40:36 +0800 Subject: [PATCH 2/3] ci: keep the checks for documents that code reads Route docs/architecture/tui-e2e.md to scripts and docs/design/plugins/EventHub.md to rust, and name scheduled sweeps in the acp-registry paragraph. --- docs/release/README.md | 2 +- scripts/ci-changes.mjs | 4 ++++ scripts/ci-changes.test.mjs | 2 ++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/release/README.md b/docs/release/README.md index 58476e1098..80362b2217 100644 --- a/docs/release/README.md +++ b/docs/release/README.md @@ -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. diff --git a/scripts/ci-changes.mjs b/scripts/ci-changes.mjs index 3208b6fb85..d5b33a023f 100644 --- a/scripts/ci-changes.mjs +++ b/scripts/ci-changes.mjs @@ -11,6 +11,10 @@ const rules=[ [/^\.agents\/|^skills\/|^\.github\/(?:ISSUE_TEMPLATE\/|pull_request_template\.md$|PULL_REQUEST_TEMPLATE\.md$)/,[]], [/^docs\/architecture\/rust-agent\/(plugins|generated)\//,['xtask']], [/^docs\/design\/appserver\/native-storage-format\.md$/,['rust']], + // scripts/tui-tmux.test.mjs reads this page and checks every scenario is documented. + [/^docs\/architecture\/tui-e2e\.md$/,['scripts']], + // crates/dim-event-hub tests compare their strings to its appendix blocks. + [/^docs\/design\/plugins\/EventHub\.md$/,['rust']], // The ADR check runs in the changes job; docs alone need no build group. [documentation,[]], [/^deny\.toml$|^LICENSE$/,['dependencies']], diff --git a/scripts/ci-changes.test.mjs b/scripts/ci-changes.test.mjs index 7e4c7bf929..690afc991f 100644 --- a/scripts/ci-changes.test.mjs +++ b/scripts/ci-changes.test.mjs @@ -41,6 +41,8 @@ test('documentation and non-code repository metadata need no build group',()=>{ test('documents that code reads keep their checks',()=>{ assert.deepEqual(classify(['docs/architecture/rust-agent/plugins/goal.md']),only('xtask')); assert.deepEqual(classify(['docs/design/appserver/native-storage-format.md']),only('rust')); + assert.deepEqual(classify(['docs/architecture/tui-e2e.md']),only('scripts')); + assert.deepEqual(classify(['docs/design/plugins/EventHub.md']),only('rust')); }); test('Web sources that xtask reads keep its check',()=>{ From 8c70416a741ffc26b0a1c4ede67407fc1257cffa Mon Sep 17 00:00:00 2001 From: scotares Date: Sat, 21 Nov 2026 18:00:38 +0800 Subject: [PATCH 3/3] ci: route the TypeScript authoring guide and drop a dead node filter The plugin SDK test reads fenced TypeScript blocks from docs/typescript-plugin-authoring.md, so a guide-only change must select the Rust and Node groups. The migration_flow target has no node_ tests; its filter matched nothing and only spawned an extra test process. The release guide also named only stage-web.mjs as the scripts path that selects web. --- .github/workflows/ci.yml | 1 - docs/release/README.md | 2 +- scripts/ci-changes.mjs | 2 ++ scripts/ci-changes.test.mjs | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 40e1ab7a0f..65dd506b52 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -367,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" diff --git a/docs/release/README.md b/docs/release/README.md index 5933b95dc7..0b699301c2 100644 --- a/docs/release/README.md +++ b/docs/release/README.md @@ -180,7 +180,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, 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/`, only `scripts/stage-web.mjs` triggers the `web` job, 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. +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. diff --git a/scripts/ci-changes.mjs b/scripts/ci-changes.mjs index 0ee1400022..cd7280e917 100644 --- a/scripts/ci-changes.mjs +++ b/scripts/ci-changes.mjs @@ -16,6 +16,8 @@ const rules=[ [/^docs\/architecture\/tui-e2e\.md$/,['scripts']], // crates/dim-event-hub tests compare their strings to its appendix blocks. [/^docs\/design\/plugins\/EventHub\.md$/,['rust']], + // runtime/plugin-sdk.test.mjs compiles its fenced TypeScript blocks. + [/^docs\/typescript-plugin-authoring\.md$/,['rust','node']], // The ADR check runs in the changes job; docs alone need no build group. [documentation,[]], [/^deny\.toml$|^LICENSE$/,['dependencies']], diff --git a/scripts/ci-changes.test.mjs b/scripts/ci-changes.test.mjs index 757ac774a1..1a34f57d97 100644 --- a/scripts/ci-changes.test.mjs +++ b/scripts/ci-changes.test.mjs @@ -45,6 +45,7 @@ test('documents that code reads keep their checks',()=>{ assert.deepEqual(classify(['docs/design/appserver/native-storage-format.md']),only('rust')); assert.deepEqual(classify(['docs/architecture/tui-e2e.md']),only('scripts')); assert.deepEqual(classify(['docs/design/plugins/EventHub.md']),only('rust')); + assert.deepEqual(classify(['docs/typescript-plugin-authoring.md']),only('rust','node')); }); test('Web sources that static checks read avoid the heavy xtask build',()=>{