Skip to content

chore: add keyword - #14181

Merged
kgryte merged 3 commits into
developfrom
philipp/drift-stats-base-dists-2026-08-12
Aug 12, 2026
Merged

chore: add keyword#14181
kgryte merged 3 commits into
developfrom
philipp/drift-stats-base-dists-2026-08-12

Conversation

@Planeshifter

@Planeshifter Planeshifter commented Aug 12, 2026

Copy link
Copy Markdown
Member

Description

This pull request corrects two cross-package API drift findings in the @stdlib/stats/base/dists namespace, detected by majority-vote comparison across the namespace's 39 distribution packages. Each fix brings a single outlier package into line with a convention shared by ≥97% of its siblings, without changing observable behavior or test expectations.

@stdlib/stats/base/dists/weibull

Fixes the missing continuous support-type tag in @stdlib/stats/base/dists/weibull package.json keywords. Weibull exposes pdf, cdf, logpdf, and logcdf but carried neither continuous nor discrete in its keywords, an outlier against the rest of stats/base/dists, where 29 of 30 continuous namespaces already carry continuous and all 8 discrete namespaces carry discrete. Adds continuous to bring Weibull's keywords in line with the rest of the package family.

@stdlib/stats/base/dists/degenerate

Adds the missing constructor demonstration to @stdlib/stats/base/dists/degenerate's README, immediately following the constructor table of contents. The Usage section jumped from the ctor toc straight to Examples, skipping the runnable snippet showing new Degenerate( 2.0 ).mean returning 2.0. All ~30 sibling distributions exposing a constructor include this demo block; degenerate was the only constructor-bearing distribution without one.

Related Issues

No related issues.

Questions

No.

Other

Namespace summary. 39 members analyzed (all non-autogenerated distribution-namespace aggregators). Structural features extracted per package: aggregator file tree, package.json key / scripts / stdlib shape, README heading sequence, manifest.json shape, and test / examples / benchmark file naming. Semantic features extracted via one agent per package over each lib/index.js. Two features carried a clear ≥75% majority and an outlier — the keyword support-type tag (97%) and the constructor-usage README demo (97%), both corrected here — alongside a large set of features at 100% conformance (file tree, package.json shape, README headings, test/example naming, member ordering, require-path style). Features excluded for lacking a clear majority: examples/index.js narrative-vs-dump style, the TODO: better examples HTML-comment marker (85%, and regressive to re-add), and the intentional per-distribution moment/member sets.

Validation. Each correction passed a three-agent review: (1) semantic review confirming the deviation is accidental drift rather than an intentional mathematical difference, (2) cross-reference confirming no test or example relies on the deviating state and no documented API contract breaks — the degenerate demo's new Degenerate( 2.0 ).mean === 2.0 return value was verified against source (degenerate/mean returns mu unchanged) — and (3) structural review confirming the majority pattern is the one that should be applied. Deliberately excluded from this PR: intentional deviations (e.g. degenerate legitimately carrying no support-type keyword as a point mass; distributions exposing different moment functions), features without a clear majority, and fixes that would cascade into sibling or leaf packages (e.g. a planck blockquote-link convention spanning 14 sub-package READMEs was logged and dropped).

Checklist

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 an automated cross-package drift-detection routine. It extracted structural and semantic features from all 39 packages in stats/base/dists, identified the per-feature majority convention, flagged deviating packages, and validated each candidate correction through independent review agents before applying. Both changes are mechanical normalizations toward the namespace majority; a maintainer should review before merge.


claude added 2 commits August 12, 2026 00:29
…weibull`

The Weibull distribution is continuous, but its package.json keywords
omitted the `continuous` support-type tag. Added the tag to match the
namespace convention: 29 of 30 continuous distributions in
`stats/base/dists` carry `continuous` (97% conformance), and all 8
discrete distributions carry `discrete`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BMbL5NUYGNvoTGVxdZUpbJ
…nerate`

The Usage section closed the constructor table of contents and went
straight to the examples section, omitting the runnable constructor
demonstration that every other constructor-bearing distribution in
`stats/base/dists` includes immediately after the ctor toc (present in
all ~30 sibling packages that expose a constructor). Added a demo
constructing a `Degenerate` instance and reading its `mean` accessor,
matching the sibling convention.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BMbL5NUYGNvoTGVxdZUpbJ
@stdlib-bot stdlib-bot added the Statistics Issue or pull request related to statistical functionality. label Aug 12, 2026
@stdlib-bot

stdlib-bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/weibull $\\color{red}2581/3114$
$\\color{green}+0.00\\%$
$\\color{green}37/37$
$\\color{green}+0.00\\%$
$\\color{red}0/35$
$\\color{green}+0.00\\%$
$\\color{red}2581/3114$
$\\color{green}+0.00\\%$

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

@kgryte
kgryte marked this pull request as ready for review August 12, 2026 04:57
@kgryte
kgryte requested a review from a team August 12, 2026 04:57
@kgryte kgryte changed the title docs: add ctor example to stats/base/dists/degenerate and continuous keyword to weibull chore: add keyword Aug 12, 2026
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Aug 12, 2026
@kgryte
kgryte merged commit ed143dc into develop Aug 12, 2026
34 checks passed
@kgryte
kgryte deleted the philipp/drift-stats-base-dists-2026-08-12 branch August 12, 2026 06:50
@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Aug 12, 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