fix(prompts): auto-append JUDGE_CONFIDENCE directive in buildJudgeSys…#4
Merged
Merged
Conversation
…temPrompt (0.11.1) extractJudgeConfidence requires a trailing `JUDGE_CONFIDENCE: N` line and silently defaults to 50 when absent. buildJudgeSystemPrompt was passing custom judge prompts through untouched, unlike buildParticipantSystemPrompt which auto-appends the matching `CONFIDENCE: N` directive. Any caller overriding the default JUDGE_PERSONA prompt silently received 50 on every run — a measurement-shaped value that polluted downstream statistics. This change makes buildJudgeSystemPrompt mirror the participant builder: idempotently append the directive, skipping when the input already contains the marker (so JUDGE_PERSONA's inline directive — and any diligent custom caller — is not duplicated). Discovered by a 12-run bench in ai-consensus-mcp where judge confidence was reported as exactly 50.0 ± 0.0 across every run. No public API change. buildJudgeSystemPrompt's output is longer when the input prompt lacks the marker; callers that snapshot-test that output need to regenerate snapshots.
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.
extractJudgeConfidence requires a trailing
JUDGE_CONFIDENCE: Nline and silently defaults to 50 when absent. buildJudgeSystemPrompt was passing custom judge prompts through untouched, unlike buildParticipantSystemPrompt which auto-appends the matchingCONFIDENCE: Ndirective. Any caller overriding the default JUDGE_PERSONA prompt silently received 50 on every run — a measurement-shaped value that polluted downstream statistics.This change makes buildJudgeSystemPrompt mirror the participant builder: idempotently append the directive, skipping when the input already contains the marker (so JUDGE_PERSONA's inline directive — and any diligent custom caller — is not duplicated).
Discovered by a 12-run bench in ai-consensus-mcp where judge confidence was reported as exactly 50.0 ± 0.0 across every run.
No public API change. buildJudgeSystemPrompt's output is longer when the input prompt lacks the marker; callers that snapshot-test that output need to regenerate snapshots.