agentic-qe 3.6.13 → 3.6.15

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.
Files changed (41) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/package.json +4 -3
  3. package/v3/CHANGELOG.md +29 -0
  4. package/v3/dist/cli/bundle.js +561 -338
  5. package/v3/dist/cli/commands/test.d.ts.map +1 -1
  6. package/v3/dist/cli/commands/test.js +6 -3
  7. package/v3/dist/cli/commands/test.js.map +1 -1
  8. package/v3/dist/domains/test-generation/generators/base-test-generator.d.ts.map +1 -1
  9. package/v3/dist/domains/test-generation/generators/base-test-generator.js +49 -27
  10. package/v3/dist/domains/test-generation/generators/base-test-generator.js.map +1 -1
  11. package/v3/dist/domains/test-generation/generators/jest-vitest-generator.d.ts.map +1 -1
  12. package/v3/dist/domains/test-generation/generators/jest-vitest-generator.js +53 -21
  13. package/v3/dist/domains/test-generation/generators/jest-vitest-generator.js.map +1 -1
  14. package/v3/dist/domains/test-generation/generators/mocha-generator.d.ts.map +1 -1
  15. package/v3/dist/domains/test-generation/generators/mocha-generator.js +46 -16
  16. package/v3/dist/domains/test-generation/generators/mocha-generator.js.map +1 -1
  17. package/v3/dist/domains/test-generation/generators/pytest-generator.d.ts.map +1 -1
  18. package/v3/dist/domains/test-generation/generators/pytest-generator.js +31 -14
  19. package/v3/dist/domains/test-generation/generators/pytest-generator.js.map +1 -1
  20. package/v3/dist/domains/test-generation/services/pattern-matcher.d.ts.map +1 -1
  21. package/v3/dist/domains/test-generation/services/pattern-matcher.js +2 -1
  22. package/v3/dist/domains/test-generation/services/pattern-matcher.js.map +1 -1
  23. package/v3/dist/domains/test-generation/services/test-generator.d.ts.map +1 -1
  24. package/v3/dist/domains/test-generation/services/test-generator.js +11 -3
  25. package/v3/dist/domains/test-generation/services/test-generator.js.map +1 -1
  26. package/v3/dist/mcp/bundle.js +201 -63
  27. package/v3/dist/shared/sql-safety.d.ts +3 -0
  28. package/v3/dist/shared/sql-safety.d.ts.map +1 -1
  29. package/v3/dist/shared/sql-safety.js +12 -2
  30. package/v3/dist/shared/sql-safety.js.map +1 -1
  31. package/v3/dist/sync/cloud/postgres-writer.d.ts +6 -1
  32. package/v3/dist/sync/cloud/postgres-writer.d.ts.map +1 -1
  33. package/v3/dist/sync/cloud/postgres-writer.js +121 -46
  34. package/v3/dist/sync/cloud/postgres-writer.js.map +1 -1
  35. package/v3/dist/sync/interfaces.d.ts.map +1 -1
  36. package/v3/dist/sync/interfaces.js +97 -32
  37. package/v3/dist/sync/interfaces.js.map +1 -1
  38. package/v3/dist/sync/sync-agent.d.ts.map +1 -1
  39. package/v3/dist/sync/sync-agent.js +8 -24
  40. package/v3/dist/sync/sync-agent.js.map +1 -1
  41. package/v3/package.json +1 -1
@@ -14,7 +14,7 @@ var __require = /* @__PURE__ */ ((x67) => typeof require !== "undefined" ? requi
14
14
  var __esm = (fn, res) => function __init() {
15
15
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
16
16
  };
17
- var __commonJS = (cb, mod) => function __require10() {
17
+ var __commonJS = (cb, mod) => function __require9() {
18
18
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
19
19
  };
20
20
  var __export = (target, all) => {
@@ -1082,11 +1082,19 @@ function validateTableName(tableName) {
1082
1082
  return tableName;
1083
1083
  }
1084
1084
  function validateIdentifier(name) {
1085
- if (!IDENTIFIER_REGEX.test(name)) {
1085
+ const parts = name.split(".");
1086
+ if (parts.length > 2) {
1086
1087
  throw new Error(
1087
- `Invalid SQL identifier: "${name}" does not match pattern ${IDENTIFIER_REGEX}`
1088
+ `Invalid SQL identifier: "${name}" has too many parts (max: schema.table)`
1088
1089
  );
1089
1090
  }
1091
+ for (const part of parts) {
1092
+ if (!IDENTIFIER_REGEX.test(part)) {
1093
+ throw new Error(
1094
+ `Invalid SQL identifier: "${name}" \u2014 part "${part}" does not match pattern ${IDENTIFIER_REGEX}`
1095
+ );
1096
+ }
1097
+ }
1090
1098
  return name;
1091
1099
  }
1092
1100
  var ALLOWED_TABLE_NAMES, IDENTIFIER_REGEX;
@@ -16856,63 +16864,6 @@ var init_hnswlib_node = __esm({
16856
16864
  }
16857
16865
  });
16858
16866
 
16859
- // native-require:pg
16860
- var pg_exports = {};
16861
- __export(pg_exports, {
16862
- DotProductAttention: () => DotProductAttention7,
16863
- FlashAttention: () => FlashAttention7,
16864
- HyperbolicAttention: () => HyperbolicAttention7,
16865
- LinearAttention: () => LinearAttention7,
16866
- MoEAttention: () => MoEAttention7,
16867
- MultiHeadAttention: () => MultiHeadAttention7,
16868
- RuvectorLayer: () => RuvectorLayer7,
16869
- SonaEngine: () => SonaEngine7,
16870
- TensorCompress: () => TensorCompress7,
16871
- default: () => pg_default,
16872
- differentiableSearch: () => differentiableSearch7,
16873
- getCompressionLevel: () => getCompressionLevel7,
16874
- hierarchicalForward: () => hierarchicalForward7,
16875
- init: () => init7,
16876
- pipeline: () => pipeline8
16877
- });
16878
- import { createRequire as createRequire7 } from "module";
16879
- var __require8, __mod7, pg_default, RuvectorLayer7, TensorCompress7, differentiableSearch7, hierarchicalForward7, getCompressionLevel7, init7, FlashAttention7, DotProductAttention7, MultiHeadAttention7, HyperbolicAttention7, LinearAttention7, MoEAttention7, SonaEngine7, pipeline8;
16880
- var init_pg = __esm({
16881
- "native-require:pg"() {
16882
- __require8 = createRequire7(import.meta.url);
16883
- __mod7 = __require8("pg");
16884
- pg_default = __mod7;
16885
- ({
16886
- RuvectorLayer: (
16887
- // @ruvector/gnn
16888
- RuvectorLayer7
16889
- ),
16890
- TensorCompress: TensorCompress7,
16891
- differentiableSearch: differentiableSearch7,
16892
- hierarchicalForward: hierarchicalForward7,
16893
- getCompressionLevel: getCompressionLevel7,
16894
- init: init7,
16895
- FlashAttention: (
16896
- // @ruvector/attention
16897
- FlashAttention7
16898
- ),
16899
- DotProductAttention: DotProductAttention7,
16900
- MultiHeadAttention: MultiHeadAttention7,
16901
- HyperbolicAttention: HyperbolicAttention7,
16902
- LinearAttention: LinearAttention7,
16903
- MoEAttention: MoEAttention7,
16904
- SonaEngine: (
16905
- // @ruvector/sona
16906
- SonaEngine7
16907
- ),
16908
- pipeline: (
16909
- // @xenova/transformers
16910
- pipeline8
16911
- )
16912
- } = __mod7 || {});
16913
- }
16914
- });
16915
-
16916
16867
  // src/learning/qe-reasoning-bank.ts
16917
16868
  var qe_reasoning_bank_exports = {};
16918
16869
  __export(qe_reasoning_bank_exports, {
@@ -18314,57 +18265,57 @@ On promotion:
18314
18265
  // native-require:prime-radiant-advanced-wasm
18315
18266
  var prime_radiant_advanced_wasm_exports = {};
18316
18267
  __export(prime_radiant_advanced_wasm_exports, {
18317
- DotProductAttention: () => DotProductAttention8,
18318
- FlashAttention: () => FlashAttention8,
18319
- HyperbolicAttention: () => HyperbolicAttention8,
18320
- LinearAttention: () => LinearAttention8,
18321
- MoEAttention: () => MoEAttention8,
18322
- MultiHeadAttention: () => MultiHeadAttention8,
18323
- RuvectorLayer: () => RuvectorLayer8,
18324
- SonaEngine: () => SonaEngine8,
18325
- TensorCompress: () => TensorCompress8,
18268
+ DotProductAttention: () => DotProductAttention7,
18269
+ FlashAttention: () => FlashAttention7,
18270
+ HyperbolicAttention: () => HyperbolicAttention7,
18271
+ LinearAttention: () => LinearAttention7,
18272
+ MoEAttention: () => MoEAttention7,
18273
+ MultiHeadAttention: () => MultiHeadAttention7,
18274
+ RuvectorLayer: () => RuvectorLayer7,
18275
+ SonaEngine: () => SonaEngine7,
18276
+ TensorCompress: () => TensorCompress7,
18326
18277
  default: () => prime_radiant_advanced_wasm_default,
18327
- differentiableSearch: () => differentiableSearch8,
18328
- getCompressionLevel: () => getCompressionLevel8,
18329
- hierarchicalForward: () => hierarchicalForward8,
18330
- init: () => init8,
18331
- pipeline: () => pipeline9
18278
+ differentiableSearch: () => differentiableSearch7,
18279
+ getCompressionLevel: () => getCompressionLevel7,
18280
+ hierarchicalForward: () => hierarchicalForward7,
18281
+ init: () => init7,
18282
+ pipeline: () => pipeline8
18332
18283
  });
18333
18284
  import { createRequire as createRequire8 } from "module";
18334
- var __require9, __mod8, prime_radiant_advanced_wasm_default, RuvectorLayer8, TensorCompress8, differentiableSearch8, hierarchicalForward8, getCompressionLevel8, init8, FlashAttention8, DotProductAttention8, MultiHeadAttention8, HyperbolicAttention8, LinearAttention8, MoEAttention8, SonaEngine8, pipeline9;
18285
+ var __require8, __mod7, prime_radiant_advanced_wasm_default, RuvectorLayer7, TensorCompress7, differentiableSearch7, hierarchicalForward7, getCompressionLevel7, init7, FlashAttention7, DotProductAttention7, MultiHeadAttention7, HyperbolicAttention7, LinearAttention7, MoEAttention7, SonaEngine7, pipeline8;
18335
18286
  var init_prime_radiant_advanced_wasm = __esm({
18336
18287
  "native-require:prime-radiant-advanced-wasm"() {
18337
- __require9 = createRequire8(import.meta.url);
18338
- __mod8 = __require9("prime-radiant-advanced-wasm");
18339
- prime_radiant_advanced_wasm_default = __mod8;
18288
+ __require8 = createRequire8(import.meta.url);
18289
+ __mod7 = __require8("prime-radiant-advanced-wasm");
18290
+ prime_radiant_advanced_wasm_default = __mod7;
18340
18291
  ({
18341
18292
  RuvectorLayer: (
18342
18293
  // @ruvector/gnn
18343
- RuvectorLayer8
18294
+ RuvectorLayer7
18344
18295
  ),
18345
- TensorCompress: TensorCompress8,
18346
- differentiableSearch: differentiableSearch8,
18347
- hierarchicalForward: hierarchicalForward8,
18348
- getCompressionLevel: getCompressionLevel8,
18349
- init: init8,
18296
+ TensorCompress: TensorCompress7,
18297
+ differentiableSearch: differentiableSearch7,
18298
+ hierarchicalForward: hierarchicalForward7,
18299
+ getCompressionLevel: getCompressionLevel7,
18300
+ init: init7,
18350
18301
  FlashAttention: (
18351
18302
  // @ruvector/attention
18352
- FlashAttention8
18303
+ FlashAttention7
18353
18304
  ),
18354
- DotProductAttention: DotProductAttention8,
18355
- MultiHeadAttention: MultiHeadAttention8,
18356
- HyperbolicAttention: HyperbolicAttention8,
18357
- LinearAttention: LinearAttention8,
18358
- MoEAttention: MoEAttention8,
18305
+ DotProductAttention: DotProductAttention7,
18306
+ MultiHeadAttention: MultiHeadAttention7,
18307
+ HyperbolicAttention: HyperbolicAttention7,
18308
+ LinearAttention: LinearAttention7,
18309
+ MoEAttention: MoEAttention7,
18359
18310
  SonaEngine: (
18360
18311
  // @ruvector/sona
18361
- SonaEngine8
18312
+ SonaEngine7
18362
18313
  ),
18363
18314
  pipeline: (
18364
18315
  // @xenova/transformers
18365
- pipeline9
18316
+ pipeline8
18366
18317
  )
18367
- } = __mod8 || {});
18318
+ } = __mod7 || {});
18368
18319
  }
18369
18320
  });
18370
18321
 
@@ -25357,7 +25308,7 @@ var BaseTestGenerator = class _BaseTestGenerator {
25357
25308
  for (const [typeKey, generator] of _BaseTestGenerator.TYPE_VALUE_TABLE) {
25358
25309
  if (type.includes(typeKey)) return generator();
25359
25310
  }
25360
- return `mock${param.name.charAt(0).toUpperCase() + param.name.slice(1)}`;
25311
+ return `{} /* TODO: provide ${param.name}: ${param.type || "unknown"} */`;
25361
25312
  }
25362
25313
  /**
25363
25314
  * Generate test cases for a function based on its signature
@@ -25370,21 +25321,46 @@ var BaseTestGenerator = class _BaseTestGenerator {
25370
25321
  const testCases = [];
25371
25322
  const validParams = fn.parameters.map((p74) => this.generateTestValue(p74)).join(", ");
25372
25323
  const fnCall = fn.isAsync ? `await ${fn.name}(${validParams})` : `${fn.name}(${validParams})`;
25324
+ const isVoid = fn.returnType === "void" || fn.returnType === "Promise<void>";
25373
25325
  testCases.push({
25374
25326
  description: "should handle valid input correctly",
25375
25327
  type: "happy-path",
25376
- action: `const result = ${fnCall};`,
25377
- assertion: "expect(result).toBeDefined();"
25328
+ action: isVoid ? `${fnCall};` : `const result = ${fnCall};`,
25329
+ assertion: isVoid ? `// void function \u2014 no return value to assert` : "expect(result).toBeDefined();"
25378
25330
  });
25331
+ const bodyText = fn.body || "";
25332
+ const hasExplicitThrow = /\bthrow\b/.test(bodyText) || /\bvalidat/i.test(bodyText);
25379
25333
  for (const param of fn.parameters) {
25380
25334
  if (!param.optional) {
25381
25335
  const paramsWithUndefined = fn.parameters.map((p74) => p74.name === param.name ? "undefined" : this.generateTestValue(p74)).join(", ");
25382
- testCases.push({
25383
- description: `should handle undefined ${param.name}`,
25384
- type: "error-handling",
25385
- action: fn.isAsync ? `const action = async () => await ${fn.name}(${paramsWithUndefined});` : `const action = () => ${fn.name}(${paramsWithUndefined});`,
25386
- assertion: "expect(action).toThrow();"
25387
- });
25336
+ if (hasExplicitThrow) {
25337
+ testCases.push({
25338
+ description: `should handle undefined ${param.name}`,
25339
+ type: "error-handling",
25340
+ action: fn.isAsync ? `const action = async () => await ${fn.name}(${paramsWithUndefined});` : `const action = () => ${fn.name}(${paramsWithUndefined});`,
25341
+ assertion: "expect(action).toThrow();"
25342
+ });
25343
+ } else {
25344
+ const undefinedCall = fn.isAsync ? `await ${fn.name}(${paramsWithUndefined})` : `${fn.name}(${paramsWithUndefined})`;
25345
+ testCases.push({
25346
+ description: `should handle undefined ${param.name}`,
25347
+ type: "edge-case",
25348
+ action: fn.isAsync ? `let threw = false;
25349
+ try {
25350
+ await ${fn.name}(${paramsWithUndefined});
25351
+ } catch (e) {
25352
+ threw = true;
25353
+ expect(e).toBeInstanceOf(Error);
25354
+ }` : `let threw = false;
25355
+ try {
25356
+ ${fn.name}(${paramsWithUndefined});
25357
+ } catch (e) {
25358
+ threw = true;
25359
+ expect(e).toBeInstanceOf(Error);
25360
+ }`,
25361
+ assertion: `expect(true).toBe(true); // function either handles undefined or throws TypeError`
25362
+ });
25363
+ }
25388
25364
  }
25389
25365
  testCases.push(...this.generateBoundaryTestCases(fn, param));
25390
25366
  }
@@ -25404,32 +25380,48 @@ var BaseTestGenerator = class _BaseTestGenerator {
25404
25380
  generateBoundaryTestCases(fn, param) {
25405
25381
  const testCases = [];
25406
25382
  const type = param.type?.toLowerCase() || "";
25383
+ const wrapBoundaryAction = (call, isAsync) => {
25384
+ if (isAsync) {
25385
+ return `try {
25386
+ const result = await ${call};
25387
+ expect(result).toBeDefined();
25388
+ } catch (e) {
25389
+ expect(e).toBeInstanceOf(Error);
25390
+ }`;
25391
+ }
25392
+ return `try {
25393
+ const result = ${call};
25394
+ expect(result).toBeDefined();
25395
+ } catch (e) {
25396
+ expect(e).toBeInstanceOf(Error);
25397
+ }`;
25398
+ };
25407
25399
  if (type.includes("string")) {
25408
25400
  const paramsWithEmpty = fn.parameters.map((p74) => p74.name === param.name ? "''" : this.generateTestValue(p74)).join(", ");
25409
- const emptyCall = fn.isAsync ? `await ${fn.name}(${paramsWithEmpty})` : `${fn.name}(${paramsWithEmpty})`;
25401
+ const emptyCall = `${fn.name}(${paramsWithEmpty})`;
25410
25402
  testCases.push({
25411
25403
  description: `should handle empty string for ${param.name}`,
25412
25404
  type: "boundary",
25413
- action: `const result = ${emptyCall};`,
25414
- assertion: "expect(result).toBeDefined();"
25405
+ action: wrapBoundaryAction(emptyCall, fn.isAsync),
25406
+ assertion: ""
25415
25407
  });
25416
25408
  }
25417
25409
  if (type.includes("number")) {
25418
25410
  const paramsWithZero = fn.parameters.map((p74) => p74.name === param.name ? "0" : this.generateTestValue(p74)).join(", ");
25419
- const zeroCall = fn.isAsync ? `await ${fn.name}(${paramsWithZero})` : `${fn.name}(${paramsWithZero})`;
25411
+ const zeroCall = `${fn.name}(${paramsWithZero})`;
25420
25412
  testCases.push({
25421
25413
  description: `should handle zero for ${param.name}`,
25422
25414
  type: "boundary",
25423
- action: `const result = ${zeroCall};`,
25424
- assertion: "expect(result).toBeDefined();"
25415
+ action: wrapBoundaryAction(zeroCall, fn.isAsync),
25416
+ assertion: ""
25425
25417
  });
25426
25418
  const paramsWithNegative = fn.parameters.map((p74) => p74.name === param.name ? "-1" : this.generateTestValue(p74)).join(", ");
25427
- const negativeCall = fn.isAsync ? `await ${fn.name}(${paramsWithNegative})` : `${fn.name}(${paramsWithNegative})`;
25419
+ const negativeCall = `${fn.name}(${paramsWithNegative})`;
25428
25420
  testCases.push({
25429
25421
  description: `should handle negative value for ${param.name}`,
25430
25422
  type: "edge-case",
25431
- action: `const result = ${negativeCall};`,
25432
- assertion: "expect(result).toBeDefined();"
25423
+ action: wrapBoundaryAction(negativeCall, fn.isAsync),
25424
+ assertion: ""
25433
25425
  });
25434
25426
  }
25435
25427
  if (type.includes("[]") || type.includes("array")) {
@@ -25527,24 +25519,31 @@ ${importStatement}
25527
25519
  `;
25528
25520
  if (dependencies && dependencies.imports.length > 0) {
25529
25521
  const mockFn = this.framework === "vitest" ? "vi.fn()" : "jest.fn()";
25530
- testCode += `
25522
+ const externalDeps = dependencies.imports.filter((dep) => !dep.startsWith("."));
25523
+ if (externalDeps.length > 0) {
25524
+ testCode += `
25531
25525
  // Auto-generated mocks from Knowledge Graph dependency analysis
25532
25526
  `;
25533
- for (const dep of dependencies.imports.slice(0, 10)) {
25534
- const depName = dep.split("/").pop()?.replace(/[^a-zA-Z0-9_]/g, "_") || dep;
25535
- testCode += `${this.framework === "vitest" ? "vi" : "jest"}.mock('${dep}', () => ({ default: ${mockFn} }));
25527
+ for (const dep of externalDeps.slice(0, 10)) {
25528
+ testCode += `${this.framework === "vitest" ? "vi" : "jest"}.mock('${dep}', () => ({ default: ${mockFn} }));
25536
25529
  `;
25537
- }
25538
- testCode += `
25530
+ }
25531
+ testCode += `
25539
25532
  `;
25533
+ } else {
25534
+ testCode += `
25535
+ `;
25536
+ }
25540
25537
  } else {
25541
25538
  testCode += `
25542
25539
  `;
25543
25540
  }
25544
- for (const fn of analysis.functions) {
25541
+ const exportedFns = analysis.functions.filter((fn) => fn.isExported);
25542
+ const exportedClasses = analysis.classes.filter((cls) => cls.isExported);
25543
+ for (const fn of exportedFns) {
25545
25544
  testCode += this.generateFunctionTests(fn, testType);
25546
25545
  }
25547
- for (const cls of analysis.classes) {
25546
+ for (const cls of exportedClasses) {
25548
25547
  testCode += this.generateClassTests(cls, testType);
25549
25548
  }
25550
25549
  return testCode;
@@ -25631,24 +25630,52 @@ ${importStatement}
25631
25630
  const validParams = method.parameters.map((p74) => this.generateTestValue(p74)).join(", ");
25632
25631
  const methodCall = method.isAsync ? `await instance.${method.name}(${validParams})` : `instance.${method.name}(${validParams})`;
25633
25632
  const asyncPrefix = method.isAsync ? "async " : "";
25633
+ const isVoid = method.returnType === "void" || method.returnType === "Promise<void>";
25634
25634
  code += ` it('should execute successfully', ${asyncPrefix}() => {
25635
25635
  `;
25636
- code += ` const result = ${methodCall};
25636
+ if (isVoid) {
25637
+ code += ` ${methodCall};
25637
25638
  `;
25638
- code += ` expect(result).toBeDefined();
25639
+ code += ` // void return \u2014 no assertion on result needed
25639
25640
  `;
25641
+ } else {
25642
+ code += ` const result = ${methodCall};
25643
+ `;
25644
+ code += ` expect(result).toBeDefined();
25645
+ `;
25646
+ }
25640
25647
  code += ` });
25641
25648
  `;
25649
+ const methodBody = method.body || "";
25650
+ const methodThrows = /\bthrow\b/.test(methodBody) || /\bvalidat/i.test(methodBody);
25642
25651
  for (const param of method.parameters) {
25643
25652
  if (!param.optional) {
25644
25653
  const paramsWithUndefined = method.parameters.map((p74) => p74.name === param.name ? "undefined as any" : this.generateTestValue(p74)).join(", ");
25645
- code += `
25646
- it('should handle invalid ${param.name}', () => {
25654
+ if (methodThrows) {
25655
+ code += `
25656
+ it('should handle invalid ${param.name}', ${asyncPrefix}() => {
25647
25657
  `;
25648
- code += ` expect(() => instance.${method.name}(${paramsWithUndefined})).toThrow();
25658
+ code += ` expect(() => instance.${method.name}(${paramsWithUndefined})).toThrow();
25649
25659
  `;
25650
- code += ` });
25660
+ code += ` });
25661
+ `;
25662
+ } else {
25663
+ code += `
25664
+ it('should handle undefined ${param.name}', ${asyncPrefix}() => {
25665
+ `;
25666
+ code += ` try {
25667
+ `;
25668
+ code += ` ${method.isAsync ? "await " : ""}instance.${method.name}(${paramsWithUndefined});
25669
+ `;
25670
+ code += ` } catch (e) {
25671
+ `;
25672
+ code += ` expect(e).toBeInstanceOf(Error);
25673
+ `;
25674
+ code += ` }
25675
+ `;
25676
+ code += ` });
25651
25677
  `;
25678
+ }
25652
25679
  }
25653
25680
  }
25654
25681
  code += ` });
@@ -25668,12 +25695,15 @@ ${importStatement}
25668
25695
  let mockDeclarations = "";
25669
25696
  if (dependencies && dependencies.imports.length > 0) {
25670
25697
  const mockFn = this.framework === "vitest" ? "vi.fn()" : "jest.fn()";
25671
- mockDeclarations += `
25698
+ const externalDeps = dependencies.imports.filter((dep) => !dep.startsWith("."));
25699
+ if (externalDeps.length > 0) {
25700
+ mockDeclarations += `
25672
25701
  // Auto-generated mocks from Knowledge Graph dependency analysis
25673
25702
  `;
25674
- for (const dep of dependencies.imports.slice(0, 10)) {
25675
- mockDeclarations += `${this.mockUtil}.mock('${dep}', () => ({ default: ${mockFn} }));
25703
+ for (const dep of externalDeps.slice(0, 10)) {
25704
+ mockDeclarations += `${this.mockUtil}.mock('${dep}', () => ({ default: ${mockFn} }));
25676
25705
  `;
25706
+ }
25677
25707
  }
25678
25708
  }
25679
25709
  let similarityComment = "";
@@ -25950,10 +25980,11 @@ var MochaGenerator = class extends BaseTestGenerator {
25950
25980
  const importStatement = this.generateImportStatement(exports, importPath, moduleName);
25951
25981
  let sinonImport = "";
25952
25982
  let stubSetup = "";
25953
- if (dependencies && dependencies.imports.length > 0) {
25983
+ const externalDeps = dependencies?.imports.filter((dep) => !dep.startsWith(".")) || [];
25984
+ if (externalDeps.length > 0) {
25954
25985
  sinonImport = `import sinon from 'sinon';
25955
25986
  `;
25956
- const depsToMock = dependencies.imports.slice(0, 5);
25987
+ const depsToMock = externalDeps.slice(0, 5);
25957
25988
  stubSetup += ` // Auto-generated stubs from Knowledge Graph dependency analysis
25958
25989
  `;
25959
25990
  stubSetup += ` let stubs;
@@ -25986,10 +26017,12 @@ ${sinonImport}${importStatement}
25986
26017
 
25987
26018
  describe('${moduleName} - ${testType} tests', function() {
25988
26019
  ${stubSetup}`;
25989
- for (const fn of analysis.functions) {
26020
+ const exportedFns = analysis.functions.filter((fn) => fn.isExported);
26021
+ const exportedClasses = analysis.classes.filter((cls) => cls.isExported);
26022
+ for (const fn of exportedFns) {
25990
26023
  code += this.generateFunctionTests(fn, testType);
25991
26024
  }
25992
- for (const cls of analysis.classes) {
26025
+ for (const cls of exportedClasses) {
25993
26026
  code += this.generateClassTests(cls, testType);
25994
26027
  }
25995
26028
  code += `});
@@ -26002,26 +26035,52 @@ ${stubSetup}`;
26002
26035
  generateFunctionTests(fn, _testType) {
26003
26036
  const validParams = fn.parameters.map((p74) => this.generateTestValue(p74)).join(", ");
26004
26037
  const fnCall = fn.isAsync ? `await ${fn.name}(${validParams})` : `${fn.name}(${validParams})`;
26038
+ const isVoid = fn.returnType === "void" || fn.returnType === "Promise<void>";
26005
26039
  let code = ` describe('${fn.name}', function() {
26006
26040
  `;
26007
26041
  code += ` it('should handle valid input', ${fn.isAsync ? "async " : ""}function() {
26008
26042
  `;
26009
- code += ` const result = ${fnCall};
26043
+ if (isVoid) {
26044
+ code += ` ${fnCall};
26045
+ `;
26046
+ } else {
26047
+ code += ` const result = ${fnCall};
26010
26048
  `;
26011
- code += ` expect(result).to.not.be.undefined;
26049
+ code += ` expect(result).to.not.be.undefined;
26012
26050
  `;
26051
+ }
26013
26052
  code += ` });
26014
26053
  `;
26054
+ const bodyText = fn.body || "";
26055
+ const hasExplicitThrow = /\bthrow\b/.test(bodyText) || /\bvalidat/i.test(bodyText);
26015
26056
  for (const param of fn.parameters) {
26016
26057
  if (!param.optional) {
26017
26058
  const paramsWithUndefined = fn.parameters.map((p74) => p74.name === param.name ? "undefined" : this.generateTestValue(p74)).join(", ");
26018
- code += `
26059
+ if (hasExplicitThrow) {
26060
+ code += `
26019
26061
  it('should handle undefined ${param.name}', function() {
26020
26062
  `;
26021
- code += ` expect(function() { ${fn.name}(${paramsWithUndefined}); }).to.throw();
26063
+ code += ` expect(function() { ${fn.name}(${paramsWithUndefined}); }).to.throw();
26022
26064
  `;
26023
- code += ` });
26065
+ code += ` });
26066
+ `;
26067
+ } else {
26068
+ code += `
26069
+ it('should handle undefined ${param.name}', function() {
26070
+ `;
26071
+ code += ` try {
26072
+ `;
26073
+ code += ` ${fn.name}(${paramsWithUndefined});
26074
+ `;
26075
+ code += ` } catch (e) {
26076
+ `;
26077
+ code += ` expect(e).to.be.instanceOf(Error);
26024
26078
  `;
26079
+ code += ` }
26080
+ `;
26081
+ code += ` });
26082
+ `;
26083
+ }
26025
26084
  }
26026
26085
  }
26027
26086
  code += ` });
@@ -26055,13 +26114,19 @@ ${stubSetup}`;
26055
26114
  for (const method of cls.methods) {
26056
26115
  if (!method.name.startsWith("_")) {
26057
26116
  const methodParams = method.parameters.map((p74) => this.generateTestValue(p74)).join(", ");
26117
+ const isVoid = method.returnType === "void" || method.returnType === "Promise<void>";
26058
26118
  code += `
26059
26119
  it('${method.name} should work', ${method.isAsync ? "async " : ""}function() {
26060
26120
  `;
26061
- code += ` const result = ${method.isAsync ? "await " : ""}instance.${method.name}(${methodParams});
26121
+ if (isVoid) {
26122
+ code += ` ${method.isAsync ? "await " : ""}instance.${method.name}(${methodParams});
26123
+ `;
26124
+ } else {
26125
+ code += ` const result = ${method.isAsync ? "await " : ""}instance.${method.name}(${methodParams});
26062
26126
  `;
26063
- code += ` expect(result).to.not.be.undefined;
26127
+ code += ` expect(result).to.not.be.undefined;
26064
26128
  `;
26129
+ }
26065
26130
  code += ` });
26066
26131
  `;
26067
26132
  }
@@ -26084,10 +26149,11 @@ ${stubSetup}`;
26084
26149
  let sinonImport = "";
26085
26150
  let stubSetup = "";
26086
26151
  let stubTeardown = "";
26087
- if (dependencies && dependencies.imports.length > 0) {
26152
+ const stubExternalDeps = dependencies?.imports.filter((dep) => !dep.startsWith(".")) || [];
26153
+ if (stubExternalDeps.length > 0) {
26088
26154
  sinonImport = `import sinon from 'sinon';
26089
26155
  `;
26090
- const depsToMock = dependencies.imports.slice(0, 5);
26156
+ const depsToMock = stubExternalDeps.slice(0, 5);
26091
26157
  stubSetup += `
26092
26158
  // Auto-generated stubs from Knowledge Graph dependency analysis
26093
26159
  `;
@@ -26258,12 +26324,13 @@ var PytestGenerator = class extends BaseTestGenerator {
26258
26324
  const exports = this.extractExports(analysis.functions, analysis.classes);
26259
26325
  const pythonImport = importPath.replace(/\//g, ".").replace(/\.(ts|js)$/, "");
26260
26326
  const importStatement = exports.length > 0 ? `from ${pythonImport} import ${exports.join(", ")}` : `import ${pythonImport} as ${moduleName}`;
26327
+ const externalDeps = dependencies?.imports.filter((dep) => !dep.startsWith(".")) || [];
26261
26328
  let mockImport = "";
26262
- if (dependencies && dependencies.imports.length > 0) {
26329
+ if (externalDeps.length > 0) {
26263
26330
  mockImport = `from unittest.mock import patch, MagicMock
26264
26331
  `;
26265
26332
  }
26266
- const depsToMock = dependencies?.imports.slice(0, 5) || [];
26333
+ const depsToMock = externalDeps.slice(0, 5);
26267
26334
  const patchDecorators = depsToMock.map((dep) => {
26268
26335
  const depModule = dep.replace(/\//g, ".").replace(/\.py$/, "");
26269
26336
  return `@patch('${depModule}')`;
@@ -26276,10 +26343,12 @@ class Test${this.pascalCase(moduleName)}:
26276
26343
  """${testType} tests for ${moduleName}"""
26277
26344
 
26278
26345
  `;
26279
- for (const fn of analysis.functions) {
26346
+ const exportedFns = analysis.functions.filter((fn) => fn.isExported);
26347
+ const exportedClasses = analysis.classes.filter((cls) => cls.isExported);
26348
+ for (const fn of exportedFns) {
26280
26349
  code += this.generateFunctionTestsWithPatches(fn, testType, patchDecorators);
26281
26350
  }
26282
- for (const cls of analysis.classes) {
26351
+ for (const cls of exportedClasses) {
26283
26352
  code += this.generateClassTests(cls, testType);
26284
26353
  }
26285
26354
  return code;
@@ -26299,15 +26368,22 @@ class Test${this.pascalCase(moduleName)}:
26299
26368
  const allParams = mockParams ? `self, ${mockParams}` : "self";
26300
26369
  const patchPrefix = patchDecorators.map((d74) => ` ${d74}
26301
26370
  `).join("");
26371
+ const isVoid = fn.returnType === "void" || fn.returnType === "Promise<void>" || fn.returnType === "None";
26302
26372
  let code = `${patchPrefix} def test_${fn.name}_valid_input(${allParams}):
26303
26373
  `;
26304
26374
  code += ` """Test ${fn.name} with valid input"""
26305
26375
  `;
26306
- code += ` result = ${fn.name}(${validParams})
26376
+ if (isVoid) {
26377
+ code += ` ${fn.name}(${validParams}) # void function
26378
+
26379
+ `;
26380
+ } else {
26381
+ code += ` result = ${fn.name}(${validParams})
26307
26382
  `;
26308
- code += ` assert result is not None
26383
+ code += ` assert result is not None
26309
26384
 
26310
26385
  `;
26386
+ }
26311
26387
  for (const param of fn.parameters) {
26312
26388
  if (!param.optional && param.type?.includes("str")) {
26313
26389
  code += `${patchPrefix} def test_${fn.name}_empty_${param.name}(${allParams}):
@@ -26350,13 +26426,20 @@ class Test${cls.name}:
26350
26426
  for (const method of cls.methods) {
26351
26427
  if (!method.name.startsWith("_")) {
26352
26428
  const methodParams = method.parameters.map((p74) => this.generatePythonTestValue(p74)).join(", ");
26429
+ const isVoid = method.returnType === "void" || method.returnType === "Promise<void>";
26353
26430
  code += ` def test_${method.name}(self, instance):
26354
26431
  `;
26355
- code += ` result = instance.${method.name}(${methodParams})
26432
+ if (isVoid) {
26433
+ code += ` instance.${method.name}(${methodParams})
26434
+
26356
26435
  `;
26357
- code += ` assert result is not None
26436
+ } else {
26437
+ code += ` result = instance.${method.name}(${methodParams})
26438
+ `;
26439
+ code += ` assert result is not None
26358
26440
 
26359
26441
  `;
26442
+ }
26360
26443
  }
26361
26444
  }
26362
26445
  return code;
@@ -26374,11 +26457,11 @@ class Test${cls.name}:
26374
26457
  const asyncDef = isAsync ? "async def" : "def";
26375
26458
  let mockImports = "";
26376
26459
  let mockPatches = "";
26377
- if (dependencies && dependencies.imports.length > 0) {
26460
+ const stubExternalDeps = dependencies?.imports.filter((dep) => !dep.startsWith(".")) || [];
26461
+ if (stubExternalDeps.length > 0) {
26378
26462
  mockImports = `from unittest.mock import patch, MagicMock
26379
26463
  `;
26380
- const depsToMock = dependencies.imports.slice(0, 5);
26381
- for (const dep of depsToMock) {
26464
+ for (const dep of stubExternalDeps.slice(0, 5)) {
26382
26465
  const depModule = dep.replace(/\//g, ".").replace(/\.py$/, "");
26383
26466
  mockPatches += ` @patch('${depModule}')
26384
26467
  `;
@@ -28019,12 +28102,18 @@ ${sourceCode}
28019
28102
  const callees = [];
28020
28103
  const callers = [];
28021
28104
  const tsImports = sourceContent.matchAll(/(?:import|from)\s+['"]([^'"]+)['"]/g);
28022
- const pyImports = sourceContent.matchAll(/(?:^|\n)\s*(?:from\s+(\S+)\s+import|import\s+(\S+))/g);
28023
28105
  for (const match of tsImports) {
28024
28106
  imports.push(match[1]);
28025
28107
  }
28026
- for (const match of pyImports) {
28027
- imports.push(match[1] || match[2]);
28108
+ const isPython = filePath.endsWith(".py");
28109
+ if (isPython) {
28110
+ const pyImports = sourceContent.matchAll(/(?:^|\n)\s*(?:from\s+(\S+)\s+import|import\s+(\S+))/g);
28111
+ for (const match of pyImports) {
28112
+ const mod = match[1] || match[2];
28113
+ if (mod && /^[a-zA-Z_][\w.]*$/.test(mod)) {
28114
+ imports.push(mod);
28115
+ }
28116
+ }
28028
28117
  }
28029
28118
  const normalizedPath = filePath.replace(/\\/g, "/");
28030
28119
  const baseName = normalizedPath.split("/").pop()?.replace(/\.(ts|js|tsx|jsx|py)$/, "") || "";
@@ -28486,7 +28575,7 @@ var PatternMatcherService = class _PatternMatcherService {
28486
28575
  return template.replace("{{name}}", param.name);
28487
28576
  }
28488
28577
  }
28489
- return `mock${param.name.charAt(0).toUpperCase() + param.name.slice(1)}`;
28578
+ return `{} /* TODO: provide ${param.name}: ${param.type || "unknown"} */`;
28490
28579
  }
28491
28580
  /**
28492
28581
  * Estimate number of branches from cyclomatic complexity
@@ -114551,7 +114640,7 @@ function parsePipelineContent(content, sourcePath) {
114551
114640
  if (errors.length > 0) {
114552
114641
  return { success: false, errors };
114553
114642
  }
114554
- const pipeline11 = {
114643
+ const pipeline10 = {
114555
114644
  name: parsed.name,
114556
114645
  description: parsed.description,
114557
114646
  version: parsed.version || "1.0.0",
@@ -114573,26 +114662,26 @@ function parsePipelineContent(content, sourcePath) {
114573
114662
  tags: parsed.tags,
114574
114663
  timeout: parsed.timeout
114575
114664
  };
114576
- for (let i58 = 0; i58 < pipeline11.stages.length; i58++) {
114577
- const stage = pipeline11.stages[i58];
114665
+ for (let i58 = 0; i58 < pipeline10.stages.length; i58++) {
114666
+ const stage = pipeline10.stages[i58];
114578
114667
  if (!stage.command) {
114579
114668
  errors.push(`Stage ${i58 + 1} (${stage.name}) must have a "command" field`);
114580
114669
  }
114581
114670
  }
114582
114671
  if (errors.length > 0) {
114583
- return { success: false, pipeline: pipeline11, errors };
114672
+ return { success: false, pipeline: pipeline10, errors };
114584
114673
  }
114585
- const workflow = convertToWorkflowDefinition(pipeline11, sourcePath);
114674
+ const workflow = convertToWorkflowDefinition(pipeline10, sourcePath);
114586
114675
  return {
114587
114676
  success: true,
114588
- pipeline: pipeline11,
114677
+ pipeline: pipeline10,
114589
114678
  workflow,
114590
114679
  errors: []
114591
114680
  };
114592
114681
  }
114593
- function convertToWorkflowDefinition(pipeline11, sourcePath) {
114594
- const workflowId = `pipeline-${pipeline11.name.replace(/\s+/g, "-").toLowerCase()}`;
114595
- const steps = pipeline11.stages.map((stage, index) => {
114682
+ function convertToWorkflowDefinition(pipeline10, sourcePath) {
114683
+ const workflowId = `pipeline-${pipeline10.name.replace(/\s+/g, "-").toLowerCase()}`;
114684
+ const steps = pipeline10.stages.map((stage, index) => {
114596
114685
  const domainAction = mapCommandToDomainAction(stage.command);
114597
114686
  const inputMapping = {};
114598
114687
  if (stage.params) {
@@ -114626,7 +114715,7 @@ function convertToWorkflowDefinition(pipeline11, sourcePath) {
114626
114715
  }
114627
114716
  return step;
114628
114717
  });
114629
- const triggers = pipeline11.triggers?.map((trigger) => {
114718
+ const triggers = pipeline10.triggers?.map((trigger) => {
114630
114719
  const workflowTrigger = {
114631
114720
  eventType: mapTriggerEventType(trigger),
114632
114721
  sourceDomain: trigger.source_domain
@@ -114642,13 +114731,13 @@ function convertToWorkflowDefinition(pipeline11, sourcePath) {
114642
114731
  });
114643
114732
  return {
114644
114733
  id: workflowId,
114645
- name: pipeline11.name,
114646
- description: pipeline11.description || `Pipeline from ${sourcePath || "inline YAML"}`,
114647
- version: pipeline11.version || "1.0.0",
114734
+ name: pipeline10.name,
114735
+ description: pipeline10.description || `Pipeline from ${sourcePath || "inline YAML"}`,
114736
+ version: pipeline10.version || "1.0.0",
114648
114737
  steps,
114649
114738
  triggers,
114650
- tags: pipeline11.tags,
114651
- timeout: pipeline11.timeout ? pipeline11.timeout * 1e3 : void 0
114739
+ tags: pipeline10.tags,
114740
+ timeout: pipeline10.timeout ? pipeline10.timeout * 1e3 : void 0
114652
114741
  };
114653
114742
  }
114654
114743
  function mapCommandToDomainAction(command) {
@@ -114697,17 +114786,17 @@ function mapTriggerEventType(trigger) {
114697
114786
  }
114698
114787
  return event;
114699
114788
  }
114700
- function validatePipeline(pipeline11) {
114789
+ function validatePipeline(pipeline10) {
114701
114790
  const errors = [];
114702
114791
  const warnings = [];
114703
- if (!pipeline11.name) {
114792
+ if (!pipeline10.name) {
114704
114793
  errors.push({
114705
114794
  path: "name",
114706
114795
  message: "Pipeline name is required",
114707
114796
  severity: "error"
114708
114797
  });
114709
114798
  }
114710
- if (!pipeline11.stages || pipeline11.stages.length === 0) {
114799
+ if (!pipeline10.stages || pipeline10.stages.length === 0) {
114711
114800
  errors.push({
114712
114801
  path: "stages",
114713
114802
  message: "Pipeline must have at least one stage",
@@ -114715,8 +114804,8 @@ function validatePipeline(pipeline11) {
114715
114804
  });
114716
114805
  } else {
114717
114806
  const stageNames = /* @__PURE__ */ new Set();
114718
- for (let i58 = 0; i58 < pipeline11.stages.length; i58++) {
114719
- const stage = pipeline11.stages[i58];
114807
+ for (let i58 = 0; i58 < pipeline10.stages.length; i58++) {
114808
+ const stage = pipeline10.stages[i58];
114720
114809
  const stagePath = `stages[${i58}]`;
114721
114810
  if (stageNames.has(stage.name)) {
114722
114811
  errors.push({
@@ -114744,7 +114833,7 @@ function validatePipeline(pipeline11) {
114744
114833
  }
114745
114834
  if (stage.depends_on) {
114746
114835
  for (const dep of stage.depends_on) {
114747
- if (!pipeline11.stages.some((s70) => s70.name === dep)) {
114836
+ if (!pipeline10.stages.some((s70) => s70.name === dep)) {
114748
114837
  errors.push({
114749
114838
  path: `${stagePath}.depends_on`,
114750
114839
  message: `Unknown dependency: ${dep}`,
@@ -114770,7 +114859,7 @@ function validatePipeline(pipeline11) {
114770
114859
  }
114771
114860
  }
114772
114861
  }
114773
- const circular = detectCircularDependencies(pipeline11.stages);
114862
+ const circular = detectCircularDependencies(pipeline10.stages);
114774
114863
  if (circular) {
114775
114864
  errors.push({
114776
114865
  path: "stages",
@@ -114779,18 +114868,18 @@ function validatePipeline(pipeline11) {
114779
114868
  });
114780
114869
  }
114781
114870
  }
114782
- if (pipeline11.schedule) {
114783
- if (!isValidCronExpression(pipeline11.schedule)) {
114871
+ if (pipeline10.schedule) {
114872
+ if (!isValidCronExpression(pipeline10.schedule)) {
114784
114873
  errors.push({
114785
114874
  path: "schedule",
114786
- message: `Invalid cron expression: ${pipeline11.schedule}`,
114875
+ message: `Invalid cron expression: ${pipeline10.schedule}`,
114787
114876
  severity: "error"
114788
114877
  });
114789
114878
  }
114790
114879
  }
114791
- if (pipeline11.triggers) {
114792
- for (let i58 = 0; i58 < pipeline11.triggers.length; i58++) {
114793
- const trigger = pipeline11.triggers[i58];
114880
+ if (pipeline10.triggers) {
114881
+ for (let i58 = 0; i58 < pipeline10.triggers.length; i58++) {
114882
+ const trigger = pipeline10.triggers[i58];
114794
114883
  const triggerPath = `triggers[${i58}]`;
114795
114884
  if (!trigger.event) {
114796
114885
  errors.push({
@@ -115449,7 +115538,7 @@ var ALL_DOMAINS2 = [
115449
115538
  "enterprise-integration"
115450
115539
  ];
115451
115540
  function getAQEVersion() {
115452
- return true ? "3.6.13" : "3.0.0";
115541
+ return true ? "3.6.15" : "3.0.0";
115453
115542
  }
115454
115543
  function createDefaultConfig(projectName, projectRoot) {
115455
115544
  return {
@@ -123549,11 +123638,11 @@ function createTestCommand(context2, cleanupAndExit2, ensureInitialized2) {
123549
123638
  console.log(chalk9.gray(` Assertions: ${test.assertions}`));
123550
123639
  if (test.testCode) {
123551
123640
  console.log(chalk9.gray(` Test File: ${test.testFile}`));
123552
- console.log(`
123553
- --- Generated Code ---`);
123554
- console.log(test.testCode);
123555
- console.log(`--- End Generated Code ---
123556
- `);
123641
+ const fs23 = await import("fs");
123642
+ const testDir = path26.dirname(test.testFile);
123643
+ fs23.mkdirSync(testDir, { recursive: true });
123644
+ fs23.writeFileSync(test.testFile, test.testCode, "utf-8");
123645
+ console.log(chalk9.green(` Written to: ${test.testFile}`));
123557
123646
  }
123558
123647
  }
123559
123648
  if (generated.tests.length > 10) {
@@ -132588,16 +132677,15 @@ import ora2 from "ora";
132588
132677
  var DEFAULT_SYNC_CONFIG = {
132589
132678
  local: {
132590
132679
  // PRIMARY: Root database (consolidated, MCP-active)
132591
- v3MemoryDb: "../.agentic-qe/memory.db",
132592
- // Now points to root (consolidated)
132593
- rootMemoryDb: "../.agentic-qe/memory.db",
132594
- // Same as above
132595
- claudeFlowMemory: "../.claude-flow/memory/store.json",
132596
- claudeFlowDaemon: "../.claude-flow/daemon-state.json",
132597
- claudeFlowMetrics: "../.claude-flow/metrics/",
132598
- intelligenceJson: "../v3/.ruvector/intelligence.json",
132599
- swarmMemoryDb: "../.swarm/memory.db",
132600
- v2PatternsDb: "../v2/data/ruvector-patterns.db"
132680
+ // Paths relative to process.cwd() which is the project root
132681
+ v3MemoryDb: "./.agentic-qe/memory.db",
132682
+ rootMemoryDb: "./.agentic-qe/memory.db",
132683
+ claudeFlowMemory: "./.claude-flow/memory/store.json",
132684
+ claudeFlowDaemon: "./.claude-flow/daemon-state.json",
132685
+ claudeFlowMetrics: "./.claude-flow/metrics/",
132686
+ intelligenceJson: "./v3/.ruvector/intelligence.json",
132687
+ swarmMemoryDb: "./.swarm/memory.db",
132688
+ v2PatternsDb: "./v2/data/ruvector-patterns.db"
132601
132689
  },
132602
132690
  cloud: {
132603
132691
  project: process.env.GCP_PROJECT || "",
@@ -132613,82 +132701,150 @@ var DEFAULT_SYNC_CONFIG = {
132613
132701
  batchSize: 1e3,
132614
132702
  conflictResolution: "newer-wins",
132615
132703
  sourcePriority: {
132616
- rootMemory: 1,
132617
- // Root is now PRIMARY (consolidated)
132618
- claudeFlowMemory: 2,
132619
- intelligenceJson: 3,
132620
- legacy: 4
132704
+ qePatterns: 1,
132705
+ // Primary QE learning data (12K+ records)
132706
+ sonaPatterns: 2,
132707
+ // Neural backbone patterns
132708
+ goapActions: 3,
132709
+ // Planning primitives
132710
+ kvStore: 4,
132711
+ // Key-value memory entries
132712
+ experiences: 5,
132713
+ // Captured RL experiences
132714
+ claudeFlowMemory: 6,
132715
+ intelligenceJson: 7
132621
132716
  },
132622
132717
  sources: [
132623
132718
  // ============================================================
132624
- // ROOT Memory - PRIMARY (Consolidated from V3 + Historical)
132625
- // All tables now in single database: .agentic-qe/memory.db
132719
+ // ROOT Memory - PRIMARY (Consolidated database)
132720
+ // All tables in single database: .agentic-qe/memory.db
132721
+ //
132722
+ // NOTE (2026-02-20): Post-consolidation table mapping:
132723
+ // OLD v2 tables (removed) → NEW v3 tables (actual)
132724
+ // memory_entries → kv_store
132725
+ // learning_experiences → captured_experiences
132726
+ // patterns → qe_patterns (absorbed)
132727
+ // events → (removed, use dream_cycles/routing_outcomes)
132626
132728
  // ============================================================
132729
+ // QE Patterns - PRIMARY learning data (12,150+ records)
132730
+ // Explicit columns to match cloud schema exactly
132731
+ {
132732
+ name: "root-qe-patterns",
132733
+ type: "sqlite",
132734
+ path: "./.agentic-qe/memory.db",
132735
+ targetTable: "aqe.qe_patterns",
132736
+ priority: "high",
132737
+ mode: "incremental",
132738
+ query: "SELECT id, pattern_type, qe_domain, domain, name, description, confidence, usage_count, success_rate, quality_score, tier, template_json, context_json, successful_uses, created_at, updated_at, last_used_at, tokens_used, input_tokens, output_tokens, latency_ms, reusable, reuse_count, average_token_savings, total_tokens_saved FROM qe_patterns",
132739
+ enabled: true
132740
+ },
132741
+ // SONA neural patterns (731+ records)
132627
132742
  {
132628
132743
  name: "root-sona-patterns",
132629
132744
  type: "sqlite",
132630
- path: "../.agentic-qe/memory.db",
132745
+ path: "./.agentic-qe/memory.db",
132631
132746
  targetTable: "aqe.sona_patterns",
132632
132747
  priority: "high",
132633
132748
  mode: "incremental",
132634
132749
  query: "SELECT * FROM sona_patterns",
132635
132750
  enabled: true
132636
132751
  },
132752
+ // GOAP actions (2,243+ records)
132637
132753
  {
132638
132754
  name: "root-goap-actions",
132639
132755
  type: "sqlite",
132640
- path: "../.agentic-qe/memory.db",
132756
+ path: "./.agentic-qe/memory.db",
132641
132757
  targetTable: "aqe.goap_actions",
132642
132758
  priority: "high",
132643
132759
  mode: "incremental",
132644
132760
  query: "SELECT * FROM goap_actions",
132645
132761
  enabled: true
132646
132762
  },
132763
+ // KV Store → cloud memory_entries (1,619+ records)
132764
+ // Only sync entries with valid JSON values (skip corrupt/HTML-embedded data)
132647
132765
  {
132648
- name: "root-memory-entries",
132766
+ name: "root-kv-store",
132649
132767
  type: "sqlite",
132650
- path: "../.agentic-qe/memory.db",
132768
+ path: "./.agentic-qe/memory.db",
132651
132769
  targetTable: "aqe.memory_entries",
132652
132770
  priority: "high",
132653
132771
  mode: "incremental",
132654
- query: "SELECT * FROM memory_entries",
132772
+ query: "SELECT key, namespace as partition, CASE WHEN json_valid(value) THEN value ELSE json_quote(value) END as value, created_at, expires_at FROM kv_store WHERE json_valid(value) OR json_valid(json_quote(value))",
132655
132773
  enabled: true
132656
132774
  },
132775
+ // Captured experiences → cloud learning_experiences (854+ records)
132776
+ // Cloud id is SERIAL (auto-increment) — omit local UUID id
132657
132777
  {
132658
- name: "root-learning-experiences",
132778
+ name: "root-captured-experiences",
132659
132779
  type: "sqlite",
132660
- path: "../.agentic-qe/memory.db",
132780
+ path: "./.agentic-qe/memory.db",
132661
132781
  targetTable: "aqe.learning_experiences",
132662
132782
  priority: "high",
132663
132783
  mode: "append",
132664
- query: "SELECT * FROM learning_experiences",
132784
+ query: "SELECT agent as agent_id, task as task_id, domain as task_type, COALESCE(result_json, '{}') as state, COALESCE(steps_json, '{}') as action, quality as reward, COALESCE(routing_json, '{}') as next_state, tags as episode_id, started_at as created_at FROM captured_experiences",
132665
132785
  enabled: true
132666
132786
  },
132787
+ // GOAP plans (91+ records)
132667
132788
  {
132668
- name: "root-patterns",
132789
+ name: "root-goap-plans",
132669
132790
  type: "sqlite",
132670
- path: "../.agentic-qe/memory.db",
132671
- targetTable: "aqe.patterns",
132791
+ path: "./.agentic-qe/memory.db",
132792
+ targetTable: "aqe.goap_plans",
132672
132793
  priority: "medium",
132673
132794
  mode: "incremental",
132674
- query: "SELECT * FROM patterns",
132795
+ query: "SELECT id, goal_id, action_sequence as sequence, initial_state, goal_state, action_sequence, total_cost, estimated_duration_ms as estimated_duration, status, created_at, completed_at FROM goap_plans",
132675
132796
  enabled: true
132676
132797
  },
132798
+ // RL Q-values (from SQLite, not JSON)
132799
+ // Use DISTINCT to avoid duplicate (state, action) pairs in same batch
132677
132800
  {
132678
- name: "root-events",
132801
+ name: "root-rl-q-values",
132679
132802
  type: "sqlite",
132680
- path: "../.agentic-qe/memory.db",
132681
- targetTable: "aqe.events",
132803
+ path: "./.agentic-qe/memory.db",
132804
+ targetTable: "aqe.qlearning_patterns",
132805
+ priority: "medium",
132806
+ mode: "incremental",
132807
+ query: "SELECT DISTINCT state_key as state, action_key as action, q_value, visits, updated_at as last_update, created_at FROM rl_q_values GROUP BY state_key, action_key",
132808
+ enabled: true
132809
+ },
132810
+ // Routing outcomes (184+ records) - model routing decisions
132811
+ {
132812
+ name: "root-routing-outcomes",
132813
+ type: "sqlite",
132814
+ path: "./.agentic-qe/memory.db",
132815
+ targetTable: "aqe.routing_outcomes",
132816
+ priority: "medium",
132817
+ mode: "append",
132818
+ query: "SELECT * FROM routing_outcomes",
132819
+ enabled: true
132820
+ },
132821
+ // QE trajectories (320+ records) - execution traces
132822
+ {
132823
+ name: "root-qe-trajectories",
132824
+ type: "sqlite",
132825
+ path: "./.agentic-qe/memory.db",
132826
+ targetTable: "aqe.qe_trajectories",
132827
+ priority: "medium",
132828
+ mode: "append",
132829
+ query: "SELECT * FROM qe_trajectories",
132830
+ enabled: true
132831
+ },
132832
+ // Dream insights (660+ records) - consolidation results
132833
+ {
132834
+ name: "root-dream-insights",
132835
+ type: "sqlite",
132836
+ path: "./.agentic-qe/memory.db",
132837
+ targetTable: "aqe.dream_insights",
132682
132838
  priority: "low",
132683
132839
  mode: "append",
132684
- query: "SELECT * FROM events",
132840
+ query: "SELECT * FROM dream_insights",
132685
132841
  enabled: true
132686
132842
  },
132687
132843
  // Claude-Flow Memory (JSON)
132688
132844
  {
132689
132845
  name: "claude-flow-memory",
132690
132846
  type: "json",
132691
- path: "../.claude-flow/memory/store.json",
132847
+ path: "./.claude-flow/memory/store.json",
132692
132848
  targetTable: "aqe.claude_flow_memory",
132693
132849
  priority: "medium",
132694
132850
  mode: "full",
@@ -132698,7 +132854,7 @@ var DEFAULT_SYNC_CONFIG = {
132698
132854
  {
132699
132855
  name: "intelligence-qlearning",
132700
132856
  type: "json",
132701
- path: "../v3/.ruvector/intelligence.json",
132857
+ path: "./v3/.ruvector/intelligence.json",
132702
132858
  targetTable: "aqe.qlearning_patterns",
132703
132859
  priority: "low",
132704
132860
  mode: "full",
@@ -133450,7 +133606,9 @@ function createConnectionManager(config) {
133450
133606
  init_sql_safety();
133451
133607
  init_error_utils();
133452
133608
  init_logging();
133609
+ import { createRequire as createRequire7 } from "module";
133453
133610
  var logger14 = LoggerFactory.create("postgres-writer");
133611
+ var requirePg = createRequire7(import.meta.url);
133454
133612
  var PostgresWriter = class {
133455
133613
  client = null;
133456
133614
  config;
@@ -133471,31 +133629,36 @@ var PostgresWriter = class {
133471
133629
  if (!connection) {
133472
133630
  throw new Error("No tunnel connection available");
133473
133631
  }
133632
+ let pg;
133474
133633
  try {
133475
- const pg = await Promise.resolve().then(() => (init_pg(), pg_exports));
133476
- const Client = pg.Client || pg.default?.Client;
133477
- if (Client) {
133478
- const connectionConfig = {
133479
- host: connection.host,
133480
- port: connection.port,
133481
- database: this.config.cloud.database,
133482
- user: this.config.cloud.user,
133483
- password: process.env.PGPASSWORD || "",
133484
- connectionTimeoutMillis: this.config.connectionTimeout || 1e4
133485
- };
133486
- this.client = new Client(connectionConfig);
133487
- await this.client.connect();
133488
- this.connected = true;
133489
- console.log(`[PostgresWriter] Connected to ${connection.host}:${connection.port}/${this.config.cloud.database}`);
133490
- } else {
133491
- throw new Error("pg Client not found");
133492
- }
133634
+ pg = requirePg("pg");
133493
133635
  } catch (e20) {
133494
- logger14.debug("pg module not available, using mock mode", { error: e20 instanceof Error ? e20.message : String(e20) });
133495
- console.warn("[PostgresWriter] pg module not available, running in mock mode");
133636
+ logger14.debug("pg module not installed, using mock mode", { error: e20 instanceof Error ? e20.message : String(e20) });
133637
+ console.warn("[PostgresWriter] pg module not installed, running in mock mode");
133496
133638
  this.client = this.createMockClient();
133497
133639
  this.connected = true;
133640
+ return;
133498
133641
  }
133642
+ const pgDefault = pg.default;
133643
+ const Client = pg.Client || pgDefault?.Client;
133644
+ if (!Client) {
133645
+ console.warn("[PostgresWriter] pg.Client not found in module, running in mock mode");
133646
+ this.client = this.createMockClient();
133647
+ this.connected = true;
133648
+ return;
133649
+ }
133650
+ const connectionConfig = {
133651
+ host: connection.host,
133652
+ port: connection.port,
133653
+ database: this.config.cloud.database,
133654
+ user: this.config.cloud.user,
133655
+ password: process.env.PGPASSWORD || "",
133656
+ connectionTimeoutMillis: this.config.connectionTimeout || 1e4
133657
+ };
133658
+ this.client = new Client(connectionConfig);
133659
+ await this.client.connect();
133660
+ this.connected = true;
133661
+ console.log(`[PostgresWriter] Connected to ${connection.host}:${connection.port}/${this.config.cloud.database}`);
133499
133662
  }
133500
133663
  /**
133501
133664
  * Begin a transaction
@@ -133545,8 +133708,28 @@ var PostgresWriter = class {
133545
133708
  const batchSize = 100;
133546
133709
  for (let i58 = 0; i58 < records.length; i58 += batchSize) {
133547
133710
  const batch = records.slice(i58, i58 + batchSize);
133548
- const inserted = await this.upsertBatch(table, batch, columns, conflictColumns, updateColumns, options?.skipIfExists);
133549
- totalInserted += inserted;
133711
+ try {
133712
+ const inserted = await this.upsertBatch(table, batch, columns, conflictColumns, updateColumns, options?.skipIfExists);
133713
+ totalInserted += inserted;
133714
+ } catch (error) {
133715
+ const batchNum = Math.floor(i58 / batchSize) + 1;
133716
+ const totalBatches = Math.ceil(records.length / batchSize);
133717
+ logger14.debug(`Batch ${batchNum}/${totalBatches} failed for ${table}, retrying individually`, { error: toErrorMessage(error) });
133718
+ let recovered = 0;
133719
+ for (const record of batch) {
133720
+ try {
133721
+ const inserted = await this.upsertBatch(table, [record], columns, conflictColumns, updateColumns, options?.skipIfExists);
133722
+ recovered += inserted;
133723
+ } catch (retryError) {
133724
+ const recordId = record["id"] || record["key"] || "?";
133725
+ logger14.debug(`Skipped record ${String(recordId).slice(0, 50)} in ${table}`, { error: toErrorMessage(retryError) });
133726
+ }
133727
+ }
133728
+ totalInserted += recovered;
133729
+ if (recovered < batch.length) {
133730
+ console.warn(`[PostgresWriter] Batch ${batchNum}/${totalBatches} for ${table}: ${recovered}/${batch.length} recovered (${batch.length - recovered} skipped)`);
133731
+ }
133732
+ }
133550
133733
  }
133551
133734
  return totalInserted;
133552
133735
  }
@@ -133589,7 +133772,7 @@ var PostgresWriter = class {
133589
133772
  const result = await this.client.query(sql, params);
133590
133773
  return result.rowCount || 0;
133591
133774
  } catch (error) {
133592
- console.error(`[PostgresWriter] Upsert failed: ${toErrorMessage(error)}`);
133775
+ logger14.debug(`Upsert failed for ${table}`, { error: toErrorMessage(error) });
133593
133776
  throw error;
133594
133777
  }
133595
133778
  }
@@ -133660,9 +133843,33 @@ var PostgresWriter = class {
133660
133843
  return JSON.stringify(value);
133661
133844
  }
133662
133845
  if (typeof value === "object") {
133663
- return JSON.stringify(value);
133846
+ let jsonStr = JSON.stringify(value);
133847
+ if (columnName && this.isJsonbColumn(columnName)) {
133848
+ jsonStr = jsonStr.replace(/\u0000/g, "");
133849
+ try {
133850
+ JSON.parse(jsonStr);
133851
+ } catch {
133852
+ return JSON.stringify(String(value));
133853
+ }
133854
+ }
133855
+ return jsonStr;
133664
133856
  }
133665
133857
  if (typeof value === "string") {
133858
+ if (value === "") {
133859
+ const timestampColumns = [
133860
+ "created_at",
133861
+ "updated_at",
133862
+ "last_used_at",
133863
+ "started_at",
133864
+ "ended_at",
133865
+ "completed_at",
133866
+ "expires_at",
133867
+ "last_update"
133868
+ ];
133869
+ if (columnName && timestampColumns.includes(columnName)) {
133870
+ return null;
133871
+ }
133872
+ }
133666
133873
  if (/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/.test(value)) {
133667
133874
  return value;
133668
133875
  }
@@ -133670,53 +133877,83 @@ var PostgresWriter = class {
133670
133877
  if (!isNaN(numVal) && numVal > 9466848e5 && numVal < 41024448e5) {
133671
133878
  return new Date(numVal).toISOString();
133672
133879
  }
133673
- const jsonbColumns = [
133674
- "action_value",
133675
- "state",
133676
- "action",
133677
- "next_state",
133678
- "preconditions",
133679
- "effects",
133680
- "metadata",
133681
- "value",
133682
- "payload",
133683
- "context_json",
133684
- "template_json",
133685
- "execution_trace",
133686
- "action_sequence",
133687
- "initial_state",
133688
- "goal_state",
133689
- "sequence"
133690
- ];
133691
- if (columnName && jsonbColumns.includes(columnName)) {
133692
- if (!value.startsWith("{") && !value.startsWith("[") && !value.startsWith('"')) {
133693
- return JSON.stringify(value);
133880
+ if (columnName && this.isJsonbColumn(columnName)) {
133881
+ const sanitized = value.replace(/\u0000/g, "");
133882
+ try {
133883
+ JSON.parse(sanitized);
133884
+ return sanitized;
133885
+ } catch {
133886
+ return JSON.stringify(sanitized);
133694
133887
  }
133695
133888
  }
133696
133889
  }
133697
133890
  return value;
133698
133891
  }
133699
133892
  /**
133700
- * Infer conflict columns from table name
133893
+ * Check if a column is a JSONB column
133894
+ */
133895
+ isJsonbColumn(columnName) {
133896
+ const jsonbColumns = [
133897
+ "action_value",
133898
+ "state",
133899
+ "action",
133900
+ "next_state",
133901
+ "preconditions",
133902
+ "effects",
133903
+ "metadata",
133904
+ "value",
133905
+ "payload",
133906
+ "context_json",
133907
+ "template_json",
133908
+ "execution_trace",
133909
+ "action_sequence",
133910
+ "initial_state",
133911
+ "goal_state",
133912
+ "sequence",
133913
+ "task_json",
133914
+ "decision_json",
133915
+ "steps_json",
133916
+ "metadata_json"
133917
+ ];
133918
+ return jsonbColumns.includes(columnName);
133919
+ }
133920
+ /**
133921
+ * Infer conflict columns from table name and available columns.
133922
+ * Only returns columns if the target table is known to have a matching unique constraint.
133701
133923
  */
133702
133924
  inferConflictColumns(table, columns) {
133703
133925
  const tableName = table.includes(".") ? table.split(".")[1] : table;
133704
- if (columns.includes("id")) {
133926
+ const tablesWithIdPK = [
133927
+ "qe_patterns",
133928
+ "sona_patterns",
133929
+ "goap_actions",
133930
+ "goap_plans",
133931
+ "patterns",
133932
+ "events",
133933
+ "routing_outcomes",
133934
+ "qe_trajectories",
133935
+ "dream_insights",
133936
+ "intelligence_memories"
133937
+ ];
133938
+ if (columns.includes("id") && tablesWithIdPK.includes(tableName)) {
133705
133939
  return ["id"];
133706
133940
  }
133707
- if (columns.includes("key") && columns.includes("source_env")) {
133941
+ if (tableName === "memory_entries" && columns.includes("key") && columns.includes("source_env")) {
133708
133942
  if (columns.includes("partition")) {
133709
133943
  return ["key", "partition", "source_env"];
133710
133944
  }
133711
133945
  return ["key", "source_env"];
133712
133946
  }
133713
- if (columns.includes("state") && columns.includes("action") && columns.includes("source_env")) {
133947
+ if (tableName === "claude_flow_memory" && columns.includes("key") && columns.includes("source_env")) {
133948
+ return ["key", "source_env"];
133949
+ }
133950
+ if (tableName === "qlearning_patterns" && columns.includes("state") && columns.includes("action") && columns.includes("source_env")) {
133714
133951
  return ["state", "action", "source_env"];
133715
133952
  }
133716
- if (columns.includes("worker_type") && columns.includes("source_env")) {
133953
+ if (tableName === "claude_flow_workers" && columns.includes("worker_type") && columns.includes("source_env")) {
133717
133954
  return ["worker_type", "source_env"];
133718
133955
  }
133719
- return columns.includes("id") ? ["id"] : [];
133956
+ return [];
133720
133957
  }
133721
133958
  /**
133722
133959
  * Create mock client for testing without pg installed
@@ -133869,17 +134106,10 @@ var CloudSyncAgent = class {
133869
134106
  return result;
133870
134107
  }
133871
134108
  if (this.writer && !this.config.sync.dryRun) {
133872
- await this.writer.beginTransaction();
133873
- try {
133874
- const written = await this.writer.upsert(source.targetTable, records, {
133875
- skipIfExists: source.mode === "append"
133876
- });
133877
- result.recordsSynced = written;
133878
- await this.writer.commit();
133879
- } catch (error) {
133880
- await this.writer.rollback();
133881
- throw error;
133882
- }
134109
+ const written = await this.writer.upsert(source.targetTable, records, {
134110
+ skipIfExists: source.mode === "append"
134111
+ });
134112
+ result.recordsSynced = written;
133883
134113
  } else {
133884
134114
  result.recordsSynced = records.length;
133885
134115
  this.log(`[DRY RUN] Would sync ${records.length} records to ${source.targetTable}`);
@@ -133919,15 +134149,8 @@ var CloudSyncAgent = class {
133919
134149
  return result;
133920
134150
  }
133921
134151
  if (this.writer && !this.config.sync.dryRun) {
133922
- await this.writer.beginTransaction();
133923
- try {
133924
- const written = await this.writer.upsert(source.targetTable, records);
133925
- result.recordsSynced = written;
133926
- await this.writer.commit();
133927
- } catch (error) {
133928
- await this.writer.rollback();
133929
- throw error;
133930
- }
134152
+ const written = await this.writer.upsert(source.targetTable, records);
134153
+ result.recordsSynced = written;
133931
134154
  } else {
133932
134155
  result.recordsSynced = records.length;
133933
134156
  }
@@ -135653,22 +135876,22 @@ var CategoryAdapter = class {
135653
135876
  * @param pipeline - The pipeline to verify
135654
135877
  * @returns Type verification result
135655
135878
  */
135656
- verifyPipeline(pipeline11) {
135879
+ verifyPipeline(pipeline10) {
135657
135880
  const startTime = Date.now();
135658
135881
  this.clear();
135659
- this.addType(pipeline11.inputType, this.inferSchema(pipeline11.inputType));
135660
- this.addType(pipeline11.outputType, this.inferSchema(pipeline11.outputType));
135661
- for (const element of pipeline11.elements) {
135882
+ this.addType(pipeline10.inputType, this.inferSchema(pipeline10.inputType));
135883
+ this.addType(pipeline10.outputType, this.inferSchema(pipeline10.outputType));
135884
+ for (const element of pipeline10.elements) {
135662
135885
  this.addType(element.inputType, this.inferSchema(element.inputType));
135663
135886
  this.addType(element.outputType, this.inferSchema(element.outputType));
135664
135887
  }
135665
- for (const element of pipeline11.elements) {
135888
+ for (const element of pipeline10.elements) {
135666
135889
  this.addMorphism(element.inputType, element.outputType, element.name);
135667
135890
  }
135668
- const path26 = this.buildCompositionPath(pipeline11);
135891
+ const path26 = this.buildCompositionPath(pipeline10);
135669
135892
  const compositionValid = this.verifyComposition(path26);
135670
135893
  const mismatches = this.checkTypeConsistency();
135671
- const warnings = this.generateWarnings(pipeline11, compositionValid, mismatches);
135894
+ const warnings = this.generateWarnings(pipeline10, compositionValid, mismatches);
135672
135895
  const durationMs = Date.now() - startTime;
135673
135896
  const result = {
135674
135897
  isValid: compositionValid && mismatches.length === 0,
@@ -135678,7 +135901,7 @@ var CategoryAdapter = class {
135678
135901
  usedFallback: false
135679
135902
  };
135680
135903
  this.logger.info("Verified pipeline", {
135681
- pipelineId: pipeline11.id,
135904
+ pipelineId: pipeline10.id,
135682
135905
  isValid: result.isValid,
135683
135906
  mismatchCount: mismatches.length,
135684
135907
  warningCount: warnings.length,
@@ -135689,16 +135912,16 @@ var CategoryAdapter = class {
135689
135912
  /**
135690
135913
  * Build a composition path from a pipeline
135691
135914
  */
135692
- buildCompositionPath(pipeline11) {
135693
- const path26 = [pipeline11.inputType];
135694
- for (const element of pipeline11.elements) {
135915
+ buildCompositionPath(pipeline10) {
135916
+ const path26 = [pipeline10.inputType];
135917
+ for (const element of pipeline10.elements) {
135695
135918
  if (element.inputType !== path26[path26.length - 1]) {
135696
135919
  path26.push(element.inputType);
135697
135920
  }
135698
135921
  path26.push(element.outputType);
135699
135922
  }
135700
- if (path26[path26.length - 1] !== pipeline11.outputType) {
135701
- path26.push(pipeline11.outputType);
135923
+ if (path26[path26.length - 1] !== pipeline10.outputType) {
135924
+ path26.push(pipeline10.outputType);
135702
135925
  }
135703
135926
  return path26;
135704
135927
  }
@@ -135744,21 +135967,21 @@ var CategoryAdapter = class {
135744
135967
  /**
135745
135968
  * Generate warnings for potential issues
135746
135969
  */
135747
- generateWarnings(pipeline11, compositionValid, mismatches) {
135970
+ generateWarnings(pipeline10, compositionValid, mismatches) {
135748
135971
  const warnings = [];
135749
135972
  if (!compositionValid) {
135750
135973
  warnings.push(
135751
- `Pipeline '${pipeline11.id}' has an invalid composition chain. Types do not connect properly from input to output.`
135974
+ `Pipeline '${pipeline10.id}' has an invalid composition chain. Types do not connect properly from input to output.`
135752
135975
  );
135753
135976
  }
135754
- for (const element of pipeline11.elements) {
135977
+ for (const element of pipeline10.elements) {
135755
135978
  if (element.inputType === "any" || element.outputType === "any") {
135756
135979
  warnings.push(
135757
135980
  `Element '${element.name}' uses 'any' type, which bypasses type safety.`
135758
135981
  );
135759
135982
  }
135760
135983
  }
135761
- for (const element of pipeline11.elements) {
135984
+ for (const element of pipeline10.elements) {
135762
135985
  if (element.inputType.includes("<T>") || element.outputType.includes("<T>")) {
135763
135986
  warnings.push(
135764
135987
  `Element '${element.name}' has unconstrained generic types.`
@@ -136668,21 +136891,21 @@ var CoherenceService = class {
136668
136891
  /**
136669
136892
  * Verify type consistency in a pipeline
136670
136893
  */
136671
- async verifyTypes(pipeline11) {
136894
+ async verifyTypes(pipeline10) {
136672
136895
  this.ensureInitialized();
136673
136896
  if (this.categoryAdapter?.isInitialized()) {
136674
- return this.categoryAdapter.verifyPipeline(pipeline11);
136897
+ return this.categoryAdapter.verifyPipeline(pipeline10);
136675
136898
  }
136676
- return this.verifyTypesWithFallback(pipeline11);
136899
+ return this.verifyTypesWithFallback(pipeline10);
136677
136900
  }
136678
136901
  /**
136679
136902
  * Fallback type verification using simple matching
136680
136903
  */
136681
- verifyTypesWithFallback(pipeline11) {
136904
+ verifyTypesWithFallback(pipeline10) {
136682
136905
  const startTime = Date.now();
136683
136906
  const mismatches = [];
136684
- let currentType = pipeline11.inputType;
136685
- for (const element of pipeline11.elements) {
136907
+ let currentType = pipeline10.inputType;
136908
+ for (const element of pipeline10.elements) {
136686
136909
  if (element.inputType !== currentType && currentType !== "any") {
136687
136910
  mismatches.push({
136688
136911
  location: element.name,
@@ -136693,10 +136916,10 @@ var CoherenceService = class {
136693
136916
  }
136694
136917
  currentType = element.outputType;
136695
136918
  }
136696
- if (currentType !== pipeline11.outputType && currentType !== "any") {
136919
+ if (currentType !== pipeline10.outputType && currentType !== "any") {
136697
136920
  mismatches.push({
136698
136921
  location: "pipeline output",
136699
- expected: pipeline11.outputType,
136922
+ expected: pipeline10.outputType,
136700
136923
  actual: currentType,
136701
136924
  severity: "critical"
136702
136925
  });
@@ -139196,7 +139419,7 @@ import chalk28 from "chalk";
139196
139419
  import path24 from "node:path";
139197
139420
  import { createReadStream, createWriteStream } from "node:fs";
139198
139421
  import { createGzip, createGunzip } from "node:zlib";
139199
- import { pipeline as pipeline10 } from "node:stream/promises";
139422
+ import { pipeline as pipeline9 } from "node:stream/promises";
139200
139423
  init_qe_patterns();
139201
139424
  var state2 = {
139202
139425
  reasoningBank: null,
@@ -139324,7 +139547,7 @@ function getDbPath() {
139324
139547
  }
139325
139548
  async function compressFile(inputPath, outputPath) {
139326
139549
  const gzPath = outputPath || `${inputPath}.gz`;
139327
- await pipeline10(
139550
+ await pipeline9(
139328
139551
  createReadStream(inputPath),
139329
139552
  createGzip(),
139330
139553
  createWriteStream(gzPath)
@@ -139332,7 +139555,7 @@ async function compressFile(inputPath, outputPath) {
139332
139555
  return gzPath;
139333
139556
  }
139334
139557
  async function decompressFile(gzPath, outputPath) {
139335
- await pipeline10(
139558
+ await pipeline9(
139336
139559
  createReadStream(gzPath),
139337
139560
  createGunzip(),
139338
139561
  createWriteStream(outputPath)
@@ -140544,7 +140767,7 @@ async function cleanupAndExit(code = 0) {
140544
140767
  process.exit(code);
140545
140768
  }
140546
140769
  var program = new Command18();
140547
- var VERSION = true ? "3.6.13" : "0.0.0-dev";
140770
+ var VERSION = true ? "3.6.15" : "0.0.0-dev";
140548
140771
  program.name("aqe").description("Agentic QE - Domain-Driven Quality Engineering").version(VERSION);
140549
140772
  var registry = createCommandRegistry(context, cleanupAndExit, ensureInitialized);
140550
140773
  registry.registerAll(program);
@@ -140828,22 +141051,22 @@ Validating pipeline: ${file}
140828
141051
  console.log("");
140829
141052
  }
140830
141053
  if (options.verbose && parseResult.pipeline) {
140831
- const pipeline11 = parseResult.pipeline;
141054
+ const pipeline10 = parseResult.pipeline;
140832
141055
  console.log(chalk30.cyan("Pipeline Details:\n"));
140833
- console.log(chalk30.gray(` Name: ${pipeline11.name}`));
140834
- console.log(chalk30.gray(` Version: ${pipeline11.version || "1.0.0"}`));
140835
- if (pipeline11.description) {
140836
- console.log(chalk30.gray(` Description: ${pipeline11.description}`));
141056
+ console.log(chalk30.gray(` Name: ${pipeline10.name}`));
141057
+ console.log(chalk30.gray(` Version: ${pipeline10.version || "1.0.0"}`));
141058
+ if (pipeline10.description) {
141059
+ console.log(chalk30.gray(` Description: ${pipeline10.description}`));
140837
141060
  }
140838
- if (pipeline11.schedule) {
140839
- console.log(chalk30.gray(` Schedule: ${pipeline11.schedule} (${describeCronSchedule(pipeline11.schedule)})`));
141061
+ if (pipeline10.schedule) {
141062
+ console.log(chalk30.gray(` Schedule: ${pipeline10.schedule} (${describeCronSchedule(pipeline10.schedule)})`));
140840
141063
  }
140841
- if (pipeline11.tags && pipeline11.tags.length > 0) {
140842
- console.log(chalk30.gray(` Tags: ${pipeline11.tags.join(", ")}`));
141064
+ if (pipeline10.tags && pipeline10.tags.length > 0) {
141065
+ console.log(chalk30.gray(` Tags: ${pipeline10.tags.join(", ")}`));
140843
141066
  }
140844
141067
  console.log(chalk30.cyan("\n Stages:"));
140845
- for (let i58 = 0; i58 < pipeline11.stages.length; i58++) {
140846
- const stage = pipeline11.stages[i58];
141068
+ for (let i58 = 0; i58 < pipeline10.stages.length; i58++) {
141069
+ const stage = pipeline10.stages[i58];
140847
141070
  console.log(` ${i58 + 1}. ${chalk30.white(stage.name)}`);
140848
141071
  console.log(chalk30.gray(` Command: ${stage.command}`));
140849
141072
  if (stage.params) {
@@ -140856,9 +141079,9 @@ Validating pipeline: ${file}
140856
141079
  console.log(chalk30.gray(` Timeout: ${stage.timeout}s`));
140857
141080
  }
140858
141081
  }
140859
- if (pipeline11.triggers && pipeline11.triggers.length > 0) {
141082
+ if (pipeline10.triggers && pipeline10.triggers.length > 0) {
140860
141083
  console.log(chalk30.cyan("\n Triggers:"));
140861
- for (const trigger of pipeline11.triggers) {
141084
+ for (const trigger of pipeline10.triggers) {
140862
141085
  console.log(chalk30.gray(` * ${trigger.event}`));
140863
141086
  if (trigger.branches) {
140864
141087
  console.log(chalk30.gray(` Branches: ${trigger.branches.join(", ")}`));