Skip to content

fix(agent): verify exhaustive result requests - #740

Merged
ericleepi314 merged 1 commit into
mainfrom
fix/exhaustive-result-audit
Jul 22, 2026
Merged

fix(agent): verify exhaustive result requests#740
ericleepi314 merged 1 commit into
mainfrom
fix/exhaustive-result-audit

Conversation

@ericleepi314

Copy link
Copy Markdown
Collaborator

Summary

  • add a completion-audit contract to the core task prompt
  • require one bounded tool-backed audit when a user explicitly requests all/multiple/exhaustive results
  • preserve the audit latch across tool rounds and add regression coverage

Root cause

On terminal-bench 2.1 chess-best-move, clawcodex found e2e4 and stopped despite the request to return all winning moves. Claude Code mechanically enumerated candidates and also found g2g4. A prose-only follow-up audit repeated the same error, so the runtime guard now requires tool-backed validation for mechanically enumerable state spaces.

Verification

  • pytest -q tests/test_query_loop_wires_round3.py tests/parity/test_query_state_parity.py tests/parity/test_error_recovery_flow.py tests/test_system_prompt_full.py tests/test_query_extended_thinking.py tests/test_effort.py — 125 passed
  • terminal-bench 2.1 terminal-bench/chess-best-move, Claude Opus 4.8, effort high — reward improved from 0.0 to 1.0
  • successful local job: eval/harbor/jobs/chess-rerun-tool-backed-audit

@ericleepi314
ericleepi314 merged commit 4632433 into main Jul 22, 2026
2 checks passed
ericleepi314 added a commit that referenced this pull request Jul 26, 2026
…nglish (#749)

#740 added a one-shot "exhaustive audit" pass: when a request matched a
bare quantifier, the loop appended a MUST-enumerate instruction and forced
another model turn, backed by a matching system-prompt clause.

The trigger was `\b(all|every|multiple|each|exhaustive|complete set|any
other|others)\b` — plain English, not a request shape. Measured against
the 89 terminal-bench 2.1 instructions it fired on 49% of them, almost all
incidental: "each line of the file", "where each task is an async job",
"in all years". One case inverted the instruction outright — regex-log
says "If multiple dates are present in a line, the regex should match only
the last one", and the nudge answered that by demanding exhaustive
enumeration.

Removed rather than tuned. Tightening the regex would have been fitting a
clawcodex-only heuristic to a benchmark; the evidence says the mechanism
should not exist:

* the latest Claude Code scores 1.0 on both tasks this was built for
  (chess-best-move, regex-chess) with no audit machinery at all;
* only 1 of its 89 trials writes more than two verification files, where
  clawcodex wrote 57 temporary verification scripts across the run;
* clawcodex is +26% on mean trajectory steps against the same model at
  the same effort, and forced audit turns are part of that.

What stays is the phrasing-independent half: "audit the result against
every explicit requirement in the user's request … do not treat producing
a plausible result as proof that the task is complete." A genuine request
for every qualifying result IS an explicit requirement, so that sentence
already covers the case the nudge was reaching for — without keying off
the word "each".

Removes: EXHAUSTIVE_AUDIT_NUDGE, requests_exhaustive_results, the
_EXHAUSTIVE_REQUIREMENT pattern, the QueryState.exhaustive_audit_performed
latch, and the forced-turn branch in the loop.

Tests: 8842 passed. The replacement test pins the inverse — a completion
claim on an exhaustive-sounding request must not buy an extra turn.

Co-authored-by: Claude Opus 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.

1 participant