Skip to content

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

Closed
RealDiligent wants to merge 4 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#3405
RealDiligent wants to merge 4 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 and #3388 (codecov/patch failures).

Fix

  • Wire accountAgeThresholdDays into issue contributor-cap path and label newly opened issues
  • Match PR-path v8 ignore on issue label catch handler (codecov/patch gap)
  • Tests: custom label, owner/admin exemption, cap tighten, fail-open, autonomy off

Test plan

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

RealDiligent and others added 4 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>
@RealDiligent
RealDiligent requested a review from JSONbored as a code owner July 5, 2026 06:19
@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:24:28 UTC

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

🛑 Suggested Action - Fix Blockers

Review summary
The change wires accountAgeThresholdDays into the issue contributor-cap path and adds issue-open labeling parity for below-threshold accounts. The core cap tightening is on the real opened-issue path, preserves owner/admin/automation exemptions, and fail-opens when the GitHub user creation date cannot be resolved. I did not find a reachable correctness blocker in the visible diff, but the new age calculation/lookup logic is duplicated enough that it should be tightened for maintainability.

Nits — 5 non-blocking
  • nit: src/queue/processors.ts:4829 and src/queue/processors.ts:5645 duplicate the same account-age lookup and day math, so change this to a shared helper or point me to the existing PR-path helper if there is one.
  • nit: src/queue/processors.ts:4833 and src/queue/processors.ts:5650 inline `24 * 60 * 60 * 1000`; use a named `MS_PER_DAY`/helper so the issue path stays aligned with the PR path.
  • nit: test/unit/queue.test.ts:10508 has `stubIssueAccountAgeFetch` always return `login: "newbie"`, even in the `oldbie` test, which weakens the test as a source-path assertion; make the stub take the expected login or derive it from the request URL.
  • In src/queue/processors.ts, extract something like `isBelowAccountAgeThreshold(env, installationId, authorLogin, thresholdDays)` and reuse it for both issue labeling and issue cap tightening.
  • In test/unit/queue.test.ts, update `stubIssueAccountAgeFetch(issueNumber, createdAt, seen)` to accept `login` so the fixture matches the author under test.

CI checks failing

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

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

❌ Your patch check has failed because the patch coverage (96.15%) 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    #3405   +/-   ##
=======================================
  Coverage   93.46%   93.46%           
=======================================
  Files         289      289           
  Lines       30784    30809   +25     
  Branches    11220    11231   +11     
=======================================
+ Hits        28773    28797   +24     
  Misses       1355     1355           
- Partials      656      657    +1     
Files with missing lines Coverage Δ
src/queue/processors.ts 93.05% <96.15%> (+0.02%) ⬆️
🚀 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