Pipeline & Suite Runner

Each run uses Explorer then Consolidator (optional video review can run between them). The Suite Runner executes that pipeline in parallel across every booted simulator.

Suite Overview

The outer loop: xqa run reads a .suite.json, provisions simulators, and distributes specs through a FIFO worker pool. Each simulator lane runs the full agent pipeline — shown in miniature here, detailed further down.

Entry Point
xqa run <suite.json>
Reads .suite.json → resolves spec globs + freestyle count → validates config → discovers simulators
Simulator Provisioning
terminateApp → installApp → launchApp
Idempotent setup for every booted simulator before work begins
Worker Pool — FIFO Queue
Simulators ↔ Specs
Each simulator picks the next spec when it finishes. Failures stay isolated so one bad run never stops the others. Each lane runs the agent pipeline end-to-end.
Simulator 1
checkout.test.md
E C
payments.test.md
E C
Simulator 2
send-asset.test.md
E C
receive-flow.test.md
E C
Simulator 3
freestyle #1
E breadth-first sweep
swap.test.md
E C
Live Output
SuiteDisplay
TTY dashboard or CI tagged lines
Results
Suite Findings
suite-findings.json written atomically

Suite Configuration

A .suite.json file defines what to run — spec files and/or freestyle explorers.

.xqa/suites/smoke.suite.json
{
  "specs": [
    "specs/payments/*.test.md",
    "specs/auth/*.test.md"
  ],
  "freestyle": 2
}
specs
string[]

Glob patterns resolving to .test.md spec files. Each matched spec runs the full pipeline (Explorer → Consolidator) on its assigned simulator. Duplicates across patterns are removed.

freestyle
number

Number of freestyle explorer agents to run. Each gets its own simulator and performs a breadth-first UI sweep without spec files. Useful for catching regressions outside of scripted flows.

Both fields are optional but at least one must be present. Specs and freestyle agents compete for simulators through the same FIFO worker pool.

Single-Run Pipeline

Zooming in on one simulator lane: Explorer runs first, then Consolidator — each stage strictly sequential.

E
Explorer
Drives simulator, emits navigation & visual findings
Claude Agent SDK
C
Consolidator
Deduplicates, final findings
Claude
Sequential flow
Animated data flow

Agents

Explorer

Claude Agent SDK + MCP

Drives the iOS simulator, captures screenshots & accessibility trees, detects navigation and visual regressions, records video.

Responsibility

The Explorer is the first agent in the pipeline. It autonomously navigates the app in the iOS simulator, interacting with UI elements while capturing screenshots and accessibility tree snapshots at each step. It operates in two modes: freestyle (breadth-first sweep) or spec-guided (following markdown test specs). It records the entire session as video for later analysis. Visual quality review is delegated to a separate visual-pass hook — an isolated single-turn Anthropic call that fires synchronously after every view_ui capture and emits visual findings (design-system-violation, visual-regression, interaction-regression) via a forced visual_scan tool. The hook has no spec / navigation / app context, which empirically removes the tunnel-vision failure mode where the agent in spec mode skips visual review while focused on assertions. The hook is gated by the visualMode config: disabled skips the hook entirely, enabled-no-designs runs the visual reviewer with no artboard reference, and enabled-with-designs additionally surfaces candidate design artboards alongside each view_ui result. Both paths write findings into the same store.

Receives

  • ExplorerConfig — mode, app context, device UDID, timeout, visualMode
  • Spec files (markdown) when in spec mode
  • Design artboards from agents.explorer.visual.designsDir when visualMode is enabled-with-designs

Produces

  • ExplorerArtifacts — findings, video paths (1x/2x/4x), snapshots
  • Navigation findings (spec-deviation, stuck-loop, dead-end)
  • Visual findings (design-system-violation, visual-regression, interaction-regression)

Interactions

  • Produces a session video recording (consumed by the viewer)
  • Navigation and visual findings flow to Consolidator

Consolidator

Claude

Deduplicates findings from all agents, applies dismissal filters, outputs final report.

Responsibility

The Consolidator is the terminal agent. It receives all findings from the Explorer. It sends them to Claude for intelligent deduplication (same bug reported by multiple agents gets merged), applies persisted dismissals (previously marked false positives), and writes the final findings.json.

Receives

  • Navigation and visual findings from Explorer
  • Persisted dismissals

Produces

  • findings.json — deduplicated, filtered final findings

Interactions

  • Receives navigation and visual findings from Explorer
  • Outputs final findings.json to disk

Suite Components

Five components collaborate to orchestrate parallel spec execution.

Run Command

xqa run

CLI entry point. Reads .suite.json, resolves spec globs and freestyle agent count, validates config, discovers simulators, orchestrates provisioning, creates the worker pool, and handles SIGINT gracefully.

Responsibility

The Run Command is the top-level orchestrator. It reads a .suite.json config file that defines which specs to run (via glob patterns) and how many freestyle explorers to dispatch. It resolves globs into spec file paths, checks that the app path is configured (IOS_APP_PATH or ANDROID_APP_PATH), and discovers booted simulators. Spec runs and freestyle runs are both enqueued into the same FIFO worker pool. Progress is shown in the terminal; on completion it writes suite findings. On SIGINT it captures partial results and exits with code 130.

