Skip to content

feat(qa): executable runtime UI contracts + generic contract runner#575

Merged
HomenShum merged 2 commits into
mainfrom
feat/runtime-ui-contract
Jul 17, 2026
Merged

feat(qa): executable runtime UI contracts + generic contract runner#575
HomenShum merged 2 commits into
mainfrom
feat/runtime-ui-contract

Conversation

@HomenShum

Copy link
Copy Markdown
Owner

Summary

Agent-native QA: the third contract layer beside the static design manifest (src/design/designSystem.ts) and the visual-evidence store. Surfaces now declare invariants as data — docs/design/ui-contract/surfaces/*.contract.json — and one generic Playwright runner (tests/e2e/ui-contract-runner.spec.ts) executes every manifest against the live DOM per theme × viewport. Adding a surface = adding a manifest, zero new spec code. Tier B runs the runner per-PR against the preview.

The seed contract for decision-workspace encodes:

  • anchors — one workspace, one composer, no legacy nav, named submit, agent-discoverable surface marker
  • geometry — the 2026-07-16 70px mobile collapse as gridTracks: 1 + minWidthPx: 300 clauses (computed style, not overflow booleans)
  • theme wiringstorageKey: nodebench:redesign:theme; runner and shell read the same key, so the key drift that shipped mislabeled dark captures now fails loudly
  • states — the context-miss banner as a deep-link-forced state with expectText/forbidText copy agreement

Verification

  • 5/5 against the live bundle (light/dark × desktop/mobile + state test) in 6.1s
  • Reversion proof: flipping gridTracks to 2 fails exactly the two mobile variants; restored → 5/5
  • Vision QA (Gemini loop / screenshot review) remains for taste; everything objectively checkable moves into contracts

Prior art: repo's own UI-contract evidence schema + designSystem manifest+audit pattern, agents.md / MCP progressive-discovery (machine-readable affordances), Storybook play functions, ARIA AX-tree.

🤖 Generated with Claude Code

Agent-native QA layer: surfaces declare their invariants as data
(docs/design/ui-contract/surfaces/*.contract.json) — anchors, computed
geometry, theme wiring, and deep-link-forced states with copy that must
agree with reality. One generic Playwright runner executes every
manifest per theme x viewport; adding a surface means adding a manifest,
not writing spec code. Tier B runs the runner per-PR against the preview.

The first contract encodes this week's two shipped failures as clauses:
the 70px mobile collapse (geometry: gridTracks/minWidthPx) and the
mislabeled dark captures (theme.storageKey — runner and shell read the
same key, so key drift fails loudly).

Proof: 5/5 against the live bundle in 6.1s; flipping gridTracks to a
wrong value fails exactly the two mobile variants; restored, 5/5.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@HomenShum
HomenShum enabled auto-merge (squash) July 17, 2026 20:39
@vercel

vercel Bot commented Jul 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
nodebench-ai Ignored Ignored Preview Jul 17, 2026 8:56pm

Request Review

@github-actions

github-actions Bot commented Jul 17, 2026

Copy link
Copy Markdown

✅ Dogfood Visual QA Gate: PASSED

Check Status
Screenshots 7 captured (pass)
Walkthrough 9 chapters (pass)
Key Frames 9 extracted (pass)
Scribe Steps 8 how-to steps (pass)
Build success
Artifacts

Download the dogfood-evidence-3c6bd44 artifact from the Actions tab for full screenshots, frames, and walkthrough video.


Generated by Dogfood QA Gate

HomenShum pushed a commit that referenced this pull request Jul 17, 2026
A second agent proposed building .ui/contract.json + a Playwright drift
verifier + /.well-known/agent-ui.json from scratch. The first two exist
(PR #575); the ledger entry points at the substrate and scopes the real
delta: a build-time projection of repo contracts into a served public
affordance manifest, version discipline, and two more surface contracts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@HomenShum
HomenShum merged commit f7d61be into main Jul 17, 2026
14 checks passed
@HomenShum
HomenShum deleted the feat/runtime-ui-contract branch July 17, 2026 21:01
@github-actions

Copy link
Copy Markdown

Demo: walkthrough of the surfaces this PR changed is available as a workflow artifact (pr-demo-575) at https://github.com/HomenShum/NodeBenchAI/actions/runs/29613275579

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.

2 participants