@neuroverseos/governance 0.3.4 → 0.4.1
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 +280 -405
- package/dist/adapters/autoresearch.cjs +63 -9
- package/dist/adapters/autoresearch.d.cts +2 -1
- package/dist/adapters/autoresearch.d.ts +2 -1
- package/dist/adapters/autoresearch.js +3 -3
- package/dist/adapters/deep-agents.cjs +63 -9
- package/dist/adapters/deep-agents.d.cts +3 -2
- package/dist/adapters/deep-agents.d.ts +3 -2
- package/dist/adapters/deep-agents.js +3 -3
- package/dist/adapters/express.cjs +63 -9
- package/dist/adapters/express.d.cts +2 -1
- package/dist/adapters/express.d.ts +2 -1
- package/dist/adapters/express.js +3 -3
- package/dist/adapters/index.cjs +961 -9
- package/dist/adapters/index.d.cts +4 -2
- package/dist/adapters/index.d.ts +4 -2
- package/dist/adapters/index.js +54 -17
- package/dist/adapters/langchain.cjs +63 -9
- package/dist/adapters/langchain.d.cts +3 -2
- package/dist/adapters/langchain.d.ts +3 -2
- package/dist/adapters/langchain.js +3 -3
- package/dist/adapters/mentraos.cjs +2181 -0
- package/dist/adapters/mentraos.d.cts +319 -0
- package/dist/adapters/mentraos.d.ts +319 -0
- package/dist/adapters/mentraos.js +48 -0
- package/dist/adapters/openai.cjs +63 -9
- package/dist/adapters/openai.d.cts +3 -2
- package/dist/adapters/openai.d.ts +3 -2
- package/dist/adapters/openai.js +3 -3
- package/dist/adapters/openclaw.cjs +63 -9
- package/dist/adapters/openclaw.d.cts +3 -2
- package/dist/adapters/openclaw.d.ts +3 -2
- package/dist/adapters/openclaw.js +3 -3
- package/dist/{add-ROOZLU62.js → add-XSANI3FK.js} +1 -1
- package/dist/{behavioral-MJO34S6Q.js → behavioral-SLW7ALEK.js} +4 -4
- package/dist/{bootstrap-CQRZVOXK.js → bootstrap-2OW5ZLBL.js} +4 -4
- package/dist/bootstrap-contract-DcV6t-8M.d.cts +216 -0
- package/dist/bootstrap-contract-DcV6t-8M.d.ts +216 -0
- package/dist/browser.global.js +149 -5
- package/dist/{build-ZHPMX5AZ.js → build-EGBGZFIJ.js} +6 -6
- package/dist/{chunk-A7GKPPU7.js → chunk-2VAWP6FI.js} +1 -1
- package/dist/{chunk-3WQLXYTP.js → chunk-3AYKQHYI.js} +2 -2
- package/dist/{chunk-EMQDLDAF.js → chunk-3NZMMSOW.js} +80 -2
- package/dist/chunk-3S5AD4AB.js +421 -0
- package/dist/{chunk-VXHSMA3I.js → chunk-6CV4XG3J.js} +1 -1
- package/dist/{chunk-BNKJPUPQ.js → chunk-A7SHG75T.js} +2 -2
- package/dist/{chunk-U6U7EJZL.js → chunk-AV7XJJWK.js} +2 -2
- package/dist/{chunk-ZWI3NIXK.js → chunk-CYDMUJVZ.js} +54 -3
- package/dist/{chunk-F66BVUYB.js → chunk-DA5MHFRR.js} +3 -3
- package/dist/{chunk-YEKMVDWK.js → chunk-FHXXD2TI.js} +7 -7
- package/dist/{chunk-5TPFNWRU.js → chunk-FS2UUJJO.js} +3 -3
- package/dist/{chunk-4FLICVVA.js → chunk-FVOGUCB6.js} +2 -2
- package/dist/chunk-GTPV2XGO.js +893 -0
- package/dist/{chunk-CTZHONLA.js → chunk-I4RTIMLX.js} +2 -2
- package/dist/{chunk-B6OXJLJ5.js → chunk-J2IZBHXJ.js} +4 -4
- package/dist/{chunk-TG6SEF24.js → chunk-OQU65525.js} +1 -1
- package/dist/{chunk-QXBFT7NI.js → chunk-QMVQ6KPL.js} +2 -2
- package/dist/{chunk-G7DJ6VOD.js → chunk-RDA7ISWC.js} +2 -2
- package/dist/{chunk-O5ABKEA7.js → chunk-YJ34R5NB.js} +2 -2
- package/dist/{chunk-PVTQQS3Y.js → chunk-YPCVY4GS.js} +31 -0
- package/dist/{chunk-W7LLXRGY.js → chunk-ZAF6JH23.js} +65 -10
- package/dist/{chunk-IS4WUH6Y.js → chunk-ZEIT2QLM.js} +4 -4
- package/dist/cli/neuroverse.cjs +4436 -1035
- package/dist/cli/neuroverse.js +40 -24
- package/dist/cli/plan.cjs +176 -12
- package/dist/cli/plan.js +2 -2
- package/dist/cli/run.cjs +63 -9
- package/dist/cli/run.js +2 -2
- package/dist/configure-world-XU2COHOZ.js +705 -0
- package/dist/{decision-flow-M63D47LO.js → decision-flow-3K4D72G4.js} +2 -2
- package/dist/{demo-G43RLCPK.js → demo-6OQYWRR6.js} +4 -4
- package/dist/{derive-LMDUTXDD.js → derive-7Y7YWVLU.js} +5 -5
- package/dist/{doctor-6BC6X2VO.js → doctor-NHXI7OQW.js} +3 -1
- package/dist/engine/bootstrap-emitter.cjs +241 -0
- package/dist/engine/bootstrap-emitter.d.cts +27 -0
- package/dist/engine/bootstrap-emitter.d.ts +27 -0
- package/dist/{bootstrap-emitter-Q7UIJZ2O.js → engine/bootstrap-emitter.js} +2 -2
- package/dist/engine/bootstrap-parser.cjs +560 -0
- package/dist/engine/bootstrap-parser.d.cts +96 -0
- package/dist/engine/bootstrap-parser.d.ts +96 -0
- package/dist/{bootstrap-parser-EEF36XDU.js → engine/bootstrap-parser.js} +2 -2
- package/dist/engine/guard-engine.cjs +1116 -0
- package/dist/engine/guard-engine.d.cts +60 -0
- package/dist/engine/guard-engine.d.ts +60 -0
- package/dist/engine/guard-engine.js +12 -0
- package/dist/engine/simulate-engine.cjs +390 -0
- package/dist/engine/simulate-engine.d.cts +105 -0
- package/dist/engine/simulate-engine.d.ts +105 -0
- package/dist/engine/simulate-engine.js +9 -0
- package/dist/{equity-penalties-SG5IZQ7I.js → equity-penalties-NVBAB5WL.js} +4 -4
- package/dist/{explain-RHBU2GBR.js → explain-HDFN4ION.js} +1 -1
- package/dist/github-TIKTWOGU.js +27 -0
- package/dist/{guard-AEEJNWLD.js → guard-6KSCWT2W.js} +4 -4
- package/dist/{guard-contract-B7lplwm9.d.cts → guard-contract-C991HDZp.d.cts} +32 -309
- package/dist/{guard-contract-B7lplwm9.d.ts → guard-contract-hHjTTjtR.d.ts} +32 -309
- package/dist/{impact-3XVDSCBU.js → impact-WIAM66IH.js} +3 -3
- package/dist/{improve-TQP4ECSY.js → improve-2PWGGO5B.js} +3 -3
- package/dist/index.cjs +682 -14
- package/dist/index.d.cts +231 -423
- package/dist/index.d.ts +231 -423
- package/dist/index.js +81 -58
- package/dist/{init-FYPV4SST.js → init-TKIJDR7I.js} +5 -1
- package/dist/lens-MHMUDCMQ.js +1084 -0
- package/dist/{mcp-server-5Y3ZM7TV.js → mcp-server-TNIWZ7B5.js} +3 -3
- package/dist/{playground-VZBNPPBO.js → playground-3FLDGBET.js} +3 -3
- package/dist/{redteam-MZPZD3EF.js → redteam-HV6LMKEH.js} +3 -3
- package/dist/{session-JYOARW54.js → session-XZP2754M.js} +3 -3
- package/dist/{shared-C_zpdvBm.d.cts → shared-DGnn1jiS.d.cts} +1 -1
- package/dist/{shared-Cf7yxx4-.d.ts → shared-U405h52W.d.ts} +1 -1
- package/dist/{simulate-LJXYBC6M.js → simulate-VT437EEL.js} +17 -4
- package/dist/spatial/index.cjs +682 -0
- package/dist/spatial/index.d.cts +517 -0
- package/dist/spatial/index.d.ts +517 -0
- package/dist/spatial/index.js +633 -0
- package/dist/{test-BOOR4A5F.js → test-4WTX6RKQ.js} +3 -3
- package/dist/{trace-PKV4KX56.js → trace-2YDNAXMK.js} +2 -2
- package/dist/types.cjs +18 -0
- package/dist/types.d.cts +370 -0
- package/dist/types.d.ts +370 -0
- package/dist/types.js +0 -0
- package/dist/{validate-RALX7CZS.js → validate-M52DX22Y.js} +1 -1
- package/dist/{world-BIP4GZBZ.js → world-O4HTQPDP.js} +1 -1
- package/dist/{world-loader-Y6HMQH2D.js → world-loader-YTYFOP7D.js} +1 -1
- package/dist/worlds/mentraos-smartglasses.nv-world.md +423 -0
- package/dist/worlds/mentraos-spatial.nv-world.md +68 -0
- package/dist/worlds/user-rules.nv-world.md +328 -0
- package/package.json +46 -3
- package/dist/guard-engine-PNR6MHCM.js +0 -10
- package/dist/{configure-ai-5MP5DWTT.js → configure-ai-LL3VAPQW.js} +3 -3
package/dist/types.d.cts
ADDED
|
@@ -0,0 +1,370 @@
|
|
|
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
|
+
}
|
|
369
|
+
|
|
370
|
+
export type { AssumptionConfig, AssumptionProfile, CausalTranslation, CollapseCheck, CollapseVisual, ComparisonLayout, ComputedOutcome, ConditionalEffect, Effect, EffectOperation, GatesConfig, GovernanceEvent, Guard, GuardsConfig, IntentPattern, Invariant, KernelConfig, LensConfig, LensDirectiveConfig, LensesConfig, ModelIdentity, OutcomesConfig, ParameterDefinition, RoleArchetype, RoleAssignment, RoleAuthority, RolePosture, RoleTransition, RolesConfig, Rule, RuleRedirect, RuleSeverity, StatePreset, StateSchema, StateVariable, Trigger, TriggerOperator, ViabilityGate, ViabilityStatus, WorldDefinition, WorldIdentity, WorldMetadata, WorldRoleDefinition };
|