{
  "info": {
    "name": "Sandbox Platform API",
    "description": "Sandbox Platform via the gateway.\n\n## Folders\n\n| Folder | What |\n|--------|------|\n| **Start here** | Health, providers, first run, auth samples |\n| **Admin** | Teams, keys, quotas, onboard a tenant |\n| **Harbor** | All Harbor surfaces (v2 / v1 / unversioned / deliver) |\n| **SSE** | Live Harbor/Agent event streams (Send and Download) |\n| **Agent** | Agent catalog + runs |\n| **Code Edit** | Catalog + code executions |\n| **Sandboxes** | Long-lived sandbox lifecycle |\n| **Local** | Direct ports \u2014 `make up` only |\n\n## Setup\n\n1. Import this collection + **Sandbox Dev** (or Local).\n2. Set `SANDBOX_API_KEY`. For Admin also set `SANDBOX_ADMIN_API_KEY`.\n3. Set `tenant_id` / `project_id` (or `new_*` for Admin onboard).\n4. Open **Start here** and send top \u2192 bottom.\n\nKeyHive is in-cluster only \u2014 provision keys under **Admin**, never a KeyHive URL. Job ids save into variables automatically.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "type": "text/javascript",
        "exec": [
          "const url = (pm.request.url && pm.request.url.toString()) || \"\";",
          "if (/\\/sandbox\\/v1\\/admin\\/(credential-plane|keyhive)\\//.test(url)) {",
          "  return;",
          "}",
          "const nt = (pm.environment.get(\"new_tenant_id\") || pm.variables.get(\"new_tenant_id\") || \"\").trim();",
          "const np = (pm.environment.get(\"new_project_id\") || pm.variables.get(\"new_project_id\") || \"\").trim();",
          "let tenant = (pm.variables.get(\"tenant_id\") || \"\").trim();",
          "let project = (pm.variables.get(\"project_id\") || \"\").trim();",
          "if (nt && np && (nt !== tenant || np !== project)) {",
          "  const ns = nt + \":\" + np;",
          "  console.warn(",
          "    \"tenancy mismatch: tenant_id/project_id=\" + (tenant || \"?\") + \":\" + (project || \"?\") +",
          "    \" but new_tenant_id/new_project_id=\" + ns +",
          "    \" \u2014 activating new_* so /providers /quota /usage /jobs use the operator target\"",
          "  );",
          "  pm.environment.set(\"tenant_id\", nt);",
          "  pm.environment.set(\"project_id\", np);",
          "  pm.environment.set(\"namespace\", ns);",
          "  pm.collectionVariables.set(\"tenant_id\", nt);",
          "  pm.collectionVariables.set(\"project_id\", np);",
          "  pm.collectionVariables.set(\"namespace\", ns);",
          "  tenant = nt;",
          "  project = np;",
          "}",
          "if (tenant && project) {",
          "  pm.request.headers.upsert({ key: \"X-Sandbox-Tenant-Id\", value: tenant });",
          "  pm.request.headers.upsert({ key: \"X-Sandbox-Project-Id\", value: project });",
          "}"
        ]
      }
    },
    {
      "listen": "test",
      "script": {
        "type": "text/javascript",
        "exec": [
          "if (!pm.response) { return; }",
          "const expected = (pm.info.requestName.match(/\\u2192\\s*(\\d{3})/) || [])[1];",
          "const code = pm.response.code;",
          "",
          "if (expected) {",
          "  pm.test(`responds ${expected}`, function () {",
          "    pm.response.to.have.status(Number(expected));",
          "  });",
          "} else {",
          "  pm.test(\"the platform did not fail\", function () {",
          "    pm.expect(code, String(pm.response.text() || \"\").slice(0, 200)).to.be.below(500);",
          "  });",
          "  if (code === 401 || code === 403) {",
          "    pm.test(\"credentials are set\", function () {",
          "      throw new Error(",
          "        \"Refused. Set SANDBOX_API_KEY in the environment, or \" +",
          "        \"SANDBOX_ADMIN_API_KEY for the credential-plane admin folders.\"",
          "      );",
          "    });",
          "  }",
          "}"
        ]
      }
    }
  ],
  "auth": {
    "type": "apikey",
    "apikey": [
      {
        "key": "key",
        "value": "X-Api-Key",
        "type": "string"
      },
      {
        "key": "value",
        "value": "{{SANDBOX_API_KEY}}",
        "type": "string"
      },
      {
        "key": "in",
        "value": "header",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://sandbox-dev.turing.com"
    },
    {
      "key": "SANDBOX_API_KEY",
      "value": ""
    },
    {
      "key": "KEYHIVE_TEAM_TOKEN",
      "value": ""
    },
    {
      "key": "SANDBOX_ADMIN_API_KEY",
      "value": ""
    },
    {
      "key": "namespace",
      "value": "harbor-canvas:default"
    },
    {
      "key": "tenant_id",
      "value": "harbor-canvas"
    },
    {
      "key": "project_id",
      "value": "default"
    },
    {
      "key": "new_tenant_id",
      "value": "harbor-canvas"
    },
    {
      "key": "new_project_id",
      "value": "default"
    },
    {
      "key": "job_id",
      "value": ""
    },
    {
      "key": "retry_job_id",
      "value": ""
    },
    {
      "key": "agent_run_job_id",
      "value": ""
    },
    {
      "key": "last_event_id",
      "value": "0"
    },
    {
      "key": "agent_id",
      "value": "opencode"
    },
    {
      "key": "model",
      "value": "anthropic/claude-sonnet-4-5"
    },
    {
      "key": "wandb_model",
      "value": "wandb/moonshotai/Kimi-K2.5"
    },
    {
      "key": "provider",
      "value": "anthropic"
    },
    {
      "key": "provider_api_key",
      "value": ""
    },
    {
      "key": "provider_api_key_2",
      "value": ""
    },
    {
      "key": "key_id",
      "value": ""
    },
    {
      "key": "test_stdout_path",
      "value": "tests/test_stdout.txt"
    },
    {
      "key": "task_archive_url",
      "value": ""
    },
    {
      "key": "workspace_fixture_url",
      "value": ""
    },
    {
      "key": "deliver_url",
      "value": ""
    },
    {
      "key": "sandbox_id",
      "value": ""
    },
    {
      "key": "capture_id",
      "value": ""
    },
    {
      "key": "capture_url",
      "value": ""
    }
  ],
  "item": [
    {
      "name": "Start here",
      "description": "Send Quickstart top \u2192 bottom first. Gateway and Auth are reference samples.",
      "item": [
        {
          "name": "Quickstart",
          "description": "A minimal real workflow against dev or prod. Select an environment, set SANDBOX_API_KEY plus tenant_id/project_id, then send these requests top to bottom. Code execution needs no model-provider key. The W&B run requires provider `wandb` to be provisioned for the selected project.",
          "item": [
            {
              "name": "1. Gateway health \u2014 no credentials required",
              "request": {
                "method": "GET",
                "header": [],
                "url": "{{baseUrl}}/healthz",
                "description": "",
                "auth": {
                  "type": "noauth"
                }
              },
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"gateway is healthy\", () => pm.response.to.have.status(200));"
                    ]
                  }
                }
              ]
            },
            {
              "name": "2. Providers available to this project",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/v1/providers",
                "description": "Confirms which provider keys exist for `tenant_id:project_id` (headers stamped by the collection). Each item has `source: tenant` \u2014 there is no shared fallback pool. For W&B, set `provider=wandb` and expect it listed. If you just provisioned via 01a, run step 6 (or re-send 01a step 3) so `tenant_id` matches `new_tenant_id`."
              },
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"provider inventory returned\", function () {",
                      "  pm.response.to.have.status(200);",
                      "  const body = pm.response.json();",
                      "  const items = Array.isArray(body) ? body : (body.items || body.providers || []);",
                      "  pm.expect(Array.isArray(items)).to.be.true;",
                      "  const tenant = (pm.variables.get(\"tenant_id\") || \"\").trim();",
                      "  const project = (pm.variables.get(\"project_id\") || \"\").trim();",
                      "  console.log(\"scoped to \" + (tenant || \"?\") + \":\" + (project || \"?\"));",
                      "  const lines = items.map((item) => {",
                      "    if (typeof item === \"string\") return item;",
                      "    return (item.provider || \"?\") + \" (\" + (item.source || \"unknown\") + \")\";",
                      "  });",
                      "  console.log(\"providers:\", lines.join(\", \") || \"(none)\");",
                      "  const want = (pm.variables.get(\"provider\") || \"\").trim();",
                      "  if (want) {",
                      "    const row = items.find((item) => (item.provider || item) === want);",
                      "    pm.test(\"selected provider=\" + want + \" is listed\", function () {",
                      "      pm.expect(row, want + \" missing \u2014 provision it for tenant_id:project_id\").to.exist;",
                      "    });",
                      "    if (row && row.source) {",
                      "      pm.test(\"selected provider=\" + want + \" is leased from tenant\", function () {",
                      "        pm.expect(row.source).to.eql(\"tenant\");",
                      "      });",
                      "    }",
                      "  }",
                      "  pm.collectionVariables.set(",
                      "    \"wandb_available\",",
                      "    String(items.some((item) => (item.provider || item) === \"wandb\"))",
                      "  );",
                      "});"
                    ]
                  }
                }
              ]
            },
            {
              "name": "3. Run Python now \u2014 real sandbox, no LLM key",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/codeedit/v1/executions",
                "description": "",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"language\": \"python3.12\",\n  \"files\": {\n    \"main.py\": \"import json, platform\\nprint(json.dumps({'message': 'Sandbox works', 'python': platform.python_version()}))\"\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"code ran successfully\", function () {",
                      "  pm.response.to.have.status(200);",
                      "  const body = pm.response.json();",
                      "  pm.expect(body.exit_code).to.eql(0);",
                      "  pm.expect(body.stdout).to.include(\"Sandbox works\");",
                      "});"
                    ]
                  }
                }
              ]
            },
            {
              "name": "4. Run W&B Kimi with OpenCode",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/agent/v1/runs",
                "description": "Starts a real OpenCode run through W&B Serverless Inference. The returned job id is saved automatically for request 5.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"agent_id\": \"opencode\",\n  \"model\": \"{{wandb_model}}\",\n  \"instruction\": \"Create hello.txt containing exactly: Hello from W&B Kimi via Sandbox\",\n  \"workspace\": {\n    \"files\": {\n      \"README.md\": \"Postman quickstart workspace\\n\"\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (pm.variables.get(\"wandb_available\") !== \"true\") {",
                      "  throw new Error(",
                      "    \"W&B is not provisioned for tenant_id:project_id. Run request 2 and \" +",
                      "    \"provision provider `wandb` before starting this model run.\"",
                      "  );",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "const code = pm.response.code;",
                      "if (code === 200 || code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.job_id) pm.collectionVariables.set(\"agent_run_job_id\", j.job_id);",
                      "  } catch (e) {}",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "5. Check W&B Kimi run status",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/agent/v1/runs/{{agent_run_job_id}}",
                "description": "Repeat until status is succeeded or failed. The same project headers are attached automatically, so platform API keys can read the job they submitted."
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"agent_run_job_id\")) {",
                      "  console.log(\"Skipping: agent_run_job_id is not set. Send quickstart request 4 first; it saves the job id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            }
          ]
        },
        {
          "name": "Gateway",
          "item": [
            {
              "name": "GET /",
              "request": {
                "method": "GET",
                "header": [],
                "url": "{{baseUrl}}/",
                "description": "",
                "auth": {
                  "type": "noauth"
                }
              }
            },
            {
              "name": "GET /healthz",
              "request": {
                "method": "GET",
                "header": [],
                "url": "{{baseUrl}}/healthz",
                "description": "",
                "auth": {
                  "type": "noauth"
                }
              }
            },
            {
              "name": "GET /readyz",
              "request": {
                "method": "GET",
                "header": [],
                "url": "{{baseUrl}}/readyz",
                "description": "",
                "auth": {
                  "type": "noauth"
                }
              }
            },
            {
              "name": "GET /sandbox/healthz",
              "request": {
                "method": "GET",
                "header": [],
                "url": "{{baseUrl}}/sandbox/healthz",
                "description": ""
              }
            },
            {
              "name": "GET /sandbox (route index)",
              "request": {
                "method": "GET",
                "header": [],
                "url": "{{baseUrl}}/sandbox",
                "description": "Which planes this deployment routes to. Needs a key: only the gateway's own /healthz, /readyz and /sandbox/healthz are unauthenticated."
              }
            },
            {
              "name": "GET /docs/index (redirect)",
              "request": {
                "method": "GET",
                "header": [],
                "url": "{{baseUrl}}/docs/index",
                "description": "",
                "auth": {
                  "type": "noauth"
                }
              }
            },
            {
              "name": "GET /docs (integrator site)",
              "request": {
                "method": "GET",
                "header": [],
                "url": "{{baseUrl}}/docs/introduction/overview/",
                "description": "",
                "auth": {
                  "type": "noauth"
                }
              }
            },
            {
              "name": "GET /openapi/sandbox-platform.yaml",
              "request": {
                "method": "GET",
                "header": [],
                "url": "{{baseUrl}}/openapi/sandbox-platform.yaml",
                "description": "",
                "auth": {
                  "type": "noauth"
                }
              }
            },
            {
              "name": "GET /internal/swagger",
              "request": {
                "method": "GET",
                "header": [],
                "url": "{{baseUrl}}/internal/swagger",
                "description": "",
                "auth": {
                  "type": "noauth"
                }
              }
            },
            {
              "name": "GET /internal/redoc",
              "request": {
                "method": "GET",
                "header": [],
                "url": "{{baseUrl}}/internal/redoc",
                "description": "",
                "auth": {
                  "type": "noauth"
                }
              }
            },
            {
              "name": "GET /internal/openapi.json",
              "request": {
                "method": "GET",
                "header": [],
                "url": "{{baseUrl}}/internal/openapi.json",
                "description": "",
                "auth": {
                  "type": "noauth"
                }
              }
            }
          ]
        },
        {
          "name": "Auth",
          "item": [
            {
              "name": "No credentials \u2192 401",
              "request": {
                "method": "GET",
                "header": [],
                "url": "{{baseUrl}}/sandbox/harbor/capabilities",
                "description": "What every route does without a credential. Worth sending once so you recognise the shape of the refusal.",
                "auth": {
                  "type": "noauth"
                }
              }
            },
            {
              "name": "X-Api-Key \u2192 200",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/capabilities",
                "description": "The header the rest of the collection inherits."
              }
            },
            {
              "name": "Bearer KeyHive team token \u2192 200",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/capabilities",
                "description": "The alternative to an API key: a token scoped to one tenant:project, which carries your tenancy with it. Skipped unless you set KEYHIVE_TEAM_TOKEN in the environment \u2014 most consumers use the API key and never need one.",
                "auth": {
                  "type": "bearer",
                  "bearer": [
                    {
                      "key": "token",
                      "value": "{{KEYHIVE_TEAM_TOKEN}}",
                      "type": "string"
                    }
                  ]
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"KEYHIVE_TEAM_TOKEN\")) {",
                      "  console.log(\"Skipping: KEYHIVE_TEAM_TOKEN is not set. Most consumers use the API key instead.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name": "Admin",
      "description": "All operator management. Needs `SANDBOX_ADMIN_API_KEY`.\n\n- **Keys & quotas** \u2014 create team, add/list/rotate/delete keys, quotas, verify providers.\n- **Onboard tenant** \u2014 ordered first-time setup for a new `tenant:project`.\n\nSet `new_tenant_id` / `new_project_id` to the project you manage.",
      "item": [
        {
          "name": "Keys & quotas",
          "description": "**This is how you manage tenant keys and quotas on hosted sandbox** (dev/preprod/prod). KeyHive has no public URL \u2014 all operator work goes through these gateway routes.\n\nRequires `SANDBOX_ADMIN_API_KEY` (`X-Sandbox-Admin-Key`) plus `SANDBOX_API_KEY`. Requests skip when the admin key is unset.\n\n**Target project:** set `new_tenant_id` / `new_project_id` (e.g. `meta` / `multi-agent-swarm`). Create-team, add-key, list/rotate/delete keys, and admin quotas all use that pair. Consumer routes (`/usage`, `/quota`, `/providers`) stamp `tenant_id`/`project_id` and auto-activate from `new_*` when they diverge.\n\n**Day-to-day:** list keys \u2192 rotate or delete by `key_id` \u2192 `GET /providers` (folder 00 or 01a step 5) to verify BYOK. Folder **01a** is the ordered first-time onboard for a new `tenant:project`.",
          "item": [
            {
              "name": "GET /sandbox/v1/usage/summary",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/v1/usage/summary",
                "description": "Your own usage for the stamped tenancy (`tenant_id`/`project_id`, auto-healed from `new_*` when they diverge). No admin key needed."
              },
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"response ok\", function () {",
                      "  pm.response.to.have.status(200);",
                      "});",
                      "const tenant = (pm.variables.get(\"tenant_id\") || \"\").trim();",
                      "const project = (pm.variables.get(\"project_id\") || \"\").trim();",
                      "console.log(\"scoped to \" + (tenant || \"?\") + \":\" + (project || \"?\"));"
                    ]
                  }
                }
              ]
            },
            {
              "name": "GET /sandbox/v1/quota",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/v1/quota",
                "description": "Effective per-project concurrency limit and current in-flight count for the stamped tenancy (`tenant_id`/`project_id`). Set `new_tenant_id`/`new_project_id` to your target project (e.g. `meta` / `multi-agent-swarm`) \u2014 the collection activates them before stamping headers."
              },
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"response ok\", function () {",
                      "  pm.response.to.have.status(200);",
                      "});",
                      "const tenant = (pm.variables.get(\"tenant_id\") || \"\").trim();",
                      "const project = (pm.variables.get(\"project_id\") || \"\").trim();",
                      "console.log(\"scoped to \" + (tenant || \"?\") + \":\" + (project || \"?\"));"
                    ]
                  }
                }
              ]
            },
            {
              "name": "PUT /sandbox/v1/admin/quotas/{tenant}/{project}",
              "request": {
                "method": "PUT",
                "header": [
                  {
                    "key": "X-Sandbox-Admin-Key",
                    "value": "{{SANDBOX_ADMIN_API_KEY}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/v1/admin/quotas/{{new_tenant_id}}/{{new_project_id}}",
                "description": "Operator-owned per-project concurrency cap. Path is `new_tenant_id`/`new_project_id` (same target as 01a BYOK). On success, activates that tenancy for consumer routes.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"max_concurrent\": 2\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"SANDBOX_ADMIN_API_KEY\")) {",
                      "  console.log(\"Skipping: SANDBOX_ADMIN_API_KEY is not set. These routes are for platform operators; consumers do not need them.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if ([200,201].includes(pm.response.code)) {",
                      "  pm.test(\"quota upserted\", function () {",
                      "    pm.expect(pm.response.code).to.be.oneOf([200, 201]);",
                      "  });",
                      "}",
                      "const t = (pm.environment.get(\"new_tenant_id\") || pm.variables.get(\"new_tenant_id\") || \"\").trim();",
                      "const p = (pm.environment.get(\"new_project_id\") || pm.variables.get(\"new_project_id\") || \"\").trim();",
                      "if (!t || !p) {",
                      "  console.log(\"Skipping activate: set new_tenant_id and new_project_id first.\");",
                      "} else {",
                      "  const ns = t + \":\" + p;",
                      "  pm.environment.set(\"tenant_id\", t);",
                      "  pm.environment.set(\"project_id\", p);",
                      "  pm.environment.set(\"namespace\", ns);",
                      "  pm.collectionVariables.set(\"tenant_id\", t);",
                      "  pm.collectionVariables.set(\"project_id\", p);",
                      "  pm.collectionVariables.set(\"namespace\", ns);",
                      "  console.log(\"Activated tenancy \" + ns + \" for subsequent requests.\");",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "GET /sandbox/v1/admin/quotas/{tenant}/{project}",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Admin-Key",
                    "value": "{{SANDBOX_ADMIN_API_KEY}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/v1/admin/quotas/{{new_tenant_id}}/{{new_project_id}}",
                "description": "Read the operator quota row for `new_tenant_id`/`new_project_id`."
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"SANDBOX_ADMIN_API_KEY\")) {",
                      "  console.log(\"Skipping: SANDBOX_ADMIN_API_KEY is not set. These routes are for platform operators; consumers do not need them.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "DELETE /sandbox/v1/admin/quotas/{tenant}/{project}",
              "request": {
                "method": "DELETE",
                "header": [
                  {
                    "key": "X-Sandbox-Admin-Key",
                    "value": "{{SANDBOX_ADMIN_API_KEY}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/v1/admin/quotas/{{new_tenant_id}}/{{new_project_id}}",
                "description": "Remove the operator quota override for `new_tenant_id`/`new_project_id`."
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"SANDBOX_ADMIN_API_KEY\")) {",
                      "  console.log(\"Skipping: SANDBOX_ADMIN_API_KEY is not set. These routes are for platform operators; consumers do not need them.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /sandbox/v1/admin/credential-plane/teams",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Admin-Key",
                    "value": "{{SANDBOX_ADMIN_API_KEY}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/v1/admin/credential-plane/teams",
                "description": "Ensure a KeyHive team for `new_tenant_id:new_project_id` without tenancy headers. Optional `keys` map appends provider keys in the same call. Returns a team token \u2192 `KEYHIVE_TEAM_TOKEN`. On success, aligns `tenant_id`/`project_id`/`namespace` so /quota /providers match. Idempotent if the team already exists.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"namespace\": \"{{new_tenant_id}}:{{new_project_id}}\",\n  \"keys\": {}\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"SANDBOX_ADMIN_API_KEY\")) {",
                      "  console.log(\"Skipping: SANDBOX_ADMIN_API_KEY is not set. These routes are for platform operators; consumers do not need them.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if ([200,201].includes(pm.response.code)) {",
                      "  const j = pm.response.json();",
                      "  if (j.token) {",
                      "    pm.collectionVariables.set(\"KEYHIVE_TEAM_TOKEN\", j.token);",
                      "    pm.environment.set(\"KEYHIVE_TEAM_TOKEN\", j.token);",
                      "  }",
                      "  const ns = (",
                      "    j.namespace",
                      "    || (pm.environment.get(\"new_tenant_id\") + \":\" + pm.environment.get(\"new_project_id\"))",
                      "    || \"\"",
                      "  ).trim();",
                      "  if (ns) {",
                      "    pm.collectionVariables.set(\"namespace\", ns);",
                      "    pm.environment.set(\"namespace\", ns);",
                      "    const parts = ns.split(\":\");",
                      "    if (parts.length === 2 && parts[0] && parts[1]) {",
                      "      pm.environment.set(\"tenant_id\", parts[0]);",
                      "      pm.environment.set(\"project_id\", parts[1]);",
                      "      pm.environment.set(\"new_tenant_id\", parts[0]);",
                      "      pm.environment.set(\"new_project_id\", parts[1]);",
                      "      pm.collectionVariables.set(\"tenant_id\", parts[0]);",
                      "      pm.collectionVariables.set(\"project_id\", parts[1]);",
                      "      pm.collectionVariables.set(\"new_tenant_id\", parts[0]);",
                      "      pm.collectionVariables.set(\"new_project_id\", parts[1]);",
                      "      console.log(\"Aligned tenant_*/new_* to namespace \" + ns);",
                      "    }",
                      "  }",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /sandbox/v1/admin/credential-plane/keys",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Admin-Key",
                    "value": "{{SANDBOX_ADMIN_API_KEY}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/v1/admin/credential-plane/keys",
                "description": "Append a model-provider key to `new_tenant_id:new_project_id`. Re-posting the same value is deduped; a different value adds another active key. Set `provider` + `provider_api_key` (e.g. `wandb` + W&B service key). On success, aligns `tenant_id`/`project_id` so `GET /providers` queries the same pool.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"namespace\": \"{{new_tenant_id}}:{{new_project_id}}\",\n  \"provider\": \"{{provider}}\",\n  \"key\": \"{{provider_api_key}}\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"SANDBOX_ADMIN_API_KEY\")) {",
                      "  console.log(\"Skipping: SANDBOX_ADMIN_API_KEY is not set. These routes are for platform operators; consumers do not need them.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if ([200,201].includes(pm.response.code)) {",
                      "  const j = pm.response.json();",
                      "  if (j.key_id) {",
                      "    pm.collectionVariables.set(\"key_id\", j.key_id);",
                      "    pm.environment.set(\"key_id\", j.key_id);",
                      "  }",
                      "  // Keep consumer stamps aligned with the namespace we just wrote.",
                      "  const ns = (",
                      "    pm.environment.get(\"new_tenant_id\") + \":\" + pm.environment.get(\"new_project_id\")",
                      "  ).trim();",
                      "  const parts = ns.split(\":\");",
                      "  if (parts.length === 2 && parts[0] && parts[1]) {",
                      "    pm.environment.set(\"tenant_id\", parts[0]);",
                      "    pm.environment.set(\"project_id\", parts[1]);",
                      "    pm.collectionVariables.set(\"tenant_id\", parts[0]);",
                      "    pm.collectionVariables.set(\"project_id\", parts[1]);",
                      "    console.log(\"Aligned tenant_id/project_id to namespace \" + ns);",
                      "  }",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /sandbox/v1/admin/credential-plane/keys (add another key)",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Admin-Key",
                    "value": "{{SANDBOX_ADMIN_API_KEY}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/v1/admin/credential-plane/keys",
                "description": "Second active key for the same provider. Inventory still lists the provider once; leases can return either value.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"namespace\": \"{{new_tenant_id}}:{{new_project_id}}\",\n  \"provider\": \"{{provider}}\",\n  \"key\": \"{{provider_api_key_2}}\",\n  \"label\": \"secondary\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"SANDBOX_ADMIN_API_KEY\")) {",
                      "  console.log(\"Skipping: SANDBOX_ADMIN_API_KEY is not set. These routes are for platform operators; consumers do not need them.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "GET /sandbox/v1/admin/credential-plane/keys",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Admin-Key",
                    "value": "{{SANDBOX_ADMIN_API_KEY}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/v1/admin/credential-plane/keys?namespace={{new_tenant_id}}:{{new_project_id}}",
                "description": "List key ids/labels for `new_tenant_id:new_project_id` (never key material). Saves the first `key_id` for rotate/delete."
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"SANDBOX_ADMIN_API_KEY\")) {",
                      "  console.log(\"Skipping: SANDBOX_ADMIN_API_KEY is not set. These routes are for platform operators; consumers do not need them.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (pm.response.code === 200) {",
                      "  const j = pm.response.json();",
                      "  const items = j.items || j.keys || (Array.isArray(j) ? j : []);",
                      "  const first = items[0];",
                      "  const id = first && (first.key_id || first.id);",
                      "  if (id) {",
                      "    pm.collectionVariables.set(\"key_id\", id);",
                      "    pm.environment.set(\"key_id\", id);",
                      "  }",
                      "  console.log(",
                      "    \"keys for \" +",
                      "      pm.environment.get(\"new_tenant_id\") +",
                      "      \":\" +",
                      "      pm.environment.get(\"new_project_id\") +",
                      "      \" \u2192 \" +",
                      "      items.length +",
                      "      \" row(s)\"",
                      "  );",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /sandbox/v1/admin/credential-plane/keys/{key_id}/rotate",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Admin-Key",
                    "value": "{{SANDBOX_ADMIN_API_KEY}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/v1/admin/credential-plane/keys/{{key_id}}/rotate",
                "description": "Replace the value of one pool row in place. Prefer this over re-POSTing /keys when you mean overwrite, not append. Run list-keys first so `key_id` is set.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"key\": \"{{provider_api_key}}\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"SANDBOX_ADMIN_API_KEY\")) {",
                      "  console.log(\"Skipping: SANDBOX_ADMIN_API_KEY is not set. These routes are for platform operators; consumers do not need them.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "DELETE /sandbox/v1/admin/credential-plane/keys/{key_id}",
              "request": {
                "method": "DELETE",
                "header": [
                  {
                    "key": "X-Sandbox-Admin-Key",
                    "value": "{{SANDBOX_ADMIN_API_KEY}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/v1/admin/credential-plane/keys/{{key_id}}",
                "description": "Remove one pool row by `key_id` (from list-keys). Does not delete the KeyHive team."
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"SANDBOX_ADMIN_API_KEY\")) {",
                      "  console.log(\"Skipping: SANDBOX_ADMIN_API_KEY is not set. These routes are for platform operators; consumers do not need them.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "GET /sandbox/v1/providers (verify tenant BYOK)",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/v1/providers",
                "description": "Consumer view of providers for the stamped tenancy (auto-healed from `new_*`). After add-key, your `provider` should appear with `source=tenant`."
              },
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"provider inventory returned\", function () {",
                      "  pm.response.to.have.status(200);",
                      "  const body = pm.response.json();",
                      "  const items = Array.isArray(body) ? body : (body.items || body.providers || []);",
                      "  pm.expect(Array.isArray(items)).to.be.true;",
                      "  const tenant = (pm.variables.get(\"tenant_id\") || \"\").trim();",
                      "  const project = (pm.variables.get(\"project_id\") || \"\").trim();",
                      "  console.log(\"scoped to \" + (tenant || \"?\") + \":\" + (project || \"?\"));",
                      "  const lines = items.map((item) => {",
                      "    if (typeof item === \"string\") return item;",
                      "    return (item.provider || \"?\") + \" (\" + (item.source || \"unknown\") + \")\";",
                      "  });",
                      "  console.log(\"providers:\", lines.join(\", \") || \"(none)\");",
                      "  const want = (pm.variables.get(\"provider\") || \"\").trim();",
                      "  if (want) {",
                      "    const row = items.find((item) => (item.provider || item) === want);",
                      "    pm.test(\"selected provider=\" + want + \" is listed\", function () {",
                      "      pm.expect(row, want + \" missing \u2014 provision it for tenant_id:project_id\").to.exist;",
                      "    });",
                      "    if (row && row.source) {",
                      "      pm.test(\"selected provider=\" + want + \" is leased from tenant\", function () {",
                      "        pm.expect(row.source).to.eql(\"tenant\");",
                      "      });",
                      "    }",
                      "  }",
                      "  pm.collectionVariables.set(",
                      "    \"wandb_available\",",
                      "    String(items.some((item) => (item.provider || item) === \"wandb\"))",
                      "  );",
                      "});"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /sandbox/v1/admin/keyhive/teams (legacy alias)",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Admin-Key",
                    "value": "{{SANDBOX_ADMIN_API_KEY}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/v1/admin/keyhive/teams",
                "description": "Older path for create-team. Prefer credential-plane.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"namespace\": \"{{new_tenant_id}}:{{new_project_id}}\",\n  \"keys\": {}\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"SANDBOX_ADMIN_API_KEY\")) {",
                      "  console.log(\"Skipping: SANDBOX_ADMIN_API_KEY is not set. These routes are for platform operators; consumers do not need them.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /sandbox/v1/admin/keyhive/keys (legacy alias)",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Admin-Key",
                    "value": "{{SANDBOX_ADMIN_API_KEY}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/v1/admin/keyhive/keys",
                "description": "Older path for add-key. Prefer credential-plane.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"namespace\": \"{{new_tenant_id}}:{{new_project_id}}\",\n  \"provider\": \"{{provider}}\",\n  \"key\": \"{{provider_api_key}}\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"SANDBOX_ADMIN_API_KEY\")) {",
                      "  console.log(\"Skipping: SANDBOX_ADMIN_API_KEY is not set. These routes are for platform operators; consumers do not need them.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            }
          ]
        },
        {
          "name": "Onboard tenant",
          "description": "Ordered walkthrough to onboard a **new** `tenant:project` on a hosted gateway (sandbox-dev / prod). KeyHive stays inside the cluster \u2014 these calls go through `/sandbox/v1/admin/credential-plane/*`.\n\n**Before you run:** set `SANDBOX_API_KEY`, `SANDBOX_ADMIN_API_KEY`, `new_tenant_id`, `new_project_id`, `provider` (e.g. `wandb`), and `provider_api_key`.\n\nFor an **existing** project (e.g. `meta` / `multi-agent-swarm`), set `new_tenant_id` / `new_project_id` to that pair \u2014 do not leave them as `acme` / `proj-postman` while querying a different tenancy.\n\nSend top \u2192 bottom. Steps 1 and 3 also copy `new_tenant_id` / `new_project_id` into `tenant_id` / `project_id` / `namespace` so QUICKSTART and `GET /providers` stamp the same headers as the pool you just wrote. Step 6 remains as an explicit activate.",
          "item": [
            {
              "name": "1. Create team for new_tenant:new_project",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Admin-Key",
                    "value": "{{SANDBOX_ADMIN_API_KEY}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/v1/admin/credential-plane/teams",
                "description": "Creates (or ensures) KeyHive team `{{new_tenant_id}}:{{new_project_id}}`. Body namespace only \u2014 tenancy headers are irrelevant here. On success, activates that tenancy in the environment.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"namespace\": \"{{new_tenant_id}}:{{new_project_id}}\",\n  \"keys\": {}\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"SANDBOX_ADMIN_API_KEY\")) {",
                      "  console.log(\"Skipping: SANDBOX_ADMIN_API_KEY is not set. These routes are for platform operators; consumers do not need them.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if ([200,201].includes(pm.response.code)) {",
                      "  const j = pm.response.json();",
                      "  const ns = j.namespace || (",
                      "    (pm.environment.get(\"new_tenant_id\") || \"\") + \":\" +",
                      "    (pm.environment.get(\"new_project_id\") || \"\")",
                      "  );",
                      "  if (j.token) {",
                      "    pm.collectionVariables.set(\"KEYHIVE_TEAM_TOKEN\", j.token);",
                      "    pm.environment.set(\"KEYHIVE_TEAM_TOKEN\", j.token);",
                      "  }",
                      "  if (ns) {",
                      "    pm.collectionVariables.set(\"namespace\", ns);",
                      "    pm.environment.set(\"namespace\", ns);",
                      "  }",
                      "  pm.test(\"team namespace returned or accepted\", function () {",
                      "    pm.expect(pm.response.code).to.be.oneOf([200, 201]);",
                      "  });",
                      "}",
                      "const t = (pm.environment.get(\"new_tenant_id\") || pm.variables.get(\"new_tenant_id\") || \"\").trim();",
                      "const p = (pm.environment.get(\"new_project_id\") || pm.variables.get(\"new_project_id\") || \"\").trim();",
                      "if (!t || !p) {",
                      "  console.log(\"Skipping activate: set new_tenant_id and new_project_id first.\");",
                      "} else {",
                      "  const ns = t + \":\" + p;",
                      "  pm.environment.set(\"tenant_id\", t);",
                      "  pm.environment.set(\"project_id\", p);",
                      "  pm.environment.set(\"namespace\", ns);",
                      "  pm.collectionVariables.set(\"tenant_id\", t);",
                      "  pm.collectionVariables.set(\"project_id\", p);",
                      "  pm.collectionVariables.set(\"namespace\", ns);",
                      "  console.log(\"Activated tenancy \" + ns + \" for subsequent requests.\");",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "2. Set concurrency quota for the new project",
              "request": {
                "method": "PUT",
                "header": [
                  {
                    "key": "X-Sandbox-Admin-Key",
                    "value": "{{SANDBOX_ADMIN_API_KEY}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/v1/admin/quotas/{{new_tenant_id}}/{{new_project_id}}",
                "description": "Path-scoped quota for the new tenant/project. Adjust `max_concurrent` as needed.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"max_concurrent\": 4\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"SANDBOX_ADMIN_API_KEY\")) {",
                      "  console.log(\"Skipping: SANDBOX_ADMIN_API_KEY is not set. These routes are for platform operators; consumers do not need them.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "3. Add provider key (anthropic / openai / wandb / \u2026)",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Admin-Key",
                    "value": "{{SANDBOX_ADMIN_API_KEY}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/v1/admin/credential-plane/keys",
                "description": "Append BYOK for `provider` into `new_tenant_id:new_project_id`. For W&B Inference use `provider=wandb` and a W&B service account key; model ids are `wandb/<model-id>` (e.g. `wandb/moonshotai/Kimi-K2.5`). On success, activates that tenancy so later `GET /providers` / Harbor / Agent use the same project.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"namespace\": \"{{new_tenant_id}}:{{new_project_id}}\",\n  \"provider\": \"{{provider}}\",\n  \"key\": \"{{provider_api_key}}\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"SANDBOX_ADMIN_API_KEY\")) {",
                      "  console.log(\"Skipping: SANDBOX_ADMIN_API_KEY is not set. These routes are for platform operators; consumers do not need them.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if ([200,201].includes(pm.response.code)) {",
                      "  const j = pm.response.json();",
                      "  if (j.key_id) {",
                      "    pm.collectionVariables.set(\"key_id\", j.key_id);",
                      "    pm.environment.set(\"key_id\", j.key_id);",
                      "  }",
                      "  pm.test(\"provider key accepted\", function () {",
                      "    pm.expect(pm.response.code).to.be.oneOf([200, 201]);",
                      "  });",
                      "}",
                      "const t = (pm.environment.get(\"new_tenant_id\") || pm.variables.get(\"new_tenant_id\") || \"\").trim();",
                      "const p = (pm.environment.get(\"new_project_id\") || pm.variables.get(\"new_project_id\") || \"\").trim();",
                      "if (!t || !p) {",
                      "  console.log(\"Skipping activate: set new_tenant_id and new_project_id first.\");",
                      "} else {",
                      "  const ns = t + \":\" + p;",
                      "  pm.environment.set(\"tenant_id\", t);",
                      "  pm.environment.set(\"project_id\", p);",
                      "  pm.environment.set(\"namespace\", ns);",
                      "  pm.collectionVariables.set(\"tenant_id\", t);",
                      "  pm.collectionVariables.set(\"project_id\", p);",
                      "  pm.collectionVariables.set(\"namespace\", ns);",
                      "  console.log(\"Activated tenancy \" + ns + \" for subsequent requests.\");",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "4. List key ids for the new namespace",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Admin-Key",
                    "value": "{{SANDBOX_ADMIN_API_KEY}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/v1/admin/credential-plane/keys?namespace={{new_tenant_id}}:{{new_project_id}}",
                "description": "Confirms pool rows exist (ids/labels only)."
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"SANDBOX_ADMIN_API_KEY\")) {",
                      "  console.log(\"Skipping: SANDBOX_ADMIN_API_KEY is not set. These routes are for platform operators; consumers do not need them.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (pm.response.code === 200) {",
                      "  const j = pm.response.json();",
                      "  const items = j.items || j.keys || (Array.isArray(j) ? j : []);",
                      "  pm.test(\"at least one key id listed\", function () {",
                      "    pm.expect(items.length).to.be.above(0);",
                      "  });",
                      "  const first = items[0];",
                      "  const id = first && (first.key_id || first.id);",
                      "  if (id) {",
                      "    pm.collectionVariables.set(\"key_id\", id);",
                      "    pm.environment.set(\"key_id\", id);",
                      "  }",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "5. GET /providers as the new tenant (headers override)",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{new_tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{new_project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/v1/providers",
                "description": "Consumer inventory for the **new** tenancy. Explicit headers override the collection stamp. Expect `provider` with `source=tenant` only \u2014 provision keys under `new_tenant_id:new_project_id` or they will not appear."
              },
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"provider inventory returned\", function () {",
                      "  pm.response.to.have.status(200);",
                      "  const body = pm.response.json();",
                      "  const items = Array.isArray(body) ? body : (body.items || body.providers || []);",
                      "  pm.expect(Array.isArray(items)).to.be.true;",
                      "  const tenant = (pm.variables.get(\"tenant_id\") || \"\").trim();",
                      "  const project = (pm.variables.get(\"project_id\") || \"\").trim();",
                      "  console.log(\"scoped to \" + (tenant || \"?\") + \":\" + (project || \"?\"));",
                      "  const lines = items.map((item) => {",
                      "    if (typeof item === \"string\") return item;",
                      "    return (item.provider || \"?\") + \" (\" + (item.source || \"unknown\") + \")\";",
                      "  });",
                      "  console.log(\"providers:\", lines.join(\", \") || \"(none)\");",
                      "  const want = (pm.variables.get(\"provider\") || \"\").trim();",
                      "  if (want) {",
                      "    const row = items.find((item) => (item.provider || item) === want);",
                      "    pm.test(\"selected provider=\" + want + \" is listed\", function () {",
                      "      pm.expect(row, want + \" missing \u2014 provision it for tenant_id:project_id\").to.exist;",
                      "    });",
                      "    if (row && row.source) {",
                      "      pm.test(\"selected provider=\" + want + \" is leased from tenant\", function () {",
                      "        pm.expect(row.source).to.eql(\"tenant\");",
                      "      });",
                      "    }",
                      "  }",
                      "  pm.collectionVariables.set(",
                      "    \"wandb_available\",",
                      "    String(items.some((item) => (item.provider || item) === \"wandb\"))",
                      "  );",
                      "});"
                    ]
                  }
                }
              ]
            },
            {
              "name": "6. Activate new tenancy in this environment",
              "request": {
                "method": "GET",
                "header": [],
                "url": "{{baseUrl}}/healthz",
                "description": "Copies `new_tenant_id` / `new_project_id` into `tenant_id` / `project_id` / `namespace` so Harbor, Agent, and `GET /providers` use the new project. (Also runs automatically after steps 1 and 3.) Hits `/healthz` only as a harmless send target.",
                "auth": {
                  "type": "noauth"
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "const t = (pm.environment.get(\"new_tenant_id\") || pm.variables.get(\"new_tenant_id\") || \"\").trim();",
                      "const p = (pm.environment.get(\"new_project_id\") || pm.variables.get(\"new_project_id\") || \"\").trim();",
                      "if (!t || !p) {",
                      "  console.log(\"Skipping activate: set new_tenant_id and new_project_id first.\");",
                      "} else {",
                      "  const ns = t + \":\" + p;",
                      "  pm.environment.set(\"tenant_id\", t);",
                      "  pm.environment.set(\"project_id\", p);",
                      "  pm.environment.set(\"namespace\", ns);",
                      "  pm.collectionVariables.set(\"tenant_id\", t);",
                      "  pm.collectionVariables.set(\"project_id\", p);",
                      "  pm.collectionVariables.set(\"namespace\", ns);",
                      "  console.log(\"Activated tenancy \" + ns + \" for subsequent requests.\");",
                      "}",
                      "const t = (pm.environment.get(\"new_tenant_id\") || \"\").trim();",
                      "const p = (pm.environment.get(\"new_project_id\") || \"\").trim();",
                      "if (!t || !p) {",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"environment now points at new_tenant:new_project\", function () {",
                      "  const t = pm.environment.get(\"tenant_id\");",
                      "  const p = pm.environment.get(\"project_id\");",
                      "  const nt = pm.environment.get(\"new_tenant_id\");",
                      "  const np = pm.environment.get(\"new_project_id\");",
                      "  pm.expect(t).to.eql(nt);",
                      "  pm.expect(p).to.eql(np);",
                      "});"
                    ]
                  }
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name": "Harbor",
      "description": "All Harbor API variants. Prefer **v2**. Set `task_archive_url` before datapoint / execute-tasks.",
      "item": [
        {
          "name": "Ops (capabilities / health)",
          "item": [
            {
              "name": "GET /capabilities",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/capabilities",
                "description": ""
              }
            },
            {
              "name": "GET /api-versions",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/api-versions",
                "description": ""
              }
            },
            {
              "name": "GET /healthz",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/healthz",
                "description": ""
              }
            },
            {
              "name": "GET /docs",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/docs",
                "description": ""
              }
            },
            {
              "name": "GET /openapi.json",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/openapi.json",
                "description": ""
              }
            }
          ]
        },
        {
          "name": "v2 (preferred)",
          "description": "The datapoint, verify-task, and job API under `/v2`. Every request sends `X-Sandbox-Tenant-Id` / `X-Sandbox-Project-Id` (from `tenant_id` / `project_id`). Start a run with one of the first four requests; the rest read the job id it saves, and skip until then.",
          "item": [
            {
              "name": "GET /v2/capabilities",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v2/capabilities",
                "description": "Versioned capabilities (not on unversioned alias)."
              }
            },
            {
              "name": "POST /v2/run/datapoint",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v2/run/datapoint",
                "description": "Runs a datapoint and holds the connection open until it finishes. 400 if the archive is not a zip, 504 if the run outlives the wait (the job keeps going \u2014 follow it with the job id in the response headers).",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"task_slug\": \"postman-sync\",\n  \"agents\": [\n    {\n      \"name\": \"oracle-run\",\n      \"harbor_agent\": \"oracle\",\n      \"pass_at_k\": 1,\n      \"harbor_extensions\": {\n        \"agent_env\": {\n          \"FOO\": \"bar\"\n        }\n      }\n    }\n  ],\n  \"metadata\": {\n    \"task_archive_url\": \"{{task_archive_url}}\"\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"task_archive_url\")) {",
                      "  console.log(\"Skipping: task_archive_url is not set. Set it to an HTTPS zip of your task directory that the cluster can reach (a presigned URL, not a path on your laptop).\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "const code = pm.response.code;",
                      "if (code === 200 || code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.job_id) pm.collectionVariables.set(\"job_id\", j.job_id);",
                      "  } catch (e) {}",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /v2/jobs/execute-tasks",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "postman-v2 (preferred)-{{$guid}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v2/jobs/execute-tasks",
                "description": "Queues the same work and returns a job id immediately. Prefer this over the synchronous route for anything that takes minutes.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"task_slug\": \"postman-hello\",\n  \"agents\": [\n    {\n      \"name\": \"oracle-run\",\n      \"harbor_agent\": \"oracle\",\n      \"pass_at_k\": 1\n    }\n  ],\n  \"metadata\": {\n    \"task_archive_url\": \"{{task_archive_url}}\"\n  },\n  \"artifacts\": []\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"task_archive_url\")) {",
                      "  console.log(\"Skipping: task_archive_url is not set. Set it to an HTTPS zip of your task directory that the cluster can reach (a presigned URL, not a path on your laptop).\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "const code = pm.response.code;",
                      "if (code === 200 || code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.job_id) pm.collectionVariables.set(\"job_id\", j.job_id);",
                      "  } catch (e) {}",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /v2/verify-task",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v2/verify-task",
                "description": "Verifier-only task authoring: runs tests/test.sh with visible_seed/ and optional workspace_fixture_url. Holds the connection until finished.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"task_slug\": \"postman-verify\",\n  \"metadata\": {\n    \"task_archive_url\": \"{{task_archive_url}}\"\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"task_archive_url\")) {",
                      "  console.log(\"Skipping: task_archive_url is not set. Set it to an HTTPS zip of your task directory that the cluster can reach (a presigned URL, not a path on your laptop).\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "const code = pm.response.code;",
                      "if (code === 200 || code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.job_id) pm.collectionVariables.set(\"job_id\", j.job_id);",
                      "  } catch (e) {}",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /v2/jobs/verify-task",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "postman-verify-v2 (preferred)-{{$guid}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v2/jobs/verify-task",
                "description": "Async verify-task: queues verifier-only validation and returns job_id. Set workspace_fixture_url to an HTTPS zip merged into /workspace.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"task_slug\": \"postman-verify-fixture\",\n  \"metadata\": {\n    \"task_archive_url\": \"{{task_archive_url}}\"\n  },\n  \"workspace_fixture_url\": \"{{workspace_fixture_url}}\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"task_archive_url\")) {",
                      "  console.log(\"Skipping: task_archive_url is not set. Set it to an HTTPS zip of your task directory that the cluster can reach (a presigned URL, not a path on your laptop).\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "const code = pm.response.code;",
                      "if (code === 200 || code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.job_id) pm.collectionVariables.set(\"job_id\", j.job_id);",
                      "  } catch (e) {}",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "GET /v2/jobs/{{job_id}}",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v2/jobs/{{job_id}}",
                "description": "Status, timings and result for one job. Requires the same tenant/project headers as submit (shown in Headers). On datapoint jobs, `result.outcome.trials_detail` lists each pass@k attempt (`completed` vs `errored`). Wrong answers stay `completed` with reward 0.0 \u2014 only `errored` rows are refill candidates."
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /v2/jobs/{{job_id}}/cancel",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v2/jobs/{{job_id}}/cancel",
                "description": "",
                "body": {
                  "mode": "raw",
                  "raw": "{}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /v2/jobs/{{job_id}}/retry-errored-trials",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "postman-retry-v2 (preferred)-{{$guid}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v2/jobs/{{job_id}}/retry-errored-trials",
                "description": "Batch-refill incomplete pass@k attempts: enqueues a **new** job with `pass_at_k = N_errored` and `metadata.retry_of` set to this job. Does **not** re-run completed trials (including reward 0.0). Parent archive stays immutable; combine scores client-side. Default clears notifications/deliver/writeback (`?include_side_effects=true` to keep them). Send Idempotency-Key to avoid duplicate children on retry. v1: single-agent datapoints only. 400 if nothing errored or the parent has no request snapshot.",
                "body": {
                  "mode": "raw",
                  "raw": "{}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "const code = pm.response.code;",
                      "if (code === 200 || code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.job_id) pm.collectionVariables.set(\"retry_job_id\", j.job_id);",
                      "  } catch (e) {}",
                      "}",
                      "if (pm.response.code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.retry_of) console.log(\"retry_of=\" + j.retry_of + \" pass_at_k=\" + j.pass_at_k);",
                      "  } catch (e) {}",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /v2/jobs/{{job_id}}/retry-provider-blocked",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "postman-provider-retry-v2 (preferred)-{{$guid}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v2/jobs/{{job_id}}/retry-provider-blocked",
                "description": "Full pass@k retry after provider quota/auth blocked the parent (`result.outcome.failure_class=provider`). Unlike `retry-errored-trials`, re-runs the original k budget with a fresh KeyHive lease. Sets `metadata.retry_of` / `retry_kind=provider_blocked`. Send Idempotency-Key to avoid duplicate children. v1: single-agent datapoints only.",
                "body": {
                  "mode": "raw",
                  "raw": "{}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "const code = pm.response.code;",
                      "if (code === 200 || code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.job_id) pm.collectionVariables.set(\"provider_retry_job_id\", j.job_id);",
                      "  } catch (e) {}",
                      "}",
                      "if (pm.response.code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.retry_of) console.log(\"retry_of=\" + j.retry_of + \" pass_at_k=\" + j.pass_at_k + \" kind=\" + j.retry_kind);",
                      "  } catch (e) {}",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "GET /v2/jobs/{{job_id}}/events (SSE)",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Accept",
                    "value": "text/event-stream"
                  },
                  {
                    "key": "Last-Event-ID",
                    "value": "0"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v2/jobs/{{job_id}}/events",
                "description": "SSE phase stream until the job finishes. In Postman use **Send and Download** (plain Send often looks hung). Requires the same tenant/project as submit. `Last-Event-ID=0` replays from the start."
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "GET /v2/jobs/{{job_id}}/artifacts",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v2/jobs/{{job_id}}/artifacts",
                "description": ""
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "GET /v2/jobs/{{job_id}}/artifacts/archive",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v2/jobs/{{job_id}}/artifacts/archive",
                "description": "ZIP download when archive exists (404 otherwise)."
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "GET /v2/jobs/{{job_id}}/artifacts/archive?presigned=1",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v2/jobs/{{job_id}}/artifacts/archive?presigned=1",
                "description": "302 redirect to presigned GET URL when archive exists."
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "GET /v2/jobs/{{job_id}}/artifacts/test-stdout/{path}",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v2/jobs/{{job_id}}/artifacts/test-stdout/{{test_stdout_path}}",
                "description": "Verifier stdout object; set collection var test_stdout_path."
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            }
          ]
        },
        {
          "name": "v2 deliver",
          "item": [
            {
              "name": "POST /v2/jobs/execute-tasks + deliver",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "postman-v2-deliver-{{$guid}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v2/jobs/execute-tasks",
                "description": "v2 customer delivery: the run's zip is PUT to `deliver.agent_run_zip.url` when it finishes. Set `deliver_url` to a presigned PUT URL you control.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"task_slug\": \"postman-v2-deliver\",\n  \"agents\": [\n    {\n      \"name\": \"oracle-run\",\n      \"harbor_agent\": \"oracle\",\n      \"pass_at_k\": 1\n    }\n  ],\n  \"metadata\": {\n    \"task_archive_url\": \"{{task_archive_url}}\"\n  },\n  \"deliver\": {\n    \"agent_run_zip\": {\n      \"url\": \"{{deliver_url}}\",\n      \"method\": \"PUT\"\n    }\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"deliver_url\")) {",
                      "  console.log(\"Skipping: deliver_url is not set. Set it to a presigned PUT URL you own, plus task_archive_url. The worker really uploads the run zip there.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "const code = pm.response.code;",
                      "if (code === 200 || code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.job_id) pm.collectionVariables.set(\"job_id\", j.job_id);",
                      "  } catch (e) {}",
                      "}"
                    ]
                  }
                }
              ]
            }
          ]
        },
        {
          "name": "v1",
          "description": "The datapoint, verify-task, and job API under `/v1`. Every request sends `X-Sandbox-Tenant-Id` / `X-Sandbox-Project-Id` (from `tenant_id` / `project_id`). Start a run with one of the first four requests; the rest read the job id it saves, and skip until then.",
          "item": [
            {
              "name": "GET /v1/capabilities",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v1/capabilities",
                "description": "Versioned capabilities (not on unversioned alias)."
              }
            },
            {
              "name": "POST /v1/run/datapoint",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v1/run/datapoint",
                "description": "Runs a datapoint and holds the connection open until it finishes. 400 if the archive is not a zip, 504 if the run outlives the wait (the job keeps going \u2014 follow it with the job id in the response headers).",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"task_slug\": \"postman-sync\",\n  \"agents\": [\n    {\n      \"name\": \"oracle-run\",\n      \"harbor_agent\": \"oracle\",\n      \"pass_at_k\": 1,\n      \"harbor_extensions\": {\n        \"agent_env\": {\n          \"FOO\": \"bar\"\n        }\n      }\n    }\n  ],\n  \"metadata\": {\n    \"task_archive_url\": \"{{task_archive_url}}\"\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"task_archive_url\")) {",
                      "  console.log(\"Skipping: task_archive_url is not set. Set it to an HTTPS zip of your task directory that the cluster can reach (a presigned URL, not a path on your laptop).\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "const code = pm.response.code;",
                      "if (code === 200 || code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.job_id) pm.collectionVariables.set(\"job_id\", j.job_id);",
                      "  } catch (e) {}",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /v1/jobs/execute-tasks",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "postman-v1 (TB compat)-{{$guid}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v1/jobs/execute-tasks",
                "description": "Queues the same work and returns a job id immediately. Prefer this over the synchronous route for anything that takes minutes.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"task_slug\": \"postman-hello\",\n  \"agents\": [\n    {\n      \"name\": \"oracle-run\",\n      \"harbor_agent\": \"oracle\",\n      \"pass_at_k\": 1\n    }\n  ],\n  \"metadata\": {\n    \"task_archive_url\": \"{{task_archive_url}}\"\n  },\n  \"artifacts\": []\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"task_archive_url\")) {",
                      "  console.log(\"Skipping: task_archive_url is not set. Set it to an HTTPS zip of your task directory that the cluster can reach (a presigned URL, not a path on your laptop).\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "const code = pm.response.code;",
                      "if (code === 200 || code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.job_id) pm.collectionVariables.set(\"job_id\", j.job_id);",
                      "  } catch (e) {}",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /v1/verify-task",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v1/verify-task",
                "description": "Verifier-only task authoring: runs tests/test.sh with visible_seed/ and optional workspace_fixture_url. Holds the connection until finished.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"task_slug\": \"postman-verify\",\n  \"metadata\": {\n    \"task_archive_url\": \"{{task_archive_url}}\"\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"task_archive_url\")) {",
                      "  console.log(\"Skipping: task_archive_url is not set. Set it to an HTTPS zip of your task directory that the cluster can reach (a presigned URL, not a path on your laptop).\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "const code = pm.response.code;",
                      "if (code === 200 || code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.job_id) pm.collectionVariables.set(\"job_id\", j.job_id);",
                      "  } catch (e) {}",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /v1/jobs/verify-task",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "postman-verify-v1 (TB compat)-{{$guid}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v1/jobs/verify-task",
                "description": "Async verify-task: queues verifier-only validation and returns job_id. Set workspace_fixture_url to an HTTPS zip merged into /workspace.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"task_slug\": \"postman-verify-fixture\",\n  \"metadata\": {\n    \"task_archive_url\": \"{{task_archive_url}}\"\n  },\n  \"workspace_fixture_url\": \"{{workspace_fixture_url}}\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"task_archive_url\")) {",
                      "  console.log(\"Skipping: task_archive_url is not set. Set it to an HTTPS zip of your task directory that the cluster can reach (a presigned URL, not a path on your laptop).\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "const code = pm.response.code;",
                      "if (code === 200 || code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.job_id) pm.collectionVariables.set(\"job_id\", j.job_id);",
                      "  } catch (e) {}",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "GET /v1/jobs/{{job_id}}",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v1/jobs/{{job_id}}",
                "description": "Status, timings and result for one job. Requires the same tenant/project headers as submit (shown in Headers). On datapoint jobs, `result.outcome.trials_detail` lists each pass@k attempt (`completed` vs `errored`). Wrong answers stay `completed` with reward 0.0 \u2014 only `errored` rows are refill candidates."
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /v1/jobs/{{job_id}}/cancel",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v1/jobs/{{job_id}}/cancel",
                "description": "",
                "body": {
                  "mode": "raw",
                  "raw": "{}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /v1/jobs/{{job_id}}/retry-errored-trials",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "postman-retry-v1 (TB compat)-{{$guid}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v1/jobs/{{job_id}}/retry-errored-trials",
                "description": "Batch-refill incomplete pass@k attempts: enqueues a **new** job with `pass_at_k = N_errored` and `metadata.retry_of` set to this job. Does **not** re-run completed trials (including reward 0.0). Parent archive stays immutable; combine scores client-side. Default clears notifications/deliver/writeback (`?include_side_effects=true` to keep them). Send Idempotency-Key to avoid duplicate children on retry. v1: single-agent datapoints only. 400 if nothing errored or the parent has no request snapshot.",
                "body": {
                  "mode": "raw",
                  "raw": "{}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "const code = pm.response.code;",
                      "if (code === 200 || code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.job_id) pm.collectionVariables.set(\"retry_job_id\", j.job_id);",
                      "  } catch (e) {}",
                      "}",
                      "if (pm.response.code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.retry_of) console.log(\"retry_of=\" + j.retry_of + \" pass_at_k=\" + j.pass_at_k);",
                      "  } catch (e) {}",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /v1/jobs/{{job_id}}/retry-provider-blocked",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "postman-provider-retry-v1 (TB compat)-{{$guid}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v1/jobs/{{job_id}}/retry-provider-blocked",
                "description": "Full pass@k retry after provider quota/auth blocked the parent (`result.outcome.failure_class=provider`). Unlike `retry-errored-trials`, re-runs the original k budget with a fresh KeyHive lease. Sets `metadata.retry_of` / `retry_kind=provider_blocked`. Send Idempotency-Key to avoid duplicate children. v1: single-agent datapoints only.",
                "body": {
                  "mode": "raw",
                  "raw": "{}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "const code = pm.response.code;",
                      "if (code === 200 || code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.job_id) pm.collectionVariables.set(\"provider_retry_job_id\", j.job_id);",
                      "  } catch (e) {}",
                      "}",
                      "if (pm.response.code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.retry_of) console.log(\"retry_of=\" + j.retry_of + \" pass_at_k=\" + j.pass_at_k + \" kind=\" + j.retry_kind);",
                      "  } catch (e) {}",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "GET /v1/jobs/{{job_id}}/events (SSE)",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Accept",
                    "value": "text/event-stream"
                  },
                  {
                    "key": "Last-Event-ID",
                    "value": "0"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v1/jobs/{{job_id}}/events",
                "description": "SSE phase stream until the job finishes. In Postman use **Send and Download** (plain Send often looks hung). Requires the same tenant/project as submit. `Last-Event-ID=0` replays from the start."
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "GET /v1/jobs/{{job_id}}/artifacts",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v1/jobs/{{job_id}}/artifacts",
                "description": ""
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "GET /v1/jobs/{{job_id}}/artifacts/archive",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v1/jobs/{{job_id}}/artifacts/archive",
                "description": "ZIP download when archive exists (404 otherwise)."
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "GET /v1/jobs/{{job_id}}/artifacts/archive?presigned=1",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v1/jobs/{{job_id}}/artifacts/archive?presigned=1",
                "description": "302 redirect to presigned GET URL when archive exists."
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "GET /v1/jobs/{{job_id}}/artifacts/test-stdout/{path}",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v1/jobs/{{job_id}}/artifacts/test-stdout/{{test_stdout_path}}",
                "description": "Verifier stdout object; set collection var test_stdout_path."
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            }
          ]
        },
        {
          "name": "Unversioned (=v1)",
          "description": "The datapoint, verify-task, and job API under `/ (unversioned -> v1)`. Every request sends `X-Sandbox-Tenant-Id` / `X-Sandbox-Project-Id` (from `tenant_id` / `project_id`). Start a run with one of the first four requests; the rest read the job id it saves, and skip until then.",
          "item": [
            {
              "name": "POST /run/datapoint",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/run/datapoint",
                "description": "Runs a datapoint and holds the connection open until it finishes. 400 if the archive is not a zip, 504 if the run outlives the wait (the job keeps going \u2014 follow it with the job id in the response headers).",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"task_slug\": \"postman-sync\",\n  \"agents\": [\n    {\n      \"name\": \"oracle-run\",\n      \"harbor_agent\": \"oracle\",\n      \"pass_at_k\": 1,\n      \"harbor_extensions\": {\n        \"agent_env\": {\n          \"FOO\": \"bar\"\n        }\n      }\n    }\n  ],\n  \"metadata\": {\n    \"task_archive_url\": \"{{task_archive_url}}\"\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"task_archive_url\")) {",
                      "  console.log(\"Skipping: task_archive_url is not set. Set it to an HTTPS zip of your task directory that the cluster can reach (a presigned URL, not a path on your laptop).\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "const code = pm.response.code;",
                      "if (code === 200 || code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.job_id) pm.collectionVariables.set(\"job_id\", j.job_id);",
                      "  } catch (e) {}",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /jobs/execute-tasks",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "postman-unversioned (=v1)-{{$guid}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/jobs/execute-tasks",
                "description": "Queues the same work and returns a job id immediately. Prefer this over the synchronous route for anything that takes minutes.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"task_slug\": \"postman-hello\",\n  \"agents\": [\n    {\n      \"name\": \"oracle-run\",\n      \"harbor_agent\": \"oracle\",\n      \"pass_at_k\": 1\n    }\n  ],\n  \"metadata\": {\n    \"task_archive_url\": \"{{task_archive_url}}\"\n  },\n  \"artifacts\": []\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"task_archive_url\")) {",
                      "  console.log(\"Skipping: task_archive_url is not set. Set it to an HTTPS zip of your task directory that the cluster can reach (a presigned URL, not a path on your laptop).\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "const code = pm.response.code;",
                      "if (code === 200 || code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.job_id) pm.collectionVariables.set(\"job_id\", j.job_id);",
                      "  } catch (e) {}",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /verify-task",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/verify-task",
                "description": "Verifier-only task authoring: runs tests/test.sh with visible_seed/ and optional workspace_fixture_url. Holds the connection until finished.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"task_slug\": \"postman-verify\",\n  \"metadata\": {\n    \"task_archive_url\": \"{{task_archive_url}}\"\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"task_archive_url\")) {",
                      "  console.log(\"Skipping: task_archive_url is not set. Set it to an HTTPS zip of your task directory that the cluster can reach (a presigned URL, not a path on your laptop).\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "const code = pm.response.code;",
                      "if (code === 200 || code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.job_id) pm.collectionVariables.set(\"job_id\", j.job_id);",
                      "  } catch (e) {}",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /jobs/verify-task",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "postman-verify-unversioned (=v1)-{{$guid}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/jobs/verify-task",
                "description": "Async verify-task: queues verifier-only validation and returns job_id. Set workspace_fixture_url to an HTTPS zip merged into /workspace.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"task_slug\": \"postman-verify-fixture\",\n  \"metadata\": {\n    \"task_archive_url\": \"{{task_archive_url}}\"\n  },\n  \"workspace_fixture_url\": \"{{workspace_fixture_url}}\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"task_archive_url\")) {",
                      "  console.log(\"Skipping: task_archive_url is not set. Set it to an HTTPS zip of your task directory that the cluster can reach (a presigned URL, not a path on your laptop).\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "const code = pm.response.code;",
                      "if (code === 200 || code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.job_id) pm.collectionVariables.set(\"job_id\", j.job_id);",
                      "  } catch (e) {}",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "GET /jobs/{{job_id}}",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/jobs/{{job_id}}",
                "description": "Status, timings and result for one job. Requires the same tenant/project headers as submit (shown in Headers). On datapoint jobs, `result.outcome.trials_detail` lists each pass@k attempt (`completed` vs `errored`). Wrong answers stay `completed` with reward 0.0 \u2014 only `errored` rows are refill candidates."
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /jobs/{{job_id}}/cancel",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/jobs/{{job_id}}/cancel",
                "description": "",
                "body": {
                  "mode": "raw",
                  "raw": "{}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /jobs/{{job_id}}/retry-errored-trials",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "postman-retry-unversioned (=v1)-{{$guid}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/jobs/{{job_id}}/retry-errored-trials",
                "description": "Batch-refill incomplete pass@k attempts: enqueues a **new** job with `pass_at_k = N_errored` and `metadata.retry_of` set to this job. Does **not** re-run completed trials (including reward 0.0). Parent archive stays immutable; combine scores client-side. Default clears notifications/deliver/writeback (`?include_side_effects=true` to keep them). Send Idempotency-Key to avoid duplicate children on retry. v1: single-agent datapoints only. 400 if nothing errored or the parent has no request snapshot.",
                "body": {
                  "mode": "raw",
                  "raw": "{}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "const code = pm.response.code;",
                      "if (code === 200 || code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.job_id) pm.collectionVariables.set(\"retry_job_id\", j.job_id);",
                      "  } catch (e) {}",
                      "}",
                      "if (pm.response.code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.retry_of) console.log(\"retry_of=\" + j.retry_of + \" pass_at_k=\" + j.pass_at_k);",
                      "  } catch (e) {}",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /jobs/{{job_id}}/retry-provider-blocked",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Idempotency-Key",
                    "value": "postman-provider-retry-unversioned (=v1)-{{$guid}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/jobs/{{job_id}}/retry-provider-blocked",
                "description": "Full pass@k retry after provider quota/auth blocked the parent (`result.outcome.failure_class=provider`). Unlike `retry-errored-trials`, re-runs the original k budget with a fresh KeyHive lease. Sets `metadata.retry_of` / `retry_kind=provider_blocked`. Send Idempotency-Key to avoid duplicate children. v1: single-agent datapoints only.",
                "body": {
                  "mode": "raw",
                  "raw": "{}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "const code = pm.response.code;",
                      "if (code === 200 || code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.job_id) pm.collectionVariables.set(\"provider_retry_job_id\", j.job_id);",
                      "  } catch (e) {}",
                      "}",
                      "if (pm.response.code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.retry_of) console.log(\"retry_of=\" + j.retry_of + \" pass_at_k=\" + j.pass_at_k + \" kind=\" + j.retry_kind);",
                      "  } catch (e) {}",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "GET /jobs/{{job_id}}/events (SSE)",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Accept",
                    "value": "text/event-stream"
                  },
                  {
                    "key": "Last-Event-ID",
                    "value": "0"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/jobs/{{job_id}}/events",
                "description": "SSE phase stream until the job finishes. In Postman use **Send and Download** (plain Send often looks hung). Requires the same tenant/project as submit. `Last-Event-ID=0` replays from the start."
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "GET /jobs/{{job_id}}/artifacts",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/jobs/{{job_id}}/artifacts",
                "description": ""
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "GET /jobs/{{job_id}}/artifacts/archive",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/jobs/{{job_id}}/artifacts/archive",
                "description": "ZIP download when archive exists (404 otherwise)."
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "GET /jobs/{{job_id}}/artifacts/archive?presigned=1",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/jobs/{{job_id}}/artifacts/archive?presigned=1",
                "description": "302 redirect to presigned GET URL when archive exists."
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "GET /jobs/{{job_id}}/artifacts/test-stdout/{path}",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/jobs/{{job_id}}/artifacts/test-stdout/{{test_stdout_path}}",
                "description": "Verifier stdout object; set collection var test_stdout_path."
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"job_id\")) {",
                      "  console.log(\"Skipping: job_id is not set. Run a datapoint, execute-tasks, or verify-task request above first; it saves the id.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "name": "SSE",
      "description": "Live Harbor + Agent event streams. Use **Send and Download**. Set job_id / agent_run_job_id and tenant_id / project_id first.",
      "item": [
        {
          "name": "1. Harbor v2 \u2014 GET /jobs/{{job_id}}/events",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              },
              {
                "key": "Accept",
                "value": "text/event-stream"
              },
              {
                "key": "Last-Event-ID",
                "value": "0"
              }
            ],
            "url": "{{baseUrl}}/sandbox/harbor/v2/jobs/{{job_id}}/events",
            "description": "Live Harbor job phases (credentials, materialize, agent, artifacts) then `done`. Use **Send and Download**. Same tenant/project as submit or you get 404."
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"job_id\")) {",
                  "  console.log(\"Skipping: job_id is not set. Set job_id (or run Harbor \u2192 v2 \u2192 execute-tasks first).\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "2. Harbor v2 \u2014 resume SSE (Last-Event-ID)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              },
              {
                "key": "Accept",
                "value": "text/event-stream"
              },
              {
                "key": "Last-Event-ID",
                "value": "{{last_event_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/harbor/v2/jobs/{{job_id}}/events",
            "description": "Resume a Harbor SSE stream after disconnect. Set `last_event_id` to the last event `id:` you received (not 0)."
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"job_id\")) {",
                  "  console.log(\"Skipping: job_id is not set. Set job_id and last_event_id (from a prior stream id: line).\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "3. Agent \u2014 GET /v1/runs/{{agent_run_job_id}}/events",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              },
              {
                "key": "Accept",
                "value": "text/event-stream"
              },
              {
                "key": "Last-Event-ID",
                "value": "0"
              }
            ],
            "url": "{{baseUrl}}/sandbox/agent/v1/runs/{{agent_run_job_id}}/events",
            "description": "Live Agent Runtime phases until `done`. Use **Send and Download**."
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"agent_run_job_id\")) {",
                  "  console.log(\"Skipping: agent_run_job_id is not set. Set agent_run_job_id (or run Agent \u2192 POST /v1/runs first).\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "4. Agent \u2014 resume SSE (Last-Event-ID)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              },
              {
                "key": "Accept",
                "value": "text/event-stream"
              },
              {
                "key": "Last-Event-ID",
                "value": "{{last_event_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/agent/v1/runs/{{agent_run_job_id}}/events",
            "description": "Resume an Agent SSE stream. Set `last_event_id` from the last `id:` line of a prior stream."
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"agent_run_job_id\")) {",
                  "  console.log(\"Skipping: agent_run_job_id is not set. Set agent_run_job_id and last_event_id.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Agent",
      "item": [
        {
          "name": "GET /capabilities",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/agent/capabilities",
            "description": ""
          }
        },
        {
          "name": "GET /v1/agents (catalog \u222a Harbor factory)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/agent/v1/agents",
            "description": "Tier 1 curated agents merged with Harbor AgentFactory; each item has `source`."
          }
        },
        {
          "name": "GET /agents/{{agent_id}}",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/agent/agents/{{agent_id}}",
            "description": ""
          }
        },
        {
          "name": "POST /agents",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/sandbox/agent/agents",
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"id\": \"postman-custom-agent\",\n  \"display_name\": \"Postman Custom\",\n  \"requires_model\": true,\n  \"mcp_adapter\": null,\n  \"air_gap_capable\": false\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code === 201) {",
                  "  const j = pm.response.json();",
                  "  if (j.id) pm.collectionVariables.set(\"agent_id\", j.id);",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "GET /agents/postman-custom-agent",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/agent/agents/postman-custom-agent",
            "description": ""
          }
        },
        {
          "name": "GET /healthz (proxied agent)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/agent/healthz",
            "description": "Agent service health via gateway proxy strip."
          }
        },
        {
          "name": "GET /docs (proxied agent OpenAPI UI)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/agent/docs",
            "description": ""
          }
        },
        {
          "name": "GET /openapi.json (proxied agent)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/agent/openapi.json",
            "description": ""
          }
        },
        {
          "name": "POST /v1/runs (Agent Runtime)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/sandbox/agent/v1/runs",
            "description": "Enqueue an agent run. The 202 carries `status_url` and `events_url`; the job id is saved to `agent_run_job_id`, so the next two requests work without copying anything.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"agent_id\": \"{{agent_id}}\",\n  \"instruction\": \"Postman smoke \\u2014 fix the noop task.\",\n  \"model\": \"{{model}}\",\n  \"workspace\": {\n    \"files\": {\n      \"notes.txt\": \"hello from postman\"\n    }\n  },\n  \"harbor_extensions\": {\n    \"agent_env\": {\n      \"POSTMAN\": \"1\"\n    }\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const code = pm.response.code;",
                  "if (code === 200 || code === 202) {",
                  "  try {",
                  "    const j = pm.response.json();",
                  "    if (j.job_id) pm.collectionVariables.set(\"agent_run_job_id\", j.job_id);",
                  "  } catch (e) {}",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "GET /v1/runs/{{agent_run_job_id}} (status)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/agent/v1/runs/{{agent_run_job_id}}",
            "description": "Point-in-time status, timings and result for the run enqueued above. Answers 404 for a run that does not exist in your tenancy \u2014 send the same tenant/project headers."
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"agent_run_job_id\")) {",
                  "  console.log(\"Skipping: agent_run_job_id is not set. Send POST /v1/runs first; it saves the id.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "GET /v1/runs/{{agent_run_job_id}}/events (SSE)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              },
              {
                "key": "Accept",
                "value": "text/event-stream"
              }
            ],
            "url": "{{baseUrl}}/sandbox/agent/v1/runs/{{agent_run_job_id}}/events",
            "description": "Follow the run as it happens: one frame per phase (credentials, materialize, agent, artifacts), then `done`. The connection stays open until the run finishes, which for a real agent is minutes \u2014 that is the point, but it means this request blocks a collection run, so stop it when you have seen enough. Send `Last-Event-ID` to resume after a dropped connection instead of replaying from the start."
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"agent_run_job_id\")) {",
                  "  console.log(\"Skipping: agent_run_job_id is not set. Send POST /v1/runs first; it saves the id.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Options & edge cases",
          "description": "Tier 1 catalog vs Tier 2 Harbor breadth (warn locally) and the bounded options passthrough \u2014 agent_options on the agentic surface, harbor_extensions on the datapoint one. Agent Runtime stays catalog-strict.",
          "item": [
            {
              "name": "GET /sandbox/agent/v1/agents (tier union)",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/agent/v1/agents",
                "description": "Each item includes source: catalog | harbor_factory."
              },
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"agent registry\", function () {",
                      "  pm.response.to.have.status(200);",
                      "  const j = pm.response.json();",
                      "  pm.expect(j.items).to.be.an(\"array\");",
                      "  pm.expect(j.count).to.be.at.least(4);",
                      "});"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /agent/v1/runs \u2014 agent_options",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/agent/v1/runs",
                "description": "",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"agent_id\": \"{{agent_id}}\",\n  \"instruction\": \"Local smoke with agent_options\",\n  \"model\": \"{{model}}\",\n  \"agent_options\": {\n    \"agent_env\": {\n      \"POSTMAN\": \"1\"\n    },\n    \"n_concurrent\": 1\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "const code = pm.response.code;",
                      "if (code === 200 || code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.job_id) pm.collectionVariables.set(\"agent_run_job_id\", j.job_id);",
                      "  } catch (e) {}",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /harbor/v2/run/datapoint \u2014 harbor_extensions",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/harbor/v2/run/datapoint",
                "description": "Harbor datapoint accepts non-catalog agents when SANDBOX_CATALOG_ENFORCE_AGENTS=warn (local default).",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"task_slug\": \"postman-sync\",\n  \"agents\": [\n    {\n      \"name\": \"oracle-run\",\n      \"harbor_agent\": \"oracle\",\n      \"pass_at_k\": 1,\n      \"harbor_extensions\": {\n        \"agent_env\": {\n          \"FOO\": \"bar\"\n        }\n      }\n    }\n  ],\n  \"metadata\": {\n    \"task_archive_url\": \"{{task_archive_url}}\"\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "prerequest",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "if (!pm.variables.get(\"task_archive_url\")) {",
                      "  console.log(\"Skipping: task_archive_url is not set. Set it to an HTTPS zip of your task directory.\");",
                      "  pm.execution.skipRequest();",
                      "}"
                    ]
                  }
                },
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "const code = pm.response.code;",
                      "if (code === 200 || code === 202) {",
                      "  try {",
                      "    const j = pm.response.json();",
                      "    if (j.job_id) pm.collectionVariables.set(\"harbor_job_id\", j.job_id);",
                      "  } catch (e) {}",
                      "}"
                    ]
                  }
                }
              ]
            },
            {
              "name": "POST /agent/v1/runs \u2014 unknown agent \u2192 400",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/agent/v1/runs",
                "description": "",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"agent_id\": \"not-in-catalog-xyz\",\n  \"instruction\": \"should fail\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"strict agent runtime\", function () {",
                      "  pm.expect([400, 422]).to.include(pm.response.code);",
                      "});"
                    ]
                  }
                }
              ]
            }
          ]
        }
      ],
      "description": "Agent catalog, enqueue runs, status, events."
    },
    {
      "name": "Code Edit",
      "description": "Execution catalog + CodeEdit runs (via gateway).",
      "item": [
        {
          "name": "Catalog & executions",
          "description": "Unified execution catalog read + non-Harbor L3 executors (via gateway strip prefix).",
          "item": [
            {
              "name": "GET /sandbox/v1/catalog",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/v1/catalog",
                "description": "L2 Execution Catalog (languages, agents, profiles)."
              }
            },
            {
              "name": "GET /sandbox/v1/catalog?kind=language",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/v1/catalog?kind=language",
                "description": ""
              }
            },
            {
              "name": "GET /sandbox/v1/catalog?kind=agent",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/v1/catalog?kind=agent",
                "description": ""
              }
            },
            {
              "name": "GET /sandbox/v1/providers",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/v1/providers",
                "description": "Which model providers you can actually run a model from: only the providers your `tenant:project` holds an API key for (no shared fallback). Each item has `source=tenant`. Set `provider` (e.g. `wandb`) to assert that provider is present. Pair with the agent catalog above \u2014 an agent with `requires_model: true` needs a `provider/model` whose provider appears here."
              },
              "event": [
                {
                  "listen": "test",
                  "script": {
                    "type": "text/javascript",
                    "exec": [
                      "pm.test(\"provider inventory returned\", function () {",
                      "  pm.response.to.have.status(200);",
                      "  const body = pm.response.json();",
                      "  const items = Array.isArray(body) ? body : (body.items || body.providers || []);",
                      "  pm.expect(Array.isArray(items)).to.be.true;",
                      "  const tenant = (pm.variables.get(\"tenant_id\") || \"\").trim();",
                      "  const project = (pm.variables.get(\"project_id\") || \"\").trim();",
                      "  console.log(\"scoped to \" + (tenant || \"?\") + \":\" + (project || \"?\"));",
                      "  const lines = items.map((item) => {",
                      "    if (typeof item === \"string\") return item;",
                      "    return (item.provider || \"?\") + \" (\" + (item.source || \"unknown\") + \")\";",
                      "  });",
                      "  console.log(\"providers:\", lines.join(\", \") || \"(none)\");",
                      "  const want = (pm.variables.get(\"provider\") || \"\").trim();",
                      "  if (want) {",
                      "    const row = items.find((item) => (item.provider || item) === want);",
                      "    pm.test(\"selected provider=\" + want + \" is listed\", function () {",
                      "      pm.expect(row, want + \" missing \u2014 provision it for tenant_id:project_id\").to.exist;",
                      "    });",
                      "    if (row && row.source) {",
                      "      pm.test(\"selected provider=\" + want + \" is leased from tenant\", function () {",
                      "        pm.expect(row.source).to.eql(\"tenant\");",
                      "      });",
                      "    }",
                      "  }",
                      "  pm.collectionVariables.set(",
                      "    \"wandb_available\",",
                      "    String(items.some((item) => (item.provider || item) === \"wandb\"))",
                      "  );",
                      "});"
                    ]
                  }
                }
              ]
            },
            {
              "name": "GET /codeedit/healthz",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/codeedit/healthz",
                "description": "A per-plane probe behind the gateway, so it needs a key. For an unauthenticated check use GET /healthz on the gateway itself."
              }
            },
            {
              "name": "GET /codeedit/v1/languages",
              "request": {
                "method": "GET",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/codeedit/v1/languages",
                "description": ""
              }
            },
            {
              "name": "POST /codeedit/v1/executions",
              "request": {
                "method": "POST",
                "header": [
                  {
                    "key": "X-Sandbox-Tenant-Id",
                    "value": "{{tenant_id}}"
                  },
                  {
                    "key": "X-Sandbox-Project-Id",
                    "value": "{{project_id}}"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": "{{baseUrl}}/sandbox/codeedit/v1/executions",
                "description": "Requires docker/k8s backend locally; may 500 without runtime.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"language\": \"python3.12\",\n  \"files\": {\n    \"main.py\": \"print(42)\"\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Sandboxes",
      "description": "Create / exec / files / verify / stop for long-lived sandboxes.",
      "item": [
        {
          "name": "POST /sandboxes/v1 (create desktop-ubuntu session)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/sandbox/sandboxes/v1",
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"profile\": \"desktop-ubuntu\",\n  \"autostop_sec\": 1800,\n  \"ttl_sec\": 7200\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code === 201 || pm.response.code === 202) {",
                  "  try {",
                  "    const j = pm.response.json();",
                  "    if (j.sandbox_id) pm.collectionVariables.set(\"sandbox_id\", j.sandbox_id);",
                  "    if (j.viewer && j.viewer.url) pm.collectionVariables.set(\"viewer_url\", j.viewer.url);",
                  "    if (j.events_url) pm.collectionVariables.set(\"sandbox_events_url\", j.events_url);",
                  "  } catch (e) {}",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "POST /sandboxes/v1 (create session)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/sandbox/sandboxes/v1",
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"profile\": \"sandboxes-default\",\n  \"autostop_sec\": 600,\n  \"ttl_sec\": 3600\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code === 201 || pm.response.code === 202) {",
                  "  try {",
                  "    const j = pm.response.json();",
                  "    if (j.sandbox_id) pm.collectionVariables.set(\"sandbox_id\", j.sandbox_id);",
                  "    if (j.viewer && j.viewer.url) pm.collectionVariables.set(\"viewer_url\", j.viewer.url);",
                  "    if (j.events_url) pm.collectionVariables.set(\"sandbox_events_url\", j.events_url);",
                  "  } catch (e) {}",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "GET /sandboxes/v1 (list)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/sandboxes/v1",
            "description": ""
          }
        },
        {
          "name": "GET /sandboxes/v1/{sandbox_id}",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/sandboxes/v1/{{sandbox_id}}",
            "description": ""
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"sandbox_id\")) {",
                  "  console.log(\"Skipping: sandbox_id is not set. Send POST /sandboxes/v1 first; it saves the id.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "POST /sandboxes/v1/{sandbox_id}/exec",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/sandbox/sandboxes/v1/{{sandbox_id}}/exec",
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"command\": [\n    \"/bin/sh\",\n    \"-c\",\n    \"echo postman-sandbox-ok\"\n  ]\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"sandbox_id\")) {",
                  "  console.log(\"Skipping: sandbox_id is not set. Create a sandbox first.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "PUT /sandboxes/v1/{sandbox_id}/files",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "text/plain"
              },
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/sandbox/sandboxes/v1/{{sandbox_id}}/files?path=notes.txt",
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "\"hello from postman\"",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"sandbox_id\")) {",
                  "  console.log(\"Skipping: sandbox_id is not set. Create a sandbox first.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "GET /sandboxes/v1/{sandbox_id}/files",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/sandboxes/v1/{{sandbox_id}}/files?path=notes.txt",
            "description": ""
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"sandbox_id\")) {",
                  "  console.log(\"Skipping: sandbox_id is not set. Create a sandbox first.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "DELETE /sandboxes/v1/{sandbox_id}/files",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/sandboxes/v1/{{sandbox_id}}/files?path=notes.txt",
            "description": ""
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"sandbox_id\")) {",
                  "  console.log(\"Skipping: sandbox_id is not set. Create a sandbox first.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "POST /sandboxes/v1/{sandbox_id}/capture",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/sandboxes/v1/{{sandbox_id}}/capture",
            "description": ""
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"sandbox_id\")) {",
                  "  console.log(\"Skipping: sandbox_id is not set. Create a sandbox first.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code === 200) {",
                  "  try {",
                  "    const j = pm.response.json();",
                  "    if (j.capture_id) pm.collectionVariables.set(\"capture_id\", j.capture_id);",
                  "    if (j.url) pm.collectionVariables.set(\"capture_url\", j.url);",
                  "  } catch (e) {}",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "GET /sandboxes/v1/{sandbox_id}/artifacts",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/sandboxes/v1/{{sandbox_id}}/artifacts?kind=screenshot&limit=10",
            "description": ""
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"sandbox_id\")) {",
                  "  console.log(\"Skipping: sandbox_id is not set. Create a sandbox first.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "GET /sandboxes/v1/{sandbox_id}/artifacts/{capture_id}",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/sandboxes/v1/{{sandbox_id}}/artifacts/{{capture_id}}",
            "description": ""
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"capture_id\")) {",
                  "  console.log(\"Skipping: capture_id is not set. POST /capture first; it saves capture_id.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "POST /sandboxes/v1/{sandbox_id}/verify",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/sandbox/sandboxes/v1/{{sandbox_id}}/verify",
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"require_verifier_evidence\": false\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"sandbox_id\")) {",
                  "  console.log(\"Skipping: sandbox_id is not set. Create a sandbox first.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "POST /sandboxes/v1/{sandbox_id}/stop",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/sandboxes/v1/{{sandbox_id}}/stop",
            "description": ""
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"sandbox_id\")) {",
                  "  console.log(\"Skipping: sandbox_id is not set. Create a sandbox first.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "POST /sandboxes/v1/{sandbox_id}/start",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/sandboxes/v1/{{sandbox_id}}/start",
            "description": ""
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"sandbox_id\")) {",
                  "  console.log(\"Skipping: sandbox_id is not set. Create a sandbox first.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "DELETE /sandboxes/v1/{sandbox_id}",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/sandboxes/v1/{{sandbox_id}}",
            "description": ""
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"sandbox_id\")) {",
                  "  console.log(\"Skipping: sandbox_id is not set. Create a sandbox first.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "POST /sandboxes/v1/_reap",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/sandboxes/v1/_reap",
            "description": "Ops-only idle/TTL sweep for the caller's tenancy."
          }
        }
      ]
    },
    {
      "name": "Desktop viewer",
      "description": "Live desktop viewer (viewer.url), SSE lifecycle, capture artifacts.",
      "item": [
        {
          "name": "POST /sandboxes/v1 (create desktop-ubuntu)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/sandbox/sandboxes/v1",
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"profile\": \"desktop-ubuntu\",\n  \"autostop_sec\": 1800,\n  \"ttl_sec\": 7200\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code === 201 || pm.response.code === 202) {",
                  "  try {",
                  "    const j = pm.response.json();",
                  "    if (j.sandbox_id) pm.collectionVariables.set(\"sandbox_id\", j.sandbox_id);",
                  "    if (j.viewer && j.viewer.url) pm.collectionVariables.set(\"viewer_url\", j.viewer.url);",
                  "    if (j.events_url) pm.collectionVariables.set(\"sandbox_events_url\", j.events_url);",
                  "  } catch (e) {}",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "GET /sandboxes/v1/{sandbox_id}/events (SSE until running)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "text/event-stream"
              },
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/sandboxes/v1/{{sandbox_id}}/events",
            "description": "Streams meta + lifecycle events. Send and Download \u2014 stop when you see lifecycle running, then open viewer_url in a browser."
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"sandbox_id\")) {",
                  "  console.log(\"Skipping: sandbox_id is not set. Send POST /sandboxes/v1 (desktop) first; it saves the id.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "GET /sandboxes/v1/{sandbox_id}/viewer (mint viewer.url)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/sandboxes/v1/{{sandbox_id}}/viewer",
            "description": ""
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"sandbox_id\")) {",
                  "  console.log(\"Skipping: sandbox_id is not set. Create a desktop sandbox first.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "try {",
                  "  const j = pm.response.json();",
                  "  if (j.url) pm.collectionVariables.set(\"viewer_url\", j.url);",
                  "} catch (e) {}"
                ]
              }
            }
          ]
        },
        {
          "name": "POST /sandboxes/v1/{sandbox_id}/viewer/start",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/sandboxes/v1/{{sandbox_id}}/viewer/start",
            "description": ""
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"sandbox_id\")) {",
                  "  console.log(\"Skipping: sandbox_id is not set. Create a desktop sandbox first.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "POST /sandboxes/v1/{sandbox_id}/viewer/stop",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/sandboxes/v1/{{sandbox_id}}/viewer/stop",
            "description": ""
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"sandbox_id\")) {",
                  "  console.log(\"Skipping: sandbox_id is not set. Create a desktop sandbox first.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "POST /sandboxes/v1/{sandbox_id}/capture",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/sandboxes/v1/{{sandbox_id}}/capture",
            "description": ""
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"sandbox_id\")) {",
                  "  console.log(\"Skipping: sandbox_id is not set. Create a desktop sandbox first.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code === 200) {",
                  "  try {",
                  "    const j = pm.response.json();",
                  "    if (j.capture_id) pm.collectionVariables.set(\"capture_id\", j.capture_id);",
                  "    if (j.url) pm.collectionVariables.set(\"capture_url\", j.url);",
                  "  } catch (e) {}",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "GET /sandboxes/v1/{sandbox_id}/artifacts",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/sandboxes/v1/{{sandbox_id}}/artifacts?kind=screenshot&limit=10",
            "description": ""
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"sandbox_id\")) {",
                  "  console.log(\"Skipping: sandbox_id is not set. Create a desktop sandbox first.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "DELETE /sandboxes/v1/{sandbox_id}",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/sandboxes/v1/{{sandbox_id}}",
            "description": ""
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"sandbox_id\")) {",
                  "  console.log(\"Skipping: sandbox_id is not set. Create a desktop sandbox first.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Desktop eval (Harbor)",
      "description": "Harbor async execute-tasks for desktop-ubuntu-smoke.",
      "item": [
        {
          "name": "POST /harbor/v2/jobs/execute-tasks (desktop-ubuntu-smoke)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              },
              {
                "key": "Idempotency-Key",
                "value": "postman-desktop-smoke-{{$guid}}"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": "{{baseUrl}}/sandbox/harbor/v2/jobs/execute-tasks",
            "description": "",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"task_slug\": \"desktop-ubuntu-smoke\",\n  \"agents\": [\n    {\n      \"name\": \"oracle-run\",\n      \"harbor_agent\": \"oracle\",\n      \"pass_at_k\": 1\n    }\n  ],\n  \"metadata\": {\n    \"task_archive_url\": \"{{task_archive_url}}\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"task_archive_url\")) {",
                  "  console.log(\"Skipping: task_archive_url is not set. Set task_archive_url to the desktop-ubuntu-smoke task zip URL.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            },
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const code = pm.response.code;",
                  "if (code === 200 || code === 202) {",
                  "  try {",
                  "    const j = pm.response.json();",
                  "    if (j.job_id) pm.collectionVariables.set(\"job_id\", j.job_id);",
                  "  } catch (e) {}",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "GET /harbor/v2/jobs/{job_id}",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/harbor/v2/jobs/{{job_id}}",
            "description": ""
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"job_id\")) {",
                  "  console.log(\"Skipping: job_id is not set. Run execute-tasks first.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "GET /harbor/v2/jobs/{job_id}/events (SSE)",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "text/event-stream"
              },
              {
                "key": "X-Sandbox-Tenant-Id",
                "value": "{{tenant_id}}"
              },
              {
                "key": "X-Sandbox-Project-Id",
                "value": "{{project_id}}"
              }
            ],
            "url": "{{baseUrl}}/sandbox/harbor/v2/jobs/{{job_id}}/events",
            "description": ""
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (!pm.variables.get(\"job_id\")) {",
                  "  console.log(\"Skipping: job_id is not set. Run execute-tasks first.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Local",
      "description": "Service ports on localhost \u2014 skipped unless baseUrl is local.",
      "item": [
        {
          "name": "Harbor direct GET /healthz :8781",
          "request": {
            "method": "GET",
            "header": [],
            "url": "http://localhost:8781/healthz",
            "description": "",
            "auth": {
              "type": "noauth"
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const base = pm.variables.get(\"baseUrl\") || \"\";",
                  "if (!/localhost|127\\.0\\.0\\.1/.test(base)) {",
                  "  console.log(\"Skipping: service ports are only reachable on a local stack.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Harbor direct GET /v2/capabilities :8781",
          "request": {
            "method": "GET",
            "header": [],
            "url": "http://localhost:8781/v2/capabilities",
            "description": "Uses collection X-Api-Key auth."
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const base = pm.variables.get(\"baseUrl\") || \"\";",
                  "if (!/localhost|127\\.0\\.0\\.1/.test(base)) {",
                  "  console.log(\"Skipping: service ports are only reachable on a local stack.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Agent direct GET /healthz :8782",
          "request": {
            "method": "GET",
            "header": [],
            "url": "http://localhost:8782/healthz",
            "description": "",
            "auth": {
              "type": "noauth"
            }
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const base = pm.variables.get(\"baseUrl\") || \"\";",
                  "if (!/localhost|127\\.0\\.0\\.1/.test(base)) {",
                  "  console.log(\"Skipping: service ports are only reachable on a local stack.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        },
        {
          "name": "Agent direct GET /capabilities :8782",
          "request": {
            "method": "GET",
            "header": [],
            "url": "http://localhost:8782/capabilities",
            "description": "Uses collection X-Api-Key auth."
          },
          "event": [
            {
              "listen": "prerequest",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "const base = pm.variables.get(\"baseUrl\") || \"\";",
                  "if (!/localhost|127\\.0\\.0\\.1/.test(base)) {",
                  "  console.log(\"Skipping: service ports are only reachable on a local stack.\");",
                  "  pm.execution.skipRequest();",
                  "}"
                ]
              }
            }
          ]
        }
      ]
    }
  ]
}
