Skip to content

chore: update keywords - #13496

Merged
kgryte merged 11 commits into
developfrom
philipp/drift-stats-base-dists-discrete-uniform-2026-07-16
Jul 16, 2026
Merged

kgryte merged 11 commits into
developfrom
philipp/drift-stats-base-dists-discrete-uniform-2026-07-16

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

What is the purpose of this pull request?

This pull request adds the univariate keyword to the keywords array of eleven @stdlib/stats/base/dists/discrete-uniform sub-packages that were missing it. Only logpmf, pmf, and quantile carried the keyword; the other eleven (cdf, ctor, entropy, kurtosis, logcdf, mean, median, mgf, skewness, stdev, variance) did not. The keyword is a near-universal ecosystem convention (491/517 = 95% of stats/base/dists/*/* packages carry it, including 100% of the sibling bernoulli, poisson, and continuous uniform families), and the namespace's own top-level package.json already lists it. No source, tests, TypeScript declarations, or public API are touched.

Namespace summary

  • Members analyzed: 14 (none autogenerated).
  • Features extracted: file tree, package.json shape (top-level keys, scripts, stdlib, keywords), manifest.json shape, README section list, lib/ / test/ / benchmark/ / examples/ / docs/ file lists, JSDoc @example counts, and per-package semantic features (public signature, validation prologue, error construction, JSDoc shape, dependencies) via direct source inspection of lib/main.js, lib/index.js, lib/factory.js, lib/native.js, plus test/test.js structure.
  • Features with a clear in-namespace majority (≥75%): package.json top-level key set, README section list (## Usage / ## Examples / ## C APIs / ### Usage / ### Examples), validation-prologue shape (per API arity), error-construction kind, benchmark / examples / docs/ file names.
  • Feature with an unambiguous ecosystem-wide majority that fails the in-namespace threshold: the univariate keyword — 3/14 locally (below 75%) but 95% stdlib-wide and 100% across every sibling distribution family checked. This PR corrects it.
  • Features without a clear majority (excluded from drift analysis): distribution-specific keywords array contents beyond univariate (e.g. probability, prob, symmetric — verified as intentional per-package/per-family choices), @returns type annotations (number / PositiveNumber / Probability / integer vary by mathematical object).

Per outlier package

Each of the following packages had "univariate" appended to the end of its keywords array (matching the placement in sibling continuous uniform, bernoulli, and poisson sub-packages). Every diff is a single +"univariate", line with a matching comma on the previous line; no other field is touched.

  • cdf, entropy, kurtosis, mean, median, skewness, stdev, variance — the eight single-scalar and CDF packages missing the ecosystem-standard univariate keyword. Local conformance 3/14 (21%); ecosystem-wide conformance 491/517 (95%).
  • logcdf — same missing keyword; local conformance 3/14; the sibling logpmf package already carries it.
  • mgf — same missing keyword; local conformance 3/14; the sibling continuous uniform/mgf package already carries it (14/14 in that family).
  • ctor — same missing keyword; the class-based JavaScript wrapper. Sibling bernoulli/ctor, poisson/ctor, and continuous uniform/ctor all carry univariate; this one did not.

Validation

  • Structural extraction: file tree, package.json fields, manifest.json shape, README section list, test/ / benchmark/ / examples/ / docs/ / lib/ directory listings extracted for each of the 14 members.
  • Semantic extraction: validation prologues, error-construction kind, JSDoc shape, dependencies, and public signatures compared across single-scalar dists (entropy, kurtosis, mean, median, skewness, stdev, variance), factory dists (cdf, logcdf, logpmf, mgf, pmf, quantile), and the class-based ctor. All three groupings were internally consistent — no semantic drift found.
  • Adversarial review: an independent reviewer pass surfaced the univariate finding after the primary pass had missed it; the reviewer also verified .d.ts shape, C header shape, benchmark/c/benchmark.c boilerplate, README heading structure, copyright years, JSDoc @example counts, and test tape-block counts — all confirmed to have no drift.
  • Deliberately excluded:
    • ctor lacks the native-addon scaffold (binding.gyp, manifest.json, src/, include/, lib/native.js) — intentional, since it is a JavaScript class with no C implementation.
    • skewness lacks test/fixtures/julia/ cross-language fixture data — intentional, since the skewness of a discrete uniform distribution is always 0 and does not require numerical verification.
    • mgf lacks the probability keyword, present in 13/14 in-namespace siblings — excluded because moment-generating-function packages stdlib-wide consistently omit probability (20/22 = 91%); the in-namespace majority is itself the outlier.
    • The symmetric keyword is present only in logpmf, pmf, and quantile — verified as an intentional narrow convention matching the identical 3-of-14 scoping in the sibling continuous uniform family.
    • JSDoc @returns type annotations vary by mathematical object and reflect intentional semantic differences.

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.

This is a follow-up drift audit of the same namespace corrected in #12669 (merged 2026-06-07). That PR normalized JSDoc summary phrasing across mgf and fixed a typo in quantile; this run finds the univariate keyword gap missed by the earlier audit. All corrections here are package.json metadata only — no source, tests, or declarations.

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

A cross-package drift audit of the @stdlib/stats/base/dists/discrete-uniform namespace was run using Claude Code. Structural and semantic features were extracted from each of the fourteen non-autogenerated members, the majority pattern was computed per feature, and outliers were validated against sibling packages before any change was applied. An adversarial independent review pass verified the primary findings and surfaced the univariate keyword gap that this PR corrects. Each candidate was checked against the ecosystem-wide convention (491/517 = 95% presence) and against sibling distribution families (bernoulli, poisson, continuous uniform, each at 100%) before applying. All proposed changes were reviewed before submitting.


@stdlib-js/reviewers


Generated by Claude Code

claude added 11 commits July 16, 2026 08:24
…-uniform/cdf`

Adds the `univariate` keyword to the `keywords` array to align with the
ecosystem-wide convention (present in 491/517 = 95% of packages under
`stats/base/dists/`, and 100% of the sibling `bernoulli`, `poisson`, and
continuous `uniform` distribution families). The `discrete-uniform`
namespace's own top-level `package.json` already carries the keyword;
only 3 of the 14 in-namespace sub-packages did.
…-uniform/ctor`

Adds the `univariate` keyword to the `keywords` array to align with the
ecosystem-wide convention (present in 491/517 = 95% of packages under
`stats/base/dists/`, and 100% of the sibling `bernoulli`, `poisson`, and
continuous `uniform` distribution families). The `discrete-uniform`
namespace's own top-level `package.json` already carries the keyword;
only 3 of the 14 in-namespace sub-packages did.
…-uniform/entropy`

Adds the `univariate` keyword to the `keywords` array to align with the
ecosystem-wide convention (present in 491/517 = 95% of packages under
`stats/base/dists/`, and 100% of the sibling `bernoulli`, `poisson`, and
continuous `uniform` distribution families). The `discrete-uniform`
namespace's own top-level `package.json` already carries the keyword;
only 3 of the 14 in-namespace sub-packages did.
…-uniform/kurtosis`

Adds the `univariate` keyword to the `keywords` array to align with the
ecosystem-wide convention (present in 491/517 = 95% of packages under
`stats/base/dists/`, and 100% of the sibling `bernoulli`, `poisson`, and
continuous `uniform` distribution families). The `discrete-uniform`
namespace's own top-level `package.json` already carries the keyword;
only 3 of the 14 in-namespace sub-packages did.
…-uniform/logcdf`

Adds the `univariate` keyword to the `keywords` array to align with the
ecosystem-wide convention (present in 491/517 = 95% of packages under
`stats/base/dists/`, and 100% of the sibling `bernoulli`, `poisson`, and
continuous `uniform` distribution families). The `discrete-uniform`
namespace's own top-level `package.json` already carries the keyword;
only 3 of the 14 in-namespace sub-packages did.
…-uniform/mean`

Adds the `univariate` keyword to the `keywords` array to align with the
ecosystem-wide convention (present in 491/517 = 95% of packages under
`stats/base/dists/`, and 100% of the sibling `bernoulli`, `poisson`, and
continuous `uniform` distribution families). The `discrete-uniform`
namespace's own top-level `package.json` already carries the keyword;
only 3 of the 14 in-namespace sub-packages did.
…-uniform/median`

Adds the `univariate` keyword to the `keywords` array to align with the
ecosystem-wide convention (present in 491/517 = 95% of packages under
`stats/base/dists/`, and 100% of the sibling `bernoulli`, `poisson`, and
continuous `uniform` distribution families). The `discrete-uniform`
namespace's own top-level `package.json` already carries the keyword;
only 3 of the 14 in-namespace sub-packages did.
…-uniform/mgf`

Adds the `univariate` keyword to the `keywords` array to align with the
ecosystem-wide convention (present in 491/517 = 95% of packages under
`stats/base/dists/`, and 100% of the sibling `bernoulli`, `poisson`, and
continuous `uniform` distribution families). The `discrete-uniform`
namespace's own top-level `package.json` already carries the keyword;
only 3 of the 14 in-namespace sub-packages did.
…-uniform/skewness`

Adds the `univariate` keyword to the `keywords` array to align with the
ecosystem-wide convention (present in 491/517 = 95% of packages under
`stats/base/dists/`, and 100% of the sibling `bernoulli`, `poisson`, and
continuous `uniform` distribution families). The `discrete-uniform`
namespace's own top-level `package.json` already carries the keyword;
only 3 of the 14 in-namespace sub-packages did.
…-uniform/stdev`

Adds the `univariate` keyword to the `keywords` array to align with the
ecosystem-wide convention (present in 491/517 = 95% of packages under
`stats/base/dists/`, and 100% of the sibling `bernoulli`, `poisson`, and
continuous `uniform` distribution families). The `discrete-uniform`
namespace's own top-level `package.json` already carries the keyword;
only 3 of the 14 in-namespace sub-packages did.
…-uniform/variance`

Adds the `univariate` keyword to the `keywords` array to align with the
ecosystem-wide convention (present in 491/517 = 95% of packages under
`stats/base/dists/`, and 100% of the sibling `bernoulli`, `poisson`, and
continuous `uniform` distribution families). The `discrete-uniform`
namespace's own top-level `package.json` already carries the keyword;
only 3 of the 14 in-namespace sub-packages did.
@stdlib-bot stdlib-bot added the Statistics Issue or pull request related to statistical functionality. label Jul 16, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/discrete-uniform/cdf $\\color{green}301/301$
$\\color{green}+100.00\\%$
$\\color{green}31/31$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}301/301$
$\\color{green}+100.00\\%$
stats/base/dists/discrete-uniform/ctor $\\color{green}478/478$
$\\color{green}+100.00\\%$
$\\color{green}39/39$
$\\color{green}+100.00\\%$
$\\color{green}18/18$
$\\color{green}+100.00\\%$
$\\color{green}478/478$
$\\color{green}+100.00\\%$
stats/base/dists/discrete-uniform/entropy $\\color{green}179/179$
$\\color{green}+100.00\\%$
$\\color{green}9/9$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}179/179$
$\\color{green}+100.00\\%$
stats/base/dists/discrete-uniform/kurtosis $\\color{green}181/181$
$\\color{green}+100.00\\%$
$\\color{green}9/9$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}181/181$
$\\color{green}+100.00\\%$
stats/base/dists/discrete-uniform/logcdf $\\color{green}305/305$
$\\color{green}+100.00\\%$
$\\color{green}31/31$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}305/305$
$\\color{green}+100.00\\%$
stats/base/dists/discrete-uniform/mean $\\color{green}178/178$
$\\color{green}+100.00\\%$
$\\color{green}9/9$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}178/178$
$\\color{green}+100.00\\%$
stats/base/dists/discrete-uniform/median $\\color{green}178/178$
$\\color{green}+100.00\\%$
$\\color{green}9/9$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}178/178$
$\\color{green}+100.00\\%$
stats/base/dists/discrete-uniform/mgf $\\color{green}315/315$
$\\color{green}+100.00\\%$
$\\color{green}27/27$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}315/315$
$\\color{green}+100.00\\%$
stats/base/dists/discrete-uniform/skewness $\\color{green}178/178$
$\\color{green}+100.00\\%$
$\\color{green}9/9$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}178/178$
$\\color{green}+100.00\\%$
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\\%$
stats/base/dists/discrete-uniform/variance $\\color{green}179/179$
$\\color{green}+100.00\\%$
$\\color{green}9/9$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}179/179$
$\\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 July 16, 2026 17:53
@kgryte
kgryte requested a review from a team July 16, 2026 17:53
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Jul 16, 2026
@kgryte kgryte changed the title chore: add univariate keyword across stats/base/dists/discrete-uniform sub-packages chore: update keywords Jul 16, 2026
@kgryte
kgryte merged commit fd2d15a into develop Jul 16, 2026
52 checks passed
@kgryte
kgryte deleted the philipp/drift-stats-base-dists-discrete-uniform-2026-07-16 branch July 16, 2026 17:53
@kgryte kgryte removed the Needs Review A pull request which needs code review. label Jul 16, 2026
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