opencode-swarm 7.135.1 → 7.135.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-feedback/SKILL.md +24 -21
- package/.opencode/skills/swarm-pr-review/SKILL.md +55 -42
- package/dist/agents/explorer.d.ts +1 -1
- package/dist/background/candidate-contract.d.ts +113 -0
- package/dist/background/candidate-parser.d.ts +8 -29
- package/dist/background/pr-review-trigger-contract.d.ts +197 -0
- package/dist/background/workspace-snapshot.d.ts +26 -0
- package/dist/cli/{config-doctor-6398t3a6.js → config-doctor-pj3yvxdb.js} +2 -2
- package/dist/cli/{core-9876t6cs.js → core-4va9z2ng.js} +2 -2
- package/dist/cli/{curation-policy-f7qz4tez.js → curation-policy-b2caf3v3.js} +5 -5
- package/dist/cli/{curator-drift-9q6f85bm.js → curator-drift-2ta83hss.js} +2 -2
- package/dist/cli/{curator-llm-factory-wr3zmy2c.js → curator-llm-factory-9983528d.js} +26 -26
- package/dist/cli/{curator-fjhyezyx.js → curator-r1s2mwf2.js} +26 -26
- package/dist/cli/{dispatch-gxbeb2ps.js → dispatch-wtk6dxky.js} +2 -2
- package/dist/cli/{evidence-summary-service-0cczdmjv.js → evidence-summary-service-feby8ny0.js} +5 -5
- package/dist/cli/{explorer-jp0nen03.js → explorer-15gqzxh8.js} +1 -1
- package/dist/cli/{gate-evidence-8zrwdj69.js → gate-evidence-84b03mb4.js} +3 -3
- package/dist/cli/guardrail-explain-pwxvg5n0.js +57 -0
- package/dist/cli/{guardrail-log-bd45kw0x.js → guardrail-log-yzpz8b7t.js} +4 -4
- package/dist/cli/{hive-promoter-f2yh22m1.js → hive-promoter-586dhndj.js} +26 -26
- package/dist/cli/{index-j89zmcpx.js → index-02cqjna3.js} +6 -6
- package/dist/cli/{index-jtshf1pd.js → index-2pxk6qg4.js} +1 -1
- package/dist/cli/{index-aky90eqz.js → index-340chr1e.js} +1612 -166
- package/dist/cli/{index-xhpmagdm.js → index-3m7kpnqf.js} +2 -2
- package/dist/cli/{index-z085b4ka.js → index-3xbx305x.js} +1 -1
- package/dist/cli/{index-b4z7s917.js → index-73dfyfhq.js} +1 -1
- package/dist/cli/{index-ens0gt38.js → index-7pnvf04s.js} +8 -8
- package/dist/cli/{index-g1drmgxe.js → index-8gw8p7yh.js} +3 -3
- package/dist/cli/{index-jxchddjk.js → index-9c3gf2wd.js} +1 -1
- package/dist/cli/{index-bjrkg4tc.js → index-b0eva00y.js} +2 -2
- package/dist/cli/{index-2ghkk9ve.js → index-bfd4xfpp.js} +3 -3
- package/dist/cli/{index-4pdrmemy.js → index-bs4m85v1.js} +2 -2
- package/dist/cli/{index-5wx8wdxg.js → index-ckdva4rs.js} +5 -5
- package/dist/cli/{index-w80r3axq.js → index-cwdy5vw9.js} +28 -28
- package/dist/cli/{index-fwkqq9mq.js → index-d5psymdk.js} +4 -4
- package/dist/cli/{index-vxv732ex.js → index-dg1njnms.js} +7 -4
- package/dist/cli/{index-yhba8swx.js → index-dzyjb33e.js} +1 -1
- package/dist/cli/{index-xg9repnx.js → index-ey29aap6.js} +1 -1
- package/dist/cli/{index-wdkkf3xg.js → index-g3meqrsg.js} +2 -2
- package/dist/cli/{index-7an2qn0s.js → index-hdy2nd5h.js} +4 -4
- package/dist/cli/{index-nbnqf4fj.js → index-hvrrq3f3.js} +1 -1
- package/dist/cli/{index-dzaarxhg.js → index-j0kte6gd.js} +1 -1
- package/dist/cli/{index-5vp9gka3.js → index-j92ser8n.js} +1 -1
- package/dist/cli/{index-2nqsr1dx.js → index-jgkjxpdh.js} +4 -4
- package/dist/cli/{index-13xxjfhn.js → index-m0ynxkaa.js} +3 -3
- package/dist/cli/{index-247b1c1m.js → index-qqkw794p.js} +3 -3
- package/dist/cli/{index-b7p0mp2q.js → index-ryqnn3nv.js} +1 -1
- package/dist/cli/{index-fpkb3mw1.js → index-vg3yx648.js} +1 -1
- package/dist/cli/{index-qe3v54nb.js → index-y111zefa.js} +64 -23
- package/dist/cli/{index-3nasn371.js → index-y6a7gjtj.js} +126 -42
- package/dist/cli/index.js +26 -26
- package/dist/cli/{knowledge-escalator-4tp3yy7e.js → knowledge-escalator-w7by1m8m.js} +6 -6
- package/dist/cli/{knowledge-events-7854gb3p.js → knowledge-events-n8xxsay3.js} +4 -4
- package/dist/cli/{knowledge-link-etrfntkd.js → knowledge-link-mm1w967j.js} +3 -3
- package/dist/cli/{knowledge-store-cxnr6v01.js → knowledge-store-xzmvfnx3.js} +4 -4
- package/dist/cli/{knowledge-validator-3n5t55qy.js → knowledge-validator-5q1amsq6.js} +7 -7
- package/dist/cli/{pending-delegations-4z3tkkct.js → pending-delegations-mt5gs1bt.js} +3 -3
- package/dist/cli/{pr-subscriptions-29j794kd.js → pr-subscriptions-v5xd3j6d.js} +3 -3
- package/dist/cli/{scan-cursor-0cexjh3b.js → scan-cursor-1q1zmt4b.js} +5 -5
- package/dist/cli/{schema-rs5a7ywx.js → schema-8mtsfspm.js} +1 -1
- package/dist/cli/{scope-persistence-1vsnkmm4.js → scope-persistence-h2fpgxww.js} +2 -2
- package/dist/cli/{skill-generator-n0h9n0zd.js → skill-generator-54xbjgak.js} +8 -8
- package/dist/cli/{workspace-snapshot-9h5za0s6.js → workspace-snapshot-jmyamqnv.js} +6 -1
- package/dist/cli/{worktree-collision-ownership-dtwr0xj4.js → worktree-collision-ownership-15hymf1y.js} +5 -5
- package/dist/commands/registry.d.ts +1 -1
- package/dist/hooks/pr-workflow-gate.d.ts +30 -4
- package/dist/hooks/repo-graph-builder.d.ts +18 -0
- package/dist/index.js +394 -390
- package/dist/tools/convene-council.d.ts +3 -3
- package/dist/tools/dispatch-lanes.d.ts +65 -7
- package/dist/tools/repo-graph/builder.d.ts +20 -2
- package/dist/tools/repo-graph/incremental.d.ts +18 -1
- package/dist/tools/repo-graph/ontology.d.ts +8 -0
- package/dist/tools/repo-graph/types.d.ts +62 -1
- package/dist/tools/repo-graph.d.ts +1 -1
- package/dist/tools/submit-phase-council-verdicts.d.ts +3 -3
- package/dist/tools/write-final-council-evidence.d.ts +3 -3
- package/dist/tools/write-pr-review-trigger-eval.d.ts +34 -63
- package/package.json +1 -1
- package/dist/cli/guardrail-explain-g1s89b3e.js +0 -57
|
@@ -36,10 +36,10 @@ export declare const ArgsSchema: z.ZodObject<{
|
|
|
36
36
|
confidence: z.ZodNumber;
|
|
37
37
|
findings: z.ZodArray<z.ZodObject<{
|
|
38
38
|
severity: z.ZodEnum<{
|
|
39
|
-
CRITICAL: "CRITICAL";
|
|
40
|
-
HIGH: "HIGH";
|
|
41
|
-
MEDIUM: "MEDIUM";
|
|
42
39
|
LOW: "LOW";
|
|
40
|
+
MEDIUM: "MEDIUM";
|
|
41
|
+
HIGH: "HIGH";
|
|
42
|
+
CRITICAL: "CRITICAL";
|
|
43
43
|
}>;
|
|
44
44
|
category: z.ZodString;
|
|
45
45
|
location: z.ZodString;
|
|
@@ -48,11 +48,39 @@ declare const DispatchLanesAsyncArgsSchema: z.ZodObject<{
|
|
|
48
48
|
base_sha: z.ZodOptional<z.ZodString>;
|
|
49
49
|
base_ref: z.ZodOptional<z.ZodString>;
|
|
50
50
|
scope: z.ZodOptional<z.ZodString>;
|
|
51
|
-
trigger_evaluation: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
52
|
-
trigger_id: z.
|
|
51
|
+
trigger_evaluation: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
52
|
+
trigger_id: z.ZodEnum<{
|
|
53
|
+
"auth-identity-secrets": "auth-identity-secrets";
|
|
54
|
+
"untrusted-input-boundaries": "untrusted-input-boundaries";
|
|
55
|
+
"subprocess-platform": "subprocess-platform";
|
|
56
|
+
"concurrency-state": "concurrency-state";
|
|
57
|
+
"dependencies-build-release": "dependencies-build-release";
|
|
58
|
+
"api-schema-migrations": "api-schema-migrations";
|
|
59
|
+
"test-infrastructure": "test-infrastructure";
|
|
60
|
+
"ui-accessibility-i18n": "ui-accessibility-i18n";
|
|
61
|
+
"privacy-observability": "privacy-observability";
|
|
62
|
+
"generated-provenance": "generated-provenance";
|
|
63
|
+
"unclassified-risk": "unclassified-risk";
|
|
64
|
+
}>;
|
|
53
65
|
result: z.ZodLiteral<"MATCHED">;
|
|
54
66
|
evidence: z.ZodString;
|
|
55
|
-
}, z.core.$strict
|
|
67
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
68
|
+
trigger_id: z.ZodEnum<{
|
|
69
|
+
"auth-identity-secrets": "auth-identity-secrets";
|
|
70
|
+
"untrusted-input-boundaries": "untrusted-input-boundaries";
|
|
71
|
+
"subprocess-platform": "subprocess-platform";
|
|
72
|
+
"concurrency-state": "concurrency-state";
|
|
73
|
+
"dependencies-build-release": "dependencies-build-release";
|
|
74
|
+
"api-schema-migrations": "api-schema-migrations";
|
|
75
|
+
"test-infrastructure": "test-infrastructure";
|
|
76
|
+
"ui-accessibility-i18n": "ui-accessibility-i18n";
|
|
77
|
+
"privacy-observability": "privacy-observability";
|
|
78
|
+
"generated-provenance": "generated-provenance";
|
|
79
|
+
"unclassified-risk": "unclassified-risk";
|
|
80
|
+
}>;
|
|
81
|
+
result: z.ZodLiteral<"NOT_TRIGGERED">;
|
|
82
|
+
evidence: z.ZodString;
|
|
83
|
+
}, z.core.$strict>], "result">>>;
|
|
56
84
|
feedback_inventory: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
57
85
|
}, z.core.$strip>;
|
|
58
86
|
declare const CollectLaneResultsArgsSchema: z.ZodObject<{
|
|
@@ -297,11 +325,39 @@ export declare const _test_exports: {
|
|
|
297
325
|
base_sha: z.ZodOptional<z.ZodString>;
|
|
298
326
|
base_ref: z.ZodOptional<z.ZodString>;
|
|
299
327
|
scope: z.ZodOptional<z.ZodString>;
|
|
300
|
-
trigger_evaluation: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
301
|
-
trigger_id: z.
|
|
328
|
+
trigger_evaluation: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
329
|
+
trigger_id: z.ZodEnum<{
|
|
330
|
+
"auth-identity-secrets": "auth-identity-secrets";
|
|
331
|
+
"untrusted-input-boundaries": "untrusted-input-boundaries";
|
|
332
|
+
"subprocess-platform": "subprocess-platform";
|
|
333
|
+
"concurrency-state": "concurrency-state";
|
|
334
|
+
"dependencies-build-release": "dependencies-build-release";
|
|
335
|
+
"api-schema-migrations": "api-schema-migrations";
|
|
336
|
+
"test-infrastructure": "test-infrastructure";
|
|
337
|
+
"ui-accessibility-i18n": "ui-accessibility-i18n";
|
|
338
|
+
"privacy-observability": "privacy-observability";
|
|
339
|
+
"generated-provenance": "generated-provenance";
|
|
340
|
+
"unclassified-risk": "unclassified-risk";
|
|
341
|
+
}>;
|
|
302
342
|
result: z.ZodLiteral<"MATCHED">;
|
|
303
343
|
evidence: z.ZodString;
|
|
304
|
-
}, z.core.$strict
|
|
344
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
345
|
+
trigger_id: z.ZodEnum<{
|
|
346
|
+
"auth-identity-secrets": "auth-identity-secrets";
|
|
347
|
+
"untrusted-input-boundaries": "untrusted-input-boundaries";
|
|
348
|
+
"subprocess-platform": "subprocess-platform";
|
|
349
|
+
"concurrency-state": "concurrency-state";
|
|
350
|
+
"dependencies-build-release": "dependencies-build-release";
|
|
351
|
+
"api-schema-migrations": "api-schema-migrations";
|
|
352
|
+
"test-infrastructure": "test-infrastructure";
|
|
353
|
+
"ui-accessibility-i18n": "ui-accessibility-i18n";
|
|
354
|
+
"privacy-observability": "privacy-observability";
|
|
355
|
+
"generated-provenance": "generated-provenance";
|
|
356
|
+
"unclassified-risk": "unclassified-risk";
|
|
357
|
+
}>;
|
|
358
|
+
result: z.ZodLiteral<"NOT_TRIGGERED">;
|
|
359
|
+
evidence: z.ZodString;
|
|
360
|
+
}, z.core.$strict>], "result">>>;
|
|
305
361
|
feedback_inventory: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
306
362
|
}, z.core.$strip>;
|
|
307
363
|
DEFAULT_TIMEOUT_MS: number;
|
|
@@ -363,7 +419,9 @@ type ApplyCommonPromptResult = {
|
|
|
363
419
|
* prompts when it is. Callers may treat the returned array as their own.
|
|
364
420
|
*/
|
|
365
421
|
declare function applyCommonPrompt(lanes: DispatchLaneSpec[], commonPrompt: string | undefined): ApplyCommonPromptResult;
|
|
366
|
-
declare function applyExplorerFormatSuffix(lanes: DispatchLaneSpec[]
|
|
422
|
+
declare function applyExplorerFormatSuffix(lanes: DispatchLaneSpec[], options?: {
|
|
423
|
+
failClosed?: boolean;
|
|
424
|
+
}): ApplyCommonPromptResult;
|
|
367
425
|
declare function applyPrWorkflowPromptContract(lanes: DispatchLaneSpec[], options: {
|
|
368
426
|
mode?: string;
|
|
369
427
|
prHeadSha?: string;
|
|
@@ -34,6 +34,24 @@ export declare const _internals: {
|
|
|
34
34
|
computeUsedSymbols: typeof computeUsedSymbols;
|
|
35
35
|
extractFileSymbols: typeof extractFileSymbols;
|
|
36
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* Whether `p` is a scannable source file — i.e. one of the extensions the
|
|
39
|
+
* walker turns into a graph node. This is the SINGLE source of truth for "is
|
|
40
|
+
* this a graph-node-able file" (issue #1985, defect A2): the write hook and
|
|
41
|
+
* the incremental updater both route through it so the allowlist can never
|
|
42
|
+
* drift from the builder's `LANGUAGE_REGISTRY`-derived set.
|
|
43
|
+
*/
|
|
44
|
+
export declare function isScannableSourcePath(p: string): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Whether an edge's resolved target is an asset (a real file that never
|
|
47
|
+
* becomes a graph node, e.g. JSON/CSS) rather than a node. Uses the explicit
|
|
48
|
+
* `targetKind` tag on schema >= 1.3.0 graphs and falls back to an extension
|
|
49
|
+
* check on older graphs whose edges are untagged (issue #1985, defect A1).
|
|
50
|
+
* Asset edges only require their source node to exist during incremental
|
|
51
|
+
* validation and are excluded from in-degree ranking / importer / dependent
|
|
52
|
+
* queries.
|
|
53
|
+
*/
|
|
54
|
+
export declare function isAssetEdge(edge: GraphEdge): boolean;
|
|
37
55
|
/**
|
|
38
56
|
* Add or update a node in the graph.
|
|
39
57
|
* @param graph - The graph to modify
|
|
@@ -156,7 +174,7 @@ export interface AsyncScanResult {
|
|
|
156
174
|
* @param maxFileSize - Maximum file size in bytes
|
|
157
175
|
* @returns ScanResult with node and edges
|
|
158
176
|
*/
|
|
159
|
-
export declare function scanFile(filePath: string, absoluteRoot: string, maxFileSize: number): ScanResult;
|
|
177
|
+
export declare function scanFile(filePath: string, absoluteRoot: string, maxFileSize: number, hasManifest?: (relDir: string) => boolean): ScanResult;
|
|
160
178
|
/**
|
|
161
179
|
* Async variant of scanFile that uses tree-sitter symbol extraction
|
|
162
180
|
* (extractFileSymbols) to populate exportRanges and symbolEdges.
|
|
@@ -173,7 +191,7 @@ export declare function scanFile(filePath: string, absoluteRoot: string, maxFile
|
|
|
173
191
|
* @param maxFileSize - Maximum file size in bytes
|
|
174
192
|
* @returns AsyncScanResult with node, edges, and symbolEdges
|
|
175
193
|
*/
|
|
176
|
-
export declare function scanFileAsync(filePath: string, absoluteRoot: string, maxFileSize: number): Promise<AsyncScanResult>;
|
|
194
|
+
export declare function scanFileAsync(filePath: string, absoluteRoot: string, maxFileSize: number, hasManifest?: (relDir: string) => boolean): Promise<AsyncScanResult>;
|
|
177
195
|
/**
|
|
178
196
|
* Build a complete dependency graph for a workspace by scanning all source files.
|
|
179
197
|
*
|
|
@@ -5,8 +5,25 @@
|
|
|
5
5
|
* their nodes and edges in the existing graph, and saves the result. It
|
|
6
6
|
* includes an optimistic concurrency check (mtime comparison) so that
|
|
7
7
|
* concurrent sessions do not overwrite each other's updates — when a race
|
|
8
|
-
* is detected the function
|
|
8
|
+
* is detected the function reloads the freshest on-disk graph and replays
|
|
9
|
+
* the update once before falling back to a full rebuild.
|
|
10
|
+
*
|
|
11
|
+
* Asset edges (issue #1985, defect A1): an edge whose target is a real file
|
|
12
|
+
* that never becomes a graph node (e.g. `import data from './data.json'`) is
|
|
13
|
+
* tagged `targetKind: 'asset'`. Such edges only require their SOURCE node to
|
|
14
|
+
* exist during validation, so a single asset import no longer forces a full
|
|
15
|
+
* rebuild on every incremental update.
|
|
16
|
+
*/
|
|
17
|
+
import { type Stats } from 'node:fs';
|
|
18
|
+
/**
|
|
19
|
+
* DI seam for the optimistic-concurrency stat check (defect A4). Tests override
|
|
20
|
+
* `stat` to inject deterministic mtime shifts between load and the pre-save
|
|
21
|
+
* re-check, exercising the reload-and-replay branch without races. Defaults to
|
|
22
|
+
* the real `fsPromises.stat`. Restore in afterEach.
|
|
9
23
|
*/
|
|
24
|
+
export declare const _internals: {
|
|
25
|
+
stat: (path: string) => Promise<Stats>;
|
|
26
|
+
};
|
|
10
27
|
import type { RepoGraph } from './types';
|
|
11
28
|
/**
|
|
12
29
|
* Incrementally update the graph for a set of changed files.
|
|
@@ -6,5 +6,13 @@ export interface ExtractFileOntologyInput {
|
|
|
6
6
|
language: string;
|
|
7
7
|
exports: string[];
|
|
8
8
|
imports: string[];
|
|
9
|
+
/**
|
|
10
|
+
* Optional callback returning true when a workspace-relative directory
|
|
11
|
+
* contains a package manifest (`package.json`, `Cargo.toml`,
|
|
12
|
+
* `pyproject.toml`, `go.mod`). When provided, the package-boundary rule
|
|
13
|
+
* becomes manifest-driven; otherwise it falls back to the static segment
|
|
14
|
+
* rules (issue #1985, defect A8). The extractor stays pure — no fs I/O.
|
|
15
|
+
*/
|
|
16
|
+
hasManifest?: (relDir: string) => boolean;
|
|
9
17
|
}
|
|
10
18
|
export declare function extractFileOntology(input: ExtractFileOntologyInput): FileOntology;
|
|
@@ -23,11 +23,20 @@ export declare const REPO_GRAPH_FILENAME = "repo-graph.json";
|
|
|
23
23
|
* still load without corruption. New queries may use these fields to provide
|
|
24
24
|
* more precise context-packing and symbol-level navigation.
|
|
25
25
|
*
|
|
26
|
+
* 1.3.0 adds the optional per-edge `targetKind` field (`'node' | 'asset'`)
|
|
27
|
+
* that distinguishes edges whose resolved target is a scannable source file
|
|
28
|
+
* (a graph node) from edges whose target is an asset (JSON/CSS/etc. — a real
|
|
29
|
+
* file that never becomes a node). The field is optional, so 1.0.0–1.2.0
|
|
30
|
+
* graphs still load; `storage.ts` only checks that a version string is
|
|
31
|
+
* present, and feature gating is per-query via {@link isSchemaVersionAtLeast}.
|
|
32
|
+
* For pre-1.3.0 graphs the loader/queries fall back to an extension check
|
|
33
|
+
* (`isScannableSourcePath`) to classify an untagged edge's target kind.
|
|
34
|
+
*
|
|
26
35
|
* Diagnostics are additive and optional on all schema versions. Old graphs
|
|
27
36
|
* without diagnostics remain readable; graph-health queries surface empty
|
|
28
37
|
* diagnostics with an explicit rebuild note.
|
|
29
38
|
*/
|
|
30
|
-
export declare const GRAPH_SCHEMA_VERSION = "1.
|
|
39
|
+
export declare const GRAPH_SCHEMA_VERSION = "1.3.0";
|
|
31
40
|
/**
|
|
32
41
|
* Compare dotted numeric version strings (e.g. '1.1.0' >= '1.1.0').
|
|
33
42
|
* Missing/non-numeric segments are treated as 0. Returns true when `version`
|
|
@@ -150,6 +159,16 @@ export interface GraphEdge {
|
|
|
150
159
|
* imports, where individual symbol usage is not statically resolvable.
|
|
151
160
|
*/
|
|
152
161
|
usedSymbols?: string[];
|
|
162
|
+
/**
|
|
163
|
+
* Whether the resolved target is a graph node or an asset. `'node'` targets
|
|
164
|
+
* are scannable source files that become graph nodes; `'asset'` targets are
|
|
165
|
+
* real files (JSON/CSS/etc.) that never become nodes (schema >= 1.3.0).
|
|
166
|
+
* Absent on older graphs — callers fall back to `isScannableSourcePath` on
|
|
167
|
+
* the target path. Asset edges only require their source node to exist
|
|
168
|
+
* during incremental validation, and are excluded from in-degree ranking /
|
|
169
|
+
* importer / dependent queries.
|
|
170
|
+
*/
|
|
171
|
+
targetKind?: 'node' | 'asset';
|
|
153
172
|
}
|
|
154
173
|
export interface FileReference {
|
|
155
174
|
file: string;
|
|
@@ -269,6 +288,20 @@ export interface RepoGraphDiagnostics {
|
|
|
269
288
|
binaryFiles?: string[];
|
|
270
289
|
unreadableFiles?: string[];
|
|
271
290
|
lowConfidenceEdgeCount?: number;
|
|
291
|
+
/**
|
|
292
|
+
* True when the last workspace walk was truncated by the file cap or wall-
|
|
293
|
+
* clock budget (issue #1985, defect A7). Additive/optional on all schema
|
|
294
|
+
* versions — old graphs without it read as `false`.
|
|
295
|
+
*/
|
|
296
|
+
walkTruncated?: boolean;
|
|
297
|
+
/** Why the walk truncated: hit the wall-clock `'budget'` or the `'cap'`. */
|
|
298
|
+
walkTruncationReason?: 'budget' | 'cap';
|
|
299
|
+
/**
|
|
300
|
+
* Count of incremental-update passes that fell back to a full rebuild
|
|
301
|
+
* (issue #1985, defect A1). Accumulated across incremental runs; reset on
|
|
302
|
+
* a fresh full build.
|
|
303
|
+
*/
|
|
304
|
+
incrementalFallbacks?: number;
|
|
272
305
|
}
|
|
273
306
|
export interface GraphHealthResult {
|
|
274
307
|
schemaVersion: string | null;
|
|
@@ -281,6 +314,9 @@ export interface GraphHealthResult {
|
|
|
281
314
|
binaryFiles: string[];
|
|
282
315
|
unreadableFiles: string[];
|
|
283
316
|
lowConfidenceEdgeCount: number;
|
|
317
|
+
walkTruncated: boolean;
|
|
318
|
+
walkTruncationReason: 'budget' | 'cap' | null;
|
|
319
|
+
incrementalFallbacks: number;
|
|
284
320
|
notes: string[];
|
|
285
321
|
}
|
|
286
322
|
export interface BlastRadiusResult {
|
|
@@ -359,6 +395,31 @@ export interface BuildWorkspaceGraphOptions {
|
|
|
359
395
|
* This ensures the same file produces the same key on Windows, macOS, and Linux.
|
|
360
396
|
*/
|
|
361
397
|
export declare function normalizeGraphPath(filePath: string): string;
|
|
398
|
+
/**
|
|
399
|
+
* Infer the package boundary for a module name using the generic rule shared
|
|
400
|
+
* by ontology extraction and the query-side no-ontology fallback (issue #1985,
|
|
401
|
+
* defect A8). Pure / dependency-free / no fs I/O so it can live in this
|
|
402
|
+
* foundation module and stay callable from both `ontology.ts` and `query.ts`.
|
|
403
|
+
*
|
|
404
|
+
* Rules (in order):
|
|
405
|
+
* - empty → `'.'`
|
|
406
|
+
* - segment 0 ∈ {packages, crates, apps, libs, services} with ≥2 segments → `<seg0>/<seg1>`
|
|
407
|
+
* - segment 0 === `src` with ≥2 segments → `src/<seg1>`
|
|
408
|
+
* - segment 0 === `tests` with ≥2 segments → `tests/<seg1>`
|
|
409
|
+
* - when `hasManifest` is provided and either `<seg0>` or `<seg0>/<seg1>` is a
|
|
410
|
+
* manifest-bearing directory (with ≥2 segments) → `<seg0>/<seg1>`
|
|
411
|
+
* - otherwise → segment 0 (or `'.'` when there are no segments)
|
|
412
|
+
*
|
|
413
|
+
* The previous `src/tools/repo-graph` special case is intentionally removed:
|
|
414
|
+
* user repos should not inherit this project's internal layout.
|
|
415
|
+
*
|
|
416
|
+
* @param moduleName - Workspace-relative module name (forward slashes).
|
|
417
|
+
* @param hasManifest - Optional callback returning true when a workspace-
|
|
418
|
+
* relative directory contains a package manifest (`package.json`,
|
|
419
|
+
* `Cargo.toml`, `pyproject.toml`, `go.mod`). When omitted, only the static
|
|
420
|
+
* segment rules apply.
|
|
421
|
+
*/
|
|
422
|
+
export declare function inferPackageBoundary(moduleName: string, hasManifest?: (relDir: string) => boolean): string;
|
|
362
423
|
/**
|
|
363
424
|
* Create an empty graph for a workspace.
|
|
364
425
|
* @param workspaceRoot - The workspace root directory
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* All existing imports of this module continue to work unchanged.
|
|
16
16
|
*/
|
|
17
17
|
export type { ScanResult } from './repo-graph/builder';
|
|
18
|
-
export { addEdge, buildWorkspaceGraph, buildWorkspaceGraphAsync, resolveModuleSpecifier, upsertNode, } from './repo-graph/builder';
|
|
18
|
+
export { addEdge, buildWorkspaceGraph, buildWorkspaceGraphAsync, isScannableSourcePath, resolveModuleSpecifier, upsertNode, } from './repo-graph/builder';
|
|
19
19
|
export { clearCache, getCachedGraph, getCachedMtime, isDirty, markDirty, setCachedGraph, } from './repo-graph/cache';
|
|
20
20
|
export { updateGraphForFiles } from './repo-graph/incremental';
|
|
21
21
|
export type { ExtractFileOntologyInput } from './repo-graph/ontology';
|
|
@@ -22,10 +22,10 @@ export declare const ArgsSchema: z.ZodObject<{
|
|
|
22
22
|
confidence: z.ZodNumber;
|
|
23
23
|
findings: z.ZodArray<z.ZodObject<{
|
|
24
24
|
severity: z.ZodEnum<{
|
|
25
|
-
CRITICAL: "CRITICAL";
|
|
26
|
-
HIGH: "HIGH";
|
|
27
|
-
MEDIUM: "MEDIUM";
|
|
28
25
|
LOW: "LOW";
|
|
26
|
+
MEDIUM: "MEDIUM";
|
|
27
|
+
HIGH: "HIGH";
|
|
28
|
+
CRITICAL: "CRITICAL";
|
|
29
29
|
}>;
|
|
30
30
|
category: z.ZodString;
|
|
31
31
|
location: z.ZodString;
|
|
@@ -28,10 +28,10 @@ export declare const ArgsSchema: z.ZodObject<{
|
|
|
28
28
|
confidence: z.ZodNumber;
|
|
29
29
|
findings: z.ZodArray<z.ZodObject<{
|
|
30
30
|
severity: z.ZodEnum<{
|
|
31
|
-
CRITICAL: "CRITICAL";
|
|
32
|
-
HIGH: "HIGH";
|
|
33
|
-
MEDIUM: "MEDIUM";
|
|
34
31
|
LOW: "LOW";
|
|
32
|
+
MEDIUM: "MEDIUM";
|
|
33
|
+
HIGH: "HIGH";
|
|
34
|
+
CRITICAL: "CRITICAL";
|
|
35
35
|
}>;
|
|
36
36
|
category: z.ZodString;
|
|
37
37
|
location: z.ZodString;
|
|
@@ -1,79 +1,51 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { resolveExactMergeBase, resolvePrWorkflowRevisionDigest } from '../background/workspace-snapshot.js';
|
|
3
3
|
import { createSwarmTool } from './create-tool';
|
|
4
|
+
export { PR_REVIEW_TRIGGER_DEFINITIONS } from '../background/pr-review-trigger-contract.js';
|
|
4
5
|
export declare const _internals: {
|
|
5
6
|
resolvePrWorkflowRevisionDigest: typeof resolvePrWorkflowRevisionDigest;
|
|
6
7
|
resolveMergeBase: typeof resolveExactMergeBase;
|
|
7
8
|
};
|
|
8
|
-
/** Canonical trigger IDs and display values shared with the PR-review protocol. */
|
|
9
|
-
export declare const PR_REVIEW_TRIGGER_DEFINITIONS: readonly [{
|
|
10
|
-
readonly id: "auth-identity-secrets";
|
|
11
|
-
readonly scope: "universal";
|
|
12
|
-
readonly trigger_row: "authentication, authorization, identity, sessions, permissions, secrets, cryptography";
|
|
13
|
-
readonly micro_lane: "Identity and secret boundaries";
|
|
14
|
-
}, {
|
|
15
|
-
readonly id: "untrusted-input-boundaries";
|
|
16
|
-
readonly scope: "universal";
|
|
17
|
-
readonly trigger_row: "parsing, serialization, queries, templates/rendering, file or network input/output";
|
|
18
|
-
readonly micro_lane: "Untrusted input and sink analysis";
|
|
19
|
-
}, {
|
|
20
|
-
readonly id: "subprocess-platform";
|
|
21
|
-
readonly scope: "universal";
|
|
22
|
-
readonly trigger_row: "subprocesses, shell commands, filesystem operations, OS/runtime-specific code";
|
|
23
|
-
readonly micro_lane: "Subprocess and platform safety";
|
|
24
|
-
}, {
|
|
25
|
-
readonly id: "concurrency-state";
|
|
26
|
-
readonly scope: "universal";
|
|
27
|
-
readonly trigger_row: "queues, caches, retries, transactions, locks, state machines, async coordination";
|
|
28
|
-
readonly micro_lane: "Concurrency and state transitions";
|
|
29
|
-
}, {
|
|
30
|
-
readonly id: "dependencies-build-release";
|
|
31
|
-
readonly scope: "universal";
|
|
32
|
-
readonly trigger_row: "dependency manifests, lockfiles, installers, build scripts, CI, packaging, deployment";
|
|
33
|
-
readonly micro_lane: "Dependency and delivery integrity";
|
|
34
|
-
}, {
|
|
35
|
-
readonly id: "api-schema-migrations";
|
|
36
|
-
readonly scope: "universal";
|
|
37
|
-
readonly trigger_row: "public API, wire/schema/config/storage formats, migrations, feature flags";
|
|
38
|
-
readonly micro_lane: "Compatibility and migration safety";
|
|
39
|
-
}, {
|
|
40
|
-
readonly id: "test-infrastructure";
|
|
41
|
-
readonly scope: "universal";
|
|
42
|
-
readonly trigger_row: "tests, mocks, fixtures, harnesses, coverage, CI matrices";
|
|
43
|
-
readonly micro_lane: "Test validity and isolation";
|
|
44
|
-
}, {
|
|
45
|
-
readonly id: "ui-accessibility-i18n";
|
|
46
|
-
readonly scope: "universal";
|
|
47
|
-
readonly trigger_row: "user interfaces, interaction flows, rendering, accessibility, localization";
|
|
48
|
-
readonly micro_lane: "UI and human-interface quality";
|
|
49
|
-
}, {
|
|
50
|
-
readonly id: "privacy-observability";
|
|
51
|
-
readonly scope: "universal";
|
|
52
|
-
readonly trigger_row: "telemetry, logs, analytics, traces, retention, diagnostics";
|
|
53
|
-
readonly micro_lane: "Privacy and observability safety";
|
|
54
|
-
}, {
|
|
55
|
-
readonly id: "generated-provenance";
|
|
56
|
-
readonly scope: "universal";
|
|
57
|
-
readonly trigger_row: "generated, vendored, binary, model-produced, codegen or checked-in build artifacts";
|
|
58
|
-
readonly micro_lane: "Generated artifact provenance";
|
|
59
|
-
}, {
|
|
60
|
-
readonly id: "unclassified-risk";
|
|
61
|
-
readonly scope: "universal";
|
|
62
|
-
readonly trigger_row: "any changed artifact or behavior not confidently classified by the rows above";
|
|
63
|
-
readonly micro_lane: "Unclassified high-risk fallback";
|
|
64
|
-
}];
|
|
65
9
|
declare const WritePrReviewTriggerEvalArgsSchema: z.ZodObject<{
|
|
66
10
|
run_id: z.ZodString;
|
|
67
11
|
pr_head_sha: z.ZodString;
|
|
68
12
|
base_sha: z.ZodOptional<z.ZodString>;
|
|
69
13
|
base_ref: z.ZodOptional<z.ZodString>;
|
|
70
|
-
rows: z.ZodArray<z.ZodObject<{
|
|
71
|
-
trigger_id: z.
|
|
14
|
+
rows: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
15
|
+
trigger_id: z.ZodEnum<{
|
|
16
|
+
"auth-identity-secrets": "auth-identity-secrets";
|
|
17
|
+
"untrusted-input-boundaries": "untrusted-input-boundaries";
|
|
18
|
+
"subprocess-platform": "subprocess-platform";
|
|
19
|
+
"concurrency-state": "concurrency-state";
|
|
20
|
+
"dependencies-build-release": "dependencies-build-release";
|
|
21
|
+
"api-schema-migrations": "api-schema-migrations";
|
|
22
|
+
"test-infrastructure": "test-infrastructure";
|
|
23
|
+
"ui-accessibility-i18n": "ui-accessibility-i18n";
|
|
24
|
+
"privacy-observability": "privacy-observability";
|
|
25
|
+
"generated-provenance": "generated-provenance";
|
|
26
|
+
"unclassified-risk": "unclassified-risk";
|
|
27
|
+
}>;
|
|
72
28
|
result: z.ZodLiteral<"MATCHED">;
|
|
73
29
|
evidence: z.ZodString;
|
|
74
|
-
source_batch_id: z.
|
|
75
|
-
source_lane_id: z.
|
|
76
|
-
}, z.core.$strict
|
|
30
|
+
source_batch_id: z.ZodString;
|
|
31
|
+
source_lane_id: z.ZodString;
|
|
32
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
33
|
+
trigger_id: z.ZodEnum<{
|
|
34
|
+
"auth-identity-secrets": "auth-identity-secrets";
|
|
35
|
+
"untrusted-input-boundaries": "untrusted-input-boundaries";
|
|
36
|
+
"subprocess-platform": "subprocess-platform";
|
|
37
|
+
"concurrency-state": "concurrency-state";
|
|
38
|
+
"dependencies-build-release": "dependencies-build-release";
|
|
39
|
+
"api-schema-migrations": "api-schema-migrations";
|
|
40
|
+
"test-infrastructure": "test-infrastructure";
|
|
41
|
+
"ui-accessibility-i18n": "ui-accessibility-i18n";
|
|
42
|
+
"privacy-observability": "privacy-observability";
|
|
43
|
+
"generated-provenance": "generated-provenance";
|
|
44
|
+
"unclassified-risk": "unclassified-risk";
|
|
45
|
+
}>;
|
|
46
|
+
result: z.ZodLiteral<"NOT_TRIGGERED">;
|
|
47
|
+
evidence: z.ZodString;
|
|
48
|
+
}, z.core.$strict>], "result">>;
|
|
77
49
|
}, z.core.$strict>;
|
|
78
50
|
export type WritePrReviewTriggerEvalArgs = z.infer<typeof WritePrReviewTriggerEvalArgsSchema>;
|
|
79
51
|
/** Validate and atomically persist the complete PR-review trigger evaluation. */
|
|
@@ -81,4 +53,3 @@ export declare function executeWritePrReviewTriggerEval(args: unknown, directory
|
|
|
81
53
|
sessionID?: string;
|
|
82
54
|
}): Promise<string>;
|
|
83
55
|
export declare const write_pr_review_trigger_eval: ReturnType<typeof createSwarmTool>;
|
|
84
|
-
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-swarm",
|
|
3
|
-
"version": "7.135.
|
|
3
|
+
"version": "7.135.2",
|
|
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",
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import {
|
|
3
|
-
handleGuardrailExplain
|
|
4
|
-
} from "./index-4pdrmemy.js";
|
|
5
|
-
import"./index-aky90eqz.js";
|
|
6
|
-
import"./index-13xxjfhn.js";
|
|
7
|
-
import"./index-jtshf1pd.js";
|
|
8
|
-
import"./index-5vp9gka3.js";
|
|
9
|
-
import"./index-ens0gt38.js";
|
|
10
|
-
import"./index-4905hd2m.js";
|
|
11
|
-
import"./index-134d35c1.js";
|
|
12
|
-
import"./index-247b1c1m.js";
|
|
13
|
-
import"./index-5wx8wdxg.js";
|
|
14
|
-
import"./index-bjrkg4tc.js";
|
|
15
|
-
import"./index-vxv732ex.js";
|
|
16
|
-
import"./index-c8s9a3zh.js";
|
|
17
|
-
import"./index-9ss2m4rs.js";
|
|
18
|
-
import"./index-b7p0mp2q.js";
|
|
19
|
-
import"./index-z085b4ka.js";
|
|
20
|
-
import"./index-2nqsr1dx.js";
|
|
21
|
-
import"./index-xhpmagdm.js";
|
|
22
|
-
import"./index-rtry5xyf.js";
|
|
23
|
-
import"./index-j89zmcpx.js";
|
|
24
|
-
import"./index-g1drmgxe.js";
|
|
25
|
-
import"./index-ae75rja9.js";
|
|
26
|
-
import"./index-yhba8swx.js";
|
|
27
|
-
import"./index-xg9repnx.js";
|
|
28
|
-
import"./index-jxchddjk.js";
|
|
29
|
-
import"./index-k5jrywpr.js";
|
|
30
|
-
import"./index-n832052r.js";
|
|
31
|
-
import"./index-dzaarxhg.js";
|
|
32
|
-
import"./index-bk5tah7q.js";
|
|
33
|
-
import"./index-8fwhhayc.js";
|
|
34
|
-
import"./index-q1exe2b3.js";
|
|
35
|
-
import"./index-fpkb3mw1.js";
|
|
36
|
-
import"./index-wxyxf0bd.js";
|
|
37
|
-
import"./index-1kz6da87.js";
|
|
38
|
-
import"./index-b4z7s917.js";
|
|
39
|
-
import"./index-b8zgtz81.js";
|
|
40
|
-
import"./index-fwkqq9mq.js";
|
|
41
|
-
import"./index-4rhhvd1a.js";
|
|
42
|
-
import"./index-7an2qn0s.js";
|
|
43
|
-
import"./index-2ghkk9ve.js";
|
|
44
|
-
import"./index-fsrp8wp3.js";
|
|
45
|
-
import"./index-09b9zncg.js";
|
|
46
|
-
import"./index-7g4c7s5r.js";
|
|
47
|
-
import"./index-7a2hm51h.js";
|
|
48
|
-
import"./index-bpmtbmy9.js";
|
|
49
|
-
import"./index-z6xqpmqg.js";
|
|
50
|
-
import"./index-zjygnfay.js";
|
|
51
|
-
import"./index-qe3v54nb.js";
|
|
52
|
-
import"./index-zgwm4ryv.js";
|
|
53
|
-
import"./index-3nasn371.js";
|
|
54
|
-
import"./index-a76rekgs.js";
|
|
55
|
-
export {
|
|
56
|
-
handleGuardrailExplain
|
|
57
|
-
};
|