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,30 @@
// Route: POST /agent/optimize/traces (Cloud Trace v1 list, dashboard numbers)
#include <cstdlib>
#include "support/GoogleRig.hpp"
using namespace molo::example::test;
int main() {
setenv("GOOGLE_CLOUD_PROJECT", "test-proj", 1);
const char* json = "application/json";
GoogleRig keyed;
Fixture f(keyed.client);
check(f.client->post("/agent/optimize/traces", "{\"limit\":0}", json).status == 422,
"limit 0 is 422");
check(f.client->post("/agent/optimize/traces", "{\"limit\":101}", json).status == 422,
"limit over 100 is 422");
check(f.client->post("/agent/optimize/traces",
"{\"filter\":\"" + std::string(1001, 'x') + "\"}", json).status == 422,
"filter over 1000 characters is 422");
check(keyed.mock->send_count() == 0, "rejected input never reached Google");
check(f.client->get("/agent/optimize/traces").status == 405, "get is 405");
GoogleRig none(false);
Fixture g(none.client);
auto res = g.client->post("/agent/optimize/traces", "{\"limit\":5}", 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/traces");
}