Skip to content

feat(miner-governor): wire rate-limit + jittered backoff into live write enforcement #2344

Description

@JSONbored

Take the pure rate-limit/jitter calculator (companion wave-1 issue) and actually wire it into the Governor chokepoint so a miner cannot burst writes past a per-repo or global cadence — both to respect GitHub's own rate limits and to prevent a runaway loop from flooding a repo with PRs/comments. This is the enforcement half — the underlying calculator is already contributor-built and tested; this issue is its enforcement wiring. Open, scored contributor work, provided the tests below (burst-throttling, global+per-repo buckets, window reset) are thorough.

Deliverables

  • The Governor chokepoint calls evaluateLocalRateLimit per write-action-class + per-repo bucket before allowing execution
  • A denied (over-limit) action schedules a jittered retry using jitteredBackoffMs rather than either failing permanently or busy-looping
  • Global AND per-repo buckets both apply (a repo under its own limit can still be blocked by a global ceiling, mirroring how the review-stack's rate-limit floors work)
  • Integration tests: a burst of writes past the per-repo limit is throttled with increasing jittered delays, a global ceiling blocks even when every individual repo bucket is under its own limit, and the bucket correctly resets after its window elapses

References

  • The pure rate-limit/jitter calculator (companion wave-1 foundation issue) — this issue is its enforcement wiring
  • src/auth/rate-limit.ts — the server-side vocabulary this local enforcement mirrors
  • The Governor chokepoint (companion maintainer issue) — this is one of the calculators it composes

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

    Projects

    Status
    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions