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
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic QE v3 - Audit Command
|
|
3
|
+
*
|
|
4
|
+
* Verifies the witness chain audit trail integrity.
|
|
5
|
+
* Shows chain length, integrity status, and last receipt hash.
|
|
6
|
+
*
|
|
7
|
+
* Usage: aqe audit verify [--format json|text]
|
|
8
|
+
*
|
|
9
|
+
* @module cli/commands/audit
|
|
10
|
+
* @see ADR-083-coherence-gated-agent-actions.md
|
|
11
|
+
*/
|
|
12
|
+
import { Command } from 'commander';
|
|
13
|
+
import { type ChainVerificationResult } from '../../governance/witness-chain.js';
|
|
14
|
+
import type { CLIContext } from '../handlers/interfaces.js';
|
|
15
|
+
/**
|
|
16
|
+
* Verification output for JSON format.
|
|
17
|
+
*/
|
|
18
|
+
export interface AuditVerifyOutput {
|
|
19
|
+
featureEnabled: boolean;
|
|
20
|
+
chainLength: number;
|
|
21
|
+
integrity: boolean;
|
|
22
|
+
brokenAt: number;
|
|
23
|
+
lastHash: string;
|
|
24
|
+
message: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Format verification result as human-readable text.
|
|
28
|
+
*/
|
|
29
|
+
export declare function formatVerificationText(result: ChainVerificationResult, featureEnabled: boolean): string;
|
|
30
|
+
/**
|
|
31
|
+
* Handle the audit verify command.
|
|
32
|
+
*
|
|
33
|
+
* Loads the witness chain from SQLite if available, otherwise creates
|
|
34
|
+
* a fresh in-memory chain.
|
|
35
|
+
*/
|
|
36
|
+
export declare function handleAuditVerify(options: {
|
|
37
|
+
format?: 'json' | 'text';
|
|
38
|
+
}): Promise<AuditVerifyOutput>;
|
|
39
|
+
/**
|
|
40
|
+
* Create the audit command group following the project convention.
|
|
41
|
+
*/
|
|
42
|
+
export declare function createAuditCommand(_context: CLIContext, cleanupAndExit: (code: number) => Promise<never>, _ensureInitialized: () => Promise<boolean>): Command;
|
|
43
|
+
//# sourceMappingURL=audit.d.ts.map
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic QE v3 - Audit Command
|
|
3
|
+
*
|
|
4
|
+
* Verifies the witness chain audit trail integrity.
|
|
5
|
+
* Shows chain length, integrity status, and last receipt hash.
|
|
6
|
+
*
|
|
7
|
+
* Usage: aqe audit verify [--format json|text]
|
|
8
|
+
*
|
|
9
|
+
* @module cli/commands/audit
|
|
10
|
+
* @see ADR-083-coherence-gated-agent-actions.md
|
|
11
|
+
*/
|
|
12
|
+
import { Command } from 'commander';
|
|
13
|
+
import chalk from 'chalk';
|
|
14
|
+
import { createWitnessChain, createPersistentWitnessChain, createWitnessChainSQLitePersistence, isWitnessChainFeatureEnabled, } from '../../governance/witness-chain.js';
|
|
15
|
+
import { findProjectRoot } from '../../kernel/unified-memory.js';
|
|
16
|
+
import { existsSync } from 'node:fs';
|
|
17
|
+
import path from 'node:path';
|
|
18
|
+
/**
|
|
19
|
+
* Format verification result as human-readable text.
|
|
20
|
+
*/
|
|
21
|
+
export function formatVerificationText(result, featureEnabled) {
|
|
22
|
+
const lines = [];
|
|
23
|
+
lines.push(chalk.bold('Witness Chain Audit Verification'));
|
|
24
|
+
lines.push('');
|
|
25
|
+
// Feature flag status
|
|
26
|
+
const flagStatus = featureEnabled
|
|
27
|
+
? chalk.green('ENABLED')
|
|
28
|
+
: chalk.yellow('DISABLED');
|
|
29
|
+
lines.push(` Feature Flag: ${flagStatus}`);
|
|
30
|
+
// Chain length
|
|
31
|
+
lines.push(` Chain Length: ${result.length} receipts`);
|
|
32
|
+
// Integrity status
|
|
33
|
+
const integrityStatus = result.valid
|
|
34
|
+
? chalk.green('VALID')
|
|
35
|
+
: chalk.red('BROKEN');
|
|
36
|
+
lines.push(` Integrity: ${integrityStatus}`);
|
|
37
|
+
// Last hash
|
|
38
|
+
if (result.length > 0) {
|
|
39
|
+
lines.push(` Last Hash: ${result.lastHash.slice(0, 16)}...`);
|
|
40
|
+
}
|
|
41
|
+
// Details
|
|
42
|
+
if (!result.valid && result.brokenAt >= 0) {
|
|
43
|
+
lines.push('');
|
|
44
|
+
lines.push(chalk.red(` Break detected at index ${result.brokenAt}`));
|
|
45
|
+
lines.push(chalk.red(` ${result.message}`));
|
|
46
|
+
}
|
|
47
|
+
lines.push('');
|
|
48
|
+
return lines.join('\n');
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Try to load a SQLite-backed witness chain from the project's unified database.
|
|
52
|
+
* Returns null if the database is unavailable.
|
|
53
|
+
*/
|
|
54
|
+
function tryLoadPersistentChain() {
|
|
55
|
+
try {
|
|
56
|
+
const root = findProjectRoot();
|
|
57
|
+
const dbPath = path.join(root, '.agentic-qe', 'memory.db');
|
|
58
|
+
if (!existsSync(dbPath))
|
|
59
|
+
return null;
|
|
60
|
+
// Dynamic import to avoid hard dependency on better-sqlite3 at CLI load time
|
|
61
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
62
|
+
const Database = require('better-sqlite3');
|
|
63
|
+
const db = new Database(dbPath);
|
|
64
|
+
const persistence = createWitnessChainSQLitePersistence(db);
|
|
65
|
+
const chain = createPersistentWitnessChain(persistence);
|
|
66
|
+
// Close the DB handle; chain data is now loaded into memory
|
|
67
|
+
db.close();
|
|
68
|
+
return chain;
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Handle the audit verify command.
|
|
76
|
+
*
|
|
77
|
+
* Loads the witness chain from SQLite if available, otherwise creates
|
|
78
|
+
* a fresh in-memory chain.
|
|
79
|
+
*/
|
|
80
|
+
export async function handleAuditVerify(options) {
|
|
81
|
+
const featureEnabled = isWitnessChainFeatureEnabled();
|
|
82
|
+
// Load persisted chain from SQLite if available, else in-memory
|
|
83
|
+
const chain = tryLoadPersistentChain() ?? createWitnessChain();
|
|
84
|
+
const result = chain.verifyChain();
|
|
85
|
+
const output = {
|
|
86
|
+
featureEnabled,
|
|
87
|
+
chainLength: result.length,
|
|
88
|
+
integrity: result.valid,
|
|
89
|
+
brokenAt: result.brokenAt,
|
|
90
|
+
lastHash: result.lastHash,
|
|
91
|
+
message: result.message,
|
|
92
|
+
};
|
|
93
|
+
if (options.format === 'json') {
|
|
94
|
+
console.log(JSON.stringify(output, null, 2));
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
console.log(formatVerificationText(result, featureEnabled));
|
|
98
|
+
}
|
|
99
|
+
return output;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Create the audit command group following the project convention.
|
|
103
|
+
*/
|
|
104
|
+
export function createAuditCommand(_context, cleanupAndExit, _ensureInitialized) {
|
|
105
|
+
const audit = new Command('audit')
|
|
106
|
+
.description('Witness chain audit trail management');
|
|
107
|
+
audit
|
|
108
|
+
.command('verify')
|
|
109
|
+
.description('Verify witness chain integrity')
|
|
110
|
+
.option('-F, --format <format>', 'Output format (json|text)', 'text')
|
|
111
|
+
.action(async (options) => {
|
|
112
|
+
try {
|
|
113
|
+
await handleAuditVerify({
|
|
114
|
+
format: options.format,
|
|
115
|
+
});
|
|
116
|
+
await cleanupAndExit(0);
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
console.error('Failed to verify witness chain:', error);
|
|
120
|
+
await cleanupAndExit(1);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
return audit;
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=audit.js.map
|
|
@@ -358,7 +358,24 @@ async function consolidateExperiencesToPatterns() {
|
|
|
358
358
|
await um.initialize();
|
|
359
359
|
}
|
|
360
360
|
const db = um.getDatabase();
|
|
361
|
-
//
|
|
361
|
+
// Ensure consolidation columns exist (may be missing on older DBs)
|
|
362
|
+
const existingCols = new Set(db.prepare('PRAGMA table_info(captured_experiences)').all().map(c => c.name));
|
|
363
|
+
const migrations = [
|
|
364
|
+
['consolidated_into', 'TEXT DEFAULT NULL'],
|
|
365
|
+
['consolidation_count', 'INTEGER DEFAULT 1'],
|
|
366
|
+
['quality_updated_at', 'TEXT DEFAULT NULL'],
|
|
367
|
+
['reuse_success_count', 'INTEGER DEFAULT 0'],
|
|
368
|
+
['reuse_failure_count', 'INTEGER DEFAULT 0'],
|
|
369
|
+
];
|
|
370
|
+
for (const [col, def] of migrations) {
|
|
371
|
+
if (!existingCols.has(col)) {
|
|
372
|
+
db.exec(`ALTER TABLE captured_experiences ADD COLUMN ${col} ${def}`);
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
// Aggregate unprocessed experiences by domain+agent with quality thresholds.
|
|
376
|
+
// Exclude 'cli-hook' agent — these are low-quality hook telemetry events
|
|
377
|
+
// (quality ~0.40, success_rate ~0.24) that flood the pipeline and block
|
|
378
|
+
// real pattern creation. See issue #348.
|
|
362
379
|
const aggregates = db.prepare(`
|
|
363
380
|
SELECT
|
|
364
381
|
domain,
|
|
@@ -371,6 +388,7 @@ async function consolidateExperiencesToPatterns() {
|
|
|
371
388
|
GROUP_CONCAT(DISTINCT source) as sources
|
|
372
389
|
FROM captured_experiences
|
|
373
390
|
WHERE application_count = 0
|
|
391
|
+
AND agent != 'cli-hook'
|
|
374
392
|
GROUP BY domain, agent
|
|
375
393
|
HAVING cnt >= 3 AND avg_quality >= 0.5 AND success_rate >= 0.6
|
|
376
394
|
ORDER BY avg_quality DESC
|
|
@@ -382,20 +400,25 @@ async function consolidateExperiencesToPatterns() {
|
|
|
382
400
|
let created = 0;
|
|
383
401
|
for (const agg of aggregates) {
|
|
384
402
|
try {
|
|
385
|
-
//
|
|
403
|
+
// Use date-bucketed names so new patterns emerge as usage evolves,
|
|
404
|
+
// instead of silently reinforcing one static pattern forever.
|
|
405
|
+
const dateBucket = new Date().toISOString().slice(0, 7); // YYYY-MM
|
|
406
|
+
const patternName = `${agg.agent}-${agg.domain}-${dateBucket}`;
|
|
407
|
+
// Check for existing pattern with same name this month
|
|
386
408
|
const existing = db.prepare(`
|
|
387
409
|
SELECT id FROM qe_patterns
|
|
388
410
|
WHERE qe_domain = ? AND name = ?
|
|
389
411
|
LIMIT 1
|
|
390
|
-
`).get(agg.domain,
|
|
412
|
+
`).get(agg.domain, patternName);
|
|
391
413
|
if (existing) {
|
|
392
|
-
// Reinforce existing pattern
|
|
414
|
+
// Reinforce existing monthly pattern
|
|
393
415
|
db.prepare(`
|
|
394
416
|
UPDATE qe_patterns
|
|
395
417
|
SET usage_count = usage_count + ?,
|
|
396
418
|
successful_uses = successful_uses + ?,
|
|
397
419
|
confidence = MIN(0.99, confidence + 0.01),
|
|
398
|
-
quality_score = MIN(0.99, quality_score + 0.005)
|
|
420
|
+
quality_score = MIN(0.99, quality_score + 0.005),
|
|
421
|
+
updated_at = datetime('now')
|
|
399
422
|
WHERE id = ?
|
|
400
423
|
`).run(agg.cnt, agg.successes, existing.id);
|
|
401
424
|
}
|
|
@@ -409,7 +432,7 @@ async function consolidateExperiencesToPatterns() {
|
|
|
409
432
|
confidence, usage_count, success_rate, quality_score, tier,
|
|
410
433
|
template_json, context_json, created_at, successful_uses
|
|
411
434
|
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, datetime('now'), ?)
|
|
412
|
-
`).run(patternId, 'workflow', agg.domain, agg.domain,
|
|
435
|
+
`).run(patternId, 'workflow', agg.domain, agg.domain, patternName, `Auto-consolidated from ${agg.cnt} experiences. Agent: ${agg.agent}, success rate: ${(agg.success_rate * 100).toFixed(0)}%`, confidence, agg.cnt, agg.success_rate, qualityScore, 'short-term', JSON.stringify({ type: 'workflow', content: `${agg.agent} pattern for ${agg.domain}`, variables: [] }), JSON.stringify({ tags: (agg.sources || '').split(','), sourceType: 'session-consolidation', extractedAt: new Date().toISOString() }), agg.successes);
|
|
413
436
|
created++;
|
|
414
437
|
}
|
|
415
438
|
// Mark experiences as processed
|
|
@@ -28,7 +28,6 @@ export function createInitCommand() {
|
|
|
28
28
|
.description('Initialize Agentic QE v3 in your project')
|
|
29
29
|
.option('-a, --auto', 'Auto-configure without prompts')
|
|
30
30
|
.option('-u, --upgrade', 'Upgrade existing installation (overwrites skills, agents, validation)')
|
|
31
|
-
.option('--auto-migrate', 'Automatically migrate from v2 if detected')
|
|
32
31
|
.option('--minimal', 'Minimal installation (no skills, patterns, or workers)')
|
|
33
32
|
.option('--skip-patterns', 'Skip pattern loading')
|
|
34
33
|
.option('--with-n8n', 'Include n8n workflow testing platform')
|
|
@@ -57,14 +56,6 @@ export function createInitCommand() {
|
|
|
57
56
|
.action(async () => {
|
|
58
57
|
await checkStatus();
|
|
59
58
|
});
|
|
60
|
-
initCmd
|
|
61
|
-
.command('migrate')
|
|
62
|
-
.description('Migrate from v2 to v3')
|
|
63
|
-
.option('--dry-run', 'Show what would be migrated without making changes')
|
|
64
|
-
.option('--force', 'Force migration even if v3 already exists')
|
|
65
|
-
.action(async (migrateOptions) => {
|
|
66
|
-
await runMigration(migrateOptions);
|
|
67
|
-
});
|
|
68
59
|
initCmd
|
|
69
60
|
.command('reset')
|
|
70
61
|
.description('Reset AQE configuration (keeps data)')
|
|
@@ -87,11 +78,10 @@ async function runInit(options) {
|
|
|
87
78
|
// Check if already initialized
|
|
88
79
|
const aqeDir = path.join(projectRoot, '.agentic-qe');
|
|
89
80
|
const isExisting = existsSync(aqeDir);
|
|
90
|
-
if (isExisting && !options.auto && !options.
|
|
81
|
+
if (isExisting && !options.auto && !options.upgrade) {
|
|
91
82
|
console.log(chalk.yellow(' ⚠ AQE directory already exists at:'), aqeDir);
|
|
92
83
|
console.log(chalk.gray(' Use --auto to update configuration (keeps existing skills)'));
|
|
93
84
|
console.log(chalk.gray(' Use --upgrade to update all skills, agents, and validation'));
|
|
94
|
-
console.log(chalk.gray(' Use --auto-migrate to migrate from v2'));
|
|
95
85
|
console.log('');
|
|
96
86
|
}
|
|
97
87
|
// Expand --with-all-platforms into individual flags
|
|
@@ -110,7 +100,6 @@ async function runInit(options) {
|
|
|
110
100
|
projectRoot,
|
|
111
101
|
autoMode: options.auto,
|
|
112
102
|
upgrade: options.upgrade,
|
|
113
|
-
autoMigrate: options.autoMigrate,
|
|
114
103
|
minimal: options.minimal,
|
|
115
104
|
skipPatterns: options.skipPatterns,
|
|
116
105
|
withN8n: options.withN8n,
|
|
@@ -223,67 +212,6 @@ async function checkStatus() {
|
|
|
223
212
|
}
|
|
224
213
|
console.log('');
|
|
225
214
|
}
|
|
226
|
-
/**
|
|
227
|
-
* Run v2 to v3 migration
|
|
228
|
-
*/
|
|
229
|
-
async function runMigration(options) {
|
|
230
|
-
const projectRoot = process.cwd();
|
|
231
|
-
const aqeDir = path.join(projectRoot, '.agentic-qe');
|
|
232
|
-
console.log('');
|
|
233
|
-
console.log(chalk.bold.blue(' AQE v2 to v3 Migration'));
|
|
234
|
-
console.log(chalk.gray(' ──────────────────────────'));
|
|
235
|
-
console.log('');
|
|
236
|
-
// Import migration modules
|
|
237
|
-
const { createV2Detector, createV2DataMigrator, createV2ConfigMigrator } = await import('../../init/migration/index.js');
|
|
238
|
-
// Detect v2
|
|
239
|
-
const detector = createV2Detector(projectRoot);
|
|
240
|
-
const v2Info = await detector.detect();
|
|
241
|
-
if (!v2Info.detected) {
|
|
242
|
-
console.log(chalk.yellow(' ⚠ No v2 installation detected'));
|
|
243
|
-
console.log(chalk.gray(' Run "aqe init" to create a new installation'));
|
|
244
|
-
console.log('');
|
|
245
|
-
return;
|
|
246
|
-
}
|
|
247
|
-
console.log(chalk.green(' ✓ Found v2 installation'));
|
|
248
|
-
console.log(chalk.gray(` Database: ${v2Info.paths.memoryDb || 'not found'}`));
|
|
249
|
-
console.log(chalk.gray(` Config: ${v2Info.paths.configDir || 'not found'}`));
|
|
250
|
-
console.log(chalk.gray(` Version: ${v2Info.version || 'unknown'}`));
|
|
251
|
-
console.log('');
|
|
252
|
-
if (options.dryRun) {
|
|
253
|
-
console.log(chalk.yellow(' Dry run - no changes will be made'));
|
|
254
|
-
console.log('');
|
|
255
|
-
return;
|
|
256
|
-
}
|
|
257
|
-
// Run migration
|
|
258
|
-
console.log(chalk.blue(' Migrating data...'));
|
|
259
|
-
if (v2Info.paths.memoryDb) {
|
|
260
|
-
const dataMigrator = createV2DataMigrator({
|
|
261
|
-
v2DbPath: v2Info.paths.memoryDb,
|
|
262
|
-
v3PatternsDbPath: path.join(aqeDir, 'patterns.db'),
|
|
263
|
-
onProgress: (p) => console.log(chalk.gray(` ${p.message}`)),
|
|
264
|
-
});
|
|
265
|
-
const dataResult = await dataMigrator.migrate();
|
|
266
|
-
if (dataResult.success) {
|
|
267
|
-
console.log(chalk.green(` ✓ Migrated ${dataResult.counts.patterns || 0} patterns`));
|
|
268
|
-
console.log(chalk.green(` ✓ Migrated ${dataResult.counts.experiences || 0} experiences`));
|
|
269
|
-
}
|
|
270
|
-
else {
|
|
271
|
-
console.log(chalk.red(` ✗ Data migration failed: ${dataResult.errors.join(', ')}`));
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
const configMigrator = createV2ConfigMigrator(projectRoot);
|
|
275
|
-
const configResult = await configMigrator.migrate();
|
|
276
|
-
if (configResult.success) {
|
|
277
|
-
console.log(chalk.green(' ✓ Config migrated'));
|
|
278
|
-
}
|
|
279
|
-
else {
|
|
280
|
-
console.log(chalk.yellow(' ⚠ Config migration skipped (no v2 config found)'));
|
|
281
|
-
}
|
|
282
|
-
console.log('');
|
|
283
|
-
console.log(chalk.green(' Migration complete!'));
|
|
284
|
-
console.log(chalk.gray(' Run "aqe init" to complete setup'));
|
|
285
|
-
console.log('');
|
|
286
|
-
}
|
|
287
215
|
/**
|
|
288
216
|
* Reset AQE configuration
|
|
289
217
|
*/
|