Skip to content

chore: align keywords with sibling stdev packages#12219

Merged
kgryte merged 1 commit into
developfrom
philipp/drift-stats-base-dists-discrete-uniform-2026-05-20
May 20, 2026
Merged

chore: align keywords with sibling stdev packages#12219
kgryte merged 1 commit into
developfrom
philipp/drift-stats-base-dists-discrete-uniform-2026-05-20

Conversation

@Planeshifter
Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request corrects a copy-paste defect in the keywords array of stats/base/dists/discrete-uniform/stdev/package.json so the package is discoverable by its actual function.

Namespace summary

  • Namespace: stats/base/dists/discrete-uniform (14 members: cdf, ctor, entropy, kurtosis, logcdf, logpmf, mean, median, mgf, pmf, quantile, skewness, stdev, variance).
  • Features analyzed: file tree, package.json shape (keys, scripts, stdlib, keywords), README section list and order, manifest.json shape, test/benchmark/example file naming, public signature, validation prologue, JSDoc shape, error construction, dependencies.
  • Features with a clear majority (≥75% within the namespace): file tree (excluding ctor and skewness/julia-fixtures deviations, both intentional), package.json top-level key set, README section list, validation-prologue patterns within each call-shape group, errorConstruction (none of the moment/density functions throw), returnKind.
  • Features without a clear majority (excluded from drift analysis): the lib/factory.js / test/test.factory.js / test/test.<fn>.js cluster (6/14 = 43%); @returns JSDoc tag type for moment functions ({number} 5/7 vs {PositiveNumber} 2/7 = 71%, below threshold).

discrete-uniform/stdev

Replace "variance" with "standard", "deviation", "stdev", and "std" in the keywords array of package.json, and reorder the dispersion block to match sibling stdev packages. The previous keywords were a byte-identical copy of discrete-uniform/variance, making the package undiscoverable by its actual function. All 9/9 sampled sibling stdev packages include these four terms; 0/9 include "variance".

Related Issues

Does this pull request have any related issues?

No.

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

Validation

  • Structural extraction over all 14 members: file tree (excluding node_modules/), package.json shape, README headings, manifest.json shape, test/benchmark/example filenames.
  • Semantic extraction over lib/main.js for 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; ctor is a distinct constructor cohort.
  • Three-agent drift validation on the single candidate correction:
    • Semantic (Opus): confirmed-drift — the keyword list is byte-identical to discrete-uniform/variance/package.json; the source, README, and description describe standard deviation only, so "variance" is an unintentional copy-paste.
    • Cross-reference (Opus): confirmed-driftkeywords is not read by any test, REPL fixture, or namespace export; replacing it breaks no observable contract.
    • Structural (Sonnet): confirmed-drift — all 9/9 sampled sibling stdev packages use standard, deviation, stdev, std and none uses variance.
  • Deliberately excluded:
    • ctor deviations on file tree, README section list, and package.json shape — ctor is a class constructor, not a numeric function; the deviation reflects a genuine semantic difference.
    • skewness lack of test/fixtures/julia/ — the function is the constant 0.0 for all valid inputs, so there is no parameter sweep to validate against Julia.
    • stdev and variance use of @returns {PositiveNumber} (vs {number} in the other five moment packages) — 5/7 = 71%, below the 75% threshold; excluded as no clear majority.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of 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 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

…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.
@stdlib-bot stdlib-bot added the Statistics Issue or pull request related to statistical functionality. label May 20, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/discrete-uniform/stdev $\color{green}185/185$
$\color{green}+100.00%$
$\color{green}9/9$
$\color{green}+100.00%$
$\color{green}2/2$
$\color{green}+100.00%$
$\color{green}185/185$
$\color{green}+100.00%$

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

@kgryte kgryte marked this pull request as ready for review May 20, 2026 19:11
@kgryte kgryte requested a review from a team May 20, 2026 19:11
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label May 20, 2026
@kgryte kgryte removed the Needs Review A pull request which needs code review. label May 20, 2026
@kgryte kgryte changed the title chore: align keywords with sibling stdev packages in stats/base/dists/discrete-uniform/stdev chore: align keywords with sibling stdev packages May 20, 2026
@kgryte kgryte merged commit 80996a6 into develop May 20, 2026
53 checks passed
@kgryte kgryte deleted the philipp/drift-stats-base-dists-discrete-uniform-2026-05-20 branch May 20, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Statistics Issue or pull request related to statistical functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants