opencode-swarm 7.134.2 → 7.134.3

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 (49) hide show
  1. package/.opencode/skills/swarm-pr-feedback/SKILL.md +10 -3
  2. package/.opencode/skills/swarm-pr-review/SKILL.md +11 -3
  3. package/README.md +1 -1
  4. package/dist/background/pr-event-delivery.d.ts +8 -0
  5. package/dist/background/pr-event-subscribers.d.ts +5 -0
  6. package/dist/background/pr-feedback-event-queue.d.ts +37 -0
  7. package/dist/background/workspace-snapshot.d.ts +8 -3
  8. package/dist/cli/{config-doctor-wk7xzrma.js → config-doctor-yqwm2tfh.js} +2 -2
  9. package/dist/cli/{curation-policy-npgspa14.js → curation-policy-x5m4x34n.js} +2 -2
  10. package/dist/cli/{curator-llm-factory-tpc0qg6x.js → curator-llm-factory-24mjnh2y.js} +13 -13
  11. package/dist/cli/{curator-njzxdyav.js → curator-thrwgwh1.js} +13 -13
  12. package/dist/cli/{guardrail-explain-75pr3e9z.js → guardrail-explain-nmfq71cm.js} +14 -14
  13. package/dist/cli/{guardrail-log-783svw0e.js → guardrail-log-2a61rz1w.js} +3 -3
  14. package/dist/cli/{hive-promoter-nrxjatdx.js → hive-promoter-2nkjjwgc.js} +13 -13
  15. package/dist/cli/{index-njfcm1tn.js → index-1mq8kmp6.js} +3 -3
  16. package/dist/cli/{index-ss26e2d4.js → index-2b7sv71f.js} +1 -1
  17. package/dist/cli/{index-h3k62043.js → index-3nasn371.js} +47 -12
  18. package/dist/cli/{index-y8vqsm2g.js → index-5f403c30.js} +1 -1
  19. package/dist/cli/{index-cav39zjt.js → index-6kfqz0jw.js} +3180 -2036
  20. package/dist/cli/{index-asd9n0ms.js → index-6wya5cqh.js} +1 -1
  21. package/dist/cli/{index-746ga67b.js → index-8wktghbc.js} +1 -1
  22. package/dist/cli/{index-n48xwynh.js → index-ddxt327j.js} +1 -1
  23. package/dist/cli/{index-4cnwvmsm.js → index-mgr951p8.js} +5 -5
  24. package/dist/cli/{index-a0nk83rk.js → index-q3m6bpx2.js} +2 -2
  25. package/dist/cli/{index-1bytvz73.js → index-reesz606.js} +2 -2
  26. package/dist/cli/{index-x60gpbt5.js → index-rjngxx7q.js} +4 -4
  27. package/dist/cli/{index-v8m282zt.js → index-tsmjmhnk.js} +1 -1
  28. package/dist/cli/{index-225t7m1j.js → index-txwm0fv4.js} +15 -15
  29. package/dist/cli/{index-ca44jww3.js → index-y3rj2jgb.js} +1 -1
  30. package/dist/cli/{index-9299e7d5.js → index-yaptf0hg.js} +2 -2
  31. package/dist/cli/{index-0dszfjf3.js → index-yqvh2s4w.js} +1 -1
  32. package/dist/cli/index.js +13 -13
  33. package/dist/cli/{knowledge-escalator-b3b91k0t.js → knowledge-escalator-fqsavryx.js} +3 -3
  34. package/dist/cli/{knowledge-events-kyw0s745.js → knowledge-events-ykt8vrvj.js} +1 -1
  35. package/dist/cli/{knowledge-store-5watc2b2.js → knowledge-store-tpd98m39.js} +1 -1
  36. package/dist/cli/{knowledge-validator-a4wxkgbc.js → knowledge-validator-kc7fnt2r.js} +4 -4
  37. package/dist/cli/{scan-cursor-gcd771kn.js → scan-cursor-121b73j0.js} +2 -2
  38. package/dist/cli/{schema-6eghf6gt.js → schema-jb4p8ja9.js} +1 -1
  39. package/dist/cli/{skill-generator-8dswjh14.js → skill-generator-m2g5mdva.js} +5 -5
  40. package/dist/cli/{workspace-snapshot-35qc0y8a.js → workspace-snapshot-9h5za0s6.js} +3 -1
  41. package/dist/commands/pr-feedback.d.ts +15 -2
  42. package/dist/git/pr-workflow-state.d.ts +37 -0
  43. package/dist/hooks/pr-workflow-gate.d.ts +42 -2
  44. package/dist/hooks/pr-workflow-response-gate.d.ts +3 -0
  45. package/dist/index.js +490 -476
  46. package/dist/tools/pr-workflow-status.d.ts +2 -0
  47. package/dist/tools/pre-check-batch.d.ts +22 -0
  48. package/dist/tools/prepare-pr-workflow-checkout.d.ts +2 -0
  49. package/package.json +1 -1
@@ -608,7 +608,7 @@ async function applyKnowledgeVerdictFeedback(directory, options) {
608
608
  deltas.push({ id, delta });
609
609
  }
610
610
  if (deltas.length > 0) {
611
- const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-5watc2b2.js");
611
+ const { bumpKnowledgeConfidenceBatch } = await import("./knowledge-store-tpd98m39.js");
612
612
  await bumpKnowledgeConfidenceBatch(directory, deltas, options?.floorOptions);
613
613
  }
614
614
  return {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  redactPath,
4
4
  redactShellCommand
5
- } from "./index-0dszfjf3.js";
5
+ } from "./index-yqvh2s4w.js";
6
6
 
7
7
  // src/services/guardrail-log-service.ts
8
8
  import * as fs from "fs/promises";
@@ -8,7 +8,7 @@ import {
8
8
  init_constants,
9
9
  init_schema,
10
10
  resolveExternalSkillsConfig
11
- } from "./index-v8m282zt.js";
11
+ } from "./index-tsmjmhnk.js";
12
12
  import {
13
13
  advisoryWarn,
14
14
  init_warning_buffer
@@ -6,13 +6,13 @@ import {
6
6
  resolveSwarmKnowledgePath,
7
7
  transactKnowledge,
8
8
  wordBigrams
9
- } from "./index-x60gpbt5.js";
9
+ } from "./index-rjngxx7q.js";
10
10
  import {
11
11
  countEntryContradictionsInWindow,
12
12
  countEntryViolationsInWindow,
13
13
  readKnowledgeEvents,
14
14
  recordKnowledgeEvent
15
- } from "./index-asd9n0ms.js";
15
+ } from "./index-6wya5cqh.js";
16
16
  import {
17
17
  init_knowledge_types,
18
18
  isActiveStatus
@@ -190,11 +190,11 @@ async function maybeQuarantineOnContradiction(directory, entryId, threshold, win
190
190
  alreadyInactive: true
191
191
  };
192
192
  }
193
- const { quarantineEntry } = await import("./knowledge-validator-a4wxkgbc.js");
193
+ const { quarantineEntry } = await import("./knowledge-validator-kc7fnt2r.js");
194
194
  let policyConfig;
195
195
  try {
196
- const { KnowledgeConfigSchema } = await import("./schema-6eghf6gt.js");
197
- const { loadPluginConfigWithMeta } = await import("./index-1bytvz73.js");
196
+ const { KnowledgeConfigSchema } = await import("./schema-jb4p8ja9.js");
197
+ const { loadPluginConfigWithMeta } = await import("./index-reesz606.js");
198
198
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
199
199
  policyConfig = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
200
200
  } catch {
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  authorizeCuration
4
- } from "./index-ca44jww3.js";
4
+ } from "./index-y3rj2jgb.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-x60gpbt5.js";
12
+ } from "./index-rjngxx7q.js";
13
13
  import {
14
14
  resolveKnowledgeStoreDir
15
15
  } from "./index-cfkvc5q9.js";
@@ -7,7 +7,7 @@ import {
7
7
  loadPluginConfigWithMeta,
8
8
  loadPluginConfigWithMetaAsync,
9
9
  resolveWorktreeIsolationConfig
10
- } from "./index-n48xwynh.js";
10
+ } from "./index-ddxt327j.js";
11
11
  import {
12
12
  ApprovalEvidenceSchema,
13
13
  BaseEvidenceSchema,
@@ -62,7 +62,7 @@ import {
62
62
  isQAAgent,
63
63
  isSubagent,
64
64
  resolveAutoReviewConfig
65
- } from "./index-v8m282zt.js";
65
+ } from "./index-tsmjmhnk.js";
66
66
  import"./index-bk5tah7q.js";
67
67
  import {
68
68
  MigrationStatusSchema,
@@ -702,7 +702,7 @@ async function applyConfidenceFloorAction(directory, touched, options) {
702
702
  const recovered = touched.filter((e) => e.confidence > CONFIDENCE_FLOOR + FLOOR_EPSILON && e.confidence_floor_demoted);
703
703
  if (atFloor.length === 0 && recovered.length === 0)
704
704
  return;
705
- const { readKnowledgeCounterRollups, effectiveRetrievalOutcomes } = await import("./knowledge-events-kyw0s745.js");
705
+ const { readKnowledgeCounterRollups, effectiveRetrievalOutcomes } = await import("./knowledge-events-ykt8vrvj.js");
706
706
  const rollups = await readKnowledgeCounterRollups(directory);
707
707
  const flagIds = new Set;
708
708
  for (const e of atFloor) {
@@ -769,11 +769,11 @@ async function applyConfidenceFloorAction(directory, touched, options) {
769
769
  });
770
770
  }
771
771
  if (action === "quarantine" && toQuarantine.length > 0) {
772
- const { quarantineEntry } = await import("./knowledge-validator-a4wxkgbc.js");
773
- const { KnowledgeConfigSchema } = await import("./schema-6eghf6gt.js");
772
+ const { quarantineEntry } = await import("./knowledge-validator-kc7fnt2r.js");
773
+ const { KnowledgeConfigSchema } = await import("./schema-jb4p8ja9.js");
774
774
  let config;
775
775
  try {
776
- const { loadPluginConfigWithMeta } = await import("./index-1bytvz73.js");
776
+ const { loadPluginConfigWithMeta } = await import("./index-reesz606.js");
777
777
  const { config: loadedConfig } = loadPluginConfigWithMeta(directory);
778
778
  config = KnowledgeConfigSchema.parse(loadedConfig.knowledge ?? {});
779
779
  } catch {
@@ -19,7 +19,7 @@ var package_default;
19
19
  var init_package = __esm(() => {
20
20
  package_default = {
21
21
  name: "opencode-swarm",
22
- version: "7.134.2",
22
+ version: "7.134.3",
23
23
  description: "Architect-centric agentic swarm plugin for OpenCode - hub-and-spoke orchestration with SME consultation, code generation, and QA review",
24
24
  main: "dist/index.js",
25
25
  types: "dist/index.d.ts",
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-9299e7d5.js";
4
+ } from "./index-yaptf0hg.js";
5
5
  import {
6
6
  handleGuardrailLog
7
- } from "./index-746ga67b.js";
7
+ } from "./index-8wktghbc.js";
8
8
  import {
9
9
  COMMAND_REGISTRY,
10
10
  SWARM_COMMAND_TOOL_ALLOWLIST,
@@ -84,30 +84,30 @@ import {
84
84
  handleWriteRetroCommand,
85
85
  normalizeSwarmCommandInput,
86
86
  resolveCommand
87
- } from "./index-cav39zjt.js";
87
+ } from "./index-6kfqz0jw.js";
88
88
  import"./index-13xxjfhn.js";
89
- import"./index-0dszfjf3.js";
90
- import"./index-ss26e2d4.js";
89
+ import"./index-yqvh2s4w.js";
90
+ import"./index-2b7sv71f.js";
91
91
  import"./index-8fhg2nt2.js";
92
92
  import"./index-4905hd2m.js";
93
93
  import"./index-134d35c1.js";
94
- import"./index-njfcm1tn.js";
95
- import"./index-4cnwvmsm.js";
96
- import"./index-y8vqsm2g.js";
94
+ import"./index-1mq8kmp6.js";
95
+ import"./index-mgr951p8.js";
96
+ import"./index-5f403c30.js";
97
97
  import"./index-vxv732ex.js";
98
98
  import"./index-c8s9a3zh.js";
99
99
  import"./index-9ss2m4rs.js";
100
100
  import"./index-wk1h5ec2.js";
101
101
  import"./index-1j3682j8.js";
102
- import"./index-a0nk83rk.js";
103
- import"./index-ca44jww3.js";
102
+ import"./index-q3m6bpx2.js";
103
+ import"./index-y3rj2jgb.js";
104
104
  import"./index-rtry5xyf.js";
105
- import"./index-x60gpbt5.js";
106
- import"./index-asd9n0ms.js";
105
+ import"./index-rjngxx7q.js";
106
+ import"./index-6wya5cqh.js";
107
107
  import"./index-ae75rja9.js";
108
108
  import"./index-cfkvc5q9.js";
109
109
  import"./index-dd7ttx8x.js";
110
- import"./index-n48xwynh.js";
110
+ import"./index-ddxt327j.js";
111
111
  import"./index-k5jrywpr.js";
112
112
  import"./index-n832052r.js";
113
113
  import {
@@ -116,7 +116,7 @@ import {
116
116
  init_constants,
117
117
  init_schema,
118
118
  stripKnownSwarmPrefix
119
- } from "./index-v8m282zt.js";
119
+ } from "./index-tsmjmhnk.js";
120
120
  import"./index-bk5tah7q.js";
121
121
  import"./index-8fwhhayc.js";
122
122
  import"./index-q1exe2b3.js";
@@ -138,7 +138,7 @@ import"./index-z6xqpmqg.js";
138
138
  import"./index-zjygnfay.js";
139
139
  import"./index-qe3v54nb.js";
140
140
  import"./index-zgwm4ryv.js";
141
- import"./index-h3k62043.js";
141
+ import"./index-3nasn371.js";
142
142
  import"./index-a76rekgs.js";
143
143
 
144
144
  // src/commands/index.ts
@@ -4,7 +4,7 @@ import {
4
4
  } from "./index-rtry5xyf.js";
5
5
  import {
6
6
  readKnowledgeEvents
7
- } from "./index-asd9n0ms.js";
7
+ } from "./index-6wya5cqh.js";
8
8
  import {
9
9
  isLinked,
10
10
  readLinkPointer,
@@ -12,14 +12,14 @@ import {
12
12
  detectPosixWrites,
13
13
  detectWindowsWrites,
14
14
  resolveWriteTargets
15
- } from "./index-cav39zjt.js";
15
+ } from "./index-6kfqz0jw.js";
16
16
  import {
17
17
  checkFileAuthority,
18
18
  classifyFile,
19
19
  isInDeclaredScope,
20
20
  redactPath,
21
21
  redactShellCommand
22
- } from "./index-0dszfjf3.js";
22
+ } from "./index-yqvh2s4w.js";
23
23
 
24
24
  // src/services/guardrail-explain-service.ts
25
25
  import path from "path";
@@ -3,7 +3,7 @@ import {
3
3
  init_constants,
4
4
  init_schema,
5
5
  stripKnownSwarmPrefix
6
- } from "./index-v8m282zt.js";
6
+ } from "./index-tsmjmhnk.js";
7
7
  import {
8
8
  init_logger,
9
9
  warn
package/dist/cli/index.js CHANGED
@@ -6,30 +6,30 @@ import {
6
6
  getPluginConfigDir,
7
7
  getPluginLockFilePaths,
8
8
  resolveCommand
9
- } from "./index-cav39zjt.js";
9
+ } from "./index-6kfqz0jw.js";
10
10
  import"./index-13xxjfhn.js";
11
- import"./index-0dszfjf3.js";
12
- import"./index-ss26e2d4.js";
11
+ import"./index-yqvh2s4w.js";
12
+ import"./index-2b7sv71f.js";
13
13
  import"./index-8fhg2nt2.js";
14
14
  import"./index-4905hd2m.js";
15
15
  import"./index-134d35c1.js";
16
- import"./index-njfcm1tn.js";
17
- import"./index-4cnwvmsm.js";
18
- import"./index-y8vqsm2g.js";
16
+ import"./index-1mq8kmp6.js";
17
+ import"./index-mgr951p8.js";
18
+ import"./index-5f403c30.js";
19
19
  import"./index-vxv732ex.js";
20
20
  import"./index-c8s9a3zh.js";
21
21
  import"./index-9ss2m4rs.js";
22
22
  import"./index-wk1h5ec2.js";
23
23
  import"./index-1j3682j8.js";
24
- import"./index-a0nk83rk.js";
25
- import"./index-ca44jww3.js";
24
+ import"./index-q3m6bpx2.js";
25
+ import"./index-y3rj2jgb.js";
26
26
  import"./index-rtry5xyf.js";
27
- import"./index-x60gpbt5.js";
28
- import"./index-asd9n0ms.js";
27
+ import"./index-rjngxx7q.js";
28
+ import"./index-6wya5cqh.js";
29
29
  import"./index-ae75rja9.js";
30
30
  import"./index-cfkvc5q9.js";
31
31
  import"./index-dd7ttx8x.js";
32
- import"./index-n48xwynh.js";
32
+ import"./index-ddxt327j.js";
33
33
  import"./index-k5jrywpr.js";
34
34
  import"./index-n832052r.js";
35
35
  import {
@@ -37,7 +37,7 @@ import {
37
37
  init_constants,
38
38
  init_package,
39
39
  package_default
40
- } from "./index-v8m282zt.js";
40
+ } from "./index-tsmjmhnk.js";
41
41
  import"./index-bk5tah7q.js";
42
42
  import"./index-8fwhhayc.js";
43
43
  import"./index-q1exe2b3.js";
@@ -59,7 +59,7 @@ import"./index-z6xqpmqg.js";
59
59
  import"./index-zjygnfay.js";
60
60
  import"./index-qe3v54nb.js";
61
61
  import"./index-zgwm4ryv.js";
62
- import"./index-h3k62043.js";
62
+ import"./index-3nasn371.js";
63
63
  import"./index-a76rekgs.js";
64
64
 
65
65
  // src/cli/index.ts
@@ -8,9 +8,9 @@ import {
8
8
  maybeEscalateOnViolation,
9
9
  maybeQuarantineOnContradiction,
10
10
  readRecentEscalations
11
- } from "./index-4cnwvmsm.js";
12
- import"./index-x60gpbt5.js";
13
- import"./index-asd9n0ms.js";
11
+ } from "./index-mgr951p8.js";
12
+ import"./index-rjngxx7q.js";
13
+ import"./index-6wya5cqh.js";
14
14
  import"./index-ae75rja9.js";
15
15
  import"./index-cfkvc5q9.js";
16
16
  import"./index-dd7ttx8x.js";
@@ -26,7 +26,7 @@ import {
26
26
  resolveKnowledgeCounterBaselinePath,
27
27
  resolveKnowledgeEventsPath,
28
28
  resolveLegacyApplicationLogPath
29
- } from "./index-asd9n0ms.js";
29
+ } from "./index-6wya5cqh.js";
30
30
  import"./index-ae75rja9.js";
31
31
  import"./index-cfkvc5q9.js";
32
32
  import"./index-dd7ttx8x.js";
@@ -41,7 +41,7 @@ import {
41
41
  transactKnowledge,
42
42
  transactKnowledgeWithCas,
43
43
  wordBigrams
44
- } from "./index-x60gpbt5.js";
44
+ } from "./index-rjngxx7q.js";
45
45
  import {
46
46
  resolveHiveDataDir
47
47
  } from "./index-ae75rja9.js";
@@ -23,11 +23,11 @@ import {
23
23
  validateLesson,
24
24
  validateSkillCandidatePath,
25
25
  validateSkillPath
26
- } from "./index-a0nk83rk.js";
27
- import"./index-ca44jww3.js";
26
+ } from "./index-q3m6bpx2.js";
27
+ import"./index-y3rj2jgb.js";
28
28
  import"./index-rtry5xyf.js";
29
- import"./index-x60gpbt5.js";
30
- import"./index-asd9n0ms.js";
29
+ import"./index-rjngxx7q.js";
30
+ import"./index-6wya5cqh.js";
31
31
  import"./index-ae75rja9.js";
32
32
  import"./index-cfkvc5q9.js";
33
33
  import"./index-dd7ttx8x.js";
@@ -4,8 +4,8 @@ import {
4
4
  alreadyCuratedThisGeneration,
5
5
  claimNextScanBatch,
6
6
  getScanStatus
7
- } from "./index-y8vqsm2g.js";
8
- import"./index-x60gpbt5.js";
7
+ } from "./index-5f403c30.js";
8
+ import"./index-rjngxx7q.js";
9
9
  import"./index-ae75rja9.js";
10
10
  import"./index-cfkvc5q9.js";
11
11
  import"./index-dd7ttx8x.js";
@@ -93,7 +93,7 @@ import {
93
93
  resolveGeneratedAgentRole,
94
94
  resolveGuardrailsConfig,
95
95
  stripKnownSwarmPrefix
96
- } from "./index-v8m282zt.js";
96
+ } from "./index-tsmjmhnk.js";
97
97
  import"./index-bk5tah7q.js";
98
98
  import"./index-bpmtbmy9.js";
99
99
  import"./index-zjygnfay.js";
@@ -33,12 +33,12 @@ import {
33
33
  sanitizeSlug,
34
34
  selectCandidateEntries,
35
35
  writeEvalStub
36
- } from "./index-njfcm1tn.js";
37
- import"./index-a0nk83rk.js";
38
- import"./index-ca44jww3.js";
36
+ } from "./index-1mq8kmp6.js";
37
+ import"./index-q3m6bpx2.js";
38
+ import"./index-y3rj2jgb.js";
39
39
  import"./index-rtry5xyf.js";
40
- import"./index-x60gpbt5.js";
41
- import"./index-asd9n0ms.js";
40
+ import"./index-rjngxx7q.js";
41
+ import"./index-6wya5cqh.js";
42
42
  import"./index-ae75rja9.js";
43
43
  import"./index-cfkvc5q9.js";
44
44
  import"./index-dd7ttx8x.js";
@@ -7,6 +7,7 @@ import {
7
7
  compareWorkspaceSnapshots,
8
8
  digest,
9
9
  parsePorcelainPaths,
10
+ parsePorcelainV2Snapshot,
10
11
  readGitTextAtRevision,
11
12
  resolveCommitCountSince,
12
13
  resolveCommitCountSinceAsync,
@@ -32,7 +33,7 @@ import {
32
33
  resolveRemoteRefsContainingHead,
33
34
  resolveRemoteRefsContainingHeadAsync,
34
35
  workspaceSnapshotMatches
35
- } from "./index-h3k62043.js";
36
+ } from "./index-3nasn371.js";
36
37
  import"./index-a76rekgs.js";
37
38
  export {
38
39
  workspaceSnapshotMatches,
@@ -60,6 +61,7 @@ export {
60
61
  resolveCommitCountSinceAsync,
61
62
  resolveCommitCountSince,
62
63
  readGitTextAtRevision,
64
+ parsePorcelainV2Snapshot,
63
65
  parsePorcelainPaths,
64
66
  digest,
65
67
  compareWorkspaceSnapshots,
@@ -9,8 +9,8 @@
9
9
  * Input contract (PR reference is optional):
10
10
  * /swarm pr-feedback 155 → feedback pass on PR 155
11
11
  * /swarm pr-feedback 155 also fix the lint errors → PR 155 + extra instructions
12
- * /swarm pr-feedback 155 continue from .swarm/pr-review/<run_id>/feedback-handoff.md
13
- * -> PR 155 + handoff path instructions
12
+ * /swarm pr-feedback 155 continue from .swarm/pr-review/<run_id>/feedback-handoff.json
13
+ * -> PR 155 + exact transition request
14
14
  * /swarm pr-feedback owner/repo#155 → shorthand
15
15
  * /swarm pr-feedback https://github.com/.../pull/155
16
16
  * /swarm pr-feedback → bare signal; architect builds
@@ -22,4 +22,17 @@
22
22
  * PR-reference parsing and injection-hardening are shared with /swarm pr-review
23
23
  * via ./pr-ref.ts.
24
24
  */
25
+ export interface PrFeedbackContinuationRequest {
26
+ runId: string;
27
+ handoffPath: string;
28
+ instructions: string;
29
+ }
30
+ export interface PrFeedbackCommandInput {
31
+ prUrl?: string;
32
+ instructions: string;
33
+ continuation?: PrFeedbackContinuationRequest;
34
+ error?: string;
35
+ errorKind?: 'pr-reference' | 'continuation';
36
+ }
37
+ export declare function parsePrFeedbackCommandInput(directory: string, args: string[]): PrFeedbackCommandInput;
25
38
  export declare function handlePrFeedbackCommand(directory: string, args: string[]): string;
@@ -0,0 +1,37 @@
1
+ import { parsePorcelainV2Snapshot } from '../background/workspace-snapshot.js';
2
+ export type PrWorkflowGitStateKind = 'clean' | 'stashable' | 'recovery-required' | 'indeterminate';
3
+ export interface PrWorkflowGitState {
4
+ kind: PrWorkflowGitStateKind;
5
+ code: 'CLEAN' | 'STASHABLE_CHANGES' | 'UNMERGED_INDEX' | 'GIT_OPERATION_IN_PROGRESS' | 'DIRTY_SUBMODULE' | 'SWARM_STATE_TRACKING_ERROR' | 'GIT_STATE_INDETERMINATE';
6
+ retryable: boolean;
7
+ requiredAction: string;
8
+ evidence: {
9
+ worktreeRoot: string | null;
10
+ gitDir: string | null;
11
+ operations: string[];
12
+ unmergedCodes: string[];
13
+ paths: string[];
14
+ trackedCount: number;
15
+ untrackedCount: number;
16
+ pathsTruncated: boolean;
17
+ detail?: string;
18
+ };
19
+ }
20
+ interface GitCaptureResult {
21
+ ok: boolean;
22
+ stdout: string;
23
+ }
24
+ declare function runGitCapture(directory: string, args: readonly string[]): Promise<GitCaptureResult>;
25
+ declare function activeOperations(gitDir: string): Promise<string[]>;
26
+ /**
27
+ * Classify the checkout before a PR workflow can take ownership of it.
28
+ * Unknown Git state fails closed; ordinary tracked/untracked dirt is explicitly
29
+ * distinguished from conflict and in-progress-operation recovery states.
30
+ */
31
+ export declare function classifyPrWorkflowGitState(directory: string): Promise<PrWorkflowGitState>;
32
+ export declare const _internals: {
33
+ runGitCapture: typeof runGitCapture;
34
+ activeOperations: typeof activeOperations;
35
+ parsePorcelainV2: typeof parsePorcelainV2Snapshot;
36
+ };
37
+ export {};
@@ -1,9 +1,27 @@
1
1
  import * as fsp from 'node:fs/promises';
2
2
  import { resolveCommitCountSince, resolveCommitCountSinceAsync, resolveCurrentGitHead, resolveCurrentGitHeadAsync, resolveCurrentUpstreamPushTarget, resolveCurrentUpstreamPushTargetAsync, resolveCurrentUpstreamRemoteRef, resolveExactRemoteBranchHead, resolveExactRemoteBranchHeadAsync, resolveIsExactSingleChildCommit, resolveIsExactSingleChildCommitAsync, resolveIsWorkingTreeClean, resolveIsWorkingTreeCleanAsync, resolvePrReviewDiffStats, resolvePrReviewDiffStatsAsync, resolvePrWorkflowRevisionDigest, resolveRemoteRefsContainingHead, resolveRemoteRefsContainingHeadAsync } from '../background/workspace-snapshot.js';
3
+ import { type PrWorkflowGitState } from '../git/pr-workflow-state.js';
3
4
  export declare const PR_REVIEW_BASE_DIMENSION_IDS: readonly ["intent-architecture", "correctness-state", "tests-falsifiability", "security-trust", "reliability-performance", "compatibility-delivery"];
4
5
  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
6
  export type PrReviewBaseDimensionId = (typeof PR_REVIEW_BASE_DIMENSION_IDS)[number];
6
7
  export type PrWorkflowMode = 'PR_REVIEW' | 'PR_FEEDBACK';
8
+ export interface PrWorkflowCheckoutRecoveryRecord {
9
+ code: 'UNMERGED_INDEX' | 'GIT_OPERATION_IN_PROGRESS' | 'DIRTY_SUBMODULE' | 'SWARM_STATE_TRACKING_ERROR' | 'GIT_STATE_INDETERMINATE';
10
+ retryable: false;
11
+ requiredAction: string;
12
+ evidence: PrWorkflowGitState['evidence'];
13
+ detectedAt: string;
14
+ }
15
+ export interface PrFeedbackReviewHandoffRecord {
16
+ path: string;
17
+ runId: string;
18
+ sourcePrHeadSha: string;
19
+ prUrl: string;
20
+ findingIds: string[];
21
+ digest: string;
22
+ sourceWorkflowInstanceId: string;
23
+ provenance: 'active-review-v1' | 'external-v1';
24
+ }
7
25
  export type PrReviewDepthTier = 'S' | 'M' | 'L';
8
26
  /**
9
27
  * Objective size thresholds for the controller-computed PR-review depth tier.
@@ -156,6 +174,8 @@ export interface PrWorkflowGateState {
156
174
  schemaVersion: 1;
157
175
  /** Monotonic durable revision used to reject stale same-session transitions. */
158
176
  revision: number;
177
+ /** Stable identity that prevents revision-only ABA during mode replacement. */
178
+ workflowInstanceId?: string;
159
179
  sessionID: string;
160
180
  mode: PrWorkflowMode;
161
181
  activatedAt: string;
@@ -181,6 +201,10 @@ export interface PrWorkflowGateState {
181
201
  prReviewArtifactBoundaries?: PrReviewArtifactBoundary[];
182
202
  prReviewHandoffPath?: string;
183
203
  prReviewHandoffRequired?: boolean;
204
+ checkoutRecovery?: PrWorkflowCheckoutRecoveryRecord;
205
+ /** HTTPS PR URL selected after canonical GitHub PR identity validation. */
206
+ prFeedbackTargetUrl?: string;
207
+ prFeedbackReviewHandoff?: PrFeedbackReviewHandoffRecord;
184
208
  prFeedbackInventory?: string[];
185
209
  prFeedbackVerifications?: PrFeedbackVerificationRecord[];
186
210
  /** @deprecated Compatibility projection of the most recent verification dispatch. */
@@ -192,6 +216,8 @@ export interface PrWorkflowGateState {
192
216
  }
193
217
  export declare function activatePrWorkflow(directory: string, sessionID: string, mode: PrWorkflowMode, options?: {
194
218
  prHeadSha?: string;
219
+ requireCheckoutPreflight?: boolean;
220
+ prUrl?: string;
195
221
  }): Promise<PrWorkflowGateState>;
196
222
  export declare function readPrWorkflowGateState(directory: string, sessionID: string): Promise<PrWorkflowGateState | null>;
197
223
  /**
@@ -202,7 +228,9 @@ export declare function readPrWorkflowGateState(directory: string, sessionID: st
202
228
  * it settles. The state passed to the action is schema-validated durable state,
203
229
  * never a caller-supplied projection.
204
230
  */
205
- export declare function withPrWorkflowCheckoutPreparationLock<T>(directory: string, sessionID: string, action: (state: PrWorkflowGateState) => Promise<T>): Promise<T>;
231
+ export declare function withPrWorkflowCheckoutPreparationLock<T>(directory: string, sessionID: string, action: (state: PrWorkflowGateState, controls: {
232
+ markRecoveryRequired: (gitState: PrWorkflowGitState) => Promise<PrWorkflowGateState>;
233
+ }) => Promise<T>): Promise<T>;
206
234
  export declare function clearPrWorkflowGateState(directory: string, sessionID: string, expectedRevision?: number): Promise<void>;
207
235
  /**
208
236
  * Abort an active PR workflow gate without reaching terminal completion.
@@ -316,6 +344,11 @@ export declare function assertPrReviewArtifactBoundary(directory: string, sessio
316
344
  export declare function assertPrReviewArtifactRecordsMatchAuthoritativeVerdicts(directory: string, sessionID: string, boundary: PrReviewArtifactBoundary, records: readonly PrReviewArtifactRecord[]): Promise<void>;
317
345
  export declare function markPrReviewArtifactBoundary(directory: string, sessionID: string, runId: string, boundary: PrReviewArtifactBoundary, artifactPath: string, findingIds: string[], handoffRequired: boolean): Promise<PrWorkflowGateState>;
318
346
  export declare function markPrReviewHandoffComplete(directory: string, sessionID: string, runId: string, artifactPath: string): Promise<PrWorkflowGateState>;
347
+ export declare function transitionPrReviewToFeedback(directory: string, sessionID: string, request: {
348
+ runId: string;
349
+ handoffPath: string;
350
+ prUrl?: string;
351
+ }): Promise<PrWorkflowGateState>;
319
352
  export declare function declarePrFeedbackScope(directory: string, sessionID: string, taskId: string, files: string[]): Promise<PrWorkflowGateState>;
320
353
  export declare function resolvePrFeedbackScopeDeclaration(directory: string, sessionID: string, taskId: string): Promise<PrFeedbackScopeDeclarationRecord | null>;
321
354
  export declare function consumePrFeedbackScopeDeclaration(directory: string, sessionID: string, taskId: string, callID: string): Promise<PrFeedbackScopeDeclarationRecord | null>;
@@ -334,6 +367,12 @@ export declare const _test_exports: {
334
367
  workflowGateStateLockRelativePath: typeof workflowGateStateLockRelativePath;
335
368
  resetTrackedStateCache: () => void;
336
369
  beforeTerminalClear: (() => Promise<void>) | undefined;
370
+ beforePrFeedbackTransitionLock: (() => Promise<void>) | undefined;
371
+ beforeBoundedSwarmFileOpen: (() => Promise<void>) | undefined;
372
+ beforeSessionStateLockWrite: (() => Promise<void>) | undefined;
373
+ beforeSafeDirectoryCreate: ((parentPath: string, nextPath: string) => Promise<void>) | undefined;
374
+ beforeAtomicTempWrite: (() => Promise<void>) | undefined;
375
+ beforeAtomicRename: (() => Promise<void>) | undefined;
337
376
  resolveCurrentGitHead: typeof resolveCurrentGitHead;
338
377
  resolveCurrentGitHeadAsync: typeof resolveCurrentGitHeadAsync;
339
378
  resolveCurrentUpstreamPushTarget: typeof resolveCurrentUpstreamPushTarget;
@@ -378,10 +417,11 @@ declare function isProcessAlive(pid: number): boolean;
378
417
  declare function workflowGateStateLockRelativePath(sessionID: string): string;
379
418
  declare function workflowGateStateRelativePath(sessionID: string): string;
380
419
  export declare function prWorkflowSessionFileStem(sessionID: string): string;
420
+ export declare function ensurePrWorkflowSafeParentDirectory(directory: string, filePath: string): Promise<string>;
381
421
  /**
382
422
  * Write a PR-workflow artifact with the gate's Windows-safe atomic persistence
383
423
  * contract. Checkout-preparation receipts must survive the same transient
384
424
  * rename contention as canonical gate state.
385
425
  */
386
- export declare function writePrWorkflowAtomicJson(filePath: string, value: unknown): Promise<void>;
426
+ export declare function writePrWorkflowAtomicJson(directory: string, filePath: string, value: unknown): Promise<void>;
387
427
  export {};
@@ -1,6 +1,9 @@
1
+ import { claimPrFeedbackMonitorEvents, readPrFeedbackMonitorQueue } from '../background/pr-feedback-event-queue.js';
1
2
  import { readPrWorkflowGateState } from './pr-workflow-gate.js';
2
3
  export declare const _internals: {
3
4
  readPrWorkflowGateState: typeof readPrWorkflowGateState;
5
+ claimPrFeedbackMonitorEvents: typeof claimPrFeedbackMonitorEvents;
6
+ readPrFeedbackMonitorQueue: typeof readPrFeedbackMonitorQueue;
4
7
  };
5
8
  /**
6
9
  * Maximum number of consecutive unproductive auto-resumes per gated session