Change the route without moving the finish line.
A contract hash covers intent + outcomes. Healing can rewrite drifted steps, but it cannot silently weaken what the spec promises.
sha256:98b7…4a21verifiedBehavioral browser specs for coding agents
Cairntrace is a local-first browser testing layer for AI coding agents. Define the user outcome once, replay it through a real browser, and return failures with the evidence needed to fix them.
git clone https://github.com/abdul-hamid-achik/cairntrace && cd cairntrace && bun installOpen source. MIT licensed. Runs from source with Bun.
version: 1
name: orders_filter
intent: an admin can find failed orders
session:
resume: admin
outcomes:
- id: failed_orders_visible
description: only failed orders remain
verify:
text: { contains: "Payment failed" }
steps:
- open: { path: /orders, waitUntil: networkidle }
- click: { by: role, role: button, name: "Failed" }The missing acceptance layer
Coding agents can change the code, run unit tests, and still miss a broken checkout, an empty dashboard, or a button that no longer responds. Cairntrace moves the final check into the browser and makes its result legible to the next agent.
Read the contract-first authoring guideintent + outcomes define what success means.
steps are executable hints, not the contract itself.
Reports, snapshots, console, network, and outcome files.
A tighter agent loop
Cairntrace gives the agent a deterministic route from product intent to browser evidence without coupling the spec to one model or one test runner.
Write the intent and typed observables before scripting the clicks.
cairn spec verify flows/checkout.yml --stampUse a login action, checkpoint, or deterministic precondition for cold-start replay.
cairn run flows/checkout.yml --cold-start --jsonRead the focused agent context, inspect the evidence, and repair only the path.
cairn context latestBuilt for work that survives the demo
Human-readable contracts at authoring time. Stable machine-readable output at run time. Rich evidence when the browser disagrees.
A contract hash covers intent + outcomes. Healing can rewrite drifted steps, but it cannot silently weaken what the spec promises.
sha256:98b7…4a21verifiedCLI commands support JSON, YAML, and Markdown. MCP tools mirror the same surface, so any capable coding agent can author, run, and read the same spec.
Use it where confidence is expensive
Cairntrace fits the moment between “the code compiles” and “ship it.” Keep the spec beside the feature, let the agent run it while working, and preserve the evidence for review or CI.
Verify the user-visible outcome before the task is called complete.
Cover login, checkout, imports, dashboards, and multi-step operations.
Compare the browser state and patch locator drift without rewriting intent.
Open a self-contained report instead of reconstructing the run from raw logs.
Questions, answered
Still evaluating the fit? The docs stay concrete and the repository is public.
Inspect the source on GitHubCairntrace is a local-first behavioral browser-spec layer for coding agents. A YAML spec defines the product intent, the observable outcomes, and a repairable sequence of browser steps.
No. Cairntrace adds a contract and agent-readable evidence layer. It can use Playwright as a backend and export stable specs to Playwright when conventional CI tests are the better destination.
Any agent that can call a CLI or MCP server can use the same Cairntrace surface. There are no product-specific branches for Codex, Claude Code, Cursor, or OpenCode.
Normal runs are local-first. Browser state and artifact packs are written locally. Optional integrations only run when you configure or invoke them.
Semantic locators fail with diagnostics, and the healer can propose step changes from fresh browser snapshots. The contract hash prevents those repairs from silently changing the intended outcome.
The browser gets the final word
Clone Cairntrace, run the demo flow, and give your next coding task a browser contract.