Skip to content

Commit c35a04d

Browse files
FredAppsadityankale190895claude
authored
test(rust): replay pinned public glob history on hosted CI (#95)
* feat(rust): map Cargo packages and test targets (#58) Signed-off-by: FredApps <[email protected]> * feat(rust): select workspace tests by crate dependencies (#59) Signed-off-by: FredApps <[email protected]> * feat(rust): synthesize conservative Cargo test commands (#60) Signed-off-by: FredApps <[email protected]> * feat(rust): register conservative Cargo adapter and document boundaries Signed-off-by: FredApps <[email protected]> * test(rust): add pinned public glob replay on hosted CI Signed-off-by: FredApps <[email protected]> * docs(rust): publish measured glob replay and fallback limits Signed-off-by: FredApps <[email protected]> * test(rust): execute selections from real Git changes Signed-off-by: FredApps <[email protected]> * docs(rust): publish Linux selective execution evidence Signed-off-by: FredApps <[email protected]> * fix(rust): narrow dependency, feature and runtime-input blockers Review on #92: the checks were so broad that no real crate could select fewer tests. Keep failing closed where a subset can actually differ. - Locked registry/Git dependencies (including build scripts and proc macros) no longer block; Cargo.lock changes keep the full suite. Local path dependencies outside the workspace still block. - A workspace crate with a build script depends on every workspace crate: it and its dependents run for any Rust change, other crates narrow. - Feature requests no longer block. Cargo (`cargo tree`) resolves each tested crate alone and with its dependents; the coverage is recorded for the planner to check each selected set. Missing evidence blocks. - Drop the fs/process/unsafe/extern keyword denylist. Literal paths that reach another crate, and code that runs Cargo/rustc, become crate dependencies instead of blockers. - Check only module trees for symlinks and unlisted sources (no 50k cap; linked LICENSE/README files are fine). - Read parent-directory and $CARGO_HOME Cargo config, block only build-changing keys, and include RUSTDOCFLAGS and CARGO_BUILD_TARGET. Signed-off-by: FredApps <[email protected]> * fix(rust): select only crates plain cargo test covers; check features per command Review on #93: plain `cargo test` tests only the root package of a non-virtual workspace, or `default-members`. Register test targets only for `workspace_default_members`, so a selective run stays a subset of the full one; other members remain sources that reach tested dependents. Metadata without default members (Cargo < 1.71) falls back. With #92's feature coverage, every synthesized Cargo invocation must contain a unit Cargo resolved with the full run's features for each package a selected crate would otherwise build differently; otherwise the plan is refused. Profiles without coverage are refused. Also keep release-files.json alphabetical. Signed-off-by: FredApps <[email protected]> * fix(rust): keep registration Rust-only; narrow docs, invocation and fixture fallbacks Review on #94: 1. Documentation changes follow the shared classification (no tests, no fallback) unless Rust code names a documentation path or a workspace build script exists; include_str!'d docs stay modelled assets. .github/** keeps the full suite: it is the invocation evidence. 2. Leave Maven, Python and Go behaviour as on main: the test matcher adds only Rust targets, goTestPackages only drops Rust contributions, and hydrated graphs only trust declared test identities for .rs nodes. 3. Accept ordinary CI around a plain `cargo test`: checkout, toolchain and cache actions, a matrix, output-only env, and build/clippy/fmt/doc/ rustup steps or jobs. Test flags, other runners, compiler env, conditional or relocated test steps and unknown actions stay advisory. 4. Label Rust support experimental in the docs. From #91 (point 2): Cargo manifests outside the workspace no longer block the repository when metadata shows no member depends on them; their files stay unmodelled, so changing one keeps the full suite. Also pass Cargo feature coverage and documentation readers to the profile. Signed-off-by: FredApps <[email protected]> * ci(rust): run glob replay on demand, execution proof in one Linux job Signed-off-by: FredApps <[email protected]> * fix(rust): paths that climb out of a crate in code depend on every crate Review on #92: a test that reads another crate's files only counted as depending on it when the code held a literal path to that crate. Tests that check every crate's files usually build the path instead, through .parent(), .ancestors(), PathBuf::pop or a formatted '..' path, so a change to the other crate skipped them. Treat such code like code that runs Cargo: its crate depends on every workspace crate. It only fires where the file also works with paths, so tree parent() methods and Vec::pop keep narrowing. Crate-local paths built from CARGO_MANIFEST_DIR stay narrow; the literal pass resolves them. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: adityankale190895 <[email protected]> * fix(rust): find documentation reads through relative and walked paths Review on #94: a test that reached docs/ through "../docs", concat!(env!("CARGO_MANIFEST_DIR"), "/../docs") or a directory walk that matched the "md" extension was not recorded as reading documentation, so a docs-only change ran no tests and kept no fallback. Match a documentation directory anywhere in a path, a Markdown name or a bare md/mdx extension, and count code that climbs out of its crate as a documentation reader too. Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: adityankale190895 <[email protected]> --------- Signed-off-by: FredApps <[email protected]> Signed-off-by: adityankale190895 <[email protected]> Co-authored-by: adityankale190895 <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 62a9c3c commit c35a04d

9 files changed

Lines changed: 2318 additions & 0 deletions

‎.github/workflows/ci.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ env:
88

99
jobs:
1010
check:
11+
env:
12+
# The real Cargo execution fixture (tests/repo/rust-execution.test.ts) builds workspaces; one
13+
# Linux job proves it and fails if Cargo is missing, the other matrix entries skip it.
14+
DIFFCI_REQUIRE_CARGO: ${{ matrix.os == 'ubuntu-26.04' && matrix.node == 24 && '1' || '0' }}
1115
strategy:
1216
matrix:
1317
os: [ubuntu-26.04, windows-latest]

‎.github/workflows/rust-replay.yml‎

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Rust public repository replay
2+
# Manual only: each run clones, builds and fully tests glob three times. Run it from the Actions tab
3+
# when a Rust adapter change could alter the replay's outcome.
4+
on:
5+
workflow_dispatch:
6+
permissions:
7+
contents: read
8+
jobs:
9+
replay:
10+
runs-on: ubuntu-26.04
11+
timeout-minutes: 20
12+
steps:
13+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
14+
with:
15+
persist-credentials: false
16+
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
17+
with:
18+
node-version: 24
19+
cache: npm
20+
- name: Verify hosted Rust toolchain
21+
run: |
22+
cargo --version
23+
rustc -Vv
24+
- run: npm ci --ignore-scripts
25+
- run: npm run build
26+
- name: Clone pinned official Rust target into a disposable directory
27+
shell: bash
28+
run: |
29+
set -euo pipefail
30+
root=$(mktemp -d "$RUNNER_TEMP/diffci-rust-replay.XXXXXX")
31+
echo "RUST_REPLAY_ROOT=$root" >> "$GITHUB_ENV"
32+
git clone https://github.com/rust-lang/glob.git "$root/glob"
33+
git -C "$root/glob" checkout --detach 057cef2824f5a96f738e52d7d8ca3e024381bcc6
34+
- name: Prepare Cargo dependencies, then analyze and run full offline baselines
35+
shell: bash
36+
run: |
37+
set -euo pipefail
38+
node scripts/replay-rust.mjs \
39+
--repo "$RUST_REPLAY_ROOT/glob" \
40+
--disposable-root "$RUST_REPLAY_ROOT" \
41+
--output "$RUNNER_TEMP/rust-replay-report.json" \
42+
--prepare-dependencies
43+
- name: Upload replay evidence, including failures
44+
if: always()
45+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
46+
with:
47+
name: rust-public-replay
48+
path: ${{ runner.temp }}/rust-replay-report.json
49+
if-no-files-found: warn
50+
retention-days: 30

‎docs/research/2026-11-10-rust-glob-replay.json‎

Lines changed: 1158 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Rust public replay: glob, 2026-11-10
2+
3+
## Result
4+
5+
All three historical source-changing revisions of [rust-lang/glob](https://github.com/rust-lang/glob) retained **FULL** validation. All three independent full Cargo baselines passed. No selective command was executed, and this replay establishes **zero selectivity and no avoided-compute claim**.
6+
7+
This validates the adapter's conservative fallback on a real filesystem-oriented crate. It does not establish selective correctness for arbitrary Rust repositories, reproduce glob's CI matrix, or demonstrate a performance improvement. Positive crate-selection coverage currently comes from the synthetic workspace tests.
8+
9+
## Evidence and environment
10+
11+
- [Hosted replay run](https://github.com/DiffCI/core/actions/runs/42828196139), completed successfully on 2026-11-10 at 13:50:49 UTC.
12+
- [Machine-readable report](2026-11-10-rust-glob-replay.json), including exact deltas, Cargo output, dependency-lock bytes/hashes, blockers, plans and checkout-state receipts.
13+
- Core PR head: `8d0ba78eed600a7d84ddadc4def6c4e1e6d0dd2a`; GitHub tested merge commit: `017320e7f939e15222a950958ee3e0cb7af90e1a`, whose tree matches the PR head. The report was added afterward without changing the engine or harness.
14+
- Official target history pinned beneath `057cef2824f5a96f738e52d7d8ca3e024381bcc6`.
15+
- GitHub-hosted Ubuntu 26.04 x64, image `20261101.186.1`; Node `v24.22.2`; Cargo and rustc `1.99.1`.
16+
17+
| Target head | Exact parent | Plan | Full baseline | Observed command wall time |
18+
| --- | --- | --- | --- | --- |
19+
| [`8a903ef83cdc`](https://github.com/rust-lang/glob/commit/8a903ef83cdc3ac4be8a16c4160c570fcfead655), edition 2021 | `1f753241f047175126d1be051718d1a0994d29f4` | FULL | Passed | 7.527 s |
20+
| [`0639988caf1c`](https://github.com/rust-lang/glob/commit/0639988caf1c644b78629cd0f7d65f4d0a4920c9), cache filename for sorting | `335da33c46daaa7db629ad77e07a9531909d9dfd` | FULL | Passed | 1.759 s |
21+
| [`335da33c46da`](https://github.com/rust-lang/glob/commit/335da33c46daaa7db629ad77e07a9531909d9dfd), Into conversion | `e0b33b0fac2d83f37e737e7207e75a36339380a6` | FULL | Passed | 0.688 s |
22+
23+
Each baseline reported 18 unit tests, 1 integration test and 5 doctests passing, with 2 doctests ignored by the target itself. Timings include compilation and sequential reuse of one build cache. They are single observations, not benchmark comparisons.
24+
25+
## Why the adapter retained the full suite
26+
27+
Each revision discovered two test-target identities, `src/lib.rs` and `tests/glob-std.rs`. Both remained selected. The graph reported UNSAFE and explicit blockers for:
28+
29+
- Dependencies outside the workspace whose runtime inputs are opaque.
30+
- Dependency feature unification requiring the original workspace invocation.
31+
- Build scripts in the resolved dependency set.
32+
- Runtime inputs or unsupported include/path behavior in the crate and integration-test sources.
33+
34+
Command synthesis was NOT_APPLICABLE because the repository's original full test command applies. These results must not be described as a selective run that happened to pass.
35+
36+
## Reproduction
37+
38+
Use the `Rust public repository replay` GitHub Actions workflow (run by hand with `workflow_dispatch`) or run the harness in a disposable clone outside Core. Build Core with `npm ci` and `npm run build`, clone the official repository, and check out the pinned target head above. Then run:
39+
40+
```sh
41+
node scripts/replay-rust.mjs \
42+
--repo /tmp/disposable-rust-replay/glob \
43+
--disposable-root /tmp/disposable-rust-replay \
44+
--output /tmp/rust-replay-report.json \
45+
--prepare-dependencies
46+
```
47+
48+
The harness verifies the official origin, pinned ancestry, exact parents and clean state. It explicitly generates an ignored Cargo.lock and fetches dependencies before read-only analysis, then executes `cargo test --offline --locked` as the independent full baseline at each head. Dependency preparation belongs to this harness; the analyzer itself does not fetch or generate a lockfile.
49+
50+
The generated lockfile had SHA-256 `e520ab8782edb3b0ca6bce25668d6eb637b592e364cd6a8ae676626feb9ed699` at all three heads. Analysis and full tests preserved tracked checkout state and that lockfile. The raw report retains the lockfile contents so future dependency resolution can be compared rather than assumed identical.
51+
52+
## Remaining boundary
53+
54+
The initial selective path supports local workspace crates with complete source/input coverage and a reproducible plain Cargo test invocation. Broader dependency runtime-input coverage, feature-context reproduction and CI invocation support need additional evidence before this public repository can safely narrow. This replay completes the public-report milestone of #62 while keeping those limitations explicit.

0 commit comments

Comments
 (0)