opencode-swarm 7.125.6 → 7.126.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/.opencode/skills/brainstorm/SKILL.md +18 -14
  2. package/.opencode/skills/plan/SKILL.md +21 -15
  3. package/.opencode/skills/specify/SKILL.md +18 -14
  4. package/.opencode/skills/swarm-pr-feedback/SKILL.md +19 -14
  5. package/.opencode/skills/swarm-pr-review/SKILL.md +17 -13
  6. package/dist/agents/architect.d.ts +9 -7
  7. package/dist/cli/{config-doctor-akxywx0c.js → config-doctor-23jxdqwv.js} +2 -2
  8. package/dist/cli/{core-v1kp7anb.js → core-wg3re04e.js} +1 -1
  9. package/dist/cli/{curation-policy-62w2pwfz.js → curation-policy-0t6hny6g.js} +2 -2
  10. package/dist/cli/{curator-gke6nrc4.js → curator-g8rggzbk.js} +14 -14
  11. package/dist/cli/{curator-llm-factory-40c4852v.js → curator-llm-factory-36psae60.js} +14 -14
  12. package/dist/cli/{guardrail-explain-m34vcgjg.js → guardrail-explain-6ffgrjx9.js} +15 -15
  13. package/dist/cli/{guardrail-log-222xyxfp.js → guardrail-log-57sczn5h.js} +3 -3
  14. package/dist/cli/{hive-promoter-6fg3redm.js → hive-promoter-c458rgp5.js} +14 -14
  15. package/dist/cli/{index-qzkcy22e.js → index-1p9z8cc4.js} +1 -1
  16. package/dist/cli/{index-e315gwc9.js → index-3hkbegq2.js} +1 -1
  17. package/dist/cli/{index-gnvg72y1.js → index-4ff0x4cg.js} +79 -1
  18. package/dist/cli/{index-yq4s3q43.js → index-6j9p0c40.js} +2 -2
  19. package/dist/cli/{index-74xejn4v.js → index-abw10n3f.js} +139 -83
  20. package/dist/cli/{index-r1gdkn2d.js → index-c8sqc3nh.js} +113 -21
  21. package/dist/cli/{index-gbnpz7rh.js → index-cnhp6c0k.js} +1 -1
  22. package/dist/cli/{index-dezgmvtw.js → index-echdpdhy.js} +1 -1
  23. package/dist/cli/{index-gd5w3ef8.js → index-k5xh81c9.js} +3 -3
  24. package/dist/cli/{index-1htanqp1.js → index-kx3533dm.js} +1 -1
  25. package/dist/cli/{index-0f45t7xy.js → index-nkhp7j16.js} +5 -5
  26. package/dist/cli/{index-1012f47p.js → index-nmyg9b7v.js} +4 -4
  27. package/dist/cli/{index-4b1e5m0d.js → index-vvwf9ark.js} +2 -2
  28. package/dist/cli/{index-jt7hnr7q.js → index-w0yztxgq.js} +1 -1
  29. package/dist/cli/{index-g4ef4v3m.js → index-w9cb5zwh.js} +1 -1
  30. package/dist/cli/{index-1cxp3b5y.js → index-x1w4cx3n.js} +2 -2
  31. package/dist/cli/{index-d17kqe54.js → index-y9t766sw.js} +4950 -4890
  32. package/dist/cli/{index-zp330ss0.js → index-yf4kvhrn.js} +16 -16
  33. package/dist/cli/index.js +14 -14
  34. package/dist/cli/{knowledge-escalator-h3hg7ek7.js → knowledge-escalator-kd80m9vp.js} +3 -3
  35. package/dist/cli/{knowledge-events-jtr66wxz.js → knowledge-events-j7jfwm1d.js} +1 -1
  36. package/dist/cli/{knowledge-store-69ttjjjs.js → knowledge-store-1d4byc7y.js} +1 -1
  37. package/dist/cli/{knowledge-validator-yn06rh13.js → knowledge-validator-63mkgt9x.js} +4 -4
  38. package/dist/cli/{scan-cursor-r0w2p5gz.js → scan-cursor-qzn5jmbe.js} +2 -2
  39. package/dist/cli/{schema-69z8w1ka.js → schema-2j92wnns.js} +1 -1
  40. package/dist/cli/{scope-persistence-habn4q8a.js → scope-persistence-dm5bab50.js} +3 -1
  41. package/dist/cli/{skill-generator-a7xfyddq.js → skill-generator-sv6zvdvz.js} +5 -5
  42. package/dist/commands/turbo-constants.d.ts +6 -0
  43. package/dist/config/constants.d.ts +1 -1
  44. package/dist/config/index.d.ts +1 -0
  45. package/dist/config/loader.d.ts +51 -10
  46. package/dist/hooks/pr-workflow-gate.d.ts +39 -0
  47. package/dist/hooks/scope-guard.d.ts +6 -1
  48. package/dist/index.js +47 -84
  49. package/dist/scope/scope-binding.d.ts +21 -2
  50. package/dist/scope/scope-persistence.d.ts +6 -0
  51. package/dist/tools/index.d.ts +2 -0
  52. package/dist/tools/manifest.d.ts +2 -0
  53. package/dist/tools/prepare-pr-feedback-scope.d.ts +5 -0
  54. package/dist/tools/tool-metadata.d.ts +98 -0
  55. package/dist/tools/write-pr-review-artifact.d.ts +5 -0
  56. package/package.json +4 -3
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  handleGuardrailExplain
4
- } from "./index-1cxp3b5y.js";
4
+ } from "./index-x1w4cx3n.js";
5
5
  import {
6
6
  handleGuardrailLog
7
- } from "./index-qzkcy22e.js";
7
+ } from "./index-1p9z8cc4.js";
8
8
  import {
9
9
  COMMAND_REGISTRY,
10
10
  SWARM_COMMAND_TOOL_ALLOWLIST,
@@ -83,28 +83,28 @@ import {
83
83
  handleWriteRetroCommand,
84
84
  normalizeSwarmCommandInput,
85
85
  resolveCommand
86
- } from "./index-d17kqe54.js";
87
- import"./index-dezgmvtw.js";
88
- import"./index-jt7hnr7q.js";
86
+ } from "./index-y9t766sw.js";
87
+ import"./index-echdpdhy.js";
88
+ import"./index-w0yztxgq.js";
89
89
  import"./index-kk1scggc.js";
90
90
  import"./index-4905hd2m.js";
91
91
  import"./index-134d35c1.js";
92
92
  import"./index-6n2jpz7x.js";
93
- import"./index-gd5w3ef8.js";
94
- import"./index-0f45t7xy.js";
95
- import"./index-e315gwc9.js";
93
+ import"./index-k5xh81c9.js";
94
+ import"./index-nkhp7j16.js";
95
+ import"./index-3hkbegq2.js";
96
96
  import"./index-vxv732ex.js";
97
97
  import"./index-c8s9a3zh.js";
98
98
  import"./index-9ss2m4rs.js";
99
99
  import"./index-23zsx7dm.js";
100
- import"./index-yq4s3q43.js";
101
- import"./index-1htanqp1.js";
100
+ import"./index-6j9p0c40.js";
101
+ import"./index-kx3533dm.js";
102
102
  import"./index-rtry5xyf.js";
103
- import"./index-1012f47p.js";
104
- import"./index-gbnpz7rh.js";
103
+ import"./index-nmyg9b7v.js";
104
+ import"./index-cnhp6c0k.js";
105
105
  import"./index-ae75rja9.js";
106
106
  import"./index-q27bajqb.js";
107
- import"./index-74xejn4v.js";
107
+ import"./index-abw10n3f.js";
108
108
  import"./index-k5jrywpr.js";
109
109
  import"./index-n832052r.js";
110
110
  import {
@@ -113,14 +113,14 @@ import {
113
113
  init_constants,
114
114
  init_schema,
115
115
  stripKnownSwarmPrefix
116
- } from "./index-r1gdkn2d.js";
116
+ } from "./index-c8sqc3nh.js";
117
117
  import"./index-bk5tah7q.js";
118
118
  import"./index-8fwhhayc.js";
119
119
  import"./index-q1exe2b3.js";
120
- import"./index-gnvg72y1.js";
120
+ import"./index-4ff0x4cg.js";
121
121
  import"./index-2tn5h2zp.js";
122
122
  import"./index-1kz6da87.js";
123
- import"./index-g4ef4v3m.js";
123
+ import"./index-w9cb5zwh.js";
124
124
  import"./index-4rhhvd1a.js";
125
125
  import"./index-0cz1ws47.js";
126
126
  import"./index-2445sx3d.js";
package/dist/cli/index.js CHANGED
@@ -7,41 +7,41 @@ import {
7
7
  getPluginLockFilePaths,
8
8
  package_default,
9
9
  resolveCommand
10
- } from "./index-d17kqe54.js";
11
- import"./index-dezgmvtw.js";
12
- import"./index-jt7hnr7q.js";
10
+ } from "./index-y9t766sw.js";
11
+ import"./index-echdpdhy.js";
12
+ import"./index-w0yztxgq.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-gd5w3ef8.js";
18
- import"./index-0f45t7xy.js";
19
- import"./index-e315gwc9.js";
17
+ import"./index-k5xh81c9.js";
18
+ import"./index-nkhp7j16.js";
19
+ import"./index-3hkbegq2.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-yq4s3q43.js";
25
- import"./index-1htanqp1.js";
24
+ import"./index-6j9p0c40.js";
25
+ import"./index-kx3533dm.js";
26
26
  import"./index-rtry5xyf.js";
27
- import"./index-1012f47p.js";
28
- import"./index-gbnpz7rh.js";
27
+ import"./index-nmyg9b7v.js";
28
+ import"./index-cnhp6c0k.js";
29
29
  import"./index-ae75rja9.js";
30
30
  import"./index-q27bajqb.js";
31
- import"./index-74xejn4v.js";
31
+ import"./index-abw10n3f.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-r1gdkn2d.js";
37
+ } from "./index-c8sqc3nh.js";
38
38
  import"./index-bk5tah7q.js";
39
39
  import"./index-8fwhhayc.js";
40
40
  import"./index-q1exe2b3.js";
41
- import"./index-gnvg72y1.js";
41
+ import"./index-4ff0x4cg.js";
42
42
  import"./index-2tn5h2zp.js";
43
43
  import"./index-1kz6da87.js";
44
- import"./index-g4ef4v3m.js";
44
+ import"./index-w9cb5zwh.js";
45
45
  import"./index-4rhhvd1a.js";
46
46
  import"./index-0cz1ws47.js";
47
47
  import"./index-2445sx3d.js";
@@ -8,9 +8,9 @@ import {
8
8
  maybeEscalateOnViolation,
9
9
  maybeQuarantineOnContradiction,
10
10
  readRecentEscalations
11
- } from "./index-0f45t7xy.js";
12
- import"./index-1012f47p.js";
13
- import"./index-gbnpz7rh.js";
11
+ } from "./index-nkhp7j16.js";
12
+ import"./index-nmyg9b7v.js";
13
+ import"./index-cnhp6c0k.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-gbnpz7rh.js";
29
+ } from "./index-cnhp6c0k.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-1012f47p.js";
43
+ } from "./index-nmyg9b7v.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-yq4s3q43.js";
27
- import"./index-1htanqp1.js";
26
+ } from "./index-6j9p0c40.js";
27
+ import"./index-kx3533dm.js";
28
28
  import"./index-rtry5xyf.js";
29
- import"./index-1012f47p.js";
30
- import"./index-gbnpz7rh.js";
29
+ import"./index-nmyg9b7v.js";
30
+ import"./index-cnhp6c0k.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-e315gwc9.js";
8
- import"./index-1012f47p.js";
7
+ } from "./index-3hkbegq2.js";
8
+ import"./index-nmyg9b7v.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-r1gdkn2d.js";
92
+ } from "./index-c8sqc3nh.js";
93
93
  import"./index-bk5tah7q.js";
94
94
  import"./index-zjygnfay.js";
95
95
  import"./index-bpmtbmy9.js";
@@ -6,12 +6,13 @@ import {
6
6
  readPlanScope,
7
7
  readScopeBindingFromDisk,
8
8
  readScopeFromDisk,
9
+ resolveAuthorizedPrFeedbackScopeBindingFromDisk,
9
10
  resolveAuthorizedScopeBinding,
10
11
  resolveAuthorizedScopeBindingForSession,
11
12
  resolveScopeWithFallbacks,
12
13
  writeScopeBindingToDisk,
13
14
  writeScopeToDisk
14
- } from "./index-gnvg72y1.js";
15
+ } from "./index-4ff0x4cg.js";
15
16
  import"./index-2tn5h2zp.js";
16
17
  import"./index-1kz6da87.js";
17
18
  import"./index-zgwm4ryv.js";
@@ -27,6 +28,7 @@ export {
27
28
  resolveScopeWithFallbacks,
28
29
  resolveAuthorizedScopeBindingForSession,
29
30
  resolveAuthorizedScopeBinding,
31
+ resolveAuthorizedPrFeedbackScopeBindingFromDisk,
30
32
  readScopeFromDisk,
31
33
  readScopeBindingFromDisk,
32
34
  readPlanScope,
@@ -33,12 +33,12 @@ import {
33
33
  sanitizeSlug,
34
34
  selectCandidateEntries,
35
35
  writeEvalStub
36
- } from "./index-gd5w3ef8.js";
37
- import"./index-yq4s3q43.js";
38
- import"./index-1htanqp1.js";
36
+ } from "./index-k5xh81c9.js";
37
+ import"./index-6j9p0c40.js";
38
+ import"./index-kx3533dm.js";
39
39
  import"./index-rtry5xyf.js";
40
- import"./index-1012f47p.js";
41
- import"./index-gbnpz7rh.js";
40
+ import"./index-nmyg9b7v.js";
41
+ import"./index-cnhp6c0k.js";
42
42
  import"./index-ae75rja9.js";
43
43
  import"./index-q27bajqb.js";
44
44
  import"./index-bk5tah7q.js";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Single source of truth for the gate-bypass enumeration in Turbo enable messages.
3
+ * Used by all four standard-Turbo enable return strings and by the registry help text.
4
+ * Kept in a separate file to avoid circular-import issues between turbo.ts and registry.ts.
5
+ */
6
+ export declare const TURBO_BYPASS_DISCLOSURE: string;
@@ -82,7 +82,7 @@ export declare const COMPACTION_DEFAULTS: {
82
82
  readonly emergencyThreshold: 80;
83
83
  readonly preserveLastNTurns: 5;
84
84
  };
