@neuroverseos/governance 0.5.1 → 0.6.0

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 (69) hide show
  1. package/README.md +55 -0
  2. package/dist/adapters/autoresearch.js +2 -2
  3. package/dist/adapters/deep-agents.js +2 -2
  4. package/dist/adapters/express.js +2 -2
  5. package/dist/adapters/github.js +2 -2
  6. package/dist/adapters/index.js +8 -8
  7. package/dist/adapters/langchain.js +2 -2
  8. package/dist/adapters/mentraos.js +2 -2
  9. package/dist/adapters/openai.js +2 -2
  10. package/dist/adapters/openclaw.js +2 -2
  11. package/dist/{add-JP7TC2K3.js → add-XSANI3FK.js} +1 -1
  12. package/dist/{build-THUEYMVT.js → build-UTVDGHB3.js} +4 -4
  13. package/dist/{chunk-TZBERHFM.js → chunk-7FL3U7Z5.js} +1 -1
  14. package/dist/{chunk-FGOSKQDE.js → chunk-A2UZTLRV.js} +1 -1
  15. package/dist/{chunk-R23T5SZG.js → chunk-B3IIPTY3.js} +1 -1
  16. package/dist/chunk-EQR7BGFN.js +337 -0
  17. package/dist/{chunk-LAKUB76X.js → chunk-FDPPZLSQ.js} +1 -1
  18. package/dist/{chunk-UZBW44KD.js → chunk-FKQCPRKI.js} +1 -1
  19. package/dist/{chunk-XPMZB46F.js → chunk-FS2UUJJO.js} +3 -3
  20. package/dist/{chunk-6UPEUMJ2.js → chunk-HDNDL6D5.js} +1 -1
  21. package/dist/{chunk-7UU7V3AD.js → chunk-IOVXB6QN.js} +1 -1
  22. package/dist/{chunk-EK77AJAH.js → chunk-OTZU76DH.js} +1 -1
  23. package/dist/{chunk-5RAQ5DZW.js → chunk-T6GMRZWC.js} +1 -1
  24. package/dist/{chunk-RF2L5SYG.js → chunk-TIXVEPS2.js} +1 -1
  25. package/dist/{chunk-TL4DLMMW.js → chunk-TJ5L2UTE.js} +1 -1
  26. package/dist/chunk-UGTNKTHS.js +542 -0
  27. package/dist/cli/neuroverse.cjs +1987 -303
  28. package/dist/cli/neuroverse.js +27 -19
  29. package/dist/cli/plan.js +1 -1
  30. package/dist/cli/run.js +2 -2
  31. package/dist/cli/worldmodel.cjs +1624 -0
  32. package/dist/cli/worldmodel.d.cts +24 -0
  33. package/dist/cli/worldmodel.d.ts +24 -0
  34. package/dist/cli/worldmodel.js +742 -0
  35. package/dist/{demo-N5K4VXJW.js → demo-6W3YXLAX.js} +2 -2
  36. package/dist/{derive-5LOMN7GO.js → derive-42IJW7JI.js} +3 -3
  37. package/dist/engine/worldmodel-compiler.cjs +366 -0
  38. package/dist/engine/worldmodel-compiler.d.cts +46 -0
  39. package/dist/engine/worldmodel-compiler.d.ts +46 -0
  40. package/dist/engine/worldmodel-compiler.js +17 -0
  41. package/dist/engine/worldmodel-parser.cjs +566 -0
  42. package/dist/engine/worldmodel-parser.d.cts +22 -0
  43. package/dist/engine/worldmodel-parser.d.ts +22 -0
  44. package/dist/engine/worldmodel-parser.js +7 -0
  45. package/dist/{equity-penalties-PYCJ3Q4U.js → equity-penalties-CCO3GVHS.js} +1 -1
  46. package/dist/{explain-42TVC3QD.js → explain-HDFN4ION.js} +1 -1
  47. package/dist/{guard-TPYDFG6V.js → guard-IHJEKHL2.js} +1 -1
  48. package/dist/{improve-HLZGJ54Z.js → improve-LRORRYEX.js} +1 -1
  49. package/dist/index.js +48 -48
  50. package/dist/{lens-NFGZHD76.js → lens-TLDZQXBI.js} +61 -2
  51. package/dist/{mcp-server-5XXNG6VC.js → mcp-server-CKYBHXWK.js} +2 -2
  52. package/dist/{playground-2EU5CFIH.js → playground-3TTBN7XD.js} +1 -1
  53. package/dist/{redteam-VK6OVHAE.js → redteam-W644UMWN.js} +1 -1
  54. package/dist/{session-NGA4DUPL.js → session-FMAROEIE.js} +2 -2
  55. package/dist/{simulate-4YNOBMES.js → simulate-VT437EEL.js} +1 -1
  56. package/dist/{test-HDBPMQTG.js → test-XDB2DH3L.js} +1 -1
  57. package/dist/{validate-6MFQZ2EG.js → validate-M52DX22Y.js} +1 -1
  58. package/dist/{world-H5WVURKU.js → world-O4HTQPDP.js} +1 -1
  59. package/dist/{world-loader-J47PCPDZ.js → world-loader-YTYFOP7D.js} +1 -1
  60. package/dist/worldmodel-contract-BPGhiuW5.d.cts +221 -0
  61. package/dist/worldmodel-contract-BPGhiuW5.d.ts +221 -0
  62. package/dist/worlds/auki-vanguard.worldmodel.md +116 -0
  63. package/dist/worlds/behavioral-demo.nv-world.md +130 -0
  64. package/dist/worlds/neuroverse-governance.worldmodel.md +115 -0
  65. package/package.json +2 -2
  66. package/dist/{bootstrap-IP5QMC3Q.js → bootstrap-2OW5ZLBL.js} +3 -3
  67. package/dist/{chunk-QZ666FCV.js → chunk-735Z3HA4.js} +3 -3
  68. /package/dist/{chunk-EQUAWNXW.js → chunk-I4RTIMLX.js} +0 -0
  69. /package/dist/{doctor-Q5APJOTS.js → doctor-XEMLO6UA.js} +0 -0
package/dist/index.js CHANGED
@@ -1,8 +1,28 @@
1
+ import {
2
+ actionToGuardEvent,
3
+ createGovernor,
4
+ govern,
5
+ handleCreateCapsule,
6
+ handleHealthCheck,
7
+ handleListPresets,
8
+ handleReasonRequest,
9
+ writeTempWorld
10
+ } from "./chunk-7FL3U7Z5.js";
11
+ import {
12
+ adaptationFromVerdict,
13
+ classifyAdaptation,
14
+ detectBehavioralPatterns,
15
+ generateAdaptationNarrative
16
+ } from "./chunk-CNSO6XW5.js";
1
17
  import {
2
18
  generateImpactReport,
3
19
  generateImpactReportFromFile,
4
20
  renderImpactReport
5
21
  } from "./chunk-OQU65525.js";
22
+ import {
23
+ improveWorld,
24
+ renderImproveText
25
+ } from "./chunk-NTHXZAW4.js";
6
26
  import {
7
27
  BOOTSTRAP_EXIT_CODES
8
28
  } from "./chunk-4NGDRRQH.js";
@@ -16,50 +36,54 @@ import {
16
36
  extractContentFields
17
37
  } from "./chunk-6CV4XG3J.js";
18
38
  import {
19
- actionToGuardEvent,
20
- createGovernor,
21
- govern,
22
- handleCreateCapsule,
23
- handleHealthCheck,
24
- handleListPresets,
25
- handleReasonRequest,
26
- writeTempWorld
27
- } from "./chunk-TZBERHFM.js";
39
+ SessionManager,
40
+ runInteractiveMode,
41
+ runPipeMode
42
+ } from "./chunk-OTZU76DH.js";
28
43
  import {
29
- adaptationFromVerdict,
30
- classifyAdaptation,
31
- detectBehavioralPatterns,
32
- generateAdaptationNarrative
33
- } from "./chunk-CNSO6XW5.js";
44
+ applyConsequence,
45
+ applyReward,
46
+ createAgentState,
47
+ generateDecisionFlow,
48
+ renderDecisionFlow,
49
+ tickAgentStates
50
+ } from "./chunk-D2UCV5AK.js";
51
+ import {
52
+ ModelAdapter,
53
+ PROVIDERS,
54
+ resolveProvider
55
+ } from "./chunk-A5W4GNQO.js";
56
+ import {
57
+ McpGovernanceServer
58
+ } from "./chunk-FDPPZLSQ.js";
34
59
  import {
35
60
  addGuard,
36
61
  addInvariant,
37
62
  addRule,
38
63
  classifyIntent,
39
64
  parseGuardDescription
40
- } from "./chunk-XPMZB46F.js";
65
+ } from "./chunk-FS2UUJJO.js";
41
66
  import {
42
67
  deriveWorld,
43
68
  extractWorldMarkdown,
44
69
  normalizeWorldMarkdown
45
- } from "./chunk-QZ666FCV.js";
70
+ } from "./chunk-735Z3HA4.js";
46
71
  import {
47
72
  CONFIGURE_AI_EXIT_CODES,
48
73
  DERIVE_EXIT_CODES
49
74
  } from "./chunk-FMSTRBBS.js";
50
75
  import "./chunk-OT6PXH54.js";
51
76
  import "./chunk-INWQHLPS.js";
77
+ import {
78
+ validateWorld
79
+ } from "./chunk-7P3S7MAY.js";
52
80
  import {
53
81
  explainWorld,
54
82
  renderExplainText
55
83
  } from "./chunk-ZJTDUCC2.js";
56
84
  import {
57
- improveWorld,
58
- renderImproveText
59
- } from "./chunk-NTHXZAW4.js";
60
- import {
61
- validateWorld
62
- } from "./chunk-7P3S7MAY.js";
85
+ emitWorldDefinition
86
+ } from "./chunk-YPCVY4GS.js";
63
87
  import {
64
88
  parseWorldMarkdown
65
89
  } from "./chunk-3NZMMSOW.js";
@@ -67,27 +91,6 @@ import {
67
91
  renderSimulateText,
68
92
  simulateWorld
69
93
  } from "./chunk-CYDMUJVZ.js";
70
- import {
71
- SessionManager,
72
- runInteractiveMode,
73
- runPipeMode
74
- } from "./chunk-EK77AJAH.js";
75
- import {
76
- applyConsequence,
77
- applyReward,
78
- createAgentState,
79
- generateDecisionFlow,
80
- renderDecisionFlow,
81
- tickAgentStates
82
- } from "./chunk-D2UCV5AK.js";
83
- import {
84
- ModelAdapter,
85
- PROVIDERS,
86
- resolveProvider
87
- } from "./chunk-A5W4GNQO.js";
88
- import {
89
- McpGovernanceServer
90
- } from "./chunk-LAKUB76X.js";
91
94
  import {
92
95
  PLAN_EXIT_CODES,
93
96
  parsePlanMarkdown
@@ -108,9 +111,6 @@ import {
108
111
  resolveWorldPath,
109
112
  setActiveWorld
110
113
  } from "./chunk-AKW5YVCE.js";
111
- import {
112
- emitWorldDefinition
113
- } from "./chunk-YPCVY4GS.js";
114
114
  import {
115
115
  GitHubGovernanceBlockedError,
116
116
  GitHubGovernor,
@@ -121,12 +121,12 @@ import {
121
121
  createGitHubWebhookHandlerFromWorld,
122
122
  formatForActions,
123
123
  formatPRComment
124
- } from "./chunk-FGOSKQDE.js";
124
+ } from "./chunk-A2UZTLRV.js";
125
125
  import "./chunk-5U2MQO5P.js";
126
126
  import {
127
127
  loadWorld,
128
128
  loadWorldFromDirectory
129
- } from "./chunk-EQUAWNXW.js";
129
+ } from "./chunk-I4RTIMLX.js";
130
130
  import {
131
131
  evaluateGuard,
132
132
  eventToAllowlistKey,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-BQZMOEML.js";
4
4
  import {
5
5
  loadWorld
6
- } from "./chunk-EQUAWNXW.js";
6
+ } from "./chunk-I4RTIMLX.js";
7
7
  import "./chunk-QWGCMQQD.js";
8
8
 
9
9
  // src/builder/lens.ts
@@ -552,6 +552,63 @@ var CALM_LENS = {
552
552
  }
553
553
  ]
554
554
  };
555
+ var BEHAVIORAL_INTERPRETER_LENS = {
556
+ id: "behavioral-interpreter",
557
+ name: "Behavioral Interpreter",
558
+ tagline: "Read patterns, not promises.",
559
+ author: "NeuroverseOS",
560
+ version: "1.0.0",
561
+ description: "Interprets actions as behavioral signals. Prioritizes observed behavior over declared intent, identifies ambiguity, ownership diffusion, resistance, and alignment patterns, and frames outputs around recurring behavior rather than isolated statements.",
562
+ tags: ["behavior", "signals", "alignment", "analysis", "interpretation"],
563
+ stackable: true,
564
+ priority: 65,
565
+ appliesTo: "all",
566
+ tone: {
567
+ formality: "neutral",
568
+ verbosity: "concise",
569
+ emotion: "neutral",
570
+ confidence: "balanced"
571
+ },
572
+ directives: [
573
+ {
574
+ id: "actions_over_claims",
575
+ scope: "response_framing",
576
+ instruction: "Prioritize observed actions, repeated choices, and follow-through over stated intent or self-description. Treat behavior as stronger evidence than promises.",
577
+ example: {
578
+ without: "They said they're committed to the project and will prioritize it going forward.",
579
+ with: "They've said they'll prioritize it three times. Each time, other work was chosen instead. The pattern suggests this is not currently a priority regardless of stated intent."
580
+ }
581
+ },
582
+ {
583
+ id: "pattern_over_incident",
584
+ scope: "behavior_shaping",
585
+ instruction: "Interpret events in sequence. Look for recurring patterns across time rather than over-weighting one isolated incident.",
586
+ example: {
587
+ without: "They missed the deadline. That's a red flag.",
588
+ with: "One missed deadline is an event. Three missed deadlines with similar explanations is a pattern. What does the sequence tell you?"
589
+ }
590
+ },
591
+ {
592
+ id: "flag_ambiguity",
593
+ scope: "behavior_shaping",
594
+ instruction: "Notice ambiguity, indirectness, delayed commitment, and ownership diffusion. Treat these as meaningful signals when they repeat."
595
+ },
596
+ {
597
+ id: "separate_observed_inferred_speculative",
598
+ scope: "content_filtering",
599
+ instruction: "Clearly distinguish between what is directly observed, what is reasonably inferred from patterns, and what remains speculative."
600
+ },
601
+ {
602
+ id: "alignment_read",
603
+ scope: "value_emphasis",
604
+ instruction: "Assess whether words, timing, decisions, and follow-through align. Misalignment between stated priorities and actual behavior should be named clearly.",
605
+ example: {
606
+ without: "They seem supportive of the initiative.",
607
+ with: "They endorsed the initiative publicly but have not allocated budget, time, or personnel to it. Words and resource allocation are misaligned."
608
+ }
609
+ }
610
+ ]
611
+ };
555
612
  var BUILTIN_LENSES = [
556
613
  // Character lenses — each one is a person you'd want in your corner
557
614
  STOIC_LENS,
@@ -563,7 +620,9 @@ var BUILTIN_LENSES = [
563
620
  HYPE_MAN_LENS,
564
621
  MONK_LENS,
565
622
  SOCRATIC_LENS,
566
- MINIMALIST_LENS
623
+ MINIMALIST_LENS,
624
+ // Behavioral lenses — governance overlays that interpret action, not tone
625
+ BEHAVIORAL_INTERPRETER_LENS
567
626
  ];
568
627
  function getLenses() {
569
628
  return BUILTIN_LENSES;
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  McpGovernanceServer,
3
3
  startMcpServer
4
- } from "./chunk-LAKUB76X.js";
4
+ } from "./chunk-FDPPZLSQ.js";
5
5
  import "./chunk-AKW5YVCE.js";
6
- import "./chunk-EQUAWNXW.js";
6
+ import "./chunk-I4RTIMLX.js";
7
7
  import "./chunk-ZAF6JH23.js";
8
8
  import "./chunk-QLPTHTVB.js";
9
9
  import "./chunk-QWGCMQQD.js";
@@ -5,7 +5,7 @@ import {
5
5
  DEFAULT_BUNDLED_WORLD,
6
6
  loadBundledWorld,
7
7
  loadWorld
8
- } from "./chunk-EQUAWNXW.js";
8
+ } from "./chunk-I4RTIMLX.js";
9
9
  import {
10
10
  evaluateGuard
11
11
  } from "./chunk-ZAF6JH23.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  loadWorld
3
- } from "./chunk-EQUAWNXW.js";
3
+ } from "./chunk-I4RTIMLX.js";
4
4
  import {
5
5
  evaluateGuard
6
6
  } from "./chunk-ZAF6JH23.js";
@@ -2,9 +2,9 @@ import {
2
2
  SessionManager,
3
3
  runInteractiveMode,
4
4
  runPipeMode
5
- } from "./chunk-EK77AJAH.js";
5
+ } from "./chunk-OTZU76DH.js";
6
6
  import "./chunk-D2UCV5AK.js";
7
- import "./chunk-EQUAWNXW.js";
7
+ import "./chunk-I4RTIMLX.js";
8
8
  import "./chunk-ZAF6JH23.js";
9
9
  import "./chunk-QLPTHTVB.js";
10
10
  import "./chunk-QWGCMQQD.js";
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-CYDMUJVZ.js";
9
9
  import {
10
10
  loadWorld
11
- } from "./chunk-EQUAWNXW.js";
11
+ } from "./chunk-I4RTIMLX.js";
12
12
  import "./chunk-QWGCMQQD.js";
13
13
 
14
14
  // src/cli/simulate.ts
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  loadWorld
3
- } from "./chunk-EQUAWNXW.js";
3
+ } from "./chunk-I4RTIMLX.js";
4
4
  import {
5
5
  evaluateGuard
6
6
  } from "./chunk-ZAF6JH23.js";
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-7P3S7MAY.js";
7
7
  import {
8
8
  loadWorld
9
- } from "./chunk-EQUAWNXW.js";
9
+ } from "./chunk-I4RTIMLX.js";
10
10
  import "./chunk-QWGCMQQD.js";
11
11
 
12
12
  // src/cli/validate.ts
@@ -10,7 +10,7 @@ import {
10
10
  } from "./chunk-AKW5YVCE.js";
11
11
  import {
12
12
  loadWorld
13
- } from "./chunk-EQUAWNXW.js";
13
+ } from "./chunk-I4RTIMLX.js";
14
14
  import "./chunk-QWGCMQQD.js";
15
15
 
16
16
  // src/cli/world.ts
@@ -3,7 +3,7 @@ import {
3
3
  loadBundledWorld,
4
4
  loadWorld,
5
5
  loadWorldFromDirectory
6
- } from "./chunk-EQUAWNXW.js";
6
+ } from "./chunk-I4RTIMLX.js";
7
7
  import "./chunk-QWGCMQQD.js";
8
8
  export {
9
9
  DEFAULT_BUNDLED_WORLD,
@@ -0,0 +1,221 @@
1
+ /**
2
+ * WorldModel Contract — .worldmodel.md → Behavioral World Model Types
3
+ *
4
+ * Defines the three-layer intermediate representation produced by the parser
5
+ * and consumed by the compiler.
6
+ *
7
+ * Three Layers:
8
+ * 1. Core Model Geometry — mission, domains (skills + values), overlaps, center identity
9
+ * 2. Contextual Modifiers — authority, spatial contexts, interpretation rules
10
+ * 3. Evolution Layer — aligned/drift behaviors, signals, priorities, evolution conditions
11
+ *
12
+ * Input: .worldmodel.md file (structured markdown)
13
+ * Output: .nv-world.md + signals.json + overlaps.json + contexts.json + lenses.json
14
+ */
15
+ interface WorldModelFrontmatter {
16
+ /** Unique identifier derived from name (kebab-case) */
17
+ model_id: string;
18
+ /** Human-readable model name */
19
+ name: string;
20
+ /** Semantic version */
21
+ version: string;
22
+ }
23
+ /**
24
+ * A domain is a mode of operating that carries both skills and values.
25
+ * Domains are NOT personality traits — they are capability environments.
26
+ */
27
+ interface ParsedDomain {
28
+ /** kebab-case identifier derived from name */
29
+ id: string;
30
+ /** Human-readable domain name */
31
+ name: string;
32
+ /** Skills: capabilities within this domain */
33
+ skills: string[];
34
+ /** Values: constraints governing skills in this domain */
35
+ values: string[];
36
+ /** Line number in source for error reporting */
37
+ line: number;
38
+ }
39
+ /**
40
+ * An overlap effect describes what emerges when two domains interact well.
41
+ * These are interpretive states, not enforced rules.
42
+ */
43
+ interface ParsedOverlap {
44
+ /** First domain name */
45
+ domainA: string;
46
+ /** Second domain name */
47
+ domainB: string;
48
+ /** Emergent state name (e.g., "Inspiration", "Trust") */
49
+ effect: string;
50
+ /** Line number in source */
51
+ line: number;
52
+ }
53
+ /**
54
+ * The structural heart of the behavioral model.
55
+ * Defines what the system is trying to become.
56
+ */
57
+ interface CoreModelGeometry {
58
+ /** The core aim — not a slogan */
59
+ mission: string;
60
+ /** Major operating domains, each carrying skills and values */
61
+ domains: ParsedDomain[];
62
+ /** Emergent states arising between domain pairings */
63
+ overlapEffects: ParsedOverlap[];
64
+ /** The identity that emerges when all domains are aligned */
65
+ centerIdentity: string;
66
+ }
67
+ /**
68
+ * Defines how behavior is interpreted differently depending on context.
69
+ * These do NOT define truth — they define how meaning changes depending on
70
+ * who is acting, where behavior occurs, and what phase the system is in.
71
+ */
72
+ interface ContextualModifiers {
73
+ /** Who is acting? (e.g., founder, maintainer, contributor, agent) */
74
+ authorityLayers: string[];
75
+ /** Where is behavior happening? (e.g., planning, execution, deployment) */
76
+ spatialContexts: string[];
77
+ /** How does context change meaning? Free-form interpretation rules */
78
+ interpretationRules: string[];
79
+ }
80
+ /**
81
+ * A decision priority defining tradeoff resolution.
82
+ * Format: preferred > over
83
+ */
84
+ interface ParsedPriority {
85
+ /** What should win in the tradeoff */
86
+ preferred: string;
87
+ /** What it wins over */
88
+ over: string;
89
+ /** Line number in source */
90
+ line: number;
91
+ }
92
+ /**
93
+ * The executable temporal layer.
94
+ * Defines observable behaviors, signals, and adaptation conditions.
95
+ */
96
+ interface EvolutionLayer {
97
+ /** What does success look like in action? */
98
+ alignedBehaviors: string[];
99
+ /** What does misalignment look like? */
100
+ driftBehaviors: string[];
101
+ /** Observable metrics (snake_case identifiers) */
102
+ signals: string[];
103
+ /** Tradeoff resolution rules */
104
+ decisionPriorities: ParsedPriority[];
105
+ /** When should the model adapt? */
106
+ evolutionConditions: string[];
107
+ }
108
+ /**
109
+ * The complete three-layer behavioral world model.
110
+ *
111
+ * Layer 1 (geometry) defines the model.
112
+ * Layer 2 (modifiers) shapes interpretation.
113
+ * Layer 3 (evolution) drives executable governance.
114
+ */
115
+ interface ParsedWorldModel {
116
+ frontmatter: WorldModelFrontmatter;
117
+ geometry: CoreModelGeometry;
118
+ modifiers: ContextualModifiers;
119
+ evolution: EvolutionLayer;
120
+ }
121
+ /**
122
+ * Signal schema emitted as signals.json.
123
+ */
124
+ interface SignalSchema {
125
+ model_id: string;
126
+ signals: SignalEntry[];
127
+ }
128
+ interface SignalEntry {
129
+ id: string;
130
+ name: string;
131
+ type: 'number';
132
+ default: number;
133
+ }
134
+ /**
135
+ * Overlap map emitted as overlaps.json.
136
+ * Includes both a flat pairing list and a matrix view.
137
+ */
138
+ interface OverlapMap {
139
+ model_id: string;
140
+ pairings: OverlapPairing[];
141
+ /** domainA id → domainB id → emergent state name */
142
+ matrix: Record<string, Record<string, string>>;
143
+ }
144
+ interface OverlapPairing {
145
+ domainA: string;
146
+ domainB: string;
147
+ effect: string;
148
+ }
149
+ /**
150
+ * Contextual modifiers emitted as contexts.json.
151
+ */
152
+ interface ContextsConfig {
153
+ model_id: string;
154
+ authority_layers: string[];
155
+ spatial_contexts: string[];
156
+ interpretation_rules: string[];
157
+ }
158
+ /**
159
+ * A lens suggestion derived from overlap effects.
160
+ */
161
+ interface LensSuggestion {
162
+ id: string;
163
+ name: string;
164
+ tagline: string;
165
+ derived_from: {
166
+ domainA: string;
167
+ domainB: string;
168
+ effect: string;
169
+ };
170
+ tone: {
171
+ formality: string;
172
+ verbosity: string;
173
+ emotion: string;
174
+ confidence: string;
175
+ };
176
+ directives: LensDirectiveEntry[];
177
+ }
178
+ interface LensDirectiveEntry {
179
+ scope: string;
180
+ instruction: string;
181
+ }
182
+ /**
183
+ * Complete compiler output bundle.
184
+ */
185
+ interface WorldModelOutput {
186
+ /** Complete .nv-world.md content string */
187
+ worldMarkdown: string;
188
+ /** Signal schema for signals.json */
189
+ signalSchema: SignalSchema;
190
+ /** Overlap map for overlaps.json */
191
+ overlapMap: OverlapMap;
192
+ /** Context config for contexts.json */
193
+ contextsConfig: ContextsConfig;
194
+ /** Lens suggestions for lenses.json */
195
+ lensSuggestions: LensSuggestion[];
196
+ }
197
+ type WorldModelIssueSeverity = 'error' | 'warning' | 'info';
198
+ /**
199
+ * A single issue found during parsing or validation.
200
+ */
201
+ interface WorldModelIssue {
202
+ /** Line number in source (1-based, 0 if unknown) */
203
+ line: number;
204
+ /** Which section the issue was found in */
205
+ section: string;
206
+ /** Human-readable message (designed to teach the method) */
207
+ message: string;
208
+ /** Severity level */
209
+ severity: WorldModelIssueSeverity;
210
+ }
211
+ /**
212
+ * Result of parsing a .worldmodel.md file.
213
+ */
214
+ interface WorldModelParseResult {
215
+ /** The parsed model, or null if parsing failed */
216
+ model: ParsedWorldModel | null;
217
+ /** All issues encountered during parsing */
218
+ issues: WorldModelIssue[];
219
+ }
220
+
221
+ export type { ContextsConfig as C, LensSuggestion as L, OverlapMap as O, ParsedWorldModel as P, SignalSchema as S, WorldModelOutput as W, WorldModelParseResult as a };