@neuroverseos/governance 0.8.0 → 0.9.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.
- package/AGENTS.md +8 -0
- package/README.md +180 -10
- package/dist/{chunk-MC6O5GV5.js → chunk-3ZWU7C43.js} +1056 -135
- package/dist/{chunk-VGFDMPVB.js → chunk-TCGGED4G.js} +283 -1
- package/dist/cli/neuroverse.cjs +2000 -460
- package/dist/cli/radiant.cjs +1452 -237
- package/dist/cli/radiant.js +62 -24
- package/dist/cli/worldmodel.cjs +1157 -823
- package/dist/cli/worldmodel.js +116 -1
- package/dist/{lenses-K5FVSALR.js → lenses-XDWK6ZKI.js} +5 -3
- package/dist/radiant/index.cjs +953 -130
- package/dist/radiant/index.d.cts +271 -10
- package/dist/radiant/index.d.ts +271 -10
- package/dist/radiant/index.js +41 -397
- package/dist/{server-DFNY5N5A.js → server-JKUBUK5H.js} +2 -2
- package/dist/worldmodel-create-5SWHVNMQ.js +195 -0
- package/examples/radiant-weekly-workflow.yml +81 -0
- package/package.json +2 -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
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# Weekly Radiant Read — GitHub Actions workflow template
|
|
2
|
+
#
|
|
3
|
+
# Copy this file into your org's exocortex repo at:
|
|
4
|
+
# .github/workflows/radiant-weekly.yml
|
|
5
|
+
#
|
|
6
|
+
# Every Monday at 9am UTC it:
|
|
7
|
+
# 1. Checks out this repo (the exocortex — where reads persist)
|
|
8
|
+
# 2. Runs `radiant emergent <your-org>/` against the latest 14 days of activity
|
|
9
|
+
# 3. Writes the read to radiant/reads/YYYY-MM-DD.md
|
|
10
|
+
# 4. Commits and pushes the new file
|
|
11
|
+
#
|
|
12
|
+
# Each run extends the palace history. Week over week, Radiant gains the
|
|
13
|
+
# baselines / drift detection / pattern confidence promised in the DEPTH
|
|
14
|
+
# section of the output.
|
|
15
|
+
#
|
|
16
|
+
# Required repo secrets:
|
|
17
|
+
# ANTHROPIC_API_KEY — for the MEANING/MOVE interpretation step
|
|
18
|
+
#
|
|
19
|
+
# Required repo settings:
|
|
20
|
+
# Settings → Actions → General → Workflow permissions → "Read and write"
|
|
21
|
+
# (so the job can push its own commit)
|
|
22
|
+
#
|
|
23
|
+
# Optional:
|
|
24
|
+
# Replace the hardcoded org (NeuroverseOS) with your own.
|
|
25
|
+
# Replace the lens (sovereign-conduit) with your chosen lens.
|
|
26
|
+
|
|
27
|
+
name: Weekly Radiant Read
|
|
28
|
+
|
|
29
|
+
on:
|
|
30
|
+
schedule:
|
|
31
|
+
# Monday at 09:00 UTC. Change to whatever rhythm your team uses.
|
|
32
|
+
- cron: '0 9 * * MON'
|
|
33
|
+
# Allow manual trigger from the Actions tab for testing.
|
|
34
|
+
workflow_dispatch:
|
|
35
|
+
|
|
36
|
+
permissions:
|
|
37
|
+
contents: write # needed to push the new read back into this repo
|
|
38
|
+
|
|
39
|
+
jobs:
|
|
40
|
+
read:
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
steps:
|
|
43
|
+
- name: Check out this exocortex repo
|
|
44
|
+
uses: actions/checkout@v4
|
|
45
|
+
|
|
46
|
+
- name: Set up Node
|
|
47
|
+
uses: actions/setup-node@v4
|
|
48
|
+
with:
|
|
49
|
+
node-version: '20'
|
|
50
|
+
|
|
51
|
+
- name: Install @neuroverseos/governance
|
|
52
|
+
run: npm install --no-save @neuroverseos/governance@latest
|
|
53
|
+
|
|
54
|
+
- name: Run Radiant emergent read
|
|
55
|
+
env:
|
|
56
|
+
# GITHUB_TOKEN is auto-provided by Actions and is enough to read the
|
|
57
|
+
# NeuroverseOS org's public repos. For private repo reads, replace
|
|
58
|
+
# with a fine-grained PAT stored in secrets.RADIANT_GITHUB_TOKEN.
|
|
59
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
60
|
+
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
61
|
+
# Memory Palace writes into THIS repo — since we checked it out at
|
|
62
|
+
# the workflow root, point the CLI at $GITHUB_WORKSPACE.
|
|
63
|
+
RADIANT_EXOCORTEX: ${{ github.workspace }}
|
|
64
|
+
run: |
|
|
65
|
+
npx @neuroverseos/governance@latest radiant emergent NeuroverseOS/ \
|
|
66
|
+
--lens sovereign-conduit
|
|
67
|
+
# No --worlds flag needed — discovery probes NeuroverseOS/worlds
|
|
68
|
+
# directly from the scope arg. See the governance repo for details.
|
|
69
|
+
|
|
70
|
+
- name: Commit and push the new read
|
|
71
|
+
run: |
|
|
72
|
+
git config user.name 'radiant-bot'
|
|
73
|
+
git config user.email 'radiant-bot@users.noreply.github.com'
|
|
74
|
+
# Only commit if the read actually produced a file.
|
|
75
|
+
if [[ -n "$(git status --porcelain radiant/reads/)" ]]; then
|
|
76
|
+
git add radiant/reads/
|
|
77
|
+
git commit -m "radiant: weekly read $(date -u +%Y-%m-%d)"
|
|
78
|
+
git push
|
|
79
|
+
else
|
|
80
|
+
echo "No new read file produced — nothing to commit."
|
|
81
|
+
fi
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neuroverseos/governance",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
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",
|
|
@@ -114,6 +114,7 @@
|
|
|
114
114
|
"dist/browser.global.js",
|
|
115
115
|
"policies",
|
|
116
116
|
"examples/social-media-sim",
|
|
117
|
+
"examples/radiant-weekly-workflow.yml",
|
|
117
118
|
"simulate.html",
|
|
118
119
|
"LICENSE.md",
|
|
119
120
|
"README.md",
|