feat(clients): sessions+registry+optimize+armor: close gaps, loud list truncation, shared Gemini adapter

sessions: operations get/list/cancel/delete/wait for engine, session, memory and
serving profile; servingProfiles CRUD. registry: ListResult with truncated flag,
v1alpha twins, gateway/policy operations, authz IAM, deny policy update, boundary
patch/bindings. optimize: make_gemini_model over models::VertexModel (DirectModel
removed), generateSyntheticData, online evaluator operations, trace/log writers.
armor: SecurityAdmin for all SCC v2 methods (attack exposure excluded), documented
agent threat categories, floor settings fixed to location global after live run.
check_discovery.py of all four enforce coverage.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-24 05:43:13 +02:00
co-authored by Claude Sonnet 5.5
parent 29d775a923
commit a3396bfc68
83 changed files with 5020 additions and 378 deletions
@@ -57,6 +57,26 @@ int main() {
body("\"scope_key\":\"user_id\",\"scope_value\":\"1\""), body("\"scope_key\":\"\"")},
{"/agent/sessions/memories/purge", body("\"filter\":\"scope.user_id=\\\"1\\\"\""),
body("\"filter\":\"\"")},
{"/agent/sessions/operations/list", body("\"parent\":\"" + kEngine + "/sessions/chat-1\""),
body("\"parent\":\"" + kEngine + "/other/x\"")},
{"/agent/sessions/operations/get", body("\"name\":\"" + kEngine + "/operations/7\""),
body("\"name\":\"" + kEngine + "/operations/..\"")},
{"/agent/sessions/operations/wait",
body("\"name\":\"" + kEngine + "/operations/7\",\"timeout_seconds\":\"60\""),
body("\"name\":\"" + kEngine + "/operations/7\",\"timeout_seconds\":\"61\"")},
{"/agent/sessions/operations/cancel",
body("\"name\":\"" + kEngine + "/memories/mem-1/operations/7\""),
body("\"name\":\"operations/7\"")},
{"/agent/sessions/serving-profiles/list", "{\"location\":\"us-central1\"}",
"{\"location\":\"Bad Place\"}"},
{"/agent/sessions/serving-profiles/get",
"{\"location\":\"us-central1\",\"profile_id\":\"sp-1\"}",
"{\"location\":\"us-central1\",\"profile_id\":\"Bad_Id\"}"},
{"/agent/sessions/serving-profiles/create",
"{\"location\":\"us-central1\",\"profile_id\":\"sp-1\",\"display_name\":\"Live\","
"\"scope\":\"GEMINI_LIVE\"}",
"{\"location\":\"us-central1\",\"profile_id\":\"sp-1\",\"display_name\":\"Live\","
"\"scope\":\"EVERYTHING\"}"},
};
GoogleRig rig(false);
@@ -119,6 +139,30 @@ int main() {
422,
"delete memory: bad id is 422");
auto del_op = f.client->request(
Method::Delete, "/agent/sessions/operations/operation?engine=" + kEngine +
"&name=" + kEngine + "/operations/7");
check(del_op.status == 503 && contains(del_op.body, "google_not_configured"),
"delete operation: no credential is 503");
check(f.client->request(Method::Delete,
"/agent/sessions/operations/operation?engine=" + kEngine +
"&name=" + kEngine + "/sessions").status == 422,
"delete operation: a name that is no operation is 422");
check(f.client->post("/agent/sessions/operations/operation").status == 405,
"delete operation route: post is 405");
auto del_profile = f.client->request(
Method::Delete, "/agent/sessions/serving-profiles/profile?location=us-central1&id=sp-1");
check(del_profile.status == 503 && contains(del_profile.body, "google_not_configured"),
"delete serving profile: no credential is 503");
check(f.client->request(Method::Delete,
"/agent/sessions/serving-profiles/profile?location=us-central1&id=A_B")
.status == 422,
"delete serving profile: bad id is 422");
check(f.client->post("/agent/sessions/operations/wait",
body("\"name\":\"" + kEngine + "/operations/7\",\"timeout_seconds\":\"0\""),
kJson).status == 422,
"server-side wait of 0 seconds is 422");
check(rig.mock->send_count() == 0, "side effect: nothing reached the network");
// With a credential, validation still runs first and still stops traffic.
@@ -12,6 +12,8 @@ int main() {
check(contains(page.headers.get("Content-Type"), "text/html"), "html");
check(contains(page.body, "Agent sessions and memory"), "heading");
check(contains(page.body, "/agent/sessions/memories/purge"), "lists the purge route");
check(contains(page.body, "/agent/sessions/operations/wait"), "lists the server-side wait route");
check(contains(page.body, "/agent/sessions/serving-profiles/list"), "lists serving profiles");
check(contains(page.body, "viewport"), "mobile viewport meta from the base template");
auto status = f.client->get("/agent/sessions/status");
@@ -20,6 +22,7 @@ int main() {
check(contains(status.body, "\"configured\":true"), "configured with a credential");
check(contains(status.body, "aiplatform v1beta1"), "names the API surface");
check(contains(status.body, "\"max_top_k\":50"), "shows the top_k cap");
check(contains(status.body, "\"max_server_wait_seconds\":60"), "shows the wait cap");
check(!contains(status.body, kTestKey), "credential never shown");
check(rig.mock->send_count() == 0, "side effect: GET pages never call Google");
}