squally-mcp 0.1.4 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@
3
3
  "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
4
4
  "info": {
5
5
  "title": "Squally Read API",
6
- "version": "1.0.0-beta",
6
+ "version": "1.0.0-beta.3",
7
7
  "description": "Read access to a Squally organization's test results, for scripts, CI jobs and AI agents.\n\n**Authentication.** Every request carries an organization read key as `Authorization: Bearer sqly_ro_…`. A read key is organization-wide (every project), created by an organization admin in Settings → API keys, and expires after 30, 60, 90, 180 days as chosen at creation. There is no renewal: create a new key and revoke the old one. Project ingest keys (`sqly_…`) are refused with `wrong_key_type`.\n\n**Expiry warning.** From 7 days before a key expires, every authenticated response carries `Squally-Key-Expires-At` with the expiry instant (ISO-8601).\n\n**Rate limit.** Currently 60 requests per 60 seconds per key, counted per `Authorization` header - a read key has its own budget, shared with nothing else. Over the limit the edge answers 429 without a JSON body.\n\n**Retries.** 429: wait 60 seconds, then retry. The edge counts requests per key in 60-second windows and sends no Retry-After header. 5xx: retry with exponential backoff, starting at 1 second and capped at 30 seconds. 400, 401, 403, 404: never retry - the same request gets the same answer.\n\n**Plans.** The read API is part of the Standard and Pro plans. A key of an organization on Free is answered 403 `tier_too_low`; keys are not revoked on a downgrade and work again after an upgrade.\n\n**Errors.** Every error is `{\"error\": \"<sentence>\", \"code\": \"<slug>\"}`. The sentence may be reworded; the slug may not. An id that does not exist and an id that belongs to another organization get the same 404, byte for byte.\n\n**Test names in paths.** Test names are Playwright title paths and often contain `/`: URL-encode them, including `/` as `%2F`.\n\n**Sharded runs** are returned as one logical run: /runs lists one row per logical run, and the run routes answer for all shards whichever shard's id you pass.\n\n**Stability.** v1, beta. The API may change until the beta ends; every change is listed in the changelog (docs/openapi/CHANGELOG.md)."
8
8
  },
9
9
  "servers": [
@@ -27,11 +27,7 @@
27
27
  },
28
28
  {
29
29
  "name": "Tests",
30
- "description": "One test by name: its stored flakiness verdict and its history across runs."
31
- },
32
- {
33
- "name": "Flakiness",
34
- "description": "Flaky and broken tests as the flakiness engine judges them."
30
+ "description": "Every test's metrics over a period, and one test by name: its metrics and its history across runs."
35
31
  },
36
32
  {
37
33
  "name": "Errors",
@@ -61,7 +57,7 @@
61
57
  "code": "invalid_period",
62
58
  "status": 400,
63
59
  "when": "days=90 is beyond this plan's 60-day retention. Use 60 or less.",
64
- "action": "Use days=7, 30 or 90, within the plan's retention; do not retry.",
60
+ "action": "Use days=7, 14, 30 or 90, within the plan's retention; do not retry.",
65
61
  "hasBody": true
66
62
  },
67
63
  {
@@ -364,6 +360,7 @@
364
360
  "type": "integer",
365
361
  "enum": [
366
362
  7,
363
+ 14,
367
364
  30,
368
365
  90
369
366
  ],
@@ -482,10 +479,10 @@
482
479
  "durationMs": 515000,
483
480
  "counts": {
484
481
  "total": 412,
485
- "passed": 409,
482
+ "passed": 408,
486
483
  "failed": 0,
487
484
  "skipped": 3,
488
- "recovered": 1
485
+ "flaky": 1
489
486
  },
490
487
  "shards": {
491
488
  "received": 2,
@@ -508,7 +505,7 @@
508
505
  "passed": 401,
509
506
  "failed": 2,
510
507
  "skipped": 2,
511
- "recovered": 0
508
+ "flaky": 0
512
509
  },
513
510
  "shards": null
514
511
  }
@@ -827,10 +824,10 @@
827
824
  },
828
825
  "counts": {
829
826
  "total": 412,
830
- "passed": 409,
827
+ "passed": 408,
831
828
  "failed": 0,
832
829
  "skipped": 3,
833
- "recovered": 1
830
+ "flaky": 1
834
831
  },
835
832
  "tests": [
836
833
  {
@@ -1148,7 +1145,7 @@
1148
1145
  }
1149
1146
  }
1150
1147
  ],
1151
- "copyPrompt": "You have the repository open. Find the test below, explain the failure and propose a fix.\n\nFailing test: chromium > checkout.spec.ts > Checkout > applies a coupon code\nFile: tests/checkout.spec.ts\nBrowser: chromium\nRun branch: main\nAttempt: first try\nOutcome: a later retry of this test passed (the test is flaky rather than consistently broken).\n\nError message:\nError: expect(locator).toHaveText(expected) failed\n\nLocator: getByTestId('order-total')\nExpected: \"€ 45.00\"\nReceived: \"€ 50.00\"\nTimeout: 5000ms\nStack (top frames):\nat /home/runner/work/storefront-web/tests/checkout.spec.ts:48:52\nAttempt duration: 6210 ms\nFailure category: Assertion\nStatus from the flakiness engine: flaky (signals: Retry rate). Treat this as evidence to weigh, not as a verdict.",
1148
+ "copyPrompt": "You have the repository open. Find the test below, explain the failure and propose a fix.\n\nFailing test: chromium > checkout.spec.ts > Checkout > applies a coupon code\nFile: tests/checkout.spec.ts\nBrowser: chromium\nRun branch: main\nAttempt: first try\nOutcome: a later retry of this test passed - a flaky run.\n\nError message:\nError: expect(locator).toHaveText(expected) failed\n\nLocator: getByTestId('order-total')\nExpected: \"€ 45.00\"\nReceived: \"€ 50.00\"\nTimeout: 5000ms\nStack (top frames):\nat /home/runner/work/storefront-web/tests/checkout.spec.ts:48:52\nAttempt duration: 6210 ms\nFailure category: Assertion\nLast 14 days on CI: flaky rate 50% (4/8), failure rate 0% (0/8)",
1152
1149
  "shard": {
1153
1150
  "index": 1,
1154
1151
  "runId": "b1e0c6d2-7a43-4f19-8d5e-0c3a9e6f2b71"
@@ -1634,13 +1631,13 @@
1634
1631
  }
1635
1632
  }
1636
1633
  },
