opencode-swarm 7.125.4 → 7.125.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/.opencode/skills/swarm-pr-feedback/SKILL.md +15 -0
  2. package/.opencode/skills/swarm-pr-review/SKILL.md +34 -0
  3. package/dist/cli/{config-doctor-rm1m07gz.js → config-doctor-akxywx0c.js} +2 -2
  4. package/dist/cli/{curation-policy-7pgdjt5w.js → curation-policy-62w2pwfz.js} +2 -2
  5. package/dist/cli/{curator-llm-factory-0hncnz9t.js → curator-llm-factory-av2tcfy9.js} +12 -12
  6. package/dist/cli/{curator-n6whbm4r.js → curator-mhhvx2pw.js} +12 -12
  7. package/dist/cli/{guardrail-explain-8gknrsbb.js → guardrail-explain-kqx2bczn.js} +13 -13
  8. package/dist/cli/{guardrail-log-6a2zxvtx.js → guardrail-log-222xyxfp.js} +3 -3
  9. package/dist/cli/{hive-promoter-mpjq0fw9.js → hive-promoter-6mhnhrbx.js} +12 -12
  10. package/dist/cli/{index-hr2kzcem.js → index-0cdq55k0.js} +14 -14
  11. package/dist/cli/{index-vdfewvn5.js → index-0f45t7xy.js} +5 -5
  12. package/dist/cli/{index-45mvd5q7.js → index-1012f47p.js} +4 -4
  13. package/dist/cli/{index-rp5msv7n.js → index-1htanqp1.js} +1 -1
  14. package/dist/cli/{index-emzes7sj.js → index-4b1e5m0d.js} +2 -2
  15. package/dist/cli/{index-ambnwnmt.js → index-74xejn4v.js} +1 -1
  16. package/dist/cli/{index-jkwyjr8x.js → index-ccfkfrew.js} +2 -2
  17. package/dist/cli/{index-xezv6tdw.js → index-dezgmvtw.js} +1 -1
  18. package/dist/cli/{index-8tjbq2ej.js → index-e315gwc9.js} +1 -1
  19. package/dist/cli/{index-fm4zfxnr.js → index-gbnpz7rh.js} +1 -1
  20. package/dist/cli/{index-01n43w2p.js → index-gd5w3ef8.js} +3 -3
  21. package/dist/cli/{index-pk099nqv.js → index-jt7hnr7q.js} +1 -1
  22. package/dist/cli/{index-4ycq2mrp.js → index-qzkcy22e.js} +1 -1
  23. package/dist/cli/{index-414r47r7.js → index-r1gdkn2d.js} +4 -0
  24. package/dist/cli/{index-7xg876np.js → index-s6hskqg6.js} +211 -91
  25. package/dist/cli/{index-sa3dgpmc.js → index-yq4s3q43.js} +2 -2
  26. package/dist/cli/index.js +12 -12
  27. package/dist/cli/{knowledge-escalator-gr8qd7kz.js → knowledge-escalator-h3hg7ek7.js} +3 -3
  28. package/dist/cli/{knowledge-events-q83g3f8z.js → knowledge-events-jtr66wxz.js} +1 -1
  29. package/dist/cli/{knowledge-store-qq3w5yt8.js → knowledge-store-69ttjjjs.js} +1 -1
  30. package/dist/cli/{knowledge-validator-7jhq8yam.js → knowledge-validator-yn06rh13.js} +4 -4
  31. package/dist/cli/{scan-cursor-fa5sy36q.js → scan-cursor-r0w2p5gz.js} +2 -2
  32. package/dist/cli/{schema-bw68my66.js → schema-69z8w1ka.js} +1 -1
  33. package/dist/cli/{skill-generator-ffc1agyw.js → skill-generator-a7xfyddq.js} +5 -5
  34. package/dist/commands/abort-pr-workflow.d.ts +17 -0
  35. package/dist/commands/registry.d.ts +8 -0
  36. package/dist/hooks/pr-workflow-gate.d.ts +32 -0
  37. package/dist/hooks/pr-workflow-response-gate.d.ts +48 -0
  38. package/dist/index.js +73 -63
  39. package/dist/tools/abort-pr-workflow.d.ts +5 -0
  40. package/dist/tools/index.d.ts +1 -0
  41. package/dist/tools/manifest.d.ts +1 -0
  42. package/dist/tools/tool-metadata.d.ts +4 -0
  43. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  authorizeCuration
4
- } from "./index-rp5msv7n.js";
4
+ } from "./index-1htanqp1.js";
5
5
  import {
6
6
  findNearDuplicate,
7
7
  inferTags,
@@ -9,7 +9,7 @@ import {
9
9
  resolveSwarmKnowledgePath,
10
10
  resolveSwarmRejectedPath,
11
11
  transactKnowledge
12
- } from "./index-45mvd5q7.js";
12
+ } from "./index-1012f47p.js";
13
13
  import {
14
14
  resolveKnowledgeStoreDir
15
15
  } from "./index-q27bajqb.js";
package/dist/cli/index.js CHANGED
@@ -7,34 +7,34 @@ import {
7
7
  getPluginLockFilePaths,
8
8
  package_default,
9
9
  resolveCommand
10
- } from "./index-7xg876np.js";
11
- import"./index-xezv6tdw.js";
12
- import"./index-pk099nqv.js";
10
+ } from "./index-s6hskqg6.js";
11
+ import"./index-dezgmvtw.js";
12
+ import"./index-jt7hnr7q.js";
13
13
  import"./index-kk1scggc.js";
14
14
  import"./index-4905hd2m.js";
15
15
  import"./index-134d35c1.js";
16
16
  import"./index-6n2jpz7x.js";
17
- import"./index-01n43w2p.js";
18
- import"./index-vdfewvn5.js";
19
- import"./index-8tjbq2ej.js";
17
+ import"./index-gd5w3ef8.js";
18
+ import"./index-0f45t7xy.js";
19
+ import"./index-e315gwc9.js";
20
20
  import"./index-vxv732ex.js";
21
21
  import"./index-c8s9a3zh.js";
22
22
  import"./index-9ss2m4rs.js";
23
23
  import"./index-23zsx7dm.js";
24
- import"./index-sa3dgpmc.js";
25
- import"./index-rp5msv7n.js";
24
+ import"./index-yq4s3q43.js";
25
+ import"./index-1htanqp1.js";
26
26
  import"./index-rtry5xyf.js";
27
- import"./index-45mvd5q7.js";
28
- import"./index-fm4zfxnr.js";
27
+ import"./index-1012f47p.js";
28
+ import"./index-gbnpz7rh.js";
29
29
  import"./index-ae75rja9.js";
30
30
  import"./index-q27bajqb.js";
31
- import"./index-ambnwnmt.js";
31
+ import"./index-74xejn4v.js";
32
32
  import"./index-k5jrywpr.js";
33
33
  import"./index-n832052r.js";
34
34
  import {
35
35
  DEFAULT_AGENT_CONFIGS,
36
36
  init_constants
37
- } from "./index-414r47r7.js";
37
+ } from "./index-r1gdkn2d.js";
38
38
  import"./index-bk5tah7q.js";
39
39
  import"./index-8fwhhayc.js";
40
40
  import"./index-q1exe2b3.js";
@@ -8,9 +8,9 @@ import {
8
8
  maybeEscalateOnViolation,
9
9
  maybeQuarantineOnContradiction,
10
10
  readRecentEscalations
11
- } from "./index-vdfewvn5.js";
12
- import"./index-45mvd5q7.js";
13
- import"./index-fm4zfxnr.js";
11
+ } from "./index-0f45t7xy.js";
12
+ import"./index-1012f47p.js";
13
+ import"./index-gbnpz7rh.js";
14
14
  import"./index-ae75rja9.js";
15
15
  import"./index-q27bajqb.js";
16
16
  import"./index-bk5tah7q.js";
@@ -26,7 +26,7 @@ import {
26
26
  resolveKnowledgeCounterBaselinePath,
27
27
  resolveKnowledgeEventsPath,
28
28
  resolveLegacyApplicationLogPath
29
- } from "./index-fm4zfxnr.js";
29
+ } from "./index-gbnpz7rh.js";
30
30
  import"./index-ae75rja9.js";
31
31
  import"./index-q27bajqb.js";
32
32
  import"./index-zgwm4ryv.js";
@@ -40,7 +40,7 @@ import {
40
40
  transactKnowledge,
41
41
  transactKnowledgeWithCas,
42
42
  wordBigrams
43
- } from "./index-45mvd5q7.js";
43
+ } from "./index-1012f47p.js";
44
44
  import {
45
45
  resolveHiveDataDir
46
46
  } from "./index-ae75rja9.js";
@@ -23,11 +23,11 @@ import {
23
23
  validateLesson,
24
24
  validateSkillCandidatePath,
25
25
  validateSkillPath
26
- } from "./index-sa3dgpmc.js";
27
- import"./index-rp5msv7n.js";
26
+ } from "./index-yq4s3q43.js";
27
+ import"./index-1htanqp1.js";
28
28
  import"./index-rtry5xyf.js";
29
- import"./index-45mvd5q7.js";
30
- import"./index-fm4zfxnr.js";
29
+ import"./index-1012f47p.js";
30
+ import"./index-gbnpz7rh.js";
31
31
  import"./index-ae75rja9.js";
32
32
  import"./index-q27bajqb.js";
33
33
  import"./index-bk5tah7q.js";
@@ -4,8 +4,8 @@ import {
4
4
  alreadyCuratedThisGeneration,
5
5
  claimNextScanBatch,
6
6
  getScanStatus
7
- } from "./index-8tjbq2ej.js";
8
- import"./index-45mvd5q7.js";
7
+ } from "./index-e315gwc9.js";
8
+ import"./index-1012f47p.js";
9
9
  import"./index-ae75rja9.js";
10
10
  import"./index-q27bajqb.js";
11
11
  import"./index-bk5tah7q.js";
@@ -89,7 +89,7 @@ import {
89
89
  resolveGeneratedAgentRole,
90
90
  resolveGuardrailsConfig,
91
91
  stripKnownSwarmPrefix
92
- } from "./index-414r47r7.js";
92
+ } from "./index-r1gdkn2d.js";
93
93
  import"./index-bk5tah7q.js";
94
94
  import"./index-zjygnfay.js";
95
95
  import"./index-bpmtbmy9.js";
@@ -33,12 +33,12 @@ import {
33
33
  sanitizeSlug,
34
34
  selectCandidateEntries,
35
35
  writeEvalStub
36
- } from "./index-01n43w2p.js";
37
- import"./index-sa3dgpmc.js";
38
- import"./index-rp5msv7n.js";
36
+ } from "./index-gd5w3ef8.js";
37
+ import"./index-yq4s3q43.js";
38
+ import"./index-1htanqp1.js";
39
39
  import"./index-rtry5xyf.js";
40
- import"./index-45mvd5q7.js";
41
- import"./index-fm4zfxnr.js";
40
+ import"./index-1012f47p.js";
41
+ import"./index-gbnpz7rh.js";
42
42
  import"./index-ae75rja9.js";
43
43
  import"./index-q27bajqb.js";
44
44
  import"./index-bk5tah7q.js";
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Handle /swarm abort-pr-workflow command.
3
+ *
4
+ * Human-only escape hatch for an unrecoverable PR_REVIEW / PR_FEEDBACK
5
+ * mechanical gate. When the architect cannot reach `complete_pr_workflow`
6
+ * (compound `git fetch && git checkout` rejected as read-only shell syntax,
7
+ * missing PR ref, model confusion, suspended wake budget, …), the user runs
8
+ * this to clear the durable gate and stop the auto-resume loop without
9
+ * depending on the trapped model.
10
+ *
11
+ * The command is `toolPolicy: 'restricted'` — the agent cannot run it via
12
+ * `swarm_command`; the agent must instead call the `abort_pr_workflow` tool
13
+ * (or ask the user to run this command). Both paths funnel into
14
+ * `abortPrWorkflow`, which is fail-closed on armed publication and on
15
+ * in-flight lanes.
16
+ */
17
+ export declare function handleAbortPrWorkflowCommand(directory: string, args: string[], sessionID: string): Promise<string>;
@@ -513,6 +513,14 @@ export declare const COMMAND_REGISTRY: {
513
513
  readonly category: "agent";
514
514
  readonly toolPolicy: "none";
515
515
  };
516
+ readonly 'abort-pr-workflow': {
517
+ readonly handler: (ctx: CommandContext) => Promise<string>;
518
+ readonly description: "Clear a stuck PR_REVIEW/PR_FEEDBACK mechanical gate and stop the auto-resume loop [mode] [reason]";
519
+ readonly args: "[PR_REVIEW|PR_FEEDBACK] [reason...]";
520
+ readonly details: "Human-only escape hatch for an unrecoverable PR_REVIEW or PR_FEEDBACK mechanical gate. When the architect cannot reach complete_pr_workflow — 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 — 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.";
521
+ readonly category: "utility";
522
+ readonly toolPolicy: "restricted";
523
+ };
516
524
  readonly 'pr-review': {
517
525
  readonly handler: (ctx: CommandContext) => CommandResult;
518
526
  readonly description: "Launch deep PR review with multi-lane analysis [url] [--council]";
@@ -118,6 +118,38 @@ export declare function activatePrWorkflow(directory: string, sessionID: string,
118
118
  }): Promise<PrWorkflowGateState>;
119
119
  export declare function readPrWorkflowGateState(directory: string, sessionID: string): Promise<PrWorkflowGateState | null>;
120
120
  export declare function clearPrWorkflowGateState(directory: string, sessionID: string, expectedRevision?: number): Promise<void>;
121
+ /**
122
+ * Abort an active PR workflow gate without reaching terminal completion.
123
+ *
124
+ * This is the escape hatch for the deadlock where `/swarm pr-review` activates
125
+ * a PR_REVIEW gate without binding a PR head and the architect cannot reach
126
+ * `completePrWorkflow` (compound `git fetch && git checkout` rejected by the
127
+ * read-only shell classifier, missing PR ref, model confusion, etc.). Without
128
+ * this path the durable gate is permanent for the session and the response
129
+ * gate's auto-resume loop runs unbounded.
130
+ *
131
+ * Fail-closed semantics, checked in order:
132
+ * 1. Authorization: operates on the raw caller `sessionID` only. A lane or
133
+ * child session whose ID has no gate record throws "no active gate" —
134
+ * lanes must not abort the controller's gate.
135
+ * 2. Mode match when `expectedMode` is supplied.
136
+ * 3. Refuses while `prFeedbackReadyToPublish` is set — clearing an armed
137
+ * gate would drop the immutable-commit binding and leave a half-published
138
+ * commit. The tool gate refuses armed abort too (defense in depth).
139
+ * 4. Refuses while open `swarm-pr-*` delegations exist, matching
140
+ * `completePrWorkflow` — aborting mid-flight would orphan running lanes.
141
+ *
142
+ * Records a non-fatal audit event into the existing `.swarm/events.jsonl`
143
+ * (no new ledger file), then delegates to `clearPrWorkflowGateState`.
144
+ */
145
+ export declare function abortPrWorkflow(directory: string, sessionID: string, options?: {
146
+ expectedMode?: PrWorkflowMode;
147
+ reason?: string;
148
+ }): Promise<{
149
+ mode: PrWorkflowMode;
150
+ prHeadSha?: string;
151
+ openLanes: number;
152
+ }>;
121
153
  /** Bind an active PR workflow to one immutable PR head. */
122
154
  export declare function bindPrWorkflowHead(directory: string, sessionID: string, prHeadSha: string): Promise<PrWorkflowGateState>;
123
155
  /** Bind an active PR_REVIEW workflow to one immutable merge-base scope. */
@@ -1,15 +1,56 @@
1
+ /**
2
+ * Maximum number of consecutive unproductive auto-resumes per gated session
3
+ * before the response gate suspends further wakes. "Unproductive" means the
4
+ * durable gate's `revision` did not advance between wakes — i.e. no
5
+ * state-mutating controller tool (dispatch_lanes_async,
6
+ * write_pr_review_trigger_eval, complete_pr_workflow, recordPrReview*,
7
+ * bindPrReviewBase, …) made durable progress. A healthy review bumps
8
+ * `revision` on every successful state-mutating controller call, so the
9
+ * consecutive counter resets on progress and never exhausts the budget.
10
+ * Read-only tools (collect_lane_results polling, grep, read) intentionally do
11
+ * NOT bump `revision` — an architect that only polls without ever dispatching
12
+ * new lanes or recording trigger evaluations IS making progress on the
13
+ * runtime's bookkeeping but is not advancing the durable gate, so the budget
14
+ * treats long polling-only stretches conservatively. Only a genuinely stuck
15
+ * session holds `revision` constant across many idle cycles.
16
+ */
17
+ export declare const DEFAULT_MAX_CONSECUTIVE_UNPRODUCTIVE_WAKES = 5;
18
+ /**
19
+ * Cooldown applied ONLY between consecutive unproductive wakes. The first
20
+ * wake after progress is never throttled, so a review that is actively
21
+ * bumping `revision` never waits.
22
+ */
23
+ export declare const DEFAULT_WAKE_COOLDOWN_MS = 30000;
24
+ /**
25
+ * Bounded FIFO map of tracked wake budgets. Invariant 8 (session/global
26
+ * state): module-level state must have an explicit eviction strategy.
27
+ */
28
+ export declare const MAX_TRACKED_WAKE_SESSIONS = 200;
1
29
  interface PrWorkflowResponseGateClient {
2
30
  session?: unknown;
3
31
  }
32
+ interface WakeBudget {
33
+ consecutiveUnproductive: number;
34
+ lastWakeAt: number;
35
+ lastSeenRevision?: number;
36
+ suspended: boolean;
37
+ }
4
38
  /**
5
39
  * Prevent an architect from bypassing PR obligations by simply emitting text.
6
40
  * The text-complete hook replaces every architect-session text part while the
7
41
  * durable gate exists; session.idle then mechanically resumes that session.
42
+ *
43
+ * The resume loop is bounded (see DEFAULT_MAX_CONSECUTIVE_UNPRODUCTIVE_WAKES)
44
+ * so a session that cannot make progress suspends instead of spinning
45
+ * forever. `textComplete` keeps rewriting text after suspension so the
46
+ * user-visible surface always names the recovery path.
8
47
  */
9
48
  export declare function createPrWorkflowResponseGate(options: {
10
49
  directory: string;
11
50
  client?: PrWorkflowResponseGateClient;
12
51
  wakeTimeoutMs?: number;
52
+ maxConsecutiveUnproductiveWakes?: number;
53
+ wakeCooldownMs?: number;
13
54
  }): {
14
55
  event: (input: {
15
56
  event: unknown;
@@ -19,5 +60,12 @@ export declare function createPrWorkflowResponseGate(options: {
19
60
  }, output: {
20
61
  text: string;
21
62
  }) => Promise<void>;
63
+ /**
64
+ * Test/inspection seam: returns a snapshot of the wake budget for the
65
+ * given session. Production code does not call this; it exists so
66
+ * tests can assert the consecutive counter and suspended flag
67
+ * without relying on `promptAsync` call counts alone.
68
+ */
69
+ _inspectWakeBudget: (sessionID: string) => WakeBudget | undefined;
22
70
  };
23
71
  export {};