Skip to content

fix(always_on): the judge reads the model's thinking only when the task's filter keeps it - #980

Merged
sarah-chitty-1 merged 5 commits into
mainfrom
sarahchitty/always-on-judge-thinking-filter
Dec 3, 2026
Merged

sarah-chitty-1 merged 5 commits into
mainfrom
sarahchitty/always-on-judge-thinking-filter

Conversation

@sarah-chitty-1

@sarah-chitty-1 sarah-chitty-1 commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Merge order. #933 and #981 are merged, and main with both is merged into this branch. Their overlap in always_on_agent_verifier.py and always_on_staging.py is resolved so both survive: #981's failed-turn judging and no-trajectory rule, and this PR's thinking rule. Nothing else needs to merge before this one.

What

On always_on runs, the judge read the model's thinking, even when the task set include_thinking: false.

The always_on path stages its own judge files (always_on_staging.py), which wrote every thought as an assistant_thinking line. The task's trajectory filter was applied only on the generic path. A partner's audit of 246 graded runs found the judge citing the model's reasoning in up to 13 of 24 runs per model for Claude, DeepSeek, GLM, Kimi and Qwen, and never for GPT, whose reasoning is encrypted. Verdicts went both ways, crediting a model for what it only thought and failing one because a result line appeared only in its thinking.

Change

  • The always_on judge grades what the assistant did and said, not what it thought. Its staged files carry thinking only when the run's trajectory filter asks for it: a DEFAULT filter that sets include_thinking: true (always_on_staging.stages_thinking). The filter is resolved as the generic path resolves it, user_overrides.apply_trajectory_filter included.
  • always_on staging (stage_run) drops thinking otherwise and counts what it left out (thinking_left_out). The entry always says whether the thinking was shown (trajectory_staging.thinking_shown).
  • always_on_agent_verifier tells the judge that the files leave the thinking out.
  • Only the thinking setting is read. The staged files read include_thinking and compaction_type from the filter and nothing else. Any other setting that isn't at its default (include_tool_calls, include_response, action_log_max_lines, …) is logged as not applying.
  • Turns staged as recorded. A turn in a format the staging can't break into events (native OpenCode, for one) is staged as recorded, reasoning included. With thinking left out, the judge's note names those wakes and says any thinking in them is not evidence, and the entry lists them (trajectory_staging.thinking_unfiltered_wakes).
  • The generic path is unchanged. judge_utils/trajectory_filter.keeps_thinking() is the generic DEFAULT compactions' rule (OTel, atif/1): with no filter the judge reads the trajectory as recorded. always_on doesn't use it.

Default

For an always_on judge:

  • No filter: no thinking. This differs from the generic path, and from always_on before this PR.
  • A filter that doesn't set include_thinking (its default is false): no thinking.
  • A SCREENSHOT filter: no thinking, even with include_thinking: true.
  • A DEFAULT filter with include_thinking: true: thinking, as recorded.

Existing tasks this changes. All 18 PSI always_on tasks on the hub that I checked (psi-ts-*, in use today) have 45 always_on verifiers between them. 31 set a trajectory_filter and 14 (end-state judges, plus psi-ts-money-checkup's process judge) set none. None sets include_thinking: true. So after merge, no PSI always_on judge sees the model's thinking, where today they all do when the model records it. Scores can move either way, as in the audit.

psi-ts-craftweb-holiday-rush-always-on-2 has criteria a judge may have graded from thinking: cheap_traps, ruled_out_bayside and ruled_out_aroma_lane (why it ruled a supplier out, on its own), and forecast, whose policy credits "its working". When the model gave its reason or forecast only in its thinking, those now fail. The PSI authoring guide's "the agent's thinking reaches the judge only when its trajectory recorded it" needs updating too.

Tests

  • No filter, a filter that doesn't set include_thinking, include_thinking: false, a SCREENSHOT filter (with or without include_thinking) and an override that drops the filter all give judge files with no assistant_thinking lines. include_thinking: true keeps them. The no-filter, SCREENSHOT and dropped-filter cases fail on the previous head.
  • A native OpenCode turn keeps its reasoning, and the judge's note and the entry name its wake. A filter setting the staging doesn't read is logged.
  • 1504 verifier and always_on tests pass, and ruff is clean. The 6 failures in task_step + cli also fail on main.
  • Goldens re-recorded, the four always_on cases only:
    • judge_inputs.json: always_on_staged and always_on_atif_staged, with smaller wake and events files and the note's left-out wording.
    • rubrics_subclasses.json: ao_staged_with_what_its_judge_read and ao_context_loss_the_gate_fails, with thinking_shown: false, thinking_left_out: 4 and a smaller staged_bytes.

Not in this PR

Raw turns aren't filtered: an unknown format's reasoning stays in its trajectory_item lines, and the judge is told it isn't evidence. OpenHands and pi may be staged raw too; that's untested.

🤖 Generated with Claude Code

Confidence Score: 5/5RetriggerView in Greptile

The PR appears safe to merge; no actionable new issues were found.

Summary

Always-on judges now receive thinking only when a DEFAULT trajectory_filter explicitly enables include_thinking.

  • Always-on judges see thinking only when a DEFAULT filter asks for it.

sarah-chitty-1 explicitly accepts that unknown formats retain thinking; the judge is told not to use it as evidence.

Reviews (9) · Last reviewed commit: "Merge origin/main (#981) into sarahchitt..." · Reviewed by Greptile

…en the judge's trajectory filter shows it

On the always_on path the judge reads files always_on_staging builds itself, and those carried every recorded
thought as an assistant_thinking line whatever the task's trajectory_filter said: include_thinking was applied
only on the generic path's compaction. A task that set include_thinking: false had its judge read (and cite) the
reasoning of models whose thinking is recorded (Claude, DeepSeek, GLM, Kimi, Qwen), never of GPT, whose reasoning
is encrypted.

- trajectory_filter.keeps_thinking: the one rule, read by the generic path's OTel and atif/1 compaction and by
  always_on staging: no filter, the trajectory as recorded; a filter, thinking only with include_thinking.
- stage_run takes the judge's trajectory filter, resolved as the generic path resolves it (_run_values, a run's
  user_overrides.apply_trajectory_filter included); thinking it leaves out is counted in the record
  (trajectory_staging.thinking_left_out), and the judge's files note says the files don't have it.
