Skip to content

docs: correct parameter prose in stats/base/dists/gumbel/mgf doc comments#12007

Open
Planeshifter wants to merge 1 commit intodevelopfrom
philipp/drift-stats-base-dists-gumbel-2026-05-09
Open

docs: correct parameter prose in stats/base/dists/gumbel/mgf doc comments#12007
Planeshifter wants to merge 1 commit intodevelopfrom
philipp/drift-stats-base-dists-gumbel-2026-05-09

Conversation

@Planeshifter
Copy link
Copy Markdown
Member

Description

Documentation prose in @stdlib/stats/base/dists/gumbel/mgf referenced the scale parameter as b and labeled the location parameter mu as "mean", and the package's TypeScript declaration opened the declare var JSDoc block with "Gamma distribution" — copy-paste artifacts inconsistent with both mgf's own README/repl.txt and 13/13 sibling packages in the namespace. Six files were normalized to the namespace convention; no behavior, signatures, exports, or test expectations change.

Namespace summary

  • Members analyzed: 15 (all non-autogenerated children of stats/base/dists/gumbel/)
  • Majority threshold: 12/15 (≥75%)
  • Features analyzed: file tree, package.json shape, manifest.json presence, README sections (set + order), test/benchmark/examples filenames, public signature, validation prologue, return kind, error construction, JSDoc shape, doc-comment prose, dependencies
  • Features with clear majority that produced advancing corrections: doc-comment prose for the location/scale parameters and the function-summary line (1 outlier package, 13 sites)
  • Features with clear majority but no advancing corrections: structural drift on ctor (no native bindings), mgf and skewness (no test/fixtures/julia/) — see Validation
  • Features without clear majority: none — every observed feature either reached 75% or had a single dominant value

stats/base/dists/gumbel/mgf

The function-summary line in lib/main.js, lib/factory.js, lib/native.js, docs/types/index.d.ts, include/stdlib/stats/base/dists/gumbel/mgf.h, and src/main.c referenced the scale parameter as `b` (13/13 sibling packages and mgf's own README/repl.txt use `beta`). The @param mu description in lib/main.js, lib/factory.js, and three sites in docs/types/index.d.ts was "mean" rather than "location parameter" (13/13 siblings use "location parameter"; mu is not the mean of the Gumbel distribution — mu + beta·γ_E is). The declare var mgf JSDoc opened with "Gamma distribution moment-generating function (MGF)." (5/5 factory-style siblings open with "Gumbel distribution …"). Total: 13 sites, 6 files, +13 / −13 LOC.

Validation

What was checked:

  • Structural feature extraction across all 15 members (file tree, package.json shape, README headings, test/benchmark/examples file naming).
  • Semantic feature extraction (public signature, validation prologue, return kind, doc-comment prose, JSDoc shape, dependencies) across the 14 function-style packages, plus the JS/TS/C documentation prose.
  • Independent validation passes against the surviving outlier:
    1. Opus semantic-review on mgf's doc-comment drift → confirmed-drift (parameter is named beta in code; mu is a location parameter, not the mean; Gamma distribution is a copy-paste artifact).
    2. Opus cross-reference against mgf's tests, examples, factory, native bindings, namespace re-exports, and any consumer importing the package → safe-to-apply (no test, fixture, or downstream consumer references the existing wording).

What was deliberately excluded:

  • ctor's missing binding.gyp, manifest.json, native bindings, and ## C APIs README section — inapplicable to a JavaScript constructor with property accessors.
  • mgf's and skewness's missing test/fixtures/julia/ directory — mgf's tests already exercise analytically known values; skewness for Gumbel is a parameter-independent constant (Julia ground-truth fixtures would be mathematically meaningless).
  • lib/factory.js / lib/index.js only present in the six factory-style packages — minority pattern, not drift.
  • The ## Notes README section in logcdf/logpdf — minority pattern reflecting genuine domain notes for those functions.

Other

This PR is the output of a per-namespace cross-package drift-detection routine. The full per-feature majority/conformance/outlier breakdown and per-agent verdicts are recorded in the local report at ~/drift-reports/drift-stats-base-dists-gumbel-2026-05-09.md.

Checklist

AI Assistance

  • Yes
  • No

How AI assistance was used:

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

Disclosure

This PR was authored by Claude Code running an automated cross-package drift-detection routine. The routine extracted structural and semantic features from every member of stats/base/dists/gumbel/, computed per-feature majority patterns at a 75% threshold, and dispatched two independent Opus validation agents (semantic review, cross-reference safety check) against the surviving findings. The single advancing finding produced this 13-site, 6-file, behavior-preserving prose normalization.


Generated by Claude Code

… convention

Description prose for `mgf` referenced the scale parameter as `b` (rather
than `beta`, which is the actual variable name and what 13/13 sibling
packages and `mgf`'s own README/repl.txt use), labeled `mu` as `mean`
(rather than `location parameter`, used by 13/13 siblings), and the
`declare var mgf` JSDoc opened with "Gamma distribution moment-generating
function" (5/5 factory-style siblings open with "Gumbel distribution ...").
Aligned all six affected files to the namespace convention. No behavior,
signatures, exports, or test expectations change; the actual function
parameter remains `beta` at every site.
@stdlib-bot stdlib-bot added the Statistics Issue or pull request related to statistical functionality. label May 9, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/gumbel/mgf $\color{green}296/296$
$\color{green}+100.00%$
$\color{green}20/20$
$\color{green}+100.00%$
$\color{green}4/4$
$\color{green}+100.00%$
$\color{green}296/296$
$\color{green}+100.00%$

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

@Planeshifter Planeshifter marked this pull request as ready for review May 9, 2026 21:00
@Planeshifter Planeshifter requested a review from a team May 9, 2026 21:00
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label May 9, 2026
@Planeshifter Planeshifter requested a review from kgryte May 9, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review A pull request which needs code review. Statistics Issue or pull request related to statistical functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants