agentic-qe 3.7.21 → 3.8.0
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/.claude/helpers/brain-checkpoint.cjs +4 -1
- package/.claude/helpers/statusline-v3.cjs +3 -1
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +45 -0
- package/README.md +2 -14
- package/assets/helpers/statusline-v3.cjs +3 -1
- package/dist/cli/brain-commands.js +6 -10
- package/dist/cli/bundle.js +7441 -4327
- package/dist/cli/commands/audit.d.ts +43 -0
- package/dist/cli/commands/audit.js +125 -0
- package/dist/cli/commands/hooks.js +29 -6
- package/dist/cli/commands/init.js +1 -73
- package/dist/cli/commands/learning.js +270 -13
- package/dist/cli/commands/ruvector-commands.d.ts +15 -0
- package/dist/cli/commands/ruvector-commands.js +271 -0
- package/dist/cli/handlers/init-handler.d.ts +0 -1
- package/dist/cli/handlers/init-handler.js +0 -6
- package/dist/cli/index.js +4 -2
- package/dist/context/sources/defect-source.js +2 -2
- package/dist/context/sources/memory-source.js +2 -2
- package/dist/context/sources/requirements-source.js +2 -2
- package/dist/coordination/behavior-tree/decorators.d.ts +108 -0
- package/dist/coordination/behavior-tree/decorators.js +251 -0
- package/dist/coordination/behavior-tree/index.d.ts +12 -0
- package/dist/coordination/behavior-tree/index.js +15 -0
- package/dist/coordination/behavior-tree/nodes.d.ts +165 -0
- package/dist/coordination/behavior-tree/nodes.js +338 -0
- package/dist/coordination/behavior-tree/qe-trees.d.ts +105 -0
- package/dist/coordination/behavior-tree/qe-trees.js +181 -0
- package/dist/coordination/coherence-action-gate.d.ts +284 -0
- package/dist/coordination/coherence-action-gate.js +512 -0
- package/dist/coordination/index.d.ts +4 -0
- package/dist/coordination/index.js +8 -0
- package/dist/coordination/reasoning-qec.d.ts +315 -0
- package/dist/coordination/reasoning-qec.js +585 -0
- package/dist/coordination/task-executor.d.ts +16 -0
- package/dist/coordination/task-executor.js +99 -0
- package/dist/coordination/workflow-orchestrator.d.ts +29 -0
- package/dist/coordination/workflow-orchestrator.js +42 -0
- package/dist/domains/visual-accessibility/cnn-visual-regression.d.ts +135 -0
- package/dist/domains/visual-accessibility/cnn-visual-regression.js +327 -0
- package/dist/domains/visual-accessibility/index.d.ts +1 -0
- package/dist/domains/visual-accessibility/index.js +4 -0
- package/dist/governance/coherence-validator.d.ts +112 -0
- package/dist/governance/coherence-validator.js +180 -0
- package/dist/governance/index.d.ts +1 -0
- package/dist/governance/index.js +2 -0
- package/dist/governance/witness-chain.d.ts +311 -0
- package/dist/governance/witness-chain.js +509 -0
- package/dist/init/index.d.ts +0 -2
- package/dist/init/index.js +0 -1
- package/dist/init/init-wizard-steps.d.ts +10 -0
- package/dist/init/init-wizard-steps.js +87 -1
- package/dist/init/init-wizard.d.ts +1 -9
- package/dist/init/init-wizard.js +3 -69
- package/dist/init/orchestrator.js +0 -1
- package/dist/init/phases/01-detection.js +0 -27
- package/dist/init/phases/07-hooks.js +6 -4
- package/dist/init/phases/phase-interface.d.ts +0 -1
- package/dist/init/settings-merge.js +1 -1
- package/dist/integrations/browser/qe-dashboard/clustering.d.ts +48 -0
- package/dist/integrations/browser/qe-dashboard/clustering.js +183 -0
- package/dist/integrations/browser/qe-dashboard/index.d.ts +12 -0
- package/dist/integrations/browser/qe-dashboard/index.js +15 -0
- package/dist/integrations/browser/qe-dashboard/pattern-explorer.d.ts +165 -0
- package/dist/integrations/browser/qe-dashboard/pattern-explorer.js +260 -0
- package/dist/integrations/browser/qe-dashboard/wasm-vector-store.d.ts +144 -0
- package/dist/integrations/browser/qe-dashboard/wasm-vector-store.js +277 -0
- package/dist/integrations/ruvector/cognitive-container-codec.d.ts +51 -0
- package/dist/integrations/ruvector/cognitive-container-codec.js +180 -0
- package/dist/integrations/ruvector/cognitive-container.d.ts +125 -0
- package/dist/integrations/ruvector/cognitive-container.js +306 -0
- package/dist/integrations/ruvector/coherence-gate.d.ts +309 -0
- package/dist/integrations/ruvector/coherence-gate.js +631 -0
- package/dist/integrations/ruvector/compressed-hnsw-integration.d.ts +176 -0
- package/dist/integrations/ruvector/compressed-hnsw-integration.js +301 -0
- package/dist/integrations/ruvector/dither-adapter.d.ts +122 -0
- package/dist/integrations/ruvector/dither-adapter.js +295 -0
- package/dist/integrations/ruvector/domain-transfer.d.ts +129 -0
- package/dist/integrations/ruvector/domain-transfer.js +220 -0
- package/dist/integrations/ruvector/feature-flags.d.ts +214 -2
- package/dist/integrations/ruvector/feature-flags.js +167 -2
- package/dist/integrations/ruvector/filter-adapter.d.ts +71 -0
- package/dist/integrations/ruvector/filter-adapter.js +285 -0
- package/dist/integrations/ruvector/gnn-wrapper.d.ts +20 -0
- package/dist/integrations/ruvector/gnn-wrapper.js +40 -0
- package/dist/integrations/ruvector/hnsw-health-monitor.d.ts +237 -0
- package/dist/integrations/ruvector/hnsw-health-monitor.js +394 -0
- package/dist/integrations/ruvector/index.d.ts +8 -2
- package/dist/integrations/ruvector/index.js +18 -2
- package/dist/integrations/ruvector/interfaces.d.ts +40 -0
- package/dist/integrations/ruvector/sona-persistence.d.ts +54 -0
- package/dist/integrations/ruvector/sona-persistence.js +162 -0
- package/dist/integrations/ruvector/sona-three-loop.d.ts +392 -0
- package/dist/integrations/ruvector/sona-three-loop.js +814 -0
- package/dist/integrations/ruvector/sona-wrapper.d.ts +97 -0
- package/dist/integrations/ruvector/sona-wrapper.js +147 -3
- package/dist/integrations/ruvector/spectral-math.d.ts +101 -0
- package/dist/integrations/ruvector/spectral-math.js +254 -0
- package/dist/integrations/ruvector/temporal-compression.d.ts +163 -0
- package/dist/integrations/ruvector/temporal-compression.js +318 -0
- package/dist/integrations/ruvector/thompson-sampler.d.ts +61 -0
- package/dist/integrations/ruvector/thompson-sampler.js +118 -0
- package/dist/integrations/ruvector/transfer-coherence-stub.d.ts +80 -0
- package/dist/integrations/ruvector/transfer-coherence-stub.js +63 -0
- package/dist/integrations/ruvector/transfer-verification.d.ts +119 -0
- package/dist/integrations/ruvector/transfer-verification.js +115 -0
- package/dist/kernel/hnsw-adapter.d.ts +52 -1
- package/dist/kernel/hnsw-adapter.js +139 -4
- package/dist/kernel/hnsw-index-provider.d.ts +5 -0
- package/dist/kernel/native-hnsw-backend.d.ts +110 -0
- package/dist/kernel/native-hnsw-backend.js +408 -0
- package/dist/kernel/unified-memory.js +5 -6
- package/dist/learning/aqe-learning-engine.d.ts +2 -0
- package/dist/learning/aqe-learning-engine.js +65 -0
- package/dist/learning/experience-capture-middleware.js +20 -0
- package/dist/learning/experience-capture.d.ts +10 -0
- package/dist/learning/experience-capture.js +34 -0
- package/dist/learning/index.d.ts +2 -2
- package/dist/learning/index.js +4 -4
- package/dist/learning/metrics-tracker.d.ts +11 -0
- package/dist/learning/metrics-tracker.js +29 -13
- package/dist/learning/pattern-lifecycle.d.ts +30 -1
- package/dist/learning/pattern-lifecycle.js +92 -20
- package/dist/learning/pattern-store.d.ts +8 -0
- package/dist/learning/pattern-store.js +8 -2
- package/dist/learning/qe-unified-memory.js +1 -28
- package/dist/learning/regret-tracker.d.ts +201 -0
- package/dist/learning/regret-tracker.js +361 -0
- package/dist/mcp/bundle.js +5915 -474
- package/dist/routing/index.d.ts +4 -2
- package/dist/routing/index.js +3 -1
- package/dist/routing/neural-tiny-dancer-router.d.ts +268 -0
- package/dist/routing/neural-tiny-dancer-router.js +514 -0
- package/dist/routing/queen-integration.js +5 -5
- package/dist/routing/routing-config.d.ts +6 -0
- package/dist/routing/routing-config.js +1 -0
- package/dist/routing/simple-neural-router.d.ts +76 -0
- package/dist/routing/simple-neural-router.js +202 -0
- package/dist/routing/tiny-dancer-router.d.ts +20 -1
- package/dist/routing/tiny-dancer-router.js +21 -2
- package/dist/test-scheduling/dag-attention-scheduler.d.ts +81 -0
- package/dist/test-scheduling/dag-attention-scheduler.js +358 -0
- package/dist/test-scheduling/dag-attention-types.d.ts +81 -0
- package/dist/test-scheduling/dag-attention-types.js +10 -0
- package/dist/test-scheduling/index.d.ts +1 -0
- package/dist/test-scheduling/index.js +4 -0
- package/dist/test-scheduling/pipeline.d.ts +8 -0
- package/dist/test-scheduling/pipeline.js +28 -0
- package/package.json +6 -2
- package/dist/cli/commands/migrate.d.ts +0 -9
- package/dist/cli/commands/migrate.js +0 -566
- package/dist/init/init-wizard-migration.d.ts +0 -52
- package/dist/init/init-wizard-migration.js +0 -345
- package/dist/init/migration/config-migrator.d.ts +0 -31
- package/dist/init/migration/config-migrator.js +0 -149
- package/dist/init/migration/data-migrator.d.ts +0 -72
- package/dist/init/migration/data-migrator.js +0 -232
- package/dist/init/migration/detector.d.ts +0 -44
- package/dist/init/migration/detector.js +0 -105
- package/dist/init/migration/index.d.ts +0 -8
- package/dist/init/migration/index.js +0 -8
- package/dist/learning/v2-to-v3-migration.d.ts +0 -86
- package/dist/learning/v2-to-v3-migration.js +0 -529
|
@@ -1,345 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Init Wizard - V2 Migration Logic
|
|
3
|
-
*
|
|
4
|
-
* Contains V2 installation detection, migration, and config conversion.
|
|
5
|
-
* Extracted from init-wizard.ts.
|
|
6
|
-
*/
|
|
7
|
-
import { existsSync, mkdirSync, writeFileSync, readFileSync, readdirSync, statSync, unlinkSync, copyFileSync } from 'fs';
|
|
8
|
-
import { join, dirname } from 'path';
|
|
9
|
-
import { getAQEVersion } from './types.js';
|
|
10
|
-
import { toErrorMessage } from '../shared/error-utils.js';
|
|
11
|
-
import { safeJsonParse } from '../shared/safe-json.js';
|
|
12
|
-
import { openDatabase } from '../shared/safe-db.js';
|
|
13
|
-
// ============================================================================
|
|
14
|
-
// V2 Detection
|
|
15
|
-
// ============================================================================
|
|
16
|
-
/**
|
|
17
|
-
* Read AQE version directly from memory.db without full initialization.
|
|
18
|
-
* Returns undefined if no version is stored (v2 installations).
|
|
19
|
-
*/
|
|
20
|
-
export function readVersionFromDb(dbPath) {
|
|
21
|
-
try {
|
|
22
|
-
const db = openDatabase(dbPath, { readonly: true, fileMustExist: true });
|
|
23
|
-
try {
|
|
24
|
-
const tableExists = db.prepare(`
|
|
25
|
-
SELECT name FROM sqlite_master
|
|
26
|
-
WHERE type='table' AND name='kv_store'
|
|
27
|
-
`).get();
|
|
28
|
-
if (!tableExists) {
|
|
29
|
-
db.close();
|
|
30
|
-
return undefined;
|
|
31
|
-
}
|
|
32
|
-
const row = db.prepare(`
|
|
33
|
-
SELECT value FROM kv_store
|
|
34
|
-
WHERE key = 'aqe_version' AND namespace = '_system'
|
|
35
|
-
`).get();
|
|
36
|
-
db.close();
|
|
37
|
-
if (row) {
|
|
38
|
-
return safeJsonParse(row.value);
|
|
39
|
-
}
|
|
40
|
-
return undefined;
|
|
41
|
-
}
|
|
42
|
-
catch {
|
|
43
|
-
db.close();
|
|
44
|
-
return undefined;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
catch {
|
|
48
|
-
return undefined;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Write AQE version to memory.db in _system namespace.
|
|
53
|
-
* This marks the installation as v3.
|
|
54
|
-
*/
|
|
55
|
-
export async function writeVersionToDb(projectRoot, version) {
|
|
56
|
-
const memoryDbPath = join(projectRoot, '.agentic-qe', 'memory.db');
|
|
57
|
-
try {
|
|
58
|
-
const dir = dirname(memoryDbPath);
|
|
59
|
-
if (!existsSync(dir)) {
|
|
60
|
-
mkdirSync(dir, { recursive: true });
|
|
61
|
-
}
|
|
62
|
-
const db = openDatabase(memoryDbPath);
|
|
63
|
-
try {
|
|
64
|
-
db.exec(`
|
|
65
|
-
CREATE TABLE IF NOT EXISTS kv_store (
|
|
66
|
-
key TEXT NOT NULL,
|
|
67
|
-
namespace TEXT NOT NULL,
|
|
68
|
-
value TEXT NOT NULL,
|
|
69
|
-
expires_at INTEGER,
|
|
70
|
-
created_at INTEGER DEFAULT (strftime('%s', 'now') * 1000),
|
|
71
|
-
PRIMARY KEY (namespace, key)
|
|
72
|
-
);
|
|
73
|
-
`);
|
|
74
|
-
const now = Date.now();
|
|
75
|
-
db.prepare(`
|
|
76
|
-
INSERT OR REPLACE INTO kv_store (key, namespace, value, created_at)
|
|
77
|
-
VALUES (?, '_system', ?, ?)
|
|
78
|
-
`).run('aqe_version', JSON.stringify(version), now);
|
|
79
|
-
db.prepare(`
|
|
80
|
-
INSERT OR REPLACE INTO kv_store (key, namespace, value, created_at)
|
|
81
|
-
VALUES (?, '_system', ?, ?)
|
|
82
|
-
`).run('init_timestamp', JSON.stringify(new Date().toISOString()), now);
|
|
83
|
-
db.close();
|
|
84
|
-
console.log(` ✓ Version ${version} written to memory.db`);
|
|
85
|
-
return true;
|
|
86
|
-
}
|
|
87
|
-
catch (err) {
|
|
88
|
-
db.close();
|
|
89
|
-
console.warn(` ⚠ Could not write version: ${toErrorMessage(err)}`);
|
|
90
|
-
return false;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
catch (err) {
|
|
94
|
-
console.warn(` ⚠ Could not open memory.db: ${toErrorMessage(err)}`);
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Detect existing v2 AQE installation.
|
|
100
|
-
*
|
|
101
|
-
* Detection logic:
|
|
102
|
-
* 1. If memory.db exists, try to read aqe_version from kv_store._system
|
|
103
|
-
* 2. If version exists and starts with '3.', it's v3 - not detected
|
|
104
|
-
* 3. If no version or version < 3.0.0, and v2 markers exist, it's v2
|
|
105
|
-
*/
|
|
106
|
-
export async function detectV2Installation(projectRoot) {
|
|
107
|
-
const memoryDbPath = join(projectRoot, '.agentic-qe', 'memory.db');
|
|
108
|
-
const configPath = join(projectRoot, '.agentic-qe', 'config');
|
|
109
|
-
const agentsPath = join(projectRoot, '.claude', 'agents');
|
|
110
|
-
const v2ConfigFile = join(projectRoot, '.agentic-qe', 'config', 'learning.json');
|
|
111
|
-
const hasMemoryDb = existsSync(memoryDbPath);
|
|
112
|
-
const hasConfig = existsSync(configPath);
|
|
113
|
-
const hasAgents = existsSync(agentsPath);
|
|
114
|
-
const hasV2ConfigFiles = existsSync(v2ConfigFile);
|
|
115
|
-
const hasV3ConfigYaml = existsSync(join(projectRoot, '.agentic-qe', 'config.yaml'));
|
|
116
|
-
let version;
|
|
117
|
-
let isV3Installation = false;
|
|
118
|
-
if (hasMemoryDb) {
|
|
119
|
-
version = readVersionFromDb(memoryDbPath);
|
|
120
|
-
if (version) {
|
|
121
|
-
isV3Installation = version.startsWith('3.');
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
version = '2.x.x';
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
const detected = !isV3Installation && hasMemoryDb && (!version?.startsWith('3.') ||
|
|
128
|
-
(hasV2ConfigFiles && !hasV3ConfigYaml));
|
|
129
|
-
return {
|
|
130
|
-
detected,
|
|
131
|
-
memoryDbPath: hasMemoryDb ? memoryDbPath : undefined,
|
|
132
|
-
configPath: hasConfig ? configPath : undefined,
|
|
133
|
-
agentsPath: hasAgents ? agentsPath : undefined,
|
|
134
|
-
hasMemoryDb,
|
|
135
|
-
hasConfig,
|
|
136
|
-
hasAgents,
|
|
137
|
-
version,
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
// ============================================================================
|
|
141
|
-
// V2 Migration
|
|
142
|
-
// ============================================================================
|
|
143
|
-
/**
|
|
144
|
-
* Run v2 to v3 migration during init (when --auto-migrate is used).
|
|
145
|
-
*/
|
|
146
|
-
export async function runV2Migration(projectRoot, v2Detection) {
|
|
147
|
-
try {
|
|
148
|
-
const { V2ToV3Migrator } = await import('../learning/v2-to-v3-migration.js');
|
|
149
|
-
if (v2Detection.memoryDbPath) {
|
|
150
|
-
console.log(' Migrating V2 data to V3 format...');
|
|
151
|
-
const v3PatternsDbPath = join(projectRoot, '.agentic-qe', 'memory.db');
|
|
152
|
-
const migrator = new V2ToV3Migrator({
|
|
153
|
-
v2DbPath: v2Detection.memoryDbPath,
|
|
154
|
-
v3PatternsDbPath,
|
|
155
|
-
onProgress: (progress) => {
|
|
156
|
-
console.log(` ${progress.stage}: ${progress.message}`);
|
|
157
|
-
},
|
|
158
|
-
});
|
|
159
|
-
const result = await migrator.migrate();
|
|
160
|
-
if (result.success) {
|
|
161
|
-
console.log(` ✓ Migrated ${result.tablesMigrated.length} tables:`);
|
|
162
|
-
for (const [table, count] of Object.entries(result.counts)) {
|
|
163
|
-
console.log(` - ${table}: ${count} entries`);
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
else {
|
|
167
|
-
console.warn(` ⚠ Migration completed with errors: ${result.errors.join(', ')}`);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
await migrateV2Config(projectRoot, v2Detection);
|
|
171
|
-
await removeV2QEAgents(projectRoot);
|
|
172
|
-
console.log(' Writing v3 version marker...');
|
|
173
|
-
await writeVersionToDb(projectRoot, '3.0.0-migrated');
|
|
174
|
-
console.log('✓ V2 to V3 migration completed\n');
|
|
175
|
-
}
|
|
176
|
-
catch (error) {
|
|
177
|
-
console.warn(`⚠ Migration warning: ${toErrorMessage(error)}`);
|
|
178
|
-
console.log(' Continuing with init (v2 data preserved)...\n');
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Remove v2 QE agents from .claude/agents/ root folder.
|
|
183
|
-
* V2 QE agents are replaced by current agents in .claude/agents/v3/.
|
|
184
|
-
*/
|
|
185
|
-
export async function removeV2QEAgents(projectRoot) {
|
|
186
|
-
const agentsDir = join(projectRoot, '.claude', 'agents');
|
|
187
|
-
if (!existsSync(agentsDir)) {
|
|
188
|
-
return;
|
|
189
|
-
}
|
|
190
|
-
const V2_LEGACY_AGENTS = [
|
|
191
|
-
'qx-partner.md',
|
|
192
|
-
'base-template-generator.md',
|
|
193
|
-
];
|
|
194
|
-
try {
|
|
195
|
-
const entries = readdirSync(agentsDir);
|
|
196
|
-
const v2QEAgents = [];
|
|
197
|
-
for (const entry of entries) {
|
|
198
|
-
if (entry.startsWith('qe-') && entry.endsWith('.md')) {
|
|
199
|
-
const fullPath = join(agentsDir, entry);
|
|
200
|
-
const stat = statSync(fullPath);
|
|
201
|
-
if (stat.isFile()) {
|
|
202
|
-
v2QEAgents.push(entry);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
else if (V2_LEGACY_AGENTS.includes(entry)) {
|
|
206
|
-
const fullPath = join(agentsDir, entry);
|
|
207
|
-
const stat = statSync(fullPath);
|
|
208
|
-
if (stat.isFile()) {
|
|
209
|
-
v2QEAgents.push(entry);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
if (v2QEAgents.length === 0) {
|
|
214
|
-
return;
|
|
215
|
-
}
|
|
216
|
-
console.log(` Removing ${v2QEAgents.length} v2 QE agents from .claude/agents/...`);
|
|
217
|
-
const backupDir = join(projectRoot, '.agentic-qe', 'backup', 'v2-agents');
|
|
218
|
-
if (!existsSync(backupDir)) {
|
|
219
|
-
mkdirSync(backupDir, { recursive: true });
|
|
220
|
-
}
|
|
221
|
-
for (const agent of v2QEAgents) {
|
|
222
|
-
const sourcePath = join(agentsDir, agent);
|
|
223
|
-
const backupPath = join(backupDir, agent);
|
|
224
|
-
try {
|
|
225
|
-
copyFileSync(sourcePath, backupPath);
|
|
226
|
-
unlinkSync(sourcePath);
|
|
227
|
-
}
|
|
228
|
-
catch (err) {
|
|
229
|
-
console.warn(` ⚠ Could not remove ${agent}: ${toErrorMessage(err)}`);
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
console.log(` ✓ Moved ${v2QEAgents.length} v2 agents to .agentic-qe/backup/v2-agents/`);
|
|
233
|
-
console.log(' Agents will be installed to .claude/agents/v3/');
|
|
234
|
-
}
|
|
235
|
-
catch (error) {
|
|
236
|
-
console.warn(` ⚠ Could not remove v2 agents: ${toErrorMessage(error)}`);
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
/**
|
|
240
|
-
* Migrate v2 config files to v3 format.
|
|
241
|
-
*/
|
|
242
|
-
export async function migrateV2Config(projectRoot, v2Detection) {
|
|
243
|
-
if (!v2Detection.hasConfig)
|
|
244
|
-
return;
|
|
245
|
-
const v2ConfigDir = join(projectRoot, '.agentic-qe', 'config');
|
|
246
|
-
const v3ConfigPath = join(projectRoot, '.agentic-qe', 'config.yaml');
|
|
247
|
-
if (existsSync(v3ConfigPath)) {
|
|
248
|
-
console.log(' ✓ V3 config already exists, preserving...');
|
|
249
|
-
return;
|
|
250
|
-
}
|
|
251
|
-
try {
|
|
252
|
-
const learningConfig = readJsonSafe(join(v2ConfigDir, 'learning.json'));
|
|
253
|
-
const improvementConfig = readJsonSafe(join(v2ConfigDir, 'improvement.json'));
|
|
254
|
-
const codeIntelConfig = readJsonSafe(join(v2ConfigDir, 'code-intelligence.json'));
|
|
255
|
-
const v3Config = {
|
|
256
|
-
version: getAQEVersion(),
|
|
257
|
-
migratedFrom: v2Detection.version || '2.x.x',
|
|
258
|
-
migratedAt: new Date().toISOString(),
|
|
259
|
-
project: {
|
|
260
|
-
name: 'migrated-project',
|
|
261
|
-
root: projectRoot,
|
|
262
|
-
type: 'unknown',
|
|
263
|
-
},
|
|
264
|
-
learning: {
|
|
265
|
-
enabled: learningConfig?.enabled ?? true,
|
|
266
|
-
embeddingModel: 'transformer',
|
|
267
|
-
hnswConfig: { M: 8, efConstruction: 100, efSearch: 50 },
|
|
268
|
-
qualityThreshold: learningConfig?.qualityThreshold ?? 0.5,
|
|
269
|
-
promotionThreshold: 2,
|
|
270
|
-
pretrainedPatterns: true,
|
|
271
|
-
v2Settings: learningConfig,
|
|
272
|
-
},
|
|
273
|
-
routing: {
|
|
274
|
-
mode: 'ml',
|
|
275
|
-
confidenceThreshold: 0.7,
|
|
276
|
-
feedbackEnabled: true,
|
|
277
|
-
},
|
|
278
|
-
workers: {
|
|
279
|
-
enabled: ['pattern-consolidator'],
|
|
280
|
-
intervals: {
|
|
281
|
-
'pattern-consolidator': 1800000,
|
|
282
|
-
'coverage-gap-scanner': 3600000,
|
|
283
|
-
'flaky-test-detector': 7200000,
|
|
284
|
-
},
|
|
285
|
-
maxConcurrent: 2,
|
|
286
|
-
daemonAutoStart: true,
|
|
287
|
-
},
|
|
288
|
-
hooks: {
|
|
289
|
-
claudeCode: true,
|
|
290
|
-
preCommit: false,
|
|
291
|
-
ciIntegration: codeIntelConfig?.ciIntegration ?? false,
|
|
292
|
-
},
|
|
293
|
-
skills: {
|
|
294
|
-
install: true,
|
|
295
|
-
installV2: true,
|
|
296
|
-
installV3: true,
|
|
297
|
-
overwrite: false,
|
|
298
|
-
},
|
|
299
|
-
domains: {
|
|
300
|
-
enabled: [
|
|
301
|
-
'test-generation', 'test-execution', 'coverage-analysis',
|
|
302
|
-
'quality-assessment', 'defect-intelligence', 'requirements-validation',
|
|
303
|
-
'code-intelligence', 'security-compliance', 'contract-testing',
|
|
304
|
-
'visual-accessibility', 'chaos-resilience', 'learning-optimization',
|
|
305
|
-
],
|
|
306
|
-
disabled: [],
|
|
307
|
-
},
|
|
308
|
-
agents: {
|
|
309
|
-
maxConcurrent: 5,
|
|
310
|
-
defaultTimeout: 60000,
|
|
311
|
-
},
|
|
312
|
-
_v2Backup: {
|
|
313
|
-
learning: learningConfig,
|
|
314
|
-
improvement: improvementConfig,
|
|
315
|
-
codeIntelligence: codeIntelConfig,
|
|
316
|
-
},
|
|
317
|
-
};
|
|
318
|
-
const yaml = await import('yaml');
|
|
319
|
-
const yamlContent = `# Agentic QE v3 Configuration
|
|
320
|
-
# Migrated from v2 on ${new Date().toISOString()}
|
|
321
|
-
# Original v2 settings preserved in _v2Backup section
|
|
322
|
-
|
|
323
|
-
${yaml.stringify(v3Config)}`;
|
|
324
|
-
writeFileSync(v3ConfigPath, yamlContent, 'utf-8');
|
|
325
|
-
console.log(' ✓ V2 config migrated to v3 format');
|
|
326
|
-
}
|
|
327
|
-
catch (error) {
|
|
328
|
-
console.warn(` ⚠ Config migration warning: ${toErrorMessage(error)}`);
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
/**
|
|
332
|
-
* Safely read JSON file, returning null on error.
|
|
333
|
-
*/
|
|
334
|
-
function readJsonSafe(filePath) {
|
|
335
|
-
try {
|
|
336
|
-
if (!existsSync(filePath))
|
|
337
|
-
return null;
|
|
338
|
-
const content = readFileSync(filePath, 'utf-8');
|
|
339
|
-
return safeJsonParse(content);
|
|
340
|
-
}
|
|
341
|
-
catch {
|
|
342
|
-
return null;
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
//# sourceMappingURL=init-wizard-migration.js.map
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* V2 Config Migrator
|
|
3
|
-
* Migrates v2 config files to v3 YAML format
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* V2 Config Migrator
|
|
7
|
-
*/
|
|
8
|
-
export declare class V2ConfigMigrator {
|
|
9
|
-
private projectRoot;
|
|
10
|
-
constructor(projectRoot: string);
|
|
11
|
-
/**
|
|
12
|
-
* Migrate v2 config to v3 format
|
|
13
|
-
*/
|
|
14
|
-
migrate(): Promise<{
|
|
15
|
-
success: boolean;
|
|
16
|
-
configPath?: string;
|
|
17
|
-
}>;
|
|
18
|
-
/**
|
|
19
|
-
* Read JSON file safely
|
|
20
|
-
*/
|
|
21
|
-
private readJsonSafe;
|
|
22
|
-
/**
|
|
23
|
-
* Build v3 config from v2 configs
|
|
24
|
-
*/
|
|
25
|
-
private buildV3Config;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Create V2 config migrator
|
|
29
|
-
*/
|
|
30
|
-
export declare function createV2ConfigMigrator(projectRoot: string): V2ConfigMigrator;
|
|
31
|
-
//# sourceMappingURL=config-migrator.d.ts.map
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* V2 Config Migrator
|
|
3
|
-
* Migrates v2 config files to v3 YAML format
|
|
4
|
-
*/
|
|
5
|
-
import { existsSync, readFileSync, writeFileSync } from 'fs';
|
|
6
|
-
import { join } from 'path';
|
|
7
|
-
import { getAQEVersion } from '../types.js';
|
|
8
|
-
import { safeJsonParse } from '../../shared/safe-json.js';
|
|
9
|
-
/**
|
|
10
|
-
* V2 Config Migrator
|
|
11
|
-
*/
|
|
12
|
-
export class V2ConfigMigrator {
|
|
13
|
-
projectRoot;
|
|
14
|
-
constructor(projectRoot) {
|
|
15
|
-
this.projectRoot = projectRoot;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Migrate v2 config to v3 format
|
|
19
|
-
*/
|
|
20
|
-
async migrate() {
|
|
21
|
-
const v2ConfigDir = join(this.projectRoot, '.agentic-qe', 'config');
|
|
22
|
-
const v3ConfigPath = join(this.projectRoot, '.agentic-qe', 'config.yaml');
|
|
23
|
-
// Skip if v3 config exists
|
|
24
|
-
if (existsSync(v3ConfigPath)) {
|
|
25
|
-
return { success: true, configPath: v3ConfigPath };
|
|
26
|
-
}
|
|
27
|
-
// Skip if no v2 config
|
|
28
|
-
if (!existsSync(v2ConfigDir)) {
|
|
29
|
-
return { success: false };
|
|
30
|
-
}
|
|
31
|
-
try {
|
|
32
|
-
// Read v2 config files
|
|
33
|
-
const learningConfig = this.readJsonSafe(join(v2ConfigDir, 'learning.json'));
|
|
34
|
-
const improvementConfig = this.readJsonSafe(join(v2ConfigDir, 'improvement.json'));
|
|
35
|
-
const codeIntelConfig = this.readJsonSafe(join(v2ConfigDir, 'code-intelligence.json'));
|
|
36
|
-
// Build v3 config
|
|
37
|
-
const v3Config = this.buildV3Config(learningConfig, improvementConfig, codeIntelConfig);
|
|
38
|
-
// Write as YAML
|
|
39
|
-
const yaml = await import('yaml');
|
|
40
|
-
const yamlContent = `# Agentic QE v3 Configuration
|
|
41
|
-
# Migrated from v2 on ${new Date().toISOString()}
|
|
42
|
-
|
|
43
|
-
${yaml.stringify(v3Config)}`;
|
|
44
|
-
writeFileSync(v3ConfigPath, yamlContent, 'utf-8');
|
|
45
|
-
return { success: true, configPath: v3ConfigPath };
|
|
46
|
-
}
|
|
47
|
-
catch {
|
|
48
|
-
return { success: false };
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Read JSON file safely
|
|
53
|
-
*/
|
|
54
|
-
readJsonSafe(path) {
|
|
55
|
-
try {
|
|
56
|
-
if (!existsSync(path))
|
|
57
|
-
return null;
|
|
58
|
-
return safeJsonParse(readFileSync(path, 'utf-8'));
|
|
59
|
-
}
|
|
60
|
-
catch {
|
|
61
|
-
return null;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Build v3 config from v2 configs
|
|
66
|
-
*/
|
|
67
|
-
buildV3Config(learningConfig, improvementConfig, codeIntelConfig) {
|
|
68
|
-
return {
|
|
69
|
-
version: getAQEVersion(),
|
|
70
|
-
migratedFrom: '2.x.x',
|
|
71
|
-
migratedAt: new Date().toISOString(),
|
|
72
|
-
project: {
|
|
73
|
-
name: 'migrated-project',
|
|
74
|
-
root: this.projectRoot,
|
|
75
|
-
type: 'unknown',
|
|
76
|
-
},
|
|
77
|
-
learning: {
|
|
78
|
-
enabled: learningConfig?.enabled ?? true,
|
|
79
|
-
embeddingModel: 'transformer',
|
|
80
|
-
hnswConfig: {
|
|
81
|
-
M: 8,
|
|
82
|
-
efConstruction: 100,
|
|
83
|
-
efSearch: 50,
|
|
84
|
-
},
|
|
85
|
-
qualityThreshold: learningConfig?.qualityThreshold ?? 0.5,
|
|
86
|
-
promotionThreshold: 2,
|
|
87
|
-
pretrainedPatterns: true,
|
|
88
|
-
},
|
|
89
|
-
routing: {
|
|
90
|
-
mode: 'ml',
|
|
91
|
-
confidenceThreshold: 0.7,
|
|
92
|
-
feedbackEnabled: true,
|
|
93
|
-
},
|
|
94
|
-
workers: {
|
|
95
|
-
enabled: ['pattern-consolidator'],
|
|
96
|
-
intervals: {
|
|
97
|
-
'pattern-consolidator': 1800000,
|
|
98
|
-
},
|
|
99
|
-
maxConcurrent: 2,
|
|
100
|
-
daemonAutoStart: true,
|
|
101
|
-
},
|
|
102
|
-
hooks: {
|
|
103
|
-
claudeCode: true,
|
|
104
|
-
preCommit: false,
|
|
105
|
-
ciIntegration: codeIntelConfig?.ciIntegration ?? false,
|
|
106
|
-
},
|
|
107
|
-
skills: {
|
|
108
|
-
install: true,
|
|
109
|
-
installV2: true,
|
|
110
|
-
installV3: true,
|
|
111
|
-
overwrite: false,
|
|
112
|
-
},
|
|
113
|
-
domains: {
|
|
114
|
-
// Enable ALL domains - limiting causes "No factory registered" errors
|
|
115
|
-
enabled: [
|
|
116
|
-
'test-generation',
|
|
117
|
-
'test-execution',
|
|
118
|
-
'coverage-analysis',
|
|
119
|
-
'quality-assessment',
|
|
120
|
-
'defect-intelligence',
|
|
121
|
-
'requirements-validation',
|
|
122
|
-
'code-intelligence',
|
|
123
|
-
'security-compliance',
|
|
124
|
-
'contract-testing',
|
|
125
|
-
'visual-accessibility',
|
|
126
|
-
'chaos-resilience',
|
|
127
|
-
'learning-optimization',
|
|
128
|
-
],
|
|
129
|
-
disabled: [],
|
|
130
|
-
},
|
|
131
|
-
agents: {
|
|
132
|
-
maxConcurrent: 5,
|
|
133
|
-
defaultTimeout: 60000,
|
|
134
|
-
},
|
|
135
|
-
_v2Backup: {
|
|
136
|
-
learning: learningConfig,
|
|
137
|
-
improvement: improvementConfig,
|
|
138
|
-
codeIntelligence: codeIntelConfig,
|
|
139
|
-
},
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Create V2 config migrator
|
|
145
|
-
*/
|
|
146
|
-
export function createV2ConfigMigrator(projectRoot) {
|
|
147
|
-
return new V2ConfigMigrator(projectRoot);
|
|
148
|
-
}
|
|
149
|
-
//# sourceMappingURL=config-migrator.js.map
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* V2 Data Migrator
|
|
3
|
-
* Migrates patterns and experiences from v2 to v3 format
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Migration result
|
|
7
|
-
*/
|
|
8
|
-
export interface MigrationResult {
|
|
9
|
-
success: boolean;
|
|
10
|
-
backupPath?: string;
|
|
11
|
-
tablesMigrated: string[];
|
|
12
|
-
counts: Record<string, number>;
|
|
13
|
-
errors: string[];
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Migration progress callback
|
|
17
|
-
*/
|
|
18
|
-
export interface MigrationProgress {
|
|
19
|
-
stage: string;
|
|
20
|
-
message: string;
|
|
21
|
-
progress?: number;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* V2 Data Migrator
|
|
25
|
-
*/
|
|
26
|
-
export declare class V2DataMigrator {
|
|
27
|
-
private v2DbPath;
|
|
28
|
-
private v3PatternsDbPath;
|
|
29
|
-
private onProgress?;
|
|
30
|
-
constructor(options: {
|
|
31
|
-
v2DbPath: string;
|
|
32
|
-
v3PatternsDbPath: string;
|
|
33
|
-
onProgress?: (progress: MigrationProgress) => void;
|
|
34
|
-
});
|
|
35
|
-
/**
|
|
36
|
-
* Run migration
|
|
37
|
-
*/
|
|
38
|
-
migrate(): Promise<MigrationResult>;
|
|
39
|
-
/**
|
|
40
|
-
* Report progress
|
|
41
|
-
*/
|
|
42
|
-
private report;
|
|
43
|
-
/**
|
|
44
|
-
* Create backup of v2 database
|
|
45
|
-
*/
|
|
46
|
-
private createBackup;
|
|
47
|
-
/**
|
|
48
|
-
* Initialize v3 patterns database
|
|
49
|
-
*/
|
|
50
|
-
private initializeV3Database;
|
|
51
|
-
/**
|
|
52
|
-
* Migrate patterns from v2 kv_store
|
|
53
|
-
*/
|
|
54
|
-
private migratePatterns;
|
|
55
|
-
/**
|
|
56
|
-
* Migrate experiences from v2
|
|
57
|
-
*/
|
|
58
|
-
private migrateExperiences;
|
|
59
|
-
/**
|
|
60
|
-
* Migrate concept graph from v2
|
|
61
|
-
*/
|
|
62
|
-
private migrateConceptGraph;
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* Create V2 data migrator
|
|
66
|
-
*/
|
|
67
|
-
export declare function createV2DataMigrator(options: {
|
|
68
|
-
v2DbPath: string;
|
|
69
|
-
v3PatternsDbPath: string;
|
|
70
|
-
onProgress?: (progress: MigrationProgress) => void;
|
|
71
|
-
}): V2DataMigrator;
|
|
72
|
-
//# sourceMappingURL=data-migrator.d.ts.map
|