Skip to content

docs: update descriptions#13438

Merged
kgryte merged 2 commits into
developfrom
philipp/drift-random-2026-07-12
Jul 12, 2026
Merged

docs: update descriptions#13438
kgryte merged 2 commits into
developfrom
philipp/drift-random-2026-07-12

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

Normalizes the distribution name "betaprime" (concatenated) to the canonical "beta prime" (two words) in @stdlib/random/betaprime's prose and metadata. Every other distribution package in @stdlib/random/* already spells its multi-word distribution name with proper spacing/hyphenation (e.g., "chi-square distribution", "negative binomial distribution", "discrete uniform distribution", "inverse gamma distribution", "Student's t-distribution"), and every sibling betaprime package under @stdlib/random/base, @stdlib/random/array, @stdlib/random/strided, and @stdlib/stats/base/dists already uses "beta prime" in its package.json description; @stdlib/random/betaprime was the lone holdout.

Namespace summary

  • Members analyzed: 41 (@stdlib/random/{arcsine, array, base, bernoulli, beta, betaprime, binomial, cauchy, chi, chisquare, cosine, discrete-uniform, erlang, exponential, f, frechet, gamma, geometric, gumbel, hypergeometric, invgamma, iter, kumaraswamy, laplace, levy, logistic, lognormal, negative-binomial, normal, pareto-type1, poisson, rayleigh, sample, shuffle, streams, strided, t, tools, triangular, uniform, weibull}).
  • Distribution subset: 33 (excludes 6 umbrella packages that re-export sub-namespaces — array, base, iter, streams, strided, tools — and 2 non-PRNG helpers — sample, shuffle).
  • Features with clear majority (≥75%): file tree, package.json shape (18 keys, identical across 33/33 distributions), README section list (UsageNotesExamplesSee Also, identical across 33/33), JSDoc @throws list in main.js and factory.js (identical across 33/33), @example counts (2 per main.js, 2 per factory.js, 4 per index.js), keyword base set (19 keywords present in 33/33), output-policy taxonomy (continuous → real_floating_point_and_generic, discrete → real_and_generic), factory arity taxonomy (unary/binary/ternary matches distribution parameter count), examples file line count (53 in 33/33), and prose distribution-name spelling (spaced/hyphenated in 32/33 distributions; betaprime is the sole outlier).
  • Features excluded (no clear majority within namespace): presence of lib/main.js/lib/factory.js/benchmark files (~80% present; the 6 umbrella packages legitimately re-export sub-namespaces, sample/shuffle use a different benchmark shape), copyright year (staleness, not drift).

@stdlib/random/betaprime

Fix betaprimebeta prime in prose across lib/main.js, lib/index.js, lib/factory.js, package.json, and README.md (four JSDoc description lines, the manifest description field, and the intro blockquote plus three .method() blurbs). Every other @stdlib/random/* multi-word distribution name is spaced or hyphenated — chi-square, negative binomial, discrete uniform — and every sibling betaprime package across base, array, strided, and stats/base/dists already says "beta prime"; this package was the lone holdout. Link anchors (@stdlib/random/base/betaprime) are untouched, only display text and prose; docs/repl.txt and docs/types/index.d.ts are excluded per the standard drift-audit convention.

Related Issues

None.

Questions

None.

Other

Validation

  • Structural feature extraction. Walked every direct child of lib/node_modules/@stdlib/random/ and captured file trees, package.json key sets and keywords arrays, README ##/### heading sequences, and test/benchmark/example file naming. File presence is uniform across the 33-package distribution subset; package.json top-level key set is identical (18 keys); the 19-keyword base set (stdlib, stdmath, mathematics, math, statistics, stats, prng, rng, pseudorandom, random, rand, generator, seed, seedable, ndarray, multidimensional, array, vector, matrix) is present in 33/33; README heading sequence is identical.
  • Semantic feature extraction. Sonnet agent read lib/main.js, lib/index.js, and lib/factory.js across a representative subset covering unary/binary/ternary arity and continuous/discrete support (arcsine, beta, betaprime, hypergeometric, frechet, normal, negative-binomial, pareto-type1, lognormal, discrete-uniform). @throws lists in main.js and factory.js, output-policy naming, exports end-of-file comments, and dtypes-module requires are all identical across the sample; the only substantive semantic outlier was betaprime's use of "betaprime distribution" as the distribution name in prose, contradicting the canonical two-word form used by every other package in the sample.
  • Three-agent drift validation. Opus semantic-review, Opus cross-reference, and Sonnet structural-review each independently returned confirmed-drift for the betaprime prose-normalization candidate. Cross-reference read every test file (test.js, test.main.js, test.factory.js, test.assign.js) and examples/index.js under @stdlib/random/betaprime and confirmed nothing string-matches the current phrasing; type-only checks in docs/types/test.ts do not depend on description text.
  • Cross-run dedup. No open PR against stdlib-js/stdlib targets this fix; the open drift/propagation PR chore: propagate recent develop fixes to sibling packages (2026-07-10) #13410 touches stats/base/dists/betaprime/{pdf,logpdf} (a different pattern in a different subtree) and is unrelated. No PR merged in the last 14 days applies this fix.

Deliberately excluded

  • The 6 umbrella packages (@stdlib/random/{array, base, iter, streams, strided, tools}) legitimately re-export sub-namespaces and have no lib/main.js / lib/factory.js by design; the missing files are not drift.
  • @stdlib/random/{sample, shuffle} implement collection-sampling primitives with a single-file benchmark/benchmark.js and test/test.js shape rather than the ndarray-multi-shape benchmark/test pattern used by the distributions; the shape difference reflects a genuine semantic difference (they do not produce ndarrays and take no shape argument).
  • docs/repl.txt and docs/types/index.d.ts under @stdlib/random/betaprime still contain "betaprime distribution" in eight further places. Excluded per the drift-audit convention that treats these as generator-owned; leaving them for a scaffold-source sync (see below).
  • The scaffold data file lib/node_modules/@stdlib/random/scripts/scaffolds/binary/scripts/data/betaprime.json contains the same "betaprime distribution" phrasing in its from_desc, readme_from_desc, and three repl_text_*_desc fields. Fixing the scaffold source is out of scope for a per-package drift correction — regenerating from a corrected scaffold and re-syncing docs/repl.txt, docs/types/index.d.ts, and the sibling packages' auto-populated ## See Also entries is a separate, larger sweep. Logged for the next run.
  • Copyright-year variance in @stdlib/random/hypergeometric (2026 vs 2025 elsewhere) is staleness from a recent touch, not drift.
  • Description-style differences on non-hyphenated distributions (e.g., "lognormal" vs "log-normal", "Kumaraswamy" vs "Kumaraswamy's double bounded") were noted but not corrected — these lack a clear majority within the namespace and cross into stylistic territory outside the drift-audit's mechanical-fix mandate.

Checklist

AI Assistance

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

This PR was authored by Claude Code on behalf of @Planeshifter as an automated cross-package API drift audit of @stdlib/random. The target namespace was picked at random from the 122 stdlib namespaces containing ≥8 direct package children. Structural features were extracted from every member; semantic features were extracted via an LLM agent from a distribution-arity-diverse subset; each proposed correction was independently confirmed as confirmed-drift by three parallel reviewer agents (Opus semantic-review, Opus cross-reference, Sonnet structural-review) before the patch was applied in the primary worktree. A maintainer should audit and promote out of draft.



Generated by Claude Code

Normalizes the multi-word distribution name from "betaprime distribution"
to "beta prime distribution" across the package's `README.md` intro/notes
blockquote and method descriptions, `lib/main.js`, `lib/index.js`, and
`lib/factory.js` JSDoc description lines, and the `package.json`
description field. Aligns with the spelling used by every other
distribution package in `@stdlib/random/*` (33 of 33 use spaced/hyphenated
multi-word names, e.g. "negative binomial distribution", "chi-square
distribution", "discrete uniform distribution") and by all sibling
`betaprime` packages under `@stdlib/random/base`, `@stdlib/random/array`,
`@stdlib/random/strided`, and `@stdlib/stats/base/dists`. The link anchor
`@stdlib/random/base/betaprime` and every code identifier remain
unchanged; only the human-readable distribution name in prose is affected.

docs/repl.txt and docs/types/index.d.ts are excluded per the drift-audit
convention (auto-populated / generator-owned).
@stdlib-bot

stdlib-bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
random/betaprime $\\color{green}217/217$
$\\color{green}+0.00\\%$
$\\color{green}3/3$
$\\color{green}+0.00\\%$
$\\color{green}0/0$
$\\color{green}+0.00\\%$
$\\color{green}217/217$
$\\color{green}+0.00\\%$
random $\\color{red}74367/99205$
$\\color{green}+74.96\\%$
$\\color{red}1006/1318$
$\\color{green}+76.33\\%$
$\\color{red}87/1231$
$\\color{green}+7.07\\%$
$\\color{red}74367/99205$
$\\color{green}+74.96\\%$

The above coverage report was generated for the changes in this PR.

@kgryte kgryte left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This needs to be fixed in the scaffold meta data, as well. Otherwise, if the scaffold is run again, these changes will be overwritten.

@kgryte kgryte added the Documentation Improvements, additions, or changes to documentation. label Jul 12, 2026
…d data

Aligns the scaffold source with the leaf-package fix in the previous
commit so that a scaffold re-run will not overwrite the "beta prime"
prose. Rewrites `from_desc`, `readme_from_desc`, `repl_text_main_desc`,
`repl_text_assign_desc`, and `repl_text_factory_desc`. The `keywords`
field is unchanged — `betaprime` there is the package identifier used
for keyword search, not the distribution's prose name.
@kgryte kgryte marked this pull request as ready for review July 12, 2026 18:47
@kgryte kgryte requested a review from a team July 12, 2026 18:47
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Jul 12, 2026
@kgryte kgryte changed the title docs: use "beta prime" distribution name in @stdlib/random/betaprime docs: update descriptions Jul 12, 2026
@kgryte kgryte merged commit b59aade into develop Jul 12, 2026
32 checks passed
@kgryte kgryte deleted the philipp/drift-random-2026-07-12 branch July 12, 2026 18:48
@kgryte kgryte removed the Needs Review A pull request which needs code review. label Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Documentation Improvements, additions, or changes to documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants