Skip to content

docs: align keywords in string/base with namespace majority patterns#11841

Open
Planeshifter wants to merge 13 commits intodevelopfrom
philipp/drift-string-base-2026-04-29
Open

docs: align keywords in string/base with namespace majority patterns#11841
Planeshifter wants to merge 13 commits intodevelopfrom
philipp/drift-string-base-2026-04-29

Conversation

@Planeshifter
Copy link
Copy Markdown
Member

Description

This pull request aligns outlier packages in the @stdlib/string/base namespace with majority package.json keywords conventions (random namespace pick, seed 20260429).

Namespace summary

  • Namespace: @stdlib/string/base
  • Members analyzed: 60 leaf packages (1 namespace package excluded)
  • Majority threshold: 45 of 60 (75%)
  • Features with clear majority (≥75%): file tree, package.json top-level keys, os, engines, main, types, directories, README Usage/Examples sections, keywords set, returnKind, JSDoc @example/@param/@returns coverage
  • Features without clear majority (excluded): errorConstruction (only format-interpolate throws), validationPrologue (no validation in /base/), README ## section order (top sequence at 62%), __stdlib__ field (22%)

Outlier packages

string/base/slice-code-points

Keyword block was missing stdstring, utility, and util — each present in 96–98% of namespace siblings. Inserted at canonical positions; existing order otherwise untouched.

string/base/code-point-at, ends-with, for-each, for-each-code-point, for-each-code-point-right, for-each-grapheme-cluster, for-each-right, format-interpolate, format-tokenize, right-trim, slice-grapheme-clusters, trim

Each was missing the base keyword (47/60 = 78% in-namespace conformance). Inserted immediately after util to match the canonical leading-block layout. One commit per package per the routine.

Note: the five for-each* packages also use stdutils/stdutil in place of the conventional stdstring in their leading block. That secondary deviation is out of scope for this PR — it requires human review since it is not strictly a missing-element drift but a substitution.

Related Issues

None.

Questions

None.

Other

Validation

Cross-package drift was identified by extracting structural and semantic features from all 60 leaf packages, computing per-feature majority patterns at the 75% threshold, and gating each candidate fix through three independent reviewers:

  • Semantic review (Opus): confirmed no semantic-feature drift in the namespace; format-interpolate's concat-style throws have no in-namespace majority and are deliberately not touched.
  • Cross-reference review (Opus): confirmed package.json.keywords is read by no test, example, benchmark, or sibling tooling in string/base/; modifications cannot affect API contracts or test expectations.
  • Structural review (Sonnet): confirmed distances is a namespace aggregator (intentional deviation) and verified the canonical keyword-block layout used by the corrected packages.

Excluded from this run

  • distances — namespace package (re-exports hamming and levenshtein); missing lib/main.js, benchmark/, docs/repl.txt and most leaf-keyword conventions are intentional given its package shape.
  • format-interpolate error construction — concat-style throws diverge from the global format convention, but only one package in the namespace throws, so no in-namespace majority exists; out of scope per the routine's strict majority-vote rule.
  • README See Also section — auto-populated by tooling; missing sections are upstream automation territory, not drift.
  • for-each* stdutils/stdutil substitution — flagged for human review; not a strict missing-element drift.

A full local audit report is saved alongside the worktree as drift-string-base-2026-04-29.md.

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 the cross-package drift-detection routine: structural and semantic features were extracted programmatically, three independent agents validated each candidate correction, and only fixes confirmed as mechanical, behavior-preserving metadata edits were applied. Human authors should audit the keyword insertions against the namespace conventions before promoting from draft.



Generated by Claude Code

claude added 13 commits April 29, 2026 12:50
Added missing `base` keyword (present in 78% of `string/base/*` siblings).
Added missing `base` keyword (present in 78% of `string/base/*` siblings).
Added missing `base` keyword (present in 78% of `string/base/*` siblings).
…ions

Added missing `base` keyword (present in 78% of `string/base/*` siblings).
…onventions

Added missing `base` keyword (present in 78% of `string/base/*` siblings).
…onventions

Added missing `base` keyword (present in 78% of `string/base/*` siblings).
Added missing `base` keyword (present in 78% of `string/base/*` siblings).
Added missing `base` keyword (present in 78% of `string/base/*` siblings).
Added missing `base` keyword (present in 78% of `string/base/*` siblings).
Added missing `base` keyword (present in 78% of `string/base/*` siblings).
…ventions

