Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

fix(visual-review): stop listing absorbed drift as noisy in flakiness (#113162)

Julian Bez6dff2f70e16a
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 29df06f08f8a..b4bfd906907b 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -13971,13 +13971,13 @@ snapshots:
scenes-app-visual-review-flakiness--could-not-load--light:
hash: v1.k794b7964.5119397214de62b75921741010980f978628fe51001f93fb553577f696a639b6.UMrYhyQ1Nv8Z0JH1XJWFPl6nHdkAqtMWq8hk3ypDmfo
scenes-app-visual-review-flakiness--nothing-to-show--dark:
- hash: v1.k794b7964.f7fd2f2c682f53cda60735fe414da42f4b901a8aec28626d6707b82139d72038.zGQ9RsZZ8hz6OVZinYDscHO99oJ_aUc_74PL-94z9P4
+ hash: v1.k794b7964.9d4c5d4a2343859716250440ee0b6bb26399e39d11ebd13c5fa2cc68d4f961b2.rMU3ZZ6mu_jHa4Khi6eGtmq4hq0qidNNlsI_lMN2wQg
scenes-app-visual-review-flakiness--nothing-to-show--light:
- hash: v1.k794b7964.099f7cf91596a9cb775d2936404ce36f55ff670df7b02e336fa9e68dbcbc3f64.SEL1SJqeSDSHYy8DECMu7cK3hXN73TQe6QquscuJIFQ
+ hash: v1.k794b7964.456d0144898fd68ad53f429e13e6696d47b70aac5cfece2a15b204378ee82793.ywddpmqHFWNPMD1SPtTwFOvyuCHggjZH6b1tRinBSkg
scenes-app-visual-review-flakiness--unstable--dark:
- hash: v1.k794b7964.12bc6373464176d7fb6b9251bb7d6342cd381a64e3ee28c8380045b06f5e97ec.BLZ-Fbl_W9xx4oAA39xVucIxMtSpBAzm5Pwp6f1Bk6w
+ hash: v1.k794b7964.3a0b8246b281cd8861495469567eb85eeedec17ec1b8db3d14e730ac7c5957bb.pIML51aJvFUdsEDw5nUaCTxejqGWscTBmFAGnrh1Axk
scenes-app-visual-review-flakiness--unstable--light:
- hash: v1.k794b7964.26ff0c274624f9d1ea71f4377d104d5e4feae204ba8ea0b68735c7f5fae8423e.WaXT0zPJ1WHOerBWKkJmHERCIZwpJT_L_4AHvWL3bSE
+ hash: v1.k794b7964.ce4999b498ff455fedeeb554f5ea6cbaaed7b91b92f77b674e7fad59a79bcc60.epcReErfeQQrr2dQujDtIXAwrSGAbIf7OpXZ1m3xXe4
scenes-app-visual-review-run--clean-quarantined-stories--dark:
hash: v1.k794b7964.453c5fceef7e5351174d1391762ed725663a12ff3f494a06744b4dcec0573fc1.EBH6vLSFPVFcutmHJ_MeoOgN_Wl-Ss5mwBy-U1ENPgE
scenes-app-visual-review-run--clean-quarantined-stories--light:
diff --git a/products/visual_review/README.md b/products/visual_review/README.md
index 86d9c8f89788..bea5eb11bf27 100644
--- a/products/visual_review/README.md
+++ b/products/visual_review/README.md
@@ -320,11 +320,11 @@ The states are an urgency ladder, and each rung asks for a different fix:
| `broken` | Fails nearly every run | Correct the baseline; a quarantine hides it |
| `unstable` | Fails some runs and not others | Stabilize the story, or quarantine it |
| `at_risk` | Never fails, but its worst absorbed diff is near the threshold | Fix it before it starts failing |
-| `noisy` | Renders variants, absorbed with room to spare | Nothing |
-| `clean` | Nothing failing or absorbed inside the rate span | Nothing |
+| `clean` | Nothing failing or at risk inside the rate span | Nothing |
-The page groups `noisy` and `clean` under one "Quiet" tile, so every listed entry is reachable from some tile.
-A row can be listed for history the rate span no longer counts, and it would otherwise sit in the totals with no way to display it.
+A diff absorbed far below the threshold is `clean`, and on its own it does not list a row.
+Every variant is diffed against the baseline itself, so the thresholds bound the total drift, and the absorption is internal handling rather than instability.
+A `clean` row is listed only for a quarantine or for gate failures further back in the read window, and the page shows it under the "Quiet" tile so every listed entry is reachable from some tile.
`at_risk` exists because always being absorbed is not a safety property.
A snapshot passes only while it stays under both diff thresholds, so one absorbed at 0.01% will never cross and one absorbed just under the line is a hard failure waiting for the next unrelated restyle.
diff --git a/products/visual_review/backend/facade/api.py b/products/visual_review/backend/facade/api.py
index 0d5e817e8599..fd43609915ab 100644
--- a/products/visual_review/backend/facade/api.py
+++ b/products/visual_review/backend/facade/api.py
@@ -486,7 +486,6 @@ def get_flakiness_overview(repo_id: UUID, team_id: int) -> contracts.FlakinessOv
broken=raw.totals_broken,
unstable=raw.totals_unstable,
at_risk=raw.totals_at_risk,
- noisy=raw.totals_noisy,
clean=raw.totals_clean,
quarantined=raw.totals_quarantined,
needs_decision=raw.totals_needs_decision,
diff --git a/products/visual_review/backend/facade/contracts.py b/products/visual_review/backend/facade/contracts.py
index 72c93212fda1..087bb192efcd 100644
--- a/products/visual_review/backend/facade/contracts.py
+++ b/products/visual_review/backend/facade/contracts.py
@@ -779,10 +779,6 @@ class FlakinessTotals:
broken: int
unstable: int
at_risk: int
- noisy: int
- # Listed, but nothing failing or absorbed inside the rate span. A row
- # reaches this state by carrying live variants, or history further back in
- # the read window, so it is reported rather than silently unreachable.
clean: int
quarantined: int
needs_decision: int
diff --git a/products/visual_review/backend/facade/enums.py b/products/visual_review/backend/facade/enums.py
index f8db2635fa7a..e771db9188db 100644
--- a/products/visual_review/backend/facade/enums.py
+++ b/products/visual_review/backend/facade/enums.py
@@ -117,8 +117,7 @@ class FlakinessState(StrEnum):
BROKEN = "broken" # Fails nearly every run: the baseline is wrong, not the story
UNSTABLE = "unstable" # Fails some runs and not others: the classic flake
AT_RISK = "at_risk" # Never fails, but its diff is already touching the threshold
- NOISY = "noisy" # Renders variants, absorbed with room to spare
- CLEAN = "clean" # Matched its baseline on every run in the window
+ CLEAN = "clean" # No gate failure in the window, and any absorbed diff is far below the threshold
class ActorType(StrEnum):
diff --git a/products/visual_review/backend/logic/flakiness.py b/products/visual_review/backend/logic/flakiness.py
index 5d848fc534c4..19f06b4f60de 100644
--- a/products/visual_review/backend/logic/flakiness.py
+++ b/products/visual_review/backend/logic/flakiness.py
@@ -381,6 +381,14 @@ def get_flakiness_overview(repo_id: UUID) -> _FlakinessRaw:
worst_soft_diff = soft.worst_diff_percentage if soft is not None else None
hard_rate = _rate(hard_count, window_runs)
headroom = _headroom(worst_soft_diff)
+ state = _state(
+ hard_rate=hard_rate,
+ soft_count=soft_count,
+ headroom=headroom,
+ window_runs=window_runs,
+ )
+ if state == FlakinessState.CLEAN and quarantine is None and hard is None:
+ continue
rows.append(
_FlakinessRow(
run_type=key.run_type,
@@ -409,12 +417,7 @@ def get_flakiness_overview(repo_id: UUID) -> _FlakinessRaw:
length=FLAKINESS_WINDOW_DAYS,
),
baseline_moved_at=baseline_moved_at_by_key.get(key),
- state=_state(
- hard_rate=hard_rate,
- soft_count=soft_count,
- headroom=headroom,
- window_runs=window_runs,
- ),
+ state=state,
quarantine=quarantine,
needs_decision=_needs_decision(
quarantine=quarantine,
@@ -460,7 +463,6 @@ def get_flakiness_overview(repo_id: UUID) -> _FlakinessRaw:
totals_broken=sum(1 for row in rows if row.state == FlakinessState.BROKEN),
totals_unstable=sum(1 for row in rows if row.state == FlakinessState.UNSTABLE),
totals_at_risk=sum(1 for row in rows if row.state == FlakinessState.AT_RISK),
- totals_noisy=sum(1 for row in rows if row.state == FlakinessState.NOISY),
totals_clean=sum(1 for row in rows if row.state == FlakinessState.CLEAN),
totals_quarantined=sum(1 for row in rows if row.quarantine is not None),
totals_needs_decision=sum(1 for row in rows if row.needs_decision),
@@ -516,7 +518,6 @@ def _quarantine_only_raw(
totals_broken=0,
totals_unstable=0,
totals_at_risk=0,
- totals_noisy=0,
totals_clean=len(rows),
# Totals count the whole population, as they do on the normal path, so
# the tiles stay right when the list is capped.
@@ -619,21 +620,18 @@ def _state(*, hard_rate: float, soft_count: int, headroom: float | None, window_
return FlakinessState.BROKEN
if hard_rate > 0:
return FlakinessState.UNSTABLE
- if soft_count == 0:
- return FlakinessState.CLEAN
- if headroom is not None and headroom < FLAKINESS_MIN_HEADROOM:
+ if soft_count > 0 and headroom is not None and headroom < FLAKINESS_MIN_HEADROOM:
return FlakinessState.AT_RISK
- return FlakinessState.NOISY
+ return FlakinessState.CLEAN
# How far up the ladder each state sits, for ordering against the entry cap.
# Keyed by `str` because `_state` returns one: `FlakinessState` is a `StrEnum`,
# so the members are the keys either way.
_STATE_URGENCY: dict[str, int] = {
- FlakinessState.BROKEN: 4,
- FlakinessState.UNSTABLE: 3,
- FlakinessState.AT_RISK: 2,
- FlakinessState.NOISY: 1,
+ FlakinessState.BROKEN: 3,
+ FlakinessState.UNSTABLE: 2,
+ FlakinessState.AT_RISK: 1,
FlakinessState.CLEAN: 0,
}
@@ -775,7 +773,6 @@ class _FlakinessRaw:
totals_broken: int
totals_unstable: int
totals_at_risk: int
- totals_noisy: int
totals_clean: int
totals_quarantined: int
totals_needs_decision: int
@@ -794,7 +791,6 @@ class _FlakinessRaw:
totals_broken=0,
totals_unstable=0,
totals_at_risk=0,
- totals_noisy=0,
totals_clean=0,
totals_quarantined=0,
totals_needs_decision=0,
diff --git a/products/visual_review/backend/presentation/serializers.py b/products/visual_review/backend/presentation/serializers.py
index 0b6b7c7d2bce..31c8d97a7b00 100644
--- a/products/visual_review/backend/presentation/serializers.py
+++ b/products/visual_review/backend/presentation/serializers.py
@@ -655,8 +655,8 @@ class FlakinessEntrySerializer(DataclassSerializer):
"every run, so its baseline is wrong and quarantining it only hides that. `unstable` "
"fails some runs and not others, the classic flake. `at_risk` never fails, but its "
"worst absorbed diff is already touching the threshold, so the next unrelated change "
- "turns it red. `noisy` renders variants and absorbs them with room to spare. `clean` "
- "matched its baseline on every run in the window."
+ "turns it red. `clean` has no gate failure inside the rate span, and any diff it absorbed "
+ "sits far below the threshold."
),
)
needs_decision = serializers.BooleanField(
@@ -696,11 +696,10 @@ class FlakinessTotalsSerializer(DataclassSerializer):
broken = serializers.IntegerField(help_text="Identifiers whose `flakiness_state` is `broken`.")
unstable = serializers.IntegerField(help_text="Identifiers whose `flakiness_state` is `unstable`.")
at_risk = serializers.IntegerField(help_text="Identifiers whose `flakiness_state` is `at_risk`.")
- noisy = serializers.IntegerField(help_text="Identifiers whose `flakiness_state` is `noisy`.")
clean = serializers.IntegerField(
help_text=(
- "Identifiers whose `flakiness_state` is `clean`. They are listed because they carry live "
- "variants or older history, and reported here so every listed entry is reachable."
+ "Identifiers whose `flakiness_state` is `clean`. They are listed because they carry a "
+ "quarantine or older gate failures, and reported here so every listed entry is reachable."
)
)
by_run_type = serializers.DictField(
diff --git a/products/visual_review/backend/presentation/views.py b/products/visual_review/backend/presentation/views.py
index c0ab9f0751b4..b3f36e6cf890 100644
--- a/products/visual_review/backend/presentation/views.py
+++ b/products/visual_review/backend/presentation/views.py
@@ -402,9 +402,10 @@ class RepoViewSet(TeamAndOrgViewSetMixin, viewsets.GenericViewSet):
parameters=[OpenApiParameter("id", OpenApiTypes.STR, OpenApiParameter.PATH)],
responses={200: FlakinessOverviewSerializer},
description=(
- "Snapshots in a repo whose rendering cannot be trusted: those that failed the gate or "
- "were absorbed by a toleration on a recent default-branch run, and those under an "
- "active quarantine. Everything else is omitted, so this is far smaller than the "
+ "Snapshots in a repo whose rendering cannot be trusted: those that failed the gate on a "
+ "recent default-branch run, those whose absorbed diff is close to the threshold, and those "
+ "under an active quarantine. Small absorbed diffs well under the threshold are omitted, as is "
+ "everything else, so this is far smaller than the "
"baselines universe; `totals.tracked` gives the full denominator. Each entry carries "
f"the share of the last {contracts.FLAKINESS_RATE_DAYS} days of default-branch runs "
"that failed the gate (`hard_rate`) and the share a toleration absorbed "
diff --git a/products/visual_review/backend/tests/test_flakiness.py b/products/visual_review/backend/tests/test_flakiness.py
index c9d6e02616ab..337955f65566 100644
--- a/products/visual_review/backend/tests/test_flakiness.py
+++ b/products/visual_review/backend/tests/test_flakiness.py
@@ -335,12 +335,12 @@ class TestFlakinessOverview(VisualReviewTeamScopedTestMixin, APIBaseTest):
@parameterized.expand(
[
- ("far_under_the_threshold", 0.01, FlakinessState.NOISY),
+ ("far_under_the_threshold", 0.01, None),
("touching_the_threshold", PIXEL_DIFF_THRESHOLD_PERCENT - 0.05, FlakinessState.AT_RISK),
]
)
- def test_headroom_separates_absorbed_noise_from_a_snapshot_on_the_edge(
- self, _name: str, worst_diff: float, expected: str
+ def test_headroom_separates_absorbed_drift_from_a_snapshot_on_the_edge(
+ self, _name: str, worst_diff: float, expected: str | None
):
# Always being absorbed is not a safety property. A snapshot is absorbed
# only while it stays under the threshold, so one sitting just under the
@@ -353,9 +353,7 @@ class TestFlakinessOverview(VisualReviewTeamScopedTestMixin, APIBaseTest):
entry = self._entry("jittery")
- assert entry is not None
- assert entry.worst_soft_diff_percentage == worst_diff
- assert entry.flakiness_state == expected
+ assert (entry.flakiness_state if entry is not None else None) == expected
def test_a_snapshot_failing_the_gate_is_listed_without_recording_a_variant(self):
# A hard failure mints nothing, so a population drawn from tolerations
@@ -389,6 +387,7 @@ class TestFlakinessOverview(VisualReviewTeamScopedTestMixin, APIBaseTest):
diff_percentage=0.02,
tolerated_hash_match=variant if outcome == SOFT_MATCH else None,
)
+ self._mk_quarantine("jittery")
entry = self._entry("jittery")
@@ -414,12 +413,8 @@ class TestFlakinessOverview(VisualReviewTeamScopedTestMixin, APIBaseTest):
tolerated_hash_match=tolerated,
)
- entry = self._entry("accepted")
-
- assert entry is not None
- assert entry.soft_count == 1 # only the auto-minted match
- assert entry.worst_soft_diff_percentage == 0.01
- assert entry.flakiness_state == FlakinessState.NOISY
+ # Counting the human matches would make it at risk, and so listed.
+ assert self._entry("accepted") is None
def test_the_rate_denominator_covers_the_same_days_as_its_numerator(self):
# The numerator is summed from per-day buckets while the denominator was
@@ -509,6 +504,7 @@ class TestFlakinessOverview(VisualReviewTeamScopedTestMixin, APIBaseTest):
for index in range(5):
self._mk_variant(identifier="redesigned", alternate_hash=f"old-{index}", baseline_hash="baseline-previous")
self._mk_variant(identifier="redesigned", alternate_hash="new-0")
+ self._mk_quarantine("redesigned")
entry = self._entry("redesigned")
@@ -542,6 +538,7 @@ class TestFlakinessOverview(VisualReviewTeamScopedTestMixin, APIBaseTest):
alternate_hash="dead",
expires_at=timezone.now() - timedelta(days=1),
)
+ self._mk_quarantine("lapsed")
entry = self._entry("lapsed")
@@ -597,6 +594,7 @@ class TestFlakinessOverview(VisualReviewTeamScopedTestMixin, APIBaseTest):
_mk_snapshot(main_run, identifier="shared", baseline_hash="baseline-stale")
_mk_snapshot(self.master_run, identifier="shared")
self._mk_variant(identifier="shared", alternate_hash="a")
+ self._mk_quarantine("shared")
entry = self._entry("shared")
@@ -631,24 +629,32 @@ class TestFlakinessOverview(VisualReviewTeamScopedTestMixin, APIBaseTest):
# one row somebody has to answer, and it carries the least activity.
_mk_snapshot(self.master_run, identifier="muted")
self._mk_quarantine("muted")
- _mk_snapshot(self.master_run, identifier="noisy")
- variant = self._mk_variant(identifier="noisy", alternate_hash="a")
- self._render("noisy", outcome=SOFT_MATCH, count=5, diff_percentage=0.01, tolerated_hash_match=variant)
+ _mk_snapshot(self.master_run, identifier="edge")
+ variant = self._mk_variant(identifier="edge", alternate_hash="a")
+ self._render(
+ "edge",
+ outcome=SOFT_MATCH,
+ count=5,
+ diff_percentage=PIXEL_DIFF_THRESHOLD_PERCENT - 0.05,
+ tolerated_hash_match=variant,
+ )
result = vr_api.get_flakiness_overview(self.repo.id, self.team.id)
- assert [e.identifier for e in result.entries] == ["muted", "noisy"]
+ assert [e.identifier for e in result.entries] == ["muted", "edge"]
def test_snapshots_with_nothing_to_report_are_not_listed(self):
_mk_snapshot(self.master_run, identifier="stable")
- _mk_snapshot(self.master_run, identifier="flaky")
- self._mk_variant(identifier="flaky", alternate_hash="a")
+ _mk_snapshot(self.master_run, identifier="drifting")
+ self._mk_variant(identifier="drifting", alternate_hash="a")
+ _mk_snapshot(self.master_run, identifier="flaky", outcome=HARD)
+ self._render("flaky", outcome=HARD)
result = vr_api.get_flakiness_overview(self.repo.id, self.team.id)
assert [e.identifier for e in result.entries] == ["flaky"]
assert result.totals.listed == 1
- assert result.totals.tracked == 2
+ assert result.totals.tracked == 3
def test_the_denominator_counts_only_snapshots_with_a_baseline(self):
_mk_snapshot(self.master_run, identifier="compared")
@@ -681,7 +687,7 @@ class TestFlakinessOverview(VisualReviewTeamScopedTestMixin, APIBaseTest):
created_at=timezone.now() - timedelta(days=FLAKINESS_WINDOW_DAYS + 10)
)
_mk_snapshot(self.master_run, identifier="flaky")
- self._mk_variant(identifier="flaky", alternate_hash="a")
+ self._mk_quarantine("flaky")
entry = self._entry("flaky")
@@ -705,16 +711,17 @@ class TestFlakinessOverview(VisualReviewTeamScopedTestMixin, APIBaseTest):
totals = vr_api.get_flakiness_overview(self.repo.id, self.team.id).totals
assert totals.tracked == 3
- assert totals.listed == 2
+ assert totals.listed == 1
assert totals.broken == 1
- assert totals.noisy == 1
+ assert totals.clean == 0
assert totals.quarantined == 1
- assert totals.by_run_type == {RunType.STORYBOOK: 2}
+ assert totals.by_run_type == {RunType.STORYBOOK: 1}
def test_endpoint_serializes_the_overview(self):
_mk_snapshot(self.master_run, identifier="flaky")
- variant = self._mk_variant(identifier="flaky", alternate_hash="a", diff_percentage=0.04)
- self._render("flaky", outcome=SOFT_MATCH, diff_percentage=0.04, tolerated_hash_match=variant)
+ edge_diff = PIXEL_DIFF_THRESHOLD_PERCENT - 0.05
+ variant = self._mk_variant(identifier="flaky", alternate_hash="a", diff_percentage=edge_diff)
+ self._render("flaky", outcome=SOFT_MATCH, diff_percentage=edge_diff, tolerated_hash_match=variant)
url = f"/api/projects/{self.team.id}/visual_review/repos/{self.repo.id}/flakiness/"
response = self.client.get(url)
@@ -725,7 +732,7 @@ class TestFlakinessOverview(VisualReviewTeamScopedTestMixin, APIBaseTest):
entry = data["entries"][0]
assert entry["variant_count"] == 1
assert entry["soft_count"] == 1
- assert entry["flakiness_state"] == FlakinessState.NOISY
+ assert entry["flakiness_state"] == FlakinessState.AT_RISK
assert len(entry["daily_hard_counts"]) == FLAKINESS_WINDOW_DAYS
assert data["totals"]["tracked"] == 1
diff --git a/products/visual_review/frontend/components/FlakinessStatRow.tsx b/products/visual_review/frontend/components/FlakinessStatRow.tsx
index c7a1d6cb0fde..a179911b570c 100644
--- a/products/visual_review/frontend/components/FlakinessStatRow.tsx
+++ b/products/visual_review/frontend/components/FlakinessStatRow.tsx
@@ -38,7 +38,7 @@ const STATS: Array<{ value: FlakinessPreset; label: string; description: string
{
value: 'quiet',
label: 'Quiet',
- description: 'Absorbed with room to spare, or nothing failing now',
+ description: 'Nothing failing now',
},
{
value: 'quarantined',
@@ -58,10 +58,9 @@ interface FlakinessStatRowProps {
* one wants.
*
* Together they have to cover every listed row. `quiet` is the catch-all that
- * makes that hold: it takes both `noisy` and `clean`, because a row can be
- * listed for history the rate span no longer counts and would otherwise show
- * in the totals while no tile could reach it. The State column still names the
- * precise state, so nothing is lost by grouping them here.
+ * makes that hold: it takes the `clean` rows, which are listed for a
+ * quarantine or for history the rate span no longer counts, and would
+ * otherwise show in the totals while no tile could reach them.
*
* There is still no "all snapshots" tile: that would repeat the Snapshots tab
* and open thousands of rows with nothing to act on.
diff --git a/products/visual_review/frontend/components/FlakinessStateCell.tsx b/products/visual_review/frontend/components/FlakinessStateCell.tsx
index 1f10e1eb3923..212d97c2b906 100644
--- a/products/visual_review/frontend/components/FlakinessStateCell.tsx
+++ b/products/visual_review/frontend/components/FlakinessStateCell.tsx
@@ -22,15 +22,10 @@ const STATE_TAG: Record<
type: 'warning',
title: 'Never fails today, but its worst diff is already close to the threshold. The next unrelated rendering change turns it red.',
},
- noisy: {
- label: 'Noisy',
- type: 'muted',
- title: 'Renders more than one image, and the tolerated variants absorb it with room to spare. Nothing to do.',
- },
clean: {
label: 'Clean',
type: 'success',
- title: 'Matched its baseline on every run in the window.',
+ title: 'Nothing failed the gate in the last 7 days, and any small diff stays well under the threshold.',
},
}
diff --git a/products/visual_review/frontend/generated/api.schemas.ts b/products/visual_review/frontend/generated/api.schemas.ts
index e4636ff18e14..866cc497c96d 100644
--- a/products/visual_review/frontend/generated/api.schemas.ts
+++ b/products/visual_review/frontend/generated/api.schemas.ts
@@ -128,7 +128,6 @@ export interface BaselineOverviewApi {
* * `broken` - broken
* * `unstable` - unstable
* * `at_risk` - at_risk
- * * `noisy` - noisy
* * `clean` - clean
*/
export type FlakinessStateEnumApi = (typeof FlakinessStateEnumApi)[keyof typeof FlakinessStateEnumApi]
@@ -137,7 +136,6 @@ export const FlakinessStateEnumApi = {
Broken: 'broken',
Unstable: 'unstable',
AtRisk: 'at_risk',
- Noisy: 'noisy',
Clean: 'clean',
} as const
@@ -188,12 +186,11 @@ export interface FlakinessEntryApi {
* @nullable
*/
baseline_moved_day_index?: number | null
- /** An urgency ladder, where each rung asks for a different fix. `broken` fails nearly every run, so its baseline is wrong and quarantining it only hides that. `unstable` fails some runs and not others, the classic flake. `at_risk` never fails, but its worst absorbed diff is already touching the threshold, so the next unrelated change turns it red. `noisy` renders variants and absorbs them with room to spare. `clean` matched its baseline on every run in the window.
+ /** An urgency ladder, where each rung asks for a different fix. `broken` fails nearly every run, so its baseline is wrong and quarantining it only hides that. `unstable` fails some runs and not others, the classic flake. `at_risk` never fails, but its worst absorbed diff is already touching the threshold, so the next unrelated change turns it red. `clean` has no gate failure inside the rate span, and any diff it absorbed sits far below the threshold.
*
* * `broken` - broken
* * `unstable` - unstable
* * `at_risk` - at_risk
- * * `noisy` - noisy
* * `clean` - clean */
flakiness_state: FlakinessStateEnumApi
/** True when an active quarantine has run out, is about to, or covers a snapshot that has stopped failing the gate. All three mean a human has to extend it or lift it. */
@@ -234,9 +231,7 @@ export interface FlakinessTotalsApi {
unstable: number
/** Identifiers whose `flakiness_state` is `at_risk`. */
at_risk: number
- /** Identifiers whose `flakiness_state` is `noisy`. */
- noisy: number
- /** Identifiers whose `flakiness_state` is `clean`. They are listed because they carry live variants or older history, and reported here so every listed entry is reachable. */
+ /** Identifiers whose `flakiness_state` is `clean`. They are listed because they carry a quarantine or older gate failures, and reported here so every listed entry is reachable. */
clean: number
/** Listed identifiers per run type, so one suite's noise can be told from another's. */
by_run_type: FlakinessTotalsApiByRunType
diff --git a/products/visual_review/frontend/generated/api.ts b/products/visual_review/frontend/generated/api.ts
index edf149184965..b4952787208a 100644
--- a/products/visual_review/frontend/generated/api.ts
+++ b/products/visual_review/frontend/generated/api.ts
@@ -163,7 +163,7 @@ export const getVisualReviewReposFlakinessRetrieveUrl = (projectId: string, id:
}
/**
- * Snapshots in a repo whose rendering cannot be trusted: those that failed the gate or were absorbed by a toleration on a recent default-branch run, and those under an active quarantine. Everything else is omitted, so this is far smaller than the baselines universe; `totals.tracked` gives the full denominator. Each entry carries the share of the last 7 days of default-branch runs that failed the gate (`hard_rate`) and the share a toleration absorbed (`soft_rate`), plus `headroom`, the fraction of the diff threshold its worst absorbed run leaves free. Capped at 2000 entries, which sets `truncated`. Filtering, faceting and search are done client-side; this endpoint takes no filter query params.
+ * Snapshots in a repo whose rendering cannot be trusted: those that failed the gate on a recent default-branch run, those whose absorbed diff is close to the threshold, and those under an active quarantine. Small absorbed diffs well under the threshold are omitted, as is everything else, so this is far smaller than the baselines universe; `totals.tracked` gives the full denominator. Each entry carries the share of the last 7 days of default-branch runs that failed the gate (`hard_rate`) and the share a toleration absorbed (`soft_rate`), plus `headroom`, the fraction of the diff threshold its worst absorbed run leaves free. Capped at 2000 entries, which sets `truncated`. Filtering, faceting and search are done client-side; this endpoint takes no filter query params.
*/
export const visualReviewReposFlakinessRetrieve = async (
projectId: string,
diff --git a/products/visual_review/frontend/scenes/VisualReviewFlakinessScene.stories.tsx b/products/visual_review/frontend/scenes/VisualReviewFlakinessScene.stories.tsx
index 2dd6be3bfe3e..40fbe8ea0536 100644
--- a/products/visual_review/frontend/scenes/VisualReviewFlakinessScene.stories.tsx
+++ b/products/visual_review/frontend/scenes/VisualReviewFlakinessScene.stories.tsx
@@ -120,7 +120,6 @@ const overview: FlakinessOverviewApi = {
broken: 18,
unstable: 231,
at_risk: 63,
- noisy: 604,
clean: 812,
quarantined: 47,
// Zero, and deliberately so: none of the three entries needs a decision,
@@ -141,7 +140,6 @@ const emptyOverview: FlakinessOverviewApi = {
broken: 0,
unstable: 0,
at_risk: 0,
- noisy: 0,
clean: 0,
quarantined: 0,
needs_decision: 0,
diff --git a/products/visual_review/frontend/scenes/VisualReviewFlakinessScene.tsx b/products/visual_review/frontend/scenes/VisualReviewFlakinessScene.tsx
index 838e45e63364..d62985a29e37 100644
--- a/products/visual_review/frontend/scenes/VisualReviewFlakinessScene.tsx
+++ b/products/visual_review/frontend/scenes/VisualReviewFlakinessScene.tsx
@@ -127,7 +127,7 @@ export function VisualReviewFlakinessScene(): JSX.Element {
{overview.totals.listed.toLocaleString()} snapshots
</span>{' '}
have something to show here, out of {overview.totals.tracked.toLocaleString()} with a current
- baseline. The rest matched their baseline on every run and carry no quarantine.
+ baseline. The rest passed every run and carry no quarantine.
</div>
)}
@@ -188,10 +188,10 @@ export function VisualReviewFlakinessScene(): JSX.Element {
</LemonBanner>
) : !hasPopulation ? (
<div className="flex flex-col items-center justify-center py-20 gap-2 text-center">
- <p className="m-0 font-semibold">Every snapshot renders the same way every time</p>
+ <p className="m-0 font-semibold">No snapshot needs attention</p>
<p className="m-0 text-xs text-muted max-w-md">
- Snapshots show up here once a run renders one differently from its baseline, or once someone
- quarantines one. Nothing in this repo has done either.
+ Snapshots show up here once one fails the gate on a default-branch run, gets close to the diff
+ threshold, or is quarantined. Small differences well under the threshold are not listed.
</p>
</div>
) : (
diff --git a/products/visual_review/frontend/scenes/visualReviewFlakinessSceneLogic.test.ts b/products/visual_review/frontend/scenes/visualReviewFlakinessSceneLogic.test.ts
index 6fba76c9ebd0..899b0557ef6e 100644
--- a/products/visual_review/frontend/scenes/visualReviewFlakinessSceneLogic.test.ts
+++ b/products/visual_review/frontend/scenes/visualReviewFlakinessSceneLogic.test.ts
@@ -18,7 +18,6 @@ const overview: FlakinessOverviewApi = {
broken: 18,
unstable: 231,
at_risk: 63,
- noisy: 604,
clean: 812,
quarantined: 47,
needs_decision: 12,
@@ -59,7 +58,7 @@ describe('visualReviewFlakinessSceneLogic', () => {
broken: 18,
unstable: 231,
at_risk: 63,
- quiet: 1416,
+ quiet: 812,
quarantined: 47,
})
})
diff --git a/products/visual_review/frontend/scenes/visualReviewFlakinessSceneLogic.ts b/products/visual_review/frontend/scenes/visualReviewFlakinessSceneLogic.ts
index cfb938e1f2ea..5b8b69076a65 100644
--- a/products/visual_review/frontend/scenes/visualReviewFlakinessSceneLogic.ts
+++ b/products/visual_review/frontend/scenes/visualReviewFlakinessSceneLogic.ts
@@ -84,9 +84,9 @@ function matchesPreset(entry: DecoratedEntry, preset: FlakinessPreset): boolean
case 'unstable':
case 'at_risk':
return entry.flakiness_state === preset
- // The catch-all. See `FlakinessStatRow` for why these two share a tile.
+ // The catch-all. See `FlakinessStatRow` for why it exists.
case 'quiet':
- return entry.flakiness_state === 'noisy' || entry.flakiness_state === 'clean'
+ return entry.flakiness_state === 'clean'
case 'quarantined':
return entry.is_quarantined
case 'needs_decision':
@@ -442,7 +442,7 @@ export const visualReviewFlakinessSceneLogic = kea<visualReviewFlakinessSceneLog
broken: overview?.totals.broken ?? 0,
unstable: overview?.totals.unstable ?? 0,
at_risk: overview?.totals.at_risk ?? 0,
- quiet: (overview?.totals.noisy ?? 0) + (overview?.totals.clean ?? 0),
+ quiet: overview?.totals.clean ?? 0,
quarantined: overview?.totals.quarantined ?? 0,
}),
],
diff --git a/products/visual_review/mcp/tools.yaml b/products/visual_review/mcp/tools.yaml
index 1a5a36c9229e..3085da54383b 100644
--- a/products/visual_review/mcp/tools.yaml
+++ b/products/visual_review/mcp/tools.yaml
@@ -25,12 +25,14 @@ tools:
idempotent: true
title: Visual review flakiness overview
description: >
- Snapshots in a repo whose rendering is untrusted: a live tolerated variant, a gate failure on a recent
- default-branch run, or an active quarantine. Start here to decide what to quarantine or lift. Each entry has
- `flakiness_state`, `hard_rate` (share of recent default-branch runs that failed the gate), `soft_rate`
- (share a toleration absorbed), `window_runs`, `headroom` and `needs_decision`. `totals` covers every
- snapshot; `listed` stops at the cap. Takes no filters: filter the entries yourself, and pass `fields` to
- trim the response.
+ Snapshots in a repo whose rendering is untrusted: a gate failure on a recent default-branch run, an absorbed
+ diff close to the threshold, or an active quarantine. A snapshot that is not listed may still render small
+ absorbed differences from its baseline; those stay under the diff thresholds and block nobody. Start here to
+ decide what to quarantine or lift. Each entry has `flakiness_state`, `hard_rate` (share of recent
+ default-branch runs that failed the gate), `soft_rate` (share a toleration absorbed), `window_runs`,
+ `headroom` and `needs_decision`. `totals.tracked` counts every baselined snapshot, the state counts cover
+ the reportable rows, and `listed` stops at the cap. Takes no filters: filter the entries yourself, and pass
+ `fields` to trim the response.
param_overrides:
id:
description: The repo's UUID, from `visual-review-repos-list`.
diff --git a/products/visual_review/skills/triaging-visual-review-runs/SKILL.md b/products/visual_review/skills/triaging-visual-review-runs/SKILL.md
index 93ee4c15f4f6..1369d8a8f071 100644
--- a/products/visual_review/skills/triaging-visual-review-runs/SKILL.md
+++ b/products/visual_review/skills/triaging-visual-review-runs/SKILL.md
@@ -301,7 +301,7 @@ Once you have a suspect snapshot row from `visual-review-runs-snapshots-list`, a
`posthog:visual-review-repos-flakiness-retrieve { id: <repo_id> }`, and find the entry whose `identifier` and
`run_type` match your snapshot. That entry carries the flake signal:
-- `flakiness_state`: `broken`, `unstable`, `at_risk`, `noisy`, or `clean`.
+- `flakiness_state`: `broken`, `unstable`, `at_risk`, or `clean`.
- `hard_rate` and `hard_count`: the share and number of recent default-branch runs that failed the gate.
`last_flaked_at`: the latest of them.
- `soft_rate`: the share that a toleration absorbed.
@@ -326,7 +326,7 @@ Verdicts:
- `flakiness_state` is `unstable` with `hard_count` ≥ 5 and a recent `last_flaked_at` → flaky story; quarantine it.
One failure is enough for `unstable`, and a single failure is often a real change that merged, so trust the count.
- `flakiness_state` is `broken` → the baseline is wrong, not the story. Do not quarantine; recommend a re-baseline.
-- `at_risk` and `noisy` never fail a run, so they need no action on a PR.
+- `at_risk` never fails a run, so it needs no action on a PR.
- Recent `removed`, a large-jump dimension change, or a baseline that last moved long ago → baseline likely stale;
recommend re-baselining on master.
diff --git a/services/mcp/schema/generated-tool-definitions.json b/services/mcp/schema/generated-tool-definitions.json
index 4165130e0ed1..ca7b9cfe6e4b 100644
--- a/services/mcp/schema/generated-tool-definitions.json
+++ b/services/mcp/schema/generated-tool-definitions.json
@@ -14132,7 +14132,7 @@
}
},
"visual-review-repos-flakiness-retrieve": {
- "description": "Snapshots in a repo whose rendering is untrusted: a live tolerated variant, a gate failure on a recent default-branch run, or an active quarantine. Start here to decide what to quarantine or lift. Each entry has `flakiness_state`, `hard_rate` (share of recent default-branch runs that failed the gate), `soft_rate` (share a toleration absorbed), `window_runs`, `headroom` and `needs_decision`. `totals` covers every snapshot; `listed` stops at the cap. Takes no filters: filter the entries yourself, and pass `fields` to trim the response.",
+ "description": "Snapshots in a repo whose rendering is untrusted: a gate failure on a recent default-branch run, an absorbed diff close to the threshold, or an active quarantine. A snapshot that is not listed may still render small absorbed differences from its baseline; those stay under the diff thresholds and block nobody. Start here to decide what to quarantine or lift. Each entry has `flakiness_state`, `hard_rate` (share of recent default-branch runs that failed the gate), `soft_rate` (share a toleration absorbed), `window_runs`, `headroom` and `needs_decision`. `totals.tracked` counts every baselined snapshot, the state counts cover the reportable rows, and `listed` stops at the cap. Takes no filters: filter the entries yourself, and pass `fields` to trim the response.",
"category": "Visual review",
"feature": "visual_review",
"summary": "Visual review flakiness overview",
diff --git a/services/mcp/schema/tool-definitions-all.json b/services/mcp/schema/tool-definitions-all.json
index f1e5dc287c31..c09a23eb5a41 100644
--- a/services/mcp/schema/tool-definitions-all.json
+++ b/services/mcp/schema/tool-definitions-all.json
@@ -14810,7 +14810,7 @@
}
},
"visual-review-repos-flakiness-retrieve": {
- "description": "Snapshots in a repo whose rendering is untrusted: a live tolerated variant, a gate failure on a recent default-branch run, or an active quarantine. Start here to decide what to quarantine or lift. Each entry has `flakiness_state`, `hard_rate` (share of recent default-branch runs that failed the gate), `soft_rate` (share a toleration absorbed), `window_runs`, `headroom` and `needs_decision`. `totals` covers every snapshot; `listed` stops at the cap. Takes no filters: filter the entries yourself, and pass `fields` to trim the response.",
+ "description": "Snapshots in a repo whose rendering is untrusted: a gate failure on a recent default-branch run, an absorbed diff close to the threshold, or an active quarantine. A snapshot that is not listed may still render small absorbed differences from its baseline; those stay under the diff thresholds and block nobody. Start here to decide what to quarantine or lift. Each entry has `flakiness_state`, `hard_rate` (share of recent default-branch runs that failed the gate), `soft_rate` (share a toleration absorbed), `window_runs`, `headroom` and `needs_decision`. `totals.tracked` counts every baselined snapshot, the state counts cover the reportable rows, and `listed` stops at the cap. Takes no filters: filter the entries yourself, and pass `fields` to trim the response.",
"category": "Visual review",
"feature": "visual_review",
"summary": "Visual review flakiness overview",
diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.ts
index 7ce717e45a59..022528769b1b 100644
--- a/services/mcp/src/api/generated.ts
+++ b/services/mcp/src/api/generated.ts
@@ -51177,7 +51177,6 @@ export namespace Schemas {
* * `broken` - broken
* * `unstable` - unstable
* * `at_risk` - at_risk
- * * `noisy` - noisy
* * `clean` - clean
*/
export type FlakinessStateEnum = typeof FlakinessStateEnum[keyof typeof FlakinessStateEnum];
@@ -51187,7 +51186,6 @@ export namespace Schemas {
Broken: 'broken',
Unstable: 'unstable',
AtRisk: 'at_risk',
- Noisy: 'noisy',
Clean: 'clean',
} as const;
@@ -51238,12 +51236,11 @@ export namespace Schemas {
* @nullable
*/
baseline_moved_day_index?: number | null;
- /** An urgency ladder, where each rung asks for a different fix. `broken` fails nearly every run, so its baseline is wrong and quarantining it only hides that. `unstable` fails some runs and not others, the classic flake. `at_risk` never fails, but its worst absorbed diff is already touching the threshold, so the next unrelated change turns it red. `noisy` renders variants and absorbs them with room to spare. `clean` matched its baseline on every run in the window.
+ /** An urgency ladder, where each rung asks for a different fix. `broken` fails nearly every run, so its baseline is wrong and quarantining it only hides that. `unstable` fails some runs and not others, the classic flake. `at_risk` never fails, but its worst absorbed diff is already touching the threshold, so the next unrelated change turns it red. `clean` has no gate failure inside the rate span, and any diff it absorbed sits far below the threshold.
*
* * `broken` - broken
* * `unstable` - unstable
* * `at_risk` - at_risk
- * * `noisy` - noisy
* * `clean` - clean */
flakiness_state: FlakinessStateEnum;
/** True when an active quarantine has run out, is about to, or covers a snapshot that has stopped failing the gate. All three mean a human has to extend it or lift it. */
@@ -51284,9 +51281,7 @@ export namespace Schemas {
unstable: number;
/** Identifiers whose `flakiness_state` is `at_risk`. */
at_risk: number;
- /** Identifiers whose `flakiness_state` is `noisy`. */
- noisy: number;
- /** Identifiers whose `flakiness_state` is `clean`. They are listed because they carry live variants or older history, and reported here so every listed entry is reachable. */
+ /** Identifiers whose `flakiness_state` is `clean`. They are listed because they carry a quarantine or older gate failures, and reported here so every listed entry is reachable. */
clean: number;
/** Listed identifiers per run type, so one suite's noise can be told from another's. */
by_run_type: FlakinessTotalsByRunType;
diff --git a/services/mcp/src/generated/visual_review/api.ts b/services/mcp/src/generated/visual_review/api.ts
index 4fac0766a91b..98fb81ec6f46 100644
--- a/services/mcp/src/generated/visual_review/api.ts
+++ b/services/mcp/src/generated/visual_review/api.ts
@@ -63,7 +63,7 @@ export const VisualReviewReposPartialUpdateBody = () => zod.object({
})
/**
- * Snapshots in a repo whose rendering cannot be trusted: those that failed the gate or were absorbed by a toleration on a recent default-branch run, and those under an active quarantine. Everything else is omitted, so this is far smaller than the baselines universe; `totals.tracked` gives the full denominator. Each entry carries the share of the last 7 days of default-branch runs that failed the gate (`hard_rate`) and the share a toleration absorbed (`soft_rate`), plus `headroom`, the fraction of the diff threshold its worst absorbed run leaves free. Capped at 2000 entries, which sets `truncated`. Filtering, faceting and search are done client-side; this endpoint takes no filter query params.
+ * Snapshots in a repo whose rendering cannot be trusted: those that failed the gate on a recent default-branch run, those whose absorbed diff is close to the threshold, and those under an active quarantine. Small absorbed diffs well under the threshold are omitted, as is everything else, so this is far smaller than the baselines universe; `totals.tracked` gives the full denominator. Each entry carries the share of the last 7 days of default-branch runs that failed the gate (`hard_rate`) and the share a toleration absorbed (`soft_rate`), plus `headroom`, the fraction of the diff threshold its worst absorbed run leaves free. Capped at 2000 entries, which sets `truncated`. Filtering, faceting and search are done client-side; this endpoint takes no filter query params.
*/
export const VisualReviewReposFlakinessRetrieveParams = () => zod.object({
id: zod.string(),