Skip to content

feat(ui-visual): design-review workflow and status check for UI PRs (warren-a694) - #1359

Merged
warren-auto-merge[bot] merged 1 commit into
mainfrom
ui-visual/design-review-a694
Oct 8, 2026
Merged

warren-auto-merge[bot] merged 1 commit into
mainfrom
ui-visual/design-review-a694

Conversation

@jayminwest

Copy link
Copy Markdown
Owner

Seed warren-a694 (plan pl-10db, step 15). Adds .github/workflows/ui-design-review.yml, which runs the ui-design-review evaluator on PRs that touch src/ui. It reports the result as a design-review check run on the PR head and as one sticky PR comment.

What it does

Job Trigger Token Role
gate pull_request_target checks: write, PRs: read Sets the first check on every PR head into main. A PR with no rendered src/ui change gets success ("Skipped: no src/ui changes") at once. Any other PR gets a queued "Waiting for ui-visual" check, so a required check never hangs.
prepare workflow_run of UI visual, or dispatch actions: read, checks: write Trusts the artifact's PR number only when that PR's head is the run's head sha (the warren-70d9 pattern). Maps changed files to manifest pages and stages only the in-scope screenshots plus the src/ui diff. Sets the check to in_progress.
evaluate needs prepare (mode == review) contents: read only anthropics/claude-code-action pinned to 6fed3ca (v1.0.245). The prompt is fixed and carries no PR text: page ids come from the manifest and the sha from the API. Allowed tools are Read(./**), Glob, Grep, Skill, Edit(./.design-review/verdict.json) and Bash(bun run scripts/design-review/verdict.ts:*). There are no web tools.
report always, after prepare checks: write, PRs: write Re-validates the verdict in a fresh checkout against the head sha from the API. It fails closed on a missing or invalid verdict, sets the check, and upserts the comment with the auto-merge App token.

All logic lives in pure, unit-tested modules under scripts/design-review/ (scope, outcome, github, gate, prepare, report, usage). Every job runs only the default branch's code. Model text in the comment is escaped, with mentions, links, HTML and table breaks neutralized and credential-shaped strings redacted.

Cost guardrails are repo variables, all optional:

  • DESIGN_REVIEW_MODEL (default claude-opus-5-5)
  • DESIGN_REVIEW_MAX_TURNS (default 60)
  • DESIGN_REVIEW_MAX_BUDGET_USD (default 5)

The evaluator also gets only the in-scope screenshots. It falls back to every page when a shared file changes or GitHub caps the file list.

Contract for warren-dbef

The contract is documented in docs/design/ui-design-review.md section 7 and in the workflow header.

  • The check is named exactly design-review. Its source app is GitHub Actions, because it is created through the Checks API with the workflow's GITHUB_TOKEN.
  • It is success only on a valid PASS or a skip.
  • It is failure on FAIL, on an invalid or missing verdict, or when ui-visual failed.
  • A finished check is never reopened: a re-run creates a new one.
  • Manual re-run: gh workflow run ui-design-review.yml -f run_id=<ui-visual run id>.

Deviation

The sticky marker is <!-- design-review -->, from stickyMarker("design-review"). The seed text says <!-- ui-design-review -->.

Validation

Follow-ups

  • warren-dbef: require design-review and pin its source to GitHub Actions.
  • A PR whose pusher lacks write access is refused by claude-code-action and fails closed until a maintainer dispatches a re-run.
  • Consider keeping the evaluator transcript, for example as a short-retention artifact. A failed review is currently opaque, because the action hides its output.
  • The prepare job can crash before it outputs the PR number. In that case a queued check stays queued.

…and reports a design-review check (warren-a694)

.github/workflows/ui-design-review.yml runs the ui-design-review skill
through claude-code-action (pinned by commit) after each ui-visual run,
validates the verdict with scripts/design-review/verdict.ts, and reports
the result as the `design-review` check run on the PR head plus one sticky
comment keyed by <!-- design-review -->.

- gate (pull_request_target): every PR head into main gets the check at
  once, success "Skipped: no src/ui changes" or queued, so the check
  warren-dbef makes required never hangs.
- prepare (workflow_run): trusts the artifact's PR number only when that
  PR's head is the run's head sha, maps changed files to manifest pages,
  stages only in-scope screenshots and the src/ui diff.
- evaluate: contents: read token, scoped tools, no web tools, fixed
  prompt with no PR text, model/turn/budget caps from repo variables.
- report: re-validates in a fresh checkout and fails closed on a missing
  or invalid verdict.

Logic lives in pure, unit-tested modules under scripts/design-review/.
@warren-auto-merge
warren-auto-merge Bot enabled auto-merge (squash) October 8, 2026 17:08
@warren-auto-merge
warren-auto-merge Bot merged commit aacd1fb into main Oct 8, 2026
6 checks passed
@warren-auto-merge
warren-auto-merge Bot deleted the ui-visual/design-review-a694 branch October 8, 2026 17:11
jayminwest added a commit that referenced this pull request Oct 9, 2026
…e (warren-598d) (#1361)

* feat(ui-visual): design-review workflow runs the evaluator on UI PRs and reports a design-review check (warren-a694) (#1359)

.github/workflows/ui-design-review.yml runs the ui-design-review skill
through claude-code-action (pinned by commit) after each ui-visual run,
validates the verdict with scripts/design-review/verdict.ts, and reports
the result as the `design-review` check run on the PR head plus one sticky
comment keyed by <!-- design-review -->.

- gate (pull_request_target): every PR head into main gets the check at
  once, success "Skipped: no src/ui changes" or queued, so the check
  warren-dbef makes required never hangs.
- prepare (workflow_run): trusts the artifact's PR number only when that
  PR's head is the run's head sha, maps changed files to manifest pages,
  stages only in-scope screenshots and the src/ui diff.
- evaluate: contents: read token, scoped tools, no web tools, fixed
  prompt with no PR text, model/turn/budget caps from repo variables.
- report: re-validates in a fresh checkout and fails closed on a missing
  or invalid verdict.

Logic lives in pure, unit-tested modules under scripts/design-review/.

* feat(auto-merge): require ui-visual and design-review success for UI PRs before arming (warren-dbef)

* docs(ui): AGENTS.md UI conventions section and a UI definition of done (warren-598d)

Adds a UI conventions section to AGENTS.md that pairs each rule with the
check that holds it: the Tailwind arbitrary-value ratchet, the GritQL
primitive and inline-style bans, check:ui-visual, the golden baseline
approval label, and the design-review rubric. Folds the UI merge-gate
paragraph out of Protected paths into it and moves the repro-first
section next to it. The PR template gains a collapsed UI definition of
done, and src/ui/README.md links both UI design records.
jayminwest added a commit that referenced this pull request Oct 9, 2026
…o-merge refuses without it (warren-4780) (#1356)

* feat(ui-visual): human-only approval for golden baseline changes; auto-merge refuses without it (warren-4780)

auto-merge.yml gains a UI baseline approval check next to Article IX. A PR
that changes scripts/ui-visual/__golden__/ or the comparison machinery arms
only when a human approver applied ui-baseline-approved to the exact baseline
content the head carries. The gate reads the labeler from the issue events
API (never label presence), the head the approver saw from the repository
activity API, and compares baseline object ids. It runs the base branch's
copy of scripts/ui-visual/baseline-approval.ts, fails closed, and disarms on
refusal. The arm step now also refuses to arm a head the gates did not judge.

Adds the label, CODEOWNERS routing, and docs/design/ui-visual-gate.md.

* feat(auto-merge): require ui-visual and design-review success for UI PRs before arming (warren-dbef) (#1360)

* docs(ui): AGENTS.md UI conventions section and a UI definition of done (warren-598d) (#1361)

* feat(ui-visual): design-review workflow runs the evaluator on UI PRs and reports a design-review check (warren-a694) (#1359)

.github/workflows/ui-design-review.yml runs the ui-design-review skill
through claude-code-action (pinned by commit) after each ui-visual run,
validates the verdict with scripts/design-review/verdict.ts, and reports
the result as the `design-review` check run on the PR head plus one sticky
comment keyed by <!-- design-review -->.

- gate (pull_request_target): every PR head into main gets the check at
  once, success "Skipped: no src/ui changes" or queued, so the check
  warren-dbef makes required never hangs.
- prepare (workflow_run): trusts the artifact's PR number only when that
  PR's head is the run's head sha, maps changed files to manifest pages,
  stages only in-scope screenshots and the src/ui diff.
- evaluate: contents: read token, scoped tools, no web tools, fixed
  prompt with no PR text, model/turn/budget caps from repo variables.
- report: re-validates in a fresh checkout and fails closed on a missing
  or invalid verdict.

Logic lives in pure, unit-tested modules under scripts/design-review/.

* feat(auto-merge): require ui-visual and design-review success for UI PRs before arming (warren-dbef)

* docs(ui): AGENTS.md UI conventions section and a UI definition of done (warren-598d)

Adds a UI conventions section to AGENTS.md that pairs each rule with the
check that holds it: the Tailwind arbitrary-value ratchet, the GritQL
primitive and inline-style bans, check:ui-visual, the golden baseline
approval label, and the design-review rubric. Folds the UI merge-gate
paragraph out of Protected paths into it and moves the repro-first
section next to it. The PR template gains a collapsed UI definition of
done, and src/ui/README.md links both UI design records.
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.

1 participant