@heretek-ai/epistemic-swarm 0.2.3 → 0.3.0

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 (138) hide show
  1. package/.agents/skills/brainstorming/SKILL.md +13 -0
  2. package/.agents/skills/code_audit/SKILL.md +13 -0
  3. package/.agents/skills/epistemic_search/SKILL.md +13 -0
  4. package/.agents/skills/grilling/SKILL.md +13 -0
  5. package/.agents/skills/oss_scout/SKILL.md +13 -0
  6. package/.agents/skills/research_cache/SKILL.md +13 -0
  7. package/.agents/skills/swarm_config/SKILL.md +13 -0
  8. package/.claude-plugin/plugin.json +15 -5
  9. package/.omp/README.md +39 -0
  10. package/.omp/SYSTEM.md +12 -0
  11. package/.omp/commands/audit.md +10 -0
  12. package/.omp/commands/brainstorming.md +12 -0
  13. package/.omp/commands/grill.md +9 -0
  14. package/.omp/commands/scout.md +10 -0
  15. package/.omp/commands/swarm-config.md +10 -0
  16. package/.omp/commands/swarm.md +9 -0
  17. package/.omp/hooks/post/epistemic-audit.ts +16 -0
  18. package/.omp/hooks/pre/epistemic-redirect.ts +21 -0
  19. package/.omp/prompts/brainstorming.md +8 -0
  20. package/.omp/prompts/swarm.md +8 -0
  21. package/MARKETPLACE.md +8 -0
  22. package/README.md +32 -3
  23. package/bin/cli.js +27 -3
  24. package/config/domain_packs/biopharma.json +23 -0
  25. package/config/domain_packs/legal.json +19 -0
  26. package/config/domain_packs/quant.json +19 -0
  27. package/config/mcp-research-servers.json +7 -0
  28. package/config/mcp_launcher.py +48 -137
  29. package/config/opencode-snippet.json +20 -1
  30. package/config/searxng_mcp.py +42 -83
  31. package/extensions/pi/index.js +138 -73
  32. package/install.sh +20 -4
  33. package/package.json +40 -5
  34. package/plugins/antigravity/README.md +28 -0
  35. package/plugins/antigravity/agents/alpha-thesis.md +6 -0
  36. package/plugins/antigravity/agents/beta-antithesis.md +7 -0
  37. package/plugins/antigravity/agents/brainstormer.md +7 -0
  38. package/plugins/antigravity/agents/epistemic-auditor.md +5 -0
  39. package/plugins/antigravity/hooks.json +23 -0
  40. package/plugins/antigravity/mcp_config.json +33 -0
  41. package/plugins/antigravity/plugin.json +21 -0
  42. package/plugins/antigravity/rules/epistemic-integrity.md +6 -0
  43. package/plugins/antigravity/skills/brainstorming/SKILL.md +13 -0
  44. package/plugins/antigravity/skills/code_audit/SKILL.md +13 -0
  45. package/plugins/antigravity/skills/epistemic_search/SKILL.md +13 -0
  46. package/plugins/antigravity/skills/grilling/SKILL.md +13 -0
  47. package/plugins/antigravity/skills/oss_scout/SKILL.md +13 -0
  48. package/plugins/antigravity/skills/research_cache/SKILL.md +13 -0
  49. package/plugins/antigravity/skills/swarm_config/SKILL.md +13 -0
  50. package/plugins/codex/AGENTS.md.snippet +10 -0
  51. package/plugins/codex/README.md +37 -0
  52. package/plugins/codex/config.toml.snippet +28 -0
  53. package/plugins/codex/openai.yaml +24 -0
  54. package/plugins/codex/skills/brainstorming/SKILL.md +13 -0
  55. package/plugins/codex/skills/code_audit/SKILL.md +13 -0
  56. package/plugins/codex/skills/epistemic_search/SKILL.md +13 -0
  57. package/plugins/codex/skills/grilling/SKILL.md +13 -0
  58. package/plugins/codex/skills/oss_scout/SKILL.md +13 -0
  59. package/plugins/codex/skills/research_cache/SKILL.md +13 -0
  60. package/plugins/codex/skills/swarm_config/SKILL.md +13 -0
  61. package/plugins/gemini/GEMINI.md +15 -0
  62. package/plugins/gemini/README.md +19 -0
  63. package/plugins/gemini/commands/audit.toml +6 -0
  64. package/plugins/gemini/commands/brainstorming.toml +10 -0
  65. package/plugins/gemini/commands/grill.toml +6 -0
  66. package/plugins/gemini/commands/scout.toml +7 -0
  67. package/plugins/gemini/commands/swarm-config.toml +7 -0
  68. package/plugins/gemini/commands/swarm.toml +8 -0
  69. package/plugins/gemini/gemini-extension.json +38 -0
  70. package/plugins/gemini/hooks/hooks.json +11 -0
  71. package/plugins/gemini/skills/brainstorming/SKILL.md +13 -0
  72. package/plugins/gemini/skills/code_audit/SKILL.md +13 -0
  73. package/plugins/gemini/skills/epistemic_search/SKILL.md +13 -0
  74. package/plugins/gemini/skills/grilling/SKILL.md +13 -0
  75. package/plugins/gemini/skills/oss_scout/SKILL.md +13 -0
  76. package/plugins/gemini/skills/research_cache/SKILL.md +13 -0
  77. package/plugins/gemini/skills/swarm_config/SKILL.md +13 -0
  78. package/plugins/opencode/index.js +326 -263
  79. package/prompts/agent_brainstormer.md +97 -0
  80. package/runner/__pycache__/__init__.cpython-311.pyc +0 -0
  81. package/runner/__pycache__/auctioneer.cpython-311.pyc +0 -0
  82. package/runner/__pycache__/auditor_engine.cpython-311.pyc +0 -0
  83. package/runner/__pycache__/claim_store.cpython-311.pyc +0 -0
  84. package/runner/__pycache__/claim_witness.cpython-311.pyc +0 -0
  85. package/runner/__pycache__/living_dossiers.cpython-311.pyc +0 -0
  86. package/runner/__pycache__/mcp_protocol.cpython-311.pyc +0 -0
  87. package/runner/__pycache__/mcp_server.cpython-311.pyc +0 -0
  88. package/runner/__pycache__/pcrb.cpython-311.pyc +0 -0
  89. package/runner/__pycache__/pcrb_verify.cpython-311.pyc +0 -0
  90. package/runner/__pycache__/refinement.cpython-311.pyc +0 -0
  91. package/runner/__pycache__/research_swarm.cpython-311.pyc +0 -0
  92. package/runner/__pycache__/state_machine.cpython-311.pyc +0 -0
  93. package/runner/auctioneer.py +169 -0
  94. package/runner/auditor_engine.py +127 -12
  95. package/runner/claim_store.py +361 -0
  96. package/runner/claim_witness.py +183 -0
  97. package/runner/living_dossiers.py +355 -0
  98. package/runner/mcp_protocol.py +188 -0
  99. package/runner/mcp_server.py +567 -0
  100. package/runner/pcrb.py +212 -0
  101. package/runner/pcrb_verify.py +237 -0
  102. package/runner/refinement.py +335 -0
  103. package/runner/research_swarm.py +378 -94
  104. package/runner/tests/__pycache__/test_auction_order.cpython-311.pyc +0 -0
  105. package/runner/tests/__pycache__/test_claim_store.cpython-311.pyc +0 -0
  106. package/runner/tests/__pycache__/test_claim_witness.cpython-311.pyc +0 -0
  107. package/runner/tests/__pycache__/test_domain_packs.cpython-311.pyc +0 -0
  108. package/runner/tests/__pycache__/test_fleet_seam.cpython-311.pyc +0 -0
  109. package/runner/tests/__pycache__/test_living_dossiers.cpython-311.pyc +0 -0
  110. package/runner/tests/__pycache__/test_mcp_server.cpython-311.pyc +0 -0
  111. package/runner/tests/__pycache__/test_pcrb.cpython-311.pyc +0 -0
  112. package/runner/tests/__pycache__/test_refinement.cpython-311.pyc +0 -0
  113. package/runner/tests/__pycache__/test_swarm.cpython-311.pyc +0 -0
  114. package/runner/tests/fixtures/auction_objective.json +35 -0
  115. package/runner/tests/fixtures/borderline_claims.json +27 -0
  116. package/runner/tests/fixtures/divergence_objectives.json +31 -0
  117. package/runner/tests/test_auction_order.py +173 -0
  118. package/runner/tests/test_claim_store.py +162 -0
  119. package/runner/tests/test_claim_witness.py +186 -0
  120. package/runner/tests/test_domain_packs.py +217 -0
  121. package/runner/tests/test_fleet_seam.py +113 -0
  122. package/runner/tests/test_living_dossiers.py +204 -0
  123. package/runner/tests/test_mcp_server.py +212 -0
  124. package/runner/tests/test_pcrb.py +240 -0
  125. package/runner/tests/test_refinement.py +255 -0
  126. package/runner/tests/test_swarm.py +137 -30
  127. package/scripts/auction_experiment.py +180 -0
  128. package/scripts/build_adapters.py +183 -0
  129. package/scripts/divergence_experiment.py +184 -0
  130. package/skills/brainstorming/SKILL.md +106 -0
  131. package/skills/brainstorming/__init__.py +1 -0
  132. package/skills/brainstorming/scripts/brainstorm.py +200 -0
  133. package/skills/research_cache/__pycache__/__init__.cpython-311.pyc +0 -0
  134. package/skills/research_cache/__pycache__/hasher.cpython-311.pyc +0 -0
  135. package/skills/swarm_config/SKILL.md +1 -1
  136. package/skills/swarm_config/__pycache__/__init__.cpython-311.pyc +0 -0
  137. package/skills/swarm_config/__pycache__/configure.cpython-311.pyc +0 -0
  138. package/skills/swarm_config/configure.py +45 -11
@@ -1,9 +1,15 @@
1
1
  /**
2
2
  * IUMBTEMS: I Use My Brain To Express My Self
3
- * Native Extension for Pi (pi.dev)
4
- *
5
- * Exposes /swarm, /grill, /swarm-config, /audit, and /scout slash commands
6
- * along with epistemic verification and configuration tools in Pi.
3
+ * Native Extension for Pi (pi.dev) and OMP (oh-my-pi)
4
+ *
5
+ * THIN REGISTRATION (Stream A2b): slash commands keep their UX; every body
6
+ * forwards to the canonical first-party MCP surface:
7
+ *
8
+ * python3 runner/mcp_server.py call <tool> '<json>'
9
+ *
10
+ * The one exception is the brainstorming context scaffold
11
+ * (skills/brainstorming/scripts/brainstorm.py), which is skill-local tooling,
12
+ * not a duplicate tool implementation.
7
13
  */
8
14
 
9
15
  import { spawnSync } from 'child_process';
@@ -13,6 +19,39 @@ import { fileURLToPath } from 'url';
13
19
  const __filename = fileURLToPath(import.meta.url);
14
20
  const __dirname = path.dirname(__filename);
15
21
  const PKG_ROOT = path.resolve(__dirname, '../..');
22
+ const MCP_SERVER = path.join(PKG_ROOT, 'runner', 'mcp_server.py');
23
+
24
+ /** Uniform dispatch: one-shot MCP call. Returns {ok, text}. */
25
+ function callMcp(tool, args = {}, ctx = {}) {
26
+ const res = spawnSync(
27
+ 'python3',
28
+ [MCP_SERVER, 'call', tool, JSON.stringify(args || {})],
29
+ {
30
+ encoding: 'utf-8',
31
+ cwd: ctx.cwd || process.cwd(),
32
+ env: { ...process.env, PYTHONPATH: PKG_ROOT },
33
+ }
34
+ );
35
+ return {
36
+ ok: res.status === 0,
37
+ text: res.stdout || res.stderr,
38
+ };
39
+ }
40
+
41
+ /** Parse `/swarm-config --engine X --depth N --mode M [--show]` into tool args. */
42
+ function parseConfigArgs(raw) {
43
+ const tokens = raw.trim() ? raw.trim().split(/\s+/) : [];
44
+ const out = {};
45
+ for (let i = 0; i < tokens.length; i++) {
46
+ const t = tokens[i];
47
+ if (t === '--engine' || t === '-e') out.search_engine = tokens[++i];
48
+ else if (t === '--depth' || t === '-d' || t === '--iterations') out.max_iterations = Number(tokens[++i]);
49
+ else if (t === '--mode' || t === '-m') out.mode = tokens[++i];
50
+ else if (t === '--divergence') out.divergence_threshold = Number(tokens[++i]);
51
+ // --show / bare invocation = read-only inspect (MCP tool's default)
52
+ }
53
+ return out;
54
+ }
16
55
 
17
56
  export default function initPiExtension(pi) {
18
57
  // Check if Pi extension API is available
@@ -32,18 +71,12 @@ export default function initPiExtension(pi) {
32
71
  }
33
72
 
34
73
  ctx.output?.(`🌟 [IUMBTEMS] Dispatching Dialectic Swarm: "${objective}"...`);
35
- const runnerPath = path.join(PKG_ROOT, 'runner/research_swarm.py');
36
- const res = spawnSync('python3', [runnerPath, '--objective', objective], {
37
- encoding: 'utf-8',
38
- cwd: ctx.cwd || process.cwd(),
39
- env: { ...process.env, PYTHONPATH: PKG_ROOT }
40
- });
41
-
42
- if (res.status === 0) {
43
- ctx.output?.(res.stdout);
74
+ const r = callMcp('iumbtems_swarm_research', { objective }, ctx);
75
+ if (r.ok) {
76
+ ctx.output?.(r.text);
44
77
  ctx.output?.('\n✅ Research complete! Summary written to .research/final_synthesis.md');
45
78
  } else {
46
- ctx.output?.(`❌ Swarm failed:\n${res.stderr || res.stdout}`);
79
+ ctx.output?.(`❌ Swarm failed:\n${r.text}`);
47
80
  }
48
81
  }
49
82
  });
@@ -54,13 +87,13 @@ export default function initPiExtension(pi) {
54
87
  usage: '/grill [--objective <text>]',
55
88
  handler: async (args, ctx) => {
56
89
  ctx.output?.('🧠 [IUMBTEMS] Launching Socratic Grilling decision tree...');
57
- const treePath = path.join(PKG_ROOT, 'skills/grilling/socratic_tree.py');
58
- const forwardArgs = args.trim() ? ['--objective', args.trim()] : ['--show-frontier'];
59
- const res = spawnSync('python3', [treePath, ...forwardArgs], {
60
- encoding: 'utf-8',
61
- cwd: ctx.cwd || process.cwd()
62
- });
63
- ctx.output?.(res.stdout || res.stderr);
90
+ const objective = args.trim();
91
+ const r = callMcp(
92
+ 'iumbtems_socratic_frontier',
93
+ objective ? { objective, file: '.research/frontier.json' } : { file: '.research/frontier.json' },
94
+ ctx
95
+ );
96
+ ctx.output?.(r.text);
64
97
  }
65
98
  });
66
99
 
@@ -69,14 +102,8 @@ export default function initPiExtension(pi) {
69
102
  description: 'Inspect or update Epistemic Swarm parameters (engine, depth, mode)',
70
103
  usage: '/swarm-config [--engine <e>] [--depth <d>] [--mode <m>] [--show]',
71
104
  handler: async (args, ctx) => {
72
- const configScript = path.join(PKG_ROOT, 'skills/swarm_config/configure.py');
73
- const rawArgs = args.trim() ? args.trim().split(/\s+/) : ['--show'];
74
- const res = spawnSync('python3', [configScript, ...rawArgs], {
75
- encoding: 'utf-8',
76
- cwd: ctx.cwd || process.cwd(),
77
- env: { ...process.env, PYTHONPATH: PKG_ROOT }
78
- });
79
- ctx.output?.(res.stdout || res.stderr);
105
+ const r = callMcp('iumbtems_config', parseConfigArgs(args), ctx);
106
+ ctx.output?.(r.text);
80
107
  }
81
108
  });
82
109
 
@@ -87,17 +114,12 @@ export default function initPiExtension(pi) {
87
114
  handler: async (args, ctx) => {
88
115
  const target = args.trim() || 'Full repository architecture and vulnerability audit';
89
116
  ctx.output?.(`🛡️ [IUMBTEMS Audit] Launching Codebase Audit for: "${target}"...`);
90
- const runnerPath = path.join(PKG_ROOT, 'runner/research_swarm.py');
91
- const res = spawnSync('python3', [runnerPath, '--mode', 'audit', '--objective', target], {
92
- encoding: 'utf-8',
93
- cwd: ctx.cwd || process.cwd(),
94
- env: { ...process.env, PYTHONPATH: PKG_ROOT }
95
- });
96
- if (res.status === 0) {
97
- ctx.output?.(res.stdout);
117
+ const r = callMcp('iumbtems_code_audit', { target }, ctx);
118
+ if (r.ok) {
119
+ ctx.output?.(r.text);
98
120
  ctx.output?.('\n✅ Audit complete! Report written to .research/code_audit_report.md');
99
121
  } else {
100
- ctx.output?.(`❌ Audit failed:\n${res.stderr || res.stdout}`);
122
+ ctx.output?.(`❌ Audit failed:\n${r.text}`);
101
123
  }
102
124
  }
103
125
  });
@@ -113,23 +135,56 @@ export default function initPiExtension(pi) {
113
135
  return;
114
136
  }
115
137
  ctx.output?.(`🔭 [IUMBTEMS Scout] Scouting open-source solutions for: "${feature}"...`);
116
- const runnerPath = path.join(PKG_ROOT, 'runner/research_swarm.py');
117
- const res = spawnSync('python3', [runnerPath, '--mode', 'scout', '--objective', feature], {
138
+ const r = callMcp('iumbtems_oss_scout', { feature }, ctx);
139
+ if (r.ok) {
140
+ ctx.output?.(r.text);
141
+ ctx.output?.('\n✅ Scout complete! Blueprint written to .research/oss_scout_report.md');
142
+ } else {
143
+ ctx.output?.(`❌ Scout failed:\n${r.text}`);
144
+ }
145
+ }
146
+ });
147
+
148
+ // /brainstorming: Lateral creative ideation (divergent, speculative)
149
+ pi.registerCommand('brainstorming', {
150
+ description: 'Lateral brainstorming: novel feature vectors, paradigm inversions, falsifiable spikes',
151
+ usage: '/brainstorming <ambiguous-prompt>',
152
+ handler: async (args, ctx) => {
153
+ const objective = args.trim() || 'Where do we go from here?';
154
+ ctx.output?.(`💡 [IUMBTEMS Brainstorm] Diverging on: "${objective}"...`);
155
+ // Skill-local context scaffold (not a tool duplicate) -> then canonical tool.
156
+ const scaffold = path.join(PKG_ROOT, 'skills/brainstorming/scripts/brainstorm.py');
157
+ const pre = spawnSync('python3', [scaffold, '--objective', objective, '--show-context'], {
118
158
  encoding: 'utf-8',
119
- cwd: ctx.cwd || process.cwd(),
120
- env: { ...process.env, PYTHONPATH: PKG_ROOT }
159
+ cwd: ctx.cwd || process.cwd()
121
160
  });
122
- if (res.status === 0) {
123
- ctx.output?.(res.stdout);
124
- ctx.output?.('\n✅ Scout complete! Blueprint written to .research/oss_scout_report.md');
161
+ ctx.output?.(pre.stdout || pre.stderr);
162
+ const r = callMcp('iumbtems_brainstorm', { objective }, ctx);
163
+ if (r.ok) {
164
+ ctx.output?.(r.text);
165
+ ctx.output?.('\n✅ Brainstorm complete! Portfolio written to .research/brainstorm_report.md');
125
166
  } else {
126
- ctx.output?.(`❌ Scout failed:\n${res.stderr || res.stdout}`);
167
+ ctx.output?.(`❌ Brainstorm failed:\n${r.text}`);
127
168
  }
128
169
  }
129
170
  });
171
+
172
+ // /brainstorm alias
173
+ try {
174
+ pi.registerCommand('brainstorm', {
175
+ description: 'Alias for /brainstorming',
176
+ usage: '/brainstorm <ambiguous-prompt>',
177
+ handler: async (args, ctx) => {
178
+ const cmds = typeof pi.getCommands === 'function' ? pi.getCommands() : {};
179
+ const target = cmds?.brainstorming?.handler || cmds?.['brainstorming'];
180
+ if (typeof target === 'function') return target(args, ctx);
181
+ ctx.output?.('Use /brainstorming <prompt> instead.');
182
+ }
183
+ });
184
+ } catch { /* alias is best-effort across pi/omp versions */ }
130
185
  }
131
186
 
132
- // 2. Register Agent Tools
187
+ // 2. Register Agent Tools (thin forwarders)
133
188
  if (typeof pi.registerTool === 'function') {
134
189
  // Tool: iumbtems_verify_quote
135
190
  pi.registerTool({
@@ -143,14 +198,9 @@ export default function initPiExtension(pi) {
143
198
  },
144
199
  required: ['hash', 'quote']
145
200
  },
146
- execute: async ({ hash, quote }) => {
147
- const hasherPath = path.join(PKG_ROOT, 'skills/research-cache/hasher.py');
148
- const res = spawnSync('python3', [hasherPath, 'verify', '--hash', hash, '--quote', quote], {
149
- encoding: 'utf-8'
150
- });
151
- return {
152
- content: [{ type: 'text', text: res.stdout || res.stderr }]
153
- };
201
+ execute: async (args = {}) => {
202
+ const r = callMcp('iumbtems_verify_quote', { hash: args.hash, quote: args.quote }, {});
203
+ return { content: [{ type: 'text', text: r.text }] };
154
204
  }
155
205
  });
156
206
 
@@ -163,31 +213,46 @@ export default function initPiExtension(pi) {
163
213
  properties: {
164
214
  search_engine: { type: 'string', enum: ['duckduckgo', 'brave', 'firecrawl', 'searxng'] },
165
215
  max_iterations: { type: 'integer', minimum: 1, maximum: 4 },
166
- mode: { type: 'string', enum: ['research', 'audit', 'scout', 'hybrid'] },
216
+ mode: { type: 'string', enum: ['research', 'audit', 'scout', 'hybrid', 'brainstorm'] },
167
217
  divergence_threshold: { type: 'number', minimum: 0, maximum: 1 },
168
218
  show: { type: 'boolean', default: false }
169
219
  }
170
220
  },
171
221
  execute: async (args = {}) => {
172
- const configScript = path.join(PKG_ROOT, 'skills/swarm_config/configure.py');
173
- const cmdArgs = [configScript];
174
- if (args.show || (!args.search_engine && !args.max_iterations && !args.mode && args.divergence_threshold === undefined)) {
175
- cmdArgs.push('--show');
176
- } else {
177
- if (args.search_engine) cmdArgs.push('--engine', args.search_engine);
178
- if (args.max_iterations) cmdArgs.push('--depth', String(args.max_iterations));
179
- if (args.mode) cmdArgs.push('--mode', args.mode);
180
- if (args.divergence_threshold !== undefined) cmdArgs.push('--divergence', String(args.divergence_threshold));
181
- }
222
+ const r = callMcp('iumbtems_config', parseConfigArgsFromObject(args), {});
223
+ return { content: [{ type: 'text', text: r.text }] };
224
+ }
225
+ });
182
226
 
183
- const res = spawnSync('python3', cmdArgs, {
184
- encoding: 'utf-8',
185
- env: { ...process.env, PYTHONPATH: PKG_ROOT }
186
- });
187
- return {
188
- content: [{ type: 'text', text: res.stdout || res.stderr }]
189
- };
227
+ // Tool: iumbtems_brainstorm (lateral ideation)
228
+ pi.registerTool({
229
+ name: 'iumbtems_brainstorm',
230
+ description: 'Run lateral brainstorming: novel feature vectors, paradigm inversions, falsifiable spikes',
231
+ parameters: {
232
+ type: 'object',
233
+ properties: {
234
+ objective: { type: 'string', description: 'Ambiguous exploration prompt' },
235
+ mock_mode: { type: 'boolean', description: 'Mock mode without LLM tokens', default: false }
236
+ },
237
+ required: ['objective']
238
+ },
239
+ execute: async (args = {}) => {
240
+ const r = callMcp('iumbtems_brainstorm', {
241
+ objective: args.objective || 'Where do we go from here?',
242
+ mock_claude: Boolean(args.mock_mode)
243
+ }, {});
244
+ return { content: [{ type: 'text', text: r.text }] };
190
245
  }
191
246
  });
192
247
  }
193
248
  }
249
+
250
+ /** Map a structured args object onto the iumbtems_config tool contract. */
251
+ function parseConfigArgsFromObject(args = {}) {
252
+ const out = {};
253
+ if (args.search_engine) out.search_engine = args.search_engine;
254
+ if (args.max_iterations) out.max_iterations = args.max_iterations;
255
+ if (args.mode) out.mode = args.mode;
256
+ if (args.divergence_threshold !== undefined) out.divergence_threshold = args.divergence_threshold;
257
+ return out;
258
+ }
package/install.sh CHANGED
@@ -21,10 +21,15 @@ echo "✅ Core prerequisites detected (Python $(python3 --version | cut -d' ' -f
21
21
  mkdir -p "$CLAUDE_DIR/skills"
22
22
 
23
23
  echo "🔗 Linking skills into $CLAUDE_DIR/skills/..."
24
- ln -sf "$REPO_DIR/skills/grilling" "$CLAUDE_DIR/skills/grilling"
25
- ln -sf "$REPO_DIR/skills/research-cache" "$CLAUDE_DIR/skills/research-cache"
26
- echo " - $CLAUDE_DIR/skills/grilling -> $REPO_DIR/skills/grilling"
27
- echo " - $CLAUDE_DIR/skills/research-cache -> $REPO_DIR/skills/research-cache"
24
+ for skill in grilling research_cache epistemic_search swarm_config code_audit oss_scout brainstorming; do
25
+ # legacy research-cache dir name kept as alias for older configs
26
+ ln -sf "$REPO_DIR/skills/$skill" "$CLAUDE_DIR/skills/$skill"
27
+ echo " - $CLAUDE_DIR/skills/$skill -> $REPO_DIR/skills/$skill"
28
+ done
29
+ if [ ! -e "$CLAUDE_DIR/skills/research-cache" ]; then
30
+ ln -sf "$REPO_DIR/skills/research_cache" "$CLAUDE_DIR/skills/research-cache"
31
+ echo " - $CLAUDE_DIR/skills/research-cache -> $REPO_DIR/skills/research_cache (legacy alias)"
32
+ fi
28
33
 
29
34
  # 3. Patch ~/.claude.json mcpServers non-destructively
30
35
  if [ -f "$CLAUDE_JSON" ]; then
@@ -47,6 +52,15 @@ try:
47
52
  claude_data["mcpServers"] = {}
48
53
 
49
54
  for server_name, server_def in mcp_data.get("mcpServers", {}).items():
55
+ # The first-party iumbtems server must resolve absolutely: a relative
56
+ # "runner/mcp_server.py" only works when cwd is the repo root.
57
+ if server_name == "iumbtems":
58
+ server_def = dict(server_def)
59
+ server_def["args"] = [str(Path("$REPO_DIR") / "runner" / "mcp_server.py")]
60
+ env = dict(server_def.get("env") or {})
61
+ env["PYTHONPATH"] = "$REPO_DIR"
62
+ server_def["env"] = env
63
+
50
64
  if server_name not in claude_data["mcpServers"]:
51
65
  claude_data["mcpServers"][server_name] = server_def
52
66
  print(f" + Added MCP server: {server_name}")
@@ -98,5 +112,7 @@ fi
98
112
  echo ""
99
113
  echo "🎉 Epistemic Swarm installation complete!"
100
114
  echo " - Interactive Grilling: run /grilling inside Claude Code"
115
+ echo " - Lateral Brainstorming: run /brainstorming inside Claude Code (skills/brainstorming)"
116
+ echo " - Rebuild harness adapters: python3 scripts/build_adapters.py"
101
117
  echo " - Headless Research Swarm: npx @heretek-ai/epistemic-swarm run \"<objective>\""
102
118
  echo "========================================================"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@heretek-ai/epistemic-swarm",
3
- "version": "0.2.3",
4
- "description": "IUMBTEMS: I Use My Brain To Express My Self — High-Integrity Dialectic Research Agent Harness for Claude Code, Pi (pi.dev), and OpenCode V2",
3
+ "version": "0.3.0",
4
+ "description": "IUMBTEMS: I Use My Brain To Express My Self — High-Integrity Dialectic Research Agent Harness for Claude Code, OpenCode V2, Pi, OMP (oh-my-pi), Gemini CLI, Codex CLI, and AntiGravity",
5
5
  "main": "bin/cli.js",
6
6
  "bin": {
7
7
  "iumbtems": "bin/cli.js",
@@ -11,7 +11,8 @@
11
11
  ".": "./bin/cli.js",
12
12
  "./opencode": "./plugins/opencode/index.js",
13
13
  "./server": "./plugins/opencode/index.js",
14
- "./pi": "./extensions/pi/index.js"
14
+ "./pi": "./extensions/pi/index.js",
15
+ "./omp": "./extensions/pi/index.js"
15
16
  },
16
17
  "publishConfig": {
17
18
  "access": "public"
@@ -28,9 +29,15 @@
28
29
  "iumbtems",
29
30
  "i-use-my-brain-to-express-my-self",
30
31
  "pi-package",
32
+ "omp-package",
31
33
  "opencode",
32
34
  "opencode-plugin",
33
35
  "claude-code",
36
+ "gemini-cli",
37
+ "codex-cli",
38
+ "antigravity",
39
+ "oh-my-pi",
40
+ "omp",
34
41
  "ai-agents",
35
42
  "autonomous-agents",
36
43
  "multi-agent-systems",
@@ -45,6 +52,8 @@
45
52
  "deep-research",
46
53
  "socratic-grilling",
47
54
  "socratic-questioning",
55
+ "brainstorming",
56
+ "lateral-thinking",
48
57
  "fact-checking",
49
58
  "red-teaming",
50
59
  "citation-validation",
@@ -64,12 +73,33 @@
64
73
  "./skills/epistemic_search",
65
74
  "./skills/swarm_config",
66
75
  "./skills/code_audit",
67
- "./skills/oss_scout"
76
+ "./skills/oss_scout",
77
+ "./skills/brainstorming"
68
78
  ],
69
79
  "prompts": [
70
80
  "./prompts/*.md"
71
81
  ]
72
82
  },
83
+ "omp": {
84
+ "extensions": [
85
+ "./extensions/pi/index.js"
86
+ ],
87
+ "skills": [
88
+ "./skills/grilling",
89
+ "./skills/research_cache",
90
+ "./skills/epistemic_search",
91
+ "./skills/swarm_config",
92
+ "./skills/code_audit",
93
+ "./skills/oss_scout",
94
+ "./skills/brainstorming"
95
+ ],
96
+ "prompts": [
97
+ "./prompts/*.md"
98
+ ],
99
+ "commands": [
100
+ "./.omp/commands/*.md"
101
+ ]
102
+ },
73
103
  "author": "Heretek AI",
74
104
  "license": "Apache-2.0",
75
105
  "files": [
@@ -81,6 +111,9 @@
81
111
  "runner",
82
112
  "extensions",
83
113
  "plugins",
114
+ "scripts",
115
+ ".agents",
116
+ ".omp",
84
117
  ".claude-plugin",
85
118
  "install.sh",
86
119
  "README.md",
@@ -92,8 +125,10 @@
92
125
  },
93
126
  "scripts": {
94
127
  "test": "python3 -m unittest discover -s runner/tests",
128
+ "build:adapters": "python3 scripts/build_adapters.py",
129
+ "check:adapters": "python3 scripts/build_adapters.py --check",
95
130
  "validate:claude": "claude plugin validate --strict .claude-plugin/marketplace.json && claude plugin validate --strict .",
96
- "prepack": "python3 -m unittest discover -s runner/tests",
131
+ "prepack": "python3 scripts/build_adapters.py && python3 -m unittest discover -s runner/tests",
97
132
  "install-local": "bash install.sh"
98
133
  }
99
134
  }
@@ -0,0 +1,28 @@
1
+ # IUMBTEMS for AntiGravity
2
+
3
+ Native AntiGravity plugin (`agy`). Install from git or local path:
4
+
5
+ ```bash
6
+ agy plugin install https://github.com/Heretek-AI/IUMBTEMS --path plugins/antigravity
7
+ # or local clone:
8
+ agy plugin install /path/to/IUMBTEMS/plugins/antigravity
9
+ agy plugin list
10
+ agy plugin validate /path/to/IUMBTEMS/plugins/antigravity
11
+ ```
12
+
13
+ Layout follows the AntiGravity extensibility model:
14
+
15
+ ```
16
+ plugins/antigravity/
17
+ ├── plugin.json # required manifest (name, description, skills, agents, rules)
18
+ ├── mcp_config.json # MCP servers (brave-search, firecrawl, searxng via config/mcp_launcher.py)
19
+ ├── hooks.json # pre/post tool hooks (WebSearch/WebFetch interception)
20
+ ├── skills/ # generated copies of canonical skills/ (see scripts/build_adapters.py)
21
+ ├── agents/ # subagent definitions (alpha-thesis, beta-antithesis, auditor, brainstormer)
22
+ └── rules/ # workspace rules (epistemic integrity invariant)
23
+ ```
24
+
25
+ Skills auto-promote to slash commands (`/grilling`, `/brainstorming`, ...).
26
+ Set optional secrets via workspace settings / env:
27
+ `BRAVE_SEARCH_API_KEY`, `FIRECRAWL_API_KEY`, `FIRECRAWL_API_URL`, `SEARXNG_URL`.
28
+ Zero-key DuckDuckGo + readability fallback works with no keys.
@@ -0,0 +1,6 @@
1
+ # Alpha Thesis — Proponent Subagent (AntiGravity)
2
+
3
+ Read `prompts/agent_alpha_thesis.md` as system instructions.
4
+ Posture: constructive, empirical, affirmative.
5
+ Every `[VERIFIED:<hash>]` claim must point at `.research/sources/<sha256>.md`
6
+ with a verbatim quote substring. Never fabricate citations.
@@ -0,0 +1,7 @@
1
+ # Beta Antithesis — Adversary Subagent (AntiGravity)
2
+
3
+ Read `prompts/agent_beta_antithesis.md` as system instructions.
4
+ Posture: hostile auditor, active falsifier.
5
+ For every thesis claim, run inverted queries ("why [claim] fails",
6
+ "[claim] debunked", "[claim] performance degradation") and log
7
+ `[NEGATIVE_KNOWLEDGE:<query>]` when nothing is found.
@@ -0,0 +1,7 @@
1
+ # Brainstormer — Lateral Ideation Subagent (AntiGravity)
2
+
3
+ Read `prompts/agent_brainstormer.md` as system instructions.
4
+ Calibration: temperature 1.0-1.2, top_p 0.92.
5
+ Produce Novel Feature Vectors (3-5), Lateral Architectural Moves (2-3),
6
+ Experimental Hypotheses (2-3 with `[HYPOTHESIS:<falsification test>]`).
7
+ Never output bug-fix lists. Write only to `.research/`.
@@ -0,0 +1,5 @@
1
+ # Epistemic Auditor — Synthesizer Subagent (AntiGravity)
2
+
3
+ Read `prompts/epistemic_auditor.md` as system instructions.
4
+ Verify every `verbatim_quote` against `.research/sources/<sha256>.md`,
5
+ excise failures, compute divergence, reject dossiers with score < 0.65.
@@ -0,0 +1,23 @@
1
+ {
2
+ "hooks": {
3
+ "pre_tool": [
4
+ {
5
+ "matcher": "WebSearch",
6
+ "action": "deny",
7
+ "reason": "Intercepted by epistemic-swarm: use epistemic search (python3 skills/epistemic_search/scripts/search.py \"<query>\") for SHA-256 cached verification."
8
+ },
9
+ {
10
+ "matcher": "WebFetch",
11
+ "action": "deny",
12
+ "reason": "Intercepted by epistemic-swarm: use epistemic fetch (python3 skills/epistemic_search/scripts/fetch.py \"<url>\") for content-addressed caching."
13
+ }
14
+ ],
15
+ "post_tool": [
16
+ {
17
+ "matcher": "*",
18
+ "action": "log",
19
+ "reason": "Epistemic audit trail: verify [VERIFIED:<hash>] quotes against .research/sources/<sha256>.md."
20
+ }
21
+ ]
22
+ }
23
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "mcpServers": {
3
+ "brave-search": {
4
+ "command": "python3",
5
+ "args": ["${pluginPath}/../../config/mcp_launcher.py", "brave-search"],
6
+ "env": {
7
+ "BRAVE_SEARCH_API_KEY": "${BRAVE_SEARCH_API_KEY}"
8
+ }
9
+ },
10
+ "firecrawl": {
11
+ "command": "python3",
12
+ "args": ["${pluginPath}/../../config/mcp_launcher.py", "firecrawl"],
13
+ "env": {
14
+ "FIRECRAWL_API_KEY": "${FIRECRAWL_API_KEY}",
15
+ "FIRECRAWL_API_URL": "${FIRECRAWL_API_URL:-http://localhost:3002}"
16
+ }
17
+ },
18
+ "searxng": {
19
+ "command": "python3",
20
+ "args": ["${pluginPath}/../../config/mcp_launcher.py", "searxng"],
21
+ "env": {
22
+ "SEARXNG_URL": "${SEARXNG_URL:-http://localhost:8080}"
23
+ }
24
+ },
25
+ "iumbtems": {
26
+ "command": "python3",
27
+ "args": ["${pluginPath}/../../runner/mcp_server.py"],
28
+ "env": {
29
+ "PYTHONPATH": "${pluginPath}/../.."
30
+ }
31
+ }
32
+ }
33
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://antigravity.google/schemas/v1/plugin.json",
3
+ "name": "epistemic-swarm",
4
+ "version": "0.3.0",
5
+ "description": "IUMBTEMS Epistemic Swarm: dialectic research, code audit, OSS scout, and lateral brainstorming for AntiGravity.",
6
+ "author": "Heretek AI",
7
+ "license": "Apache-2.0",
8
+ "repository": "https://github.com/Heretek-AI/IUMBTEMS",
9
+ "homepage": "https://github.com/Heretek-AI/IUMBTEMS#readme",
10
+ "skills": [
11
+ "./skills/grilling",
12
+ "./skills/research_cache",
13
+ "./skills/epistemic_search",
14
+ "./skills/swarm_config",
15
+ "./skills/code_audit",
16
+ "./skills/oss_scout",
17
+ "./skills/brainstorming"
18
+ ],
19
+ "agents": ["./agents"],
20
+ "rules": ["./rules"]
21
+ }
@@ -0,0 +1,6 @@
1
+ # Epistemic Integrity (AntiGravity workspace rule)
2
+
3
+ All factual claims MUST carry `[VERIFIED:<hash>]`, `[INFERRED:<chain>]`,
4
+ `[HYPOTHESIS:<falsification>]`, or `[NEGATIVE_KNOWLEDGE:<query>]` tags
5
+ (see `prompts/base_epistemic_system.md`). Unverified parametric recollection
6
+ is quarantined. Fetch, verify, then assert.
@@ -0,0 +1,13 @@
1
+ # Brainstorming (thin adapter stub)
2
+
3
+ This file is a POINTER, not the implementation. It exists so harness skill
4
+ discovery finds an entry; the real skill lives in the IUMBTEMS repo.
5
+
6
+ - Canonical prose & scripts: `skills/brainstorming/`
7
+ - Canonical programmatic surface: `python3 runner/mcp_server.py` (stdio MCP),
8
+ or one-shot: `python3 runner/mcp_server.py call <tool> '{...json...}'`
9
+ - MCP tools for this skill: `iumbtems_brainstorm`
10
+
11
+ Epistemic rules apply regardless of harness: tag claims as
12
+ `[VERIFIED: <hash>]`, `[INFERRED: <reasoning>]`, `[HYPOTHESIS: <test>]`, or
13
+ `[NEGATIVE_KNOWLEDGE: <query>]`. Writes go only to `.research/`.
@@ -0,0 +1,13 @@
1
+ # Code Audit (thin adapter stub)
2
+
3
+ This file is a POINTER, not the implementation. It exists so harness skill
4
+ discovery finds an entry; the real skill lives in the IUMBTEMS repo.
5
+
6
+ - Canonical prose & scripts: `skills/code_audit/`
7
+ - Canonical programmatic surface: `python3 runner/mcp_server.py` (stdio MCP),
8
+ or one-shot: `python3 runner/mcp_server.py call <tool> '{...json...}'`
9
+ - MCP tools for this skill: `iumbtems_code_audit`
10
+
11
+ Epistemic rules apply regardless of harness: tag claims as
12
+ `[VERIFIED: <hash>]`, `[INFERRED: <reasoning>]`, `[HYPOTHESIS: <test>]`, or
13
+ `[NEGATIVE_KNOWLEDGE: <query>]`. Writes go only to `.research/`.
@@ -0,0 +1,13 @@
1
+ # Epistemic Search (thin adapter stub)
2
+
3
+ This file is a POINTER, not the implementation. It exists so harness skill
4
+ discovery finds an entry; the real skill lives in the IUMBTEMS repo.
5
+
6
+ - Canonical prose & scripts: `skills/epistemic_search/`
7
+ - Canonical programmatic surface: `python3 runner/mcp_server.py` (stdio MCP),
8
+ or one-shot: `python3 runner/mcp_server.py call <tool> '{...json...}'`
9
+ - MCP tools for this skill: `brave_web_search / firecrawl_scrape (research MCP servers)`
10
+
11
+ Epistemic rules apply regardless of harness: tag claims as
12
+ `[VERIFIED: <hash>]`, `[INFERRED: <reasoning>]`, `[HYPOTHESIS: <test>]`, or
13
+ `[NEGATIVE_KNOWLEDGE: <query>]`. Writes go only to `.research/`.
@@ -0,0 +1,13 @@
1
+ # Socratic Grilling (thin adapter stub)
2
+
3
+ This file is a POINTER, not the implementation. It exists so harness skill
4
+ discovery finds an entry; the real skill lives in the IUMBTEMS repo.
5
+
6
+ - Canonical prose & scripts: `skills/grilling/`
7
+ - Canonical programmatic surface: `python3 runner/mcp_server.py` (stdio MCP),
8
+ or one-shot: `python3 runner/mcp_server.py call <tool> '{...json...}'`
9
+ - MCP tools for this skill: `iumbtems_socratic_frontier`
10
+
11
+ Epistemic rules apply regardless of harness: tag claims as
12
+ `[VERIFIED: <hash>]`, `[INFERRED: <reasoning>]`, `[HYPOTHESIS: <test>]`, or
13
+ `[NEGATIVE_KNOWLEDGE: <query>]`. Writes go only to `.research/`.