Skip to content

refactor: use main as require alias in stats/base/dists/frechet#12260

Merged
kgryte merged 3 commits into
developfrom
philipp/drift-stats-base-dists-frechet-2026-05-24
May 24, 2026
Merged

refactor: use main as require alias in stats/base/dists/frechet#12260
kgryte merged 3 commits into
developfrom
philipp/drift-stats-base-dists-frechet-2026-05-24

Conversation

@Planeshifter
Copy link
Copy Markdown
Member

Description

Normalizes the require( './main.js' ) alias in three lib/index.js files under stats/base/dists/frechet from the package-name form (e.g. var mean = ...) to the canonical var main = ... form, with matching module.exports updates. Internal-only rename: the exported value is unchanged.

Namespace summary

  • Target namespace: @stdlib/stats/base/dists/frechet
  • Members: 14, all hand-written (no autogenerated packages)
  • Features analyzed: file tree, package.json shape, README sections, lib/ file set, lib/index.js require-alias variable, error-construction shape
  • Features with clear majority (≥75%): lib/index.js require-alias variable (11/14 = 78.6% use var main)
  • Features without clear majority: none material; native-binding presence (12/14) was excluded because adding a native binding is not a mechanical fix and the absences (ctor, pdf) are intentional (constructor; trivial exp(logpdf(...)) wrapper)

Per outlier package

stats/base/dists/frechet/mean

Renames the local alias in lib/index.js from mean to main to match the canonical wrapper-module convention used by the remaining sibling packages under stats/base/dists/frechet and throughout the stats/base/dists ecosystem. No functional changes; export behavior is unchanged.

stats/base/dists/frechet/median

Renames the local alias in lib/index.js from median to main to match the canonical wrapper-module convention used across the stats/base/dists ecosystem. Purely cosmetic and does not affect the exported API or runtime behavior.

stats/base/dists/frechet/mode

Renames the local alias in lib/index.js from mode to main to align with the canonical wrapper-module convention used by 11 of 14 sibling packages under stats/base/dists/frechet and approximately 78% of packages across the stats/base/dists ecosystem. No functional changes; export behavior is unchanged.

Related Issues

None.

Questions

No.

Other

Validation

  • Structural extraction: filesystem walk and string-level scan of every member's package.json, README headings, lib/, test/, benchmark/, examples/, and docs/ trees.
  • Semantic extraction: error-construction pattern (uniformly format for the one package that throws — ctor; the distribution functions return NaN on invalid input).
  • Three-agent drift validation: semantic-review, cross-reference, and structural-review agents independently confirmed the rename is mechanical, the var main alias is the canonical convention, and no test / example / downstream consumer reads the exports via a named property (.mean / .median / .mode).
  • Ecosystem cross-check: 398 / 505 (78%) of stats/base/dists/*/*/lib/index.js files already use var main, confirming this is the canonical convention and not a frechet-local style choice.

Deliberately excluded

  • pdf package lacks native bindings and a ## C APIs README section: intentional — the implementation is exp(logpdf(x, ...)), a one-line wrapper around logpdf, so a native binding adds no value.
  • ctor package has a distinct file tree (no native binding, no factory.js, different README): legitimately different — it is a stateful distribution constructor, not a scalar function.
  • Outliers whose drift would require touching tests or examples: none in this run.
  • Features without a clear ≥75% majority: none in this namespace beyond those documented above.

Checklist

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 authored by Claude Code running a cross-package drift-detection routine: extract structural/semantic features from every package in a randomly chosen namespace, identify a ≥75% majority pattern per feature, validate with three independent review agents, and apply mechanical fixes to outliers. The scope here is a purely internal var rename in three lib/index.js files. A human maintainer should confirm and promote out of draft.


@stdlib-js/reviewers


Generated by Claude Code

claude added 3 commits May 24, 2026 04:13
Rename the `var` alias bound to `require( './main.js' )` in
`lib/index.js` from `mean` to `main`, and update the matching
`module.exports` assignment. Brings the package into line with the
canonical wrapper-module pattern used by 11/14 (78.6%) of sibling
packages under `stats/base/dists/frechet` and 78% of packages under
`stats/base/dists` ecosystem-wide. Internal-only rename: the module's
public export value is unchanged.
…dian`

Rename the `var` alias bound to `require( './main.js' )` in
`lib/index.js` from `median` to `main`, and update the matching
`module.exports` assignment. Brings the package into line with the
canonical wrapper-module pattern used by 11/14 (78.6%) of sibling
packages under `stats/base/dists/frechet` and 78% of packages under
`stats/base/dists` ecosystem-wide. Internal-only rename: the module's
public export value is unchanged.
Rename the `var` alias bound to `require( './main.js' )` in
`lib/index.js` from `mode` to `main`, and update the matching
`module.exports` assignment. Brings the package into line with the
canonical wrapper-module pattern used by 11/14 (78.6%) of sibling
packages under `stats/base/dists/frechet` and 78% of packages under
`stats/base/dists` ecosystem-wide. Internal-only rename: the module's
public export value is unchanged.
@stdlib-bot stdlib-bot added the Statistics Issue or pull request related to statistical functionality. label May 24, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/frechet/mean $\color{green}193/193$
$\color{green}+100.00%$
$\color{green}13/13$
$\color{green}+100.00%$
$\color{green}2/2$
$\color{green}+100.00%$
$\color{green}193/193$
$\color{green}+100.00%$
stats/base/dists/frechet/median $\color{green}189/189$
$\color{green}+100.00%$
$\color{green}11/11$
$\color{green}+100.00%$
$\color{green}2/2$
$\color{green}+100.00%$
$\color{green}189/189$
$\color{green}+100.00%$
stats/base/dists/frechet/mode $\color{green}190/190$
$\color{green}+100.00%$
$\color{green}11/11$
$\color{green}+100.00%$
$\color{green}2/2$
$\color{green}+100.00%$
$\color{green}190/190$
$\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 24, 2026 09:42
@kgryte kgryte requested a review from a team May 24, 2026 09:42
@kgryte kgryte merged commit ac45b11 into develop May 24, 2026
35 checks passed
@kgryte kgryte deleted the philipp/drift-stats-base-dists-frechet-2026-05-24 branch May 24, 2026 09:42
@stdlib-bot stdlib-bot added Needs Review A pull request which needs code review. and removed Needs Review A pull request which needs code review. labels May 24, 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