Added missing `base` keyword (present in 78% of `string/base/*` siblings).
Added missing `base` keyword (present in 78% of `string/base/*` siblings).
Added missing `stdstring`, `utility`, and `util` keywords (present in 96-98% of `string/base/*` siblings).
@stdlib-bot
Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
string/base/code-point-at $\color{red}137/146$
$\color{green}+93.84%$
$\color{red}10/14$
$\color{green}+71.43%$
$\color{green}1/1$
$\color{green}+100.00%$
$\color{red}137/146$
$\color{green}+93.84%$
string/base/ends-with $\color{green}270/270$
$\color{green}+100.00%$
$\color{green}31/31$
$\color{green}+100.00%$
$\color{green}2/2$
$\color{green}+100.00%$
$\color{green}270/270$
$\color{green}+100.00%$
string/base/for-each-code-point-right $\color{green}124/124$
$\color{green}+100.00%$
$\color{green}6/6$
$\color{green}+100.00%$
$\color{green}1/1$
$\color{green}+100.00%$
$\color{green}124/124$
$\color{green}+100.00%$
string/base/for-each-code-point $\color{green}124/124$
$\color{green}+100.00%$
$\color{green}6/6$
$\color{green}+100.00%$
$\color{green}1/1$
$\color{green}+100.00%$
$\color{green}124/124$
$\color{green}+100.00%$
string/base/for-each-grapheme-cluster $\color{green}107/107$
$\color{green}+100.00%$
$\color{green}5/5$
$\color{green}+100.00%$
$\color{green}1/1$
$\color{green}+100.00%$
$\color{green}107/107$
$\color{green}+100.00%$
string/base/for-each-right $\color{green}92/92$
$\color{green}+100.00%$
$\color{green}4/4$
$\color{green}+100.00%$
$\color{green}1/1$
$\color{green}+100.00%$
$\color{green}92/92$
$\color{green}+100.00%$
string/base/for-each $\color{green}92/92$
$\color{green}+100.00%$
$\color{green}4/4$
$\color{green}+100.00%$
$\color{green}1/1$
$\color{green}+100.00%$
$\color{green}92/92$
$\color{green}+100.00%$
string/base/format-interpolate $\color{red}712/739$
$\color{green}+96.35%$
$\color{red}123/139$
$\color{green}+88.49%$
$\color{green}12/12$
$\color{green}+100.00%$
$\color{red}712/739$
$\color{green}+96.35%$
string/base/format-tokenize $\color{red}134/136$
$\color{green}+98.53%$
$\color{red}12/13$
$\color{green}+92.31%$
$\color{green}2/2$
$\color{green}+100.00%$
$\color{red}134/136$
$\color{green}+98.53%$
string/base/right-trim $\color{green}227/227$
$\color{green}+100.00%$
$\color{green}9/9$
$\color{green}+100.00%$
$\color{green}2/2$
$\color{green}+100.00%$
$\color{green}227/227$
$\color{green}+100.00%$
string/base/slice-code-points $\color{green}107/107$
$\color{green}+100.00%$
$\color{green}21/21$
$\color{green}+100.00%$
$\color{green}1/1$
$\color{green}+100.00%$
$\color{green}107/107$
$\color{green}+100.00%$
string/base/slice-grapheme-clusters $\color{green}146/146$
$\color{green}+100.00%$
$\color{green}20/20$
$\color{green}+100.00%$
$\color{green}1/1$
$\color{green}+100.00%$
$\color{green}146/146$
$\color{green}+100.00%$
string/base/trim $\color{green}283/283$
$\color{green}+100.00%$
$\color{green}11/11$
$\color{green}+100.00%$
$\color{green}3/3$
$\color{green}+100.00%$
$\color{green}283/283$
$\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 string/base with namespace majority patterns docs: align keywords in string/base with namespace majority patterns Apr 30, 2026
@Planeshifter Planeshifter marked this pull request as ready for review April 30, 2026 00:45
@Planeshifter Planeshifter requested a review from a team April 30, 2026 00:45
@stdlib-bot stdlib-bot added the Needs Review A pull request which needs code review. label Apr 30, 2026
@Planeshifter Planeshifter requested a review from kgryte April 30, 2026 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Review A pull request which needs code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants