@heretek-ai/epistemic-swarm 0.4.6 → 0.4.7

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 (37) hide show
  1. package/.claude-plugin/plugin.json +1 -1
  2. package/package.json +1 -1
  3. package/plugins/antigravity/plugin.json +1 -1
  4. package/plugins/gemini/gemini-extension.json +1 -1
  5. package/plugins/opencode/index.js +43 -33
  6. package/runner/__pycache__/__init__.cpython-311.pyc +0 -0
  7. package/runner/__pycache__/auctioneer.cpython-311.pyc +0 -0
  8. package/runner/__pycache__/auditor_engine.cpython-311.pyc +0 -0
  9. package/runner/__pycache__/claim_store.cpython-311.pyc +0 -0
  10. package/runner/__pycache__/claim_witness.cpython-311.pyc +0 -0
  11. package/runner/__pycache__/living_dossiers.cpython-311.pyc +0 -0
  12. package/runner/__pycache__/mcp_protocol.cpython-311.pyc +0 -0
  13. package/runner/__pycache__/mcp_server.cpython-311.pyc +0 -0
  14. package/runner/__pycache__/pcrb.cpython-311.pyc +0 -0
  15. package/runner/__pycache__/pcrb_verify.cpython-311.pyc +0 -0
  16. package/runner/__pycache__/refinement.cpython-311.pyc +0 -0
  17. package/runner/__pycache__/research_swarm.cpython-311.pyc +0 -0
  18. package/runner/__pycache__/state_machine.cpython-311.pyc +0 -0
  19. package/runner/tests/__pycache__/test_auction_order.cpython-311.pyc +0 -0
  20. package/runner/tests/__pycache__/test_bet1_spike.cpython-311.pyc +0 -0
  21. package/runner/tests/__pycache__/test_claim_store.cpython-311.pyc +0 -0
  22. package/runner/tests/__pycache__/test_claim_witness.cpython-311.pyc +0 -0
  23. package/runner/tests/__pycache__/test_domain_packs.cpython-311.pyc +0 -0
  24. package/runner/tests/__pycache__/test_fleet_seam.cpython-311.pyc +0 -0
  25. package/runner/tests/__pycache__/test_living_dossiers.cpython-311.pyc +0 -0
  26. package/runner/tests/__pycache__/test_mcp_server.cpython-311.pyc +0 -0
  27. package/runner/tests/__pycache__/test_opencode_ux.cpython-311.pyc +0 -0
  28. package/runner/tests/__pycache__/test_pcrb.cpython-311.pyc +0 -0
  29. package/runner/tests/__pycache__/test_refinement.cpython-311.pyc +0 -0
  30. package/runner/tests/__pycache__/test_swarm.cpython-311.pyc +0 -0
  31. package/runner/tests/__pycache__/test_webcache.cpython-311.pyc +0 -0
  32. package/runner/tests/test_opencode_ux.py +30 -0
  33. package/scripts/__pycache__/bet1_advisory_spike.cpython-311.pyc +0 -0
  34. package/skills/research_cache/__pycache__/__init__.cpython-311.pyc +0 -0
  35. package/skills/research_cache/__pycache__/hasher.cpython-311.pyc +0 -0
  36. package/skills/swarm_config/__pycache__/__init__.cpython-311.pyc +0 -0
  37. package/skills/swarm_config/__pycache__/configure.cpython-311.pyc +0 -0
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "epistemic-swarm",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "description": "High-Integrity Dialectic Research Agent Harness for Claude Code enforcing empirical evidence over parametric hallucination.",
5
5
  "author": {
6
6
  "name": "Heretek AI",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heretek-ai/epistemic-swarm",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
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": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://antigravity.google/schemas/v1/plugin.json",
3
3
  "name": "epistemic-swarm",
4
- "version": "0.4.6",
4
+ "version": "0.4.7",
5
5
  "description": "IUMBTEMS Epistemic Swarm: dialectic research, code audit, OSS scout, and lateral brainstorming for AntiGravity.",
6
6
  "author": "Heretek AI",
7
7
  "license": "Apache-2.0",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "epistemic-swarm",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "description": "IUMBTEMS Epistemic Swarm: dialectic research, code audit, OSS scout, and lateral brainstorming for Gemini CLI.",
5
5
  "mcpServers": {
6
6
  "brave-search": {
@@ -665,39 +665,9 @@ export function createOpenCodePlugin(context = {}) {
665
665
  setup: async (appContext) => {
666
666
  const host = appContext || {};
667
667
  const opts = context.options || host.options;
668
- if (opts && typeof opts === 'object') {
669
- const updates = {};
670
- if (opts.search_engine) updates.search_engine = opts.search_engine;
671
- if (opts.max_iterations) updates.max_iterations = opts.max_iterations;
672
- if (opts.mode) updates.mode = opts.mode;
673
- if (opts.divergence_threshold !== undefined) {
674
- updates.divergence_threshold = opts.divergence_threshold;
675
- }
676
- if (Object.keys(updates).length > 0) {
677
- await callMcp('iumbtems_config', updates, host.cwd);
678
- }
679
- }
680
- // Phase C: idle staleness nudge (opt out with {staleness_nudge: false}).
681
- // Subscribes only when the host exposes event/session; one per root.
682
- try {
683
- if ((opts?.staleness_nudge ?? true)) {
684
- const nudgeHost = {
685
- event: host.event || context.event,
686
- session: host.session || context.session,
687
- };
688
- const root =
689
- host.location?.directory || context.location?.directory;
690
- if (root) {
691
- const stop = startStalenessNudge(nudgeHost, root);
692
- if (typeof stop === 'function') setupCleanups.add(stop);
693
- }
694
- }
695
- } catch {
696
- /* lifecycle hooks are best-effort */
697
- }
698
- // V2 host transforms (official dual-package pattern: V1 calls server(),
699
- // V2 calls setup()). Registers slash commands + tools via the owning
700
- // domains; each guarded so V1 hosts and partial V2 hosts keep working.
668
+ // V2 host transforms FIRST (official dual-package pattern: V1 calls
669
+ // server(), V2 calls setup()). Registration must precede any slow
670
+ // work: the host may not wait out subprocess calls before reconciling.
701
671
  try {
702
672
  if (host.command && typeof host.command.transform === 'function') {
703
673
  let existing = new Set();
@@ -751,6 +721,46 @@ export function createOpenCodePlugin(context = {}) {
751
721
  } catch {
752
722
  /* tool transform is best-effort */
753
723
  }
724
+ // Slow work AFTER registration: apply tuple options via MCP config
725
+ // write, scoped to the plugin location (never the service cwd).
726
+ try {
727
+ if (opts && typeof opts === 'object') {
728
+ const updates = {};
729
+ if (opts.search_engine) updates.search_engine = opts.search_engine;
730
+ if (opts.max_iterations) updates.max_iterations = opts.max_iterations;
731
+ if (opts.mode) updates.mode = opts.mode;
732
+ if (opts.divergence_threshold !== undefined) {
733
+ updates.divergence_threshold = opts.divergence_threshold;
734
+ }
735
+ if (Object.keys(updates).length > 0) {
736
+ await callMcp(
737
+ 'iumbtems_config',
738
+ updates,
739
+ host.location?.directory || context.location?.directory || host.cwd
740
+ );
741
+ }
742
+ }
743
+ } catch {
744
+ /* options apply is best-effort */
745
+ }
746
+ // Phase C: idle staleness nudge (opt out with {staleness_nudge: false}).
747
+ // Subscribes only when the host exposes event/session; one per root.
748
+ try {
749
+ if ((opts?.staleness_nudge ?? true)) {
750
+ const nudgeHost = {
751
+ event: host.event || context.event,
752
+ session: host.session || context.session,
753
+ };
754
+ const root =
755
+ host.location?.directory || context.location?.directory;
756
+ if (root) {
757
+ const stop = startStalenessNudge(nudgeHost, root);
758
+ if (typeof stop === 'function') setupCleanups.add(stop);
759
+ }
760
+ }
761
+ } catch {
762
+ /* lifecycle hooks are best-effort */
763
+ }
754
764
  // Disposer: the host calls setup's return value as a cleanup function
755
765
  // on unload/reload. It MUST be a function (returning a plain object
756
766
  // crashes host reload with "not a function"). Aborts nudge streams so
@@ -565,6 +565,36 @@ class TestOpenCodeV2Transforms(unittest.TestCase):
565
565
  data = last_json_object(res.stdout)
566
566
  self.assertEqual(data["cleanupFn"], True)
567
567
 
568
+ def test_options_applied_to_location_dir_after_transforms(self):
569
+ import tempfile
570
+
571
+ with tempfile.TemporaryDirectory() as tmp:
572
+ res = run_node(
573
+ f"""
574
+ import plugin from "./plugins/opencode/index.js";
575
+ const added = [];
576
+ const host = {{
577
+ options: {{mode: "audit"}},
578
+ location: {{directory: {tmp!r}}},
579
+ command: {{
580
+ list: async () => ({{data: []}}),
581
+ transform: async (fn) => {{ fn({{add: (d) => added.push(d.name)}}); }}
582
+ }},
583
+ tool: {{transform: async () => {{}}}}
584
+ }};
585
+ await plugin.setup(host);
586
+ console.log(JSON.stringify({{commands: added}}));
587
+ """
588
+ )
589
+ self.assertEqual(res.returncode, 0, f"options test failed: {res.stderr}")
590
+ data = last_json_object(res.stdout)
591
+ # Transforms registered despite the slow MCP options write.
592
+ self.assertIn("swarm", data["commands"])
593
+ cfg = json.loads(
594
+ Path(tmp, ".research", "config.json").read_text(encoding="utf-8")
595
+ )
596
+ self.assertEqual(cfg.get("mode"), "audit")
597
+
568
598
  def test_setup_cleanup_aborts_nudge_streams(self):
569
599
  res = run_node(
570
600
  """