Skip to content

test(rust): replay pinned public glob history on hosted CI - #95

Merged
adityankale190895 merged 29 commits into
DiffCI:mainfrom
FredApps:rust/62-public-replay
Nov 16, 2026
Merged

adityankale190895 merged 29 commits into
DiffCI:mainfrom
FredApps:rust/62-public-replay

Conversation

@FredApps

@FredApps FredApps commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Part 5 of #62, stacked after #92, #93 and #94 (#91 has merged).

Linux execution proof

The complete branch stack was tested on Linux without waiting for upstream merges. See the detailed report and the machine-readable evidence.

  • Real fixture Git commits and the HEAD inventory feed actual Cargo metadata, the registered graph, impact analysis and the planner.
  • The generated command runs 6 Rust tests instead of the full 9. It keeps unit tests, named integrations and doctests, and leaves out the unrelated crate.
  • Three separately seeded production arithmetic regressions are caught by both the selected and full commands, and restoring the code makes both pass.
  • The real Cargo execution test runs in a single CI job. ci.yml sets DIFFCI_REQUIRE_CARGO=1 only for ubuntu-26.04 with Node 24. That job must run it and fails if Cargo, rustc or rustdoc is missing. The other three matrix jobs skip it to save CI compute, and locally it runs whenever Cargo is installed. The small real-Cargo adapter tests from feat(rust): select tests through Cargo crate dependencies #92/feat(rust): synthesize conservative cargo test commands #93 still run wherever Cargo is available. Most only call cargo metadata/cargo tree, and two compile a tiny workspace for cargo test -- --list.

This is a synthetic workspace execution proof, not a timing or avoided-compute claim for a public project. It tests Core's Git-to-Cargo path, not an installed CLI containing the new adapter.

Public replay

rust-replay.yml now runs only through workflow_dispatch (started by hand), not on pull requests. The pinned official rust-lang/glob replay originally passed on hosted CI and was repeated on Linux. All three historical revisions kept FULL validation and passed the independent offline/locked Cargo baseline: at each head, 18 unit tests, 1 integration test and 5 doctests passed, and 2 doctests were ignored. No public synthesized subset was executed.

Limitations:

The analyzer stays offline and read-only. The harness explicitly prepares dependencies in a disposable clone and verifies the pinned history and an unchanged checkout and lock state.

Validation and review scope

On this head, the full suite passes locally on Linux with DIFFCI_REQUIRE_CARGO=1 (1047 tests), and the CI-mode skip was checked. Typecheck, build, release-boundary audit and agent check pass. Hosted Linux/Windows Node 22/24 checks, CLI packaging, Observer Action smoke and CodeQL pass, and the CI logs confirm the execution test ran in the Linux Node 24 job and was skipped in the others.

Commits for this milestone:

Earlier milestones stay in the branch until they land. The support boundary and the remaining public-repository limitations are documented. DCO signed off. Review reply: #95 (comment)

@adityankale190895 adityankale190895 left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FredApps Thanks for how honest the reports are: they state zero selectivity and make no savings claim. Two notes on CI cost:

