diff --git a/CHANGELOG.md b/CHANGELOG.md index 80ba455..fe14eef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,18 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added + +- **Playwright interaction loop** — `forge uicheck interact ` drives the + page headless under `prefers-reduced-motion` and checks what it *does* + (console-clean, keyboard-reachable, focus-visible, reduced-motion), where + `uicheck visual` only fingerprints what it paints. The verdict is recorded through + the ledger's cross-family-gated `behavioral` oracle (advisory by default; + `--record` appends it as evidence on the project `fingerprint` claim, `--enforce` + gates). Reuses the visual gate's Playwright resolver + loopback-only target guard; + Playwright stays an optional tier (ADR-0005) with a graceful skip. New + `src/uiinteract.js` (`runInteractions`, `summarizeVerdict`, `verdictOutcome`, + `recordInteraction`) with a browser-free test suite. ## [0.15.0] - 2026-07-15 ### Added diff --git a/docs/GUIDE.md b/docs/GUIDE.md index be75885..c15ffdc 100644 --- a/docs/GUIDE.md +++ b/docs/GUIDE.md @@ -660,8 +660,8 @@ tree (your uncommitted changes wouldn't be in the run); commit/stash first or pa ### `forge uicheck` — deterministic UI checks -Four subcommands: three are static parsing — no LLM, no screenshots — and `visual` -optionally drives a real browser. +Five subcommands: three are static parsing — no LLM, no screenshots — and `visual` +and `interact` optionally drive a real browser. **`contrast `** — exact WCAG math, asserted, never guessed (bare `forge uicheck ` still works): @@ -720,6 +720,33 @@ Forge uicheck visual — rendered fingerprint + design gate ✓ PASS ``` +**`interact [--record] [--enforce] [--json] [--remote]`** — the Playwright +_interaction_ loop: where `visual` fingerprints what the page **paints**, `interact` +checks what it **does**, headless under `prefers-reduced-motion`. Four checks: +`console-clean` (no console errors on load), `keyboard-reachable` (Tab lands on an +interactive control), `focus-visible` (the focused control shows a visible focus ring — +WCAG 2.4.7), and `reduced-motion` (nothing animates when reduced motion is requested). +The verdict is **advisory** by default — it is recorded through the ledger's weakest, +cross-family-gated `behavioral` oracle, so a lone interaction run can never move a claim +on its own (overview §4 honesty register). `--record` appends the verdict as evidence on +your minted project `fingerprint` claim; `--enforce` (or `FORGE_ENFORCE=1`) turns a fail +into a non-zero exit. Playwright and the loopback-only target guard are shared with +`visual` (same _optional tier_, same `--remote` rule). + +```console +$ forge uicheck interact src/dash.html --record +Forge uicheck interact — browser interaction checks + + driven: file:///…/src/dash.html (headless, prefers-reduced-motion) + ✓ console-clean: no console errors on load + ✓ keyboard-reachable: Tab reached