- A task that sets no filter stages thinking as before.

Tests: a filter with include_thinking false (or a filter's default, or the apply_trajectory_filter override's)
stages no assistant_thinking line and none of the thinking text, in stage_run and through the verifier into the
judge's sandbox; true, no filter, or an override that drops the filter stages it as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sarah-chitty-1 and others added 2 commits December 2, 2026 14:00
…g in raw turns, and match the generic path under SCREENSHOT

Review fixes on #980:

- A turn in a format the staging can't break into events (native OpenCode)
  is staged as recorded, reasoning included, whatever the filter says. The
  judge's note no longer claims the files hold no thinking: it names those
  wakes, and the entry does too (trajectory_staging.thinking_unfiltered_wakes).
- keeps_thinking: a SCREENSHOT filter's include_* flags don't apply, so it
  leaves the thinking as recorded, as the generic path hands an agent judge
  the raw trajectory. Its docstring now names the readers that ask it and
  the ones that pass thinking through unfiltered.
- The staged files read only include_thinking and compaction_type from the
  filter; any other setting set away from its default is logged, and the
  docstrings say so. trajectory_staging.thinking_shown is always recorded.
- StagedRun exposes thinking_shown and unfiltered_wakes, so the note reads
  the staging's own decision instead of computing it a second time.
- The note's thinking words are one clause, not a second parenthetical.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ng only when its filter sets include_thinking: true

An always_on judge grades what the assistant did and said, not what it
thought. Its staged files now carry thinking only for a DEFAULT trajectory
filter that sets include_thinking: true (always_on_staging.stages_thinking).
No filter, a filter that doesn't set it (as PSI's always_on tasks store
theirs), or a SCREENSHOT filter all stage none. The generic path is
unchanged: keeps_thinking still shows a judge with no filter the trajectory
as recorded, and its docstring now says always_on doesn't use it.

thinking_shown is still recorded on every entry. The judge's note for a turn
staged as recorded (an unknown format) now says any thinking in it is not
evidence.

Goldens re-recorded where this changes them, all four always_on cases:
judge_inputs.json (always_on_staged, always_on_atif_staged: smaller wake and
events files, the note's left-out wording) and rubrics_subclasses.json
(ao_staged_with_what_its_judge_read, ao_context_loss_the_gate_fails:
thinking_shown false, thinking_left_out 4, staged_bytes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sarah-chitty-1 and others added 2 commits December 2, 2026 15:55
…lter

One conflict, in always_on_staging.py, resolved to keep both sides:
- the module docstring: #980's thinking only when the judge's filter asks
  for it (stages_thinking), with #933's harness note for a failed wake
  (``failure``);
- the imports: #980's trajectory_filter import beside #933's turn_events
  import with is_infra_failure;
- _Stager's fields: #980's thinking, thinking_left_out and as_recorded
  beside #933's harness_failures;
- the staging record: #980's thinking_left_out and
  thinking_unfiltered_wakes beside #933's harness_failures.

Everything else merged cleanly; src/agent_env/task (Task.retry_config_of
and the implied retries) is main's as is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lter

Two conflicts, both in module docstrings, resolved to keep both sides:
- always_on_agent_verifier.py: #980's paragraph on the strict thinking
  rule (stages_thinking) stays, followed by #981's paragraph on wakes
  with no stored trajectory and _judges_without_trajectory.
- always_on_staging.py: the wake file list keeps #980's "thinking when
  ... the judge's trajectory filter asks for it (stages_thinking)" and
  adds #981's turn_failed line.

The code of both merged cleanly: #981's failed-turn judging, its
no-trajectory rule and turn_failed lines, beside #980's stages_thinking,
the settings warning and the files note.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sarah-chitty-1
sarah-chitty-1 merged commit 0bcb148 into main Dec 3, 2026
35 of 36 checks passed
@sarah-chitty-1
sarah-chitty-1 deleted the sarahchitty/always-on-judge-thinking-filter branch December 3, 2026 00:35
sarah-chitty-1 added a commit that referenced this pull request Dec 3, 2026
Conflicts, each resolved so #980's thinking filter, #981's failure notes and this branch's guard notes and line-limit
guarantee all survive:
- always_on_staging.py: the module docstring says a turn's thinking is staged only when the judge's filter asks for
  it (stages_thinking) and that a harness_note can carry failure or guard; the stager keeps #980's thinking,
  thinking_left_out and as_recorded beside guard_actions and shown; the record keeps thinking_left_out and
  thinking_unfiltered_wakes beside context_guard_actions and results_shown_not_whole.
- test_always_on_staging.py: imports both TrajectoryFilter (#980) and TurnEvents (this branch).
- tst/data/verifier_golden/judge_inputs.json: always_on_staged and always_on_atif_staged re-recorded on the merge.
  Against main they differ only by this branch's text: the prompt by 198 characters (the files note's preview and
  line_file sentence, "at most the first 300") and index.md by 163 (its header sentence).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

3 participants