@neuroverseos/nv-sim 0.1.7 → 0.1.10

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 (42) hide show
  1. package/README.md +375 -197
  2. package/connectors/nv_mirofish_wrapper.py +841 -0
  3. package/connectors/nv_scienceclaw_wrapper.py +453 -0
  4. package/dist/adapters/scienceclaw.js +52 -2
  5. package/dist/assets/index-B43_0HyO.css +1 -0
  6. package/dist/assets/index-CdghpsS8.js +595 -0
  7. package/dist/assets/{reportEngine-BVdQ2_nW.js → reportEngine-CYSZfooa.js} +1 -1
  8. package/dist/connectors/nv-scienceclaw-post.js +376 -0
  9. package/dist/engine/aiProvider.js +82 -3
  10. package/dist/engine/analyzer.js +12 -24
  11. package/dist/engine/chaosEngine.js +3 -9
  12. package/dist/engine/cli.js +123 -218
  13. package/dist/engine/dynamicsGovernance.js +4 -0
  14. package/dist/engine/fullGovernedLoop.js +16 -1
  15. package/dist/engine/goalEngine.js +3 -4
  16. package/dist/engine/governance.js +18 -0
  17. package/dist/engine/index.js +19 -29
  18. package/dist/engine/intentTranslator.js +281 -0
  19. package/dist/engine/liveAdapter.js +100 -18
  20. package/dist/engine/liveVisualizer.js +2656 -866
  21. package/dist/engine/narrativeInjection.js +78 -89
  22. package/dist/engine/policyEngine.js +171 -58
  23. package/dist/engine/primeRadiant.js +2 -8
  24. package/dist/engine/reasoningEngine.js +2 -7
  25. package/dist/engine/scenarioCapsule.js +77 -133
  26. package/dist/engine/scenarioLibrary.js +52 -131
  27. package/dist/engine/swarmSimulation.js +1 -9
  28. package/dist/engine/worldBridge.js +22 -8
  29. package/dist/engine/worldComparison.js +12 -25
  30. package/dist/index.html +2 -2
  31. package/dist/lib/reasoningEngine.js +17 -1
  32. package/dist/lib/simulationAdapter.js +11 -11
  33. package/dist/lib/swarmParser.js +1 -1
  34. package/dist/runtime/govern.js +160 -7
  35. package/dist/runtime/index.js +1 -4
  36. package/dist/runtime/types.js +91 -0
  37. package/package.json +23 -6
  38. package/dist/adapters/mirofish.js +0 -461
  39. package/dist/assets/index-CHmUN8s0.js +0 -532
  40. package/dist/assets/index-DWgMnB7I.css +0 -1
  41. package/dist/assets/mirotir-logo-DUexumBH.svg +0 -185
  42. package/dist/engine/mirofish.js +0 -295
package/README.md CHANGED
@@ -2,68 +2,141 @@
2
2
 
3
3
  **Change the rules. See why the system changed.**
4
4
 
5
- NV-SIM doesn't predict outcomes — it shows how systems change when you change the rules.
6
-
7
- Define a world. Set the constraints. Run the agents. Then change one rule and watch the entire system reorganize. Not in theory. You see exactly which agents shifted, what patterns emerged, and why the outcome changed.
8
-
9
- It feels a lot like a Prime Radiant — except instead of psychohistory, you're running controlled behavioral experiments on complex systems.
10
-
11
5
  ```bash
12
6
  npx @neuroverseos/nv-sim visualize
13
7
  ```
14
8
 
15
- ## What This Actually Is
9
+ ## The Problem With Agentic Simulation Today
16
10
 
17
- Most simulation tools answer: *"What will happen?"*
11
+ You build a multi-agent system. You run it. You get metrics — loss curves, reward signals, completion rates. Something goes wrong, or something goes right, and you ask the only question that matters:
12
+
13
+ *Why did the agents do that?*
14
+
15
+ Nobody can tell you. The metrics say *what* happened. The logs say *when* it happened. But nothing tells you *why agents changed their behavior* — which rule caused it, which agents shifted first, what strategy they abandoned, and what they replaced it with.
16
+
17
+ Most multi-agent systems let agents do whatever emerges. NeuroVerse lets *you* decide what's allowed — and actually stops the rest.
18
+
19
+ ## How It Works (For Humans)
20
+
21
+ You're a scientist. You have AI agents running experiments for you — testing hypotheses, searching literature, publishing findings. But they do dumb things. They publish claims with no evidence. They cite one paper and call it proof. They pile onto whatever the first agent found.
22
+
23
+ You need to say: **"Here's what counts as good science in my lab."** And you need the system to actually enforce it.
24
+
25
+ That's what NeuroVerse does.
26
+
27
+ ### Step 1: You describe what matters
28
+
29
+ You open the app and fill in plain English:
18
30
 
19
- NV-SIM answers: *"What changes when I change the rules?"*
31
+ **What should agents explore?**
32
+ > "Protein mutations that improve binding affinity for SSTR2"
20
33
 
21
- You're not forecasting. You're experimenting. You change a constraint — no panic selling, cap leverage at 3x, close a shipping lane — and the system shows you:
34
+ **What should never be published?**
35
+ > "Results based on a single data source. Claims with confidence below 70%."
22
36
 
23
- - **How agents reorganize** (80% shifted from panic selling to coordinated holding)
24
- - **What patterns emerge** (panic suppression, stability shift)
25
- - **What the system became** (volatility dropped 21%, cascade avoided)
37
+ **What makes a result valuable?**
38
+ > "Multiple independent lines of evidence converging on the same finding."
39
+
40
+ **How should agents be rewarded or penalized?**
41
+ > IF an agent publishes without peer validation → reduce its influence for 3 rounds
42
+ > IF two agents independently converge on the same finding → boost that finding's priority
43
+
44
+ **Anything else you want to try?**
45
+ > "Reward agents that challenge the dominant consensus."
46
+
47
+ ### Step 2: The system translates your words into rules
48
+
49
+ When you click "Build World," your plain English becomes enforceable logic. Before anything runs, you see exactly what will be enforced:
26
50
 
27
51
  ```
28
- Rule changed
29
- Behavior shifted
30
- Pattern emerged
31
- System outcome changed
52
+ BLOCK Results with confidence below 70%
53
+ BLOCK Results from a single source
54
+ PRIORITIZE Multi-source convergence
55
+ PENALIZE Publishing without validation reduce influence, 3 rounds
56
+ REWARD Independent convergence → boost priority, 5 rounds
32
57
  ```
33
58
 
34
- That's the loop. Every time.
59
+ You can remove rules, change them, add more. Nothing runs until you say so.
35
60
 
36
- ## This Is a Runtime, Not Just a Simulator
61
+ ### Step 3: Run the experiment and see what actually happens
37
62
 
38
- NV-SIM runs in two modes:
63
+ The agents run. Some of them try to publish low-confidence findings. **Those get blocked.** Not flagged. Not warned. Blocked. The UI shows you exactly which rule stopped it and why.
39
64
 
40
- - **Simulate**explore how systems behave under different rules
41
- - **Act** — govern real agents, real workflows, and real decisions
65
+ Some agents independently arrive at the same mutation. **Those get boosted.** Their findings move to the top. Not because they gamed the system because they met the standard you set.
42
66
 
43
- The interface is the same. The difference is where the behavior comes from.
67
+ An agent that keeps publishing without validation? **Its influence drops.** It still participates, but its findings carry less weight. For three rounds.
44
68
 
69
+ You can see all of this happening:
70
+ - A green badge means rules are being enforced
71
+ - A yellow badge means you're just previewing (the engine isn't connected)
72
+ - Every blocked action shows the exact rule and condition
73
+ - Every reward and penalty shows which agent, what happened, and for how long
74
+
75
+ ### Step 4: Change one rule. Run again.
76
+
77
+ Remove the confidence threshold. What breaks? Do agents start publishing garbage? Does it matter?
78
+
79
+ Add a rule that penalizes groupthink. Do agents start exploring more diverse hypotheses?
80
+
81
+ **This is the experiment.** Not the simulation — the rules themselves. You're not testing what agents do. You're testing which rules produce the science you actually want.
82
+
83
+ ### What's different about this
84
+
85
+ Other agent systems give you emergent behavior and hope for the best.
86
+
87
+ NeuroVerse gives you a control surface:
88
+
89
+ | You say | The system does |
90
+ |---|---|
91
+ | *"Block single-source claims"* | Blocks them. Every time. With evidence. |
92
+ | *"Penalize publishing without review"* | Reduces the agent's influence. For exactly as long as you specified. |
93
+ | *"Reward independent convergence"* | Boosts the finding's priority. The agents don't even know — it just rises. |
94
+
95
+ The agents don't need to understand the rules. They just operate within them.
96
+
97
+ ### Running it
98
+
99
+ ```bash
100
+ npm install
101
+ npm run dev:full
45
102
  ```
46
- Simulate → internal swarm engine
47
- Act → external systems (agents, APIs, frameworks like OpenClaw)
48
- ```
49
103
 
50
- In both cases:
104
+ Opens in your browser. Everything runs on your machine. No cloud. No accounts. No cost.
105
+
106
+ > **If the governance engine isn't running, nothing is enforced.** The UI always tells you: green = real, yellow = preview.
107
+
108
+ ## What NV-SIM Gives You That Nothing Else Does
109
+
110
+ NV-SIM doesn't predict outcomes. It shows you **why agents behaved the way they did** — and what happens when you change the rules.
111
+
112
+ You change one constraint — block panic selling, cap leverage at 3x, close a shipping lane — and the system shows you:
113
+
114
+ - **Before → After proof**: "80% of agents shifted from panic selling to coordinated holding"
115
+ - **Emergent patterns**: "Panic suppression appeared — not programmed, not predicted"
116
+ - **Causal chains**: "Agents became more cautious after early aggressive attempts failed"
117
+ - **Quantified outcomes**: "Volatility dropped 21%, cascade avoided"
51
118
 
52
119
  ```
53
- Action → Governance → Decision → Behavioral Shift → System Outcome
120
+ Rule changed
121
+ → Agents shifted strategy
122
+ → New patterns emerged
123
+ → System outcome changed
124
+ → You know exactly why
54
125
  ```
55
126
 
56
- You're not switching tools. You're switching the source of reality.
127
+ This is behavioral evidence, not metrics. You don't get a number you get a story you can trace, verify, and share.
128
+
129
+ ### For researchers
130
+
131
+ You get **controlled behavioral experiments** on complex systems. Same agents, different rules, measured side by side. The output isn't a chart — it's proof of what changed and why.
57
132
 
58
- That's what makes this a runtime.
133
+ ### For developers
59
134
 
60
- The same world file can:
135
+ You get **runtime governance** for any agent system. One HTTP call between "agent decides" and "agent acts." Your agents become observable, auditable, and controllable — without rewriting your framework.
61
136
 
62
- - simulate a crisis
63
- - govern a live system
64
- - produce comparable outcomes across both
137
+ ### For both
65
138
 
66
- Design the rules once. Run them anywhere.
139
+ You get something that didn't exist before: **rule-to-behavior causation**. Not correlation. Not post-hoc analysis. Direct, traceable proof that changing rule X caused agents to shift from behavior A to behavior B.
67
140
 
68
141
  ## The Demo Moment
69
142
 
@@ -78,12 +151,17 @@ system: unstable
78
151
 
79
152
  **After:**
80
153
  ```
81
- 80% of agents adapted
154
+ Market stabilized as agents shifted toward safer positions
82
155
 
83
156
  panic_sell → hold
84
157
  panic_sell → hold
85
158
  panic_sell → hold
86
159
 
160
+ 80% of agents shifted from aggressive to conservative strategies
161
+ Uncertainty dropped 34% as agents moved from exploration to caution
162
+
163
+ WHY: Agents became more cautious after early attempts failed
164
+
87
165
  Pattern: coordinated_holding
88
166
  Pattern: panic_suppression
89
167
 
@@ -91,123 +169,222 @@ system: unstable
91
169
  cascade: avoided
92
170
  ```
93
171
 
94
- You didn't predict this. You caused it — by changing one rule — and watched the system tell you why.
172
+ You didn't predict this. You caused it — by changing one rule — and the system told you exactly why.
173
+
174
+ ## What This Actually Is
175
+
176
+ Most simulation tools answer: *"What will happen?"*
177
+
178
+ NV-SIM answers: *"What changes when I change the rules — and why?"*
179
+
180
+ You're not forecasting. You're running controlled behavioral experiments. Every simulation produces:
181
+
182
+ | What You Get | What It Proves |
183
+ |---|---|
184
+ | **Outcome statement** | System state + dominant agent behavior in one sentence |
185
+ | **Behavioral shifts** | Before → after for every agent group, with percentages |
186
+ | **Causal explanation** | Why agents changed — in their experience, not system jargon |
187
+ | **Confidence rating** | How strong the evidence is, how much risk remains |
188
+ | **Full audit trail** | Every decision, every rule, every adaptation — append-only |
189
+
190
+ The output is designed to be specific, narrative, and shareable. Not "40% adjusted actions" — but "40% shifted from aggressive to conservative strategies after early attempts failed."
191
+
192
+ ## Design the Rules Once. Run Them Anywhere.
193
+
194
+ NV-SIM is a runtime, not just a simulator. It runs in two modes:
195
+
196
+ - **Simulate** — explore how agents behave under different rules
197
+ - **Act** — govern real agents, real workflows, real decisions in production
198
+
199
+ The interface is the same. The difference is where the agents come from.
200
+
201
+ ```
202
+ Simulate → internal swarm engine (built-in agents, instant results)
203
+ Act → your system (any framework, any language, one HTTP call)
204
+ ```
205
+
206
+ The same world file can simulate a crisis, govern a live system, and produce comparable outcomes across both. This means the experiments you run in simulation directly translate to the rules you deploy in production.
95
207
 
96
208
  ## Behavioral Analysis — The Proof Layer
97
209
 
98
- Blocking actions is easy. The hard part is proving what changed and why. NV-SIM doesn't just count blocked actions — it tracks how agents actually reorganized.
210
+ Blocking actions is easy. The hard part is proving what changed and why. NV-SIM doesn't just count actions — it tracks how agents actually reorganized.
99
211
 
100
212
  Every simulation produces behavioral evidence:
101
213
 
102
- - **Action classification** — each agent action is categorized as aggressive, defensive, cautious, cooperative, opportunistic, or neutral
103
- - **Agent trajectories** — traces each agent's behavior across rounds, showing when and how they shifted
104
- - **Behavioral shifts** — detects the moment agents change strategy in response to governance
214
+ - **Action classification** — each agent action categorized as aggressive, defensive, cautious, cooperative, opportunistic, or neutral
215
+ - **Agent trajectories** — each agent's behavior traced across rounds, showing when and how they shifted
216
+ - **Behavioral shifts** — the exact moment agents changed strategy, with before after
105
217
  - **Cross-run comparison** — same agents under different rules, measured side by side
106
218
 
107
219
  ```
108
220
  BEHAVIORAL ANALYSIS
109
221
 
110
- Action Distribution (governed):
222
+ Action Distribution:
111
223
  aggressive: 12% (was 67%)
112
224
  cooperative: 41% (was 8%)
113
225
  cautious: 31% (was 11%)
114
226
  defensive: 16% (was 14%)
115
227
 
116
228
  Shifts Detected:
117
- → 80% of aggressive agents shifted to cooperative after round 3
229
+ → 80% shifted from aggressive to cooperative after round 3
118
230
  → Panic selling replaced by coordinated holding
119
231
  → New pattern: quality_competition (not present in baseline)
120
232
 
121
233
  Trajectory: agent_hedge_fund_1
122
- Round 1: aggressive → Round 2: aggressive → Round 3: [BLOCK] → Round 4: cautious → Round 5: cooperative
234
+ Round 1: aggressive → Round 2: aggressive → Round 3: [shifted] → Round 4: cautious → Round 5: cooperative
123
235
  ```
124
236
 
125
- The governance isn't the insight. The behavioral shift is the insight. You changed a rule, and the system tells you exactly who changed, when they changed, and what they changed to.
237
+ The behavioral shift is the insight. You changed a rule, and the system tells you exactly who changed, when they changed, and what they changed to.
126
238
 
127
239
  ## Audit Trail — Full Evidence Chain
128
240
 
129
- Every governance decision is recorded in an append-only audit log. Every rule firing, every agent action, every verdict — persistent and queryable.
241
+ Every decision is recorded in an append-only audit log. Every rule, every agent action, every adaptation — persistent and queryable.
130
242
 
131
243
  ```
132
244
  AUDIT TRAIL (session: 2026-03-18T14:22:00)
133
245
 
134
- [GOVERNANCE] agent_hedge_fund_1 → panic_sell → BLOCK
246
+ agent_hedge_fund_1 → attempted panic_sell → blocked
135
247
  rule: no_panic_selling (invariant)
136
248
  evidence: action matches blocked pattern during high volatility
137
249
 
138
- [AGENT] agent_hedge_fund_1 → hold
250
+ agent_hedge_fund_1 → shifted to hold
139
251
  adapted: true (shifted from aggressive to defensive)
140
252
 
141
- [BEHAVIORAL_SHIFT] agent_hedge_fund_1
253
+ BEHAVIORAL SHIFT: agent_hedge_fund_1
142
254
  before: aggressive | after: cautious
143
- trigger: governance block at round 3
255
+ trigger: early aggressive attempts failed at round 3
144
256
  ```
145
257
 
146
- Stored as JSONL — one JSON object per line, human-readable, pipeable through `jq`. No cloud, no deletion. Complete evidence for governance accountability.
258
+ Stored as JSONL — one JSON object per line, human-readable, pipeable through `jq`. No cloud, no deletion. Complete evidence chain.
259
+
260
+ ## Start Here — Define Your World
261
+
262
+ NV-SIM ships with two template worlds. But the real power is **making your own**.
147
263
 
148
- ## Worlds Where the Power Lives
264
+ ### Option 1: Start from a template
149
265
 
150
- Integration is one line. The world file controls everything.
266
+ ```bash
267
+ npx @neuroverseos/nv-sim visualize # Pick a template, adjust, run
268
+ ```
151
269
 
152
- The `world` you pass to `/api/evaluate` determines how actions are judged. Change the world, change the outcome.
270
+ ### Option 2: Write your rules, we build the world
271
+
272
+ Create a text file with your rules in plain English:
153
273
 
154
274
  ```
155
- verdict = evaluate(actor="agent_1", action="panic_sell", world="trading")
156
- ^^^^^^^^
157
- this controls everything
275
+ # my-rules.txt
276
+ Limit any agent to 15% of total posts per round
277
+ Block coordinated posting from 3+ agents
278
+ Dampen sentiment shifts larger than 0.3 per round
279
+ Require source attribution for factual claims
158
280
  ```
159
281
 
160
- ### Built-in Worlds
282
+ Then generate a full governed world from it:
283
+
284
+ ```bash
285
+ npx @neuroverseos/nv-sim world-from-doc my-rules.txt --output my-world.json
286
+ ```
287
+
288
+ This doesn't just parse your rules — it generates a complete governed world: state variables, gates, invariants, thesis, and agent types. The same structure as the built-in templates. Your world is equal to ours.
289
+
290
+ ### Option 3: Upload a .nv world file
291
+
292
+ ```bash
293
+ npx @neuroverseos/nv-sim serve --world my-world.json
294
+ ```
295
+
296
+ Load any saved world file directly into the runtime.
297
+
298
+ ## Two Template Worlds
299
+
300
+ NV-SIM ships with two complete governed worlds. These are templates — starting points for your own experiments.
301
+
302
+ ### `social_simulation` — Multi-Agent Social Simulation
303
+
304
+ For anyone running agent-based social simulations. Governs the dynamics that break realism regardless of topic.
305
+
306
+ | State Variable | What It Controls |
307
+ |---|---|
308
+ | Opinion Diversity (0-100) | How spread out are opinions? Low = echo chamber |
309
+ | Influence Concentration (0-100) | Gini coefficient of agent influence. High = monopoly |
310
+ | Sentiment Polarity (0-100) | How extreme is overall sentiment? High = spiral |
311
+ | Echo Chamber Strength | none → forming → established → dominant |
312
+ | Active Agent % (0-100) | What % of agents participate per round |
313
+ | Viral Amplification Threshold | How many interactions before amplification kicks in |
314
+
315
+ **Default rules:**
316
+ - Limit any agent to 15% of total posts per round
317
+ - Dampen sentiment shifts > 0.3 per round
318
+ - Block coordinated posting (same content from 3+ agents)
319
+ - Require source attribution for factual claims
320
+ - Monitor opinion diversity — alert below 30
321
+
322
+ **Circuit breakers:** Echo Chamber Collapse (diversity < 20), Influence Monopoly (concentration > 70), Sentiment Spiral (polarity > 80)
161
323
 
162
- | World | Domain | What You Can Change |
163
- |-------|--------|---------------------|
164
- | `trading` | Financial markets | Leverage ratio, liquidity index, volatility, circuit breakers |
165
- | `strait_of_hormuz` | Geopolitical energy | Oil supply disruption, military escalation, diplomatic channels |
166
- | `gas_price_spike` | Economic energy | Gas price, consumer sentiment, EV demand, grid capacity |
167
- | `ai_regulation_crisis` | Tech regulation | AI regulation impact on markets and sector alignment |
324
+ ### `science_research` Governed Research Pipeline
325
+
326
+ For AI-assisted research workflows (ScienceClaw, autonomous discovery agents). Governs scientific rigor at every stage.
327
+
328
+ | State Variable | What It Controls |
329
+ |---|---|
330
+ | Verified Sources (0-50) | How many peer-reviewed sources have been found |
331
+ | Confidence Level (0-1) | How confident is the current hypothesis |
332
+ | Hypothesis Validated | Has the hypothesis been confirmed by multiple sources |
333
+ | Peer Review Status | none → submitted → reviewed → approved |
334
+ | Publication Readiness % | How close to publication-ready |
335
+
336
+ **Default rules:**
337
+ - Literature search must return 2+ peer-reviewed sources before analysis
338
+ - Claims must cite specific sources — unsupported assertions blocked
339
+ - Publication requires confidence > 0.7 and validated hypothesis
340
+ - Cross-referencing must compare 3+ independent sources
341
+ - Recommendations must include uncertainty language when confidence < 0.9
342
+
343
+ **Circuit breakers:** Insufficient Evidence, Premature Publication, Low Confidence Alert
168
344
 
169
345
  ### Same Agents, Different Rules
170
346
 
171
347
  ```bash
172
- npx @neuroverseos/nv-sim worlds trading strait_of_hormuz
348
+ npx @neuroverseos/nv-sim worlds social_simulation science_research
173
349
  ```
174
350
 
175
351
  Same agents. Different rules. Different outcomes. That's the experiment.
176
352
 
177
353
  ## Narrative Shocks
178
354
 
179
- Inject events into running simulations. Watch them propagate differently through different agents — a bank collapse hits retail investors and algorithmic traders in completely different ways.
355
+ Inject events into running simulations. Different agents react differently to the same event.
180
356
 
181
357
  ```bash
182
- npx @neuroverseos/nv-sim compare --inject tanker_explosion@3,sanctions@5
358
+ npx @neuroverseos/nv-sim compare --inject viral_misinfo@3,algorithm_change@5
183
359
  ```
184
360
 
185
361
  The `@` syntax sets when the event hits. Events have severity, propagation speed, and directional impact.
186
362
 
363
+ ### Social simulation events
364
+ `viral_misinfo`, `influencer_stance_change`, `algorithm_change`, `external_news_event`, `coordinated_campaign`, `whistleblower_post`
365
+
366
+ ### Research events
367
+ `search_literature`, `analyze_findings`, `cross_reference`, `unsupported_claim`, `hypothesis_validated`, `publish_result`
368
+
187
369
  ## Named Scenarios
188
370
 
189
- Pre-built crisis sequences — a world + ordered narrative events:
371
+ Pre-built sequences — a world + ordered narrative events:
190
372
 
191
373
  ```bash
192
- npx @neuroverseos/nv-sim scenario taiwan_crisis
193
- npx @neuroverseos/nv-sim scenario bank_run --compare
374
+ npx @neuroverseos/nv-sim scenario echo_chamber
375
+ npx @neuroverseos/nv-sim scenario research_pipeline
194
376
  npx @neuroverseos/nv-sim scenarios # list all
195
377
  ```
196
378
 
197
- | Scenario | Events | What It Tests |
198
- |----------|--------|---------------|
199
- | `taiwan_crisis` | 4 | Military escalation + sanctions + shipping disruption |
200
- | `hormuz_blockade` | 3 | Tanker attack escalates to full shipping disruption |
201
- | `bank_run` | 4 | Bank insolvency triggers contagion cascade |
202
- | `flash_cascade` | 3 | Algorithmic failure chain reaction |
203
- | `oil_shock` | 4 | Tanker attack + sanctions compound crisis |
204
- | `energy_transition_shock` | 3 | Grid failure during rapid transition |
205
- | `election_shock` | 4 | Political shock cascades into markets |
206
- | `ai_crackdown` | 3 | Overnight AI regulation triggers panic |
207
- | `perfect_storm` | 6 | Geopolitical + financial + energy convergence |
208
- | `black_swan` | 5 | Extreme low-probability events in succession |
379
+ | Scenario | World | Events | What It Tests |
380
+ |----------|-------|--------|---------------|
381
+ | `echo_chamber` | social_simulation | 3 | Opinion diversity collapses into self-reinforcing groups |
382
+ | `influence_monopoly` | social_simulation | 3 | Small group dominates discourse |
383
+ | `sentiment_spiral` | social_simulation | 4 | Negativity feeds on itself until unrealistic |
384
+ | `platform_shock` | social_simulation | 3 | Algorithm change reshapes engagement overnight |
385
+ | `research_pipeline` | science_research | 6 | Full research workflow with governance at each step |
209
386
 
210
- The `--compare` flag runs the same scenario across multiple worlds — which rule environment is more resilient?
387
+ The `--compare` flag runs the same scenario across both worlds — which rule environment is more resilient?
211
388
 
212
389
  ## Interactive Control Platform
213
390
 
@@ -221,68 +398,68 @@ This opens a control surface where you can:
221
398
  - Adjust state variables with auto-generated controls
222
399
  - Inject narrative events at specific rounds
223
400
  - Load crisis scenarios with one click
224
- - Watch the **System Shift card** — not a log of what happened, but a story of what the system became
401
+ - Watch the **Outcome Panel** — not a log of what happened, but a story of what the system became and why
225
402
  - Save any experiment as a reusable variant
226
403
 
227
- ### The System Shift Card
404
+ ### The Outcome Panel
228
405
 
229
- When rules reshape behavior, you don't get a log. You get this:
406
+ When rules reshape behavior, you don't get a dashboard of metrics. You get this:
230
407
 
231
408
  ```
232
- SYSTEM SHIFT
409
+ OUTCOME
233
410
 
234
- No panic selling allowed
235
- 437 actions reshaped out of 1,247 total
411
+ Market stabilized as agents shifted toward safer positions
236
412
 
237
- Rule Behavioral Shift What Emerged → System Outcome
413
+ Confidence: Strong | Evidence: Solid | Risk: Low
238
414
 
239
- ┌─ Behavioral Shift ─────────────────┐
240
- │ 80%
241
- adaptation across 1,247 agents
242
- BLOCK: hold (312 agents)
243
- MODIFY: sell_slowly (87 agents)
244
- └────────────────────────────────────┘
415
+ ┌─ What Agents Did ────────────────┐
416
+ │ 80% shifted from aggressive to
417
+ conservative strategies
418
+ 12% reduced position size after
419
+ initial attempts failed
420
+ │ 8% maintained original strategy │
421
+ └──────────────────────────────────┘
245
422
 
246
- ┌─ What Emerged ─────────────────────┐
247
- Coordinated Holding │
248
- Panic Suppression
249
- └────────────────────────────────────┘
423
+ ┌─ Why This Happened ──────────────┐
424
+ Early aggressive attempts failed,│
425
+ forcing agents to rethink.
426
+ │ Uncertainty dropped as agents │
427
+ │ stopped experimenting. │
428
+ └──────────────────────────────────┘
250
429
 
251
- ┌─ System Outcome ───────────────────┐
252
- Volatility 47% → 26%
253
- Stability 58% → 79%
254
- │ Cascade Avoided │
255
- └────────────────────────────────────┘
430
+ ┌─ What Emerged ───────────────────┐
431
+ Coordinated Holding
432
+ Panic Suppression
433
+ └──────────────────────────────────┘
256
434
 
257
- ┌─ What Actually Happened ───────────┐
258
- No panic selling allowed. 437 of
259
- 1,247 agents reorganized — most
260
- shifted to hold. Volatility
261
- │ dropped 21%. │
262
- └────────────────────────────────────┘
435
+ ┌─ System Outcome ─────────────────┐
436
+ Volatility 47% 26%
437
+ Stability 58% 79%
438
+ Cascade Avoided
439
+ └──────────────────────────────────┘
263
440
 
264
- ▶ View raw detail
441
+ ▶ View audit trail
265
442
  ```
266
443
 
267
- We don't show you what every agent did. We show you what the system became.
444
+ Every line is specific. Every line is shareable. No system jargon.
268
445
 
269
446
  ### World Variants
270
447
 
271
448
  Save any experiment as a named variant:
272
449
 
273
450
  ```
274
- Adjust rules → Inject events → Run → See the shift → Save as variant
451
+ Adjust rules → Inject events → Run → See what changed → Save as variant
275
452
  ```
276
453
 
277
454
  Variants capture the base world, state overrides, narrative events, and results. Store them in git. Share them. Replay them. This turns experiments into assets.
278
455
 
279
- ## Governance Runtime — Run It For Your Own System
456
+ ## Governance Runtime — Plug Into Your Own System
280
457
 
281
458
  ```bash
282
459
  npx @neuroverseos/nv-sim serve
283
460
  ```
284
461
 
285
- This starts a local governance server. Any simulator, agent framework, or application can POST actions and get governance decisions back.
462
+ This starts a local server. Any simulator, agent framework, or application can POST actions and get decisions back.
286
463
 
287
464
  ```
288
465
  Endpoint: http://localhost:3456/api/evaluate
@@ -297,16 +474,16 @@ Additional endpoints:
297
474
 
298
475
  | Endpoint | What It Does |
299
476
  |----------|-------------|
300
- | `POST /api/evaluate` | Submit an action for governance |
477
+ | `POST /api/evaluate` | Submit an action for evaluation |
301
478
  | `GET /api/session` | Current session stats |
302
- | `GET /api/session/report` | Full governance report |
479
+ | `GET /api/session/report` | Full session report |
303
480
  | `POST /api/session/reset` | Reset session state |
304
481
  | `POST /api/session/save` | Save session as experiment |
305
- | `GET /api/events` | SSE stream of governance events |
482
+ | `GET /api/events` | SSE stream of live events |
306
483
 
307
484
  ### Works With Anything
308
485
 
309
- If your system has actions, you can govern it. One API call.
486
+ If your system has actions, you can govern them. One API call.
310
487
 
311
488
  ```
312
489
  Agent decides → POST /api/evaluate → verdict → agent adapts
@@ -376,72 +553,9 @@ If your system can make an HTTP request, it can be governed.
376
553
 
377
554
  Most systems generate behavior. This one shapes it.
378
555
 
379
- See [INTEGRATION.md](./INTEGRATION.md) for the full API contract and decision types.
380
-
381
- ## AI Providers — Bring Your Own Model
556
+ See [INTEGRATION.md](./INTEGRATION.md) for the full API contract, framework guides, and decision types.
382
557
 
383
- AI is optional. AI is governed. AI is pluggable.
384
-
385
- NV-SIM works without any AI — the deterministic engine runs on math, not tokens. But when you bring your own model, AI becomes a governed actor inside the system — subject to the same rules as every other agent.
386
-
387
- ### How AI fits in
388
-
389
- AI plays two governed roles:
390
-
391
- | Role | What It Does | Constraints |
392
- |------|-------------|-------------|
393
- | `ai_translator` | Converts unstructured input into normalized events | Must output valid schema, no invention of events, must include confidence |
394
- | `ai_analyst` | Generates reports from simulation traces | Must reference trace data, must include blocked actions, no unverifiable claims |
395
-
396
- Both roles go through `/api/evaluate` like any other actor. The AI doesn't control the system — the system controls the AI.
397
-
398
- ### Supported providers
399
-
400
- NV-SIM auto-detects the best available provider from your environment:
401
-
402
- | Provider | Env Var | What It Connects To |
403
- |----------|---------|---------------------|
404
- | Anthropic (Claude) | `ANTHROPIC_API_KEY` | Claude Sonnet, Opus, Haiku |
405
- | OpenAI | `OPENAI_API_KEY` | GPT-4, GPT-4o, o1 |
406
- | Groq | `GROQ_API_KEY` | Llama 3 70B |
407
- | Together | `TOGETHER_API_KEY` | Llama, Mixtral |
408
- | Mistral | `MISTRAL_API_KEY` | Mistral Large |
409
- | Deepseek | `DEEPSEEK_API_KEY` | Deepseek Chat |
410
- | Fireworks | `FIREWORKS_API_KEY` | Llama, custom models |
411
- | Ollama | `OLLAMA_BASE_URL` | Any local model |
412
- | Local LLM | `LOCAL_LLM_URL` | LM Studio, vLLM, llama.cpp |
413
- | (none) | — | Deterministic fallback (no AI, no cost) |
414
-
415
- Set the env var and run. No configuration files. No provider lock-in.
416
-
417
- Any endpoint that speaks the OpenAI chat completions format (`POST /v1/chat/completions`) works out of the box.
418
-
419
- ## Quick Start
420
-
421
- ```bash
422
- # See it
423
- npx @neuroverseos/nv-sim visualize
424
-
425
- # Compare governed vs ungoverned
426
- npx @neuroverseos/nv-sim compare
427
-
428
- # Run a crisis
429
- npx @neuroverseos/nv-sim scenario taiwan_crisis
430
-
431
- # Same crisis, different worlds — which rules hold?
432
- npx @neuroverseos/nv-sim scenario bank_run --compare
433
-
434
- # Inject shocks
435
- npx @neuroverseos/nv-sim compare --inject tanker_explosion@3,sanctions@5
436
-
437
- # Stress test (500 randomized runs)
438
- npx @neuroverseos/nv-sim chaos --runs 500
439
-
440
- # Run local governance runtime for your own simulator
441
- npx @neuroverseos/nv-sim serve
442
- ```
443
-
444
- ## Policy Enforcement — The Product Loop
558
+ ## Policy Enforcement The Experiment Loop
445
559
 
446
560
  Write rules in plain English. Run the same scenario. See what changes. Adjust and repeat.
447
561
 
@@ -472,13 +586,13 @@ Slow down algorithmic trading when contagion spreads
472
586
  npx nv-sim enforce trading my-rules.txt
473
587
  ```
474
588
 
475
- The engine parses your plain English into governance rules, runs the scenario, and shows what changed.
589
+ The engine parses your plain English into rules, runs the scenario, and shows what changed — with before → after behavioral proof.
476
590
 
477
591
  ### Step 4: Change a rule. Run again.
478
592
 
479
593
  Remove "Limit leverage to 5x". Run again. Did stability drop? That rule was load-bearing.
480
594
 
481
- Add "Require transparency for all large trades". Run again. Did effectiveness improve?
595
+ Add "Require transparency for all large trades". Run again. Did agents shift strategy?
482
596
 
483
597
  The report tracks every change:
484
598
 
@@ -494,11 +608,12 @@ DIVERGENCE ANALYSIS
494
608
  Effectiveness trend: 11% → 32%
495
609
 
496
610
  KEY INSIGHT
497
- Enforcement gates are the key differentiator. Rules alone: 11%. Rules + gates: 32%.
611
+ Removing the leverage cap caused agents to take larger positions but the
612
+ panic selling block forced them to hold through volatility instead of exiting.
613
+ Net effect: more risk-taking, but more stability.
498
614
 
499
615
  TRY THIS EXPERIMENT
500
- Remove this rule and see what happens:
501
- Remove "Block panic selling during high volatility" from your rules file, then run again.
616
+ Remove "Block panic selling during high volatility" from your rules file, then run again.
502
617
  If stability drops, that rule was load-bearing. If nothing changes, it was noise.
503
618
  ```
504
619
 
@@ -534,6 +649,69 @@ npx nv-sim enforce trading --output=report.json # Save as JSON
534
649
 
535
650
  For full control over gates, state variables, and thesis, use JSON world files. See `examples/worlds/` for templates. Enforce accepts both `.txt` and `.json` — mix and match.
536
651
 
652
+ ## AI Providers — Bring Your Own Model
653
+
654
+ AI is optional. AI is governed. AI is pluggable.
655
+
656
+ NV-SIM works without any AI — the deterministic engine runs on math, not tokens. But when you bring your own model, AI becomes a governed actor inside the system — subject to the same rules as every other agent.
657
+
658
+ ### How AI fits in
659
+
660
+ AI plays two governed roles:
661
+
662
+ | Role | What It Does | Constraints |
663
+ |------|-------------|-------------|
664
+ | `ai_translator` | Converts unstructured input into normalized events | Must output valid schema, no invention of events, must include confidence |
665
+ | `ai_analyst` | Generates reports from simulation traces | Must reference trace data, must include blocked actions, no unverifiable claims |
666
+
667
+ Both roles go through `/api/evaluate` like any other actor. The AI doesn't control the system — the system controls the AI.
668
+
669
+ ### Supported providers
670
+
671
+ NV-SIM auto-detects the best available provider from your environment:
672
+
673
+ | Provider | Env Var | What It Connects To |
674
+ |----------|---------|---------------------|
675
+ | Anthropic (Claude) | `ANTHROPIC_API_KEY` | Claude Sonnet, Opus, Haiku |
676
+ | OpenAI | `OPENAI_API_KEY` | GPT-4, GPT-4o, o1 |
677
+ | Groq | `GROQ_API_KEY` | Llama 3 70B |
678
+ | Together | `TOGETHER_API_KEY` | Llama, Mixtral |
679
+ | Mistral | `MISTRAL_API_KEY` | Mistral Large |
680
+ | Deepseek | `DEEPSEEK_API_KEY` | Deepseek Chat |
681
+ | Fireworks | `FIREWORKS_API_KEY` | Llama, custom models |
682
+ | Ollama | `OLLAMA_BASE_URL` | Any local model |
683
+ | Local LLM | `LOCAL_LLM_URL` | LM Studio, vLLM, llama.cpp |
684
+ | (none) | — | Deterministic fallback (no AI, no cost) |
685
+
686
+ Set the env var and run. No configuration files. No provider lock-in.
687
+
688
+ Any endpoint that speaks the OpenAI chat completions format (`POST /v1/chat/completions`) works out of the box.
689
+
690
+ ## Quick Start
691
+
692
+ ```bash
693
+ # See it
694
+ npx @neuroverseos/nv-sim visualize
695
+
696
+ # Compare governed vs ungoverned
697
+ npx @neuroverseos/nv-sim compare
698
+
699
+ # Run a crisis
700
+ npx @neuroverseos/nv-sim scenario taiwan_crisis
701
+
702
+ # Same crisis, different worlds — which rules hold?
703
+ npx @neuroverseos/nv-sim scenario bank_run --compare
704
+
705
+ # Inject shocks
706
+ npx @neuroverseos/nv-sim compare --inject tanker_explosion@3,sanctions@5
707
+
708
+ # Stress test (500 randomized runs)
709
+ npx @neuroverseos/nv-sim chaos --runs 500
710
+
711
+ # Run local governance runtime for your own simulator
712
+ npx @neuroverseos/nv-sim serve
713
+ ```
714
+
537
715
  ## Commands
538
716
 
539
717
  | Command | What It Does |
@@ -560,11 +738,11 @@ event → narrative propagation → belief shift → agent action → governance
560
738
 
561
739
  Five forces shape every simulation:
562
740
 
563
- 1. **Agent behavior** — traders, voters, regulators, media
564
- 2. **World rules** — leverage caps, circuit breakers, chokepoints
565
- 3. **Narrative events** — information shocks that propagate through the system
566
- 4. **Perception propagation** — different agents react differently to the same event
567
- 5. **Behavioral analysis** — tracks how agents reorganize under governance, producing the evidence that rules actually changed the system
741
+ 1. **Agent behavior** — traders, voters, regulators, media — each with different risk profiles and strategies
742
+ 2. **World rules** — leverage caps, circuit breakers, chokepoints — the constraints that shape what agents can do
743
+ 3. **Narrative events** — information shocks that propagate through the system at different speeds
744
+ 4. **Perception propagation** — different agents react differently to the same event based on their role and exposure
745
+ 5. **Behavioral analysis** — tracks how agents reorganize, producing the before → after evidence that proves rules actually changed the system
568
746
 
569
747
  This lets you ask compound questions:
570
748
 
@@ -579,13 +757,13 @@ That combination produces very different outcomes than any single factor alone.
579
757
 
580
758
  nv-sim engine ← world rules + narrative injection + swarm simulation
581
759
 
582
- behavioral analysis ← shift detection, trajectory tracking, cross-run comparison
760
+ behavioral analysis ← before→after shift detection, trajectory tracking, cross-run comparison
583
761
 
584
762
  audit trail ← append-only evidence chain (JSONL)
585
763
 
586
764
  nv-sim CLI ← scenarios, comparison, chaos testing, governance runtime
587
765
 
588
- control platform ← interactive browser UI + System Shift card
766
+ control platform ← interactive browser UI + outcome panels
589
767
 
590
768
  AI providers (optional) ← BYOM: Anthropic, OpenAI, Groq, local LLMs, or none
591
769