feat: Stop agent emission - #448
Open
jmnmv12 wants to merge 18 commits into
Open
Conversation
jmnmv12
marked this pull request as ready for review
July 24, 2026 15:20
…eader during disqualification reapproval
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a new endpoint
PUT /admin/disqualified-agents/{agent_id}that allows an admin user to disqualify a single agent from receiving emission.A disqualified agent is dropped from all emission/ranking/leaderboard queries and the remaining agents renormalize in
normalize_agent_reward_weights. Removing an agent from the "approval chain" might influence the decisions made when it was the baseline agent to compare to.Taking that into account when an agent is disqualified, a new async job is created,
run_disqualification_reapproval, that walks every agent whose incentive decision came after B's (ordered by actual decision time) and re-runs the approve/reject gate against the evolving leader, starting from B's original baseline. Already-approved agents are only ever demoted, never rewritten, while rejected agents can be promoted with a freshly computed reward snapshot.Two new DB tables were added:
disqualified_agentsanddisqualification_jobs. It allows us to track disqualified agents and the reason why they were disqualified and disqualification_jobs and their respective status.A new unified view,
disqualified_agent_ids, was created to group common disqualification logic, i.e. an agent might be disqualified because it was specifically disqualified or because the miner CK they are associated with was banned. All of the operations that looked at thebanned_coldkeysnow look at this unified view.New tests were added to validate the behaviour of this operation.