playwright-intelligence-engine 2.0.0 → 2.0.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.
- package/README.md +229 -229
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/core/version.d.ts +3 -3
- package/dist/index.js +81 -24
- package/package.json +76 -76
- package/src/authoring/author.ts +81 -81
- package/src/authoring/generation-contract.ts +283 -283
- package/src/authoring/hybrid-author.ts +115 -115
- package/src/authoring/index.ts +7 -7
- package/src/authoring/llm-author.ts +282 -282
- package/src/authoring/naming/name-plan.ts +28 -28
- package/src/authoring/naming/name-planner.ts +339 -339
- package/src/authoring/naming/naming-linter.ts +292 -292
- package/src/cli/index.ts +1238 -1172
- package/src/collectors/git-diff-collector.ts +190 -190
- package/src/core/version.ts +25 -25
- package/src/diagnostics/diagnostic-report.ts +204 -204
- package/src/diagnostics/failure-classifier.ts +701 -701
- package/src/evaluation/repository-runner.ts +197 -197
- package/src/gate/quality.ts +101 -101
- package/src/generator/architecture-generator.ts +582 -582
- package/src/generator/assertion-quality-gate.ts +88 -88
- package/src/generator/candidate-writer.ts +288 -288
- package/src/generator/test-generator.ts +52 -52
- package/src/index.ts +107 -107
- package/src/intelligence/evidence-bundle.ts +300 -300
- package/src/intelligence/generation-agent.ts +561 -561
- package/src/intelligence/generation-verifier.ts +1115 -1115
- package/src/intelligence/locator-disambiguation-engine.ts +331 -331
- package/src/intelligence/project-intelligence.ts +140 -140
- package/src/intelligence/repository-profile.ts +796 -796
- package/src/intelligence/trace-proposal-workflow.ts +318 -318
- package/src/intelligence/workflow-planner.ts +966 -966
- package/src/mcp/server.ts +970 -970
- package/src/perception/app-model.ts +32 -32
- package/src/perception/crawler.ts +263 -263
- package/src/perception/index.ts +3 -3
- package/src/repair/assertion-hasher.ts +386 -386
- package/src/repair/diff-allowlist.ts +612 -612
- package/src/repair/intent-validator.ts +761 -761
- package/src/repair/repair-planner.ts +467 -467
- package/src/repair/statement-patcher.ts +544 -544
- package/src/reproduce/interactive-workflow-runner.ts +828 -828
- package/src/sandbox/execution-runner.ts +408 -408
- package/src/selector/abstention-policy.ts +175 -175
- package/src/selector/candidate-extractor.ts +343 -343
- package/src/selector/repair-candidate-ranker.ts +92 -92
- package/src/selector/selector-scorer.ts +344 -344
package/package.json
CHANGED
|
@@ -1,76 +1,76 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "playwright-intelligence-engine",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"description": "Enterprise-grade Playwright reliability, failure diagnosis, and intent-preserving test verification engine",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./dist/index.js",
|
|
7
|
-
"types": "./dist/index.d.ts",
|
|
8
|
-
"bin": {
|
|
9
|
-
"pw-intel": "bin/pw-intel.js",
|
|
10
|
-
"playwright-intelligence-engine": "bin/pw-intel.js"
|
|
11
|
-
},
|
|
12
|
-
"files": [
|
|
13
|
-
"dist",
|
|
14
|
-
"bin",
|
|
15
|
-
"src",
|
|
16
|
-
"skills",
|
|
17
|
-
"README.md",
|
|
18
|
-
"LICENSE"
|
|
19
|
-
],
|
|
20
|
-
"scripts": {
|
|
21
|
-
"build": "tsup src/index.ts --format esm --clean && tsc --emitDeclarationOnly --declaration --declarationMap --outDir dist",
|
|
22
|
-
"test": "vitest run --maxWorkers=4",
|
|
23
|
-
"test:watch": "vitest",
|
|
24
|
-
"typecheck": "tsc --noEmit && tsc -p tests/tsconfig.json --noEmit",
|
|
25
|
-
"verify:all": "node scripts/verify/index.mjs",
|
|
26
|
-
"verify:full": "node scripts/verify/index.mjs --full",
|
|
27
|
-
"verify:baseline": "node scripts/verify-baseline.mjs"
|
|
28
|
-
},
|
|
29
|
-
"keywords": [
|
|
30
|
-
"playwright",
|
|
31
|
-
"test-intelligence",
|
|
32
|
-
"self-healing",
|
|
33
|
-
"flaky-tests",
|
|
34
|
-
"ast-manipulation",
|
|
35
|
-
"trace-analysis"
|
|
36
|
-
],
|
|
37
|
-
"author": "Playwright Intelligence Team",
|
|
38
|
-
"license": "Apache-2.0",
|
|
39
|
-
"repository": {
|
|
40
|
-
"type": "git",
|
|
41
|
-
"url": "git+https://github.com/lst2121/playwright-intelligence-engine.git"
|
|
42
|
-
},
|
|
43
|
-
"bugs": {
|
|
44
|
-
"url": "https://github.com/lst2121/playwright-intelligence-engine/issues"
|
|
45
|
-
},
|
|
46
|
-
"homepage": "https://github.com/lst2121/playwright-intelligence-engine#readme",
|
|
47
|
-
"engines": {
|
|
48
|
-
"node": ">=20.0.0"
|
|
49
|
-
},
|
|
50
|
-
"dependencies": {
|
|
51
|
-
"adm-zip": "^0.6.1",
|
|
52
|
-
"ts-morph": "^28.0.0",
|
|
53
|
-
"tsx": "^4.23.15",
|
|
54
|
-
"zod": "^4.6.7"
|
|
55
|
-
},
|
|
56
|
-
"peerDependencies": {
|
|
57
|
-
"@playwright/test": ">=1.30.0"
|
|
58
|
-
},
|
|
59
|
-
"peerDependenciesMeta": {
|
|
60
|
-
"@playwright/test": {
|
|
61
|
-
"optional": true
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
"devDependencies": {
|
|
65
|
-
"@playwright/test": "^1.64.1",
|
|
66
|
-
"@types/adm-zip": "^0.6.0",
|
|
67
|
-
"@types/node": "^26.6.6",
|
|
68
|
-
"tsup": "^9.0.0",
|
|
69
|
-
"typescript": "^7.0.2",
|
|
70
|
-
"vitest": "^5.1.0"
|
|
71
|
-
},
|
|
72
|
-
"directories": {
|
|
73
|
-
"doc": "docs",
|
|
74
|
-
"test": "tests"
|
|
75
|
-
}
|
|
76
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "playwright-intelligence-engine",
|
|
3
|
+
"version": "2.0.2",
|
|
4
|
+
"description": "Enterprise-grade Playwright reliability, failure diagnosis, and intent-preserving test verification engine",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"pw-intel": "bin/pw-intel.js",
|
|
10
|
+
"playwright-intelligence-engine": "bin/pw-intel.js"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"bin",
|
|
15
|
+
"src",
|
|
16
|
+
"skills",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"build": "tsup src/index.ts --format esm --clean && tsc --emitDeclarationOnly --declaration --declarationMap --outDir dist",
|
|
22
|
+
"test": "vitest run --maxWorkers=4",
|
|
23
|
+
"test:watch": "vitest",
|
|
24
|
+
"typecheck": "tsc --noEmit && tsc -p tests/tsconfig.json --noEmit",
|
|
25
|
+
"verify:all": "node scripts/verify/index.mjs",
|
|
26
|
+
"verify:full": "node scripts/verify/index.mjs --full",
|
|
27
|
+
"verify:baseline": "node scripts/verify-baseline.mjs"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"playwright",
|
|
31
|
+
"test-intelligence",
|
|
32
|
+
"self-healing",
|
|
33
|
+
"flaky-tests",
|
|
34
|
+
"ast-manipulation",
|
|
35
|
+
"trace-analysis"
|
|
36
|
+
],
|
|
37
|
+
"author": "Playwright Intelligence Team",
|
|
38
|
+
"license": "Apache-2.0",
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "git+https://github.com/lst2121/playwright-intelligence-engine.git"
|
|
42
|
+
},
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/lst2121/playwright-intelligence-engine/issues"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://github.com/lst2121/playwright-intelligence-engine#readme",
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=20.0.0"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"adm-zip": "^0.6.1",
|
|
52
|
+
"ts-morph": "^28.0.0",
|
|
53
|
+
"tsx": "^4.23.15",
|
|
54
|
+
"zod": "^4.6.7"
|
|
55
|
+
},
|
|
56
|
+
"peerDependencies": {
|
|
57
|
+
"@playwright/test": ">=1.30.0"
|
|
58
|
+
},
|
|
59
|
+
"peerDependenciesMeta": {
|
|
60
|
+
"@playwright/test": {
|
|
61
|
+
"optional": true
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"devDependencies": {
|
|
65
|
+
"@playwright/test": "^1.64.1",
|
|
66
|
+
"@types/adm-zip": "^0.6.0",
|
|
67
|
+
"@types/node": "^26.6.6",
|
|
68
|
+
"tsup": "^9.0.0",
|
|
69
|
+
"typescript": "^7.0.2",
|
|
70
|
+
"vitest": "^5.1.0"
|
|
71
|
+
},
|
|
72
|
+
"directories": {
|
|
73
|
+
"doc": "docs",
|
|
74
|
+
"test": "tests"
|
|
75
|
+
}
|
|
76
|
+
}
|
package/src/authoring/author.ts
CHANGED
|
@@ -1,81 +1,81 @@
|
|
|
1
|
-
import type { ArchitectureMode } from '../generator/architecture-generator.js';
|
|
2
|
-
import type { GeneratedStep } from '../generator/test-generator.js';
|
|
3
|
-
import type { RepositoryConventionProfile, PageObjectExemplar } from '../intelligence/repository-profile.js';
|
|
4
|
-
import type { NamePlan } from './naming/name-plan.js';
|
|
5
|
-
import type { FullGenerationProposal } from './generation-contract.js';
|
|
6
|
-
|
|
7
|
-
export type AuthorKind = 'template' | 'hybrid' | 'llm';
|
|
8
|
-
|
|
9
|
-
export interface CandidateFile {
|
|
10
|
-
relativePath: string;
|
|
11
|
-
content: string;
|
|
12
|
-
purpose?: string | undefined;
|
|
13
|
-
action?: 'CREATE' | 'MODIFY' | 'SKIP_EXISTING' | undefined;
|
|
14
|
-
rationale?: string | undefined;
|
|
15
|
-
evidenceReferences?: string[] | undefined;
|
|
16
|
-
scenarioIds?: string[] | undefined;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface CandidateChange {
|
|
20
|
-
files: CandidateFile[];
|
|
21
|
-
symbols: NamePlan;
|
|
22
|
-
rationale: string;
|
|
23
|
-
authorKind: AuthorKind;
|
|
24
|
-
featureName: string;
|
|
25
|
-
slug: string;
|
|
26
|
-
mode: ArchitectureMode;
|
|
27
|
-
status?: 'GENERATE' | 'NEEDS_INPUT' | 'ABSTAIN' | undefined;
|
|
28
|
-
fullCodeAuthoring?: boolean | undefined;
|
|
29
|
-
usedFallback?: boolean | undefined;
|
|
30
|
-
proposal?: FullGenerationProposal | undefined;
|
|
31
|
-
assumptions?: string[] | undefined;
|
|
32
|
-
requiredClarifications?: string[] | undefined;
|
|
33
|
-
validationErrors?: string[] | undefined;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export interface FullCodeGenerationInput {
|
|
37
|
-
featureName: string;
|
|
38
|
-
mode: ArchitectureMode;
|
|
39
|
-
baseUrl?: string | undefined;
|
|
40
|
-
requirements?: string | undefined;
|
|
41
|
-
steps?: GeneratedStep[] | undefined;
|
|
42
|
-
profile?: RepositoryConventionProfile | undefined;
|
|
43
|
-
existingFiles?: string[] | undefined;
|
|
44
|
-
exemplars?: PageObjectExemplar[] | undefined;
|
|
45
|
-
contextPacket?: unknown;
|
|
46
|
-
workflowPlan?: unknown;
|
|
47
|
-
explorationBundle?: unknown;
|
|
48
|
-
scenarios?: unknown;
|
|
49
|
-
existingFileSnapshots?: Array<{ path: string; content: string; hash?: string | undefined }> | undefined;
|
|
50
|
-
allowedEvidenceIds?: string[] | undefined;
|
|
51
|
-
feedback?: string[] | undefined;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export interface FullCodeGenerationProvider {
|
|
55
|
-
generate(input: FullCodeGenerationInput): Promise<unknown>;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export interface AuthorInput {
|
|
59
|
-
featureName: string;
|
|
60
|
-
mode: ArchitectureMode;
|
|
61
|
-
baseUrl?: string | undefined;
|
|
62
|
-
requirements?: string | undefined;
|
|
63
|
-
steps?: GeneratedStep[] | undefined;
|
|
64
|
-
profile?: RepositoryConventionProfile | undefined;
|
|
65
|
-
existingFiles?: string[] | undefined;
|
|
66
|
-
exemplars?: PageObjectExemplar[] | undefined;
|
|
67
|
-
contextPacket?: unknown;
|
|
68
|
-
workflowPlan?: unknown;
|
|
69
|
-
explorationBundle?: unknown;
|
|
70
|
-
scenarios?: unknown;
|
|
71
|
-
existingFileSnapshots?: Array<{ path: string; content: string; hash?: string | undefined }> | undefined;
|
|
72
|
-
allowedEvidenceIds?: string[] | undefined;
|
|
73
|
-
requireEvidenceReferences?: boolean | undefined;
|
|
74
|
-
fullCodeProvider?: FullCodeGenerationProvider | undefined;
|
|
75
|
-
feedback?: string[] | undefined;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export interface Author {
|
|
79
|
-
readonly kind: AuthorKind;
|
|
80
|
-
propose(input: AuthorInput): Promise<CandidateChange>;
|
|
81
|
-
}
|
|
1
|
+
import type { ArchitectureMode } from '../generator/architecture-generator.js';
|
|
2
|
+
import type { GeneratedStep } from '../generator/test-generator.js';
|
|
3
|
+
import type { RepositoryConventionProfile, PageObjectExemplar } from '../intelligence/repository-profile.js';
|
|
4
|
+
import type { NamePlan } from './naming/name-plan.js';
|
|
5
|
+
import type { FullGenerationProposal } from './generation-contract.js';
|
|
6
|
+
|
|
7
|
+
export type AuthorKind = 'template' | 'hybrid' | 'llm';
|
|
8
|
+
|
|
9
|
+
export interface CandidateFile {
|
|
10
|
+
relativePath: string;
|
|
11
|
+
content: string;
|
|
12
|
+
purpose?: string | undefined;
|
|
13
|
+
action?: 'CREATE' | 'MODIFY' | 'SKIP_EXISTING' | undefined;
|
|
14
|
+
rationale?: string | undefined;
|
|
15
|
+
evidenceReferences?: string[] | undefined;
|
|
16
|
+
scenarioIds?: string[] | undefined;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface CandidateChange {
|
|
20
|
+
files: CandidateFile[];
|
|
21
|
+
symbols: NamePlan;
|
|
22
|
+
rationale: string;
|
|
23
|
+
authorKind: AuthorKind;
|
|
24
|
+
featureName: string;
|
|
25
|
+
slug: string;
|
|
26
|
+
mode: ArchitectureMode;
|
|
27
|
+
status?: 'GENERATE' | 'NEEDS_INPUT' | 'ABSTAIN' | undefined;
|
|
28
|
+
fullCodeAuthoring?: boolean | undefined;
|
|
29
|
+
usedFallback?: boolean | undefined;
|
|
30
|
+
proposal?: FullGenerationProposal | undefined;
|
|
31
|
+
assumptions?: string[] | undefined;
|
|
32
|
+
requiredClarifications?: string[] | undefined;
|
|
33
|
+
validationErrors?: string[] | undefined;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface FullCodeGenerationInput {
|
|
37
|
+
featureName: string;
|
|
38
|
+
mode: ArchitectureMode;
|
|
39
|
+
baseUrl?: string | undefined;
|
|
40
|
+
requirements?: string | undefined;
|
|
41
|
+
steps?: GeneratedStep[] | undefined;
|
|
42
|
+
profile?: RepositoryConventionProfile | undefined;
|
|
43
|
+
existingFiles?: string[] | undefined;
|
|
44
|
+
exemplars?: PageObjectExemplar[] | undefined;
|
|
45
|
+
contextPacket?: unknown;
|
|
46
|
+
workflowPlan?: unknown;
|
|
47
|
+
explorationBundle?: unknown;
|
|
48
|
+
scenarios?: unknown;
|
|
49
|
+
existingFileSnapshots?: Array<{ path: string; content: string; hash?: string | undefined }> | undefined;
|
|
50
|
+
allowedEvidenceIds?: string[] | undefined;
|
|
51
|
+
feedback?: string[] | undefined;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface FullCodeGenerationProvider {
|
|
55
|
+
generate(input: FullCodeGenerationInput): Promise<unknown>;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface AuthorInput {
|
|
59
|
+
featureName: string;
|
|
60
|
+
mode: ArchitectureMode;
|
|
61
|
+
baseUrl?: string | undefined;
|
|
62
|
+
requirements?: string | undefined;
|
|
63
|
+
steps?: GeneratedStep[] | undefined;
|
|
64
|
+
profile?: RepositoryConventionProfile | undefined;
|
|
65
|
+
existingFiles?: string[] | undefined;
|
|
66
|
+
exemplars?: PageObjectExemplar[] | undefined;
|
|
67
|
+
contextPacket?: unknown;
|
|
68
|
+
workflowPlan?: unknown;
|
|
69
|
+
explorationBundle?: unknown;
|
|
70
|
+
scenarios?: unknown;
|
|
71
|
+
existingFileSnapshots?: Array<{ path: string; content: string; hash?: string | undefined }> | undefined;
|
|
72
|
+
allowedEvidenceIds?: string[] | undefined;
|
|
73
|
+
requireEvidenceReferences?: boolean | undefined;
|
|
74
|
+
fullCodeProvider?: FullCodeGenerationProvider | undefined;
|
|
75
|
+
feedback?: string[] | undefined;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface Author {
|
|
79
|
+
readonly kind: AuthorKind;
|
|
80
|
+
propose(input: AuthorInput): Promise<CandidateChange>;
|
|
81
|
+
}
|