opencode-swarm 7.125.4 → 7.125.6
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/brainstorm/SKILL.md +1 -0
- package/.opencode/skills/execute/SKILL.md +5 -0
- package/.opencode/skills/phase-wrap/SKILL.md +2 -0
- package/.opencode/skills/plan/SKILL.md +1 -0
- package/.opencode/skills/swarm-pr-feedback/SKILL.md +16 -0
- package/.opencode/skills/swarm-pr-review/SKILL.md +34 -0
- package/dist/cli/{config-doctor-rm1m07gz.js → config-doctor-akxywx0c.js} +2 -2
- package/dist/cli/{curation-policy-7pgdjt5w.js → curation-policy-62w2pwfz.js} +2 -2
- package/dist/cli/{curator-n6whbm4r.js → curator-gke6nrc4.js} +12 -12
- package/dist/cli/{curator-llm-factory-0hncnz9t.js → curator-llm-factory-40c4852v.js} +12 -12
- package/dist/cli/{guardrail-explain-8gknrsbb.js → guardrail-explain-m34vcgjg.js} +13 -13
- package/dist/cli/{guardrail-log-6a2zxvtx.js → guardrail-log-222xyxfp.js} +3 -3
- package/dist/cli/{hive-promoter-mpjq0fw9.js → hive-promoter-6fg3redm.js} +12 -12
- package/dist/cli/{index-vdfewvn5.js → index-0f45t7xy.js} +5 -5
- package/dist/cli/{index-45mvd5q7.js → index-1012f47p.js} +4 -4
- package/dist/cli/{index-jkwyjr8x.js → index-1cxp3b5y.js} +2 -2
- package/dist/cli/{index-rp5msv7n.js → index-1htanqp1.js} +1 -1
- package/dist/cli/{index-emzes7sj.js → index-4b1e5m0d.js} +2 -2
- package/dist/cli/{index-ambnwnmt.js → index-74xejn4v.js} +1 -1
- package/dist/cli/{index-7xg876np.js → index-d17kqe54.js} +221 -94
- package/dist/cli/{index-xezv6tdw.js → index-dezgmvtw.js} +1 -1
- package/dist/cli/{index-8tjbq2ej.js → index-e315gwc9.js} +1 -1
- package/dist/cli/{index-fm4zfxnr.js → index-gbnpz7rh.js} +1 -1
- package/dist/cli/{index-01n43w2p.js → index-gd5w3ef8.js} +3 -3
- package/dist/cli/{index-pk099nqv.js → index-jt7hnr7q.js} +1 -1
- package/dist/cli/{index-4ycq2mrp.js → index-qzkcy22e.js} +1 -1
- package/dist/cli/{index-414r47r7.js → index-r1gdkn2d.js} +4 -0
- package/dist/cli/{index-sa3dgpmc.js → index-yq4s3q43.js} +2 -2
- package/dist/cli/{index-hr2kzcem.js → index-zp330ss0.js} +14 -14
- package/dist/cli/index.js +12 -12
- package/dist/cli/{knowledge-escalator-gr8qd7kz.js → knowledge-escalator-h3hg7ek7.js} +3 -3
- package/dist/cli/{knowledge-events-q83g3f8z.js → knowledge-events-jtr66wxz.js} +1 -1
- package/dist/cli/{knowledge-store-qq3w5yt8.js → knowledge-store-69ttjjjs.js} +1 -1
- package/dist/cli/{knowledge-validator-7jhq8yam.js → knowledge-validator-yn06rh13.js} +4 -4
- package/dist/cli/{scan-cursor-fa5sy36q.js → scan-cursor-r0w2p5gz.js} +2 -2
- package/dist/cli/{schema-bw68my66.js → schema-69z8w1ka.js} +1 -1
- package/dist/cli/{skill-generator-ffc1agyw.js → skill-generator-a7xfyddq.js} +5 -5
- package/dist/commands/abort-pr-workflow.d.ts +17 -0
- package/dist/commands/registry.d.ts +8 -0
- package/dist/hooks/pr-workflow-gate.d.ts +32 -0
- package/dist/hooks/pr-workflow-response-gate.d.ts +48 -0
- package/dist/index.js +84 -67
- package/dist/tools/abort-pr-workflow.d.ts +5 -0
- package/dist/tools/index.d.ts +1 -0
- package/dist/tools/manifest.d.ts +1 -0
- package/dist/tools/tool-metadata.d.ts +4 -0
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
readDoctorArtifact,
|
|
5
5
|
removeStraySwarmDir,
|
|
6
6
|
runConfigDoctor
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-jt7hnr7q.js";
|
|
8
8
|
import {
|
|
9
9
|
EvaluationTaskV1Schema,
|
|
10
10
|
GateAuditManifestV1Schema,
|
|
@@ -94,15 +94,15 @@ import {
|
|
|
94
94
|
retireSkill,
|
|
95
95
|
selectCandidateEntries,
|
|
96
96
|
syncBundledProjectSkillsIfMissingAsync
|
|
97
|
-
} from "./index-
|
|
97
|
+
} from "./index-gd5w3ef8.js";
|
|
98
98
|
import {
|
|
99
99
|
readRecentEscalations
|
|
100
|
-
} from "./index-
|
|
100
|
+
} from "./index-0f45t7xy.js";
|
|
101
101
|
import {
|
|
102
102
|
alreadyCuratedThisGeneration,
|
|
103
103
|
claimNextScanBatch,
|
|
104
104
|
resolveCohortId
|
|
105
|
-
} from "./index-
|
|
105
|
+
} from "./index-e315gwc9.js";
|
|
106
106
|
import {
|
|
107
107
|
CURATOR_INIT_PROMPT,
|
|
108
108
|
CURATOR_PHASE_PROMPT,
|
|
@@ -135,11 +135,11 @@ import {
|
|
|
135
135
|
validateActionability,
|
|
136
136
|
validateActionableFields,
|
|
137
137
|
validateLesson
|
|
138
|
-
} from "./index-
|
|
138
|
+
} from "./index-yq4s3q43.js";
|
|
139
139
|
import {
|
|
140
140
|
authorizeCuration,
|
|
141
141
|
buildConfigFingerprintInput
|
|
142
|
-
} from "./index-
|
|
142
|
+
} from "./index-1htanqp1.js";
|
|
143
143
|
import {
|
|
144
144
|
cohortConfigFingerprint
|
|
145
145
|
} from "./index-rtry5xyf.js";
|
|
@@ -169,7 +169,7 @@ import {
|
|
|
169
169
|
transactFile,
|
|
170
170
|
transactKnowledge,
|
|
171
171
|
wordBigrams
|
|
172
|
-
} from "./index-
|
|
172
|
+
} from "./index-1012f47p.js";
|
|
173
173
|
import {
|
|
174
174
|
MAX_EVENT_LOG_ENTRIES,
|
|
175
175
|
_internals,
|
|
@@ -179,7 +179,7 @@ import {
|
|
|
179
179
|
recordHiveKnowledgeEvent,
|
|
180
180
|
recordKnowledgeEvent,
|
|
181
181
|
resolveKnowledgeEventsPath
|
|
182
|
-
} from "./index-
|
|
182
|
+
} from "./index-gbnpz7rh.js";
|
|
183
183
|
import {
|
|
184
184
|
resolveHiveDataDir,
|
|
185
185
|
resolveHiveEventsPath,
|
|
@@ -201,7 +201,7 @@ import {
|
|
|
201
201
|
init_loader,
|
|
202
202
|
loadPluginConfig,
|
|
203
203
|
loadPluginConfigWithMeta
|
|
204
|
-
} from "./index-
|
|
204
|
+
} from "./index-74xejn4v.js";
|
|
205
205
|
import {
|
|
206
206
|
RetrospectiveEvidenceSchema
|
|
207
207
|
} from "./index-k5jrywpr.js";
|
|
@@ -220,7 +220,7 @@ import {
|
|
|
220
220
|
init_schema,
|
|
221
221
|
init_tool_metadata,
|
|
222
222
|
stripKnownSwarmPrefix
|
|
223
|
-
} from "./index-
|
|
223
|
+
} from "./index-r1gdkn2d.js";
|
|
224
224
|
import {
|
|
225
225
|
KNOWLEDGE_SCHEMA_VERSION,
|
|
226
226
|
OUTCOME_BLOCK_THRESHOLD,
|
|
@@ -251,6 +251,9 @@ import {
|
|
|
251
251
|
getDeferredWarnings,
|
|
252
252
|
init_warning_buffer
|
|
253
253
|
} from "./index-4rhhvd1a.js";
|
|
254
|
+
import {
|
|
255
|
+
readDelegations
|
|
256
|
+
} from "./index-0cz1ws47.js";
|
|
254
257
|
import {
|
|
255
258
|
readSwarmFileAsync,
|
|
256
259
|
safeHook,
|
|
@@ -5449,6 +5452,60 @@ async function readPrWorkflowGateState(directory, sessionID) {
|
|
|
5449
5452
|
}
|
|
5450
5453
|
return state;
|
|
5451
5454
|
}
|
|
5455
|
+
async function clearPrWorkflowGateState(directory, sessionID, expectedRevision) {
|
|
5456
|
+
const normalizedSessionID = normalizeSessionID(sessionID);
|
|
5457
|
+
await withSessionStateMutation(directory, normalizedSessionID, async () => {
|
|
5458
|
+
const current = await readPrWorkflowGateStateFromDisk(directory, normalizedSessionID);
|
|
5459
|
+
if (expectedRevision !== undefined && (!current || current.revision !== expectedRevision)) {
|
|
5460
|
+
throw new Error("BLOCKED: PR workflow gate state changed during terminal completion; revalidate the current session state before retrying");
|
|
5461
|
+
}
|
|
5462
|
+
try {
|
|
5463
|
+
await fsp.rm(workflowGateStatePath(directory, normalizedSessionID), {
|
|
5464
|
+
force: true
|
|
5465
|
+
});
|
|
5466
|
+
} catch (error2) {
|
|
5467
|
+
if (error2.code !== "ENOENT") {
|
|
5468
|
+
throw error2;
|
|
5469
|
+
}
|
|
5470
|
+
}
|
|
5471
|
+
trackedStatesByProjectSession.delete(stateCacheKey(directory, normalizedSessionID));
|
|
5472
|
+
});
|
|
5473
|
+
}
|
|
5474
|
+
async function abortPrWorkflow(directory, sessionID, options = {}) {
|
|
5475
|
+
const state = await requireAnyActiveState(directory, sessionID);
|
|
5476
|
+
if (options.expectedMode && state.mode !== options.expectedMode) {
|
|
5477
|
+
throw wrongModeError(state, options.expectedMode);
|
|
5478
|
+
}
|
|
5479
|
+
if (state.prFeedbackReadyToPublish) {
|
|
5480
|
+
throw new Error(`BLOCKED: ${state.mode} is armed for publication; abort is blocked. Complete the workflow with complete_pr_workflow (or push the bound commit first) before aborting.`);
|
|
5481
|
+
}
|
|
5482
|
+
const openLanes = readDelegations(directory).filter((record) => record.parentSessionId === state.sessionID && record.mode?.startsWith("swarm-pr-") && (record.status === "pending" || record.status === "running"));
|
|
5483
|
+
if (openLanes.length > 0) {
|
|
5484
|
+
const laneIds = openLanes.map((record) => record.laneId ?? record.subagentSessionId ?? "unknown").filter(Boolean).slice(0, 10).join(", ");
|
|
5485
|
+
throw new Error(`BLOCKED: ${state.mode} abort refused while ${openLanes.length} PR workflow lane(s) are still in flight (lane ids: ${laneIds}). Collect their results or let them settle before aborting.`);
|
|
5486
|
+
}
|
|
5487
|
+
const sanitizedReason = typeof options.reason === "string" ? options.reason.trim().slice(0, 500) : undefined;
|
|
5488
|
+
const abortEvent = {
|
|
5489
|
+
type: "pr_workflow_aborted",
|
|
5490
|
+
timestamp: isoNow(),
|
|
5491
|
+
sessionID: state.sessionID,
|
|
5492
|
+
mode: state.mode,
|
|
5493
|
+
...state.prHeadSha ? { prHeadSha: state.prHeadSha } : {},
|
|
5494
|
+
openLanes: openLanes.length,
|
|
5495
|
+
...sanitizedReason ? { reason: sanitizedReason } : {}
|
|
5496
|
+
};
|
|
5497
|
+
try {
|
|
5498
|
+
const eventsPath = validateSwarmPath(directory, "events.jsonl");
|
|
5499
|
+
await fsp.appendFile(eventsPath, `${JSON.stringify(abortEvent)}
|
|
5500
|
+
`, "utf-8");
|
|
5501
|
+
} catch {}
|
|
5502
|
+
await clearPrWorkflowGateState(directory, sessionID, state.revision);
|
|
5503
|
+
return {
|
|
5504
|
+
mode: state.mode,
|
|
5505
|
+
...state.prHeadSha ? { prHeadSha: state.prHeadSha } : {},
|
|
5506
|
+
openLanes: openLanes.length
|
|
5507
|
+
};
|
|
5508
|
+
}
|
|
5452
5509
|
async function bindPrWorkflowHead(directory, sessionID, prHeadSha) {
|
|
5453
5510
|
const state = await requireAnyActiveState(directory, sessionID);
|
|
5454
5511
|
const normalizedHead = normalizePrHeadSha(prHeadSha);
|
|
@@ -5513,7 +5570,11 @@ async function requireAnyActiveState(directory, sessionID) {
|
|
|
5513
5570
|
}
|
|
5514
5571
|
return state;
|
|
5515
5572
|
}
|
|
5573
|
+
function wrongModeError(state, expectedMode) {
|
|
5574
|
+
return new Error(`BLOCKED: session "${state.sessionID}" is active in ${state.mode}, not ${expectedMode}`);
|
|
5575
|
+
}
|
|
5516
5576
|
var PR_WORKFLOW_CONTROLLER_TOOLS = new Set([
|
|
5577
|
+
"abort_pr_workflow",
|
|
5517
5578
|
"collect_lane_results",
|
|
5518
5579
|
"complete_pr_workflow",
|
|
5519
5580
|
"dispatch_lanes_async",
|
|
@@ -5856,6 +5917,55 @@ function delay(ms) {
|
|
|
5856
5917
|
// src/commands/registry.ts
|
|
5857
5918
|
init_logger();
|
|
5858
5919
|
|
|
5920
|
+
// src/commands/abort-pr-workflow.ts
|
|
5921
|
+
var USAGE = [
|
|
5922
|
+
"Usage: /swarm abort-pr-workflow [PR_REVIEW|PR_FEEDBACK] [reason...]",
|
|
5923
|
+
"",
|
|
5924
|
+
"Clear an active PR_REVIEW or PR_FEEDBACK mechanical gate for the current session",
|
|
5925
|
+
"and stop the auto-resume loop. Use when a PR review or feedback workflow is stuck",
|
|
5926
|
+
"(e.g. the working tree cannot reach the PR head, a compound shell command was",
|
|
5927
|
+
"rejected, or the wake budget is suspended).",
|
|
5928
|
+
"",
|
|
5929
|
+
"Arguments:",
|
|
5930
|
+
" mode Optional: PR_REVIEW or PR_FEEDBACK. If omitted, aborts whichever is active.",
|
|
5931
|
+
" reason Optional free-text reason (recorded to .swarm/events.jsonl).",
|
|
5932
|
+
"",
|
|
5933
|
+
"Refuses while the workflow is armed for publication (call complete_pr_workflow",
|
|
5934
|
+
"instead) or while PR workflow lanes are still in flight (collect their results first)."
|
|
5935
|
+
].join(`
|
|
5936
|
+
`);
|
|
5937
|
+
var KNOWN_MODES = new Set(["PR_REVIEW", "PR_FEEDBACK"]);
|
|
5938
|
+
async function handleAbortPrWorkflowCommand(directory, args, sessionID) {
|
|
5939
|
+
const tokens = (args ?? []).filter((token) => token.trim().length > 0);
|
|
5940
|
+
const modeToken = tokens[0]?.toUpperCase();
|
|
5941
|
+
const knownMode = modeToken && KNOWN_MODES.has(modeToken) ? modeToken : undefined;
|
|
5942
|
+
const reasonStartIndex = knownMode ? 1 : 0;
|
|
5943
|
+
const reason = tokens.slice(reasonStartIndex).join(" ").trim().slice(0, 500) || undefined;
|
|
5944
|
+
if (modeToken && !knownMode) {
|
|
5945
|
+
return `Error: Unknown mode "${modeToken}". Expected PR_REVIEW or PR_FEEDBACK.
|
|
5946
|
+
|
|
5947
|
+
${USAGE}`;
|
|
5948
|
+
}
|
|
5949
|
+
if (!sessionID?.trim()) {
|
|
5950
|
+
return `Error: abort-pr-workflow requires an active sessionID.
|
|
5951
|
+
|
|
5952
|
+
${USAGE}`;
|
|
5953
|
+
}
|
|
5954
|
+
try {
|
|
5955
|
+
const summary = await abortPrWorkflow(directory, sessionID, {
|
|
5956
|
+
...knownMode ? { expectedMode: knownMode } : {},
|
|
5957
|
+
...reason ? { reason } : {}
|
|
5958
|
+
});
|
|
5959
|
+
const headLine = summary.prHeadSha ? ` (was bound to PR head ${summary.prHeadSha})` : " (was not bound to a PR head)";
|
|
5960
|
+
return `Aborted active ${summary.mode} mechanical gate for session ${sessionID}${headLine}. The durable gate state has been cleared and the auto-resume loop will stop. An audit event was appended to .swarm/events.jsonl.`;
|
|
5961
|
+
} catch (error2) {
|
|
5962
|
+
const message = error2 instanceof Error ? error2.message : String(error2);
|
|
5963
|
+
return `Error: ${message}
|
|
5964
|
+
|
|
5965
|
+
${USAGE}`;
|
|
5966
|
+
}
|
|
5967
|
+
}
|
|
5968
|
+
|
|
5859
5969
|
// src/commands/acknowledge-spec-drift.ts
|
|
5860
5970
|
import { promises as fsPromises } from "fs";
|
|
5861
5971
|
import * as path10 from "path";
|
|
@@ -7916,7 +8026,7 @@ function resolvePrCommandInput(rest, cwd) {
|
|
|
7916
8026
|
}
|
|
7917
8027
|
|
|
7918
8028
|
// src/commands/ci-monitor.ts
|
|
7919
|
-
var
|
|
8029
|
+
var USAGE2 = [
|
|
7920
8030
|
"Usage: /swarm ci-monitor <pr-url|owner/repo#N|N>",
|
|
7921
8031
|
"",
|
|
7922
8032
|
"Drive an already human-reviewed, approved pull request to green and",
|
|
@@ -7933,17 +8043,17 @@ function handleCiMonitorCommand(directory, args) {
|
|
|
7933
8043
|
const rest = args.filter((token) => token.trim().length > 0);
|
|
7934
8044
|
const resolved = resolvePrCommandInput(rest, directory);
|
|
7935
8045
|
if (resolved === null) {
|
|
7936
|
-
return
|
|
8046
|
+
return USAGE2;
|
|
7937
8047
|
}
|
|
7938
8048
|
if ("error" in resolved) {
|
|
7939
8049
|
return `Error: ${resolved.error}
|
|
7940
8050
|
|
|
7941
|
-
${
|
|
8051
|
+
${USAGE2}`;
|
|
7942
8052
|
}
|
|
7943
8053
|
if (resolved.instructions) {
|
|
7944
8054
|
return `Error: /swarm ci-monitor takes only a PR reference \u2014 no trailing instructions. Got: "${resolved.instructions}"
|
|
7945
8055
|
|
|
7946
|
-
${
|
|
8056
|
+
${USAGE2}`;
|
|
7947
8057
|
}
|
|
7948
8058
|
return `[MODE: CI_MONITOR pr="${resolved.prUrl}"]`;
|
|
7949
8059
|
}
|
|
@@ -10815,7 +10925,7 @@ async function runCuratorPhase(directory, phase, agentsDispatched, config, knowl
|
|
|
10815
10925
|
}
|
|
10816
10926
|
if (config.skill_generation_enabled === true && skillCandidates.length > 0) {
|
|
10817
10927
|
try {
|
|
10818
|
-
const skillModule = await import("./skill-generator-
|
|
10928
|
+
const skillModule = await import("./skill-generator-a7xfyddq.js");
|
|
10819
10929
|
for (const cand of skillCandidates) {
|
|
10820
10930
|
if (cand.confidence < (config.min_skill_confidence ?? DEFAULT_SKILL_MIN_CONFIDENCE)) {
|
|
10821
10931
|
continue;
|
|
@@ -11152,7 +11262,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
|
|
|
11152
11262
|
} catch {}
|
|
11153
11263
|
}
|
|
11154
11264
|
if (contradictedEntries.length > 0 && knowledgeConfig.contradiction_threshold_action === "quarantine") {
|
|
11155
|
-
const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-
|
|
11265
|
+
const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-h3hg7ek7.js");
|
|
11156
11266
|
for (const { id } of contradictedEntries) {
|
|
11157
11267
|
try {
|
|
11158
11268
|
await maybeQuarantineOnContradiction(directory, id, knowledgeConfig.contradiction_quarantine_threshold, knowledgeConfig.contradiction_quarantine_window_days);
|
|
@@ -11951,7 +12061,7 @@ async function runCuratorPostMortem(directory, options = {}) {
|
|
|
11951
12061
|
warnings.push("Failed to collect knowledge summary.");
|
|
11952
12062
|
}
|
|
11953
12063
|
try {
|
|
11954
|
-
const { getScanStatus } = await import("./scan-cursor-
|
|
12064
|
+
const { getScanStatus } = await import("./scan-cursor-r0w2p5gz.js");
|
|
11955
12065
|
const scanStatus = await getScanStatus(directory);
|
|
11956
12066
|
if (scanStatus.remaining_estimate > 0) {
|
|
11957
12067
|
warnings.push(`Fair scan: reviewed ${knowledgeSummary.length} entries this sweep (generation ${scanStatus.generation}); ${scanStatus.remaining_estimate} more eligible entries will be visited in future curation sweeps.`);
|
|
@@ -12123,9 +12233,9 @@ var _internals15 = {
|
|
|
12123
12233
|
verifyPostMortemKnowledgeActions,
|
|
12124
12234
|
repairPostMortemActions,
|
|
12125
12235
|
loadDefaultKnowledgeConfig: async (directory) => {
|
|
12126
|
-
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-
|
|
12236
|
+
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-69z8w1ka.js");
|
|
12127
12237
|
try {
|
|
12128
|
-
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-
|
|
12238
|
+
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-4b1e5m0d.js");
|
|
12129
12239
|
const loaded = loadPluginConfigWithMeta2(directory);
|
|
12130
12240
|
return KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
|
|
12131
12241
|
} catch {
|
|
@@ -12133,11 +12243,11 @@ var _internals15 = {
|
|
|
12133
12243
|
}
|
|
12134
12244
|
},
|
|
12135
12245
|
applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig, generation) => {
|
|
12136
|
-
const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-
|
|
12246
|
+
const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-gke6nrc4.js");
|
|
12137
12247
|
return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig, generation);
|
|
12138
12248
|
},
|
|
12139
12249
|
checkHivePromotions: async (entries, knowledgeConfig, directory) => {
|
|
12140
|
-
const { checkHivePromotions } = await import("./hive-promoter-
|
|
12250
|
+
const { checkHivePromotions } = await import("./hive-promoter-6fg3redm.js");
|
|
12141
12251
|
return checkHivePromotions(entries, knowledgeConfig, directory);
|
|
12142
12252
|
},
|
|
12143
12253
|
applyProposalTriage: async (directory, triage) => {
|
|
@@ -12146,7 +12256,7 @@ var _internals15 = {
|
|
|
12146
12256
|
activateProposal,
|
|
12147
12257
|
listSkills: listSkills2,
|
|
12148
12258
|
sanitizeSlug
|
|
12149
|
-
} = await import("./skill-generator-
|
|
12259
|
+
} = await import("./skill-generator-a7xfyddq.js");
|
|
12150
12260
|
const result = {
|
|
12151
12261
|
approved: [],
|
|
12152
12262
|
rejected: [],
|
|
@@ -12279,7 +12389,7 @@ function failedGateNames(decision) {
|
|
|
12279
12389
|
|
|
12280
12390
|
// src/hooks/hive-transaction.ts
|
|
12281
12391
|
var import_proper_lockfile2 = __toESM(require_proper_lockfile(), 1);
|
|
12282
|
-
import { appendFile as
|
|
12392
|
+
import { appendFile as appendFile3, mkdir as mkdir7 } from "fs/promises";
|
|
12283
12393
|
import * as path22 from "path";
|
|
12284
12394
|
init_logger();
|
|
12285
12395
|
var HIVE_LOCK_STALE_MS = 5000;
|
|
@@ -12340,13 +12450,13 @@ async function transactHiveStore(mutate) {
|
|
|
12340
12450
|
const rejectBlock = `${outcome.rejects.map((r) => JSON.stringify(r)).join(`
|
|
12341
12451
|
`)}
|
|
12342
12452
|
`;
|
|
12343
|
-
await
|
|
12453
|
+
await appendFile3(rejectedPath, rejectBlock, "utf-8");
|
|
12344
12454
|
}
|
|
12345
12455
|
if (outcome.audit && outcome.audit.length > 0) {
|
|
12346
12456
|
const auditBlock = `${outcome.audit.map((a) => a.line).join(`
|
|
12347
12457
|
`)}
|
|
12348
12458
|
`;
|
|
12349
|
-
await
|
|
12459
|
+
await appendFile3(eventsPath, auditBlock, "utf-8");
|
|
12350
12460
|
try {
|
|
12351
12461
|
await trimHiveEventsUnderLock(eventsPath);
|
|
12352
12462
|
} catch (err) {
|
|
@@ -12394,7 +12504,7 @@ init_knowledge_types();
|
|
|
12394
12504
|
|
|
12395
12505
|
// src/hooks/promotion-evidence-store.ts
|
|
12396
12506
|
import {
|
|
12397
|
-
appendFile as
|
|
12507
|
+
appendFile as appendFile4,
|
|
12398
12508
|
mkdir as mkdir8,
|
|
12399
12509
|
readFile as readFile7,
|
|
12400
12510
|
rename as rename5,
|
|
@@ -13102,7 +13212,7 @@ async function promoteFromSwarm(directory, lessonId, options, config) {
|
|
|
13102
13212
|
import { createHash as createHash7 } from "crypto";
|
|
13103
13213
|
import { existsSync as existsSync15 } from "fs";
|
|
13104
13214
|
import {
|
|
13105
|
-
appendFile as
|
|
13215
|
+
appendFile as appendFile5,
|
|
13106
13216
|
mkdir as mkdir10,
|
|
13107
13217
|
readFile as readFile10,
|
|
13108
13218
|
realpath,
|
|
@@ -14671,9 +14781,9 @@ function hashContent(content) {
|
|
|
14671
14781
|
return createHash7("sha1").update(content).digest("hex");
|
|
14672
14782
|
}
|
|
14673
14783
|
async function loadConfigForPolicyCurator(directory) {
|
|
14674
|
-
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-
|
|
14784
|
+
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-69z8w1ka.js");
|
|
14675
14785
|
try {
|
|
14676
|
-
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-
|
|
14786
|
+
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-4b1e5m0d.js");
|
|
14677
14787
|
const { config: loadedConfig } = loadPluginConfigWithMeta2(directory);
|
|
14678
14788
|
return KnowledgeConfigSchema2.parse(loadedConfig.knowledge ?? {});
|
|
14679
14789
|
} catch {
|
|
@@ -15153,7 +15263,7 @@ async function appendCuratorSkippedEvent(directory, record) {
|
|
|
15153
15263
|
try {
|
|
15154
15264
|
const filePath = path28.join(directory, ".swarm", "events.jsonl");
|
|
15155
15265
|
await mkdir10(path28.dirname(filePath), { recursive: true });
|
|
15156
|
-
await
|
|
15266
|
+
await appendFile5(filePath, `${JSON.stringify({
|
|
15157
15267
|
timestamp: new Date().toISOString(),
|
|
15158
15268
|
event: "curator_skipped",
|
|
15159
15269
|
entry_id: record.entry_id,
|
|
@@ -17834,7 +17944,7 @@ async function runFinalizeStage(ctx) {
|
|
|
17834
17944
|
}
|
|
17835
17945
|
}
|
|
17836
17946
|
try {
|
|
17837
|
-
const { CuratorConfigSchema: CCS } = await import("./schema-
|
|
17947
|
+
const { CuratorConfigSchema: CCS } = await import("./schema-69z8w1ka.js");
|
|
17838
17948
|
const { config: pmLoadedConfig } = _internals24.loadPluginConfigWithMeta(ctx.directory);
|
|
17839
17949
|
const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
|
|
17840
17950
|
if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
|
|
@@ -18674,7 +18784,7 @@ var MODES = new Set(CODEBASE_REVIEW_MODES);
|
|
|
18674
18784
|
var DEFAULT_MODE = "phase0";
|
|
18675
18785
|
var DEFAULT_SCOPE = "repository root";
|
|
18676
18786
|
var FLAG_VALUE_MISSING = (token) => `Flag "${token}" requires a value`;
|
|
18677
|
-
var
|
|
18787
|
+
var USAGE3 = `Usage: /swarm codebase-review [scope] [--mode phase0|complete|defect|security|correctness|testing|ui|performance|ai-slop|enhancements|custom] [--tracks <list>] [--continue <run-id>] [--json] [--skip-update] [--allow-dirty]
|
|
18678
18788
|
|
|
18679
18789
|
Run the codebase-review-swarm workflow in the current repository.
|
|
18680
18790
|
|
|
@@ -18767,12 +18877,12 @@ function parseArgs(args) {
|
|
|
18767
18877
|
async function handleCodebaseReviewCommand(_directory, args) {
|
|
18768
18878
|
const parsed = parseArgs(args);
|
|
18769
18879
|
if (parsed.help) {
|
|
18770
|
-
return
|
|
18880
|
+
return USAGE3;
|
|
18771
18881
|
}
|
|
18772
18882
|
if (parsed.error) {
|
|
18773
18883
|
return `Error: ${parsed.error}
|
|
18774
18884
|
|
|
18775
|
-
${
|
|
18885
|
+
${USAGE3}`;
|
|
18776
18886
|
}
|
|
18777
18887
|
const scope = sanitizeText(parsed.rest.join(" "), MAX_SCOPE_LEN) || DEFAULT_SCOPE;
|
|
18778
18888
|
return [
|
|
@@ -19190,7 +19300,7 @@ function parseArgs2(args) {
|
|
|
19190
19300
|
}
|
|
19191
19301
|
return out;
|
|
19192
19302
|
}
|
|
19193
|
-
var
|
|
19303
|
+
var USAGE4 = [
|
|
19194
19304
|
"Usage: /swarm council <question> [--spec-review]",
|
|
19195
19305
|
"",
|
|
19196
19306
|
" question The question to put to the council",
|
|
@@ -19203,7 +19313,7 @@ async function handleCouncilCommand(_directory, args) {
|
|
|
19203
19313
|
const parsed = parseArgs2(args);
|
|
19204
19314
|
const question = sanitizeQuestion(parsed.rest.join(" "));
|
|
19205
19315
|
if (!question) {
|
|
19206
|
-
return
|
|
19316
|
+
return USAGE4;
|
|
19207
19317
|
}
|
|
19208
19318
|
const tokens = ["MODE: COUNCIL"];
|
|
19209
19319
|
if (parsed.preset) {
|
|
@@ -20003,9 +20113,9 @@ var _internals28 = {
|
|
|
20003
20113
|
readSwarmFileAsync,
|
|
20004
20114
|
loadCuratorDeps: async () => {
|
|
20005
20115
|
const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate: createCuratorLLMDelegate2 }] = await Promise.all([
|
|
20006
|
-
import("./schema-
|
|
20007
|
-
import("./curator-
|
|
20008
|
-
import("./curator-llm-factory-
|
|
20116
|
+
import("./schema-69z8w1ka.js"),
|
|
20117
|
+
import("./curator-gke6nrc4.js"),
|
|
20118
|
+
import("./curator-llm-factory-40c4852v.js")
|
|
20009
20119
|
]);
|
|
20010
20120
|
return { CuratorConfigSchema, curator, createCuratorLLMDelegate: createCuratorLLMDelegate2 };
|
|
20011
20121
|
}
|
|
@@ -20161,7 +20271,7 @@ var PROFILES = new Set([
|
|
|
20161
20271
|
var DEFAULT_PROFILE = "standard";
|
|
20162
20272
|
var DEFAULT_MAX_EXPLORERS = 6;
|
|
20163
20273
|
var FULL_PROFILE_DEFAULT_MAX_EXPLORERS = 8;
|
|
20164
|
-
var
|
|
20274
|
+
var USAGE5 = `Usage: /swarm deep-dive <scope> [--profile standard|security|ux|architecture|full] [--max-explorers N] [--json] [--skip-update] [--allow-dirty]
|
|
20165
20275
|
|
|
20166
20276
|
Run a bounded, evidence-backed deep dive on an application section.
|
|
20167
20277
|
|
|
@@ -20250,11 +20360,11 @@ async function handleDeepDiveCommand(_directory, args) {
|
|
|
20250
20360
|
if (parsed.error) {
|
|
20251
20361
|
return `Error: ${parsed.error}
|
|
20252
20362
|
|
|
20253
|
-
${
|
|
20363
|
+
${USAGE5}`;
|
|
20254
20364
|
}
|
|
20255
20365
|
const scope = sanitizeScope(parsed.rest.join(" "));
|
|
20256
20366
|
if (!scope) {
|
|
20257
|
-
return
|
|
20367
|
+
return USAGE5;
|
|
20258
20368
|
}
|
|
20259
20369
|
if (parsed.profile === "full" && !parsed.maxExplorersExplicit) {
|
|
20260
20370
|
parsed.maxExplorers = FULL_PROFILE_DEFAULT_MAX_EXPLORERS;
|
|
@@ -20271,7 +20381,7 @@ var DEFAULT_MAX_RESEARCHERS = 3;
|
|
|
20271
20381
|
var EXHAUSTIVE_DEFAULT_MAX_RESEARCHERS = 5;
|
|
20272
20382
|
var DEFAULT_ROUNDS = 2;
|
|
20273
20383
|
var EXHAUSTIVE_DEFAULT_ROUNDS = 3;
|
|
20274
|
-
var
|
|
20384
|
+
var USAGE6 = `Usage: /swarm deep-research <question> [--depth standard|exhaustive] [--max-researchers 1..6] [--rounds 1..4] [--brief]
|
|
20275
20385
|
|
|
20276
20386
|
Run a multi-source, fact-checked deep research pass and synthesize a cited report.
|
|
20277
20387
|
|
|
@@ -20365,11 +20475,11 @@ async function handleDeepResearchCommand(_directory, args) {
|
|
|
20365
20475
|
if (parsed.error) {
|
|
20366
20476
|
return `Error: ${parsed.error}
|
|
20367
20477
|
|
|
20368
|
-
${
|
|
20478
|
+
${USAGE6}`;
|
|
20369
20479
|
}
|
|
20370
20480
|
const question = sanitizeQuestion2(parsed.rest.join(" "));
|
|
20371
20481
|
if (!question) {
|
|
20372
|
-
return
|
|
20482
|
+
return USAGE6;
|
|
20373
20483
|
}
|
|
20374
20484
|
if (parsed.depth === "exhaustive") {
|
|
20375
20485
|
if (!parsed.maxResearchersExplicit)
|
|
@@ -20384,7 +20494,7 @@ ${USAGE5}`;
|
|
|
20384
20494
|
init_warning_buffer();
|
|
20385
20495
|
var MAX_DESC_LEN = 2000;
|
|
20386
20496
|
var _internals29 = { loadPluginConfigWithMeta };
|
|
20387
|
-
var
|
|
20497
|
+
var USAGE7 = `Usage: /swarm design-docs <description> [--out <dir>] [--lang <name>] [--update]
|
|
20388
20498
|
|
|
20389
20499
|
Generate or sync language-agnostic design docs for the project under build:
|
|
20390
20500
|
<out>/domain.md, <out>/technical-spec.md, <out>/behavior-spec.md,
|
|
@@ -20476,21 +20586,21 @@ async function handleDesignDocsCommand(directory, args) {
|
|
|
20476
20586
|
if (parsed.error) {
|
|
20477
20587
|
return `Error: ${parsed.error}
|
|
20478
20588
|
|
|
20479
|
-
${
|
|
20589
|
+
${USAGE7}`;
|
|
20480
20590
|
}
|
|
20481
20591
|
try {
|
|
20482
20592
|
const { config } = _internals29.loadPluginConfigWithMeta(directory);
|
|
20483
20593
|
if (config.design_docs?.enabled !== true) {
|
|
20484
20594
|
return "Error: design docs are disabled. Set `design_docs.enabled: true` in " + `opencode-swarm.json to enable the docs_design agent and this command.
|
|
20485
20595
|
|
|
20486
|
-
` +
|
|
20596
|
+
` + USAGE7;
|
|
20487
20597
|
}
|
|
20488
20598
|
} catch (configErr) {
|
|
20489
20599
|
advisoryWarn(`[design-docs] Could not read opencode-swarm.json (${String(configErr)}). ` + "Falling through \u2014 the architect will abort if docs_design is not registered.");
|
|
20490
20600
|
}
|
|
20491
20601
|
const description = sanitizeDescription(parsed.rest.join(" "));
|
|
20492
20602
|
if (!description && !parsed.update) {
|
|
20493
|
-
return
|
|
20603
|
+
return USAGE7;
|
|
20494
20604
|
}
|
|
20495
20605
|
const header = `[MODE: DESIGN_DOCS out=${parsed.out} lang=${parsed.lang} update=${parsed.update}] ${description}`;
|
|
20496
20606
|
return header.trimEnd();
|
|
@@ -20504,7 +20614,7 @@ import { fileURLToPath } from "url";
|
|
|
20504
20614
|
// package.json
|
|
20505
20615
|
var package_default = {
|
|
20506
20616
|
name: "opencode-swarm",
|
|
20507
|
-
version: "7.125.
|
|
20617
|
+
version: "7.125.6",
|
|
20508
20618
|
description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
|
|
20509
20619
|
main: "dist/index.js",
|
|
20510
20620
|
types: "dist/index.d.ts",
|
|
@@ -21025,7 +21135,7 @@ async function computeCurationDiagnostics(directory, entries) {
|
|
|
21025
21135
|
let scanCompleted = false;
|
|
21026
21136
|
let scanRemaining = 0;
|
|
21027
21137
|
try {
|
|
21028
|
-
const { getScanStatus } = await import("./scan-cursor-
|
|
21138
|
+
const { getScanStatus } = await import("./scan-cursor-r0w2p5gz.js");
|
|
21029
21139
|
const status = await getScanStatus(directory);
|
|
21030
21140
|
scanGeneration = status.generation;
|
|
21031
21141
|
scanCompleted = status.completed;
|
|
@@ -21035,17 +21145,17 @@ async function computeCurationDiagnostics(directory, entries) {
|
|
|
21035
21145
|
try {
|
|
21036
21146
|
const { isLinked: isLinked2 } = await import("./knowledge-link-4yd2z8ev.js");
|
|
21037
21147
|
if (isLinked2(directory)) {
|
|
21038
|
-
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-
|
|
21148
|
+
const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-69z8w1ka.js");
|
|
21039
21149
|
let config;
|
|
21040
21150
|
try {
|
|
21041
|
-
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-
|
|
21151
|
+
const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-4b1e5m0d.js");
|
|
21042
21152
|
const loaded = loadPluginConfigWithMeta2(directory);
|
|
21043
21153
|
config = KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
|
|
21044
21154
|
} catch {
|
|
21045
21155
|
config = KnowledgeConfigSchema2.parse({});
|
|
21046
21156
|
}
|
|
21047
21157
|
const { cohortConfigFingerprint: cohortConfigFingerprint2 } = await import("./config-fingerprint-v22xh5a2.js");
|
|
21048
|
-
const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-
|
|
21158
|
+
const { buildConfigFingerprintInput: buildConfigFingerprintInput2, readCohortConfigFingerprint } = await import("./curation-policy-62w2pwfz.js");
|
|
21049
21159
|
const currentFp = cohortConfigFingerprint2(buildConfigFingerprintInput2(config));
|
|
21050
21160
|
const cohortFp = await readCohortConfigFingerprint(directory);
|
|
21051
21161
|
configMatch = cohortFp === null ? null : currentFp === cohortFp;
|
|
@@ -22233,7 +22343,7 @@ async function handleDoctorCommand(directory, args) {
|
|
|
22233
22343
|
const result = runConfigDoctor(config, directory);
|
|
22234
22344
|
let output;
|
|
22235
22345
|
if (enableAutoFix && result.hasAutoFixableIssues) {
|
|
22236
|
-
const { runConfigDoctorWithFixes } = await import("./config-doctor-
|
|
22346
|
+
const { runConfigDoctorWithFixes } = await import("./config-doctor-akxywx0c.js");
|
|
22237
22347
|
const fixResult = await runConfigDoctorWithFixes(directory, config, true, {
|
|
22238
22348
|
applyLossy: true
|
|
22239
22349
|
});
|
|
@@ -28827,7 +28937,7 @@ async function handleHistoryCommand(directory, _args) {
|
|
|
28827
28937
|
// src/commands/issue.ts
|
|
28828
28938
|
import * as fs24 from "fs";
|
|
28829
28939
|
import * as path56 from "path";
|
|
28830
|
-
var
|
|
28940
|
+
var USAGE8 = [
|
|
28831
28941
|
"Usage: /swarm issue <url|owner/repo#N|N> [--plan] [--trace] [--no-repro]",
|
|
28832
28942
|
"",
|
|
28833
28943
|
"Ingest a GitHub issue into the swarm workflow.",
|
|
@@ -28944,21 +29054,21 @@ function handleIssueCommand(directory, args) {
|
|
|
28944
29054
|
const parsed = parseArgs8(args);
|
|
28945
29055
|
const rawInput = parsed.rest.join(" ").trim();
|
|
28946
29056
|
if (!rawInput) {
|
|
28947
|
-
return
|
|
29057
|
+
return USAGE8;
|
|
28948
29058
|
}
|
|
28949
29059
|
const isFullUrl = /^https?:\/\//i.test(rawInput);
|
|
28950
29060
|
const issueInfo = parseIssueRef(isFullUrl ? sanitizeUrl(rawInput) : rawInput, directory);
|
|
28951
29061
|
if (!issueInfo) {
|
|
28952
29062
|
return `Error: Could not parse issue reference from "${sanitizeErrorEcho(rawInput)}"
|
|
28953
29063
|
|
|
28954
|
-
${
|
|
29064
|
+
${USAGE8}`;
|
|
28955
29065
|
}
|
|
28956
29066
|
const issueUrl = `https://github.com/${issueInfo.owner}/${issueInfo.repo}/issues/${issueInfo.number}`;
|
|
28957
29067
|
const result = validateAndSanitizeUrl2(issueUrl);
|
|
28958
29068
|
if ("error" in result) {
|
|
28959
29069
|
return `Error: ${result.error}
|
|
28960
29070
|
|
|
28961
|
-
${
|
|
29071
|
+
${USAGE8}`;
|
|
28962
29072
|
}
|
|
28963
29073
|
const swarmDir = path56.join(directory, ".swarm");
|
|
28964
29074
|
const issueReference = {
|
|
@@ -29009,7 +29119,7 @@ ${USAGE7}`;
|
|
|
29009
29119
|
const errMsg = e instanceof Error ? e.message : String(e);
|
|
29010
29120
|
return `Error: Failed to persist issue reference durably: ${errMsg}
|
|
29011
29121
|
|
|
29012
|
-
${
|
|
29122
|
+
${USAGE8}`;
|
|
29013
29123
|
}
|
|
29014
29124
|
const flags = [];
|
|
29015
29125
|
if (parsed.plan)
|
|
@@ -30534,7 +30644,7 @@ async function readLatestLoopState(directory) {
|
|
|
30534
30644
|
var _internals45 = {
|
|
30535
30645
|
readLatestLoopState
|
|
30536
30646
|
};
|
|
30537
|
-
var
|
|
30647
|
+
var USAGE9 = `Usage: /swarm loop <objective> [--max-cycles 1..5] [--autonomy checkpoint|auto] [--depth standard|exhaustive] [--resume]
|
|
30538
30648
|
|
|
30539
30649
|
Run a compound-engineering loop: brainstorm \u2192 plan \u2192 build \u2192 review \u2192 improve,
|
|
30540
30650
|
iterating until the objective is met or a budget stop condition fires.
|
|
@@ -30636,11 +30746,11 @@ async function handleLoopCommand(_directory, args) {
|
|
|
30636
30746
|
if (parsed.error) {
|
|
30637
30747
|
return `Error: ${parsed.error}
|
|
30638
30748
|
|
|
30639
|
-
${
|
|
30749
|
+
${USAGE9}`;
|
|
30640
30750
|
}
|
|
30641
30751
|
const objective = sanitizeObjective(parsed.rest.join(" "));
|
|
30642
30752
|
if (!objective && !parsed.resume) {
|
|
30643
|
-
return
|
|
30753
|
+
return USAGE9;
|
|
30644
30754
|
}
|
|
30645
30755
|
let autonomy = parsed.autonomy;
|
|
30646
30756
|
if (parsed.resume && !parsed.autonomyExplicit) {
|
|
@@ -31022,7 +31132,7 @@ var CuratorOutputMemoryDecisionSchema = exports_external.object({
|
|
|
31022
31132
|
// src/memory/injector.ts
|
|
31023
31133
|
init_schema();
|
|
31024
31134
|
// src/memory/consolidation-log.ts
|
|
31025
|
-
import { appendFile as
|
|
31135
|
+
import { appendFile as appendFile6, mkdir as mkdir17, readFile as readFile17 } from "fs/promises";
|
|
31026
31136
|
import * as path61 from "path";
|
|
31027
31137
|
var LOG_RELATIVE_PATH = path61.join("memory", "consolidation-log.jsonl");
|
|
31028
31138
|
var LOG_BASENAME = "consolidation-log.jsonl";
|
|
@@ -32502,7 +32612,7 @@ async function handlePrMonitorStatusCommand(directory, _args, sessionID, source)
|
|
|
32502
32612
|
}
|
|
32503
32613
|
|
|
32504
32614
|
// src/commands/pr-review.ts
|
|
32505
|
-
var
|
|
32615
|
+
var USAGE10 = [
|
|
32506
32616
|
"Usage: /swarm pr-review <url|owner/repo#N|N> [--council] [instructions...]",
|
|
32507
32617
|
"",
|
|
32508
32618
|
"Run a full swarm PR review on a GitHub pull request.",
|
|
@@ -32540,16 +32650,16 @@ function handlePrReviewCommand(directory, args) {
|
|
|
32540
32650
|
if (parsed.unknownFlag) {
|
|
32541
32651
|
return `Error: Unknown flag "${parsed.unknownFlag}"
|
|
32542
32652
|
|
|
32543
|
-
${
|
|
32653
|
+
${USAGE10}`;
|
|
32544
32654
|
}
|
|
32545
32655
|
const resolved = resolvePrCommandInput(parsed.rest, directory);
|
|
32546
32656
|
if (resolved === null) {
|
|
32547
|
-
return
|
|
32657
|
+
return USAGE10;
|
|
32548
32658
|
}
|
|
32549
32659
|
if ("error" in resolved) {
|
|
32550
32660
|
return `Error: ${resolved.error}
|
|
32551
32661
|
|
|
32552
|
-
${
|
|
32662
|
+
${USAGE10}`;
|
|
32553
32663
|
}
|
|
32554
32664
|
const councilFlag = parsed.council ? "council=true" : "council=false";
|
|
32555
32665
|
const signal = `[MODE: PR_REVIEW pr="${resolved.prUrl}" ${councilFlag}]`;
|
|
@@ -39334,7 +39444,7 @@ var _internals59 = {
|
|
|
39334
39444
|
writeProjectedSpecSync
|
|
39335
39445
|
};
|
|
39336
39446
|
var SWARM_SPEC_REL = path79.join(".swarm", "spec.md");
|
|
39337
|
-
var
|
|
39447
|
+
var USAGE11 = `Usage:
|
|
39338
39448
|
/swarm sdd status [--json] [--source <provider>]
|
|
39339
39449
|
/swarm sdd validate [--json] [--change <id>] [--source <provider>] [--feature <id>]
|
|
39340
39450
|
/swarm sdd project [--dry-run] [--overwrite] [--json] [--change <id>] [--source <provider>] [--feature <id>]
|
|
@@ -39447,11 +39557,11 @@ async function handleSddStatusCommand(directory, args) {
|
|
|
39447
39557
|
if (parsed.error)
|
|
39448
39558
|
return `Error: ${parsed.error}
|
|
39449
39559
|
|
|
39450
|
-
${
|
|
39560
|
+
${USAGE11}`;
|
|
39451
39561
|
if (parsed.feature && parsed.source && parsed.source !== "speckit") {
|
|
39452
39562
|
return `Error: --feature is only valid with --source speckit
|
|
39453
39563
|
|
|
39454
|
-
${
|
|
39564
|
+
${USAGE11}`;
|
|
39455
39565
|
}
|
|
39456
39566
|
const speckitDetection = detectSpeckit(directory);
|
|
39457
39567
|
const speckitPresent = speckitDetection.features.length > 0;
|
|
@@ -39518,11 +39628,11 @@ async function handleSddValidateCommand(directory, args) {
|
|
|
39518
39628
|
if (parsed.error)
|
|
39519
39629
|
return `Error: ${parsed.error}
|
|
39520
39630
|
|
|
39521
|
-
${
|
|
39631
|
+
${USAGE11}`;
|
|
39522
39632
|
if (parsed.feature && parsed.source && parsed.source !== "speckit") {
|
|
39523
39633
|
return `Error: --feature is only valid with --source speckit
|
|
39524
39634
|
|
|
39525
|
-
${
|
|
39635
|
+
${USAGE11}`;
|
|
39526
39636
|
}
|
|
39527
39637
|
let useSpeckit = false;
|
|
39528
39638
|
const nativeSpecExists = fs39.existsSync(path79.join(directory, SWARM_SPEC_REL));
|
|
@@ -39551,7 +39661,7 @@ ${USAGE10}`;
|
|
|
39551
39661
|
const resolution = resolveSpeckitProjection(directory);
|
|
39552
39662
|
return parsed.json ? JSON.stringify({ valid: false, error: formatSpeckitError(resolution) }, null, 2) : `Error: ${formatSpeckitError(resolution)}
|
|
39553
39663
|
|
|
39554
|
-
${
|
|
39664
|
+
${USAGE11}`;
|
|
39555
39665
|
}
|
|
39556
39666
|
}
|
|
39557
39667
|
}
|
|
@@ -39562,7 +39672,7 @@ ${USAGE10}`;
|
|
|
39562
39672
|
if (resolution.kind !== "ok" && resolution.kind !== "zero_requirements") {
|
|
39563
39673
|
return parsed.json ? JSON.stringify({ valid: false, error: formatSpeckitError(resolution) }, null, 2) : `Error: ${formatSpeckitError(resolution)}
|
|
39564
39674
|
|
|
39565
|
-
${
|
|
39675
|
+
${USAGE11}`;
|
|
39566
39676
|
}
|
|
39567
39677
|
const spec = resolution.kind === "ok" ? resolution.spec : null;
|
|
39568
39678
|
const result2 = {
|
|
@@ -39667,16 +39777,16 @@ async function handleSddProjectCommand(directory, args) {
|
|
|
39667
39777
|
if (parsed.error)
|
|
39668
39778
|
return `Error: ${parsed.error}
|
|
39669
39779
|
|
|
39670
|
-
${
|
|
39780
|
+
${USAGE11}`;
|
|
39671
39781
|
if (parsed.feature && parsed.source && parsed.source !== "speckit") {
|
|
39672
39782
|
return `Error: --feature is only valid with --source speckit
|
|
39673
39783
|
|
|
39674
|
-
${
|
|
39784
|
+
${USAGE11}`;
|
|
39675
39785
|
}
|
|
39676
39786
|
if (parsed.source === "swarm") {
|
|
39677
39787
|
return `Error: --source swarm selects the native .swarm/spec.md and does not generate a projection. Use --source openspec or --source speckit.
|
|
39678
39788
|
|
|
39679
|
-
${
|
|
39789
|
+
${USAGE11}`;
|
|
39680
39790
|
}
|
|
39681
39791
|
if (!parsed.dryRun) {
|
|
39682
39792
|
const nativeSpecPath = path79.join(directory, SWARM_SPEC_REL);
|
|
@@ -39686,7 +39796,7 @@ ${USAGE10}`;
|
|
|
39686
39796
|
"Error: .swarm/spec.md already exists.",
|
|
39687
39797
|
"Pass --overwrite to replace it.",
|
|
39688
39798
|
"",
|
|
39689
|
-
|
|
39799
|
+
USAGE11
|
|
39690
39800
|
].join(`
|
|
39691
39801
|
`);
|
|
39692
39802
|
}
|
|
@@ -39713,7 +39823,7 @@ ${USAGE10}`;
|
|
|
39713
39823
|
const resolution = resolveSpeckitProjection(directory);
|
|
39714
39824
|
return `Error: ${formatSpeckitError(resolution)}
|
|
39715
39825
|
|
|
39716
|
-
${
|
|
39826
|
+
${USAGE11}`;
|
|
39717
39827
|
}
|
|
39718
39828
|
}
|
|
39719
39829
|
}
|
|
@@ -39724,7 +39834,7 @@ ${USAGE10}`;
|
|
|
39724
39834
|
if (resolution.kind !== "ok") {
|
|
39725
39835
|
return `Error: ${formatSpeckitError(resolution)}
|
|
39726
39836
|
|
|
39727
|
-
${
|
|
39837
|
+
${USAGE11}`;
|
|
39728
39838
|
}
|
|
39729
39839
|
const result2 = _internals59.writeProjectedSpecSync(directory, {
|
|
39730
39840
|
source: "speckit",
|
|
@@ -39743,7 +39853,7 @@ ${USAGE10}`;
|
|
|
39743
39853
|
}
|
|
39744
39854
|
return `Error: ${result2.error}
|
|
39745
39855
|
|
|
39746
|
-
${
|
|
39856
|
+
${USAGE11}`;
|
|
39747
39857
|
}
|
|
39748
39858
|
if (!result2.projection) {
|
|
39749
39859
|
if (parsed.json) {
|
|
@@ -39757,7 +39867,7 @@ ${USAGE10}`;
|
|
|
39757
39867
|
return [
|
|
39758
39868
|
"SDD projection failed: no valid Spec-Kit projection could be built.",
|
|
39759
39869
|
"",
|
|
39760
|
-
|
|
39870
|
+
USAGE11
|
|
39761
39871
|
].join(`
|
|
39762
39872
|
`);
|
|
39763
39873
|
}
|
|
@@ -39800,7 +39910,7 @@ ${formatList(result2.projection.warnings)}` : ""
|
|
|
39800
39910
|
}
|
|
39801
39911
|
return `Error: ${result.error}
|
|
39802
39912
|
|
|
39803
|
-
${
|
|
39913
|
+
${USAGE11}`;
|
|
39804
39914
|
}
|
|
39805
39915
|
if (!result.projection) {
|
|
39806
39916
|
if (parsed.json) {
|
|
@@ -39814,7 +39924,7 @@ ${USAGE10}`;
|
|
|
39814
39924
|
return [
|
|
39815
39925
|
"SDD projection failed: no valid OpenSpec-compatible projection could be built.",
|
|
39816
39926
|
"",
|
|
39817
|
-
|
|
39927
|
+
USAGE11
|
|
39818
39928
|
].join(`
|
|
39819
39929
|
`);
|
|
39820
39930
|
}
|
|
@@ -39842,7 +39952,7 @@ ${formatList(result.projection.warnings)}` : ""
|
|
|
39842
39952
|
`);
|
|
39843
39953
|
}
|
|
39844
39954
|
async function handleSddCommand(_directory, _args) {
|
|
39845
|
-
return
|
|
39955
|
+
return USAGE11;
|
|
39846
39956
|
}
|
|
39847
39957
|
|
|
39848
39958
|
// src/commands/simulate.ts
|
|
@@ -41016,7 +41126,7 @@ function buildDetailedHelp(commandName, entry) {
|
|
|
41016
41126
|
async function handleHelpCommand(ctx) {
|
|
41017
41127
|
const targetCommand = ctx.args.join(" ");
|
|
41018
41128
|
if (!targetCommand) {
|
|
41019
|
-
const { buildHelpText } = await import("./index-
|
|
41129
|
+
const { buildHelpText } = await import("./index-zp330ss0.js");
|
|
41020
41130
|
return buildHelpText();
|
|
41021
41131
|
}
|
|
41022
41132
|
const tokens = targetCommand.split(/\s+/);
|
|
@@ -41025,7 +41135,7 @@ async function handleHelpCommand(ctx) {
|
|
|
41025
41135
|
return _internals62.buildDetailedHelp(resolved.key, resolved.entry);
|
|
41026
41136
|
}
|
|
41027
41137
|
const similar = _internals62.findSimilarCommands(targetCommand);
|
|
41028
|
-
const { buildHelpText: fullHelp } = await import("./index-
|
|
41138
|
+
const { buildHelpText: fullHelp } = await import("./index-zp330ss0.js");
|
|
41029
41139
|
if (similar.length > 0) {
|
|
41030
41140
|
return `Command '/swarm ${targetCommand}' not found.
|
|
41031
41141
|
|
|
@@ -41164,7 +41274,7 @@ var COMMAND_REGISTRY = {
|
|
|
41164
41274
|
},
|
|
41165
41275
|
"guardrail explain": {
|
|
41166
41276
|
handler: async (ctx) => {
|
|
41167
|
-
const { handleGuardrailExplain } = await import("./guardrail-explain-
|
|
41277
|
+
const { handleGuardrailExplain } = await import("./guardrail-explain-m34vcgjg.js");
|
|
41168
41278
|
return handleGuardrailExplain(ctx.directory, ctx.args);
|
|
41169
41279
|
},
|
|
41170
41280
|
description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
|
|
@@ -41174,7 +41284,7 @@ var COMMAND_REGISTRY = {
|
|
|
41174
41284
|
},
|
|
41175
41285
|
"guardrail-explain": {
|
|
41176
41286
|
handler: async (ctx) => {
|
|
41177
|
-
const { handleGuardrailExplain } = await import("./guardrail-explain-
|
|
41287
|
+
const { handleGuardrailExplain } = await import("./guardrail-explain-m34vcgjg.js");
|
|
41178
41288
|
return handleGuardrailExplain(ctx.directory, ctx.args);
|
|
41179
41289
|
},
|
|
41180
41290
|
description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
|
|
@@ -41184,7 +41294,7 @@ var COMMAND_REGISTRY = {
|
|
|
41184
41294
|
},
|
|
41185
41295
|
"guardrail-log": {
|
|
41186
41296
|
handler: async (ctx) => {
|
|
41187
|
-
const { handleGuardrailLog } = await import("./guardrail-log-
|
|
41297
|
+
const { handleGuardrailLog } = await import("./guardrail-log-222xyxfp.js");
|
|
41188
41298
|
return handleGuardrailLog(ctx.directory, ctx.args);
|
|
41189
41299
|
},
|
|
41190
41300
|
description: "Read the guardrail decision log (use --blocks-only for blocks)",
|
|
@@ -41537,6 +41647,14 @@ Subcommands:
|
|
|
41537
41647
|
category: "agent",
|
|
41538
41648
|
toolPolicy: "none"
|
|
41539
41649
|
},
|
|
41650
|
+
"abort-pr-workflow": {
|
|
41651
|
+
handler: (ctx) => handleAbortPrWorkflowCommand(ctx.directory, ctx.args, ctx.sessionID),
|
|
41652
|
+
description: "Clear a stuck PR_REVIEW/PR_FEEDBACK mechanical gate and stop the auto-resume loop [mode] [reason]",
|
|
41653
|
+
args: "[PR_REVIEW|PR_FEEDBACK] [reason...]",
|
|
41654
|
+
details: "Human-only escape hatch for an unrecoverable PR_REVIEW or PR_FEEDBACK mechanical gate. When the architect cannot reach complete_pr_workflow \u2014 for example a compound `git fetch && git checkout` was rejected as read-only shell syntax, the PR head cannot be fetched, or the working tree is on the wrong branch \u2014 running this clears the durable gate state for the current session and stops the auto-resume loop without depending on the trapped model. The agent itself cannot run this command; it must call the abort_pr_workflow tool (or ask you to run this command). Both paths funnel into the same fail-closed abortPrWorkflow hook, which refuses while the workflow is armed for publication or while PR workflow lanes are still in flight. An audit event is appended to .swarm/events.jsonl.",
|
|
41655
|
+
category: "utility",
|
|
41656
|
+
toolPolicy: "restricted"
|
|
41657
|
+
},
|
|
41540
41658
|
"pr-review": {
|
|
41541
41659
|
handler: (ctx) => handleModeCommandWithBundledSkills(ctx, handlePrReviewCommand, "PR_REVIEW"),
|
|
41542
41660
|
description: "Launch deep PR review with multi-lane analysis [url] [--council]",
|
|
@@ -42452,7 +42570,12 @@ DELEGATION ENVELOPE FIELDS \u2014 include these in every delegation for traceabi
|
|
|
42452
42570
|
|
|
42453
42571
|
Before delegating to {{AGENT_PREFIX}}reviewer: call check_gate_status for the current task_id and include the gate results in the GATES field of the reviewer message. Format: GATES: lint=PASS/FAIL, sast_scan=PASS/FAIL, secretscan=PASS/FAIL (use PASS/FAIL/skipped for each gate). If no gates have been run yet, use GATES: none.
|
|
42454
42572
|
|
|
42455
|
-
ACCEPTANCE FIELD RESOLUTION \u2014
|
|
42573
|
+
ACCEPTANCE FIELD RESOLUTION \u2014 REQUIRED on every {{AGENT_PREFIX}}coder and {{AGENT_PREFIX}}reviewer Task dispatch. A dispatch with no ACCEPTANCE: line is BLOCKED by the delegation gate before the agent runs (ACCEPTANCE_FIELD_REQUIRED). Resolve it as:
|
|
42574
|
+
1. Read the current task's \`fr_refs\` from the plan.
|
|
42575
|
+
2. If \`fr_refs\` is non-empty: look up EVERY listed FR-###/SC-### id in the current \`.swarm/spec.md\` and copy each one's full requirement text into ACCEPTANCE VERBATIM \u2014 byte-for-byte, no summarizing or paraphrasing, and concatenate all of them when a task maps to more than one.
|
|
42576
|
+
3. When the task has no spec mapping: if \`fr_refs\` is empty or absent, populate ACCEPTANCE with a task-derived one-line restatement of what DONE looks like instead (the same pattern as \`acceptanceCriteria\` above).
|
|
42577
|
+
ACCEPTANCE must never be empty \u2014 lacking a spec mapping is normal and is not a reason to omit it.
|
|
42578
|
+
NOTE: the plan-task \`acceptance\` field is a different thing. Writing acceptance on the plan task does NOT satisfy this rule. The delegation prompt needs its own literal \`ACCEPTANCE:\` line.
|
|
42456
42579
|
|
|
42457
42580
|
<!-- BEHAVIORAL_GUIDANCE_START -->
|
|
42458
42581
|
PARTIAL GATE RATIONALIZATIONS \u2014 automated gates \u2260 agent review. Running SOME gates is NOT compliance:
|
|
@@ -42630,7 +42753,7 @@ FILE: src/auth/login.ts
|
|
|
42630
42753
|
INPUT: Validate email format, password >= 8 chars
|
|
42631
42754
|
OUTPUT: Modified file
|
|
42632
42755
|
CONSTRAINT: Do not modify other functions
|
|
42633
|
-
ACCEPTANCE:
|
|
42756
|
+
ACCEPTANCE: FR-007 The login endpoint SHALL reject passwords shorter than 8 characters with HTTP 400 and a localized error message.
|
|
42634
42757
|
SKILLS: file:.claude/skills/engineering-conventions/SKILL.md
|
|
42635
42758
|
|
|
42636
42759
|
{{AGENT_PREFIX}}reviewer
|
|
@@ -42638,11 +42761,13 @@ TASK: Review login validation
|
|
|
42638
42761
|
FILE: src/auth/login.ts
|
|
42639
42762
|
CHECK: [security, correctness, edge-cases]
|
|
42640
42763
|
GATES: lint=PASS, sast_scan=PASS, secretscan=PASS
|
|
42641
|
-
ACCEPTANCE:
|
|
42764
|
+
ACCEPTANCE: FR-007 The login endpoint SHALL reject passwords shorter than 8 characters with HTTP 400 and a localized error message.
|
|
42642
42765
|
SKILLS_USED_BY_CODER: file:.claude/skills/engineering-conventions/SKILL.md
|
|
42643
42766
|
OUTPUT: VERDICT + RISK + ISSUES + ACCEPTANCE_SATISFACTION
|
|
42644
42767
|
SKILLS: file:.claude/skills/engineering-conventions/SKILL.md
|
|
42645
42768
|
|
|
42769
|
+
NOTE (ACCEPTANCE examples above): the FR-### form applies when fr_refs is non-empty. When the task has no fr_refs, ACCEPTANCE instead carries a one-line task-derived DONE restatement, e.g. "DONE = login rejects <8-char passwords with HTTP 400; the 6 happy-path tests pass." The reviewer delegation for the same task uses the identical ACCEPTANCE text as the coder delegation.
|
|
42770
|
+
|
|
42646
42771
|
{{AGENT_PREFIX}}test_engineer
|
|
42647
42772
|
TASK: Generate and run login validation tests
|
|
42648
42773
|
FILE: src/auth/login.ts
|
|
@@ -42960,6 +43085,7 @@ HARD CONSTRAINTS (apply regardless of skill load success):
|
|
|
42960
43085
|
- RUN ALL MICRO-LANES: after the base explorer lanes settle, focus every repository-agnostic row from the exact diff/context pack and launch all 11 micro-lanes with \`mode: "swarm-pr-review:micro"\`, the complete all-\`MATCHED\` \`trigger_evaluation\`, and each trigger ID as \`workflow_lane\`. Keyword or path heuristics cannot waive a row. Missing any micro-lane is a BLOCKED coverage gap, not a speed optimization; split the lanes across bounded \`dispatch_lanes_async\` batches and use the same non-idling incremental collection pattern.
|
|
42961
43086
|
- RUN HEAD-BOUND VALIDATION: dispatch independent reviewers with \`mode: "swarm-pr-review:reviewer"\` and critics with \`mode: "swarm-pr-review:critic"\`, unique \`workflow_lane\` obligations, role-correct agents, and the same exact \`pr_head_sha\`. Critic dispatch is blocked until all declared reviewer obligations have successful artifacts.
|
|
42962
43087
|
- COMPLETE EXPLICITLY: after final artifacts and synthesis, call \`complete_pr_workflow\` with \`mode: "PR_REVIEW"\` and the bound \`pr_head_sha\`; never leave the session trapped in a stale workflow gate.
|
|
43088
|
+
- ABORT IF UNRECOVERABLE: if the PR head cannot be fetched/checked out (the working tree stays on the wrong branch), a compound \`git fetch && git checkout\` keeps being rejected as read-only shell syntax (run them as TWO separate standalone commands first), or the merge-base bind is unreachable for any reason, call \`abort_pr_workflow\` with \`mode: "PR_REVIEW"\` and a one-line \`reason\` instead of looping. The tool refuses while PR workflow lanes are in flight (collect their results first). Aborting clears the durable gate and stops the auto-resume loop; the user can also run \`/swarm abort-pr-workflow\`. Do NOT abort as a shortcut to avoid coverage obligations \u2014 only when the bind/checkout path is genuinely unreachable.
|
|
42963
43089
|
- Honor any free-text instructions that follow the closing bracket of the signal as additional reviewer focus, without weakening the validation ladder above.
|
|
42964
43090
|
|
|
42965
43091
|
### MODE: PR_FEEDBACK
|
|
@@ -42980,6 +43106,7 @@ HARD CONSTRAINTS (apply regardless of skill load success):
|
|
|
42980
43106
|
- DO NOT PUBLISH EARLY: commits, pushes, PR comments/updates, review-thread mutations, and other remote writes remain blocked until every ordered feedback gate settles positively on the same revision digest.
|
|
42981
43107
|
- After every local gate passes, create the reviewed commit with one standalone \`git commit\`, then call \`complete_pr_workflow\` once. It requires a clean index/worktree and a non-merge direct child whose sole parent is the immutable intake head before binding that post-commit HEAD and arming publication. Push only with \`git push <bound-remote> <bound-commit>:refs/heads/<bound-branch>\`; the literal bound commit and exact bound branch are required, and force flags, wrappers, aliases, fetch-based local-ref forgery, extra refspecs, \`git -C\`, and other remote writes fail closed. Perform read-only remote checks, then call \`complete_pr_workflow\` a second time with the same immutable verification \`pr_head_sha\`; the second call clears only after both the actual remote ref and its local tracking ref resolve to the exact bound commit. Only then perform any explicitly authorized PR comment/body/thread writes.
|
|
42982
43108
|
- Patch only confirmed items plus the tests/docs they require; report closure status for every ledger item including disproved ones.
|
|
43109
|
+
- ABORT IF UNRECOVERABLE (pre-armed only): if the PR head cannot be fetched/checked out or the verification bind is unreachable for any reason, call \`abort_pr_workflow\` with \`mode: "PR_FEEDBACK"\` and a one-line \`reason\` instead of looping. The tool refuses while PR workflow lanes are in flight (collect their results first) AND refuses once \`prFeedbackReadyToPublish\` is armed \u2014 after arming, you MUST complete the workflow with \`complete_pr_workflow\` (or push the bound commit first); aborting an armed gate would drop the immutable-commit binding and leave a half-published commit. Do NOT abort as a shortcut to skip the mechanical gates \u2014 only when the bind/verification path is genuinely unreachable.
|
|
42983
43110
|
- Do NOT resolve or mark GitHub review threads resolved unless the user explicitly instructs it.
|
|
42984
43111
|
- Honor any free-text instructions that follow the closing bracket of the signal as additional scope, without dropping any ledger item.
|
|
42985
43112
|
- Quality is the only metric \u2014 there is no speed, efficiency, or time exception; time, tokens, and agent dispatches are irrelevant to correctness
|