Skip to content

fix(ecosystem): gate every manifest package and add covr 4.0.0 to the default corpus - #946

Merged
sims1253 merged 5 commits into
mainfrom
fix/927-932-covr-corpus
Nov 28, 2026
Merged

sims1253 merged 5 commits into
mainfrom
fix/927-932-covr-corpus

Conversation

@sims1253

@sims1253 sims1253 commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

The default corpus gate ignored any manifest package missing from its ledger. reconcile.R intersected the processed packages with the ledger's packages list, so 8 of the 32 default-manifest packages and their 13 report findings were never reconciled. This PR closes that hole and adds r-lib/covr 4.0.0 to the corpus, as #927 requests.

 reconcile <- function(corpus_path, reports_dir, report_prefix = "", processed) {
   corpus <- jsonlite::fromJSON(corpus_path, simplifyDataFrame = TRUE)
-  audited <- intersect(processed, corpus$packages$name)
+  unledgered <- setdiff(processed, corpus$packages$name)
   ...
-  if (length(missing) || length(unowned)) {
+  if (length(missing) || length(unowned) || length(unledgered)) {   # names each missing package

The tidyverse ledger gains entries for rlang, withr, fs, cli, scales, jsonlite, testthat, curl and covr. covr is pinned at 7dbd4dea (CRAN v4.0.0) and has 0 findings: 0 in R/ and 0 at the package root. It adds 202 files to the parse differential with 0 disagreements. All 13 newly owned identities are false positives. For 12 of them the Posit ledger gives the same verdict at its own pins:

Identity Label / group Why
rlang tests/testthat/test-cnd-entrace.R:284:28 RY040, test-trace.R:592:28 RY040; cli tests/testthat/test-defer.R:4:11 RY040 FP / test-fixture deliberate 1 + "" errors that catch_cnd() / expect_snapshot(error = TRUE) catch
rlang test-cnd-message.R:480:8 RY040 FP / test-fixture "..." + "..." is quoted by enexpr() and never evaluated
rlang test-trace.R:323:5 RY091 FP / test-fixture a deliberate argument-less eval() under catch_cnd(), the error the test traces (Posit files it as type-narrowing)
rlang test-nse-defuse.R:329:22, :334:22 RY109 FP / ry109-self-defaults the function(x = x) defaults are only captured by enexpr()/enquo(), never forced
cli R/ansi-hyperlink.R:144:7, R/containers.R:41:7, R/status-bar.R:239:7, :242:7, :245:7 RY032 FP / manual-audit each operand is a single hyperlink field, container id or class name
testthat R/snapshot.R:313:7 RY032 FP / manual-audit variant comes from check_variant(), which returns "_default" or a string and aborts otherwise

The R checks in R 4.6 were: eval() errors "argument "expr" is missing", 1 + "" errors, and function(x = x) substitute(x) returns x without forcing. No identity is removed, and all 37 true positives remain.

real_world.R gains three covr idioms beyond #916. Each one has an adjacent true positive that must keep firing:

  • trace() exit calls built from quote(), next to an unbound exit helper that still fires RY010.
  • .Call() of the routines registered in src/reassign.c, next to an unbound data argument that still fires RY010.
  • withr::with_envvar() / local_dir() with rex shortcuts, next to 1 + "a" under with_envvar() that still fires RY040.

Follow-ups, not done here: the ledger file names still carry versions (tidyverse-0.7.1.json), and ecosystem/run.sh still hardcodes the Posit message-ledger path and the --local glue path (#932, item 2). I left the run.sh paths alone because a # messages: directive would let a copied manifest update the canonical message ledger.

Proof:

  • ecosystem/run.sh --check reports current reports for both manifests: default 4399 files, Posit 8397 files and 215 message identities. RY_BINARY was a release build of this branch.
  • check-ledger.py passes on both ledgers and parse-differential.json.
  • test-reconciliation.R Test 11 fails before the reconcile.R change and passes after.
  • A ledger copy without covr makes reconcile-reports.R exit 1 with manifest packages missing from the ledger: covr. The committed ledger exits 0, and the old reconcile.R exits 0 on the same copy.
  • cargo test -p ry-checker --test corpus passes.

Reviewed with sol-loop: 1 round with gpt-6.2-sol on high. Sol verdict: approved. I fixed nit S1 (swapped group counts in the ledger note). I declined S2 (report unledgered packages before reading reports): run.sh always writes a report for each processed package. I declined S3 (drop the duplicate .Call() fixture): the multi-line reset() call is covr's own layout.

Stacked on #944 (fix/928-typeshed-0.7.0). Retarget to main after it merges.

After #944 merged, I rebased this onto main (r-typeshed v0.7.1) and retargeted it to main. Both ecosystem/run.sh --check runs report "committed reports are current" with the rebased head's release binary. After that, the review bots' fixes landed: read_actual_identities() takes processed, a missing ledger entry prints its own fix-it hint, and Test 11 builds its own fixture and asserts the message (Rscript ecosystem/test-reconciliation.R passes).

Closes #927
Closes #932

Claude Opus 5.5 on behalf of Max

Confidence Score: 5/5 · The PR appears safe to merge; no actionable issues were found.RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable issues were found.

Summary

Reconciliation now rejects processed packages missing from the ledger, including packages with empty reports.

  • The ecosystem gate checks every processed package against its ledger.
  • The default corpus tracks covr 4.0.0 and eight other packages.
  • Checker fixtures now cover common patterns from covr.

All three ledgers passed their count checks. The R regression tests could not run because Rscript is unavailable.

Acknowledged by sims1253: reporting missing ledger packages before reading reports was declined because run.sh writes every processed report. The duplicate .Call() fixture was retained to match covr's layout. Versioned ledger filenames and the hardcoded message-ledger and local-source paths remain deferred.

Reviews (1) · Last reviewed commit: "docs(corpus): correct the new audit-grou..." · Reviewed by Greptile

Summary by CodeRabbit

  • New Features
    • Added covr 4.0.0 to ecosystem coverage, with its diagnostic results included in package summaries.
  • Bug Fixes
    • Reconciliation now reports an error when a processed package has no corresponding record, instead of silently skipping it.
  • Documentation
    • Updated corpus coverage details and diagnostic totals to reflect the expanded package data.

@coderabbitai

coderabbitai Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The default ecosystem corpus adds covr and additional package ledger records. Checker fixtures cover covr-related R patterns. Reconciliation now fails when a processed package is missing from the ledger.

Changes: Ecosystem corpus and reconciliation

Layer / File(s) Summary
Add package records and corpus statistics
ecosystem/packages.txt, docs/corpus/tidyverse-0.7.1.json, docs/corpus/parse-differential.json, ecosystem/reports/SUMMARY*, docs/corpus/README.md
The manifest and ledger add covr and eight other package records. The ledger adds 13 false-positive findings and updates classification and audit-group totals. Corpus statistics and diagnostic summaries include the new package data.
Add real-world checker fixtures
crates/ry-checker/testdata/cases/real_world.R
Fixtures cover trace exit calls, registered .Call() symbols, rex patterns, and code evaluated through withr::with_envvar(). Expected results include no diagnostics, RY010 for unbound names, and RY040 for invalid arithmetic.
Fail for packages missing from the ledger
ecosystem/reconcile.R, ecosystem/test-reconciliation.R, docs/corpus/README.md, CHANGELOG.md
Reconciliation checks all processed packages and returns failure when any are absent from the ledger. A test covers a clean report for an unledgered package. The documentation and changelog state the requirement.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: Minimal · up to cbeb5 · assessed changes only

Path filters excluded changed files. This rating applies only to the assessed changes.

Pre-merge checks: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Linked Issues check Inconclusive [#927, #932] Most coding requirements have supporting evidence in the PR summary. ecosystem/packages.txt pins covr to 7dbd4deaea58f8d9533b7538bf5c16acad5764ba. The tidyverse ledger adds covr and t… Confirm the covr row in ecosystem/reports/SUMMARY.root.md and the covr root report. Confirm that the root-level covr finding count matches the ledger's covr entry. If a root finding exists, its ledger identity and classification must be s…
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title names the two main changes: reconciliation now gates every manifest package, and covr 4.0.0 is added to the default corpus. The changeset matches both. The title uses the conventional-commit…
Out of Scope Changes check Passed Every changed area maps to #927 or #932. The changes cover ecosystem/reconcile.R, ecosystem/packages.txt, the tidyverse ledger, parse-differential.json, docs/corpus/README.md, the ecosystem re…
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the two main changes: reconciliation now gates every manifest package, and covr 4.0.0 is added to the default corpus. The changeset matches both. The title uses the conventional-commit 'fix(ecosystem):' scope, which is clear. It is 84 characters, which is slightly long but still readable.

Full details: Out of Scope Changes check

Explanation

Every changed area maps to #927 or #932. The changes cover ecosystem/reconcile.R, ecosystem/packages.txt, the tidyverse ledger, parse-differential.json, docs/corpus/README.md, the ecosystem reports and test-reconciliation.R, the real_world.R fixtures, and CHANGELOG.md. These files implement the reconciliation fix, the covr corpus entry, the false-positive triage, or the regression pins. The changelog entry documents the same behavior. The only excluded file, corpus__cases_real_world.snap, is a snapshot for the new fixtures. Its exclusion does not show an unrelated change.

Full details: Linked Issues check

Explanation

[#927, #932] Most coding requirements have supporting evidence in the PR summary. ecosystem/packages.txt pins covr to 7dbd4deaea58f8d9533b7538bf5c16acad5764ba. The tidyverse ledger adds covr and the other eight packages. reconcile.R now fails on processed packages missing from the ledger (#932). The three covr idioms are added to real_world.R with adjacent true positives (#927). The 13 newly owned identities are labelled false positives with audit groups (#932). The versioned-name and hardcoded-path items are deferred. The issue text calls them optional ("Consider"), so the deferral is acceptable.

The evidence conflicts on the covr root count. The PR description says covr has 0 findings in R/ and at the package root. The acceptance criterion in #927 requires 0 false positives in R/ and the root. ecosystem/reports/SUMMARY.root.md is described as reporting one RY032 finding for covr. No covr identity is listed among the 13 false positives. The ledger and run.sh --check claims cannot be checked from the summary alone.

The committed crates/ry-checker/tests/snapshots/corpus__cases_real_world.snap is in ignored_files. The cargo test -p ry-checker --test corpus result depends on it, so that result is unverified here.

Resolution

Confirm the covr row in ecosystem/reports/SUMMARY.root.md and the covr root report. Confirm that the root-level covr finding count matches the ledger's covr entry. If a root finding exists, its ledger identity and classification must be stated, and the #927 acceptance text must be reconciled with it. Confirm that ecosystem/run.sh --check and ecosystem/check-ledger.py pass against the committed reports. The snapshot file is excluded from review, so its content cannot be assessed here. Confirm the corpus test result from the snapshot file in a reviewable form.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the ledger at dawn,
Covr joins the rows, its findings gone.
Trace and rex leave footprints neat,
Withr’s tests hop into the suite.
Missing pages cannot hide,
The corpus counts them side by side.

Recent review info

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: Advanced
  • Run ID: b1643765-ca7d-44a3-a16b-993c17475116
Commits

Reviewing files that changed from the base of the PR and between 5d86737 and cbeb5a6.

Files ignored due to path filters: 1

  • crates/ry-checker/tests/snapshots/corpus__cases_real_world.snap is excluded by !**/*.snap
Files selected for processing: 12

  • CHANGELOG.md
  • crates/ry-checker/testdata/cases/real_world.R
  • docs/corpus/README.md
  • docs/corpus/parse-differential.json
  • docs/corpus/tidyverse-0.7.1.json
  • ecosystem/packages.txt
  • ecosystem/reconcile.R
  • ecosystem/reports/SUMMARY.md
  • ecosystem/reports/SUMMARY.root.md
  • ecosystem/reports/covr.root.txt
  • ecosystem/reports/covr.txt
  • ecosystem/test-reconciliation.R

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@pullfrog pullfrog 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.

ℹ️ No blocking issues — one naming nit inline and two sequencing notes below; every artifact-level claim re-checked locally and holds.

Approach: sound — failing closed at the manifest↔ledger boundary (setdiff where intersect() used to be) is the right fix for the silent-skip hole, the gate applies to both lanes, and the corpus delta is fully reconciled with the fixtures copied from covr's own sources.

Reviewed changes — all 13 files of the delta against fix/928-typeshed-0.7.0, with the counts re-derived locally (ledger↔manifest↔reports consistency, SUMMARY cells, source_sha256 recipe, Posit-verdict cross-check, covr fixture provenance) and the ecosystem, posit, Oracle (R), test, and Lint gates green at head.

  • reconcile.R un-ledgered gate: reconciliation now reads every processed package's report and exits 1 with manifest packages missing from the ledger when a manifest package lacks a ledger entry — before, intersect() dropped 8 of 32 default-manifest packages (and their 13 findings) from the gate silently.
  • Test 11 (test-reconciliation.R): pins the new gate; it exits 0 under the old intersect() logic, and it runs in the ecosystem CI job (ecosystem.yml:67).
  • covr 4.0.0 + full ledger coverage: covr pinned at 7dbd4dea (0 findings, 0-byte reports) and 9 ledger entries added so all 33 manifest packages are gated (posit stays 62 = 62, so its lane holds too); the 13 newly owned identities are all false_positive (5 test-fixture, 2 ry109-self-defaults, 6 manual-audit), leaving 37 TP / 43 FP / 0 — exactly the README, ledger note, and report lines.
  • real_world.R regression pins: three covr idioms pinned # no-diag (trace()/quote() exit calls, .Call native symbols, withr/rex), each beside an adjacent # expect: case proving RY010/RY040 still fire in the same shape; cargo test -p ry-checker --test corpus passes locally and in CI.
  • Docs and CHANGELOG: README numbers (33 packages, 80 diagnostics, 37/43/0, 4399 parse files) and the Unreleased bullet match the committed artifacts; the unchanged source_sha256 is correct because covr's empty root report contributes zero bytes to the recipe.

ℹ️ Merging closes #932 while its item 2 stays deferred

The diff resolves #932's gate bug and the triage its title asks for, but the body's problem 2 — the versioned ledger filename (tidyverse-0.7.1.json) and run.sh's hardcoded Posit-message and --local glue paths — is explicitly deferred, and Closes #932 retires the only tracker it has. Consider filing the follow-up issue (or narrowing the closer) before this merges.

Technical details
# #932 item 2 loses its tracker on merge

## Affected sites
- `ecosystem/run.sh:423` — `posit_corpus` hardcoded to `docs/corpus/posit-0.9.0.json`
- `ecosystem/run.sh:285-289` — the `--local` path hardcoded to the `glue` testdata package
- `docs/corpus/tidyverse-0.7.1.json` — the versioned filename #932 asks to reconsider

## Required outcome
- The deferred naming/paths cleanup stays tracked after #932 auto-closes on merge (a follow-up issue, or scope this PR's closer to the gate item).

## Open questions for the human
- Or should the follow-up ride the 0.13.0 release screening instead of its own issue?

ℹ️ The red Build & test / Check checks are inherited from the stacked base

Both this PR and base #944 fail the same four ry-cli e2e tests — all RY010-expectation fixtures in package/testthat contexts, plausibly the base's rlang-stub vendoring now resolving names like enquo. Nothing in this delta touches Rust or ry-cli testdata: this PR's own gates are green, and the corpus tests passed inside the red job. No change is requested here — but the stack cannot merge until #944 turns Build & test green.

Technical details
# Build & test failures are the base's, not this delta's

## Affected sites
- `crates/ry-cli/tests/e2e/config_e2e.rs:436` — `package_test_fixtures_are_skipped_by_default` ("test code was skipped")
- `crates/ry-cli/tests/e2e/config_e2e.rs:461` — `check_test_fixtures_config_opts_back_in`
- `crates/ry-cli/tests/e2e/config_e2e.rs:856` — `package_test_context_supplies_suggests_and_namespace_imports` ("enquo must stay unbound there")
- `crates/ry-cli/tests/e2e/stdin_e2e.rs:298` — `package_context_uses_stdin_instead_of_stale_disk` (expected RY010 on `tests/testthat/helper-main.R`, got `[]`)

## Required outcome
- None in this PR. The failures are byte-identical at base #944's head 56bdf69 (job 140838094376) and this head (job 140841792639) — root-cause and fix on #944.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using glm-5.3 | 𝕏

Comment thread ecosystem/reconcile.R Resolved
@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

✅ OpenCodeReview: Review complete: 0 finding(s) across 4 selected item(s).

Comment thread ecosystem/reconcile.R Resolved
Comment thread ecosystem/reconcile.R Resolved
Comment thread ecosystem/test-reconciliation.R Resolved
Comment thread ecosystem/test-reconciliation.R Resolved
…mits

reconcile() intersected the processed packages with the ledger's packages,
so a manifest package without a ledger entry left the gate silently.

Closes #932
…manifest package

Pins r-lib/covr 7dbd4dea (0 findings) and adds ledger entries for rlang,
withr, fs, cli, scales, jsonlite, testthat, curl and covr. Their 13 report
identities are reviewed false positives (see the ledger note).

Closes #927
Closes #932
@sims1253
sims1253 force-pushed the fix/927-932-covr-corpus branch from 29440d4 to a8d3aea Compare November 28, 2026 04:49
@sims1253
sims1253 changed the base branch from fix/928-typeshed-0.7.0 to main November 28, 2026 04:49
@sims1253
sims1253 force-pushed the fix/927-932-covr-corpus branch from a8d3aea to cbeb5a6 Compare November 28, 2026 04:50
@sims1253
sims1253 merged commit 95fd908 into main Nov 28, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant