Skip to content

The mock answers a judge with a verdict object - #1682

Merged
Muizzkolapo merged 3 commits into
vendors-without-a-key-need-no-api-keyfrom
mock-answers-in-the-shape-a-prompt-offers
Nov 8, 2026
Merged

Muizzkolapo merged 3 commits into
vendors-without-a-key-need-no-api-keyfrom
mock-answers-in-the-shape-a-prompt-offers

Conversation

@Muizzkolapo

@Muizzkolapo Muizzkolapo commented Nov 7, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • An llm_judge asks in text mode for one of two JSON objects. The agac-provider mock answered every text prompt with prose, so every judged outcome failed with "judge response was not a verdict object".
  • In text mode the mock now reads the prompt's last non-empty line. When that line is only two or more JSON objects joined by or, the mock returns one of them. Any other text prompt still gets prose.
  • The choice is seeded by the action name and the prompt alone, so one rule and one value always get the same verdict, whatever judge calls came before.
  • The expectations reference has a new section, "Testing a judge offline".

Verification

Gate Result
RED (tests/unit/llm/providers/test_mock_follows_an_offered_answer_shape.py on the parent) 5 assertion failures
Review (risk HIGH, 3 blind lenses) 3/3 NO, one cause: the seed used a process-wide attempt count, so a verdict depended on earlier judge calls
Fix and re-review Seed by the prompt alone; two tests pin it and fail without the fix. Blind re-review: YES
Full suite, ruff, mypy 17299 passed, 37 skipped (before and after the fix commit)
  • Smoke ran on the bottom layer only, as asked.

@Muizzkolapo
Muizzkolapo added this pull request to stack #1685 November 7, 2026 19:20
@Muizzkolapo
Muizzkolapo force-pushed the mock-answers-in-the-shape-a-prompt-offers branch 2 times, most recently from 58c948f to f13e157 Compare November 8, 2026 01:16
@Muizzkolapo
Muizzkolapo marked this pull request as ready for review November 8, 2026 09:59
@Muizzkolapo
Muizzkolapo force-pushed the mock-answers-in-the-shape-a-prompt-offers branch from f13e157 to b3dcb5a Compare November 8, 2026 13:41
@Muizzkolapo
Muizzkolapo force-pushed the mock-answers-in-the-shape-a-prompt-offers branch from b3dcb5a to 555268f Compare November 8, 2026 14:41
An llm_judge asks in text mode for one of two JSON objects. The
agac-provider mock answered every text prompt with prose, so every
judged outcome failed with "judge response was not a verdict
object". A judged rule could not be tested offline.

In text mode the mock now reads the prompt's last non-empty line.
When that line is only JSON objects joined by " or ", the mock
returns one of them, chosen by its seeded generator, with each
string value replaced by a generated sentence. Any other text
prompt still gets prose.
The mock answered with a JSON object whenever a text prompt's last
line was JSON objects joined by " or ". A single object matched
too, so a text action whose prompt ends with a rendered record got
an object back in place of prose.

The mock now needs two or more objects on that line. A judge
prompt offers two, so it still gets a verdict.
The mock seeded an offered answer with the prompt and the attempt
number. Every judge call of one action shares one attempt counter,
so the verdict for a value depended on how many judge calls came
before it: adding a record, a second judged rule or a vote changed
the verdicts of later records. The docs promise one verdict for one
rule and value.

The offered answer is now seeded by the prompt alone. Two tests
pin it: a value keeps its verdict after other judge calls, and the
order of values does not change their verdicts. Two more cases
check that two offered objects with extra text on the line still
get prose.
@Muizzkolapo
Muizzkolapo force-pushed the mock-answers-in-the-shape-a-prompt-offers branch from 555268f to 589abde Compare November 8, 2026 14:54
@Muizzkolapo
Muizzkolapo merged commit 22da4f9 into main Nov 8, 2026
10 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 8, 2026
@Muizzkolapo
Muizzkolapo deleted the mock-answers-in-the-shape-a-prompt-offers branch November 8, 2026 17:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant