Skip to content

feat(SPEC-044): agent-driven UI snapshot validation (local) - #99

Open
larryxiao wants to merge 1 commit into
mainfrom
feat/spec-044-ui-snapshots
Open

larryxiao wants to merge 1 commit into
mainfrom
feat/spec-044-ui-snapshots

Conversation

@larryxiao

Copy link
Copy Markdown
Owner

SPEC

SPEC-044 (Agent-driven UI snapshot validation)

Milestone

Adoption focus — auto-validation / ship confidently.

Why

Lets an agent see the UI and validate it against the specs locally (no cloud, no mic, no screen-capture) — catching the bug class unit tests miss: correct logic, wrong rendered UI. Directly from "the agent should drive testing, see the UI to validate by the specs, and improve on its own, run locally."

Change

  • SnapshotRenderer + a main() gate: OQ_SNAPSHOT_DIR=<dir> openquack renders the recording-overlay states to PNG via ImageRenderer and exits — deterministic, headless.
  • The validation loop, run once, already paid for itself: it caught two interrupted-overlay bugs (truncated notice; misleading "Copied to clipboard" headline) — fixed in this PR (headline → "Recording interrupted"; notice → "Saved what we captured"), confirmed by re-render.

Tests

  • swift build && swift test green (269)
  • snapshot render + agent visual check (manual; demonstrated in the PR thread)

Privacy impact

None — local SwiftUI → local PNG, inert unless OQ_SNAPSHOT_DIR is set; no network.

Out of scope

  • The app-launch behaviour harness (inject WAV → assert transcript) = SPEC-042 increment 2 (this is the visual half).
  • Pixel-diff golden images — the agent validates against the spec, not a baseline.
  • Decoupling every Settings pane from NSApp.delegate (incremental).

Render the app's SwiftUI surfaces to PNG headlessly so an agent can SEE the UI
and validate it against the specs, locally — no menu bar, no mic, no
screen-capture, deterministic.

- SnapshotRenderer + main() gate: `OQ_SNAPSHOT_DIR=<dir> openquack` renders the
  recording overlay's states (listening / thinking / pasted / interrupted /
  kickoff) to <dir>/*.png via ImageRenderer, then exits.
- The render→see→validate→fix→re-render loop, run on the first output, caught two
  interrupted-overlay bugs that no unit test would: the notice was truncated
  ("…audio devic…") and the headline misread "Copied to clipboard" on a recording
  that was cut short. Fixed here — headline → "Recording interrupted", notice →
  "Saved what we captured" (fits the pill) — confirmed by re-rendering.

Build + 269 tests green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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