Skip to content

docs: fix wording and indirection in math/base/assert/uint32-is-pow2#12854

Draft
Planeshifter wants to merge 1 commit into
developfrom
philipp/drift-math-base-assert-2026-06-13
Draft

docs: fix wording and indirection in math/base/assert/uint32-is-pow2#12854
Planeshifter wants to merge 1 commit into
developfrom
philipp/drift-math-base-assert-2026-06-13

Conversation

@Planeshifter

Copy link
Copy Markdown
Member

Description

This pull request:

  • Normalizes the package summary in @stdlib/math/base/assert/uint32-is-pow2 from "Test whether"/"Tests whether" to "Test if"/"Tests if" across package.json, README.md (blockquote, Usage, C APIs), lib/index.js, lib/main.js, lib/native.js, and docs/types/index.d.ts. The convention is used by 34/35 sibling packages in the namespace (97% conformance per location; 23/24 for the C APIs narrative).
  • Renames the lib/index.js import variable from isPow2Uint32 to main and updates the corresponding module.exports to the var main = require( './main.js' ); module.exports = main; indirection pattern used by 34/35 siblings (97% conformance). The exported function is unchanged.

Namespace summary

  • Members analyzed: 35 (zero autogenerated)
  • Features with a clear majority (≥75%) and corrections applied: 9 stylistic items, all in uint32-is-pow2
  • Features without a clear majority: README ## See Also (74%), ## C APIs (69%), ## Notes (37%) — excluded from drift analysis
  • No semantic drift found (uniform boolean return, single x: number/integer32/uinteger32 parameter, no validation prologue, no thrown errors)

uint32-is-pow2

Sole outlier in the namespace. The package predates the namespace-wide normalization to "Test if ..." phrasing and the var main indirection. The proposed corrections are pure docstring / local-identifier edits — no signature, behavior, or test expectation changes. docs/repl.txt is left untouched as a generator-owned file.

Validation

Three independent agent reviews confirmed all nine items as unintentional drift:

  • semantic review (no mathematical justification for "whether" over "if"; the predicate is a one-line bit-twiddle comparable in complexity to siblings using "Tests if");
  • cross-reference review (no tests, examples, or external consumers rely on the deviating strings; the module.exports rename is internal-only — test files declare their own local var isPow2Uint32 = require('./../lib'));
  • structural review (majority pattern confirmed by reading sibling packages directly).

Deliberately excluded:

  • is-coprime missing C-implementation files — open PR feat: add C implementation for math/base/assert/is-coprime  #4169 is adding the C implementation.
  • is-negative-integerf missing docs/repl.txt — generator-owned.
  • 6 packages using legacy src/addon.cpp + src/<name>.c instead of src/addon.c + src/main.c — non-mechanical refactor; warrants a separate maintainer pass.
  • is-composite, is-coprime, is-prime JSDoc summary "Returns a boolean ..." vs majority "Tests if ..." — plausibly intentional for number-theoretic predicates; needs human judgment.
  • The same "Tests whether" drift at line 836 of the namespace-aggregate math/base/assert/docs/types/index.d.ts — outside per-package scope.

Related Issues

No.

Questions

No.

Other

No.

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 a cross-package drift detection routine on @stdlib/math/base/assert. The routine extracted structural and semantic features per package, identified uint32-is-pow2 as the sole outlier on nine related stylistic features (≥75% conformance per feature), and three independent agent reviews confirmed each item as unintentional drift before any edits were applied.


@stdlib-js/reviewers


Generated by Claude Code

Replaces "whether" with "if" in package summary, README blockquote, README
Usage and C APIs sections, JSDoc summaries in `lib/main.js`, `lib/index.js`,
`lib/native.js`, and `docs/types/index.d.ts` to match the namespace
convention (34/35 siblings use "Test if"/"Tests if" in each location).

Renames the `lib/index.js` import variable from `isPow2Uint32` to `main` and
updates the corresponding `module.exports` to match the indirection pattern
used by 34/35 siblings. The exported function is unchanged.

`docs/repl.txt` left untouched per generator-owned exclusion.

https://claude.ai/code/session_01PZXpkkqMMffNV6CWutMWRP
@stdlib-bot stdlib-bot added the Math Issue or pull request specific to math functionality. label Jun 13, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
math/base/assert/uint32-is-pow2 $\\color{green}143/143$
$\\color{green}+100.00\\%$
$\\color{green}6/6$
$\\color{green}+100.00\\%$
$\\color{green}2/2$
$\\color{green}+100.00\\%$
$\\color{green}143/143$
$\\color{green}+100.00\\%$

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Math Issue or pull request specific to math functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants