opencode-swarm 7.126.6 → 7.127.1
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/issue-tracer/SKILL.md +7 -6
- package/.opencode/skills/issue-tracer/references/install.md +5 -3
- package/.opencode/skills/swarm-pr-feedback/SKILL.md +87 -13
- package/.opencode/skills/swarm-pr-review/SKILL.md +313 -109
- package/.opencode/skills/swarm-pr-review/references/parser-dry-run.md +5 -3
- package/.opencode/skills/swarm-pr-review/references/prompt-templates.md +5 -5
- package/dist/background/candidate-parser.d.ts +1 -0
- package/dist/background/pending-delegations.d.ts +7 -0
- package/dist/background/workspace-snapshot.d.ts +20 -0
- package/dist/cli/{curator-llm-factory-ffseqhr4.js → curator-llm-factory-4t2h2p60.js} +3 -3
- package/dist/cli/{curator-zmff7bha.js → curator-qqd1fvvg.js} +3 -3
- package/dist/cli/{guardrail-explain-n4eyw2ak.js → guardrail-explain-4yg67c3t.js} +4 -4
- package/dist/cli/{hive-promoter-s60fcnq0.js → hive-promoter-14jh86kj.js} +3 -3
- package/dist/cli/{index-mg54y5gc.js → index-40zn444p.js} +38 -1
- package/dist/cli/{index-w3q49fy4.js → index-8cnpsbk5.js} +1 -1
- package/dist/cli/{index-8exjgmrz.js → index-bn3w6ym4.js} +49 -24
- package/dist/cli/{index-0cz1ws47.js → index-ecxwhwz7.js} +2 -0
- package/dist/cli/{index-p3cksay8.js → index-pbw1ncre.js} +4 -4
- package/dist/cli/index.js +3 -3
- package/dist/cli/{pending-delegations-7j8xqg5f.js → pending-delegations-a1bbpp8b.js} +1 -1
- package/dist/cli/{workspace-snapshot-c9pxxt9a.js → workspace-snapshot-aa0ggevw.js} +3 -1
- package/dist/commands/registry.d.ts +1 -1
- package/dist/hooks/pr-workflow-gate.d.ts +45 -1
- package/dist/hooks/pr-workflow-response-gate.d.ts +7 -5
- package/dist/index.js +22 -17
- package/dist/tools/dispatch-lanes.d.ts +5 -0
- package/package.json +1 -1
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# Dry-Run: Parser-Based Candidate Extraction
|
|
2
2
|
|
|
3
|
-
This section demonstrates the
|
|
4
|
-
using synthetic data. It is concrete enough to implement the
|
|
5
|
-
another skill.
|
|
3
|
+
This section demonstrates the Profile A (structured controller) extraction
|
|
4
|
+
path end-to-end using synthetic data. It is concrete enough to implement the
|
|
5
|
+
same pattern in another skill. On Profiles B/C the `[CANDIDATE]` row format in
|
|
6
|
+
the lane reports is the extraction contract itself; this parser flow does not
|
|
7
|
+
apply.
|
|
6
8
|
|
|
7
9
|
### Scenario
|
|
8
10
|
|
|
@@ -94,10 +94,10 @@ For a clean micro-lane, emit `[CLEAN] | micro_lane | coverage_scope | evidence`.
|
|
|
94
94
|
For a clean base lane, emit `[CLEAN] | workflow_lane | coverage_scope | evidence`.
|
|
95
95
|
```
|
|
96
96
|
|
|
97
|
-
|
|
98
|
-
`parse_lane_candidates` as the primary mechanism.
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
97
|
+
Under Profile A the orchestrator extracts candidates from the full lane
|
|
98
|
+
artifact via `parse_lane_candidates` as the primary mechanism. On Profiles
|
|
99
|
+
B/C — and as a Profile A fallback when the parser is unavailable — the
|
|
100
|
+
`[CANDIDATE]` row format above IS the extraction contract. Explorers emit
|
|
101
|
+
structured records regardless of which harness runs them.
|
|
102
102
|
|
|
103
103
|
Do not let speed degrade validation quality.
|
|
@@ -32,6 +32,7 @@ declare const ParseFlagsSchema: z.ZodObject<{
|
|
|
32
32
|
base_explorer: "base_explorer";
|
|
33
33
|
}>>;
|
|
34
34
|
expected_micro_lane: z.ZodOptional<z.ZodString>;
|
|
35
|
+
expected_micro_lanes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
35
36
|
}, z.core.$strict>;
|
|
36
37
|
export type ArtifactInput = z.infer<typeof ArtifactInputSchema>;
|
|
37
38
|
export type ParseFlags = z.infer<typeof ParseFlagsSchema>;
|
|
@@ -54,6 +54,12 @@ export interface BackgroundDelegationRecord {
|
|
|
54
54
|
mode?: string;
|
|
55
55
|
/** Mechanical PR workflow obligation identifier, distinct from retry-safe laneId. */
|
|
56
56
|
workflowLane?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Complete set of PR-review dimensions/risk families this lane covers when a
|
|
59
|
+
* depth tier consolidates dispatch. Always contains workflowLane. Absent for
|
|
60
|
+
* singleton lanes (legacy and tier-L dispatches).
|
|
61
|
+
*/
|
|
62
|
+
ownedWorkflowLanes?: string[];
|
|
57
63
|
/** Canonical hash of prompt/provenance inputs captured at dispatch time. */
|
|
58
64
|
promptHash?: string;
|
|
59
65
|
/** Project/root provenance captured at dispatch time. */
|
|
@@ -122,6 +128,7 @@ export interface RecordPendingInput {
|
|
|
122
128
|
laneId?: string;
|
|
123
129
|
mode?: string;
|
|
124
130
|
workflowLane?: string;
|
|
131
|
+
ownedWorkflowLanes?: string[];
|
|
125
132
|
promptHash?: string;
|
|
126
133
|
workspace?: BackgroundWorkspaceSnapshot;
|
|
127
134
|
taskChangeContext?: BackgroundTaskChangeContext;
|
|
@@ -21,6 +21,26 @@ export declare function readGitTextAtRevision(directory: string, revision: strin
|
|
|
21
21
|
export declare function resolveCurrentGitHead(directory: string): string | null;
|
|
22
22
|
/** Resolve one exact PR merge base without shell interpolation or unbounded I/O. */
|
|
23
23
|
export declare function resolveExactMergeBase(directory: string, baseRef: string, prHeadSha: string): string | null;
|
|
24
|
+
export interface PrReviewDiffStats {
|
|
25
|
+
changedLines: number;
|
|
26
|
+
changedFiles: number;
|
|
27
|
+
/**
|
|
28
|
+
* True when the range contains any gitlink (submodule) pointer change.
|
|
29
|
+
* Git's numstat reports a submodule bump as a fixed 1-added/1-deleted row
|
|
30
|
+
* regardless of the referenced repository's actual diff size, so size
|
|
31
|
+
* thresholds cannot bound this case; callers must escalate unconditionally.
|
|
32
|
+
*/
|
|
33
|
+
hasSubmoduleChange: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Compute bounded changed-line/file totals for the exact reviewed PR range.
|
|
37
|
+
* Returns null on any Git failure, malformed numstat row, or buffer overflow
|
|
38
|
+
* so callers can fail strict (treat unknown size as the largest tier).
|
|
39
|
+
* Rename detection is pinned off (`--no-renames`) so the same logical diff
|
|
40
|
+
* produces the same totals regardless of the executing machine's ambient
|
|
41
|
+
* git version/config.
|
|
42
|
+
*/
|
|
43
|
+
export declare function resolvePrReviewDiffStats(directory: string, baseSha: string, prHeadSha: string): PrReviewDiffStats | null;
|
|
24
44
|
/** Resolve the current branch's exact remote-tracking publication target. */
|
|
25
45
|
export declare function resolveCurrentUpstreamRemoteRef(directory: string): string | null;
|
|
26
46
|
export interface PrUpstreamPushTarget {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
createCuratorLLMDelegate
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-bn3w6ym4.js";
|
|
5
5
|
import"./index-v4n224r1.js";
|
|
6
6
|
import"./index-cpssctv1.js";
|
|
7
7
|
import"./index-kk1scggc.js";
|
|
@@ -34,12 +34,12 @@ import"./index-2tn5h2zp.js";
|
|
|
34
34
|
import"./index-1kz6da87.js";
|
|
35
35
|
import"./index-w9cb5zwh.js";
|
|
36
36
|
import"./index-4rhhvd1a.js";
|
|
37
|
-
import"./index-
|
|
37
|
+
import"./index-ecxwhwz7.js";
|
|
38
38
|
import"./index-2445sx3d.js";
|
|
39
39
|
import"./index-z6xqpmqg.js";
|
|
40
40
|
import"./index-zjygnfay.js";
|
|
41
41
|
import"./index-zgwm4ryv.js";
|
|
42
|
-
import"./index-
|
|
42
|
+
import"./index-40zn444p.js";
|
|
43
43
|
import"./index-3x761jqv.js";
|
|
44
44
|
import"./index-7mkpsw6g.js";
|
|
45
45
|
import"./index-fsrp8wp3.js";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
runCuratorInit,
|
|
15
15
|
runCuratorPhase,
|
|
16
16
|
writeCuratorSummary
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-bn3w6ym4.js";
|
|
18
18
|
import"./index-v4n224r1.js";
|
|
19
19
|
import"./index-cpssctv1.js";
|
|
20
20
|
import"./index-kk1scggc.js";
|
|
@@ -47,12 +47,12 @@ import"./index-2tn5h2zp.js";
|
|
|
47
47
|
import"./index-1kz6da87.js";
|
|
48
48
|
import"./index-w9cb5zwh.js";
|
|
49
49
|
import"./index-4rhhvd1a.js";
|
|
50
|
-
import"./index-
|
|
50
|
+
import"./index-ecxwhwz7.js";
|
|
51
51
|
import"./index-2445sx3d.js";
|
|
52
52
|
import"./index-z6xqpmqg.js";
|
|
53
53
|
import"./index-zjygnfay.js";
|
|
54
54
|
import"./index-zgwm4ryv.js";
|
|
55
|
-
import"./index-
|
|
55
|
+
import"./index-40zn444p.js";
|
|
56
56
|
import"./index-3x761jqv.js";
|
|
57
57
|
import"./index-7mkpsw6g.js";
|
|
58
58
|
import"./index-fsrp8wp3.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
handleGuardrailExplain
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
4
|
+
} from "./index-8cnpsbk5.js";
|
|
5
|
+
import"./index-bn3w6ym4.js";
|
|
6
6
|
import"./index-v4n224r1.js";
|
|
7
7
|
import"./index-cpssctv1.js";
|
|
8
8
|
import"./index-kk1scggc.js";
|
|
@@ -35,12 +35,12 @@ import"./index-2tn5h2zp.js";
|
|
|
35
35
|
import"./index-1kz6da87.js";
|
|
36
36
|
import"./index-w9cb5zwh.js";
|
|
37
37
|
import"./index-4rhhvd1a.js";
|
|
38
|
-
import"./index-
|
|
38
|
+
import"./index-ecxwhwz7.js";
|
|
39
39
|
import"./index-2445sx3d.js";
|
|
40
40
|
import"./index-z6xqpmqg.js";
|
|
41
41
|
import"./index-zjygnfay.js";
|
|
42
42
|
import"./index-zgwm4ryv.js";
|
|
43
|
-
import"./index-
|
|
43
|
+
import"./index-40zn444p.js";
|
|
44
44
|
import"./index-3x761jqv.js";
|
|
45
45
|
import"./index-7mkpsw6g.js";
|
|
46
46
|
import"./index-fsrp8wp3.js";
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
isHiveEligible,
|
|
8
8
|
promoteFromSwarm,
|
|
9
9
|
promoteToHive
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-bn3w6ym4.js";
|
|
11
11
|
import"./index-v4n224r1.js";
|
|
12
12
|
import"./index-cpssctv1.js";
|
|
13
13
|
import"./index-kk1scggc.js";
|
|
@@ -42,12 +42,12 @@ import"./index-2tn5h2zp.js";
|
|
|
42
42
|
import"./index-1kz6da87.js";
|
|
43
43
|
import"./index-w9cb5zwh.js";
|
|
44
44
|
import"./index-4rhhvd1a.js";
|
|
45
|
-
import"./index-
|
|
45
|
+
import"./index-ecxwhwz7.js";
|
|
46
46
|
import"./index-2445sx3d.js";
|
|
47
47
|
import"./index-z6xqpmqg.js";
|
|
48
48
|
import"./index-zjygnfay.js";
|
|
49
49
|
import"./index-zgwm4ryv.js";
|
|
50
|
-
import"./index-
|
|
50
|
+
import"./index-40zn444p.js";
|
|
51
51
|
import"./index-3x761jqv.js";
|
|
52
52
|
import"./index-7mkpsw6g.js";
|
|
53
53
|
import"./index-fsrp8wp3.js";
|
|
@@ -92,6 +92,43 @@ function resolveExactMergeBase(directory, baseRef, prHeadSha) {
|
|
|
92
92
|
const mergeBase = runGit(directory, ["merge-base", "--", baseRef, prHeadSha]);
|
|
93
93
|
return mergeBase && /^[0-9a-f]{6,64}$/i.test(mergeBase) ? mergeBase : null;
|
|
94
94
|
}
|
|
95
|
+
var GITLINK_MODE_PATTERN = /^:\d{6} 160000 |^:160000 \d{6} /;
|
|
96
|
+
function resolvePrReviewDiffStats(directory, baseSha, prHeadSha) {
|
|
97
|
+
if (!isSafeGitRevisionToken(baseSha) || !isSafeGitRevisionToken(prHeadSha))
|
|
98
|
+
return null;
|
|
99
|
+
const range = `${baseSha}...${prHeadSha}`;
|
|
100
|
+
const output = runGit(directory, [
|
|
101
|
+
"diff",
|
|
102
|
+
"--no-renames",
|
|
103
|
+
"--numstat",
|
|
104
|
+
range
|
|
105
|
+
]);
|
|
106
|
+
if (output === null)
|
|
107
|
+
return null;
|
|
108
|
+
let changedLines = 0;
|
|
109
|
+
let changedFiles = 0;
|
|
110
|
+
for (const line of output.split(`
|
|
111
|
+
`)) {
|
|
112
|
+
const trimmed = line.trim();
|
|
113
|
+
if (trimmed.length === 0)
|
|
114
|
+
continue;
|
|
115
|
+
const fields = trimmed.split("\t");
|
|
116
|
+
if (fields.length < 3)
|
|
117
|
+
return null;
|
|
118
|
+
const added = fields[0] === "-" ? 0 : Number.parseInt(fields[0], 10);
|
|
119
|
+
const deleted = fields[1] === "-" ? 0 : Number.parseInt(fields[1], 10);
|
|
120
|
+
if (Number.isNaN(added) || Number.isNaN(deleted))
|
|
121
|
+
return null;
|
|
122
|
+
changedFiles += 1;
|
|
123
|
+
changedLines += added + deleted;
|
|
124
|
+
}
|
|
125
|
+
const rawOutput = runGit(directory, ["diff", "--raw", range]);
|
|
126
|
+
if (rawOutput === null)
|
|
127
|
+
return null;
|
|
128
|
+
const hasSubmoduleChange = rawOutput.split(`
|
|
129
|
+
`).some((line) => GITLINK_MODE_PATTERN.test(line.trim()));
|
|
130
|
+
return { changedLines, changedFiles, hasSubmoduleChange };
|
|
131
|
+
}
|
|
95
132
|
function isSafeGitRevisionToken(value) {
|
|
96
133
|
return /^(?!-)[A-Za-z0-9][A-Za-z0-9._/-]{0,255}$/.test(value) && !value.includes("..") && !value.includes("//") && !value.includes("@{");
|
|
97
134
|
}
|
|
@@ -561,4 +598,4 @@ var _internals = {
|
|
|
561
598
|
parsePorcelainV2Snapshot
|
|
562
599
|
};
|
|
563
600
|
|
|
564
|
-
export { readGitTextAtRevision, resolveCurrentGitHead, resolveExactMergeBase, resolveCurrentUpstreamRemoteRef, resolveCurrentUpstreamPushTarget, resolveExactRemoteBranchHead, resolveGitControlStateDigest, resolveIsWorkingTreeClean, resolveCommitCountSince, resolveIsExactSingleChildCommit, resolveRemoteRefsContainingHead, resolvePrWorkflowRevisionDigest, resolvePrWorkflowRevisionDigestAsync, parsePorcelainPaths, captureWorkspaceSnapshot, changedFilesSinceSnapshot, workspaceSnapshotMatches, compareWorkspaceSnapshot, compareWorkspaceSnapshots, digest, _internals };
|
|
601
|
+
export { readGitTextAtRevision, resolveCurrentGitHead, resolveExactMergeBase, resolvePrReviewDiffStats, resolveCurrentUpstreamRemoteRef, resolveCurrentUpstreamPushTarget, resolveExactRemoteBranchHead, resolveGitControlStateDigest, resolveIsWorkingTreeClean, resolveCommitCountSince, resolveIsExactSingleChildCommit, resolveRemoteRefsContainingHead, resolvePrWorkflowRevisionDigest, resolvePrWorkflowRevisionDigestAsync, parsePorcelainPaths, captureWorkspaceSnapshot, changedFilesSinceSnapshot, workspaceSnapshotMatches, compareWorkspaceSnapshot, compareWorkspaceSnapshots, digest, _internals };
|
|
@@ -253,7 +253,7 @@ import {
|
|
|
253
253
|
} from "./index-4rhhvd1a.js";
|
|
254
254
|
import {
|
|
255
255
|
readDelegations
|
|
256
|
-
} from "./index-
|
|
256
|
+
} from "./index-ecxwhwz7.js";
|
|
257
257
|
import {
|
|
258
258
|
readSwarmFileAsync,
|
|
259
259
|
safeHook,
|
|
@@ -274,9 +274,10 @@ import {
|
|
|
274
274
|
resolveExactRemoteBranchHead,
|
|
275
275
|
resolveIsExactSingleChildCommit,
|
|
276
276
|
resolveIsWorkingTreeClean,
|
|
277
|
+
resolvePrReviewDiffStats,
|
|
277
278
|
resolvePrWorkflowRevisionDigest,
|
|
278
279
|
resolveRemoteRefsContainingHead
|
|
279
|
-
} from "./index-
|
|
280
|
+
} from "./index-40zn444p.js";
|
|
280
281
|
import {
|
|
281
282
|
atomicWriteFile
|
|
282
283
|
} from "./index-7mkpsw6g.js";
|
|
@@ -715,6 +716,19 @@ var LaneOutputArtifactSchema = exports_external.object({
|
|
|
715
716
|
init_constants();
|
|
716
717
|
init_schema();
|
|
717
718
|
init_tool_metadata();
|
|
719
|
+
var PR_REVIEW_BASE_DIMENSION_IDS = [
|
|
720
|
+
"intent-architecture",
|
|
721
|
+
"correctness-state",
|
|
722
|
+
"tests-falsifiability",
|
|
723
|
+
"security-trust",
|
|
724
|
+
"reliability-performance",
|
|
725
|
+
"compatibility-delivery"
|
|
726
|
+
];
|
|
727
|
+
var PR_REVIEW_BASE_LANE_FLOORS = {
|
|
728
|
+
S: 1,
|
|
729
|
+
M: 3,
|
|
730
|
+
L: PR_REVIEW_BASE_DIMENSION_IDS.length
|
|
731
|
+
};
|
|
718
732
|
var GATE_SCHEMA_VERSION = 1;
|
|
719
733
|
var MAX_TRACKED_SESSIONS = 200;
|
|
720
734
|
var MAX_WORKFLOW_BATCHES = 128;
|
|
@@ -726,18 +740,20 @@ var STATE_MUTATION_LOCK_UNINITIALIZED_STALE_MS = 30000;
|
|
|
726
740
|
var WORKFLOW_GATE_DIR = "pr-workflow-gates";
|
|
727
741
|
var trackedStatesByProjectSession = new Map;
|
|
728
742
|
var pendingStateMutationsByProjectSession = new Map;
|
|
743
|
+
var PrReviewBaseDimensionIdSchema = exports_external.enum([
|
|
744
|
+
"intent-architecture",
|
|
745
|
+
"correctness-state",
|
|
746
|
+
"tests-falsifiability",
|
|
747
|
+
"security-trust",
|
|
748
|
+
"reliability-performance",
|
|
749
|
+
"compatibility-delivery"
|
|
750
|
+
]);
|
|
729
751
|
var PrReviewBaseDispatchRecordSchema = exports_external.object({
|
|
730
752
|
batchId: exports_external.string().min(1),
|
|
731
753
|
lanes: exports_external.array(exports_external.object({
|
|
732
754
|
laneId: exports_external.string().min(1),
|
|
733
|
-
workflowLane:
|
|
734
|
-
|
|
735
|
-
"correctness-state",
|
|
736
|
-
"tests-falsifiability",
|
|
737
|
-
"security-trust",
|
|
738
|
-
"reliability-performance",
|
|
739
|
-
"compatibility-delivery"
|
|
740
|
-
])
|
|
755
|
+
workflowLane: PrReviewBaseDimensionIdSchema,
|
|
756
|
+
ownedWorkflowLanes: exports_external.array(PrReviewBaseDimensionIdSchema).min(1).max(PR_REVIEW_BASE_DIMENSION_IDS.length).optional()
|
|
741
757
|
}).strict()).min(1),
|
|
742
758
|
validatedAt: exports_external.string().min(1)
|
|
743
759
|
}).strict();
|
|
@@ -832,6 +848,12 @@ var PrWorkflowGateStateSchema = exports_external.object({
|
|
|
832
848
|
prHeadSha: exports_external.string().min(1).optional(),
|
|
833
849
|
prReviewBaseRef: exports_external.string().min(1).optional(),
|
|
834
850
|
prReviewBaseSha: exports_external.string().min(1).optional(),
|
|
851
|
+
prReviewDepthTier: exports_external.enum(["S", "M", "L"]).optional(),
|
|
852
|
+
prReviewDiffStats: exports_external.object({
|
|
853
|
+
changedLines: exports_external.number().int().nonnegative(),
|
|
854
|
+
changedFiles: exports_external.number().int().nonnegative(),
|
|
855
|
+
hasSubmoduleChange: exports_external.boolean().default(false)
|
|
856
|
+
}).strict().optional(),
|
|
835
857
|
prReviewBaseDispatches: exports_external.array(PrReviewBaseDispatchRecordSchema).max(MAX_WORKFLOW_BATCHES).optional(),
|
|
836
858
|
prReviewBaseDispatch: PrReviewBaseDispatchRecordSchema.optional(),
|
|
837
859
|
prReviewTriggerEvalPath: exports_external.string().min(1).optional(),
|
|
@@ -848,7 +870,7 @@ var PrWorkflowGateStateSchema = exports_external.object({
|
|
|
848
870
|
prFeedbackGateBatches: exports_external.array(PrFeedbackGateBatchRecordSchema).max(MAX_WORKFLOW_BATCHES).optional(),
|
|
849
871
|
prFeedbackReadyToPublish: PrFeedbackReadyToPublishRecordSchema.optional(),
|
|
850
872
|
prFeedbackScopes: exports_external.array(PrFeedbackScopeDeclarationRecordSchema).max(MAX_WORKFLOW_BATCHES).optional()
|
|
851
|
-
}).
|
|
873
|
+
}).passthrough();
|
|
852
874
|
async function activatePrWorkflow(directory, sessionID, mode, options = {}) {
|
|
853
875
|
const normalizedSessionID = normalizeSessionID(sessionID);
|
|
854
876
|
const existing = await readPrWorkflowGateState(directory, normalizedSessionID);
|
|
@@ -885,9 +907,11 @@ async function readPrWorkflowGateState(directory, sessionID) {
|
|
|
885
907
|
async function clearPrWorkflowGateState(directory, sessionID, expectedRevision) {
|
|
886
908
|
const normalizedSessionID = normalizeSessionID(sessionID);
|
|
887
909
|
await withSessionStateMutation(directory, normalizedSessionID, async () => {
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
910
|
+
if (expectedRevision !== undefined) {
|
|
911
|
+
const current = await readPrWorkflowGateStateFromDisk(directory, normalizedSessionID);
|
|
912
|
+
if (!current || current.revision !== expectedRevision) {
|
|
913
|
+
throw new Error("BLOCKED: PR workflow gate state changed during terminal completion; revalidate the current session state before retrying");
|
|
914
|
+
}
|
|
891
915
|
}
|
|
892
916
|
try {
|
|
893
917
|
await fsp.rm(workflowGateStatePath(directory, normalizedSessionID), {
|
|
@@ -1000,6 +1024,7 @@ var _test_exports = {
|
|
|
1000
1024
|
resolveCommitCountSince,
|
|
1001
1025
|
resolveIsWorkingTreeClean,
|
|
1002
1026
|
resolveIsExactSingleChildCommit,
|
|
1027
|
+
resolvePrReviewDiffStats,
|
|
1003
1028
|
resolvePrWorkflowRevisionDigest,
|
|
1004
1029
|
resolveRemoteRefsContainingHead,
|
|
1005
1030
|
parseCriticVerdict,
|
|
@@ -12280,11 +12305,11 @@ var _internals15 = {
|
|
|
12280
12305
|
}
|
|
12281
12306
|
},
|
|
12282
12307
|
applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig, generation) => {
|
|
12283
|
-
const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-
|
|
12308
|
+
const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-qqd1fvvg.js");
|
|
12284
12309
|
return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig, generation);
|
|
12285
12310
|
},
|
|
12286
12311
|
checkHivePromotions: async (entries, knowledgeConfig, directory) => {
|
|
12287
|
-
const { checkHivePromotions } = await import("./hive-promoter-
|
|
12312
|
+
const { checkHivePromotions } = await import("./hive-promoter-14jh86kj.js");
|
|
12288
12313
|
return checkHivePromotions(entries, knowledgeConfig, directory);
|
|
12289
12314
|
},
|
|
12290
12315
|
applyProposalTriage: async (directory, triage) => {
|
|
@@ -20151,8 +20176,8 @@ var _internals28 = {
|
|
|
20151
20176
|
loadCuratorDeps: async () => {
|
|
20152
20177
|
const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate: createCuratorLLMDelegate2 }] = await Promise.all([
|
|
20153
20178
|
import("./schema-2x7wsb0n.js"),
|
|
20154
|
-
import("./curator-
|
|
20155
|
-
import("./curator-llm-factory-
|
|
20179
|
+
import("./curator-qqd1fvvg.js"),
|
|
20180
|
+
import("./curator-llm-factory-4t2h2p60.js")
|
|
20156
20181
|
]);
|
|
20157
20182
|
return { CuratorConfigSchema, curator, createCuratorLLMDelegate: createCuratorLLMDelegate2 };
|
|
20158
20183
|
}
|
|
@@ -20651,7 +20676,7 @@ import { fileURLToPath } from "url";
|
|
|
20651
20676
|
// package.json
|
|
20652
20677
|
var package_default = {
|
|
20653
20678
|
name: "opencode-swarm",
|
|
20654
|
-
version: "7.
|
|
20679
|
+
version: "7.127.1",
|
|
20655
20680
|
description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
20656
20681
|
main: "dist/index.js",
|
|
20657
20682
|
types: "dist/index.d.ts",
|
|
@@ -41213,7 +41238,7 @@ function buildDetailedHelp(commandName, entry) {
|
|
|
41213
41238
|
async function handleHelpCommand(ctx) {
|
|
41214
41239
|
const targetCommand = ctx.args.join(" ");
|
|
41215
41240
|
if (!targetCommand) {
|
|
41216
|
-
const { buildHelpText } = await import("./index-
|
|
41241
|
+
const { buildHelpText } = await import("./index-pbw1ncre.js");
|
|
41217
41242
|
return buildHelpText();
|
|
41218
41243
|
}
|
|
41219
41244
|
const tokens = targetCommand.split(/\s+/);
|
|
@@ -41222,7 +41247,7 @@ async function handleHelpCommand(ctx) {
|
|
|
41222
41247
|
return _internals63.buildDetailedHelp(resolved.key, resolved.entry);
|
|
41223
41248
|
}
|
|
41224
41249
|
const similar = _internals63.findSimilarCommands(targetCommand);
|
|
41225
|
-
const { buildHelpText: fullHelp } = await import("./index-
|
|
41250
|
+
const { buildHelpText: fullHelp } = await import("./index-pbw1ncre.js");
|
|
41226
41251
|
if (similar.length > 0) {
|
|
41227
41252
|
return `Command '/swarm ${targetCommand}' not found.
|
|
41228
41253
|
|
|
@@ -41361,7 +41386,7 @@ var COMMAND_REGISTRY = {
|
|
|
41361
41386
|
},
|
|
41362
41387
|
"guardrail explain": {
|
|
41363
41388
|
handler: async (ctx) => {
|
|
41364
|
-
const { handleGuardrailExplain } = await import("./guardrail-explain-
|
|
41389
|
+
const { handleGuardrailExplain } = await import("./guardrail-explain-4yg67c3t.js");
|
|
41365
41390
|
return handleGuardrailExplain(ctx.directory, ctx.args);
|
|
41366
41391
|
},
|
|
41367
41392
|
description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
|
|
@@ -41371,7 +41396,7 @@ var COMMAND_REGISTRY = {
|
|
|
41371
41396
|
},
|
|
41372
41397
|
"guardrail-explain": {
|
|
41373
41398
|
handler: async (ctx) => {
|
|
41374
|
-
const { handleGuardrailExplain } = await import("./guardrail-explain-
|
|
41399
|
+
const { handleGuardrailExplain } = await import("./guardrail-explain-4yg67c3t.js");
|
|
41375
41400
|
return handleGuardrailExplain(ctx.directory, ctx.args);
|
|
41376
41401
|
},
|
|
41377
41402
|
description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
|
|
@@ -41746,7 +41771,7 @@ Subcommands:
|
|
|
41746
41771
|
handler: (ctx) => handleModeCommandWithBundledSkills(ctx, handlePrReviewCommand, "PR_REVIEW"),
|
|
41747
41772
|
description: "Launch deep PR review with multi-lane analysis [url] [--council]",
|
|
41748
41773
|
args: "<pr-url|owner/repo#N|N> [--council]",
|
|
41749
|
-
details: "Launches a structured PR review: reconstructs PR intent via obligation extraction cascade,
|
|
41774
|
+
details: "Launches a structured PR review: reconstructs PR intent via obligation extraction cascade, computes a depth tier (S/M/L) from the bound merge-base diff, launches the base explorer wave through dispatch_lanes_async (all 6 review dimensions covered on every PR \u2014 six singleton lanes at tier L, consolidated owned_workflow_lanes partitions at tiers S/M) while the architect keeps doing non-dependent work, polls collect_lane_results incrementally, evaluates all 11 mandatory repository-agnostic risk families without applicability waivers (dedicated micro-lanes at tier L, consolidated sweeps at S/M), validates findings through independent reviewer confirmation, applies critic challenge to HIGH/CRITICAL findings, then synthesizes only after coverage is closed. Failed obligations retry through the same structured async mode and exact PR head; blocking or direct-Task dispatch is not provenance-equivalent, so unclosed coverage leaves the review BLOCKED rather than degraded. --council variant fires adversarial multi-model review. Supports full GitHub URL, owner/repo#N shorthand, or bare PR number (resolves against origin remote).",
|
|
41750
41775
|
category: "agent",
|
|
41751
41776
|
toolPolicy: "none"
|
|
41752
41777
|
},
|
|
@@ -81,6 +81,7 @@ var RecordSchema = exports_external.object({
|
|
|
81
81
|
laneId: exports_external.string().optional(),
|
|
82
82
|
mode: exports_external.string().optional(),
|
|
83
83
|
workflowLane: exports_external.string().optional(),
|
|
84
|
+
ownedWorkflowLanes: exports_external.array(exports_external.string().min(1).max(120)).min(1).max(11).optional(),
|
|
84
85
|
promptHash: exports_external.string().optional(),
|
|
85
86
|
workspace: WorkspaceSchema.optional(),
|
|
86
87
|
taskChangeContext: TaskChangeContextSchema.optional(),
|
|
@@ -158,6 +159,7 @@ async function recordPendingDelegation(directory, input, options = {}) {
|
|
|
158
159
|
...input.laneId ? { laneId: input.laneId } : {},
|
|
159
160
|
...input.mode ? { mode: input.mode } : {},
|
|
160
161
|
...input.workflowLane ? { workflowLane: input.workflowLane } : {},
|
|
162
|
+
...input.ownedWorkflowLanes?.length ? { ownedWorkflowLanes: [...input.ownedWorkflowLanes] } : {},
|
|
161
163
|
...input.promptHash ? { promptHash: input.promptHash } : {},
|
|
162
164
|
...input.workspace ? { workspace: input.workspace } : {},
|
|
163
165
|
...input.taskChangeContext ? { taskChangeContext: input.taskChangeContext } : {},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
handleGuardrailExplain
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-8cnpsbk5.js";
|
|
5
5
|
import {
|
|
6
6
|
handleGuardrailLog
|
|
7
7
|
} from "./index-8etcyr9r.js";
|
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
handleWriteRetroCommand,
|
|
84
84
|
normalizeSwarmCommandInput,
|
|
85
85
|
resolveCommand
|
|
86
|
-
} from "./index-
|
|
86
|
+
} from "./index-bn3w6ym4.js";
|
|
87
87
|
import"./index-v4n224r1.js";
|
|
88
88
|
import"./index-cpssctv1.js";
|
|
89
89
|
import"./index-kk1scggc.js";
|
|
@@ -122,12 +122,12 @@ import"./index-2tn5h2zp.js";
|
|
|
122
122
|
import"./index-1kz6da87.js";
|
|
123
123
|
import"./index-w9cb5zwh.js";
|
|
124
124
|
import"./index-4rhhvd1a.js";
|
|
125
|
-
import"./index-
|
|
125
|
+
import"./index-ecxwhwz7.js";
|
|
126
126
|
import"./index-2445sx3d.js";
|
|
127
127
|
import"./index-z6xqpmqg.js";
|
|
128
128
|
import"./index-zjygnfay.js";
|
|
129
129
|
import"./index-zgwm4ryv.js";
|
|
130
|
-
import"./index-
|
|
130
|
+
import"./index-40zn444p.js";
|
|
131
131
|
import"./index-3x761jqv.js";
|
|
132
132
|
import"./index-7mkpsw6g.js";
|
|
133
133
|
import"./index-fsrp8wp3.js";
|
package/dist/cli/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
getPluginLockFilePaths,
|
|
8
8
|
package_default,
|
|
9
9
|
resolveCommand
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-bn3w6ym4.js";
|
|
11
11
|
import"./index-v4n224r1.js";
|
|
12
12
|
import"./index-cpssctv1.js";
|
|
13
13
|
import"./index-kk1scggc.js";
|
|
@@ -43,12 +43,12 @@ import"./index-2tn5h2zp.js";
|
|
|
43
43
|
import"./index-1kz6da87.js";
|
|
44
44
|
import"./index-w9cb5zwh.js";
|
|
45
45
|
import"./index-4rhhvd1a.js";
|
|
46
|
-
import"./index-
|
|
46
|
+
import"./index-ecxwhwz7.js";
|
|
47
47
|
import"./index-2445sx3d.js";
|
|
48
48
|
import"./index-z6xqpmqg.js";
|
|
49
49
|
import"./index-zjygnfay.js";
|
|
50
50
|
import"./index-zgwm4ryv.js";
|
|
51
|
-
import"./index-
|
|
51
|
+
import"./index-40zn444p.js";
|
|
52
52
|
import"./index-3x761jqv.js";
|
|
53
53
|
import"./index-7mkpsw6g.js";
|
|
54
54
|
import"./index-fsrp8wp3.js";
|
|
@@ -17,17 +17,19 @@ import {
|
|
|
17
17
|
resolveGitControlStateDigest,
|
|
18
18
|
resolveIsExactSingleChildCommit,
|
|
19
19
|
resolveIsWorkingTreeClean,
|
|
20
|
+
resolvePrReviewDiffStats,
|
|
20
21
|
resolvePrWorkflowRevisionDigest,
|
|
21
22
|
resolvePrWorkflowRevisionDigestAsync,
|
|
22
23
|
resolveRemoteRefsContainingHead,
|
|
23
24
|
workspaceSnapshotMatches
|
|
24
|
-
} from "./index-
|
|
25
|
+
} from "./index-40zn444p.js";
|
|
25
26
|
import"./index-a76rekgs.js";
|
|
26
27
|
export {
|
|
27
28
|
workspaceSnapshotMatches,
|
|
28
29
|
resolveRemoteRefsContainingHead,
|
|
29
30
|
resolvePrWorkflowRevisionDigestAsync,
|
|
30
31
|
resolvePrWorkflowRevisionDigest,
|
|
32
|
+
resolvePrReviewDiffStats,
|
|
31
33
|
resolveIsWorkingTreeClean,
|
|
32
34
|
resolveIsExactSingleChildCommit,
|
|
33
35
|
resolveGitControlStateDigest,
|
|
@@ -525,7 +525,7 @@ export declare const COMMAND_REGISTRY: {
|
|
|
525
525
|
readonly handler: (ctx: CommandContext) => CommandResult;
|
|
526
526
|
readonly description: "Launch deep PR review with multi-lane analysis [url] [--council]";
|
|
527
527
|
readonly args: "<pr-url|owner/repo#N|N> [--council]";
|
|
528
|
-
readonly details: "Launches a structured PR review: reconstructs PR intent via obligation extraction cascade,
|
|
528
|
+
readonly details: "Launches a structured PR review: reconstructs PR intent via obligation extraction cascade, computes a depth tier (S/M/L) from the bound merge-base diff, launches the base explorer wave through dispatch_lanes_async (all 6 review dimensions covered on every PR — six singleton lanes at tier L, consolidated owned_workflow_lanes partitions at tiers S/M) while the architect keeps doing non-dependent work, polls collect_lane_results incrementally, evaluates all 11 mandatory repository-agnostic risk families without applicability waivers (dedicated micro-lanes at tier L, consolidated sweeps at S/M), validates findings through independent reviewer confirmation, applies critic challenge to HIGH/CRITICAL findings, then synthesizes only after coverage is closed. Failed obligations retry through the same structured async mode and exact PR head; blocking or direct-Task dispatch is not provenance-equivalent, so unclosed coverage leaves the review BLOCKED rather than degraded. --council variant fires adversarial multi-model review. Supports full GitHub URL, owner/repo#N shorthand, or bare PR number (resolves against origin remote).";
|
|
529
529
|
readonly category: "agent";
|
|
530
530
|
readonly toolPolicy: "none";
|
|
531
531
|
};
|
|
@@ -1,13 +1,47 @@
|
|
|
1
1
|
import * as fsp from 'node:fs/promises';
|
|
2
|
-
import { resolveCommitCountSince, resolveCurrentGitHead, resolveCurrentUpstreamPushTarget, resolveCurrentUpstreamRemoteRef, resolveExactRemoteBranchHead, resolveIsExactSingleChildCommit, resolveIsWorkingTreeClean, resolvePrWorkflowRevisionDigest, resolveRemoteRefsContainingHead } from '../background/workspace-snapshot.js';
|
|
2
|
+
import { resolveCommitCountSince, resolveCurrentGitHead, resolveCurrentUpstreamPushTarget, resolveCurrentUpstreamRemoteRef, resolveExactRemoteBranchHead, resolveIsExactSingleChildCommit, resolveIsWorkingTreeClean, resolvePrReviewDiffStats, resolvePrWorkflowRevisionDigest, resolveRemoteRefsContainingHead } from '../background/workspace-snapshot.js';
|
|
3
3
|
export declare const PR_REVIEW_BASE_DIMENSION_IDS: readonly ["intent-architecture", "correctness-state", "tests-falsifiability", "security-trust", "reliability-performance", "compatibility-delivery"];
|
|
4
4
|
export declare const PR_REVIEW_REQUIRED_MICRO_LANE_IDS: readonly ["auth-identity-secrets", "untrusted-input-boundaries", "subprocess-platform", "concurrency-state", "dependencies-build-release", "api-schema-migrations", "test-infrastructure", "ui-accessibility-i18n", "privacy-observability", "generated-provenance", "unclassified-risk"];
|
|
5
5
|
export type PrReviewBaseDimensionId = (typeof PR_REVIEW_BASE_DIMENSION_IDS)[number];
|
|
6
6
|
export type PrWorkflowMode = 'PR_REVIEW' | 'PR_FEEDBACK';
|
|
7
|
+
export type PrReviewDepthTier = 'S' | 'M' | 'L';
|
|
8
|
+
/**
|
|
9
|
+
* Objective size thresholds for the controller-computed PR-review depth tier.
|
|
10
|
+
* Risk-trigger escalation is semantic and stays caller-side: callers may
|
|
11
|
+
* always dispatch more lanes than a tier's floor, never fewer.
|
|
12
|
+
*/
|
|
13
|
+
export declare const PR_REVIEW_DEPTH_TIER_THRESHOLDS: {
|
|
14
|
+
readonly smallMaxChangedLines: 50;
|
|
15
|
+
readonly smallMaxChangedFiles: 3;
|
|
16
|
+
readonly mediumMaxChangedLines: 500;
|
|
17
|
+
readonly mediumMaxChangedFiles: 20;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Minimum initial base-wave lane counts per depth tier. Tier L preserves the
|
|
21
|
+
* historical exact-six singleton wave; S/M permit consolidated lanes that own
|
|
22
|
+
* multiple dimensions while every dimension stays mandatory to evaluate.
|
|
23
|
+
*/
|
|
24
|
+
export declare const PR_REVIEW_BASE_LANE_FLOORS: Record<PrReviewDepthTier, number>;
|
|
25
|
+
/**
|
|
26
|
+
* Unknown or uncomputable diff size fails strict to the deepest tier, as does
|
|
27
|
+
* any range containing a submodule pointer change: git's numstat reports a
|
|
28
|
+
* gitlink bump as a fixed 1-added/1-deleted row regardless of the referenced
|
|
29
|
+
* repository's actual diff size, so no line/file threshold can bound it.
|
|
30
|
+
*/
|
|
31
|
+
export declare function computePrReviewDepthTier(stats: {
|
|
32
|
+
changedLines: number;
|
|
33
|
+
changedFiles: number;
|
|
34
|
+
hasSubmoduleChange?: boolean;
|
|
35
|
+
} | null | undefined): PrReviewDepthTier;
|
|
7
36
|
export interface PrWorkflowLaneSpec {
|
|
8
37
|
laneId?: string;
|
|
9
38
|
workflowLane?: string;
|
|
10
39
|
reviewItemIds?: string[];
|
|
40
|
+
/**
|
|
41
|
+
* Complete dimension/family set this lane covers under a consolidated depth
|
|
42
|
+
* tier. Must contain workflowLane. Absent means the singleton [workflowLane].
|
|
43
|
+
*/
|
|
44
|
+
ownedWorkflowLanes?: string[];
|
|
11
45
|
}
|
|
12
46
|
export interface PrFeedbackLaneOwnership {
|
|
13
47
|
laneId: string;
|
|
@@ -18,6 +52,7 @@ interface PrReviewBaseDispatchRecord {
|
|
|
18
52
|
lanes: Array<{
|
|
19
53
|
laneId: string;
|
|
20
54
|
workflowLane: PrReviewBaseDimensionId;
|
|
55
|
+
ownedWorkflowLanes?: PrReviewBaseDimensionId[];
|
|
21
56
|
}>;
|
|
22
57
|
validatedAt: string;
|
|
23
58
|
}
|
|
@@ -115,6 +150,14 @@ export interface PrWorkflowGateState {
|
|
|
115
150
|
prHeadSha?: string;
|
|
116
151
|
prReviewBaseRef?: string;
|
|
117
152
|
prReviewBaseSha?: string;
|
|
153
|
+
/** Controller-computed size tier for the bound merge-base scope. */
|
|
154
|
+
prReviewDepthTier?: PrReviewDepthTier;
|
|
155
|
+
/** Audit record of the bounded numstat totals behind prReviewDepthTier. */
|
|
156
|
+
prReviewDiffStats?: {
|
|
157
|
+
changedLines: number;
|
|
158
|
+
changedFiles: number;
|
|
159
|
+
hasSubmoduleChange: boolean;
|
|
160
|
+
};
|
|
118
161
|
prReviewBaseDispatches?: PrReviewBaseDispatchRecord[];
|
|
119
162
|
/** @deprecated Compatibility projection of the most recent base dispatch. */
|
|
120
163
|
prReviewBaseDispatch?: PrReviewBaseDispatchRecord;
|
|
@@ -285,6 +328,7 @@ export declare const _test_exports: {
|
|
|
285
328
|
resolveCommitCountSince: typeof resolveCommitCountSince;
|
|
286
329
|
resolveIsWorkingTreeClean: typeof resolveIsWorkingTreeClean;
|
|
287
330
|
resolveIsExactSingleChildCommit: typeof resolveIsExactSingleChildCommit;
|
|
331
|
+
resolvePrReviewDiffStats: typeof resolvePrReviewDiffStats;
|
|
288
332
|
resolvePrWorkflowRevisionDigest: typeof resolvePrWorkflowRevisionDigest;
|
|
289
333
|
resolveRemoteRefsContainingHead: typeof resolveRemoteRefsContainingHead;
|
|
290
334
|
parseCriticVerdict: typeof parseCriticVerdict;
|