Skip to content

fix(rust): a file no Cargo target compiles contributes no related test (#8999) - #10207

Merged
EffortlessSteven merged 12 commits into
mainfrom
claude/8999-probe-scan
Oct 25, 2026
Merged

EffortlessSteven merged 12 commits into
mainfrom
claude/8999-probe-scan

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Governing issue or accepted claim: #8999

Acceptance delta (one sentence): A Rust file that no Cargo target can compile (a benchmark/corpus haystack outside src/, tests/, benches/, examples/ that no manifest, #[path], include! or mod names) is no longer listed as a related test and no longer adds a lexical-fallback limitation.

What

  • facts/stray_files.rs decides which unlinked, non-root files are positively never compiled; role_composition marks them outside_module_tree and withholds their executable tests.
  • Fail closed: any manifest/source mention of the file name, a mod <stem>, macro-built mod/include! operands, an unreadable manifest, an unresolved include, a linked/root lexical-fallback file, or an unindexed crate root keeps the file as before.
  • Spec RIPR-SPEC-0356, traceability, changelog fragment, corpus spec-coverage ledgers (scope out, proved by outside_target_haystack.rs).

Proof

  • cargo test -p ripr --lib stray_files (12), --test outside_target_haystack (4), --lib analysis::facts (383), reuse and lexical_test_grip filters; cargo xtask precommit passed locally.
  • Mutation checks: removing the file-name reference check fails 2 tests.
  • Rendered: haystack test absent from related tests, run complete_with_findings; #[path]/[[bench]] controls keep the test and the limitation.

Not covered

  • A parser-refused haystack that spells assert_eq! still makes the workspace macro-binding scan ambiguous, so the class may stay static_unknown (disclosed, fail closed); follow-up.
  • Not run: full workspace tests, goldens check, hosted CI, real memchr repro, Windows/macOS.

Generated by Claude Code

#8999)

Files outside src/tests/benches/examples that no manifest, #[path], include! or mod names are marked outside the module tree and their tests are withheld; fail closed on any doubt.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuJ5J2vLze4cRJra3suroQ
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 44 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 169 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: a904af4c-eb63-4b20-a126-58d9c1e83848
Commits

Reviewing files that changed from the base of the PR and between feea378 and 098ee10.

Files selected for processing: 16
  • .ripr/traceability.toml
  • changelog.d/8999-uncompiled-rust-files-no-tests.md
  • crates/ripr/src/analysis/facts/harness_registry.rs
  • crates/ripr/src/analysis/facts/harness_registry/tests.rs
  • crates/ripr/src/analysis/facts/mod.rs
  • crates/ripr/src/analysis/facts/role_composition.rs
  • crates/ripr/src/analysis/facts/stray_files.rs
  • crates/ripr/src/analysis/test_grip_evidence/tests.rs
  • crates/ripr/tests/outside_target_haystack.rs
  • docs/specs/README.md
  • docs/specs/RIPR-SPEC-0356-uncompiled-rust-files-contribute-no-tests.md
  • fixtures/perl-verdict-corpus/spec-coverage.toml
  • fixtures/python-verdict-corpus/spec-coverage.toml
  • fixtures/rust-verdict-corpus/spec-coverage.toml
  • fixtures/typescript-verdict-corpus/spec-coverage.toml
  • policy/doc-artifacts.toml
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 25, 2026 04:25
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verification questions

  • Confirm test-fact removal is intended to preserve index consistency, but the safety of indexing test_facts by retained test_order IDs depends on an upstream invariant that this diff does not prove.
  • Confirm the documented contract says any doubt keeps the file as before, but the implementation can classify a file as never compiled when a relevant Cargo manifest is not included in manifest_dirs.
  • Confirm cargo target discovery is inferred only from literal .rs names and mod stems; inferred target roots or generated paths can compile a candidate without matching either set.
  • Confirm never_compiled scans Cargo.toml files but does not model Cargo target declarations whose path is absent from the scanned text, such as workspace or package metadata generated or omitted from the index.
  • Confirm the sibling scan did not cover workspace Cargo metadata or Cargo target auto-discovery across every target kind; verification is needed for custom/default target paths.
  • Confirm the new withholding route removes test facts after composition, while fresh/reuse parity is covered only for a manifest-linked leaf addition.

Refuted

  • The parser-refused haystack assertion is inconsistent with the disclosed static_unknown limitation.; refuted because: The test explicitly scopes its claim to related-test absence and absence of a lexical-fallback limitation; it does not require classification to change, matching the spec's known limits.
  • The changed active-view region could be resized, detached, transferred, or compared against a stale backing-store length.; refuted because: No active-view region, ArrayBuffer, TypedArray, resize, detach, transfer, backing store, or length snapshot exists in the changed Rust paths; the implementation classifies indexed files and removes test facts from deterministic ordered collections.
  • The change should require a full Cargo target resolver or additional architecture rather than using conservative textual evidence.; refuted because: The stated acceptance delta is limited to removing credit for positively uncompiled files. Textual ambiguity is handled by retaining files, while explicit Cargo metadata and a general module resolver are declared non-goals.
  • The Rust analysis changes introduce or cross a JavaScript-backed worker, async, GC, detach, or transfer memory boundary.; refuted because: No JavaScript, worker, asynchronous callback, runtime object, GC handle, detached buffer, or ownership-transfer API appears in the changed Rust paths or tests; the patch only analyzes Cargo/module reachability and withholds Rust test facts.

Evidence gaps

  • Automated execution of the new Rust tests is not yet visible because cargo-test is scheduled late and the ripr sensor failed.
  • Model proof intent was rejected by deterministic validation.

Copy link
Copy Markdown
Member Author

Independent exact-head review: REPAIR_REQUIRED (source/contract defect).

[P2] Macro trivia turns an unknown module into a proven-excluded file

Location: stray_files.rs:108–109.

The guard recognizes only literal mod $. With a standard src/lib.rs, a custom bin declared as path='benchmarks/entry.rs', and benchmarks/hay.rs containing a test of the library:

// benchmarks/entry.rs
macro_rules! m { ($n:ident) => { mod
$n; } }
m!(hay);
fn main() {}

Cargo compiles and runs hay::corpus_case successfully. The rendered ripr report nevertheless drops benchmarks/hay.rs from related tests, retaining only tests/api.rs. Replacing the newline with a plain space preserves the test. mod/*trivia*/ $n; reproduces the same incorrect removal and also passes Cargo's real test run.

This violates SPEC-0356's “any doubt keeps the file as before”: generated module membership is unknown here, not proven excluded. collect_declared_modules also assumes literal mod . Fix direction: recognize Rust token boundaries/trivia and macro metavariables conservatively (or withhold exclusion on unresolved module-building macros), with rendered regressions for newline/comment variants beside the compact control. No general macro expansion is required.

Identity and ownership

  • Base: c0c0b049ffbdd539a3f365cf0196224857ae47e9, tree d1d68cda277b0fd0c09ae801646314977d943bc5.
  • Reviewed and re-read head: 4f588d08c6e19462b5879a0053a45b17d91de631, tree 0c6a397552b8a422805531c1da7e9c40b2163f3b.
  • Canonical repair remains claude/8999-probe-scan (Claude's existing claim under dogfood: tests added in the same diff are often not linked (nom, bitflags, chrono, log, tracing) #8999). No implementation branch or submitted-source edits.
  • Reconciled Conversation, submitted reviews and inline threads: existing automated questions/provider quota notices contain no completed equivalent discriminator; no duplicate completed independent receipt was found. This check supplies the missing concrete generated-root counterexample.

Observed proof

  • Linux, preinstalled rustc/cargo 1.95.0; locked dependencies; isolated review checkout/target.
  • Unmodified-head cargo test --locked -p ripr --test outside_target_haystack: 4 passed, exit 0.
  • Test-only cargo test --locked -p ripr --test review_10207_boundaries -- --nocapture: 5 passed, 2 failed, exit 101. Passing controls cover custom lib/bin/test/bench paths, compact macro, cfg path, and dynamic generated include. The two failures are rendered-output assertions for newline/comment macros.
  • Both dependency-free Cargo witness runs: 1 test passed, exit 0.
  • Experimental tree: 41dcd0fa580e29e9f9105d6a64f6b6061431972a; only one added integration-test file. Patch SHA-256: 714f9801feb45072c2f4f29e9f66ee190e87bb721e75c0f58cae3ae5524b1415. Temporary source removed afterward; reviewed checkout clean.
  • Initial experiment control/setup mistakes were corrected and their failed log retained separately; they are not product findings.

Not established: complete Cargo/generated-root coverage, unindexed custom roots, cross-platform behavior, full qualification, or hosted merge readiness. PR-body unit/reuse/mutation claims remain reported evidence. Existing hosted qualification run 40163202822 was in progress when inspected; no hosted work was requested here.

Next: canonical writer repairs the macro-trivia exclusion on this same candidate, retains the passing controls, then requests review of the changed head.

…luded file (#8999)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuJ5J2vLze4cRJra3suroQ

Copy link
Copy Markdown
Member Author

Repaired the REPAIR_REQUIRED finding on head 8ec3f07. builds_module_operands and collect_declared_modules now compare with comments stripped and whitespace ignored, so mod\n$n;, mod/*c*/$n;, mod // c\n$n; and include!\n($n) all withhold exclusion. Unit tests cover each form. The new rendered test a_module_building_macro_keeps_the_file_whatever_its_spacing (compact control plus three trivia variants) passes. Local: outside_target_haystack 5 passed, --lib stray_files 15 passed. I also fixed the value_facts_share_one_file_scan_per_file fixture, which relied on an unlinked src/other.rs. Requesting the required check on the new head.


Generated by Claude Code

…raw idents, mod.rs and computed includes (#8999)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuJ5J2vLze4cRJra3suroQ
…s escaped .rs literals (#8999)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuJ5J2vLze4cRJra3suroQ
graphite-app[bot]

This comment was marked as resolved.

…s names case-insensitively (#8999)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuJ5J2vLze4cRJra3suroQ

Copy link
Copy Markdown
Member Author

Independent review of head 1c02fba: CLEAR (index-level probes on a scratch copy; hosted proof still pending). Earlier rounds found and I repaired, each with regressions: mod/include spacing and nested comments, string and raw-ident forms, mod.rs, computed include!, file names with spaces/punctuation, backslash and continued path operands, and case-insensitive names.

Named residual (exotic, not fixed here): an external directory-to-module macro such as automod::dir!("benchmarks/…") outside src/, tests/, benches/, examples/ would still read the file as never compiled. Possible hardening: keep a file whose parent directory appears as a string literal in any source. Will note it on #8999.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

Required check on 1c02fba failed only at Golden output contracts, on drift this PR does not touch: 13 Python human-full fixtures plus rust_qualified_foreign_receiver, all from the new Next: lines. Reproduced on main merged into this branch locally. Fixes are already open: #10269 (Python fixtures) and #10253 (Rust fixture, with #10260 overlapping). I'm not adding a third re-bless; I'll merge main into this branch and relabel once those land.


Generated by Claude Code

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 3 potential issues.

Devin Review

Comment thread .ripr/traceability.toml Resolved
…tside-tree verdict (#8999)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LuJ5J2vLze4cRJra3suroQ
@EffortlessSteven
EffortlessSteven merged commit 497f091 into main Oct 25, 2026
59 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/8999-probe-scan branch October 25, 2026 10:01
EffortlessSteven pushed a commit that referenced this pull request Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants