{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/currents-dev/json-schema/currents-dev-affected-test-executions-response-schema.json",
  "title": "AffectedTestExecutionsResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/currents-dev-actions-api-openapi.yml#/components/schemas/AffectedTestExecutionsResponse",
  "type": "object",
  "required": [
    "status",
    "data"
  ],
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "OK"
      ]
    },
    "data": {
      "type": "object",
      "required": [
        "executions",
        "has_more"
      ],
      "properties": {
        "executions": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/AffectedTestExecution"
          }
        },
        "has_more": {
          "type": "boolean",
          "description": "Whether more execution rows exist after this page"
        }
      }
    }
  },
  "$defs": {
    "AffectedTestExecution": {
      "type": "object",
      "required": [
        "cursor",
        "runId",
        "instanceId",
        "testId",
        "specFile",
        "title",
        "signature",
        "branch",
        "commitSha",
        "prTitle",
        "prId",
        "commitMessage",
        "groupId",
        "state",
        "isFlaky",
        "executedAt"
      ],
      "properties": {
        "cursor": {
          "type": "string",
          "description": "Test document id; pass as starting_after to fetch the next page"
        },
        "runId": {
          "type": "string",
          "description": "Run ID"
        },
        "instanceId": {
          "type": "string",
          "description": "Instance ID"
        },
        "testId": {
          "type": "string",
          "description": "Test ID"
        },
        "specFile": {
          "type": "string",
          "description": "Spec file path for this test"
        },
        "title": {
          "type": "string",
          "description": "Test title"
        },
        "signature": {
          "type": "string",
          "description": "Stable test signature"
        },
        "branch": {
          "type": [
            "string",
            "null"
          ],
          "description": "Git branch"
        },
        "commitSha": {
          "type": [
            "string",
            "null"
          ],
          "description": "Git commit SHA"
        },
        "prTitle": {
          "type": [
            "string",
            "null"
          ],
          "description": "Raw pull request title from CI when present"
        },
        "prId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Raw pull request id from CI when present"
        },
        "commitMessage": {
          "type": [
            "string",
            "null"
          ],
          "description": "Raw git commit message from CI when present"
        },
        "groupId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Run group the execution belongs to; null when absent"
        },
        "state": {
          "allOf": [
            {
              "$ref": "#/$defs/RecordedTestOutcome"
            }
          ],
          "description": "Final test outcome from test metrics; null when the metric join misses"
        },
        "isFlaky": {
          "type": [
            "boolean",
            "null"
          ],
          "description": "Whether the execution was flaky; null when state is unavailable"
        },
        "executedAt": {
          "type": "string",
          "format": "date-time",
          "description": "When the test was executed"
        }
      }
    },
    "RecordedTestOutcome": {
      "type": "string",
      "description": "Final per-test outcome stored in Currents.\n\n- **passed** — Runner reported success.\n- **failed** — Runner reported failure (assertions, errors, timeouts, etc.).\n- **pending** — Intentional skip or disabled test (e.g. `test.skip()` / `it.skip()`). In **Tests Explorer** (`GET /tests/{projectId}`) this increments `metrics.ignored` and does **not** increment `metrics.failures`.\n- **skipped** — Runner reported a skip without a normal pass/fail (often interrupted or never executed as pass/fail). In **Tests Explorer** this increments `metrics.failures` together with `failed` (there is no separate `skipped` counter in that response). On **run and spec** payloads, `stats.skipped` is still reported separately from `stats.failures` and `stats.pending`.",
      "enum": [
        "passed",
        "failed",
        "pending",
        "skipped"
      ]
    }
  }
}