Skip to content
verfix-devPublic

About

Verification runtime and execution observability for AI-generated web apps.

Topics

Resources

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

106 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Verfix

Verfix

Local-first browser verification runtime for AI coding agents.
Run deterministic browser flows, assert UI state, and get structured failure reports — all from your terminal.

npm version npm downloads License Docker Image PRs Welcome

Website · Docs · npm Package · Report a Bug · Request a Feature


Your coding agent says "fixed." Verfix checks.

AI coding agents verify their work by vibes — typecheck clean, tests green, "done!" — while the login button sits behind a modal they never saw. Verfix closes the loop: deterministic browser flows, typed failures, and structured JSON your agent can act on, all local.

// npx verfix run --flow login --output json
{
  "passed": false,
  "failures": [{
    "type": "selector_not_found",          // one of 8 stable, documented types
    "selector": "#submit-btn",
    "fix_hint": "The selector '#submit-btn' matched nothing. Nearest interactive element: button[data-testid=\"login-submit\"] — update the flow selector or restore the element."
  }],
  "trace_path": ".verfix/runs/a1b2c3.zip", // full Playwright trace — verfix show
  "timeline_url": null
}

The agent reads the JSON, fixes, re-runs. The loop terminates on verified browser state — not on the agent's optimism. Read more →

Does it actually close the loop?

We measure it. The loop-closure benchmark: 8 deliberately broken apps, the agent gets only Verfix's JSON as its failure signal — no human, no extra hints.

agent closure rate mean iterations
codex 7/8 (88%) 2
cline 6/8 (75%) 2
grok 5/8 (63%) 2
null agent (does nothing) 0/8 — enforced in CI —
oracle (known-good fix) 8/8 — enforced in CI 2

Anti-cheat invariants mean deleting an assertion doesn't count as closing the loop — every failed case above was the agent getting caught fixing things the wrong way. Full per-case breakdown in benchmark/results/; run it with your own agent: node benchmark/run.js --agent "<any command that reads JSON on stdin>".

Why not just let the agent drive Playwright itself?

You can — but an improvised check is the agent grading its own homework with a rubric it rewrites every iteration. Verfix inverts it:

agent drives a browser Verfix
Check between iterations different every time byte-identical
Failure output prose / screenshots to interpret 8 typed failure codes + fix_hint (a versioned contract)
Cost per verification LLM tokens, every time zero tokens in strict mode
Agent edits the measuring stick silent flagged (source-guard)
Evidence whatever it mentions recorded Playwright trace, replay with verfix show

Verfix is not a generic AI agent or chatbot wrapper. It is verification infrastructure. Reliability emerges from structured contracts, not unconstrained intelligence.


Features

Mode Description
Strict Fully deterministic. Selector-based flows, no AI. Best for CI/CD.
Assisted Deterministic with AI fallback. If a selector breaks, the runtime heals it semantically.
Exploratory Natural language task — AI navigates, reasons, and verifies on its own.
  • Flow Library — verfix.config.json holds as many independent flows as your app needs
  • Structured Output — every run returns typed JSON with passed, failures[], fix_hint, and a Playwright trace
  • Recorded Traces — every run captures a full Playwright trace (screenshots, network, console); open it with verfix show
  • Local-first — runs entirely in-process on Node.js 20+. No Docker, no services, no cloud. Strict mode needs no AI key.
  • AI Coding Agent Ready — ships with an AGENTS.md generator so Claude, Cursor, and Codex know exactly how to use it

Quick Start

