@ouro.bot/cli 0.1.0-alpha.1483 → 0.1.0-alpha.1484

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/changelog.json CHANGED
@@ -1,13 +1,25 @@
1
1
  {
2
2
  "_note": "Each pull request writes its own change note under changes/; the release job on main gives each landed change its version and adds the notes here (scripts/release-version.cjs). On main this file stops at the last version set by hand; the published package has every release. Agents read this file directly via read_file to understand what changed between versions.",
3
3
  "versions": [
4
+ {
5
+ "version": "0.1.0-alpha.1484",
6
+ "changes": [
7
+ "Blind interviews: product U's arms and kit. The guest builds one of three U arms (`ouro`, `shadcn`, `mui`). Each arm is the same project template with only the component kit under `@kit/ui` changing, and has the five registered tools: `read_file`, `write_file`, `list_files`, `run_checks` and `finish`. `finish` ends the job's turn. Once the conversation ends, the arm grades the run with the image's grader, which lives outside the project.",
8
+ "The host's `U_KIT` runs the registered `remove-copy-card` job with the user message word for word. It passes a run only when all of these hold: the type-check passes, axe finds no violations, and the hidden test's three checks pass. It records U's fidelity notes. The image itself (templates, tools, hidden test) comes in a later change."
9
+ ]
10
+ },
4
11
  {
5
12
  "version": "0.1.0-alpha.1483",
6
13
  "changes": [
7
- "A blind-interview session now reserves 45 calls before it starts, up from 44. The extra call covers the one nudge the choice question may get, so a session can never use more than it reserved. This follows the pilot amendment of 2026-11-23.",
8
14
  "Update the Ouro UI files to Ouro UI v1.3.492."
9
15
  ]
10
16
  },
17
+ {
18
+ "version": "0.1.0-alpha.1482",
19
+ "changes": [
20
+ "A blind-interview session now reserves 45 calls before it starts, up from 44. The extra call covers the one nudge the choice question may get, so a session can never use more than it reserved. This follows the pilot amendment of 2026-11-23."
21
+ ]
22
+ },
11
23
  {
12
24
  "version": "0.1.0-alpha.1481",
13
25
  "changes": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1483",
2
+ "runtimeVersion": "0.1.0-alpha.1484",
3
3
  "bundleSchemaVersion": 3,
4
4
  "lastUpdated": "2026-09-03T00:00:00.000Z"
5
5
  }
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0"?>
2
2
  <Container version="2">
3
3
  <Name>ouro-butler</Name>
4
- <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1483</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1484</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -25,6 +25,7 @@ const host_lock_1 = require("./sandbox/host-lock");
25
25
  const remote_1 = require("./sandbox/remote");
26
26
  const targets_1 = require("./targets");
27
27
  const runner_1 = require("./interviews/runner");
28
+ const kit_1 = require("./interviews/u/kit");
28
29
  const REPO = node_path_1.default.resolve(__dirname, "../..");
29
30
  function take(argv, flag) {
30
31
  const at = argv.indexOf(flag);
@@ -147,7 +148,7 @@ async function interviews(args, deps) {
147
148
  loadCases: self_test_1.loadCases,
148
149
  resolveTarget: (spec, creds) => (0, targets_1.resolveTarget)(spec, creds),
149
150
  runCase: deps.runCase,
150
- kits: { X: runner_1.X_KIT },
151
+ kits: { X: runner_1.X_KIT, U: kit_1.U_KIT },
151
152
  outputExists: (file) => node_fs_1.default.existsSync(file),
152
153
  writeReport: report_1.writePrivateReport,
153
154
  openLog: openPrivateLog,
@@ -22,6 +22,7 @@ const provider_proxy_1 = require("../../transport/provider-proxy");
22
22
  const arms_1 = require("./arms");
23
23
  const books_core_1 = require("./books-core");
24
24
  const loop_1 = require("./loop");
25
+ const arms_2 = require("./u/arms");
25
26
  /** The persona's files, in the order the system prompt puts them. */
26
27
  exports.PERSONA_FILES = ["IDENTITY.md", "SOUL.md", "LORE.md", "ASPIRATIONS.md", "TACIT.md"];
27
28
  /** The household's names, the same in every arm: the eval's synthetic owner, and the Butler's own name. */
@@ -41,6 +42,7 @@ function readTurnFile(file) {
41
42
  /** Each product's arm builder in the guest; a product without one is refused. */
42
43
  exports.ARM_BUILDERS = {
43
44
  X: (arm, context) => (0, arms_1.buildArm)(arm, context.core ?? (0, books_core_1.booksCore)({ home: node_path_1.default.join(context.bundle, "books") })),
45
+ U: (arm) => (0, arms_2.buildUArm)(arm),
44
46
  };
45
47
  async function runInterviewGuest(input) {
46
48
  (0, runtime_1.emitNervesEvent)({ component: "eval", event: "eval.interview_guest_start", message: "interview guest starting a conversation", meta: {} });
@@ -0,0 +1,266 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.U_TOOLS = exports.execNode = exports.CHECK_TIMEOUT_MS = exports.READ_LIMIT = exports.COMPONENT = exports.U_PATHS = exports.KIT_SLOTS = exports.U_ARMS = void 0;
7
+ exports.makeProject = makeProject;
8
+ exports.resolveInProject = resolveInProject;
9
+ exports.checksText = checksText;
10
+ exports.buildUArm = buildUArm;
11
+ /**
12
+ * The three U arms (pre-registration section 2): the same project and the same five tools in every arm, with only the
13
+ * component kit installed under `@kit/ui` changing. The image (deploy/eval/u) holds one project template per kit,
14
+ * each under a neutral folder name, with the kit and its dependencies brand-rewritten in `node_modules`, and the
15
+ * checking tools apart from all of them. At the start of a conversation the template's files are copied to the
16
+ * project folder and its `node_modules` is linked in, so every path the model sees is the same in every arm.
17
+ *
18
+ * Tools (section 4): `read_file`, `write_file` and `list_files` work inside the project only (reading may follow the
19
+ * `node_modules` link into the template's packages; nothing can be written into any `node_modules`, or through a
20
+ * link out of the project); `run_checks` runs the type-check and an axe scan of the rendered component; `finish`
21
+ * ends the job. The grade, once the conversation has ended, runs the same checks and the hidden test.
22
+ *
23
+ * The trust boundary: the checking tools run as the guest's user, from a folder the file tools refuse. The type-check
24
+ * never runs the model's code. The axe scan and the hidden test bundle the component for the browser and run it in
25
+ * jsdom in a separate process under Node's permission model, which can read neither the tools' own files nor any
26
+ * project and can write nothing; its result counts only when signed with a key the page never sees
27
+ * (deploy/eval/u/tools).
28
+ */
29
+ const node_child_process_1 = require("node:child_process");
30
+ const node_fs_1 = __importDefault(require("node:fs"));
31
+ const node_path_1 = __importDefault(require("node:path"));
32
+ const runtime_1 = require("../../../../nerves/runtime");
33
+ exports.U_ARMS = ["ouro", "shadcn", "mui"];
34
+ /** Each arm's template folder name in the image: neutral, so no path names a kit. */
35
+ exports.KIT_SLOTS = { ouro: "k1", shadcn: "k2", mui: "k3" };
36
+ exports.U_PATHS = { kits: "/opt/u-kits", tools: "/opt/u-tools", project: "/tmp/work" };
37
+ /** The component the job asks for, as the checks and the hidden test read it. */
38
+ exports.COMPONENT = "src/RemoveCopy.tsx";
39
+ /** The longest answer one file read gives, in characters; a longer file is cut with a note saying where to read on. */
40
+ exports.READ_LIMIT = 60_000;
41
+ /** How long one check run may take. */
42
+ exports.CHECK_TIMEOUT_MS = 120_000;
43
+ /** Runs a file with its arguments, never through a shell; a run that could not start answers code 1 with why. */
44
+ const execNode = (file, args, options) => new Promise((resolve) => {
45
+ (0, node_child_process_1.execFile)(file, args, { cwd: options.cwd, timeout: options.timeoutMs, maxBuffer: 16 * 1024 * 1024, encoding: "utf8" }, (error, stdout, stderr) => {
46
+ const code = error ? (typeof error.code === "number" ? error.code : 1) : 0;
47
+ resolve({ code, stdout, stderr: error && !stderr ? error.message : stderr });
48
+ });
49
+ });
50
+ exports.execNode = execNode;
51
+ exports.U_TOOLS = [
52
+ {
53
+ name: "read_file",
54
+ description: `Read a text file in the project. The path is relative to the project folder, for example src/RemoveCopy.tsx or node_modules/@kit/ui/package.json. Gives at most ${exports.READ_LIMIT} characters; give offset to read on.`,
55
+ parameters: {
56
+ type: "object",
57
+ properties: {
58
+ path: { type: "string", description: "The file's path, relative to the project folder." },
59
+ offset: { type: "integer", description: "The character to start from; leave it out to start at the beginning." },
60
+ },
61
+ required: ["path"],
62
+ },
63
+ },
64
+ {
65
+ name: "write_file",
66
+ description: "Write a text file in the project, replacing it if it exists and making its folders. The path is relative to the project folder; nothing in node_modules can be written.",
67
+ parameters: { type: "object", properties: { path: { type: "string", description: "The file's path, relative to the project folder." }, content: { type: "string", description: "The whole new content of the file." } }, required: ["path", "content"] },
68
+ },
69
+ {
70
+ name: "list_files",
71
+ description: "List one folder in the project: its files, and its folders with a trailing /. The path is relative to the project folder; leave it out for the project folder itself.",
72
+ parameters: { type: "object", properties: { path: { type: "string", description: "The folder's path, relative to the project folder." } } },
73
+ },
74
+ {
75
+ name: "run_checks",
76
+ description: `Run the project's checks: a TypeScript type-check of the project, then an accessibility scan (axe) of ${exports.COMPONENT} rendered with a test onRemove. Returns what each found.`,
77
+ parameters: { type: "object", properties: {} },
78
+ },
79
+ {
80
+ name: "finish",
81
+ description: "Finish the job. Call it once the component is written and the checks have been run, with a short summary for the user.",
82
+ parameters: { type: "object", properties: { summary: { type: "string", description: "A short summary for the user of what was built." } }, required: ["summary"] },
83
+ },
84
+ ];
85
+ const parse = (args) => {
86
+ try {
87
+ const value = JSON.parse(args || "{}");
88
+ return value && typeof value === "object" && !Array.isArray(value) ? value : null;
89
+ }
90
+ catch {
91
+ return null;
92
+ }
93
+ };
94
+ const fail = (text) => ({ text, isError: true });
95
+ /**
96
+ * Copies the arm's template into the project, all but `node_modules`, which is linked. Each conversation runs in a
97
+ * fresh container, so the project folder is new; one that already holds anything is refused, never cleared.
98
+ */
99
+ function makeProject(slot, paths) {
100
+ const template = node_path_1.default.join(paths.kits, slot);
101
+ if (!node_fs_1.default.existsSync(template))
102
+ throw new Error(`no project template ${slot} in the image`);
103
+ if (node_fs_1.default.existsSync(paths.project) && node_fs_1.default.readdirSync(paths.project).length > 0)
104
+ throw new Error("the project folder is not empty");
105
+ node_fs_1.default.mkdirSync(paths.project, { recursive: true });
106
+ for (const name of node_fs_1.default.readdirSync(template)) {
107
+ if (name === "node_modules")
108
+ node_fs_1.default.symlinkSync(node_path_1.default.join(template, "node_modules"), node_path_1.default.join(paths.project, "node_modules"));
109
+ else
110
+ node_fs_1.default.cpSync(node_path_1.default.join(template, name), node_path_1.default.join(paths.project, name), { recursive: true, verbatimSymlinks: true });
111
+ }
112
+ }
113
+ const within = (real, root) => real === root || real.startsWith(`${root}${node_path_1.default.sep}`);
114
+ const present = (full) => {
115
+ try {
116
+ node_fs_1.default.lstatSync(full);
117
+ return true;
118
+ }
119
+ catch {
120
+ return false;
121
+ }
122
+ };
123
+ /** The deepest part of `full` that is there (a broken link counts), with links followed; null when a link is broken. */
124
+ function realExisting(full) {
125
+ let at = full;
126
+ while (!present(at))
127
+ at = node_path_1.default.dirname(at);
128
+ try {
129
+ return node_fs_1.default.realpathSync(at);
130
+ }
131
+ catch {
132
+ return null;
133
+ }
134
+ }
135
+ /**
136
+ * A model-given path inside the project, or why it is refused. The path must stay inside the project as written.
137
+ * A read, after links are followed, must stay inside the project or the template's `node_modules`. A write may not
138
+ * name any `node_modules` folder, may not replace a link, and its deepest existing folder must be inside the project
139
+ * once links are followed.
140
+ */
141
+ function resolveInProject(paths, slot, given, mode) {
142
+ if (typeof given !== "string" || given.trim() === "")
143
+ return { refused: "path must be a non-empty string, relative to the project folder" };
144
+ const full = node_path_1.default.resolve(paths.project, given);
145
+ const shown = node_path_1.default.relative(paths.project, full);
146
+ if (shown === ".." || shown.startsWith(`..${node_path_1.default.sep}`) || node_path_1.default.isAbsolute(shown))
147
+ return { refused: `${given} is outside the project folder` };
148
+ const project = node_fs_1.default.realpathSync(paths.project);
149
+ if (mode === "write") {
150
+ if (shown.split(node_path_1.default.sep).includes("node_modules"))
151
+ return { refused: "nothing in node_modules can be written" };
152
+ if (present(full) && node_fs_1.default.lstatSync(full).isSymbolicLink())
153
+ return { refused: `${shown} is a link, which can't be written` };
154
+ const real = realExisting(full);
155
+ if (real === null || !within(real, project))
156
+ return { refused: `${given} is outside the project folder` };
157
+ }
158
+ else if (node_fs_1.default.existsSync(full)) {
159
+ const real = node_fs_1.default.realpathSync(full);
160
+ if (!within(real, project) && !within(real, node_fs_1.default.realpathSync(node_path_1.default.join(paths.kits, slot, "node_modules"))))
161
+ return { refused: `${given} is outside the project folder` };
162
+ }
163
+ return { full, shown: shown === "" ? "." : shown };
164
+ }
165
+ /** run_checks' JSON (deploy/eval/u/tools/check.mjs) as text for the model. */
166
+ function checksText(result) {
167
+ let parsed;
168
+ try {
169
+ parsed = JSON.parse(result.stdout);
170
+ }
171
+ catch {
172
+ return `The checks could not run: ${(result.stderr || result.stdout).trim().slice(0, 4000)}`;
173
+ }
174
+ const part = (name, entry) => {
175
+ if (!entry)
176
+ return `${name}: not run`;
177
+ const output = typeof entry.output === "string" ? entry.output.trim() : "";
178
+ return `${name}: ${entry.ok === true ? "passed" : "failed"}${output ? `\n${output}` : ""}`;
179
+ };
180
+ return [part("Type-check", parsed.typecheck), part("Accessibility scan (axe)", parsed.axe)].join("\n\n");
181
+ }
182
+ function isFolder(full) {
183
+ try {
184
+ return node_fs_1.default.statSync(full).isDirectory();
185
+ }
186
+ catch {
187
+ return false;
188
+ }
189
+ }
190
+ function buildUArm(arm, options = {}) {
191
+ if (!exports.U_ARMS.includes(arm))
192
+ throw new Error(`no U arm ${arm}`);
193
+ const paths = options.paths ?? exports.U_PATHS;
194
+ const exec = options.exec ?? exports.execNode;
195
+ const slot = exports.KIT_SLOTS[arm];
196
+ makeProject(slot, paths);
197
+ (0, runtime_1.emitNervesEvent)({ component: "eval", event: "eval.u_arm_ready", message: "made the U project for an arm", meta: { slot } });
198
+ const tool = (script) => exec(process.execPath, [node_path_1.default.join(paths.tools, script), paths.project], { cwd: paths.tools, timeoutMs: exports.CHECK_TIMEOUT_MS });
199
+ const call = async (name, args) => {
200
+ const input = parse(args);
201
+ if (!input)
202
+ return fail("arguments must be a JSON object");
203
+ if (name === "read_file") {
204
+ const at = resolveInProject(paths, slot, input.path, "read");
205
+ if ("refused" in at)
206
+ return fail(at.refused);
207
+ const offset = input.offset ?? 0;
208
+ if (typeof offset !== "number" || !Number.isInteger(offset) || offset < 0)
209
+ return fail("offset must be a whole number, 0 or more");
210
+ if (!node_fs_1.default.existsSync(at.full))
211
+ return fail(`no file ${at.shown}`);
212
+ if (isFolder(at.full))
213
+ return fail(`${at.shown} is a folder; use list_files`);
214
+ const text = node_fs_1.default.readFileSync(at.full, "utf8");
215
+ const end = offset + exports.READ_LIMIT;
216
+ const part = text.slice(offset, end);
217
+ return { text: end < text.length ? `${part}\n[characters ${offset} to ${end} of ${text.length}; read on with offset ${end}]` : part, isError: false };
218
+ }
219
+ if (name === "write_file") {
220
+ const at = resolveInProject(paths, slot, input.path, "write");
221
+ if ("refused" in at)
222
+ return fail(at.refused);
223
+ if (typeof input.content !== "string")
224
+ return fail("content must be a string");
225
+ if (isFolder(at.full))
226
+ return fail(`${at.shown} is a folder`);
227
+ node_fs_1.default.mkdirSync(node_path_1.default.dirname(at.full), { recursive: true });
228
+ node_fs_1.default.writeFileSync(at.full, input.content);
229
+ return { text: `Wrote ${at.shown} (${Buffer.byteLength(input.content)} bytes).`, isError: false };
230
+ }
231
+ if (name === "list_files") {
232
+ const at = resolveInProject(paths, slot, input.path ?? ".", "read");
233
+ if ("refused" in at)
234
+ return fail(at.refused);
235
+ if (!isFolder(at.full))
236
+ return fail(`no folder ${at.shown}`);
237
+ const entries = node_fs_1.default.readdirSync(at.full, { withFileTypes: true })
238
+ .map((entry) => entry.isDirectory() || (entry.isSymbolicLink() && isFolder(node_path_1.default.join(at.full, entry.name))) ? `${entry.name}/` : entry.name)
239
+ .sort();
240
+ return { text: entries.length > 0 ? entries.join("\n") : "(empty)", isError: false };
241
+ }
242
+ if (name === "run_checks")
243
+ return { text: checksText(await tool("check.mjs")), isError: false };
244
+ if (name === "finish") {
245
+ if (typeof input.summary !== "string" || input.summary.trim() === "")
246
+ return fail("summary must be a non-empty string");
247
+ return { text: input.summary, isError: false, ends: true };
248
+ }
249
+ return fail(`no tool ${name}`);
250
+ };
251
+ return {
252
+ key: arm,
253
+ tools: exports.U_TOOLS,
254
+ call,
255
+ operationOf: () => null,
256
+ grade: async () => {
257
+ const result = await tool("grade.mjs");
258
+ try {
259
+ return JSON.parse(result.stdout);
260
+ }
261
+ catch {
262
+ return { error: `the grader gave no result (exit ${result.code}): ${(result.stderr || result.stdout).trim().slice(0, 2000)}` };
263
+ }
264
+ },
265
+ };
266
+ }
@@ -14,6 +14,7 @@ const allocation_1 = require("./allocation");
14
14
  const final_1 = require("./final");
15
15
  const arms_1 = require("./guest/arms");
16
16
  const loop_1 = require("./guest/loop");
17
+ const arms_2 = require("./guest/u/arms");
17
18
  const operations_1 = require("./guest/operations");
18
19
  const latch_1 = require("./latch");
19
20
  const protocol_1 = require("./protocol");
@@ -298,8 +299,8 @@ async function runInterviews(args, deps) {
298
299
  (0, runtime_1.emitNervesEvent)({ component: "eval", event: "eval.interview_run_end", message: "finished blind-interview sessions", meta: { sessions: records.length, stopped } });
299
300
  return { exitCode: stopped ? 2 : 0, records };
300
301
  }
301
- /** Every X arm, for the parser's check. */
302
- exports.KNOWN_ARMS = { H: [], U: [], X: arms_1.X_ARMS };
302
+ /** Every X and U arm, for the parser's check. */
303
+ exports.KNOWN_ARMS = { H: [], U: arms_2.U_ARMS, X: arms_1.X_ARMS };
303
304
  const STRING_FLAGS = { "--preregistration": "preregistration", "--cases": "cases", "--target": "target", "--credentials-agent": "credentialsAgent", "--output": "output", "--request-log": "requestLog", "--harness-ref": "harnessRef", "--copilot-account": "copilotAccount" };
304
305
  const NUMBER_FLAGS = { "--budget-premium": "budgetPremium", "--budget-credits": "budgetCredits", "--price-in": "priceIn", "--price-out": "priceOut", "--reserve-credits-per-call": "reserveCreditsPerCall", "--premium-multiplier": "premiumMultiplier" };
305
306
  const REQUIRED = ["--preregistration", "--cases", "--target", "--credentials-agent", "--budget-premium", "--output"];
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.U_KIT = exports.U_FIDELITY = exports.U_CASE = exports.U_JOB_MESSAGE = exports.U_JOB = void 0;
4
+ exports.readGrade = readGrade;
5
+ exports.gradeU = gradeU;
6
+ /**
7
+ * Product U, Ouro UI against two other component kits (pre-registration section 2), as the runner's `ProductKit`.
8
+ * Its one job, `remove-copy-card` (section 4), is no books case: the owner's message is the job, word for word, and
9
+ * the run is graded in the container (`guest/u/arms.ts`) by the type-check, an axe scan with no violations and the
10
+ * hidden test, which this kit reads back into a verdict. The household still runs beside the agent container, as in
11
+ * every sandboxed run, but no U tool reaches it.
12
+ */
13
+ const runtime_1 = require("../../../nerves/runtime");
14
+ const protocol_1 = require("../protocol");
15
+ exports.U_JOB = "remove-copy-card";
16
+ /** The job's user message, word for word from section 4. */
17
+ exports.U_JOB_MESSAGE = "Build the screen where I confirm removing a bad copy of a book from my library. It shows the two copies of The Harbour Almanac: 187, which is unreadable, and 189, the good one. Removing 187 must ask me to confirm first, then tell me it's done. Write it as a React component in src/RemoveCopy.tsx with the default export RemoveCopy({ onRemove }), using the component kit in @kit/ui, and run the checks before you finish.";
18
+ /** The job as the sandbox runs it: the persona's bundle paths, the owner's message and an empty household. */
19
+ exports.U_CASE = {
20
+ schemaVersion: 1,
21
+ id: exports.U_JOB,
22
+ actionIds: [],
23
+ bundle: { include: ["agent.json", "psyche", "skills", "books"] },
24
+ prefix: [{ role: "user", content: exports.U_JOB_MESSAGE }],
25
+ seed: { library: [], libgen: [], labels: [], deleteAllowed: false, disk: [] },
26
+ assertions: [{ name: "u.grade" }],
27
+ fixtures: { pass: emptyObservation(), fail: { "no-grade": emptyObservation() } },
28
+ };
29
+ function emptyObservation() {
30
+ return { timeline: [], finalReply: "", library: [], mail: [], created: [], outcome: "settled", steps: 0, oracle: {} };
31
+ }
32
+ const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
33
+ /** The grade, or why it isn't one. */
34
+ function readGrade(value) {
35
+ if (!isRecord(value))
36
+ return { error: "the guest reported no grade" };
37
+ if (typeof value.error === "string")
38
+ return { error: value.error };
39
+ const { typecheck, axe, hidden } = value;
40
+ if (!isRecord(typecheck) || typeof typecheck.ok !== "boolean" || typeof typecheck.output !== "string"
41
+ || !isRecord(axe) || typeof axe.ok !== "boolean" || typeof axe.violations !== "number" || typeof axe.output !== "string"
42
+ || !isRecord(hidden) || typeof hidden.firstPressHeld !== "boolean" || typeof hidden.confirmedOnce187 !== "boolean" || typeof hidden.statusSaysDone !== "boolean" || typeof hidden.detail !== "string") {
43
+ return { error: "the guest's grade is malformed" };
44
+ }
45
+ return value;
46
+ }
47
+ /** Section 4's pass rule: the type-check passes, axe finds no violations, and the hidden test's three checks hold. */
48
+ function gradeU(run) {
49
+ const grade = readGrade(run.grade);
50
+ if ("error" in grade)
51
+ return { passed: false, reason: `grade: ${grade.error}`, checks: [{ name: "u.grade", ok: false, detail: grade.error }] };
52
+ const detail = grade.hidden.detail;
53
+ const checks = [
54
+ { name: "u.typecheck", ok: grade.typecheck.ok, detail: grade.typecheck.ok ? "no type errors" : "type errors" },
55
+ { name: "u.axe", ok: grade.axe.ok && grade.axe.violations === 0, detail: `${grade.axe.violations} violations` },
56
+ { name: "u.hidden.firstPressHeld", ok: grade.hidden.firstPressHeld, detail },
57
+ { name: "u.hidden.confirmedOnce187", ok: grade.hidden.confirmedOnce187, detail },
58
+ { name: "u.hidden.statusSaysDone", ok: grade.hidden.statusSaysDone, detail },
59
+ ];
60
+ const failed = checks.filter((check) => !check.ok).map((check) => check.name);
61
+ (0, runtime_1.emitNervesEvent)({ component: "eval", event: "eval.u_graded", message: "graded a U run", meta: { failed: failed.length } });
62
+ return { passed: failed.length === 0, reason: failed.length === 0 ? null : `failed ${failed.join(", ")}`, checks };
63
+ }
64
+ /** What is recorded about each U arm before any session (section 3): where it differs from the kit it stands for. */
65
+ exports.U_FIDELITY = {
66
+ "U:all": [
67
+ "every arm is the same project template with the kit installed under @kit/ui, and the same five tools; a tool's path is relative to the project, reads may follow node_modules into the kit's packages, and writes never reach node_modules; read_file gives at most 60,000 characters a call, with an offset to read on",
68
+ "the type-check and the axe scan use the checking tools' own compiler settings and rules, not files the model can change; axe runs the WCAG 2.x A and AA rules on the first render in jsdom, where no kit's stylesheet is loaded",
69
+ "the job and its debrief run in one conversation with the arm's tools; finish ends a turn with its summary as the reply; the run is graded once the conversation has ended, so a debrief call can still change the project, as X scores its household after the debrief",
70
+ "the grade is taken in the container and the host reads it back as the guest reported it; the model's component runs only in a separate process under Node's permission model that can't read the hidden test or write files, and its result counts only with a signature made under a key the page never sees; a component written to subvert the test inside its own page could still change what the test sees, and transcripts are kept",
71
+ "the system prompt is the Butler's persona and the label line, as in every U and X arm",
72
+ ],
73
+ };
74
+ exports.U_KIT = {
75
+ guest: ({ session, arm, debrief }) => ({
76
+ entry: "interview-guest-entry.js",
77
+ turn: { product: session.product, arm: arm.arm, labelLine: (0, protocol_1.labelLine)(session.product, arm.label), prefix: [], userText: exports.U_JOB_MESSAGE, followUps: [debrief] },
78
+ }),
79
+ canonical: (_arm, obs) => obs,
80
+ job: (id) => id === exports.U_JOB ? exports.U_CASE : undefined,
81
+ grade: (run) => gradeU(run),
82
+ fidelity: exports.U_FIDELITY,
83
+ };
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1483",
3
+ "version": "0.1.0-alpha.1484",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@ouro.bot/cli",
9
- "version": "0.1.0-alpha.1483",
9
+ "version": "0.1.0-alpha.1484",
10
10
  "bundleDependencies": [
11
11
  "@ouro.bot/friends"
12
12
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1483",
3
+ "version": "0.1.0-alpha.1484",
4
4
  "description": "Ouroboros, the agent harness: agents with durable memory that live where you talk (terminal, Teams, iMessage, mail, voice) and use real tools. Start with npx ouro.bot@latest.",
5
5
  "homepage": "https://ouroboros.bot/",
6
6
  "engines": {