Skip to content

fix(agent-actions): apply account-age throttle on issue contributor-cap path - #3388

Closed
RealDiligent wants to merge 3 commits into
JSONbored:mainfrom
RealDiligent:fix/account-age-throttle-issue-path-v2
Closed

fix(agent-actions): apply account-age throttle on issue contributor-cap path#3388
RealDiligent wants to merge 3 commits into
JSONbored:mainfrom
RealDiligent:fix/account-age-throttle-issue-path-v2

Conversation

@RealDiligent

Copy link
Copy Markdown
Contributor

Summary

Completes the issue-path half of account-age throttle (#2561). Supersedes closed #3374 (codecov/patch 92.59%).

Fix

Test plan

  • npm run typecheck
  • 7 issue-path account-age unit tests pass locally

RealDiligent and others added 3 commits July 5, 2026 13:37
…ap path

Wire accountAgeThresholdDays into maybeCloseIssueOverContributorCap and
label newly opened issues from below-threshold accounts, completing the

Co-authored-by: Cursor <cursoragent@cursor.com>
JSONbored#2561 issue-path gap documented in RepositorySettings.
…ap path

Wire accountAgeThresholdDays into maybeCloseIssueOverContributorCap and
label newly opened issues from below-threshold accounts, completing the

Co-authored-by: Cursor <cursoragent@cursor.com>
JSONbored#2561 issue-path gap documented in RepositorySettings.
…count-age throttle

Co-authored-by: Cursor <cursoragent@cursor.com>
@RealDiligent
RealDiligent requested a review from JSONbored as a code owner July 5, 2026 06:00
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@loopover-orb loopover-orb Bot added the gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. label Jul 5, 2026
@loopover-orb

loopover-orb Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Caution

🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥

🛑 Gittensory review result - fixes required

Review updated: 2026-07-05 06:04:48 UTC

3 files · 1 AI reviewer · no blockers · readiness 80/100 · CI failing · unstable

🛑 Suggested Action - Fix Blockers

Review summary
This change wires account-age throttling into the issue contributor-cap path and adds issue-side labeling for below-threshold accounts, with tests covering the main enabled, disabled, established-account, custom-label, autonomy, lookup-failure, and owner-label cases. The core cap calculation is correct for the visible path: it fails open when user creation time is unavailable and uses the tightened cap only after live-verifying sibling issues. I do not see a reachable correctness defect in the diff itself, but the implementation duplicates PR/issue account-age logic and does an avoidable user lookup before knowing the per-repo issue cap will run.

Nits — 5 non-blocking
  • nit: src/queue/processors.ts:4829 duplicates the account-age lookup and age-days calculation that is repeated again in processGitHubWebhook at src/queue/processors.ts:5646, so this should be pulled into a small shared helper or you need to explain why the issue close path and label path must drift independently.
  • nit: src/queue/processors.ts:4829 runs getGithubUserCreatedAt before the per-repo cap guard at src/queue/processors.ts:4885, which means repos with accountAgeThresholdDays configured but no numeric contributorOpenIssueCap still pay a GitHub user lookup that cannot affect the close decision.
  • nit: src/queue/processors.ts:4833 and src/queue/processors.ts:5650 repeat the 24 * 60 * 60 * 1000 conversion inline; use the existing project constant if one exists or add a local MS_PER_DAY constant to make the threshold math less error-prone.
  • nit: test/unit/queue.test.ts:10502 adds broad fetch stubs that return Response.json({}) for unexpected requests, which can hide accidental extra API calls; prefer throwing on unmatched URLs in these account-age tests once the expected calls are enumerated.
  • src/queue/processors.ts:4829: move the account-age lookup below the numeric cap and autoCloseExempt guards, or document that the early lookup is intentional because another earlier decision needs it.

CI checks failing

  • codecov/patch — 92.59% of diff hit (target 99.00%)
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #3374
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (1 linked issue).
Validation posture ❌ 5/25 Preflight is holding this PR: the review lane is unavailable, so it is not ready for automated review.
Contributor workload ✅ 10/10 Author activity: 132 registered-repo PR(s), 17 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor RealDiligent; Gittensor profile; 132 PR(s), 0 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: RealDiligent
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: not available
  • Official Gittensor activity: 132 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Await review-lane availability.
  • Refresh registry data or choose a registered active repo.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

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

  • Re-run Gittensory review

@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.59259% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.46%. Comparing base (8334b1b) to head (52064a0).
⚠️ Report is 10 commits behind head on main.

Files with missing lines Patch % Lines
src/queue/processors.ts 92.59% 1 Missing and 1 partial ⚠️

❌ Your patch check has failed because the patch coverage (92.59%) is below the target coverage (99.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3388      +/-   ##
==========================================
- Coverage   93.46%   93.46%   -0.01%     
==========================================
  Files         286      286              
  Lines       30761    30787      +26     
  Branches    11209    11220      +11     
==========================================
+ Hits        28750    28774      +24     
- Misses       1355     1356       +1     
- Partials      656      657       +1     
Files with missing lines Coverage Δ
src/queue/processors.ts 93.02% <92.59%> (-0.01%) ⬇️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb

loopover-orb Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Gittensory is closing this pull request on the maintainer's behalf (CI is failing (codecov/patch)). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

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 — scores a 0.05x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant