@ouro.bot/cli 0.1.0-alpha.1451 → 0.1.0-alpha.1452
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,6 +1,12 @@
|
|
|
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.1452",
|
|
6
|
+
"changes": [
|
|
7
|
+
"The interviews command takes `--host-lock <holder>`, as the eval's run command does. It holds the remote Docker host's lock for the whole command and sends its token with every job, so a Butler upgrade on that host waits for the interviews. The interviews wait up to 30 minutes for an upgrade in progress, then refuse. The lock lasts at most 6 hours. On the Butler's host, where the sandbox checks the lock, a job that finds it gone stops the study before it marks another session started, so only that one session is lost. The command refuses `--host-lock` without a holder, with a holder that isn't one safe word, or without `--sandbox-ssh`."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
4
10
|
{
|
|
5
11
|
"version": "0.1.0-alpha.1451",
|
|
6
12
|
"changes": [
|
|
@@ -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.
|
|
4
|
+
<Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1452</Repository>
|
|
5
5
|
<Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
|
|
6
6
|
<Network>host</Network>
|
|
7
7
|
<Shell>sh</Shell>
|
|
@@ -8,15 +8,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
8
8
|
* from the pre-registration's Appendix B on one model target, writes the private report and the private request log
|
|
9
9
|
* (both opened `wx`, mode 0600, under a 0700 folder) and prints a counts-only summary. With `--sandbox-ssh
|
|
10
10
|
* <host>:<folder>` the sandbox runs on that Docker host, whose harness checkout is synced to `<folder>/harness`;
|
|
11
|
-
* `--bundle` and `--seed-bundle` are then paths on that host.
|
|
11
|
+
* `--bundle` and `--seed-bundle` are then paths on that host. `--host-lock <holder>` holds that host's lock
|
|
12
|
+
* (deploy/unraid/ouro-host-lock.mjs) for the whole command, as `run-entry` does, so the Butler's upgrade and rollback
|
|
13
|
+
* wait for it and the sandbox runs on the Butler's host only while it does. Model calls and credentials stay on this
|
|
14
|
+
* machine.
|
|
12
15
|
*/
|
|
13
16
|
const node_fs_1 = __importDefault(require("node:fs"));
|
|
14
17
|
const node_os_1 = __importDefault(require("node:os"));
|
|
15
18
|
const node_path_1 = __importDefault(require("node:path"));
|
|
16
19
|
const runtime_1 = require("../nerves/runtime");
|
|
20
|
+
const loop_1 = require("./interviews/guest/loop");
|
|
17
21
|
const self_test_1 = require("./self-test");
|
|
18
22
|
const report_1 = require("./report");
|
|
19
23
|
const docker_1 = require("./sandbox/docker");
|
|
24
|
+
const host_lock_1 = require("./sandbox/host-lock");
|
|
20
25
|
const remote_1 = require("./sandbox/remote");
|
|
21
26
|
const targets_1 = require("./targets");
|
|
22
27
|
const runner_1 = require("./interviews/runner");
|
|
@@ -27,16 +32,22 @@ function take(argv, flag) {
|
|
|
27
32
|
return { value: undefined, rest: argv };
|
|
28
33
|
return { value: argv[at + 1], rest: [...argv.slice(0, at), ...argv.slice(at + 2)] };
|
|
29
34
|
}
|
|
30
|
-
function
|
|
35
|
+
function sshTarget(spec) {
|
|
36
|
+
const split = spec.indexOf(":");
|
|
37
|
+
if (split < 1)
|
|
38
|
+
throw new Error("--sandbox-ssh must be <host>:<folder>");
|
|
39
|
+
return { host: spec.slice(0, split), root: spec.slice(split + 1) };
|
|
40
|
+
}
|
|
41
|
+
function runCaseFor(sandboxSsh, bundle, seedBundle, images, hostLockToken) {
|
|
31
42
|
if (sandboxSsh) {
|
|
32
|
-
const
|
|
33
|
-
if (split < 1)
|
|
34
|
-
throw new Error("--sandbox-ssh must be <host>:<folder>");
|
|
35
|
-
const host = sandboxSsh.slice(0, split);
|
|
36
|
-
const root = sandboxSsh.slice(split + 1);
|
|
43
|
+
const { host, root } = sshTarget(sandboxSsh);
|
|
37
44
|
return (0, remote_1.remoteRunCase)({
|
|
38
45
|
start: (0, remote_1.sshStart)(host, `${root}/harness/dist/eval/remote-entry.js`),
|
|
39
|
-
paths: {
|
|
46
|
+
paths: {
|
|
47
|
+
bundleDir: bundle, seedBundleDir: seedBundle ?? `${root}/harness/deploy/unraid/sanctuary.ouro`, workRoot: `${root}/work`,
|
|
48
|
+
...(images ? { images } : {}),
|
|
49
|
+
...(hostLockToken ? { hostLockToken } : {}),
|
|
50
|
+
},
|
|
40
51
|
});
|
|
41
52
|
}
|
|
42
53
|
const docker = (0, docker_1.dockerCli)();
|
|
@@ -71,23 +82,75 @@ async function main() {
|
|
|
71
82
|
const seed = take(bundle.rest, "--seed-bundle");
|
|
72
83
|
// `--images <agent>,<household>`: image tags of this run's own, so a run never uses images another checkout built.
|
|
73
84
|
const tags = take(seed.rest, "--images");
|
|
85
|
+
const hostLock = take(tags.rest, "--host-lock");
|
|
74
86
|
if (!bundle.value)
|
|
75
87
|
throw new Error("--bundle is required");
|
|
88
|
+
if (hostLock.rest.length !== tags.rest.length) {
|
|
89
|
+
if (!hostLock.value || hostLock.value.startsWith("--"))
|
|
90
|
+
throw new Error("--host-lock needs a holder, such as eval:<your run>");
|
|
91
|
+
// The holder goes to the host through ssh's remote shell, as in `run-command`.
|
|
92
|
+
if (!/^[\w.:@+-]+$/.test(hostLock.value))
|
|
93
|
+
throw new Error("--host-lock takes one word of letters, digits and . : @ + - _ (it is sent over ssh)");
|
|
94
|
+
if (!ssh.value)
|
|
95
|
+
throw new Error("--host-lock needs --sandbox-ssh");
|
|
96
|
+
}
|
|
76
97
|
const [agent, household] = tags.value?.split(",") ?? [];
|
|
77
98
|
if (tags.value && !(agent && household))
|
|
78
99
|
throw new Error("--images must be <agent image>,<household image>");
|
|
79
100
|
const images = agent && household ? { agent, household } : undefined;
|
|
80
|
-
const args = (0, runner_1.parseInterviewArgs)(
|
|
101
|
+
const args = (0, runner_1.parseInterviewArgs)(hostLock.rest);
|
|
102
|
+
let lock;
|
|
103
|
+
if (hostLock.value && ssh.value) {
|
|
104
|
+
const { host, root } = sshTarget(ssh.value);
|
|
105
|
+
lock = await (0, host_lock_1.holdHostLock)((0, remote_1.sshNode)(host, [`${root}/harness/deploy/unraid/ouro-host-lock.mjs`, "hold", "--holder", hostLock.value, "--ttl", String(host_lock_1.HOST_LOCK_TTL_S), "--wait", String(host_lock_1.HOST_LOCK_WAIT_S)]));
|
|
106
|
+
}
|
|
107
|
+
try {
|
|
108
|
+
return await interviews(args, lock ? stopWhenLockLost(runCaseFor(ssh.value, bundle.value, seed.value, images, lock.token)) : { runCase: runCaseFor(ssh.value, bundle.value, seed.value, images, undefined), started: startedSessions() });
|
|
109
|
+
}
|
|
110
|
+
finally {
|
|
111
|
+
await lock?.release();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* A study under a host lock stops once a job finds the lock gone (its ssh session dropped, or its 6 hours ran out):
|
|
116
|
+
* the next session is refused before it is marked started, so it can still run under a new lock. Only the session
|
|
117
|
+
* whose job found the lock gone is lost, as a crash.
|
|
118
|
+
*/
|
|
119
|
+
function stopWhenLockLost(runCase) {
|
|
120
|
+
let lost = false;
|
|
121
|
+
const started = startedSessions();
|
|
122
|
+
return {
|
|
123
|
+
runCase: async (input) => {
|
|
124
|
+
try {
|
|
125
|
+
return await runCase(input);
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
if (/no host lock/.test((0, loop_1.messageOf)(error)))
|
|
129
|
+
lost = true;
|
|
130
|
+
throw error;
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
started: {
|
|
134
|
+
has: (id) => started.has(id),
|
|
135
|
+
add: (id) => {
|
|
136
|
+
if (lost)
|
|
137
|
+
throw new Error(`the host lock was lost, so session ${id} was not started; name it and the later sessions with --session to run them under a new lock`);
|
|
138
|
+
started.add(id);
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
async function interviews(args, deps) {
|
|
81
144
|
const { exitCode } = await (0, runner_1.runInterviews)(args, {
|
|
82
145
|
readText: (file) => node_fs_1.default.readFileSync(file, "utf8"),
|
|
83
146
|
loadCases: self_test_1.loadCases,
|
|
84
147
|
resolveTarget: (spec, creds) => (0, targets_1.resolveTarget)(spec, creds),
|
|
85
|
-
runCase:
|
|
148
|
+
runCase: deps.runCase,
|
|
86
149
|
kits: { X: runner_1.X_KIT },
|
|
87
150
|
outputExists: (file) => node_fs_1.default.existsSync(file),
|
|
88
151
|
writeReport: report_1.writePrivateReport,
|
|
89
152
|
openLog: openPrivateLog,
|
|
90
|
-
started:
|
|
153
|
+
started: deps.started,
|
|
91
154
|
print: (text) => { process.stdout.write(`${text}\n`); },
|
|
92
155
|
});
|
|
93
156
|
return exitCode;
|
|
@@ -153,7 +153,7 @@ exports.ENTRY_POINT_COMMANDS = [
|
|
|
153
153
|
] } },
|
|
154
154
|
{ name: "node dist/eval/interview-entry.js", effect: "private", summary: "Run blind-interview sessions on a model.", ax: { id: "cli:node dist/eval/interview-entry.js", group: "diagnostics", effect: "consequential", confirm: "It spends model credits or premium requests on the account the flags name, up to the caps you pass, and a session it starts can never run again.", when: "Run the pre-registered blind-interview sessions on one model, writing a private report and request log; each session reserves its worst case first.", errors: [
|
|
155
155
|
{ code: "budget-stopped", means: "The study stopped: a session's reservation would pass a cap, or the provider answered 402 or 429. Later sessions are recorded as not run.", fix: "Read the counts on stdout; the study stays stopped, since a session that didn't run counts as ouro not chosen first." },
|
|
156
|
-
{ code: "eval-error", means: "The interviews refused to start (a bad flag, sandbox or target, or a session not allowed or already started) or failed after starting.", fix: "Read the `interviews:` line on stderr;
|
|
156
|
+
{ code: "eval-error", means: "The interviews refused to start (a bad flag, sandbox or target, a host lock already held by another holder or lost mid-run, or a session not allowed or already started) or failed after starting.", fix: "Read the `interviews:` line on stderr; sessions it began are in the started file and can't run again, so name the others with --session." },
|
|
157
157
|
] } },
|
|
158
158
|
{ name: "node dist/senses/shepherd/judge-evaluation-entry.js", effect: "private", summary: "Evaluate Shepherd's judge on its cases.", ax: { id: "cli:node dist/senses/shepherd/judge-evaluation-entry.js", group: "diagnostics", effect: "write", when: "Measure how Shepherd's judge classifies its evaluation cases, writing a report; it never qualifies v1 on its own.", errors: [
|
|
159
159
|
{ code: "not-passed", means: "The Shepherd judge evaluation finished, but its classification didn't pass or closing its report threw.", fix: "Read the JSON summary on stdout and the report for the failing cases." },
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ouro.bot/cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.1452",
|
|
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.
|
|
9
|
+
"version": "0.1.0-alpha.1452",
|
|
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.
|
|
3
|
+
"version": "0.1.0-alpha.1452",
|
|
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": {
|