@neuroverseos/governance 0.2.3 → 0.3.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/package.json +4 -2
- package/policies/content-moderation-rules.txt +8 -0
- package/policies/marketing-rules.txt +8 -0
- package/policies/science-research-rules.txt +11 -0
- package/policies/social-media-rules.txt +7 -0
- package/policies/strict-rules.txt +8 -0
- package/policies/trading-rules.txt +8 -0
- package/simulate.html +1899 -0
- package/dist/adapters/autoresearch.cjs +0 -196
- package/dist/adapters/autoresearch.d.cts +0 -103
- package/dist/adapters/autoresearch.d.ts +0 -103
- package/dist/adapters/autoresearch.js +0 -7
- package/dist/adapters/deep-agents.cjs +0 -1472
- package/dist/adapters/deep-agents.d.cts +0 -181
- package/dist/adapters/deep-agents.d.ts +0 -181
- package/dist/adapters/deep-agents.js +0 -17
- package/dist/adapters/express.cjs +0 -1196
- package/dist/adapters/express.d.cts +0 -66
- package/dist/adapters/express.d.ts +0 -66
- package/dist/adapters/express.js +0 -12
- package/dist/adapters/index.cjs +0 -2038
- package/dist/adapters/index.d.cts +0 -8
- package/dist/adapters/index.d.ts +0 -8
- package/dist/adapters/index.js +0 -68
- package/dist/adapters/langchain.cjs +0 -1259
- package/dist/adapters/langchain.d.cts +0 -89
- package/dist/adapters/langchain.d.ts +0 -89
- package/dist/adapters/langchain.js +0 -17
- package/dist/adapters/openai.cjs +0 -1289
- package/dist/adapters/openai.d.cts +0 -99
- package/dist/adapters/openai.d.ts +0 -99
- package/dist/adapters/openai.js +0 -17
- package/dist/adapters/openclaw.cjs +0 -1281
- package/dist/adapters/openclaw.d.cts +0 -99
- package/dist/adapters/openclaw.d.ts +0 -99
- package/dist/adapters/openclaw.js +0 -17
- package/dist/bootstrap-GXVDZNF7.js +0 -114
- package/dist/build-X5MZY4IA.js +0 -339
- package/dist/chunk-4L6OPKMQ.js +0 -100
- package/dist/chunk-4NGDRRQH.js +0 -10
- package/dist/chunk-5U2MQO5P.js +0 -57
- package/dist/chunk-6BB55YJI.js +0 -113
- package/dist/chunk-6CZSKEY5.js +0 -164
- package/dist/chunk-7P3S7MAY.js +0 -1090
- package/dist/chunk-A5W4GNQO.js +0 -130
- package/dist/chunk-AF2VX4AL.js +0 -363
- package/dist/chunk-AKW5YVCE.js +0 -96
- package/dist/chunk-BMOXICAB.js +0 -340
- package/dist/chunk-BQZMOEML.js +0 -43
- package/dist/chunk-D2UCV5AK.js +0 -326
- package/dist/chunk-EVDJUSZ2.js +0 -91
- package/dist/chunk-FYS2CBUW.js +0 -304
- package/dist/chunk-I3RRAYK2.js +0 -11
- package/dist/chunk-IZSO75NZ.js +0 -792
- package/dist/chunk-JCKSW2PZ.js +0 -304
- package/dist/chunk-JZPQGIKR.js +0 -79
- package/dist/chunk-KTFTTLTP.js +0 -246
- package/dist/chunk-MH7BT4VH.js +0 -15
- package/dist/chunk-ORJ3NOE6.js +0 -622
- package/dist/chunk-OT6PXH54.js +0 -61
- package/dist/chunk-Q6O7ZLO2.js +0 -62
- package/dist/chunk-QLPTHTVB.js +0 -253
- package/dist/chunk-REXY4LUL.js +0 -226
- package/dist/chunk-T5EUJQE5.js +0 -172
- package/dist/chunk-TTBKTF3P.js +0 -608
- package/dist/chunk-XPDMYECO.js +0 -642
- package/dist/chunk-YZFATT7X.js +0 -9
- package/dist/chunk-ZIVQNSZU.js +0 -119
- package/dist/chunk-ZJTDUCC2.js +0 -194
- package/dist/cli/neuroverse.cjs +0 -12564
- package/dist/cli/neuroverse.d.cts +0 -1
- package/dist/cli/neuroverse.d.ts +0 -1
- package/dist/cli/neuroverse.js +0 -208
- package/dist/cli/plan.cjs +0 -1686
- package/dist/cli/plan.d.cts +0 -20
- package/dist/cli/plan.d.ts +0 -20
- package/dist/cli/plan.js +0 -353
- package/dist/cli/run.cjs +0 -1945
- package/dist/cli/run.d.cts +0 -20
- package/dist/cli/run.d.ts +0 -20
- package/dist/cli/run.js +0 -143
- package/dist/configure-ai-TK67ZWZL.js +0 -132
- package/dist/decision-flow-LETV5NWY.js +0 -61
- package/dist/derive-7365SUFU.js +0 -152
- package/dist/doctor-QYISMKEL.js +0 -173
- package/dist/equity-penalties-63FGB3I2.js +0 -244
- package/dist/explain-A2EWI2OL.js +0 -51
- package/dist/guard-3BWL3IGH.js +0 -92
- package/dist/guard-contract-C9_zKbzd.d.cts +0 -821
- package/dist/guard-contract-C9_zKbzd.d.ts +0 -821
- package/dist/guard-engine-QFMIBWJY.js +0 -10
- package/dist/impact-UB6DXKSX.js +0 -59
- package/dist/improve-XZA57GER.js +0 -66
- package/dist/index.cjs +0 -6821
- package/dist/index.d.cts +0 -1829
- package/dist/index.d.ts +0 -1829
- package/dist/index.js +0 -430
- package/dist/infer-world-7GVZWFX4.js +0 -543
- package/dist/init-PKPIYHYE.js +0 -144
- package/dist/init-world-VWMQZQC7.js +0 -223
- package/dist/mcp-server-XWQZXNW7.js +0 -13
- package/dist/model-adapter-BB7G4MFI.js +0 -11
- package/dist/playground-ADWZORNV.js +0 -550
- package/dist/redteam-JRQ7FD2F.js +0 -357
- package/dist/session-MMYX5YCF.js +0 -15
- package/dist/shared--Q8wPBVN.d.ts +0 -60
- package/dist/shared-HpAG90PX.d.cts +0 -60
- package/dist/shared-U2QFV7JH.js +0 -16
- package/dist/simulate-GMIFFXYV.js +0 -83
- package/dist/test-JBBZ65X4.js +0 -217
- package/dist/trace-3MYWIDEF.js +0 -166
- package/dist/validate-LLBWVPGV.js +0 -81
- package/dist/validate-engine-UIABSIHD.js +0 -7
- package/dist/world-BFJCIQSH.js +0 -378
- package/dist/world-loader-HMPTOEA2.js +0 -9
- package/dist/worlds/autoresearch.nv-world.md +0 -230
- package/dist/worlds/coding-agent.nv-world.md +0 -211
- package/dist/worlds/derivation-world.nv-world.md +0 -278
|
@@ -1,223 +0,0 @@
|
|
|
1
|
-
import "./chunk-YZFATT7X.js";
|
|
2
|
-
|
|
3
|
-
// src/cli/init-world.ts
|
|
4
|
-
import { readFileSync, existsSync } from "fs";
|
|
5
|
-
import { writeFile } from "fs/promises";
|
|
6
|
-
import { dirname, join } from "path";
|
|
7
|
-
import { fileURLToPath } from "url";
|
|
8
|
-
function parseArgs(argv) {
|
|
9
|
-
const template = argv[0] || "";
|
|
10
|
-
let outputPath = "";
|
|
11
|
-
const config = {};
|
|
12
|
-
for (let i = 1; i < argv.length; i++) {
|
|
13
|
-
const arg = argv[i];
|
|
14
|
-
if (arg === "--context" && i + 1 < argv.length) {
|
|
15
|
-
config.context = argv[++i];
|
|
16
|
-
} else if (arg === "--dataset" && i + 1 < argv.length) {
|
|
17
|
-
config.dataset = argv[++i];
|
|
18
|
-
} else if (arg === "--goal" && i + 1 < argv.length) {
|
|
19
|
-
config.goal = argv[++i];
|
|
20
|
-
} else if (arg === "--metric" && i + 1 < argv.length) {
|
|
21
|
-
config.metric = argv[++i];
|
|
22
|
-
} else if (arg === "--optimize" && i + 1 < argv.length) {
|
|
23
|
-
const dir = argv[++i];
|
|
24
|
-
if (dir === "minimize" || dir === "maximize") {
|
|
25
|
-
config.optimize = dir;
|
|
26
|
-
}
|
|
27
|
-
} else if (arg === "--compute" && i + 1 < argv.length) {
|
|
28
|
-
config.computeBudgetMinutes = parseInt(argv[++i], 10);
|
|
29
|
-
} else if (arg === "--output" && i + 1 < argv.length) {
|
|
30
|
-
outputPath = argv[++i];
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return { template, config, outputPath };
|
|
34
|
-
}
|
|
35
|
-
var AVAILABLE_TEMPLATES = ["autoresearch"];
|
|
36
|
-
function loadBaseTemplate(template) {
|
|
37
|
-
let currentDir;
|
|
38
|
-
try {
|
|
39
|
-
currentDir = dirname(fileURLToPath(import.meta.url));
|
|
40
|
-
} catch {
|
|
41
|
-
currentDir = __dirname;
|
|
42
|
-
}
|
|
43
|
-
const candidates = [
|
|
44
|
-
join(currentDir, "..", "worlds", `${template}.nv-world.md`),
|
|
45
|
-
join(currentDir, "worlds", `${template}.nv-world.md`),
|
|
46
|
-
// Fallback: resolve from process.cwd()
|
|
47
|
-
join(process.cwd(), "src", "worlds", `${template}.nv-world.md`)
|
|
48
|
-
];
|
|
49
|
-
for (const candidate of candidates) {
|
|
50
|
-
if (existsSync(candidate)) {
|
|
51
|
-
return readFileSync(candidate, "utf-8");
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
throw new Error(`Template "${template}" not found. Available: ${AVAILABLE_TEMPLATES.join(", ")}`);
|
|
55
|
-
}
|
|
56
|
-
function customizeAutoresearchWorld(baseTemplate, config) {
|
|
57
|
-
let output = baseTemplate;
|
|
58
|
-
if (config.context) {
|
|
59
|
-
const worldId = config.context.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_|_$/g, "").slice(0, 40);
|
|
60
|
-
output = output.replace(/^world_id: autoresearch$/m, `world_id: ${worldId}_research`);
|
|
61
|
-
output = output.replace(/^name: Autoresearch Governance$/m, `name: ${config.context} Research`);
|
|
62
|
-
}
|
|
63
|
-
if (config.context) {
|
|
64
|
-
const customThesis = `Autonomous AI research loops investigating ${config.context} must operate within structured governance: experiments are reproducible, metrics are tracked, compute budgets are enforced, and agents cannot drift beyond their declared research context. A research world without constraints produces noise, not knowledge.`;
|
|
65
|
-
output = output.replace(
|
|
66
|
-
/^Autonomous AI research loops must operate.*$/m,
|
|
67
|
-
customThesis
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
if (config.dataset) {
|
|
71
|
-
output = output.replace(
|
|
72
|
-
/- `dataset_must_be_declared`[^\n]+/,
|
|
73
|
-
`- \`dataset_must_be_declared\` \u2014 The dataset "${config.dataset}" must be used for training and evaluation and never changed without governance approval (structural, immutable)`
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
if (config.context && config.constraints && config.constraints.length > 0) {
|
|
77
|
-
const constraintInvariants = config.constraints.map(
|
|
78
|
-
(c, i) => `- \`custom_constraint_${i + 1}\` \u2014 ${c} (prompt, immutable)`
|
|
79
|
-
).join("\n");
|
|
80
|
-
output = output.replace(
|
|
81
|
-
/- `architecture_constraints_honored`[^\n]+/,
|
|
82
|
-
`- \`architecture_constraints_honored\` \u2014 If the research context declares architectural constraints, experiments must satisfy them (prompt, immutable)
|
|
83
|
-
${constraintInvariants}`
|
|
84
|
-
);
|
|
85
|
-
}
|
|
86
|
-
if (config.metric) {
|
|
87
|
-
output = output.replace(
|
|
88
|
-
/Best value achieved for the primary evaluation metric/g,
|
|
89
|
-
`Best value achieved for ${config.metric}`
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
if (config.computeBudgetMinutes) {
|
|
93
|
-
output = output.replace(
|
|
94
|
-
/- default: 1440\n- label: Compute Budget/,
|
|
95
|
-
`- default: ${config.computeBudgetMinutes}
|
|
96
|
-
- label: Compute Budget`
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
if (config.optimize === "maximize") {
|
|
100
|
-
output = output.replace(
|
|
101
|
-
/- default: 100\n- label: Best Metric Value/,
|
|
102
|
-
"- default: -1000\n- label: Best Metric Value"
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
return output;
|
|
106
|
-
}
|
|
107
|
-
function generateResearchContext(config) {
|
|
108
|
-
const context = {
|
|
109
|
-
research: {
|
|
110
|
-
context: config.context || "Define your research context",
|
|
111
|
-
dataset: config.dataset || "Define your dataset",
|
|
112
|
-
goal: config.goal || "Define your optimization goal",
|
|
113
|
-
metric: {
|
|
114
|
-
name: config.metric || "val_bpb",
|
|
115
|
-
optimization: config.optimize || "minimize"
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
roles: config.roles || [
|
|
119
|
-
"hypothesis_generator",
|
|
120
|
-
"experiment_runner",
|
|
121
|
-
"result_evaluator",
|
|
122
|
-
"critic"
|
|
123
|
-
],
|
|
124
|
-
experiment_loop: {
|
|
125
|
-
generate_architecture: true,
|
|
126
|
-
train_model: true,
|
|
127
|
-
evaluate_results: true,
|
|
128
|
-
iterate: true
|
|
129
|
-
},
|
|
130
|
-
state: {
|
|
131
|
-
experiments_run: 0,
|
|
132
|
-
best_result: null,
|
|
133
|
-
architectures_tested: []
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
return JSON.stringify(context, null, 2);
|
|
137
|
-
}
|
|
138
|
-
async function main(argv = process.argv.slice(2)) {
|
|
139
|
-
try {
|
|
140
|
-
const args = parseArgs(argv);
|
|
141
|
-
if (!args.template) {
|
|
142
|
-
process.stderr.write("Usage: neuroverse init-world <template> [options]\n\n");
|
|
143
|
-
process.stderr.write("Available templates:\n");
|
|
144
|
-
for (const t of AVAILABLE_TEMPLATES) {
|
|
145
|
-
process.stderr.write(` ${t} Generate a governed research world for autonomous AI experiments
|
|
146
|
-
`);
|
|
147
|
-
}
|
|
148
|
-
process.stderr.write("\nExample:\n");
|
|
149
|
-
process.stderr.write(' neuroverse init-world autoresearch --context "attention-free LLM architectures" --dataset "TinyStories"\n');
|
|
150
|
-
process.exit(1);
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
if (!AVAILABLE_TEMPLATES.includes(args.template)) {
|
|
154
|
-
process.stderr.write(`Unknown template: "${args.template}"
|
|
155
|
-
`);
|
|
156
|
-
process.stderr.write(`Available: ${AVAILABLE_TEMPLATES.join(", ")}
|
|
157
|
-
`);
|
|
158
|
-
process.exit(1);
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
const worldFileName = args.config.context ? args.config.context.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "").slice(0, 40) + ".nv-world.md" : "research.nv-world.md";
|
|
162
|
-
const outputPath = args.outputPath || `./${worldFileName}`;
|
|
163
|
-
if (existsSync(outputPath)) {
|
|
164
|
-
process.stderr.write(`File already exists: ${outputPath}
|
|
165
|
-
`);
|
|
166
|
-
process.stderr.write("Use --output to specify a different path.\n");
|
|
167
|
-
process.exit(2);
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
const baseTemplate = loadBaseTemplate(args.template);
|
|
171
|
-
const customized = customizeAutoresearchWorld(baseTemplate, args.config);
|
|
172
|
-
await writeFile(outputPath, customized, "utf-8");
|
|
173
|
-
const contextPath = outputPath.replace(/\.nv-world\.md$/, ".research.json");
|
|
174
|
-
await writeFile(contextPath, generateResearchContext(args.config), "utf-8");
|
|
175
|
-
const result = {
|
|
176
|
-
created: {
|
|
177
|
-
world: outputPath,
|
|
178
|
-
context: contextPath
|
|
179
|
-
},
|
|
180
|
-
template: args.template,
|
|
181
|
-
config: {
|
|
182
|
-
context: args.config.context || null,
|
|
183
|
-
dataset: args.config.dataset || null,
|
|
184
|
-
goal: args.config.goal || null,
|
|
185
|
-
metric: args.config.metric || "val_bpb",
|
|
186
|
-
optimize: args.config.optimize || "minimize",
|
|
187
|
-
computeBudgetMinutes: args.config.computeBudgetMinutes || 1440
|
|
188
|
-
},
|
|
189
|
-
nextSteps: [
|
|
190
|
-
`Edit ${outputPath} to refine governance rules for your research`,
|
|
191
|
-
`neuroverse bootstrap --input ${outputPath} --output ./world/ --validate`,
|
|
192
|
-
`neuroverse simulate ${outputPath} --steps 5`,
|
|
193
|
-
`neuroverse guard --world ./world/ < experiment.json`,
|
|
194
|
-
`npx autoresearch run --world ${contextPath}`
|
|
195
|
-
]
|
|
196
|
-
};
|
|
197
|
-
process.stdout.write(JSON.stringify(result, null, 2) + "\n");
|
|
198
|
-
process.stderr.write("\n");
|
|
199
|
-
process.stderr.write(`\u2713 World created: ${outputPath}
|
|
200
|
-
`);
|
|
201
|
-
process.stderr.write(`\u2713 Research context: ${contextPath}
|
|
202
|
-
`);
|
|
203
|
-
process.stderr.write("\n");
|
|
204
|
-
process.stderr.write("Next steps:\n");
|
|
205
|
-
process.stderr.write(` Compile world neuroverse bootstrap --input ${outputPath} --output ./world/ --validate
|
|
206
|
-
`);
|
|
207
|
-
process.stderr.write(` Simulate neuroverse simulate ${outputPath} --steps 5
|
|
208
|
-
`);
|
|
209
|
-
process.stderr.write(` Run autoresearch npx autoresearch run --world ${contextPath}
|
|
210
|
-
`);
|
|
211
|
-
process.stderr.write(` Launch dashboard make dashboard
|
|
212
|
-
`);
|
|
213
|
-
process.stderr.write("\n");
|
|
214
|
-
process.exit(0);
|
|
215
|
-
} catch (e) {
|
|
216
|
-
process.stderr.write(`init-world failed: ${e instanceof Error ? e.message : e}
|
|
217
|
-
`);
|
|
218
|
-
process.exit(3);
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
export {
|
|
222
|
-
main
|
|
223
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
McpGovernanceServer,
|
|
3
|
-
startMcpServer
|
|
4
|
-
} from "./chunk-TTBKTF3P.js";
|
|
5
|
-
import "./chunk-AKW5YVCE.js";
|
|
6
|
-
import "./chunk-IZSO75NZ.js";
|
|
7
|
-
import "./chunk-QLPTHTVB.js";
|
|
8
|
-
import "./chunk-JZPQGIKR.js";
|
|
9
|
-
import "./chunk-YZFATT7X.js";
|
|
10
|
-
export {
|
|
11
|
-
McpGovernanceServer,
|
|
12
|
-
startMcpServer
|
|
13
|
-
};
|