feat(clients): optimize: evaluation, simulation, observability and optimizer on a discovery-checked call table

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-24 04:40:55 +02:00
co-authored by Claude Sonnet 5.5
parent 6d744a433f
commit 1e2fb400bb
55 changed files with 5099 additions and 3 deletions
@@ -0,0 +1,32 @@
// Route: POST /agent/optimize/simulate (simulated user vs a model agent, scored)
#include "support/GoogleRig.hpp"
using namespace molo::example::test;
int main() {
const char* json = "application/json";
GoogleRig keyed;
Fixture f(keyed.client);
const std::string ok =
"\"instruction\":\"help\",\"starting_prompt\":\"hi\",\"plan\":\"ask for a refund\"";
check(f.client->post("/agent/optimize/simulate", "{" + ok + ",\"max_turns\":13}", json).status == 422,
"max_turns over 12 is 422");
check(f.client->post("/agent/optimize/simulate", "{" + ok + ",\"max_turns\":0}", json).status == 422,
"max_turns 0 is 422");
check(f.client->post("/agent/optimize/simulate",
"{\"instruction\":\"help\",\"starting_prompt\":\"hi\"}", json).status == 422,
"missing plan is 422");
check(f.client->post("/agent/optimize/simulate", "{\"plan\":\"p\",\"starting_prompt\":\"hi\"}", json)
.status == 422,
"missing instruction is 422");
check(keyed.mock->send_count() == 0, "rejected input never reached Google");
check(f.client->get("/agent/optimize/simulate").status == 405, "get is 405");
GoogleRig none(false);
Fixture g(none.client);
auto res = g.client->post("/agent/optimize/simulate", "{" + ok + "}", json);
check(res.status == 503 && contains(res.body, "google_not_configured"),
"no credential is a loud 503");
check(none.mock->send_count() == 0, "no network without a credential");
return finish("agent/optimize/simulate");
}