agentic-qe 3.1.4 → 3.1.5

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/CHANGELOG.md CHANGED
@@ -5,6 +5,16 @@ All notable changes to the Agentic QE project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.1.5] - 2026-01-22
9
+
10
+ ### Added
11
+
12
+ - **Root-level preinstall script** - Added migration detection for users upgrading from:
13
+ - `@agentic-qe/v3` (alpha package) → `agentic-qe@latest`
14
+ - `agentic-qe` v2 → `agentic-qe@latest`
15
+ - Provides clear instructions to resolve binary conflicts
16
+ - Supports `AQE_AUTO_MIGRATE=true` for automatic migration
17
+
8
18
  ## [3.1.4] - 2026-01-22
9
19
 
10
20
  ### Changed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-qe",
3
- "version": "3.1.4",
3
+ "version": "3.1.5",
4
4
  "description": "Agentic Quality Engineering V3 - Domain-Driven Design Architecture with 12 Bounded Contexts, O(log n) coverage analysis, ReasoningBank learning, 51 specialized QE agents, deep Claude Flow integration",
5
5
  "main": "./v3/dist/index.js",
6
6
  "types": "./v3/dist/index.d.ts",
@@ -11,6 +11,7 @@
11
11
  "aqe-mcp": "./v3/dist/mcp/bundle.js"
12
12
  },
13
13
  "scripts": {
14
+ "preinstall": "node scripts/preinstall.cjs || true",
14
15
  "postinstall": "test -f v3/package.json && cd v3 && npm install || true",
15
16
  "build": "cd v3 && npm run build",
16
17
  "test": "cd v3 && npm test -- --run",
@@ -132,6 +133,7 @@
132
133
  "v3/dist/**",
133
134
  "v3/assets/**",
134
135
  "v3/package.json",
136
+ "scripts/**",
135
137
  ".claude/agents",
136
138
  ".claude/skills",
137
139
  ".claude/commands",
@@ -0,0 +1,260 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Preinstall script for agentic-qe
5
+ * Detects and handles conflicts from:
6
+ * - agentic-qe v2 (old package)
7
+ * - @agentic-qe/v3 (alpha package)
8
+ *
9
+ * Uses CommonJS for maximum Node.js compatibility
10
+ */
11
+
12
+ const { execSync, spawnSync } = require('child_process');
13
+ const { existsSync, unlinkSync, lstatSync } = require('fs');
14
+ const { join } = require('path');
15
+
16
+ const RESET = '\x1b[0m';
17
+ const BOLD = '\x1b[1m';
18
+ const YELLOW = '\x1b[33m';
19
+ const GREEN = '\x1b[32m';
20
+ const CYAN = '\x1b[36m';
21
+ const RED = '\x1b[31m';
22
+
23
+ function log(msg) {
24
+ console.log(`${CYAN}[agentic-qe]${RESET} ${msg}`);
25
+ }
26
+
27
+ function warn(msg) {
28
+ console.log(`${YELLOW}[agentic-qe]${RESET} ${msg}`);
29
+ }
30
+
31
+ function error(msg) {
32
+ console.log(`${RED}[agentic-qe]${RESET} ${msg}`);
33
+ }
34
+
35
+ function success(msg) {
36
+ console.log(`${GREEN}[agentic-qe]${RESET} ${msg}`);
37
+ }
38
+
39
+ function findExistingAqeBinary() {
40
+ // Try 'which' command first
41
+ try {
42
+ const result = spawnSync('which', ['aqe'], { encoding: 'utf-8' });
43
+ if (result.status === 0 && result.stdout.trim()) {
44
+ return result.stdout.trim();
45
+ }
46
+ } catch {
47
+ // which command failed
48
+ }
49
+
50
+ // Try to find via npm prefix
51
+ try {
52
+ const prefix = execSync('npm config get prefix', { encoding: 'utf-8' }).trim();
53
+ const binPath = join(prefix, 'bin', 'aqe');
54
+ if (existsSync(binPath)) {
55
+ return binPath;
56
+ }
57
+ } catch {
58
+ // Ignore
59
+ }
60
+
61
+ return null;
62
+ }
63
+
64
+ function checkPackageInstalled(packageName) {
65
+ try {
66
+ const result = execSync(`npm list -g ${packageName} --depth=0 2>/dev/null`, {
67
+ encoding: 'utf-8',
68
+ stdio: ['pipe', 'pipe', 'pipe']
69
+ });
70
+ return result.includes(`${packageName}@`);
71
+ } catch {
72
+ return false;
73
+ }
74
+ }
75
+
76
+ function getPackageVersion(packageName) {
77
+ try {
78
+ const result = execSync(`npm list -g ${packageName} --depth=0 2>/dev/null`, {
79
+ encoding: 'utf-8',
80
+ stdio: ['pipe', 'pipe', 'pipe']
81
+ });
82
+ const regex = new RegExp(`${packageName.replace('/', '\\/')}@([\\d\\.\\-a-z]+)`);
83
+ const match = result.match(regex);
84
+ return match ? match[1] : null;
85
+ } catch {
86
+ return null;
87
+ }
88
+ }
89
+
90
+ function uninstallPackage(packageName) {
91
+ try {
92
+ log(`Uninstalling ${packageName}...`);
93
+ execSync(`npm uninstall -g ${packageName}`, {
94
+ encoding: 'utf-8',
95
+ stdio: 'inherit'
96
+ });
97
+ success(`Successfully uninstalled ${packageName}`);
98
+ return true;
99
+ } catch (err) {
100
+ error(`Failed to uninstall ${packageName}: ${err.message}`);
101
+ return false;
102
+ }
103
+ }
104
+
105
+ function removeStaleSymlink(binaryPath) {
106
+ try {
107
+ const stats = lstatSync(binaryPath);
108
+ if (stats.isSymbolicLink()) {
109
+ unlinkSync(binaryPath);
110
+ success(`Removed stale symlink: ${binaryPath}`);
111
+ return true;
112
+ }
113
+ } catch {
114
+ // Not a symlink or can't remove
115
+ }
116
+ return false;
117
+ }
118
+
119
+ function main() {
120
+ // Skip in CI environments unless explicitly requested
121
+ if (process.env.CI && !process.env.AQE_PREINSTALL_CHECK) {
122
+ return;
123
+ }
124
+
125
+ const aqeBinary = findExistingAqeBinary();
126
+
127
+ // Check for both old package names
128
+ const v2Installed = checkPackageInstalled('agentic-qe');
129
+ const alphaInstalled = checkPackageInstalled('@agentic-qe/v3');
130
+
131
+ const v2Version = v2Installed ? getPackageVersion('agentic-qe') : null;
132
+ const alphaVersion = alphaInstalled ? getPackageVersion('@agentic-qe/v3') : null;
133
+
134
+ // If the currently installed agentic-qe is version 3.x, we're good (user is upgrading within v3)
135
+ if (v2Version && v2Version.startsWith('3.')) {
136
+ // User is upgrading from 3.x to newer 3.x - this should work normally
137
+ return;
138
+ }
139
+
140
+ if (!aqeBinary && !v2Installed && !alphaInstalled) {
141
+ // Clean install, nothing to do
142
+ return;
143
+ }
144
+
145
+ console.log('');
146
+ log(`${BOLD}Checking for existing agentic-qe installation...${RESET}`);
147
+
148
+ // Handle alpha package conflict
149
+ if (alphaInstalled) {
150
+ warn(`Found @agentic-qe/v3@${alphaVersion || 'alpha'} installed globally`);
151
+ warn('The alpha package uses the same "aqe" binary name as the released version');
152
+ console.log('');
153
+
154
+ // Check if we can auto-migrate
155
+ const autoMigrate = process.env.AQE_AUTO_MIGRATE === 'true' ||
156
+ process.env.npm_config_yes === 'true';
157
+
158
+ if (autoMigrate) {
159
+ log('Auto-migrating from alpha to release...');
160
+ if (uninstallPackage('@agentic-qe/v3')) {
161
+ success('Migration complete. Continuing with install...');
162
+ return;
163
+ } else {
164
+ error('Auto-migration failed. Please run manually:');
165
+ console.log(` ${CYAN}npm uninstall -g @agentic-qe/v3 && npm install -g agentic-qe@latest${RESET}`);
166
+ process.exit(1);
167
+ }
168
+ }
169
+
170
+ // Interactive mode
171
+ console.log(`${YELLOW}To upgrade from alpha to release:${RESET}`);
172
+ console.log('');
173
+ console.log(` ${BOLD}Option 1: Auto-migrate (recommended)${RESET}`);
174
+ console.log(` ${CYAN}AQE_AUTO_MIGRATE=true npm install -g agentic-qe@latest${RESET}`);
175
+ console.log('');
176
+ console.log(` ${BOLD}Option 2: Manual uninstall first${RESET}`);
177
+ console.log(` ${CYAN}npm uninstall -g @agentic-qe/v3${RESET}`);
178
+ console.log(` ${CYAN}npm install -g agentic-qe@latest${RESET}`);
179
+ console.log('');
180
+ console.log(` ${BOLD}Option 3: Force overwrite${RESET}`);
181
+ console.log(` ${CYAN}npm install -g agentic-qe@latest --force${RESET}`);
182
+ console.log('');
183
+
184
+ process.exit(1);
185
+ }
186
+
187
+ // Handle v2 package conflict
188
+ if (v2Installed && !v2Version?.startsWith('3.')) {
189
+ warn(`Found agentic-qe v${v2Version || '2.x'} installed globally`);
190
+ warn('The v2 package uses the same "aqe" binary name as v3');
191
+ console.log('');
192
+
193
+ const autoMigrate = process.env.AQE_AUTO_MIGRATE === 'true' ||
194
+ process.env.npm_config_yes === 'true';
195
+
196
+ if (autoMigrate) {
197
+ log('Auto-migrating from v2 to v3...');
198
+ if (uninstallPackage('agentic-qe')) {
199
+ success('Migration complete. Continuing with v3 install...');
200
+ return;
201
+ } else {
202
+ error('Auto-migration failed. Please run manually:');
203
+ console.log(` ${CYAN}npm uninstall -g agentic-qe && npm install -g agentic-qe@latest${RESET}`);
204
+ process.exit(1);
205
+ }
206
+ }
207
+
208
+ console.log(`${YELLOW}To upgrade from v2 to v3:${RESET}`);
209
+ console.log('');
210
+ console.log(` ${BOLD}Option 1: Auto-migrate (recommended)${RESET}`);
211
+ console.log(` ${CYAN}AQE_AUTO_MIGRATE=true npm install -g agentic-qe@latest${RESET}`);
212
+ console.log('');
213
+ console.log(` ${BOLD}Option 2: Manual uninstall first${RESET}`);
214
+ console.log(` ${CYAN}npm uninstall -g agentic-qe${RESET}`);
215
+ console.log(` ${CYAN}npm install -g agentic-qe@latest${RESET}`);
216
+ console.log('');
217
+ console.log(` ${BOLD}Option 3: Force overwrite${RESET}`);
218
+ console.log(` ${CYAN}npm install -g agentic-qe@latest --force${RESET}`);
219
+ console.log('');
220
+
221
+ process.exit(1);
222
+
223
+ } else if (aqeBinary && !v2Installed && !alphaInstalled) {
224
+ // Binary exists but no known package found - stale symlink or different package
225
+ warn(`Found existing 'aqe' binary at: ${aqeBinary}`);
226
+
227
+ // Try to identify what it's from
228
+ try {
229
+ const realpath = require('fs').realpathSync(aqeBinary);
230
+ if (realpath.includes('agentic-qe')) {
231
+ warn('This appears to be from a previous agentic-qe installation.');
232
+ }
233
+ } catch {
234
+ // Can't resolve realpath
235
+ }
236
+
237
+ console.log('');
238
+ console.log(`${YELLOW}To resolve the conflict:${RESET}`);
239
+ console.log('');
240
+ console.log(` ${BOLD}Option 1: Remove existing binary${RESET}`);
241
+ console.log(` ${CYAN}rm ${aqeBinary}${RESET}`);
242
+ console.log(` ${CYAN}npm install -g agentic-qe@latest${RESET}`);
243
+ console.log('');
244
+ console.log(` ${BOLD}Option 2: Force overwrite${RESET}`);
245
+ console.log(` ${CYAN}npm install -g agentic-qe@latest --force${RESET}`);
246
+ console.log('');
247
+
248
+ process.exit(1);
249
+ }
250
+ }
251
+
252
+ try {
253
+ main();
254
+ } catch (err) {
255
+ // Don't let preinstall failures block installation
256
+ // Just log and continue
257
+ if (process.env.DEBUG) {
258
+ error(`Preinstall check error: ${err.message}`);
259
+ }
260
+ }
@@ -0,0 +1,74 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Test Dashboard Generator
4
+ * Generates a simple test metrics dashboard for CI
5
+ */
6
+
7
+ const fs = require('fs');
8
+ const path = require('path');
9
+
10
+ // Find all test files
11
+ function findTestFiles(dir, files = []) {
12
+ if (!fs.existsSync(dir)) return files;
13
+
14
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
15
+ for (const entry of entries) {
16
+ const fullPath = path.join(dir, entry.name);
17
+ if (entry.isDirectory()) {
18
+ findTestFiles(fullPath, files);
19
+ } else if (entry.name.endsWith('.test.ts') || entry.name.endsWith('.spec.ts')) {
20
+ files.push(fullPath);
21
+ }
22
+ }
23
+ return files;
24
+ }
25
+
26
+ // Count tests in a file (simple heuristic)
27
+ function countTests(filePath) {
28
+ try {
29
+ const content = fs.readFileSync(filePath, 'utf-8');
30
+ const itMatches = content.match(/\bit\s*\(/g) || [];
31
+ const testMatches = content.match(/\btest\s*\(/g) || [];
32
+ return itMatches.length + testMatches.length;
33
+ } catch {
34
+ return 0;
35
+ }
36
+ }
37
+
38
+ // Main
39
+ const testDirs = ['tests', 'v3/tests'];
40
+ let totalFiles = 0;
41
+ let totalTests = 0;
42
+ const categories = {};
43
+
44
+ for (const dir of testDirs) {
45
+ const files = findTestFiles(dir);
46
+ for (const file of files) {
47
+ totalFiles++;
48
+ const tests = countTests(file);
49
+ totalTests += tests;
50
+
51
+ // Categorize
52
+ if (file.includes('/unit/')) {
53
+ categories.unit = (categories.unit || 0) + tests;
54
+ } else if (file.includes('/integration/')) {
55
+ categories.integration = (categories.integration || 0) + tests;
56
+ } else if (file.includes('/e2e/')) {
57
+ categories.e2e = (categories.e2e || 0) + tests;
58
+ } else {
59
+ categories.other = (categories.other || 0) + tests;
60
+ }
61
+ }
62
+ }
63
+
64
+ console.log('# Test Dashboard');
65
+ console.log('');
66
+ console.log(`**Total Test Files**: ${totalFiles}`);
67
+ console.log(`**Total Tests**: ${totalTests}`);
68
+ console.log('');
69
+ console.log('## By Category');
70
+ for (const [cat, count] of Object.entries(categories)) {
71
+ console.log(`- **${cat}**: ${count} tests`);
72
+ }
73
+ console.log('');
74
+ console.log('Dashboard generated successfully.');
@@ -83268,7 +83268,7 @@ async function cleanupAndExit(code = 0) {
83268
83268
  process.exit(code);
83269
83269
  }
83270
83270
  var program = new Command4();
83271
- var VERSION = true ? "3.1.4" : "0.0.0-dev";
83271
+ var VERSION = true ? "3.1.5" : "0.0.0-dev";
83272
83272
  program.name("aqe").description("Agentic QE - Domain-Driven Quality Engineering").version(VERSION);
83273
83273
  program.command("init").description("Initialize the AQE v3 system").option("-d, --domains <domains>", "Comma-separated list of domains to enable", "all").option("-m, --max-agents <number>", "Maximum concurrent agents", "15").option("--memory <backend>", "Memory backend (sqlite|agentdb|hybrid)", "hybrid").option("--lazy", "Enable lazy loading of domains").option("--wizard", "Run interactive setup wizard").option("--auto", "Auto-configure based on project analysis").option("--minimal", "Minimal configuration (skip optional features)").option("--skip-patterns", "Skip loading pre-trained patterns").option("--with-n8n", "Install n8n workflow testing agents and skills").option("--auto-migrate", "Automatically migrate from v2 if detected").action(async (options) => {
83274
83274
  try {
package/v3/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentic-qe/v3",
3
- "version": "3.1.4",
3
+ "version": "3.1.5",
4
4
  "description": "Agentic QE v3 - Domain-Driven Design Architecture with 12 Bounded Contexts, O(log n) coverage analysis, ReasoningBank learning, 51 specialized QE agents",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",