Skip to content

fix(queue): eliminate duplicate scheduled work and gate jitter #1942

Description

@JSONbored

Parent: #1936

Problem

Hourly or bursty queue spikes suggest scheduled work and webhook-triggered work can still overlap. Beta-stable needs strict no-waste scheduler behavior: no polling loops, no duplicate sweeps, and no review job starting before required CI state is meaningful.

Requirements

  • Scheduled regate/backfill work should not fan out while equivalent work is already pending or processing.
  • Webhook bursts should coalesce where behavior is safe.
  • Orb review/gate jobs should not repeatedly appear transiently running after already publishing a final state.
  • Closed, stale, or head-changed PRs must not receive visible output from old work.

Deliverables

  • Audit scheduled jobs for hourly fanout patterns and overlapping triggers.
  • Add explicit queue introspection/backpressure for remaining scheduled job types, not just regate sweeps.
  • Add idempotency keys or terminal-state guards for public review/check publication where needed.
  • Add tests for duplicate scheduled sweeps, closed PRs, head changes, and CI-not-ready transitions.

Acceptance criteria

  • Hourly scheduled events do not create avoidable queue spikes under normal load.
  • A job already known to be stale exits before expensive GitHub reads.
  • The Orb review check/comment does not flip back into running after reaching a terminal state unless there is a new head/event that legitimately requires it.
  • The queue can continue draining useful work even when some jobs are deferred by GitHub budget.

Expected outcome

The queue stays smooth under bursty GitHub activity and avoids creating work that cannot produce a valid review outcome.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.orbGittensory Orb related - maintainer self-hosting analytics.roadmapOn the Wave-2 agent-layer roadmap board (project 9)

Projects

Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions