@ouro.bot/cli 0.1.0-alpha.1358 → 0.1.0-alpha.1361

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": "This changelog is maintained as part of the PR/version-bump workflow. Agent-curated, not auto-generated. Agents read this file directly via read_file to understand what changed between versions.",
3
3
  "versions": [
4
+ {
5
+ "version": "0.1.0-alpha.1361",
6
+ "changes": [
7
+ "The Butler's release gate treats an owner notice the replay run caused as a leak whether it went to Telegram or, with an owner route on, to the owner's primary agent."
8
+ ]
9
+ },
4
10
  {
5
11
  "version": "0.1.0-alpha.1358",
6
12
  "changes": [
@@ -252,6 +252,25 @@ export function ownerNoticeEffects(effects, start, end) {
252
252
  })
253
253
  }
254
254
 
255
+ /**
256
+ * The keys an owner route recorded after `before` (state/telegram/routed-owner-notices.json). The ledger drops a key and
257
+ * appends it again when it is routed again, and drops its oldest keys past its cap, so what is older stays in order and
258
+ * everything after the first key out of that order is new.
259
+ */
260
+ export function routedSince(before, after) {
261
+ const old = Array.isArray(before) ? before : []
262
+ const now = Array.isArray(after) ? after : []
263
+ let at = 0
264
+ let kept = 0
265
+ for (const key of now) {
266
+ const found = old.indexOf(key, at)
267
+ if (found === -1) break
268
+ at = found + 1
269
+ kept += 1
270
+ }
271
+ return now.slice(kept)
272
+ }
273
+
255
274
  const AWAIT_NOTICE_KEY = /^owner-notice:await:(.+):(resolved|expired|asked_owner):(\d{4}-\d{2}-\d{2}T[^:]*:[^:]*:[^:]*Z)$/
256
275
  const unquote = (value) => String(value ?? "").replace(/^["']|["']$/g, "")
257
276
 
@@ -1367,11 +1386,12 @@ async function runCases(host, { cases = CASES.map((entry) => entry.id), plant, w
1367
1386
  }
1368
1387
  const runEnd = host.now()
1369
1388
  const finalObservation = await host.observe()
1370
- const { leaks, info } = classifyOwnerNotices(finalObservation.effects, runStart, runEnd, { replayFriends: [host.friends.principal, host.friends.stranger, host.friends.escalation], awaits: [...(finalObservation.awaiting ?? []), ...(finalObservation.done ?? [])] })
1389
+ const routed = routedSince(baseline.routed, finalObservation.routed).map((key) => ({ idempotencyKey: key, createdAt: new Date(runEnd).toISOString() }))
1390
+ const { leaks, info } = classifyOwnerNotices([...finalObservation.effects, ...routed], runStart, runEnd, { replayFriends: [host.friends.principal, host.friends.stranger, host.friends.escalation], awaits: [...(finalObservation.awaiting ?? []), ...(finalObservation.done ?? [])] })
1371
1391
  const readable = finalObservation.effectsReadable === true
1372
1392
  const clean = readable && leaks.length === 0
1373
1393
  const detail = readable ? [...leaks.map((leak) => `${leak.key} (${leak.reason})`), ...info.map((entry) => `info: ${entry.key} (${entry.reason})`)].join(", ") : "state/telegram/effects is not readable, so the absence of a leak cannot be shown"
1374
- const telegram = { id: "no-telegram", status: clean ? "pass" : "fail", checks: [check("no owner-notice Telegram effect attributable to the replay run was recorded", clean, detail)] }
1394
+ const telegram = { id: "no-telegram", status: clean ? "pass" : "fail", checks: [check("no owner notice attributable to the replay run went to Telegram or to the owner's primary agent", clean, detail)] }
1375
1395
  const policyChecks = ownerPolicyUntouched(baseline, finalObservation)
1376
1396
  const policy = { id: "owner-policy-untouched", status: policyChecks.every((entry) => entry.ok) ? "pass" : "fail", checks: policyChecks }
1377
1397
  const all = [...results, policy, telegram, ...(restored ? [restored] : []), ...(friendRestored ? [friendRestored] : [])]
@@ -2103,6 +2123,11 @@ export function makeHost({ bundle = DEFAULT_BUNDLE, trustDir = DEFAULT_TRUST_DIR
2103
2123
  const effects = list(effectsDir).filter((name) => name.endsWith(".json")).flatMap((name) => {
2104
2124
  try { const record = readJson(path.join(effectsDir, name)); return [{ idempotencyKey: record.idempotencyKey, createdAt: record.createdAt }] } catch { return [] }
2105
2125
  })
2126
+ let routed = []
2127
+ try {
2128
+ const parsed = readJson(path.join(state, "telegram", "routed-owner-notices.json"))
2129
+ if (Array.isArray(parsed)) routed = parsed.filter((key) => typeof key === "string")
2130
+ } catch { /* none routed yet */ }
2106
2131
  const outbox = {}
2107
2132
  const outboxBodies = {}
2108
2133
  for (const friendId of list(path.join(state, "outbox"))) {
@@ -2111,6 +2136,7 @@ export function makeHost({ bundle = DEFAULT_BUNDLE, trustDir = DEFAULT_TRUST_DIR
2111
2136
  outboxBodies[friendId] = outbox[friendId].map((id) => { try { return readJson(path.join(dir, `${id}.json`)).body } catch { return "" } }).join("\n---\n")
2112
2137
  }
2113
2138
  return {
2139
+ routed,
2114
2140
  outbox,
2115
2141
  outboxBodies,
2116
2142
  stewardSha: hashOf(policy),
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1358",
2
+ "runtimeVersion": "0.1.0-alpha.1361",
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.1358</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1361</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,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1358",
3
+ "version": "0.1.0-alpha.1361",
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.1358",
9
+ "version": "0.1.0-alpha.1361",
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.1358",
3
+ "version": "0.1.0-alpha.1361",
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": {