From cabc024642d5655023e34b301905ee508fa9e4fd Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 20:47:32 +0000 Subject: [PATCH 1/6] ci: halve PR wall-clock time and drop redundant jobs - Split the macOS and Windows test jobs in two with nextest --partition. Their nextest steps took 26 and 22 minutes against 10.5 on Linux and set every PR's ~29 minute wall-clock time. - Run doctests on Linux only (4.5 minutes on Windows). - Remove the Check job: Clippy already type-checks the workspace. - Remove the MSRV job. rust-toolchain.toml overrides the toolchain dtolnay/rust-toolchain installs, so its "1.90" step ran 1.98.0 (the job log says so), and every crate now declares rust-version 1.98, so both steps repeated Clippy's check. - Conformance: use rust-cache saved from dev only, instead of actions/cache, which saved a full target/ from each PR that changed Cargo.lock into the shared 10 GB cache. - Provenance DSSE: add a cache (seeded by a dev push trigger), paths-ignore for Markdown, and cancel superseded PR runs. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Q7Qtv34PZoUooFXFpB3zMU --- .github/workflows/ci.yml | 80 ++++++++++----------------- .github/workflows/provenance-dsse.yml | 17 ++++++ 2 files changed, 47 insertions(+), 50 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 272bd3a5..003c6225 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,30 +22,30 @@ env: CARGO_TERM_COLOR: always RUSTFLAGS: -Dwarnings +# There is no separate `cargo check` or MSRV job. Clippy type-checks the whole +# workspace, and rust-toolchain.toml pins the same Rust (1.98) that every +# crate declares as its rust-version, so both would repeat Clippy's work. A +# `dtolnay/rust-toolchain@` step cannot test an older Rust here +# anyway: rust-toolchain.toml overrides the toolchain it installs. If the pin +# ever moves above rust-version, add an MSRV job that runs +# `cargo + check` so the override does not apply. jobs: - check: - name: Check - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: dtolnay/rust-toolchain@stable - - - name: Cache cargo registry and dependency builds - uses: Swatinem/rust-cache@v2 - with: - save-if: ${{ github.ref == 'refs/heads/dev' }} - - - name: cargo check - run: cargo check --workspace - test: - name: Test (${{ matrix.os }}) + name: Test (${{ matrix.os }}${{ matrix.shards > 1 && format(' {0}/{1}', matrix.shard, matrix.shards) || '' }}) runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + # The nextest step took 26 minutes on macOS and 22 on Windows against + # 10.5 on Linux, so those two set every PR's wall-clock time. Each + # runs in two halves; both halves of an OS share one rust-cache key + # and restore the same build. + include: + - { os: ubuntu-latest, shard: 1, shards: 1 } + - { os: macos-latest, shard: 1, shards: 2 } + - { os: macos-latest, shard: 2, shards: 2 } + - { os: windows-latest, shard: 1, shards: 2 } + - { os: windows-latest, shard: 2, shards: 2 } env: # Line tables keep file:line in backtraces but link far faster and keep # target/ (and the cache) much smaller than full debug info. @@ -108,10 +108,14 @@ jobs: # (cfg(unix)); Linux/macOS still run them. Keep Windows native tests on. # Re-enable the shim suites after Windows support is defined and its # path/mode/locking behavior is validated; see the RFC platform policy. - run: cargo nextest run --workspace --features atomic-cli/adoption-test-injection --profile ci + run: >- + cargo nextest run --workspace --features atomic-cli/adoption-test-injection --profile ci + --partition count:${{ matrix.shard }}/${{ matrix.shards }} - # nextest does not run doctests. + # nextest does not run doctests. They exercise the same code on every + # platform and took 4.5 minutes on Windows, so they run on Linux only. - name: Run doctests + if: matrix.os == 'ubuntu-latest' run: cargo test --workspace --doc --features atomic-cli/adoption-test-injection --no-fail-fast - name: Run CLI semantic diff harness @@ -192,39 +196,15 @@ jobs: - uses: dtolnay/rust-toolchain@stable - - name: Cache cargo registry and build - uses: actions/cache@v4 + # Not actions/cache: that saved a new full target/ from every PR that + # changed Cargo.lock, which only that PR could restore, and which counts + # against the repository's 10 GB cache limit that the test caches need. + - name: Cache cargo registry and dependency builds + uses: Swatinem/rust-cache@v2 with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-conformance-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-cargo-conformance- + save-if: ${{ github.ref == 'refs/heads/dev' }} - name: Replay the suite through the JSON admission run: cargo test -p atomic-canonical --test conformance_corpus -- --ignored env: AEV_SUITE: ${{ github.workspace }}/agent-evidence-vectors/vectors-ai-agent-action - - msrv: - name: Minimum Supported Rust Version - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: dtolnay/rust-toolchain@1.90 - - - name: Cache cargo registry and dependency builds - uses: Swatinem/rust-cache@v2 - with: - save-if: ${{ github.ref == 'refs/heads/dev' }} - - - name: cargo check (shared library MSRV) - run: cargo check --workspace --exclude atomic-cli --exclude atomic-shacl --locked - - - uses: dtolnay/rust-toolchain@1.98 - - - name: cargo check (CLI and SHACL MSRV) - run: cargo check -p atomic-cli -p atomic-shacl --locked diff --git a/.github/workflows/provenance-dsse.yml b/.github/workflows/provenance-dsse.yml index 468d746a..dfcea746 100644 --- a/.github/workflows/provenance-dsse.yml +++ b/.github/workflows/provenance-dsse.yml @@ -3,6 +3,19 @@ name: Provenance DSSE interoperability on: pull_request: branches: [dev] + paths-ignore: + - '**.md' + - '**.markdown' + # Seeds the cache that pull requests restore; see ci.yml. + push: + branches: [dev] + paths-ignore: + - '**.md' + - '**.markdown' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.event_name == 'pull_request' }} env: CARGO_TERM_COLOR: always @@ -19,6 +32,10 @@ jobs: - uses: actions/setup-python@v5 with: python-version: '3.12' + - name: Cache cargo registry and dependency builds + uses: Swatinem/rust-cache@v2 + with: + save-if: ${{ github.ref == 'refs/heads/dev' }} - name: Install independent Ed25519 verifier run: python -m pip install 'cryptography==50.0.0' - name: Feature API tests and examples From 6ab8c604db1dee057f468a9500f9a470c4549b03 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 21:37:50 +0000 Subject: [PATCH 2/6] ci: keep the macOS test job whole On the first run of the split, each macOS half took about as long as the whole suite (shard 2/2 ran 44 minutes), and the extra macOS job held one of the organization's few macOS runners: dev's macOS test job queued for 22 minutes behind it. Windows halves went from 28 to 17 minutes and stay split. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Q7Qtv34PZoUooFXFpB3zMU --- .github/workflows/ci.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 003c6225..e0798a5f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,14 +36,18 @@ jobs: strategy: fail-fast: false matrix: - # The nextest step took 26 minutes on macOS and 22 on Windows against - # 10.5 on Linux, so those two set every PR's wall-clock time. Each - # runs in two halves; both halves of an OS share one rust-cache key - # and restore the same build. + # Windows runs in two halves: its nextest step took 22 minutes + # against 10.5 on Linux, and halved it is ~15. Both halves share one + # rust-cache key and restore the same build. + # + # macOS stays whole. GitHub runs only a few macOS jobs at once per + # organization, so a second macOS job queues other PRs' and dev's + # macOS jobs (dev waited 22 minutes behind a split run). In that + # run each macOS half took about as long as the whole suite, so the + # split gained nothing. include: - { os: ubuntu-latest, shard: 1, shards: 1 } - - { os: macos-latest, shard: 1, shards: 2 } - - { os: macos-latest, shard: 2, shards: 2 } + - { os: macos-latest, shard: 1, shards: 1 } - { os: windows-latest, shard: 1, shards: 2 } - { os: windows-latest, shard: 2, shards: 2 } env: From e79ba9614745ea8fbfa9abee3a52dabe42f1ac11 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 22:04:05 +0000 Subject: [PATCH 3/6] ci: run the other jobs only after Format and Clippy pass Test, Documentation, Conformance vectors and the DSSE export job now need fmt and clippy, so a PR with a lint or formatting error stops after about a minute and a half instead of also running the macOS and Windows suites. Fold the Provenance DSSE interoperability workflow into ci.yml as the export-consumer job so it can wait on Clippy too. Its feature lint (clippy with --features dsse-export) moves into the Clippy job, so there is one place that runs Clippy. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Q7Qtv34PZoUooFXFpB3zMU --- .github/workflows/ci.yml | 41 +++++++++++++++++++++++ .github/workflows/provenance-dsse.yml | 48 --------------------------- 2 files changed, 41 insertions(+), 48 deletions(-) delete mode 100644 .github/workflows/provenance-dsse.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0798a5f..8dae0477 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,8 +29,13 @@ env: # anyway: rust-toolchain.toml overrides the toolchain it installs. If the pin # ever moves above rust-version, add an MSRV job that runs # `cargo + check` so the override does not apply. +# +# Format and Clippy run first; every other job waits for both to pass, so a PR +# with a lint or formatting error does not also start the macOS and Windows +# test runs. Clippy takes about a minute and a half with a warm cache. jobs: test: + needs: [fmt, clippy] name: Test (${{ matrix.os }}${{ matrix.shards > 1 && format(' {0}/{1}', matrix.shard, matrix.shards) || '' }}) runs-on: ${{ matrix.os }} strategy: @@ -166,7 +171,12 @@ jobs: - name: cargo clippy run: cargo clippy --workspace -- -D warnings + # The DSSE export code is behind a feature the workspace run leaves off. + - name: cargo clippy (dsse-export feature) + run: cargo clippy --locked --no-deps -p atomic-canonical -p atomic-cli --features dsse-export -- -D warnings + doc: + needs: [fmt, clippy] name: Documentation runs-on: ubuntu-latest steps: @@ -185,6 +195,7 @@ jobs: RUSTDOCFLAGS: -Dwarnings conformance: + needs: [fmt, clippy] name: Conformance vectors runs-on: ubuntu-latest steps: @@ -212,3 +223,33 @@ jobs: run: cargo test -p atomic-canonical --test conformance_corpus -- --ignored env: AEV_SUITE: ${{ github.workspace }}/agent-evidence-vectors/vectors-ai-agent-action + + # Formerly the separate "Provenance DSSE interoperability" workflow. Its + # feature lint now runs in the Clippy job. + export-consumer: + needs: [fmt, clippy] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: dtolnay/rust-toolchain@stable + + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Cache cargo registry and dependency builds + uses: Swatinem/rust-cache@v2 + with: + save-if: ${{ github.ref == 'refs/heads/dev' }} + + - name: Install independent Ed25519 verifier + run: python -m pip install 'cryptography==50.0.0' + + - name: Feature API tests and examples + run: cargo test --locked -p atomic-canonical --features dsse-export + + - name: Real CLI export and independent consumption + run: cargo test --locked -p atomic-cli --features dsse-export --test it provenance_integration_test + env: + ATOMIC_DSSE_PYTHON: python diff --git a/.github/workflows/provenance-dsse.yml b/.github/workflows/provenance-dsse.yml deleted file mode 100644 index dfcea746..00000000 --- a/.github/workflows/provenance-dsse.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Provenance DSSE interoperability - -on: - pull_request: - branches: [dev] - paths-ignore: - - '**.md' - - '**.markdown' - # Seeds the cache that pull requests restore; see ci.yml. - push: - branches: [dev] - paths-ignore: - - '**.md' - - '**.markdown' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ github.event_name == 'pull_request' }} - -env: - CARGO_TERM_COLOR: always - RUSTFLAGS: -Dwarnings - -jobs: - export-consumer: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@1.90 - with: - components: clippy - - uses: actions/setup-python@v5 - with: - python-version: '3.12' - - name: Cache cargo registry and dependency builds - uses: Swatinem/rust-cache@v2 - with: - save-if: ${{ github.ref == 'refs/heads/dev' }} - - name: Install independent Ed25519 verifier - run: python -m pip install 'cryptography==50.0.0' - - name: Feature API tests and examples - run: cargo test --locked -p atomic-canonical --features dsse-export - - name: Real CLI export and independent consumption - run: cargo test --locked -p atomic-cli --features dsse-export --test it provenance_integration_test - env: - ATOMIC_DSSE_PYTHON: python - - name: Feature lint - run: cargo clippy --locked --no-deps -p atomic-canonical -p atomic-cli --features dsse-export -- -D warnings From 609deecd8e058fc39a979609b3b4fb1ca8a43e5d Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 23:24:28 +0000 Subject: [PATCH 4/6] test(agent): close the repository before the second idle Stop test_fully_idle_turn_end_creates_attestation opened a Repository to check the first attestation and kept it open across the second turn. The open handle holds the database lock, so the orchestrator's opens in that turn (has_working_copy_changes, record_turn, persist_incomplete_refusal) each waited out the lock budget, and the turn ended on the incomplete-refusal path instead of the no-op path the test describes. The test took 41s on every platform; it now takes 0.6s and exercises the path it names. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Q7Qtv34PZoUooFXFpB3zMU --- atomic-agent/src/turn/orchestrator/tests.rs | 34 ++++++++++++--------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/atomic-agent/src/turn/orchestrator/tests.rs b/atomic-agent/src/turn/orchestrator/tests.rs index 115af80d..4f951d4b 100644 --- a/atomic-agent/src/turn/orchestrator/tests.rs +++ b/atomic-agent/src/turn/orchestrator/tests.rs @@ -1018,20 +1018,25 @@ async fn test_fully_idle_turn_end_creates_attestation() { let turn_result = orch.dispatch(agy_stop).await.unwrap(); assert!(turn_result.change_recorded.is_some()); - let repo = Repository::open(dir.path()).unwrap(); - let attestations: Vec<_> = repo - .change_store() - .iter_attestations() - .filter_map(|r| r.ok()) - .collect(); - assert_eq!( - attestations.len(), - 1, - "Stop with fullyIdle=true must create an attestation", - ); - let attest = repo.load_attestation(&attestations[0]).unwrap(); - assert_eq!(attest.session_id, "sess-agy-1"); - assert_eq!(attest.changes_covered.len(), 1); + // Scoped so the handle is closed before the next dispatch: an open + // Repository holds the database lock, and the orchestrator's own opens + // would wait out ATOMIC_DB_LOCK_WAIT_MS (30s) behind it. + { + let repo = Repository::open(dir.path()).unwrap(); + let attestations: Vec<_> = repo + .change_store() + .iter_attestations() + .filter_map(|r| r.ok()) + .collect(); + assert_eq!( + attestations.len(), + 1, + "Stop with fullyIdle=true must create an attestation", + ); + let attest = repo.load_attestation(&attestations[0]).unwrap(); + assert_eq!(attest.session_id, "sess-agy-1"); + assert_eq!(attest.changes_covered.len(), 1); + } // A second idle Stop with no new changes must NOT create a duplicate. orch.dispatch(turn_start_event("sess-agy-1", "no-op turn")) @@ -1044,6 +1049,7 @@ async fn test_fully_idle_turn_end_creates_attestation() { })); orch.dispatch(agy_stop_again).await.unwrap(); + let repo = Repository::open(dir.path()).unwrap(); let attestations_after: Vec<_> = repo .change_store() .iter_attestations() From 292c204f8e3aa343343d0368d722fcd5584e05b6 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 3 Nov 2026 23:31:04 +0000 Subject: [PATCH 5/6] ci: run two tests per CPU under nextest The integration tests mostly wait on git and atomic subprocesses: on a 4-CPU machine, 86 git shim, adoption and anchor tests used 1.5 CPUs at one test per CPU (182s) and took 101s at two per CPU and 75s at four. The 3-CPU macOS runner, which sets every PR's wall-clock time, ran exactly 3 tests at a time (3,777s of test time in 1,261s). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Q7Qtv34PZoUooFXFpB3zMU --- .github/workflows/ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8dae0477..a799474b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -117,9 +117,17 @@ jobs: # (cfg(unix)); Linux/macOS still run them. Keep Windows native tests on. # Re-enable the shim suites after Windows support is defined and its # path/mode/locking behavior is validated; see the RFC platform policy. + # + # Two tests per CPU. The integration tests mostly wait on git and + # atomic subprocesses and the filesystem: on 4 CPUs, 86 of the git + # shim/adoption/anchor tests used 1.5 CPUs at one test per CPU and + # finished 1.8x faster at two. nextest's default of one per CPU left + # the 3-CPU macOS runner running exactly 3 tests at a time. + shell: bash run: >- cargo nextest run --workspace --features atomic-cli/adoption-test-injection --profile ci --partition count:${{ matrix.shard }}/${{ matrix.shards }} + --test-threads $(( 2 * $(getconf _NPROCESSORS_ONLN 2>/dev/null || nproc) )) # nextest does not run doctests. They exercise the same code on every # platform and took 4.5 minutes on Windows, so they run on Linux only. From a50c06605369c0ba07775c85e0932053148ecb78 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 4 Nov 2026 14:32:16 +0000 Subject: [PATCH 6/6] ci: split the macOS test job in two again Retry the split now that tests run two per CPU: macOS is the last job to finish (23 minutes in the latest run). Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Q7Qtv34PZoUooFXFpB3zMU --- .github/workflows/ci.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a799474b..0aa265f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,18 +41,14 @@ jobs: strategy: fail-fast: false matrix: - # Windows runs in two halves: its nextest step took 22 minutes - # against 10.5 on Linux, and halved it is ~15. Both halves share one - # rust-cache key and restore the same build. - # - # macOS stays whole. GitHub runs only a few macOS jobs at once per - # organization, so a second macOS job queues other PRs' and dev's - # macOS jobs (dev waited 22 minutes behind a split run). In that - # run each macOS half took about as long as the whole suite, so the - # split gained nothing. + # macOS and Windows run in two halves: their nextest steps took 26 + # and 22 minutes against 10.5 on Linux. Both halves of an OS share + # one rust-cache key and restore the same build. A second macOS job + # takes one more of the organization's few concurrent macOS runners. include: - { os: ubuntu-latest, shard: 1, shards: 1 } - - { os: macos-latest, shard: 1, shards: 1 } + - { os: macos-latest, shard: 1, shards: 2 } + - { os: macos-latest, shard: 2, shards: 2 } - { os: windows-latest, shard: 1, shards: 2 } - { os: windows-latest, shard: 2, shards: 2 } env: