@ouro.bot/cli 0.1.0-alpha.1126 → 0.1.0-alpha.1127
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.1127",
|
|
6
|
+
"changes": [
|
|
7
|
+
"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."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
4
10
|
{
|
|
5
11
|
"version": "0.1.0-alpha.1126",
|
|
6
12
|
"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
|
-
|
|
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 {
|
|
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
|
-
|
|
1159
|
-
|
|
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,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.1127</Repository>
|
|
5
5
|
<Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
|
|
6
6
|
<Network>host</Network>
|
|
7
7
|
<Shell>sh</Shell>
|
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.1127",
|
|
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.1127",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@anthropic-ai/sdk": "^0.78.0",
|
|
12
12
|
"@ouro.bot/friends": "0.1.0-alpha.18",
|