Skip to main content

Demonstration compiler: record a desktop workflow once, compile it into a deterministic, self-healing, locally-run script.

Project description

openadapt-flow

Record a GUI workflow once. Replay it deterministically, locally, for free. A model only touches the script to repair it.

Computer-use agents re-reason on every run: screenshot, think, click, repeat. That's the right shape for a task nobody has automated before, and the wrong one for the 500th referral this month. openadapt-flow makes the other bet. It compiles a human demonstration into a plain, reviewable script with vision anchors and per-step assertions. A healthy script replays in milliseconds with zero model calls. When the UI shifts, a fallback ladder still finds the target, and the fix gets written back into the script as a diff you can review. The automation gets cheaper over time instead of billing you to re-think the same eleven clicks.

How it works

A recording captures screenshots and input events while a person does the task once. The compiler turns that into a workflow bundle: for every click it stores a template crop, the OCR'd label, and offsets to nearby landmark text, then derives postconditions from what actually changed on screen after the action. Typed values can be tagged as parameters, so one demo yields a reusable, parameterized automation plus a generated workflow.py rendering a human can code-review.

At replay time, each step walks a resolution ladder:

  1. template match near the recorded location (milliseconds, no model)
  2. template match across the whole screen
  3. OCR match on the label
  4. geometry from surrounding landmarks
  5. optionally, a grounding model (local or API)

Resolving below the top rung triggers a heal: fresh crop, updated coordinates, re-read label, saved as a reviewable change to the bundle. Postconditions check that each step actually worked. If the screen stops matching expectations entirely (a surprise dialog, a changed process), the run halts with an illustrated report rather than guessing. Steps tagged irreversible refuse to act on low-confidence resolutions at all.

The runtime is vision-only: PNG in, clicks and keys out, behind a small Backend protocol. The reference backend drives a headless browser, which is what lets the entire record→compile→replay→heal loop run in CI with no OS permissions. Native desktop and RDP backends are planned adapters behind the same protocol.

What it looks like

One demonstration was recorded on the light UI (left). The compiled workflow then ran unattended against a dark theme it had never seen (right): all 11 steps succeeded, every anchor re-resolved through the OCR or geometry rungs, and all 8 anchors healed themselves back onto the fast path. No human involved.

Recorded UI → baseline replay (all template rung, 0 model calls) Theme-drifted UI → replay + self-heal (8/8 anchors healed)
Baseline replay final screen Theme-drift replay final screen

Every replay generates an illustrated run report: baseline · theme drift with heals.

Quickstart

pip install -e '.[dev]'
playwright install chromium

# 1. Record a demonstration (drives the bundled MockMed demo app):
openadapt-flow demo-record --out /tmp/rec

# 2. Compile it into a workflow bundle:
openadapt-flow compile /tmp/rec --out /tmp/bundle --name triage-demo

# 3. Replay it — deterministic, local, zero model calls:
openadapt-flow replay /tmp/bundle --run-dir /tmp/run
open /tmp/run/REPORT.md

# 4. Drift the UI (dark theme it has never seen) and watch it heal:
openadapt-flow replay /tmp/bundle --drift theme \
    --run-dir /tmp/run-drift --save-healed-to /tmp/healed
open /tmp/run-drift/REPORT.md

Steps 3–4 serve the bundled MockMed app automatically. To replay against your own running app, pass --url (parameters default to the values recorded during the demo; --param overrides them):

openadapt-flow replay /tmp/bundle --url <APP_URL> \
    --run-dir /tmp/run --param note="Booking 3 months"

bench replays a bundle N times and aggregates success rate, latency percentiles, and cost: openadapt-flow bench /tmp/bundle --n 10 --run-root /tmp/bench.

The test suite includes the full drift matrix (theme, moved buttons, renamed buttons, surprise modal) end to end:

pytest -q

Status

v0. The record→compile→replay→heal loop runs end to end against MockMed, the bundled mock clinical app, under four kinds of deliberate UI drift. The suite (124 tests) runs headlessly in GitHub Actions and uploads run reports as build artifacts. Compiled workflows can also be emitted as Agent Skills (SKILL.md) and MCP servers, so other agents can invoke them.

Solid for the reference browser backend; everything else should be treated as a design seam, not a finished feature. See DESIGN.md for module contracts and docs/L1_INTEGRATION.md for feeding layered clinical-data platforms (L1→L2 acquisition contracts). MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openadapt_flow-0.1.0.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

openadapt_flow-0.1.0-py3-none-any.whl (67.0 kB view details)

Uploaded Python 3

File details

Details for the file openadapt_flow-0.1.0.tar.gz.

File metadata

  • Download URL: openadapt_flow-0.1.0.tar.gz
  • Upload date:
  • Size: 1.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for openadapt_flow-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fbf780cf29cba170de4623d57b161b35c66597c697b411bc2b3a696b4bccbeef
MD5 bb14d83d13d9c1900a751d9843b6a147
BLAKE2b-256 a63b4b83f47474c62ae5aa1968a5e61123441416e6a8fd63c6b32b6192c29588

See more details on using hashes here.

Provenance

The following attestation bundles were made for openadapt_flow-0.1.0.tar.gz:

Publisher: release.yml on OpenAdaptAI/openadapt-flow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file openadapt_flow-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: openadapt_flow-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 67.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for openadapt_flow-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb54dc518769c6a47bdf54050ccbe31ff78b450054bc6c7fa42e2d132e927dc6
MD5 1e98697e37ceed42d8f9c2c07ff3bd02
BLAKE2b-256 37f9c95f1fe8d1736aff8f0c75b4e4fc6811a372d1a0e6290edbfb21106811a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for openadapt_flow-0.1.0-py3-none-any.whl:

Publisher: release.yml on OpenAdaptAI/openadapt-flow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page