@ouro.bot/cli 0.1.0-alpha.1618 → 0.1.0-alpha.1620

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,14 +1,27 @@
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.1620",
6
+ "changes": [
7
+ "The Butler's behaviour (its Telegram sense, owner escalation, house-care and media tools, health habit, acceptance markers and download-credit text) now turns on for an agent named `butler` as well as `sanctuary`. This is the first step of the rename: an install runs the same whichever name its bundle has.",
8
+ "The Butler's saved records and messages from the host (the Usenet event spool, its replay record, the Telegram failsafe and the scheduler's cron proof) are now accepted under the name `butler` as well as `sanctuary`, so the Butler keeps working through the rename from `sanctuary.ouro` to `butler.ouro`. Records written before the rename still say `sanctuary` and are read as before.",
9
+ "The blind interviews now know pre-registration version 3 (seed 20261126, registered 2026-11-26), which runs only the reduced design. Under version 3, a call that gets a 429 is sent again after 15 s, 45 s and 120 s before the study stops, and the runner waits 60 s between sessions. Each session's record, report and summary line count its rate-limit retries. Versions 1 and 2 behave as before: the first 429 stops the study. A 402 still stops every version at once."
10
+ ]
11
+ },
4
12
  {
5
13
  "version": "0.1.0-alpha.1618",
6
14
  "changes": [
7
- "Blind interviews, product U: every arm's sandbox container now has 4 GB of memory instead of 2 GB. Grading a component built on the shadcn kit peaks at about 2 GB, so at 2 GB it thrashed until the turn's time limit and the arm ended ungraded. A guest can now name its own container memory (`memory`, such as `4g`); the household and helper containers keep 2 GB.",
8
15
  "An ask on its way to a person (through `surface`, `send_message`, Teams or iMessage) now reaches them only when it names something only their body can do: approve a number or prompt on their own phone (2FA, GitHub Mobile, a passkey), pay with their card, or make an irreversible call that is theirs. An ask to run a command, press a key at a prompt, paste a code from their mail, sign in on a particular machine, accept terms or change a setting by hand goes back to the sender with \"do it yourself; you have standing authority\". A \"you need to sign in to gh\" ask is checked with `gh auth status` first and dropped when gh is already signed in. Sign-in, password and verification-code asks are no longer treated as theirs.",
9
16
  "The auth and mail docs no longer tell agents to hand browser logins, dashboards, API tokens, HEY export or DNS to the person: those are the agent's, with its vault and browser."
10
17
  ]
11
18
  },
19
+ {
20
+ "version": "0.1.0-alpha.1617",
21
+ "changes": [
22
+ "Blind interviews, product U: every arm's sandbox container now has 4 GB of memory instead of 2 GB. Grading a component built on the shadcn kit peaks at about 2 GB, so at 2 GB it thrashed until the turn's time limit and the arm ended ungraded. A guest can now name its own container memory (`memory`, such as `4g`); the household and helper containers keep 2 GB."
23
+ ]
24
+ },
12
25
  {
13
26
  "version": "0.1.0-alpha.1616",
14
27
  "changes": [
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1618",
2
+ "runtimeVersion": "0.1.0-alpha.1620",
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.1618</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1620</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -39,6 +39,7 @@ exports.sendOwnerNoticeViaTelegram = sendOwnerNoticeViaTelegram;
39
39
  const fs = __importStar(require("node:fs"));
40
40
  const path = __importStar(require("node:path"));
41
41
  const runtime_1 = require("../nerves/runtime");
42
+ const butler_agent_1 = require("../heart/butler-agent");
42
43
  /**
43
44
  * The version of the harness that is running, read from its own package.json once when this module loads. A fix is
44
45
  * "live" only when this process carries it, so the value must not follow whatever an upgrade later writes to disk.
@@ -49,7 +50,7 @@ exports.RUNNING_HARNESS_VERSION = JSON.parse(fs.readFileSync(path.resolve(__dirn
49
50
  * owner-notice path as delegated commands. Only the Butler files and confirms failure reports.
50
51
  */
51
52
  function escalationOptionsFor(agentName, sendOwnerNotice) {
52
- if (agentName !== "sanctuary")
53
+ if (!(0, butler_agent_1.isButlerAgent)(agentName))
53
54
  return {};
54
55
  (0, runtime_1.emitNervesEvent)({ component: "senses", event: "senses.a2a_escalation_wired", message: "A2A server will confirm resolved failure reports to the owner", meta: { agentName, runningVersion: exports.RUNNING_HARNESS_VERSION } });
55
56
  return { escalation: { runningVersion: exports.RUNNING_HARNESS_VERSION, notifyOwner: sendOwnerNotice } };
@@ -112,17 +112,45 @@ function createBudgetLedger(caps, options = {}) {
112
112
  };
113
113
  }
114
114
  const STOPPING_STATUS = new Set([402, 429]);
115
- /** The runtime with each call's usage settled on `hold`; a failed call is billed, and a 402, 429 or usage or rate limit stops the ledger. */
116
- function meteredRuntime(inner, hold, ledger) {
115
+ function errorOf(caught) {
116
+ return caught instanceof Error ? caught : new Error(String(caught));
117
+ }
118
+ /**
119
+ * The runtime with each call's usage settled on `hold`; a failed call is billed, and a 402, 429 or usage or rate limit
120
+ * stops the ledger. With `retry`, a rate limit is first waited out and the request sent again beneath the metering, so
121
+ * the call is still one call, billed once; only a rate limit that outlasts every retry stops the ledger.
122
+ */
123
+ function meteredRuntime(inner, hold, ledger, retry) {
124
+ const send = async (request) => {
125
+ for (let attempt = 1;; attempt += 1) {
126
+ try {
127
+ return await inner.streamTurn(request);
128
+ }
129
+ catch (caught) {
130
+ const error = errorOf(caught);
131
+ const status = error.status;
132
+ const classification = inner.classifyError(error);
133
+ const rateLimited = (status === 429 || classification === "rate-limit") && status !== 402 && classification !== "usage-limit";
134
+ const delay = retry?.delays[attempt - 1];
135
+ if (!rateLimited || delay === undefined)
136
+ throw error;
137
+ (0, runtime_1.emitNervesEvent)({ component: "eval", level: "warn", event: "eval.rate_limit_retry", message: "waiting out a rate limit before sending the call again", meta: { attempt, delayMs: delay } });
138
+ retry.onRetry?.(attempt, delay);
139
+ await retry.sleep(delay);
140
+ // The provider builds its body from these messages again, as it did before the first attempt.
141
+ inner.resetTurnState(request.messages);
142
+ }
143
+ }
144
+ };
117
145
  const streamTurn = async (request) => {
118
146
  try {
119
- const result = await inner.streamTurn(request);
147
+ const result = await send(request);
120
148
  hold.settle(result.usage);
121
149
  return result;
122
150
  }
123
151
  catch (caught) {
124
152
  hold.settle(undefined);
125
- const error = caught instanceof Error ? caught : new Error(String(caught));
153
+ const error = errorOf(caught);
126
154
  const status = error.status;
127
155
  const classification = inner.classifyError(error);
128
156
  if ((typeof status === "number" && STOPPING_STATUS.has(status)) || classification === "usage-limit" || classification === "rate-limit") {
@@ -23,6 +23,8 @@ exports.REGISTERED_ALLOCATIONS = {
23
23
  ca0b441641c6c62e70238ee2b31b2283d358103d683061a97e0174f6c29851f2: 1,
24
24
  // preregistration-v2.md, registered 2026-11-23, seed 20261123: the study on Copilot, with no MiniMax.
25
25
  "71fc28b44d71b1b3d09dffebafa377059a514b42c4a1524cbd3cf7182531c379": 2,
26
+ // preregistration-v3.md, registered 2026-11-26, seed 20261126: version 2's method with a 429 backoff and a neutral bundle.
27
+ "0a0656f41369bab7b1c0ba34a425a908ba0077acd70fc62477ef2a9a2483a96e": 3,
26
28
  };
27
29
  /**
28
30
  * The id a session is marked started under. Version 1's ids are kept as they were written; a later version's are
@@ -67,8 +69,8 @@ function readAllocation(preregistration, registered = exports.REGISTERED_ALLOCAT
67
69
  (0, runtime_1.emitNervesEvent)({ component: "eval", event: "eval.interview_allocation_read", message: "read the pre-registered allocation", meta: { sessions: sessions.length, version } });
68
70
  return { version, sessions };
69
71
  }
70
- /** The versions that run only the reduced design: version 2 adopts it before any call (its section 5). */
71
- exports.REDUCED_ONLY = new Set([2]);
72
+ /** The versions that run only the reduced design: versions 2 and 3 adopt it before any call (each one's section 5). */
73
+ exports.REDUCED_ONLY = new Set([2, 3]);
72
74
  /** The sessions a run or a grade covers: the reduced design, or every session where the version allows the full one. */
73
75
  function designOf(allocation, reduced) {
74
76
  if (!reduced && exports.REDUCED_ONLY.has(allocation.version))
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RefusedCall = exports.CALL_LIMITS = exports.SESSION_CALLS = void 0;
3
+ exports.RefusedCall = exports.CALL_LIMITS = exports.BACKOFF_FROM_VERSION = exports.SESSION_GAP_MS = exports.RATE_LIMIT_BACKOFF_MS = exports.SESSION_CALLS = void 0;
4
+ exports.sleep = sleep;
4
5
  exports.createInterviewLatch = createInterviewLatch;
5
6
  exports.requestText = requestText;
6
7
  exports.guardedRuntime = guardedRuntime;
@@ -13,6 +14,19 @@ const rewrite_1 = require("./rewrite");
13
14
  * nudge the choice may get (36 + 6 + 2 + 1). The pilot amendment of 2026-11-23 reserves the nudge's call too.
14
15
  */
15
16
  exports.SESSION_CALLS = 45;
17
+ /**
18
+ * Version 3's pacing, pre-registered in preregistration-v3.md section 5, and applied from `BACKOFF_FROM_VERSION` on.
19
+ * A call that gets a 429 (or a "rate-limit" classification) is sent again after 15 s, then 45 s, then 120 s: three
20
+ * retries, 180 s at most; a fourth 429 stops the study. The runner waits `SESSION_GAP_MS` between one session's end
21
+ * and the next one's start.
22
+ */
23
+ exports.RATE_LIMIT_BACKOFF_MS = Object.freeze([15_000, 45_000, 120_000]);
24
+ exports.SESSION_GAP_MS = 60_000;
25
+ exports.BACKOFF_FROM_VERSION = 3;
26
+ /** The real wait; tests inject their own. */
27
+ function sleep(ms) {
28
+ return new Promise((resolve) => setTimeout(resolve, ms));
29
+ }
16
30
  exports.CALL_LIMITS = { job: 12, debrief: 2, choose: 1, identify: 1 };
17
31
  function createInterviewLatch(input) {
18
32
  return {
@@ -23,10 +37,13 @@ function createInterviewLatch(input) {
23
37
  return hold;
24
38
  let voided = null;
25
39
  const records = [];
40
+ let retries = 0;
26
41
  const latch = {
27
42
  hold,
28
43
  voided: () => voided,
29
44
  calls: () => [...records],
45
+ rateLimitRetries: () => retries,
46
+ _retried: () => { retries += 1; },
30
47
  release: () => hold.release(),
31
48
  _void: (hits) => { voided ??= hits; },
32
49
  _record: (entry) => { records.push(entry); },
@@ -92,7 +109,8 @@ function requestFields(request) {
92
109
  */
93
110
  function guardedRuntime(input) {
94
111
  const latch = input.latch;
95
- const metered = (0, budget_1.meteredRuntime)(input.inner, latch.hold, input.ledger);
112
+ const retry = input.backoff ? { ...input.backoff, onRetry: () => latch._retried() } : undefined;
113
+ const metered = (0, budget_1.meteredRuntime)(input.inner, latch.hold, input.ledger, retry);
96
114
  const streamTurn = async (own) => {
97
115
  const gate = input.gateFor(own);
98
116
  const rewritten = input.replacements ? (0, rewrite_1.rewriteRequest)(own, input.replacements) : undefined;
@@ -116,17 +116,18 @@ function fidelityOf(kits, sessions) {
116
116
  function caseOf(kit, cases, session) {
117
117
  return kit.job?.(session.job) ?? cases.get(session.job);
118
118
  }
119
- /** Runs one session. Returns its record; `stop` when the study must stop (402, 429 or a cap). */
119
+ /** Runs one session. Returns its record; the ledger is stopped when the study must stop (402, an unretried 429 or a cap). */
120
120
  async function runSession(input) {
121
121
  const { session, latch } = input;
122
122
  const record = {
123
123
  id: session.id, product: session.product, model: session.model, job: session.job, pilot: session.pilot,
124
124
  labels: Object.fromEntries(session.arms.map((arm) => [arm.label, arm.arm])), status: "complete", ended: null, arms: [], final: null,
125
- ouroFirst: false, voidedBy: null, calls: [], spent: ZERO,
125
+ ouroFirst: false, voidedBy: null, calls: [], rateLimitRetries: 0, spent: ZERO,
126
126
  };
127
127
  const c = caseOf(input.kit, input.cases, session);
128
+ const backoff = input.version >= latch_1.BACKOFF_FROM_VERSION ? { backoff: { delays: latch_1.RATE_LIMIT_BACKOFF_MS, sleep: input.sleep } } : {};
128
129
  const guard = (gateFor, replacements, rewrites) => (0, latch_1.guardedRuntime)({
129
- inner: input.target.runtime, latch, ledger: input.ledger, pricing: input.pricing, gateFor, ...(replacements ? { replacements, rewrites } : {}),
130
+ inner: input.target.runtime, latch, ledger: input.ledger, pricing: input.pricing, gateFor, ...(replacements ? { replacements, rewrites } : {}), ...backoff,
130
131
  log: (entry) => input.log(JSON.stringify({ session: session.id, preregistrationVersion: input.version, ...entry })),
131
132
  });
132
133
  const end = (status, why) => {
@@ -182,6 +183,7 @@ async function runSession(input) {
182
183
  record.ouroFirst = record.status === "complete" && record.final?.choice?.first === ouroLabel;
183
184
  record.voidedBy = latch.voided();
184
185
  record.calls = latch.calls();
186
+ record.rateLimitRetries = latch.rateLimitRetries();
185
187
  record.spent = latch.release();
186
188
  (0, runtime_1.emitNervesEvent)({ component: "eval", event: "eval.interview_session_end", message: "finished an interview session", meta: { session: session.id, status: record.status, calls: record.calls.length } });
187
189
  return record;
@@ -192,7 +194,7 @@ function summarizeSessions(records, spent, stopped) {
192
194
  const passed = r.arms.filter((arm) => arm.passed).length;
193
195
  const usage = r.calls.reduce((sum, call) => ({ input: sum.input + (call.usage?.input_tokens ?? 0), output: sum.output + (call.usage?.output_tokens ?? 0) }), { input: 0, output: 0 });
194
196
  const rewrites = r.arms.map((arm) => `${arm.arm}:${Object.entries(arm.rewrites).map(([tier, n]) => `${tier} ${n}`).join(",") || "none"}`).join(";");
195
- return `${r.id} ${r.status} ouro-first=${r.ouroFirst ? "yes" : "no"} jobs-passed=${passed}/${r.arms.length} calls=${r.calls.length} tokens-in=${usage.input} tokens-out=${usage.output} credits=${r.spent.credits.toFixed(3)} premium=${r.spent.premium}${rewrites ? ` rewrites=${rewrites}` : ""}`;
197
+ return `${r.id} ${r.status} ouro-first=${r.ouroFirst ? "yes" : "no"} jobs-passed=${passed}/${r.arms.length} calls=${r.calls.length} tokens-in=${usage.input} tokens-out=${usage.output} credits=${r.spent.credits.toFixed(3)} premium=${r.spent.premium} rate-limit-retries=${r.rateLimitRetries}${rewrites ? ` rewrites=${rewrites}` : ""}`;
196
198
  });
197
199
  return [...lines, `spent: ${spent.credits.toFixed(3)} credits, ${spent.premium} premium requests${stopped ? `; stopped: ${stopped}` : ""}`].join("\n");
198
200
  }
@@ -259,6 +261,9 @@ async function runInterviews(args, deps) {
259
261
  (0, runtime_1.emitNervesEvent)({ component: "eval", event: "eval.interview_run_start", message: "starting blind-interview sessions", meta: { sessions: chosen.length, target: args.target } });
260
262
  const records = [];
261
263
  let stopped = null;
264
+ const wait = deps.sleep ?? latch_1.sleep;
265
+ const paced = version >= latch_1.BACKOFF_FROM_VERSION;
266
+ let ranOne = false;
262
267
  const writeReport = () => {
263
268
  const totals = ledger.totals();
264
269
  deps.writeReport(args.output, {
@@ -273,12 +278,17 @@ async function runInterviews(args, deps) {
273
278
  const notRun = (why) => ({
274
279
  id: session.id, product: session.product, model: session.model, job: session.job, pilot: session.pilot,
275
280
  labels: Object.fromEntries(session.arms.map((arm) => [arm.label, arm.arm])), status: "not-run", ended: why, arms: [], final: null,
276
- ouroFirst: false, voidedBy: null, calls: [], spent: ZERO,
281
+ ouroFirst: false, voidedBy: null, calls: [], rateLimitRetries: 0, spent: ZERO,
277
282
  });
278
283
  if (stopped) {
279
284
  records.push(notRun(`the study stopped: ${stopped}`));
280
285
  continue;
281
286
  }
287
+ // From version 3, a pause between one session's end and the next one's start, so a run doesn't hammer the account.
288
+ if (paced && ranOne) {
289
+ (0, runtime_1.emitNervesEvent)({ component: "eval", event: "eval.interview_session_gap", message: "waiting between interview sessions", meta: { session: session.id, gapMs: latch_1.SESSION_GAP_MS } });
290
+ await wait(latch_1.SESSION_GAP_MS);
291
+ }
282
292
  const latch = interviewLatch.reserve(session.id, latch_1.SESSION_CALLS);
283
293
  if ("refused" in latch) {
284
294
  stopped = latch.refused;
@@ -286,13 +296,14 @@ async function runInterviews(args, deps) {
286
296
  continue;
287
297
  }
288
298
  deps.started.add((0, allocation_1.startedKey)(version, session.id));
299
+ ranOne = true;
289
300
  let record;
290
301
  try {
291
- record = await runSession({ session, kit: deps.kits[session.product], cases, latch, target, ledger, pricing, runCase: deps.runCase, version, log });
302
+ record = await runSession({ session, kit: deps.kits[session.product], cases, latch, target, ledger, pricing, runCase: deps.runCase, version, sleep: wait, log });
292
303
  }
293
304
  catch (error) {
294
305
  // Nothing that goes wrong in one session loses the sessions already run, or holds its reservation.
295
- record = { ...notRun((0, loop_1.messageOf)(error)), status: "crashed", voidedBy: latch.voided(), calls: latch.calls(), spent: latch.release() };
306
+ record = { ...notRun((0, loop_1.messageOf)(error)), status: "crashed", voidedBy: latch.voided(), calls: latch.calls(), rateLimitRetries: latch.rateLimitRetries(), spent: latch.release() };
296
307
  }
297
308
  records.push(record);
298
309
  // The month ledger only hears what the session spent: it never blocks or stops the study, whose pre-registered
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BUTLER_AGENT_NAMES = void 0;
4
+ exports.isButlerAgent = isButlerAgent;
5
+ /**
6
+ * The Butler's agent names: `butler`, and `sanctuary` from before the rename (M2). Every check that picks Butler behaviour
7
+ * asks this, so an install runs the same whichever name its bundle has.
8
+ */
9
+ exports.BUTLER_AGENT_NAMES = ["butler", "sanctuary"];
10
+ /** Whether this agent (or a saved record's `agent` field) is the Butler, under its name or its name from before the rename. */
11
+ function isButlerAgent(agentName) {
12
+ return typeof agentName === "string" && exports.BUTLER_AGENT_NAMES.includes(agentName);
13
+ }
@@ -52,6 +52,7 @@ const sense_manager_1 = require("./sense-manager");
52
52
  const agent_discovery_1 = require("./agent-discovery");
53
53
  const agent_home_1 = require("./agent-home");
54
54
  const identity_1 = require("../identity");
55
+ const butler_agent_1 = require("../butler-agent");
55
56
  const app_sessions_record_1 = require("./app-sessions-record");
56
57
  const runtime_mode_1 = require("./runtime-mode");
57
58
  const habit_scheduler_1 = require("../habits/habit-scheduler");
@@ -537,7 +538,7 @@ const daemon = new daemon_1.OuroDaemon({
537
538
  },
538
539
  schedulerFireConsumer: (origin) => (0, sanctuary_scheduler_liveness_1.consumeSanctuarySchedulerFire)(path.join((0, identity_1.getAgentBundlesRoot)(), "sanctuary.ouro"), origin),
539
540
  nativeHabitRunner: async ({ agent, habitName, trigger, occurrenceId, runnerId, schedulerOrigin }) => {
540
- if (agent !== "sanctuary" || habitName !== "sanctuary-health")
541
+ if (!(0, butler_agent_1.isButlerAgent)(agent) || habitName !== "sanctuary-health")
541
542
  return null;
542
543
  const marker = (0, sanctuary_acceptance_marker_1.readSanctuaryAcceptanceMarker)(agent);
543
544
  const schedulerScenario = marker?.label === "unit-16f-cron-fingerprint" ? marker : null;
@@ -580,7 +581,7 @@ const daemon = new daemon_1.OuroDaemon({
580
581
  }
581
582
  return result;
582
583
  },
583
- nativeHabitMatch: (agent, habitName) => agent === "sanctuary" && habitName === "sanctuary-health",
584
+ nativeHabitMatch: (agent, habitName) => (0, butler_agent_1.isButlerAgent)(agent) && habitName === "sanctuary-health",
584
585
  mode,
585
586
  onStopCommandComplete: async () => {
586
587
  await stopEntryRuntime();
@@ -897,7 +898,7 @@ void (0, daemon_bootstrap_startup_1.startDaemonAfterContainerCredentialBootstrap
897
898
  habitsDir,
898
899
  osCronManager,
899
900
  onHabitFire: (habitName, trigger, context) => {
900
- if ((0, habit_policy_1.isRsvpHabitName)(habitName) || (agent === "sanctuary" && habitName === "sanctuary-health")) {
901
+ if ((0, habit_policy_1.isRsvpHabitName)(habitName) || ((0, butler_agent_1.isButlerAgent)(agent) && habitName === "sanctuary-health")) {
901
902
  (0, socket_client_1.sendDaemonCommand)(socketPath, {
902
903
  kind: "habit.poke",
903
904
  agent,
@@ -53,6 +53,7 @@ const path = __importStar(require("path"));
53
53
  const node_crypto_1 = require("node:crypto");
54
54
  const node_string_decoder_1 = require("node:string_decoder");
55
55
  const identity_1 = require("../identity");
56
+ const butler_agent_1 = require("../butler-agent");
56
57
  const state_retention_1 = require("./state-retention");
57
58
  const agent_discovery_1 = require("./agent-discovery");
58
59
  const runtime_1 = require("../../nerves/runtime");
@@ -2393,7 +2394,7 @@ class OuroDaemon {
2393
2394
  return { ok: false, error: `invalid habit trigger: ${String(trigger)}` };
2394
2395
  }
2395
2396
  const schedulerOrigin = this.authenticatedSchedulerPokes.get(command);
2396
- if (command.agent === "sanctuary" && command.habitName === "sanctuary-health" && trigger === "cron" && !schedulerOrigin) {
2397
+ if ((0, butler_agent_1.isButlerAgent)(command.agent) && command.habitName === "sanctuary-health" && trigger === "cron" && !schedulerOrigin) {
2397
2398
  return { ok: false, error: "Sanctuary cron habit requires authenticated Supercronic provenance" };
2398
2399
  }
2399
2400
  if (!(0, habit_policy_1.isRsvpHabitName)(command.habitName) && !this.hasManagedPrivateRuntime(command.agent)) {
@@ -50,6 +50,7 @@ const node_async_hooks_1 = require("node:async_hooks");
50
50
  const node_crypto_1 = require("node:crypto");
51
51
  const node_child_process_1 = require("node:child_process");
52
52
  const identity_1 = require("../identity");
53
+ const butler_agent_1 = require("../butler-agent");
53
54
  const runtime_1 = require("../../nerves/runtime");
54
55
  const SHA256 = /^[0-9a-f]{64}$/u;
55
56
  const acceptanceApproval = new node_async_hooks_1.AsyncLocalStorage();
@@ -93,7 +94,7 @@ function parseMarker(value) {
93
94
  return marker;
94
95
  }
95
96
  function readSanctuaryAcceptanceMarker(agentName, configuredAgentRoot) {
96
- if (agentName !== "sanctuary")
97
+ if (!(0, butler_agent_1.isButlerAgent)(agentName))
97
98
  return null;
98
99
  const filePath = markerPath(agentName, configuredAgentRoot);
99
100
  let raw;
@@ -108,7 +109,7 @@ function readSanctuaryAcceptanceMarker(agentName, configuredAgentRoot) {
108
109
  return parseMarker(JSON.parse(raw));
109
110
  }
110
111
  function writeSanctuaryAcceptanceMarker(agentName, marker, configuredAgentRoot) {
111
- if (agentName !== "sanctuary")
112
+ if (!(0, butler_agent_1.isButlerAgent)(agentName))
112
113
  throw new Error("acceptance markers are restricted to Sanctuary");
113
114
  const parsed = parseMarker(marker);
114
115
  const filePath = markerPath(agentName, configuredAgentRoot);
@@ -131,7 +132,7 @@ function clearSanctuaryAcceptanceMarker(agentName, scenarioHandleDigest, configu
131
132
  (0, runtime_1.emitNervesEvent)({ component: "daemon", event: "daemon.sanctuary_acceptance_marker_cleared", message: "Sanctuary acceptance marker cleared", meta: { scenarioHandleDigest } });
132
133
  }
133
134
  function quarantineSanctuaryAcceptanceMarker(agentName, configuredAgentRoot) {
134
- if (agentName !== "sanctuary")
135
+ if (!(0, butler_agent_1.isButlerAgent)(agentName))
135
136
  throw new Error("acceptance markers are restricted to Sanctuary");
136
137
  const filePath = markerPath(agentName, configuredAgentRoot);
137
138
  const sourceParent = path.dirname(filePath);
@@ -42,6 +42,7 @@ const identity_1 = require("../identity");
42
42
  const runtime_1 = require("../../nerves/runtime");
43
43
  const telegram_identity_key_1 = require("../../senses/telegram-identity-key");
44
44
  const sanctuary_acceptance_marker_1 = require("./sanctuary-acceptance-marker");
45
+ const butler_agent_1 = require("../butler-agent");
45
46
  const CRONTAB_PATH = "/home/ouro/.ouro-cli/scheduler/sanctuary.crontab";
46
47
  const SUPERCRONIC = "/usr/local/bin/supercronic";
47
48
  const SUPERCRONIC_CMDLINE = `${SUPERCRONIC}\0-split-logs\0-inotify\0${CRONTAB_PATH}\0`;
@@ -84,7 +85,7 @@ function defaultSanctuarySchedulerOriginDeps(agentRoot = (0, identity_1.getAgent
84
85
  };
85
86
  }
86
87
  function createSanctuarySchedulerFireCommand(command, deps = defaultSanctuarySchedulerOriginDeps()) {
87
- if (command.agent !== "sanctuary" || command.habitName !== "sanctuary-health" || command.trigger !== "cron" || deps.platform !== "linux")
88
+ if (!(0, butler_agent_1.isButlerAgent)(command.agent) || command.habitName !== "sanctuary-health" || command.trigger !== "cron" || deps.platform !== "linux")
88
89
  return null;
89
90
  try {
90
91
  const invocation = processIdentity(deps.readFile(`/proc/${deps.pid}/stat`));
@@ -96,7 +97,7 @@ function createSanctuarySchedulerFireCommand(command, deps = defaultSanctuarySch
96
97
  return null;
97
98
  const slot = slotFor(deps.now());
98
99
  const value = {
99
- kind: "habit.scheduler-fire", agent: "sanctuary", habitName: "sanctuary-health", trigger: "cron",
100
+ kind: "habit.scheduler-fire", agent: command.agent, habitName: "sanctuary-health", trigger: "cron",
100
101
  slot, occurrenceId: `cron:${slot}`, schedulerRunId: deps.randomId(), invocationPid: deps.pid, parentPid: deps.ppid,
101
102
  parentStartTime: parent.startTime, invocationStartTime: invocation.startTime,
102
103
  scenarioHandleDigest: marker?.label === "unit-16f-cron-fingerprint" ? marker.scenarioHandleDigest : null,
@@ -108,7 +109,7 @@ function createSanctuarySchedulerFireCommand(command, deps = defaultSanctuarySch
108
109
  }
109
110
  }
110
111
  function verifySanctuarySchedulerFireCommand(command, deps) {
111
- if (!command || command.kind !== "habit.scheduler-fire" || command.agent !== "sanctuary" || command.habitName !== "sanctuary-health" || command.trigger !== "cron"
112
+ if (!command || command.kind !== "habit.scheduler-fire" || !(0, butler_agent_1.isButlerAgent)(command.agent) || command.habitName !== "sanctuary-health" || command.trigger !== "cron"
112
113
  || !UUID.test(command.schedulerRunId) || (command.scenarioHandleDigest !== null && !SHA256.test(command.scenarioHandleDigest)) || command.scenarioHandleDigest !== deps.scenarioHandleDigest
113
114
  || command.slot !== slotFor(deps.now()) || command.occurrenceId !== `cron:${command.slot}`)
114
115
  throw new Error("scheduler fire slot or binding is invalid");
@@ -40,6 +40,7 @@ const os = __importStar(require("os"));
40
40
  const path = __importStar(require("path"));
41
41
  const runtime_1 = require("../../nerves/runtime");
42
42
  const identity_1 = require("../identity");
43
+ const butler_agent_1 = require("../butler-agent");
43
44
  const runtime_credentials_1 = require("../runtime-credentials");
44
45
  const provider_credentials_1 = require("../provider-credentials");
45
46
  const sense_truth_1 = require("../sense-truth");
@@ -189,7 +190,7 @@ function runtimeConfigUnavailableDetail(agent, runtimeConfig) {
189
190
  return `vault ${itemName} unavailable (${compactRuntimeConfigError(agent, runtimeConfig.error)})`;
190
191
  }
191
192
  function needsMachineRuntimeConfig(agent, sense) {
192
- return sense === "bluebubbles" || sense === "voice" || sense === "a2a" || sense === "shepherd" || (agent === "sanctuary" && sense === "telegram");
193
+ return sense === "bluebubbles" || sense === "voice" || sense === "a2a" || sense === "shepherd" || ((0, butler_agent_1.isButlerAgent)(agent) && sense === "telegram");
193
194
  }
194
195
  function senseFactsFromRuntimeConfig(agent, senses, runtimeConfig, machineRuntimeConfig = (0, runtime_credentials_1.readMachineRuntimeCredentialConfig)(agent), workbenchHasStaleBundleEntry = false) {
195
196
  const base = {
@@ -215,7 +216,7 @@ function senseFactsFromRuntimeConfig(agent, senses, runtimeConfig, machineRuntim
215
216
  const integrations = payload.integrations;
216
217
  const voice = machinePayload.voice;
217
218
  const a2a = machinePayload.a2a;
218
- if (senses.telegram.enabled && agent === "sanctuary") {
219
+ if (senses.telegram.enabled && (0, butler_agent_1.isButlerAgent)(agent)) {
219
220
  const ready = runtimeConfig.ok && machineRuntimeConfig.ok
220
221
  && !Object.hasOwn(payload, "telegramBotToken") && !Object.hasOwn(machinePayload, "telegramBotToken");
221
222
  base.telegram = ready
@@ -408,7 +409,7 @@ function senseRepairHint(agent, sense) {
408
409
  return `Agent-runnable: run 'ouro connect a2a --agent ${agent}', then restart with 'ouro up'.`;
409
410
  }
410
411
  if (sense === "telegram") {
411
- return agent === "sanctuary"
412
+ return (0, butler_agent_1.isButlerAgent)(agent)
412
413
  ? "Agent-runnable: complete or recover the root authority migration; do not restore a resident Telegram token."
413
414
  : `Agent-runnable: store Telegram bot/user/chat coordinates with 'ouro connect telegram --agent ${agent}', then restart with 'ouro up'.`;
414
415
  }
@@ -60,6 +60,7 @@ const path = __importStar(require("node:path"));
60
60
  const runtime_1 = require("../../nerves/runtime");
61
61
  const ouro_version_manager_1 = require("../versioning/ouro-version-manager");
62
62
  const atomic_file_1 = require("../atomic-file");
63
+ const butler_agent_1 = require("../butler-agent");
63
64
  const MAX_EVENT_TEXT_BYTES = 4_096;
64
65
  const MAX_EVENT_EVIDENCE = 32;
65
66
  const MAX_EVENT_RECORD_BYTES = 64 * 1_024;
@@ -877,7 +878,7 @@ function parsePrivilegedEnvelope(raw, fileName, now) {
877
878
  const observationTransitionIsAllowed = value.eventType !== "usenet.health_observation" || /^(?:auth-failed|stalled|recovered|indeterminate):\d{8}T\d{6}Z$/u.test(String(value.transitionId));
878
879
  const expectedKeys = ["action", "actionReceipt", "agent", "createdAt", "critical", "eventType", "evidence", "expiresAt", "incidentKey", "nonce", "observationRevision", "protectiveStateDigest", "protectiveStateObservedAt", "protectiveStateVerified", "schemaVersion", "source", "summary", "transitionId"];
879
880
  if (Object.keys(value).sort().join("\0") !== expectedKeys.sort().join("\0")
880
- || value.schemaVersion !== 1 || value.agent !== "sanctuary" || value.source !== PRIVILEGED_EVENT_SOURCE
881
+ || value.schemaVersion !== 1 || !(0, butler_agent_1.isButlerAgent)(value.agent) || value.source !== PRIVILEGED_EVENT_SOURCE
881
882
  || !eventShapeIsAllowed || !observationTransitionIsAllowed
882
883
  || value.critical !== true || !boundedIdentifier(value.incidentKey) || !boundedIdentifier(value.transitionId)
883
884
  || !/^[a-f0-9]{64}$/u.test(String(value.observationRevision)) || !/^[a-f0-9]{64}$/u.test(String(value.nonce))
@@ -1028,7 +1029,7 @@ function isReplayState(value) {
1028
1029
  if (!value || typeof value !== "object" || Array.isArray(value))
1029
1030
  return false;
1030
1031
  const state = value;
1031
- if (state.schemaVersion !== 1 || state.agent !== "sanctuary" || state.source !== PRIVILEGED_EVENT_SOURCE || !canonicalIso(state.updatedAt))
1032
+ if (state.schemaVersion !== 1 || !(0, butler_agent_1.isButlerAgent)(state.agent) || state.source !== PRIVILEGED_EVENT_SOURCE || !canonicalIso(state.updatedAt))
1032
1033
  return false;
1033
1034
  try {
1034
1035
  replayBytes(state);
@@ -1204,7 +1205,7 @@ function commitMutation(recordPath, record, now) {
1204
1205
  function bindPrivilegedFailsafeArtifact(recordPath, input) {
1205
1206
  return withRecordLock(recordPath, () => {
1206
1207
  const record = readExternalEventRecord(recordPath);
1207
- if (record.agent !== "sanctuary" || record.source !== PRIVILEGED_EVENT_SOURCE || !record.privilegedProtectiveAction) {
1208
+ if (!(0, butler_agent_1.isButlerAgent)(record.agent) || record.source !== PRIVILEGED_EVENT_SOURCE || !record.privilegedProtectiveAction) {
1208
1209
  throw new Error("System failsafe requires a privileged Sanctuary event");
1209
1210
  }
1210
1211
  if (!/^[a-f0-9]{64}$/u.test(input.artifactId))
@@ -48,6 +48,7 @@ const path = __importStar(require("path"));
48
48
  const runtime_1 = require("../nerves/runtime");
49
49
  const manager_1 = require("./bridges/manager");
50
50
  const identity_1 = require("./identity");
51
+ const butler_agent_1 = require("./butler-agent");
51
52
  const coding_1 = require("../repertoire/coding");
52
53
  const session_activity_1 = require("./session-activity");
53
54
  const thoughts_1 = require("./daemon/thoughts");
@@ -221,7 +222,7 @@ function readSenseStatusLines() {
221
222
  // Sanctuary's resident is deliberately tokenless: the root authority gateway holds the
222
223
  // token, so a token in the resident's config would be the misconfiguration. Mirror the
223
224
  // daemon's rule (sense-manager) instead of reporting a working sense as needs_config (D-047).
224
- telegram: agentName === "sanctuary"
225
+ telegram: (0, butler_agent_1.isButlerAgent)(agentName)
225
226
  ? runtimeConfig.ok && machineRuntimeConfig.ok && !Object.hasOwn(runtimePayload, "telegramBotToken") && !Object.hasOwn(machinePayload, "telegramBotToken")
226
227
  : hasTextField(runtimePayload, "telegramBotToken")
227
228
  && hasTextField(runtimePayload, "telegramAuthorizedUserId")
@@ -69,6 +69,8 @@ const DISPATCH_EXEMPT_PATTERNS = [
69
69
  // otherwise read as code to isTypeOnlyFile.
70
70
  "daemon/cli-commands/",
71
71
  // Shared utility modules: pure helpers consumed by modules that own observability.
72
+ // The Butler's names and the one check that picks Butler behaviour; each caller owns its observability.
73
+ "heart/butler-agent",
72
74
  "arc/json-store",
73
75
  "heart/mail-import-discovery",
74
76
  "repertoire/api-client",
@@ -47,6 +47,7 @@ const shared_turn_1 = require("../senses/shared-turn");
47
47
  const relationship_authorization_1 = require("./relationship-authorization");
48
48
  const tool_arguments_1 = require("./tool-arguments");
49
49
  const tools_base_1 = require("./tools-base");
50
+ const butler_agent_1 = require("../heart/butler-agent");
50
51
  const NAME = "sanctuary_host_execute";
51
52
  const bindings = new WeakMap();
52
53
  const selections = new WeakMap();
@@ -69,7 +70,7 @@ function currentCoordinates(ctx) {
69
70
  const actor = relationship?.actor;
70
71
  const session = ctx.currentSession;
71
72
  const friend = ctx.context?.friend;
72
- requireOwner(ctx.agentName === "sanctuary" && typeof ctx.agentRoot === "string" && path.isAbsolute(ctx.agentRoot)
73
+ requireOwner((0, butler_agent_1.isButlerAgent)(ctx.agentName) && typeof ctx.agentRoot === "string" && path.isAbsolute(ctx.agentRoot)
73
74
  && path.resolve(ctx.agentRoot) === ctx.agentRoot && path.basename(ctx.agentRoot) === "sanctuary.ouro");
74
75
  requireOwner(root && root.port.isHealthy() && !ctx.currentExternalEvent);
75
76
  requireOwner(relationship?.profileId === "sanctuary-owner" && relationship.advertisedToolNames?.includes(NAME));
@@ -42,6 +42,7 @@ const path = __importStar(require("path"));
42
42
  const crypto_1 = require("crypto");
43
43
  const config_1 = require("../heart/config");
44
44
  const identity_1 = require("../heart/identity");
45
+ const butler_agent_1 = require("../heart/butler-agent");
45
46
  const session_events_1 = require("../heart/session-events");
46
47
  const runtime_1 = require("../nerves/runtime");
47
48
  const socket_client_1 = require("../heart/daemon/socket-client");
@@ -652,7 +653,7 @@ exports.sessionToolDefinitions = [
652
653
  const frame = await buildToolActiveWorkFrame(ctx);
653
654
  const activeWork = `this is my current top-level live world-state.\nanswer whole-self status questions from this before drilling into individual sessions.\n\n${(0, active_work_1.formatActiveWorkFrame)(frame)}`;
654
655
  const numeric = (value, fallback, min, max) => value === undefined ? fallback : /^\d+$/u.test(value) ? Math.min(max, Math.max(min, Number(value))) : fallback;
655
- return (0, identity_1.getAgentName)() === "sanctuary"
656
+ return (0, butler_agent_1.isButlerAgent)((0, identity_1.getAgentName)())
656
657
  ? `${activeWork}\n\n${formatButlerOperationalVisibility(readButlerOperationalVisibility(), { section: args.section, offset: numeric(args.offset, 0, 0, 10_000), limit: numeric(args.limit, 10, 1, 20) })}`
657
658
  : activeWork;
658
659
  },
@@ -32,6 +32,7 @@ const tools_bundle_1 = require("./tools-bundle");
32
32
  const runtime_1 = require("../nerves/runtime");
33
33
  const guardrails_1 = require("./guardrails");
34
34
  const identity_1 = require("../heart/identity");
35
+ const butler_agent_1 = require("../heart/butler-agent");
35
36
  const store_1 = require("../commerce/store");
36
37
  const tools_surface_1 = require("./tools-surface");
37
38
  const mcp_tools_1 = require("./mcp-tools");
@@ -170,7 +171,7 @@ function selectToolsForChannel(capabilities, toolPreferences, _context, provider
170
171
  // loop and the host-local CLI/MCP) keep the unscoped tool set.
171
172
  const channel = capabilities?.channel;
172
173
  const remote = channel !== undefined && !SANCTUARY_LOCAL_CHANNELS.has(channel);
173
- const sanctuary = (context?.agentName === "sanctuary" && (relationship !== undefined || remote))
174
+ const sanctuary = ((0, butler_agent_1.isButlerAgent)(context?.agentName) && (relationship !== undefined || remote))
174
175
  || profileId?.startsWith("sanctuary-") === true;
175
176
  const owner = profileId === "sanctuary-owner";
176
177
  // A trusted peer agent acting for the owner gets the owner's chat tool menu. Host
@@ -230,7 +231,7 @@ function selectToolsForChannel(capabilities, toolPreferences, _context, provider
230
231
  ordinary.push(hostTool);
231
232
  const inner = capabilities?.channel === "inner";
232
233
  // The Butler's own scheduled turns (the daily house-care await) carry no relationship, so they cannot take the owner profile's menu.
233
- if (inner && !sanctuary && context?.agentName === "sanctuary")
234
+ if (inner && !sanctuary && (0, butler_agent_1.isButlerAgent)(context?.agentName))
234
235
  ordinary.push(...tools_house_care_1.houseCareToolDefinitions);
235
236
  const habit = context?.habitSession;
236
237
  if (inner) {
@@ -491,7 +492,7 @@ async function preflightToolCall(name, args, ctx) {
491
492
  }
492
493
  const currentSelection = ctx?.selectCurrentTools?.()
493
494
  ?? (name === tools_sanctuary_host_1.rootHostToolDefinition.tool.function.name ? selection
494
- : relationship?.profileId?.startsWith("sanctuary-") || (relationship && ctx?.agentName === "sanctuary")
495
+ : relationship?.profileId?.startsWith("sanctuary-") || (relationship && (0, butler_agent_1.isButlerAgent)(ctx?.agentName))
495
496
  ? selectToolsForChannel(undefined, undefined, undefined, undefined, undefined, undefined, ctx)
496
497
  : undefined);
497
498
  const current = currentSelection ? findDefinition(name, currentSelection) : def?.mcpBinding ? def : findDefinition(name);
@@ -49,6 +49,7 @@ const runtime_logging_1 = require("../heart/daemon/runtime-logging");
49
49
  const runtime_1 = require("../nerves/runtime");
50
50
  const delegated_command_1 = require("../a2a/delegated-command");
51
51
  const identity_1 = require("../heart/identity");
52
+ const butler_agent_1 = require("../heart/butler-agent");
52
53
  (0, runtime_logging_1.configureDaemonRuntimeLogger)("a2a");
53
54
  (0, runtime_1.emitNervesEvent)({
54
55
  component: "senses",
@@ -105,7 +106,7 @@ Promise.all([
105
106
  identity,
106
107
  // The Butler accepts delegated commands from explicitly granted peers; each
107
108
  // one is announced in the owner's own Telegram chat before it runs (never through the owner route, never held).
108
- ...(agentName === "sanctuary" ? {
109
+ ...((0, butler_agent_1.isButlerAgent)(agentName) ? {
109
110
  delegation: {
110
111
  principalProfileId: delegated_command_1.A2A_PRINCIPAL_PROFILE_ID,
111
112
  agentRoot: (0, identity_1.getAgentRoot)(agentName),
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.presentSanctuaryDownloadCreditReply = presentSanctuaryDownloadCreditReply;
4
4
  const runtime_1 = require("../nerves/runtime");
5
+ const butler_agent_1 = require("../heart/butler-agent");
5
6
  const TOP_UP_LINK = "https://www.astraweb.com/login";
6
7
  const SAFE_FALLBACK = `Downloads are paused to protect your prepaid credit. Top it up here: ${TOP_UP_LINK}. Tell me when you’re done, and I’ll resume downloads and verify one finishes. Or tell me a reminder time, like “tomorrow at 9.”`;
7
8
  const FORBIDDEN_INTERNALS = /\b(?:SABnzbd|Sonarr|Radarr|Deluge|auth[ -]?check|credential|dead[ -]?letter|indexer has been disabled|keep watching)\b/iu;
@@ -20,7 +21,7 @@ const REQUIRED_HOUSEHOLD_CONTRACT = [
20
21
  /\btime\b|\btomorrow at 9\b/iu,
21
22
  ];
22
23
  function presentSanctuaryDownloadCreditReply(agentName, exactQuestion, text) {
23
- if (agentName !== "sanctuary" || !exactQuestion || !text.includes(TOP_UP_LINK) || !/\bcredit\b/iu.test(text))
24
+ if (!(0, butler_agent_1.isButlerAgent)(agentName) || !exactQuestion || !text.includes(TOP_UP_LINK) || !/\bcredit\b/iu.test(text))
24
25
  return text;
25
26
  if (!FORBIDDEN_INTERNALS.test(text) && REQUIRED_HOUSEHOLD_CONTRACT.every((pattern) => pattern.test(text)))
26
27
  return text;
@@ -45,6 +45,7 @@ const path = __importStar(require("node:path"));
45
45
  const node_crypto_1 = require("node:crypto");
46
46
  const node_async_hooks_1 = require("node:async_hooks");
47
47
  const identity_1 = require("../heart/identity");
48
+ const butler_agent_1 = require("../heart/butler-agent");
48
49
  const sanctuary_bundle_migration_1 = require("../heart/daemon/sanctuary-bundle-migration");
49
50
  const sanctuary_package_management_1 = require("../heart/daemon/sanctuary-package-management");
50
51
  const machine_identity_1 = require("../heart/machine-identity");
@@ -68,7 +69,7 @@ const sanctuaryToolGroundings = new node_async_hooks_1.AsyncLocalStorage();
68
69
  const acceptanceLedgerTails = new Map();
69
70
  /** The Butler agent whose private and A2A turns carry the Sanctuary tool context. */
70
71
  function isSanctuaryAgent(agentName) {
71
- return agentName === "sanctuary";
72
+ return (0, butler_agent_1.isButlerAgent)(agentName);
72
73
  }
73
74
  function isSanctuaryExternalEventSource(source) {
74
75
  return source === "sanctuary-health" || source === "sanctuary-usenet";
@@ -57,6 +57,7 @@ const session_events_1 = require("../heart/session-events");
57
57
  const session_transaction_1 = require("../mind/session-transaction");
58
58
  const telegram_client_1 = require("./telegram-client");
59
59
  const telegram_markdown_1 = require("./telegram-markdown");
60
+ const butler_agent_1 = require("../heart/butler-agent");
60
61
  exports.FIXED_ADMISSION_ACKNOWLEDGEMENT = "Thanks — I’ve asked the person I work for. Your message is still unread and unprocessed; I’ll only read it if they welcome you in.";
61
62
  exports.FIXED_USENET_SYSTEM_FAILSAFE = "Quick heads-up: I paused downloads because the server was discarding most of what it fetched. Nothing needs doing this second — I’ll investigate and follow up when I’m back online.";
62
63
  const SYSTEM_FAILSAFE_UNAVAILABLE_MS = 2 * 60_000;
@@ -543,7 +544,7 @@ async function reconcileTelegramSystemFailsafe(input) {
543
544
  const action = record.privilegedProtectiveAction;
544
545
  if (record.privilegedFailsafe)
545
546
  return { sent: false, reason: "already_recorded", artifactId: record.privilegedFailsafe.artifactId };
546
- if (record.agent !== "sanctuary" || record.source !== "sanctuary-usenet" || record.eventType !== "usenet.protective_action"
547
+ if (!(0, butler_agent_1.isButlerAgent)(record.agent) || record.source !== "sanctuary-usenet" || record.eventType !== "usenet.protective_action"
547
548
  || record.priority !== "critical" || !action?.critical)
548
549
  return { sent: false, reason: "noncritical" };
549
550
  if (!action.verification.verified)
@@ -578,7 +579,7 @@ async function reconcileTelegramSystemFailsafe(input) {
578
579
  async function sweepTelegramSystemFailsafes(input) {
579
580
  const scanned = (input.scanCache ?? new router_1.ExternalEventScanCache()).scan(input.eventRoot);
580
581
  const records = scanned
581
- .flatMap((entry) => entry.record && entry.record.agent === "sanctuary" && entry.record.source === "sanctuary-usenet" && !entry.record.privilegedFailsafe ? [entry.record] : [])
582
+ .flatMap((entry) => entry.record && (0, butler_agent_1.isButlerAgent)(entry.record.agent) && entry.record.source === "sanctuary-usenet" && !entry.record.privilegedFailsafe ? [entry.record] : [])
582
583
  .sort((left, right) => left.eventId.localeCompare(right.eventId))
583
584
  .slice(0, 32);
584
585
  let sent = 0;
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1618",
3
+ "version": "0.1.0-alpha.1620",
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.1618",
9
+ "version": "0.1.0-alpha.1620",
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.1618",
3
+ "version": "0.1.0-alpha.1620",
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": {