Skip to content

chore: fix example positioning and align keywords in stats/base/dists/chisquare packages#11746

Merged
kgryte merged 4 commits intodevelopfrom
philipp/drift-stats-base-dists-chisquare-2026-04-23
Apr 23, 2026
Merged

chore: fix example positioning and align keywords in stats/base/dists/chisquare packages#11746
kgryte merged 4 commits intodevelopfrom
philipp/drift-stats-base-dists-chisquare-2026-04-23

Conversation

@Planeshifter
Copy link
Copy Markdown
Member

Description

Aligning outliers in stats/base/dists/chisquare with namespace majority patterns (random namespace pick, seed 20260423).

Namespace summary

  • Target: stats/base/dists/chisquare
  • Members analyzed: 14 (all non-autogenerated)
  • Features analyzed: file tree, package.json top-level / scripts / stdlib / keywords, manifest.json shape, README ##/### heading order, test//benchmark//examples/ filenames, public JSDoc signature, validation prologue, error construction, @returns/@param/@throws/@example presence, @stdlib/* source imports.
  • Features with clear majority (≥75% conformance): package.json top-level keys (100%), majority file set (README.md, benchmark/benchmark.js, docs/repl.txt, docs/types/*, examples/index.js, lib/{index,main}.js, test/test.js at 100%; Julia test fixtures at 86%), contiguous ## Usage → ## Examples README subsequence (86%), keyword set (chi-square 93%, chi-squared 93%, chisq 79%, etc.).
  • Features without clear majority (excluded): native-addon presence (10/14 = 71%); README full section tuple Usage → Examples → C APIs (9/14 = 64%); package.json scripts/stdlib inner keys (all empty).

Per-outlier drift corrections

cdf

Reorders the top-level README sections to match the convention used across the namespace: ## Examples now follows ## Usage directly, with ## C APIs placed afterward. No content changes.

ctor

Adds chi-square (missing in 1/14, majority 93%) and chisq (missing in 3/14, majority 79%) to the keywords array. Fills in the chi-* alias cluster alongside the existing chisquare, chisquared, and chi-squared entries.

entropy

Adds chisq to the keywords array in package.json, bringing the package in line with 11 of 14 siblings in the stats/base/dists/chisquare namespace that already include this short-form alias. The omission was the sole drift item relative to peer packages.

median

Adds chi-squared and chisq to the keywords array in @stdlib/stats/base/dists/chisquare/median, aligning with 13/14 and 11/14 sibling packages in the namespace respectively. Keeps the chi-* keyword cluster consistent across the distribution family.

Validation

Checked:

  • Structural feature extraction across all 14 members (file trees, package.json shape, README heading order, test/benchmark/example filenames, manifest.json shape).
  • Semantic feature extraction across all 14 members (signature shape, validation prologue, error-construction style, JSDoc tag inventory, @stdlib/* imports).
  • Three-agent drift validation: opus semantic review, opus cross-reference against tests / sibling docs / remark-lint / package-json schema / TOC generator, and sonnet structural review.

Deliberately excluded:

  • Native-addon presence (10/14 = 71%, below the 75% threshold; ctor/median/pdf/quantile lack addons for genuine reasons and the sample is too close to the cutoff to infer drift).
  • ctor README shape (different by design — class/constructor layout rather than function docs).
  • stdev Julia test fixtures (stdev currently tests against Python-generated reference data; switching fixture generators would cascade into regenerated test.js data — out of scope).
  • entropy/kurtosis/skewness PositiveNumber parameter types (semantically correct: division by zero / log of zero at k = 0, so NonNegativeNumber would be a type lie).
  • Keyword-ordering variations where the suffix varies by package.

Related Issues

No.

Questions

No.

Other

Raised by the cross-package API drift-detection routine. Random namespace selection seeded with 20260423; the full drift report with every feature's conformance percentage, outlier list, and dropped-correction log is archived locally under ~/drift-reports/.

One commit per outlier package, in the stdlib convention: style: prefix, imperative subject with the package name in backticks, body citing the specific drift items corrected and the majority conformance percentage for each.

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 produced by Claude Code running the cross-package API drift-detection routine: structural + semantic feature extraction per package, 75% majority-vote, three-agent drift validation (opus semantic, opus cross-reference, sonnet structural), and per-package corrections. Human maintainer review required before promotion out of draft.


@stdlib-js/reviewers


Generated by Claude Code

claude added 4 commits April 23, 2026 20:22
Moved the JS `## Examples` section above `## C APIs` to match the
namespace-wide README section ordering (contiguous `## Usage` ->
`## Examples` appears in 12/14 chisquare packages, 86%). No content
changes; purely reordering.
…ions

Added missing `chi-square` (present in 13/14 siblings, 93%) and
`chisq` (11/14, 79%) to the keywords list. Both are standard
chi-squared-distribution aliases already present in the other
majority patterns.
…entions

Added missing `chisq` keyword (present in 11/14 siblings, 79%). The
package already lists `chisquare`, `chisquared`, `chi-square`, and
`chi-squared`, so the short-form alias was the sole omission
relative to the majority pattern.
…ntions

Added missing `chi-squared` (present in 13/14 siblings, 93%) and
`chisq` (11/14, 79%) to the keywords list. Both are standard
chi-squared-distribution aliases and complete the chi-* cluster
already present in the package.
@stdlib-bot stdlib-bot added the Statistics Issue or pull request related to statistical functionality. label Apr 23, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/base/dists/chisquare/cdf $\color{green}241/241$
$\color{green}+100.00%$
$\color{green}7/7$
$\color{green}+100.00%$
$\color{green}3/3$
$\color{green}+100.00%$
$\color{green}241/241$
$\color{green}+100.00%$
stats/base/dists/chisquare/ctor $\color{green}406/406$
$\color{green}+100.00%$
$\color{green}26/26$
$\color{green}+100.00%$
$\color{green}15/15$
$\color{green}+100.00%$
$\color{green}406/406$
$\color{green}+100.00%$
stats/base/dists/chisquare/entropy $\color{green}166/166$
$\color{green}+100.00%$
$\color{green}8/8$
$\color{green}+100.00%$
$\color{green}2/2$
$\color{green}+100.00%$
$\color{green}166/166$
$\color{green}+100.00%$
stats/base/dists/chisquare/median $\color{green}100/100$
$\color{green}+100.00%$
$\color{green}3/3$
$\color{green}+100.00%$
$\color{green}1/1$
$\color{green}+100.00%$
$\color{green}100/100$
$\color{green}+100.00%$

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

@Planeshifter Planeshifter changed the title style: align outliers in stats/base/dists/chisquare with namespace majority patterns chore: fix example positioning and align keywords in stats/base/dists/chisquare packages Apr 23, 2026
@Planeshifter Planeshifter marked this pull request as ready for review April 23, 2026 21:37
@Planeshifter Planeshifter requested review from a team and kgryte April 23, 2026 21:37
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Apr 23, 2026
@kgryte kgryte removed the Needs Review A pull request which needs code review. label Apr 23, 2026
@kgryte kgryte merged commit c660c8e into develop Apr 23, 2026
60 checks passed
@kgryte kgryte deleted the philipp/drift-stats-base-dists-chisquare-2026-04-23 branch April 23, 2026 22:14
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