Skip to content

refactor: align ndarray/base/diagonal error message and remove namespace self-refs#12096

Merged
kgryte merged 4 commits into
developfrom
philipp/fix-propagation-2026-05-11
May 11, 2026
Merged

refactor: align ndarray/base/diagonal error message and remove namespace self-refs#12096
kgryte merged 4 commits into
developfrom
philipp/fix-propagation-2026-05-11

Conversation

@Planeshifter
Copy link
Copy Markdown
Member

Description

Propagating fixes merged to develop between 2026-05-10 14:17 PDT and 2026-05-11 02:26 PDT to sibling packages with the same defect.

25ae5aa — align ndarray/base/diagonal ndims < 2 error message with ndarray/transpose

Follows 25ae5aa, which standardised the ndims < 2 RangeError message in ndarray/transpose to read 'invalid argument. Must provide an ndarray having two or more dimensions. Number of dimensions: \%u`.'and updated the corresponding@throwsJSDoc accordingly. Applies the same pattern to@stdlib/ndarray/base/diagonal, where both the thrown message and the @throws tag still carried the pre-standardised phrasing. The four iterator packages (ndarray/iter/{rows,columns,row-entries,column-entries}) were reviewed and excluded, as their ndims < 2guards throw aTypeErrorwithoutformat()` and follow a distinct phrasing convention.

  • lib/node_modules/@stdlib/ndarray/base/diagonal

b8d09ca — remove self-references from namespace 'related' arrays

Follows up b8d09ca, which removed self-referential entries from 'related' arrays in random/main.js where a block's own 'path' value appeared verbatim among its cross-links. The same defect exists in four additional namespace files; this commit removes the offending entries. A fifth candidate (usStatesNamesCapitals in u.js) was held back because the self-reference is the trailing array element, requiring a comma fix on the preceding line in addition to the deletion.

Affected blocks:

  • base.asech in lib/node_modules/@stdlib/namespace/lib/namespace/base/a.js
  • base.strided.dmskdeg2rad in lib/node_modules/@stdlib/namespace/lib/namespace/base/strided/d.js
  • base.strided.unary in lib/node_modules/@stdlib/namespace/lib/namespace/base/strided/u.js
  • iterDivide in lib/node_modules/@stdlib/namespace/lib/namespace/i.js

Related Issues

None.

Questions

No.

Other

Validation

What was checked:

  • Pattern search scoped per source: ndarray/base/** and ndarray/iter/** for the ndims < 2 error wording; lib/node_modules/@stdlib/namespace/lib/namespace/** for self-referential 'related' array entries (excluding derived alias2related/ / pkg2related/ data files).
  • Two independent Opus validation agents read every candidate site in full; both returned confirmed for the five propagated sites.
  • Opus adaptation agent produced per-site patches (Pattern 3, adaptive class); Sonnet style-consistency agent confirmed format() retention, Error-class preservation, and the trailing-comma audit for the 'related' array deletions.

Deliberately excluded:

  • The four ndarray/iter/{rows,columns,row-entries,column-entries} candidates for Pattern 3 — one validator marked these rejected because they throw a TypeError without format() against a different phrasing convention ('First argument must be an ndarray ...'), so the source commit's shape does not apply.
  • usStatesNamesCapitals in lib/node_modules/@stdlib/namespace/lib/namespace/u.js — self-reference is the last entry in its 'related' array; removal also requires stripping a trailing comma from the preceding line, flagged needs-human by one validator.
  • Three other source commits in the 24-hour window dropped during pre-validation:
    • 8ad7ea2f ("fix: update stride validation error messages") — runtime throws were already covered by PR fix: update stride validation error messages #11998 (merged 2026-05-10); a JSDoc-only propagation across 42 BLAS sites would exceed the source commit's mechanical scope, which touched only runtime throws.
    • a6af2c8b ("bench: replace new Array(100) with zeros(100, 'generic') in assert/is-*-property benchmarks") — recent-merge dedup applies. PR bench: replace new Array(100) with zeros(100, 'generic') in assert/is-*-property benchmarks #12010, merged 2026-05-10, was itself the propagation PR for this pattern and explicitly enumerated 88 rejected candidate sites.
    • b8d09ca sub-patterns 4b (buffer:data: rename in ndarray descriptor docs) and 4c (// buf =>// returns in scalar2ndarray d.ts doctests) — zero remaining candidate sites; the source commit itself already covered the only instances.

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 as part of a routine that scans the previous 24 hours of develop commits for generalisable fixes and propagates them to sibling packages. Candidate sites were independently verified by two Opus validation agents and a third Opus adaptation agent, then audited by a Sonnet style-consistency agent before any edits were applied. Each change is a direct analog of the cited source commit's transformation, restricted to the source commit's mechanical scope.


@stdlib-js/reviewers


Generated by Claude Code

claude added 2 commits May 11, 2026 13:39
Propagates the wording change from 25ae5aa ("refactor: update error
message") to `ndarray/base/diagonal`, the only remaining `ndarray/base`
package whose `ndims < 2` `RangeError` still uses the pre-standardized
phrasing ("First argument must be an ndarray having at least two
dimensions") in both the runtime throw and the `@throws` JSDoc tag.
Propagates the cleanup from b8d09ca ("chore: follow-up corrections for
commits merged to develop on 2026-05-10") to four sibling namespace
blocks where the entry's `'path'` value was also listed verbatim in
its own `'related'` array. Affected blocks: `asech` in `base/a.js`,
`dmskdeg2rad` in `base/strided/d.js`, `unary` in `base/strided/u.js`,
and `iterDivide` in `i.js`.
@stdlib-bot
Copy link
Copy Markdown
Contributor

stdlib-bot commented May 11, 2026

Coverage Report

Package Statements Branches Functions Lines
namespace $\color{red}40063/40166$
$\color{green}+0.00%$
$\color{green}113/113$
$\color{green}+0.00%$
$\color{red}2/11$
$\color{green}+0.00%$
$\color{red}40063/40166$
$\color{green}+0.00%$
ndarray/base/diagonal $\color{green}188/188$
$\color{green}+0.00%$
$\color{green}22/22$
$\color{green}+0.00%$
$\color{green}1/1$
$\color{green}+0.00%$
$\color{green}188/188$
$\color{green}+0.00%$

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

@Planeshifter Planeshifter marked this pull request as ready for review May 11, 2026 18:54
@Planeshifter Planeshifter requested review from a team and kgryte May 11, 2026 18:54
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label May 11, 2026
@kgryte kgryte removed the Needs Review A pull request which needs code review. label May 11, 2026
Comment thread lib/node_modules/@stdlib/namespace/lib/namespace/base/strided/u.js
Comment thread lib/node_modules/@stdlib/namespace/lib/namespace/base/a.js
Comment thread lib/node_modules/@stdlib/namespace/lib/namespace/i.js
Comment thread lib/node_modules/@stdlib/ndarray/base/diagonal/lib/main.js Outdated
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Comment thread lib/node_modules/@stdlib/ndarray/base/diagonal/lib/main.js Outdated
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
@kgryte kgryte changed the title refactor: align ndarray/base/diagonal and clean namespace self-refs refactor: align ndarray/base/diagonal error message and remove namespace self-refs May 11, 2026
@kgryte kgryte merged commit c77fbd9 into develop May 11, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants