@neuroverseos/governance 0.5.0 → 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 (133) hide show
  1. package/README.md +244 -0
  2. package/dist/adapters/autoresearch.d.cts +2 -1
  3. package/dist/adapters/autoresearch.d.ts +2 -1
  4. package/dist/adapters/autoresearch.js +2 -2
  5. package/dist/adapters/deep-agents.d.cts +3 -2
  6. package/dist/adapters/deep-agents.d.ts +3 -2
  7. package/dist/adapters/deep-agents.js +2 -2
  8. package/dist/adapters/express.d.cts +2 -1
  9. package/dist/adapters/express.d.ts +2 -1
  10. package/dist/adapters/express.js +2 -2
  11. package/dist/adapters/github.cjs +1697 -0
  12. package/dist/adapters/github.d.cts +225 -0
  13. package/dist/adapters/github.d.ts +225 -0
  14. package/dist/adapters/github.js +27 -0
  15. package/dist/adapters/index.d.cts +4 -316
  16. package/dist/adapters/index.d.ts +4 -316
  17. package/dist/adapters/index.js +23 -21
  18. package/dist/adapters/langchain.d.cts +3 -2
  19. package/dist/adapters/langchain.d.ts +3 -2
  20. package/dist/adapters/langchain.js +2 -2
  21. package/dist/adapters/mentraos.cjs +2181 -0
  22. package/dist/adapters/mentraos.d.cts +319 -0
  23. package/dist/adapters/mentraos.d.ts +319 -0
  24. package/dist/{mentraos-LLH7KEV4.js → adapters/mentraos.js} +12 -10
  25. package/dist/adapters/openai.d.cts +3 -2
  26. package/dist/adapters/openai.d.ts +3 -2
  27. package/dist/adapters/openai.js +2 -2
  28. package/dist/adapters/openclaw.d.cts +3 -2
  29. package/dist/adapters/openclaw.d.ts +3 -2
  30. package/dist/adapters/openclaw.js +2 -2
  31. package/dist/{add-LYHDZ5RL.js → add-XSANI3FK.js} +1 -1
  32. package/dist/admin/index.cjs +2214 -0
  33. package/dist/admin/index.d.cts +362 -0
  34. package/dist/admin/index.d.ts +362 -0
  35. package/dist/admin/index.js +703 -0
  36. package/dist/bootstrap-contract-DcV6t-8M.d.cts +216 -0
  37. package/dist/bootstrap-contract-DcV6t-8M.d.ts +216 -0
  38. package/dist/{build-SCAWPA7E.js → build-UTVDGHB3.js} +5 -5
  39. package/dist/{chunk-JKGPSFGH.js → chunk-7FL3U7Z5.js} +3 -3
  40. package/dist/chunk-A2UZTLRV.js +421 -0
  41. package/dist/{chunk-TD5GKIHP.js → chunk-B3IIPTY3.js} +3 -3
  42. package/dist/chunk-EQR7BGFN.js +337 -0
  43. package/dist/{chunk-5JUZ4HL7.js → chunk-FDPPZLSQ.js} +3 -3
  44. package/dist/{chunk-MFKHTE5R.js → chunk-FKQCPRKI.js} +3 -3
  45. package/dist/{chunk-7D7PZLB7.js → chunk-FS2UUJJO.js} +3 -3
  46. package/dist/{chunk-U6FRAEQJ.js → chunk-GJ6LM4JZ.js} +1 -441
  47. package/dist/chunk-H3REGQRI.js +107 -0
  48. package/dist/{chunk-25XHSTPT.js → chunk-HDNDL6D5.js} +3 -3
  49. package/dist/{chunk-BXLTEUS4.js → chunk-I4RTIMLX.js} +2 -2
  50. package/dist/chunk-IOVXB6QN.js +447 -0
  51. package/dist/{chunk-Y6WXAPKY.js → chunk-NTHXZAW4.js} +3 -3
  52. package/dist/{chunk-UTH7OXTM.js → chunk-OTZU76DH.js} +22 -4
  53. package/dist/{chunk-DWHUZUEY.js → chunk-T6GMRZWC.js} +3 -3
  54. package/dist/{chunk-V4FZHJQX.js → chunk-TIXVEPS2.js} +3 -3
  55. package/dist/{chunk-YNYCQECH.js → chunk-TJ5L2UTE.js} +3 -3
  56. package/dist/chunk-UGTNKTHS.js +542 -0
  57. package/dist/cli/neuroverse.cjs +3372 -523
  58. package/dist/cli/neuroverse.js +53 -21
  59. package/dist/cli/plan.js +2 -2
  60. package/dist/cli/run.cjs +242 -139
  61. package/dist/cli/run.js +23 -3
  62. package/dist/cli/worldmodel.cjs +1624 -0
  63. package/dist/cli/worldmodel.d.cts +24 -0
  64. package/dist/cli/worldmodel.d.ts +24 -0
  65. package/dist/cli/worldmodel.js +742 -0
  66. package/dist/{demo-66MMJTEH.js → demo-6W3YXLAX.js} +4 -4
  67. package/dist/{derive-AUQE3L3P.js → derive-42IJW7JI.js} +4 -4
  68. package/dist/{doctor-EY7LKSYY.js → doctor-XEMLO6UA.js} +3 -2
  69. package/dist/engine/bootstrap-emitter.cjs +241 -0
  70. package/dist/engine/bootstrap-emitter.d.cts +27 -0
  71. package/dist/engine/bootstrap-emitter.d.ts +27 -0
  72. package/dist/{bootstrap-emitter-GIMOJFOC.js → engine/bootstrap-emitter.js} +2 -2
  73. package/dist/engine/bootstrap-parser.cjs +560 -0
  74. package/dist/engine/bootstrap-parser.d.cts +96 -0
  75. package/dist/engine/bootstrap-parser.d.ts +96 -0
  76. package/dist/{bootstrap-parser-LBLGVEMU.js → engine/bootstrap-parser.js} +2 -2
  77. package/dist/engine/guard-engine.cjs +1116 -0
  78. package/dist/engine/guard-engine.d.cts +60 -0
  79. package/dist/engine/guard-engine.d.ts +60 -0
  80. package/dist/{guard-engine-N7TUIUU7.js → engine/guard-engine.js} +3 -3
  81. package/dist/engine/simulate-engine.cjs +390 -0
  82. package/dist/engine/simulate-engine.d.cts +105 -0
  83. package/dist/engine/simulate-engine.d.ts +105 -0
  84. package/dist/engine/simulate-engine.js +9 -0
  85. package/dist/engine/worldmodel-compiler.cjs +366 -0
  86. package/dist/engine/worldmodel-compiler.d.cts +46 -0
  87. package/dist/engine/worldmodel-compiler.d.ts +46 -0
  88. package/dist/engine/worldmodel-compiler.js +17 -0
  89. package/dist/engine/worldmodel-parser.cjs +566 -0
  90. package/dist/engine/worldmodel-parser.d.cts +22 -0
  91. package/dist/engine/worldmodel-parser.d.ts +22 -0
  92. package/dist/engine/worldmodel-parser.js +7 -0
  93. package/dist/{equity-penalties-WWC7UDQD.js → equity-penalties-CCO3GVHS.js} +6 -6
  94. package/dist/{explain-MUSGDT67.js → explain-HDFN4ION.js} +1 -1
  95. package/dist/{guard-W3BMQPBJ.js → guard-IHJEKHL2.js} +16 -4
  96. package/dist/{guard-contract-CLBbTGK_.d.ts → guard-contract-ddiIPlOg.d.cts} +2 -369
  97. package/dist/{guard-contract-CLBbTGK_.d.cts → guard-contract-q6HJAq3Q.d.ts} +2 -369
  98. package/dist/{improve-PJDAWW4Q.js → improve-LRORRYEX.js} +3 -3
  99. package/dist/index.cjs +471 -1
  100. package/dist/index.d.cts +14 -492
  101. package/dist/index.d.ts +14 -492
  102. package/dist/index.js +63 -42
  103. package/dist/keygen-BSZH3NM2.js +77 -0
  104. package/dist/{lens-IP6GIZ2Q.js → lens-TLDZQXBI.js} +152 -26
  105. package/dist/{mcp-server-OG3PPVD2.js → mcp-server-CKYBHXWK.js} +2 -2
  106. package/dist/migrate-NH5PVMX4.js +221 -0
  107. package/dist/{playground-4BK2XQ47.js → playground-3TTBN7XD.js} +5 -5
  108. package/dist/{redteam-BRZALBPP.js → redteam-W644UMWN.js} +3 -3
  109. package/dist/{session-SGRUT2UH.js → session-FMAROEIE.js} +2 -2
  110. package/dist/{shared-CwGpPheR.d.ts → shared-DAzdfWtU.d.ts} +1 -1
  111. package/dist/{shared-BGzmYP5g.d.cts → shared-PpalGKxc.d.cts} +1 -1
  112. package/dist/sign-RRELHKWM.js +11 -0
  113. package/dist/{simulate-FGXKIH7V.js → simulate-VT437EEL.js} +2 -2
  114. package/dist/{test-PT44BSYG.js → test-XDB2DH3L.js} +3 -3
  115. package/dist/types.cjs +18 -0
  116. package/dist/types.d.cts +370 -0
  117. package/dist/types.d.ts +370 -0
  118. package/dist/types.js +0 -0
  119. package/dist/{validate-Q5O5TGLT.js → validate-M52DX22Y.js} +1 -1
  120. package/dist/verify-6AVTWX75.js +151 -0
  121. package/dist/{world-V52ZMH26.js → world-O4HTQPDP.js} +1 -1
  122. package/dist/{world-loader-C4D3VPP3.js → world-loader-YTYFOP7D.js} +1 -1
  123. package/dist/worldmodel-contract-BPGhiuW5.d.cts +221 -0
  124. package/dist/worldmodel-contract-BPGhiuW5.d.ts +221 -0
  125. package/dist/worlds/auki-vanguard.worldmodel.md +116 -0
  126. package/dist/worlds/behavioral-demo.nv-world.md +130 -0
  127. package/dist/worlds/neuroverse-governance.worldmodel.md +115 -0
  128. package/package.json +44 -3
  129. package/dist/{bootstrap-IP5QMC3Q.js → bootstrap-2OW5ZLBL.js} +3 -3
  130. package/dist/{chunk-4G6WHPLI.js → chunk-735Z3HA4.js} +6 -6
  131. package/dist/{chunk-7QIAF377.js → chunk-CYDMUJVZ.js} +0 -0
  132. package/dist/{configure-ai-LL3VAPQW.js → configure-ai-5MP5DWTT.js} +3 -3
  133. package/dist/{decision-flow-3K4D72G4.js → decision-flow-IJPNMVQK.js} +3 -3
@@ -6,17 +6,21 @@ import {
6
6
  evaluateGuardWithAI
7
7
  } from "./chunk-6CV4XG3J.js";
8
8
  import "./chunk-INWQHLPS.js";
9
+ import {
10
+ FileAuditLogger,
11
+ verdictToAuditEvent
12
+ } from "./chunk-2VAWP6FI.js";
9
13
  import {
10
14
  describeActiveWorld,
11
15
  resolveWorldPath
12
16
  } from "./chunk-AKW5YVCE.js";
17
+ import {
18
+ loadWorld
19
+ } from "./chunk-I4RTIMLX.js";
13
20
  import {
14
21
  evaluateGuard
15
22
  } from "./chunk-ZAF6JH23.js";
16
23
  import "./chunk-QLPTHTVB.js";
17
- import {
18
- loadWorld
19
- } from "./chunk-BXLTEUS4.js";
20
24
  import "./chunk-QWGCMQQD.js";
21
25
 
22
26
  // src/cli/guard.ts
@@ -25,6 +29,7 @@ function parseArgs(argv) {
25
29
  let trace = false;
26
30
  let level;
27
31
  let aiClassify = false;
32
+ let logPath;
28
33
  for (let i = 0; i < argv.length; i++) {
29
34
  const arg = argv[i];
30
35
  if (arg === "--world" && i + 1 < argv.length) {
@@ -33,6 +38,8 @@ function parseArgs(argv) {
33
38
  trace = true;
34
39
  } else if (arg === "--ai-classify") {
35
40
  aiClassify = true;
41
+ } else if (arg === "--log" && i + 1 < argv.length) {
42
+ logPath = argv[++i];
36
43
  } else if (arg === "--level" && i + 1 < argv.length) {
37
44
  const val = argv[++i];
38
45
  if (val === "basic" || val === "standard" || val === "strict") {
@@ -42,7 +49,7 @@ function parseArgs(argv) {
42
49
  }
43
50
  }
44
51
  }
45
- return { worldPath, trace, level, aiClassify };
52
+ return { worldPath, trace, level, aiClassify, logPath };
46
53
  }
47
54
  async function main(argv = process.argv.slice(2)) {
48
55
  try {
@@ -102,6 +109,11 @@ async function main(argv = process.argv.slice(2)) {
102
109
  const options = { trace: args.trace, level: args.level };
103
110
  verdict = evaluateGuard(event, world, options);
104
111
  }
112
+ if (args.logPath) {
113
+ const logger = new FileAuditLogger(args.logPath, { flushIntervalMs: 0 });
114
+ logger.log(verdictToAuditEvent(event, verdict));
115
+ await logger.flush();
116
+ }
105
117
  process.stdout.write(JSON.stringify(verdict, null, 2) + "\n");
106
118
  const exitCode = GUARD_EXIT_CODES[verdict.status];
107
119
  process.exit(exitCode);
@@ -1,371 +1,4 @@
1
- /**
2
- * World Engine Types — Subset for Governance Engine
3
- *
4
- * These types map to the .nv-world.zip file format.
5
- * This file contains only the types referenced by the governance
6
- * engine (guard, validate, bootstrap). The full type system lives
7
- * in the main NeuroVerse OS repo.
8
- */
9
- interface ModelIdentity {
10
- modelName: string;
11
- acronymExpansion?: string;
12
- nameType: 'acronym' | 'metaphor';
13
- purpose: string;
14
- domain?: string;
15
- }
16
- interface WorldIdentity {
17
- world_id: string;
18
- name: string;
19
- thesis: string;
20
- version: string;
21
- runtime_mode: 'SIMULATION' | 'NARRATIVE' | 'COMPLIANCE' | 'CUSTOM';
22
- default_assumption_profile: string;
23
- default_alternative_profile: string;
24
- modules: string[];
25
- players: {
26
- thinking_space: boolean;
27
- experience_space: boolean;
28
- action_space: boolean;
29
- };
30
- modelIdentity?: ModelIdentity;
31
- }
32
- interface Invariant {
33
- id: string;
34
- label: string;
35
- enforcement: 'structural' | 'prompt';
36
- mutable: false;
37
- }
38
- interface AssumptionProfile {
39
- name: string;
40
- description: string;
41
- is_default_baseline?: boolean;
42
- is_default_alternative?: boolean;
43
- parameters: Record<string, string>;
44
- }
45
- interface ParameterDefinition {
46
- type: 'enum' | 'number' | 'boolean';
47
- options?: string[];
48
- min?: number;
49
- max?: number;
50
- label: string;
51
- description: string;
52
- }
53
- interface AssumptionConfig {
54
- profiles: Record<string, AssumptionProfile>;
55
- parameter_definitions: Record<string, ParameterDefinition>;
56
- }
57
- interface StateVariable {
58
- type: 'enum' | 'number' | 'boolean';
59
- options?: string[];
60
- min?: number;
61
- max?: number;
62
- step?: number;
63
- default: string | number | boolean;
64
- mutable: boolean;
65
- label: string;
66
- description: string;
67
- display_as?: 'percentage' | 'integer' | 'decimal';
68
- }
69
- interface StatePreset {
70
- description: string;
71
- values: Record<string, string | number | boolean>;
72
- }
73
- interface StateSchema {
74
- variables: Record<string, StateVariable>;
75
- presets: Record<string, StatePreset>;
76
- }
77
- type TriggerOperator = '==' | '!=' | '>' | '<' | '>=' | '<=' | 'in';
78
- type EffectOperation = 'multiply' | 'add' | 'subtract' | 'set' | 'set_boolean' | 'multiply_dynamic' | 'add_dynamic' | 'subtract_dynamic' | 'set_dynamic';
79
- type RuleSeverity = 'structural' | 'degradation' | 'advantage';
80
- interface Trigger {
81
- field: string;
82
- operator: TriggerOperator;
83
- value: string | number | boolean | string[];
84
- source: 'state' | 'assumption';
85
- }
86
- interface Effect {
87
- target: string;
88
- operation: EffectOperation;
89
- value: number | boolean | string;
90
- value_formula?: string;
91
- }
92
- interface CollapseCheck {
93
- field: string;
94
- operator: TriggerOperator;
95
- value: number;
96
- result: 'MODEL_COLLAPSES';
97
- }
98
- interface ConditionalEffect {
99
- condition: Trigger;
100
- and?: Trigger;
101
- or?: Trigger;
102
- condition_any?: Trigger[];
103
- effects: Effect[];
104
- }
105
- interface CausalTranslation {
106
- trigger_text: string;
107
- rule_text: string;
108
- shift_text: string;
109
- effect_text: string;
110
- }
111
- interface RuleRedirect {
112
- suggested_action: string;
113
- reason: string;
114
- fallback_state_changes?: Record<string, string | number | boolean>;
115
- }
116
- interface Rule {
117
- id: string;
118
- severity: RuleSeverity;
119
- label: string;
120
- description: string;
121
- order: number;
122
- triggers: Trigger[];
123
- effects?: Effect[];
124
- effects_conditional?: ConditionalEffect[];
125
- collapse_check?: CollapseCheck;
126
- secondary_check?: CollapseCheck;
127
- exclusive_with?: string;
128
- causal_translation: CausalTranslation;
129
- redirect?: RuleRedirect;
130
- }
131
- type ViabilityStatus = 'THRIVING' | 'STABLE' | 'COMPRESSED' | 'CRITICAL' | 'MODEL_COLLAPSES';
132
- interface ViabilityGate {
133
- status: ViabilityStatus;
134
- field: string;
135
- operator: TriggerOperator;
136
- value: number;
137
- color: string;
138
- icon: string;
139
- }
140
- interface CollapseVisual {
141
- background: string;
142
- text: string;
143
- border: string;
144
- label: string;
145
- }
146
- interface GatesConfig {
147
- viability_classification: ViabilityGate[];
148
- structural_override: {
149
- description: string;
150
- enforcement: 'mandatory';
151
- };
152
- sustainability_threshold: number;
153
- collapse_visual: CollapseVisual;
154
- }
155
- interface ComputedOutcome {
156
- id: string;
157
- type: 'number' | 'boolean' | 'enum';
158
- range?: [number, number];
159
- options?: string[];
160
- default?: number | boolean | string;
161
- display_as?: 'percentage' | 'integer' | 'decimal';
162
- label: string;
163
- primary?: boolean;
164
- initial_value?: string;
165
- derived_from?: string;
166
- assignment?: 'rule' | 'external';
167
- show_in_comparison: boolean;
168
- structural_indicator?: boolean;
169
- }
170
- interface ComparisonLayout {
171
- primary_card: string;
172
- status_badge: string;
173
- structural_indicators: string[];
174
- }
175
- interface OutcomesConfig {
176
- computed_outcomes: ComputedOutcome[];
177
- comparison_layout: ComparisonLayout;
178
- }
179
- interface WorldMetadata {
180
- format_version: string;
181
- created_at: string;
182
- last_modified: string;
183
- authoring_method: 'manual-authoring' | 'configurator-ai' | 'migration';
184
- integrity_hash?: string;
185
- }
186
- interface KernelConfig {
187
- artifact_type: string;
188
- kernel_id: string;
189
- version: string;
190
- domain: string;
191
- enforcement_level: 'standard' | 'strict' | 'permissive';
192
- input_boundaries: {
193
- forbidden_patterns: Array<{
194
- id: string;
195
- pattern: string;
196
- reason: string;
197
- action: 'BLOCK' | 'WARN';
198
- }>;
199
- };
200
- output_boundaries: {
201
- forbidden_patterns: Array<{
202
- id: string;
203
- pattern: string;
204
- reason: string;
205
- action: 'BLOCK' | 'WARN';
206
- }>;
207
- };
208
- response_vocabulary: Record<string, string>;
209
- metadata: {
210
- compiled_by: string;
211
- compiled_at: string;
212
- source_hash: string;
213
- compiler_version: string;
214
- };
215
- }
216
- type RoleArchetype = 'observer' | 'operator' | 'strategist' | 'guardian' | 'steward' | 'executor';
217
- type RoleAuthority = 'none' | 'execute_within_limits' | 'reprioritize_within_bounds' | 'block_violations' | 'escalate_audit_freeze' | 'execute_declared_actions';
218
- type RolePosture = 'analyze' | 'task_oriented' | 'long_term_coherence' | 'constraint_aware' | 'system_integrity' | 'efficient';
219
- interface WorldRoleDefinition {
220
- id: string;
221
- archetype: RoleArchetype;
222
- authority: RoleAuthority;
223
- posture: RolePosture;
224
- name: string;
225
- description: string;
226
- icon?: string;
227
- roleMandate: string;
228
- voiceStyle?: string;
229
- canDo: string[];
230
- cannotDo: string[];
231
- requiresApproval?: boolean;
232
- trackedOutcomes?: string[];
233
- ownedRules?: string[];
234
- /** Default lens for this role (references a lens id from the world's lenses config) */
235
- defaultLens?: string;
236
- }
237
- type RoleAssignment = 'dynamic' | 'per_session' | 'permanent';
238
- interface RoleTransition {
239
- from: string;
240
- to: string;
241
- initiator: 'self' | 'steward' | 'any';
242
- condition?: string;
243
- }
244
- interface RolesConfig {
245
- assignment: RoleAssignment;
246
- roles: WorldRoleDefinition[];
247
- transitions?: RoleTransition[];
248
- }
249
- interface Guard {
250
- id: string;
251
- label: string;
252
- description: string;
253
- category: 'structural' | 'operational' | 'advisory';
254
- enforcement: 'block' | 'pause' | 'warn' | 'modify' | 'penalize' | 'reward' | 'neutral';
255
- immutable: boolean;
256
- invariant_ref?: string;
257
- intent_patterns: string[];
258
- required_roles?: string[];
259
- redirect?: string;
260
- default_enabled?: boolean;
261
- /** Tool names this guard applies to (case-insensitive). Empty/absent = all tools. */
262
- appliesTo?: string[];
263
- player_modes?: {
264
- thinking?: 'annotate' | 'block' | 'ignore';
265
- experience?: 'simulate' | 'score' | 'ignore';
266
- action?: 'block' | 'pause' | 'warn' | 'modify' | 'penalize' | 'reward' | 'neutral';
267
- };
268
- /** Consequence to apply when enforcement is 'penalize' */
269
- consequence?: {
270
- type: 'freeze' | 'reduce_influence' | 'increase_risk' | 'cooldown' | 'custom';
271
- rounds?: number;
272
- magnitude?: number;
273
- description: string;
274
- };
275
- /** Reward to apply when enforcement is 'reward' */
276
- reward?: {
277
- type: 'boost_influence' | 'priority' | 'faster_execution' | 'weight_increase' | 'custom';
278
- rounds?: number;
279
- magnitude?: number;
280
- description: string;
281
- };
282
- /** For 'modify' enforcement: what the action should be changed to */
283
- modify_to?: string;
284
- }
285
- interface IntentPattern {
286
- label: string;
287
- pattern: string;
288
- }
289
- interface GuardsConfig {
290
- guards: Guard[];
291
- intent_vocabulary: Record<string, IntentPattern>;
292
- /** All known action surfaces (e.g. "shell", "http", "db", "email", "deploy").
293
- * When declared, the validator checks that every surface has at least one
294
- * governing guard — surfaces without guards are reported as fail-open. */
295
- tool_surfaces?: string[];
296
- }
297
- /**
298
- * A governance event — the bridge between Guard and Simulate.
299
- *
300
- * Guard produces events (what happened).
301
- * Simulate consumes events (what changes because of it).
302
- *
303
- * Events are NOT stored — they flow through the system.
304
- * Guard evaluation log IS the event stream.
305
- */
306
- interface GovernanceEvent {
307
- /** Semantic event type: "complaint", "refund", "action_blocked", etc. */
308
- type: string;
309
- /** Who caused this event */
310
- actor?: 'customer' | 'agent' | 'system';
311
- /** Where the event originated */
312
- source: 'guard' | 'manual' | 'system';
313
- /** Unix timestamp (ms) */
314
- timestamp: number;
315
- /** Guard status that produced this event (when source=guard) */
316
- guardStatus?: 'ALLOW' | 'BLOCK' | 'PAUSE' | 'MODIFY' | 'PENALIZE' | 'REWARD' | 'NEUTRAL';
317
- /** Optional metadata */
318
- metadata?: Record<string, unknown>;
319
- }
320
- interface LensDirectiveConfig {
321
- id: string;
322
- scope: 'response_framing' | 'language_style' | 'content_filtering' | 'value_emphasis' | 'behavior_shaping';
323
- instruction: string;
324
- }
325
- interface LensConfig {
326
- id: string;
327
- name: string;
328
- tagline: string;
329
- description: string;
330
- tags: string[];
331
- tone: {
332
- formality: 'casual' | 'neutral' | 'formal' | 'professional';
333
- verbosity: 'terse' | 'concise' | 'balanced' | 'detailed';
334
- emotion: 'warm' | 'neutral' | 'reserved' | 'clinical';
335
- confidence: 'humble' | 'balanced' | 'authoritative' | 'assertive';
336
- };
337
- directives: LensDirectiveConfig[];
338
- defaultForRoles: string[];
339
- priority: number;
340
- stackable: boolean;
341
- }
342
- interface LensesConfig {
343
- lenses: LensConfig[];
344
- /**
345
- * Lens policy:
346
- * - 'locked': lenses are assigned by role, user cannot change without pin
347
- * - 'role_default': lenses start as role default, user can override
348
- * - 'user_choice': no default, user picks freely
349
- */
350
- policy?: 'locked' | 'role_default' | 'user_choice';
351
- /** Pin required to change lenses when policy is 'locked' */
352
- lockPin?: string;
353
- }
354
- interface WorldDefinition {
355
- world: WorldIdentity;
356
- invariants: Invariant[];
357
- assumptions: AssumptionConfig;
358
- stateSchema: StateSchema;
359
- rules: Rule[];
360
- gates: GatesConfig;
361
- outcomes: OutcomesConfig;
362
- guards?: GuardsConfig;
363
- roles?: RolesConfig;
364
- kernel?: KernelConfig;
365
- lenses?: LensesConfig;
366
- enforcement?: string;
367
- metadata: WorldMetadata;
368
- }
1
+ import { GovernanceEvent } from './types.cjs';
369
2
 
370
3
  /**
371
4
  * Plan Contract — Plan Enforcement Types
@@ -924,4 +557,4 @@ declare const GUARD_EXIT_CODES: {
924
557
  };
925
558
  type GuardExitCode = (typeof GUARD_EXIT_CODES)[keyof typeof GUARD_EXIT_CODES];
926
559
 
927
- export { type AdvanceResult as A, type Consequence as C, type EvaluationTrace as E, type GuardEvent as G, type Invariant as I, type KernelRuleCheck as K, type LevelCheck as L, type PlanDefinition as P, type Reward as R, type StepEvidence as S, type ViabilityStatus as V, type WorldDefinition as W, type GuardVerdict as a, type GuardEngineOptions as b, type PlanProgress as c, type GuardStatus as d, type GovernanceEvent as e, type PlanVerdict as f, type PlanCheck as g, type AgentBehaviorState as h, type Guard as i, type Rule as j, GUARD_EXIT_CODES as k, type GuardCheck as l, type GuardExitCode as m, type IntentRecord as n, type InvariantCheck as o, PLAN_EXIT_CODES as p, type PlanCompletionMode as q, type PlanConstraint as r, type PlanExitCode as s, type PlanStatus as t, type PlanStep as u, type PrecedenceResolution as v, type RoleCheck as w, type SafetyCheck as x, type VerdictEvidence as y };
560
+ export { type AdvanceResult as A, type Consequence as C, type EvaluationTrace as E, type GuardVerdict as G, type IntentRecord as I, type KernelRuleCheck as K, type LevelCheck as L, type PlanDefinition as P, type Reward as R, type StepEvidence as S, type VerdictEvidence as V, type GuardEvent as a, type GuardEngineOptions as b, type PlanProgress as c, type GuardStatus as d, type PlanVerdict as e, type PlanCheck as f, type AgentBehaviorState as g, GUARD_EXIT_CODES as h, type GuardCheck as i, type GuardExitCode as j, type InvariantCheck as k, PLAN_EXIT_CODES as l, type PlanCompletionMode as m, type PlanConstraint as n, type PlanExitCode as o, type PlanStatus as p, type PlanStep as q, type PrecedenceResolution as r, type RoleCheck as s, type SafetyCheck as t };