@ouro.bot/cli 0.1.0-alpha.1126 → 0.1.0-alpha.1128

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,18 @@
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.1128",
6
+ "changes": [
7
+ "An await the agent files from its private runtime is no longer cancelled on its first check, and a blocked await send tells the agent why and that it can message the person itself, then cancel the await."
8
+ ]
9
+ },
10
+ {
11
+ "version": "0.1.0-alpha.1127",
12
+ "changes": [
13
+ "The replay gate no longer rolls back a release on one slow network fetch: a slow first sync timing takes two more read-only turns and judges the median."
14
+ ]
15
+ },
4
16
  {
5
17
  "version": "0.1.0-alpha.1126",
6
18
  "changes": [
@@ -51,6 +51,8 @@ export const SYNC_LOCK_MALFORMED_MS = 30 * 1000
51
51
  // The sync path inside the container, as src/heart/sync.ts's SYNC_SSH_COMMAND.
52
52
  export const SYNC_SSH_COMMAND = "sudo -n -u ouro-sync /usr/local/libexec/ouro-sync-ssh"
53
53
  export const SYNC_LATENCY_LIMIT_MS = 2000
54
+ /** Turns timed when the first is slow; the median is judged. */
55
+ export const SYNC_LATENCY_TURNS = 3
54
56
  export const SYNC_EVENTS_WAIT_MS = 60 * 1000
55
57
  export const SYNC_EVENTS_POLL_MS = 2000
56
58
  export const LATENCY_WORDS = "(replay) what time is it?"
@@ -1138,25 +1140,48 @@ export function syncIntervals(events) {
1138
1140
  return { pull, commit, complete: pull.ms !== null && commit.ms !== null }
1139
1141
  }
1140
1142
 
1141
- /**
1142
- * The check `sync latency`: one read-only turn after the cases, inside the bracket (the residue check reads its commits too). Its
1143
- * pre-turn pull and its synchronous post-turn commit each stay under two seconds; the network push is not timed.
1144
- */
1145
- export async function syncLatencyResult(host) {
1143
+ /** One read-only turn, timed from its own sync events. */
1144
+ async function timedLatencyTurn(host) {
1146
1145
  const sync = host.sync
1147
1146
  const since = host.now()
1148
1147
  host.openWindow(10)
1149
1148
  let sent
1150
1149
  try { sent = await host.send({ who: "principal", text: LATENCY_WORDS, delegated: false, context: randomUUID() }) } finally { host.closeWindow() }
1151
- if (sent.error) return { id: "sync-latency", status: "fail", checks: [check("the read-only turn answered", false, sent.error)] }
1150
+ if (sent.error) return { error: sent.error }
1152
1151
  const deadline = host.now() + SYNC_EVENTS_WAIT_MS
1153
1152
  let intervals = syncIntervals(sync.events(since))
1154
1153
  while (!intervals.complete && host.now() < deadline) {
1155
1154
  await host.sleep(SYNC_EVENTS_POLL_MS)
1156
1155
  intervals = syncIntervals(sync.events(since))
1157
1156
  }
1158
- const judge = (name, span) => check(`${name} took under ${SYNC_LATENCY_LIMIT_MS} ms`, span.ms !== null && span.ms < SYNC_LATENCY_LIMIT_MS, span.ms === null ? span.problem : `${span.ms} ms`)
1159
- const checks = [judge("the pre-turn pull (heart.sync_pull_start to heart.sync_pull_end)", intervals.pull), judge("the post-turn commit (heart.sync_push_start to heart.sync_commit_end)", intervals.commit)]
1157
+ return { intervals }
1158
+ }
1159
+
1160
+ /**
1161
+ * The check `sync latency`: a read-only turn after the cases, inside the bracket (the residue check reads its commits too). Its
1162
+ * pre-turn pull and its synchronous post-turn commit each stay under two seconds; the network push is not timed. The pull is a
1163
+ * network fetch, so one slow turn takes two more and the median of the three is judged: a slow network blip passes, sync that
1164
+ * is slow on most turns still blocks.
1165
+ */
1166
+ export async function syncLatencyResult(host) {
1167
+ const fast = (span) => span.ms !== null && span.ms < SYNC_LATENCY_LIMIT_MS
1168
+ const turns = []
1169
+ for (let turn = 0; turn < SYNC_LATENCY_TURNS; turn += 1) {
1170
+ const timed = await timedLatencyTurn(host)
1171
+ if (timed.error) return { id: "sync-latency", status: "fail", checks: [check("the read-only turn answered", false, timed.error)] }
1172
+ turns.push(timed.intervals)
1173
+ const first = turns[0]
1174
+ if (!first.complete || (fast(first.pull) && fast(first.commit))) break
1175
+ }
1176
+ const median = (key) => {
1177
+ const spans = turns.map((intervals) => intervals[key])
1178
+ const missing = spans.find((span) => span.ms === null)
1179
+ if (missing) return missing
1180
+ const ms = spans.map((span) => span.ms).sort((a, b) => a - b)
1181
+ return { ms: ms[Math.floor(ms.length / 2)], detail: ms.length > 1 ? `median ${ms[Math.floor(ms.length / 2)]} ms of ${ms.join(", ")} ms` : `${ms[0]} ms` }
1182
+ }
1183
+ const judge = (name, span) => check(`${name} took under ${SYNC_LATENCY_LIMIT_MS} ms`, fast(span), span.ms === null ? span.problem : span.detail)
1184
+ const checks = [judge("the pre-turn pull (heart.sync_pull_start to heart.sync_pull_end)", median("pull")), judge("the post-turn commit (heart.sync_push_start to heart.sync_commit_end)", median("commit"))]
1160
1185
  return { id: "sync-latency", status: checks.every((entry) => entry.ok) ? "pass" : "fail", checks }
1161
1186
  }
1162
1187
 
@@ -1,5 +1,5 @@
1
1
  {
2
- "runtimeVersion": "0.1.0-alpha.1126",
2
+ "runtimeVersion": "0.1.0-alpha.1128",
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.1126</Repository>
4
+ <Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1128</Repository>
5
5
  <Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
6
6
  <Network>host</Network>
7
7
  <Shell>sh</Shell>
@@ -528,7 +528,14 @@ async function resolveAwaitTool(name, verdict, observation, agentRoot, agentName
528
528
  (0, runtime_1.emitNervesEvent)({ level: "error", component: "repertoire", event: "repertoire.await_alert_error", message: "await alert delivery threw", meta: { agent: agentName, name, error: error instanceof Error ? error.message : String(error) } });
529
529
  }
530
530
  if (alert?.delivery?.status !== "delivered_now") {
531
- return JSON.stringify({ verdict: "yes", archived: null, alert: alert ? { attempted: alert.attempted, status: alert.delivery?.status ?? null, skipped: alert.skipped ?? null } : null, advancedExternalEvents: [] });
531
+ const why = alert?.delivery?.detail ?? alert?.skipped ?? "the send failed";
532
+ return JSON.stringify({
533
+ verdict: "yes",
534
+ archived: null,
535
+ alert: alert ? { attempted: alert.attempted, status: alert.delivery?.status ?? null, skipped: alert.skipped ?? null } : null,
536
+ advancedExternalEvents: [],
537
+ note: `Not sent yet (${why}). The await stays open and I retry the send on its next check. I can also tell ${existing.filed_for_friend_id} myself on ${existing.filed_from}, then cancel_await "${name}".`,
538
+ });
532
539
  }
533
540
  }
534
541
  const advancedEvents = existing.filed_from === "external-event" && existing.filed_from_key && existing.wake_at
@@ -142,9 +142,10 @@ function relationshipAwaitCoordinates(awaitFile) {
142
142
  throw new InvalidRelationshipAwaitProvenanceError("Relationship await provenance is invalid");
143
143
  return { friendId: awaitFile.filed_for_friend_id, channel: "a2a", key: awaitFile.filed_from_key, requestId: null };
144
144
  }
145
- const isSystemAwait = awaitFile.filed_for_friend_id === null
145
+ // The agent's own awaits: filed from its private runtime, the CLI, or with no session at all. No relationship to honour.
146
+ const isSystemAwait = awaitFile.filed_from === "inner" || (awaitFile.filed_for_friend_id === null
146
147
  && awaitFile.filed_from_key === null
147
- && (awaitFile.filed_from === null || awaitFile.filed_from === "unknown" || awaitFile.filed_from === "cli");
148
+ && (awaitFile.filed_from === null || awaitFile.filed_from === "unknown" || awaitFile.filed_from === "cli"));
148
149
  if (isSystemAwait)
149
150
  return null;
150
151
  throw new InvalidRelationshipAwaitProvenanceError("Relationship await provenance is incomplete or legacy");
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1126",
3
+ "version": "0.1.0-alpha.1128",
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.1126",
9
+ "version": "0.1.0-alpha.1128",
10
10
  "dependencies": {
11
11
  "@anthropic-ai/sdk": "^0.78.0",
12
12
  "@ouro.bot/friends": "0.1.0-alpha.18",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ouro.bot/cli",
3
- "version": "0.1.0-alpha.1126",
3
+ "version": "0.1.0-alpha.1128",
4
4
  "engines": {
5
5
  "node": ">=22"
6
6
  },