Skip to content

ci(visual): name every case in the job summary and refuse a short matrix (#787) - #1205

Open
HugoXK wants to merge 5 commits into
mainfrom
dev3/787-visual-matrix
Open

HugoXK wants to merge 5 commits into
mainfrom
dev3/787-visual-matrix

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

Written-by: HugoXK
Author: Fledge Platform Dev-3

Fixes #787

What a user sees differently

Nothing on a console page. The change is inside CI: the visual job's summary now names every measured case with its own result instead of one line for the whole matrix. A reader of a red run sees the page, viewport, scheme and the exact reason that failed; a reader of a green run sees the full table, including the cells whose share only recorded a failure.

What changed

  • The branch now sits on main 4740fcc1 via merge commit 33e85fa2 (no force, no rebase). #1208 sharded the sweep while this card was parked and #1214 merged it, so the branch's serial record() loop and its promise list are gone; the surviving behaviour is built on the shard aggregate that owns the workload.
  • src/lib/visualMatrix.ts: caseRows(cells, results) turns the shares' reports into one row per promised cell — locale, viewport, the scheme it ran in (host for the sweep, the forced palette for the gate, explicit-dark for the theme probe), its page, and the reasons it failed, with the cell's label prefix stripped. A cell no share reported is a failure row naming that, not a missing row. summaryMarkdown(rows, notes) renders the table and escapes a | inside a reason.
  • scripts/visual-matrix.ts: the coordinator writes caseRows(...) through summaryMarkdown to GITHUB_STEP_SUMMARY before the exit code is decided, so a red run still tells the reader what failed. Aggregate reasons that belong to no single row (a share that died, a cell counted twice) are appended as notes. A local run without GITHUB_STEP_SUMMARY skips the write; a failed write is reported and does not change the exit code.
  • test/visualJobCeiling.test.ts (new): pins the job's name and its place in ci-ok needs, the unguarded install and matrix steps, the aggregate refusing an empty share, a missing result, a dropped cell and a duplicate, and the table's shape (a failing row keeps its reason, an unmeasured cell is a failure row, a pipe cannot break the row).
  • docs/autonomous-dev.md: the visual bullet records the summary and the aggregate's refusal.

The cache half is dropped

actions/cache was the other half of this card. ADR 0027 (#1216) settled the pre-approved-action route, so that lever is #1206's subject and it is parked; this PR removes the Cache step, the Playwright-version step it keyed on, the allowlist entry that admitted it, and the cache claim from the docs bullet. The visual job downloads Chromium on every run here, exactly as it did before this card.

Why the coverage half is the shard aggregate, not a second promise list

#1214 made the workload one list (visualWorkload()): the runner iterates the partition of it, and shardFailures refuses an empty share, a result that never arrived, a cell a share did not report, a cell reported twice and a cell reported outside its slice. The branch's caseKey/expectedCaseKeys/caseCoverage would be a second copy of that promise — a second thing to drift — so they are not rebased. The property they expressed is pinned in this PR against the one guard that now owns it.

The three negatives

  1. A broken cell fails ci-ok. The matrix step is unguarded, the runner sets process.exitCode = 1 on any failure, and visual is in the aggregate ci-ok needs: list in ci.yml.
  2. A share that checks less cannot read green. The aggregate names an empty share, a share with no result, a cell a share did not report, a cell measured twice and a share that exited non-zero without naming a failure. The table derives its rows from the same reports, so a shrunken run shrinks nothing.
  3. A dropped case cannot hide in the table. caseRows emits one row per cell the matrix promises, from visualWorkload(); a cell no share reported is fail: the share that owned this cell reported no result, so the summary cannot read green by omission.

Red first

At a3b637df (the cache removal on top of the merge, with the test file committed byte-identical), npx tsx --test test/visualJobCeiling.test.ts:

# tests 8
# pass 3
# fail 5

The three passing assertions are the controls this change must not break: the job keeps its name and its needs entry, a broken cell still reds, and the aggregate still refuses an empty share, a missing result, a dropped cell and a duplicate. The five failures are the behaviour added here: no case table is written to GITHUB_STEP_SUMMARY, and caseRows/summaryMarkdown do not exist. At d00e65b0 the same file is 8/8.

The card's earlier red evidence stays in this branch's history at f1c48ed3/9a61fc3e (43 tests, 33 pass, 10 fail) — history, not the tip's evidence.

Measurement

The visual job's wall time when this card was written was 79 s cold / 88 s warm on a serial sweep. #1208 then sharded it and #1214 measured 46 s / 48 s / 60 s over three runs at four shares on the same runner. This PR adds no cache and no step, so it does not change the job's timing; the timing question now belongs to #1206.

Ran:

  • npm run check at d00e65b0 — exit 0, 3335 tests / 3335 pass, build clean
  • npx tsx --test test/visualJobCeiling.test.ts at d00e65b0 — 8/8
  • the same file at a3b637df — 3/8, the red run above
  • node scripts/risk-gate.mjs --base 4740fcc1 — T3, 4 changed files

Not run:

  • The visual matrix on this host: no Playwright Chromium is installed here; the job's own CI runs are the measurement.
  • docker: the image is unaffected by this diff and was not built locally.

Risk and rollback

  • The table is derived, never asserted independently of the exit code: caseRows reads the same failure list the aggregate decides on, so a red matrix cannot render a green table.
  • A cell a share reported but whose failure text does not begin with its label still reds the job through shardFailures; the table shows it as a pass row and the aggregate notes carry the reason, because the text cannot be attributed to one cell. That is a display gap, not a gate gap.
  • The summary write cannot change the result: it is appended after the failures are collected, wrapped, and never touches process.exitCode.
  • Rollback: revert the commits. The job returns to per-share failure lines with no table, and every gate property above still holds through shardFailures, which ships independently in #1214.

Docs and changelog

docs/autonomous-dev.md updated (the visual bullet).

Changelog-not-needed: this is CI plumbing users cannot see.

Fledge risk tier
base: 4740fcc1990bc2964e33f72a43f384f9c7d5e05c
head: HEAD
changed files: 4

T3: docs/autonomous-dev.md, scripts/visual-matrix.ts
T2: src/lib/visualMatrix.ts
T1: test/visualJobCeiling.test.ts
T0: docs/autonomous-dev.md
limits: 40 files / 1200 lines (advisory)

risk-tier: T3; basis: docs/autonomous-dev.md

@HugoXK HugoXK changed the title Cache the Chromium layer in the visual job and refuse a short matrix ci(visual): name every case in the job summary and refuse a short matrix (#787) Nov 23, 2026
@HugoXK
HugoXK requested a review from HugoXK-bot November 23, 2026 00:49
Fledge Platform Dev-3 added 4 commits November 23, 2026 01:07
#1208 sharded the visual sweep and #1214 merged it; the branch's serial
recording loop cannot survive that, so the three conflicts resolve to main's
runner and the workload guard. The cache step is untouched here and is removed
in the next commit, because #1206 owns that route.
ADR 0027 settled the pre-approved-action route, so the `actions/cache` half of
this card belongs to #1206 and is parked there. This removes the Cache step,
the version-reading step it keyed on, the allowlist entry that admitted the
action, and the cache claim in the job's doc bullet. No step the matrix depends
on is touched.
… not a pass (#787)

Red at a3b637d: 8 tests, 3 pass, 5 fail — the three workflow pins pass (the
job keeps its name and its needs entry, a broken cell still reds, the aggregate
still refuses an empty share, a missing result, a dropped cell and a duplicate).
The five failures are the behaviour this card adds: no case table is written to
GITHUB_STEP_SUMMARY, and `caseRows`/`summaryMarkdown` do not exist.
)

`caseRows` turns the shares' reports into one row per promised cell — the
scheme it ran in, its page and viewport, and the reasons it failed — and
`summaryMarkdown` renders that table to GITHUB_STEP_SUMMARY from the coordinator,
before the exit code is decided. A cell no share reported is a failure row, not
a missing one, so a shrunken matrix cannot read green through the table.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: keep the console visual matrix fast and deterministic

1 participant