agentic-qe 3.8.8 → 3.8.9

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.
@@ -9,6 +9,7 @@
9
9
  import { Command } from 'commander';
10
10
  import chalk from 'chalk';
11
11
  import { getRuVectorFeatureFlags, setRuVectorFeatureFlags, DEFAULT_FEATURE_FLAGS, } from '../../integrations/ruvector/feature-flags.js';
12
+ import { HnswAdapter } from '../../kernel/hnsw-adapter.js';
12
13
  // ============================================================================
13
14
  // Constants
14
15
  // ============================================================================
@@ -44,7 +45,7 @@ const FLAG_DESCRIPTIONS = {
44
45
  useHnswHealthMonitor: 'HNSW health monitor (Task 3.4)',
45
46
  useRegretTracking: 'Regret tracking & learning health (Task 2.4)',
46
47
  useCoherenceGate: 'Sheaf-gated coherence validation (ADR-083, Task 3.1)',
47
- useWitnessChain: 'Blake3 hash-chained witness records (Task 3.1)',
48
+ useWitnessChain: 'SHA-256 hash-chained witness records (Task 3.1)',
48
49
  useCNNVisualRegression: 'CNN visual regression testing (Task 4.3)',
49
50
  useDAGAttention: 'DAG attention for test scheduling (Task 4.2)',
50
51
  useCoherenceActionGate: 'Coherence-gated agent actions (ADR-083, Task 3.2)',
@@ -102,6 +103,15 @@ function isDefaultValue(flag, value) {
102
103
  function padRight(str, length) {
103
104
  return str.padEnd(length);
104
105
  }
106
+ function formatBytes(bytes) {
107
+ if (bytes < 1024)
108
+ return `${bytes}B`;
109
+ if (bytes < 1024 * 1024)
110
+ return `${(bytes / 1024).toFixed(1)}KB`;
111
+ if (bytes < 1024 * 1024 * 1024)
112
+ return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
113
+ return `${(bytes / (1024 * 1024 * 1024)).toFixed(2)}GB`;
114
+ }
105
115
  function isValidFlagName(name) {
106
116
  return VALID_FLAG_NAMES.includes(name);
107
117
  }
@@ -134,6 +144,36 @@ function executeStatus() {
134
144
  const suffix = isDefault ? chalk.gray(' (default)') : chalk.yellow(' (modified)');
135
145
  console.log(` ${padRight(flagName + ':', 30)} ${valueText}${suffix}`);
136
146
  }
147
+ // HNSW Memory Usage
148
+ const indexNames = HnswAdapter.listIndexes();
149
+ if (indexNames.length > 0) {
150
+ console.log('');
151
+ console.log(chalk.cyan(' HNSW Memory Usage:'));
152
+ let totalVectors = 0;
153
+ let totalEstimatedBytes = 0;
154
+ for (const name of indexNames) {
155
+ const adapter = HnswAdapter.get(name);
156
+ if (adapter) {
157
+ const count = adapter.size();
158
+ const dims = adapter.dimensions();
159
+ // Raw vectors + HNSW graph overhead (~2x)
160
+ const rawBytes = count * dims * 4;
161
+ const estimatedBytes = rawBytes * 3;
162
+ totalVectors += count;
163
+ totalEstimatedBytes += estimatedBytes;
164
+ console.log(` ${padRight(name + ':', 20)} ${chalk.white(String(count))} vectors, ` +
165
+ `${chalk.white(dims)}d, ~${chalk.white(formatBytes(estimatedBytes))}`);
166
+ }
167
+ }
168
+ console.log(chalk.gray(` ${'─'.repeat(50)}`));
169
+ console.log(` ${padRight('Total:', 20)} ${chalk.bold.white(String(totalVectors))} vectors, ` +
170
+ `~${chalk.bold.white(formatBytes(totalEstimatedBytes))}`);
171
+ }
172
+ else {
173
+ console.log('');
174
+ console.log(chalk.cyan(' HNSW Memory Usage:'));
175
+ console.log(chalk.gray(' No active indexes (indexes are created on first use)'));
176
+ }
137
177
  // Memory info when compression is enabled
138
178
  if (flags.useTemporalCompression) {
139
179
  console.log('');
@@ -1041,6 +1041,7 @@ Return JSON: { "rankedIds": ["id1", "id2", ...], "insights": ["insight1", "insig
1041
1041
  rs: 'rust',
1042
1042
  rb: 'ruby',
1043
1043
  cs: 'csharp',
1044
+ swift: 'swift',
1044
1045
  };
1045
1046
  return typeMap[ext] || 'unknown';
1046
1047
  }
@@ -1052,6 +1053,8 @@ Return JSON: { "rankedIds": ["id1", "id2", ...], "insights": ["insight1", "insig
1052
1053
  go: ['go'],
1053
1054
  java: ['java'],
1054
1055
  rust: ['rs'],
1056
+ csharp: ['cs'],
1057
+ swift: ['swift'],
1055
1058
  };
1056
1059
  return languages.some((lang) => {
1057
1060
  const exts = langMap[lang.toLowerCase()] || [lang];
@@ -5,6 +5,12 @@
5
5
  * - LCOV format (from Istanbul, nyc, c8)
6
6
  * - Cobertura XML format
7
7
  * - JSON format (Istanbul/vitest)
8
+ * - JaCoCo XML format (Java/Kotlin)
9
+ * - dotcover XML format (C#/.NET)
10
+ * - Tarpaulin JSON format (Rust)
11
+ * - Go cover text format (Go)
12
+ * - Kover XML format (Kotlin/JVM)
13
+ * - xcresult JSON format (Swift/iOS)
8
14
  *
9
15
  * This is NOT a simulation - it reads and parses real coverage data.
10
16
  *
@@ -115,8 +121,10 @@ export interface FunctionDetail {
115
121
  export interface CoverageReport {
116
122
  /** Timestamp of when the report was generated */
117
123
  timestamp: Date;
118
- /** Source format (lcov, cobertura, json) */
119
- format: 'lcov' | 'cobertura' | 'json';
124
+ /** Source format */
125
+ format: CoverageFormat;
126
+ /** Detected source language (when determinable from format) */
127
+ language?: string;
120
128
  /** Coverage data by file */
121
129
  files: Map<string, FileCoverageData>;
122
130
  /** Summary statistics */
@@ -153,6 +161,10 @@ export interface CoverageSummary {
153
161
  percentage: number;
154
162
  };
155
163
  }
164
+ /**
165
+ * Supported coverage format types
166
+ */
167
+ export type CoverageFormat = 'lcov' | 'cobertura' | 'json' | 'jacoco' | 'dotcover' | 'tarpaulin' | 'gocover' | 'kover' | 'xcresult';
156
168
  /**
157
169
  * Parse LCOV format coverage data
158
170
  *
@@ -168,9 +180,65 @@ export declare function parseLCOVContent(content: string, projectRoot: string):
168
180
  */
169
181
  export declare function parseJSONCoverage(jsonPath: string, projectRoot?: string): Promise<CoverageReport>;
170
182
  /**
171
- * Auto-detect coverage format and parse accordingly
183
+ * Parse JaCoCo XML coverage data.
184
+ *
185
+ * JaCoCo XML structure:
186
+ * <report><package><class><method><counter type="LINE" missed="X" covered="Y"/></method></class></package></report>
187
+ */
188
+ export declare function parseJaCoCo(xmlPath: string, projectRoot?: string): Promise<CoverageReport>;
189
+ export declare function parseJaCoCoContent(content: string, projectRoot: string): CoverageReport;
190
+ /**
191
+ * Parse dotcover XML coverage data.
192
+ *
193
+ * dotcover XML structure:
194
+ * <Root CoveredStatements="X" TotalStatements="Y"><Assembly><Namespace><Type><Member Statement="..."/></Type></Namespace></Assembly></Root>
195
+ */
196
+ export declare function parseDotcover(xmlPath: string, projectRoot?: string): Promise<CoverageReport>;
197
+ export declare function parseDotcoverContent(content: string, projectRoot: string): CoverageReport;
198
+ /**
199
+ * Parse Tarpaulin JSON coverage data.
200
+ *
201
+ * Tarpaulin JSON structure (--output-dir with --out Json):
202
+ * { "files": [ { "path": "...", "content": "...", "traces": [ { "line": N, "stats": { "Line": N } } ] } ] }
203
+ *
204
+ * Also handles tarpaulin LCOV output by delegating to parseLCOVContent.
205
+ */
206
+ export declare function parseTarpaulin(filePath: string, projectRoot?: string): Promise<CoverageReport>;
207
+ export declare function parseTarpaulinContent(content: string, projectRoot: string): CoverageReport;
208
+ /**
209
+ * Parse Go coverage profile text format.
210
+ *
211
+ * Format:
212
+ * mode: set|count|atomic
213
+ * pkg/file.go:startLine.startCol,endLine.endCol numStatements count
214
+ */
215
+ export declare function parseGoCover(coverPath: string, projectRoot?: string): Promise<CoverageReport>;
216
+ export declare function parseGoCoverContent(content: string, projectRoot: string): CoverageReport;
217
+ /**
218
+ * Parse Kover XML coverage data.
219
+ *
220
+ * Kover outputs JaCoCo-compatible XML. This delegates to the JaCoCo parser
221
+ * but sets the format and language appropriately.
222
+ */
223
+ export declare function parseKover(xmlPath: string, projectRoot?: string): Promise<CoverageReport>;
224
+ /**
225
+ * Parse xcresult coverage data exported via:
226
+ * xcrun xccov view --report --json result.xcresult > coverage.json
227
+ *
228
+ * Structure:
229
+ * { "targets": [ { "files": [ { "path": "...", "lineCoverage": 0.85, "coveredLines": N, "executableLines": N, "functions": [...] } ] } ] }
230
+ */
231
+ export declare function parseXcresult(jsonPath: string, projectRoot?: string): Promise<CoverageReport>;
232
+ export declare function parseXcresultContent(content: string, projectRoot: string): CoverageReport;
233
+ /**
234
+ * Auto-detect coverage format and parse accordingly.
235
+ *
236
+ * @param coveragePath - Path to the coverage file
237
+ * @param projectRoot - Project root for relative path calculation
238
+ * @param format - Explicit format override
239
+ * @param language - Language hint for format inference
172
240
  */
173
- export declare function parseCoverage(coveragePath: string, projectRoot?: string): Promise<CoverageReport>;
241
+ export declare function parseCoverage(coveragePath: string, projectRoot?: string, format?: CoverageFormat, language?: string): Promise<CoverageReport>;
174
242
  /**
175
243
  * Find and parse coverage files in a directory
176
244
  */