Skip to content

fix(xtask): distinguish empty test-efficiency evidence from pass - #8227

Merged
EffortlessSteven merged 2 commits into
mainfrom
fix/empty-test-efficiency-evidence
Oct 16, 2026
Merged

EffortlessSteven merged 2 commits into
mainfrom
fix/empty-test-efficiency-evidence

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Problem and behavior

cargo xtask test-efficiency-report previously wrote Status: pass with tests_scanned: 0 and tests: [] when its static collector selected no tests. Missing source roots are deliberately skipped, and existing Rust files without test functions also reach this path. An empty warning search was being treated as affirmative evidence.

Empty selections now report not_run in JSON and Markdown, with one shared explanation that test-efficiency evidence was not established and a workspace-root recovery hint. This is the same diagnostic distinction already used by the adjacent test-oracle report (#3688 / #3693).

Nonempty strong results remain pass; smoke/non-strong results remain warn. Advisory command success, zero denominators, classifications, suppressions and thresholds are preserved.

Scope and acceptance

One advisory report diagnostic; ordinary ripr-swarm repair. Accepted claim: empty selected evidence must not read as a pass. Spec: RIPR-SPEC-0004; new tests are mapped in the spec and .ripr/traceability.toml.

Production delta: the existing report-status owner checks for an empty ledger; a shared optional explanation feeds both renderers. The JSON explanation field is additive, present only for empty selections; existing report schema/version and fields remain.

Evidence delta: two real-producer tests exercise missing roots, existing no-test Rust sources, and populated strong/smoke controls. Independent process replay additionally checks populated-to-empty overwrite.

Non-goals: executing recommended tests, runtime-test success, analyzer promotions, product badge Unknown handling, workflows, security/protection settings, credentials, releases or deployments. The badge parser independently consumes ledger entries and ignores top-level report status; this patch makes no badge claim.

Exact candidate and proof

Candidate: f12420b675d544158723287a82e8b2ddbd5ccc2e.
Saved baseline: 97cc171257fd76a1b3b9e79cc41ad949e0ecc861.
Test-only red commit: 1178c17143817d3488adcab4d48faf3d04d2eb5c.
Linux x86_64, pinned Rust 1.95.0, locked Cargo graph, default language features.

  • Baseline actual command from empty fixture: native exit 0, JSON status=pass, tests_scanned=0, empty ledger; matching Markdown false pass. Independently reproduced for missing roots and existing no-test sources.
  • cargo test --locked -p xtask --bin xtask test_efficiency_ -- --nocapture: RED native 101, 8 passed / 1 intended failure (pass != not_run); GREEN native 0, 9 passed / 0 failed / 3717 filtered. Regression source unchanged between red and green.
  • cargo build --locked -p xtask: native 0 on candidate.
  • Independent exact-source/oracle review: no blocking findings. Independent actual candidate CLI: five cases passed, native exits all 0: missing roots and no-test roots -> not_run/0; strong -> pass/1/strong_discriminator; smoke -> warn/1/smoke_only; populated-to-empty overwrite -> not_run/0. Both renderers, explanation presence/absence, advisory behavior and denominators checked. Executable SHA256 stayed 514c071869b68e1727947865a82daf9bbeac81c0fef92b1fa6fc498f2e4b7b5c throughout replay.
  • Baseline worktree doctor, cargo check --locked -p xtask --all-targets, and cargo xtask check-fast: native 0. Baseline floor selected 5571 inherited paths against the saved old origin/main; independent Git path enumeration succeeded. This broad inherited floor is separate from the five-path repair diff.
  • Candidate cargo xtask check-fast: native 0, all 16 applicable gates passed; independently verified stable 5573-path selector against the saved older origin/main. Subsequent normal fetch refreshed origin/main to e660a99; actual merge base is the saved baseline 97cc171 and Git independently selects exactly the five repair paths. The broader check-fast receipt is retained with its original selector basis; fetching unrelated main content does not change the reviewed candidate.
  • Candidate cargo xtask precommit: native 0 on the fresh origin/main basis; canonical receipt head=f12420b675d544158723287a82e8b2ddbd5ccc2e, merge_base=97cc171257fd76a1b3b9e79cc41ad949e0ecc861, complete five-path change set, impacted package xtask, no skipped commands or limitations. Actual cargo clippy --manifest-path $REPO/Cargo.toml -p xtask --all-targets -- -D warnings passed. Receipt digest sha256:1db4e140c74ec380ffd82ef44071a7508ec2feab53573c39d4e6d7fdfeddec25.
  • Clean working tree and remote branch readback verified exact published head f12420b on 2026-10-16 06:22 UTC.

Hosted qualification completed successfully in run38861294382, attempt1. Full terminal log confirms16321tests passed/3skipped, both new regressions executed and passed, and doctests2passed/1ignored. Required aggregate Ripr Rust Small Result succeeded. Independent final audit and exact-head author COMMENT review5544413067 establish REVIEW_READY. Ordinary protected squash merged this candidate as97b2d224eb467b7c3b090acde86725e19d6a837b on2026-10-16 at07:33:14UTC.

Changelog, rollback and continuation

changelog.d/empty-test-efficiency-evidence.md uses canonical Internal / CI, a bullet and related issue reference. This contributor-facing xtask diagnostic does not change public analyzer outputs or golden fixtures. Rollback is the report guard, shared explanation and supporting tests/docs; no migration.

Terminal reconciliation — 2026-10-16 07:34 UTC

PR_MERGED: 97b2d224eb467b7c3b090acde86725e19d6a837b, ordinary expected-head squash of reviewed f12420b. Fresh GitHub readback confirms merged/closed; fetch verifies ancestor of main and exact five-file/110-line repair. Landed tree e64422bfa2fecf47138bc59ad1217d3f59a29866 equals the pre-merge clean integration calculation on main0b8dad52d85dc7271e4ddfeef8b6d375dc02784c. No conflict repair or behind-only restack.

Accepted bounded claim: an empty static selection produces not_run plus shared actionable explanation in both report formats, retaining zero denominators and advisory native success. Populated pass/warn controls remain unchanged. This lands the selected report diagnostic repair; it does not claim all unavailable recommended-test paths, runtime execution or badge Unknown handling are complete. Historical issue3688 remains closed; no unrelated issue disposition changed. The separately announced consumer-regression follow-up remains with its owner.

Qualification: existing required run38861294382 attempt1 and aggregate job116864231822 success. Actual hosted checkout c8da0da includes candidate; full native log independently inspected,16321passed/3skipped, both new tests PASS, doctests2passed/1ignored. Compilers, Clippy, goldens, fixtures, corpora and PR evidence contracts pass. Later main changes were inspected as unrelated; do not relabel original hosted checkout as a new full-suite run on the squash commit. No duplicate run, rerun or Ready toggle.

Final checks before merge: exact head unchanged, required context success, no unresolved threads/new material findings, active main ruleset18845973/no bypass, and current REVIEW_READY COMMENT5544413067. UB findings source-refuted; providerquota notices remain missing provider reviews, with independent substantive review supplied. Full classic protection read403 retained as reader limitation; GitHub accepted normal protected merge.

Evidence retention: full decoded terminal log SHA2564f0b2057049bf388e15fb35876c6a2ae51daaf4cd87f591899c021dffc5547c3 resolves earlier partial-log gap. Nextest artifact12030164289 metadata digest sha256:5282b3c355f04ae4a503bcaf730fb6161163f22015ab8a8f1d9b6ed5fc4da2f0; ZIP bytes not locally verified because signed executor transfer returned403. No load-bearing qualification remains dependent on ZIP transfer.

Resources: exact baseline/candidate executable witnesses, red/green logs, source bundle, independent CLI receipts and hosted terminal log retained for delivery-owner verification. Candidate branch/checkout and reusable warm Cargo cache retained awaiting that verification; no new worktree or owned background build/watch process remains. No source changes after reviewed head. No threshold, suppression, workflow, protection, credential, release or deployment change. Main-triggered qualification is separate and is not claimed completed here.

Next owner: parent delivery lane consumes this bounded landed claim and retained receipts, then selects any remaining unavailable-evidence diagnostic work. No remaining candidate-specific repair or merge action.

@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 16, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

The included review limit has been reached and this organization has disabled usage-based review continuation. Wait for reviews to reset or ask a billing admin to change After included review limits.

Next included review available in 3 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: c14afc2d-323b-45c3-a66f-7b091cd47948
📥 Commits

Reviewing files that changed from the base of the PR and between e660a99 and f12420b.

📒 Files selected for processing: 5
  • .ripr/traceability.toml
  • changelog.d/empty-test-efficiency-evidence.md
  • docs/specs/RIPR-SPEC-0004-test-efficiency.md
  • xtask/src/main.rs
  • xtask/src/tests.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Author synthesis of the independent exact-head review; disposition REVIEW_INCOMPLETE for hosted evidence, suitable for Draft publication.

Reviewed head f12420b, baseline 97cc171. Independent source/oracle inspection covered the shared status owner, both renderers, production collector reachability, report-index and badge consumers, JSON compatibility, spec, traceability and changelog. No blocking findings. Badge Unknown behavior remains outside this claim.

Observed proof: unchanged regression rejects the old pass-on-empty behavior (RED 8 pass/1 intended failure), then GREEN 9 pass/0 failed. Independent actual CLI replay passed five cases covering missing roots, existing no-test roots, strong/smoke controls and populated-to-empty overwrite; both formats, explanations, zero denominators and advisory success were checked. Candidate executable SHA256 514c071869b68e1727947865a82daf9bbeac81c0fef92b1fa6fc498f2e4b7b5c stayed unchanged. The reviewer corrected initially misleading one-line fixture stimuli through actual baseline replay before the committed tests.

Root verified native-zero check-fast (16 gates, retained old-origin selector basis) and fresh-origin precommit (complete five-path selection, exact candidate head/base, xtask all-target strict Clippy, no skips or limitations). No suppression, threshold, workflow, protection, credential, release or deployment change. Hosted qualification is not established and merge readiness is not claimed. Keep Draft; the delivery owner owns any later explicit qualification and current-head integration review.

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 16, 2026 06:27
@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.

Confirmed findings

  • Schema-version bump for the JSON explanation field is not documented; if downstream consumers strictly validate the JSON schema they could reject the new field or, conversely, omit it from allow-lists. No security exploit, but worth a release note.

Verification questions

  • Confirm xtask/src/main.rs:8520 — 'explanation' is emitted into the JSON object before 'reason_counts', but status/fields like 'advisory' are appended later; verify final key ordering matches any documented schema and that downstream JSON parsers accept the new key alongside existing readers. Place 'explanation' consistently with other optional/derived fields at end of object.
  • Confirm changelog entry credits issue #3688 (test-oracle) but PR body also references #3693; cross-link inconsistency is cosmetic and not load-bearing for the red/green claim.

Refuted

  • New tests might also need a populated-then-overwrite case because the report writes to disk between runs; refuted because: PR body claims independent process replay covers populated-to-empty overwrite; this is a runtime CLI replay, not a test. However, the red/green claim being verified is only empty-vs-pass, not overwrite semantics, so it is not required for the lane scope.
  • Sharing a &'static str helper for the explanation is unnecessary indirection and could be replaced by inlining two literals, eliminating a function.; refuted because: Two literal call sites already diverge on escaping (Markdown prose vs JSON string) and on field placement (Explanation: … line vs top-level explanation key); a single helper keeps the message identical and trivially greppable, while remaining adjacent to the owner it complements.
  • JSON 'explanation' is rendered via format!+json_escape interpolation rather than the existing structured builders.
  • Empty-selection override could mask tampered/forged evidence by always returning not_run; refuted because: Override triggers only on truly empty entries; the owner check is unchanged for nonempty entries, and the control test test_efficiency_nonempty_selection_keeps_pass_and_warn pins both pass and warn for populated selections.
  • Returning &'static str through Option<&'static str> from a function parameterized over a borrowed slice could create a self-referential or dangling aliasing pattern (e.g., closure capturing entries).; refuted because: The returned &str is bound to a string literal compile-time, not to entries. The slice is borrowed by-value for an is_empty check; no closure capture, no longer-lived reference, and no Box/Vec allocation that could fail. Pattern is the same as Other Literal-returning helpers in the same module (e.g., the existing fallback "pass"/"warn" returns).
  • Empty test set is meaningful 'pass' evidence that downstream should preserve; refuted because: PR spec invariant and test explicitly assert not_run for empty selection with tests_scanned=0 and explanation text; same diagnostic was adopted earlier for test-oracle (#3688) so the change is consistent and not overclaim.
  • Empty-evidence report might be produced by an async worker after detach and read with a stale view across worker boundary, masking not_run.; refuted because: xtask is single-threaded within this report path; the new tests run super::test_efficiency_report_impl() synchronously and then read the produced files. No worker boundary or detach exists to read across, so racy stale-view UB is not introduced.
  • The same false-pass pattern likely exists in test_coverage_report_status, duplicate_report_status, or test_oracle_report_status, making this fix under-scoped.; refuted because: xtask/src/main.rs grep over *_report_status owners: only test_efficiency_report_status returned 'pass' on empty; test-oracle already distinguishes not_run; coverage/duplicate report owners do not collapse to pass-on-zero. No latent twin found in this sibling scan; under-scoping premise is false for this diff.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

UB review disposition on unchanged f12420b: no material repair required; independently checked against source and consumers.

  1. Schema-version concern is refuted for the retained contract. The optional explanation adds no new required field and changes no existing field type. No closed test-efficiency report schema was found. The actual badge reader in crates/ripr/src/output/badge/test_efficiency.rs parses serde_json::Value, accepts additional keys, and explicitly requires version0.1; a producer-only bump would break that reader. docs/BADGE_ADOPTION.md documents a minimum shape rather than a closed key set. The spec, changelog and PR body document the empty-selection behavior and additive field. External readers assuming an undocumented closed key set remain an unestablished compatibility assumption, not an observed failure.
  2. JSON-order question is refuted by test_efficiency_report_json: schema_version, status, advisory and counts are already emitted in the initial string; explanation follows counts and precedes reason_counts. The assertion that advisory is appended later is incorrect. The retained readers parse JSON structurally; both new producer tests parse the final JSON successfully.
  3. #3688 is the historical issue and #3693 its repair PR; citing the issue in the fragment and both in the body is consistent provenance.

The independent reviewer agrees that the candidate should remain unchanged. Required run38861294382 attempt1 is progressing through strict Clippy after successful workspace/all-feature checks. Review remains REVIEW_INCOMPLETE until the actual required result, checkout and execution receipts are inspected. No rerun, Ready retoggle, threshold or suppression change.

EffortlessSteven commented Oct 16, 2026 •

Copy link
Copy Markdown
Member Author

Consumer compatibility review completed for author session 01a14343-9990-7269-a04a-860fefe520d9. Reviewed exact source candidate f12420b; current fetch/API confirms #8227 landed as 97b2d22. No duplicate source repair or CI rerun.

No blocking compatibility defect found. Both test-efficiency and sibling test-oracle JSON reports retain schema 0.1. Badge input schema 0.1 is distinct from native badge output 0.8 and Shields schemaVersion: 1. The actual badge reader (crates/ripr/src/output/badge/test_efficiency.rs::parse_test_efficiency_badge_summary) parses serde_json::Value, requires 0.1, consumes the ledger/classes/metrics, and ignores optional explanation/top-level status. A producer-only bump to 0.2 would break this retained reader. Documented minimum input is an open subset, not a demonstrated closed external validator. JSON key reordering is immaterial to that structural parser.

xtask/src/main.rs::{report_status_from_text,report_entry_status} preserves emitted not_run on individual JSON/Markdown artifacts. The emitter already puts status/advisory in its initial object header; the review premise that advisory is appended after explanation was incorrect. Index's reader is line-based/limited to its first 24 lines, so arbitrary-order acceptance is not claimed for that consumer. Neither a schema bump nor moving explanation to the object's end is warranted by these actual readers.

Boundaries: badge count audit and index aggregate status have separate collection/count semantics. Generic receipts default readable non-fail/non-warn reports to passed, but receipt_specs does not consume test-efficiency artifacts. These inherited boundaries do not establish report-availability propagation and are outside this source repair.

Unique follow-up coverage is committed/pushed as Draft #8248: #8248 — exact consumer head b99444d. Three reader regressions cover empty explained not_run, legacy omission, nonempty strong/smoke projections, 0.2 rejection, JSON key order, file discovery and both index serializers. Protocol-subset tests characterize readers; they are not a duplicate producer replay.

Evidence: current-head badge suite: 20 passed / 0 failed; unchanged index regression: 1 passed / 0 failed carried from 3e53b80ef with identical test/implementation. Current-head check-fast: 14 gates / 1 inapplicable skip, independently matching six-file selector; canonical precommit-v2 pass with exact head/base, complete change set, impacted ripr and xtask, all commands passed and no skips/limitations. Independent exact-head semantic/test-oracle review found no repair required. Conflict-free composition with landed main verified without claiming combined-tree execution. Full commands, identities and receipt digest are in #8248. Successor qualification is complete on unchanged b99444d: first required run38869131956, attempt1, succeeded. Its complete job log verifies actual checkout87fb49dc containing #8227,16330 nextest passes with3 skipped, and explicit passes for all3 consumer regressions and both producer regressions. Doctests separately passed2 with1 ignored. Current REVIEW_READY and merge-eligibility record is review5544988778 on #8248; the fresh REST PR snapshot is mergeable/clean with no unresolved inline thread. The requested endpoint is eligibility, and #8248 remains open. Artifact ZIP transfer is blocked by executor proxy403; qualification uses the complete checked job log, not an uninspected archive. Full identities, counts, limits and run links are maintained in #8248.

Coordination used this repository conversation because no direct messaging route to the named author session is exposed.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

REVIEW_READY — author synthesis of independent review and final exact-head qualification, 2026-10-16 07:33UTC.

reviewed_head_sha: f12420b.
integration_basis: hosted checkout c8da0da (parents e660a99 + candidate). Current main0b8dad52d85dc7271e4ddfeef8b6d375dc02784c merges cleanly (computed tree e64422bfa2fecf47138bc59ad1217d3f59a29866); intervening CLI guidance/closed-stderr handling, lifecycle/contributor docs and policy tests do not change this report's owner, collector, renderers, tests or consumers. Traceability overlap adds disjoint SPEC0190 entries.

claim_boundary / inspected surfaces: empty selected test-efficiency evidence must report not_run with matching Markdown/JSON explanation; nonempty pass/warn, advisory native success, zero denominators, thresholds and suppressions remain unchanged. Earlier exact-source/oracle/consumer review and independent five-case CLI replay remain current. Baseline and unchanged test-only RED discriminate the former pass-on-empty behavior; populated strong/smoke controls and overwrite replay challenge the repair. Spec, traceability, changelog and additive JSON contract inspected. Badge Unknown behavior is not claimed.

proof_and_ci_observed: required run38861294382 attempt1 completed SUCCESS; hosted Rust job116844050213 and required aggregate Ripr Rust Small Result job116864231822 both SUCCESS on this head. Full terminal decoded native log independently inspected: nextest16321run/16321passed (25slow),3skipped across107binaries; both new regressions explicitly PASS (16036/16321 and16039/16321). Doctests2passed/0failed/1ignored. Workspace/all-target and all-feature checks, strict Clippy, goldens, fixtures, corpora and PR evidence contracts passed. Independent terminal audit agrees. No duplicate CI or rerun. Relevant native profile has no filter/retry substitution; the3skips are not credited as passes. Selfhost/docs/scratch/advisory/report-upload alternatives skipped by workflow routing are not credited as tests or protection.

blocking_findings: none.
refuted_findings: UB optional-field schema bump/key-order/provenance concerns retain source-backed disposition in prior COMMENT; no repair warranted. No unresolved inline threads; current inventory has no new substantive finding. Provider quota remains missing review, not a clean review; independent substantive review supplies the allowed alternative.

requirements: branch summary requires Ripr Rust Small Result, now success; active main ruleset18845973 requires resolved threads and zero approvals, has no bypass actor. Both commits attributed to author. Full classic-protection read403 remains a reader limitation; normal protected expected-head operation will enforce applicable requirements. No protection edit or admin bypass.

residuals/non-claims: artifact metadata binds nextest artifact12030164289 to candidate (540064bytes, sha256:5282b3c355f04ae4a503bcaf730fb6161163f22015ab8a8f1d9b6ed5fc4da2f0), but ZIP bytes were not locally verified because executor transfer returned403. Full native log resolves the earlier partial-log gap; no load-bearing evidence remains dependent on that transfer. Third-party closed-key schema assumptions are unestablished, and no badge/runtime-test/release claim is made. Main-triggered workflows perform dry-run qualification; actual publication is manual-dispatch only and no release/deployment is requested.

disposition: REVIEW_READY for ordinary expected-head protected squash. This COMMENT records accountable review; it is not an author APPROVE event.

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.

1 participant