Skip to content

fix(typeshed): resolve set6 and dictionar6 imports - #441

Open
sims1253 wants to merge 1 commit into
mainfrom
t3code/ry-sprint-typeshed
Open

fix(typeshed): resolve set6 and dictionar6 imports#441
sims1253 wants to merge 1 commit into
mainfrom
t3code/ry-sprint-typeshed

Conversation

@sims1253

@sims1253 sims1253 commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Packages with import(set6) or import(dictionar6) report valid exports as unbound when those dependencies are not installed. Vendor the complete export inventories from r-typeshed #41, register both packages, and test the CLI with installed-library lookup disabled.

import(set6) → bundled exports → Set, Reals, Interval resolve
importFrom(set6, Set)          → only Set resolves
                              → Reaals still reports RY010

The stubs keep R6 generators opaque and function formals inference-only. The upstream runtime tests compare all exports and formals against set6 0.2.4 and dictionar6 0.1.3. This PR records the clean upstream commit in vendor/SOURCE; merge the typeshed PR first.

On the pinned sources from #366, param6 0.2.4 goes from 133 diagnostics to zero and distr6 1.6.9 from 191 to 10. All 314 removed findings are RY010s for verified exports. No diagnostic is added, and all remaining findings match the baseline. Source hashes, reproduction commands, and limits are in docs/corpus/set6-inventory.md. Other missing dependency inventories remain outside this change.

A wider comparison used the same baseline binary with only the two new stub directories as overrides across 472 local package checkouts. Diagnostics fell from 3,106 to 2,784: 322 RY010s removed, none added. Only param6 and distr6 changed; that panel uses distr6 1.8.4, which accounts for the larger reduction. Every removed name is a verified export. The bundled binary produces identical results for both reported packages and for the changed corpus packages.

Validation:

  • The new CLI regression fails on 92c822a and passes with the vendored stubs. It covers wholesale imports, selective imports, absent imports, and a misspelling.
  • cargo test --locked --workspace, Clippy with warnings denied, formatting, and the full R oracle (--include-ignored) pass.
  • Typeshed validation passes for all 38 stub files. The sync harness and release-checksum unit tests pass.
  • The tracked tidyverse corpus matches its committed reports. All GitHub CI jobs pass, including the Posit corpus and ledger regression checks. The extra local full-tier Posit run was stopped after CI passed; it is not counted as a completed check.
  • Pullfrog reviewed this commit and the upstream typeshed PR and found no new issues.

@coderabbitai

coderabbitai Bot commented Sep 11, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 3231ff79-4e57-4713-b770-f36985478af2

📥 Commits

Reviewing files that changed from the base of the PR and between 92c822a and 2d81251.

📒 Files selected for processing (7)
  • CHANGELOG.md
  • crates/ry-cli/tests/config_e2e.rs
  • crates/ry-typeshed/packages.txt
  • crates/ry-typeshed/vendor/SOURCE
  • crates/ry-typeshed/vendor/dictionar6/dictionar6.json
  • crates/ry-typeshed/vendor/set6/set6.json
  • docs/corpus/set6-inventory.md

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


📝 Walkthrough

Walkthrough

The change bundles export inventories for set6 and dictionar6, registers both packages, updates the vendored source pin, and adds end-to-end coverage for import resolution and unknown-name diagnostics.

Changes

Bundled package inventories

Layer / File(s) Summary
Package inventory definitions
crates/ry-typeshed/vendor/set6/set6.json, crates/ry-typeshed/vendor/dictionar6/dictionar6.json
Adds opaque function and dataset declarations for set6 and dictionar6.
Inventory registration and source pin
crates/ry-typeshed/packages.txt, crates/ry-typeshed/vendor/SOURCE
Registers both packages and updates the vendored r-typeshed commit and checksum.
Import diagnostic validation
crates/ry-cli/tests/config_e2e.rs, docs/corpus/set6-inventory.md, CHANGELOG.md
Tests whole-package imports, selective imports, absent imports, and continued reporting of Reaals. Documents the inventories and records the fix.

Priority: ➖ Normal

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

Severity of issue fixed: Medium

Sequence Diagram(s)

sequenceDiagram
  participant Fixture as Fixture package
  participant CLI as ry check
  participant Inventories as Bundled inventories
  participant Diagnostics as RY010 diagnostics
  Fixture->>CLI: Analyze NAMESPACE and use.R
  CLI->>Inventories: Resolve set6 and dictionar6 exports
  Inventories-->>CLI: Return bundled names
  CLI->>Diagnostics: Report unresolved names
  Diagnostics-->>Fixture: Preserve Reaals as unbound
Loading

Merge Risk: ⚪ Minimal · up to 2d812

The bundled inventories, registration, and import-diagnostic coverage introduce no established merge-blocking risk.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. (6 skipped: 6 …
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: fixing bundled typeshed imports for set6 and dictionar6.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch t3code/ry-sprint-typeshed

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 bundled names,
Through set6 fields and dictionar6 lanes.
Known names bind without delay,
While Reaals stays astray.
Clean imports hop through tests today.

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

@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 new issues found.

Reviewed changes

  • Vendored set6 and dictionar6 export inventories from r-typeshed @ cadfe7a — both JSONs verified byte-identical to upstream, and the vendor/SOURCE stubs-sha256: 0a59363… reproduces exactly from the upstream tarball via the scripts/sync_typeshed.sh recipe; ry typeshed validate reports 38 stub files, 0 errors.
  • Registered both packages in crates/ry-typeshed/packages.txt — the build script's registration ↔ vendor assertions hold and the embedded table builds cleanly.
  • New CLI e2e regression bundled_set6_imports_bind_exports_without_hiding_misspellings covering wholesale imports, selective importFrom, absent imports, and the Reaals misspelling control, all under RY_NO_INSTALLED_LIBRARIES=1. Exact assertions, and falsifiable: reverting crates/ry-typeshed to base 92c822a makes it fail with all seven names unbound.
  • Corpus record docs/corpus/set6-inventory.md — every number reproduced end-to-end on the checksum-verified CRAN sources with the built binary: param6 133→0, distr6 191→10 (8 RY010 + 2 RY100); the diagnostic diff against baseline is 181 removed, all RY010, every removed name present in the new inventories, zero added, and the remaining 10 are an exact subset of the baseline (133 + 181 = 314, as claimed).
  • CHANGELOG ### Fixed bullet citing closing issue #366, matching the section's sibling style.

Inventory completeness was also checked against the packages themselves: set6.json contains exactly the 106 export() names from set6 0.2.4's NAMESPACE (no extras, none missing), and dictionar6.json is exactly Dictionary + dct. This meets the #366 screening bar — static inventories only, misspelling diagnostics preserved. cargo fmt, cargo clippy -p ry-cli --all-targets, and the sync-harness unittest suite (13 tests) all pass.

Pullfrog  | View workflow run | Using openai-compatible/glm-5.3𝕏

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