Skip to content

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

Closed
RealDiligent wants to merge 9 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#3423
RealDiligent wants to merge 9 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, #3388, #3405.

Fix

  • Wire accountAgeThresholdDays into issue contributor-cap path and label newly opened issues
  • Match PR-path v8 ignore on label catch + defensive no-slash repoOwner branch (codecov/patch)
  • Tests: tighten cap, established account, off-by-default, non-auto label, fail-open, custom label, owner/admin/bot exemption

Test plan

  • npm run typecheck
  • npm run selfhost:env-reference:check
  • 9 issue-path account-age unit tests pass locally

RealDiligent and others added 8 commits July 5, 2026 14:08
…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>
… exemption

Co-authored-by: Cursor <cursoragent@cursor.com>
… label

Co-authored-by: Cursor <cursoragent@cursor.com>
…-age label

Co-authored-by: Cursor <cursoragent@cursor.com>
…overage

Co-authored-by: Cursor <cursoragent@cursor.com>
…/patch

Co-authored-by: Cursor <cursoragent@cursor.com>
@RealDiligent
RealDiligent requested a review from JSONbored as a code owner July 5, 2026 06:42
@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:56:53 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 cap-tightening, exemption, fail-open, and custom-label cases. The core behavior matches the PR-path contract visible in the diff: account age only tightens an existing contributor cap and never closes solely on age. I did not find a reachable correctness blocker in the provided diff, but the implementation now duplicates the same account-age fetch/date math in two issue-path sites, which is worth tightening before this grows further.

Nits — 5 non-blocking
  • nit: src/queue/processors.ts:4828 and src/queue/processors.ts:5645 duplicate the same `getGithubUserCreatedAt` plus age-days calculation, so extract or reuse a small helper to keep the issue and PR paths from drifting.
  • nit: src/queue/processors.ts:4833 and src/queue/processors.ts:5651 repeat the day-to-milliseconds literal; use an existing constant if one exists, or add a local `MS_PER_DAY` to make the threshold math harder to misread.
  • nit: src/queue/processors.ts:5628 adds a fairly deep nested block for issue labeling; an early-return helper would make the exemption, threshold, autonomy, and action-mode checks easier to audit in this hot path.
  • src/queue/processors.ts:4828: factor the account-age decision into a helper such as `isBelowAccountAgeThreshold(env, installationId, authorLogin, thresholdDays)` and call it from both the close path and label path.
  • src/queue/processors.ts:5628: consider moving the new issue-labeling block into a named helper mirroring the PR-path implementation so future parity changes have one obvious place to review.

CI checks failing

  • codecov/patch — 96.29% 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 96.29630% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 93.46%. Comparing base (4dc106e) to head (38c77dd).
⚠️ Report is 16 commits behind head on main.

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

❌ Your patch check has failed because the patch coverage (96.29%) 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    #3423   +/-   ##
=======================================
  Coverage   93.46%   93.46%           
=======================================
  Files         289      289           
  Lines       30784    30810   +26     
  Branches    11220    11232   +12     
=======================================
+ Hits        28773    28798   +25     
  Misses       1355     1355           
- Partials      656      657    +1     
Files with missing lines Coverage Δ
src/queue/processors.ts 93.06% <96.29%> (+0.03%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…erage

Co-authored-by: Cursor <cursoragent@cursor.com>
@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