1637
- "/projects/{projectId}/flaky": {
1634
+ "/projects/{projectId}/tests": {
1638
1635
  "get": {
1639
- "operationId": "listFlakyTests",
1640
- "summary": "List flaky tests",
1641
- "description": "List flaky and broken tests (expensive). Flaky and broken tests as the flakiness engine judges them over its fixed 14-day window, ranked by time lost. THE EXPENSIVE ENDPOINT: it runs the engine live on every call - call it once per question, not in a loop, and use the test status route for a single test.",
1636
+ "operationId": "listTests",
1637
+ "summary": "List tests",
1638
+ "description": "Every test with a CI run in the period and its metrics - stability, flaky rate, failure rate, runs, time lost, its last 20 runs, the branches it ran on and where it fails most - ranked by the chosen sort. Counts completed CI runs only, without mass-failure runs, on every branch unless branch names one (see population). Moderate: two queries over the period's CI results, paged in the database; use the metrics route for one test.",
1642
1639
  "tags": [
1643
- "Flakiness"
1640
+ "Tests"
1644
1641
  ],
1645
1642
  "parameters": [
1646
1643
  {
@@ -1653,44 +1650,71 @@
1653
1650
  }
1654
1651
  },
1655
1652
  {
1656
- "name": "status",
1653
+ "name": "days",
1657
1654
  "in": "query",
1658
1655
  "required": false,
1659
- "description": "Only tests with this verdict.",
1656
+ "description": "The period, in days, ending now. Must not exceed the plan's retention (Standard 60, Pro 90 days); a longer period is refused with 400 invalid_period rather than answered with less data.",
1660
1657
  "schema": {
1661
- "type": "string",
1658
+ "type": "integer",
1662
1659
  "enum": [
1663
- "flaky",
1664
- "broken"
1665
- ]
1660
+ 7,
1661
+ 14,
1662
+ 30,
1663
+ 90
1664
+ ],
1665
+ "default": 14
1666
1666
  }
1667
1667
  },
1668
1668
  {
1669
- "name": "sort",
1669
+ "name": "search",
1670
+ "in": "query",
1671
+ "required": false,
1672
+ "description": "Case-insensitive substring of the test name or its file.",
1673
+ "schema": {
1674
+ "type": "string",
1675
+ "minLength": 1,
1676
+ "maxLength": 200
1677
+ }
1678
+ },
1679
+ {
1680
+ "name": "branch",
1670
1681
  "in": "query",
1671
1682
  "required": false,
1672
- "description": "Ranking: time lost (default), flake rate, or impact on the stable branch.",
1683
+ "description": "Only runs on this branch, the name exactly. Every branch when absent.",
1673
1684
  "schema": {
1674
1685
  "type": "string",
1675
- "enum": [
1676
- "timeLost",
1677
- "rate",
1678
- "impact"
1679
- ],
1680
- "default": "timeLost"
1686
+ "minLength": 1,
1687
+ "maxLength": 200
1681
1688
  }
1682
1689
  },
1683
1690
  {
1684
- "name": "search",
1691
+ "name": "browser",
1685
1692
  "in": "query",
1686
1693
  "required": false,
1687
- "description": "Case-insensitive substring of the test name or its file.",
1694
+ "description": "Only tests of this Playwright project - the items' browser field, exactly (e.g. chromium). Every test when absent.",
1688
1695
  "schema": {
1689
1696
  "type": "string",
1690
1697
  "minLength": 1,
1691
1698
  "maxLength": 200
1692
1699
  }
1693
1700
  },
1701
+ {
1702
+ "name": "sort",
1703
+ "in": "query",
1704
+ "required": false,
1705
+ "description": "Ranking, the worst first: stability (the default) lowest first; flakyRate, failureRate, runs and timeLost highest first. Ties go to the most runs (for runs: the lowest stability), then to the test name and file. A rate with nothing to divide by (null) sorts after every number.",
1706
+ "schema": {
1707
+ "type": "string",
1708
+ "enum": [
1709
+ "stability",
1710
+ "flakyRate",
1711
+ "failureRate",
1712
+ "runs",
1713
+ "timeLost"
1714
+ ],
1715
+ "default": "stability"
1716
+ }
1717
+ },
1694
1718
  {
1695
1719
  "name": "page",
1696
1720
  "in": "query",
@@ -1706,15 +1730,12 @@
1706
1730
  "name": "perPage",
1707
1731
  "in": "query",
1708
1732
  "required": false,
1709
- "description": "Rows per page.",
1733
+ "description": "Rows per page, 1 to 100.",
1710
1734
  "schema": {
1711
1735
  "type": "integer",
1712
- "enum": [
1713
- 10,
1714
- 25,
1715
- 50
1716
- ],
1717
- "default": 10
1736
+ "minimum": 1,
1737
+ "maximum": 100,
1738
+ "default": 50
1718
1739
  }
1719
1740
  }
1720
1741
  ],
@@ -1729,76 +1750,272 @@
1729
1750
  "content": {
1730
1751
  "application/json": {
1731
1752
  "schema": {
1732
- "$ref": "#/components/schemas/FlakyResponse"
1753
+ "$ref": "#/components/schemas/TestsResponse"
1733
1754
  },
1734
1755
  "example": {
1735
1756
  "project": {
1736
1757
  "id": "3f7c2a91-5b8e-4d0a-9c61-2e4b7f0d8a15",
1737
1758
  "name": "storefront-web"
1738
1759
  },
1739
- "windowDays": 14,
1740
- "sort": "timeLost",
1741
- "page": {
1742
- "page": 1,
1743
- "perPage": 10,
1744
- "total": 3,
1745
- "pageCount": 1
1746
- },
1747
- "tests": [
1760
+ "population": "ci_completed_not_excluded",
1761
+ "days": 14,
1762
+ "since": "2026-09-10T08:00:00.000Z",
1763
+ "until": "2026-09-24T08:00:00.000Z",
1764
+ "branch": null,
1765
+ "browser": null,
1766
+ "sort": "stability",
1767
+ "page": 1,
1768
+ "perPage": 3,
1769
+ "total": 409,
1770
+ "pageCount": 137,
1771
+ "items": [
1748
1772
  {
1749
1773
  "testName": "chromium > checkout.spec.ts > Checkout > applies a coupon code",
1750
1774
  "filePath": "tests/checkout.spec.ts",
1751
- "status": "flaky",
1752
- "statusReason": "retry_rate",
1753
- "alsoActive": [
1754
- "same_sha_flip"
1775
+ "browser": "chromium",
1776
+ "runs": 8,
1777
+ "stableRuns": 4,
1778
+ "flakyRuns": 4,
1779
+ "failedRuns": 0,
1780
+ "stability": 0.5,
1781
+ "flakyRate": 0.5,
1782
+ "failureRate": 0,
1783
+ "timeLostMs": 7361,
1784
+ "recentResults": [
1785
+ {
1786
+ "runId": "5c8e2a17-9d4b-4f60-b3a1-7e2d9c0f4b58",
1787
+ "runNumber": 1261,
1788
+ "startedAt": "2026-09-12T07:30:41.000Z",
1789
+ "branch": "main",
1790
+ "result": "stable"
1791
+ },
1792
+ {
1793
+ "runId": "c2e7a940-5d1b-4f8e-9a36-0b4d7e1c5f92",
1794
+ "runNumber": 1264,
1795
+ "startedAt": "2026-09-14T15:12:09.000Z",
1796
+ "branch": "feature/saved-carts",
1797
+ "result": "flaky"
1798
+ },
1799
+ {
1800
+ "runId": "a3f19c62-0e7d-4b85-9c24-6d1e8b3f7a09",
1801
+ "runNumber": 1266,
1802
+ "startedAt": "2026-09-15T07:31:03.000Z",
1803
+ "branch": "main",
1804
+ "result": "flaky"
1805
+ },
1806
+ {
1807
+ "runId": "d07b4e95-6a2c-4e13-8f5d-2b9c1a7e6f30",
1808
+ "runNumber": 1270,
1809
+ "startedAt": "2026-09-17T07:29:58.000Z",
1810
+ "branch": "main",
1811
+ "result": "flaky"
1812
+ },
1813
+ {
1814
+ "runId": "6b1f8d23-9e4a-4c07-b5d2-3a8e0f6c1d74",
1815
+ "runNumber": 1273,
1816
+ "startedAt": "2026-09-18T11:47:35.000Z",
1817
+ "branch": "feature/saved-carts",
1818
+ "result": "stable"
1819
+ },
1820
+ {
1821
+ "runId": "8f6a3d21-4c9e-4a7b-b052-e1d7c3a9f864",
1822
+ "runNumber": 1277,
1823
+ "startedAt": "2026-09-20T07:32:16.000Z",
1824
+ "branch": "main",
1825
+ "result": "stable"
1826
+ },
1827
+ {
1828
+ "runId": "7d2f4b19-3c8e-4a61-9e07-5b1d8c2a6f34",
1829
+ "runNumber": 1283,
1830
+ "startedAt": "2026-09-23T16:05:40.000Z",
1831
+ "branch": "feature/saved-carts",
1832
+ "result": "stable"
1833
+ },
1834
+ {
1835
+ "runId": "b1e0c6d2-7a43-4f19-8d5e-0c3a9e6f2b71",
1836
+ "runNumber": 1284,
1837
+ "startedAt": "2026-09-24T07:31:12.000Z",
1838
+ "branch": "main",
1839
+ "result": "flaky"
1840
+ }
1755
1841
  ],
1756
- "timeLostMs": 1968000,
1757
- "flakeScore": 0.42,
1758
- "flipRate": 0.31,
1759
- "failureRate": 0.18,
1760
- "runsConsidered": 38,
1761
- "runsInWindow": 44,
1762
- "failureStreak": 0,
1763
- "lastSeenAt": "2026-09-24T07:34:05.000Z",
1764
- "lastRun": {
1765
- "runId": "b1e0c6d2-7a43-4f19-8d5e-0c3a9e6f2b71",
1766
- "runNumber": 1284,
1767
- "status": "passed",
1768
- "startedAt": "2026-09-24T07:31:12.000Z"
1842
+ "branches": [
1843
+ "feature/saved-carts",
1844
+ "main"
1845
+ ],
1846
+ "topBranch": {
1847
+ "branch": "main",
1848
+ "kind": "retries",
1849
+ "count": 3
1769
1850
  }
1770
1851
  },
1771
1852
  {
1772
1853
  "testName": "chromium > search.spec.ts > Search > filters by date",
1773
1854
  "filePath": "tests/search.spec.ts",
1774
- "status": "broken",
1775
- "statusReason": "consecutive_failures",
1776
- "alsoActive": [
1777
- "failure_rate_broken"
1855
+ "browser": "chromium",
1856
+ "runs": 8,
1857
+ "stableRuns": 5,
1858
+ "flakyRuns": 0,
1859
+ "failedRuns": 3,
1860
+ "stability": 0.625,
1861
+ "flakyRate": 0,
1862
+ "failureRate": 0.375,
1863
+ "timeLostMs": 14308,
1864
+ "recentResults": [
1865
+ {
1866
+ "runId": "5c8e2a17-9d4b-4f60-b3a1-7e2d9c0f4b58",
1867
+ "runNumber": 1261,
1868
+ "startedAt": "2026-09-12T07:30:41.000Z",
1869
+ "branch": "main",
1870
+ "result": "stable"
1871
+ },
1872
+ {
1873
+ "runId": "c2e7a940-5d1b-4f8e-9a36-0b4d7e1c5f92",
1874
+ "runNumber": 1264,
1875
+ "startedAt": "2026-09-14T15:12:09.000Z",
1876
+ "branch": "feature/saved-carts",
1877
+ "result": "stable"
1878
+ },
1879
+ {
1880
+ "runId": "a3f19c62-0e7d-4b85-9c24-6d1e8b3f7a09",
1881
+ "runNumber": 1266,
1882
+ "startedAt": "2026-09-15T07:31:03.000Z",
1883
+ "branch": "main",
1884
+ "result": "stable"
1885
+ },
1886
+ {
1887
+ "runId": "d07b4e95-6a2c-4e13-8f5d-2b9c1a7e6f30",
1888
+ "runNumber": 1270,
1889
+ "startedAt": "2026-09-17T07:29:58.000Z",
1890
+ "branch": "main",
1891
+ "result": "failed"
1892
+ },
1893
+ {
1894
+ "runId": "6b1f8d23-9e4a-4c07-b5d2-3a8e0f6c1d74",
1895
+ "runNumber": 1273,
1896
+ "startedAt": "2026-09-18T11:47:35.000Z",
1897
+ "branch": "feature/saved-carts",
1898
+ "result": "stable"
1899
+ },
1900
+ {
1901
+ "runId": "8f6a3d21-4c9e-4a7b-b052-e1d7c3a9f864",
1902
+ "runNumber": 1277,
1903
+ "startedAt": "2026-09-20T07:32:16.000Z",
1904
+ "branch": "main",
1905
+ "result": "failed"
1906
+ },
1907
+ {
1908
+ "runId": "7d2f4b19-3c8e-4a61-9e07-5b1d8c2a6f34",
1909
+ "runNumber": 1283,
1910
+ "startedAt": "2026-09-23T16:05:40.000Z",
1911
+ "branch": "feature/saved-carts",
1912
+ "result": "failed"
1913
+ },
1914
+ {
1915
+ "runId": "b1e0c6d2-7a43-4f19-8d5e-0c3a9e6f2b71",
1916
+ "runNumber": 1284,
1917
+ "startedAt": "2026-09-24T07:31:12.000Z",
1918
+ "branch": "main",
1919
+ "result": "stable"
1920
+ }
1921
+ ],
1922
+ "branches": [
1923
+ "feature/saved-carts",
1924
+ "main"
1925
+ ],
1926
+ "topBranch": {
1927
+ "branch": "main",
1928
+ "kind": "failures",
1929
+ "count": 2
1930
+ }
1931
+ },
1932
+ {
1933
+ "testName": "chromium > auth.spec.ts > Login > remembers the device",
1934
+ "filePath": "tests/auth.spec.ts",
1935
+ "browser": "chromium",
1936
+ "runs": 7,
1937
+ "stableRuns": 6,
1938
+ "flakyRuns": 1,
1939
+ "failedRuns": 0,
1940
+ "stability": 0.8571428571428571,
1941
+ "flakyRate": 0.14285714285714285,
1942
+ "failureRate": 0,
1943
+ "timeLostMs": 3071,
1944
+ "recentResults": [
1945
+ {
1946
+ "runId": "5c8e2a17-9d4b-4f60-b3a1-7e2d9c0f4b58",
1947
+ "runNumber": 1261,
1948
+ "startedAt": "2026-09-12T07:30:41.000Z",
1949
+ "branch": "main",
1950
+ "result": "stable"
1951
+ },
1952
+ {
1953
+ "runId": "c2e7a940-5d1b-4f8e-9a36-0b4d7e1c5f92",
1954
+ "runNumber": 1264,
1955
+ "startedAt": "2026-09-14T15:12:09.000Z",
1956
+ "branch": "feature/saved-carts",
1957
+ "result": "flaky"
1958
+ },
1959
+ {
1960
+ "runId": "a3f19c62-0e7d-4b85-9c24-6d1e8b3f7a09",
1961
+ "runNumber": 1266,
1962
+ "startedAt": "2026-09-15T07:31:03.000Z",
1963
+ "branch": "main",
1964
+ "result": "stable"
1965
+ },
1966
+ {
1967
+ "runId": "d07b4e95-6a2c-4e13-8f5d-2b9c1a7e6f30",
1968
+ "runNumber": 1270,
1969
+ "startedAt": "2026-09-17T07:29:58.000Z",
1970
+ "branch": "main",
1971
+ "result": "skipped"
1972
+ },
1973
+ {
1974
+ "runId": "6b1f8d23-9e4a-4c07-b5d2-3a8e0f6c1d74",
1975
+ "runNumber": 1273,
1976
+ "startedAt": "2026-09-18T11:47:35.000Z",
1977
+ "branch": "feature/saved-carts",
1978
+ "result": "stable"
1979
+ },
1980
+ {
1981
+ "runId": "8f6a3d21-4c9e-4a7b-b052-e1d7c3a9f864",
1982
+ "runNumber": 1277,
1983
+ "startedAt": "2026-09-20T07:32:16.000Z",
1984
+ "branch": "main",
1985
+ "result": "stable"
1986
+ },
1987
+ {
1988
+ "runId": "7d2f4b19-3c8e-4a61-9e07-5b1d8c2a6f34",
1989
+ "runNumber": 1283,
1990
+ "startedAt": "2026-09-23T16:05:40.000Z",
1991
+ "branch": "feature/saved-carts",
1992
+ "result": "stable"
1993
+ },
1994
+ {
1995
+ "runId": "b1e0c6d2-7a43-4f19-8d5e-0c3a9e6f2b71",
1996
+ "runNumber": 1284,
1997
+ "startedAt": "2026-09-24T07:31:12.000Z",
1998
+ "branch": "main",
1999
+ "result": "stable"
2000
+ }
1778
2001
  ],
1779
- "timeLostMs": 540000,
1780
- "flakeScore": 0.9,
1781
- "flipRate": 0.05,
1782
- "failureRate": 1,
1783
- "runsConsidered": 12,
1784
- "runsInWindow": 12,
1785
- "failureStreak": 12,
1786
- "lastSeenAt": "2026-09-23T16:09:31.000Z",
1787
- "lastRun": {
1788
- "runId": "7d2f4b19-3c8e-4a61-9e07-5b1d8c2a6f34",
1789
- "runNumber": 1283,
1790
- "status": "failed",
1791
- "startedAt": "2026-09-23T16:05:40.000Z"
2002
+ "branches": [
2003
+ "feature/saved-carts",
2004
+ "main"
2005
+ ],
2006
+ "topBranch": {
2007
+ "branch": "feature/saved-carts",
2008
+ "kind": "retries",
2009
+ "count": 1
1792
2010
  }
1793
2011
  }
1794
- ],
1795
- "gatheringDataCount": 6
2012
+ ]
1796
2013
  }
1797
2014
  }
1798
2015
  }
1799
2016
  },
1800
2017
  "400": {
1801
- "description": "Error: invalid_parameter",
2018
+ "description": "Error: invalid_parameter, invalid_period",
1802
2019
  "content": {
1803
2020
  "application/json": {
1804
2021
  "schema": {
@@ -1811,7 +2028,8 @@
1811
2028
  "code": {
1812
2029
  "type": "string",
1813
2030
  "enum": [
1814
- "invalid_parameter"
2031
+ "invalid_parameter",
2032
+ "invalid_period"
1815
2033
  ],
1816
2034
  "description": "Stable slug - match on this, not on the sentence."
1817
2035
  }
@@ -1828,6 +2046,13 @@
1828
2046
  "error": "sha must be 4 to 40 hexadecimal characters (a commit SHA or a prefix of one).",
1829
2047
  "code": "invalid_parameter"
1830
2048
  }
2049
+ },
2050
+ "invalid_period": {
2051
+ "summary": "invalid_period",
2052
+ "value": {
2053
+ "error": "days=90 is beyond this plan's 60-day retention. Use 60 or less.",
2054
+ "code": "invalid_period"
2055
+ }
1831
2056
  }
1832
2057
  }
1833
2058
  }
@@ -2015,11 +2240,11 @@
2015
2240
  }
2016
2241
  }
2017
2242
  },
2018
- "/projects/{projectId}/tests/{testName}/status": {
2243
+ "/projects/{projectId}/tests/{testName}/metrics": {
2019
2244
  "get": {
2020
- "operationId": "getTestStatus",
2021
- "summary": "Get test status",
2022
- "description": "Get one test's flakiness verdict (cheap). The stored verdict for one test - status, active signals, labels - as of the last ingest. THE CHEAP ONE: a single lookup, no engine pass; prefer it to /flaky when the question is about one test.",
2245
+ "operationId": "getTestMetrics",
2246
+ "summary": "Get test metrics",
2247
+ "description": "One test's metrics over the period: the fields of its /tests row, flat, beside the same period. A test with results but no CI run in the period answers zeros and null rates rather than 404. Cheap: the list's queries, narrowed to one test; prefer it to /tests when the question is about one test.",
2023
2248
  "tags": [
2024
2249
  "Tests"
2025
2250
  ],
@@ -2050,6 +2275,33 @@
2050
2275
  "schema": {
2051
2276
  "type": "string"
2052
2277
  }
2278
+ },
2279
+ {
2280
+ "name": "days",
2281
+ "in": "query",
2282
+ "required": false,
2283
+ "description": "The period, in days, ending now. Must not exceed the plan's retention (Standard 60, Pro 90 days); a longer period is refused with 400 invalid_period rather than answered with less data.",
2284
+ "schema": {
2285
+ "type": "integer",
2286
+ "enum": [
2287
+ 7,
2288
+ 14,
2289
+ 30,
2290
+ 90
2291
+ ],
2292
+ "default": 14
2293
+ }
2294
+ },
2295
+ {
2296
+ "name": "branch",
2297
+ "in": "query",
2298
+ "required": false,
2299
+ "description": "Only runs on this branch, the name exactly. Every branch when absent.",
2300
+ "schema": {
2301
+ "type": "string",
2302
+ "minLength": 1,
2303
+ "maxLength": 200
2304
+ }
2053
2305
  }
2054
2306
  ],
2055
2307
  "responses": {
@@ -2063,38 +2315,102 @@
2063
2315
  "content": {
2064
2316
  "application/json": {
2065
2317
  "schema": {
2066
- "$ref": "#/components/schemas/V4StatusResponse"
2318
+ "$ref": "#/components/schemas/TestMetricsResponse"
2067
2319
  },
2068
2320
  "example": {
2069
2321
  "project": {
2070
2322
  "id": "3f7c2a91-5b8e-4d0a-9c61-2e4b7f0d8a15",
2071
2323
  "name": "storefront-web"
2072
2324
  },
2073
- "test": {
2074
- "name": "chromium > checkout.spec.ts > Checkout > applies a coupon code",
2075
- "filePath": "tests/checkout.spec.ts"
2076
- },
2077
- "status": "flaky",
2078
- "awaitingFirstWrite": false,
2079
- "activeSignals": [
2325
+ "population": "ci_completed_not_excluded",
2326
+ "days": 14,
2327
+ "since": "2026-09-10T08:00:00.000Z",
2328
+ "until": "2026-09-24T08:00:00.000Z",
2329
+ "branch": null,
2330
+ "testName": "chromium > checkout.spec.ts > Checkout > applies a coupon code",
2331
+ "filePath": "tests/checkout.spec.ts",
2332
+ "browser": "chromium",
2333
+ "runs": 8,
2334
+ "stableRuns": 4,
2335
+ "flakyRuns": 4,
2336
+ "failedRuns": 0,
2337
+ "stability": 0.5,
2338
+ "flakyRate": 0.5,
2339
+ "failureRate": 0,
2340
+ "timeLostMs": 7361,
2341
+ "recentResults": [
2342
+ {
2343
+ "runId": "5c8e2a17-9d4b-4f60-b3a1-7e2d9c0f4b58",
2344
+ "runNumber": 1261,
2345
+ "startedAt": "2026-09-12T07:30:41.000Z",
2346
+ "branch": "main",
2347
+ "result": "stable"
2348
+ },
2349
+ {
2350
+ "runId": "c2e7a940-5d1b-4f8e-9a36-0b4d7e1c5f92",
2351
+ "runNumber": 1264,
2352
+ "startedAt": "2026-09-14T15:12:09.000Z",
2353
+ "branch": "feature/saved-carts",
2354
+ "result": "flaky"
2355
+ },
2356
+ {
2357
+ "runId": "a3f19c62-0e7d-4b85-9c24-6d1e8b3f7a09",
2358
+ "runNumber": 1266,
2359
+ "startedAt": "2026-09-15T07:31:03.000Z",
2360
+ "branch": "main",
2361
+ "result": "flaky"
2362
+ },
2363
+ {
2364
+ "runId": "d07b4e95-6a2c-4e13-8f5d-2b9c1a7e6f30",
2365
+ "runNumber": 1270,
2366
+ "startedAt": "2026-09-17T07:29:58.000Z",
2367
+ "branch": "main",
2368
+ "result": "flaky"
2369
+ },
2370
+ {
2371
+ "runId": "6b1f8d23-9e4a-4c07-b5d2-3a8e0f6c1d74",
2372
+ "runNumber": 1273,
2373
+ "startedAt": "2026-09-18T11:47:35.000Z",
2374
+ "branch": "feature/saved-carts",
2375
+ "result": "stable"
2376
+ },
2377
+ {
2378
+ "runId": "8f6a3d21-4c9e-4a7b-b052-e1d7c3a9f864",
2379
+ "runNumber": 1277,
2380
+ "startedAt": "2026-09-20T07:32:16.000Z",
2381
+ "branch": "main",
2382
+ "result": "stable"
2383
+ },
2080
2384
  {
2081
- "signal": "retry_rate",
2082
- "label": "Retry rate"
2385
+ "runId": "7d2f4b19-3c8e-4a61-9e07-5b1d8c2a6f34",
2386
+ "runNumber": 1283,
2387
+ "startedAt": "2026-09-23T16:05:40.000Z",
2388
+ "branch": "feature/saved-carts",
2389
+ "result": "stable"
2083
2390
  },
2084
2391
  {
2085
- "signal": "same_sha_flip",
2086
- "label": "Same-code flip"
2392
+ "runId": "b1e0c6d2-7a43-4f19-8d5e-0c3a9e6f2b71",
2393
+ "runNumber": 1284,
2394
+ "startedAt": "2026-09-24T07:31:12.000Z",
2395
+ "branch": "main",
2396
+ "result": "flaky"
2087
2397
  }
2088
2398
  ],
2089
- "labels": [
2090
- "retries"
2091
- ]
2399
+ "branches": [
2400
+ "feature/saved-carts",
2401
+ "main"
2402
+ ],
2403
+ "topBranch": {
2404
+ "branch": "main",
2405
+ "kind": "retries",
2406
+ "count": 3
2407
+ }
2092
2408
  }
2093
2409
  }
2094
2410
  }
2095
2411
  },
2096
2412
  "400": {
2097
- "description": "Error: ambiguous_test",
2413
+ "description": "Error: ambiguous_test, invalid_parameter, invalid_period",
2098
2414
  "content": {
2099
2415
  "application/json": {
2100
2416
  "schema": {
@@ -2107,7 +2423,9 @@
2107
2423
  "code": {
2108
2424
  "type": "string",
2109
2425
  "enum": [
2110
- "ambiguous_test"
2426
+ "ambiguous_test",
2427
+ "invalid_parameter",
2428
+ "invalid_period"
2111
2429
  ],
2112
2430
  "description": "Stable slug - match on this, not on the sentence."
2113
2431
  }
@@ -2124,6 +2442,20 @@
2124
2442
  "error": "Several tests have this name. Pass ?filePath= with one of: tests/a.spec.ts, tests/b.spec.ts.",
2125
2443
  "code": "ambiguous_test"
2126
2444
  }
2445
+ },
2446
+ "invalid_parameter": {
2447
+ "summary": "invalid_parameter",
2448
+ "value": {
2449
+ "error": "sha must be 4 to 40 hexadecimal characters (a commit SHA or a prefix of one).",
2450
+ "code": "invalid_parameter"
2451
+ }
2452
+ },
2453
+ "invalid_period": {
2454
+ "summary": "invalid_period",
2455
+ "value": {
2456
+ "error": "days=90 is beyond this plan's 60-day retention. Use 60 or less.",
2457
+ "code": "invalid_period"
2458
+ }
2127
2459
  }
2128
2460
  }
2129
2461
  }
@@ -2364,6 +2696,7 @@
2364
2696
  "type": "integer",
2365
2697
  "enum": [
2366
2698
  7,
2699
+ 14,
2367
2700
  30,
2368
2701
  90
2369
2702
  ],
@@ -2687,6 +3020,7 @@
2687
3020
  "type": "integer",
2688
3021
  "enum": [
2689
3022
  7,
3023
+ 14,
2690
3024
  30,
2691
3025
  90
2692
3026
  ],
@@ -3036,6 +3370,7 @@
3036
3370
  "type": "integer",
3037
3371
  "enum": [
3038
3372
  7,
3373
+ 14,
3039
3374
  30,
3040
3375
  90
3041
3376
  ],
@@ -3338,7 +3673,7 @@
3338
3673
  "get": {
3339
3674
  "operationId": "getOverview",
3340
3675
  "summary": "Get dashboard figures",
3341
- "description": "The dashboard for a period: last run, stability, time lost, slowest tests, time sinks, recent runs. Moderately expensive: its flaky count rides on one engine pass.",
3676
+ "description": "The dashboard for a period: last run, suite stability, time lost, the two test-metric tiles (testMetrics), slowest tests, time sinks, recent runs. Suite stability and testMetrics count completed CI runs only. Moderate: one pass over the period's runs and one count over its CI results.",
3342
3677
  "tags": [
3343
3678
  "Project"
3344
3679
  ],
@@ -3361,6 +3696,7 @@
3361
3696
  "type": "integer",
3362
3697
  "enum": [
3363
3698
  7,
3699
+ 14,
3364
3700
  30,
3365
3701
  90
3366
3702
  ],
@@ -3415,13 +3751,13 @@
3415
3751
  "startedAt": "2026-09-24T07:31:12.000Z",
3416
3752
  "finishedAt": "2026-09-24T07:39:47.000Z",
3417
3753
  "total": 412,
3418
- "passed": 409,
3754
+ "passed": 408,
3419
3755
  "failed": 0,
3420
3756
  "isFallbackBranch": false
3421
3757
  },
3422
- "runsInWindow": 57,
3758
+ "runsInWindow": 11,
3423
3759
  "suiteSize": 412,
3424
- "windowStability": 91.2,
3760
+ "windowStability": 99,
3425
3761
  "timeLost": {
3426
3762
  "lostMs": 5112000,
3427
3763
  "lostPercent": 2.4,
@@ -3430,11 +3766,15 @@
3430
3766
  },
3431
3767
  "failingTests": {
3432
3768
  "failing": 1,
3433
- "withVerdict": 3,
3434
3769
  "testsRun": 412
3435
3770
  },
3436
- "flakyOrBrokenCount": 3,
3437
- "flakyWindowDays": 14,
3771
+ "testMetrics": {
3772
+ "population": "ci_completed_not_excluded",
3773
+ "days": 30,
3774
+ "testsWithRetries": 7,
3775
+ "failingTests": 2,
3776
+ "ciTests": 409
3777
+ },
3438
3778
  "slowestTests": [
3439
3779
  {
3440
3780
  "testName": "chromium > checkout.spec.ts > Checkout > pays with a saved card",
@@ -3452,14 +3792,14 @@
3452
3792
  ],
3453
3793
  "runsSeries": [
3454
3794
  {
3455
- "runNumber": 1282,
3456
- "passed": 410,
3457
- "failed": 0,
3795
+ "runNumber": 1277,
3796
+ "passed": 408,
3797
+ "failed": 1,
3458
3798
  "durationMs": 498000
3459
3799
  },
3460
3800
  {
3461
3801
  "runNumber": 1284,
3462
- "passed": 409,
3802
+ "passed": 408,
3463
3803
  "failed": 0,
3464
3804
  "durationMs": 515000
3465
3805
  }
@@ -3737,8 +4077,7 @@
3737
4077
  "slack": {
3738
4078
  "configured": true,
3739
4079
  "events": [
3740
- "flaky_detected",
3741
- "broken_detected"
4080
+ "run_summary"
3742
4081
  ]
3743
4082
  },
3744
4083
  "github": {
@@ -4129,8 +4468,9 @@
4129
4468
  "skipped": {
4130
4469
  "type": "integer"
4131
4470
  },
4132
- "recovered": {
4133
- "type": "integer"
4471
+ "flaky": {
4472
+ "type": "integer",
4473
+ "description": "Tests whose final attempt passed after at least one retry in this run. Not counted in passed: total = passed + failed + skipped + flaky."
4134
4474
  }
4135
4475
  },
4136
4476
  "required": [
@@ -4138,7 +4478,7 @@
4138
4478
  "passed",
4139
4479
  "failed",
4140
4480
  "skipped",
4141
- "recovered"
4481
+ "flaky"
4142
4482
  ]
4143
4483
  },
4144
4484
  "shards": {
@@ -4458,8 +4798,9 @@
4458
4798
  "skipped": {
4459
4799
  "type": "integer"
4460
4800
  },
4461
- "recovered": {
4462
- "type": "integer"
4801
+ "flaky": {
4802
+ "type": "integer",
4803
+ "description": "Tests whose final attempt passed after at least one retry in this run. Not counted in passed: total = passed + failed + skipped + flaky."
4463
4804
  }
4464
4805
  },
4465
4806
  "required": [
@@ -4467,7 +4808,7 @@
4467
4808
  "passed",
4468
4809
  "failed",
4469
4810
  "skipped",
4470
- "recovered"
4811
+ "flaky"
4471
4812
  ]
4472
4813
  },
4473
4814
  "tests": {
@@ -4860,7 +5201,7 @@
4860
5201
  "branches"
4861
5202
  ]
4862
5203
  },
4863
- "FlakyResponse": {
5204
+ "TestsResponse": {
4864
5205
  "type": "object",
4865
5206
  "properties": {
4866
5207
  "project": {
@@ -4878,43 +5219,78 @@
4878
5219
  "name"
4879
5220
  ]
4880
5221
  },
4881
- "windowDays": {
5222
+ "population": {
5223
+ "type": "string",
5224
+ "const": "ci_completed_not_excluded",
5225
+ "description": "Which runs every number counts: completed CI runs (reported with a CI provider) started inside the period, without the runs excluded as a mass failure (at least 20 tests, over 80% of them failed). Every branch unless the branch parameter names one. Local runs never count."
5226
+ },
5227
+ "days": {
4882
5228
  "type": "integer",
4883
- "description": "The engine's fixed window in days. The flaky list takes no other period."
5229
+ "description": "The period in days, ending at until."
4884
5230
  },
4885
- "sort": {
4886
- "type": "string"
5231
+ "since": {
5232
+ "type": "string",
5233
+ "format": "date-time",
5234
+ "description": "Start of the period: until minus days. ISO-8601."
4887
5235
  },
4888
- "page": {
4889
- "type": "object",
4890
- "properties": {
4891
- "page": {
4892
- "type": "integer"
4893
- },
4894
- "perPage": {
4895
- "type": "integer"
5236
+ "until": {
5237
+ "type": "string",
5238
+ "format": "date-time",
5239
+ "description": "End of the period: when the numbers were computed. ISO-8601."
5240
+ },
5241
+ "branch": {
5242
+ "anyOf": [
5243
+ {
5244
+ "type": "string"
4896
5245
  },
4897
- "total": {
4898
- "type": "integer"
5246
+ {
5247
+ "type": "null"
5248
+ }
5249
+ ],
5250
+ "description": "The branch filter applied; null for every branch."
5251
+ },
5252
+ "browser": {
5253
+ "anyOf": [
5254
+ {
5255
+ "type": "string"
4899
5256
  },
4900
- "pageCount": {
4901
- "type": "integer"
5257
+ {
5258
+ "type": "null"
4902
5259
  }
4903
- },
4904
- "required": [
4905
- "page",
4906
- "perPage",
4907
- "total",
4908
- "pageCount"
5260
+ ],
5261
+ "description": "The browser filter applied; null for every test."
5262
+ },
5263
+ "sort": {
5264
+ "type": "string",
5265
+ "enum": [
5266
+ "stability",
5267
+ "flakyRate",
5268
+ "failureRate",
5269
+ "runs",
5270
+ "timeLost"
4909
5271
  ]
4910
5272
  },
4911
- "tests": {
5273
+ "page": {
5274
+ "type": "integer"
5275
+ },
5276
+ "perPage": {
5277
+ "type": "integer"
5278
+ },
5279
+ "total": {
5280
+ "type": "integer",
5281
+ "description": "Tests matching the query across all pages: every test with at least one CI run in the period, narrowed by search, branch and browser."
5282
+ },
5283
+ "pageCount": {
5284
+ "type": "integer"
5285
+ },
5286
+ "items": {
4912
5287
  "type": "array",
4913
5288
  "items": {
4914
5289
  "type": "object",
4915
5290
  "properties": {
4916
5291
  "testName": {
4917
- "type": "string"
5292
+ "type": "string",
5293
+ "description": "The stored name: Playwright's title path, the Playwright project first when there is one. The identity other test routes take."
4918
5294
  },
4919
5295
  "filePath": {
4920
5296
  "anyOf": [
@@ -4926,19 +5302,34 @@
4926
5302
  }
4927
5303
  ]
4928
5304
  },
4929
- "status": {
4930
- "type": "string"
5305
+ "browser": {
5306
+ "anyOf": [
5307
+ {
5308
+ "type": "string"
5309
+ },
5310
+ {
5311
+ "type": "null"
5312
+ }
5313
+ ],
5314
+ "description": "The Playwright project the name starts with (chromium in \"chromium > cart.spec.ts > adds an item\") - null when the name has none, i.e. when its second part is not the test's own file."
4931
5315
  },
4932
- "statusReason": {
4933
- "type": "string"
5316
+ "runs": {
5317
+ "type": "integer",
5318
+ "description": "CI runs in the period in which the test has a final attempt that did not skip: stableRuns + flakyRuns + failedRuns."
4934
5319
  },
4935
- "alsoActive": {
4936
- "type": "array",
4937
- "items": {
4938
- "type": "string"
4939
- }
5320
+ "stableRuns": {
5321
+ "type": "integer",
5322
+ "description": "Of runs, those whose final attempt passed on the first try."
4940
5323
  },
4941
- "timeLostMs": {
5324
+ "flakyRuns": {
5325
+ "type": "integer",
5326
+ "description": "Of runs, those whose final attempt passed after at least one retry."
5327
+ },
5328
+ "failedRuns": {
5329
+ "type": "integer",
5330
+ "description": "Of runs, those whose final attempt failed."
5331
+ },
5332
+ "stability": {
4942
5333
  "anyOf": [
4943
5334
  {
4944
5335
  "type": "number"
@@ -4947,13 +5338,18 @@
4947
5338
  "type": "null"
4948
5339
  }
4949
5340
  ],
4950
- "description": "Time lost to failed and retried attempts in the window, ms (approximation: wasted attempts x the final attempt duration). A failed run wastes every attempt it made, a run rescued by a retry wastes the attempts before it, and a run that passed first time wastes none - so 0 is a real measurement. Computed for every listed test; null is a guard for a test with no occurrence in the window and should not occur here."
5341
+ "description": "stableRuns / runs, a fraction from 0 to 1. null only when runs is 0."
4951
5342
  },
4952
- "flakeScore": {
4953
- "type": "number"
4954
- },
4955
- "flipRate": {
4956
- "type": "number"
5343
+ "flakyRate": {
5344
+ "anyOf": [
5345
+ {
5346
+ "type": "number"
5347
+ },
5348
+ {
5349
+ "type": "null"
5350
+ }
5351
+ ],
5352
+ "description": "flakyRuns / runs, a fraction from 0 to 1. null only when runs is 0."
4957
5353
  },
4958
5354
  "failureRate": {
4959
5355
  "anyOf": [
@@ -4963,80 +5359,149 @@
4963
5359
  {
4964
5360
  "type": "null"
4965
5361
  }
4966
- ]
4967
- },
4968
- "runsConsidered": {
4969
- "type": "integer",
4970
- "description": "How many runs flipRate and flakeScore are computed over (the flip_rate signal uses exactly these) - NOT how many runs the test appeared in, which is runsInWindow. Counted over the response's window, completed runs only (runs excluded as mass failures never count), one per run in which the test has a final result that is not skipped, and only runs that pass the revision filter: every run on the project's stableBranch (main when none is set) counts; a run on any other branch counts only if its testedRevision is set and equals the testedRevision of the test's previous run. Runs on other branches without a testedRevision do not count - squally-reporter sets one only with SAME_REPO_AS_APP=true or TESTED_REVISION - so a test that runs every day, but only on feature branches, can show 0. 0 therefore does not mean the test did not run, and it does not weaken the verdict: status can come from a signal that counts differently - retry_rate counts every run on every branch; consecutive_failures, failure_rate_flaky and failure_rate_broken count stableBranch runs only."
5362
+ ],
5363
+ "description": "failedRuns / runs, a fraction from 0 to 1. null only when runs is 0."
4971
5364
  },
4972
- "runsInWindow": {
5365
+ "timeLostMs": {
4973
5366
  "type": "integer",
4974
- "description": "Runs in the response's window that contain this test, on all branches - the plain count, with no branch or revision filter. Completed runs only (runs excluded as mass failures never count), one per run in which the test has a final result that is not skipped. Never smaller than runsConsidered, which counts only the runs flipRate is computed over."
5367
+ "description": "Time spent on attempts that did not count, in ms, summed over runs: a failed run loses every attempt it made, a run rescued by a retry the attempts before the pass, each at the final attempt's duration. 0 when every run passed on the first try."
4975
5368
  },
4976
- "failureStreak": {
4977
- "type": "integer"
5369
+ "recentResults": {
5370
+ "type": "array",
5371
+ "items": {
5372
+ "type": "object",
5373
+ "properties": {
5374
+ "runId": {
5375
+ "type": "string"
5376
+ },
5377
+ "runNumber": {
5378
+ "type": "integer"
5379
+ },
5380
+ "startedAt": {
5381
+ "type": "string",
5382
+ "format": "date-time"
5383
+ },
5384
+ "branch": {
5385
+ "anyOf": [
5386
+ {
5387
+ "type": "string"
5388
+ },
5389
+ {
5390
+ "type": "null"
5391
+ }
5392
+ ],
5393
+ "description": "The run's branch; null when its CI sent none."
5394
+ },
5395
+ "result": {
5396
+ "type": "string",
5397
+ "enum": [
5398
+ "stable",
5399
+ "flaky",
5400
+ "failed",
5401
+ "skipped"
5402
+ ],
5403
+ "description": "The run's final attempt: stable (passed on the first try), flaky (passed after at least one retry), failed, or skipped. A skipped run appears only here: it is not a run of the test, so it counts in neither runs nor any rate."
5404
+ }
5405
+ },
5406
+ "required": [
5407
+ "runId",
5408
+ "runNumber",
5409
+ "startedAt",
5410
+ "branch",
5411
+ "result"
5412
+ ]
5413
+ },
5414
+ "description": "The test's last 20 runs in the period, oldest first, including runs whose final attempt skipped (result skipped). Empty when it has none."
4978
5415
  },
4979
- "lastSeenAt": {
4980
- "type": "string",
4981
- "format": "date-time"
5416
+ "branches": {
5417
+ "type": "array",
5418
+ "items": {
5419
+ "anyOf": [
5420
+ {
5421
+ "type": "string"
5422
+ },
5423
+ {
5424
+ "type": "null"
5425
+ }
5426
+ ]
5427
+ },
5428
+ "description": "Every branch the test ran on in the period, code-point order, a null branch (a run whose CI sent none) last."
4982
5429
  },
4983
- "lastRun": {
4984
- "type": "object",
4985
- "properties": {
4986
- "runId": {
4987
- "type": "string"
4988
- },
4989
- "runNumber": {
4990
- "type": "integer"
4991
- },
4992
- "status": {
4993
- "type": "string"
5430
+ "topBranch": {
5431
+ "anyOf": [
5432
+ {
5433
+ "type": "object",
5434
+ "properties": {
5435
+ "branch": {
5436
+ "anyOf": [
5437
+ {
5438
+ "type": "string"
5439
+ },
5440
+ {
5441
+ "type": "null"
5442
+ }
5443
+ ]
5444
+ },
5445
+ "kind": {
5446
+ "type": "string",
5447
+ "enum": [
5448
+ "failures",
5449
+ "retries"
5450
+ ]
5451
+ },
5452
+ "count": {
5453
+ "type": "integer"
5454
+ }
5455
+ },
5456
+ "required": [
5457
+ "branch",
5458
+ "kind",
5459
+ "count"
5460
+ ]
4994
5461
  },
4995
- "startedAt": {
4996
- "type": "string",
4997
- "format": "date-time"
5462
+ {
5463
+ "type": "null"
4998
5464
  }
4999
- },
5000
- "required": [
5001
- "runId",
5002
- "runNumber",
5003
- "status",
5004
- "startedAt"
5005
- ]
5465
+ ],
5466
+ "description": "The branch with the most failed runs (kind failures, count = those runs); when no run failed, the branch with the most flaky runs (kind retries, count = those runs); null when neither. Ties go to the branch name in code-point order, a null branch last."
5006
5467
  }
5007
5468
  },
5008
5469
  "required": [
5009
5470
  "testName",
5010
5471
  "filePath",
5011
- "status",
5012
- "statusReason",
5013
- "alsoActive",
5014
- "timeLostMs",
5015
- "flakeScore",
5016
- "flipRate",
5472
+ "browser",
5473
+ "runs",
5474
+ "stableRuns",
5475
+ "flakyRuns",
5476
+ "failedRuns",
5477
+ "stability",
5478
+ "flakyRate",
5017
5479
  "failureRate",
5018
- "runsConsidered",
5019
- "runsInWindow",
5020
- "failureStreak",
5021
- "lastSeenAt",
5022
- "lastRun"
5480
+ "timeLostMs",
5481
+ "recentResults",
5482
+ "branches",
5483
+ "topBranch"
5023
5484
  ]
5024
5485
  }
5025
- },
5026
- "gatheringDataCount": {
5027
- "type": "integer"
5028
5486
  }
5029
5487
  },
5030
5488
  "required": [
5031
5489
  "project",
5032
- "windowDays",
5490
+ "population",
5491
+ "days",
5492
+ "since",
5493
+ "until",
5494
+ "branch",
5495
+ "browser",
5033
5496
  "sort",
5034
5497
  "page",
5035
- "tests",
5036
- "gatheringDataCount"
5498
+ "perPage",
5499
+ "total",
5500
+ "pageCount",
5501
+ "items"
5037
5502
  ]
5038
5503
  },
5039
- "V4StatusResponse": {
5504
+ "TestMetricsResponse": {
5040
5505
  "type": "object",
5041
5506
  "properties": {
5042
5507
  "project": {
@@ -5054,77 +5519,235 @@
5054
5519
  "name"
5055
5520
  ]
5056
5521
  },
5057
- "test": {
5058
- "type": "object",
5059
- "properties": {
5060
- "name": {
5522
+ "population": {
5523
+ "type": "string",
5524
+ "const": "ci_completed_not_excluded",
5525
+ "description": "Which runs every number counts: completed CI runs (reported with a CI provider) started inside the period, without the runs excluded as a mass failure (at least 20 tests, over 80% of them failed). Every branch unless the branch parameter names one. Local runs never count."
5526
+ },
5527
+ "days": {
5528
+ "type": "integer",
5529
+ "description": "The period in days, ending at until."
5530
+ },
5531
+ "since": {
5532
+ "type": "string",
5533
+ "format": "date-time",
5534
+ "description": "Start of the period: until minus days. ISO-8601."
5535
+ },
5536
+ "until": {
5537
+ "type": "string",
5538
+ "format": "date-time",
5539
+ "description": "End of the period: when the numbers were computed. ISO-8601."
5540
+ },
5541
+ "branch": {
5542
+ "anyOf": [
5543
+ {
5061
5544
  "type": "string"
5062
5545
  },
5063
- "filePath": {
5064
- "anyOf": [
5065
- {
5066
- "type": "string"
5067
- },
5068
- {
5069
- "type": "null"
5070
- }
5071
- ]
5546
+ {
5547
+ "type": "null"
5072
5548
  }
5073
- },
5074
- "required": [
5075
- "name",
5076
- "filePath"
5077
- ]
5549
+ ],
5550
+ "description": "The branch filter applied; null for every branch."
5078
5551
  },
5079
- "status": {
5552
+ "testName": {
5080
5553
  "type": "string",
5081
- "enum": [
5082
- "insufficient_data",
5083
- "healthy",
5084
- "flaky",
5085
- "broken"
5554
+ "description": "The stored name: Playwright's title path, the Playwright project first when there is one. The identity other test routes take."
5555
+ },
5556
+ "filePath": {
5557
+ "anyOf": [
5558
+ {
5559
+ "type": "string"
5560
+ },
5561
+ {
5562
+ "type": "null"
5563
+ }
5086
5564
  ]
5087
5565
  },
5088
- "awaitingFirstWrite": {
5089
- "type": "boolean",
5090
- "description": "True when the test is known but no verdict has been stored for it yet; status then reads insufficient_data."
5566
+ "browser": {
5567
+ "anyOf": [
5568
+ {
5569
+ "type": "string"
5570
+ },
5571
+ {
5572
+ "type": "null"
5573
+ }
5574
+ ],
5575
+ "description": "The Playwright project the name starts with (chromium in \"chromium > cart.spec.ts > adds an item\") - null when the name has none, i.e. when its second part is not the test's own file."
5576
+ },
5577
+ "runs": {
5578
+ "type": "integer",
5579
+ "description": "CI runs in the period in which the test has a final attempt that did not skip: stableRuns + flakyRuns + failedRuns."
5580
+ },
5581
+ "stableRuns": {
5582
+ "type": "integer",
5583
+ "description": "Of runs, those whose final attempt passed on the first try."
5584
+ },
5585
+ "flakyRuns": {
5586
+ "type": "integer",
5587
+ "description": "Of runs, those whose final attempt passed after at least one retry."
5588
+ },
5589
+ "failedRuns": {
5590
+ "type": "integer",
5591
+ "description": "Of runs, those whose final attempt failed."
5592
+ },
5593
+ "stability": {
5594
+ "anyOf": [
5595
+ {
5596
+ "type": "number"
5597
+ },
5598
+ {
5599
+ "type": "null"
5600
+ }
5601
+ ],
5602
+ "description": "stableRuns / runs, a fraction from 0 to 1. null only when runs is 0."
5603
+ },
5604
+ "flakyRate": {
5605
+ "anyOf": [
5606
+ {
5607
+ "type": "number"
5608
+ },
5609
+ {
5610
+ "type": "null"
5611
+ }
5612
+ ],
5613
+ "description": "flakyRuns / runs, a fraction from 0 to 1. null only when runs is 0."
5091
5614
  },
5092
- "activeSignals": {
5615
+ "failureRate": {
5616
+ "anyOf": [
5617
+ {
5618
+ "type": "number"
5619
+ },
5620
+ {
5621
+ "type": "null"
5622
+ }
5623
+ ],
5624
+ "description": "failedRuns / runs, a fraction from 0 to 1. null only when runs is 0."
5625
+ },
5626
+ "timeLostMs": {
5627
+ "type": "integer",
5628
+ "description": "Time spent on attempts that did not count, in ms, summed over runs: a failed run loses every attempt it made, a run rescued by a retry the attempts before the pass, each at the final attempt's duration. 0 when every run passed on the first try."
5629
+ },
5630
+ "recentResults": {
5093
5631
  "type": "array",
5094
5632
  "items": {
5095
5633
  "type": "object",
5096
5634
  "properties": {
5097
- "signal": {
5635
+ "runId": {
5098
5636
  "type": "string"
5099
5637
  },
5100
- "label": {
5101
- "type": "string"
5638
+ "runNumber": {
5639
+ "type": "integer"
5640
+ },
5641
+ "startedAt": {
5642
+ "type": "string",
5643
+ "format": "date-time"
5644
+ },
5645
+ "branch": {
5646
+ "anyOf": [
5647
+ {
5648
+ "type": "string"
5649
+ },
5650
+ {
5651
+ "type": "null"
5652
+ }
5653
+ ],
5654
+ "description": "The run's branch; null when its CI sent none."
5655
+ },
5656
+ "result": {
5657
+ "type": "string",
5658
+ "enum": [
5659
+ "stable",
5660
+ "flaky",
5661
+ "failed",
5662
+ "skipped"
5663
+ ],
5664
+ "description": "The run's final attempt: stable (passed on the first try), flaky (passed after at least one retry), failed, or skipped. A skipped run appears only here: it is not a run of the test, so it counts in neither runs nor any rate."
5102
5665
  }
5103
5666
  },
5104
5667
  "required": [
5105
- "signal",
5106
- "label"
5668
+ "runId",
5669
+ "runNumber",
5670
+ "startedAt",
5671
+ "branch",
5672
+ "result"
5107
5673
  ]
5108
- }
5674
+ },
5675
+ "description": "The test's last 20 runs in the period, oldest first, including runs whose final attempt skipped (result skipped). Empty when it has none."
5109
5676
  },
5110
- "labels": {
5677
+ "branches": {
5111
5678
  "type": "array",
5112
5679
  "items": {
5113
- "type": "string",
5114
- "enum": [
5115
- "flips",
5116
- "retries"
5680
+ "anyOf": [
5681
+ {
5682
+ "type": "string"
5683
+ },
5684
+ {
5685
+ "type": "null"
5686
+ }
5117
5687
  ]
5118
- }
5688
+ },
5689
+ "description": "Every branch the test ran on in the period, code-point order, a null branch (a run whose CI sent none) last."
5690
+ },
5691
+ "topBranch": {
5692
+ "anyOf": [
5693
+ {
5694
+ "type": "object",
5695
+ "properties": {
5696
+ "branch": {
5697
+ "anyOf": [
5698
+ {
5699
+ "type": "string"
5700
+ },
5701
+ {
5702
+ "type": "null"
5703
+ }
5704
+ ]
5705
+ },
5706
+ "kind": {
5707
+ "type": "string",
5708
+ "enum": [
5709
+ "failures",
5710
+ "retries"
5711
+ ]
5712
+ },
5713
+ "count": {
5714
+ "type": "integer"
5715
+ }
5716
+ },
5717
+ "required": [
5718
+ "branch",
5719
+ "kind",
5720
+ "count"
5721
+ ]
5722
+ },
5723
+ {
5724
+ "type": "null"
5725
+ }
5726
+ ],
5727
+ "description": "The branch with the most failed runs (kind failures, count = those runs); when no run failed, the branch with the most flaky runs (kind retries, count = those runs); null when neither. Ties go to the branch name in code-point order, a null branch last."
5119
5728
  }
5120
5729
  },
5121
5730
  "required": [
5122
5731
  "project",
5123
- "test",
5124
- "status",
5125
- "awaitingFirstWrite",
5126
- "activeSignals",
5127
- "labels"
5732
+ "population",
5733
+ "days",
5734
+ "since",
5735
+ "until",
5736
+ "branch",
5737
+ "testName",
5738
+ "filePath",
5739
+ "browser",
5740
+ "runs",
5741
+ "stableRuns",
5742
+ "flakyRuns",
5743
+ "failedRuns",
5744
+ "stability",
5745
+ "flakyRate",
5746
+ "failureRate",
5747
+ "timeLostMs",
5748
+ "recentResults",
5749
+ "branches",
5750
+ "topBranch"
5128
5751
  ]
5129
5752
  },
5130
5753
  "TestHistoryResponse": {
@@ -5755,7 +6378,8 @@
5755
6378
  ]
5756
6379
  },
5757
6380
  "runsInWindow": {
5758
- "type": "integer"
6381
+ "type": "integer",
6382
+ "description": "Completed CI runs in the window on branchScope, without mass-failure runs - the runs windowStability is counted over."
5759
6383
  },
5760
6384
  "suiteSize": {
5761
6385
  "type": "integer"
@@ -5768,7 +6392,8 @@
5768
6392
  {
5769
6393
  "type": "null"
5770
6394
  }
5771
- ]
6395
+ ],
6396
+ "description": "Suite stability, 0-100: of the final test results in the window's completed CI runs on branchScope (mass-failure runs and skipped results left out), the share that passed on the first try, rounded. A result that passed only after a retry counts against it. null when no such result exists."
5772
6397
  },
5773
6398
  "timeLost": {
5774
6399
  "type": "object",
@@ -5806,24 +6431,49 @@
5806
6431
  "failing": {
5807
6432
  "type": "integer"
5808
6433
  },
5809
- "withVerdict": {
5810
- "type": "integer"
5811
- },
5812
6434
  "testsRun": {
5813
6435
  "type": "integer"
5814
6436
  }
5815
6437
  },
5816
6438
  "required": [
5817
6439
  "failing",
5818
- "withVerdict",
5819
6440
  "testsRun"
5820
- ]
5821
- },
5822
- "flakyOrBrokenCount": {
5823
- "type": "integer"
6441
+ ],
6442
+ "description": "Tests that failed at least once in the window on branchScope, out of the tests those runs reported - every run, local ones included. Not the dashboard's Failing tests tile: that is testMetrics.failingTests, over CI runs on every branch."
5824
6443
  },
5825
- "flakyWindowDays": {
5826
- "type": "integer"
6444
+ "testMetrics": {
6445
+ "type": "object",
6446
+ "properties": {
6447
+ "population": {
6448
+ "type": "string",
6449
+ "const": "ci_completed_not_excluded",
6450
+ "description": "Which runs every number counts: completed CI runs (reported with a CI provider) started inside the period, without the runs excluded as a mass failure (at least 20 tests, over 80% of them failed). Every branch unless the branch parameter names one. Local runs never count."
6451
+ },
6452
+ "days": {
6453
+ "type": "integer",
6454
+ "description": "The period in days: the same as window.days."
6455
+ },
6456
+ "testsWithRetries": {
6457
+ "type": "integer",
6458
+ "description": "Of ciTests, the tests with at least one flaky run in the period (a final attempt that passed after a retry)."
6459
+ },
6460
+ "failingTests": {
6461
+ "type": "integer",
6462
+ "description": "Of ciTests, the tests with at least one failed run in the period."
6463
+ },
6464
+ "ciTests": {
6465
+ "type": "integer",
6466
+ "description": "Tests with at least one CI run in the period."
6467
+ }
6468
+ },
6469
+ "required": [
6470
+ "population",
6471
+ "days",
6472
+ "testsWithRetries",
6473
+ "failingTests",
6474
+ "ciTests"
6475
+ ],
6476
+ "description": "The dashboard's Tests with retries and Failing tests tiles and their denominator, counted like /tests: CI runs only, every branch - not narrowed by branchScope. The top-level failingTests counts differently: every run in the window on branchScope, local ones included."
5827
6477
  },
5828
6478
  "slowestTests": {
5829
6479
  "type": "array",
@@ -5932,8 +6582,7 @@
5932
6582
  "windowStability",
5933
6583
  "timeLost",
5934
6584
  "failingTests",
5935
- "flakyOrBrokenCount",
5936
- "flakyWindowDays",
6585
+ "testMetrics",
5937
6586
  "slowestTests",
5938
6587
  "timeSinks",
5939
6588
  "runsSeries"