1. rust-replay.yml runs on every PR that touches src/**. Each run clones glob, builds it and runs its full suite three times, and today the result is always FULL. CI compute is limited for this project, so could it be workflow_dispatch only? If it should stay automatic, could it trigger only on changes to Rust adapter and planner files?

2. rust-execution.test.ts builds real Cargo workspaces in every ci.yml matrix job (Linux and Windows × Node 22 and 24) because of DIFFCI_REQUIRE_CARGO=1. Could one Linux job cover the executable proof, with the other matrix entries skipping it?

Resolve the DiffCI#91 squash merge: keep main's symlinked-checkout fix,
grouped fallback-reason rows and maintainer line, and reapply this
milestone's crate dependency analysis on top.

Signed-off-by: FredApps <[email protected]>
Bring in main (including the DiffCI#91 squash merge) through the updated
dependency milestone; this milestone's changes are reapplied unchanged.

Signed-off-by: FredApps <[email protected]>
Bring in main (including the DiffCI#91 squash merge) through the updated
command milestone. Bump the graph cache schema to 15 after main's 11-14,
and keep release-files.json alphabetical.

Signed-off-by: FredApps <[email protected]>
Bring in main (including the DiffCI#91 squash merge) through the updated
registration milestone; the replay and execution evidence is reapplied
unchanged.

Signed-off-by: FredApps <[email protected]>
Review on DiffCI#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]>
… per command

Review on DiffCI#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 DiffCI#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]>
…ixture fallbacks

Review on DiffCI#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 DiffCI#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]>
@FredApps

Copy link
Copy Markdown
Contributor Author

@adityankale190895 thanks, both done in 9df6ec7, after merging main (1fed587) and #94 (8ed76d6).

1. rust-replay.yml now runs only on workflow_dispatch, and the replay report says to start it by hand.

2. rust-execution.test.ts. ci.yml sets DIFFCI_REQUIRE_CARGO=1 only for ubuntu-26.04 with Node 24. That job must run the real Cargo proof and fails if Cargo, rustc or rustdoc is missing. The other three matrix jobs skip it under CI. Locally it still runs whenever Cargo is installed. The Linux execution report is updated to match. The small real-Cargo adapter tests from #92/#93 still run wherever Cargo is available. Most only call cargo metadata/cargo tree on tiny fixtures, and two compile a two-crate workspace for cargo test -- --list. Together they take a few seconds.

Note: the replay reports and the PR description describe the earlier, stricter checks. With #92 loosened, glob would still always be FULL, because it's a single crate and any change selects all of it.

Local results: 1047 tests pass with DIFFCI_REQUIRE_CARGO=1, and the CI-mode skip was checked.

@FredApps
FredApps marked this pull request as ready for review November 15, 2026 17:22
adityankale190895 and others added 4 commits November 16, 2026 08:41
Review on DiffCI#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]>
Signed-off-by: adityankale190895 <[email protected]>

# Conflicts:
#	docs/using-diffci.md
Signed-off-by: adityankale190895 <[email protected]>

# Conflicts:
#	docs/using-diffci.md
#	src/repo/adapters/rust.ts
Review on DiffCI#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: adityankale190895 <[email protected]>

# Conflicts:
#	docs/using-diffci.md
#	src/repo/adapters/rust.ts
#	tests/repo/rust-adapter.test.ts
Signed-off-by: adityankale190895 <[email protected]>

# Conflicts:
#	docs/using-diffci.md
Signed-off-by: adityankale190895 <[email protected]>

# Conflicts:
#	release-files.json
@adityankale190895

adityankale190895 commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

@FredApps thanks for the quick turnaround on #92–#95. The whole stack, #92 to #95, is now merged. To get the stack in, I pushed two fixes to your branches myself, so here is what changed.

#92: paths built in code that climb out of a crate (fa50d31)

This is the blocking point from my 15 November review. A source file that climbs out of its crate in code now makes its crate depend on every workspace crate, the same way code that runs Cargo does. That covers .parent(), .ancestors(), PathBuf::pop and format strings with a .. segment (format!("{}/../{}", …)). It only applies when the file also works with paths (Path, PathBuf, current_dir, CARGO_MANIFEST_DIR), so a tree node's parent() or Vec::pop still narrows. I left out CARGO_MANIFEST_DIR on its own: paths built from it with a literal are already resolved by the literal pass, and counting every use would make most fixture-reading tests depend on everything.

The three failing cases from the review are now regression tests in rust-adapter.test.ts, along with the format! and pop forms. Two more tests check that a crate-local CARGO_MANIFEST_DIR join and a non-path parent()/pop() keep narrowing.

#94: tests that read docs through relative paths (16a0c9f)

A docs-only change runs no tests unless some Rust code is recorded as reading docs. The check only matched strings that end in .md or start with docs/, so these forms were missed, and a change to docs/guide.md ran nothing:

How the test reaches docs Before After
Path::new(env!("CARGO_MANIFEST_DIR")).join("../docs") not detected full suite
concat!(env!("CARGO_MANIFEST_DIR"), "/../docs") not detected full suite
.parent() + read_dir + extension() == "md" not detected full suite

A documentation directory (docs, doc, documentation) anywhere in a path, a Markdown name or a bare md/mdx extension now counts, and so does any code that climbs out of its crate. These cases are in rust-integration.test.ts, which fails without the fix. Strings like "cmd" and "doctor/visit" still don't count.

Stack updates

  • I merged each fix up the stack and brought each branch up to date with main after the squash-merges. Each merge commit has a DCO sign-off.
  • docs/using-diffci.md and docs/release-boundary.md describe both rules.
  • Before merging, the full suite passed locally (1030 pass, 0 fail) and CI was green on every head.

#95

#95 is merged as c35a04d. It merged cleanly on main with CI green, and #59 is closed as done by #92. Two follow-ups, whenever you have time:

  • The replay reports are dated 2026-11-10 and describe the checks from before this round. A short note or a fresh report for the merged rules would keep them current.
  • A glob replay against the merged rules would show how much these two fixes cost in narrowing. It runs only when started by hand now, so start it whenever you're ready.

If either fix has a better shape, a follow-up PR is welcome. The Rust adapter is your area.

@adityankale190895
adityankale190895 merged commit c35a04d into DiffCI:main Nov 16, 2026
13 checks passed
adityankale190895 added a commit that referenced this pull request Nov 16, 2026
The 0.3.48 release failed with 'Resource not accessible by integration'
when creating v0.3.48 and action-v0.3.48: PR #95 had landed on main with
.github/workflows changes 73 seconds earlier, and a job token cannot create
a tag on a commit whose workflow files differ from main's (that needs the
workflows permission, which GITHUB_TOKEN never has).

npm run release:tag now creates cli-release-v, v and an annotated action-v
tag on the pushed release commit and pushes them atomically. The workflow
already accepts tags that exist; its two tag steps now say what to do if
the token is refused.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: adityankale190895 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants