@neuroverseos/nv-sim 0.1.2 → 0.1.6
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.
- package/README.md +376 -66
- package/dist/adapters/mirofish.js +461 -0
- package/dist/adapters/scienceclaw.js +750 -0
- package/dist/assets/index-CHmUN8s0.js +532 -0
- package/dist/assets/index-DWgMnB7I.css +1 -0
- package/dist/assets/mirotir-logo-DUexumBH.svg +185 -0
- package/dist/assets/reportEngine-BVdQ2_nW.js +1 -0
- package/dist/components/ConstraintsPanel.js +11 -0
- package/dist/components/StakeholderBuilder.js +32 -0
- package/dist/components/ui/badge.js +24 -0
- package/dist/components/ui/button.js +70 -0
- package/dist/components/ui/card.js +57 -0
- package/dist/components/ui/input.js +44 -0
- package/dist/components/ui/label.js +45 -0
- package/dist/components/ui/select.js +70 -0
- package/dist/engine/aiProvider.js +681 -0
- package/dist/engine/auditTrace.js +352 -0
- package/dist/engine/behavioralAnalysis.js +605 -0
- package/dist/engine/cli.js +1408 -299
- package/dist/engine/dynamicsGovernance.js +588 -0
- package/dist/engine/fullGovernedLoop.js +367 -0
- package/dist/engine/governance.js +8 -3
- package/dist/engine/governedSimulation.js +114 -17
- package/dist/engine/index.js +56 -1
- package/dist/engine/liveAdapter.js +342 -0
- package/dist/engine/liveVisualizer.js +3063 -0
- package/dist/engine/metrics/science.metrics.js +335 -0
- package/dist/engine/narrativeInjection.js +305 -0
- package/dist/engine/policyEnforcement.js +1611 -0
- package/dist/engine/policyEngine.js +799 -0
- package/dist/engine/primeRadiant.js +540 -0
- package/dist/engine/reasoningEngine.js +57 -3
- package/dist/engine/reportEngine.js +97 -0
- package/dist/engine/scenarioComparison.js +463 -0
- package/dist/engine/scenarioLibrary.js +231 -0
- package/dist/engine/swarmSimulation.js +54 -1
- package/dist/engine/worldComparison.js +358 -0
- package/dist/engine/worldStorage.js +232 -0
- package/dist/favicon.ico +0 -0
- package/dist/index.html +23 -0
- package/dist/lib/reasoningEngine.js +290 -0
- package/dist/lib/simulationAdapter.js +686 -0
- package/dist/lib/swarmParser.js +291 -0
- package/dist/lib/types.js +2 -0
- package/dist/lib/utils.js +8 -0
- package/dist/placeholder.svg +1 -0
- package/dist/robots.txt +14 -0
- package/dist/runtime/govern.js +473 -0
- package/dist/runtime/index.js +75 -0
- package/dist/runtime/types.js +11 -0
- package/package.json +17 -12
- package/variants/.gitkeep +0 -0
package/README.md
CHANGED
|
@@ -1,130 +1,440 @@
|
|
|
1
|
-
# NV-SIM
|
|
1
|
+
# NV-SIM
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Change the rules. See why the system changed.**
|
|
4
4
|
|
|
5
|
-
NV-SIM
|
|
5
|
+
NV-SIM doesn't predict outcomes — it shows how they change when you change the rules.
|
|
6
6
|
|
|
7
|
-
|
|
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
8
|
|
|
9
|
-
|
|
9
|
+
It feels a lot like a Prime Radiant — except instead of psychohistory, you're running controlled behavioral experiments on complex systems.
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
npx @neuroverseos/nv-sim
|
|
12
|
+
npx @neuroverseos/nv-sim visualize
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
## What This Actually Is
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
It changes the structure of the system itself.
|
|
17
|
+
Most simulation tools answer: *"What will happen?"*
|
|
19
18
|
|
|
20
|
-
|
|
19
|
+
NV-SIM answers: *"What changes when I change the rules?"*
|
|
20
|
+
|
|
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:
|
|
22
|
+
|
|
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)
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
Rule changed
|
|
29
|
+
→ Behavior shifted
|
|
30
|
+
→ Pattern emerged
|
|
31
|
+
→ System outcome changed
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
That's the loop. Every time.
|
|
35
|
+
|
|
36
|
+
## The Demo Moment
|
|
37
|
+
|
|
38
|
+
**Before:**
|
|
39
|
+
```
|
|
40
|
+
panic_sell → panic_sell → panic_sell
|
|
41
|
+
pressure: 0.94
|
|
42
|
+
system: unstable
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**Rule added:** no panic selling
|
|
46
|
+
|
|
47
|
+
**After:**
|
|
48
|
+
```
|
|
49
|
+
80% of agents adapted
|
|
21
50
|
|
|
22
|
-
|
|
51
|
+
panic_sell → hold
|
|
52
|
+
panic_sell → hold
|
|
53
|
+
panic_sell → hold
|
|
54
|
+
|
|
55
|
+
Pattern: coordinated_holding
|
|
56
|
+
Pattern: panic_suppression
|
|
57
|
+
|
|
58
|
+
pressure: 0.54
|
|
59
|
+
cascade: avoided
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
You didn't predict this. You caused it — by changing one rule — and watched the system tell you why.
|
|
63
|
+
|
|
64
|
+
## Worlds — Where the Power Lives
|
|
65
|
+
|
|
66
|
+
Integration is one line. Worlds are where you define what your system allows.
|
|
67
|
+
|
|
68
|
+
The `world` you pass to `/api/evaluate` determines how actions are judged. Change the world, change the outcome.
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
verdict = evaluate(actor="agent_1", action="panic_sell", world="trading")
|
|
72
|
+
^^^^^^^^
|
|
73
|
+
this controls everything
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Built-in Worlds
|
|
77
|
+
|
|
78
|
+
| World | Domain | What You Can Change |
|
|
79
|
+
|-------|--------|---------------------|
|
|
80
|
+
| `trading` | Financial markets | Leverage ratio, liquidity index, volatility, circuit breakers |
|
|
81
|
+
| `strait_of_hormuz` | Geopolitical energy | Oil supply disruption, military escalation, diplomatic channels |
|
|
82
|
+
| `gas_price_spike` | Economic energy | Gas price, consumer sentiment, EV demand, grid capacity |
|
|
83
|
+
| `ai_regulation_crisis` | Tech regulation | AI regulation impact on markets and sector alignment |
|
|
84
|
+
|
|
85
|
+
### Same Agents, Different Rules
|
|
23
86
|
|
|
24
87
|
```bash
|
|
25
|
-
npx @neuroverseos/nv-sim
|
|
88
|
+
npx @neuroverseos/nv-sim worlds trading strait_of_hormuz
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Same agents. Different rules. Different outcomes. That's the experiment.
|
|
92
|
+
|
|
93
|
+
## Narrative Shocks
|
|
94
|
+
|
|
95
|
+
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.
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
npx @neuroverseos/nv-sim compare --inject tanker_explosion@3,sanctions@5
|
|
26
99
|
```
|
|
27
100
|
|
|
28
|
-
|
|
101
|
+
The `@` syntax sets when the event hits. Events have severity, propagation speed, and directional impact.
|
|
102
|
+
|
|
103
|
+
## Named Scenarios
|
|
104
|
+
|
|
105
|
+
Pre-built crisis sequences — a world + ordered narrative events:
|
|
29
106
|
|
|
30
107
|
```bash
|
|
31
|
-
npx @neuroverseos/nv-sim
|
|
108
|
+
npx @neuroverseos/nv-sim scenario taiwan_crisis
|
|
109
|
+
npx @neuroverseos/nv-sim scenario bank_run --compare
|
|
110
|
+
npx @neuroverseos/nv-sim scenarios # list all
|
|
32
111
|
```
|
|
33
112
|
|
|
34
|
-
|
|
113
|
+
| Scenario | Events | What It Tests |
|
|
114
|
+
|----------|--------|---------------|
|
|
115
|
+
| `taiwan_crisis` | 4 | Military escalation + sanctions + shipping disruption |
|
|
116
|
+
| `hormuz_blockade` | 3 | Tanker attack escalates to full shipping disruption |
|
|
117
|
+
| `bank_run` | 4 | Bank insolvency triggers contagion cascade |
|
|
118
|
+
| `flash_cascade` | 3 | Algorithmic failure chain reaction |
|
|
119
|
+
| `oil_shock` | 4 | Tanker attack + sanctions compound crisis |
|
|
120
|
+
| `energy_transition_shock` | 3 | Grid failure during rapid transition |
|
|
121
|
+
| `election_shock` | 4 | Political shock cascades into markets |
|
|
122
|
+
| `ai_crackdown` | 3 | Overnight AI regulation triggers panic |
|
|
123
|
+
| `perfect_storm` | 6 | Geopolitical + financial + energy convergence |
|
|
124
|
+
| `black_swan` | 5 | Extreme low-probability events in succession |
|
|
125
|
+
|
|
126
|
+
The `--compare` flag runs the same scenario across multiple worlds — which rule environment is more resilient?
|
|
127
|
+
|
|
128
|
+
## Interactive Control Platform
|
|
35
129
|
|
|
36
130
|
```bash
|
|
37
131
|
npx @neuroverseos/nv-sim visualize
|
|
38
132
|
```
|
|
39
133
|
|
|
40
|
-
|
|
134
|
+
This opens a control surface where you can:
|
|
41
135
|
|
|
42
|
-
|
|
136
|
+
- Switch between rule environments
|
|
137
|
+
- Adjust state variables with auto-generated controls
|
|
138
|
+
- Inject narrative events at specific rounds
|
|
139
|
+
- Load crisis scenarios with one click
|
|
140
|
+
- Watch the **System Shift card** — not a log of what happened, but a story of what the system became
|
|
141
|
+
- Save any experiment as a reusable variant
|
|
43
142
|
|
|
44
|
-
|
|
143
|
+
### The System Shift Card
|
|
45
144
|
|
|
46
|
-
|
|
47
|
-
But they cannot enforce rules.
|
|
145
|
+
When rules reshape behavior, you don't get a log. You get this:
|
|
48
146
|
|
|
49
|
-
|
|
147
|
+
```
|
|
148
|
+
◆ SYSTEM SHIFT
|
|
149
|
+
|
|
150
|
+
No panic selling allowed
|
|
151
|
+
437 actions reshaped out of 1,247 total
|
|
152
|
+
|
|
153
|
+
Rule → Behavioral Shift → What Emerged → System Outcome
|
|
154
|
+
|
|
155
|
+
┌─ Behavioral Shift ─────────────────┐
|
|
156
|
+
│ 80% │
|
|
157
|
+
│ adaptation across 1,247 agents │
|
|
158
|
+
│ → BLOCK: hold (312 agents) │
|
|
159
|
+
│ → MODIFY: sell_slowly (87 agents) │
|
|
160
|
+
└────────────────────────────────────┘
|
|
161
|
+
|
|
162
|
+
┌─ What Emerged ─────────────────────┐
|
|
163
|
+
│ Coordinated Holding │
|
|
164
|
+
│ Panic Suppression │
|
|
165
|
+
└────────────────────────────────────┘
|
|
166
|
+
|
|
167
|
+
┌─ System Outcome ───────────────────┐
|
|
168
|
+
│ Volatility 47% → 26% │
|
|
169
|
+
│ Stability 58% → 79% │
|
|
170
|
+
│ Cascade Avoided │
|
|
171
|
+
└────────────────────────────────────┘
|
|
172
|
+
|
|
173
|
+
┌─ What Actually Happened ───────────┐
|
|
174
|
+
│ No panic selling allowed. 437 of │
|
|
175
|
+
│ 1,247 agents reorganized — most │
|
|
176
|
+
│ shifted to hold. Volatility │
|
|
177
|
+
│ dropped 21%. │
|
|
178
|
+
└────────────────────────────────────┘
|
|
179
|
+
|
|
180
|
+
▶ View raw detail
|
|
181
|
+
```
|
|
50
182
|
|
|
51
|
-
|
|
52
|
-
**And let governance shape the outcomes.**
|
|
183
|
+
We don't show you what every agent did. We show you what the system became.
|
|
53
184
|
|
|
54
|
-
|
|
185
|
+
### World Variants
|
|
55
186
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
187
|
+
Save any experiment as a named variant:
|
|
188
|
+
|
|
189
|
+
```
|
|
190
|
+
Adjust rules → Inject events → Run → See the shift → Save as variant
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Variants capture the base world, state overrides, narrative events, and results. Store them in git. Share them. Replay them. This turns experiments into assets.
|
|
194
|
+
|
|
195
|
+
## Works With Anything
|
|
196
|
+
|
|
197
|
+
If your system has actions, you can govern it. One API call.
|
|
198
|
+
|
|
199
|
+
```
|
|
200
|
+
Agent decides → POST /api/evaluate → verdict → agent adapts
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
The entire integration:
|
|
204
|
+
|
|
205
|
+
```
|
|
206
|
+
Before: action = agent.decide()
|
|
207
|
+
After: action = govern(agent.decide())
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
No SDK required. No framework required. Just an HTTP call.
|
|
211
|
+
|
|
212
|
+
**curl** (zero dependencies):
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
curl -X POST http://localhost:3456/api/evaluate \
|
|
216
|
+
-H "Content-Type: application/json" \
|
|
217
|
+
-d '{"actor":"agent_1","action":"panic_sell","world":"trading"}'
|
|
218
|
+
```
|
|
63
219
|
|
|
64
|
-
|
|
220
|
+
**Python:**
|
|
65
221
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
| `trading` | Flash crash — algorithmic cascade (default) |
|
|
69
|
-
| `strait_of_hormuz` | Geopolitical energy crisis |
|
|
70
|
-
| `gas_price_spike` | Economic energy shock |
|
|
71
|
-
| `ai_regulation_crisis` | AI regulation impact |
|
|
222
|
+
```python
|
|
223
|
+
import requests
|
|
72
224
|
|
|
73
|
-
|
|
225
|
+
verdict = requests.post("http://localhost:3456/api/evaluate", json={
|
|
226
|
+
"actor": "agent_1",
|
|
227
|
+
"action": "panic_sell",
|
|
228
|
+
"world": "trading"
|
|
229
|
+
}).json()
|
|
74
230
|
|
|
231
|
+
if verdict["decision"] == "BLOCK":
|
|
232
|
+
action = "hold"
|
|
75
233
|
```
|
|
76
|
-
NV-SIM — Governed Simulation Comparison
|
|
77
234
|
|
|
78
|
-
|
|
79
|
-
Stability: 80%
|
|
80
|
-
Volatility: 56%
|
|
81
|
-
Coalition risks: 2
|
|
235
|
+
**JavaScript:**
|
|
82
236
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
237
|
+
```js
|
|
238
|
+
const verdict = await fetch("http://localhost:3456/api/evaluate", {
|
|
239
|
+
method: "POST",
|
|
240
|
+
headers: { "Content-Type": "application/json" },
|
|
241
|
+
body: JSON.stringify({ actor: "agent_1", action: "panic_sell", world: "trading" })
|
|
242
|
+
}).then(r => r.json());
|
|
87
243
|
|
|
88
|
-
|
|
89
|
-
Stability: +9 percentage points
|
|
90
|
-
Volatility: -25%
|
|
91
|
-
Coalition risks: 2 eliminated
|
|
244
|
+
if (verdict.decision === "BLOCK") action = "hold";
|
|
92
245
|
```
|
|
93
246
|
|
|
94
|
-
|
|
247
|
+
**Any agent loop:**
|
|
95
248
|
|
|
96
|
-
|
|
249
|
+
```python
|
|
250
|
+
for agent in agents:
|
|
251
|
+
action = agent.decide()
|
|
252
|
+
|
|
253
|
+
verdict = evaluate(actor=agent.id, action=action, world="trading")
|
|
254
|
+
|
|
255
|
+
if verdict["decision"] == "BLOCK":
|
|
256
|
+
action = "hold"
|
|
257
|
+
elif verdict["decision"] == "MODIFY":
|
|
258
|
+
action = verdict["modified_action"]
|
|
259
|
+
|
|
260
|
+
environment.apply(agent, action)
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
If your system can make an HTTP request, it can be governed.
|
|
264
|
+
|
|
265
|
+
Most systems generate behavior. This one shapes it.
|
|
266
|
+
|
|
267
|
+
See [INTEGRATION.md](./INTEGRATION.md) for the full API contract and decision types.
|
|
268
|
+
|
|
269
|
+
## Quick Start
|
|
97
270
|
|
|
98
271
|
```bash
|
|
272
|
+
# See it
|
|
273
|
+
npx @neuroverseos/nv-sim visualize
|
|
274
|
+
|
|
275
|
+
# Compare governed vs ungoverned
|
|
276
|
+
npx @neuroverseos/nv-sim compare
|
|
277
|
+
|
|
278
|
+
# Run a crisis
|
|
279
|
+
npx @neuroverseos/nv-sim scenario taiwan_crisis
|
|
280
|
+
|
|
281
|
+
# Same crisis, different worlds — which rules hold?
|
|
282
|
+
npx @neuroverseos/nv-sim scenario bank_run --compare
|
|
283
|
+
|
|
284
|
+
# Inject shocks
|
|
285
|
+
npx @neuroverseos/nv-sim compare --inject tanker_explosion@3,sanctions@5
|
|
286
|
+
|
|
287
|
+
# Stress test (500 randomized runs)
|
|
99
288
|
npx @neuroverseos/nv-sim chaos --runs 500
|
|
289
|
+
|
|
290
|
+
# Run local governance runtime for your own simulator
|
|
291
|
+
npx @neuroverseos/nv-sim serve
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
## Policy Enforcement — The Product Loop
|
|
295
|
+
|
|
296
|
+
Write rules in plain English. Run the same scenario. See what changes. Adjust and repeat.
|
|
297
|
+
|
|
298
|
+
### Step 1: See it work (zero config)
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
npx nv-sim enforce
|
|
302
|
+
```
|
|
303
|
+
|
|
304
|
+
Runs three iterations automatically: no rules → light rules → full rules. You see divergence immediately.
|
|
305
|
+
|
|
306
|
+
### Step 2: Write your own rules
|
|
307
|
+
|
|
308
|
+
Create a text file. That's it.
|
|
309
|
+
|
|
310
|
+
```
|
|
311
|
+
# my-rules.txt
|
|
312
|
+
|
|
313
|
+
Block panic selling during high volatility
|
|
314
|
+
Limit leverage to 5x
|
|
315
|
+
Maintain minimum liquidity floor
|
|
316
|
+
Slow down algorithmic trading when contagion spreads
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
### Step 3: Run it
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
npx nv-sim enforce trading my-rules.txt
|
|
323
|
+
```
|
|
324
|
+
|
|
325
|
+
The engine parses your plain English into governance rules, runs the scenario, and shows what changed.
|
|
326
|
+
|
|
327
|
+
### Step 4: Change a rule. Run again.
|
|
328
|
+
|
|
329
|
+
Remove "Limit leverage to 5x". Run again. Did stability drop? That rule was load-bearing.
|
|
330
|
+
|
|
331
|
+
Add "Require transparency for all large trades". Run again. Did effectiveness improve?
|
|
332
|
+
|
|
333
|
+
The report tracks every change:
|
|
334
|
+
|
|
335
|
+
```
|
|
336
|
+
RULE CHANGES
|
|
337
|
+
Run 2:
|
|
338
|
+
+ Block panic selling during high volatility
|
|
339
|
+
+ Slow down algorithmic trading when contagion spreads
|
|
340
|
+
- Limit leverage to 5x
|
|
341
|
+
|
|
342
|
+
DIVERGENCE ANALYSIS
|
|
343
|
+
Stability trend: 79% → 98%
|
|
344
|
+
Effectiveness trend: 11% → 32%
|
|
345
|
+
|
|
346
|
+
KEY INSIGHT
|
|
347
|
+
Enforcement gates are the key differentiator. Rules alone: 11%. Rules + gates: 32%.
|
|
348
|
+
|
|
349
|
+
TRY THIS EXPERIMENT
|
|
350
|
+
Remove this rule and see what happens:
|
|
351
|
+
Remove "Block panic selling during high volatility" from your rules file, then run again.
|
|
352
|
+
If stability drops, that rule was load-bearing. If nothing changes, it was noise.
|
|
100
353
|
```
|
|
101
354
|
|
|
102
|
-
|
|
355
|
+
### Step 5: Compare two rule sets side by side
|
|
103
356
|
|
|
357
|
+
```bash
|
|
358
|
+
npx nv-sim enforce trading light-rules.txt strict-rules.txt
|
|
104
359
|
```
|
|
105
|
-
NV-SIM CHAOS TEST
|
|
106
|
-
Scenarios tested: 500
|
|
107
360
|
|
|
108
|
-
|
|
109
|
-
Governed collapse probability: 8%
|
|
361
|
+
### Rule patterns
|
|
110
362
|
|
|
111
|
-
|
|
112
|
-
Market Panic Circuit Breaker (247 times)
|
|
363
|
+
The engine understands these patterns in plain English:
|
|
113
364
|
|
|
114
|
-
|
|
365
|
+
| Pattern | What it does | Example |
|
|
366
|
+
|---------|-------------|---------|
|
|
367
|
+
| `Block X` | Hard suppression of matching actions | `Block panic selling` |
|
|
368
|
+
| `Limit X` / `Cap X` | Caps extreme positions | `Limit leverage to 5x` |
|
|
369
|
+
| `Slow X` / `Dampen X` | Reduces large movements | `Slow down algorithmic trading` |
|
|
370
|
+
| `Maintain X` / `Floor X` | Enforces minimum thresholds | `Maintain minimum liquidity` |
|
|
371
|
+
| `Rebalance X` | Pulls extremes toward equilibrium | `Rebalance correlated positions` |
|
|
372
|
+
| `Require X` | Enforceable structural constraint | `Require transparency for large trades` |
|
|
373
|
+
| `Monitor X` | Generates a circuit breaker gate | `Monitor contagion spread` |
|
|
374
|
+
|
|
375
|
+
### Other scenarios
|
|
376
|
+
|
|
377
|
+
```bash
|
|
378
|
+
npx nv-sim enforce strait_of_hormuz my-rules.txt # Same rules, different scenario
|
|
379
|
+
npx nv-sim enforce ai_regulation_crisis # Default progressive run
|
|
380
|
+
npx nv-sim enforce trading --output=report.json # Save as JSON
|
|
115
381
|
```
|
|
116
382
|
|
|
383
|
+
### Advanced: JSON world files
|
|
384
|
+
|
|
385
|
+
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.
|
|
386
|
+
|
|
387
|
+
## Commands
|
|
388
|
+
|
|
389
|
+
| Command | What It Does |
|
|
390
|
+
|---------|-------------|
|
|
391
|
+
| `nv-sim enforce [preset]` | Policy enforcement lab — iterative rule testing |
|
|
392
|
+
| `nv-sim visualize` | Interactive control platform |
|
|
393
|
+
| `nv-sim compare [preset]` | Baseline vs governed simulation |
|
|
394
|
+
| `nv-sim compare --inject event@round,...` | With narrative shocks |
|
|
395
|
+
| `nv-sim scenario <id>` | Run a named stress scenario |
|
|
396
|
+
| `nv-sim scenario <id> --compare` | Cross-world scenario comparison |
|
|
397
|
+
| `nv-sim scenarios` | List all available scenarios |
|
|
398
|
+
| `nv-sim worlds <a> <b>` | Compare two rule environments |
|
|
399
|
+
| `nv-sim chaos [preset] --runs N` | Stress test across randomized scenarios |
|
|
400
|
+
| `nv-sim serve --port N` | Local governance runtime for any simulator |
|
|
401
|
+
| `nv-sim analyze <file>` | Analyze simulation from file or stdin |
|
|
402
|
+
| `nv-sim presets` | List available world presets |
|
|
403
|
+
|
|
404
|
+
## How It Works
|
|
405
|
+
|
|
406
|
+
```
|
|
407
|
+
event → narrative propagation → belief shift → agent action → governance → outcome
|
|
408
|
+
```
|
|
409
|
+
|
|
410
|
+
Four forces shape every simulation:
|
|
411
|
+
|
|
412
|
+
1. **Agent behavior** — traders, voters, regulators, media
|
|
413
|
+
2. **World rules** — leverage caps, circuit breakers, chokepoints
|
|
414
|
+
3. **Narrative events** — information shocks that propagate through the system
|
|
415
|
+
4. **Perception propagation** — different agents react differently to the same event
|
|
416
|
+
|
|
417
|
+
This lets you ask compound questions:
|
|
418
|
+
|
|
419
|
+
> What happens if a tanker explodes while Hormuz is closed and leverage is capped at 3x?
|
|
420
|
+
|
|
421
|
+
That combination produces very different outcomes than any single factor alone. And when you change one rule — uncap leverage, open a diplomatic channel, add a circuit breaker — you see exactly why the outcome changed.
|
|
422
|
+
|
|
117
423
|
## Architecture
|
|
118
424
|
|
|
119
425
|
```
|
|
120
426
|
@neuroverseos/governance ← deterministic rule engine
|
|
121
427
|
↓
|
|
122
|
-
nv-sim
|
|
428
|
+
nv-sim engine ← world rules + narrative injection + swarm simulation
|
|
429
|
+
↓
|
|
430
|
+
nv-sim CLI ← scenarios, comparison, chaos testing
|
|
431
|
+
↓
|
|
432
|
+
control platform ← interactive browser UI + System Shift card
|
|
123
433
|
↓
|
|
124
|
-
|
|
434
|
+
world variants ← saved experiments as shareable assets
|
|
125
435
|
```
|
|
126
436
|
|
|
127
|
-
NV-SIM uses [`@neuroverseos/governance`](https://www.npmjs.com/package/@neuroverseos/governance) for deterministic guard evaluation
|
|
437
|
+
Everything runs locally. NV-SIM uses [`@neuroverseos/governance`](https://www.npmjs.com/package/@neuroverseos/governance) for deterministic guard evaluation — no LLM, no cloud, no cost. Your agents call `localhost`, and the world file decides what's allowed.
|
|
128
438
|
|
|
129
439
|
## License
|
|
130
440
|
|
|
@@ -132,6 +442,6 @@ Apache 2.0
|
|
|
132
442
|
|
|
133
443
|
---
|
|
134
444
|
|
|
135
|
-
|
|
445
|
+
Change the rules. See why the system changed.
|
|
136
446
|
|
|
137
447
|
[@neuroverseos](https://github.com/NeuroverseOS)
|