Commit Graph
31 Commits
Author SHA1 Message Date
Oskar Kwaśniewski 6f528be1a8 fix(agent): fail tainted fallback-only steps with POLICY_DENIED (#827) 2026-10-05 16:05:55 +02:00
Oskar Kwaśniewski a53472cc42 fix(agent): extract stops inventing data, clearer unchanged-screen feedback, stable committed recordings (#668)
* fix(agent): extract reports absent data instead of inventing it

Send the caller schema's shape only (no min/max/length/pattern/format) inside
an agent-extract-2 envelope { found, value, missing }. found: false fails the
step ASSERTION_INCONCLUSIVE naming what was missing; the repair round may
decline instead of bending a value to fit. Explore covers a declined plan like
an invalid one.

* fix(cache): ignore a gap's derived rule when comparing re-recorded flows

derived follows how the agent read the value on that run (pixels vs node),
never what a replay does, so read-write runs rewrote committed entries.

* fix(agent): stop blaming a control for an unchanged tree without pixel proof

Tree-only unchanged result now says no listed node changed and a drawn
change needs a screenshot; "no visible effect" only when an identical
screenshot backs it. With no screenshot to be had (secret filled, engine
captures none), an unchanged listing still says to try another way.

* fix(cache): REPLAY_STALE names the strict knob and configured cache dir

Was hardcoded to --strict-cache and .e2e/cache even when cache.strict or
cache.dir came from config.
2026-09-30 14:45:53 +02:00
Oskar Kwaśniewski 8904b02ab5 docs(reference): fix stale and missing claims, sync JSDoc (#655)
* docs(reference): fix stale and missing claims, sync JSDoc

* docs(reference): only the built-in agent needs a model to acquire the fixture
2026-09-29 22:53:18 +02:00
Oskar Kwaśniewski d228e22ea3 feat(agents)!: plain-object agents entries; createAgent and limits removed (#646)
* feat(agents)!: plain-object agents entries, createAgent and limits removed

Each agents entry is one AgentConfig object: model, judge, system, context,
tools, maxSteps, maxModelCalls, judgmentTimeout, maxObservationBytes,
maxInputTokens, providerOptions, or executor for a custom brain (system and
tools rejected beside it). No inheritance between agents.

- createAgent() kept as a stub throwing INVALID_CONFIG; bare StepExecutor or
  legacy createAgent value as an entry fails naming { executor } / the object
- timeout -> judgmentTimeout, maxTurns removed (entry and
  createToolLoopExecutor), unknown keys get did-you-mean
- top-level limits removed; maxModelTokensPerCall -> per-agent
  maxInputTokens, the rest internal constants; report-1 run.limits keeps
  its shape, filled from max across agents plus the constants
- tools validated at config load; built-in agent built from the entry at
  fixture time; explore and the MCP catalog read the entry's tools
- migrate apps, docs, docs examples, init scaffold, skills, mobile README

* docs: AGENTS.md names the agent entry's model, not createAgent

* refactor(agents)!: delete createAgent instead of a throwing stub

* docs: MODEL_UNAVAILABLE scoped to the built-in agent, fixture-acquisition timing
2026-09-29 19:51:02 +02:00
Oskar Kwaśniewski d7a218af07 feat(config)!: config shape, part 1: recording modes, output root, test-glob exclusions, renames, secrets in engine options (#645)
* feat(config)!: remove specVersion from the config

The runner version is the format version. A config that still sets
specVersion fails INVALID_CONFIG telling the author to remove it. The
report's run.specVersion and the replay cache key keep their hard-coded
copies.

* feat(collect): "!" exclusions in the tests globs

An entry starting with "!" removes files an including glob matched,
in any order. Discovery never reads a directory an exclusion takes
whole, unless an including glob could reach a dot name beneath it.
A list of only exclusions is INVALID_CONFIG.

* refactor!: CacheStore and web({ screencast }) renames

TraceCacheStore is CacheStore, and the docs, skill, and CLI call the
cache the replay cache. web({ video: { size, quality } }) is
web({ screencast }) with WebScreencastOptions; web({ video }) fails
INVALID_CONFIG naming screencast.

* feat(secrets): secrets.get() in engine options, resolved per attempt

At config evaluation, before any run exists, secrets.get(name) returns
a reference by name. An engine declares the handles its options hold
in defineEngine({ secrets }); the config load fails INVALID_CONFIG for
a name no secret or credential has. The engine reads the value through
EngineAttemptContext.resolveSecret, which runs a provider fresh and
registers the value in the session and process ledgers before it
returns, without tainting the viewport. e2e/engine exports isSecret.

web({ basicAuth: { password } }) takes a Secret and declares it. Docs
show process.loadEnvFile('.env') in the config.

* feat(run)!: trace and video share recording modes; artifacts holds only store

One RecordingMode ('off' | 'on' | 'retain-on-failure' | 'on-first-retry' |
'on-all-retries') for trace and video, set on the config, a target, the CLI
(--trace [mode], --video [mode]) and a test, one precedence rule: config,
target, CLI, test. Trace defaults to on locally, on-first-retry in CI, with
a plan-time notice when a retry mode meets retries: 0. Serial members cannot
set trace.

Capability rule: a mode from the config root or a flag applies to targets
whose engine can record it, one notice naming the rest; a mode set on a
target or a test is required and fails with UNSUPPORTED_ARTIFACT.

artifacts.kinds (both forms) and artifacts.trace are removed and fail
INVALID_CONFIG naming the trace mode they meant. Failure screenshot and
screen text are always captured when the engine can. MCP sessions keep the
target's trace mode and trace only under 'on'.

* feat(run)!: output directory for every run result; ArtifactStore.putLink

output (default .e2e) and --output <dir> on run and explore hold report.json,
junit.xml, summary.md, ai-trace.json, artifacts/, sessions/ and the e2e mcp
session files; --last-failed reads <output>/report.json. The reportSibling
derivation from the artifacts dir is gone. --artifacts stays as a hidden
flag that fails with the --output it maps to.

A run clears <output>/artifacts at start. cache.dir stays independent. An
output that is the project root or outside it, is or sits in cache.dir,
would hold cache.dir under artifacts/, sessions/ or videos/, or holds a
tests glob root fails INVALID_CONFIG with the reason.

ArtifactStore gains optional putLink(link) for provider-hosted video links;
its ref lands beside the url. A passed retain-on-failure attempt's link is
never handed over, and a failing putLink never fails the run.

bench-ab and the mobile workflow move to --output.

* test(secrets): a hold's registry is probed by an unknown name, now that get() defers without one

* test(web): the download trigger's measured wait tolerates a timer firing early

* fix(secrets): rewrite the trace of an attempt whose engine holds a secret

A Playwright trace records the context options, basic-auth password in
plaintext, but a trace was rewritten only after a fill. resolveSecret now
marks the session so its trace goes through the redactor, screencast
frames kept since the value never reached the screen. The fake engine
writes a real trace archive, and the basic-auth fixture escapes its echo
and refuses a malformed header.

* fix(web): race the basic-auth secret with the attempt's signal

A provider still resolving after the launch timeout set the session after
the runner ended the attempt, so the retry failed with an attempt already
running. Resolution now runs first, raced with the signal.

* fix(mcp): a session notes a configured trace its engine cannot record

* test: a shadow-free fake trace archive and an ungarbled exclusion title

* docs: output paths, replay cache wording, and review corrections

--last-failed, --ai-trace, and the json reporter name <output> paths;
the skill says output never moves cache/ or the app's log; the
INVALID_GLOB row states the check the code makes; serial members list
only; the engine vocabulary names Secret and isSecret; the basic-auth
example uses a provider; the last trace cache wording is replay cache.

* chore(changeset): leave released notes alone; pending notes match the renames

Released CHANGELOG entries keep TraceCacheStore, the name they shipped
with; cache-store-rename.md announces the rename. The pending video and
provider recording changesets name on-all-retries and web({ screencast }).

* chore(bench): refuse a forwarded --output the harness would not clean up

* fix(secrets): a rewritten trace drops its screencast frames, engine-held secrets included
2026-09-29 19:51:02 +02:00
Oskar Kwaśniewski c1e9029fed fix(e2e): observation drops the selection of a field holding a secret (#581)
* fix(e2e): observation drops the selection of a field holding a secret

* test(e2e): selection check scans trace.zip entries for an 8-char fragment
2026-09-28 16:36:29 +02:00
Oskar Kwaśniewski 11a286d54f perf(agent): skip a second change wait after scrolling to text (#563)
The scrollUntil loop already reads a settled destination on engines without scrollIntoView. Arming another change wait against that destination adds 500 ms and repeated captures before the next action.

Keep the normal stability check and the change wait after an engine makes its final scrollIntoView adjustment. Cover live execution, zero-turn replay, an already-visible row, and a delayed final adjustment through the built runner.
2026-09-26 11:16:12 +02:00
Oskar Kwaśniewski ec503c2ea3 feat(agent): the observed node carries its selected text, and press repeats a key (#516) 2026-09-25 12:30:13 +02:00
Oskar Kwaśniewski 43d76ce760 feat(agent): scroll_to reaches a node by its text, paging a list until it shows (#514) 2026-09-25 11:48:41 +02:00
Oskar Kwaśniewski 7d93c085eb feat(agent): a tool for every engine action the target declares (#501)
Closes #486.

- The act grammar mapped 5 of the 16 engine actions. Every declared action is now a tool: `hover` (and `hover_at` at a point), `double_tap`, `long_press`, `right_click`, `check`, `drag`, `scroll_to`, `upload`, `back`. A verb the engine does not declare is not offered; `check` needs both `check` and `uncheck` because it sets a state rather than flipping one.
- One pattern end to end: the verb table in `packages/e2e/src/engine/session.ts`, `ExecutorActions`, the dispatcher, trace-1 record variants with replay (`relocatePair` re-finds both ends of a drag on one screen), the model tools built from one table per verb family, the `e2e mcp` catalog, docs, skill references.
- `upload` is policy-gated before the engine sees a path (`packages/e2e/src/agent/upload-paths.ts`): project-relative, resolved inside the project root through symlinks, no hidden segment such as `.env`, `.git`, `.e2e`. A refusal is `POLICY_DENIED` and an `upload.path` policy event on the step; a missing file is `INVALID_ARGUMENT`. A page can talk a model into naming any path; the harness decides.
- Web benchmark: drag-and-drop and kanban-board join the agentic suite with committed recordings; hover-menu is re-recorded as hover, hover, tap (the old recording was three taps, which passed because a click moves the pointer first). Testbed: `tests-agent/verbs.e2e.ts`, one live step per verb.
- Left out: tab switching (no engine contract yet) and mobile `home`/`openLink` (device fixture only, outside the engine SPI).

```mermaid
flowchart LR
  A[engine.actions] --> B[VERBS_BY_ACTION]
  B --> C[target.verbs]
  C --> D[createGrammarTools]
  D --> E[ActionDispatcher]
  E --> F[engine.perform]
  E --> G[trace-1 record]
  G --> H[zero-turn replay]
  H --> E
```

The vocabulary a web target offers, in the order the model sees it:

```
observe, tap, double_tap, long_press, right_click, hover, scroll_to, type, press,
select, check, drag, upload, scroll, navigate, back, screenshot, tap_at,
hover_at, type_at, press_at, select_at, type_secret, complete_step
```

The tap variants are separate tools, not a `kind` option on `tap` as #486 proposed. Offered as an optional enum, gpt-6-luna-fast filled it on ordinary controls and kept doing so after the description and system rule said not to; a double-click on a submit button submits twice. Live traces, same steps:

| Step | `tap {target, kind?}`, two rounds | separate tools |
| --- | --- | --- |
| Accept terms (sticky-chrome) | `kind: "double"` | `tap` |
| Rename menu item (context-menu-trap) | `kind: "long"` on every tap | `tap` |
| Archive card (testbed board) | `kind: "double"` | `tap` |
| report.pdf context menu (testbed controls) | `secondary`, then `long` | `right_click` once, 3 model calls instead of 4 |

Live on gpt-6-luna-fast: hover-menu, drag-and-drop, kanban-board, context-menu-trap, sticky-chrome pass; the testbed verbs suite passes 8 of 8. The three new recordings replay read-only in under a second each.
2026-09-24 21:17:27 +02:00
Oskar Kwaśniewski ed151e0420 fix(agent): a keyboard fallback is not blamed for an unlisted change, and an inconclusive judgment points at vision (#449) 2026-09-23 14:19:57 +02:00
Oskar Kwaśniewski 4305718f1b fix(types): targets is required, ModelInstance carries doGenerate, referenced types are exported (#434) 2026-09-23 11:16:33 +02:00
Oskar Kwaśniewski edbb84f6a1 docs: the migration tables, mobile README, and skill match what ships (#436) 2026-09-23 09:53:37 +02:00
Oskar Kwaśniewski e95135d512 chore(schema): retire the agent-tool schema nothing produces, and gate judgments on agent-judgment-2 (#454) 2026-09-23 08:34:46 +02:00
Oskar Kwaśniewski 45c08b123e feat(agent): say when an action closed the keyboard and verify the outcome before passing (#351)
* refactor(agent): one cause-chain walk and one editable-role check

Three hand-rolled loops walked an error's cause chain for a code; hasCause in internal/errors.ts does it once, bounded. secrets.ts and the agent shared the editable role set under two names; isEditable in observation.ts is the one definition.

* feat(agent): say when an action closed the keyboard and verify the outcome before passing

Traces from the mobile benchmark showed the model passing a step after a tap that only closed the keyboard. An action result now says when the keyboard left with it, so the model acts on the control again; the rules require the latest result to show the outcome before a passed verdict; scroll repeats up to 20 screens per call. The verb kit takes its screen options as one object with the change expected by default, and the presenter takes a keyboardNote flag instead of sniffing the lead.

* fix(agent): present keeps keyboardNote, and a plain look never claims an action closed the keyboard

ScreenPresenter.present rebuilt its options with lead and expectChange only, so the dismissal's keyboardNote never reached update and a successful dismiss_keyboard still told the model to act again. observe passes keyboardNote false: it acted on nothing, so a keyboard the app closed on its own is not blamed on a tap.
2026-09-18 17:27:57 +02:00
Oskar Kwaśniewski f09b69e90a docs: simplify onboarding and clarify model access (#346) 2026-09-18 11:52:06 +02:00
Oskar Kwaśniewski 7fcb925d76 feat(engine)!: the pointer side of the contract is a vocabulary, finished before it locks (#324) 2026-09-16 11:26:30 +02:00
Oskar Kwaśniewski 2e593dfb46 fix(agent): recover semantic timeouts with masked pixels (#317)
* fix(agent): recover semantic timeouts with masked pixels

Distinguish unavailable semantics from an empty tree so a proven fresh screenshot can remain useful without supporting an absence judgment. Reserve time for independent masking, reject stale references, and stop trace replay or recording after evidence degrades.

Respect judgment vision settings and attempt pixel taint. Keep device capture closed when accessibility bounds cannot prove masking. Report pre-model capture failures without inventing a revision or verdict.

* fix(agent): isolate fallback capture and evidence ownership

Reserve document node IDs before readers run and bound the entire semantic transaction, including metadata and handle readback. Quarantine late handles and publish each capture only while its page and generation remain current.

Carry semantic or pixel evidence through the internal session and agent paths. Preserve completed cache captures for one executor handoff, retire semantic presentation history on fallback, and keep public interfaces extendable.

* test(agent): align capture assertions with cache handoff

Count the reused cache observation once and wait for the fixture delayed control before asserting an unchanged screen after batched actions.

* docs(agent): clarify fallback without act vision modes

* test(agent): cover requested pixels after semantic fallback

* test(playwright): wait for recorded paint in lifecycle coverage

* test(playwright): flush a frame before checking video paint
2026-09-15 13:47:30 +02:00
Oskar Kwaśniewski 0a4b7f4fe9 feat(agent)!: drop vision from act, the model asks for pixels itself (#323) 2026-09-15 13:06:00 +02:00
Oskar Kwaśniewski 0b513d989e feat(agent): vision on act, a pixels-only vocabulary, and a keyboard engine capability (#314) 2026-09-15 11:01:16 +02:00
Oskar Kwaśniewski 1c9cc16697 feat(agent)!: agents.<name>.timeout is the judgment budget; actionTimeout bounds engine operations only (#303) 2026-09-14 16:31:30 +02:00
Oskar Kwaśniewski 5d1ae7a7f5 docs(reference): cut the slop from the Reference tab (#295) 2026-09-14 09:42:41 +02:00
Oskar Kwaśniewski c2c5df7df9 feat(e2e)!: the runner publishes as e2e; @e2edev/e2e is retired (#294) 2026-09-14 08:56:22 +02:00
Oskar Kwaśniewski aa3b05bbbd feat(agent): a judgment sees the screen and nothing else, can run on its own judge model, and answers inconclusive instead of guessing (#288) 2026-09-12 18:08:48 +02:00
Oskar Kwaśniewski f03006d47f feat(config)!: secrets declares API keys, tokens, any value the model never sees (#280) 2026-09-12 14:14:56 +02:00
Oskar Kwaśniewski ff33218345 docs: e2e is agentic testing first; quickstart for web and mobile; icons everywhere (#282) 2026-09-12 13:52:59 +02:00
Oskar Kwaśniewski c553b614de feat(agent)!: the act model sees the screen; screenshot and tap_at bring pixels into the act loop (#258) 2026-09-11 20:18:59 +02:00
Oskar Kwaśniewski fcf4fe6ff7 docs: split guides and references by platform (#266) 2026-09-11 17:32:13 +02:00
Oskar Kwaśniewski 658b9c22cc feat(agent): pin an agent per test, group, or call with the agent option (#249) 2026-09-10 14:05:00 +02:00
Oskar Kwaśniewski c72b05e57f feat(config)!: agents by name replace agent, and --agent picks one per run (#244) 2026-09-10 11:59:30 +02:00
Oskar Kwaśniewski b67e4d1aac docs: move the docs site from Starlight to Mintlify (#240) 2026-09-09 18:23:08 +02:00