You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor(llm): one quality-judgment seam for LLM-scored quality; SELF_REFLECTION routes through it (#16133) - #21815
This PR was opened for an existing branch that never had one (triage status UNFINISHED). The branch carries 1ahead commit(s) of work not on main, linked to #16133 (tech-debt(quality): LLM-judged quality is implemented three times — ReflectionResult, JudgmentResult and ThinkCategory.SELF_REFLECTION). It still needs a conflict sync with main and a review before it can merge. Acceptance criteria have not been verified against this branch.
The changes add shared LLM judgement helpers and assessment projections. The judge, RLM evaluator, and self-reflection path use validated judgement. New tests cover these paths, and a source scan checks the designated callers.
Changes: LLM quality judgement
Layer / File(s)
Summary
Shared judgement helpers and assessment projections autobot-backend/llm_shared/quality_judgment.py, autobot-backend/rlm/types.py, autobot-backend/judges/__init__.py
Adds validated-judgement, score-clamping, and threshold helpers, plus an immutable QualityAssessment view. Judgment and reflection results can project their fields into that view. RLM verdicts map to recommendation terms.
Validated judgement callers and checks autobot-backend/judges/__init__.py, autobot-backend/rlm/evaluator.py, autobot-backend/llm_shared/quality_judgment_test.py, autobot-backend/conftest.py, repo_tests/*
The judge and RLM evaluator use the shared validated-judgement helper. RLM score and verdict handling uses the shared score helpers. Tests cover results, verdicts, assessment projections, and score boundaries. A source scan checks for direct complete_validated calls and verifies designated callers use judge_validated.
Self-reflection through validated judgement autobot-backend/agent_loop/think_tool.py, autobot-backend/agent_loop/self_reflection_seam_16133_test.py
Self-reflection requests schema-conforming JSON and uses validated judgement. It clamps the returned score and assigns zero confidence with a named risk when judging fails. Tests cover prompt formatting, result mapping, client use, and failure handling.
Merge Risk: Low · previous review 57697
Merge Risk:🔵 Low · up to 57697
A malformed self-reflection reply containing NaN can be reported as perfect confidence instead of a judge failure. The impact is narrow and the fix is small, so this is mergeable with a follow-up.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the main change: a single quality-judgment seam for LLM-scored quality, with SELF_REFLECTION routed through it. The changeset adds llm_shared/quality_judgment.py with judge_validated, …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: a single quality-judgment seam for LLM-scored quality, with SELF_REFLECTION routed through it. The changeset adds llm_shared/quality_judgment.py with judge_validated, updates the judges, RLM evaluator and think tool to use it, and adds a guard test that flags direct complete_validated calls. The title is concise, specific and matches the objectives. The title is 107 characters, which is longer than ideal but still readable.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Auto-sync: merging main into issue-16133-llm-judged-quality conflicts
The sync aborted the merge and pushed nothing. Conflicts are information, so it never resolves one itself. Below, for each conflicted file, are the commits that touched it on each side since the merge base 38c62a97b8. Merge main in yourself and push; the label clears on the first run that finds this branch 0 behind.
repo_tests/_reach_policy.py
side
commit
subject
issue refs
main
a471e4d87e
test(i18n): a shrink-only ratchet on hard-coded English UI text, per file (#12732)
mrveiss
changed the title
refactor(llm): one judging seam for LLM-scored quality, drop the unwired SELF_REFLECTION fork (#16133)
refactor(llm): one quality-judgment seam for LLM-scored quality, drop unwired SELF_REFLECTION (#16133)
Nov 18, 2026
Decision needed: remove or wire in ThinkCategory.SELF_REFLECTION
This PR (synced with main today, 13 files) adds one quality-judgment seam (autobot-backend/llm_shared/quality_judgment.py, used by rlm/evaluator.py and judges/). It also deletesThinkCategory.SELF_REFLECTION (agent_loop/types.py:102) and its prompt (agent_loop/think_tool.py:116) because nothing selects that category today.
The standing rule is that unwired code is wired in, not deleted. SELF_REFLECTION describes exactly what the new seam does (RLM evaluating its own response quality, #1373), so wiring is a real option.
Option
What happens
A (recommended): wire it in
Keep the category; make the think tool's self-reflection step call the new quality seam, so the category has a caller.
B: delete as the PR does
Accept the removal; record why in this PR (no caller, superseded by the seam).
C: split
Land the seam now without touching SELF_REFLECTION; decide the category in #16133.
Decision (owner, 2026-11-18): option A — keep ThinkCategory.SELF_REFLECTION and wire it in: the think tool's self-reflection step routes through the new quality-judgment seam (llm_shared/quality_judgment.py), so the category gains a caller instead of being deleted. Rework follows in this PR.
mrveiss
changed the title
refactor(llm): one quality-judgment seam for LLM-scored quality, drop unwired SELF_REFLECTION (#16133)
refactor(llm): one quality-judgment seam for LLM-scored quality; SELF_REFLECTION routes through it (#16133)
Nov 18, 2026
Notice: 29 open PRs — past the runaway threshold (25)
This is not a request to defer this PR. There is no cap on open PRs (#19397) -- nothing blocks opening or pushing a PR.
This notice only means the count is high enough to be worth a glance for a runaway — something opening PRs in a loop, or a merge pipeline that has stalled so nothing is draining.
If the queue is draining normally, ignore this. Otherwise:
Check whether CI is dispatching at all — see the ci-dispatch-watchdog status on these PRs
Approved PRs land through the merge train the coordinator sequences (merge commits, never squash) -- check the open chore(merge-train) PR is moving, not each PR on its own
Look for a loop opening near-identical PRs
Warn-only runaway detector — .github/workflows/pr-queue-gate.yml. It never blocks a merge.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
mrveiss
added
land-next
Landing set: CI capacity goes to these PRs first (owner direction 2026-09-18, #15397)
and removed
land-next
Landing set: CI capacity goes to these PRs first (owner direction 2026-09-18, #15397)
labels
Nov 19, 2026
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
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.
Thinking Path
This PR was opened for an existing branch that never had one (triage status UNFINISHED). The branch carries 1ahead commit(s) of work not on main, linked to #16133 (tech-debt(quality): LLM-judged quality is implemented three times — ReflectionResult, JudgmentResult and ThinkCategory.SELF_REFLECTION). It still needs a conflict sync with main and a review before it can merge. Acceptance criteria have not been verified against this branch.
What Changed
Commits on the branch (not on main):
Diff summary: 13 files changed, 349 insertions(+), 28 deletions(-)
Verification
Not yet verified. No CI evidence: this is a draft; no CI has run on it yet, and it needs a conflict sync with main and a review first.
Model Used
Branch authored by earlier Claude sessions; PR opened by Claude Sonnet 5.5.
Refs #16133
🤖 Generated with Claude Code
Summary by CodeRabbit