opencode-swarm 7.149.0 → 7.150.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.
Files changed (73) hide show
  1. package/dist/background/candidate-contract.d.ts +1 -1
  2. package/dist/background/pending-delegations.d.ts +6 -0
  3. package/dist/background/pr-review-contract.d.ts +20 -0
  4. package/dist/cli/{config-doctor-fx8d6pma.js → config-doctor-96qyv31a.js} +2 -2
  5. package/dist/cli/{core-0v762txd.js → core-xx0x5tfv.js} +1 -1
  6. package/dist/cli/{curation-policy-4jxx3ey4.js → curation-policy-nck9g765.js} +6 -6
  7. package/dist/cli/{curator-6w4frzdz.js → curator-frrehxxe.js} +28 -28
  8. package/dist/cli/{curator-llm-factory-8fstpeqh.js → curator-llm-factory-b83jsg02.js} +28 -28
  9. package/dist/cli/{evidence-summary-service-x00z38n2.js → evidence-summary-service-dv4bt2bx.js} +12 -12
  10. package/dist/cli/{gate-evidence-ejdek2td.js → gate-evidence-dkvs7aez.js} +6 -6
  11. package/dist/cli/{guardrail-explain-nynjhbzk.js → guardrail-explain-1zbk21fq.js} +29 -29
  12. package/dist/cli/{guardrail-log-6bktj08e.js → guardrail-log-d20jewtr.js} +5 -5
  13. package/dist/cli/{guardrail-reset-hsfd5ykq.js → guardrail-reset-wb3ba243.js} +28 -28
  14. package/dist/cli/{hive-promoter-32artf8c.js → hive-promoter-10zv1b45.js} +28 -28
  15. package/dist/cli/{index-pgfn8h50.js → index-0tn1kxej.js} +7 -7
  16. package/dist/cli/{index-mza55jmc.js → index-1rpjd5na.js} +1 -1
  17. package/dist/cli/{index-42habrdv.js → index-1rww5k9e.js} +4 -4
  18. package/dist/cli/{index-5q5ws00e.js → index-1wmd5wn1.js} +4 -4
  19. package/dist/cli/{index-bmaz2yy4.js → index-4sdhbxgq.js} +1 -1
  20. package/dist/cli/{index-ka2vav7t.js → index-8cn6545x.js} +30 -30
  21. package/dist/cli/{index-kb1p6dpx.js → index-an922xj4.js} +7 -7
  22. package/dist/cli/{index-cfvbd3dg.js → index-apwcvfjt.js} +2 -2
  23. package/dist/cli/{index-wsar7d91.js → index-bhg6brtw.js} +1 -1
  24. package/dist/cli/{index-ame8ek9g.js → index-dtmgt2xn.js} +5 -5
  25. package/dist/cli/{index-c83bztkp.js → index-exn0ztsv.js} +1 -1
  26. package/dist/cli/{index-ef0wracg.js → index-g75rbw3e.js} +5 -5
  27. package/dist/cli/{index-zkcwan96.js → index-ggs716fj.js} +1 -1
  28. package/dist/cli/{index-ccyve4pb.js → index-htqs4p52.js} +1 -1
  29. package/dist/cli/{index-c1h0rdkr.js → index-jb9tb1sd.js} +1 -1
  30. package/dist/cli/{index-wbz365gn.js → index-k2sm9677.js} +1 -1
  31. package/dist/cli/{index-a90c1gtn.js → index-m8dn0qnm.js} +1 -1
  32. package/dist/cli/{index-01q7mb83.js → index-ma1p1w05.js} +6 -6
  33. package/dist/cli/{index-41n0thtd.js → index-mef0trex.js} +2 -1
  34. package/dist/cli/{index-8hkxm9mh.js → index-mnhagjvn.js} +4 -4
  35. package/dist/cli/{index-vfv4vnnc.js → index-n99s022c.js} +1 -1
  36. package/dist/cli/{index-z6471b7r.js → index-prxrmc3b.js} +2 -2
  37. package/dist/cli/{index-bcfcekx9.js → index-qqs44wcp.js} +1525 -459
  38. package/dist/cli/{index-79pwr8hc.js → index-r5djc1cc.js} +5 -5
  39. package/dist/cli/{index-s7t2c9jd.js → index-reknv4f9.js} +2 -2
  40. package/dist/cli/{index-hbhw2qd7.js → index-s0xz2520.js} +3 -3
  41. package/dist/cli/{index-q8e2yd98.js → index-t54jt9cs.js} +1 -1
  42. package/dist/cli/{index-n6jykega.js → index-vy6q9d8j.js} +3 -2
  43. package/dist/cli/{index-xdp0bx28.js → index-w9pb72vg.js} +2 -2
  44. package/dist/cli/{index-8yan955h.js → index-x3pt7d0b.js} +2 -2
  45. package/dist/cli/{index-wj0gnab0.js → index-xggpmtfx.js} +1 -1
  46. package/dist/cli/{index-6thxr1q7.js → index-zyv56em5.js} +3 -3
  47. package/dist/cli/index.js +28 -28
  48. package/dist/cli/{knowledge-escalator-ty2kesdj.js → knowledge-escalator-pc7smwrd.js} +11 -11
  49. package/dist/cli/{knowledge-events-x3rd7r3j.js → knowledge-events-jmb3jm84.js} +9 -9
  50. package/dist/cli/{knowledge-link-a5f89833.js → knowledge-link-mzn8x0qd.js} +5 -5
  51. package/dist/cli/{knowledge-store-zsz4dxjq.js → knowledge-store-wd6zh05h.js} +6 -6
  52. package/dist/cli/{knowledge-validator-bdhgkw9f.js → knowledge-validator-2v6ar1wk.js} +8 -8
  53. package/dist/cli/{pending-delegations-aez8ebdr.js → pending-delegations-qzy6rnvw.js} +3 -3
  54. package/dist/cli/{pr-subscriptions-cpnwvc6y.js → pr-subscriptions-q862pvz1.js} +3 -3
  55. package/dist/cli/{runner-9mnkfjw7.js → runner-1aygs98c.js} +6 -6
  56. package/dist/cli/{scan-cursor-3ba1spad.js → scan-cursor-hr8e3jqj.js} +7 -7
  57. package/dist/cli/{schema-h251vmd1.js → schema-g44y7s0w.js} +1 -1
  58. package/dist/cli/{scope-persistence-h1b31ba2.js → scope-persistence-0n2cv4kn.js} +8 -8
  59. package/dist/cli/{skill-generator-esrn40th.js → skill-generator-0gmpxwgk.js} +13 -13
  60. package/dist/cli/{telemetry-jtq6px7k.js → telemetry-5deacb7w.js} +1 -1
  61. package/dist/cli/{worktree-collision-ownership-r8j31h06.js → worktree-collision-ownership-9v8e0dz7.js} +3 -3
  62. package/dist/cli/{worktree-isolation-pbr4d5m9.js → worktree-isolation-pcr5zv0c.js} +28 -28
  63. package/dist/failures/invocation-failure.d.ts +7 -0
  64. package/dist/hooks/pr-workflow-gate.d.ts +37 -6
  65. package/dist/index.js +199 -172
  66. package/dist/lang/symbol-graph.d.ts +15 -0
  67. package/dist/services/session-reflection.d.ts +7 -0
  68. package/dist/state.d.ts +10 -0
  69. package/dist/tools/dispatch-lanes.d.ts +50 -1
  70. package/dist/tools/repo-graph/builder.d.ts +27 -1
  71. package/dist/tools/symbols.d.ts +35 -0
  72. package/dist/tools/write-pr-review-artifact.d.ts +2 -0
  73. package/package.json +2 -1
