opencode-swarm 7.26.2 → 7.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -34,7 +34,7 @@ var package_default;
34
34
  var init_package = __esm(() => {
35
35
  package_default = {
36
36
  name: "opencode-swarm",
37
- version: "7.26.2",
37
+ version: "7.27.0",
38
38
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
39
39
  main: "dist/index.js",
40
40
  types: "dist/index.d.ts",
@@ -47117,10 +47117,31 @@ function stringHash(str) {
47117
47117
  h2 ^= Math.imul(h1 ^ h1 >>> 13, 3266489909);
47118
47118
  return (4294967296 * (2097151 & h2) + (h1 >>> 0)).toString(16);
47119
47119
  }
47120
+ function isInfrastructureFailure(currentResult) {
47121
+ const errorMessage = currentResult.errorMessage || "";
47122
+ const stackPrefix = currentResult.stackPrefix || "";
47123
+ if (/\bassertionerror\b/i.test(errorMessage)) {
47124
+ return false;
47125
+ }
47126
+ const combinedText = `${errorMessage}
47127
+ ${stackPrefix}`;
47128
+ return INFRASTRUCTURE_FAILURE_PATTERNS.some((pattern) => pattern.test(combinedText));
47129
+ }
47120
47130
  function classifyFailure(currentResult, history) {
47121
47131
  const normalizedFile = currentResult.testFile.toLowerCase();
47122
47132
  const normalizedName = currentResult.testName.toLowerCase();
47123
47133
  const testHistory = history.filter((r) => r.testFile.toLowerCase() === normalizedFile && r.testName.toLowerCase() === normalizedName).sort((a, b) => new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime());
47134
+ if (isInfrastructureFailure(currentResult)) {
47135
+ return {
47136
+ testFile: currentResult.testFile,
47137
+ testName: currentResult.testName,
47138
+ classification: "infrastructure_failure",
47139
+ errorMessage: currentResult.errorMessage,
47140
+ stackPrefix: currentResult.stackPrefix,
47141
+ durationMs: currentResult.durationMs,
47142
+ confidence: computeConfidence2(testHistory.length)
47143
+ };
47144
+ }
47124
47145
  const lastThree = testHistory.slice(0, 3);
47125
47146
  const lastTen = testHistory.slice(0, 10);
47126
47147
  const normalizedTestFile = currentResult.testFile.toLowerCase();
@@ -47220,6 +47241,20 @@ function classifyAndCluster(testResults, history) {
47220
47241
  const clusters = clusterFailures(classified);
47221
47242
  return { classified, clusters };
47222
47243
  }
47244
+ var MAX_INFRA_CONTEXT_CHARS = 80, INFRASTRUCTURE_FAILURE_PATTERNS;
47245
+ var init_failure_classifier = __esm(() => {
47246
+ INFRASTRUCTURE_FAILURE_PATTERNS = [
47247
+ /\boutofmemoryerror\b/i,
47248
+ /(?:^|\n|\bcommand failed:\s*)\s*killed(?:\s*(?:[-:]\s*)?(?:out of memory|oom|by signal|signal|sigkill).*)?\s*(?:\n|$)/i,
47249
+ /(?:^|\n)\s*etimedout\b/i,
47250
+ new RegExp(`\\b(?:connect|connection|request|socket|network)\\b[^\\n]{0,${MAX_INFRA_CONTEXT_CHARS}}\\betimedout\\b`, "i"),
47251
+ /(?:^|\n)\s*econnrefused\b/i,
47252
+ new RegExp(`\\b(?:connect|connection|socket)\\b[^\\n]{0,${MAX_INFRA_CONTEXT_CHARS}}\\beconnrefused\\b`, "i"),
47253
+ /(?:^|\n)\s*enotfound\b/i,
47254
+ new RegExp(`\\b(?:getaddrinfo|dns|lookup)\\b[^\\n]{0,${MAX_INFRA_CONTEXT_CHARS}}\\benotfound\\b`, "i"),
47255
+ /\bexit(?:ed)?(?:\s+with)?(?:\s+code)?\s*[:=]?\s*137\b/i
47256
+ ];
47257
+ });
47223
47258
 
47224
47259
  // src/test-impact/flaky-detector.ts
47225
47260
  function detectFlakyTests(allHistory) {
@@ -48964,6 +48999,7 @@ var init_test_runner = __esm(() => {
48964
48999
  init_zod();
48965
49000
  init_discovery();
48966
49001
  init_analyzer();
49002
+ init_failure_classifier();
48967
49003
  init_history_store();
48968
49004
  init_bun_compat();
48969
49005
  init_path_security();
package/dist/index.js CHANGED
@@ -33,7 +33,7 @@ var package_default;
33
33
  var init_package = __esm(() => {
34
34
  package_default = {
35
35
  name: "opencode-swarm",
36
- version: "7.26.2",
36
+ version: "7.27.0",
37
37
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
38
38
  main: "dist/index.js",
39
39
  types: "dist/index.d.ts",
@@ -57509,10 +57509,31 @@ function stringHash(str) {
57509
57509
  h2 ^= Math.imul(h1 ^ h1 >>> 13, 3266489909);
57510
57510
  return (4294967296 * (2097151 & h2) + (h1 >>> 0)).toString(16);
57511
57511
  }
57512
+ function isInfrastructureFailure(currentResult) {
57513
+ const errorMessage = currentResult.errorMessage || "";
57514
+ const stackPrefix = currentResult.stackPrefix || "";
57515
+ if (/\bassertionerror\b/i.test(errorMessage)) {
57516
+ return false;
57517
+ }
57518
+ const combinedText = `${errorMessage}
57519
+ ${stackPrefix}`;
57520
+ return INFRASTRUCTURE_FAILURE_PATTERNS.some((pattern) => pattern.test(combinedText));
57521
+ }
57512
57522
  function classifyFailure(currentResult, history) {
57513
57523
  const normalizedFile = currentResult.testFile.toLowerCase();
57514
57524
  const normalizedName = currentResult.testName.toLowerCase();
57515
57525
  const testHistory = history.filter((r) => r.testFile.toLowerCase() === normalizedFile && r.testName.toLowerCase() === normalizedName).sort((a, b) => new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime());
57526
+ if (isInfrastructureFailure(currentResult)) {
57527
+ return {
57528
+ testFile: currentResult.testFile,
57529
+ testName: currentResult.testName,
57530
+ classification: "infrastructure_failure",
57531
+ errorMessage: currentResult.errorMessage,
57532
+ stackPrefix: currentResult.stackPrefix,
57533
+ durationMs: currentResult.durationMs,
57534
+ confidence: computeConfidence2(testHistory.length)
57535
+ };
57536
+ }
57516
57537
  const lastThree = testHistory.slice(0, 3);
57517
57538
  const lastTen = testHistory.slice(0, 10);
57518
57539
  const normalizedTestFile = currentResult.testFile.toLowerCase();
@@ -57612,6 +57633,20 @@ function classifyAndCluster(testResults, history) {
57612
57633
  const clusters = clusterFailures(classified);
57613
57634
  return { classified, clusters };
57614
57635
  }
57636
+ var MAX_INFRA_CONTEXT_CHARS = 80, INFRASTRUCTURE_FAILURE_PATTERNS;
57637
+ var init_failure_classifier = __esm(() => {
57638
+ INFRASTRUCTURE_FAILURE_PATTERNS = [
57639
+ /\boutofmemoryerror\b/i,
57640
+ /(?:^|\n|\bcommand failed:\s*)\s*killed(?:\s*(?:[-:]\s*)?(?:out of memory|oom|by signal|signal|sigkill).*)?\s*(?:\n|$)/i,
57641
+ /(?:^|\n)\s*etimedout\b/i,
57642
+ new RegExp(`\\b(?:connect|connection|request|socket|network)\\b[^\\n]{0,${MAX_INFRA_CONTEXT_CHARS}}\\betimedout\\b`, "i"),
57643
+ /(?:^|\n)\s*econnrefused\b/i,
57644
+ new RegExp(`\\b(?:connect|connection|socket)\\b[^\\n]{0,${MAX_INFRA_CONTEXT_CHARS}}\\beconnrefused\\b`, "i"),
57645
+ /(?:^|\n)\s*enotfound\b/i,
57646
+ new RegExp(`\\b(?:getaddrinfo|dns|lookup)\\b[^\\n]{0,${MAX_INFRA_CONTEXT_CHARS}}\\benotfound\\b`, "i"),
57647
+ /\bexit(?:ed)?(?:\s+with)?(?:\s+code)?\s*[:=]?\s*137\b/i
57648
+ ];
57649
+ });
57615
57650
 
57616
57651
  // src/test-impact/flaky-detector.ts
57617
57652
  function detectFlakyTests(allHistory) {
@@ -59356,6 +59391,7 @@ var init_test_runner = __esm(() => {
59356
59391
  init_zod();
59357
59392
  init_discovery();
59358
59393
  init_analyzer();
59394
+ init_failure_classifier();
59359
59395
  init_history_store();
59360
59396
  init_bun_compat();
59361
59397
  init_path_security();
@@ -102057,6 +102093,10 @@ var suggestPatch = createSwarmTool({
102057
102093
  }, null, 2);
102058
102094
  }
102059
102095
  });
102096
+
102097
+ // src/tools/index.ts
102098
+ init_failure_classifier();
102099
+
102060
102100
  // src/tools/generate-mutants.ts
102061
102101
  init_zod();
102062
102102
 
@@ -1,5 +1,5 @@
1
1
  import type { TestRunRecord } from './history-store.js';
2
- export type FailureClassification = 'new_regression' | 'pre_existing' | 'flaky' | 'unknown';
2
+ export type FailureClassification = 'new_regression' | 'pre_existing' | 'flaky' | 'infrastructure_failure' | 'unknown';
3
3
  export interface ClassifiedFailure {
4
4
  testFile: string;
5
5
  testName: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.26.2",
3
+ "version": "7.27.0",
4
4
  "description": "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",