Repository navigation
Replace broken Judge runtime with reliable Judge v3 - #6
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa7476d695
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const text = `${facts}\n${evidence}`.replace(/\s+/g, ' ').trim(); | ||
| const lower = text.toLowerCase(); | ||
|
|
||
| if (/\b(draw|tie|tied|dead heat|even)\b/i.test(text)) { |
There was a problem hiding this comment.
Require an affirmative draw statement
When evidence contains a negated or unrelated occurrence such as “It was not a tie; Alice won” or “Even though Bob started first, Alice won,” this unconditional token match returns a 98%-confidence draw before winner parsing runs. The resulting draw can immediately be accepted and saved to the leaderboard, so draw detection needs contextual/negation handling and should not treat every use of “even” as a tied result.
Useful? React with 👍 / 👎.
| } | ||
| } | ||
|
|
||
| if (scores.length < 2 || scores.some(item => !Number.isFinite(item.value))) return null; |
There was a problem hiding this comment.
Require scores for every participant before choosing a winner
For challenges with three or more participants, this accepts any two parsed scores and declares the best of that incomplete subset the winner. For example, with Alice, Bob, and Charlie, evidence containing only “Alice 5, Bob 6” produces an immediate 94%-confidence Bob ruling even though Charlie's result is unknown and may be higher; require a valid score for every participant before returning a winner or draw.
Useful? React with 👍 / 👎.
| if (!aiJudgePendingRuling || Number(aiJudgeActiveBetId) !== Number(bet.id)) return; | ||
| if (bet.status !== 'active') return; |
There was a problem hiding this comment.
Tie background verification to its submitted ruling
When an instant ruling is challenged while the classifier is still downloading or running, the player can return to the evidence form or submit revised evidence, but this callback checks only that some pending ruling exists for the same bet. The obsolete callback can therefore overwrite the revised pending ruling—or replace the form and discard edits—with a result computed from the old facts; capture a request/ruling token and verify it still matches before applying the response.
Useful? React with 👍 / 👎.
| const photoCount = Array.isArray(aiVisionFiles) ? aiVisionFiles.length : 0; | ||
| const photoNote = photoCount | ||
| ? `${photoCount} photo${photoCount === 1 ? '' : 's'} attached. For reliable phone judging, describe what the photo proves in the written evidence box.` | ||
| : ''; |
There was a problem hiding this comment.
Tell users that attached photos are not reviewed
When a player attaches photo evidence, Judge v3 merely counts the files and never passes their contents or prior visual observations into either referee, while the existing picker in ai-vision.js still says the images are “analyzed on-device.” Although this note is constructed, it is only stored as photoNote, which renderAiJudgeRuling never displays, so users can accept a ruling believing contradictory or decisive photos were considered; remove/disable the picker or visibly render the warning before acceptance.
Useful? React with 👍 / 👎.
What changes
Xenova/mobilebert-uncased-mnli) for fuzzy wordinginsufficientinstead of hangingGoal
Tapping Judge This Bet must always produce either a ruling or a clear insufficient-evidence result. No dead spinner and no dependency on WebGPU.