Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ad23d31
feat(jev-step): pick each browse step with Jev, act via playwright-cli
tenequm Sep 18, 2026
6f12a18
fix(jev-step): gate step completion and the chosen target
tenequm Sep 18, 2026
b1c9cd6
refactor(jev-step): move into the cuttle module at cmd/jev-step
tenequm Sep 18, 2026
8e48711
docs(cli): jev-browse skill, briefing and operator docs
tenequm Sep 18, 2026
4780a61
feat(cli): cuttle jev-browse - System-One browsing loop on the bundle…
tenequm Sep 18, 2026
6aedaa7
fix(jev): keep filled field values out of --extract
tenequm Sep 18, 2026
9181241
fix(jev): reject a step budget below one
tenequm Sep 18, 2026
80a505e
fix(jev): name the page the last action reached in the max-steps brief
tenequm Sep 18, 2026
a3bffc4
fix(jev): let the last modal block of a capture win
tenequm Sep 18, 2026
a20a05b
refactor(jev): drop Snapshot.offered, which only the tests called
tenequm Sep 18, 2026
d4e1beb
fix(jev): stop printing an empty page in the blocked brief
tenequm Sep 18, 2026
3aaa84a
feat(jev): OpenRouter transport for the Jev API
tenequm Sep 18, 2026
be91bb3
test(jev): keep the captured OpenRouter body out of the secret scanner
tenequm Sep 18, 2026
c794d9e
docs(knowledge): jev-browse decisions and driver findings
tenequm Sep 18, 2026
d38301f
fix(jev): re-goto after back to work around driver ref poisoning
tenequm Sep 18, 2026
cf3d96a
fix(jev): polish - rune-safe truncate, option-count guard, extract cl…
tenequm Sep 18, 2026
d6bb909
docs(cli): say what --extract picks and that --text values show in ps
tenequm Sep 18, 2026
39ef953
docs(knowledge): link the filed upstream go-back ref report
tenequm Sep 18, 2026
e02b262
docs(knowledge): jev-browse ecosystem survey
tenequm Sep 18, 2026
ba3086d
fix(jev): polish - driver error text, unanswered questions, retry saf…
tenequm Sep 18, 2026
5d27e3a
fix(cli): guard a verbless driver call and name the --text error for …
tenequm Sep 18, 2026
3451ad8
docs(operating): say where a --text value can still surface
tenequm Sep 18, 2026
6eca9f9
feat(cli): accept the task as a positional arg
tenequm Sep 18, 2026
0e96e55
fix(jev): guard blank-page starts and explain value-less blocks
tenequm Sep 18, 2026
e3478ac
docs(jev): openRouterModel is an alias, not a frozen pin
tenequm Sep 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ font-renaming stage is separate and does not ship.
patch series, the Linux build driver (`build/`), the Hetzner build-host scripts
(`hetzner/`), and the behavioral validate harness (`validate/`). `versions.env`
is the version/sha pin. See its README.
- `packages/cuttle/internal/jev/` - the autonomous browsing loop behind
`cuttle jev-browse`: the TypeSafe System-One client, the aria-snapshot parser,
and the per-step decide/act loop. It never talks CDP - it drives the bundled
playwright-cli through the runner `internal/cli/playwright.go` hands it, in the
same driver session as `cuttle pw`, so a person can pick a stopped run up
mid-state. `--mock` runs the whole loop with no API key, which is how the tests
exercise it; the key comes from `CUTTLE_TYPESAFE_API_KEY` and nowhere else.
- `ops/docker/` - the container build assets: `Dockerfile` (stealth-Chromium
runtime + headed Xvfb/openbox + KasmVNC; multi-arch, amd64 = Windows persona,
arm64 = macOS persona), `bin/` (entrypoint + VNC viewer), `winfonts/README.md`
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ one: playwright-cli 0.1.20 is bundled in the image, so `cuttle pw <args>` drives
the browser on any backend with nothing to install and nothing to attach by hand
([docs/OPERATING.md](docs/OPERATING.md)).

It can also drive itself: `cuttle jev-browse --task '...'` walks toward a goal one
step at a time, picking the next element with a fast decision model rather than an
LLM and performing it with that same bundled driver. When it stops - done, blocked
or out of steps - the browser is left on that exact page, so you or your agent
carry on with plain `cuttle pw` commands
([the loop, in detail](docs/OPERATING.md#autonomous-browsing-loop-jev-browse)).

## Why not Claude in Chrome or ChatGPT?

They overlap a lot: all three use a real browser, keep your logins, pass bot
Expand Down
77 changes: 76 additions & 1 deletion docs/OPERATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,79 @@ cuttle pw detach # optional; the browser stays up
out with `cuttle downloads <name>` like a page download. The driver's own
auto-named output goes to a `.playwright-cli/` dotdir the listing hides.

## Autonomous browsing loop (jev-browse)

`cuttle jev-browse` drives that same bundled driver on its own: it reads the
page's accessibility snapshot, asks a System-One decision model (TypeSafe's Jev)
which element to act on next, and has playwright-cli perform the pick - then
snapshots again. There is no LLM in the loop and no generated text: a decision is
one typed choice with a calibrated confidence, and a page where nothing makes
progress - or an answer naming an element the page never offered - ends the run
instead of being guessed at.

```bash
cuttle jev-browse --task 'download the latest invoice' \
--url https://example.com/billing --max-steps 25
cuttle jev-browse --task 'sign in' --text user=qa@example.com \
--text pass='{{cuttle:QA_PASS}}' # only the NAMES are sent
cuttle jev-browse --task 'list the open tickets' \
--extract 'one ticket, with its id and title' --json
cuttle jev-browse --task '...' --mock # no key, no model call
```

Exit codes are the result: `0` the task is done, `1` an error, `3` blocked (a
person is needed), `4` the step budget ran out.

- **The key is an environment variable, and only that.** `export
CUTTLE_TYPESAFE_API_KEY=...` in the shell that runs `cuttle` - there is no flag
and no config key for it, so it never reaches argv or `config.toml`. It is read
on this host; the container never sees it. A value that must come from a vault
goes in the same way as anything else here, e.g. `export
CUTTLE_TYPESAFE_API_KEY=$(op read op://vault/typesafe/api-key)`.
- **An OpenRouter key works in the same variable.** OpenRouter resells the same
model, and a key beginning `sk-or-` routes itself there - same variable, no
flag and nothing to configure. The first-party API is the default for every
other key. The OpenRouter model is pinned to an exact version rather than the
`latest` alias, so an upgrade is a release of cuttle and never a silent change
of judgement mid-run.
- **`--mock` needs no key.** It exercises the whole loop - snapshot parsing,
element filtering, the driver calls, the exit paths - with a local decider that
picks the first plausible element. Only the judgement is mocked: it clicks and
types on the live page for real, so point it at a page you are willing to have
it press the first button on.
- **It shares the driver session with `cuttle pw`.** Same session daemon, same
tabs, same refs. When the run ends blocked (exit `3`: an escalation, a login
wall, a native dialog) or runs out of steps (exit `4`), the browser is left
exactly where it stopped, so the next step is a plain `cuttle pw snapshot` and
manual verbs from there - nothing to re-navigate, nothing to re-authenticate.
- **Humanized input stays on.** Every action the loop takes goes through the same
humanization as any other driver action; there is no fast path for it, by
design (see `docs/knowledge/decisions/humanize-over-speed.md`).
- **What is fast is the decision, not the action.** A choice comes back in a few
hundred milliseconds where an LLM round trip is seconds, and that is where the
saving is. The action is unchanged: a humanized click is about half a second,
typing about an eighth of a second per character, plus whatever the page takes
to load. Over a 20-step run the wall clock is dominated by the browser, not by
the model, so expect a modest end-to-end speedup - the large factor is in
tokens and per-decision latency, not in how fast the page gets driven.
- **Secrets work as everywhere else.** `--text` supplies what may be typed and
only the NAMES are sent to the model - the value is looked up here afterwards
and handed to the driver verbatim, so a `{{cuttle:NAME}}` sentinel from `cuttle
secret set` passes through untouched and is substituted inside the CDP frame
(see "Secrets the session types for you" below). Element labels and page text
are data throughout: quoted into the log, offered as choices, never followed as
instructions. A `--text` value is argv, visible in the host's `ps` while the run
lasts; pass a secret as a `{{cuttle:NAME}}` sentinel to keep it out. One
residual either way: a value typed into a box whose form submits with GET ends
up in the page URL, and the URL is what the step log prints and what the next
request names the page by - so a search box is not a place to put a credential.
- **`--extract` picks items, it does not answer.** On the final page the model
judges each line against the description and the matching lines are printed
verbatim; headings, labels and descriptive prose are deliberately never picked.
It works best for list-shaped answers (tickets, rows, results) and returns
nothing useful for a question whose answer is a sentence. It needs the model,
so it is refused with `--mock`.

## Reading what the daemon did

`cuttle logs` prints the container's log (`docker logs` / `kubectl logs`) - the X
Expand Down Expand Up @@ -251,7 +324,9 @@ cuttle secret rm GH_PASS # value AND resolv
- **A value only ever travels on stdin or in a request body.** Never in argv,
which is world-readable in `/proc` and lands in shell history. `set` takes
`--stdin` or `--exec`, never a positional value, and no verb prints a stored
value back - `ls` reports source, state, length and origin only.
value back - `ls` reports source, state, length and origin only. The one verb
that will take a value in argv is `jev-browse --text name=value`, which is
exactly why a secret there belongs in a `{{cuttle:NAME}}` sentinel instead.
- **Resolution happens here, not in the container.** The daemon has no vault, no
keychain and no biometrics, and there is no daemon-to-host callback, so
`--exec` runs the command on this host at `set` time. Its stderr is discarded
Expand Down
59 changes: 59 additions & 0 deletions docs/knowledge/decisions/playwright-cli-is-the-driver-interface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
type: Decision
title: playwright-cli is the driver interface for higher-level automation
description: cuttle composes the bundled playwright-cli for all higher-level browsing automation (cuttle pw, cuttle jev-browse) - never raw CDP, never its own snapshot or ref semantics.
tags: [drivers, playwright-cli, cuttle-pw, jev-browse, stealth]
status: stable
generated: { by: claude-code/claude-opus-5, at: "2026-09-18T15:55:00+00:00" }
sources:
- id: maintainer
resource: "maintainer decision during the jev-browse design discussion, 2026-09-18"
title: Maintainer decision
- id: survey
resource: "session research, 2026-09-18: ecosystem survey of 12 open-source agent-browser repos in the jev-browse style (no durable link)"
title: Ecosystem survey
- id: code
resource: /packages/cuttle/internal/cli/playwright.go
title: cuttle pw wrapper
---

# Decision

Every higher-level browsing feature cuttle ships - the `cuttle pw`
passthrough and `cuttle jev-browse` alike - is built by composing the
bundled playwright-cli. cuttle does not drive pages over raw CDP itself and
does not reimplement snapshot, ref or actionability semantics.[^maintainer][^code]

Why:

- **Microsoft maintains the hard parts.** The aria snapshot, element refs
and actionability waiting are the pieces that break on real pages; the
driver owns them and fixes them upstream.[^maintainer]
- **The version cannot drift silently.** The driver is pinned three ways -
`versions.env`, the Dockerfile ARG and a Go const - and a test fails when
they disagree, so any behavior cuttle leans on changes only through a
reviewed pin bump.[^code]
- **Stealth guarantees hold either way.** The driver attaches through
cuttle's CDP mux, so humanized input and `{{cuttle:NAME}}` secret
sentinels apply to its verbs exactly as to any other client.[^maintainer]
- **The exec cost is acceptable.** Each verb is a separate process call,
roughly 200-600ms. Speed of action is explicitly not the product's goal -
see [Humanized input is the value proposition](/decisions/humanize-over-speed.md) -
so this overhead buys nothing worth reimplementing the driver for.[^maintainer]

A detection argument reinforces it: a survey of 12 agent-browser repos in
the jev-browse style found every one hand-rolling page perception with
DOM-stamped attributes (ids or data attributes written into the page to
address elements) - a beacon any page script can read.[^survey] Delegating
perception to the driver, whose scripts run in an isolated world, avoids
that for free.

Consequence: a new feature that needs to read or act on a page goes through
the driver. A gap in the driver is a reason to work around it narrowly
(and file upstream), not to start a parallel CDP perception layer.

Related: [playwright-cli attach and session model](/findings/playwright-cli-attach-model.md).

[^maintainer]: Maintainer decision
[^survey]: Ecosystem survey
[^code]: cuttle pw wrapper
44 changes: 44 additions & 0 deletions docs/knowledge/findings/aria-snapshot-renders-secret-values.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
type: Finding
title: The aria snapshot renders field values, password inputs included
description: playwright-cli's aria snapshot prints current field values in plaintext - type=password too - so snapshot text must have value suffixes stripped before it leaves the host.
tags: [secrets, playwright-cli, jev-browse, snapshot]
status: stable
generated: { by: claude-code/claude-opus-5, at: "2026-09-18T15:55:00+00:00" }
sources:
- id: code
resource: /packages/cuttle/internal/jev/loop.go
title: pageLines and valueRE (regression-tested in loop_test.go)
- id: live
resource: "live validation against a local cuttle image build, 2026-09-18: a filled password field's value appeared in the snapshot (session record, no durable link)"
title: Live validation
---

# Finding

The driver's aria snapshot renders the current value of an input as the
node line's suffix - `- textbox "Password" [ref=e8]: hunter2` - and does so
for `type=password` fields as well. After a `{{cuttle:NAME}}` fill, that
value IS the substituted secret.[^live][^code]

Consequence: any feature that ships snapshot-derived text off the host
(`cuttle jev-browse --extract`, any future summarizer) must drop value
suffixes first, or a secret the sentinel system kept out of the transcript
leaves the machine anyway.

How jev-browse holds this line:

- `pageLines`, the only path that sends page text to the API, skips every
node whose role carries a value (`textbox`, `searchbox`, `combobox`,
`spinbutton`, `slider`) via `valueRE`; a regression test pins it.[^code]
- The decide path was names-only by design from the start: the model sees
value NAMES, and the value itself is looked up locally only after the
answer returns.[^code]

Anyone adding a new consumer of snapshot text should reuse that filtering,
not re-derive it.

Related: [playwright-cli is the driver interface](/decisions/playwright-cli-is-the-driver-interface.md).

[^code]: pageLines and valueRE (regression-tested in loop_test.go)
[^live]: Live validation
52 changes: 52 additions & 0 deletions docs/knowledge/findings/jev-api-transports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
type: Finding
title: TypeSafe Jev API transports and answer shapes
description: The Jev client routes one API key to OpenRouter or the first-party API by its prefix, and OpenRouter sends a confidence on choice answers despite documenting only probabilities.
tags: [jev, jev-browse, api, openrouter]
status: stable
stale_after: "2027-03-18T00:00:00+00:00"
generated: { by: claude-code/claude-opus-5, at: "2026-09-18T15:55:00+00:00" }
sources:
- id: code
resource: /packages/cuttle/internal/jev/client.go
title: Jev client (with request goldens in internal/jev/testdata/)
- id: live
resource: "live call transcript against both transports, 2026-09-18 (session record, no durable link)"
title: Live calls
- id: or
resource: https://openrouter.ai/typesafe/jev-1.13
title: OpenRouter model page for typesafe/jev-1.13
---

# Finding

The TypeSafe Jev client reads one env var, `CUTTLE_TYPESAFE_API_KEY`, and
routes by the key's prefix: a key starting `sk-or-` goes to OpenRouter
(`POST https://openrouter.ai/api/alpha/decisions`), anything else to the
first-party `api.typesafe.ai`. There is no flag and no second env var - the
key says which it is.[^code]

- **Request bodies are identical except the model line**, pinned by two
goldens (`request.golden.json`, `request.openrouter.golden.json`). On
OpenRouter the model is pinned to `typesafe/jev-1.13`, never the moving
`~typesafe/jev-latest` alias: a model that changes under a fixed prompt
changes every decision without a line of diff.[^code][^or]
- **OpenRouter does return `confidence` on choice answers**, although its
documented answer shape describes only `probabilities`. The two differ:
a pick with probability 0.99 came back with confidence 0.98. The client
prefers the server-sent confidence and derives it from
`probabilities[choice]` only when absent.[^live][^code]
- **A noul answer has no confidence field** on either transport - its
probability is its confidence - matching the first-party docs, so the
loop holds nouls to the same threshold as choices.[^live][^code]
- Observed cost profile: roughly 485-734ms per decision step and about
$0.00006 per step at $0.042/M input tokens, output free.[^live][^or]

The API is days old at capture; re-check answer shapes, pricing and the
pinned model's availability before relying on them past `stale_after`.

Related: [Humanized input is the value proposition](/decisions/humanize-over-speed.md).

[^code]: Jev client (with request goldens in internal/jev/testdata/)
[^live]: Live calls
[^or]: OpenRouter model page for typesafe/jev-1.13
47 changes: 47 additions & 0 deletions docs/knowledge/findings/playwright-cli-go-back-ref-poisoning.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
type: Finding
title: playwright-cli go-back leaves the snapshot emitting dead refs
description: In the bundled playwright-cli 0.1.20, after go-back every snapshot ref is from the pre-navigation frame and clicks on it fail; only a fresh goto re-mints working refs.
tags: [playwright-cli, drivers, jev-browse, upstream-bug]
status: stable
stale_after: "2027-03-18T00:00:00+00:00"
generated: { by: claude-code/claude-opus-5, at: "2026-09-18T15:55:00+00:00" }
sources:
- id: code
resource: /packages/cuttle/internal/jev/loop.go
title: jev-browse loop, back action
- id: live
resource: "live repro transcripts, 2026-09-18: first through cuttle pw, then standalone playwright-cli attached over --cdp to a plain headless Chrome, no cuttle code in the path (session record, no durable link)"
title: Live repro
- id: upstream
resource: https://github.com/microsoft/playwright/issues/42777
title: Upstream report
---

# Finding

In `@playwright/cli` 0.1.20 - the pinned bundled driver - a `go-back` leaves
the snapshot emitting refs from the pre-navigation frame generation. Every
click on those refs fails with `Ref ... not found in the current page
snapshot`. Taking more snapshots does not recover; only a fresh `goto`
re-mints refs that work.[^live] It shows once refs are frame-qualified
(`fNeM`): the snapshot after `go-back` reuses the pre-navigation generation
number instead of minting a new one. On the first page of a fresh session,
with unprefixed refs, a click after `go-back` worked.[^live][^upstream]

It reproduces standalone over a CDP-attached session with no cuttle code in
the path, so it is a driver bug, not a mux artifact.[^live][^upstream]

jev-browse contains it deterministically: after executing a `back` action
the loop re-`goto`s the URL it landed on, so the next snapshot's refs are
live. The workaround is commented against the driver pin and must be
re-evaluated on every pin bump - drop it once the driver fixes the
bug. `TestJevBackWorkaroundTracksTheDriverPin` fails on any pin bump to force
that re-check.[^code]

Related: [playwright-cli attach and session model](/findings/playwright-cli-attach-model.md),
[playwright-cli is the driver interface](/decisions/playwright-cli-is-the-driver-interface.md).

[^code]: jev-browse loop, back action
[^live]: Live repro
[^upstream]: Upstream report
Loading
Loading