agentpath 0.0.0-stage → 0.1.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/LICENSE.md +105 -0
  2. package/README.md +101 -2
  3. package/THIRD_PARTY_NOTICES +12 -0
  4. package/apps/demo-site/dist/site.js +92 -0
  5. package/apps/studio/dist/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
  6. package/apps/studio/dist/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
  7. package/apps/studio/dist/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
  8. package/apps/studio/dist/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
  9. package/apps/studio/dist/assets/geist-mono-cyrillic-ext-wght-normal-X_5orZeX.woff2 +0 -0
  10. package/apps/studio/dist/assets/geist-mono-cyrillic-wght-normal-DiZS0aHC.woff2 +0 -0
  11. package/apps/studio/dist/assets/geist-mono-latin-ext-wght-normal-Bwz-egvJ.woff2 +0 -0
  12. package/apps/studio/dist/assets/geist-mono-latin-wght-normal-XN7g48iV.woff2 +0 -0
  13. package/apps/studio/dist/assets/geist-mono-symbols2-wght-normal-CO5SzqOn.woff2 +0 -0
  14. package/apps/studio/dist/assets/geist-mono-vietnamese-wght-normal-DadHysG0.woff2 +0 -0
  15. package/apps/studio/dist/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
  16. package/apps/studio/dist/assets/index-DH4wJPHm.js +67 -0
  17. package/apps/studio/dist/assets/index-DrnNh2ip.css +1 -0
  18. package/apps/studio/dist/index.html +14 -0
  19. package/audit.md +173 -0
  20. package/autonomous-mode.md +104 -0
  21. package/ci.md +118 -0
  22. package/coding-agents.md +143 -0
  23. package/concepts.md +145 -0
  24. package/contracts.md +356 -0
  25. package/examples/tasks/ambiguous.json +98 -0
  26. package/examples/tasks/assertion-failure.json +98 -0
  27. package/examples/tasks/broken.json +98 -0
  28. package/examples/tasks/fixed.json +98 -0
  29. package/examples/tasks/recovery.json +19 -0
  30. package/images/compare-recovery-desktop.jpg +0 -0
  31. package/images/compare-variants-desktop.jpg +0 -0
  32. package/images/overview-desktop.jpg +0 -0
  33. package/images/run-autonomous-passed-desktop.jpg +0 -0
  34. package/images/run-failed-desktop.jpg +0 -0
  35. package/images/run-failed-mobile.jpg +0 -0
  36. package/images/run-missing-artifact-desktop.jpg +0 -0
  37. package/images/task-editor-laptop.jpg +0 -0
  38. package/installation.md +102 -0
  39. package/ledger.md +62 -0
  40. package/licenses/-fontsource-variable-geist-mono.txt +93 -0
  41. package/licenses/-fontsource-variable-geist.txt +93 -0
  42. package/licenses/lucide-react.txt +43 -0
  43. package/licenses/react-dom.txt +21 -0
  44. package/licenses/react.txt +21 -0
  45. package/licenses/scheduler.txt +21 -0
  46. package/licenses/tailwindcss.txt +21 -0
  47. package/licenses/zod.txt +21 -0
  48. package/package.json +165 -4
  49. package/packages/cli/bin/agentpath.js +39 -0
  50. package/packages/cli/dist/audit-rerun.js +384 -0
  51. package/packages/cli/dist/audit.js +387 -0
  52. package/packages/cli/dist/change-summaries.js +87 -0
  53. package/packages/cli/dist/ci-report.js +88 -0
  54. package/packages/cli/dist/demo.js +88 -0
  55. package/packages/cli/dist/doctor.js +265 -0
  56. package/packages/cli/dist/explain.js +89 -0
  57. package/packages/cli/dist/git.js +7 -0
  58. package/packages/cli/dist/inspect.js +118 -0
  59. package/packages/cli/dist/ledger.js +509 -0
  60. package/packages/cli/dist/local.js +102 -0
  61. package/packages/cli/dist/main.js +708 -0
  62. package/packages/cli/dist/mcp.js +231 -0
  63. package/packages/cli/dist/paths.js +6 -0
  64. package/packages/cli/dist/playwright-fixture.js +185 -0
  65. package/packages/cli/dist/playwright-reporter.js +49 -0
  66. package/packages/cli/dist/tasks.js +37 -0
  67. package/packages/cli/dist/test-source.js +283 -0
  68. package/packages/cli/dist/watch.js +96 -0
  69. package/packages/contracts/dist/agent-settings.js +18 -0
  70. package/packages/contracts/dist/agent.js +175 -0
  71. package/packages/contracts/dist/audit.js +115 -0
  72. package/packages/contracts/dist/guidance.js +339 -0
  73. package/packages/contracts/dist/index.js +14 -0
  74. package/packages/contracts/dist/inspect.js +63 -0
  75. package/packages/contracts/dist/ledger.js +80 -0
  76. package/packages/contracts/dist/local.js +171 -0
  77. package/packages/contracts/dist/outcomes.js +94 -0
  78. package/packages/contracts/dist/platform.js +105 -0
  79. package/packages/contracts/dist/playwright-live.js +76 -0
  80. package/packages/contracts/dist/policy.js +93 -0
  81. package/packages/contracts/dist/run.js +178 -0
  82. package/packages/contracts/dist/task-issues.js +39 -0
  83. package/packages/contracts/dist/task.js +185 -0
  84. package/packages/contracts/dist/watch.js +57 -0
  85. package/packages/core/dist/action-feedback.js +103 -0
  86. package/packages/core/dist/actions.js +160 -0
  87. package/packages/core/dist/agent-loop.js +122 -0
  88. package/packages/core/dist/artifacts.js +156 -0
  89. package/packages/core/dist/assertions.js +120 -0
  90. package/packages/core/dist/autonomous.js +1 -0
  91. package/packages/core/dist/browser.js +196 -0
  92. package/packages/core/dist/compare.js +141 -0
  93. package/packages/core/dist/control-state.js +62 -0
  94. package/packages/core/dist/diagnostics.js +134 -0
  95. package/packages/core/dist/evidence-diff.js +93 -0
  96. package/packages/core/dist/evidence.js +203 -0
  97. package/packages/core/dist/index.js +22 -0
  98. package/packages/core/dist/inspect.js +257 -0
  99. package/packages/core/dist/integrity.js +176 -0
  100. package/packages/core/dist/liveness.js +114 -0
  101. package/packages/core/dist/local-files.js +61 -0
  102. package/packages/core/dist/locators.js +214 -0
  103. package/packages/core/dist/model-provider.js +88 -0
  104. package/packages/core/dist/observation.js +257 -0
  105. package/packages/core/dist/playwright-live.js +519 -0
  106. package/packages/core/dist/playwright-results.js +543 -0
  107. package/packages/core/dist/policy.js +182 -0
  108. package/packages/core/dist/privacy.js +93 -0
  109. package/packages/core/dist/recovery.js +54 -0
  110. package/packages/core/dist/retention.js +204 -0
  111. package/packages/core/dist/run-index.js +177 -0
  112. package/packages/core/dist/run-plan.js +28 -0
  113. package/packages/core/dist/run-repository.js +518 -0
  114. package/packages/core/dist/runner.js +913 -0
  115. package/packages/core/dist/storage.js +63 -0
  116. package/packages/core/dist/task-fingerprint.js +36 -0
  117. package/packages/core/dist/test-change-rerun.js +84 -0
  118. package/packages/core/dist/test-changes.js +896 -0
  119. package/packages/core/dist/timing.js +41 -0
  120. package/packages/core/dist/watch.js +165 -0
  121. package/packages/server/dist/index.js +265 -0
  122. package/packages/server/dist/task-store.js +103 -0
  123. package/quickstart.md +85 -0
  124. package/security.md +136 -0
  125. package/try-on-your-repo.md +54 -0
  126. package/understanding-results.md +159 -0
  127. package/writing-tasks.md +196 -0
