Skip to content

docs: align outliers in _tools/licenses with namespace majority patterns#11820

Closed
Planeshifter wants to merge 4 commits intodevelopfrom
philipp/drift-_tools-licenses-2026-04-28
Closed

docs: align outliers in _tools/licenses with namespace majority patterns#11820
Planeshifter wants to merge 4 commits intodevelopfrom
philipp/drift-_tools-licenses-2026-04-28

Conversation

@Planeshifter
Copy link
Copy Markdown
Member

Description

Aligning outliers in @stdlib/_tools/licenses with namespace majority patterns (random namespace pick, seed 2026-04-28-drift).

Namespace summary

  • Namespace: @stdlib/_tools/licenses
  • Members analyzed: 11 (none autogenerated)
  • Features with clear majority (≥75% conformance): top-level package.json keys (16 keys at 100%), directories.{example,lib,test} (test at 82%), lib/{index,main}.js (100%), examples/index.js (100%), README.md ## Usage (100%), README.md ## Examples (82%), errorConstruction = format (82%), jsdocShape.hasExample = true (100%).
  • Features without clear majority (excluded): __stdlib__ field (55%), os field (55%), bin (64%), directories.doc (64%), ## CLI README section (64%), ## Notes README section (55%), returnKind (split 55/45 between value and void), has_etc/has_docs (64%).

Per-outlier corrections

_tools/licenses/infer

Package _tools/licenses/infer: populated empty ## Examples section in README using examples/index.js; 9/11 siblings (82%) in @stdlib/_tools/licenses have a populated Examples section.

_tools/licenses/licenses

Package @stdlib/_tools/licenses/licenses: populated the ## Examples README section (heading and code block were HTML-commented out) using examples/index.js; 9/11 siblings (82%) in @stdlib/_tools/licenses have a populated Examples section.

Validation

Checked:

  • Structural feature extraction across all 11 members (file tree, package.json shape, README headings, manifest.json shape, test/benchmark/example filenames).
  • Semantic feature extraction via per-package agents (public signature, return kind, validation prologue, error construction, JSDoc shape, @stdlib/* dependencies).
  • Three-agent drift validation (semantic-review, cross-reference, structural-review).

Deliberately excluded:

  • header-regexp and infer errorConstruction outliers — both legitimately have no throw statements (delegated / private helper); not drift.
  • Missing test/ directory in infer and licenses — meaningful tests require fixtures and async filesystem mocking, not a mechanical stub; needs human follow-up.
  • Missing directories.test field in same packages — linked to the test-dir gap; pointless to add without the directory.
  • All features without ≥75% conformance (listed above).

Related Issues

No.

Questions

No.

Other

Any other information relevant to this pull request?

This PR was generated by an automated cross-package API drift detection routine that selects a random eligible namespace (≥8 non-autogenerated members), extracts structural and semantic features for each member, identifies majority patterns at a 75% threshold, validates findings via three independent agents, and applies only mechanical, behavior-preserving corrections to outliers.

Each commit corresponds to one outlier package.

Checklist

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of 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 end-to-end by Claude Code (Opus 4.7) running an automated namespace-drift routine: structural/semantic feature extraction across the namespace's members, majority-vote pattern detection at a 75% threshold, three-agent validation of each candidate correction, and mechanical application of only those corrections that survived all validators. The README content embedded in each Examples section is taken verbatim from the existing examples/index.js files.


@stdlib-js/reviewers


Generated by Claude Code

claude added 2 commits April 28, 2026 00:29
Populated the empty `## Examples` section in the README using the
existing `examples/index.js` content (a populated Examples section
is present in 82% of `_tools/licenses/*` siblings).

https://claude.ai/code/session_01SDghDzwtXE919uC6TaiRih
Populated the empty `## Examples` section in the README using the
existing `examples/index.js` content (a populated Examples section
is present in 82% of `_tools/licenses/*` siblings).

https://claude.ai/code/session_01SDghDzwtXE919uC6TaiRih
@stdlib-bot stdlib-bot added the Tools Issue or pull request related to project tooling. label Apr 28, 2026
Copy link
Copy Markdown
Member Author

Reverted both drift corrections after CI feedback.

The two outlier packages (infer and licenses) had their ## Examples sections populated using verbatim content from examples/index.js. Those code blocks call licenses() / infer(), which scan installed packages on the live filesystem — they don't run cleanly under the namespace's standard Examples-block contract (the ## Examples JS blocks in the 9 majority siblings are pure / fixture-based and run cleanly). Run changed examples correctly caught this.

Reclassifying both as needs-human: the README drift is real, but bringing these two examples up to majority-pattern requires writing fixture-driven example code, not mechanically lifting examples/index.js. Out of scope for this routine.

Branch left in place with revert commits for the audit trail; net diff against develop is now empty. Will leave the PR draft for a maintainer to close or re-target.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

Follow-up: Run changed examples failed again on the revert commits, but the failure is not from this PR's changes. git diff origin/develop is empty.

Cause: the workflow fires on any push that touches lib/**/README.md and then runs JS code blocks in the changed READMEs. The existing Usage-section JS in infer/README.md and licenses/README.md (already on develop) calls licenses(onResults) directly — unguarded live-filesystem I/O. Any commit that touches these two READMEs trips the same failure, regardless of content.

Pre-existing CI fragility, not actionable from this PR. Filed mental note for the routine: when a candidate README correction targets a package whose existing Usage-section JS already fails Run changed examples, the package should be skipped entirely (the trigger fires the moment we touch the file).


Generated by Claude Code

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

Labels

Tools Issue or pull request related to project tooling.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants