Skip to content

fix(scoring): base open-PR threshold on merged history only#455

Merged
JSONbored merged 2 commits into
JSONbored:mainfrom
philluiz2323:fix/open-pr-threshold-existing-history
Jun 7, 2026
Merged

fix(scoring): base open-PR threshold on merged history only#455
JSONbored merged 2 commits into
JSONbored:mainfrom
philluiz2323:fix/open-pr-threshold-existing-history

Conversation

@philluiz2323

Copy link
Copy Markdown
Contributor

Closes #454.

The open-PR spam gate (computeScoreCore) computed its concurrency threshold by adding the planned PR's own totalTokenScore to the contributor's established merged-history token score (existingContributorTokenScore). So previewing a single large PR inflated the contributor's own allowance for concurrent open PRs, even with zero merged history.

Example: existingContributorTokenScore: 0, planned totalTokenScore: 300, openPrCount: 3 → threshold min(30, 2 + floor((0+300)/300)) = 3, gate passes; with the planned PR excluded it is 2, gate blocks.

Changes

  • Base the threshold bonus on existingContributorTokenScore only (established merged-history trust), not the in-flight PR's tokens.
  • Add a test asserting the planned PR's tokens do not raise the threshold while merged history does.

Verification

  • Full unit suite green (1243 passed). New test fails against the old code (old threshold 5 vs 2).

computeScoreCore added the planned PR's own totalTokenScore to its open-PR concurrency threshold, so a single large preview inflated the contributor's allowance for concurrent open PRs with zero merged history. Use only existingContributorTokenScore (established merged-history trust) for the threshold bonus.
@philluiz2323 philluiz2323 requested a review from JSONbored as a code owner June 7, 2026 01:46
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 7, 2026
@github-actions github-actions Bot added the gittensor:bug Gittensor-scored bug fix label Jun 7, 2026
@gittensory

gittensory Bot commented Jun 7, 2026

Copy link
Copy Markdown

Note

Gittensory Gate skipped

PR closed before full evaluation. No late first comment was created.

Signal Result Evidence Action
Gate result ⚠️ Skipped #455 is no longer open. No action.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

@gittensory gittensory Bot added the gittensory:reviewed Gittensor contributor context label Jun 7, 2026

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Reviewed the patch and current CI state. The threshold now depends only on established merged-history token score, and the regression covers both no-history and with-history behavior. CI is green. No merge action taken.

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jun 7, 2026
@JSONbored JSONbored merged commit b637b51 into JSONbored:main Jun 7, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jun 7, 2026
@github-actions github-actions Bot mentioned this pull request Jun 7, 2026
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix gittensory:reviewed Gittensor contributor context lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Open-PR threshold folds the planned PR's own token score into its concurrency allowance

2 participants