Skip to content

Comments

feat: author track record signal#46

Merged
huang-benny merged 5 commits intomainfrom
behuang/author_quality_signal
Nov 13, 2025
Merged

feat: author track record signal#46
huang-benny merged 5 commits intomainfrom
behuang/author_quality_signal

Conversation

@huang-benny
Copy link
Contributor

This PR adds a new quality signal that tracks the number of packages published by a package's primary maintainer on NPM.

Changes

  • Fetches the total number of packages maintained by the first listed maintainer
  • Uses NPM search API with maintainer: filter for results
  • Returns undefined if maintainer information is unavailable
  • Added fetchAuthorPackageCount() method to NpmCollector class

Scoring

  • 20+ libraries: 5 stars
  • 11+ libraries: 4 stars
  • 5+ libraries: 3 stars
  • 2+ libraries: 2 stars
  • 1 library: 1 star

Example CLI Input and Output:

./bin/cdk-construct-analyzer cdktf --verbose                

LIBRARY: cdktf
VERSION: 0.21.0

OVERALL SCORE: 79/100

---

SUBSCORES
  MAINTENANCE :           45/100
  QUALITY     :           91/100
  POPULARITY  :          100/100

---

=== MAINTENANCE ===                                   SCORE  WEIGHT
— Time To First Response ............................ ★★★★☆    3
— Release Frequency ................................. ★★☆☆☆    3
— Provenance Verification ........................... ★☆☆☆☆    3
— Number Of Contributors (Maintenance) .............. ★★★★★    2

=== QUALITY ===                                       SCORE  WEIGHT
— Documentation Completeness ........................ ★★★★★    3
— Tests Checklist ................................... ★★★★★    3
— Author Track Record ............................... ★★★★★    3
— Stable Versioning ................................. ★★★☆☆    2

=== POPULARITY ===                                    SCORE  WEIGHT
— Weekly Downloads .................................. ★★★★★    3
— Github Stars ...................................... ★★★★★    2
— Number Of Contributors (Popularity) ............... ★★★★★    1

README.md Outdated
* Documentation Completeness: High quality documentation makes the project easier to adopt and use (README, API References, Usage Examples).
* Tests checklist (unit/snapshot): Tests ensure correctness and prevent regressions.
* Author Track Record: Measures how many packages the author has published, more published packages often indicate greater experience.
* Stable versioning (>=1.x.x, not deprecated): Indicates API maturity and stability.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: its confusing why you are adding more than 'author track record' to the readme. i assume this is because you forgot to for some other signals and now are reading, but its not good to force the reviewer to make assumption

Copy link
Contributor Author

@huang-benny huang-benny Nov 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want me to remove this and make a separate PR for this or write about why I added this in the PR description?

}

async fetchAuthorPackageCount(): Promise<number | undefined> {
// Use the first maintainer to search for their packages (libraries can have multiple maintainers)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why first? is it guaranteed that npm returns the same order each time? how do they order it?

i would expect something like this is more robust:

  • pick the "best" maintainer for the score.
  • pick the "average" score of all maintainers.
  • accumulate the package count for each maintainer

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

picked best maintainer

}

try {
const response = await fetch(`https://registry.npmjs.org/-/v1/search?text=maintainer:${encodeURIComponent(maintainer.name)}&size=1`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this (and your other fetch calls) are ugly. in a separate PR, see if you can refactor and "build" these endpoints in a helper function so you don't have string concatenation as part of the main fetchAuthorPackageCount function

Comment on lines 70 to 73
name: 'authorTrackRecord',
weight: 3,
description: 'Track record of strong authors',
benchmarks: (packageCount: number) => categorizeHigherIsBetter([20, 11, 5, 2], packageCount),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

track record doesn't make sense to me. the number you are returning is package count, not track record. i can see how it would correlate, but calling the number track record is confusing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated to package count

@cdklabs-automation cdklabs-automation added this pull request to the merge queue Nov 13, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Nov 13, 2025
@huang-benny huang-benny added this pull request to the merge queue Nov 13, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Nov 13, 2025
@huang-benny huang-benny added this pull request to the merge queue Nov 13, 2025
Merged via the queue into main with commit e370b48 Nov 13, 2025
7 checks passed
@huang-benny huang-benny deleted the behuang/author_quality_signal branch November 13, 2025 20:38
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.

2 participants