chore: align keywords with sibling stdev packages#12219
Merged
kgryte merged 1 commit intoMay 20, 2026
Conversation
…sts/discrete-uniform/stdev` Replace the `"variance"` keyword (a copy-paste from sibling `stats/base/dists/discrete-uniform/variance/package.json`) with the function-name-appropriate keywords `"standard"`, `"deviation"`, `"stdev"`, and `"std"`, and reorder the dispersion block to match the dominant ordering used by sibling `stdev` packages across stdlib's distributions. Cross-distribution conformance (sampled `normal`, `poisson`, `geometric`, `bernoulli`, `binomial`, `gamma`, `beta`, `laplace`, `logistic`): `"stdev"`/`"std"`/`"standard"`/`"deviation"` present in 9/9; `"variance"` present in 0/9. No logic, signature, or test expectation is touched; the diff is package metadata only.
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
kgryte
approved these changes
May 20, 2026
stdev packages in stats/base/dists/discrete-uniform/stdevstdev packages
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request corrects a copy-paste defect in the
keywordsarray ofstats/base/dists/discrete-uniform/stdev/package.jsonso the package is discoverable by its actual function.Namespace summary
stats/base/dists/discrete-uniform(14 members:cdf,ctor,entropy,kurtosis,logcdf,logpmf,mean,median,mgf,pmf,quantile,skewness,stdev,variance).package.jsonshape (keys, scripts, stdlib, keywords), README section list and order,manifest.jsonshape, test/benchmark/example file naming, public signature, validation prologue, JSDoc shape, error construction, dependencies.ctorandskewness/julia-fixturesdeviations, both intentional),package.jsontop-level key set, README section list, validation-prologue patterns within each call-shape group,errorConstruction(none of the moment/density functions throw),returnKind.lib/factory.js/test/test.factory.js/test/test.<fn>.jscluster (6/14 = 43%);@returnsJSDoc tag type for moment functions ({number}5/7 vs{PositiveNumber}2/7 = 71%, below threshold).discrete-uniform/stdevReplace
"variance"with"standard","deviation","stdev", and"std"in thekeywordsarray ofpackage.json, and reorder the dispersion block to match siblingstdevpackages. The previous keywords were a byte-identical copy ofdiscrete-uniform/variance, making the package undiscoverable by its actual function. All 9/9 sampled siblingstdevpackages include these four terms; 0/9 include"variance".Related Issues
No.
Questions
No.
Other
Validation
node_modules/),package.jsonshape, README headings,manifest.jsonshape, test/benchmark/example filenames.lib/main.jsfor each member: public signature, validation prologue, return kind, error construction, JSDoc shape, dependencies. Group-A (moment) and Group-B (function-of-x) members each form an internally consistent cohort;ctoris a distinct constructor cohort.confirmed-drift— the keyword list is byte-identical todiscrete-uniform/variance/package.json; the source, README, and description describe standard deviation only, so"variance"is an unintentional copy-paste.confirmed-drift—keywordsis not read by any test, REPL fixture, or namespace export; replacing it breaks no observable contract.confirmed-drift— all 9/9 sampled siblingstdevpackages usestandard, deviation, stdev, stdand none usesvariance.ctordeviations on file tree, README section list, andpackage.jsonshape —ctoris a class constructor, not a numeric function; the deviation reflects a genuine semantic difference.skewnesslack oftest/fixtures/julia/— the function is the constant0.0for all valid inputs, so there is no parameter sweep to validate against Julia.stdevandvarianceuse of@returns {PositiveNumber}(vs{number}in the other five moment packages) — 5/7 = 71%, below the 75% threshold; excluded as no clear majority.Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was produced by Claude Code running a cross-package drift-detection routine. The routine picked the namespace via a recorded random seed, extracted structural and semantic features across all 14 members, computed per-feature majority patterns at a 75% threshold, ran a three-agent validation pass (two Opus, one Sonnet) over the single surviving candidate correction, and shipped only the change confirmed by all three agents. The PR is being opened as a draft for human audit; please do not promote to ready-for-review until the change has been confirmed.
Generated by Claude Code