Scale computer-use 2.0 with open-source drivers, cross-OS sandboxes, and benchmarks for training, evaluation, and data generation.
Rust agentai-agentapplecomputer-usecomputer-use-agentcontainerizationcuadesktop-automationhacktoberfestlumemacosmanusoperatorswiftvirtualizationvirtualization-frameworkwindowswindows-sandbox
chore(kopf-k3s): remove upstream Cyclops (cyclops-ctrl/cyclops-ui) (#5912)
r33drichardsb3765c22a99c
diff --git a/libs/fleet/Dockerfile b/libs/fleet/Dockerfileindex 12742bfb22..14b57d29fa 100644--- a/libs/fleet/Dockerfile+++ b/libs/fleet/Dockerfile@@ -15,14 +15,9 @@ RUN pnpm install --frozen-lockfile --ignore-workspaceCOPY . .RUN pnpm build-# Runtime stage — nginx serves static files and proxies /api to cyclops-ctrl.+# Runtime stage — nginx serves static files and proxies /api to the backend.FROM nginx:1.27-alpine AS runtime-# In-cluster DNS for the cyclops-ctrl Service. Override at deploy-time-# with the CYCLOPS_CTRL env var if cyclops-cs runs outside the cyclops-# namespace or against a different controller.-ENV CYCLOPS_CTRL=http://cyclops-ctrl.cyclops:8080-# In-cluster DNS for the cyclops-cs-backend Service (sibling Deployment# in the same namespace). Override if the backend is reached at a# different hostname.diff --git a/libs/fleet/backend/auth/authz.rego b/libs/fleet/backend/auth/authz.regoindex 4a870c9aff..5d77518bb9 100644--- a/libs/fleet/backend/auth/authz.rego+++ b/libs/fleet/backend/auth/authz.rego@@ -91,21 +91,6 @@ allow {is_interactive_client}-# /api/pool-templates — per-user saved pool configs (list, create, get,-# delete). Exact interactive clients only; the backend scopes operations to the caller's-# sub, so a user can only ever read or mutate their own templates.-allow {- input.route == "/api/pool-templates"- input.user.sub != ""- is_interactive_client-}--allow {- input.route == "/api/pool-templates/{name}"- input.user.sub != ""- is_interactive_client-}-# /api/k8s/{path...} — kubectl-proxy passthrough.## Any exact interactive client may read customer-facing resources (their pools, the pods@@ -308,20 +293,6 @@ allow {is_user_key_client}-# Pool templates — user API keys manage their owner's templates, same as-# SPA users (the backend scopes every call to the resolved sub).-allow {- input.route == "/api/pool-templates"- input.user.sub != ""- is_user_key_client-}--allow {- input.route == "/api/pool-templates/{name}"- input.user.sub != ""- is_user_key_client-}-# K8s API proxy — user API keys get the same access as non-admin SPA users# (infra paths are blocked).allow {diff --git a/libs/fleet/backend/auth/authz_test.rego b/libs/fleet/backend/auth/authz_test.regoindex 0389c7800f..cd2b13cbca 100644--- a/libs/fleet/backend/auth/authz_test.rego+++ b/libs/fleet/backend/auth/authz_test.rego@@ -749,103 +749,6 @@ test_namespaces_missing_azp_denied if {}}-# ── /api/pool-templates — per-user saved pool configs ───────────────────────--test_pool_templates_spa_list_allowed if {- authz.allow with input as {- "route": "/api/pool-templates",- "method": "GET",- "path": "/api/pool-templates",- "params": {},- "user": {"sub": "user-123", "azp": "cyclops-cs-spa", "namespace": "", "email": "[email protected]"},- }-}--test_pool_templates_spa_create_allowed if {- authz.allow with input as {- "route": "/api/pool-templates",- "method": "POST",- "path": "/api/pool-templates",- "params": {},- "user": {"sub": "user-123", "azp": "cyclops-cs-spa", "namespace": "", "email": "[email protected]"},- }-}--test_pool_templates_spa_get_allowed if {- authz.allow with input as {- "route": "/api/pool-templates/{name}",- "method": "GET",- "path": "/api/pool-templates/gpu-large",- "params": {"name": "gpu-large"},- "user": {"sub": "user-123", "azp": "cyclops-cs-spa", "namespace": "", "email": "[email protected]"},- }-}--test_pool_templates_spa_delete_allowed if {- authz.allow with input as {- "route": "/api/pool-templates/{name}",- "method": "DELETE",- "path": "/api/pool-templates/gpu-large",- "params": {"name": "gpu-large"},- "user": {"sub": "user-123", "azp": "cyclops-cs-spa", "namespace": "", "email": "[email protected]"},- }-}--# Per-key clients (key-*) CANNOT touch pool templates — those tokens are-# bound to a single pool, not a user identity.-test_pool_templates_per_key_denied if {- not authz.allow with input as {- "route": "/api/pool-templates",- "method": "GET",- "path": "/api/pool-templates",- "params": {},- "user": {"sub": "svc-123", "azp": "key-foo", "namespace": "foo", "email": ""},- }-}--# User API keys (ukey-*) act on behalf of a user and may manage templates.-test_pool_templates_user_key_list_allowed if {- authz.allow with input as {- "route": "/api/pool-templates",- "method": "GET",- "path": "/api/pool-templates",- "params": {},- "user": {"sub": "user-123", "azp": "ukey-test123abc", "namespace": "", "email": ""},- }-}--test_pool_templates_user_key_delete_allowed if {- authz.allow with input as {- "route": "/api/pool-templates/{name}",- "method": "DELETE",- "path": "/api/pool-templates/gpu-large",- "params": {"name": "gpu-large"},- "user": {"sub": "user-123", "azp": "ukey-test123abc", "namespace": "", "email": ""},- }-}--# Empty sub denied on pool-template routes.-test_pool_templates_empty_sub_denied if {- not authz.allow with input as {- "route": "/api/pool-templates",- "method": "GET",- "path": "/api/pool-templates",- "params": {},- "user": {"sub": "", "azp": "cyclops-cs-spa", "namespace": "", "email": "[email protected]"},- }-}--# Missing azp denied on pool-template routes.-test_pool_templates_missing_azp_denied if {- not authz.allow with input as {- "route": "/api/pool-templates",- "method": "GET",- "path": "/api/pool-templates",- "params": {},- "user": {"sub": "user-123", "azp": "", "namespace": "", "email": "[email protected]"},- }-}-# ── /api/user-keys — per-user API key management ────────────────────────────test_user_keys_spa_create_allowed if {diff --git a/libs/fleet/backend/config/config.go b/libs/fleet/backend/config/config.goindex 8a77e7fd6b..cee40f1773 100644--- a/libs/fleet/backend/config/config.go+++ b/libs/fleet/backend/config/config.go@@ -24,7 +24,6 @@ type Configuration struct {Auth AuthConfigurationKeycloak KeycloakConfigurationGateway GatewayConfiguration- Templates TemplatesConfigurationMetrics MetricsConfigurationTelemetry TelemetryConfiguration}@@ -72,11 +71,6 @@ type GatewayConfiguration struct {ClusterDomain string}-// TemplatesConfiguration drives the per-user pool-template store-// (/api/pool-templates). BATCH_REDIS_URL remains a compatibility fallback.-type TemplatesConfiguration struct {- RedisURL string // POOL_TEMPLATES_REDIS_URL (falls back to BATCH_REDIS_URL)-}type MetricsConfiguration struct {Addr string // METRICS_ADDR — Prometheus listen addr@@ -115,8 +109,6 @@ var specs = []flagSpec{{"gateway.scheme", "orch-scheme", "ORCH_SCHEME", "http", "orchestrator scheme"},{"gateway.port", "orch-port", "ORCH_PORT", "80", "orchestrator port"},{"gateway.cluster-domain", "cluster-domain", "CLUSTER_DOMAIN", "svc.cluster.local", "in-cluster DNS domain"},- {"batch.redis-url", "batch-redis-url", "BATCH_REDIS_URL", "", "legacy pool-templates Redis URL fallback"},- {"templates.redis-url", "pool-templates-redis-url", "POOL_TEMPLATES_REDIS_URL", "", "pool-templates Redis URL (falls back to batch Redis)"},{"metrics.addr", "metrics-addr", "METRICS_ADDR", ":9091", "Prometheus metrics listen address"},{"telemetry.endpoint", "otel-endpoint", "OTEL_EXPORTER_OTLP_ENDPOINT", "https://otel.cua.ai", "OTLP HTTP traces endpoint"},{"telemetry.protocol", "otel-protocol", "OTEL_EXPORTER_OTLP_PROTOCOL", "http/protobuf", "OTLP exporter protocol"},@@ -148,10 +140,6 @@ func LoadConfig() (*Configuration, error) {issuer = realmPath}- templatesRedis := viper.GetString("templates.redis-url")- if templatesRedis == "" {- templatesRedis = viper.GetString("batch.redis-url")- }cfg := &Configuration{WebServer: WebServerConfiguration{Addr: viper.GetString("webserver.addr")},@@ -182,7 +170,6 @@ func LoadConfig() (*Configuration, error) {Port: viper.GetString("gateway.port"),ClusterDomain: viper.GetString("gateway.cluster-domain"),},- Templates: TemplatesConfiguration{RedisURL: templatesRedis},Metrics: MetricsConfiguration{Addr: viper.GetString("metrics.addr")},Telemetry: TelemetryConfiguration{Endpoint: viper.GetString("telemetry.endpoint"),diff --git a/libs/fleet/backend/docs/docs.go b/libs/fleet/backend/docs/docs.goindex 0741ebf61c..bdd0b63bcd 100644--- a/libs/fleet/backend/docs/docs.go+++ b/libs/fleet/backend/docs/docs.go@@ -29,7 +29,7 @@ const docTemplate = `{"tags": ["batch"],- "summary": "Deprecated batch lane acquisition route",+ "summary": "Deprecated batch lanes route","deprecated": true,"parameters": [{@@ -65,7 +65,7 @@ const docTemplate = `{"tags": ["batch"],- "summary": "Deprecated batch lane release route",+ "summary": "Deprecated batch lanes route","deprecated": true,"parameters": [{@@ -141,7 +141,7 @@ const docTemplate = `{"tags": ["batch"],- "summary": "Deprecated batch cancellation route",+ "summary": "Deprecated batch delete route","deprecated": true,"parameters": [{@@ -295,16 +295,11 @@ const docTemplate = `{},"/api/gateway/{name}/{path}": {"get": {- "security": [- {- "BearerAuth": []- }- ],- "description": "DEPRECATED (CUA-609): The per-pool orchestrator HTTP layer has been removed. This route returns 410 Gone for all requests. All pool operations must use OSGymSandboxClaim CRs (Path B) directly.",+ "description": "The per-pool HTTP orchestrator has been deprecated and removed. All pools now use OSGymSandboxClaim CRs exclusively (Path B). This endpoint returns 410 Gone for any request. See CUA-609.","tags": ["gateway"],- "summary": "DEPRECATED (CUA-609): per-pool orchestrator proxy — returns 410 Gone",+ "summary": "DEPRECATED: Per-pool orchestrator reverse-proxy (CUA-609)","parameters": [{"type": "string",@@ -315,38 +310,14 @@ const docTemplate = `{},{"type": "string",- "description": "Upstream path (proxied verbatim, no validation)",+ "description": "Upstream path (ignored)","name": "path","in": "path"}],"responses": {- "200": {- "description": "Upstream response",- "schema": {- "type": "string"- }- },- "400": {- "description": "Bad Request",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- },- "401": {- "description": "Unauthorized",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- },- "403": {- "description": "Forbidden",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- },- "502": {- "description": "Bad Gateway",+ "410": {+ "description": "Orchestrator HTTP layer deprecated (CUA-609)","schema": {"$ref": "#/definitions/handlers.ErrorResponse"}@@ -542,9 +513,9 @@ const docTemplate = `{"application/json"],"tags": [- "batch"+ "label"],- "summary": "Deprecated label cancellation route",+ "summary": "Deprecated label delete route","deprecated": true,"parameters": [{@@ -556,7 +527,7 @@ const docTemplate = `{},{"type": "string",- "description": "Batch label",+ "description": "Label","name": "label","in": "path","required": true@@ -587,9 +558,9 @@ const docTemplate = `{"application/json"],"tags": [- "batch"+ "label"],- "summary": "Deprecated label batch submission route",+ "summary": "Deprecated label batch route","deprecated": true,"parameters": [{@@ -601,7 +572,7 @@ const docTemplate = `{},{"type": "string",- "description": "Batch label",+ "description": "Label","name": "label","in": "path","required": true@@ -632,7 +603,7 @@ const docTemplate = `{"application/json"],"tags": [- "batch"+ "label"],"summary": "Deprecated label results route","deprecated": true,@@ -646,7 +617,7 @@ const docTemplate = `{},{"type": "string",- "description": "Batch label",+ "description": "Label","name": "label","in": "path","required": true@@ -677,7 +648,7 @@ const docTemplate = `{"application/json"],"tags": [- "batch"+ "label"],"summary": "Deprecated label status route","deprecated": true,@@ -691,7 +662,7 @@ const docTemplate = `{},{"type": "string",- "description": "Batch label",+ "description": "Label","name": "label","in": "path","required": true@@ -938,195 +909,6 @@ const docTemplate = `{}}},- "/api/pool-templates": {- "get": {- "security": [- {- "BearerAuth": []- }- ],- "description": "Returns every pool template owned by the calling user, newest first.",- "produces": [- "application/json"- ],- "tags": [- "pool-templates"- ],- "summary": "List the calling user's pool templates",- "responses": {- "200": {- "description": "OK",- "schema": {- "type": "array",- "items": {- "$ref": "#/definitions/handlers.PoolTemplateResponse"- }- }- },- "401": {- "description": "Unauthorized",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- },- "503": {- "description": "Service Unavailable",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- }- }- },- "post": {- "security": [- {- "BearerAuth": []- }- ],- "description": "Stores the given pool config under a name owned by the calling user. Re-saving an existing name overwrites the config while preserving the original creation time. Use GET /api/pool-templates to list them and seed a new pool.",- "consumes": [- "application/json"- ],- "produces": [- "application/json"- ],- "tags": [- "pool-templates"- ],- "summary": "Save a pool config as a reusable template",- "parameters": [- {- "description": "Template name + pool config",- "name": "body",- "in": "body",- "required": true,- "schema": {- "$ref": "#/definitions/handlers.CreatePoolTemplateRequest"- }- }- ],- "responses": {- "201": {- "description": "Created",- "schema": {- "$ref": "#/definitions/handlers.PoolTemplateResponse"- }- },- "400": {- "description": "Bad Request",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- },- "401": {- "description": "Unauthorized",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- },- "503": {- "description": "Service Unavailable",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- }- }- }- },- "/api/pool-templates/{name}": {- "get": {- "security": [- {- "BearerAuth": []- }- ],- "produces": [- "application/json"- ],- "tags": [- "pool-templates"- ],- "summary": "Get one of the calling user's pool templates",- "parameters": [- {- "type": "string",- "description": "Template name",- "name": "name",- "in": "path",- "required": true- }- ],- "responses": {- "200": {- "description": "OK",- "schema": {- "$ref": "#/definitions/handlers.PoolTemplateResponse"- }- },- "401": {- "description": "Unauthorized",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- },- "404": {- "description": "Not Found",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- },- "503": {- "description": "Service Unavailable",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- }- }- },- "delete": {- "security": [- {- "BearerAuth": []- }- ],- "tags": [- "pool-templates"- ],- "summary": "Delete one of the calling user's pool templates",- "parameters": [- {- "type": "string",- "description": "Template name",- "name": "name",- "in": "path",- "required": true- }- ],- "responses": {- "204": {- "description": "No Content"- },- "401": {- "description": "Unauthorized",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- },- "404": {- "description": "Not Found",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- },- "503": {- "description": "Service Unavailable",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- }- }- }- },"/api/svc/{namespace}/{service}/{path}": {"get": {"security": [@@ -1388,18 +1170,6 @@ const docTemplate = `{}}},- "handlers.CreatePoolTemplateRequest": {- "type": "object",- "properties": {- "config": {- "type": "object"- },- "name": {- "type": "string",- "example": "gpu-large"- }- }- },"handlers.CreateUserKeyRequest": {"type": "object","properties": {@@ -1500,23 +1270,6 @@ const docTemplate = `{}}},- "handlers.PoolTemplateResponse": {- "type": "object",- "properties": {- "config": {- "type": "object"- },- "createdAt": {- "type": "string"- },- "name": {- "type": "string"- },- "user": {- "type": "string"- }- }- },"handlers.UserKeyResponse": {"type": "object","properties": {@@ -1560,7 +1313,7 @@ const docTemplate = `{},"securityDefinitions": {"BearerAuth": {- "description": "Keycloak access token. For /api/keys and /api/{k8s,orch} the token is the SPA's user JWT (azp=cyclops-cs-spa). /api/gateway/{name} and the deprecated /api/batch/{pool} + /api/label/{pool} routes still run through the same OPA checks; per-key tokens must carry a ` + "`" + `namespace` + "`" + ` claim matching \"pool-{name}\" or \"pool-{pool}\" respectively.",+ "description": "Keycloak access token. For /api/keys and /api/{k8s,orch} the token is an interactive user JWT (azp=cyclops-cs-spa or azp=cua-cli). /api/gateway/{name} requires a per-key token whose ` + "`" + `namespace` + "`" + ` claim equals \"pool-{name}\" (enforced by OPA). The deprecated /api/batch/{pool} and /api/label/{pool} routes are permanently retired — they return 410 Gone for every request regardless of token validity.","type": "apiKey","name": "Authorization","in": "header"diff --git a/libs/fleet/backend/docs/swagger.json b/libs/fleet/backend/docs/swagger.jsonindex eb413d3e75..d4792431e8 100644--- a/libs/fleet/backend/docs/swagger.json+++ b/libs/fleet/backend/docs/swagger.json@@ -22,7 +22,7 @@"tags": ["batch"],- "summary": "Deprecated batch lane acquisition route",+ "summary": "Deprecated batch lanes route","deprecated": true,"parameters": [{@@ -58,7 +58,7 @@"tags": ["batch"],- "summary": "Deprecated batch lane release route",+ "summary": "Deprecated batch lanes route","deprecated": true,"parameters": [{@@ -134,7 +134,7 @@"tags": ["batch"],- "summary": "Deprecated batch cancellation route",+ "summary": "Deprecated batch delete route","deprecated": true,"parameters": [{@@ -288,16 +288,11 @@},"/api/gateway/{name}/{path}": {"get": {- "security": [- {- "BearerAuth": []- }- ],- "description": "DEPRECATED (CUA-609): The per-pool orchestrator HTTP layer has been removed. This route returns 410 Gone for all requests. All pool operations must use OSGymSandboxClaim CRs (Path B) directly.",+ "description": "The per-pool HTTP orchestrator has been deprecated and removed. All pools now use OSGymSandboxClaim CRs exclusively (Path B). This endpoint returns 410 Gone for any request. See CUA-609.","tags": ["gateway"],- "summary": "Reverse-proxy to the per-pool orchestrator (sole ingress path — CUA-527)",+ "summary": "DEPRECATED: Per-pool orchestrator reverse-proxy (CUA-609)","parameters": [{"type": "string",@@ -308,38 +303,14 @@},{"type": "string",- "description": "Upstream path (proxied verbatim, no validation)",+ "description": "Upstream path (ignored)","name": "path","in": "path"}],"responses": {- "200": {- "description": "Upstream response",- "schema": {- "type": "string"- }- },- "400": {- "description": "Bad Request",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- },- "401": {- "description": "Unauthorized",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- },- "403": {- "description": "Forbidden",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- },- "502": {- "description": "Bad Gateway",+ "410": {+ "description": "Orchestrator HTTP layer deprecated (CUA-609)","schema": {"$ref": "#/definitions/handlers.ErrorResponse"}@@ -535,9 +506,9 @@"application/json"],"tags": [- "batch"+ "label"],- "summary": "Deprecated label cancellation route",+ "summary": "Deprecated label delete route","deprecated": true,"parameters": [{@@ -549,7 +520,7 @@},{"type": "string",- "description": "Batch label",+ "description": "Label","name": "label","in": "path","required": true@@ -580,9 +551,9 @@"application/json"],"tags": [- "batch"+ "label"],- "summary": "Deprecated label batch submission route",+ "summary": "Deprecated label batch route","deprecated": true,"parameters": [{@@ -594,7 +565,7 @@},{"type": "string",- "description": "Batch label",+ "description": "Label","name": "label","in": "path","required": true@@ -625,7 +596,7 @@"application/json"],"tags": [- "batch"+ "label"],"summary": "Deprecated label results route","deprecated": true,@@ -639,7 +610,7 @@},{"type": "string",- "description": "Batch label",+ "description": "Label","name": "label","in": "path","required": true@@ -670,7 +641,7 @@"application/json"],"tags": [- "batch"+ "label"],"summary": "Deprecated label status route","deprecated": true,@@ -684,7 +655,7 @@},{"type": "string",- "description": "Batch label",+ "description": "Label","name": "label","in": "path","required": true@@ -931,195 +902,6 @@}}},- "/api/pool-templates": {- "get": {- "security": [- {- "BearerAuth": []- }- ],- "description": "Returns every pool template owned by the calling user, newest first.",- "produces": [- "application/json"- ],- "tags": [- "pool-templates"- ],- "summary": "List the calling user's pool templates",- "responses": {- "200": {- "description": "OK",- "schema": {- "type": "array",- "items": {- "$ref": "#/definitions/handlers.PoolTemplateResponse"- }- }- },- "401": {- "description": "Unauthorized",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- },- "503": {- "description": "Service Unavailable",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- }- }- },- "post": {- "security": [- {- "BearerAuth": []- }- ],- "description": "Stores the given pool config under a name owned by the calling user. Re-saving an existing name overwrites the config while preserving the original creation time. Use GET /api/pool-templates to list them and seed a new pool.",- "consumes": [- "application/json"- ],- "produces": [- "application/json"- ],- "tags": [- "pool-templates"- ],- "summary": "Save a pool config as a reusable template",- "parameters": [- {- "description": "Template name + pool config",- "name": "body",- "in": "body",- "required": true,- "schema": {- "$ref": "#/definitions/handlers.CreatePoolTemplateRequest"- }- }- ],- "responses": {- "201": {- "description": "Created",- "schema": {- "$ref": "#/definitions/handlers.PoolTemplateResponse"- }- },- "400": {- "description": "Bad Request",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- },- "401": {- "description": "Unauthorized",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- },- "503": {- "description": "Service Unavailable",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- }- }- }- },- "/api/pool-templates/{name}": {- "get": {- "security": [- {- "BearerAuth": []- }- ],- "produces": [- "application/json"- ],- "tags": [- "pool-templates"- ],- "summary": "Get one of the calling user's pool templates",- "parameters": [- {- "type": "string",- "description": "Template name",- "name": "name",- "in": "path",- "required": true- }- ],- "responses": {- "200": {- "description": "OK",- "schema": {- "$ref": "#/definitions/handlers.PoolTemplateResponse"- }- },- "401": {- "description": "Unauthorized",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- },- "404": {- "description": "Not Found",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- },- "503": {- "description": "Service Unavailable",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- }- }- },- "delete": {- "security": [- {- "BearerAuth": []- }- ],- "tags": [- "pool-templates"- ],- "summary": "Delete one of the calling user's pool templates",- "parameters": [- {- "type": "string",- "description": "Template name",- "name": "name",- "in": "path",- "required": true- }- ],- "responses": {- "204": {- "description": "No Content"- },- "401": {- "description": "Unauthorized",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- },- "404": {- "description": "Not Found",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- },- "503": {- "description": "Service Unavailable",- "schema": {- "$ref": "#/definitions/handlers.ErrorResponse"- }- }- }- }- },"/api/svc/{namespace}/{service}/{path}": {"get": {"security": [@@ -1381,18 +1163,6 @@}}},- "handlers.CreatePoolTemplateRequest": {- "type": "object",- "properties": {- "config": {- "type": "object"- },- "name": {- "type": "string",- "example": "gpu-large"- }- }- },"handlers.CreateUserKeyRequest": {"type": "object","properties": {@@ -1493,23 +1263,6 @@}}},- "handlers.PoolTemplateResponse": {- "type": "object",- "properties": {- "config": {- "type": "object"- },- "createdAt": {- "type": "string"- },- "name": {- "type": "string"- },- "user": {- "type": "string"- }- }- },"handlers.UserKeyResponse": {"type": "object","properties": {@@ -1553,10 +1306,10 @@},"securityDefinitions": {"BearerAuth": {- "description": "Keycloak access token. For /api/keys and /api/{k8s,orch} the token is the SPA's user JWT (azp=cyclops-cs-spa). /api/gateway/{name} and the deprecated /api/batch/{pool} + /api/label/{pool} routes still run through the same OPA checks; per-key tokens must carry a `namespace` claim matching \"pool-{name}\" or \"pool-{pool}\" respectively.",+ "description": "Keycloak access token. For /api/keys and /api/{k8s,orch} the token is an interactive user JWT (azp=cyclops-cs-spa or azp=cua-cli). /api/gateway/{name} requires a per-key token whose `namespace` claim equals \"pool-{name}\" (enforced by OPA). The deprecated /api/batch/{pool} and /api/label/{pool} routes are permanently retired — they return 410 Gone for every request regardless of token validity.","type": "apiKey","name": "Authorization","in": "header"}}-}+}\ No newline at end of filediff --git a/libs/fleet/backend/docs/swagger.yaml b/libs/fleet/backend/docs/swagger.yamlindex 2a0e3647d8..c010c6e52a 100644--- a/libs/fleet/backend/docs/swagger.yaml+++ b/libs/fleet/backend/docs/swagger.yaml@@ -38,14 +38,6 @@ definitions:example: my-workspacetype: stringtype: object- handlers.CreatePoolTemplateRequest:- properties:- config:- type: object- name:- example: gpu-large- type: string- type: objecthandlers.CreateUserKeyRequest:properties:name:@@ -111,17 +103,6 @@ definitions:status:type: stringtype: object- handlers.PoolTemplateResponse:- properties:- config:- type: object- createdAt:- type: string- name:- type: string- user:- type: string- type: objecthandlers.UserKeyResponse:properties:client_id:@@ -151,9 +132,9 @@ definitions:info:contact: {}description: Backend sidecar for the cyclops-cs SPA — Keycloak-authenticated key- management, service proxies (k8s / orch / svc), namespace management, and- deprecated gateway / batch / label routes that now return 410 Gone. All- pool operations use OSGymSandboxClaim CRs (Path B).+ management, service proxies (k8s / orch / svc), namespace management, and deprecated+ gateway / batch / label routes that now return 410 Gone. All pool operations use+ OSGymSandboxClaim CRs (Path B).title: Cyclops CS Backend APIversion: "0.1"paths:@@ -185,7 +166,7 @@ paths:type: objectsecurity:- BearerAuth: []- summary: Deprecated batch cancellation route+ summary: Deprecated batch delete routetags:- batch/api/batch/{pool}/{id}/results:@@ -273,7 +254,7 @@ paths:type: objectsecurity:- BearerAuth: []- summary: Deprecated batch lane release route+ summary: Deprecated batch lanes routetags:- batchpost:@@ -298,7 +279,7 @@ paths:type: objectsecurity:- BearerAuth: []- summary: Deprecated batch lane acquisition route+ summary: Deprecated batch lanes routetags:- batch/api/batch/{pool}/submit:@@ -349,43 +330,25 @@ paths:- config/api/gateway/{name}/{path}:get:- description: 'DEPRECATED (CUA-609): The per-pool orchestrator HTTP layer has- been removed. This route returns 410 Gone for all requests. All pool- operations must use OSGymSandboxClaim CRs (Path B) directly.'+ description: The per-pool HTTP orchestrator has been deprecated and removed.+ All pools now use OSGymSandboxClaim CRs exclusively (Path B). This endpoint+ returns 410 Gone for any request. See CUA-609.parameters:- description: Pool name (DNS-1123 label)in: pathname: namerequired: truetype: string- - description: Upstream path (proxied verbatim, no validation)+ - description: Upstream path (ignored)in: pathname: pathtype: stringresponses:- "200":- description: Upstream response- schema:- type: string- "400":- description: Bad Request- schema:- $ref: '#/definitions/handlers.ErrorResponse'- "401":- description: Unauthorized- schema:- $ref: '#/definitions/handlers.ErrorResponse'- "403":- description: Forbidden- schema:- $ref: '#/definitions/handlers.ErrorResponse'- "502":- description: Bad Gateway+ "410":+ description: Orchestrator HTTP layer deprecated (CUA-609)schema:$ref: '#/definitions/handlers.ErrorResponse'- security:- - BearerAuth: []- summary: DEPRECATED (CUA-609): per-pool orchestrator proxy — returns 410 Gone+ summary: 'DEPRECATED: Per-pool orchestrator reverse-proxy (CUA-609)'tags:- gateway/api/k8s/{path}:@@ -514,7 +477,7 @@ paths:name: poolrequired: truetype: string- - description: Batch label+ - description: Labelin: pathname: labelrequired: true@@ -530,9 +493,9 @@ paths:type: objectsecurity:- BearerAuth: []- summary: Deprecated label cancellation route+ summary: Deprecated label delete routetags:- - batch+ - label/api/label/{pool}/{label}/batch:post:deprecated: true@@ -545,7 +508,7 @@ paths:name: poolrequired: truetype: string- - description: Batch label+ - description: Labelin: pathname: labelrequired: true@@ -561,9 +524,9 @@ paths:type: objectsecurity:- BearerAuth: []- summary: Deprecated label batch submission route+ summary: Deprecated label batch routetags:- - batch+ - label/api/label/{pool}/{label}/results:get:deprecated: true@@ -576,7 +539,7 @@ paths:name: poolrequired: truetype: string- - description: Batch label+ - description: Labelin: pathname: labelrequired: true@@ -594,7 +557,7 @@ paths:- BearerAuth: []summary: Deprecated label results routetags:- - batch+ - label/api/label/{pool}/{label}/status:get:deprecated: true@@ -607,7 +570,7 @@ paths:name: poolrequired: truetype: string- - description: Batch label+ - description: Labelin: pathname: labelrequired: true@@ -625,7 +588,7 @@ paths:- BearerAuth: []summary: Deprecated label status routetags:- - batch+ - label/api/namespaces:get:description: Returns namespaces owned by the caller's Capsule Tenant. The list@@ -780,128 +743,6 @@ paths:summary: SPA-authenticated proxy to a per-namespace orchestrator servicetags:- passthrough- /api/pool-templates:- get:- description: Returns every pool template owned by the calling user, newest first.- produces:- - application/json- responses:- "200":- description: OK- schema:- items:- $ref: '#/definitions/handlers.PoolTemplateResponse'- type: array- "401":- description: Unauthorized- schema:- $ref: '#/definitions/handlers.ErrorResponse'- "503":- description: Service Unavailable- schema:- $ref: '#/definitions/handlers.ErrorResponse'- security:- - BearerAuth: []- summary: List the calling user's pool templates- tags:- - pool-templates- post:- consumes:- - application/json- description: Stores the given pool config under a name owned by the calling- user. Re-saving an existing name overwrites the config while preserving the- original creation time. Use GET /api/pool-templates to list them and seed- a new pool.- parameters:- - description: Template name + pool config- in: body- name: body- required: true- schema:- $ref: '#/definitions/handlers.CreatePoolTemplateRequest'- produces:- - application/json- responses:- "201":- description: Created- schema:- $ref: '#/definitions/handlers.PoolTemplateResponse'- "400":- description: Bad Request- schema:- $ref: '#/definitions/handlers.ErrorResponse'- "401":- description: Unauthorized- schema:- $ref: '#/definitions/handlers.ErrorResponse'- "503":- description: Service Unavailable- schema:- $ref: '#/definitions/handlers.ErrorResponse'- security:- - BearerAuth: []- summary: Save a pool config as a reusable template- tags:- - pool-templates- /api/pool-templates/{name}:- delete:- parameters:- - description: Template name- in: path- name: name- required: true- type: string- responses:- "204":- description: No Content- "401":- description: Unauthorized- schema:- $ref: '#/definitions/handlers.ErrorResponse'- "404":- description: Not Found- schema:- $ref: '#/definitions/handlers.ErrorResponse'- "503":- description: Service Unavailable- schema:- $ref: '#/definitions/handlers.ErrorResponse'- security:- - BearerAuth: []- summary: Delete one of the calling user's pool templates- tags:- - pool-templates- get:- parameters:- - description: Template name- in: path- name: name- required: true- type: string- produces:- - application/json- responses:- "200":- description: OK- schema:- $ref: '#/definitions/handlers.PoolTemplateResponse'- "401":- description: Unauthorized- schema:- $ref: '#/definitions/handlers.ErrorResponse'- "404":- description: Not Found- schema:- $ref: '#/definitions/handlers.ErrorResponse'- "503":- description: Service Unavailable- schema:- $ref: '#/definitions/handlers.ErrorResponse'- security:- - BearerAuth: []- summary: Get one of the calling user's pool templates- tags:- - pool-templates/api/svc/{namespace}/{service}/{path}:get:description: Proxies to {service}.{namespace}.svc.cluster.local:80. Per-key@@ -1043,10 +884,10 @@ paths:securityDefinitions:BearerAuth:description: Keycloak access token. For /api/keys and /api/{k8s,orch} the token- is the SPA's user JWT (azp=cyclops-cs-spa). /api/gateway/{name} and the deprecated- /api/batch/{pool} + /api/label/{pool} routes still run through the same OPA- checks; per-key tokens must carry a `namespace` claim matching "pool-{name}"- or "pool-{pool}" respectively.+ is an interactive user JWT (azp=cyclops-cs-spa or azp=cua-cli). /api/gateway/{name}+ requires a per-key token whose `namespace` claim equals "pool-{name}" (enforced+ by OPA). The deprecated /api/batch/{pool} and /api/label/{pool} routes are permanently+ retired — they return 410 Gone for every request regardless of token validity.in: headername: Authorizationtype: apiKeydiff --git a/libs/fleet/backend/handlers/deprecated.go b/libs/fleet/backend/handlers/deprecated.goindex 2c7cfb576e..6932ef189c 100644--- a/libs/fleet/backend/handlers/deprecated.go+++ b/libs/fleet/backend/handlers/deprecated.go@@ -2,7 +2,169 @@ package handlersimport "net/http"+// DeprecatedBatchRoute replies 410 Gone for the retired batch/label API.+// The per-route wrappers below exist only to carry swagger annotations, so+// `swag init` keeps the retired routes documented as deprecated instead of+// silently dropping them from the spec (pinned by+// TestSwaggerMentionsBatchRouteDeprecation).func (h Handlers) DeprecatedBatchRoute(w http.ResponseWriter, _ *http.Request) {writeErr(w, http.StatusGone,"/api/batch and /api/label are deprecated and unavailable; use the replacement claim-based flow")}++// DeprecatedBatchSubmit godoc+//+// @Summary Deprecated batch submission route+// @Description Route is deprecated and unavailable. Returns 410 Gone for every request. The orchestrator-backed batch surface is retired; callers must migrate to the replacement flow.+// @Deprecated+// @Tags batch+// @Produce json+// @Param pool path string true "Pool name"+// @Failure 410 {object} map[string]string+// @Security BearerAuth+// @Router /api/batch/{pool}/submit [post]+func (h Handlers) DeprecatedBatchSubmit(w http.ResponseWriter, r *http.Request) {+ h.DeprecatedBatchRoute(w, r)+}++// DeprecatedBatchLanesCreate godoc+//+// @Summary Deprecated batch lanes route+// @Description Route is deprecated and unavailable. Returns 410 Gone for every request. The orchestrator-backed batch surface is retired; callers must migrate to the replacement flow.+// @Deprecated+// @Tags batch+// @Produce json+// @Param pool path string true "Pool name"+// @Failure 410 {object} map[string]string+// @Security BearerAuth+// @Router /api/batch/{pool}/lanes [post]+func (h Handlers) DeprecatedBatchLanesCreate(w http.ResponseWriter, r *http.Request) {+ h.DeprecatedBatchRoute(w, r)+}++// DeprecatedBatchLanesDelete godoc+//+// @Summary Deprecated batch lanes route+// @Description Route is deprecated and unavailable. Returns 410 Gone for every request. The orchestrator-backed batch surface is retired; callers must migrate to the replacement flow.+// @Deprecated+// @Tags batch+// @Produce json+// @Param pool path string true "Pool name"+// @Failure 410 {object} map[string]string+// @Security BearerAuth+// @Router /api/batch/{pool}/lanes [delete]+func (h Handlers) DeprecatedBatchLanesDelete(w http.ResponseWriter, r *http.Request) {+ h.DeprecatedBatchRoute(w, r)+}++// DeprecatedBatchStatus godoc+//+// @Summary Deprecated batch status route+// @Description Route is deprecated and unavailable. Returns 410 Gone for every request. The orchestrator-backed batch surface is retired; callers must migrate to the replacement flow.+// @Deprecated+// @Tags batch+// @Produce json+// @Param pool path string true "Pool name"+// @Param id path string true "Batch ID"+// @Failure 410 {object} map[string]string+// @Security BearerAuth+// @Router /api/batch/{pool}/{id}/status [get]+func (h Handlers) DeprecatedBatchStatus(w http.ResponseWriter, r *http.Request) {+ h.DeprecatedBatchRoute(w, r)+}++// DeprecatedBatchResults godoc+//+// @Summary Deprecated batch results route+// @Description Route is deprecated and unavailable. Returns 410 Gone for every request. The orchestrator-backed batch surface is retired; callers must migrate to the replacement flow.+// @Deprecated+// @Tags batch+// @Produce json+// @Param pool path string true "Pool name"+// @Param id path string true "Batch ID"+// @Failure 410 {object} map[string]string+// @Security BearerAuth+// @Router /api/batch/{pool}/{id}/results [get]+func (h Handlers) DeprecatedBatchResults(w http.ResponseWriter, r *http.Request) {+ h.DeprecatedBatchRoute(w, r)+}++// DeprecatedBatchDelete godoc+//+// @Summary Deprecated batch delete route+// @Description Route is deprecated and unavailable. Returns 410 Gone for every request. The orchestrator-backed batch surface is retired; callers must migrate to the replacement flow.+// @Deprecated+// @Tags batch+// @Produce json+// @Param pool path string true "Pool name"+// @Param id path string true "Batch ID"+// @Failure 410 {object} map[string]string+// @Security BearerAuth+// @Router /api/batch/{pool}/{id} [delete]+func (h Handlers) DeprecatedBatchDelete(w http.ResponseWriter, r *http.Request) {+ h.DeprecatedBatchRoute(w, r)+}++// DeprecatedLabelBatch godoc+//+// @Summary Deprecated label batch route+// @Description Route is deprecated and unavailable. Returns 410 Gone for every request. The orchestrator-backed batch surface is retired; callers must migrate to the replacement flow.+// @Deprecated+// @Tags label+// @Produce json+// @Param pool path string true "Pool name"+// @Param label path string true "Label"+// @Failure 410 {object} map[string]string+// @Security BearerAuth+// @Router /api/label/{pool}/{label}/batch [post]+func (h Handlers) DeprecatedLabelBatch(w http.ResponseWriter, r *http.Request) {+ h.DeprecatedBatchRoute(w, r)+}++// DeprecatedLabelStatus godoc+//+// @Summary Deprecated label status route+// @Description Route is deprecated and unavailable. Returns 410 Gone for every request. The orchestrator-backed batch surface is retired; callers must migrate to the replacement flow.+// @Deprecated+// @Tags label+// @Produce json+// @Param pool path string true "Pool name"+// @Param label path string true "Label"+// @Failure 410 {object} map[string]string+// @Security BearerAuth+// @Router /api/label/{pool}/{label}/status [get]+func (h Handlers) DeprecatedLabelStatus(w http.ResponseWriter, r *http.Request) {+ h.DeprecatedBatchRoute(w, r)+}++// DeprecatedLabelResults godoc+//+// @Summary Deprecated label results route+// @Description Route is deprecated and unavailable. Returns 410 Gone for every request. The orchestrator-backed batch surface is retired; callers must migrate to the replacement flow.+// @Deprecated+// @Tags label+// @Produce json+// @Param pool path string true "Pool name"+// @Param label path string true "Label"+// @Failure 410 {object} map[string]string+// @Security BearerAuth+// @Router /api/label/{pool}/{label}/results [get]+func (h Handlers) DeprecatedLabelResults(w http.ResponseWriter, r *http.Request) {+ h.DeprecatedBatchRoute(w, r)+}++// DeprecatedLabelDelete godoc+//+// @Summary Deprecated label delete route+// @Description Route is deprecated and unavailable. Returns 410 Gone for every request. The orchestrator-backed batch surface is retired; callers must migrate to the replacement flow.+// @Deprecated+// @Tags label+// @Produce json+// @Param pool path string true "Pool name"+// @Param label path string true "Label"+// @Failure 410 {object} map[string]string+// @Security BearerAuth+// @Router /api/label/{pool}/{label} [delete]+func (h Handlers) DeprecatedLabelDelete(w http.ResponseWriter, r *http.Request) {+ h.DeprecatedBatchRoute(w, r)+}diff --git a/libs/fleet/backend/handlers/handlers.go b/libs/fleet/backend/handlers/handlers.goindex da320be761..a775596f09 100644--- a/libs/fleet/backend/handlers/handlers.go+++ b/libs/fleet/backend/handlers/handlers.go@@ -13,7 +13,6 @@ import ("cyclops-cs-backend/auth""cyclops-cs-backend/config""cyclops-cs-backend/keycloak"- "cyclops-cs-backend/templates""go.opentelemetry.io/otel""go.opentelemetry.io/otel/trace")@@ -24,9 +23,6 @@ type Handlers struct {AuthCfg config.AuthConfigurationKC config.KeycloakConfiguration- // Templates is the Redis-backed pool-template store. nil when no- // Redis is configured — the pool-template handlers then reply 503.- Templates templates.Store// WorkloadAdmin manages per-tenant clients in the workloads realm so// OSGym pool VMs can obtain a tenant-scoped OIDC token. nil disablesdiff --git a/libs/fleet/backend/handlers/pool_templates.go b/libs/fleet/backend/handlers/pool_templates.godeleted file mode 100644index 056eff71f7..0000000000--- a/libs/fleet/backend/handlers/pool_templates.go+++ /dev/null@@ -1,233 +0,0 @@-package handlers--import (- "encoding/json"- "errors"- "log/slog"- "net/http"- "regexp"-- "cyclops-cs-backend/templates"-)--// templateName bounds a template's name: 1–63 chars, alphanumerics plus-// dot/dash/underscore, no leading separator. It deliberately forbids ':'-// (the Redis key separator) so a name can never escape its owner's-// keyspace. Looser than a DNS-1123 label — a template name is a friendly-// SPA label, not a K8s object name.-var templateName = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9._-]{0,62}$`)--// maxTemplateConfigBytes caps the stored config blob. A pool config is a-// few hundred bytes; 256 KiB is a generous ceiling that still bounds what-// a single request can push into Redis.-const maxTemplateConfigBytes = 256 << 10--// CreatePoolTemplateRequest is the body for POST /api/pool-templates.-// Config is the opaque pool config the SPA would otherwise pass straight-// to createPool (cpu, ram, ociImage, replicas, services, probes).-type CreatePoolTemplateRequest struct {- Name string `json:"name" example:"gpu-large"`- Config json.RawMessage `json:"config" swaggertype:"object"`-}--// PoolTemplateResponse is a single saved template. It mirrors the four-// stored fields: the owning user, the name, when it was created, and the-// opaque pool config.-type PoolTemplateResponse struct {- User string `json:"user"`- Name string `json:"name"`- CreatedAt string `json:"createdAt"`- Config json.RawMessage `json:"config" swaggertype:"object"`-}--func toPoolTemplateResponse(t *templates.Template) PoolTemplateResponse {- return PoolTemplateResponse{- User: t.User,- Name: t.Name,- CreatedAt: t.CreatedAt.UTC().Format("2006-01-02T15:04:05.999999999Z07:00"),- Config: t.Config,- }-}--// templatesEnabled writes a 503 and returns false when no Redis-backed-// store is configured. The routes are always registered; this keeps the-// failure mode explicit ("not configured") instead of silently empty.-func (h Handlers) templatesEnabled(w http.ResponseWriter) bool {- if h.Templates == nil {- writeErr(w, http.StatusServiceUnavailable, "pool templates are not configured")- return false- }- return true-}--// CreatePoolTemplate godoc-//-// @Summary Save a pool config as a reusable template-// @Description Stores the given pool config under a name owned by the calling user. Re-saving an existing name overwrites the config while preserving the original creation time. Use GET /api/pool-templates to list them and seed a new pool.-// @Tags pool-templates-// @Accept json-// @Produce json-// @Param body body CreatePoolTemplateRequest true "Template name + pool config"-// @Success 201 {object} PoolTemplateResponse-// @Failure 400 {object} ErrorResponse-// @Failure 401 {object} ErrorResponse-// @Failure 503 {object} ErrorResponse-// @Security BearerAuth-// @Router /api/pool-templates [post]-func (h Handlers) CreatePoolTemplate(w http.ResponseWriter, r *http.Request) {- user := currentUser(r)- if user == nil {- writeErr(w, http.StatusUnauthorized, "missing user")- return- }- if !h.templatesEnabled(w) {- return- }-- r.Body = http.MaxBytesReader(w, r.Body, maxTemplateConfigBytes+4096)- var req CreatePoolTemplateRequest- if err := json.NewDecoder(r.Body).Decode(&req); err != nil {- var mbe *http.MaxBytesError- if errors.As(err, &mbe) {- writeErr(w, http.StatusBadRequest, "config too large")- return- }- writeErr(w, http.StatusBadRequest, "invalid body")- return- }- if !templateName.MatchString(req.Name) {- writeErr(w, http.StatusBadRequest, "name must be 1-63 chars: letters, digits, '.', '-', '_' (no leading separator)")- return- }- // A successful json.RawMessage decode already guarantees config is- // well-formed JSON; we only need to reject the empty/oversized cases.- if len(req.Config) == 0 {- writeErr(w, http.StatusBadRequest, "config is required")- return- }- if len(req.Config) > maxTemplateConfigBytes {- writeErr(w, http.StatusBadRequest, "config too large")- return- }-- t := &templates.Template{User: user.ID, Name: req.Name, Config: req.Config}- if err := h.Templates.Save(r.Context(), t); err != nil {- slog.Warn("pool template save failed", "err", err, "user", user.ID, "name", req.Name)- writeErr(w, http.StatusInternalServerError, "failed to save template")- return- }- writeJSON(w, http.StatusCreated, toPoolTemplateResponse(t))-}--// ListPoolTemplates godoc-//-// @Summary List the calling user's pool templates-// @Description Returns every pool template owned by the calling user, newest first.-// @Tags pool-templates-// @Produce json-// @Success 200 {array} PoolTemplateResponse-// @Failure 401 {object} ErrorResponse-// @Failure 503 {object} ErrorResponse-// @Security BearerAuth-// @Router /api/pool-templates [get]-func (h Handlers) ListPoolTemplates(w http.ResponseWriter, r *http.Request) {- user := currentUser(r)- if user == nil {- writeErr(w, http.StatusUnauthorized, "missing user")- return- }- if !h.templatesEnabled(w) {- return- }-- list, err := h.Templates.List(r.Context(), user.ID)- if err != nil {- slog.Warn("pool template list failed", "err", err, "user", user.ID)- writeErr(w, http.StatusInternalServerError, "failed to list templates")- return- }- out := make([]PoolTemplateResponse, 0, len(list))- for _, t := range list {- out = append(out, toPoolTemplateResponse(t))- }- writeJSON(w, http.StatusOK, out)-}--// GetPoolTemplate godoc-//-// @Summary Get one of the calling user's pool templates-// @Tags pool-templates-// @Produce json-// @Param name path string true "Template name"-// @Success 200 {object} PoolTemplateResponse-// @Failure 401 {object} ErrorResponse-// @Failure 404 {object} ErrorResponse-// @Failure 503 {object} ErrorResponse-// @Security BearerAuth-// @Router /api/pool-templates/{name} [get]-func (h Handlers) GetPoolTemplate(w http.ResponseWriter, r *http.Request) {- user := currentUser(r)- if user == nil {- writeErr(w, http.StatusUnauthorized, "missing user")- return- }- if !h.templatesEnabled(w) {- return- }-- name := r.PathValue("name")- if !templateName.MatchString(name) {- writeErr(w, http.StatusBadRequest, "invalid template name")- return- }- t, err := h.Templates.Get(r.Context(), user.ID, name)- if err != nil {- slog.Warn("pool template get failed", "err", err, "user", user.ID, "name", name)- writeErr(w, http.StatusInternalServerError, "failed to get template")- return- }- if t == nil {- writeErr(w, http.StatusNotFound, "template not found")- return- }- writeJSON(w, http.StatusOK, toPoolTemplateResponse(t))-}--// DeletePoolTemplate godoc-//-// @Summary Delete one of the calling user's pool templates-// @Tags pool-templates-// @Param name path string true "Template name"-// @Success 204-// @Failure 401 {object} ErrorResponse-// @Failure 404 {object} ErrorResponse-// @Failure 503 {object} ErrorResponse-// @Security BearerAuth-// @Router /api/pool-templates/{name} [delete]-func (h Handlers) DeletePoolTemplate(w http.ResponseWriter, r *http.Request) {- user := currentUser(r)- if user == nil {- writeErr(w, http.StatusUnauthorized, "missing user")- return- }- if !h.templatesEnabled(w) {- return- }-- name := r.PathValue("name")- if !templateName.MatchString(name) {- writeErr(w, http.StatusBadRequest, "invalid template name")- return- }- existed, err := h.Templates.Delete(r.Context(), user.ID, name)- if err != nil {- slog.Warn("pool template delete failed", "err", err, "user", user.ID, "name", name)- writeErr(w, http.StatusInternalServerError, "failed to delete template")- return- }- if !existed {- writeErr(w, http.StatusNotFound, "template not found")- return- }- w.WriteHeader(http.StatusNoContent)-}diff --git a/libs/fleet/backend/handlers/pool_templates_test.go b/libs/fleet/backend/handlers/pool_templates_test.godeleted file mode 100644index 6adef11321..0000000000--- a/libs/fleet/backend/handlers/pool_templates_test.go+++ /dev/null@@ -1,217 +0,0 @@-package handlers--import (- "context"- "encoding/json"- "net/http"- "net/http/httptest"- "strings"- "testing"- "time"-- "cyclops-cs-backend/auth"- "cyclops-cs-backend/templates"-)--// fakeTemplateStore is an in-memory templates.Store for handler tests —-// it exercises the real handler logic (auth, validation, status codes,-// per-user scoping) without a Redis dependency.-type fakeTemplateStore struct {- m map[string]*templates.Template // keyed by user + "\x00" + name-}--func newFakeStore() *fakeTemplateStore {- return &fakeTemplateStore{m: map[string]*templates.Template{}}-}--func (f *fakeTemplateStore) key(user, name string) string { return user + "\x00" + name }--func (f *fakeTemplateStore) Save(_ context.Context, t *templates.Template) error {- if t.CreatedAt.IsZero() {- t.CreatedAt = time.Now().UTC()- }- cp := *t- f.m[f.key(t.User, t.Name)] = &cp- return nil-}--func (f *fakeTemplateStore) Get(_ context.Context, user, name string) (*templates.Template, error) {- t, ok := f.m[f.key(user, name)]- if !ok {- return nil, nil- }- cp := *t- return &cp, nil-}--func (f *fakeTemplateStore) List(_ context.Context, user string) ([]*templates.Template, error) {- var out []*templates.Template- for _, t := range f.m {- if t.User == user {- cp := *t- out = append(out, &cp)- }- }- return out, nil-}--func (f *fakeTemplateStore) Delete(_ context.Context, user, name string) (bool, error) {- k := f.key(user, name)- if _, ok := f.m[k]; !ok {- return false, nil- }- delete(f.m, k)- return true, nil-}--func newReq(method, target, body string, user *auth.User) *http.Request {- var r *http.Request- if body != "" {- r = httptest.NewRequest(method, target, strings.NewReader(body))- } else {- r = httptest.NewRequest(method, target, nil)- }- if user != nil {- r = withUser(r, user)- }- return r-}--var alice = &auth.User{ID: "user-alice"}--func TestCreatePoolTemplate_Success(t *testing.T) {- h := Handlers{Templates: newFakeStore()}- r := newReq(http.MethodPost, "/api/pool-templates",- `{"name":"gpu-large","config":{"cpu":8,"ram":"16Gi"}}`, alice)- w := httptest.NewRecorder()-- h.CreatePoolTemplate(w, r)-- if w.Code != http.StatusCreated {- t.Fatalf("status = %d, want 201; body = %s", w.Code, w.Body.String())- }- var resp PoolTemplateResponse- if err := json.Unmarshal(w.Body.Bytes(), &resp); err != nil {- t.Fatalf("decode: %v", err)- }- if resp.Name != "gpu-large" || resp.User != "user-alice" {- t.Fatalf("resp = %+v", resp)- }- if resp.CreatedAt == "" {- t.Fatal("createdAt not set")- }- if string(resp.Config) != `{"cpu":8,"ram":"16Gi"}` {- t.Fatalf("config = %s", string(resp.Config))- }-}--func TestCreatePoolTemplate_Validation(t *testing.T) {- cases := map[string]string{- "bad name": `{"name":"bad name","config":{}}`,- "colon in name": `{"name":"a:b","config":{}}`,- "empty name": `{"name":"","config":{}}`,- "missing config": `{"name":"ok"}`,- "bad json": `{"name":"ok","config":}`,- }- for label, body := range cases {- t.Run(label, func(t *testing.T) {- h := Handlers{Templates: newFakeStore()}- w := httptest.NewRecorder()- h.CreatePoolTemplate(w, newReq(http.MethodPost, "/api/pool-templates", body, alice))- if w.Code != http.StatusBadRequest {- t.Fatalf("status = %d, want 400; body = %s", w.Code, w.Body.String())- }- })- }-}--func TestPoolTemplate_Unauthorized(t *testing.T) {- h := Handlers{Templates: newFakeStore()}- w := httptest.NewRecorder()- h.ListPoolTemplates(w, newReq(http.MethodGet, "/api/pool-templates", "", nil))- if w.Code != http.StatusUnauthorized {- t.Fatalf("status = %d, want 401", w.Code)- }-}--func TestPoolTemplate_Disabled503(t *testing.T) {- h := Handlers{} // no store- w := httptest.NewRecorder()- h.ListPoolTemplates(w, newReq(http.MethodGet, "/api/pool-templates", "", alice))- if w.Code != http.StatusServiceUnavailable {- t.Fatalf("status = %d, want 503; body = %s", w.Code, w.Body.String())- }-}--func TestListPoolTemplates_IsolatedPerUser(t *testing.T) {- store := newFakeStore()- h := Handlers{Templates: store}-- // Alice saves one.- w := httptest.NewRecorder()- h.CreatePoolTemplate(w, newReq(http.MethodPost, "/api/pool-templates",- `{"name":"a-tpl","config":{"cpu":1}}`, alice))- if w.Code != http.StatusCreated {- t.Fatalf("alice create: %d", w.Code)- }-- // Bob lists — must not see Alice's template.- bob := &auth.User{ID: "user-bob"}- w = httptest.NewRecorder()- h.ListPoolTemplates(w, newReq(http.MethodGet, "/api/pool-templates", "", bob))- if w.Code != http.StatusOK {- t.Fatalf("bob list: %d", w.Code)- }- var bobList []PoolTemplateResponse- _ = json.Unmarshal(w.Body.Bytes(), &bobList)- if len(bobList) != 0 {- t.Fatalf("bob saw %d templates, want 0", len(bobList))- }-- // Alice lists — sees exactly her one template.- w = httptest.NewRecorder()- h.ListPoolTemplates(w, newReq(http.MethodGet, "/api/pool-templates", "", alice))- var aliceList []PoolTemplateResponse- _ = json.Unmarshal(w.Body.Bytes(), &aliceList)- if len(aliceList) != 1 || aliceList[0].Name != "a-tpl" {- t.Fatalf("alice list = %+v", aliceList)- }-}--func TestGetPoolTemplate_NotFound(t *testing.T) {- h := Handlers{Templates: newFakeStore()}- r := newReq(http.MethodGet, "/api/pool-templates/missing", "", alice)- r.SetPathValue("name", "missing")- w := httptest.NewRecorder()- h.GetPoolTemplate(w, r)- if w.Code != http.StatusNotFound {- t.Fatalf("status = %d, want 404", w.Code)- }-}--func TestDeletePoolTemplate_RoundTrip(t *testing.T) {- store := newFakeStore()- h := Handlers{Templates: store}-- // Create, then delete → 204, then delete again → 404.- w := httptest.NewRecorder()- h.CreatePoolTemplate(w, newReq(http.MethodPost, "/api/pool-templates",- `{"name":"doomed","config":{"cpu":1}}`, alice))- if w.Code != http.StatusCreated {- t.Fatalf("create: %d", w.Code)- }-- del := func() int {- r := newReq(http.MethodDelete, "/api/pool-templates/doomed", "", alice)- r.SetPathValue("name", "doomed")- w := httptest.NewRecorder()- h.DeletePoolTemplate(w, r)- return w.Code- }- if code := del(); code != http.StatusNoContent {- t.Fatalf("first delete = %d, want 204", code)- }- if code := del(); code != http.StatusNotFound {- t.Fatalf("second delete = %d, want 404", code)- }-}diff --git a/libs/fleet/backend/main.go b/libs/fleet/backend/main.goindex 67c59c4491..51a75f3e42 100644--- a/libs/fleet/backend/main.go+++ b/libs/fleet/backend/main.go@@ -50,7 +50,6 @@ import ("cyclops-cs-backend/metrics""cyclops-cs-backend/middlewares""cyclops-cs-backend/telemetry"- "cyclops-cs-backend/templates"httpSwagger "github.com/swaggo/http-swagger/v2""github.com/trycua/cloud/pkg/featureflags"@@ -129,17 +128,6 @@ func setupRouter(c handlers.Handlers) http.Handler {r.Handle("DELETE /api/user-keys/{id}",withMiddlewares("/api/user-keys/{id}", []string{"id"}, c.DeleteUserKey))- // Per-user pool templates — Redis-backed saved pool configs the SPA- // reuses to seed new pools. SPA-auth, same pipeline as /api/keys.- // Always registered; the handlers reply 503 when no Redis is wired.- r.Handle("POST /api/pool-templates",- withMiddlewares("/api/pool-templates", nil, c.CreatePoolTemplate))- r.Handle("GET /api/pool-templates",- withMiddlewares("/api/pool-templates", nil, c.ListPoolTemplates))- r.Handle("GET /api/pool-templates/{name}",- withMiddlewares("/api/pool-templates/{name}", []string{"name"}, c.GetPoolTemplate))- r.Handle("DELETE /api/pool-templates/{name}",- withMiddlewares("/api/pool-templates/{name}", []string{"name"}, c.DeletePoolTemplate))r.Handle("/api/gateway/{name}",withMiddlewares("/api/gateway/{name}", []string{"name"}, c.Gateway))@@ -169,25 +157,25 @@ func setupRouter(c handlers.Handlers) http.Handler {// Keep deprecated batch/label routes registered so callers get an explicit// terminal status instead of an implicit 404 from the router.r.Handle("POST /api/batch/{pool}/submit",- withMiddlewares("/api/batch/{pool}/submit", []string{"pool"}, c.DeprecatedBatchRoute))+ withMiddlewares("/api/batch/{pool}/submit", []string{"pool"}, c.DeprecatedBatchSubmit))r.Handle("POST /api/batch/{pool}/lanes",- withMiddlewares("/api/batch/{pool}/lanes", []string{"pool"}, c.DeprecatedBatchRoute))+ withMiddlewares("/api/batch/{pool}/lanes", []string{"pool"}, c.DeprecatedBatchLanesCreate))r.Handle("DELETE /api/batch/{pool}/lanes",- withMiddlewares("/api/batch/{pool}/lanes", []string{"pool"}, c.DeprecatedBatchRoute))+ withMiddlewares("/api/batch/{pool}/lanes", []string{"pool"}, c.DeprecatedBatchLanesDelete))r.Handle("GET /api/batch/{pool}/{id}/status",- withMiddlewares("/api/batch/{pool}/{id}/status", []string{"pool", "id"}, c.DeprecatedBatchRoute))+ withMiddlewares("/api/batch/{pool}/{id}/status", []string{"pool", "id"}, c.DeprecatedBatchStatus))r.Handle("GET /api/batch/{pool}/{id}/results",- withMiddlewares("/api/batch/{pool}/{id}/results", []string{"pool", "id"}, c.DeprecatedBatchRoute))+ withMiddlewares("/api/batch/{pool}/{id}/results", []string{"pool", "id"}, c.DeprecatedBatchResults))r.Handle("DELETE /api/batch/{pool}/{id}",- withMiddlewares("/api/batch/{pool}/{id}", []string{"pool", "id"}, c.DeprecatedBatchRoute))+ withMiddlewares("/api/batch/{pool}/{id}", []string{"pool", "id"}, c.DeprecatedBatchDelete))r.Handle("POST /api/label/{pool}/{label}/batch",- withMiddlewares("/api/label/{pool}/{label}/batch", []string{"pool", "label"}, c.DeprecatedBatchRoute))+ withMiddlewares("/api/label/{pool}/{label}/batch", []string{"pool", "label"}, c.DeprecatedLabelBatch))r.Handle("GET /api/label/{pool}/{label}/status",- withMiddlewares("/api/label/{pool}/{label}/status", []string{"pool", "label"}, c.DeprecatedBatchRoute))+ withMiddlewares("/api/label/{pool}/{label}/status", []string{"pool", "label"}, c.DeprecatedLabelStatus))r.Handle("GET /api/label/{pool}/{label}/results",- withMiddlewares("/api/label/{pool}/{label}/results", []string{"pool", "label"}, c.DeprecatedBatchRoute))+ withMiddlewares("/api/label/{pool}/{label}/results", []string{"pool", "label"}, c.DeprecatedLabelResults))r.Handle("DELETE /api/label/{pool}/{label}",- withMiddlewares("/api/label/{pool}/{label}", []string{"pool", "label"}, c.DeprecatedBatchRoute))+ withMiddlewares("/api/label/{pool}/{label}", []string{"pool", "label"}, c.DeprecatedLabelDelete))// Wrap the entire mux in the metrics middleware so every request// (including /healthz and unmatched routes) is recorded. This must be@@ -294,21 +282,10 @@ func run() error {slog.Info("workload-oidc: disabled (KC_WORKLOAD_ADMIN_CLIENT_SECRET unset)")}- // Redis-backed pool templates. A connection failure is non-fatal —- // the routes stay registered and reply 503 until Redis is reachable,- // mirroring how other optional surfaces degrade gracefully.h := handlers.New(admin, cfg)h.WorkloadAdmin = workloadAdminh.WorkloadAudience = cfg.Keycloak.WorkloadAudienceh.WorkloadTokenURL = cfg.Keycloak.WorkloadTokenURL- if store, err := templates.New(ctx, cfg.Templates.RedisURL); err != nil {- slog.Error("pool templates: init failed; /api/pool-templates will return 503", "err", err)- } else if store != nil {- h.Templates = store- slog.Info("pool templates: enabled")- } else {- slog.Info("pool templates: disabled (no Redis URL configured)")- }router := setupRouter(h)diff --git a/libs/fleet/backend/templates/store.go b/libs/fleet/backend/templates/store.godeleted file mode 100644index 980953d69e..0000000000--- a/libs/fleet/backend/templates/store.go+++ /dev/null@@ -1,199 +0,0 @@-package templates--// Redis-backed persistence for pool templates.-//-// Schema:-//-// pooltpl:<user>:<name> HASH user, name, created_at (RFC3339Nano), config-// pooltpl:index:<user> SET template names owned by <user>-//-// The per-user index SET is the listing index — List() reads it and-// HGETALLs each member, so we never SCAN the whole keyspace (and never-// risk returning another user's templates). The `pooltpl:` prefix keeps-// this keyspace disjoint from the batch driver's `batch:*` keys when both-// share one Redis instance.-//-// Unlike the batch Store, writes here are synchronous: a template save is-// a deliberate, low-frequency user action (clicking "Save as template"),-// not a hot per-request mutation, so there's no CUA-535 latency concern to-// engineer around.--import (- "context"- "encoding/json"- "fmt"- "log/slog"- "time"-- "github.com/redis/go-redis/v9"-)--const (- keyPrefix = "pooltpl:"- indexPrefix = "pooltpl:index:"-)--// Store persists per-user pool templates. Every method takes the owning-// user so the storage layer enforces the same isolation the HTTP layer-// does — there is no way to address a template without naming its owner.-type Store interface {- Save(ctx context.Context, t *Template) error- Get(ctx context.Context, user, name string) (*Template, error)- List(ctx context.Context, user string) ([]*Template, error)- // Delete reports whether a template existed, so the handler can- // distinguish 404 from a successful no-op.- Delete(ctx context.Context, user, name string) (bool, error)-}--func tplKey(user, name string) string { return keyPrefix + user + ":" + name }-func indexKey(user string) string { return indexPrefix + user }--type redisStore struct{ c *redis.Client }--// New connects to Redis and returns a Store. An empty url returns-// (nil, nil): the caller treats a nil Store as "templates disabled" and-// the handlers reply 503, rather than a no-op store silently dropping-// writes and confusing the user with an always-empty list. A malformed-// url is a genuine config error and is returned as such.-//-// The startup ping is best-effort: a transient Redis outage during a-// deploy must not permanently disable the feature, and the go-redis-// client reconnects on its own, so a failed ping is logged and the store-// is still returned. Real outages then surface as per-request 500s-// (handler errors), not as a silent always-503.-func New(ctx context.Context, url string) (Store, error) {- if url == "" {- return nil, nil- }- opts, err := redis.ParseURL(url)- if err != nil {- return nil, fmt.Errorf("parse redis url: %w", err)- }- c := redis.NewClient(opts)- pingCtx, cancel := context.WithTimeout(ctx, 5*time.Second)- defer cancel()- if err := c.Ping(pingCtx).Err(); err != nil {- slog.Warn("templates: redis ping failed at startup; will retry on demand", "err", err)- }- return &redisStore{c: c}, nil-}--// Save writes (or overwrites) a template and adds it to the owner's index.-// Overwriting an existing template preserves its original created_at — a-// re-save updates the config without resetting the template's age.-func (s *redisStore) Save(ctx context.Context, t *Template) error {- key := tplKey(t.User, t.Name)-- createdAt := t.CreatedAt- switch existing, err := s.c.HGet(ctx, key, "created_at").Result(); {- case err == nil && existing != "":- if parsed, perr := time.Parse(time.RFC3339Nano, existing); perr == nil {- createdAt = parsed- }- case err != nil && err != redis.Nil:- return fmt.Errorf("hget created_at: %w", err)- }- if createdAt.IsZero() {- createdAt = time.Now().UTC()- }- t.CreatedAt = createdAt-- pipe := s.c.TxPipeline()- pipe.HSet(ctx, key, map[string]interface{}{- "user": t.User,- "name": t.Name,- "created_at": createdAt.UTC().Format(time.RFC3339Nano),- "config": string(t.Config),- })- pipe.SAdd(ctx, indexKey(t.User), t.Name)- if _, err := pipe.Exec(ctx); err != nil {- return fmt.Errorf("save template: %w", err)- }- return nil-}--// Get returns one template, or (nil, nil) if the user has no template by-// that name.-func (s *redisStore) Get(ctx context.Context, user, name string) (*Template, error) {- fields, err := s.c.HGetAll(ctx, tplKey(user, name)).Result()- if err != nil {- return nil, fmt.Errorf("hgetall: %w", err)- }- if len(fields) == 0 {- return nil, nil- }- return hydrate(user, name, fields), nil-}--// List returns all of the user's templates, newest first. Stale index-// entries (name present but hash gone, e.g. TTL/eviction) are self-healed-// with an SREM and skipped.-func (s *redisStore) List(ctx context.Context, user string) ([]*Template, error) {- names, err := s.c.SMembers(ctx, indexKey(user)).Result()- if err != nil {- return nil, fmt.Errorf("smembers: %w", err)- }- out := make([]*Template, 0, len(names))- for _, name := range names {- fields, err := s.c.HGetAll(ctx, tplKey(user, name)).Result()- if err != nil {- return nil, fmt.Errorf("hgetall %s: %w", name, err)- }- if len(fields) == 0 {- s.c.SRem(ctx, indexKey(user), name)- continue- }- out = append(out, hydrate(user, name, fields))- }- sortByCreatedDesc(out)- return out, nil-}--// Delete removes a template and its index entry. The bool reports whether-// the template existed so the handler can return 404 vs 204.-func (s *redisStore) Delete(ctx context.Context, user, name string) (bool, error) {- pipe := s.c.TxPipeline()- del := pipe.Del(ctx, tplKey(user, name))- pipe.SRem(ctx, indexKey(user), name)- if _, err := pipe.Exec(ctx); err != nil {- return false, fmt.Errorf("delete template: %w", err)- }- return del.Val() > 0, nil-}--// hydrate builds a Template from a Redis HASH. user/name args are the-// addressed key components, used as a fallback if the stored fields are-// somehow missing.-func hydrate(user, name string, fields map[string]string) *Template {- t := &Template{- User: fields["user"],- Name: fields["name"],- Config: json.RawMessage(fields["config"]),- }- if t.User == "" {- t.User = user- }- if t.Name == "" {- t.Name = name- }- if v := fields["created_at"]; v != "" {- if parsed, err := time.Parse(time.RFC3339Nano, v); err == nil {- t.CreatedAt = parsed- }- }- if len(t.Config) == 0 {- t.Config = json.RawMessage("null")- }- return t-}--// sortByCreatedDesc orders templates newest-first. Insertion sort keeps-// the dependency surface zero (no sort import churn) and is trivially fast-// for the handful of templates a single user keeps.-func sortByCreatedDesc(ts []*Template) {- for i := 1; i < len(ts); i++ {- for j := i; j > 0 && ts[j].CreatedAt.After(ts[j-1].CreatedAt); j-- {- ts[j], ts[j-1] = ts[j-1], ts[j]- }- }-}diff --git a/libs/fleet/backend/templates/store_test.go b/libs/fleet/backend/templates/store_test.godeleted file mode 100644index ea6b59696a..0000000000--- a/libs/fleet/backend/templates/store_test.go+++ /dev/null@@ -1,87 +0,0 @@-package templates--import (- "context"- "encoding/json"- "testing"- "time"-)--func TestKeyLayoutIsUserScoped(t *testing.T) {- // A template key always carries its owner, so one user's name can- // never resolve to another user's hash.- if got := tplKey("user-a", "tpl"); got != "pooltpl:user-a:tpl" {- t.Fatalf("tplKey = %q", got)- }- if got := indexKey("user-a"); got != "pooltpl:index:user-a" {- t.Fatalf("indexKey = %q", got)- }- if tplKey("user-a", "tpl") == tplKey("user-b", "tpl") {- t.Fatal("identical template name across users must not collide")- }-}--func TestHydrateFallsBackToAddressedKey(t *testing.T) {- // Missing user/name fields fall back to the addressed components;- // missing config becomes JSON null, not an empty (invalid) blob.- got := hydrate("user-a", "tpl", map[string]string{- "created_at": "2026-05-01T10:00:00Z",- })- if got.User != "user-a" || got.Name != "tpl" {- t.Fatalf("fallback user/name = %q/%q", got.User, got.Name)- }- if string(got.Config) != "null" {- t.Fatalf("empty config = %q, want null", string(got.Config))- }- if got.CreatedAt.IsZero() {- t.Fatal("created_at not parsed")- }-}--func TestHydratePrefersStoredFields(t *testing.T) {- got := hydrate("addr-user", "addr-name", map[string]string{- "user": "stored-user",- "name": "stored-name",- "config": `{"cpu":4}`,- })- if got.User != "stored-user" || got.Name != "stored-name" {- t.Fatalf("stored user/name = %q/%q", got.User, got.Name)- }- if string(got.Config) != `{"cpu":4}` {- t.Fatalf("config = %q", string(got.Config))- }-}--func TestSortByCreatedDescNewestFirst(t *testing.T) {- mk := func(name string, ts string) *Template {- at, _ := time.Parse(time.RFC3339, ts)- return &Template{Name: name, CreatedAt: at, Config: json.RawMessage("null")}- }- ts := []*Template{- mk("old", "2026-01-01T00:00:00Z"),- mk("new", "2026-03-01T00:00:00Z"),- mk("mid", "2026-02-01T00:00:00Z"),- }- sortByCreatedDesc(ts)- if ts[0].Name != "new" || ts[1].Name != "mid" || ts[2].Name != "old" {- t.Fatalf("order = %s,%s,%s", ts[0].Name, ts[1].Name, ts[2].Name)- }-}--func TestNewEmptyURLDisabled(t *testing.T) {- // No URL → (nil, nil): the caller treats nil as "disabled" and the- // handlers return 503 rather than silently dropping writes.- store, err := New(context.Background(), "")- if err != nil {- t.Fatalf("New(\"\") err = %v", err)- }- if store != nil {- t.Fatal("New(\"\") store should be nil")- }-}--func TestNewInvalidURLErrors(t *testing.T) {- if _, err := New(context.Background(), "not-a-redis-url"); err == nil {- t.Fatal("New with garbage URL should error")- }-}diff --git a/libs/fleet/backend/templates/types.go b/libs/fleet/backend/templates/types.godeleted file mode 100644index 6cf592c63e..0000000000--- a/libs/fleet/backend/templates/types.go+++ /dev/null@@ -1,34 +0,0 @@-// Package templates provides Redis-backed, per-user pool templates for-// cyclops-cs.-//-// A template is a saved OSGymWorkspacePool config the user can reuse to-// stamp out new pools without re-entering every field. It is the-// persistent, per-user evolution of the SPA's existing in-memory-// "Duplicate pool" action.-//-// Each template is stored exactly as requested — four fields:-//-// user the owning user (Keycloak sub)-// created_at when the template was first saved (RFC3339Nano)-// name the template's name (unique per user)-// config the opaque pool-config JSON the SPA sends to createPool-//-// The HTTP layer scopes every call to the caller's sub, and the Redis-// key layout (see store.go) namespaces every key by user, so one user-// can never see or clobber another's templates.-package templates--import (- "encoding/json"- "time"-)--// Template is a single saved pool config owned by one user. Config is-// kept opaque (json.RawMessage) so the backend never has to track the-// evolving OSGymWorkspacePool spec — the SPA owns that shape.-type Template struct {- User string `json:"user"`- Name string `json:"name"`- CreatedAt time.Time `json:"createdAt"`- Config json.RawMessage `json:"config"`-}diff --git a/libs/fleet/e2e/fixtures/mock-api.ts b/libs/fleet/e2e/fixtures/mock-api.tsindex 8fba24731d..de6c028aea 100644--- a/libs/fleet/e2e/fixtures/mock-api.ts+++ b/libs/fleet/e2e/fixtures/mock-api.ts@@ -370,81 +370,3 @@ export async function mockClaimsApi(page: Page): Promise<void> {)}-// ----------------------------------------------------------------------------// Pool templates API mocking (/api/pool-templates — Redis-backed)-// -----------------------------------------------------------------------------export interface MockPoolTemplate {- user: string- name: string- createdAt: string- config: Record<string, unknown>-}--const DEFAULT_POOL_TEMPLATES: MockPoolTemplate[] = [- {- user: "test-user-id",- name: "gpu-large",- createdAt: "2026-05-01T10:00:00Z",- config: {- cpu: 8,- ram: "16Gi",- ociImage: "example/osgym-workspace:latest",- replicas: 2,- },- },-]--export async function mockPoolTemplatesApi(- page: Page,- templates: MockPoolTemplate[] = DEFAULT_POOL_TEMPLATES,-): Promise<void> {- // GET list + POST create- await page.route("**/api/pool-templates", async (route) => {- if (route.request().method() === "GET") {- await route.fulfill({- contentType: "application/json",- body: JSON.stringify(templates),- })- } else if (route.request().method() === "POST") {- const body = route.request().postDataJSON()- const created: MockPoolTemplate = {- user: "test-user-id",- name: body.name,- createdAt: new Date().toISOString(),- config: body.config,- }- const idx = templates.findIndex((t) => t.name === body.name)- if (idx >= 0) templates[idx] = created- else templates.push(created)- await route.fulfill({- status: 201,- contentType: "application/json",- body: JSON.stringify(created),- })- } else {- await route.continue()- }- })-- // DELETE /api/pool-templates/:name- await page.route("**/api/pool-templates/*", async (route) => {- if (route.request().method() === "DELETE") {- const url = new URL(route.request().url())- const name = decodeURIComponent(url.pathname.split("/").pop() ?? "")- const idx = templates.findIndex((t) => t.name === name)- if (idx < 0) {- await route.fulfill({- status: 404,- contentType: "application/json",- body: JSON.stringify({ error: "template not found" }),- })- return- }- templates.splice(idx, 1)- await route.fulfill({ status: 204, body: "" })- } else {- await route.continue()- }- })-}diff --git a/libs/fleet/js-sdk/pnpm-lock.yaml b/libs/fleet/js-sdk/pnpm-lock.yamlnew file mode 100644index 0000000000..c1c5754a65--- /dev/null+++ b/libs/fleet/js-sdk/pnpm-lock.yaml@@ -0,0 +1,557 @@+lockfileVersion: '9.0'++settings:+ autoInstallPeers: true+ excludeLinksFromLockfile: false++importers:++ .:+ devDependencies:+ swagger-typescript-api:+ specifier: 13.2.7+ version: 13.2.7+ typescript:+ specifier: 5.7.2+ version: 5.7.2++packages:++ '@biomejs/[email protected]':+ resolution: {integrity: sha512-69OfQ7+09AtiCIg+k+aU3rEsGit5o/SJWCS3BeBH/2nJYdJGi0cIx+ybka8i1EK69aNcZxYO1y1iAAEmYMq1HA==}+ peerDependencies:+ '@biomejs/wasm-bundler': ^2.0.0+ '@biomejs/wasm-nodejs': ^2.0.0+ '@biomejs/wasm-web': ^2.0.0+ peerDependenciesMeta:+ '@biomejs/wasm-bundler':+ optional: true+ '@biomejs/wasm-nodejs':+ optional: true+ '@biomejs/wasm-web':+ optional: true++ '@biomejs/[email protected]':+ resolution: {integrity: sha512-pihpBMylewgDdGFZHRkgmc3OajuGIJPXhvfYuKCNK/CWyJMrYEFmPKs8Iq1kY0sYMmGlTbD4K2udV03KYa+r0Q==}++ '@exodus/[email protected]':+ resolution: {integrity: sha512-5Aap/GaRupgNx/feGBwLLTVv8OQFfv3pq2lPRzPg9R+IOBnDgghTGW7l7EuVXOvg5cc/xSAlRW8rBrjIC3Nvqw==}++ '@types/[email protected]':+ resolution: {integrity: sha512-T92Xav+Gf/Ik1uPW581nA+JftmjWPgskw/WBf4TJzxRG/SJ+DfNnNE+WuZ4mrXuzflQMqMkm1LSYjzYW7MB1Cg==}++ resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==}+ engines: {node: '>=8'}++ resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==}+ engines: {node: '>=8'}++ resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==}++ resolution: {integrity: sha512-cM0ApFQSBXuourJejzwv/AuPRvAxordTyParRVcHjjtXirtkzM0uK2L9TTn9s0cXZbG7E55jCivRQzoxYmRAlA==}+ peerDependencies:+ magicast: '*'+ peerDependenciesMeta:+ magicast:+ optional: true++ resolution: {integrity: sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==}++ resolution: {integrity: sha512-TQMmc3w+5AxjpL8iIiwebF73dRDF4fBIieAqGn9RGCWaEVwQ6Fb2cGe31Yns0RRIzii5goJ1Y7xbMwo1TxMplw==}+ engines: {node: '>= 20.19.0'}++ resolution: {integrity: sha512-tskPPKEs8D2KPafUypv2gxwJP8h/OaJmC82QQGGDQcHvXX43xF2VDACcJVmZ0EuSxkpO9Kc4MlrA3q0+FG58AQ==}++ resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}+ engines: {node: '>=12'}++ resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}+ engines: {node: '>=7.0.0'}++ resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}++ resolution: {integrity: sha512-ysOGlgTFbN2/Y6Cg3Iye8YKulHw+R2fNXHrgSmXISQdMnomY6eNDprVdW9R5xBguEqI954+S6709UyiO7B+6OQ==}++ resolution: {integrity: sha512-5IKcdX0nnYavi6G7TtOhwkYzyjfJlatbjMjuLSfE2kYT5pMDOilZ4OvMhi637CcDICTmz3wARPoyhqyX1Y+XvA==}+ engines: {node: ^14.18.0 || >=16.10.0}++ resolution: {integrity: sha512-7z22QmUWiQ/2d0KkdYmANbRUVABpZ9SNYyH5vx6PZ+nE5bcC0l7uFvEfHlyld/HcGBFTL536ClDt3DEcSlEJAQ==}++ resolution: {integrity: sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==}++ resolution: {integrity: sha512-nI4U3TottKAcAD9LLud4Cb7b2QztQMUEfHbvhTH09bqXTxnSie8WnjPALV/WMCrJZ6UV/qHJ6L03OqO3LcdYZw==}+ engines: {node: '>=12'}++ resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}++ resolution: {integrity: sha512-SOp9Phqvqn7jtEUxPWdWfWoLmyt2VaJ6MpvP9Comy1MceMXqE6bxvaTu4iaxpYYPzhny28Lc+M87/c2cPK6lDg==}++ resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==}+ engines: {node: '>=6'}++ resolution: {integrity: sha512-UVQ72Rqjy/ZKQalzV5dCCJP80GrmPrMxh6NlNf+erV6ObL0ZFkhCstWRawS85z3smdr3d2wXPsZEY7rDPfGd2g==}+ engines: {node: '>=6.0.0'}++ resolution: {integrity: sha512-D+42+T12DdIlJM3uepa55qGiL3sYdLBOxIl2ifQCzCHz4c7eiolaHsi3BIqEr7JxBzxv2pYZQX9kw16ziMcEmw==}++ resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==}++ resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}+ engines: {node: 6.* || 8.* || >= 10.*}++ resolution: {integrity: sha512-gzi2D96p+AMfDcmJHGDj3KJ9NRiwvlFAU5yfa3ROwWZmFUjX4P43x3BcyRaOMMLto1vUo7C+86+MFhYTl6Ryiw==}+ hasBin: true++ resolution: {integrity: sha512-EC2utToWl4RKfs5zd36Mxq7nzHHBuomZboI0yYL6Y0RmBgT7Sgkq4rQ0ezFTYoIsSs7Tm9SJe+o2FcAg6GBhGA==}++ resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}+ engines: {node: '>=8'}++ resolution: {integrity: sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ==}+ hasBin: true++ resolution: {integrity: sha512-1td788aAnnZ5qs7V2QIRl1owjtYpbKt749Y3xauqQgwIIGF/xXWz1wMTEBx5O3LK3lXLVuqXPdPxj2BoFHaW9Q==}+ hasBin: true++ resolution: {integrity: sha512-dMInicTPVE8d1e5otfwmmjlxkZoUpiVLwyeTdUsi/Caj/gfzzblBcCE5sRHV/AsjuCmxWrte2TNGSYuCeCq+0Q==}++ resolution: {integrity: sha512-kVrnsrJqMR8+oLJnGEmSWw9BivK5mt7H3FZatVRjrc5wGqFYuBxX1yG7+A7Gi5AefkX6t/oCkizcQgpu0cY1dQ==}+ engines: {node: ^18 || >=20}+ hasBin: true++ resolution: {integrity: sha512-ofRW94Ab0T4AOh5Fk8t0h8OBWrmjb0SSB20xh1H8YnPV9EJ+f5AMoYSUQ2zgJ4Iq2HAK0I2l5/Nequ8YzFS3Hg==}+ engines: {node: 4.x || >=6.0.0}++ resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==}+ engines: {node: 4.x || >=6.0.0}+ peerDependencies:+ encoding: ^0.1.0+ peerDependenciesMeta:+ encoding:+ optional: true++ resolution: {integrity: sha512-SU00ZarexNlE4Rjdm83vglt5Y9yiQ+XI1XpflWlb7q7UTN1JUItm69xMeiQCTxtTfnzt+83T8Cx+vI2ED++VDA==}++ resolution: {integrity: sha512-pJTS2+T0oGIwgjGpw7sIRU8RQMcUoKCDWFLdBqKB2BNmGpbBMH2sdqAaOXUg8OzonZHU0L7vfJu1mJFEiYDWOQ==}++ resolution: {integrity: sha512-KEGjPDVoU5K6swgo9hJVA/qYGlwfbFx+Kg2QB/kd7rzV5N8N5Mg6PlsoCMohVnQmo+pzJap/F610qTodKzecGQ==}++ resolution: {integrity: sha512-Yx5PWQNZomfEhPPOphFbZKi9W93CocQj18NlD2Pa4GWZzdZpSJvYwoiuurRI7m3SpcChrnO08hkuQDL3FGsVFQ==}+ hasBin: true++ resolution: {integrity: sha512-2yucenq1a9YPmeNExoUa9Qwrt9RFkjqaMAA1X+U7sbb0AqBeTIdMHky9SQQ6iN94bO5NW0W4TRYXerG+BdAvAQ==}++ resolution: {integrity: sha512-cu20/HE5N5HKqVygs3dt94eYJfBi0TsZvPVXDhbXQHiEityDN+RROTleefoKRKKJ9dFAF2JBkDHgvWj0sjKGmw==}++ resolution: {integrity: sha512-RdR9FQrFwNBNXAr4GixM8YaRZRJ5PUWbKYbE5eOsrwAjJW0q2REGcf79oYPsLyskQCZG1PLN+S/K1V00joZAoQ==}++ resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==}++ resolution: {integrity: sha512-LjgdTytVFXeUgtHZr9WYViYSM/g8MkcTPYDlPa3cDqMirHjKiSZPYd6DoL7pK8AJQr+uWkQvCjHNdiMqsrJs+g==}++ resolution: {integrity: sha512-y+ichcgc2LrADuhLNAx8DFjVfgz91pRxfZdI3UDhxHvcVEZsenLO+7XaU5vOp0u/7V/wZ+plyuQxtrDlZJ+yeg==}++ resolution: {integrity: sha512-gMDyleLWVE+i6Sgtc0QbbY6pEKqYs97NGi6isHQPqYlLemPoO8dxQ3uGi0f4NiP98c+jMW6cG1Kx9dDwfvqARQ==}++ resolution: {integrity: sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ==}+ engines: {node: '>= 20.19.0'}++ resolution: {integrity: sha512-OVede/NQE13xBQ+ob5CKd5KyeJYU2YInb1bmV4nRoOfquZPkAkxuOXicSe1PvqIuZZ4kD13sPKBbR7UFDmli6w==}++ resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==}+ engines: {node: '>=0.10.0'}++ resolution: {integrity: sha512-ZP36TMrK9euEuWQYBig9W55WPC7uo37qzAEmbjHz4gfyuXrEUgF8cUvQVO+w+d3OMfPvSRQJ22lSm8MQJ43LTA==}++ resolution: {integrity: sha512-hZ58adtulAk0gKtua7QxevgUaXTTXxIi8t41L3zo9AHvjXO1/7sdLECuHeIN2SRtYXpNkmhoUP2pdeWgricQ+Q==}++ resolution: {integrity: sha512-JA4hdoLnN+kebEp2Vs8eBe9g7uy0zbRo+RMcU0EsNy+R+k049Ki+N5tT5Jagst2g7EAja+euFuoXFCa8vIklfA==}++ resolution: {integrity: sha512-MdAsTu3n25yDbIe1NeN69G4n6mUnJGtSJHygX3+oN0ZbO3DTiATnf7XnYJdGT42JCXurTb1JI0qOBR65shvhPQ==}++ resolution: {integrity: sha512-oXF8tfxx5cDk8r2kYqlkUJzZpDBqVY/II2WhvU0n9Y3XYvAYRmeaf1PvvIvTgPnv4KJ+ES5M0PyDq5Jp+Ygy2g==}++ resolution: {integrity: sha512-ggLesLtu2xp+ZxI+ysJTmNjh2U0TsC+rQ/pfED9bUZZ4DKefP27D+7YJVVTvKsmjLpIi9jAa7itwDGkDDmt1GQ==}++ resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==}+ engines: {node: '>=8'}++ resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}+ engines: {node: '>=8'}++ resolution: {integrity: sha512-rCC0NWGKr/IJhtRuPq/t37qvZHI/mH4I4sxflVM+qgVe5Z2uOCivzWaVbuioJaB61kvm5UvB7b49E+oBY0M8jA==}++ resolution: {integrity: sha512-rfqqoRFpZJPl477M/snMJPM90EvI8WqhuUHSF5ecC2r/w376T29+QXNJFVPsJmbFu5rBc/8m3vhArtMctjONdw==}+ engines: {node: '>=20'}+ hasBin: true++ resolution: {integrity: sha512-upi/0ZGkYgEcLeGieoz8gT74oWHA0E7JivX7aN9mAf+Tc7BQoRBvnIGHoPDw+f9TXTW4s6kGYCZJtauP6OYp7g==}+ hasBin: true++ resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==}++ resolution: {integrity: sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==}+ engines: {node: '>=14.17'}+ hasBin: true++ resolution: {integrity: sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==}+ engines: {node: '>=14.17'}+ hasBin: true++ resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==}++ resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==}++ resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==}+ engines: {node: '>=10'}++ resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==}+ engines: {node: '>=10'}++ resolution: {integrity: sha512-vIYeF1u3CjlhAFekPPAk2h/Kv4T3mAkMox5OymRiJQB0spDP10LHvt+K7G9Ny6NuuMAb25/6n1qyUjAcGNf/AA==}+ engines: {node: '>= 6'}++ resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==}+ engines: {node: '>=12'}++ resolution: {integrity: sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g==}+ engines: {node: '>=12'}++snapshots:++ '@biomejs/[email protected](@biomejs/[email protected])':+ optionalDependencies:+ '@biomejs/wasm-nodejs': 2.0.5++ '@biomejs/[email protected]': {}++ '@exodus/[email protected]': {}++ '@types/[email protected]': {}++ [email protected]: {}++ dependencies:+ color-convert: 2.0.1++ [email protected]: {}++ dependencies:+ chokidar: 5.0.0+ confbox: 0.2.4+ defu: 6.1.7+ dotenv: 17.4.2+ exsolve: 1.1.0+ giget: 3.3.0+ jiti: 2.7.0+ ohash: 2.0.11+ pathe: 2.0.3+ perfect-debounce: 2.1.0+ pkg-types: 2.3.1+ rc9: 3.0.1++ [email protected]: {}++ dependencies:+ readdirp: 5.0.0++ dependencies:+ consola: 3.4.2++ dependencies:+ string-width: 4.2.3+ strip-ansi: 6.0.1+ wrap-ansi: 7.0.0++ dependencies:+ color-name: 1.1.4++ [email protected]: {}++ [email protected]: {}++ [email protected]: {}++ [email protected]: {}++ [email protected]: {}++ [email protected]: {}++ [email protected]: {}++ [email protected]: {}++ [email protected]: {}++ [email protected]: {}++ [email protected]: {}++ [email protected]: {}++ [email protected]: {}++ [email protected]: {}++ [email protected]: {}++ [email protected]: {}++ [email protected]: {}++ dependencies:+ argparse: 2.0.1++ [email protected]: {}++ [email protected]: {}++ dependencies:+ http2-client: 1.3.5++ dependencies:+ whatwg-url: 5.0.0++ dependencies:+ es6-promise: 3.3.1++ dependencies:+ fast-safe-stringify: 2.1.1++ dependencies:+ '@exodus/schemasafe': 1.3.0+ should: 13.2.3+ yaml: 1.10.3++ dependencies:+ node-fetch-h2: 2.3.0+ oas-kit-common: 1.0.8+ reftools: 1.1.9+ yaml: 1.10.3+ yargs: 17.7.3++ [email protected]: {}++ dependencies:+ call-me-maybe: 1.0.2+ oas-kit-common: 1.0.8+ oas-linter: 3.2.2+ oas-resolver: 2.5.6+ oas-schema-walker: 1.1.5+ reftools: 1.1.9+ should: 13.2.3+ yaml: 1.10.3++ [email protected]: {}++ [email protected]: {}++ [email protected]: {}++ dependencies:+ confbox: 0.2.4+ exsolve: 1.1.0+ pathe: 2.0.3++ dependencies:+ defu: 6.1.7+ destr: 2.0.5++ [email protected]: {}++ [email protected]: {}++ [email protected]: {}++ dependencies:+ should-type: 1.4.0++ dependencies:+ should-type: 1.4.0+ should-type-adaptors: 1.1.0++ dependencies:+ should-type: 1.4.0+ should-util: 1.0.1++ [email protected]: {}++ [email protected]: {}++ dependencies:+ should-equal: 2.0.0+ should-format: 3.0.3+ should-type: 1.4.0+ should-type-adaptors: 1.1.0+ should-util: 1.0.1++ dependencies:+ emoji-regex: 8.0.0+ is-fullwidth-code-point: 3.0.0+ strip-ansi: 6.0.1++ dependencies:+ ansi-regex: 5.0.1++ [email protected]: {}++ dependencies:+ '@biomejs/js-api': 1.0.0(@biomejs/[email protected])+ '@biomejs/wasm-nodejs': 2.0.5+ '@types/swagger-schema-official': 2.0.25+ c12: 3.3.4+ citty: 0.1.6+ consola: 3.4.2+ eta: 2.2.0+ js-yaml: 4.3.0+ lodash: 4.18.1+ nanoid: 5.1.16+ swagger-schema-official: 2.0.0-bab6bed+ swagger2openapi: 7.0.8+ typescript: 5.8.3+ transitivePeerDependencies:+ - '@biomejs/wasm-bundler'+ - '@biomejs/wasm-web'+ - encoding+ - magicast++ dependencies:+ call-me-maybe: 1.0.2+ node-fetch: 2.7.0+ node-fetch-h2: 2.3.0+ node-readfiles: 0.2.0+ oas-kit-common: 1.0.8+ oas-resolver: 2.5.6+ oas-schema-walker: 1.1.5+ oas-validator: 5.0.8+ reftools: 1.1.9+ yaml: 1.10.3+ yargs: 17.7.3+ transitivePeerDependencies:+ - encoding++ [email protected]: {}++ [email protected]: {}++ [email protected]: {}++ [email protected]: {}++ dependencies:+ tr46: 0.0.3+ webidl-conversions: 3.0.1++ dependencies:+ ansi-styles: 4.3.0+ string-width: 4.2.3+ strip-ansi: 6.0.1++ [email protected]: {}++ [email protected]: {}++ [email protected]: {}++ dependencies:+ cliui: 8.0.1+ escalade: 3.2.0+ get-caller-file: 2.0.5+ require-directory: 2.1.1+ string-width: 4.2.3+ y18n: 5.0.8+ yargs-parser: 21.1.1diff --git a/libs/fleet/js-sdk/src/generated/cyclops-cs-backend.ts b/libs/fleet/js-sdk/src/generated/cyclops-cs-backend.tsindex 87cbc33588..2d77f4b465 100644--- a/libs/fleet/js-sdk/src/generated/cyclops-cs-backend.ts+++ b/libs/fleet/js-sdk/src/generated/cyclops-cs-backend.ts@@ -40,12 +40,6 @@ export interface HandlersCreateNamespaceRequest {name?: string;}-export interface HandlersCreatePoolTemplateRequest {- config?: object;- /** @example "gpu-large" */- name?: string;-}-export interface HandlersCreateUserKeyRequest {/** @example "my-ci-key" */name?: string;@@ -84,13 +78,6 @@ export interface HandlersNamespaceResponse {status?: string;}-export interface HandlersPoolTemplateResponse {- config?: object;- createdAt?: string;- name?: string;- user?: string;-}-export interface HandlersUserKeyResponse {client_id?: string;id?: string;@@ -122,8 +109,6 @@ export type ConfigListData = HandlersConfigResponse;export type ConfigListError = HandlersErrorResponse;-export type GatewayDetailData = string;-export type GatewayDetailError = HandlersErrorResponse;export type GetK8SData = string;@@ -166,22 +151,6 @@ export type OrchDetailData = string;export type OrchDetailError = HandlersErrorResponse;-export type PoolTemplatesListData = HandlersPoolTemplateResponse[];--export type PoolTemplatesListError = HandlersErrorResponse;--export type PoolTemplatesCreateData = HandlersPoolTemplateResponse;--export type PoolTemplatesCreateError = HandlersErrorResponse;--export type PoolTemplatesDetailData = HandlersPoolTemplateResponse;--export type PoolTemplatesDetailError = HandlersErrorResponse;--export type PoolTemplatesDeleteData = any;--export type PoolTemplatesDeleteError = HandlersErrorResponse;-export type GetSvcData = string;export type GetSvcError = HandlersErrorResponse;@@ -489,7 +458,7 @@ export class Api<** @tags batch* @name BatchLanesCreate- * @summary Deprecated batch lane acquisition route+ * @summary Deprecated batch lanes route* @request POST:/api/batch/{pool}/lanes* @deprecated* @secure@@ -507,7 +476,7 @@ export class Api<** @tags batch* @name BatchLanesDelete- * @summary Deprecated batch lane release route+ * @summary Deprecated batch lanes route* @request DELETE:/api/batch/{pool}/lanes* @deprecated* @secure@@ -543,7 +512,7 @@ export class Api<** @tags batch* @name BatchDelete- * @summary Deprecated batch cancellation route+ * @summary Deprecated batch delete route* @request DELETE:/api/batch/{pool}/{id}* @deprecated* @secure@@ -613,19 +582,17 @@ export class Api<};gateway = {/**- * @description DEPRECATED (CUA-609): The per-pool orchestrator HTTP layer has been removed. This route returns 410 Gone for all requests. All pool operations must use OSGymSandboxClaim CRs (Path B) directly.+ * @description The per-pool HTTP orchestrator has been deprecated and removed. All pools now use OSGymSandboxClaim CRs exclusively (Path B). This endpoint returns 410 Gone for any request. See CUA-609.** @tags gateway* @name GatewayDetail- * @summary Reverse-proxy to the per-pool orchestrator (sole ingress path — CUA-527)+ * @summary DEPRECATED: Per-pool orchestrator reverse-proxy (CUA-609)* @request GET:/api/gateway/{name}/{path}- * @secure*/gatewayDetail: (name: string, path?: string, params: RequestParams = {}) =>- this.request<GatewayDetailData, GatewayDetailError>({+ this.request<any, GatewayDetailError>({path: `/api/gateway/${name}/${path}`,method: "GET",- secure: true,...params,}),};@@ -707,9 +674,9 @@ export class Api</*** @description Route is deprecated and unavailable. Returns 410 Gone for every request. The orchestrator-backed batch surface is retired; callers must migrate to the replacement flow.*- * @tags batch+ * @tags label* @name LabelDelete- * @summary Deprecated label cancellation route+ * @summary Deprecated label delete route* @request DELETE:/api/label/{pool}/{label}* @deprecated* @secure@@ -725,9 +692,9 @@ export class Api</*** @description Route is deprecated and unavailable. Returns 410 Gone for every request. The orchestrator-backed batch surface is retired; callers must migrate to the replacement flow.*- * @tags batch+ * @tags label* @name LabelBatchCreate- * @summary Deprecated label batch submission route+ * @summary Deprecated label batch route* @request POST:/api/label/{pool}/{label}/batch* @deprecated* @secure@@ -747,7 +714,7 @@ export class Api</*** @description Route is deprecated and unavailable. Returns 410 Gone for every request. The orchestrator-backed batch surface is retired; callers must migrate to the replacement flow.*- * @tags batch+ * @tags label* @name LabelResultsList* @summary Deprecated label results route* @request GET:/api/label/{pool}/{label}/results@@ -769,7 +736,7 @@ export class Api</*** @description Route is deprecated and unavailable. Returns 410 Gone for every request. The orchestrator-backed batch surface is retired; callers must migrate to the replacement flow.*- * @tags batch+ * @tags label* @name LabelStatusList* @summary Deprecated label status route* @request GET:/api/label/{pool}/{label}/status@@ -870,83 +837,6 @@ export class Api<...params,}),};- poolTemplates = {- /**- * @description Returns every pool template owned by the calling user, newest first.- *- * @tags pool-templates- * @name PoolTemplatesList- * @summary List the calling user's pool templates- * @request GET:/api/pool-templates- * @secure- */- poolTemplatesList: (params: RequestParams = {}) =>- this.request<PoolTemplatesListData, PoolTemplatesListError>({- path: `/api/pool-templates`,- method: "GET",- secure: true,- format: "json",- ...params,- }),-- /**- * @description Stores the given pool config under a name owned by the calling user. Re-saving an existing name overwrites the config while preserving the original creation time. Use GET /api/pool-templates to list them and seed a new pool.- *- * @tags pool-templates- * @name PoolTemplatesCreate- * @summary Save a pool config as a reusable template- * @request POST:/api/pool-templates- * @secure- */- poolTemplatesCreate: (- body: HandlersCreatePoolTemplateRequest,- params: RequestParams = {},- ) =>- this.request<PoolTemplatesCreateData, PoolTemplatesCreateError>({- path: `/api/pool-templates`,- method: "POST",- body: body,- secure: true,- type: ContentType.Json,- format: "json",- ...params,- }),-- /**- * No description- *- * @tags pool-templates- * @name PoolTemplatesDetail- * @summary Get one of the calling user's pool templates- * @request GET:/api/pool-templates/{name}- * @secure- */- poolTemplatesDetail: (name: string, params: RequestParams = {}) =>- this.request<PoolTemplatesDetailData, PoolTemplatesDetailError>({- path: `/api/pool-templates/${name}`,- method: "GET",- secure: true,- format: "json",- ...params,- }),-- /**- * No description- *- * @tags pool-templates- * @name PoolTemplatesDelete- * @summary Delete one of the calling user's pool templates- * @request DELETE:/api/pool-templates/{name}- * @secure- */- poolTemplatesDelete: (name: string, params: RequestParams = {}) =>- this.request<PoolTemplatesDeleteData, PoolTemplatesDeleteError>({- path: `/api/pool-templates/${name}`,- method: "DELETE",- secure: true,- ...params,- }),- };svc = {/*** @description Proxies to {service}.{namespace}.svc.cluster.local:80. Per-key tokens are bound to their `namespace` claim; all other principals (SPA, user keys, oauth2-proxy browser sessions) must hold RBAC in {namespace}, verified via an impersonated RoleBinding probe. Strips Authorization before forwarding.diff --git a/libs/fleet/nginx.conf b/libs/fleet/nginx.confindex 07f4e48cc9..f80b2225ed 100644--- a/libs/fleet/nginx.conf+++ b/libs/fleet/nginx.conf@@ -2,10 +2,10 @@## - Serves the Vite-built SPA at /, with a try_files fallback to index.html# so deep links like /modules/foo render correctly.-# - Proxies /api/* to the cyclops-ctrl Service inside the cluster, stripping-# the /api prefix (mirrors the dev-mode Vite proxy).+# - Proxies /api/* to the cyclops-cs-backend Deployment; unmatched /api+# paths return 404 rather than falling through to the SPA.#-# `${CYCLOPS_CTRL}` and `${CYCLOPS_CS_BACKEND}` are substituted by nginx's+# `${CYCLOPS_CS_BACKEND}` is substituted by nginx's# envsubst at container start (default behavior of the official# nginx:alpine image when the file is placed under /etc/nginx/templates/).@@ -70,8 +70,8 @@ server {## Backend runs as a standalone Deployment in the same namespace; nginx# reaches it via the cyclops-cs-backend Service (envsubst substitutes- # the cluster DNS URL at container start). Matched before the catch-all- # /api/ block so cyclops-ctrl never sees these paths.+ # the cluster DNS URL at container start). Matched before the /api/+ # 404 guard below.# /api/svc — sandbox service proxy.## Two auth paths:@@ -158,18 +158,11 @@ server {return 200 'window.__CYCLOPS_CS_CFG__=${CYCLOPS_CS_CONFIG_JSON};';}- # API proxy — mirrors the /api → cyclops-ctrl rewrite from vite.config.ts.+ # Upstream Cyclops (cyclops-ctrl) is retired; every live API route is+ # matched by the backend blocks above. Return 404 for anything else so+ # a stray /api call fails loudly instead of receiving index.html.location /api/ {- proxy_pass ${CYCLOPS_CTRL}/;- proxy_http_version 1.1;- proxy_set_header Host $host;- proxy_set_header X-Real-IP $remote_addr;- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;- proxy_set_header X-Forwarded-Proto $scheme;- # SSE endpoints (cyclops streams resources/logs); disable buffering.- proxy_buffering off;- proxy_read_timeout 1h;- proxy_send_timeout 1h;+ return 404;}# The previous /k8s-api/ and /orch-api/ blocks were removed — both arediff --git a/libs/fleet/src/api/cyclops.ts b/libs/fleet/src/api/cyclops.tsindex d30e232acd..57931392aa 100644--- a/libs/fleet/src/api/cyclops.ts+++ b/libs/fleet/src/api/cyclops.ts@@ -176,8 +176,7 @@ async function fetchJson<T>(url: string, init?: RequestInit): Promise<T> {url.startsWith("/api/gateway") ||url.startsWith("/api/k8s") ||url.startsWith("/api/orch") ||- url.startsWith("/api/namespaces") ||- url.startsWith("/api/pool-templates")+ url.startsWith("/api/namespaces")) {const { getToken } = await import("../auth/keycloak")const token = await getToken()@@ -563,12 +562,9 @@ export const namespacesApi = {}),}-// ── Pool templates ─────────────────────────────────────────────────────+// ── Pool config shape ──────────────────────────────────────────────────//-// Per-user saved pool configs, persisted in Redis by the backend-// (/api/pool-templates). The stored `config` is exactly the object the SPA-// passes to api.createPool — so creating a pool from a template just feeds-// it back into the New pool form.+// The object the SPA passes to api.createPool.// Optional autoscaling extension. Threaded verbatim onto the pool's// generated OSGymSandboxWarmPool.spec.autoscaling by the compat shim,@@ -598,34 +594,6 @@ export interface PoolTemplateConfig {autoscaling?: PoolAutoscalingConfig}-export interface PoolTemplate {- user: string- name: string- createdAt: string- config: PoolTemplateConfig-}--const httpPoolTemplates = <T>(path: string, init?: RequestInit) =>- fetchJson<T>(`/api/pool-templates${path}`, init)--export const poolTemplatesApi = {- list: async (): Promise<PoolTemplate[]> => {- const res = await httpPoolTemplates<PoolTemplate[]>("")- return res ?? []- },-- create: (name: string, config: PoolTemplateConfig) =>- httpPoolTemplates<PoolTemplate>("", {- method: "POST",- body: JSON.stringify({ name, config }),- }),-- remove: (name: string) =>- httpPoolTemplates<void>(`/${encodeURIComponent(name)}`, {- method: "DELETE",- }),-}-// ── User API keys ─────────────────────────────────────────────────────export interface UserApiKey {diff --git a/libs/fleet/src/api/generated/cyclops-cs-backend.ts b/libs/fleet/src/api/generated/cyclops-cs-backend.tsindex 0e3a03978e..7ca6ee79e9 100644--- a/libs/fleet/src/api/generated/cyclops-cs-backend.ts+++ b/libs/fleet/src/api/generated/cyclops-cs-backend.ts@@ -40,12 +40,6 @@ export interface HandlersCreateNamespaceRequest {name?: string;}-export interface HandlersCreatePoolTemplateRequest {- config?: object;- /** @example "gpu-large" */- name?: string;-}-export interface HandlersCreateUserKeyRequest {/** @example "my-ci-key" */name?: string;@@ -84,13 +78,6 @@ export interface HandlersNamespaceResponse {status?: string;}-export interface HandlersPoolTemplateResponse {- config?: object;- createdAt?: string;- name?: string;- user?: string;-}-export interface HandlersUserKeyResponse {client_id?: string;id?: string;@@ -122,8 +109,6 @@ export type ConfigListData = HandlersConfigResponse;export type ConfigListError = HandlersErrorResponse;-export type GatewayDetailData = string;-export type GatewayDetailError = HandlersErrorResponse;export type GetK8SData = string;@@ -166,22 +151,6 @@ export type OrchDetailData = string;export type OrchDetailError = HandlersErrorResponse;-export type PoolTemplatesListData = HandlersPoolTemplateResponse[];--export type PoolTemplatesListError = HandlersErrorResponse;--export type PoolTemplatesCreateData = HandlersPoolTemplateResponse;--export type PoolTemplatesCreateError = HandlersErrorResponse;--export type PoolTemplatesDetailData = HandlersPoolTemplateResponse;--export type PoolTemplatesDetailError = HandlersErrorResponse;--export type PoolTemplatesDeleteData = any;--export type PoolTemplatesDeleteError = HandlersErrorResponse;-export type GetSvcData = string;export type GetSvcError = HandlersErrorResponse;@@ -482,7 +451,7 @@ export class Api<** @tags batch* @name BatchLanesCreate- * @summary Deprecated batch lane acquisition route+ * @summary Deprecated batch lanes route* @request POST:/api/batch/{pool}/lanes* @deprecated* @secure@@ -500,7 +469,7 @@ export class Api<** @tags batch* @name BatchLanesDelete- * @summary Deprecated batch lane release route+ * @summary Deprecated batch lanes route* @request DELETE:/api/batch/{pool}/lanes* @deprecated* @secure@@ -536,7 +505,7 @@ export class Api<** @tags batch* @name BatchDelete- * @summary Deprecated batch cancellation route+ * @summary Deprecated batch delete route* @request DELETE:/api/batch/{pool}/{id}* @deprecated* @secure@@ -606,19 +575,17 @@ export class Api<};gateway = {/**- * @description DEPRECATED (CUA-609): The per-pool orchestrator HTTP layer has been removed. This route returns 410 Gone for all requests. All pool operations must use OSGymSandboxClaim CRs (Path B) directly.+ * @description The per-pool HTTP orchestrator has been deprecated and removed. All pools now use OSGymSandboxClaim CRs exclusively (Path B). This endpoint returns 410 Gone for any request. See CUA-609.** @tags gateway* @name GatewayDetail- * @summary Reverse-proxy to the per-pool orchestrator (sole ingress path — CUA-527)+ * @summary DEPRECATED: Per-pool orchestrator reverse-proxy (CUA-609)* @request GET:/api/gateway/{name}/{path}- * @secure*/gatewayDetail: (name: string, path?: string, params: RequestParams = {}) =>- this.request<GatewayDetailData, GatewayDetailError>({+ this.request<any, GatewayDetailError>({path: `/api/gateway/${name}/${path}`,method: "GET",- secure: true,...params,}),};@@ -700,9 +667,9 @@ export class Api</*** @description Route is deprecated and unavailable. Returns 410 Gone for every request. The orchestrator-backed batch surface is retired; callers must migrate to the replacement flow.*- * @tags batch+ * @tags label* @name LabelDelete- * @summary Deprecated label cancellation route+ * @summary Deprecated label delete route* @request DELETE:/api/label/{pool}/{label}* @deprecated* @secure@@ -718,9 +685,9 @@ export class Api</*** @description Route is deprecated and unavailable. Returns 410 Gone for every request. The orchestrator-backed batch surface is retired; callers must migrate to the replacement flow.*- * @tags batch+ * @tags label* @name LabelBatchCreate- * @summary Deprecated label batch submission route+ * @summary Deprecated label batch route* @request POST:/api/label/{pool}/{label}/batch* @deprecated* @secure@@ -740,7 +707,7 @@ export class Api</*** @description Route is deprecated and unavailable. Returns 410 Gone for every request. The orchestrator-backed batch surface is retired; callers must migrate to the replacement flow.*- * @tags batch+ * @tags label* @name LabelResultsList* @summary Deprecated label results route* @request GET:/api/label/{pool}/{label}/results@@ -762,7 +729,7 @@ export class Api</*** @description Route is deprecated and unavailable. Returns 410 Gone for every request. The orchestrator-backed batch surface is retired; callers must migrate to the replacement flow.*- * @tags batch+ * @tags label* @name LabelStatusList* @summary Deprecated label status route* @request GET:/api/label/{pool}/{label}/status@@ -863,83 +830,6 @@ export class Api<...params,}),};- poolTemplates = {- /**- * @description Returns every pool template owned by the calling user, newest first.- *- * @tags pool-templates- * @name PoolTemplatesList- * @summary List the calling user's pool templates- * @request GET:/api/pool-templates- * @secure- */- poolTemplatesList: (params: RequestParams = {}) =>- this.request<PoolTemplatesListData, PoolTemplatesListError>({- path: `/api/pool-templates`,- method: "GET",- secure: true,- format: "json",- ...params,- }),-- /**- * @description Stores the given pool config under a name owned by the calling user. Re-saving an existing name overwrites the config while preserving the original creation time. Use GET /api/pool-templates to list them and seed a new pool.- *- * @tags pool-templates- * @name PoolTemplatesCreate- * @summary Save a pool config as a reusable template- * @request POST:/api/pool-templates- * @secure- */- poolTemplatesCreate: (- body: HandlersCreatePoolTemplateRequest,- params: RequestParams = {},- ) =>- this.request<PoolTemplatesCreateData, PoolTemplatesCreateError>({- path: `/api/pool-templates`,- method: "POST",- body: body,- secure: true,- type: ContentType.Json,- format: "json",- ...params,- }),-- /**- * No description- *- * @tags pool-templates- * @name PoolTemplatesDetail- * @summary Get one of the calling user's pool templates- * @request GET:/api/pool-templates/{name}- * @secure- */- poolTemplatesDetail: (name: string, params: RequestParams = {}) =>- this.request<PoolTemplatesDetailData, PoolTemplatesDetailError>({- path: `/api/pool-templates/${name}`,- method: "GET",- secure: true,- format: "json",- ...params,- }),-- /**- * No description- *- * @tags pool-templates- * @name PoolTemplatesDelete- * @summary Delete one of the calling user's pool templates- * @request DELETE:/api/pool-templates/{name}- * @secure- */- poolTemplatesDelete: (name: string, params: RequestParams = {}) =>- this.request<PoolTemplatesDeleteData, PoolTemplatesDeleteError>({- path: `/api/pool-templates/${name}`,- method: "DELETE",- secure: true,- ...params,- }),- };svc = {/*** @description Proxies to {service}.{namespace}.svc.cluster.local:80. Per-key tokens are bound to their `namespace` claim; all other principals (SPA, user keys, oauth2-proxy browser sessions) must hold RBAC in {namespace}, verified via an impersonated RoleBinding probe. Strips Authorization before forwarding.diff --git a/libs/fleet/vite.config.ts b/libs/fleet/vite.config.tsindex 78b63fbe45..71c99a26c3 100644--- a/libs/fleet/vite.config.ts+++ b/libs/fleet/vite.config.ts@@ -1,11 +1,6 @@import { defineConfig } from "vite"import react from "@vitejs/plugin-react"-// API requests in dev are proxied to a port-forwarded cyclops-ctrl on-// localhost:8080:-// kubectl -n cyclops port-forward svc/cyclops-ctrl 8080:8080-const CYCLOPS_CTRL = process.env.CYCLOPS_CTRL ?? "http://localhost:8080"-// /api/k8s and /api/orch are served by the cyclops-cs backend sidecar// (Keycloak SSO + OPA), which isn't reachable from a laptop. In dev,// route them through the deployed cyclops-cs Tailscale ingress so the@@ -21,38 +16,13 @@ export default defineConfig({server: {port: 5180,proxy: {- // More specific /api/* rules must come before the catchall /api so- // they're matched first.- "/api/k8s": {- target: ORCH_API,- changeOrigin: true,- secure: true,- },- "/api/orch": {- target: ORCH_API,- changeOrigin: true,- secure: true,- },- "/api/keys": {- target: ORCH_API,- changeOrigin: true,- secure: true,- },- "/api/gateway": {- target: ORCH_API,- changeOrigin: true,- secure: true,- },- "/api/swagger": {+ // Upstream cyclops-ctrl is retired — every /api route is served by+ // the cyclops-cs backend behind the deployed ingress.+ "/api": {target: ORCH_API,changeOrigin: true,secure: true,},- "/api": {- target: CYCLOPS_CTRL,- changeOrigin: true,- rewrite: p => p.replace(/^\/api/, ""),- },},},optimizeDeps: {