Skip to content

chore(typeshed): sync to r-typeshed master and drop the ifelse overlay - #495

Merged
sims1253 merged 1 commit into
mainfrom
chore/typeshed-sync-drop-overlay
Sep 16, 2026
Merged

sims1253 merged 1 commit into
mainfrom
chore/typeshed-sync-drop-overlay

Conversation

@sims1253

Copy link
Copy Markdown
Owner

Sync provenance

Vendors r-typeshed master at merge commit f47b95f (PR #58 head 7e279cd; the merge tree is byte-identical to the PR head, verified by tree sha). This is the only commit master gained since the previous pin f2fe5de (r-typeshed 0.5.1, vendored in cab93af) -- nothing beyond #58 was vendored. SOURCE records commit: f47b95f, tree-state: clean, stubs-sha256: e5ccbee0.

Vendor diff: vendor/base/base.json alone -- base 0.0.18 -> 0.0.19, base::ifelse gains return_mode: {kind: test_template, test: test, values: [yes, no]}. All 48 stub files pass ry typeshed validate; every other vendored stub is byte-identical to the previous snapshot.

Refs sims1253/r-typeshed#58.

Overlay removal inventory

The upstream entry is structurally identical to the local overlay's, so the temporary overlay mechanism is deleted entirely:

  • crates/ry-typeshed/overlay/base.json -- removed (the whole overlay/ directory).
  • crates/ry-typeshed/src/lib.rs -- LOCAL_OVERLAY_JSON, apply_local_overlay(), and the load_base() merge removed; load_base now returns the parsed vendored stub directly.
  • Tests deleted: local_overlay_annotates_base_without_touching_vendor (asserted the vendor contains no return_mode -- false since this sync), local_overlay_stays_pinned_to_the_vendored_entry, and the sync-harness test_sync_preserves_the_local_annotation_overlay.
  • The vendor-pristine pin flipped rather than vanished: vendored_base_carries_the_ifelse_return_mode now asserts the vendored base itself carries the spec and that load_base surfaces it, so an upstream regression stripping RY106's data still fails CI. typeshed_preserves_embedded_schema_version tracks base 0.0.19.

RY106 unchanged

  • The vendored entry matches the overlay's byte-for-byte modulo indentation, so diagnostics are identical before and after.
  • cargo test --workspace: all green, including the 15 RY106 unit tests, the ifelse_mode_collapse_claim.R oracle claim fixture (cargo test -p ry-checker --test oracle -- --include-ignored, 17/17), and the corpus fixtures.
  • vendor_snapshot (glue) unchanged.

Corpus zero-delta

  • ecosystem/run.sh --check and ecosystem/run.sh --check --manifest ecosystem/posit-packages.txt: committed reports are current.
  • python3 ecosystem/check-ledger.py docs/corpus/posit-0.9.0.json docs/corpus/tidyverse-0.7.1.json: OK -- 421 / 88 findings, matching the committed baselines.

Gates

cargo fmt --all -- --check, cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace, oracle with --include-ignored, and python3 -m unittest discover -s scripts -p 'test_*.py' (13 tests) all pass.

Vendors r-typeshed master (merge commit f47b95f, tree-identical to the
PR #58 head 7e279cd; stubs-sha256 e5ccbee0): base 0.0.18 -> 0.0.19,
whose only stub change declares base::ifelse's test-template
return_mode -- the same spec ry carried in the local overlay.

With the spec upstream, the overlay mechanism is deleted: the
crates/ry-typeshed/overlay/base.json file, the load_base() merge
(apply_local_overlay and its compile-time embedding), and the overlay
tests (local_overlay_annotates_base_without_touching_vendor,
local_overlay_stays_pinned_to_the_vendored_entry, and the sync-harness
overlay-survival test). The vendor-pristine pin flips to assert the
vendored base itself carries ifelse's return_mode, so an upstream
regression that strips it still fails CI. RY106 diagnostics are
unchanged: the upstream entry is structurally identical to the
overlay's, both corpus ledgers stay at their 88/421 baselines, and the
committed ecosystem reports are current.

Refs sims1253/r-typeshed#58
@coderabbitai

coderabbitai Bot commented Sep 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 29 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: dd64fc7e-b488-4f4b-b9ad-80a9c0e43440

📥 Commits

Reviewing files that changed from the base of the PR and between ccbf518 and 67a9a33.

📒 Files selected for processing (5)
  • crates/ry-typeshed/overlay/base.json
  • crates/ry-typeshed/src/lib.rs
  • crates/ry-typeshed/vendor/SOURCE
  • crates/ry-typeshed/vendor/base/base.json
  • scripts/test_sync_typeshed.py

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

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 — every claim in the PR body was independently reproduced against primary sources (upstream blobs, the stubs-sha256 recipe, and the test suites), and all held.

  • Vendored sync to f47b95f: vendor/base/base.json bumps base 0.0.18 → 0.0.19 and gains base::ifelse's return_mode spec; SOURCE re-pins. Verified byte-identical to the upstream blob, stubs-sha256: e5ccbee0… reproduced exactly via the documented recipe over the tarball's stubs/ tree, and the upstream range f2fe5de...f47b95f is exactly r-typeshed PR #58 (merge and PR head share tree 5b789ba…, confirming the body's tree-sha claim). No other vendored stub changed.
  • Overlay mechanism deleted: overlay/base.json, LOCAL_OVERLAY_JSON, apply_local_overlay(), and the load_base() merge are gone; load_base now returns the parsed vendored stub directly. Zero overlay references remain in the worktree, and load_stub_file/validate_stub_dirs keep other callers, so no dead-code or clippy exposure. The upstream commit message explicitly endorses this drop at this revision.
  • Behavior unchanged by construction: the vendored ifelse entry is field-identical to the deleted overlay entry (params, return, return_mode), so the effective signature — and RY106 diagnostics — are identical before and after.
  • Test re-pinning: the flipped vendored_base_carries_the_ifelse_return_mode still fails CI on an upstream regression that strips the spec (it pins both the worktree vendor file and load_base()'s embedded data); the drift test and sync-harness overlay test are correctly deleted with their subject; the schema-version pin tracks 0.0.19.

Gates re-run locally: cargo test -p ry-typeshed 35/35 (including the flipped pin) and python3 -m unittest discover -s scripts -p 'test_*.py' 13/13, both green. Changelog omission matches convention — the previous sync (cab93af) also left the entry to release prep.

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

@sims1253

Copy link
Copy Markdown
Owner Author

Verdict

Approve. Every claim in the PR body was verified independently (GitHub API, local refs, full local gate runs); CI is fully green; no blocking or major findings. Two non-blocking nits below.

Findings

Minor (non-blocking)

  1. crates/ry-typeshed/src/lib.rs:1455-1463 — the flipped pin is presence-only: it asserts the string "return_mode" exists in the vendored file and that load_base() surfaces return_mode.is_some(), but never the spec's content. If upstream ever mutates the spec semantically (swaps test/values, changes kind), this pin still passes and coverage falls through to the 15 RY106 checker tests and the oracle claim fixture. Those do cover it end-to-end, so this is optional hardening, not a gap: consider asserting the parsed shape (kind == "test_template", test == "test", values == ["yes", "no"]) directly in the pin.
  2. crates/ry-typeshed/src/lib.rs:1456 — the contains("\"return_mode\"") string check is precise only while ifelse is the sole return_mode user in base.json. Verified true today (exactly one occurrence in the entire vendor tree), and the second assertion targets functions["ifelse"] specifically, so the test stays airtight regardless. Informational only.

No major or blocking findings.

Provenance verification

All verified against the GitHub API and local git, independently of the PR body:

  • r-typeshed master = f47b95fd59331bc1668bc5b55f54ee1c199fe228, a merge of f2fe5de + 7e279cd (parents confirmed via API).
  • f2fe5de..master is exactly two commits: 7e279cd (Plans 34–36: 0.9 evidence and LSP contract #58 head) and the merge itself — nothing beyond Plans 34–36: 0.9 evidence and LSP contract #58 was vendored.
  • Merge tree sha 5b789ba equals 7e279cd's tree sha — byte-identical trees, so vendoring at the PR head is vendoring merged master.
  • Upstream 7e279cd touched only stubs/base/base.json inside stubs/ (its other files are repo infrastructure — workflows, CHANGELOG, schema docs, audit scripts, tests — never vendored).
  • vendor/base/base.json is byte-identical (cmp) to the upstream master blob.
  • stubs-sha256 recomputed over the vendored tree (excluding SOURCE, per the sync script's own recipe) = e5ccbee0...762e, matching SOURCE exactly.
  • SOURCE follows the cab93af convention exactly (full commit sha, tree-state: clean, full digest).
  • Vendor diff from the merge-base is exactly two files: vendor/SOURCE and vendor/base/base.json; all other stubs unchanged by definition of the diff.
  • The vendored ifelse entry is field-identical (jq-normalized diff) to the deleted overlay entry — no behavioral drift by construction.
  • packages.txt needed no change: it is a versionless package list (cab93af touched it only to add new packages).

Note: the local ../r-typeshed checkout's master ref is stale at f2fe5de; all upstream checks above were therefore done via the GitHub API rather than that ref.

Deletion completeness (grep results)

grep -rni overlay across the whole worktree finds only benign matches, none referencing the deleted mechanism:

  • crates/ry-typeshed/vendor/bayesplot/bayesplot.json, crates/ry-checker/testdata/ok_package_qualified_resolution.R:13, fuzz/corpus/parse/seed_ok_package_qualified_resolution.R:13, fuzz/corpus/parse_and_check/seed_ok_package_qualified_resolution.R:13 — the bayesplot function ppc_dens_overlay.
  • crates/ry-checker/src/lib.rs:1242 — an unrelated doc comment about overlaying refined return types onto return slots in the checker.
  • crates/ry-typeshed/src/lib.rs:1445 — the new test's own doc comment, intentionally naming the removed overlay as historical context.

No hits in workflows, scripts, docs, or configs (*.yml, *.yaml, *.sh, *.py, *.md, *.toml all clean). scripts/sync_typeshed.sh never had overlay-awareness — it only copies stubs/ into vendor and writes SOURCE — so the absence of sync-script changes is correct, not an omission, and there is no dead code left in it.

Enforcement analysis

Simulated regression (upstream strips the spec; the weekly Typeshed bump sync runs):

  1. vendored_base_carries_the_ifelse_return_mode fails first, at the disk-read assertion on vendor/base/base.json — the bump PR cannot merge with the spec stripped.
  2. typeshed_preserves_embedded_schema_version fails in the same crate run on any version != 0.0.19, flagging that a bump occurred at all.
  3. If the ifelse entry were removed entirely, t.functions["ifelse"] panics via Index — still a hard failure.

Nothing formerly guarded is now unguarded: the deleted drift-pin (local_overlay_stays_pinned_to_the_vendored_entry) existed only because the overlay duplicated the vendored entry; with the duplicate gone there is no copy to drift. The pristine-vendor assertion (local_overlay_annotates_base_without_touching_vendor) is intentionally inverted, which is the point of this PR. The one residual softness is content-vs-presence, captured as finding 1.

Bot adjudication

  • CodeRabbit: produced no findings (rate-limited before its first review). Nothing to adjudicate.
  • Pullfrog (COMMENTED, "No new issues found", same head 67a9a33): I reproduced its verification chain myself and every claim holds (f47b95f pin, byte-identical blob, tree-sha identity, sha recipe, deletion completeness, gates). One imprecision: "Zero overlay references remain in the worktree" — there are several case-insensitive matches, all benign (see grep results); the substantive claim (no dangling references to the mechanism) is correct. Its note that upstream endorses the drop checks out: 7e279cd's commit message explicitly says ry "can drop the overlay and its pristine-vendor pin" once it picks the commit up.

Local verification

Detached worktree at 67a9a33 (merge-base ccbf518; main has not moved since, #483 is still open, and #374 does not exist as a PR — so no ledger re-baseline interfered with these numbers):

  • cargo test --workspace: all green, zero failures (includes every_known_package_loads, which validates the entire vendor dir — the "48 stubs pass ry typeshed validate" claim is CI-enforced, not merely manual).
  • RY106/ifelse unit tests: 15/15.
  • cargo test -p ry-checker --test oracle -- --include-ignored: 17/17 in ~44s against R 4.6.1 (version confirmed), including the ifelse_mode_collapse_claim.R fixture.
  • cargo test -p ry-checker --test vendor_snapshot: glue + purrr pass; the test file is unchanged by this PR.
  • cargo clippy --workspace --all-targets -- -D warnings: clean.
  • python3 -m unittest discover -s scripts -p 'test_*.py': 13/13 OK.
  • python3 ecosystem/check-ledger.py docs/corpus/posit-0.9.0.json docs/corpus/tidyverse-0.7.1.json: OK — 421 / 88, matching the committed baselines.
  • CI rollup on the PR: every check SUCCESS (Macroscope skipped per repo config).

CHANGELOG

Silence is correct on both legs. cab93af itself touched no CHANGELOG.md — the "Refresh the vendored typeshed to r-typeshed 0.5.1" lines were added later by release prep (7cf9723), matching the claimed precedent. And the overlay mechanism was never changelog-documented in the first place: #472's entry (the RY106 bullet) describes only the rule, and git log -S overlay -- CHANGELOG.md is empty. Release prep for 0.11.0 can consolidate the 0.0.19 bump alongside, as it did for 0.5.1.

@sims1253
sims1253 merged commit 35741bd into main Sep 16, 2026
16 checks passed
@sims1253
sims1253 deleted the chore/typeshed-sync-drop-overlay branch September 16, 2026 09:12
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