opencode-swarm 7.168.1 → 7.169.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 (133) hide show
  1. package/.opencode/skills/swarm-pr-feedback/SKILL.md +11 -11
  2. package/binaries/win32-arm64/swarm-sandbox-runner.exe +0 -0
  3. package/binaries/win32-x64/swarm-sandbox-runner.exe +0 -0
  4. package/dist/cli/{coder-settlement-54a3d97g.js → coder-settlement-fd6ba876.js} +12 -12
  5. package/dist/cli/{config-doctor-vzp6b3ng.js → config-doctor-zeppqwwx.js} +2 -2
  6. package/dist/cli/{core-yynse50x.js → core-fj1afc31.js} +5 -2
  7. package/dist/cli/{curation-policy-mgwv8h2k.js → curation-policy-k74qz9ms.js} +5 -5
  8. package/dist/cli/{curator-drift-k0zrnm09.js → curator-drift-3ssjr0nx.js} +5 -5
  9. package/dist/cli/{curator-agdhhzqt.js → curator-emftndv0.js} +39 -38
  10. package/dist/cli/curator-llm-factory-4t773tmz.js +72 -0
  11. package/dist/cli/{dispatch-8ks9dyk5.js → dispatch-hwwj3qrb.js} +2 -2
  12. package/dist/cli/{evidence-summary-service-6mmcekr7.js → evidence-summary-service-51b69jc3.js} +16 -16
  13. package/dist/cli/{gate-evidence-xqvkqhrk.js → gate-evidence-53s161wb.js} +7 -7
  14. package/dist/cli/guardrail-explain-mhx8gt8q.js +73 -0
  15. package/dist/cli/{guardrail-log-5wa5c77w.js → guardrail-log-xg6hrdsq.js} +8 -8
  16. package/dist/cli/{guardrail-reset-dh78tbcf.js → guardrail-reset-fgv5kt5x.js} +39 -38
  17. package/dist/cli/{hive-promoter-3czsx7c6.js → hive-promoter-41zygtgx.js} +39 -38
  18. package/dist/cli/index-0hgmsyfp.js +92 -0
  19. package/dist/cli/{index-6df6wbvj.js → index-0vgs5r39.js} +8 -8
  20. package/dist/cli/{index-3jmb4ppa.js → index-1cbjemgh.js} +2 -2
  21. package/dist/cli/{index-p612v1mv.js → index-2s7dvzff.js} +200 -51
  22. package/dist/cli/{index-qthc56c4.js → index-2znfa537.js} +4 -4
  23. package/dist/cli/{index-91ww9hyr.js → index-3bfzpzsb.js} +1 -1
  24. package/dist/cli/{index-kkmezerc.js → index-3zcds757.js} +3101 -1918
  25. package/dist/cli/{index-d5qf7hvh.js → index-5400m33a.js} +1 -1
  26. package/dist/cli/{index-bw9x8d8n.js → index-55fkkjec.js} +5 -5
  27. package/dist/cli/{index-qwsh0h2g.js → index-5qt9yf5w.js} +4 -4
  28. package/dist/cli/{index-chebm5h5.js → index-5reh1bjz.js} +3 -3
  29. package/dist/cli/{index-2xbww1x0.js → index-76ng6vmq.js} +7 -7
  30. package/dist/cli/{index-qhey6vc3.js → index-7h01bkm6.js} +2 -2
  31. package/dist/cli/{index-gh9ybrrs.js → index-83m0y4cj.js} +6 -6
  32. package/dist/cli/{index-yt9n9zt3.js → index-8x9keek6.js} +41 -40
  33. package/dist/cli/{index-8ybjqg51.js → index-9ttqbhvw.js} +1 -1
  34. package/dist/cli/{index-kear8gb7.js → index-b3pmzbh1.js} +2 -2
  35. package/dist/cli/{index-h439y187.js → index-bernkwgf.js} +1 -1
  36. package/dist/cli/{index-m35hybf0.js → index-bm5xrfnx.js} +1 -1
  37. package/dist/cli/{index-pyf517sz.js → index-br3mvbsa.js} +2 -2
  38. package/dist/cli/{index-4r5pmtvk.js → index-bx1wgn3a.js} +4 -4
  39. package/dist/cli/{index-xhb4gryr.js → index-c7kr7tnk.js} +4 -4
  40. package/dist/cli/{index-nwwk3dej.js → index-cgpwjctj.js} +1 -1
  41. package/dist/cli/{index-q8091q8b.js → index-dd48vt27.js} +3 -3
  42. package/dist/cli/{index-wst6n478.js → index-dvbf6fpn.js} +1 -1
  43. package/dist/cli/{index-w3x1dmrf.js → index-e4dxf5cr.js} +39 -38
  44. package/dist/cli/{index-5g6rhkn7.js → index-egkc2bpv.js} +36 -1
  45. package/dist/cli/{index-4kv1ew3q.js → index-exf0j569.js} +1 -1
  46. package/dist/cli/{index-a8xbvsse.js → index-fgp96k3r.js} +2 -2
  47. package/dist/cli/{index-5zqakgp4.js → index-fhh02gwx.js} +3 -3
  48. package/dist/cli/{index-dfyv3xkd.js → index-gfbggp8k.js} +9 -9
  49. package/dist/cli/{index-f1fps3w9.js → index-ksybszed.js} +7 -7
  50. package/dist/cli/{index-v3xc4sde.js → index-nbdmdyke.js} +2 -1
  51. package/dist/cli/{index-z6qreakh.js → index-nprdr0sm.js} +6 -4
  52. package/dist/cli/{index-9b2105n0.js → index-nwv3e3kc.js} +2 -2
  53. package/dist/cli/{index-bvqqwx84.js → index-nyn01yrz.js} +2 -2
  54. package/dist/cli/{index-y85aptep.js → index-p6xsgk4r.js} +7 -7
  55. package/dist/cli/{index-xkf3672y.js → index-s96dpjsk.js} +2 -2
  56. package/dist/cli/{index-j0bxxz9d.js → index-sb1s03y9.js} +8 -8
  57. package/dist/cli/{index-gmpmgtzn.js → index-sxcfszbe.js} +5 -5
  58. package/dist/cli/{index-qkwtth00.js → index-wwr67xc0.js} +197 -35
  59. package/dist/cli/{index-gp9yzr1v.js → index-xnpjwc4h.js} +1 -1
  60. package/dist/cli/{index-apy1qfj0.js → index-yj24ny5k.js} +26 -4
  61. package/dist/cli/{index-w1dfkp1q.js → index-zapc8vj4.js} +14 -14
  62. package/dist/cli/index.js +39 -38
  63. package/dist/cli/{knowledge-escalator-135dz4eh.js → knowledge-escalator-07s44av0.js} +13 -13
  64. package/dist/cli/{knowledge-events-27gwv47q.js → knowledge-events-j2n1569p.js} +11 -11
  65. package/dist/cli/{knowledge-link-dr3xnwyd.js → knowledge-link-rkxfrmhm.js} +4 -4
  66. package/dist/cli/{knowledge-store-80m44bfw.js → knowledge-store-85metj89.js} +5 -5
  67. package/dist/cli/{knowledge-validator-crsfb2cc.js → knowledge-validator-63k1xzcc.js} +7 -7
  68. package/dist/cli/{pending-delegations-gwgjzzkz.js → pending-delegations-dckmjymn.js} +12 -12
  69. package/dist/cli/{pr-subscriptions-g633nhz4.js → pr-subscriptions-pyh73me6.js} +12 -12
  70. package/dist/cli/{pr-workflow-gate-4dc5nt2e.js → pr-workflow-gate-k1r4rjw4.js} +39 -38
  71. package/dist/cli/{runner-k0ycgv8x.js → runner-1dwrgyyr.js} +6 -6
  72. package/dist/cli/{scan-cursor-avxjsm4w.js → scan-cursor-k6egg4n0.js} +6 -6
  73. package/dist/cli/{schema-3ja77k4y.js → schema-vdrtpggt.js} +5 -1
  74. package/dist/cli/{scope-persistence-f540tc50.js → scope-persistence-h1mmww19.js} +14 -14
  75. package/dist/cli/{skill-generator-kcqqpg1g.js → skill-generator-pmn6gmvk.js} +15 -15
  76. package/dist/cli/{snapshot-coordination-init-e4s8bn4p.js → snapshot-coordination-init-rspykgd0.js} +39 -38
  77. package/dist/cli/{telemetry-2wzapf11.js → telemetry-fdtaemnv.js} +1 -1
  78. package/dist/cli/{workspace-snapshot-rkgxhj9b.js → workspace-snapshot-hkz2wt1c.js} +4 -4
  79. package/dist/cli/{worktree-collision-ownership-rk9gz638.js → worktree-collision-ownership-x84dzzzc.js} +18 -104
  80. package/dist/cli/{worktree-isolation-1bdzfgky.js → worktree-isolation-nw9pakkx.js} +39 -38
  81. package/dist/commands/destructive-purge.d.ts +85 -0
  82. package/dist/commands/registry.d.ts +2 -2
  83. package/dist/commands/reset-session.d.ts +5 -1
  84. package/dist/config/constants.d.ts +4 -1
  85. package/dist/config/lane-context.d.ts +19 -0
  86. package/dist/config/schema.d.ts +77 -0
  87. package/dist/evaluation/index.d.ts +1 -0
  88. package/dist/evaluation/retrieval-quality.d.ts +116 -0
  89. package/dist/failures/invocation-failure.d.ts +23 -4
  90. package/dist/hooks/init-orphan-recovery.d.ts +7 -0
  91. package/dist/hooks/pr-workflow-gate.d.ts +8 -2
  92. package/dist/index.js +596 -590
  93. package/dist/memory/embeddings/reranker.d.ts +13 -2
  94. package/dist/memory/evaluation.d.ts +99 -0
  95. package/dist/memory/heldout-evaluation-corpus.d.ts +51 -0
  96. package/dist/memory/index.d.ts +5 -2
  97. package/dist/memory/sqlite-provider.d.ts +35 -1
  98. package/dist/memory/types.d.ts +14 -0
  99. package/dist/observability/otel-mapping.d.ts +5 -5
  100. package/dist/observability/otlp-exporter.d.ts +80 -0
  101. package/dist/parallel/lane-owners.d.ts +76 -0
  102. package/dist/tools/repo-graph/query.d.ts +6 -1
  103. package/dist/tools/repo-graph/types.d.ts +13 -4
  104. package/dist/utils/bun-compat.d.ts +20 -0
  105. package/dist/utils/gitignore-warning.d.ts +5 -2
  106. package/dist/worktree/base-migration.d.ts +55 -0
  107. package/dist/worktree/core.d.ts +15 -6
  108. package/dist/worktree/ownership.d.ts +66 -0
  109. package/opencode-swarm.schema.json +97 -0
  110. package/package.json +4 -2
  111. package/tests/fixtures/memory-recall-heldout/manifest.json +311 -0
  112. package/tests/fixtures/memory-recall-heldout/sources/bash.sh +1 -0
  113. package/tests/fixtures/memory-recall-heldout/sources/c.c +1 -0
  114. package/tests/fixtures/memory-recall-heldout/sources/cpp.cpp +1 -0
  115. package/tests/fixtures/memory-recall-heldout/sources/csharp.cs +1 -0
  116. package/tests/fixtures/memory-recall-heldout/sources/css.css +3 -0
  117. package/tests/fixtures/memory-recall-heldout/sources/dart.dart +1 -0
  118. package/tests/fixtures/memory-recall-heldout/sources/go.go +3 -0
  119. package/tests/fixtures/memory-recall-heldout/sources/ini.ini +2 -0
  120. package/tests/fixtures/memory-recall-heldout/sources/java.java +1 -0
  121. package/tests/fixtures/memory-recall-heldout/sources/javascript.js +3 -0
  122. package/tests/fixtures/memory-recall-heldout/sources/kotlin.kt +1 -0
  123. package/tests/fixtures/memory-recall-heldout/sources/php.php +1 -0
  124. package/tests/fixtures/memory-recall-heldout/sources/powershell.ps1 +1 -0
  125. package/tests/fixtures/memory-recall-heldout/sources/python.py +2 -0
  126. package/tests/fixtures/memory-recall-heldout/sources/regex.regex +1 -0
  127. package/tests/fixtures/memory-recall-heldout/sources/ruby.rb +3 -0
  128. package/tests/fixtures/memory-recall-heldout/sources/rust.rs +1 -0
  129. package/tests/fixtures/memory-recall-heldout/sources/swift.swift +1 -0
  130. package/tests/fixtures/memory-recall-heldout/sources/tsx.tsx +3 -0
  131. package/tests/fixtures/memory-recall-heldout/sources/typescript.ts +3 -0
  132. package/dist/cli/curator-llm-factory-ygxd6hfx.js +0 -71
  133. package/dist/cli/guardrail-explain-vjtjhgzs.js +0 -72
@@ -0,0 +1,116 @@
1
+ import { buildWorkspaceGraphAsync } from '../tools/repo-graph/builder';
2
+ export declare const _internals: {
3
+ buildWorkspaceGraphAsync: typeof buildWorkspaceGraphAsync;
4
+ };
5
+ export interface RetrievalQualityResourceCaps {
6
+ max_files: number;
7
+ walk_budget_ms: number;
8
+ max_tokens: number;
9
+ top_n: number;
10
+ }
11
+ export interface RetrievalQualityOptions {
12
+ corpusDirectory: string;
13
+ resourceCaps?: Partial<RetrievalQualityResourceCaps>;
14
+ /** Test-only diagnostic escape hatch. Production callers must clean up. */
15
+ keepTempRoot?: boolean;
16
+ }
17
+ export type RetrievalQualityStatus = 'complete' | 'degraded' | 'skipped';
18
+ export interface ExactMeasurement {
19
+ expected: string[];
20
+ observed: string[];
21
+ true_positive_count: number;
22
+ false_negative: string[];
23
+ false_positive: string[];
24
+ precision: number;
25
+ recall: number;
26
+ }
27
+ export interface RetrievalRouteMeasurement {
28
+ status: RetrievalQualityStatus;
29
+ provenance: 'direct-source-fallback' | 'fresh-indexed-subgraph' | 'unavailable';
30
+ degradation_reason?: string;
31
+ graph_hit: boolean;
32
+ positive_hit: boolean;
33
+ fallback_reason: string | null;
34
+ actions: string[];
35
+ matched_resource_count: number;
36
+ }
37
+ export interface HeldoutGraphQualityCase {
38
+ id: string;
39
+ language: string;
40
+ analyzer: {
41
+ declared_id: string | null;
42
+ implementation: 'extractFileSymbols';
43
+ };
44
+ source: {
45
+ hash: string;
46
+ provenance: 'direct-source';
47
+ };
48
+ status: RetrievalQualityStatus;
49
+ degradation_reason?: string;
50
+ symbols: ExactMeasurement;
51
+ edges: ExactMeasurement;
52
+ known_misses: {
53
+ declared: string[];
54
+ matching_measured_false_negatives: string[];
55
+ };
56
+ spurious_edges: {
57
+ declared: string[];
58
+ matching_measured_false_positives: string[];
59
+ };
60
+ paraphrase: {
61
+ query: string;
62
+ direct_source: RetrievalRouteMeasurement;
63
+ indexed_control: RetrievalRouteMeasurement;
64
+ };
65
+ latency_ms: number;
66
+ }
67
+ export interface HeldoutGraphQualityReport {
68
+ schema_version: 1;
69
+ corpus: {
70
+ id: string;
71
+ version: string | null;
72
+ hash: string;
73
+ split: 'heldout';
74
+ };
75
+ generated_at: string;
76
+ status: RetrievalQualityStatus;
77
+ degradation_reasons: string[];
78
+ resource_caps: RetrievalQualityResourceCaps;
79
+ resource_usage: {
80
+ case_count: number;
81
+ graph_node_count: number;
82
+ graph_edge_count: number;
83
+ indexed_storage_available: boolean;
84
+ };
85
+ summary: {
86
+ symbols: AggregateExactMeasurement;
87
+ edges: AggregateExactMeasurement;
88
+ complete_case_count: number;
89
+ direct_source_fallback_complete_count: number;
90
+ direct_source_fallback_positive_hit_count: number;
91
+ fresh_indexed_control_complete_count: number;
92
+ };
93
+ thresholds: Record<string, number>;
94
+ uncertainty: {
95
+ method: 'deterministic-heldout-corpus';
96
+ confidence: 0.95;
97
+ sample_count: number;
98
+ };
99
+ cases: HeldoutGraphQualityCase[];
100
+ }
101
+ export interface AggregateExactMeasurement {
102
+ expected_count: number;
103
+ observed_count: number;
104
+ true_positive_count: number;
105
+ false_negative_count: number;
106
+ false_positive_count: number;
107
+ precision: number;
108
+ recall: number;
109
+ }
110
+ /**
111
+ * Measure the repository graph and retrieval router against the immutable
112
+ * multilingual held-out corpus. This intentionally owns a disposable project
113
+ * root: graph persistence remains under that root's `.swarm/`, never beside a
114
+ * source fixture or a caller workspace.
115
+ */
116
+ export declare function evaluateHeldoutGraphRetrievalQuality(options: RetrievalQualityOptions): Promise<HeldoutGraphQualityReport>;
@@ -32,10 +32,29 @@ export interface ToolFailureClassificationInput {
32
32
  }
