Skip to content

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

Closed
RealDiligent wants to merge 12 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#3445
RealDiligent wants to merge 12 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 12 commits July 5, 2026 15:16
…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>
…erage

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

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

Co-authored-by: Cursor <cursoragent@cursor.com>
@RealDiligent
RealDiligent requested a review from JSONbored as a code owner July 5, 2026 07:18
@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 07:22:51 UTC

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

🛑 Suggested Action - Fix Blockers

Review summary
This change wires the existing account-age threshold into the issue contributor-cap path and adds issue-side visibility labeling for newly opened issues, with owner/admin/bot exemptions and fail-open behavior covered in the new tests. The core cap math mirrors the PR path by reducing only the effective per-repo issue cap and preserving the default/off path, so the visible diff is coherent and does not introduce a reachable correctness break. The main remaining issues are maintainability and coverage shape around duplicated exemption/lookup logic rather than a blocking defect.

Nits — 5 non-blocking
  • nit: src/queue/processors.ts:4836 duplicates the owner/admin/bot exemption calculation again in the issue-label path at src/queue/processors.ts:5651, so extract or reuse a small helper to keep the PR/issue account-age exemption contract from drifting.
  • nit: src/queue/processors.ts:4843 and src/queue/processors.ts:5659 can perform two `/users/{login}` lookups for the same opened issue when labeling and cap tightening both run; consider computing the account-age result once and passing it into the cap path or memoizing within the webhook handling.
  • nit: src/queue/processors.ts:4817 should use a named `MS_PER_DAY`-style constant instead of inline `24 * 60 * 60 * 1000`, matching the intent-heavy style of this queue processor code.
  • nit: test/unit/queue.test.ts:10501 adds broad account-age coverage, but the helper always returns `login: "newbie"` regardless of the requested author, which makes the fixture less faithful to the production lookup contract.
  • src/queue/processors.ts:4836: add a local `isAccountAgeExemptAuthor(repoFullName, authorLogin, env)` helper and use it from both the cap path and the opened-issue label path.

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 92.99%. Comparing base (0139bea) to head (c8806a1).
⚠️ Report is 2 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    #3445   +/-   ##
=======================================
  Coverage   92.99%   92.99%           
=======================================
  Files         294      294           
  Lines       30962    30986   +24     
  Branches    11291    11302   +11     
=======================================
+ Hits        28793    28816   +23     
  Misses       1514     1514           
- Partials      655      656    +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