feat(uicheck): Playwright interaction loop (forge uicheck interact)#62
Merged
Conversation
…eract) Implements the ROADMAP "Next" item "Playwright loop": where `uicheck visual` fingerprints what the browser PAINTS, `uicheck interact` checks what it DOES, headless under prefers-reduced-motion — console-clean, keyboard-reachable, focus-visible (WCAG 2.4.7), and reduced-motion honesty. The verdict is expressed in the ledger's own evidence vocabulary and recorded through the cross-family-gated `behavioral` oracle, so it is advisory by default (a lone interaction run can never move a claim — overview §4 honesty register): - --record appends the verdict as evidence on the project `fingerprint` claim - --enforce (or FORGE_ENFORCE=1) turns a fail into a non-zero exit Reuses the visual gate's Playwright resolver and loopback-only target guard; Playwright stays an optional tier (ADR-0005) with a graceful "skipped (no browser runtime)" fallback. New src/uiinteract.js with a browser-free test suite (the skip/refusal/verdict/outcome logic is unit-tested; the browser path mirrors the proven visualGate orchestration). Docs: GUIDE uicheck section + CHANGELOG. Verified: npm test (683 pass), npm run check, npm run typecheck, forge docs check. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WTc41NYip9GZLu4n9a5vLs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Implements the ROADMAP "Next" item "Playwright loop". Where
forge uicheck visualfingerprints what the browser paints,forge uicheck interact <file-or-url>checks what it does — driven headless underprefers-reduced-motion:console-clean— no console errors on loadkeyboard-reachable— Tab lands on an interactive controlfocus-visible— the focused control shows a visible focus ring (WCAG 2.4.7)reduced-motion— nothing animates when reduced motion is requestedThe verdict is expressed in the ledger's own evidence vocabulary and recorded through the cross-family-gated
behavioraloracle (ledger.js, w=0.3), so it's advisory by default — a lone interaction run can never move a claim on its own (overview §4 honesty register), the same guard-over-prose discipline as the visual gate:--recordappends the verdict as evidence on the projectfingerprintclaim--enforce(orFORGE_ENFORCE=1) turns a fail into a non-zero exitReuses the visual gate's Playwright resolver (
resolvePlaywright) and loopback-only target guard (resolveTarget). Playwright stays an optional tier (ADR-0005):package.jsonstays dependency-free and a missing browser runtime prints a "skipped (no browser runtime)" note and exits 0.src/uiinteract.js—runInteractions,summarizeVerdict,verdictOutcome,recordInteraction.src/cli.js—uicheck interactsubcommand.uichecksection (now five subcommands) +CHANGELOG.md[Unreleased].Checklist
npm testpasses (Node 18/20/22) — 685 tests, 683 pass, 0 fail (2 pre-existing skips); 7 new casesnpm run checkpasses (Biome lint + format) — exit 0feat:)CHANGELOG.mdupdated under## [Unreleased]behavioraloracle; GUIDE reconciled (forge docs checkgreen)Risk & rollback
visualGateorchestration; absence is a graceful skip.--record).Extra checks
npm run typecheckpasses (tsccheckJs)--remotestill required for non-loopback targets (exfiltration guard unchanged)🤖 Generated with Claude Code
Generated by Claude Code