Tighten LLM proposal schema

This commit is contained in:
2026-04-04 23:24:32 +08:00
parent 00778eff42
commit 8b024c72f1
4 changed files with 133 additions and 0 deletions

View File

@@ -682,6 +682,23 @@ class CoreFlowTests(unittest.TestCase):
)
self.assertEqual(proposal.expected_effects, ["higher throughput"])
def test_proposal_expected_effects_accepts_object(self) -> None:
proposal = Proposal.from_dict(
{
"observation": "obs",
"diagnosis": "diag",
"config_patch": {"env_patch": {}, "flag_patch": {}},
"expected_effects": {
"throughput": "higher",
"ttft": "lower",
},
}
)
self.assertEqual(
proposal.expected_effects,
["throughput: higher", "ttft: lower"],
)
def test_replay_requests_early_stops_when_slo_is_unrecoverable(self) -> None:
requests = [
TraceRequest(