@neuroverseos/governance 0.7.0 → 0.8.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 +95 -4
- package/dist/{chunk-T6EQ7ZBG.js → chunk-ETDIEVAX.js} +880 -134
- package/dist/{chunk-VGFDMPVB.js → chunk-F2LWMOM5.js} +283 -1
- package/dist/cli/neuroverse.cjs +1599 -360
- package/dist/cli/radiant.cjs +1190 -227
- package/dist/cli/radiant.js +25 -7
- package/dist/cli/worldmodel.cjs +300 -21
- package/dist/cli/worldmodel.js +76 -1
- package/dist/{lenses-K5FVSALR.js → lenses-YDMKSXDL.js} +5 -3
- package/dist/radiant/index.cjs +1183 -138
- package/dist/radiant/index.d.cts +382 -23
- package/dist/radiant/index.d.ts +382 -23
- package/dist/radiant/index.js +37 -3
- package/dist/{server-BXMC5NOE.js → server-ZSQ6DRSN.js} +2 -2
- package/dist/worldmodel-create-5SWHVNMQ.js +195 -0
- package/package.json +1 -1
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import "./chunk-QWGCMQQD.js";
|
|
2
|
+
|
|
3
|
+
// src/cli/worldmodel-create.ts
|
|
4
|
+
import { createInterface } from "readline";
|
|
5
|
+
import { writeFileSync } from "fs";
|
|
6
|
+
import { resolve } from "path";
|
|
7
|
+
var QUESTIONS = [
|
|
8
|
+
{
|
|
9
|
+
id: "name",
|
|
10
|
+
question: "What should we call this model? (Your name, your org, your project)",
|
|
11
|
+
placeholder: 'e.g., "Kirsten", "Auki", "My Startup"'
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
id: "mission",
|
|
15
|
+
question: "In one or two sentences \u2014 what does this system exist to do? Not a slogan. The real purpose.",
|
|
16
|
+
placeholder: 'e.g., "Protect human thinking while expanding cognitive capability through AI"'
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: "domains",
|
|
20
|
+
question: "What are the 2-3 big areas of focus? Not departments \u2014 the major kinds of work that matter most. Separate with commas.",
|
|
21
|
+
placeholder: 'e.g., "Safety and boundaries, Individual authority, AI as cognitive extension"'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
id: "overlaps",
|
|
25
|
+
question: "When those areas work well TOGETHER, what does that feel like? Name a feeling for each pair.",
|
|
26
|
+
placeholder: 'e.g., "Safety + Authority = Trust, Authority + AI = Possibility"'
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: "center",
|
|
30
|
+
question: "When EVERYTHING is aligned \u2014 all areas working together \u2014 what does the system become? One name or phrase.",
|
|
31
|
+
placeholder: 'e.g., "The Sovereign Conduit", "Collective Vanguard Leader"'
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: "nonnegotiables",
|
|
35
|
+
question: "What's absolutely non-negotiable? What would you walk away over? List a few.",
|
|
36
|
+
placeholder: 'e.g., "Humans retain authority over thinking. AI extends, never replaces. People can always leave."'
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
id: "success",
|
|
40
|
+
question: `What does success look like in action? What would you point at and say "that's what I mean"?`,
|
|
41
|
+
placeholder: 'e.g., "Someone maintaining clear authorship of decisions even when AI contributed"'
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: "drift",
|
|
45
|
+
question: "What does drift look like? What would worry you if you saw it happening?",
|
|
46
|
+
placeholder: 'e.g., "Decision ownership quietly shifting to AI without explicit delegation"'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: "priorities",
|
|
50
|
+
question: 'When tradeoffs appear, what wins? Give a few "X over Y" pairs.',
|
|
51
|
+
placeholder: 'e.g., "Safety over speed, sovereignty over convenience, diversity over uniformity"'
|
|
52
|
+
}
|
|
53
|
+
];
|
|
54
|
+
async function askQuestions() {
|
|
55
|
+
const rl = createInterface({
|
|
56
|
+
input: process.stdin,
|
|
57
|
+
output: process.stderr
|
|
58
|
+
// questions to stderr so stdout stays clean
|
|
59
|
+
});
|
|
60
|
+
const answers = {};
|
|
61
|
+
process.stderr.write("\n");
|
|
62
|
+
process.stderr.write(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557\n");
|
|
63
|
+
process.stderr.write(" \u2551 NeuroVerseOS \u2014 Build your thinking constitution \u2551\n");
|
|
64
|
+
process.stderr.write(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D\n");
|
|
65
|
+
process.stderr.write("\n");
|
|
66
|
+
process.stderr.write(" Answer these questions in your own words.\n");
|
|
67
|
+
process.stderr.write(" There are no wrong answers \u2014 just say what you mean.\n");
|
|
68
|
+
process.stderr.write(" The AI will structure your answers into a worldmodel.\n\n");
|
|
69
|
+
for (const q of QUESTIONS) {
|
|
70
|
+
const answer = await new Promise((resolve2) => {
|
|
71
|
+
process.stderr.write(` \x1B[1m${q.question}\x1B[0m
|
|
72
|
+
`);
|
|
73
|
+
process.stderr.write(` \x1B[2m${q.placeholder}\x1B[0m
|
|
74
|
+
`);
|
|
75
|
+
rl.question(" > ", (ans) => {
|
|
76
|
+
process.stderr.write("\n");
|
|
77
|
+
resolve2(ans.trim());
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
answers[q.id] = answer;
|
|
81
|
+
}
|
|
82
|
+
rl.close();
|
|
83
|
+
return answers;
|
|
84
|
+
}
|
|
85
|
+
async function structureWorldmodel(answers, apiKey) {
|
|
86
|
+
const prompt = buildStructuringPrompt(answers);
|
|
87
|
+
const res = await fetch("https://api.anthropic.com/v1/messages", {
|
|
88
|
+
method: "POST",
|
|
89
|
+
headers: {
|
|
90
|
+
"x-api-key": apiKey,
|
|
91
|
+
"anthropic-version": "2023-06-01",
|
|
92
|
+
"content-type": "application/json"
|
|
93
|
+
},
|
|
94
|
+
body: JSON.stringify({
|
|
95
|
+
model: "claude-sonnet-4-20250514",
|
|
96
|
+
max_tokens: 4096,
|
|
97
|
+
system: "You are a behavioral model architect. You take conversational answers about an organization's values, purpose, and priorities, and structure them into a precise .worldmodel.md file that follows the NeuroVerseOS three-layer format. Output ONLY the markdown file content, nothing else.",
|
|
98
|
+
messages: [{ role: "user", content: prompt }]
|
|
99
|
+
})
|
|
100
|
+
});
|
|
101
|
+
if (!res.ok) {
|
|
102
|
+
throw new Error(`AI structuring failed: ${res.status}`);
|
|
103
|
+
}
|
|
104
|
+
const data = await res.json();
|
|
105
|
+
const text = data.content?.filter((c) => c.type === "text").map((c) => c.text ?? "").join("");
|
|
106
|
+
if (!text) throw new Error("AI returned no content");
|
|
107
|
+
return text.replace(/^```markdown\n?/, "").replace(/\n?```$/, "").trim();
|
|
108
|
+
}
|
|
109
|
+
function buildStructuringPrompt(answers) {
|
|
110
|
+
return `Structure these conversational answers into a .worldmodel.md file.
|
|
111
|
+
|
|
112
|
+
The file MUST follow this exact three-layer format:
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
name: ${answers.name}
|
|
116
|
+
version: 1.0.0
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
# Core Model Geometry
|
|
120
|
+
|
|
121
|
+
## Mission
|
|
122
|
+
(from the mission answer)
|
|
123
|
+
|
|
124
|
+
## Domains
|
|
125
|
+
(2-4 domains from the domains answer, each with:)
|
|
126
|
+
### Domain Name
|
|
127
|
+
#### Skills (8-10 skills per domain, inferred from the answers)
|
|
128
|
+
#### Values (3-4 values per domain, drawn from the non-negotiables + mission)
|
|
129
|
+
|
|
130
|
+
## Overlap Effects
|
|
131
|
+
(from the overlaps answer, formatted as: Domain A + Domain B = Emergent State)
|
|
132
|
+
|
|
133
|
+
## Center Identity
|
|
134
|
+
(from the center answer)
|
|
135
|
+
|
|
136
|
+
# Contextual Modifiers
|
|
137
|
+
|
|
138
|
+
## Authority Layers
|
|
139
|
+
(infer 4-5 authority levels appropriate to this organization)
|
|
140
|
+
|
|
141
|
+
## Spatial Contexts
|
|
142
|
+
(infer 4-5 contexts where behavior happens)
|
|
143
|
+
|
|
144
|
+
## Interpretation Rules
|
|
145
|
+
(infer 3-5 rules about how context changes meaning)
|
|
146
|
+
|
|
147
|
+
# Evolution Layer
|
|
148
|
+
|
|
149
|
+
## Aligned Behaviors
|
|
150
|
+
(from the success answer, expanded to 5-8 items)
|
|
151
|
+
|
|
152
|
+
## Drift Behaviors
|
|
153
|
+
(from the drift answer, expanded to 5-8 items)
|
|
154
|
+
|
|
155
|
+
## Signals
|
|
156
|
+
(infer 5-7 observable signals from the answers, snake_case)
|
|
157
|
+
|
|
158
|
+
## Decision Priorities
|
|
159
|
+
(from the priorities answer, formatted as: preferred > secondary)
|
|
160
|
+
|
|
161
|
+
## Evolution Conditions
|
|
162
|
+
(infer 3-5 conditions for when the model should adapt)
|
|
163
|
+
|
|
164
|
+
HERE ARE THE ANSWERS:
|
|
165
|
+
|
|
166
|
+
Name: ${answers.name}
|
|
167
|
+
|
|
168
|
+
Mission: ${answers.mission}
|
|
169
|
+
|
|
170
|
+
Domains: ${answers.domains}
|
|
171
|
+
|
|
172
|
+
Overlaps: ${answers.overlaps}
|
|
173
|
+
|
|
174
|
+
Center identity: ${answers.center}
|
|
175
|
+
|
|
176
|
+
Non-negotiables: ${answers.nonnegotiables}
|
|
177
|
+
|
|
178
|
+
Success looks like: ${answers.success}
|
|
179
|
+
|
|
180
|
+
Drift looks like: ${answers.drift}
|
|
181
|
+
|
|
182
|
+
Priorities: ${answers.priorities}
|
|
183
|
+
|
|
184
|
+
Output ONLY the .worldmodel.md content. No explanation. No commentary. Just the file.`;
|
|
185
|
+
}
|
|
186
|
+
function saveWorldmodel(content, outputPath) {
|
|
187
|
+
const resolved = resolve(outputPath);
|
|
188
|
+
writeFileSync(resolved, content, "utf-8");
|
|
189
|
+
return resolved;
|
|
190
|
+
}
|
|
191
|
+
export {
|
|
192
|
+
askQuestions,
|
|
193
|
+
saveWorldmodel,
|
|
194
|
+
structureWorldmodel
|
|
195
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neuroverseos/governance",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Deterministic governance engine for AI agents — enforce worlds (permanent rules) and plans (mission constraints) with full audit trace",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|