85
- export declare const TURBO_MODE_BANNER = "## \uD83D\uDE80 TURBO MODE ACTIVE\n\n**Speed optimization enabled for this session.**\n\nWhile Turbo Mode is active:\n- **Stage A gates** (lint, imports, pre_check_batch) are still REQUIRED for ALL tasks\n- **Tier 3 tasks** (security-sensitive files matching: architect*.ts, delegation*.ts, guardrails*.ts, adversarial*.ts, sanitiz*.ts, auth*, permission*, crypto*, secret*, security) still require FULL review (Stage B)\n- **Tier 0-2 tasks** can skip Stage B (reviewer, test_engineer) to speed up execution\n- **Phase completion gates** (completion-verify and drift verification gate) are automatically bypassed \u2014 phase_complete will succeed without drift verification evidence when turbo is active. Note: turbo bypass is session-scoped; one session's turbo does not affect other sessions.\n\nClassification still determines the pipeline:\n- TIER 0 (metadata): lint + diff only \u2014 no change\n- TIER 1 (docs): Stage A + reviewer \u2014 no change\n- TIER 2 (standard code): Stage A + reviewer + test_engineer \u2014 CAN SKIP Stage B with turboMode\n- TIER 3 (critical): Stage A + 2x reviewer + 2x test_engineer \u2014 Stage B REQUIRED (no turbo bypass)\n\nDo NOT skip Stage A gates. Do NOT skip Stage B for TIER 3.\n";
85
+ export declare const TURBO_MODE_BANNER = "## \uD83D\uDE80 TURBO MODE ACTIVE\n\n**Speed optimization enabled for this session.**\n\nWhile Turbo Mode is active:\n- **Stage A gates** (lint, imports, pre_check_batch) are still REQUIRED for ALL tasks\n- **Tier 3 tasks** (security-sensitive files matching: architect*.ts, delegation*.ts, guardrails*.ts, adversarial*.ts, sanitiz*.ts, auth*, permission*, crypto*, secret*, security) still require FULL review (Stage B)\n- **Tier 0-2 tasks** can skip Stage B (reviewer, test_engineer) to speed up execution\n- **Phase completion gates** (Gates 1\u20135: completion-verify, drift-verifier, hallucination-guard, mutation-gate, phase-council) are automatically bypassed via the orchestrator short-circuit at `src/tools/phase-complete.ts:774\u2013827` when turbo is active; Gate 5b (architecture-supervisor), Gate 6 (final-council), and Gate 7 (full-auto) remain enforced. Note: turbo bypass is session-scoped; one session's turbo does not affect other sessions.\n\nClassification still determines the pipeline:\n- TIER 0 (metadata): lint + diff only \u2014 no change\n- TIER 1 (docs): Stage A + reviewer \u2014 no change\n- TIER 2 (standard code): Stage A + reviewer + test_engineer \u2014 CAN SKIP Stage B with turboMode\n- TIER 3 (critical): Stage A + 2x reviewer + 2x test_engineer \u2014 Stage B REQUIRED (no turbo bypass)\n\nDo NOT skip Stage A gates. Do NOT skip Stage B for TIER 3.\n";
86
86
  export declare const FULL_AUTO_BANNER = "## \u26A1 FULL-AUTO MODE ACTIVE\n\nYou are operating without a human in the loop. All escalations route to the Autonomous Oversight Critic instead of a user.\n\nBehavioral changes:\n- TIER 3 escalations go to the critic, not a human. Frame your questions technically, not conversationally.\n- Phase completion approval comes from the critic. Ensure all evidence is written before requesting.\n- The critic defaults to REJECT. Do not attempt to pressure, negotiate, or shortcut. Complete the evidence trail.\n- If the critic returns ESCALATE_TO_HUMAN, the session will pause or terminate. Only the critic can trigger this.\n- Do NOT ask \"Ready for Phase N+1?\" \u2014 call phase_complete directly. The critic reviews automatically.\n";
87
87
  export declare const AUTO_PROCEED_BANNER = "## \u23ED\uFE0F AUTO-PROCEED STATUS\n\nAuto-proceed controls whether the architect advances to the next phase automatically (skipping the \"Ready for Phase N+1?\" confirmation).\n\nBehavioral rules:\n- Session override (set via /swarm auto-proceed on|off) wins over the plan default.\n- If neither is set, auto-proceed defaults to OFF and the architect asks before advancing.\n- Full-auto mode (critic oversight) is independent \u2014 it has its own auto-advance mechanism.\n- autoProceedNudgeDone prevents the FR-004 first-boundary nudge from re-firing in this session.\n\nTo toggle at runtime: call swarm_command({ command: \"auto-proceed\", args: [\"on\"|\"off\"] }) from the architect.\n";
88
88
  /**
@@ -2,6 +2,7 @@ export type { AgentName, PipelineAgentName, QAAgentName, } from './constants';
2
2
  export { ALL_AGENT_NAMES, ALL_SUBAGENT_NAMES, DEFAULT_MODELS, isQAAgent, isSubagent, ORCHESTRATOR_NAME, PIPELINE_AGENTS, QA_AGENTS, } from './constants';
3
3
  export type { ApprovalEvidence, BaseEvidence, DiffEvidence, Evidence, EvidenceBundle, EvidenceType, EvidenceVerdict, NoteEvidence, ReviewEvidence, TestEvidence, } from './evidence-schema';
4
4
  export { ApprovalEvidenceSchema, BaseEvidenceSchema, DiffEvidenceSchema, EVIDENCE_MAX_JSON_BYTES, EVIDENCE_MAX_PATCH_BYTES, EVIDENCE_MAX_TASK_BYTES, EvidenceBundleSchema, EvidenceSchema, EvidenceTypeSchema, EvidenceVerdictSchema, NoteEvidenceSchema, ReviewEvidenceSchema, TestEvidenceSchema, } from './evidence-schema';
5
+ export type { ConfigBuildResult, ConfigLoadResult, ConfigRecovery, } from './loader';
5
6
  export { loadAgentPrompt, loadPluginConfig, loadPluginConfigWithMeta, loadPluginConfigWithMetaAsync, } from './loader';
6
7
  import { loadPluginConfigWithMeta } from './loader';
7
8
  /**
@@ -15,14 +15,35 @@ export { deepMerge, MAX_MERGE_DEPTH } from '../utils/merge';
15
15
  * raw dump of the user's config values.
16
16
  */
17
17
  export declare function formatZodIssues(error: z.ZodError): string;
18
- export declare function loadPluginConfig(directory: string): PluginConfig;
19
18
  /**
20
- * Internal variant of loadPluginConfig that also returns loader metadata.
21
- * Used only by src/index.ts to determine guardrails fallback behavior.
22
- * NOT part of the public API — use loadPluginConfig() for all other callers.
19
+ * Recovery classification returned by `buildConfigWithMeta`.
20
+ *
21
+ * 'none' – config parsed cleanly, no keys removed.
22
+ * 'stripped_keys' – pre-Zod section sanitization (gates, external_skills)
23
+ * and/or Zod-targeted key removal dropped some keys;
24
+ * the remaining configuration was preserved.
25
+ * 'user_only' – project config was discarded (failed validation and
26
+ * targeted recovery); user config alone was used.
27
+ * 'guardrails_defaults'– neither merged nor user config was recoverable;
28
+ * fell back to fail-secure guardrails-only defaults.
23
29
  */
24
- export declare function loadPluginConfigWithMeta(directory: string): {
30
+ export type ConfigRecovery = 'none' | 'stripped_keys' | 'user_only' | 'guardrails_defaults';
31
+ /** Full result from the shared config-build core. */
32
+ export type ConfigBuildResult = {
25
33
  config: PluginConfig;
34
+ recovery: ConfigRecovery;
35
+ /** Dotted key paths that were removed during recovery (gates, Zod strict, etc.). */
36
+ removedKeys: string[];
37
+ /** Human-readable summary messages about the recovery action. */
38
+ warnings: string[];
39
+ };
40
+ /**
41
+ * Full result from `loadPluginConfigWithMeta` and `loadPluginConfigWithMetaAsync`.
42
+ * Extends `ConfigBuildResult` with I/O-layer fields about whether a config
43
+ * file was found and whether it could be read.
44
+ */
45
+ export type ConfigLoadResult = ConfigBuildResult & {
46
+ /** True when at least one config file (user or project) existed on disk. */
26
47
  loadedFromFile: boolean;
27
48
  /** True when a config file existed but could not be loaded (corrupt JSON,
28
49
  * oversized, permission error). Consumers with fail-closed semantics —
@@ -30,15 +51,35 @@ export declare function loadPluginConfigWithMeta(directory: string): {
30
51
  * "config unknown", not "config defaults". */
31
52
  configHadErrors: boolean;
32
53
  };
54
+ /**
55
+ * Load plugin configuration from user and project config files.
56
+ *
57
+ * Config locations:
58
+ * 1. User config: ~/.config/opencode/opencode-swarm.json
59
+ * 2. Project config: <directory>/.opencode/opencode-swarm.json
60
+ *
61
+ * Project config takes precedence. Nested objects are deep-merged, except
62
+ * `full_auto.locked`: it is a hard-off and OR-merges across both levels, so
63
+ * `locked: true` at either level cannot be overridden by `locked: false`.
64
+ * IMPORTANT: Raw configs are merged BEFORE Zod parsing so that
65
+ * Zod defaults don't override explicit user values.
66
+ */
67
+ export declare function loadPluginConfig(directory: string): PluginConfig;
68
+ /**
69
+ * Variant of `loadPluginConfig` that also returns loader metadata, including
70
+ * recovery classification, removed keys, and warning messages. All callers
71
+ * that need to surface config-health information (doctor, command-return) use
72
+ * this function. `buildConfigWithMeta` is the shared core — files are read
73
+ * exactly once, no double-read.
74
+ */
75
+ export declare function loadPluginConfigWithMeta(directory: string): ConfigLoadResult;
33
76
  /**
34
77
  * Async variant of `loadPluginConfigWithMeta`. Used by the plugin entry
35
78
  * (issue #704) so initialization does not perform synchronous fs reads.
79
+ * Calls the same `buildConfigWithMeta` shared core as the sync path — the
80
+ * only difference is that file I/O uses `node:fs/promises` (issue #1900 FR-1).
36
81
  */
37
- export declare function loadPluginConfigWithMetaAsync(directory: string): Promise<{
38
- config: PluginConfig;
39
- loadedFromFile: boolean;
40
- configHadErrors: boolean;
41
- }>;
82
+ export declare function loadPluginConfigWithMetaAsync(directory: string): Promise<ConfigLoadResult>;
42
83
  /**
43
84
  * Load custom prompt for an agent from the prompts directory.
44
85
  * Checks for {agent}.md (replaces default) and {agent}_append.md (appends).
@@ -79,6 +79,20 @@ interface PrFeedbackReadyToPublishRecord {
79
79
  }
80
80
  export type PrWorkflowCompletionStatus = 'completed' | 'ready-to-publish';
81
81
  export type PrReviewValidationPhase = 'council' | 'reviewer' | 'critic';
82
+ export type PrReviewArtifactBoundary = 'post_explorer' | 'post_reviewer' | 'post_critic';
83
+ type PrReviewArtifactRecord = {
84
+ finding_id: string;
85
+ status: 'PENDING' | 'CONFIRMED' | 'DISPROVED' | 'PRE_EXISTING';
86
+ next_action: 'route_to_reviewer' | 'route_to_critic' | 'report' | 'suppress_with_reason' | 'handoff_to_feedback';
87
+ severity?: 'CRITICAL' | 'HIGH' | 'MEDIUM' | 'LOW';
88
+ };
89
+ interface PrFeedbackScopeDeclarationRecord {
90
+ taskId: string;
91
+ files: string[];
92
+ revisionDigest: string;
93
+ declaredAt: string;
94
+ consumedByCallId?: string;
95
+ }
82
96
  interface PrReviewValidationBatchRecord {
83
97
  batchId: string;
84
98
  phase: PrReviewValidationPhase;
@@ -105,6 +119,11 @@ export interface PrWorkflowGateState {
105
119
  prReviewBaseDispatch?: PrReviewBaseDispatchRecord;
106
120
  prReviewTriggerEvalPath?: string;
107
121
  prReviewValidationBatches?: PrReviewValidationBatchRecord[];
122
+ prReviewArtifactRunId?: string;
123
+ prReviewFindingsPath?: string;
124
+ prReviewArtifactBoundaries?: PrReviewArtifactBoundary[];
125
+ prReviewHandoffPath?: string;
126
+ prReviewHandoffRequired?: boolean;
108
127
  prFeedbackInventory?: string[];
109
128
  prFeedbackVerifications?: PrFeedbackVerificationRecord[];
110
129
  /** @deprecated Compatibility projection of the most recent verification dispatch. */
@@ -112,6 +131,7 @@ export interface PrWorkflowGateState {
112
131
  prFeedbackStageA?: PrFeedbackStageARecord;
113
132
  prFeedbackGateBatches?: PrFeedbackGateBatchRecord[];
114
133
  prFeedbackReadyToPublish?: PrFeedbackReadyToPublishRecord;
134
+ prFeedbackScopes?: PrFeedbackScopeDeclarationRecord[];
115
135
  }
116
136
  export declare function activatePrWorkflow(directory: string, sessionID: string, mode: PrWorkflowMode, options?: {
117
137
  prHeadSha?: string;
@@ -210,6 +230,25 @@ export declare function assertPrFeedbackGatePhaseSettled(directory: string, sess
210
230
  /** Require every ordered feedback gate on one unchanged revision. */
211
231
  export declare function assertPrFeedbackReadyToPublish(directory: string, sessionID: string): Promise<PrWorkflowGateState>;
212
232
  export declare function markPrReviewTriggerEvaluationComplete(directory: string, sessionID: string, artifactPath: string): Promise<PrWorkflowGateState>;
233
+ export declare function assertPrReviewArtifactBoundary(directory: string, sessionID: string, runId: string, boundary: PrReviewArtifactBoundary, findingIds: string[]): Promise<PrWorkflowGateState>;
234
+ /**
235
+ * Artifact records are a projection of lane receipts, never a caller-controlled
236
+ * replacement for them. Keep their workflow status/action aligned with the
237
+ * reviewer and critic rows that the gate already authenticated.
238
+ */
239
+ export declare function assertPrReviewArtifactRecordsMatchAuthoritativeVerdicts(directory: string, sessionID: string, boundary: PrReviewArtifactBoundary, records: readonly PrReviewArtifactRecord[]): Promise<void>;
240
+ export declare function markPrReviewArtifactBoundary(directory: string, sessionID: string, runId: string, boundary: PrReviewArtifactBoundary, artifactPath: string, findingIds: string[], handoffRequired: boolean): Promise<PrWorkflowGateState>;
241
+ export declare function markPrReviewHandoffComplete(directory: string, sessionID: string, runId: string, artifactPath: string): Promise<PrWorkflowGateState>;
242
+ export declare function declarePrFeedbackScope(directory: string, sessionID: string, taskId: string, files: string[]): Promise<PrWorkflowGateState>;
243
+ export declare function resolvePrFeedbackScopeDeclaration(directory: string, sessionID: string, taskId: string): Promise<PrFeedbackScopeDeclarationRecord | null>;
244
+ export declare function consumePrFeedbackScopeDeclaration(directory: string, sessionID: string, taskId: string, callID: string): Promise<PrFeedbackScopeDeclarationRecord | null>;
245
+ export declare function validatePrFeedbackScopeBinding(directory: string, binding: {
246
+ taskId: string;
247
+ files: string[];
248
+ dispatchCallId?: string;
249
+ workflowSessionId?: string;
250
+ workflowRevisionDigest?: string;
251
+ }): Promise<boolean>;
213
252
  export declare function enforcePrWorkflowToolBefore(directory: string, sessionID: string, toolName: string, args: Record<string, unknown> | undefined, generatedAgentNames?: readonly string[]): Promise<void>;
214
253
  /** Validate the terminal PR workflow contract before removing its durable gate. */
215
254
  export declare function completePrWorkflow(directory: string, sessionID: string, expectedMode: PrWorkflowMode, prHeadSha: string): Promise<PrWorkflowCompletionStatus>;
@@ -8,8 +8,10 @@
8
8
  * Fires BEFORE write/edit tools execute. When a coder attempts to modify a file
9
9
  * outside its Task-correlated scope, blocks the call and injects an advisory.
10
10
  */
11
- import { resolveAuthorizedScopeBinding, resolveAuthorizedScopeBindingForSession } from '../scope/scope-persistence';
11
+ import { getAuthorizedPrFeedbackScopeBinding } from '../scope/scope-binding';
12
+ import { resolveAuthorizedPrFeedbackScopeBindingFromDisk, resolveAuthorizedScopeBinding, resolveAuthorizedScopeBindingForSession } from '../scope/scope-persistence';
12
13
  import { type AgentSessionState } from '../state';
14
+ import { validatePrFeedbackScopeBinding } from './pr-workflow-gate';
13
15
  import { resolveWriteTargets } from './write-target-resolver';
14
16
  /**
15
17
  * Configuration for scope guard behavior.
@@ -69,6 +71,9 @@ export declare const _internals: {
69
71
  resolveWriteTargets: typeof resolveWriteTargets;
70
72
  resolveAuthorizedScopeBinding: typeof resolveAuthorizedScopeBinding;
71
73
  resolveAuthorizedScopeBindingForSession: typeof resolveAuthorizedScopeBindingForSession;
74
+ getAuthorizedPrFeedbackScopeBinding: typeof getAuthorizedPrFeedbackScopeBinding;
75
+ resolveAuthorizedPrFeedbackScopeBindingFromDisk: typeof resolveAuthorizedPrFeedbackScopeBindingFromDisk;
76
+ validatePrFeedbackScopeBinding: typeof validatePrFeedbackScopeBinding;
72
77
  resolveTaskId: (session: AgentSessionState | undefined) => string | null;
73
78
  };
74
79
  export {};