@@ -50,3 +50,18 @@ export interface FileSymbolFacts {
50
50
  * @returns FileSymbolFacts, or null on failure
51
51
  */
52
52
  export declare function extractFileSymbols(grammarId: string, source: string): Promise<FileSymbolFacts | null>;
53
+ declare function parseDartImport(text: string): FileSymbolFacts['imports'][0] | FileSymbolFacts['imports'] | null;
54
+ declare function parseRubyRequire(text: string): FileSymbolFacts['imports'][0] | null;
55
+ declare function parsePhpUse(text: string): FileSymbolFacts['imports'][0] | null;
56
+ /**
57
+ * DI seam for direct parser tests — the import parsers are module-private by
58
+ * design; tests exercise them through this seam instead of `mock.module`,
59
+ * which leaks across Bun's shared test-runner process (@see AGENTS.md
60
+ * invariant #7; PR #2361 review R10/PRR-017).
61
+ */
62
+ export declare const _internals: {
63
+ parseDartImport: typeof parseDartImport;
64
+ parseRubyRequire: typeof parseRubyRequire;
65
+ parsePhpUse: typeof parsePhpUse;
66
+ };
67
+ export {};
@@ -24,6 +24,13 @@ export interface ToolProblem {
24
24
  totalCalls: number;
25
25
  failureRate: number;
26
26
  avgDurationMs: number;
27
+ /**
28
+ * Issue #2349 sweep: a bounded, deduplicated sample of WHY this tool failed.
29
+ * Reporting only that a tool failed N times is the same defect class the
30
+ * sweep set out to close — the reason has to reach a surface a human or
31
+ * agent actually reads, which is this one.
32
+ */
33
+ failureReasons?: string[];
27
34
  }
28
35
  export interface AgentDispatchSummary {
29
36
  agent: string;
package/dist/state.d.ts CHANGED
@@ -33,6 +33,16 @@ export interface ToolAggregate {
33
33
  successCount: number;
34
34
  failureCount: number;
35
35
  totalDuration: number;
36
+ /**
37
+ * A small, bounded, deduplicated sample of WHY this tool failed (issue
38
+ * #2349 follow-up: agent-activity.ts previously collapsed `output.error`
39
+ * into a pure boolean and discarded the value). Capped at
40
+ * MAX_TOOL_FAILURE_REASONS distinct entries, each truncated to
41
+ * MAX_TOOL_FAILURE_REASON_LENGTH chars, so a tool that fails thousands of
42
+ * times with the same or varying reasons cannot grow this unboundedly.
43
+ * Omitted (absent, not an empty array) when no reason was ever recorded.
44
+ */
45
+ failureReasons?: string[];
36
46
  }
37
47
  /**
38
48
  * Represents a delegation from one agent to another
@@ -96,6 +96,7 @@ declare const DispatchLanesAsyncArgsSchema: z.ZodObject<{
96
96
  fanout: "fanout";
97
97
  }>>;
98
98
  pr_review_wave_attempt: z.ZodOptional<z.ZodNumber>;
99
+ pr_review_contract_retry: z.ZodOptional<z.ZodBoolean>;
99
100
  }, z.core.$strip>;
100
101
  declare const CollectLaneResultsArgsSchema: z.ZodObject<{
101
102
  batch_id: z.ZodString;
@@ -132,6 +133,7 @@ export interface DispatchLaneResult {
132
133
  output_artifact_error?: string;
133
134
  transcript_incomplete?: boolean;
134
135
  message_count?: number;
136
+ workflow_lane_failure_class?: BackgroundDelegationResult['workflowLaneFailureClass'];
135
137
  salvaged_workflow_lanes?: string[];
136
138
  salvaged_workflow_lane_recoveries?: Array<{
137
139
  workflow_lane: string;
@@ -195,7 +197,7 @@ export interface CollectLaneResultsResult {
195
197
  all_settled: boolean;
196
198
  lane_results: DispatchLaneResult[];
197
199
  /**
198
- * Alert-only host liveness advisory for still-pending pr-review lanes past
200
+ * Alert-only host liveness advisory for still-pending async lanes past
199
201
  * the pending-liveness threshold (issue #2280 Part B). Present only when at
200
202
  * least one such lane exists; never affects `success`, counts, settlement,
201
203
  * or any lane's state.
@@ -415,6 +417,7 @@ export declare const _test_exports: {
415
417
  fanout: "fanout";
416
418
  }>>;
417
419
  pr_review_wave_attempt: z.ZodOptional<z.ZodNumber>;
420
+ pr_review_contract_retry: z.ZodOptional<z.ZodBoolean>;
418
421
  }, z.core.$strip>;
419
422
  DEFAULT_TIMEOUT_MS: number;
420
423
  DEFAULT_ASYNC_LAUNCH_TIMEOUT_MS: number;
@@ -449,6 +452,29 @@ export declare function executeDispatchLanesAsync(args: unknown, directory: stri
449
452
  export declare function executeCollectLaneResults(args: unknown, directory: string, context?: Pick<DispatchLanesExecutionContext, 'sessionID'>): Promise<CollectLaneResultsResult>;
450
453
  declare function isRetryableSessionCreateFailure(error: unknown): boolean;
451
454
  declare function consumePrReviewReceiptAppendFailureLog(loggedFailures: Set<string>, parentSessionId: string, correlationId: string): boolean;
455
+ /**
456
+ * Issue #2349: a terminal error read off the last assistant message of a lane
457
+ * session, classified for settlement.
458
+ *
459
+ * `kind` derives from the SDK's discriminated `AssistantMessage.error` union and
460
+ * is AUTHORITATIVE for the settled lane status. `category`/`retryClass` come
461
+ * from the canonical {@link classifyProviderFailure} and are advisory
462
+ * classification for operator legibility. The two are NOT required to agree: an
463
+ * `APIError` whose message merely contains the word "aborted" settles as an
464
+ * error (the SDK says `APIError`) while carrying `provider.cancelled` from the
465
+ * text classifier. The reason string names both so the divergence is visible.
466
+ */
467
+ interface LaneTerminalError {
468
+ kind: 'provider' | 'aborted' | 'output_length' | 'unknown';
469
+ /** SDK discriminator (`error.name`), bounded. */
470
+ name: string;
471
+ /** Sanitized + bounded provider message. */
472
+ message: string;
473
+ statusCode: number | undefined;
474
+ /** `ApiError.data.isRetryable` — host-stated, not inferred. */
475
+ hostRetryable: boolean | undefined;
476
+ category: string;
477
+ }
452
478
  declare function extractAssistantTranscript(messages: Array<{
453
479
  info?: {
454
480
  role?: string;
@@ -467,6 +493,29 @@ declare function extractAssistantTranscript(messages: Array<{
467
493
  messageCount: number;
468
494
  transcriptIncomplete: boolean;
469
495
  terminalAssistantProof: boolean;
496
+ /**
497
+ * Issue #2349: `time.completed` of the last assistant message, surfaced so the
498
+ * collection loop can require positive turn-over evidence before settling a
499
+ * lane on an error. Previously computed here but discarded.
500
+ */
501
+ completedAt: number | undefined;
502
+ /**
503
+ * Issue #2349: the fetch-window truncation term ALONE, deliberately split out
504
+ * of {@link transcriptIncomplete}. `transcriptIncomplete` also folds in the
505
+ * TERMINAL `finish === 'length' | 'content-filter'` cases, so gating the
506
+ * error-settle on it would make the `output_length` classification
507
+ * unreachable. Only the "there may be unfetched earlier messages" signal is
508
+ * relevant to "did this lane really produce no output".
509
+ */
510
+ windowTruncated: boolean;
511
+ /**
512
+ * Issue #2349: the classified terminal error from the last assistant message,
513
+ * when present. The host records this on the persisted message; before this
514
+ * change the value was read only as an `=== undefined` existence test for
515
+ * {@link terminalAssistantProof} and then discarded, so no caller could ever
516
+ * learn WHY a lane died.
517
+ */
518
+ terminalError: LaneTerminalError | undefined;
470
519
  };
471
520
  declare function reserveCollectionLaneCallBudgets(deadline: number, remainingLaneCount: number, hasStatusCall: boolean, hasRevisionDigestCall?: boolean): {
472
521
  laneBudgetMs: number;
@@ -11,7 +11,7 @@
11
11
  * used by both the builder and the incremental updater.
12
12
  */
13
13
  import { extractFileSymbols } from '../../lang/symbol-graph';
14
- import { extractGoSymbols, extractPythonSymbols, extractRustSymbols, extractTSSymbols } from '../symbols';
14
+ import { extractDartSymbols, extractGoSymbols, extractPhpSymbols, extractPythonSymbols, extractRubySymbols, extractRustSymbols, extractTSSymbols } from '../symbols';
15
15
  import { extractFileOntology } from './ontology';
16
16
  import { safeRealpathSync } from './safe-realpath';
17
17
  import type { BuildWorkspaceGraphOptions, GraphEdge, GraphExtractorInputWitness, GraphNode, RepoGraph, RepoGraphDiagnostics, SymbolEdge } from './types';
@@ -28,7 +28,13 @@ export declare const _internals: {
28
28
  extractPythonSymbols: typeof extractPythonSymbols;
29
29
  extractRustSymbols: typeof extractRustSymbols;
30
30
  extractGoSymbols: typeof extractGoSymbols;
31
+ extractDartSymbols: typeof extractDartSymbols;
32
+ extractRubySymbols: typeof extractRubySymbols;
33
+ extractPhpSymbols: typeof extractPhpSymbols;
31
34
  parseFileImports: typeof parseFileImports;
35
+ parseDartFileImports: typeof parseDartFileImports;
36
+ parseRubyFileImports: typeof parseRubyFileImports;
37
+ parsePhpFileImports: typeof parsePhpFileImports;
32
38
  extractFileOntology: typeof extractFileOntology;
33
39
  stripComments: typeof stripComments;
34
40
  computeUsedSymbols: typeof computeUsedSymbols;
@@ -132,6 +138,26 @@ interface ParsedImport {
132
138
  */
133
139
  declare function stripComments(content: string): string;
134
140
  declare function parseFileImports(rawContent: string, sourceFile?: string, workspaceRoot?: string): ParsedImport[];
141
+ /**
142
+ * Regex import fallback for Dart (see {@link parseCSharpFileImports}).
143
+ * `hide` clauses are intentionally unhandled — the import is still recorded
144
+ * as a namespace import (all symbols minus hidden ones), which is correct
145
+ * for graph purposes.
146
+ */
147
+ declare function parseDartFileImports(rawContent: string): ParsedImport[];
148
+ /**
149
+ * Regex import fallback for Ruby require/require_relative. `require_relative`
150
+ * resolves against the requiring file's directory, so the specifier is
151
+ * normalized to './name' when no explicit relative prefix is present.
152
+ */
153
+ declare function parseRubyFileImports(rawContent: string): ParsedImport[];
154
+ /**
155
+ * Regex import fallback for PHP `use` declarations. Grouped `use A\B, C\D;`
156
+ * forms are a known limitation (the whole group is skipped); FQN specifiers
157
+ * are recorded as-is — mapping them to workspace files requires composer
158
+ * PSR-4 awareness, which is out of scope (#1531 "where practical").
159
+ */
160
+ declare function parsePhpFileImports(rawContent: string): ParsedImport[];
135
161
  /**
136
162
  * Conservatively determine which imported bindings are actually referenced in
137
163
  * the importing file's body.
@@ -19,5 +19,40 @@ export declare function extractTSSymbols(filePath: string, cwd: string): SymbolI
19
19
  export declare function extractPythonSymbols(filePath: string, cwd: string): SymbolInfo[];
20
20
  export declare function extractRustSymbols(filePath: string, cwd: string): SymbolInfo[];
21
21
  export declare function extractGoSymbols(filePath: string, cwd: string): SymbolInfo[];
22
+ /**
23
+ * Dart symbols: classes/mixins/enums/extensions and functions. Visibility is
24
+ * the `_`-prefix convention. Functions declared INSIDE a type body are
25
+ * emitted as qualified `TypeName.member` method symbols (mirroring the Swift
26
+ * extractor's naming) instead of being mislabeled as top-level functions;
27
+ * the qualification also keeps same-named members of different classes from
28
+ * collapsing in the name:kind dedup.
29
+ */
30
+ export declare function extractDartSymbols(filePath: string, cwd: string): SymbolInfo[];
31
+ /**
32
+ * Ruby symbols: modules, classes, constants, and `def` methods with
33
+ * `private`/`protected` section tracking. A nested class/module saves and
34
+ * restores the outer section (approximate `end`-balance tracking); targeted
35
+ * `private :sym` marks the named method. Singleton methods keep their `self.`
36
+ * qualification in the name. Dynamic constructs (`define_method`, `send`,
37
+ * metaprogramming) are invisible to this scanner by design.
38
+ */
39
+ export declare function extractRubySymbols(filePath: string, cwd: string): SymbolInfo[];
40
+ /**
41
+ * PHP symbols: namespaces, traits/interfaces/classes, functions and methods
42
+ * with visibility modifiers. Dynamic constructs (variable functions/classes,
43
+ * variable variables, Blade directives in `.blade.php`) are best-effort
44
+ * only — see docs/php-laravel.md.
45
+ */
46
+ export declare function extractPhpSymbols(filePath: string, cwd: string): SymbolInfo[];
22
47
  export declare const symbols: ToolDefinition;
48
+ /**
49
+ * DI seam for testability — tests substitute via `_internals.fn` rather than
50
+ * `mock.module`, which leaks across Bun's shared test-runner process.
51
+ * @see AGENTS.md invariant #7
52
+ */
53
+ export declare const _internals: {
54
+ extractDartSymbols: typeof extractDartSymbols;
55
+ extractRubySymbols: typeof extractRubySymbols;
56
+ extractPhpSymbols: typeof extractPhpSymbols;
57
+ };
23
58
  export {};
@@ -1,9 +1,11 @@
1
+ import { assertPrReviewArtifactBoundary } from '../hooks/pr-workflow-gate.js';
1
2
  import { createSwarmTool } from './create-tool.js';
2
3
  declare function atomicWrite(filePath: string, content: string): Promise<void>;
3
4
  declare function atomicCreate(filePath: string, content: string): Promise<boolean>;
4
5
  export declare const _internals: {
5
6
  atomicWrite: typeof atomicWrite;
6
7
  atomicCreate: typeof atomicCreate;
8
+ assertBoundary: typeof assertPrReviewArtifactBoundary;
7
9
  };
8
10
  export declare function executeWritePrReviewArtifact(args: unknown, directory: string, context?: {
9
11
  sessionID?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-swarm",
3
- "version": "7.149.0",
3
+ "version": "7.150.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",
@@ -114,6 +114,7 @@
114
114
  "check:pending-fragment": "bun run scripts/check-pending-fragment.ts",
115
115
  "check:gate-portability": "bun run scripts/check-gate-portability.ts",
116
116
  "check:bare-spawn": "bun run scripts/check-bare-executable-spawn.ts",
117
+ "check:error-channel-discard": "bun run scripts/check-error-channel-discard.ts",
117
118
  "check:memory-recall": "bun run scripts/memory-recall-regression.ts"
118
119
  },
119
120
  "dependencies": {