agentic-qe 3.8.10 → 3.8.12
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/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +40 -0
- package/dist/cli/bundle.js +1345 -1003
- package/dist/cli/command-registry.js +5 -1
- package/dist/cli/commands/pipeline.d.ts +16 -0
- package/dist/cli/commands/pipeline.js +314 -0
- package/dist/cli/commands/ruvector-commands.js +17 -0
- package/dist/cli/commands/token-usage.js +24 -1
- package/dist/cli/handlers/heartbeat-handler.d.ts +26 -0
- package/dist/cli/handlers/heartbeat-handler.js +382 -0
- package/dist/cli/handlers/index.d.ts +2 -0
- package/dist/cli/handlers/index.js +2 -0
- package/dist/cli/handlers/routing-handler.d.ts +22 -0
- package/dist/cli/handlers/routing-handler.js +227 -0
- package/dist/cli/index.js +2 -0
- package/dist/coordination/deterministic-actions.d.ts +36 -0
- package/dist/coordination/deterministic-actions.js +257 -0
- package/dist/coordination/workflow-orchestrator.d.ts +18 -1
- package/dist/coordination/workflow-orchestrator.js +113 -3
- package/dist/coordination/workflow-types.d.ts +19 -1
- package/dist/coordination/workflow-types.js +3 -0
- package/dist/coordination/yaml-pipeline-loader.d.ts +1 -0
- package/dist/coordination/yaml-pipeline-loader.js +34 -0
- package/dist/domains/code-intelligence/coordinator-gnn.d.ts +21 -0
- package/dist/domains/code-intelligence/coordinator-gnn.js +102 -0
- package/dist/domains/contract-testing/coordinator.js +13 -0
- package/dist/domains/coverage-analysis/coordinator.js +5 -0
- package/dist/domains/defect-intelligence/coordinator.d.ts +1 -0
- package/dist/domains/defect-intelligence/coordinator.js +43 -0
- package/dist/domains/quality-assessment/coordinator.js +26 -0
- package/dist/domains/test-generation/coordinator.js +14 -0
- package/dist/integrations/agentic-flow/reasoning-bank/experience-replay.d.ts +11 -0
- package/dist/integrations/agentic-flow/reasoning-bank/experience-replay.js +44 -1
- package/dist/integrations/rl-suite/algorithms/eprop.d.ts +79 -0
- package/dist/integrations/rl-suite/algorithms/eprop.js +284 -0
- package/dist/integrations/rl-suite/algorithms/index.d.ts +2 -1
- package/dist/integrations/rl-suite/algorithms/index.js +2 -1
- package/dist/integrations/rl-suite/index.d.ts +2 -2
- package/dist/integrations/rl-suite/index.js +2 -2
- package/dist/integrations/rl-suite/interfaces.d.ts +3 -3
- package/dist/integrations/rl-suite/interfaces.js +1 -1
- package/dist/integrations/rl-suite/orchestrator.d.ts +2 -2
- package/dist/integrations/rl-suite/orchestrator.js +3 -2
- package/dist/integrations/rl-suite/reward-signals.d.ts +1 -1
- package/dist/integrations/rl-suite/reward-signals.js +1 -1
- package/dist/integrations/ruvector/coherence-gate-cohomology.d.ts +41 -0
- package/dist/integrations/ruvector/coherence-gate-cohomology.js +47 -0
- package/dist/integrations/ruvector/coherence-gate-core.d.ts +200 -0
- package/dist/integrations/ruvector/coherence-gate-core.js +294 -0
- package/dist/integrations/ruvector/coherence-gate-energy.d.ts +136 -0
- package/dist/integrations/ruvector/coherence-gate-energy.js +373 -0
- package/dist/integrations/ruvector/coherence-gate-vector.d.ts +38 -0
- package/dist/integrations/ruvector/coherence-gate-vector.js +76 -0
- package/dist/integrations/ruvector/coherence-gate.d.ts +10 -311
- package/dist/integrations/ruvector/coherence-gate.js +10 -652
- package/dist/integrations/ruvector/cold-tier-trainer.d.ts +103 -0
- package/dist/integrations/ruvector/cold-tier-trainer.js +377 -0
- package/dist/integrations/ruvector/cusum-detector.d.ts +70 -0
- package/dist/integrations/ruvector/cusum-detector.js +142 -0
- package/dist/integrations/ruvector/delta-tracker.d.ts +122 -0
- package/dist/integrations/ruvector/delta-tracker.js +311 -0
- package/dist/integrations/ruvector/domain-transfer.d.ts +79 -1
- package/dist/integrations/ruvector/domain-transfer.js +158 -2
- package/dist/integrations/ruvector/eprop-learner.d.ts +135 -0
- package/dist/integrations/ruvector/eprop-learner.js +351 -0
- package/dist/integrations/ruvector/feature-flags.d.ts +177 -0
- package/dist/integrations/ruvector/feature-flags.js +145 -0
- package/dist/integrations/ruvector/graphmae-encoder.d.ts +88 -0
- package/dist/integrations/ruvector/graphmae-encoder.js +360 -0
- package/dist/integrations/ruvector/hdc-fingerprint.d.ts +127 -0
- package/dist/integrations/ruvector/hdc-fingerprint.js +222 -0
- package/dist/integrations/ruvector/hopfield-memory.d.ts +97 -0
- package/dist/integrations/ruvector/hopfield-memory.js +238 -0
- package/dist/integrations/ruvector/index.d.ts +13 -2
- package/dist/integrations/ruvector/index.js +46 -2
- package/dist/integrations/ruvector/mincut-wrapper.d.ts +7 -0
- package/dist/integrations/ruvector/mincut-wrapper.js +54 -2
- package/dist/integrations/ruvector/reservoir-replay.d.ts +172 -0
- package/dist/integrations/ruvector/reservoir-replay.js +335 -0
- package/dist/integrations/ruvector/solver-adapter.d.ts +93 -0
- package/dist/integrations/ruvector/solver-adapter.js +299 -0
- package/dist/integrations/ruvector/sona-persistence.d.ts +33 -0
- package/dist/integrations/ruvector/sona-persistence.js +47 -0
- package/dist/integrations/ruvector/spectral-sparsifier.d.ts +154 -0
- package/dist/integrations/ruvector/spectral-sparsifier.js +389 -0
- package/dist/integrations/ruvector/temporal-causality.d.ts +63 -0
- package/dist/integrations/ruvector/temporal-causality.js +317 -0
- package/dist/learning/pattern-promotion.d.ts +63 -0
- package/dist/learning/pattern-promotion.js +235 -1
- package/dist/learning/pattern-store.d.ts +2 -0
- package/dist/learning/pattern-store.js +187 -1
- package/dist/learning/sqlite-persistence.d.ts +2 -0
- package/dist/learning/sqlite-persistence.js +4 -0
- package/dist/mcp/bundle.js +477 -380
- package/dist/mcp/handlers/heartbeat-handlers.d.ts +67 -0
- package/dist/mcp/handlers/heartbeat-handlers.js +180 -0
- package/dist/mcp/handlers/index.d.ts +2 -1
- package/dist/mcp/handlers/index.js +5 -1
- package/dist/mcp/handlers/task-handlers.d.ts +28 -0
- package/dist/mcp/handlers/task-handlers.js +39 -0
- package/dist/mcp/protocol-server.js +45 -1
- package/dist/mcp/server.js +41 -1
- package/dist/optimization/index.d.ts +2 -0
- package/dist/optimization/index.js +1 -0
- package/dist/optimization/session-cache.d.ts +80 -0
- package/dist/optimization/session-cache.js +227 -0
- package/dist/optimization/token-optimizer-service.d.ts +10 -0
- package/dist/optimization/token-optimizer-service.js +51 -0
- package/dist/routing/economic-routing.d.ts +126 -0
- package/dist/routing/economic-routing.js +290 -0
- package/dist/routing/index.d.ts +2 -0
- package/dist/routing/index.js +2 -0
- package/dist/routing/routing-feedback.d.ts +29 -0
- package/dist/routing/routing-feedback.js +75 -0
- package/dist/shared/utils/index.d.ts +1 -0
- package/dist/shared/utils/index.js +1 -0
- package/dist/shared/utils/xorshift128.d.ts +24 -0
- package/dist/shared/utils/xorshift128.js +50 -0
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Central registry for all CLI command handlers.
|
|
5
5
|
* Provides command routing and management.
|
|
6
6
|
*/
|
|
7
|
-
import { createInitHandler, createStatusHandler, createHealthHandler, createTaskHandler, createAgentHandler, createDomainHandler, createProtocolHandler, createBrainHandler, createHypergraphHandler, } from './handlers/index.js';
|
|
7
|
+
import { createInitHandler, createStatusHandler, createHealthHandler, createTaskHandler, createAgentHandler, createDomainHandler, createProtocolHandler, createBrainHandler, createHypergraphHandler, createHeartbeatHandler, createRoutingHandler, } from './handlers/index.js';
|
|
8
8
|
// ============================================================================
|
|
9
9
|
// Command Registry
|
|
10
10
|
// ============================================================================
|
|
@@ -82,6 +82,10 @@ export class CommandRegistry {
|
|
|
82
82
|
this.register(createBrainHandler(this.cleanupAndExit, this.ensureInitialized));
|
|
83
83
|
// Hypergraph queries
|
|
84
84
|
this.register(createHypergraphHandler(this.cleanupAndExit, this.ensureInitialized));
|
|
85
|
+
// Heartbeat scheduler (Imp-10)
|
|
86
|
+
this.register(createHeartbeatHandler(this.cleanupAndExit));
|
|
87
|
+
// Routing economics & accuracy (Imp-18)
|
|
88
|
+
this.register(createRoutingHandler(this.cleanupAndExit));
|
|
85
89
|
}
|
|
86
90
|
/**
|
|
87
91
|
* Get help for all commands
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic QE v3 - Pipeline Command (Imp-9)
|
|
3
|
+
*
|
|
4
|
+
* CLI commands for YAML deterministic pipeline management:
|
|
5
|
+
* aqe pipeline load <file.yaml> [--vars key=value]
|
|
6
|
+
* aqe pipeline validate <file.yaml>
|
|
7
|
+
* aqe pipeline run <pipeline-id> [--input key=value] [--wait]
|
|
8
|
+
* aqe pipeline list
|
|
9
|
+
* aqe pipeline status <execution-id>
|
|
10
|
+
* aqe pipeline approve <execution-id> <step-id>
|
|
11
|
+
* aqe pipeline reject <execution-id> <step-id> [--reason "..."]
|
|
12
|
+
*/
|
|
13
|
+
import { Command } from 'commander';
|
|
14
|
+
import type { CLIContext } from '../handlers/interfaces.js';
|
|
15
|
+
export declare function createPipelineCommand(context: CLIContext, cleanupAndExit: (code: number) => Promise<never>, ensureInitialized: () => Promise<boolean>): Command;
|
|
16
|
+
//# sourceMappingURL=pipeline.d.ts.map
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic QE v3 - Pipeline Command (Imp-9)
|
|
3
|
+
*
|
|
4
|
+
* CLI commands for YAML deterministic pipeline management:
|
|
5
|
+
* aqe pipeline load <file.yaml> [--vars key=value]
|
|
6
|
+
* aqe pipeline validate <file.yaml>
|
|
7
|
+
* aqe pipeline run <pipeline-id> [--input key=value] [--wait]
|
|
8
|
+
* aqe pipeline list
|
|
9
|
+
* aqe pipeline status <execution-id>
|
|
10
|
+
* aqe pipeline approve <execution-id> <step-id>
|
|
11
|
+
* aqe pipeline reject <execution-id> <step-id> [--reason "..."]
|
|
12
|
+
*/
|
|
13
|
+
import { Command } from 'commander';
|
|
14
|
+
import { resolve } from 'path';
|
|
15
|
+
import chalk from 'chalk';
|
|
16
|
+
import { YamlPipelineLoader } from '../../coordination/yaml-pipeline-loader.js';
|
|
17
|
+
// ============================================================================
|
|
18
|
+
// Helpers
|
|
19
|
+
// ============================================================================
|
|
20
|
+
/**
|
|
21
|
+
* Parse `--vars key1=value1 key2=value2` into a Record.
|
|
22
|
+
*/
|
|
23
|
+
function parseVars(rawVars) {
|
|
24
|
+
const vars = {};
|
|
25
|
+
for (const entry of rawVars) {
|
|
26
|
+
const eqIndex = entry.indexOf('=');
|
|
27
|
+
if (eqIndex === -1) {
|
|
28
|
+
vars[entry] = true;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
const key = entry.slice(0, eqIndex);
|
|
32
|
+
const value = entry.slice(eqIndex + 1);
|
|
33
|
+
// Try to parse as number or boolean
|
|
34
|
+
if (value === 'true')
|
|
35
|
+
vars[key] = true;
|
|
36
|
+
else if (value === 'false')
|
|
37
|
+
vars[key] = false;
|
|
38
|
+
else if (!isNaN(Number(value)) && value !== '')
|
|
39
|
+
vars[key] = Number(value);
|
|
40
|
+
else
|
|
41
|
+
vars[key] = value;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return vars;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Parse `--input key1=value1 key2=value2` into a Record.
|
|
48
|
+
*/
|
|
49
|
+
function parseInput(rawInput) {
|
|
50
|
+
return parseVars(rawInput);
|
|
51
|
+
}
|
|
52
|
+
function getOrchestrator(context) {
|
|
53
|
+
return context.workflowOrchestrator;
|
|
54
|
+
}
|
|
55
|
+
// ============================================================================
|
|
56
|
+
// Command Factory
|
|
57
|
+
// ============================================================================
|
|
58
|
+
export function createPipelineCommand(context, cleanupAndExit, ensureInitialized) {
|
|
59
|
+
const loader = new YamlPipelineLoader();
|
|
60
|
+
const pipelineCmd = new Command('pipeline')
|
|
61
|
+
.description('Manage YAML deterministic pipelines (Imp-9)');
|
|
62
|
+
// ---------------------------------------------------------------
|
|
63
|
+
// pipeline load <file.yaml>
|
|
64
|
+
// ---------------------------------------------------------------
|
|
65
|
+
pipelineCmd
|
|
66
|
+
.command('load <file>')
|
|
67
|
+
.description('Load and register a pipeline from a YAML file')
|
|
68
|
+
.option('--vars <entries...>', 'Variable substitutions (key=value)')
|
|
69
|
+
.action(async (file, options) => {
|
|
70
|
+
if (!await ensureInitialized())
|
|
71
|
+
return;
|
|
72
|
+
const orchestrator = getOrchestrator(context);
|
|
73
|
+
if (!orchestrator) {
|
|
74
|
+
console.error(chalk.red(' Workflow orchestrator not available. Run "aqe fleet init" first.'));
|
|
75
|
+
await cleanupAndExit(1);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const filePath = resolve(file);
|
|
79
|
+
const vars = options.vars ? parseVars(options.vars) : undefined;
|
|
80
|
+
console.log(chalk.blue(`\n Loading pipeline from: ${file}\n`));
|
|
81
|
+
const result = await loader.loadFromFile(filePath, vars);
|
|
82
|
+
if (!result.success) {
|
|
83
|
+
console.error(chalk.red(` Parse error: ${result.error.message}`));
|
|
84
|
+
await cleanupAndExit(1);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
const definition = result.value;
|
|
88
|
+
const registerResult = orchestrator.registerWorkflow(definition);
|
|
89
|
+
if (!registerResult.success) {
|
|
90
|
+
console.error(chalk.red(` Registration error: ${registerResult.error.message}`));
|
|
91
|
+
await cleanupAndExit(1);
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
console.log(chalk.green(' Pipeline loaded successfully.'));
|
|
95
|
+
console.log(` ID: ${chalk.cyan(definition.id)}`);
|
|
96
|
+
console.log(` Name: ${chalk.cyan(definition.name)}`);
|
|
97
|
+
console.log(` Steps: ${chalk.cyan(definition.steps.length)}`);
|
|
98
|
+
console.log(` Version: ${chalk.cyan(definition.version)}`);
|
|
99
|
+
if (definition.tags?.length) {
|
|
100
|
+
console.log(` Tags: ${chalk.cyan(definition.tags.join(', '))}`);
|
|
101
|
+
}
|
|
102
|
+
console.log('');
|
|
103
|
+
await cleanupAndExit(0);
|
|
104
|
+
});
|
|
105
|
+
// ---------------------------------------------------------------
|
|
106
|
+
// pipeline validate <file.yaml>
|
|
107
|
+
// ---------------------------------------------------------------
|
|
108
|
+
pipelineCmd
|
|
109
|
+
.command('validate <file>')
|
|
110
|
+
.description('Validate a YAML pipeline without registering it')
|
|
111
|
+
.option('--vars <entries...>', 'Variable substitutions (key=value)')
|
|
112
|
+
.action(async (file, options) => {
|
|
113
|
+
const filePath = resolve(file);
|
|
114
|
+
const vars = options.vars ? parseVars(options.vars) : undefined;
|
|
115
|
+
console.log(chalk.blue(`\n Validating pipeline: ${file}\n`));
|
|
116
|
+
const result = await loader.loadFromFile(filePath, vars);
|
|
117
|
+
if (!result.success) {
|
|
118
|
+
console.log(chalk.red(` Invalid: ${result.error.message}`));
|
|
119
|
+
await cleanupAndExit(1);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const def = result.value;
|
|
123
|
+
console.log(chalk.green(' Valid pipeline.'));
|
|
124
|
+
console.log(` ID: ${chalk.cyan(def.id)}`);
|
|
125
|
+
console.log(` Name: ${chalk.cyan(def.name)}`);
|
|
126
|
+
console.log(` Steps: ${chalk.cyan(def.steps.length)}`);
|
|
127
|
+
console.log('');
|
|
128
|
+
await cleanupAndExit(0);
|
|
129
|
+
});
|
|
130
|
+
// ---------------------------------------------------------------
|
|
131
|
+
// pipeline run <pipeline-id>
|
|
132
|
+
// ---------------------------------------------------------------
|
|
133
|
+
pipelineCmd
|
|
134
|
+
.command('run <pipelineId>')
|
|
135
|
+
.description('Execute a registered pipeline')
|
|
136
|
+
.option('--input <entries...>', 'Input parameters (key=value)')
|
|
137
|
+
.option('--wait', 'Wait for execution to complete')
|
|
138
|
+
.action(async (pipelineId, options) => {
|
|
139
|
+
if (!await ensureInitialized())
|
|
140
|
+
return;
|
|
141
|
+
const orchestrator = getOrchestrator(context);
|
|
142
|
+
if (!orchestrator) {
|
|
143
|
+
console.error(chalk.red(' Workflow orchestrator not available. Run "aqe fleet init" first.'));
|
|
144
|
+
await cleanupAndExit(1);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
const input = options.input ? parseInput(options.input) : {};
|
|
148
|
+
console.log(chalk.blue(`\n Running pipeline: ${pipelineId}\n`));
|
|
149
|
+
const result = await orchestrator.executeWorkflow(pipelineId, input);
|
|
150
|
+
if (!result.success) {
|
|
151
|
+
console.error(chalk.red(` Failed: ${result.error.message}`));
|
|
152
|
+
await cleanupAndExit(1);
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
const executionId = result.value;
|
|
156
|
+
console.log(chalk.green(' Pipeline started.'));
|
|
157
|
+
console.log(` Execution ID: ${chalk.cyan(executionId)}`);
|
|
158
|
+
if (options.wait) {
|
|
159
|
+
console.log(chalk.gray(' Waiting for completion...'));
|
|
160
|
+
let status = orchestrator.getWorkflowStatus(executionId);
|
|
161
|
+
while (status && (status.status === 'running' || status.status === 'paused')) {
|
|
162
|
+
await new Promise((r) => setTimeout(r, 500));
|
|
163
|
+
status = orchestrator.getWorkflowStatus(executionId);
|
|
164
|
+
}
|
|
165
|
+
if (status) {
|
|
166
|
+
const statusColor = status.status === 'completed' ? chalk.green : chalk.red;
|
|
167
|
+
console.log(` Status: ${statusColor(status.status)}`);
|
|
168
|
+
if (status.duration)
|
|
169
|
+
console.log(` Duration: ${chalk.cyan(`${status.duration}ms`)}`);
|
|
170
|
+
if (status.error)
|
|
171
|
+
console.log(` Error: ${chalk.red(status.error)}`);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
console.log('');
|
|
175
|
+
await cleanupAndExit(0);
|
|
176
|
+
});
|
|
177
|
+
// ---------------------------------------------------------------
|
|
178
|
+
// pipeline list
|
|
179
|
+
// ---------------------------------------------------------------
|
|
180
|
+
pipelineCmd
|
|
181
|
+
.command('list')
|
|
182
|
+
.description('List all registered pipelines')
|
|
183
|
+
.action(async () => {
|
|
184
|
+
if (!await ensureInitialized())
|
|
185
|
+
return;
|
|
186
|
+
const orchestrator = getOrchestrator(context);
|
|
187
|
+
if (!orchestrator) {
|
|
188
|
+
console.error(chalk.red(' Workflow orchestrator not available. Run "aqe fleet init" first.'));
|
|
189
|
+
await cleanupAndExit(1);
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
const workflows = orchestrator.listWorkflows();
|
|
193
|
+
console.log(chalk.blue(`\n Registered Pipelines (${workflows.length})\n`));
|
|
194
|
+
if (workflows.length === 0) {
|
|
195
|
+
console.log(chalk.gray(' No pipelines registered.'));
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
for (const wf of workflows) {
|
|
199
|
+
console.log(` ${chalk.cyan(wf.id)} — ${wf.name} (${wf.stepCount} steps, v${wf.version})`);
|
|
200
|
+
if (wf.tags?.length) {
|
|
201
|
+
console.log(` Tags: ${chalk.gray(wf.tags.join(', '))}`);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
console.log('');
|
|
206
|
+
await cleanupAndExit(0);
|
|
207
|
+
});
|
|
208
|
+
// ---------------------------------------------------------------
|
|
209
|
+
// pipeline status <execution-id>
|
|
210
|
+
// ---------------------------------------------------------------
|
|
211
|
+
pipelineCmd
|
|
212
|
+
.command('status <executionId>')
|
|
213
|
+
.description('Show the status of a pipeline execution')
|
|
214
|
+
.action(async (executionId) => {
|
|
215
|
+
if (!await ensureInitialized())
|
|
216
|
+
return;
|
|
217
|
+
const orchestrator = getOrchestrator(context);
|
|
218
|
+
if (!orchestrator) {
|
|
219
|
+
console.error(chalk.red(' Workflow orchestrator not available. Run "aqe fleet init" first.'));
|
|
220
|
+
await cleanupAndExit(1);
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
const status = orchestrator.getWorkflowStatus(executionId);
|
|
224
|
+
if (!status) {
|
|
225
|
+
console.error(chalk.red(` Execution not found: ${executionId}`));
|
|
226
|
+
await cleanupAndExit(1);
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
const statusColor = status.status === 'completed' ? chalk.green :
|
|
230
|
+
status.status === 'failed' ? chalk.red :
|
|
231
|
+
status.status === 'running' ? chalk.yellow : chalk.gray;
|
|
232
|
+
console.log(chalk.blue(`\n Pipeline Execution Status\n`));
|
|
233
|
+
console.log(` Execution: ${chalk.cyan(executionId)}`);
|
|
234
|
+
console.log(` Pipeline: ${chalk.cyan(status.workflowName)} (${status.workflowId})`);
|
|
235
|
+
console.log(` Status: ${statusColor(status.status)}`);
|
|
236
|
+
console.log(` Progress: ${chalk.cyan(`${status.progress}%`)}`);
|
|
237
|
+
console.log(` Completed: ${chalk.cyan(status.completedSteps.join(', ') || 'none')}`);
|
|
238
|
+
if (status.failedSteps.length > 0) {
|
|
239
|
+
console.log(` Failed: ${chalk.red(status.failedSteps.join(', '))}`);
|
|
240
|
+
}
|
|
241
|
+
if (status.skippedSteps.length > 0) {
|
|
242
|
+
console.log(` Skipped: ${chalk.gray(status.skippedSteps.join(', '))}`);
|
|
243
|
+
}
|
|
244
|
+
if (status.currentSteps.length > 0) {
|
|
245
|
+
console.log(` Running: ${chalk.yellow(status.currentSteps.join(', '))}`);
|
|
246
|
+
}
|
|
247
|
+
if (status.duration) {
|
|
248
|
+
console.log(` Duration: ${chalk.cyan(`${status.duration}ms`)}`);
|
|
249
|
+
}
|
|
250
|
+
if (status.error) {
|
|
251
|
+
console.log(` Error: ${chalk.red(status.error)}`);
|
|
252
|
+
}
|
|
253
|
+
console.log('');
|
|
254
|
+
await cleanupAndExit(0);
|
|
255
|
+
});
|
|
256
|
+
// ---------------------------------------------------------------
|
|
257
|
+
// pipeline approve <execution-id> <step-id>
|
|
258
|
+
// ---------------------------------------------------------------
|
|
259
|
+
pipelineCmd
|
|
260
|
+
.command('approve <executionId> <stepId>')
|
|
261
|
+
.description('Approve a step that is awaiting approval')
|
|
262
|
+
.action(async (executionId, stepId) => {
|
|
263
|
+
if (!await ensureInitialized())
|
|
264
|
+
return;
|
|
265
|
+
const orchestrator = getOrchestrator(context);
|
|
266
|
+
if (!orchestrator) {
|
|
267
|
+
console.error(chalk.red(' Workflow orchestrator not available.'));
|
|
268
|
+
await cleanupAndExit(1);
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
const success = orchestrator.approveStep(executionId, stepId);
|
|
272
|
+
if (success) {
|
|
273
|
+
console.log(chalk.green(`\n Step '${stepId}' approved.\n`));
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
console.error(chalk.red(`\n No pending approval found for step '${stepId}' in execution '${executionId}'.\n`));
|
|
277
|
+
await cleanupAndExit(1);
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
await cleanupAndExit(0);
|
|
281
|
+
});
|
|
282
|
+
// ---------------------------------------------------------------
|
|
283
|
+
// pipeline reject <execution-id> <step-id>
|
|
284
|
+
// ---------------------------------------------------------------
|
|
285
|
+
pipelineCmd
|
|
286
|
+
.command('reject <executionId> <stepId>')
|
|
287
|
+
.description('Reject a step that is awaiting approval')
|
|
288
|
+
.option('--reason <reason>', 'Rejection reason')
|
|
289
|
+
.action(async (executionId, stepId, options) => {
|
|
290
|
+
if (!await ensureInitialized())
|
|
291
|
+
return;
|
|
292
|
+
const orchestrator = getOrchestrator(context);
|
|
293
|
+
if (!orchestrator) {
|
|
294
|
+
console.error(chalk.red(' Workflow orchestrator not available.'));
|
|
295
|
+
await cleanupAndExit(1);
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
const success = orchestrator.rejectStep(executionId, stepId, options.reason);
|
|
299
|
+
if (success) {
|
|
300
|
+
console.log(chalk.green(`\n Step '${stepId}' rejected.`));
|
|
301
|
+
if (options.reason)
|
|
302
|
+
console.log(` Reason: ${chalk.gray(options.reason)}`);
|
|
303
|
+
console.log('');
|
|
304
|
+
}
|
|
305
|
+
else {
|
|
306
|
+
console.error(chalk.red(`\n No pending approval found for step '${stepId}' in execution '${executionId}'.\n`));
|
|
307
|
+
await cleanupAndExit(1);
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
await cleanupAndExit(0);
|
|
311
|
+
});
|
|
312
|
+
return pipelineCmd;
|
|
313
|
+
}
|
|
314
|
+
//# sourceMappingURL=pipeline.js.map
|
|
@@ -50,6 +50,23 @@ const FLAG_DESCRIPTIONS = {
|
|
|
50
50
|
useDAGAttention: 'DAG attention for test scheduling (Task 4.2)',
|
|
51
51
|
useCoherenceActionGate: 'Coherence-gated agent actions (ADR-083, Task 3.2)',
|
|
52
52
|
useReasoningQEC: 'Reasoning QEC error correction (Task 4.5)',
|
|
53
|
+
// Phase 5 (ADR-087)
|
|
54
|
+
useHDCFingerprinting: 'HDC pattern fingerprinting (R1, ADR-087)',
|
|
55
|
+
useCusumDriftDetection: 'CUSUM drift detection (R2, ADR-087)',
|
|
56
|
+
useDeltaEventSourcing: 'Delta event sourcing (R3, ADR-087)',
|
|
57
|
+
useEwcPlusPlusRegularization: 'EWC++ regularization (ADR-087)',
|
|
58
|
+
// Phase 5 Milestone 2 (ADR-087)
|
|
59
|
+
useGraphMAEEmbeddings: 'GraphMAE self-supervised embeddings (R4, ADR-087)',
|
|
60
|
+
useHopfieldMemory: 'Modern Hopfield memory (R5, ADR-087)',
|
|
61
|
+
useColdTierGNN: 'Cold-tier GNN training (R6, ADR-087)',
|
|
62
|
+
// Phase 5 Milestone 3 (ADR-087)
|
|
63
|
+
useMetaLearningEnhancements: 'Meta-learning enhancements (R7, ADR-087)',
|
|
64
|
+
useSublinearSolver: 'Sublinear PageRank solver (R8, ADR-087)',
|
|
65
|
+
useSpectralSparsification: 'Spectral graph sparsification (R9, ADR-087)',
|
|
66
|
+
useReservoirReplay: 'Reservoir replay with coherence gating (R10, ADR-087)',
|
|
67
|
+
// Phase 5 Milestone 4 (ADR-087)
|
|
68
|
+
useEpropOnlineLearning: 'E-prop online learning, RL algorithm #10 (R11, ADR-087)',
|
|
69
|
+
useGrangerCausality: 'Granger causality for test failure prediction (R12, ADR-087)',
|
|
53
70
|
};
|
|
54
71
|
const PROFILES = {
|
|
55
72
|
performance: {
|
|
@@ -15,6 +15,7 @@ import { Command } from 'commander';
|
|
|
15
15
|
import chalk from 'chalk';
|
|
16
16
|
import { TokenMetricsCollector, formatDashboardSummary, } from '../../learning/token-tracker.js';
|
|
17
17
|
import { TokenOptimizerService } from '../../optimization/token-optimizer-service.js';
|
|
18
|
+
import { getSessionCache } from '../../optimization/session-cache.js';
|
|
18
19
|
import * as fs from 'fs';
|
|
19
20
|
import { toErrorMessage } from '../../shared/error-utils.js';
|
|
20
21
|
// ============================================================================
|
|
@@ -32,6 +33,7 @@ export function createTokenUsageCommand() {
|
|
|
32
33
|
.option('-r, --recommendations', 'Show optimization recommendations')
|
|
33
34
|
.option('-e, --export <file>', 'Export to CSV file')
|
|
34
35
|
.option('--dashboard', 'Show compact token budget dashboard summary')
|
|
36
|
+
.option('--cache-stats', 'Show session operation cache statistics (Imp-15)')
|
|
35
37
|
.option('--json', 'Output as JSON')
|
|
36
38
|
.option('-v, --verbose', 'Show detailed output')
|
|
37
39
|
.action(async (options) => {
|
|
@@ -45,7 +47,10 @@ export function createTokenUsageCommand() {
|
|
|
45
47
|
async function executeTokenUsage(options) {
|
|
46
48
|
const timeframe = parseTimeframe(options.period);
|
|
47
49
|
try {
|
|
48
|
-
if (options.
|
|
50
|
+
if (options.cacheStats) {
|
|
51
|
+
await showCacheStats(options);
|
|
52
|
+
}
|
|
53
|
+
else if (options.dashboard) {
|
|
49
54
|
console.log(formatDashboardSummary());
|
|
50
55
|
}
|
|
51
56
|
else if (options.byAgent) {
|
|
@@ -122,6 +127,24 @@ async function showSessionSummary(timeframe, options) {
|
|
|
122
127
|
}
|
|
123
128
|
console.log('');
|
|
124
129
|
}
|
|
130
|
+
/**
|
|
131
|
+
* Show session operation cache statistics (Imp-15)
|
|
132
|
+
*/
|
|
133
|
+
async function showCacheStats(options) {
|
|
134
|
+
const stats = getSessionCache().getStats();
|
|
135
|
+
if (options.json) {
|
|
136
|
+
console.log(JSON.stringify(stats, null, 2));
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
console.log(chalk.bold.cyan('\nSession Operation Cache (Imp-15)\n'));
|
|
140
|
+
console.log(` Cache size: ${stats.size} entries`);
|
|
141
|
+
console.log(` Cache hits: ${stats.hits}`);
|
|
142
|
+
console.log(` Cache misses: ${stats.misses}`);
|
|
143
|
+
console.log(` Hit rate: ${chalk.green(`${(stats.hitRate * 100).toFixed(1)}%`)}`);
|
|
144
|
+
console.log(` Tokens saved: ${chalk.green(formatNumber(stats.estimatedTokensSaved))}`);
|
|
145
|
+
console.log(chalk.gray('\n O(1) fingerprint lookups run before O(log n) HNSW search'));
|
|
146
|
+
console.log('');
|
|
147
|
+
}
|
|
125
148
|
/**
|
|
126
149
|
* Show usage grouped by agent
|
|
127
150
|
*/
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic QE v3 - Heartbeat Command Handler
|
|
3
|
+
* Imp-10: Token-Free Heartbeat Scheduler CLI Integration
|
|
4
|
+
*
|
|
5
|
+
* Handles the 'aqe heartbeat' command with subcommands:
|
|
6
|
+
* status, run-now, history, log, pause, resume
|
|
7
|
+
*/
|
|
8
|
+
import { Command } from 'commander';
|
|
9
|
+
import { ICommandHandler, CLIContext } from './interfaces.js';
|
|
10
|
+
export declare class HeartbeatHandler implements ICommandHandler {
|
|
11
|
+
readonly name = "heartbeat";
|
|
12
|
+
readonly description = "Manage the token-free heartbeat scheduler";
|
|
13
|
+
private cleanupAndExit;
|
|
14
|
+
private worker;
|
|
15
|
+
constructor(cleanupAndExit: (code: number) => Promise<never>);
|
|
16
|
+
register(program: Command, _context: CLIContext): void;
|
|
17
|
+
private executeStatus;
|
|
18
|
+
private executeRunNow;
|
|
19
|
+
private executeHistory;
|
|
20
|
+
private executeLog;
|
|
21
|
+
private executePause;
|
|
22
|
+
private executeResume;
|
|
23
|
+
getHelp(): string;
|
|
24
|
+
}
|
|
25
|
+
export declare function createHeartbeatHandler(cleanupAndExit: (code: number) => Promise<never>): HeartbeatHandler;
|
|
26
|
+
//# sourceMappingURL=heartbeat-handler.d.ts.map
|