@ouro.bot/cli 0.1.0-alpha.1639 → 0.1.0-alpha.1640

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,24 @@
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.1640",
6
+ "changes": [
7
+ "Blind interview runs no longer show the model the seed bundle's provider names. In an interview's sandboxed bundle, each `agent.json` lane names `github-copilot` with model `model`, `providerFallback` is left out, and `provider-readiness.json` lists no providers; every report lists both rewrites as gaps. The host's runtime still serves the model, so nothing changes about which model answers. Before any container starts, the sandbox also scans every text file of an interview's bundle for vendor and model words (`VENDOR_PATTERN`) and refuses the run, naming each file and its count of hits, when it finds any. The Telegram-turn replay eval's bundle is unchanged."
8
+ ]
9
+ },
4
10
  {
5
11
  "version": "0.1.0-alpha.1639",
6
12
  "changes": [
7
- "A call to `sanctuary_host_execute` with missing or malformed arguments is now refused with `invalid-arguments`, naming each field to fix, before the root host authority is asked. Before, the call was answered with a bare `root-host-denied`, so the agent couldn't tell its call was malformed. Authorization still runs before any other check and before anything runs, and well-formed calls take the same path as before.",
8
13
  "The 28 tool and command cards that gave the reading agent a rule (\"never\", \"always\", \"do not\") now say what the door does instead, such as \"Returns metadata only, not passwords\". The Ouro AX census now finds no weak or undeclared door in the harness, and its baseline is empty."
9
14
  ]
10
15
  },