Requirements: Node.js 20+ (that's it — no Docker)

# In your project directory
npx verfix init

The interactive wizard will:

  1. Detect your app's local URL
  2. Ask for the verification mode (default strict — fully deterministic, no AI key)
  3. Download Chromium if needed (~130MB, one-time, cached)
  4. Scaffold a verfix.config.json flow library
  5. Generate or update AGENTS.md for your coding agent

Running Verification

# See all available flows
npx verfix flows

# Run a specific flow
npx verfix run --flow <flow-id> --output json

# Run in exploratory mode (natural language)
npx verfix run --mode exploratory --task "verify the login page loads and shows a form" --output json

Example Output

{
  "passed": true,
  "failures": [],
  "timeline_url": null,
  "trace_path": "/your/project/.verfix/runs/exec_abc123_trace.zip",
  "show_command": "verfix show exec_abc123",
  "detail_commands": {
    "console": "verfix show exec_abc123 --console --output json",
    "network": "verfix show exec_abc123 --network --output json"
  },
  "duration_ms": 3120,
  "retry_count": 0,
  "exit_code": 0,
  "execution_id": "exec_abc123"
}

Results and Playwright traces are persisted under .verfix/runs/ (newest 20 runs kept). Open a recorded trace any time:

npx verfix show exec_abc123   # or just `verfix show` for the newest run

verfix.config.json

The config is a Flow Library — add one flow per user journey you want to verify:

{
  "baseUrl": "http://localhost:3000",
  "mode": "assisted",
  "flows": [
    {
      "id": "homepage-smoke",
      "steps": [
        { "action": "navigate", "url": "/" }
      ],
      "assertions": [
        { "type": "page_loaded" },
        { "type": "no_console_errors" }
      ]
    },
    {
      "id": "contact-form",
      "mode": "strict",
      "steps": [
        { "action": "navigate", "url": "/contact" },
        { "action": "type", "selector": "[data-testid=name]", "value": "Test User" },
        { "action": "click", "selector": "[data-testid=submit]" }
      ],
      "assertions": [
        { "type": "text_visible", "value": "Thank you" }
      ]
    }
  ]
}

Each flow can override the global mode — stable flows can use strict, new flows can use assisted.


CLI Reference

npx verfix init              # Interactive setup wizard (run with --yes for non-interactive mode)
npx verfix agent-setup       # Output machine-readable bootstrap instructions for AI agents
npx verfix flows             # List all flows in verfix.config.json
npx verfix run               # Run all flows
npx verfix run --flow <id>   # Run a specific flow
npx verfix show [id]         # Open the Playwright trace viewer for a run
npx verfix show --console    # Print a run's captured console log (--network for requests)
npx verfix probe -s "<css>"  # Dry-run a selector against the last run's DOM (~1s)
npx verfix list              # List recent runs
npx verfix status            # Check setup health (config, browser, last run)
npx verfix doctor            # Diagnose common setup issues

Run any command with --help for full option details. The Docker server runtime (API + dashboard, used by the future hosted product) is opt-in: pass --server to init, run, start, stop, status, logs, or update.

Non-Interactive Bootstrapping (for CI/CD & AI Agents)

For non-interactive environments, pass the --yes (or -y) flag. The default strict mode needs zero credentials:

npx verfix init --yes --base-url http://localhost:3000

To enable AI-backed modes (assisted/exploratory), supply a key:

npx verfix init --yes \
  --mode assisted \
  --ai-provider anthropic \
  --ai-key $ANTHROPIC_API_KEY \
  --base-url http://localhost:3000

Alternatively, you can use environment variables:

export VERFIX_AI_KEY="your-api-key"
export VERFIX_AI_PROVIDER="anthropic" # Optional, auto-detected from key if omitted
npx verfix init --yes --mode assisted

Dry-run Mode

You can preview the generated configuration as JSON without writing any files to disk by passing the --dry-run flag:

npx verfix init --yes --ai-key sk-ant-... --dry-run

Architecture

By default Verfix runs everything locally in a single Node.js process — the CLI calls the verification engine (@verfix/engine, Playwright-based) directly and persists results + traces to .verfix/runs/:

Execution path (local mode — the default):
  CLI → @verfix/engine (in-process) → Browser → .verfix/runs/<id>.json + trace

The Docker server runtime (Go API + Redis queue + containerized workers + timeline dashboard) still exists for the future hosted CI product and is opt-in via --server:

Execution path (server mode, --server):
  CLI → API (Docker) → Redis → Worker (container) → Browser → Postgres → Dashboard

Monorepo Structure

Package Description
cli/ npm package verfix — runtime lifecycle + flow runner
api/ Go + Fiber API — job ingestion, queue, execution state
workers/ Node.js Playwright workers — browser execution engine
dashboard/ Next.js execution timeline dashboard
sdk/ TypeScript SDK for programmatic integrations
docs/ Full documentation

Documentation


Contributing

We welcome all contributions — bug fixes, new assertion types, CLI improvements, and docs.

See CONTRIBUTING.md for local setup, architecture overview, and the PR process.

# Quick start for contributors
git clone https://github.com/verfix-dev/verfix.git
cd verfix
npm install   # workspaces: installs + live-links cli <-> workers <-> sdk

Community & Support


License

Apache 2.0 — see LICENSE.md for details.

About

Verification runtime and execution observability for AI-generated web apps.

Topics

Resources

Contributing

Security policy

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages