opencode-swarm 7.77.0 → 7.77.2
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/.opencode/skills/swarm-pr-review/SKILL.md +6 -8
- package/dist/cli/index.js +54 -2
- package/dist/commands/registry.d.ts +1 -1
- package/dist/index.js +761 -278
- package/dist/test-impact/failure-classifier.d.ts +1 -1
- package/dist/tools/dispatch-lanes.d.ts +107 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/manifest.d.ts +1 -0
- package/dist/tools/tool-metadata.d.ts +4 -0
- package/package.json +1 -1
|
@@ -468,14 +468,11 @@ Tool candidate rules:
|
|
|
468
468
|
|
|
469
469
|
## Phase 3: Parallel Base Explorer Lanes
|
|
470
470
|
|
|
471
|
-
Launch all base lanes
|
|
471
|
+
Launch all base lanes with the `dispatch_lanes` tool in one call. Pass the six lane specs together, set `max_concurrent` to `6`, and treat the returned `lane_results` as the join barrier before synthesis. Use read-only explorer/reviewer-style agents; do not rely on model-emitted background Agent calls or native background flags for base-lane parallelism.
|
|
472
472
|
|
|
473
|
-
If
|
|
473
|
+
If `dispatch_lanes` is unavailable, simulate isolated passes. Do not let one lane's conclusions bias another lane, and record that deterministic dispatch was unavailable in the validation gate.
|
|
474
474
|
|
|
475
|
-
**
|
|
476
|
-
- For Agent tools that require caller-supplied `task_id` values, every parallel explorer lane invocation and retry MUST use a unique ID across the review session, including lane and attempt suffix (e.g. `pr_review_explore_lane1_attempt2`). Never reuse a prior `task_id` unless intentionally resuming that exact lane.
|
|
477
|
-
- If the runtime auto-generates `task_id` values (resume mode), omit the `task_id` parameter rather than fabricating one.
|
|
478
|
-
- Do not use the same `task_id` across concurrent lane dispatches — schema validation rejects duplicate `task_id` values.
|
|
475
|
+
**lane id uniqueness for parallel dispatches:** When re-dispatching failed or re-running explorer lanes, every `dispatch_lanes` lane `id` MUST be unique within that dispatch batch and should include lane and attempt suffixes (e.g. `pr_review_explore_lane1_attempt2`). Never reuse an id in the same batch unless intentionally replacing that exact lane before dispatch.
|
|
479
476
|
|
|
480
477
|
Explorers optimize for recall. Over-reporting is expected. Explorers produce candidates only.
|
|
481
478
|
|
|
@@ -513,7 +510,7 @@ Explorers must not use `CONFIRMED`, `DISPROVED`, or `PRE_EXISTING`.
|
|
|
513
510
|
|
|
514
511
|
## Phase 4: Triggered Swarm Plugin Micro-Lanes
|
|
515
512
|
|
|
516
|
-
After base lanes
|
|
513
|
+
After `dispatch_lanes` returns for base lanes, inspect the context pack risk triggers. Launch focused micro-lanes for triggered categories only, using `dispatch_lanes` again when more than one read-only micro-lane is needed. Do not launch irrelevant micro-lanes.
|
|
517
514
|
|
|
518
515
|
Each micro-lane receives:
|
|
519
516
|
|
|
@@ -796,7 +793,7 @@ Council mode is opt-in only and adversarial.
|
|
|
796
793
|
When triggered:
|
|
797
794
|
|
|
798
795
|
1. Build the same context pack as default mode.
|
|
799
|
-
2. Launch all council agents
|
|
796
|
+
2. Launch all council agents with one `dispatch_lanes` call when available; use the returned `lane_results` as the join barrier before reviewer classification.
|
|
800
797
|
3. Each council agent assumes all work is wrong until code evidence proves otherwise.
|
|
801
798
|
4. Each agent hunts within its lane only.
|
|
802
799
|
5. Agents return evidence states only: `EVIDENCE_FOUND`, `SUSPICIOUS`, or `CLEAN`.
|
|
@@ -872,6 +869,7 @@ Before writing the final output, print this checklist with filled values. Every
|
|
|
872
869
|
[VALIDATION] obligation count: ___
|
|
873
870
|
[VALIDATION] repo graph / impact cone source: ___
|
|
874
871
|
[VALIDATION] deterministic signals ingested: ___
|
|
872
|
+
[VALIDATION] deterministic lane dispatcher used: YES/NO — ___
|
|
875
873
|
[VALIDATION] base explorer lanes dispatched: ___ / 6
|
|
876
874
|
[VALIDATION] base explorer lanes returned: ___ / 6
|
|
877
875
|
[VALIDATION] triggered micro-lanes: ___
|
package/dist/cli/index.js
CHANGED
|
@@ -52,7 +52,7 @@ var package_default;
|
|
|
52
52
|
var init_package = __esm(() => {
|
|
53
53
|
package_default = {
|
|
54
54
|
name: "opencode-swarm",
|
|
55
|
-
version: "7.77.
|
|
55
|
+
version: "7.77.2",
|
|
56
56
|
description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
57
57
|
main: "dist/index.js",
|
|
58
58
|
types: "dist/index.d.ts",
|
|
@@ -17615,6 +17615,10 @@ var init_tool_metadata = __esm(() => {
|
|
|
17615
17615
|
"test_engineer"
|
|
17616
17616
|
]
|
|
17617
17617
|
},
|
|
17618
|
+
dispatch_lanes: {
|
|
17619
|
+
description: "dispatch multiple read-only exploration/review lanes concurrently and return a structured join result",
|
|
17620
|
+
agents: ["architect"]
|
|
17621
|
+
},
|
|
17618
17622
|
summarize_work: {
|
|
17619
17623
|
description: "emit a short structured summary of completed work (key decisions, assumptions, risks, constraints) at task completion; rolls up per phase for architecture-supervisor review. Advisory, never blocks.",
|
|
17620
17624
|
agents: [
|
|
@@ -60645,10 +60649,37 @@ function stringHash(str) {
|
|
|
60645
60649
|
h2 ^= Math.imul(h1 ^ h1 >>> 13, 3266489909);
|
|
60646
60650
|
return (4294967296 * (2097151 & h2) + (h1 >>> 0)).toString(16);
|
|
60647
60651
|
}
|
|
60652
|
+
function buildErrnoPatternPair(errno, contextPattern) {
|
|
60653
|
+
return [
|
|
60654
|
+
new RegExp(`(?:^|\\n)\\s*${errno}\\b`, "i"),
|
|
60655
|
+
new RegExp(`\\b(?:${contextPattern})\\b[^\\n]{0,${MAX_INFRA_CONTEXT_CHARS}}\\b${errno}\\b`, "i")
|
|
60656
|
+
];
|
|
60657
|
+
}
|
|
60658
|
+
function isInfrastructureFailure(currentResult) {
|
|
60659
|
+
const errorMessage = currentResult.errorMessage || "";
|
|
60660
|
+
const stackPrefix = currentResult.stackPrefix || "";
|
|
60661
|
+
if (/\bassertionerror\b/i.test(errorMessage)) {
|
|
60662
|
+
return false;
|
|
60663
|
+
}
|
|
60664
|
+
const combinedText = `${errorMessage}
|
|
60665
|
+
${stackPrefix}`;
|
|
60666
|
+
return INFRASTRUCTURE_FAILURE_PATTERNS.some((pattern) => pattern.test(combinedText));
|
|
60667
|
+
}
|
|
60648
60668
|
function classifyFailure(currentResult, history) {
|
|
60649
60669
|
const normalizedFile = currentResult.testFile.toLowerCase();
|
|
60650
60670
|
const normalizedName = currentResult.testName.toLowerCase();
|
|
60651
60671
|
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());
|
|
60672
|
+
if (isInfrastructureFailure(currentResult)) {
|
|
60673
|
+
return {
|
|
60674
|
+
testFile: currentResult.testFile,
|
|
60675
|
+
testName: currentResult.testName,
|
|
60676
|
+
classification: "infrastructure_failure",
|
|
60677
|
+
errorMessage: currentResult.errorMessage,
|
|
60678
|
+
stackPrefix: currentResult.stackPrefix,
|
|
60679
|
+
durationMs: currentResult.durationMs,
|
|
60680
|
+
confidence: computeConfidence2(testHistory.length)
|
|
60681
|
+
};
|
|
60682
|
+
}
|
|
60652
60683
|
const lastThree = testHistory.slice(0, 3);
|
|
60653
60684
|
const lastTen = testHistory.slice(0, 10);
|
|
60654
60685
|
const normalizedTestFile = currentResult.testFile.toLowerCase();
|
|
@@ -60748,6 +60779,26 @@ function classifyAndCluster(testResults, history) {
|
|
|
60748
60779
|
const clusters = clusterFailures(classified);
|
|
60749
60780
|
return { classified, clusters };
|
|
60750
60781
|
}
|
|
60782
|
+
var MAX_INFRA_CONTEXT_CHARS = 80, INFRASTRUCTURE_FAILURE_PATTERNS;
|
|
60783
|
+
var init_failure_classifier = __esm(() => {
|
|
60784
|
+
INFRASTRUCTURE_FAILURE_PATTERNS = [
|
|
60785
|
+
/\boutofmemoryerror\b/i,
|
|
60786
|
+
/\ballocation failed - javascript heap out of memory\b/i,
|
|
60787
|
+
/\bcannot allocate memory\b/i,
|
|
60788
|
+
/\bout of memory:\s*killed process\b/i,
|
|
60789
|
+
/\boom-kill\b/i,
|
|
60790
|
+
/(?:^|\n|\bcommand failed:\s*)\s*killed(?:\s*(?:[-:]\s*)?(?:by signal|signal|sigkill).*)?\s*(?:\n|$)/i,
|
|
60791
|
+
...buildErrnoPatternPair("ETIMEDOUT", "connect|connection|request|socket|network"),
|
|
60792
|
+
...buildErrnoPatternPair("ECONNREFUSED", "connect|connection|socket"),
|
|
60793
|
+
...buildErrnoPatternPair("ENOTFOUND", "getaddrinfo|dns|lookup"),
|
|
60794
|
+
...buildErrnoPatternPair("ECONNRESET", "connect|connection|request|socket|network|stream|read"),
|
|
60795
|
+
...buildErrnoPatternPair("EPIPE", "pipe|stream|write|socket|stdout|stderr"),
|
|
60796
|
+
/\bbroken pipe\b/i,
|
|
60797
|
+
/\bexit(?:ed)?(?:\s+with)?(?:\s+code)?\s*[:=]?\s*137\b/i,
|
|
60798
|
+
/\bsig(?:segv|abrt|bus)\b/i,
|
|
60799
|
+
/\bsegmentation fault(?:\s*\(core dumped\))?\b/i
|
|
60800
|
+
];
|
|
60801
|
+
});
|
|
60751
60802
|
|
|
60752
60803
|
// src/test-impact/flaky-detector.ts
|
|
60753
60804
|
function computeCombinedFlakyScore(recent) {
|
|
@@ -62913,6 +62964,7 @@ var init_test_runner = __esm(() => {
|
|
|
62913
62964
|
init_zod();
|
|
62914
62965
|
init_discovery();
|
|
62915
62966
|
init_analyzer();
|
|
62967
|
+
init_failure_classifier();
|
|
62916
62968
|
init_history_store();
|
|
62917
62969
|
init_bun_compat();
|
|
62918
62970
|
init_path_security();
|
|
@@ -67551,7 +67603,7 @@ Subcommands:
|
|
|
67551
67603
|
handler: (ctx) => handleModeCommandWithBundledSkills(ctx, handlePrReviewCommand),
|
|
67552
67604
|
description: "Launch deep PR review with multi-lane analysis [url] [--council]",
|
|
67553
67605
|
args: "<pr-url|owner/repo#N|N> [--council]",
|
|
67554
|
-
details: "Launches a structured PR review: reconstructs PR intent via obligation extraction cascade, runs 6 parallel explorer lanes (correctness, security, dependencies, docs-intent-vs-actual, tests, performance-architecture), validates findings through independent reviewer confirmation, applies critic challenge to HIGH/CRITICAL findings, synthesizes structured report. --council variant fires adversarial multi-model review. Supports full GitHub URL, owner/repo#N shorthand, or bare PR number (resolves against origin remote).",
|
|
67606
|
+
details: "Launches a structured PR review: reconstructs PR intent via obligation extraction cascade, runs 6 parallel explorer lanes through the deterministic dispatch_lanes join barrier (correctness, security, dependencies, docs-intent-vs-actual, tests, performance-architecture), validates findings through independent reviewer confirmation, applies critic challenge to HIGH/CRITICAL findings, synthesizes structured report. --council variant fires adversarial multi-model review. Supports full GitHub URL, owner/repo#N shorthand, or bare PR number (resolves against origin remote).",
|
|
67555
67607
|
category: "agent"
|
|
67556
67608
|
},
|
|
67557
67609
|
"pr-feedback": {
|
|
@@ -362,7 +362,7 @@ export declare const COMMAND_REGISTRY: {
|
|
|
362
362
|
readonly handler: (ctx: CommandContext) => CommandResult;
|
|
363
363
|
readonly description: "Launch deep PR review with multi-lane analysis [url] [--council]";
|
|
364
364
|
readonly args: "<pr-url|owner/repo#N|N> [--council]";
|
|
365
|
-
readonly details: "Launches a structured PR review: reconstructs PR intent via obligation extraction cascade, runs 6 parallel explorer lanes (correctness, security, dependencies, docs-intent-vs-actual, tests, performance-architecture), validates findings through independent reviewer confirmation, applies critic challenge to HIGH/CRITICAL findings, synthesizes structured report. --council variant fires adversarial multi-model review. Supports full GitHub URL, owner/repo#N shorthand, or bare PR number (resolves against origin remote).";
|
|
365
|
+
readonly details: "Launches a structured PR review: reconstructs PR intent via obligation extraction cascade, runs 6 parallel explorer lanes through the deterministic dispatch_lanes join barrier (correctness, security, dependencies, docs-intent-vs-actual, tests, performance-architecture), validates findings through independent reviewer confirmation, applies critic challenge to HIGH/CRITICAL findings, synthesizes structured report. --council variant fires adversarial multi-model review. Supports full GitHub URL, owner/repo#N shorthand, or bare PR number (resolves against origin remote).";
|
|
366
366
|
readonly category: "agent";
|
|
367
367
|
};
|
|
368
368
|
readonly 'pr-feedback': {
|