@heretek-ai/epistemic-swarm 0.7.4 → 0.7.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +10 -9
  2. package/config/opencode-snippet.json +5 -5
  3. package/package.json +1 -1
  4. package/plugins/opencode/index.js +15 -1
  5. package/prompts/antigravity_repo_factcheck.md +143 -0
  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__/path_safety.cpython-311.pyc +0 -0
  15. package/runner/__pycache__/pcrb.cpython-311.pyc +0 -0
  16. package/runner/__pycache__/pcrb_verify.cpython-311.pyc +0 -0
  17. package/runner/__pycache__/refinement.cpython-311.pyc +0 -0
  18. package/runner/__pycache__/research_swarm.cpython-311.pyc +0 -0
  19. package/runner/__pycache__/state_machine.cpython-311.pyc +0 -0
  20. package/runner/tests/__pycache__/test_auction_order.cpython-311.pyc +0 -0
  21. package/runner/tests/__pycache__/test_backends.cpython-311.pyc +0 -0
  22. package/runner/tests/__pycache__/test_bet1_spike.cpython-311.pyc +0 -0
  23. package/runner/tests/__pycache__/test_claim_store.cpython-311.pyc +0 -0
  24. package/runner/tests/__pycache__/test_claim_witness.cpython-311.pyc +0 -0
  25. package/runner/tests/__pycache__/test_claude_plugin.cpython-311.pyc +0 -0
  26. package/runner/tests/__pycache__/test_domain_packs.cpython-311.pyc +0 -0
  27. package/runner/tests/__pycache__/test_factory.cpython-311.pyc +0 -0
  28. package/runner/tests/__pycache__/test_fleet_seam.cpython-311.pyc +0 -0
  29. package/runner/tests/__pycache__/test_living_dossiers.cpython-311.pyc +0 -0
  30. package/runner/tests/__pycache__/test_mcp_server.cpython-311.pyc +0 -0
  31. package/runner/tests/__pycache__/test_opencode_ux.cpython-311.pyc +0 -0
  32. package/runner/tests/__pycache__/test_pcrb.cpython-311.pyc +0 -0
  33. package/runner/tests/__pycache__/test_refinement.cpython-311.pyc +0 -0
  34. package/runner/tests/__pycache__/test_swarm.cpython-311.pyc +0 -0
  35. package/runner/tests/__pycache__/test_sweep_regressions.cpython-311.pyc +0 -0
  36. package/runner/tests/__pycache__/test_webcache.cpython-311.pyc +0 -0
  37. package/runner/tests/test_factory.py +4 -0
  38. package/scripts/__pycache__/bet1_advisory_spike.cpython-311.pyc +0 -0
  39. package/scripts/__pycache__/build_adapters.cpython-311.pyc +0 -0
  40. package/scripts/__pycache__/divergence_experiment.cpython-311.pyc +0 -0
  41. package/skills/epistemic_search/scripts/__pycache__/search.cpython-311.pyc +0 -0
  42. package/skills/research_cache/__pycache__/__init__.cpython-311.pyc +0 -0
  43. package/skills/research_cache/__pycache__/hasher.cpython-311.pyc +0 -0
  44. package/skills/swarm_config/__pycache__/__init__.cpython-311.pyc +0 -0
  45. package/skills/swarm_config/__pycache__/configure.cpython-311.pyc +0 -0
package/README.md CHANGED
@@ -75,19 +75,20 @@ pi install npm:@heretek-ai/epistemic-swarm
75
75
  - OMP (`omp.sh`, oh-my-pi) shares the same entry point: `omp install npm:@heretek-ai/epistemic-swarm`, project commands in `.omp/commands/` (`/swarm`, `/grill`, `/audit`, `/scout`, `/brainstorming`, `/swarm-config`), prompts in `.omp/prompts/`, hooks in `.omp/hooks/pre|post/`.
76
76
  - All commands automatically respect `.research/config.json`.
77
77
 
78
- ### 3. OpenCode V2 (`opencode.ai`)
79
- Enable IUMBTEMS in your `~/.config/opencode/opencode.json` or project `opencode.jsonc`. You can configure settings declaratively:
80
- ```json
78
+ ### 3. OpenCode V2 ([opencode.ai/v2/docs](https://opencode.ai/v2/docs))
79
+ Enable IUMBTEMS in your `~/.config/opencode/opencode.jsonc` or project `opencode.jsonc`. You can configure settings declaratively using native OpenCode V2 syntax:
80
+ ```jsonc
81
81
  {
82
- "plugin": [
83
- [
84
- "@heretek-ai/epistemic-swarm",
85
- {
82
+ "$schema": "https://opencode.ai/config.json",
83
+ "plugins": [
84
+ {
85
+ "package": "@heretek-ai/epistemic-swarm",
86
+ "options": {
86
87
  "search_engine": "duckduckgo",
87
88
  "max_iterations": 2,
88
89
  "mode": "research"
89
90
  }
90
- ]
91
+ }
91
92
  ]
92
93
  }
93
94
  ```
@@ -197,7 +198,7 @@ Every factual claim in IUMBTEMS carries an explicit evidentiary tag:
197
198
  1. **Discovery Tier**: SearXNG (unbiased metasearch) and Brave Search API.
198
199
  2. **Extraction Tier**: Firecrawl (headless JavaScript rendering, DOM cleaning, Markdown extraction).
199
200
  3. **Academic Tier**: Semantic Scholar / arXiv MCPs for DOI citation resolution.
200
- 4. **Caching Tier**: Content-addressed SHA-256 storage (`skills/research-cache/hasher.py`).
201
+ 4. **Caching Tier**: Content-addressed SHA-256 storage (`skills/research_cache/hasher.py`).
201
202
 
202
203
  ### Local Infrastructure (Optional)
203
204
  Run local SearXNG and Firecrawl instances via Docker Compose:
@@ -7,15 +7,15 @@
7
7
  "enabled": true
8
8
  }
9
9
  },
10
- "plugin": [
11
- [
12
- "@heretek-ai/epistemic-swarm",
13
- {
10
+ "plugins": [
11
+ {
12
+ "package": "@heretek-ai/epistemic-swarm",
13
+ "options": {
14
14
  "search_engine": "duckduckgo",
15
15
  "max_iterations": 2,
16
16
  "mode": "research"
17
17
  }
18
- ]
18
+ }
19
19
  ],
20
20
  "agent": {
21
21
  "code-auditor": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heretek-ai/epistemic-swarm",
3
- "version": "0.7.4",
3
+ "version": "0.7.5",
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": {
@@ -577,6 +577,7 @@ export const OPENCODE_COMMANDS = [
577
577
  description: 'Coding-factory Manager loop: grill-gated phased build with programmer spawns and dual QA',
578
578
  usage: '/factory <product-arena>',
579
579
  agent: 'manager',
580
+ subagent: false,
580
581
  subtask: false,
581
582
  template: [
582
583
  'Run the IUMBTEMS coding-factory Manager loop as the manager agent.',
@@ -593,6 +594,7 @@ export const OPENCODE_COMMANDS = [
593
594
  description: 'Autonomous agent-guided self-improvement loop over the codebase (count-flagged)',
594
595
  usage: '/domainexpansion <n>',
595
596
  agent: 'manager',
597
+ subagent: false,
596
598
  subtask: false,
597
599
  template: [
598
600
  'Run the IUMBTEMS domain-expansion loop as the manager agent.',
@@ -619,7 +621,14 @@ export function commandCatalog() {
619
621
  if (!cmd?.name) continue;
620
622
  out[cmd.name] = { description: cmd.description, template: cmd.template };
621
623
  if (cmd.agent) out[cmd.name].agent = cmd.agent;
624
+ if (cmd.subagent !== undefined) out[cmd.name].subagent = cmd.subagent;
622
625
  if (cmd.subtask !== undefined) out[cmd.name].subtask = cmd.subtask;
626
+ if (out[cmd.name].subagent === undefined && out[cmd.name].subtask !== undefined) {
627
+ out[cmd.name].subagent = out[cmd.name].subtask;
628
+ }
629
+ if (out[cmd.name].subtask === undefined && out[cmd.name].subagent !== undefined) {
630
+ out[cmd.name].subtask = out[cmd.name].subagent;
631
+ }
623
632
  }
624
633
  return out;
625
634
  }
@@ -889,7 +898,12 @@ async function registerHostCommands(host) {
889
898
  name: cmd.name,
890
899
  description: cmd.description,
891
900
  ...(cmd.agent ? { agent: cmd.agent } : {}),
892
- ...(cmd.subtask !== undefined ? { subtask: cmd.subtask } : {}),
901
+ ...(cmd.subagent !== undefined || cmd.subtask !== undefined
902
+ ? {
903
+ subagent: cmd.subagent !== undefined ? cmd.subagent : cmd.subtask,
904
+ subtask: cmd.subtask !== undefined ? cmd.subtask : cmd.subagent,
905
+ }
906
+ : {}),
893
907
  execute: async (input) => {
894
908
  const args = input?.prompt?.text || '';
895
909
  const prompt = (typeof input?.prompt === 'object' && input?.prompt !== null) ? input.prompt : {};
@@ -0,0 +1,143 @@
1
+ # IUMBTEMS REPOSITORY FACT-CHECKING REVIEW PROMPT FOR ANTIGRAVITY
2
+
3
+ > **Role & Protocol**: You are operating as the **Epistemic Swarm Auditor** within Google AntiGravity. Your mission is to conduct a rigorous, evidentiary, live web-search fact-checking review of the **IUMBTEMS** repository (`https://github.com/Heretek-AI/IUMBTEMS` / local workspace).
4
+ >
5
+ > You are governed by the **Epistemic Integrity Protocol** defined in this repository: your internal parametric memory is strictly quarantined as untrusted heuristic guidance. You are prohibited from presenting unverified parametric recollections as established empirical facts. Every factual assertion must be verified against live reality via web searching and URL extraction.
6
+
7
+ ---
8
+
9
+ ## 1. MANDATORY TAGGING TAXONOMY
10
+
11
+ Every factual statement, version assertion, API specification claim, or benchmark metric MUST carry an explicit epistemic tag:
12
+
13
+ - `[VERIFIED: <URL | "verbatim quote excerpt">]`
14
+ - Backed by live web content fetched during this session via `search_web` or `read_url_content`.
15
+ - Must include the exact URL and an exact verbatim quote substring from the retrieved page.
16
+ - `[INFERRED: <Parent Tags> -> <Deductive Reasoning>]`
17
+ - Deductive conclusion derived directly from cited `[VERIFIED]` premises.
18
+ - `[HYPOTHESIS: <Measurable Falsification Condition>]`
19
+ - Unverified projection or speculation; requires an empirical test that would disprove it.
20
+ - `[NEGATIVE_KNOWLEDGE: <Search Query>]`
21
+ - Rigorous confirmation that an exhaustive live web search yielded zero supporting evidence.
22
+
23
+ ---
24
+
25
+ ## 2. REPOSITORY AUDIT TARGETS
26
+
27
+ Inspect the local codebase (`README.md`, `AGENTS.md`, `MARKETPLACE.md`, `package.json`, `prompts/`, and `plugins/`) and fact-check the following four empirical domains using `search_web` and `read_url_content`:
28
+
29
+ ### Domain 1: Package Registry & Release Veracity
30
+ - **Claims in Repo**: The project is published on npm as `@heretek-ai/epistemic-swarm` under Apache-2.0, providing binary `iumbtems`.
31
+ - **Fact-Checking Action**:
32
+ - Search `https://registry.npmjs.org/@heretek-ai%2Fepistemic-swarm` or search the web for npm package `@heretek-ai/epistemic-swarm`.
33
+ - Verify: Does the package exist on npm? What is the latest published version? Does it match `package.json`? Does it expose the `iumbtems` binary?
34
+
35
+ ### Domain 2: Peer Agent Harness Compatibility Claims
36
+ - **Claims in Repo**:
37
+ 1. **OpenCode V2**: Claims plugin integration in `plugins/opencode/index.js`, using slash commands (`/swarm`, `/grill`, `/audit`), agent profiles (`config/opencode-snippet.json`), and notes that OpenCode lacks a pre-execution webfetch hook.
38
+ 2. **Pi & OMP**: Claims native install via `pi install npm:@heretek-ai/epistemic-swarm` and `omp install npm:@heretek-ai/epistemic-swarm` with command blocks in `package.json`.
39
+ 3. **Claude Code**: Claims marketplace support via `claude plugin marketplace add Heretek-AI/IUMBTEMS` and `.claude-plugin/marketplace.json`.
40
+ - **Fact-Checking Action**:
41
+ - Search official documentation and repos for OpenCode (`opencode.ai`), Pi (`pi.dev`), and Claude Code plugin specs.
42
+ - Verify: Are the configuration formats, CLI command syntaxes, and plugin manifest schemas valid against current upstream specifications?
43
+
44
+ ### Domain 3: Cited Academic & Algorithmic Benchmarks
45
+ - **Claims in Repo** (found in `prompts/base_epistemic_system.md`, `prompts/orchestrator.md`, etc.):
46
+ 1. Llama-3-70B context window (131,072 tokens) and GQA across 8 KV heads (`arXiv:2407.21783`).
47
+ 2. Tip5 hash vs. Poseidon hash SNARK witness generation benchmarks.
48
+ 3. Zero-dependency Raft consensus and DuckDuckGo Lite HTML scraping behavior.
49
+ - **Fact-Checking Action**:
50
+ - Search arXiv and web sources for the cited papers and benchmarks.
51
+ - Verify: Are the numbers, citations, and DOIs authentic, or were any placeholder/synthetic examples presented as real citations?
52
+
53
+ ### Domain 4: License, Security & Dependency Invariants
54
+ - **Claims in Repo**: Apache-2.0 clean-room licensing, permissive-only vendoring, no AGPL/GPL contamination.
55
+ - **Fact-Checking Action**:
56
+ - Inspect dependencies in `package.json` and python scripts.
57
+ - Verify license status of key referenced dependencies via web search.
58
+
59
+ ---
60
+
61
+ ## 3. SINGLE-SESSION AGENTIC EXECUTION WORKFLOW
62
+
63
+ Execute the fact-checking mission autonomously in three sequential phases:
64
+
65
+ ```
66
+ [Phase 1: Alpha (Affirmative)] ──> [Phase 2: Beta (Adversary)] ──> [Phase 3: Epistemic Auditor]
67
+ ```
68
+
69
+ ### Phase 1: Alpha (The Affirmative Grounding)
70
+ 1. Read the local claims in `README.md` and `package.json` using `view_file`.
71
+ 2. Formulate targeted search queries and execute them using `search_web`.
72
+ 3. Fetch full source pages using `read_url_content` for key results.
73
+ 4. Extract verbatim evidence excerpts corroborating the repository's claims.
74
+ 5. Tag all confirmed claims with `[VERIFIED: <URL | "quote">]`.
75
+
76
+ ### Phase 2: Beta (The Adversarial Red Team)
77
+ 1. Execute inverted and adversarial queries to hunt for discrepancies, breaking changes, and invalid claims:
78
+ - `"<package> deprecated"`, `"<command> error"`, `"<paper> critique"`
79
+ - Check if any upstream harness APIs (OpenCode, Pi, Claude Code) have deprecated or altered the interfaces IUMBTEMS relies on.
80
+ - Hunt for missing packages, unfulfilled promises, or exaggerated marketing statements.
81
+ 2. If claimed features or benchmarks cannot be found online, log them as `[NEGATIVE_KNOWLEDGE: <query>]`.
82
+ 3. If an assertion is disproven by current live documentation, document the exact contradiction.
83
+
84
+ ### Phase 3: Epistemic Auditor & Mathematical Synthesis
85
+ 1. Perform character-for-character verification between extracted quotes and source URLs.
86
+ 2. Compute the **Epistemic Score**:
87
+ $$\mathcal{E} = \frac{1.0 \times N_{\text{verified}} + 0.5 \times N_{\text{neg\_knowledge}} - 2.5 \times N_{\text{rejected}}}{N_{\text{verified}} + N_{\text{inferred}} + N_{\text{hypothesis}} + N_{\text{rejected}}}$$
88
+ *(Threshold: $\mathcal{E} \ge 0.65$ to certify empirical grounding).*
89
+ 3. Compute the **Divergence Score**:
90
+ $$D = \frac{|\text{Contradicted Claims}|}{|\text{Total Scope Claims}|}$$
91
+ 4. Output the final synthesis report as a Markdown Artifact or structured response.
92
+
93
+ ---
94
+
95
+ ## 4. OUTPUT FORMAT SPECIFICATION
96
+
97
+ Your final output must follow this structure:
98
+
99
+ ```markdown
100
+ # Epistemic Fact-Checking Audit: IUMBTEMS Repository
101
+
102
+ ## Executive Summary
103
+ - **Overall Verdict**: [CERTIFIED (Score >= 0.65) | AUDIT_WARNING: LOW_EMPIRICAL_GROUNDING]
104
+ - **Epistemic Score ($\mathcal{E}$)**: `<score>`
105
+ - **Dialectic Divergence ($D$)**: `<score>`
106
+ - **Total Claims Audited**: `<count>` (Verified: `<count>`, Rejected: `<count>`, Negative Knowledge: `<count>`)
107
+
108
+ ---
109
+
110
+ ## Evidentiary Audit Ledger
111
+
112
+ ### 1. Package & Distribution Veracity
113
+ - Claim: ...
114
+ - Status: [VERIFIED | REJECTED | NEGATIVE_KNOWLEDGE]
115
+ - Evidence: [VERIFIED: https://... | "Verbatim quote..."]
116
+ - Notes: ...
117
+
118
+ ### 2. Multi-Harness Compatibility (OpenCode, Pi, OMP, Claude Code)
119
+ ...
120
+
121
+ ### 3. Academic & Benchmark Integrity
122
+ ...
123
+
124
+ ### 4. License & Contamination Safety
125
+ ...
126
+
127
+ ---
128
+
129
+ ## Divergence & Contradiction Matrix
130
+ | Dimension | Affirmative Claim (Alpha) | Adversarial Finding (Beta) | Adjudicated Truth |
131
+ | :--- | :--- | :--- | :--- |
132
+ | ... | ... | ... | ... |
133
+
134
+ ---
135
+
136
+ ## Actionable Remediations
137
+ 1. [P0/P1/P2] Specific changes required in `README.md`, `package.json`, or code to align with verified live reality.
138
+ ```
139
+
140
+ ---
141
+
142
+ ## 5. EXECUTION DIRECTIVE
143
+ Begin Phase 1 immediately: inspect local claims, invoke `search_web` to verify npm and harness registries, then proceed through Phase 2 and Phase 3 without stopping.
@@ -238,8 +238,12 @@ class TestFactoryHelper(unittest.TestCase):
238
238
  self.assertEqual(res.returncode, 0, res.stderr)
239
239
  data = last_json_object(res.stdout)
240
240
  self.assertEqual(data["factory"]["agent"], "manager")
241
+ self.assertEqual(data["factory"]["subagent"], False)
242
+ self.assertEqual(data["factory"]["subtask"], False)
241
243
  self.assertIn("$ARGUMENTS", data["factory"]["template"])
242
244
  self.assertEqual(data["expansion"]["agent"], "manager")
245
+ self.assertEqual(data["expansion"]["subagent"], False)
246
+ self.assertEqual(data["expansion"]["subtask"], False)
243
247
 
244
248
 
245
249
  if __name__ == "__main__":