Skip to content

Replace broken Judge runtime with reliable Judge v3 - #6

Merged
duhfreakinduh merged 4 commits into
mainfrom
fix/judge-v3
Aug 24, 2026
Merged

duhfreakinduh merged 4 commits into
mainfrom
fix/judge-v3

Conversation

@duhfreakinduh

Copy link
Copy Markdown
Owner

What changes

  • Replaces the fragile generative-model-first judge path with Judge v3
  • Adds an instant deterministic referee for explicit winner/draw/score statements
  • Adds a much smaller Hugging Face zero-shot classifier (Xenova/mobilebert-uncased-mnli) for fuzzy wording
  • Uses q4 browser inference (~31 MB model) instead of a large generative LLM
  • Explicit rulings render immediately; AI verification runs in the background
  • Ambiguous cases wait briefly for AI, then safely fall back to insufficient instead of hanging
  • Photo AI is no longer required for any ruling
  • Keeps strict participant validation and conflict handling
  • Bumps the service-worker cache to v7 so installed/mobile users receive the new judge

Goal

Tapping Judge This Bet must always produce either a ruling or a clear insufficient-evidence result. No dead spinner and no dependency on WebGPU.

@duhfreakinduh
duhfreakinduh merged commit 88727c9 into main Aug 24, 2026
2 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread judge-v3.js
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)) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread judge-v3.js
}
}

if (scores.length < 2 || scores.some(item => !Number.isFinite(item.value))) return null;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread judge-v3.js
Comment on lines +395 to +396
if (!aiJudgePendingRuling || Number(aiJudgeActiveBetId) !== Number(bet.id)) return;
if (bet.status !== 'active') return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Comment thread judge-v3.js
Comment on lines +43 to +46
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.`
: '';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant