Repository navigation
Draw only seated projects, time each pair, and let judges skip one - #34
Merged
Merged
Conversation
A project with no table in the mapping from PUT /tables has nowhere for a judge to go, so the draw skips it until one is mapped. Table syncs get their own rate limit, since the dashboard now resends them as assignments change. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Assignments record when they were handed out, and POST /pairs returns that time with MDredd's clock so a client can run a timer that a refresh cannot reset. POST /pairs with skip gives up the open pair without a comparison or strikes, refunds its appearances, and draws another; a stale skip returns the current pair instead of skipping twice. Existing databases gain the assigned_at column at startup. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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
Two changes to the judge flow, one commit each.
1. Draw only projects that have a table
POST /pairs(a fresh draw, and the replacement pair after an absence) only picks projects whoseProject Urlhas a table number in thePUT /tablesmapping. A project with no table has nowhere for a judge to go.409 POOL_EXHAUSTED.PUT /tablesgets its own rate-limit bucket (MDREDD_TABLES_CAPACITY30,MDREDD_TABLES_REFILL_PER_SECOND1.0). The dashboard now re-sends tables as assignments change, and those syncs must not use up the admin bucket that upload and start/stop share.2. Time each pair and let a judge skip one unjudged
assigned_at.POST /pairsreturns it along withserver_time, so a client can run a timer from MDredd's clock that a refresh, another device or a restart can't reset.POST /pairswithskip: [id, id]gives up the open pair: no comparison and no strikes. Both projects get back the appearance the draw counted, so a timed-out pair doesn't count towardMDREDD_MIN_JUDGMENTS. The replacement avoids both skipped projects when enough others can be drawn.skipno longer matches the judge's open pair, MDredd returns the current pair instead of skipping again, so a retry is safe.skipwithabsentis422.assignments.assigned_atcolumn at startup, the same waystrikeswas added. Pairs handed out before that count from startup.Testing
POOL_EXHAUSTED. With 3 mapped, 20 judges only ever got those 3, including the replacement after an absence. After 30 table syncs the tables bucket returns429, while admin calls still succeed.assigned_atis stable across reloads and restarts. A skip gives a non-overlapping pair with a laterassigned_atand no strike changes. A retried skip keeps the replacement. Voting on the replacement works. An old database is migrated and keeps serving.entity_state.frequencygoes back to its value before the draw after a skip, and stays incremented after a vote. With 20 projects and 50% random timeouts over 120 pairs, actual judgments per project ranged from 6 to 8.responses=warnings fromerror_responseswere already there.Deploy
Deploy before mhacks/dashboard's matching PR. The dashboard's judge page needs
assigned_at,server_timeandskip.🤖 Generated with Claude Code