ready-ai 0.1.0__tar.gz
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.
- ready_ai-0.1.0/LICENSE +21 -0
- ready_ai-0.1.0/PKG-INFO +23 -0
- ready_ai-0.1.0/README.md +551 -0
- ready_ai-0.1.0/main.py +484 -0
- ready_ai-0.1.0/pyproject.toml +44 -0
- ready_ai-0.1.0/ready_ai.egg-info/PKG-INFO +23 -0
- ready_ai-0.1.0/ready_ai.egg-info/SOURCES.txt +70 -0
- ready_ai-0.1.0/ready_ai.egg-info/dependency_links.txt +1 -0
- ready_ai-0.1.0/ready_ai.egg-info/entry_points.txt +2 -0
- ready_ai-0.1.0/ready_ai.egg-info/requires.txt +19 -0
- ready_ai-0.1.0/ready_ai.egg-info/top_level.txt +2 -0
- ready_ai-0.1.0/setup.cfg +4 -0
- ready_ai-0.1.0/src/__init__.py +0 -0
- ready_ai-0.1.0/src/agent/__init__.py +3 -0
- ready_ai-0.1.0/src/agent/browser_session.py +367 -0
- ready_ai-0.1.0/src/agent/critic.py +86 -0
- ready_ai-0.1.0/src/agent/cursor.py +138 -0
- ready_ai-0.1.0/src/agent/dom_utils.py +71 -0
- ready_ai-0.1.0/src/agent/executor.py +440 -0
- ready_ai-0.1.0/src/agent/loop.py +592 -0
- ready_ai-0.1.0/src/agent/planner.py +84 -0
- ready_ai-0.1.0/src/agent/recovery.py +346 -0
- ready_ai-0.1.0/src/agent/state.py +79 -0
- ready_ai-0.1.0/src/agent/test_runner.py +579 -0
- ready_ai-0.1.0/src/api/__init__.py +0 -0
- ready_ai-0.1.0/src/api/batch_loader.py +100 -0
- ready_ai-0.1.0/src/api/manager.py +225 -0
- ready_ai-0.1.0/src/api/models.py +159 -0
- ready_ai-0.1.0/src/api/server.py +603 -0
- ready_ai-0.1.0/src/cdp/__init__.py +14 -0
- ready_ai-0.1.0/src/cdp/browser.py +146 -0
- ready_ai-0.1.0/src/cdp/connection.py +243 -0
- ready_ai-0.1.0/src/cdp/input.py +289 -0
- ready_ai-0.1.0/src/cdp/page.py +434 -0
- ready_ai-0.1.0/src/cdp/runtime.py +285 -0
- ready_ai-0.1.0/src/docs/__init__.py +4 -0
- ready_ai-0.1.0/src/docs/auto_healer.py +242 -0
- ready_ai-0.1.0/src/docs/export.py +443 -0
- ready_ai-0.1.0/src/docs/healing_publisher.py +442 -0
- ready_ai-0.1.0/src/docs/manifest.py +101 -0
- ready_ai-0.1.0/src/docs/output.py +97 -0
- ready_ai-0.1.0/src/docs/parser.py +178 -0
- ready_ai-0.1.0/src/docs/renderer.py +297 -0
- ready_ai-0.1.0/src/docs/report_html.py +225 -0
- ready_ai-0.1.0/src/docs/semantic_diff.py +71 -0
- ready_ai-0.1.0/src/docs/terminal_output.py +121 -0
- ready_ai-0.1.0/src/docs/text_diff.py +210 -0
- ready_ai-0.1.0/src/docs/visual_diff.py +140 -0
- ready_ai-0.1.0/src/history.py +128 -0
- ready_ai-0.1.0/src/llm/__init__.py +19 -0
- ready_ai-0.1.0/src/llm/client.py +283 -0
- ready_ai-0.1.0/src/llm/prompts.py +254 -0
- ready_ai-0.1.0/src/mcp_server.py +331 -0
- ready_ai-0.1.0/src/notify.py +131 -0
- ready_ai-0.1.0/src/observability.py +369 -0
- ready_ai-0.1.0/src/versioning.py +96 -0
- ready_ai-0.1.0/tests/test_agent_loop_spa_drift.py +304 -0
- ready_ai-0.1.0/tests/test_api.py +144 -0
- ready_ai-0.1.0/tests/test_api_batch.py +221 -0
- ready_ai-0.1.0/tests/test_api_phase3.py +92 -0
- ready_ai-0.1.0/tests/test_api_requests.py +32 -0
- ready_ai-0.1.0/tests/test_cdp_messages.py +377 -0
- ready_ai-0.1.0/tests/test_cli_run_config.py +175 -0
- ready_ai-0.1.0/tests/test_doc_export.py +151 -0
- ready_ai-0.1.0/tests/test_doc_parser.py +233 -0
- ready_ai-0.1.0/tests/test_e2e_doc_test.py +393 -0
- ready_ai-0.1.0/tests/test_healing_publisher.py +363 -0
- ready_ai-0.1.0/tests/test_llm_client_compat.py +19 -0
- ready_ai-0.1.0/tests/test_manifest.py +91 -0
- ready_ai-0.1.0/tests/test_mcp_server.py +128 -0
- ready_ai-0.1.0/tests/test_versioning.py +109 -0
- ready_ai-0.1.0/tests/test_visual_diff.py +140 -0
ready_ai-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 browser-auto contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
ready_ai-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ready-ai
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: ready-ai: agentic browser automation for SaaS documentation generation using CDP + LLM
|
|
5
|
+
Requires-Python: >=3.10
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Requires-Dist: websockets>=12.0
|
|
8
|
+
Requires-Dist: litellm>=1.40.0
|
|
9
|
+
Requires-Dist: aiohttp>=3.9.0
|
|
10
|
+
Requires-Dist: Pillow>=10.0.0
|
|
11
|
+
Requires-Dist: python-dotenv>=1.0.0
|
|
12
|
+
Requires-Dist: PyYAML>=6.0.0
|
|
13
|
+
Requires-Dist: tomli>=2.0.1; python_version < "3.11"
|
|
14
|
+
Provides-Extra: dev
|
|
15
|
+
Requires-Dist: fastapi<1.0,>=0.104; extra == "dev"
|
|
16
|
+
Requires-Dist: uvicorn<1.0,>=0.24; extra == "dev"
|
|
17
|
+
Requires-Dist: httpx<1.0,>=0.28; extra == "dev"
|
|
18
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
19
|
+
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
|
|
20
|
+
Requires-Dist: pytest-cov>=5.0; extra == "dev"
|
|
21
|
+
Requires-Dist: requests<3.0,>=2.31; extra == "dev"
|
|
22
|
+
Requires-Dist: ruff>=0.4; extra == "dev"
|
|
23
|
+
Dynamic: license-file
|
ready_ai-0.1.0/README.md
ADDED
|
@@ -0,0 +1,551 @@
|
|
|
1
|
+
# ready-ai
|
|
2
|
+
|
|
3
|
+
`ready-ai` is an open-source agentic browser automation tool that drives Chrome over raw CDP and generates step-by-step documentation with screenshots.
|
|
4
|
+
|
|
5
|
+
It plans a flow from the current DOM, executes the actions, critiques the result, and writes portable Markdown plus PNG screenshots to disk.
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<img src="assets/ready-ai-hero.png" alt="ready-ai hero image" width="100%" />
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
## What This Repo Is
|
|
12
|
+
|
|
13
|
+
- A local CLI for documentation runs
|
|
14
|
+
- A raw Chrome DevTools Protocol engine
|
|
15
|
+
- A planner -> executor -> critic loop
|
|
16
|
+
- Markdown and screenshot generation
|
|
17
|
+
- A documentation test runner with visual diff and self-healing
|
|
18
|
+
- A FastAPI service with batch processing and deploy webhooks
|
|
19
|
+
- Versioned documentation tied to your app releases
|
|
20
|
+
|
|
21
|
+
## What This Repo Is Not
|
|
22
|
+
|
|
23
|
+
- A hosted product (yet)
|
|
24
|
+
- A team dashboard (yet)
|
|
25
|
+
- Commercial support or SLAs
|
|
26
|
+
|
|
27
|
+
## Documentation
|
|
28
|
+
|
|
29
|
+
- [API Reference](docs/API.md) — complete REST API documentation
|
|
30
|
+
- [Batch Runner](docs/BATCH.md) — YAML/TOML batch configuration
|
|
31
|
+
- [Webhook Integration](docs/WEBHOOK.md) — CI/CD deploy webhooks
|
|
32
|
+
- [CI/CD Guide](docs/CI-CD.md) — GitHub Actions, Docker, regression tests
|
|
33
|
+
- [Versioning](docs/VERSIONING.md) — how docs are versioned with releases
|
|
34
|
+
- [Notifications](docs/NOTIFICATIONS.md) — webhook events and alerting
|
|
35
|
+
|
|
36
|
+
## Quickstart
|
|
37
|
+
|
|
38
|
+
### 1. Prerequisites
|
|
39
|
+
|
|
40
|
+
- Python `>=3.10`
|
|
41
|
+
- Google Chrome, Chromium, or Brave installed locally
|
|
42
|
+
- At least one model provider API key
|
|
43
|
+
|
|
44
|
+
If Chrome is installed in a non-default location, set:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
export CHROME_PATH="/path/to/your/chrome"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 2. Install
|
|
51
|
+
|
|
52
|
+
Canonical local install:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pip install -e ".[dev]"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
If you need a `requirements.txt` entry point for local tooling, it resolves to the same dependency set:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pip install -r requirements.txt
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 3. Set an API key
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
export OPENAI_API_KEY="your-key-here"
|
|
68
|
+
# or:
|
|
69
|
+
# export ANTHROPIC_API_KEY="your-key-here"
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### 4. Run a first job
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
ready-ai run \
|
|
76
|
+
--goal "Document the login flow" \
|
|
77
|
+
--url "https://app.example.com" \
|
|
78
|
+
--title "Login Guide" \
|
|
79
|
+
--language en \
|
|
80
|
+
--model "gpt-4o-mini" \
|
|
81
|
+
--output "./output/login-guide"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Generated files:
|
|
85
|
+
|
|
86
|
+
- `output/<run>/docs.md`
|
|
87
|
+
- `output/<run>/screenshots/`
|
|
88
|
+
- `output/<run>/summary.txt`
|
|
89
|
+
|
|
90
|
+
### 5. Test your documentation against the live UI
|
|
91
|
+
|
|
92
|
+
Once you have generated documentation, you can verify it still matches the live application:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
ready-ai test \
|
|
96
|
+
--doc "./output/login-guide/docs.md" \
|
|
97
|
+
--url "https://app.example.com" \
|
|
98
|
+
--threshold 0.85 \
|
|
99
|
+
--output "./test-report"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
This re-executes every documented step, takes new screenshots, and compares them with the baselines. The output includes a JSON report, a plain-text summary, and a standalone HTML report.
|
|
103
|
+
|
|
104
|
+
## Running The Project Correctly
|
|
105
|
+
|
|
106
|
+
The most reliable local setup is:
|
|
107
|
+
|
|
108
|
+
1. Install with `pip install -e ".[dev]"`
|
|
109
|
+
2. Export a provider API key
|
|
110
|
+
3. Let the tool launch its own Chrome instance
|
|
111
|
+
4. Start with a narrow goal and a single authenticated flow
|
|
112
|
+
5. Use `--verbose` on early runs
|
|
113
|
+
|
|
114
|
+
Recommended first targets:
|
|
115
|
+
|
|
116
|
+
- login
|
|
117
|
+
- onboarding
|
|
118
|
+
- account settings
|
|
119
|
+
- dashboard navigation
|
|
120
|
+
- simple CRUD flows
|
|
121
|
+
|
|
122
|
+
Avoid for first runs:
|
|
123
|
+
|
|
124
|
+
- mandatory SSO or OAuth-only login
|
|
125
|
+
- MFA / TOTP
|
|
126
|
+
- heavy multi-tab flows
|
|
127
|
+
- cross-origin iframe-heavy apps
|
|
128
|
+
|
|
129
|
+
## Authentication
|
|
130
|
+
|
|
131
|
+
Two auth modes are supported.
|
|
132
|
+
|
|
133
|
+
### Option 1: Session cookies
|
|
134
|
+
|
|
135
|
+
This is usually the best option for authenticated SaaS apps.
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
ready-ai run \
|
|
139
|
+
--goal "Document account settings" \
|
|
140
|
+
--url "https://app.example.com/settings" \
|
|
141
|
+
--cookies-file "./cookies.json"
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Expected `cookies.json` format:
|
|
145
|
+
|
|
146
|
+
```json
|
|
147
|
+
[
|
|
148
|
+
{
|
|
149
|
+
"name": "session_cookie",
|
|
150
|
+
"value": "abc123",
|
|
151
|
+
"domain": ".app.example.com",
|
|
152
|
+
"path": "/",
|
|
153
|
+
"secure": true,
|
|
154
|
+
"httpOnly": true
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Notes:
|
|
160
|
+
|
|
161
|
+
- The file must be a JSON array, not a key/value object.
|
|
162
|
+
- Keep cookie files out of Git.
|
|
163
|
+
- `tmp/` is gitignored in this repository.
|
|
164
|
+
|
|
165
|
+
### Option 2: Username/password
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
ready-ai run \
|
|
169
|
+
--goal "Document the billing page" \
|
|
170
|
+
--url "https://app.example.com/login" \
|
|
171
|
+
--username "user@example.com" \
|
|
172
|
+
--password "super-secret-password"
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
This works best with straightforward email/password forms.
|
|
176
|
+
|
|
177
|
+
## CLI
|
|
178
|
+
|
|
179
|
+
### `run` command
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
ready-ai run --help
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
Useful flags:
|
|
186
|
+
|
|
187
|
+
| Flag | Short | Default | Purpose |
|
|
188
|
+
|------|-------|---------|---------|
|
|
189
|
+
| `--goal` | `-g` | required | Documentation goal |
|
|
190
|
+
| `--url` | `-u` | required | Starting URL |
|
|
191
|
+
| `--title` | `-t` | goal | Optional H1 title |
|
|
192
|
+
| `--language` | `-l` | English renderer labels | Output language |
|
|
193
|
+
| `--model` | `-m` | `gpt-4o-mini` | Main planner/critic model |
|
|
194
|
+
| `--annotation-model` | | same as `--model` | Separate screenshot annotation model |
|
|
195
|
+
| `--output` | `-o` | `./output` | Output directory |
|
|
196
|
+
| `--port` | `-p` | `9222` | Chrome debugging port |
|
|
197
|
+
| `--headless` | | `false` | Run Chrome headless |
|
|
198
|
+
| `--max-critic-rounds` | | `2` | Max re-execution loops |
|
|
199
|
+
| `--cookies-file` | | `None` | Cookie JSON file |
|
|
200
|
+
| `--username` | | `None` | Login username/email |
|
|
201
|
+
| `--password` | | `None` | Login password |
|
|
202
|
+
| `--config` | | `None` | Load run settings from a flat YAML/TOML file |
|
|
203
|
+
| `--run-id` | | `local_run` | Checkpoint identity inside the output directory |
|
|
204
|
+
| `--resume` | | `false` | Resume from an existing checkpoint |
|
|
205
|
+
| `--plan-only` | | `false` | Open the page, build the plan, save checkpoint, skip execution |
|
|
206
|
+
| `--verbose` | `-v` | `false` | Debug logging |
|
|
207
|
+
|
|
208
|
+
### `test` command
|
|
209
|
+
|
|
210
|
+
The `test` subcommand re-executes every step in a previously generated `docs.md` against the live UI, compares screenshots with baselines, and generates a test report.
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
ready-ai test --help
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
| Flag | Short | Default | Purpose |
|
|
217
|
+
|------|-------|---------|---------|
|
|
218
|
+
| `--doc` | `-d` | required | Path to the `docs.md` file to test |
|
|
219
|
+
| `--url` | `-u` | required | Target URL to test against |
|
|
220
|
+
| `--model` | `-m` | `gpt-4o-mini` | LLM model for vision and healing |
|
|
221
|
+
| `--threshold` | | `0.85` | Visual similarity threshold (0.0-1.0) |
|
|
222
|
+
| `--output` | `-o` | `./test-report` | Test report output directory |
|
|
223
|
+
| `--port` | `-p` | `9222` | Chrome debugging port |
|
|
224
|
+
| `--headless` | | `false` | Run Chrome headless |
|
|
225
|
+
| `--cookies-file` | | `None` | Cookie JSON file for authentication |
|
|
226
|
+
| `--username` | | `None` | Login username/email |
|
|
227
|
+
| `--password` | | `None` | Login password |
|
|
228
|
+
| `--watch` | | `false` | Re-run tests periodically until interrupted |
|
|
229
|
+
| `--watch-interval` | | `5` | Minutes between watch runs |
|
|
230
|
+
| `--auto-heal` | | `false` | Auto-update docs when drift is detected |
|
|
231
|
+
| `--verbose` | `-v` | `false` | Debug logging |
|
|
232
|
+
|
|
233
|
+
Exit codes:
|
|
234
|
+
|
|
235
|
+
- `0` — all steps passed
|
|
236
|
+
- `1` — one or more steps are broken (execution failed)
|
|
237
|
+
- `2` — UI drift detected (visual similarity below threshold)
|
|
238
|
+
|
|
239
|
+
### `batch` command
|
|
240
|
+
|
|
241
|
+
Run multiple documentation flows from a single YAML or TOML configuration file.
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
ready-ai batch --help
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
| Flag | Short | Default | Purpose |
|
|
248
|
+
|------|-------|---------|---------|
|
|
249
|
+
| `--config` | `-c` | required | Path to YAML/TOML batch config |
|
|
250
|
+
| `--verbose` | `-v` | `false` | Debug logging |
|
|
251
|
+
|
|
252
|
+
Example:
|
|
253
|
+
|
|
254
|
+
```bash
|
|
255
|
+
ready-ai batch --config example-batch.yaml
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Example `example-batch.yaml`:
|
|
259
|
+
|
|
260
|
+
```yaml
|
|
261
|
+
app_version: "2.3.1"
|
|
262
|
+
git_commit: "abc1234"
|
|
263
|
+
base_url: "https://app.example.com"
|
|
264
|
+
|
|
265
|
+
flows:
|
|
266
|
+
- goal: "Document login"
|
|
267
|
+
path: "/login"
|
|
268
|
+
run_id: "v2.3.1-login"
|
|
269
|
+
- goal: "Document onboarding"
|
|
270
|
+
path: "/welcome"
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
The batch command starts all flows concurrently (up to browser port pool limits),
|
|
274
|
+
polls progress every 5 seconds, and reports completion.
|
|
275
|
+
|
|
276
|
+
### More examples
|
|
277
|
+
|
|
278
|
+
Portuguese output:
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
ready-ai run \
|
|
282
|
+
--goal "Documentar o fluxo de onboarding" \
|
|
283
|
+
--url "https://app.example.com" \
|
|
284
|
+
--language pt \
|
|
285
|
+
--output "./output/onboarding-pt"
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
Cheaper model for screenshot annotations:
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
ready-ai run \
|
|
292
|
+
--goal "Document the dashboard" \
|
|
293
|
+
--url "https://app.example.com" \
|
|
294
|
+
--model "claude-sonnet-4-20250514" \
|
|
295
|
+
--annotation-model "gpt-4o-mini"
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
Reusable config file:
|
|
299
|
+
|
|
300
|
+
```yaml
|
|
301
|
+
goal: Document the login flow
|
|
302
|
+
url: https://app.example.com/login
|
|
303
|
+
output: ./output/login-flow
|
|
304
|
+
run_id: login-flow
|
|
305
|
+
plan_only: true
|
|
306
|
+
headless: true
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
```bash
|
|
310
|
+
ready-ai run --config ./ready-ai.yaml
|
|
311
|
+
ready-ai run --config ./ready-ai.yaml --resume
|
|
312
|
+
```
|
|
313
|
+
|
|
314
|
+
Basic documentation test:
|
|
315
|
+
|
|
316
|
+
```bash
|
|
317
|
+
ready-ai test \
|
|
318
|
+
--doc "./output/login-guide/docs.md" \
|
|
319
|
+
--url "https://app.example.com" \
|
|
320
|
+
--headless
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
Watch mode (re-test every 10 minutes, alert on drift):
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
ready-ai test \
|
|
327
|
+
--doc "./output/login-guide/docs.md" \
|
|
328
|
+
--url "https://app.example.com" \
|
|
329
|
+
--watch \
|
|
330
|
+
--watch-interval 10 \
|
|
331
|
+
--headless
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
Auto-heal mode (update screenshots and annotations automatically):
|
|
335
|
+
|
|
336
|
+
```bash
|
|
337
|
+
ready-ai test \
|
|
338
|
+
--doc "./output/login-guide/docs.md" \
|
|
339
|
+
--url "https://app.example.com" \
|
|
340
|
+
--auto-heal \
|
|
341
|
+
--headless
|
|
342
|
+
```
|
|
343
|
+
|
|
344
|
+
## Self-Healing Documentation
|
|
345
|
+
|
|
346
|
+
The `test` command powers a self-healing documentation pipeline. Instead of documentation going stale when the UI changes, ready-ai detects drift and can automatically fix it.
|
|
347
|
+
|
|
348
|
+
### How it works
|
|
349
|
+
|
|
350
|
+
1. **Parse** -- The doc parser (`src/docs/parser.py`) extracts executable steps, screenshots, and action descriptions from a generated `docs.md`. Supports multilingual step headers (English, Portuguese, Spanish, French, German, Italian).
|
|
351
|
+
|
|
352
|
+
2. **Re-execute** -- Each step is replayed against the live UI using the same CDP executor that generated the original documentation.
|
|
353
|
+
|
|
354
|
+
3. **Visual diff** -- New screenshots are compared pixel-by-pixel against the baselines. A similarity score (0.0--1.0) determines whether the step is PASSED, DRIFT, or BROKEN. A side-by-side diff image is generated highlighting changed regions in red.
|
|
355
|
+
|
|
356
|
+
4. **Semantic diff** -- When drift is detected, an LLM vision call compares the baseline and current screenshots side-by-side and produces a human-readable description of what changed (e.g., "The Save button moved from the top-right to a sticky footer bar").
|
|
357
|
+
|
|
358
|
+
5. **Selector recovery** -- If a step fails because its CSS selector no longer matches any element, the LLM inspects the current interactive elements on the page and finds an equivalent selector automatically.
|
|
359
|
+
|
|
360
|
+
6. **Auto-heal** -- With `--auto-heal`, drifted steps are repaired in place:
|
|
361
|
+
- The baseline screenshot is replaced with the current one
|
|
362
|
+
- The annotation text is regenerated via LLM vision
|
|
363
|
+
- The `docs.md` file is rewritten with the updated content
|
|
364
|
+
|
|
365
|
+
### Watch mode
|
|
366
|
+
|
|
367
|
+
Use `--watch` to run tests on a recurring interval. The runner alerts when a previously passing step starts drifting, making it suitable for CI or monitoring dashboards:
|
|
368
|
+
|
|
369
|
+
```bash
|
|
370
|
+
ready-ai test --doc ./output/docs.md --url https://app.example.com --watch --watch-interval 5
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
Press `Ctrl+C` to stop. Status transitions (e.g., PASSED to DRIFT_DETECTED) trigger a terminal bell alert.
|
|
374
|
+
|
|
375
|
+
### Report outputs
|
|
376
|
+
|
|
377
|
+
Every test run produces three report files in the output directory:
|
|
378
|
+
|
|
379
|
+
| File | Description |
|
|
380
|
+
|------|-------------|
|
|
381
|
+
| `test_report.json` | Machine-readable full report with per-step results |
|
|
382
|
+
| `test_summary.txt` | Plain-text summary (pass/drift/broken counts) |
|
|
383
|
+
| `test_report.html` | Standalone HTML report with inline CSS, base64-embedded screenshots and diff images, expandable step cards, and a summary table |
|
|
384
|
+
|
|
385
|
+
The HTML report can be opened in any browser with no external dependencies.
|
|
386
|
+
|
|
387
|
+
## API
|
|
388
|
+
|
|
389
|
+
Start the API:
|
|
390
|
+
|
|
391
|
+
```bash
|
|
392
|
+
ready-ai api --port 8000 --host 127.0.0.1
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
Flags:
|
|
396
|
+
|
|
397
|
+
| Flag | Short | Default | Purpose |
|
|
398
|
+
|------|-------|---------|---------|
|
|
399
|
+
| `--port` | `-p` | `8000` | API server port |
|
|
400
|
+
| `--host` | | `0.0.0.0` | API server host/interface to bind |
|
|
401
|
+
| `--verbose` | `-v` | `false` | Debug logging |
|
|
402
|
+
|
|
403
|
+
Main endpoints:
|
|
404
|
+
|
|
405
|
+
- `POST /runs` — start a single documentation run
|
|
406
|
+
- `GET /runs/{run_id}` — poll run status
|
|
407
|
+
- `GET /runs/{run_id}/output` — download output as ZIP
|
|
408
|
+
- `POST /webhooks/deploy` — deploy webhook: receive a deploy event and auto-document all configured flows
|
|
409
|
+
- `POST /batches` — start a batch from a YAML/TOML config
|
|
410
|
+
- `GET /batches/{batch_id}` — poll batch status with per-flow breakdown
|
|
411
|
+
|
|
412
|
+
Example flow:
|
|
413
|
+
|
|
414
|
+
```bash
|
|
415
|
+
curl -X POST http://localhost:8000/runs \
|
|
416
|
+
-H "Content-Type: application/json" \
|
|
417
|
+
-d '{"goal":"Document login","url":"https://app.example.com"}'
|
|
418
|
+
|
|
419
|
+
curl http://localhost:8000/runs/<run_id>
|
|
420
|
+
curl -OJ http://localhost:8000/runs/<run_id>/output
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
Deploy webhook (for CI/CD integration):
|
|
424
|
+
|
|
425
|
+
```bash
|
|
426
|
+
curl -X POST http://localhost:8000/webhooks/deploy \
|
|
427
|
+
-H "Content-Type: application/json" \
|
|
428
|
+
-d '{
|
|
429
|
+
"app_version": "2.3.1",
|
|
430
|
+
"git_commit": "abc1234",
|
|
431
|
+
"deployed_at": "2026-05-09T14:00:00Z",
|
|
432
|
+
"base_url": "https://app.example.com",
|
|
433
|
+
"flows": [
|
|
434
|
+
{"goal": "Document login", "path": "/login", "run_id": "login"},
|
|
435
|
+
{"goal": "Document onboarding", "path": "/welcome"}
|
|
436
|
+
]
|
|
437
|
+
}'
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
Batch runner (from YAML config):
|
|
441
|
+
|
|
442
|
+
```bash
|
|
443
|
+
ready-ai batch --config flows.yaml
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
Example `flows.yaml`:
|
|
447
|
+
|
|
448
|
+
```yaml
|
|
449
|
+
app_version: "2.3.1"
|
|
450
|
+
git_commit: "abc1234"
|
|
451
|
+
base_url: "https://app.example.com"
|
|
452
|
+
model: "gpt-4o-mini"
|
|
453
|
+
|
|
454
|
+
flows:
|
|
455
|
+
- goal: "Document login"
|
|
456
|
+
path: "/login"
|
|
457
|
+
run_id: "v2.3.1-login"
|
|
458
|
+
- goal: "Document onboarding"
|
|
459
|
+
path: "/welcome"
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
Current API capabilities:
|
|
463
|
+
|
|
464
|
+
- start a background run
|
|
465
|
+
- poll run status
|
|
466
|
+
- resume from an existing checkpoint when the same `run_id` is reused
|
|
467
|
+
- download output as a ZIP archive
|
|
468
|
+
- receive deploy webhooks and kick off multi-flow documentation
|
|
469
|
+
- run batch jobs from YAML/TOML configuration files
|
|
470
|
+
|
|
471
|
+
## How It Works
|
|
472
|
+
|
|
473
|
+
```text
|
|
474
|
+
goal + DOM -> planner -> step list
|
|
475
|
+
step list -> executor -> screenshots + annotations
|
|
476
|
+
docs -> critic -> score + missing steps -> re-execution
|
|
477
|
+
docs.md -> test -> re-execute + visual diff -> report / auto-heal
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
Core modules:
|
|
481
|
+
|
|
482
|
+
- `src/agent/` orchestrates planning, execution, criticism, checkpoints, and the doc test runner
|
|
483
|
+
- `src/cdp/` contains the raw CDP browser engine
|
|
484
|
+
- `src/docs/` renders Markdown, parses docs, generates HTML reports, runs visual and semantic diffs, and auto-heals documentation
|
|
485
|
+
- `src/api/` exposes background runs over FastAPI
|
|
486
|
+
- `src/llm/` wraps LiteLLM model calls (text, single-image vision, and multi-image vision)
|
|
487
|
+
|
|
488
|
+
### Key modules added in recent releases
|
|
489
|
+
|
|
490
|
+
| Module | Purpose |
|
|
491
|
+
|--------|---------|
|
|
492
|
+
| `src/agent/test_runner.py` | `DocTestRunner` — re-executes documented steps and produces a `DocTestReport` |
|
|
493
|
+
| `src/docs/parser.py` | Extracts executable steps from `docs.md` (multilingual support) |
|
|
494
|
+
| `src/docs/visual_diff.py` | Pixel-level screenshot comparison with diff image generation |
|
|
495
|
+
| `src/docs/semantic_diff.py` | LLM-powered natural-language description of visual changes |
|
|
496
|
+
| `src/docs/auto_healer.py` | Auto-updates screenshots, annotations, and selectors when drift is detected |
|
|
497
|
+
| `src/docs/report_html.py` | Generates standalone HTML test reports with inline images |
|
|
498
|
+
| `src/docs/terminal_output.py` | Colored terminal progress bar and summary table (respects `NO_COLOR`) |
|
|
499
|
+
|
|
500
|
+
## Current Limitations
|
|
501
|
+
|
|
502
|
+
High-priority gaps today:
|
|
503
|
+
|
|
504
|
+
- OAuth / SSO coverage
|
|
505
|
+
- MFA / TOTP coverage
|
|
506
|
+
- multi-tab flows
|
|
507
|
+
- cross-origin iframe coverage
|
|
508
|
+
|
|
509
|
+
This repository is usable today, but the product surface is still CLI-first and early.
|
|
510
|
+
|
|
511
|
+
## Development
|
|
512
|
+
|
|
513
|
+
Run tests:
|
|
514
|
+
|
|
515
|
+
```bash
|
|
516
|
+
python3 -m pytest -q
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
Run tests with coverage:
|
|
520
|
+
|
|
521
|
+
```bash
|
|
522
|
+
python3 -m pytest -q --cov=src --cov-report=term-missing
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
Lint:
|
|
526
|
+
|
|
527
|
+
```bash
|
|
528
|
+
ruff check src/ tests/ main.py
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
### CI
|
|
532
|
+
|
|
533
|
+
The GitHub Actions pipeline (`.github/workflows/tests.yml`) runs on every push and pull request:
|
|
534
|
+
|
|
535
|
+
- **Lint job** -- `ruff check` against `src/`, `tests/`, and `main.py`
|
|
536
|
+
- **Test job** -- `pytest` with coverage across Python 3.10, 3.11, and 3.12. Coverage reports are uploaded as artifacts for the 3.12 run.
|
|
537
|
+
|
|
538
|
+
See:
|
|
539
|
+
|
|
540
|
+
- [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
541
|
+
- [SECURITY.md](SECURITY.md)
|
|
542
|
+
|
|
543
|
+
## Safety Notes
|
|
544
|
+
|
|
545
|
+
Before pushing or publishing:
|
|
546
|
+
|
|
547
|
+
- do not commit `.env`
|
|
548
|
+
- do not commit cookies
|
|
549
|
+
- do not commit generated output
|
|
550
|
+
- rotate any real credentials used during development
|
|
551
|
+
- review tracked files before pushing
|