Skip to content

docs: correct mu description and b JSDoc type in stats/base/dists/laplace/mgf#12449

Open
Planeshifter wants to merge 1 commit into
developfrom
claude/practical-goodall-2sFZa
Open

docs: correct mu description and b JSDoc type in stats/base/dists/laplace/mgf#12449
Planeshifter wants to merge 1 commit into
developfrom
claude/practical-goodall-2sFZa

Conversation

@Planeshifter
Copy link
Copy Markdown
Member

Description

This pull request normalizes the JSDoc @param descriptions and types in @stdlib/stats/base/dists/laplace/mgf so they match the rest of the stats/base/dists/laplace/ namespace and the package's own runtime contract.

Namespace summary

  • Target: stats/base/dists/laplace/
  • Members analyzed: 15 (cdf, ctor, entropy, kurtosis, logcdf, logpdf, mean, median, mgf, mode, pdf, quantile, skewness, stdev, variance)
  • Features with clear majority (≥75%) used as anchors: file tree, top-level package.json keys, README section list, manifest.json keys, test/benchmark filenames, JSDoc @param mu description, JSDoc @param b type, source-file structure.
  • Features excluded for no clear majority: JSDoc @returns type (genuine semantic split — number vs Probability vs PositiveNumber).

@stdlib/stats/base/dists/laplace/mgf

Tighten b JSDoc type from {NonNegativeNumber} to {PositiveNumber} across lib/main.js, lib/factory.js, and lib/native.js to match the b <= 0.0 rejection and the README contract. Rename mu from "mean" to "location parameter" in the same files and in docs/types/index.d.ts, aligning with every sibling in stats/base/dists/laplace/ and the package's own top-level description.

Conformance:

  • @param {PositiveNumber} b: 13/14 sibling function packages (~93%).
  • @param mu - location parameter: 13/14 sibling function packages and all >30 other @param mu occurrences in the namespace (~93%).

Related Issues

None.

Questions

None.

Other

Validation

  • Structural extraction: file trees, package.json shapes, README section lists, manifest.json shapes, and test/benchmark/example filenames captured for all 15 members.
  • Semantic extraction: public signature, return kind, validation prologue, error-construction style, JSDoc shape, and dependencies extracted per package via a sub-agent reading lib/main.js, lib/index.js, and lib/validate.js.
  • Three-agent drift validation:
    • Agent 1 (semantic-review) confirmed all three candidate drift items.
    • Agent 2 (cross-reference) confirmed no test, example, docs/types/test.ts, or external stdlib reference relies on the deviating wording; surfaced additional drift in lib/factory.js and lib/native.js (same strings), which are included in this patch.
    • Agent 3 (structural-review) confirmed filtering of the ctor structural deltas (intentional pure-JS class) and the stdev python-fixtures delta (would cascade to test expectations).
  • Deliberately excluded:
    • ctor lacking location-scale and exponential family keywords — ecosystem-wide ctor convention; verified normal/ctor, logistic/ctor, gumbel/ctor, cauchy/ctor, beta/ctor follow the same convention.
    • ctor lacking native-binding files (binding.gyp, manifest.json, src/, lib/native.js, ## C APIs README section, test.native.js, benchmark.native.js) — ctor is a pure-JS constructor class.
    • stdev using python rather than julia test fixtures — out of scope per the routine (fixture-format change cascades to expected values).
    • mgf validation-prologue extension abs(t) >= 1/b — math-correct, not drift.
    • JSDoc @returns types — no ≥75% majority; the variation reflects genuine semantic differences.

Checklist

AI Assistance

  • Yes

  • No

  • 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 as part of an automated cross-package drift-detection sweep. The routine extracted structural and semantic features from every package in stats/base/dists/laplace/, computed a per-feature majority pattern, and validated each candidate correction through three independent review agents before any edit. The corrections in this PR are pure JSDoc/typing changes; no behavior, signatures, or tests changed.


@stdlib-js/reviewers


Generated by Claude Code

…s/laplace/mgf`

Normalized JSDoc parameter descriptions in `lib/main.js`, `lib/factory.js`,
`lib/native.js`, and `docs/types/index.d.ts` to match the rest of the
`stats/base/dists/laplace/` namespace:

-   Changed `@param {NonNegativeNumber} b` to `@param {PositiveNumber} b`
    (13/14 sibling function packages use `{PositiveNumber}`; the
    implementation rejects `b <= 0.0` and the README documents that
    `b <= 0` returns `NaN`, so `NonNegativeNumber` was incorrect).
-   Changed `@param {number} mu - mean` to
    `@param {number} mu - location parameter` (every other `@param mu`
    occurrence in the namespace uses "location parameter"; the same
    `docs/types/index.d.ts` already uses "location parameter" in its
    top-level description, so the interface declarations were internally
    inconsistent).

No behavior changes; no test or example updates required.

https://claude.ai/code/session_01Cv7Lh8wtQoKzrem6gXstiK
@stdlib-bot stdlib-bot added the Statistics Issue or pull request related to statistical functionality. label Jun 2, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/laplace/mgf $\color{green}320/320$
$\color{green}+100.00\%$
$\color{green}20/20$
$\color{green}+100.00\%$
$\color{green}4/4$
$\color{green}+100.00\%$
$\color{green}320/320$
$\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 June 2, 2026 16:24
@Planeshifter Planeshifter requested review from a team and kgryte June 2, 2026 16:24
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Jun 2, 2026
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