Files
6krrt/tests/test_feedback.py
adlee-was-taken e28443cb36 feat: POST /outcome — the only ground truth the router can get
Everything else this router records is a proxy. Structural checks know whether
code parses. The local checker guesses whether prose looks right. Neither knows
whether the answer did the job. The client does: it ran the tests, or used the
answer, or watched it fail.

Clients report against the provider's completion id, which they already
receive in the response body and on every stream chunk. energy_observations
and verifications now store that id so a report has something to join on.

Two properties make this the highest-value signal available.

It is the only quality signal that survives streaming. A retry cannot reach a
streamed response -- the bytes are already gone -- but a report arrives
afterwards and works identically either way. Every agent client streams, so
without this the main workflow had verification and feedback but no route from
outcome back into routing.

And its successes count. feedback.py folds client outcomes in BOTH directions,
unlike checks where only failures do. That asymmetry is deliberate: a parser
reporting 'ok' means the code parsed, which is weak evidence that would
inflate every score toward the ceiling, while a client reporting 'succeeded'
means the work worked.

An unknown request_id returns 404 rather than being quietly accepted. A client
whose reports go nowhere should find out rather than train nothing.

Verified end to end on both paths, including a streamed completion reported as
failed after the fact.

Tests 227 -> 232.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018xTPER7K8fNyKiuqNvTCTa
2026-08-17 22:32:04 -04:00

8.1 KiB