33
33
  /**
34
34
  * Redacts secrets/URLs and strips control chars for terminal/display safety.
35
- * Redaction runs FIRST against the raw value so `\b` sees genuine boundaries;
36
- * control-char stripping runs LAST so it can't interfere with matching. See
37
- * the FILL doc comment above for why control chars and whitespace are both
38
- * treated as tolerated fill throughout the redaction patterns.
35
+ * Order of operations (each step exists to keep a prior fix closed):
36
+ * 1. slice to MAX_SANITIZE_INPUT_CHARS (regex-work bound)
37
+ * 2. neutralize ANSI CSI sequences to a single space (#2369 Gap 2 an SGR
38
+ * final byte `m` is a word character and defeated `\b`; substituting a
39
+ * separator can only create boundaries, never remove one, so the #2363
40
+ * split/join fixes stay closed)
41
+ * 3. redact URLs (against the CSI-neutralized view)
42
+ * 4. redact credential KV pairs — keyword match is UNANCHORED and tolerant
43
+ * of glued key names and identifier suffixes (#2369 Gap 1), and the
44
+ * value matcher tolerates a fill-tolerant auth scheme word (Basic,
45
+ * Digest, …) between separator and credential so `Authorization: Basic
46
+ * <base64>` redacts the credential, not just the scheme
47
+ * 5. redact SCREAMING_CASE KV pairs (unchanged shape)
48
+ * 6. strip residual control/format/DI runs to spaces
49
+ * 7. sweep residual over-long bare `[<params>m` SGR bodies (the >32-char
50
+ * CSI tail the bounded pre-pass cannot match)
51
+ * 8. trim + 512-byte UTF-8 bound
52
+ *
53
+ * Best-effort defense-in-depth for a log-display string, NOT a security
54
+ * boundary: combining marks (U+0300 class) still defeat keyword matching and
55
+ * are deliberately not fixed (#2369 Gap 3 — sweeping `\p{Mn}` would over-redact
56
+ * every legitimate combining accent in non-Latin diagnostics). Glued-key
57
+ * matching (Gap 1) and the CSI pre-pass (Gap 2) were added by #2485.
39
58
  */