16
+ {
17
+ "version": "0.1.0-alpha.1638",
18
+ "changes": [
19
+ "A call to `sanctuary_host_execute` with missing or malformed arguments is now refused with `invalid-arguments`, naming each field to fix, before the root host authority is asked. Before, the call was answered with a bare `root-host-denied`, so the agent couldn't tell its call was malformed. Authorization still runs before any other check and before anything runs, and well-formed calls take the same path as before."
20
+ ]
21
+ },
11
22
  {
12
23
  "version": "0.1.0-alpha.1637",
13
24
  "changes": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1639",
2
+ "runtimeVersion": "0.1.0-alpha.1640",
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.1639</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1640</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ID_FIELDS = exports.OPAQUE_FIELDS = exports.BRAND_PATTERN = exports.CHOOSE_NUDGE = exports.IDENTIFY_QUESTION = exports.FINAL_SYSTEM_PROMPT = exports.LABELS = exports.NEUTRAL_WORD = exports.NOUN = exports.ARMS = void 0;
3
+ exports.ID_FIELDS = exports.OPAQUE_FIELDS = exports.VENDOR_PATTERN = exports.BRAND_PATTERN = exports.CHOOSE_NUDGE = exports.IDENTIFY_QUESTION = exports.FINAL_SYSTEM_PROMPT = exports.LABELS = exports.NEUTRAL_WORD = exports.NOUN = exports.ARMS = void 0;
4
4
  exports.labelLine = labelLine;
5
5
  exports.debriefQuestion = debriefQuestion;
6
6
  exports.choiceQuestion = choiceQuestion;
@@ -65,6 +65,13 @@ function ratingOf(answer) {
65
65
  }
66
66
  /** Section 3's case-insensitive pattern of brand and model words. */
67
67
  exports.BRAND_PATTERN = "ouro|ouroboros|codex|openhands|open hands|all-hands|openai|anthropic|claude|gpt|minimax|shadcn|radix|base ui|material[ -]?ui|\\bmui\\b|mendelow|ourostack";
68
+ /**
69
+ * The case-insensitive pattern of vendor and model words an interview's projected bundle must not hold. No arm's
70
+ * replacement list rewrites these words, so a session that sends one is voided (or names a vendor to the model). The
71
+ * brand words an arm legitimately carries, such as ouro and the harness's own name in paths, are not in it. The
72
+ * sandbox scans every text file of an interview's projected bundle for these before any container starts.
73
+ */
74
+ exports.VENDOR_PATTERN = "openai|anthropic|claude|gpt|minimax|gemini|grok|\\bmai-code";
68
75
  const brandRegex = () => new RegExp(exports.BRAND_PATTERN, "gi");
69
76
  /** Every brand word in `text`, in order; empty when there is none. */
70
77
  function brandHits(text) {
@@ -35,7 +35,11 @@ exports.runSandboxed = runSandboxed;
35
35
  *
36
36
  * It refuses to run on a host that has any of the live Butler's containers unless the caller holds a host lock
37
37
  * that the Butler's lifecycle honours: on 2026-11-23 an eval container vanishing mid-upgrade broke the Butler's
38
- * upgrade and its rollback on the host they shared (#1760).
38
+ * upgrade and its rollback on the host they shared (#1760). It checks once the bundle is projected, before it starts
39
+ * any container.
40
+ *
41
+ * An interview run's bundle (one with a `guest`) names no vendor: its provider fields are made neutral, and a vendor
42
+ * or model word left in any of its text files refuses the run before anything reaches Docker (`neutral-bundle.ts`).
39
43
  */
40
44
  const node_child_process_1 = require("node:child_process");
41
45
  const node_crypto_1 = __importDefault(require("node:crypto"));
@@ -46,6 +50,7 @@ const runtime_1 = require("../../nerves/runtime");
46
50
  const provider_proxy_1 = require("../transport/provider-proxy");
47
51
  const telegram_turn_1 = require("../transport/telegram-turn");
48
52
  const declared_gaps_1 = require("./declared-gaps");
53
+ const neutral_bundle_1 = require("./neutral-bundle");
49
54
  const images_1 = require("./images");
50
55
  const agent_profile_1 = require("./agent-profile");
51
56
  const readback_1 = require("./readback");
@@ -235,11 +240,6 @@ async function runSandboxed(input) {
235
240
  const last = input.case.prefix.at(-1);
236
241
  if (last?.role !== "user")
237
242
  throw new Error(`case ${input.case.id}: the prefix must end with the owner's message`);
238
- // Docker matches the filter against the name with its leading slash; any container it lists makes this the Butler's host.
239
- const butler = (await docker.run(["ps", "--all", "--filter", `name=${exports.BUTLER_CONTAINERS}`, "--format", "{{.Names}}"])).trim();
240
- if (butler !== "" && !(await input.hostLock?.held())) {
241
- throw new Error(`refusing to run the eval sandbox on this host: it runs the live Butler (${butler.split("\n").join(", ")}), and no host lock that the Butler's upgrade and rollback honour is held`);
242
- }
243
243
  (0, runtime_1.emitNervesEvent)({ component: "eval", event: "eval.sandbox_run_start", message: "starting a sandboxed eval run", meta: { caseId: input.case.id, runId } });
244
244
  const work = node_fs_1.default.mkdtempSync(node_path_1.default.join(input.workRoot ?? node_os_1.default.tmpdir(), exports.EVAL_RUN_PREFIX));
245
245
  node_fs_1.default.chmodSync(work, 0o700);
@@ -264,6 +264,16 @@ async function runSandboxed(input) {
264
264
  try {
265
265
  // Every case is a books case, so the bundle source must make `books/` and each writable path, as the projection does.
266
266
  const { gaps } = profile.bundleSource({ include: input.case.bundle.include, out: bundle });
267
+ // An interview's bundle names no vendor: its provider fields are neutral, and any vendor word left refuses the run.
268
+ if (input.guest) {
269
+ gaps.push(...(0, neutral_bundle_1.neutralProviders)(bundle));
270
+ (0, neutral_bundle_1.checkVendorWords)(bundle);
271
+ }
272
+ // Docker matches the filter against the name with its leading slash; any container it lists makes this the Butler's host.
273
+ const butler = (await docker.run(["ps", "--all", "--filter", `name=${exports.BUTLER_CONTAINERS}`, "--format", "{{.Names}}"])).trim();
274
+ if (butler !== "" && !(await input.hostLock?.held())) {
275
+ throw new Error(`refusing to run the eval sandbox on this host: it runs the live Butler (${butler.split("\n").join(", ")}), and no host lock that the Butler's upgrade and rollback honour is held`);
276
+ }
267
277
  node_fs_1.default.writeFileSync(node_path_1.default.join(bundle, "books/credentials.json"), `${JSON.stringify(booksSettings(), null, 1)}\n`);
268
278
  for (const dir of [fixtures, tls, household])
269
279
  node_fs_1.default.mkdirSync(dir);
@@ -0,0 +1,117 @@
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.VENDOR_SCAN_MAX_BYTES = exports.NEUTRAL_LANE = void 0;
7
+ exports.neutralProviders = neutralProviders;
8
+ exports.checkVendorWords = checkVendorWords;
9
+ /**
10
+ * What an interview run's projected bundle is made to say about providers, and the check that it names no vendor.
11
+ *
12
+ * In the sandbox the model is always the host's, served over the container's stdin and stdout, so the bundle's
13
+ * provider fields pick nothing there. The seed's still name vendors and models (`agent.json`'s lanes and
14
+ * `providerFallback`, `provider-readiness.json`'s list), and an arm that reads one sends it to the host, whose brand
15
+ * scan voids the request (version 2, an H arm). So for an interview run each lane names one neutral provider and
16
+ * model, the fallback list goes, and the readiness list is empty. `github-copilot` is a provider `agent.json` accepts
17
+ * (`heart/identity.ts`), and the turn never builds it: the injected runtime replaces the lane's provider.
18
+ *
19
+ * Then every regular text file of the projected bundle is scanned for `VENDOR_PATTERN`, and a hit refuses the run
20
+ * before any container starts.
21
+ */
22
+ const node_fs_1 = __importDefault(require("node:fs"));
23
+ const node_path_1 = __importDefault(require("node:path"));
24
+ const runtime_1 = require("../../nerves/runtime");
25
+ const protocol_1 = require("../interviews/protocol");
26
+ /** The provider and model each lane of an interview's `agent.json` names. */
27
+ exports.NEUTRAL_LANE = { provider: "github-copilot", model: "model" };
28
+ /** A text file larger than this is not scanned, and refuses the run. */
29
+ exports.VENDOR_SCAN_MAX_BYTES = 8 * 1024 * 1024;
30
+ /** How much of a file is read to tell a binary (a NUL byte in it) from text. */
31
+ const SNIFF_BYTES = 8000;
32
+ const LANES = ["humanFacing", "agentFacing"];
33
+ function readObject(file) {
34
+ let value;
35
+ try {
36
+ value = JSON.parse(node_fs_1.default.readFileSync(file, "utf8"));
37
+ }
38
+ catch {
39
+ return undefined;
40
+ }
41
+ return value !== null && typeof value === "object" && !Array.isArray(value) ? value : undefined;
42
+ }
43
+ const writeJson = (file, value) => node_fs_1.default.writeFileSync(file, `${JSON.stringify(value, null, 2)}\n`);
44
+ /** Rewrites the bundle's provider fields to the neutral ones and returns a gap for each file it changed. */
45
+ function neutralProviders(bundle) {
46
+ const gaps = [];
47
+ const agentFile = node_path_1.default.join(bundle, "agent.json");
48
+ const agent = readObject(agentFile);
49
+ if (agent) {
50
+ let changed = "providerFallback" in agent;
51
+ delete agent.providerFallback;
52
+ for (const lane of LANES) {
53
+ const value = agent[lane];
54
+ if (value === null || typeof value !== "object" || !("provider" in value))
55
+ continue;
56
+ agent[lane] = { ...value, ...exports.NEUTRAL_LANE };
57
+ changed = true;
58
+ }
59
+ if (changed) {
60
+ writeJson(agentFile, agent);
61
+ gaps.push(`agent.json: each provider lane names ${exports.NEUTRAL_LANE.provider} and model "${exports.NEUTRAL_LANE.model}", and providerFallback is left out; the host's runtime serves the model in the sandbox`);
62
+ }
63
+ }
64
+ const readinessFile = node_path_1.default.join(bundle, "provider-readiness.json");
65
+ const readiness = readObject(readinessFile);
66
+ if (readiness && Array.isArray(readiness.providers) && readiness.providers.length > 0) {
67
+ writeJson(readinessFile, { ...readiness, providers: [] });
68
+ gaps.push("provider-readiness.json: its providers list is empty; the host's runtime serves the model in the sandbox");
69
+ }
70
+ (0, runtime_1.emitNervesEvent)({ component: "eval", event: "eval.sandbox_neutral_providers", message: "named neutral providers in an interview's bundle", meta: { rewritten: gaps.length } });
71
+ return gaps;
72
+ }
73
+ /** Every regular file under `root`, relative to it, sorted; symbolic links are left out. */
74
+ function regularFiles(root, relative = "") {
75
+ const found = [];
76
+ for (const entry of node_fs_1.default.readdirSync(node_path_1.default.join(root, relative), { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
77
+ const child = relative ? `${relative}/${entry.name}` : entry.name;
78
+ if (entry.isDirectory())
79
+ found.push(...regularFiles(root, child));
80
+ else if (entry.isFile())
81
+ found.push(child);
82
+ }
83
+ return found;
84
+ }
85
+ /** Throws, naming each file and its count of vendor words (never the text around them), when the bundle has any. */
86
+ function checkVendorWords(bundle) {
87
+ const pattern = new RegExp(protocol_1.VENDOR_PATTERN, "gi");
88
+ const found = [];
89
+ let hits = 0;
90
+ for (const file of regularFiles(bundle)) {
91
+ const full = node_path_1.default.join(bundle, file);
92
+ const head = Buffer.alloc(SNIFF_BYTES);
93
+ const fd = node_fs_1.default.openSync(full, "r");
94
+ let read;
95
+ try {
96
+ read = node_fs_1.default.readSync(fd, head, 0, SNIFF_BYTES, 0);
97
+ }
98
+ finally {
99
+ node_fs_1.default.closeSync(fd);
100
+ }
101
+ if (head.subarray(0, read).includes(0))
102
+ continue;
103
+ if (node_fs_1.default.statSync(full).size > exports.VENDOR_SCAN_MAX_BYTES) {
104
+ found.push(`${file} (too large to scan)`);
105
+ continue;
106
+ }
107
+ const count = [...node_fs_1.default.readFileSync(full, "utf8").matchAll(pattern)].length;
108
+ if (count === 0)
109
+ continue;
110
+ found.push(`${file} (${count})`);
111
+ hits += count;
112
+ }
113
+ if (found.length === 0)
114
+ return;
115
+ (0, runtime_1.emitNervesEvent)({ component: "eval", level: "error", event: "eval.sandbox_vendor_words", message: "refused an interview bundle that names a vendor", meta: { files: found.length, hits } });
116
+ throw new Error(`the interview's projected bundle names vendor or model words, which would void its sessions; no container was started: ${found.join(", ")}`);
117
+ }
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1639",
3
+ "version": "0.1.0-alpha.1640",
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.1639",
9
+ "version": "0.1.0-alpha.1640",
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.1639",
3
+ "version": "0.1.0-alpha.1640",
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": {