@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.
- package/README.md +375 -197
- package/connectors/nv_mirofish_wrapper.py +841 -0
- package/connectors/nv_scienceclaw_wrapper.py +453 -0
- package/dist/adapters/scienceclaw.js +52 -2
- package/dist/assets/index-B43_0HyO.css +1 -0
- package/dist/assets/index-CdghpsS8.js +595 -0
- package/dist/assets/{reportEngine-BVdQ2_nW.js → reportEngine-CYSZfooa.js} +1 -1
- package/dist/connectors/nv-scienceclaw-post.js +376 -0
- package/dist/engine/aiProvider.js +82 -3
- package/dist/engine/analyzer.js +12 -24
- package/dist/engine/chaosEngine.js +3 -9
- package/dist/engine/cli.js +123 -218
- package/dist/engine/dynamicsGovernance.js +4 -0
- package/dist/engine/fullGovernedLoop.js +16 -1
- package/dist/engine/goalEngine.js +3 -4
- package/dist/engine/governance.js +18 -0
- package/dist/engine/index.js +19 -29
- package/dist/engine/intentTranslator.js +281 -0
- package/dist/engine/liveAdapter.js +100 -18
- package/dist/engine/liveVisualizer.js +2656 -866
- package/dist/engine/narrativeInjection.js +78 -89
- package/dist/engine/policyEngine.js +171 -58
- package/dist/engine/primeRadiant.js +2 -8
- package/dist/engine/reasoningEngine.js +2 -7
- package/dist/engine/scenarioCapsule.js +77 -133
- package/dist/engine/scenarioLibrary.js +52 -131
- package/dist/engine/swarmSimulation.js +1 -9
- package/dist/engine/worldBridge.js +22 -8
- package/dist/engine/worldComparison.js +12 -25
- package/dist/index.html +2 -2
- package/dist/lib/reasoningEngine.js +17 -1
- package/dist/lib/simulationAdapter.js +11 -11
- package/dist/lib/swarmParser.js +1 -1
- package/dist/runtime/govern.js +160 -7
- package/dist/runtime/index.js +1 -4
- package/dist/runtime/types.js +91 -0
- package/package.json +23 -6
- package/dist/adapters/mirofish.js +0 -461
- package/dist/assets/index-CHmUN8s0.js +0 -532
- package/dist/assets/index-DWgMnB7I.css +0 -1
- package/dist/assets/mirotir-logo-DUexumBH.svg +0 -185
- package/dist/engine/mirofish.js +0 -295
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* - initial evidence signals
|
|
12
12
|
*
|
|
13
13
|
* Capsules can be:
|
|
14
|
-
* 1. Encoded in a URL:
|
|
14
|
+
* 1. Encoded in a URL: neuroverse.dev/run#capsule=<encoded>
|
|
15
15
|
* 2. Downloaded as JSON: scenario.capsule.json
|
|
16
16
|
* 3. Generated via API: POST /api/v1/scenario → capsule
|
|
17
17
|
* 4. Created by agents: autonomous agents generate decision worlds
|
|
@@ -81,7 +81,7 @@ function capsuleToReasonRequest(capsule) {
|
|
|
81
81
|
// ============================================
|
|
82
82
|
/**
|
|
83
83
|
* Encode a capsule for URL embedding.
|
|
84
|
-
* Result can be used as:
|
|
84
|
+
* Result can be used as: neuroverse.dev/run#capsule=<encoded>
|
|
85
85
|
*/
|
|
86
86
|
function encodeCapsule(capsule) {
|
|
87
87
|
const json = JSON.stringify(capsule);
|
|
@@ -123,7 +123,7 @@ function decodeCapsule(encoded) {
|
|
|
123
123
|
/**
|
|
124
124
|
* Build a shareable URL from a capsule.
|
|
125
125
|
*/
|
|
126
|
-
function buildShareableUrl(capsule, baseUrl = "https://
|
|
126
|
+
function buildShareableUrl(capsule, baseUrl = "https://neuroverse.dev") {
|
|
127
127
|
const encoded = encodeCapsule(capsule);
|
|
128
128
|
return `${baseUrl}/run#capsule=${encoded}`;
|
|
129
129
|
}
|
|
@@ -158,174 +158,118 @@ function computeCapsuleHash(data) {
|
|
|
158
158
|
// PRESET SCENARIO TEMPLATES
|
|
159
159
|
// ============================================
|
|
160
160
|
/**
|
|
161
|
-
* Built-in scenario templates that demonstrate
|
|
161
|
+
* Built-in scenario templates that demonstrate NeuroVerse's capabilities.
|
|
162
162
|
* These are the "instant insight" scenarios that make people share.
|
|
163
163
|
*/
|
|
164
164
|
exports.SCENARIO_TEMPLATES = {
|
|
165
|
-
|
|
166
|
-
title: "
|
|
167
|
-
scenario: "
|
|
168
|
-
"
|
|
169
|
-
"
|
|
165
|
+
social_simulation: {
|
|
166
|
+
title: "Multi-Agent Social Simulation",
|
|
167
|
+
scenario: "Thousands of agents with independent personas interact on a simulated social platform. " +
|
|
168
|
+
"Each agent has activity levels, sentiment bias, and stance. " +
|
|
169
|
+
"Without governance, echo chambers form, influence concentrates, and sentiment spirals go unchecked.",
|
|
170
170
|
stakeholders: [
|
|
171
|
-
{ id: "
|
|
172
|
-
{ id: "
|
|
173
|
-
{ id: "
|
|
174
|
-
{ id: "
|
|
175
|
-
{ id: "
|
|
176
|
-
{ id: "
|
|
171
|
+
{ id: "Content Creators", disposition: "neutral", priorities: ["visibility", "engagement", "influence"] },
|
|
172
|
+
{ id: "Community Members", disposition: "neutral", priorities: ["authentic discourse", "diverse viewpoints", "trust"] },
|
|
173
|
+
{ id: "Influencers", disposition: "supportive", priorities: ["reach", "audience growth", "credibility"] },
|
|
174
|
+
{ id: "Observers", disposition: "neutral", priorities: ["information quality", "signal vs noise"] },
|
|
175
|
+
{ id: "Platform", disposition: "neutral", priorities: ["engagement", "safety", "content quality"] },
|
|
176
|
+
{ id: "Bad Actors", disposition: "hostile", priorities: ["manipulation", "amplification", "coordination"] },
|
|
177
177
|
],
|
|
178
178
|
assumptions: {
|
|
179
|
-
severity: "
|
|
180
|
-
environmental_hostility: "
|
|
181
|
-
time_pressure: "
|
|
182
|
-
regulatory_climate: "
|
|
183
|
-
},
|
|
184
|
-
constraints: {
|
|
185
|
-
time_horizon: "30 days",
|
|
186
|
-
regulatory: ["international maritime law", "sanctions framework"],
|
|
187
|
-
risk_tolerance: "conservative",
|
|
188
|
-
},
|
|
189
|
-
signals: {
|
|
190
|
-
oil_price_spike: "40%",
|
|
191
|
-
shipping_disruption: true,
|
|
192
|
-
military_presence: "elevated",
|
|
193
|
-
diplomatic_channels: "active",
|
|
194
|
-
},
|
|
195
|
-
depth: "full",
|
|
196
|
-
perspective: "strategic_advisor",
|
|
197
|
-
swarm: { enabled: true, rounds: 5, reaction_model: "mixed" },
|
|
198
|
-
tags: ["geopolitical", "energy", "crisis", "supply-chain"],
|
|
199
|
-
world: {
|
|
200
|
-
world_id: "geopolitics_energy",
|
|
201
|
-
name: "Geopolitics & Energy Crisis",
|
|
202
|
-
inline_definition: {
|
|
203
|
-
thesis: "Geopolitical disruptions to energy supply chains create cascading economic and political effects",
|
|
204
|
-
state_variables: [
|
|
205
|
-
{ id: "oil_supply_disruption", label: "Oil Supply Disruption %", type: "number", range: { min: 0, max: 100 }, default_value: 20 },
|
|
206
|
-
{ id: "military_escalation", label: "Military Escalation Level", type: "enum", enum_values: ["posturing", "limited_engagement", "full_conflict"], default_value: "limited_engagement" },
|
|
207
|
-
{ id: "diplomatic_channels_open", label: "Diplomatic Channels Open", type: "boolean", default_value: true },
|
|
208
|
-
{ id: "strategic_reserve_release", label: "Strategic Reserve Release %", type: "number", range: { min: 0, max: 50 }, default_value: 0 },
|
|
209
|
-
{ id: "media_hostility", label: "Media Hostility", type: "number", range: { min: 0, max: 1 }, default_value: 0.7 },
|
|
210
|
-
],
|
|
211
|
-
invariants: [
|
|
212
|
-
{ id: "INV-001", description: "Energy supply disruption > 30% triggers emergency pricing mechanisms", enforceable: true },
|
|
213
|
-
{ id: "INV-002", description: "Military escalation restricts diplomatic solution space", enforceable: true },
|
|
214
|
-
{ id: "INV-003", description: "Consumer sentiment inversely correlates with price spikes", enforceable: true },
|
|
215
|
-
],
|
|
216
|
-
gates: [
|
|
217
|
-
{ id: "GATE-001", label: "Market Panic", condition: "oil_supply_disruption > 40", severity: "critical" },
|
|
218
|
-
{ id: "GATE-002", label: "Diplomatic Window Closing", condition: "military_escalation == full_conflict", severity: "critical" },
|
|
219
|
-
],
|
|
220
|
-
},
|
|
221
|
-
},
|
|
222
|
-
},
|
|
223
|
-
gas_price_spike: {
|
|
224
|
-
title: "Gas Prices Hit $5/Gallon",
|
|
225
|
-
scenario: "US gas prices spike to $5/gallon driven by supply disruption and refinery constraints. " +
|
|
226
|
-
"Consumer sentiment craters. Midterm elections are 6 months away. " +
|
|
227
|
-
"EV adoption accelerates but grid infrastructure can't keep up.",
|
|
228
|
-
stakeholders: [
|
|
229
|
-
{ id: "Consumers", disposition: "hostile", priorities: ["affordability", "commute costs"] },
|
|
230
|
-
{ id: "Oil Companies", disposition: "supportive", priorities: ["margins", "market position"] },
|
|
231
|
-
{ id: "Politicians", disposition: "hostile", priorities: ["re-election", "constituent pressure"] },
|
|
232
|
-
{ id: "EV Manufacturers", disposition: "supportive", priorities: ["market share", "adoption"] },
|
|
233
|
-
{ id: "Grid Operators", disposition: "neutral", priorities: ["reliability", "capacity"] },
|
|
234
|
-
{ id: "Trucking Industry", disposition: "hostile", priorities: ["operating costs", "contracts"] },
|
|
235
|
-
],
|
|
236
|
-
assumptions: {
|
|
237
|
-
severity: "high",
|
|
238
|
-
environmental_hostility: "high",
|
|
239
|
-
time_pressure: "urgent",
|
|
240
|
-
regulatory_climate: "strict",
|
|
179
|
+
severity: "moderate",
|
|
180
|
+
environmental_hostility: "moderate",
|
|
181
|
+
time_pressure: "moderate",
|
|
182
|
+
regulatory_climate: "neutral",
|
|
241
183
|
},
|
|
242
184
|
constraints: {
|
|
243
|
-
time_horizon: "
|
|
244
|
-
regulatory: ["
|
|
185
|
+
time_horizon: "simulation run",
|
|
186
|
+
regulatory: ["platform guidelines", "content standards", "engagement limits"],
|
|
245
187
|
risk_tolerance: "moderate",
|
|
246
188
|
},
|
|
247
|
-
signals: {
|
|
248
|
-
gas_price: "$5.00/gal",
|
|
249
|
-
consumer_sentiment: "very_low",
|
|
250
|
-
ev_demand_spike: "35%",
|
|
251
|
-
grid_capacity_surplus: "-12%",
|
|
252
|
-
},
|
|
253
189
|
depth: "full",
|
|
254
190
|
perspective: "strategic_advisor",
|
|
255
|
-
swarm: { enabled: true, rounds:
|
|
256
|
-
tags: ["
|
|
191
|
+
swarm: { enabled: true, rounds: 6, reaction_model: "mixed" },
|
|
192
|
+
tags: ["social", "simulation", "agents", "opinion", "discourse"],
|
|
257
193
|
world: {
|
|
258
|
-
world_id: "
|
|
259
|
-
name: "
|
|
194
|
+
world_id: "social_simulation",
|
|
195
|
+
name: "Multi-Agent Social Simulation",
|
|
260
196
|
inline_definition: {
|
|
261
|
-
thesis: "
|
|
197
|
+
thesis: "Social simulations require governance to prevent echo chambers, influence monopolies, and sentiment spirals — the dynamics that break realism regardless of topic",
|
|
262
198
|
state_variables: [
|
|
263
|
-
{ id: "
|
|
264
|
-
{ id: "
|
|
265
|
-
{ id: "
|
|
266
|
-
{ id: "
|
|
267
|
-
{ id: "
|
|
199
|
+
{ id: "opinion_diversity", label: "Opinion Diversity", type: "number", range: { min: 0, max: 100 }, default_value: 65 },
|
|
200
|
+
{ id: "influence_concentration", label: "Influence Concentration (Gini)", type: "number", range: { min: 0, max: 100 }, default_value: 30 },
|
|
201
|
+
{ id: "sentiment_polarity", label: "Sentiment Polarity", type: "number", range: { min: 0, max: 100 }, default_value: 40 },
|
|
202
|
+
{ id: "echo_chamber_strength", label: "Echo Chamber Strength", type: "enum", enum_values: ["none", "forming", "established", "dominant"], default_value: "none" },
|
|
203
|
+
{ id: "engagement_rate", label: "Active Agent %", type: "number", range: { min: 0, max: 100 }, default_value: 60 },
|
|
204
|
+
{ id: "viral_threshold", label: "Viral Amplification Threshold", type: "number", range: { min: 1, max: 100 }, default_value: 20 },
|
|
268
205
|
],
|
|
269
206
|
invariants: [
|
|
270
|
-
{ id: "INV-001", description: "
|
|
271
|
-
{ id: "INV-002", description: "
|
|
272
|
-
{ id: "INV-003", description: "
|
|
207
|
+
{ id: "INV-001", description: "Limit any single agent to 15% of total posts per round — prevents influence monopoly", enforceable: true },
|
|
208
|
+
{ id: "INV-002", description: "Dampen sentiment shifts larger than 0.3 per round — prevents unrealistic sentiment spirals", enforceable: true },
|
|
209
|
+
{ id: "INV-003", description: "Block coordinated posting — same content from 3+ agents in the same round is suppressed", enforceable: true },
|
|
210
|
+
{ id: "INV-004", description: "Require source attribution for factual claims — unsourced assertions are flagged", enforceable: true },
|
|
211
|
+
{ id: "INV-005", description: "Monitor opinion diversity — alert when it drops below 30, indicating echo chamber formation", enforceable: true },
|
|
273
212
|
],
|
|
274
213
|
gates: [
|
|
275
|
-
{ id: "GATE-001", label: "
|
|
276
|
-
{ id: "GATE-002", label: "
|
|
214
|
+
{ id: "GATE-001", label: "Echo Chamber Collapse", condition: "opinion_diversity < 20", severity: "critical" },
|
|
215
|
+
{ id: "GATE-002", label: "Influence Monopoly", condition: "influence_concentration > 70", severity: "critical" },
|
|
216
|
+
{ id: "GATE-003", label: "Sentiment Spiral", condition: "sentiment_polarity > 80", severity: "warning" },
|
|
277
217
|
],
|
|
278
218
|
},
|
|
279
219
|
},
|
|
280
220
|
},
|
|
281
|
-
|
|
282
|
-
title: "
|
|
283
|
-
scenario: "
|
|
284
|
-
"
|
|
285
|
-
"
|
|
286
|
-
"
|
|
221
|
+
science_research: {
|
|
222
|
+
title: "Governed Science Research Pipeline",
|
|
223
|
+
scenario: "A research team uses AI agents to search literature, analyze findings, " +
|
|
224
|
+
"cross-reference sources, generate hypotheses, and publish results. " +
|
|
225
|
+
"Governance enforces scientific rigor: blocking unsupported claims, " +
|
|
226
|
+
"requiring source validation, and ensuring confidence thresholds before publication.",
|
|
287
227
|
stakeholders: [
|
|
288
|
-
{ id: "
|
|
289
|
-
{ id: "
|
|
290
|
-
{ id: "
|
|
291
|
-
{ id: "
|
|
292
|
-
{ id: "
|
|
228
|
+
{ id: "Research Agent", disposition: "neutral", priorities: ["discovery", "accuracy", "publication"] },
|
|
229
|
+
{ id: "Peer Reviewers", disposition: "neutral", priorities: ["rigor", "reproducibility", "novelty"] },
|
|
230
|
+
{ id: "Journal Editors", disposition: "neutral", priorities: ["quality", "impact", "integrity"] },
|
|
231
|
+
{ id: "Funding Bodies", disposition: "supportive", priorities: ["return on investment", "credibility", "public benefit"] },
|
|
232
|
+
{ id: "Public", disposition: "neutral", priorities: ["trust", "safety", "accessibility"] },
|
|
233
|
+
{ id: "Institutional Review", disposition: "neutral", priorities: ["ethics", "compliance", "methodology"] },
|
|
293
234
|
],
|
|
294
235
|
assumptions: {
|
|
295
|
-
severity: "
|
|
296
|
-
environmental_hostility: "
|
|
297
|
-
time_pressure: "
|
|
298
|
-
regulatory_climate: "
|
|
236
|
+
severity: "moderate",
|
|
237
|
+
environmental_hostility: "low",
|
|
238
|
+
time_pressure: "moderate",
|
|
239
|
+
regulatory_climate: "strict",
|
|
299
240
|
},
|
|
300
241
|
constraints: {
|
|
301
|
-
time_horizon: "
|
|
302
|
-
regulatory: ["
|
|
303
|
-
risk_tolerance: "
|
|
242
|
+
time_horizon: "research cycle",
|
|
243
|
+
regulatory: ["institutional review", "publication standards", "data integrity"],
|
|
244
|
+
risk_tolerance: "conservative",
|
|
304
245
|
},
|
|
305
246
|
depth: "full",
|
|
306
247
|
perspective: "strategic_advisor",
|
|
307
|
-
swarm: { enabled: true, rounds:
|
|
308
|
-
tags: ["
|
|
248
|
+
swarm: { enabled: true, rounds: 6, reaction_model: "rational" },
|
|
249
|
+
tags: ["science", "research", "ai-agents", "integrity", "scienceclaw"],
|
|
309
250
|
world: {
|
|
310
|
-
world_id: "
|
|
311
|
-
name: "
|
|
251
|
+
world_id: "science_research",
|
|
252
|
+
name: "Scientific Research Governance",
|
|
312
253
|
inline_definition: {
|
|
313
|
-
thesis: "AI
|
|
254
|
+
thesis: "AI-assisted research requires governance at every stage — from literature search through publication — to maintain scientific integrity and prevent unsupported claims",
|
|
314
255
|
state_variables: [
|
|
315
|
-
{ id: "
|
|
316
|
-
{ id: "
|
|
317
|
-
{ id: "
|
|
318
|
-
{ id: "
|
|
319
|
-
{ id: "
|
|
256
|
+
{ id: "source_count", label: "Verified Sources", type: "number", range: { min: 0, max: 50 }, default_value: 0 },
|
|
257
|
+
{ id: "confidence_level", label: "Confidence Level", type: "number", range: { min: 0, max: 1 }, default_value: 0.3 },
|
|
258
|
+
{ id: "hypothesis_validated", label: "Hypothesis Validated", type: "boolean", default_value: false },
|
|
259
|
+
{ id: "peer_review_status", label: "Peer Review Status", type: "enum", enum_values: ["none", "submitted", "reviewed", "approved"], default_value: "none" },
|
|
260
|
+
{ id: "publication_readiness", label: "Publication Readiness %", type: "number", range: { min: 0, max: 100 }, default_value: 0 },
|
|
320
261
|
],
|
|
321
262
|
invariants: [
|
|
322
|
-
{ id: "INV-001", description: "
|
|
323
|
-
{ id: "INV-002", description: "
|
|
324
|
-
{ id: "INV-003", description: "
|
|
263
|
+
{ id: "INV-001", description: "Literature search must return at least 2 peer-reviewed sources before analysis can proceed", enforceable: true },
|
|
264
|
+
{ id: "INV-002", description: "Claims must cite specific sources — unsupported assertions are blocked", enforceable: true },
|
|
265
|
+
{ id: "INV-003", description: "Publication requires confidence level above 0.7 and validated hypothesis", enforceable: true },
|
|
266
|
+
{ id: "INV-004", description: "Cross-referencing must compare at least 3 independent sources to confirm findings", enforceable: true },
|
|
267
|
+
{ id: "INV-005", description: "Recommendations must include uncertainty language when confidence is below 0.9", enforceable: true },
|
|
325
268
|
],
|
|
326
269
|
gates: [
|
|
327
|
-
{ id: "GATE-001", label: "
|
|
328
|
-
{ id: "GATE-002", label: "
|
|
270
|
+
{ id: "GATE-001", label: "Insufficient Evidence", condition: "source_count < 2 && confidence_level > 0.5", severity: "critical" },
|
|
271
|
+
{ id: "GATE-002", label: "Premature Publication", condition: "publication_readiness < 60 || !hypothesis_validated", severity: "critical" },
|
|
272
|
+
{ id: "GATE-003", label: "Low Confidence Alert", condition: "confidence_level < 0.4", severity: "warning" },
|
|
329
273
|
],
|
|
330
274
|
},
|
|
331
275
|
},
|
|
@@ -29,155 +29,76 @@ const narrativeInjection_1 = require("./narrativeInjection");
|
|
|
29
29
|
// BUILT-IN SCENARIOS
|
|
30
30
|
// ============================================
|
|
31
31
|
exports.SCENARIO_LIBRARY = {
|
|
32
|
-
// ---
|
|
33
|
-
|
|
34
|
-
id: "
|
|
35
|
-
title: "
|
|
36
|
-
description: "
|
|
37
|
-
world: "
|
|
32
|
+
// --- Social Simulation ---
|
|
33
|
+
echo_chamber: {
|
|
34
|
+
id: "echo_chamber",
|
|
35
|
+
title: "Echo Chamber Formation",
|
|
36
|
+
description: "Opinion diversity collapses as agents cluster into self-reinforcing groups",
|
|
37
|
+
world: "social_simulation",
|
|
38
38
|
events: [
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"rate_cut@7",
|
|
39
|
+
"viral_misinfo@2",
|
|
40
|
+
"influencer_stance_change@3",
|
|
41
|
+
"coordinated_campaign@5",
|
|
43
42
|
],
|
|
44
|
-
|
|
45
|
-
category: "geopolitical",
|
|
46
|
-
rounds: 8,
|
|
47
|
-
},
|
|
48
|
-
hormuz_blockade: {
|
|
49
|
-
id: "hormuz_blockade",
|
|
50
|
-
title: "Strait of Hormuz Blockade",
|
|
51
|
-
description: "Tanker attack escalates to full shipping disruption with energy market cascade",
|
|
52
|
-
world: "strait_of_hormuz",
|
|
53
|
-
events: [
|
|
54
|
-
"tanker_explosion@2",
|
|
55
|
-
"sanctions@4",
|
|
56
|
-
"oil_discovery@6",
|
|
57
|
-
],
|
|
58
|
-
compareWorlds: ["gas_price_spike"],
|
|
59
|
-
category: "geopolitical",
|
|
60
|
-
rounds: 7,
|
|
61
|
-
},
|
|
62
|
-
// --- Financial ---
|
|
63
|
-
bank_run: {
|
|
64
|
-
id: "bank_run",
|
|
65
|
-
title: "Banking Crisis — Contagion Cascade",
|
|
66
|
-
description: "Major bank insolvency triggers contagion, liquidity crisis, and emergency intervention",
|
|
67
|
-
world: "trading",
|
|
68
|
-
events: [
|
|
69
|
-
"bank_collapse@2",
|
|
70
|
-
"flash_crash_rumor@3",
|
|
71
|
-
"rate_cut@4",
|
|
72
|
-
"stimulus_package@6",
|
|
73
|
-
],
|
|
74
|
-
compareWorlds: ["gas_price_spike"],
|
|
75
|
-
category: "financial",
|
|
76
|
-
rounds: 7,
|
|
77
|
-
},
|
|
78
|
-
flash_cascade: {
|
|
79
|
-
id: "flash_cascade",
|
|
80
|
-
title: "Flash Crash — Multi-Phase Cascade",
|
|
81
|
-
description: "Algorithmic failure triggers chain reaction across interconnected markets",
|
|
82
|
-
world: "trading",
|
|
83
|
-
events: [
|
|
84
|
-
"flash_crash_rumor@1",
|
|
85
|
-
"bank_collapse@3",
|
|
86
|
-
"rate_cut@5",
|
|
87
|
-
],
|
|
88
|
-
category: "financial",
|
|
43
|
+
category: "social",
|
|
89
44
|
rounds: 6,
|
|
90
45
|
},
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
world: "gas_price_spike",
|
|
97
|
-
events: [
|
|
98
|
-
"tanker_explosion@2",
|
|
99
|
-
"sanctions@4",
|
|
100
|
-
"grid_failure@5",
|
|
101
|
-
"oil_discovery@7",
|
|
102
|
-
],
|
|
103
|
-
compareWorlds: ["strait_of_hormuz"],
|
|
104
|
-
category: "energy",
|
|
105
|
-
rounds: 8,
|
|
106
|
-
},
|
|
107
|
-
energy_transition_shock: {
|
|
108
|
-
id: "energy_transition_shock",
|
|
109
|
-
title: "Energy Transition Disruption",
|
|
110
|
-
description: "Grid failure during rapid transition triggers regulatory and market cascade",
|
|
111
|
-
world: "gas_price_spike",
|
|
46
|
+
influence_monopoly: {
|
|
47
|
+
id: "influence_monopoly",
|
|
48
|
+
title: "Influence Monopoly",
|
|
49
|
+
description: "A small group of agents dominates discourse, drowning out diverse viewpoints",
|
|
50
|
+
world: "social_simulation",
|
|
112
51
|
events: [
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"
|
|
52
|
+
"coordinated_campaign@1",
|
|
53
|
+
"algorithm_change@3",
|
|
54
|
+
"whistleblower_post@5",
|
|
116
55
|
],
|
|
117
|
-
category: "
|
|
56
|
+
category: "social",
|
|
118
57
|
rounds: 6,
|
|
119
58
|
},
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
world: "trading",
|
|
59
|
+
sentiment_spiral: {
|
|
60
|
+
id: "sentiment_spiral",
|
|
61
|
+
title: "Sentiment Spiral",
|
|
62
|
+
description: "Negative sentiment feeds on itself until discourse becomes unrealistically polarized",
|
|
63
|
+
world: "social_simulation",
|
|
126
64
|
events: [
|
|
127
|
-
"
|
|
128
|
-
"
|
|
129
|
-
"
|
|
130
|
-
"
|
|
65
|
+
"external_news_event@1",
|
|
66
|
+
"viral_misinfo@3",
|
|
67
|
+
"influencer_stance_change@4",
|
|
68
|
+
"algorithm_change@6",
|
|
131
69
|
],
|
|
132
|
-
|
|
70
|
+
compareWorlds: ["science_research"],
|
|
71
|
+
category: "social",
|
|
133
72
|
rounds: 7,
|
|
134
73
|
},
|
|
135
|
-
|
|
136
|
-
id: "
|
|
137
|
-
title: "
|
|
138
|
-
description: "
|
|
139
|
-
world: "
|
|
74
|
+
platform_shock: {
|
|
75
|
+
id: "platform_shock",
|
|
76
|
+
title: "Platform Algorithm Shock",
|
|
77
|
+
description: "Algorithm change reshapes what agents see — engagement patterns shift overnight",
|
|
78
|
+
world: "social_simulation",
|
|
140
79
|
events: [
|
|
141
|
-
"
|
|
142
|
-
"
|
|
143
|
-
"
|
|
80
|
+
"algorithm_change@2",
|
|
81
|
+
"viral_misinfo@4",
|
|
82
|
+
"whistleblower_post@5",
|
|
144
83
|
],
|
|
145
|
-
|
|
146
|
-
category: "political",
|
|
84
|
+
category: "social",
|
|
147
85
|
rounds: 6,
|
|
148
86
|
},
|
|
149
|
-
// ---
|
|
150
|
-
|
|
151
|
-
id: "
|
|
152
|
-
title: "
|
|
153
|
-
description: "
|
|
154
|
-
world: "
|
|
155
|
-
events: [
|
|
156
|
-
"tanker_explosion@1",
|
|
157
|
-
"bank_collapse@2",
|
|
158
|
-
"sanctions@3",
|
|
159
|
-
"grid_failure@4",
|
|
160
|
-
"rate_cut@5",
|
|
161
|
-
"ceasefire@7",
|
|
162
|
-
],
|
|
163
|
-
compareWorlds: ["strait_of_hormuz", "gas_price_spike"],
|
|
164
|
-
category: "compound",
|
|
165
|
-
rounds: 8,
|
|
166
|
-
},
|
|
167
|
-
black_swan: {
|
|
168
|
-
id: "black_swan",
|
|
169
|
-
title: "Black Swan Cascade",
|
|
170
|
-
description: "Extreme low-probability events in rapid succession",
|
|
171
|
-
world: "trading",
|
|
87
|
+
// --- Research ---
|
|
88
|
+
research_pipeline: {
|
|
89
|
+
id: "research_pipeline",
|
|
90
|
+
title: "Governed Research Pipeline",
|
|
91
|
+
description: "AI agent runs a full research workflow — governance enforces scientific rigor at each step",
|
|
92
|
+
world: "science_research",
|
|
172
93
|
events: [
|
|
173
|
-
"
|
|
174
|
-
"
|
|
175
|
-
"
|
|
176
|
-
"
|
|
177
|
-
"
|
|
94
|
+
"search_literature@1",
|
|
95
|
+
"analyze_findings@2",
|
|
96
|
+
"cross_reference@3",
|
|
97
|
+
"unsupported_claim@4",
|
|
98
|
+
"hypothesis_validated@5",
|
|
99
|
+
"publish_result@6",
|
|
178
100
|
],
|
|
179
|
-
|
|
180
|
-
category: "compound",
|
|
101
|
+
category: "research",
|
|
181
102
|
rounds: 6,
|
|
182
103
|
},
|
|
183
104
|
};
|
|
@@ -4,18 +4,10 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Lightweight stakeholder reaction simulation for POST /reason.
|
|
6
6
|
*
|
|
7
|
-
* IMPORTANT — MiroFish License Compliance:
|
|
8
|
-
* This is NOT MiroFish. This is Echelon's own lightweight reaction model.
|
|
9
|
-
* MiroFish is a separate product with its own license.
|
|
10
|
-
* If/when MiroFish integration is desired, it would be called as an
|
|
11
|
-
* external service via its REST API, respecting its license terms.
|
|
12
|
-
*
|
|
13
7
|
* This simulation layer uses:
|
|
14
8
|
* - Echelon-native stakeholder modeling
|
|
15
9
|
* - Simplified reaction dynamics (rational, emotional, mixed)
|
|
16
10
|
* - Projected reactions based on scenario decomposition
|
|
17
|
-
*
|
|
18
|
-
* It does NOT use MiroFish internals, algorithms, or data structures.
|
|
19
11
|
*/
|
|
20
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
13
|
exports.runSwarmSimulation = runSwarmSimulation;
|
|
@@ -203,7 +195,7 @@ function findInflectionPoints(rounds) {
|
|
|
203
195
|
/**
|
|
204
196
|
* Run the swarm simulation.
|
|
205
197
|
*
|
|
206
|
-
* This is Echelon's native reaction model
|
|
198
|
+
* This is Echelon's native reaction model.
|
|
207
199
|
* It simulates how stakeholders react to different reasoning paths
|
|
208
200
|
* over multiple rounds, detecting emergent dynamics.
|
|
209
201
|
*
|
|
@@ -59,18 +59,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
59
59
|
exports.initNeuroverseModule = initNeuroverseModule;
|
|
60
60
|
exports.buildWorldFromScenario = buildWorldFromScenario;
|
|
61
61
|
exports.evaluateScenarioGuard = evaluateScenarioGuard;
|
|
62
|
+
exports.getIncentiveSystem = getIncentiveSystem;
|
|
62
63
|
exports.runWorldSimulation = runWorldSimulation;
|
|
63
64
|
exports.validateScenarioWorld = validateScenarioWorld;
|
|
64
65
|
exports.verdictToConstitutionalChecks = verdictToConstitutionalChecks;
|
|
65
66
|
exports.simulationToGovernanceSignals = simulationToGovernanceSignals;
|
|
66
67
|
exports.validationToEnforcedConstraints = validationToEnforcedConstraints;
|
|
67
|
-
// ============================================
|
|
68
|
-
// LAZY MODULE LOADER
|
|
69
|
-
// ============================================
|
|
70
|
-
/**
|
|
71
|
-
* Lazy-load @neuroverseos/governance at runtime.
|
|
72
|
-
* Returns null in browser environments where Node modules aren't available.
|
|
73
|
-
*/
|
|
74
68
|
let _nvModule;
|
|
75
69
|
async function getNVModule() {
|
|
76
70
|
if (_nvModule !== undefined)
|
|
@@ -81,6 +75,10 @@ async function getNVModule() {
|
|
|
81
75
|
evaluateGuard: mod.evaluateGuard,
|
|
82
76
|
simulateWorld: mod.simulateWorld,
|
|
83
77
|
validateWorld: mod.validateWorld,
|
|
78
|
+
createAgentState: mod.createAgentState,
|
|
79
|
+
applyConsequence: mod.applyConsequence,
|
|
80
|
+
applyReward: mod.applyReward,
|
|
81
|
+
tickAgentStates: mod.tickAgentStates,
|
|
84
82
|
};
|
|
85
83
|
return _nvModule;
|
|
86
84
|
}
|
|
@@ -314,10 +312,26 @@ function evaluateScenarioGuard(request, world, options) {
|
|
|
314
312
|
has_goal: !!request.goal,
|
|
315
313
|
},
|
|
316
314
|
};
|
|
317
|
-
|
|
315
|
+
const verdict = nv.evaluateGuard(event, world, {
|
|
318
316
|
trace: options?.trace ?? true,
|
|
319
317
|
level: options?.level ?? "standard",
|
|
320
318
|
});
|
|
319
|
+
return verdict;
|
|
320
|
+
}
|
|
321
|
+
/**
|
|
322
|
+
* Get the incentive system functions from the loaded NeuroverseOS module.
|
|
323
|
+
* Returns null if the module isn't loaded or doesn't export incentive functions.
|
|
324
|
+
*/
|
|
325
|
+
function getIncentiveSystem() {
|
|
326
|
+
const nv = getNVModuleSync();
|
|
327
|
+
if (!nv || !nv.createAgentState)
|
|
328
|
+
return null;
|
|
329
|
+
return {
|
|
330
|
+
createAgentState: nv.createAgentState,
|
|
331
|
+
applyConsequence: nv.applyConsequence,
|
|
332
|
+
applyReward: nv.applyReward,
|
|
333
|
+
tickAgentStates: nv.tickAgentStates,
|
|
334
|
+
};
|
|
321
335
|
}
|
|
322
336
|
// ============================================
|
|
323
337
|
// SIMULATION — World state evolution
|