Receives

  • .suite.json — specs (globs) + freestyle count
  • Env: IOS_APP_PATH / ANDROID_APP_PATH, QA_EXPLORE_TIMEOUT_SECONDS

Produces

  • Orchestrated suite execution
  • Exit codes: 0 / 1 / 2 / 3 / 130

Interactions

  • Discovers booted simulators on the host
  • Creates and drives the Worker Pool
  • Streams progress to the terminal display
  • Writes suite findings on completion
  • Registers SIGINT handler for graceful abort (exit 130)

Worker Pool

FIFO Queue

Distributes spec execution across simulators. Per-spec failures are captured — not thrown. Handles timeouts with simulator re-provisioning.

Responsibility

The Worker Pool maintains a FIFO queue of pending specs. Each simulator worker claims the next spec when it becomes free. It runs the full pipeline (Explorer → optional video review → Consolidator) for each spec. Failed specs are isolated so one failure never crashes another simulator's work. On spec timeout, the simulator is re-provisioned before accepting the next spec.

Receives

  • List of resolved spec file paths
  • List of provisioned simulator UDIDs
  • SuiteObserver progress callback

Produces

  • Per-spec results: completed / failed / timeout
  • Typed SuiteEvent stream

Interactions

  • Provisions each simulator before the first spec
  • Runs Explorer → Consolidator pipeline per spec
  • Can also dispatch freestyle explorers to idle simulators
  • Streams progress events to the terminal display
  • Re-provisions the simulator after a timeout before the next spec

SuiteDisplay

TTY / CI

Renders suite progress. TTY mode: interactive dashboard with zoom (1-9 per spec, ESC to return). CI mode: tagged greppable log lines.

Responsibility

SuiteDisplay adapts to interactive terminals vs CI. In TTY mode it renders an interactive dashboard: spinners for running specs, checkmarks for completed ones, and a live queue section. Press 1-9 to zoom into a spec's verbose output; press ESC to return to the overview. In CI mode it emits single-line tagged log entries that are easy to grep. Terminal state is always restored on teardown.

Receives

  • Progress events from the Worker Pool

Produces

  • TTY: interactive dashboard with zoom
  • CI: tagged single-line log entries

Interactions

  • Subscribes to Worker Pool events via SuiteObserver interface
  • TTY: captures raw keypresses for zoom navigation (1-9 / ESC)
  • Guarantees terminal cleanup via finally and process.on('exit')

Suite Findings Writer

suite-findings.json

Aggregates per-spec findings into a single output file. Written atomically after all specs complete. On abort, partial results are written with "aborted": true.

Responsibility

The Suite Findings Writer collects per-spec pipeline results and writes suite-findings.json to a deterministic path. The suiteId is derived from sorted, slugified glob patterns. The runId is a zero-padded counter incremented per suite-plus-date combination. Findings are attributed per-spec with no cross-spec deduplication — each spec's findings remain independent.

Receives

  • Per-spec pipeline results from Worker Pool
  • Suite metadata (globs, runId, aborted flag)

Produces

  • suite-findings.json at deterministic path

Interactions

  • Called once by Run Command after Worker Pool drains
  • suiteId derived from sorted + slugified glob patterns
  • runId incremented per suite + date combination
  • On abort: writes partial results with "aborted": true

Simulator Provisioning

simulators

Manages simulator lifecycle. Discovers booted simulators, then provisions each: terminate → install → launch. Idempotent. Re-provisions after spec timeout.

Responsibility

Simulator provisioning installs and launches your app on each booted simulator before work begins. Discovery finds simulators that are already running. Provisioning terminates the app before installing so a stale binary is never left behind. After a timeout the pool provisions again before the next spec.

Receives

  • Simulator UDIDs
  • App path (IOS_APP_PATH / ANDROID_APP_PATH)
  • Bundle ID

Produces

  • Provisioned simulators ready for spec execution

Interactions

  • Discover booted simulators at startup
  • Terminate the app before installing a fresh build
  • Launch the app idempotently (terminate-first)
  • Called again by the Worker Pool after a timeout

Run lifecycle

What you see while a suite runs — each item moves through these stages.

Queued
spec name
Spec is waiting in the FIFO queue before any simulator picks it up.
Started
spec name simulator
A simulator claimed the spec and began the pipeline.
Progress
spec name message
Step completions and stage transitions — shown in the live dashboard and CI logs.
Completed
spec name findings count duration
Pipeline finished successfully for that spec.
Failed
spec name error duration
That spec failed. The suite continues — other specs keep running.
Timed out
spec name duration
Spec exceeded its timeout. The simulator is re-provisioned; the suite continues.

Exit Codes

0
All specs completed
1
Config error (missing env, bad glob)
2
No booted simulators found
3
All provisioning failed
130
SIGINT abort (Ctrl-C)

What each piece does

Capabilities you rely on during a run — not internal package names.

Findings & types

Shared shapes for findings, run artifacts, and reports used across Explorer and Consolidator.

Used by: Explorer Consolidator

Terminal & CI display

Live suite progress in an interactive TTY dashboard, or greppable tagged lines in CI.

Used by: Explorer Consolidator

Device control

Drive the simulator — view UI, tap, screenshot, and related actions during exploration.

Used by: Explorer

Pipeline

Orchestrates Explorer, optional video review, and Consolidator into one run with retries and recovery.

Used by: xqa run