@@ -0,0 +1,143 @@
1
+ # Using AgentPath from a coding agent
2
+
3
+ AgentPath is built to be driven by coding agents (Claude Code, Cursor, Codex and others) as well as by people. An agent can discover a page's exact targets, write a task, run it, and get back a failure it can act on: the failed operation's JSON path in the task file, what the recorded evidence points to (the task or the site), and JSON Patch suggestions it can verify by running again.
4
+
5
+ There are two ways in: the `agentpath mcp` server and the CLI. Both run the same deterministic, model-free engine behind the same egress guard.
6
+
7
+ ## MCP server
8
+
9
+ `agentpath mcp` speaks the Model Context Protocol over stdio. The person who starts it decides the boundary:
10
+
11
+ ```sh
12
+ agentpath mcp --allow 127.0.0.1:3000 [--allow api.staging.example.test] [--runs-dir .agentpath/runs] [--capture-text]
13
+ ```
14
+
15
+ - `--allow` (required, repeatable) lists the only hosts a browser may reach. A task whose `allowedHosts` names any other host is rejected before a browser starts, and `agentpath_inspect` only opens URLs on these hosts. The agent cannot widen this list.
16
+ - `--runs-dir` is where runs are stored, as for `agentpath run`.
17
+ - `--capture-text` turns on text capture for every run (see [Security and privacy](security.md#failure-evidence)). Use it on test sites only.
18
+ - Tools that open a browser (`agentpath_inspect`, `agentpath_run`) run one at a time; further calls wait their turn. When the agent closes the connection, a run still in progress is cancelled and recorded as cancelled.
19
+
20
+ Register it with your agent. For Claude Code:
21
+
22
+ ```sh
23
+ claude mcp add agentpath -- agentpath mcp --allow 127.0.0.1:3000
24
+ ```
25
+
26
+ For clients that read a JSON configuration (Cursor's `.cursor/mcp.json`, Claude Desktop and others):
27
+
28
+ ```json
29
+ {
30
+ "mcpServers": {
31
+ "agentpath": { "command": "agentpath", "args": ["mcp", "--allow", "127.0.0.1:3000"] }
32
+ }
33
+ }
34
+ ```
35
+
36
+ In a source checkout, use `node /path/to/agentpath/packages/cli/bin/agentpath.js` as the command.
37
+
38
+ ### Tools
39
+
40
+ | Tool | What it does |
41
+ |---|---|
42
+ | `agentpath_inspect` `{ url, mobile? }` | Opens one page (as a phone when `mobile` is true) and lists the roles, accessible names and labels a task can target, each confirmed with the exact locator a step uses (`unique`, `ambiguous`, `not-matched`). Performs no actions. |
43
+ | `agentpath_validate` `{ task }` | Checks a task against the schema and the server's hosts without a browser. Problems come back as JSON paths, such as `/steps/0/target/name — Required`. |
44
+ | `agentpath_run` `{ task }` | Runs a deterministic task. Independent assertions decide the verdict. A failure returns the category, the failed operation's JSON path (`/steps/2`), a diagnosis and suggested JSON Patch operations. `structuredContent` carries the full result, browser observations and guidance. |
45
+ | `agentpath_report` `{ runId }` | Reads a stored run. |
46
+
47
+ Every result marks page-provided names and text as untrusted data.
48
+
49
+ ## The repair loop
50
+
51
+ 1. `agentpath_inspect` the page and write targets from what it lists. Names match exactly.
52
+ 2. `agentpath_validate`, then `agentpath_run`.
53
+ 3. On failure, read the `Diagnosis` before changing anything:
54
+ - **points to the task**: a similar target, option or a slower page explains the failure. Apply the suggested JSON Patch and run again. A suggestion is a hypothesis; the rerun is the proof.
55
+ - **points to the site**: a detached label, a network error, a server error (5xx) or a missing resource (404, 410) on an allowed host points to a defect in the site. Do not change the task to make it pass. Report the defect or fix the site.
56
+ - **fact**: recorded evidence without a direction, such as an alert on the page, a check that still failed after waiting, or a request refused with 401, 403, 407 or 429 (often missing test credentials or quota, not a broken site). Use it with the rest of the output.
57
+ - **similar targets not listed**: input had been typed earlier in the run, so names the task does not use were withheld. Without capture, `agentpath_inspect` the page (it types nothing, so names are not withheld) and compare; or, if the operator allows it on a test site, rerun with `--capture-text`. Do not report the site just because nothing was suggested. A target that is *not listed because its name contains a value the task types* stays unlisted even with capture; use `agentpath_inspect`.
58
+ 4. Never edit assertions to make a run pass. Assertions are the definition of done.
59
+
60
+ `step N` in human-readable output is 1-based. JSON paths are 0-based, and the first step is usually the `navigate` at `/steps/0`.
61
+
62
+ ## CLI
63
+
64
+ The same information is available without MCP:
65
+
66
+ ```sh
67
+ agentpath inspect http://127.0.0.1:3000/settings --allow 127.0.0.1:3000
68
+ agentpath run task.json # human-readable failure, diagnosis and JSON Patch
69
+ agentpath run task.json --json # adds `guidance` { taskPath, findings, suggestedChanges } and `failedRequests`
70
+ agentpath run task.json --capture-text # test sites only: record failed assertion and alert text
71
+ ```
72
+
73
+ Exit codes: 0 passed, 1 a task failed, 2 usage or configuration error. `agentpath run` takes several task files at once, and `--junit` and `--summary` write CI reports; see [Running AgentPath in CI](ci.md).
74
+
75
+ ## Existing Playwright tests
76
+
77
+ `agentpath explain` reads the output directory a Playwright run already wrote (`test-results` by default). It does not need task files and runs nothing:
78
+
79
+ ```sh
80
+ npx playwright test --trace retain-on-failure # traces are optional; they add failed requests
81
+ agentpath explain test-results # one explanation per failed test
82
+ agentpath explain test-results --json # { untrusted, results: [{ status, locator, guidance, suggestedLocators, ... }] }
83
+ ```
84
+
85
+ In `--json`, finding statements carry the same test wording as the text output, and `pointsTo: "task"` means the test.
86
+
87
+ - **Locators it handles.** Page-level `getByRole` with a string name, and `getByLabel`. Chained, scoped and regular-expression locators are reported as `unsupported-locator`, not guessed.
88
+ - **A field with no name.** When a `getByLabel` target is missing and Playwright's snapshot shows the requested text as plain text directly beside a form field that has no accessible name (before the field, or after a checkbox, radio or switch), the finding points to the site: the field lost its label. The snapshot cannot show whether the text is a `<label>` element, so the statement says only what it shows. No locator is suggested.
89
+ - **Suggestions.** Printed as Playwright locators with `exact: true`. Never applied.
90
+ - **Evidence boundary.** It reads Playwright's files only: there is no late re-check and no egress boundary, so a slow page shows only as a target present in the snapshot taken at the failure. Names and paths in the output are untrusted text from the page under test.
91
+ - **Coverage on a real suite.** On a large open-source end-to-end suite it read 42% of failures in a mechanical sample; the full measurement is in the repository's `docs/evaluations/` folder.
92
+
93
+ ### Inside every run: the reporter
94
+
95
+ So that an agent sees the explanation without knowing to run another command, add the reporter to the project's `playwright.config`. The tarball must be installed in the project (`npm install --save-dev --ignore-scripts ./agentpath-0.1.0-alpha.2.tgz`), because Playwright resolves reporters from the project:
96
+
97
+ ```js
98
+ // playwright.config.ts
99
+ reporter: [["list"], ["agentpath/playwright-reporter"]],
100
+ // or, to choose where the JSON goes:
101
+ reporter: [["list"], ["agentpath/playwright-reporter", { outputFile: "agentpath-explain.json" }]],
102
+ ```
103
+
104
+ When the run ends with failures, the reporter prints the same explanations as `agentpath explain` after Playwright's own output, and writes them as JSON (default `test-results/agentpath-explain.json`). It prints nothing when every test passes. It reads only the files the run wrote, so it changes no verdict, acts on no page and applies nothing. Without changing the config, `npx playwright test --reporter=list,agentpath/playwright-reporter` does the same for one run.
105
+
106
+ ### Inside every test: the fixture
107
+
108
+ The reporter and `explain` read only what Playwright wrote, so they refuse chained, CSS, placeholder and test-id locators, and they cannot tell a slow page from a missing control. The fixture reads the page itself while it is still open. Wrap the project's own `test` once, where the project defines it (or in each spec file that imports `test` from `@playwright/test`):
109
+
110
+ ```js
111
+ import { test as base } from "@playwright/test";
112
+ import { withAgentPath } from "agentpath/playwright-fixture";
113
+ export const test = withAgentPath(base);
114
+ ```
115
+
116
+ When a test fails, the fixture reads the test's page while it is still open. It finds the page in one of three ways:
117
+
118
+ - Playwright's own `page`, when that fixture is torn down after the test and its `afterEach` hooks.
119
+ - A page the test opened itself with `browser.newPage()` or `browser.newContext()`, as many suites do in `beforeEach`. The fixture reads it just before the test's own code closes the page or its context, once the test has failed (a failure in `beforeEach` included).
120
+ - A page the test opened itself and left open, for example one shared from `beforeAll`, when the test's fixtures are torn down.
121
+
122
+ On that page the fixture:
123
+
124
+ - **rebuilds the failed locator** from the form Playwright printed, step by step, and counts each step's matches, so a chain that stops at `locator('#settings')` says so. It reads only literals (strings, regular expressions, numbers, `true`/`false`) for `locator`, the `getBy…` methods, `first`, `last`, `nth`, `filter` with text or `visible`, and `contentFrame`. A nested locator (`filter({ has })`, `and`, `or`) is refused, not guessed.
125
+ - **searches near matches inside the scope that resolved**, never the whole page, so a control in a neighbouring section is not suggested. Suggestions keep the chain: `page.locator('#alpha').getByRole('button', { name: 'Star', exact: true })`. A `getByRole` with a string name and a `getByLabel` are compared with the scope's accessible names, as `explain` does. A `getByPlaceholder`, `getByTestId`, `getByTitle`, `getByAltText` or `getByText` with a string is compared with the same kind of value in the scope (for `getByText`, only short visible texts, and only inside a resolved scope: a page-wide `getByText` has too many candidates of any kind, so it gets facts only). The same guards apply: a value that differs by an identifier or a whole word, or looks like an untranslated message key, is stated as a fact and never suggested. A CSS step and a regular expression are counted but not compared.
126
+ - **repeats the failed lookup without acting** for up to 5 seconds. A target that turns up is reported as a slow page; one that never does is reported as such.
127
+ - **lists labels that label no control** and **records failed requests** on the test's own page hosts while it runs, so a detached label or a missing bundle points to the site with no trace recorded.
128
+
129
+ It writes `agentpath-live.json` next to Playwright's `error-context.md`; `agentpath explain` and the reporter read it as untrusted data. It does nothing for a test that passed or was expected to fail, never acts on the page, and never changes a result.
130
+
131
+ - **A test timeout hides the locator.** When a test dies on the test timeout (no `actionTimeout`), Playwright names the pending locator only after the page is closed. The fixture then records only the locator-free facts (failed requests, detached labels), and the late check is marked not run. Setting `actionTimeout` in `use` gives every failed action its locator while the page is open.
132
+ - **One page.** The error does not say which page a locator ran on. A test that opened a second page (a popup, `context.newPage()`) is reported as not compared, by the fixture and by `explain`.
133
+ - **When it reads.** Playwright's `page` is read after the test's `afterEach` hooks, so a hook that navigates or logs out changes what the fixture sees. A page the test opened itself is read inside the test's own close call, which spends the test's own time. Playwright gives `afterEach` hooks and teardown their own time, equal to the test's timeout, and a soft assertion can fail a test while its body still runs. The fixture cannot see which of these it is in, so it counts the time left from the earliest moment the current stretch could have begun, which never overstates it, and reads for at most 8 seconds of that, keeping 2 in reserve. It skips the reading when less than 1.5 seconds would be left.
134
+ - **No page.** A test that failed with no page read gets a record saying why: it closed the page before the failure was known, never opened one, or had too little of its timeout left for a reading. `explain` then reads Playwright's files alone.
135
+ - **How it finds the test's own pages.** It wraps `newContext` on the test's `browser`, and `close` on the contexts and pages opened through it, for the run of the worker. Those are public Playwright methods. It does not wrap locators or the test runner's internals.
136
+ - **No egress boundary.** The test's own browser is used as configured.
137
+ - **Measured on one unseen suite, then changed.** On a second open-source suite, every test opens its own pages with `browser.newPage()`, which the fixture did not read then, so it explained no more than `explain` alone (the measurement is in the repository's `docs/evaluations/` folder). Reading such pages came after that result, so that suite is a development set for it. The reporter is the recommended install; the fixture is optional.
138
+
139
+ ## What AgentPath will not do for an agent
140
+
141
+ - It never guesses between targets, and it never applies a suggestion itself. "Self-healing" that silently retargets a step can turn a real regression into a passing test; AgentPath reports instead.
142
+ - It never lets a task, a page or a calling agent widen the allowed hosts.
143
+ - Deterministic runs never call a model.
package/concepts.md ADDED
@@ -0,0 +1,145 @@
1
+ # Concepts
2
+
3
+ ## Task
4
+
5
+ A task is a saved JSON definition (schema version 1) that describes one browser scenario:
6
+
7
+ - **Name and ID.** The ID is fixed once saved, and every run is filed under it.
8
+ - **Goal.** A sentence describing the intended outcome. In autonomous mode the model reads it. In deterministic mode it documents the task.
9
+ - **Base URL and allowed hosts.** Where the browser starts, and the exact `host:port` values it may reach. Requests anywhere else are blocked.
10
+ - **Mode.** Either deterministic or autonomous.
11
+ - **Independent assertions.** The checks that decide whether the task worked.
12
+ - **Settings.** Browser limits, evidence capture, and an optional action policy.
13
+
14
+ Tasks live in `.agentpath/tasks/` in the workspace, or anywhere you keep JSON files for the CLI. [Writing tasks](writing-tasks.md) covers every field.
15
+
16
+ ## Modes
17
+
18
+ | | Deterministic | Autonomous (experimental) |
19
+ |---|---|---|
20
+ | Who chooses actions | You list each step | A model you configure, from scoped page observations |
21
+ | Model calls | None | One per decision, to the endpoint you configure |
22
+ | Repeatability | The same steps every time | Depends on the model |
23
+ | Verdict | Independent assertions | The same independent assertions |
24
+
25
+ The model never sees the assertions or the action policy. See [Autonomous mode](autonomous-mode.md).
26
+
27
+ ## Actions and semantic targets
28
+
29
+ Actions are `navigate`, `click`, `fill`, `select`, `press` and `wait`. They find elements the way assistive technology does:
30
+
31
+ - by **role and accessible name**, for example `button "Add to cart"`
32
+ - by **label**, for example the field labelled `Email`
33
+
34
+ There are no CSS selectors and no JavaScript. A target must match exactly one element. If it matches none, the step fails as *Target not found*. If it matches several, it fails as *Ambiguous target*. AgentPath never guesses between candidates.
35
+
36
+ So a control with no accessible name cannot be targeted by name. The demo's missing Quantity label shows this.
37
+
38
+ ## Independent assertions
39
+
40
+ Assertions run after the actions finish and inspect the final page:
41
+
42
+ | Assertion | Passes when |
43
+ |---|---|
44
+ | `url` | the current URL equals the pattern, where `*` matches any run of characters |
45
+ | `visible` | exactly one matching element is visible |
46
+ | `text` | exactly one matching element is visible and its text contains the given text (whitespace is normalized) |
47
+ | `count` | the number of matching elements equals a count |
48
+
49
+ They are *independent* because no action, and no agent, can mark them passed. A run passes only when every action completes **and** every assertion holds.
50
+
51
+ ## Run
52
+
53
+ A run is one execution of a task. It is a directory under `.agentpath/runs/<run-id>/` holding:
54
+
55
+ - the events, the result and the plan
56
+ - operation observations and the capture record
57
+ - screenshots and accessibility snapshots, as the task requested
58
+ - the integrity manifest
59
+
60
+ These directories are the source of truth. A SQLite index in `.agentpath/runs/.index/` only speeds up listings, and deleting it is always safe.
61
+
62
+ A run's status is one of `running`, `passed`, `failed`, `cancelled`, `stale`, `abandoned`, `incomplete` or `unreadable`:
63
+
64
+ - **Stale.** The owner's heartbeat expired, so liveness is uncertain. The process may still be running or suspended. It is not reported as a crash.
65
+ - **Abandoned.** The owner process is confirmed gone on this host, and no verdict was recorded.
66
+ - **Incomplete.** An older recording or an interrupted write left no terminal event.
67
+ - **Unreadable.** The stored record is malformed or uses a newer format. It is listed on its own, and it never hides the other runs.
68
+
69
+ ## Verdicts
70
+
71
+ Studio and the API report separate verdicts for every finalized run. They are never combined into one score.
72
+
73
+ | Verdict | Values | Decided by |
74
+ |---|---|---|
75
+ | **Goal** | passed, failed, incomplete, inconclusive | the independent assertions |
76
+ | **Action policy** | not evaluated, compliant, violation blocked, violation executed, inconclusive | the policy record against the configured rules |
77
+ | **Evidence integrity** | consistent, mismatch, legacy, inconclusive | the files against the digests sealed at finalization |
78
+ | **Agent claim** (autonomous) | declared yes or no, verified yes or no | recorded for reference only |
79
+
80
+ Some combinations are easy to misread:
81
+
82
+ - **Goal failed.** An independent assertion ran and did not pass.
83
+ - **Goal incomplete.** A step failed before the assertions ran, so the goal was never checked. The run status is still `failed`.
84
+ - **Goal inconclusive.** The run was cancelled, or the browser itself failed, so no goal verdict is implied.
85
+ - **Clean completion.** The goal passed, a policy was evaluated with no executed violation, and the evidence is consistent. A passing run with no policy is therefore not a clean completion. That is not a fault; there was simply no policy to evaluate.
86
+
87
+ ## Evidence and capture states
88
+
89
+ Every optional capture has a recorded state, so an empty slot always has a reason:
90
+
91
+ | State | Meaning |
92
+ |---|---|
93
+ | Captured | The file was written and is listed in the manifest. |
94
+ | Withheld for privacy | The privacy policy suppressed it. For example, screenshots stop after a fill or keypress. The operation still ran. |
95
+ | Not requested | The task's capture settings did not ask for it. |
96
+ | Not attempted | The operation did not run, or no page was available. |
97
+ | Capture failed or interrupted | The browser could not produce it, or the run was stopped. |
98
+ | Missing or invalid | A capture was recorded, but the file is now absent or differs from its digest. |
99
+
100
+ Absent evidence never means an action did not happen. Studio says which of these states applies.
101
+
102
+ ## Integrity
103
+
104
+ At finalization the runner records SHA-256 digests of the run's files in `integrity.json`. A later mismatch shows that files were deleted, truncated, edited or added since then.
105
+
106
+ This is **change detection relative to the recorded manifest**, not a signature. Anyone who can write the run directory can also rewrite the manifest. Integrity does not establish who produced a run or prove it authentic.
107
+
108
+ ## Comparison
109
+
110
+ Compare aligns two finalized runs operation by operation and reports:
111
+
112
+ - the first meaningful divergence
113
+ - the recorded evidence on both sides, with source links
114
+ - a verification interpretation:
115
+
116
+ | Interpretation | When |
117
+ |---|---|
118
+ | **Verified task recovery** | Same task ID, identical task and assertion fingerprints, a failed baseline, and a candidate that passed every action and assertion, with consistent records. This is the strict claim. |
119
+ | **Observed improvement** | The candidate passed after a failed baseline, but the definitions differ or their equivalence is unknown. Treat it as direction, not proof. |
120
+ | **Regression detected** | The unchanged task passed in the baseline and failed in the candidate. |
121
+ | **Verification unchanged** | Both runs reached the same verdict under the same contract. |
122
+ | **Different task definitions** | The same task ID has different definitions, so a strict comparison is not possible. |
123
+ | **Inconclusive comparison** | A run was cancelled or unfinalized, or required records are missing or changed. |
124
+
125
+ Only finalized runs can be compared. New runs record SHA-256 fingerprints of their effective task and independent assertions. So when two runs share a task ID but have different definitions, the comparison says so. Matching task IDs alone are not proof that definitions, destinations or execution environments are identical. Older runs without fingerprints show *Task definition equivalence not established*.
126
+
127
+ For a verified recovery, the comparison also checks that each run's records agree:
128
+
129
+ - the event log against the result
130
+ - the operation observations
131
+ - the metadata and plan counts
132
+ - the environment
133
+ - every referenced artifact against its digest
134
+
135
+ Operations are aligned by saved semantic identity when available, and by recorded order and operation type for older runs.
136
+
137
+ Comparisons show what changed on the page. They never claim which source change caused it.
138
+
139
+ ## Workspace and processes
140
+
141
+ A workspace is any directory. Studio and the CLI share it when started from the same place. Studio and its Fastify API share one origin on `127.0.0.1`. The API validates every request and response with the schemas in `packages/contracts`.
142
+
143
+ Each Studio server runs one browser run at a time and can cancel only the runs it started. A CLI run is cancelled from its own terminal. Runs started elsewhere, by the CLI or another Studio server, appear through their liveness lease.
144
+
145
+ The engine lives in `packages/core`, and Studio and the CLI both use it.