40
59
  export declare function sanitizeFailureEvidenceDisplay(value: string): string;
41
60
  declare function isNeutralExitOne(command: string): boolean;
@@ -72,6 +72,13 @@ export interface InitOrphanRecoveryResult {
72
72
  reason: string;
73
73
  };
74
74
  }
75
+ /**
76
+ * Issue #2527: resolves the worktree bases this project enumerates for
77
+ * reclamation — the project-internal default base plus every configured
78
+ * `worktree_dir` override. The LEGACY parent-level shared base is never
79
+ * enumerated for deletion (it is only read by the migration pass).
80
+ */
81
+ export declare function resolveWorktreeEnumerationBases(directory: string): string[];
75
82
  /**
76
83
  * Runs bounded orphan cleanup at plugin init time.
77
84
  *
@@ -914,6 +914,8 @@ export declare function abortPrWorkflow(directory: string, sessionID: string, op
914
914
  }): Promise<{
915
915
  mode: PrWorkflowMode;
916
916
  prHeadSha?: string;
917
+ /** Remote branch head observed while cancelling a publication generation. */
918
+ observedRemoteHead?: string | null;
917
919
  openLanes: number;
918
920
  presumedStaleLanes?: string[];
919
921
  presumedStaleDisclosure?: string;
@@ -1280,9 +1282,13 @@ export declare function recordPrFeedbackPushAttemptResult(directory: string, inp
1280
1282
  * appends the audit event, and NEVER manufactures push authority. Used only
1281
1283
  * by `abortPrWorkflow`'s explicit `cancelPublication` arm. Returns the NEW
1282
1284
  * state revision when a state write landed (the abort clear must CAS against
1283
- * it), or null when the generation state was absent/unreadable.
1285
+ * it), and the exact remote-head observation (including null when it could not
1286
+ * be resolved).
1284
1287
  */
1285
- declare function cancelPrFeedbackPublication(directory: string, sessionID: string, reason: string): Promise<number | null>;
1288
+ declare function cancelPrFeedbackPublication(directory: string, sessionID: string, reason: string): Promise<{
1289
+ revision: number | null;
1290
+ observedRemoteHead: string | null;
1291
+ }>;
1286
1292
  export declare function resolvePrReviewWriterRunId(directory: string, sessionID: string, requestedRunId?: string): Promise<string>;
1287
1293
  export declare function markPrReviewTriggerEvaluationComplete(directory: string, sessionID: string, runId: string, artifactPath: string): Promise<PrWorkflowGateState>;
1288
1294
  /** Freeze one exact inline trigger ledger across every micro dispatch. */