opencroc 1.8.3 → 1.8.4
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.
- package/README.md +383 -417
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,417 +1,383 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<img src="assets/banner.png" alt="OpenCroc banner" width="820" />
|
|
3
|
-
</p>
|
|
4
|
-
|
|
5
|
-
<h1 align="center">OpenCroc</h1>
|
|
6
|
-
|
|
7
|
-
<p align="center">
|
|
8
|
-
<strong>AI-native E2E testing framework that reads
|
|
9
|
-
</p>
|
|
10
|
-
|
|
11
|
-
<p align="center">
|
|
12
|
-
<a href="https://www.npmjs.com/package/opencroc"><img src="https://img.shields.io/npm/v/opencroc?color=green" alt="npm version" /></a>
|
|
13
|
-
<a href="https://github.com/opencroc/opencroc/actions/workflows/ci.yml"><img src="https://github.com/opencroc/opencroc/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI" /></a>
|
|
14
|
-
<a href="https://github.com/opencroc/opencroc/blob/main/LICENSE"><img src="https://img.shields.io/github/license/opencroc/opencroc" alt="MIT License" /></a>
|
|
15
|
-
<a href="https://opencroc.com"><img src="https://img.shields.io/badge/docs-opencroc.com-blue" alt="Documentation" /></a>
|
|
16
|
-
</p>
|
|
17
|
-
|
|
18
|
-
<p align="center">
|
|
19
|
-
<a href="README.md">English</a> | <a href="README.zh-CN.md"
|
|
20
|
-
</p>
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## What is OpenCroc?
|
|
25
|
-
|
|
26
|
-
OpenCroc is an
|
|
27
|
-
|
|
28
|
-
When tests fail, OpenCroc
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
| Capability | Description |
|
|
33
|
-
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
38
|
-
|
|
|
39
|
-
|
|
|
40
|
-
|
|
|
41
|
-
|
|
42
|
-
## Quick Start
|
|
43
|
-
|
|
44
|
-
### Prerequisites
|
|
45
|
-
|
|
46
|
-
- Node.js
|
|
47
|
-
- A backend project
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
-
|
|
128
|
-
-
|
|
129
|
-
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
npx opencroc
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
-
|
|
347
|
-
-
|
|
348
|
-
-
|
|
349
|
-
-
|
|
350
|
-
-
|
|
351
|
-
-
|
|
352
|
-
-
|
|
353
|
-
-
|
|
354
|
-
-
|
|
355
|
-
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
- [
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
-
|
|
375
|
-
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
- `0.6.x`: visual dashboard + Windows Vitest stability hardening
|
|
385
|
-
- `0.7.x – 0.9.x`: runtime infrastructure (Playwright generators, auth, log-driven detection, rules engine)
|
|
386
|
-
- `1.0.0`: full orchestration pipeline
|
|
387
|
-
- `1.1.0`: advanced self-healing (dialog loop, controlled fixer, auto-fix PR generation)
|
|
388
|
-
- `1.2.0`: advanced reporters (checklist, workorder, token tracking) + Sprint 0-3 migration complete
|
|
389
|
-
- `1.3.0`: OpenCroc Studio M1 — Fastify server, knowledge graph API, pixel croc office frontend
|
|
390
|
-
|
|
391
|
-
### Release Verification
|
|
392
|
-
|
|
393
|
-
```bash
|
|
394
|
-
npm run lint
|
|
395
|
-
npm run typecheck
|
|
396
|
-
npm test
|
|
397
|
-
npm view opencroc version dist-tags --json
|
|
398
|
-
```
|
|
399
|
-
|
|
400
|
-
## Documentation
|
|
401
|
-
|
|
402
|
-
Visit **[opencroc.com](https://opencroc.com)** for full documentation, or browse:
|
|
403
|
-
|
|
404
|
-
- [Architecture Guide](docs/architecture.md)
|
|
405
|
-
- [Configuration Reference](docs/configuration.md)
|
|
406
|
-
- [Backend Instrumentation Guide](docs/backend-instrumentation.md)
|
|
407
|
-
- [AI Provider Setup](docs/ai-providers.md)
|
|
408
|
-
- [Self-Healing Guide](docs/self-healing.md)
|
|
409
|
-
- [Troubleshooting](docs/troubleshooting.md)
|
|
410
|
-
|
|
411
|
-
## Contributing
|
|
412
|
-
|
|
413
|
-
We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
414
|
-
|
|
415
|
-
## License
|
|
416
|
-
|
|
417
|
-
[MIT](LICENSE) © 2026 OpenCroc Contributors
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/banner.png" alt="OpenCroc banner" width="820" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">OpenCroc</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>AI-native E2E testing framework that reads source code, generates tests, and self-heals failures.</strong>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://www.npmjs.com/package/opencroc"><img src="https://img.shields.io/npm/v/opencroc?color=green" alt="npm version" /></a>
|
|
13
|
+
<a href="https://github.com/opencroc/opencroc/actions/workflows/ci.yml"><img src="https://github.com/opencroc/opencroc/actions/workflows/ci.yml/badge.svg?branch=main" alt="CI" /></a>
|
|
14
|
+
<a href="https://github.com/opencroc/opencroc/blob/main/LICENSE"><img src="https://img.shields.io/github/license/opencroc/opencroc" alt="MIT License" /></a>
|
|
15
|
+
<a href="https://opencroc.com"><img src="https://img.shields.io/badge/docs-opencroc.com-blue" alt="Documentation" /></a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<p align="center">
|
|
19
|
+
<a href="README.md">English</a> | <a href="README.zh-CN.md">Simplified Chinese</a> | <a href="README.ja.md">Japanese</a>
|
|
20
|
+
</p>
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## What is OpenCroc?
|
|
25
|
+
|
|
26
|
+
OpenCroc is an AI-native end-to-end testing framework built on top of [Playwright](https://playwright.dev). Instead of writing test scripts by hand, OpenCroc reads backend source code, understands models, controllers, DTOs, and relations, then generates complete E2E suites with seed data, request bodies, API chains, and assertions.
|
|
27
|
+
|
|
28
|
+
When tests fail, OpenCroc does more than report the error. It traces the failure across the request chain, attributes likely root causes, proposes fixes, and can re-run verification after controlled healing steps.
|
|
29
|
+
|
|
30
|
+
## Key Capabilities
|
|
31
|
+
|
|
32
|
+
| Capability | Description |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| Source-aware generation | Parses Sequelize, TypeORM, Prisma, and Drizzle structures to understand modules, models, routes, and DTOs |
|
|
35
|
+
| AI-driven config generation | Produces request templates, seed plans, parameter mappings, and test scaffolds with validation gates |
|
|
36
|
+
| Chain planning | Builds dependency DAGs and plans execution order for higher API coverage |
|
|
37
|
+
| Log-driven completion | Uses backend execution signals instead of relying only on `networkidle` |
|
|
38
|
+
| Failure attribution | Traces issues across frontend requests, backend logs, and dependency chains |
|
|
39
|
+
| Controlled self-healing | Supports backup, patch, dry-run, re-run, verify, and rollback loops |
|
|
40
|
+
| Visual Studio | Ships a local web UI for graph exploration, agent activity, and pixel-office monitoring |
|
|
41
|
+
|
|
42
|
+
## Quick Start
|
|
43
|
+
|
|
44
|
+
### Prerequisites
|
|
45
|
+
|
|
46
|
+
- Node.js 18 or newer
|
|
47
|
+
- A backend project using Express or NestJS
|
|
48
|
+
- One of the supported ORM or schema patterns
|
|
49
|
+
|
|
50
|
+
### Installation
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npm install opencroc --save-dev
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Initialize
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
npx opencroc init
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
This will:
|
|
63
|
+
|
|
64
|
+
1. Scan your project structure
|
|
65
|
+
2. Detect your framework and ORM patterns
|
|
66
|
+
3. Create `opencroc.config.ts`
|
|
67
|
+
4. Generate a starter output layout
|
|
68
|
+
|
|
69
|
+
### Generate Tests
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# Generate tests for a single module
|
|
73
|
+
npx opencroc generate --module=knowledge-base
|
|
74
|
+
|
|
75
|
+
# Generate tests for all detected modules
|
|
76
|
+
npx opencroc generate --all
|
|
77
|
+
|
|
78
|
+
# Preview without writing files
|
|
79
|
+
npx opencroc generate --all --dry-run
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Run Tests
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
# Run all generated tests
|
|
86
|
+
npx opencroc test
|
|
87
|
+
|
|
88
|
+
# Run a single module
|
|
89
|
+
npx opencroc test --module=knowledge-base
|
|
90
|
+
|
|
91
|
+
# Run in headed mode
|
|
92
|
+
npx opencroc test --headed
|
|
93
|
+
|
|
94
|
+
# Override hooks from the CLI
|
|
95
|
+
npx opencroc test --setup-hook="npm run e2e:setup" --auth-hook="node scripts/auth.js" --teardown-hook="npm run e2e:cleanup"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Validate AI Configs
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
npx opencroc validate --all
|
|
102
|
+
npx opencroc compare --baseline=report-a.json --current=report-b.json
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## OpenCroc Studio
|
|
106
|
+
|
|
107
|
+
OpenCroc Studio is the local visual workspace for OpenCroc. It combines a knowledge graph view, a pixel-office operations view, and a 3D office runtime into one web experience served by the CLI.
|
|
108
|
+
|
|
109
|
+
### Launch Studio
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Start Studio and open the browser
|
|
113
|
+
npx opencroc serve
|
|
114
|
+
|
|
115
|
+
# Custom port
|
|
116
|
+
npx opencroc serve --port 3000
|
|
117
|
+
|
|
118
|
+
# Disable browser auto-open
|
|
119
|
+
npx opencroc serve --no-open
|
|
120
|
+
|
|
121
|
+
# Bind a public host
|
|
122
|
+
npx opencroc serve --host 0.0.0.0 --port 8765
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Current Web Architecture
|
|
126
|
+
|
|
127
|
+
- Fastify serves the local Studio application and API endpoints
|
|
128
|
+
- The frontend is a single-entry Vite SPA
|
|
129
|
+
- The main routes are `/`, `/studio`, and `/pixel`
|
|
130
|
+
- The web source is organized under `src/web` with `app`, `pages`, `features`, `shared`, `styles`, and `public`
|
|
131
|
+
- Legacy entry URLs such as `/index-studio.html` and `/index-v2-pixel.html` are redirected to SPA routes
|
|
132
|
+
|
|
133
|
+
### Studio Features
|
|
134
|
+
|
|
135
|
+
- Knowledge graph canvas for modules, APIs, and relations
|
|
136
|
+
- Pixel-office dashboard for live agent activity
|
|
137
|
+
- 3D office runtime view for immersive monitoring
|
|
138
|
+
- Real-time updates over WebSocket
|
|
139
|
+
- Sidebar navigation and route-based view switching
|
|
140
|
+
- REST endpoints such as `GET /api/project`, `GET /api/agents`, and `POST /api/project/refresh`
|
|
141
|
+
|
|
142
|
+
## Full Pipeline
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
# Run the full pipeline
|
|
146
|
+
npx opencroc run
|
|
147
|
+
|
|
148
|
+
# Run a module with self-healing and reports
|
|
149
|
+
npx opencroc run --module=users --self-heal --report html,json
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## CI/CD Integration
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
npx opencroc ci --platform github
|
|
156
|
+
npx opencroc ci --platform gitlab --self-heal
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Dashboard and Reports
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
npx opencroc dashboard
|
|
163
|
+
npx opencroc report --format html,json,markdown
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Architecture
|
|
167
|
+
|
|
168
|
+
```text
|
|
169
|
+
+-------------------------------------------------------------------+
|
|
170
|
+
| OpenCroc Studio |
|
|
171
|
+
| Fastify server + single-entry Vite SPA + WebSocket updates |
|
|
172
|
+
| Routes: /, /studio, /pixel |
|
|
173
|
+
+-------------------------------------------------------------------+
|
|
174
|
+
| CLI / Orchestrator |
|
|
175
|
+
+--------------+--------------+---------------+----------------------+
|
|
176
|
+
| Source Parse | Chain Plan | Test Generate | Execute / Observe |
|
|
177
|
+
+--------------+--------------+---------------+----------------------+
|
|
178
|
+
| Self-Heal | Impact Map | Reports | Dashboard / Studio |
|
|
179
|
+
+--------------+--------------+---------------+----------------------+
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### 6-Stage Pipeline
|
|
183
|
+
|
|
184
|
+
```text
|
|
185
|
+
Source Scan -> ER Diagram -> API Analysis -> Chain Planning -> Test Generation -> Failure Analysis
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
## How It Works
|
|
189
|
+
|
|
190
|
+
### 1. Source Parsing
|
|
191
|
+
|
|
192
|
+
OpenCroc uses [ts-morph](https://ts-morph.com) and framework-aware parsers to analyze:
|
|
193
|
+
|
|
194
|
+
- Models and relations
|
|
195
|
+
- Controllers and routes
|
|
196
|
+
- DTO fields and validation rules
|
|
197
|
+
- Module boundaries and dependency surfaces
|
|
198
|
+
|
|
199
|
+
### 2. AI Configuration Generation
|
|
200
|
+
|
|
201
|
+
For each module, OpenCroc can generate:
|
|
202
|
+
|
|
203
|
+
- Request body templates
|
|
204
|
+
- Seed data plans
|
|
205
|
+
- Parameter mappings
|
|
206
|
+
- ID alias rules
|
|
207
|
+
|
|
208
|
+
Each config passes through validation stages:
|
|
209
|
+
|
|
210
|
+
1. Schema validation
|
|
211
|
+
2. Semantic validation
|
|
212
|
+
3. Dry-run validation
|
|
213
|
+
|
|
214
|
+
### 3. Log-Driven Completion
|
|
215
|
+
|
|
216
|
+
Instead of depending only on browser idle heuristics, OpenCroc can watch backend completion signals and correlate them with frontend actions.
|
|
217
|
+
|
|
218
|
+
### 4. Self-Healing Loop
|
|
219
|
+
|
|
220
|
+
```text
|
|
221
|
+
Test Failure
|
|
222
|
+
-> Attribution
|
|
223
|
+
-> Proposed Fix
|
|
224
|
+
-> Dry-Run Validation
|
|
225
|
+
-> Apply Patch
|
|
226
|
+
-> Re-run
|
|
227
|
+
-> Verify
|
|
228
|
+
-> Rollback if needed
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## Real-World Validation
|
|
232
|
+
|
|
233
|
+
OpenCroc has been exercised against a production-style RBAC system with more than 100 Sequelize models, dozens of controllers, and embedded associations.
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
$ npx tsx examples/rbac-system/smoke-test.ts
|
|
237
|
+
|
|
238
|
+
Modules : 5
|
|
239
|
+
ER Diagrams : 5
|
|
240
|
+
Chain Plans : 5
|
|
241
|
+
Generated Files: 78
|
|
242
|
+
Duration : 1153ms
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Key findings:
|
|
246
|
+
|
|
247
|
+
- 102 tables and 65 foreign-key relations extracted from a flat model layout
|
|
248
|
+
- Embedded associations detected without requiring dedicated association files
|
|
249
|
+
- 78 generated test files across 5 modules
|
|
250
|
+
- Support for both flat and nested directory layouts
|
|
251
|
+
|
|
252
|
+
## Configuration
|
|
253
|
+
|
|
254
|
+
```typescript
|
|
255
|
+
import { defineConfig } from 'opencroc';
|
|
256
|
+
|
|
257
|
+
export default defineConfig({
|
|
258
|
+
backend: {
|
|
259
|
+
modelsDir: 'src/models',
|
|
260
|
+
controllersDir: 'src/controllers',
|
|
261
|
+
servicesDir: 'src/services',
|
|
262
|
+
},
|
|
263
|
+
|
|
264
|
+
baseUrl: 'http://localhost:3000',
|
|
265
|
+
apiBaseUrl: 'http://localhost:3000/api',
|
|
266
|
+
|
|
267
|
+
ai: {
|
|
268
|
+
provider: 'openai',
|
|
269
|
+
apiKey: process.env.AI_API_KEY,
|
|
270
|
+
model: 'gpt-4o-mini',
|
|
271
|
+
},
|
|
272
|
+
|
|
273
|
+
execution: {
|
|
274
|
+
workers: 4,
|
|
275
|
+
timeout: 30_000,
|
|
276
|
+
retries: 1,
|
|
277
|
+
},
|
|
278
|
+
|
|
279
|
+
logCompletion: {
|
|
280
|
+
enabled: true,
|
|
281
|
+
endpoint: '/internal/test-logs',
|
|
282
|
+
pollIntervalMs: 500,
|
|
283
|
+
timeoutMs: 10_000,
|
|
284
|
+
},
|
|
285
|
+
|
|
286
|
+
selfHealing: {
|
|
287
|
+
enabled: false,
|
|
288
|
+
fixScope: 'config-only',
|
|
289
|
+
maxFixRounds: 3,
|
|
290
|
+
dryRunFirst: true,
|
|
291
|
+
},
|
|
292
|
+
});
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
## Supported Tech Stacks
|
|
296
|
+
|
|
297
|
+
| Layer | Supported | Planned |
|
|
298
|
+
| --- | --- | --- |
|
|
299
|
+
| ORM | Sequelize, TypeORM, Prisma, Drizzle | More adapters as needed |
|
|
300
|
+
| Framework | Express | NestJS, Fastify, Koa |
|
|
301
|
+
| Test Runner | Playwright | Additional runners |
|
|
302
|
+
| LLM | OpenAI, ZhiPu, Ollama | Anthropic |
|
|
303
|
+
| Database | MySQL, PostgreSQL | SQLite, MongoDB |
|
|
304
|
+
|
|
305
|
+
## Comparison
|
|
306
|
+
|
|
307
|
+
| Feature | OpenCroc | Playwright | Metersphere | auto-playwright |
|
|
308
|
+
| --- | --- | --- | --- | --- |
|
|
309
|
+
| Source-aware generation | Yes | No | No | No |
|
|
310
|
+
| AI config generation and validation | Yes | No | No | No |
|
|
311
|
+
| Log-driven completion | Yes | No | No | No |
|
|
312
|
+
| Failure attribution | Yes | No | Partial | No |
|
|
313
|
+
| Self-healing with rollback | Yes | No | No | No |
|
|
314
|
+
| API dependency DAG | Yes | No | No | No |
|
|
315
|
+
| Zero-config test generation | Yes | Limited | Manual | Prompt-driven |
|
|
316
|
+
| Impact analysis | Yes | No | No | No |
|
|
317
|
+
|
|
318
|
+
## Roadmap
|
|
319
|
+
|
|
320
|
+
- [x] 6-stage source-to-test pipeline
|
|
321
|
+
- [x] AI configuration generation with validation
|
|
322
|
+
- [x] Controlled self-healing loop
|
|
323
|
+
- [x] Log-driven completion detection
|
|
324
|
+
- [x] Failure attribution and impact analysis
|
|
325
|
+
- [x] Prisma and Drizzle adapters
|
|
326
|
+
- [x] Ollama local LLM support
|
|
327
|
+
- [x] CI integration
|
|
328
|
+
- [x] VS Code extension scaffold
|
|
329
|
+
- [x] Plugin system
|
|
330
|
+
- [x] HTML, JSON, and Markdown reports
|
|
331
|
+
- [x] Visual Studio dashboard
|
|
332
|
+
- [x] Runtime infrastructure
|
|
333
|
+
- [x] Full orchestration pipeline
|
|
334
|
+
- [x] Advanced reporters
|
|
335
|
+
- [x] OpenCroc Studio route-based web app
|
|
336
|
+
|
|
337
|
+
## Release Snapshot
|
|
338
|
+
|
|
339
|
+
- Product snapshot covered by this README: `1.8.3`
|
|
340
|
+
- Studio architecture snapshot: Fastify + single-entry Vite SPA + route-based views
|
|
341
|
+
- Main Studio routes: `/`, `/studio`, `/pixel`
|
|
342
|
+
- Full-suite quality gate: 41 test files and 414 tests passing
|
|
343
|
+
|
|
344
|
+
### Version Rhythm
|
|
345
|
+
|
|
346
|
+
- `0.3.x`: plugin system, CI templates, reporters, VS Code scaffold
|
|
347
|
+
- `0.4.x`: NestJS controller parser
|
|
348
|
+
- `0.5.x`: Drizzle ORM adapter
|
|
349
|
+
- `0.6.x`: visual dashboard and Windows Vitest stability work
|
|
350
|
+
- `0.7.x - 0.9.x`: runtime infrastructure, auth, log-driven detection, rules engine
|
|
351
|
+
- `1.0.0`: full orchestration pipeline
|
|
352
|
+
- `1.1.0`: advanced self-healing
|
|
353
|
+
- `1.2.0`: advanced reporters and migration work
|
|
354
|
+
- `1.3.0`: OpenCroc Studio M1
|
|
355
|
+
- `1.8.3`: Vite SPA routing, web architecture cleanup, package slimming
|
|
356
|
+
|
|
357
|
+
### Release Verification
|
|
358
|
+
|
|
359
|
+
```bash
|
|
360
|
+
npm run lint
|
|
361
|
+
npm run typecheck
|
|
362
|
+
npm test
|
|
363
|
+
npm view opencroc version dist-tags --json
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
## Documentation
|
|
367
|
+
|
|
368
|
+
Visit **[opencroc.com](https://opencroc.com)** for documentation, or browse:
|
|
369
|
+
|
|
370
|
+
- [Architecture Guide](docs/architecture.md)
|
|
371
|
+
- [Configuration Reference](docs/configuration.md)
|
|
372
|
+
- [Backend Instrumentation Guide](docs/backend-instrumentation.md)
|
|
373
|
+
- [AI Provider Setup](docs/ai-providers.md)
|
|
374
|
+
- [Self-Healing Guide](docs/self-healing.md)
|
|
375
|
+
- [Troubleshooting](docs/troubleshooting.md)
|
|
376
|
+
|
|
377
|
+
## Contributing
|
|
378
|
+
|
|
379
|
+
We welcome contributions. See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
380
|
+
|
|
381
|
+
## License
|
|
382
|
+
|
|
383
|
+
[MIT](LICENSE) Copyright 2026 OpenCroc Contributors
|
package/package.json
CHANGED