mirror of
https://github.com/openclaw/openclaw.git
synced 2026-10-03 01:29:56 +00:00
Derive update inspection, candidate startup, activation, and finalization allowances from measured SQLite state, observed startup, plugin count, and the caller's step budget. Forward the owning allowance through service commands, readiness, Doctor, and migrated finalization instead of imposing competing short cutoffs. Keep metadata and progress probes cancellable in child processes. Preserve update-activation-timeout settlement, integrity checks, live authority, and unsettled-writer ownership. Expiry alone never authorizes rollback, restart, or lease release. Installer network operations share the documented allowance. No new configuration, dependencies, schema, retries, or persistent retention/recovery semantics. The activation regression failed with the original resolver and passed with the repair; focused proof passed 102 tests in six files. Native POSIX FIFO cancellation and Chrome boundary proof are recorded in the PR. CI 34767727811 passed 129 jobs with 11 skips on a verified current-base merge checkout. The final refresh commit is tree-identical to the reviewed source. The maintainer accepts longer recovery waits and the incomplete slow-state published-driver/native Windows recovery qualification. An already-installed driver retains its loaded timers; containing-release delivery and reporter recovery remain unverified. Reported by @rlosito (#146637); the initiating timeout cause remains unproved. Related update-timeout reports are tracked in #145252. Refs #144758 #144901 #144890 #143292 #146637 #145252. Preserves the activation boundary from #147019.
36 lines
1.4 KiB
JavaScript
36 lines
1.4 KiB
JavaScript
#!/usr/bin/env node
|
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
import { UPDATE_NETWORK_TIMEOUT_MS } from "../src/infra/update-network-budget.ts";
|
|
|
|
const check = process.argv.includes("--check");
|
|
const seconds = UPDATE_NETWORK_TIMEOUT_MS / 1000;
|
|
const start = "# BEGIN GENERATED UPDATE NETWORK BUDGET";
|
|
const end = "# END GENERATED UPDATE NETWORK BUDGET";
|
|
for (const file of ["scripts/install.sh", "scripts/install-cli.sh", "scripts/install.ps1"]) {
|
|
const powershell = file.endsWith(".ps1");
|
|
const block = [
|
|
start,
|
|
"# Source: src/infra/update-network-budget.ts; regenerate: node scripts/generate-update-network-budget.mjs",
|
|
powershell
|
|
? `$script:UpdateNetworkTimeoutSeconds = ${seconds}`
|
|
: `UPDATE_NETWORK_TIMEOUT_SECONDS=${seconds}`,
|
|
end,
|
|
].join("\n");
|
|
const current = readFileSync(file, "utf8");
|
|
const anchor = powershell ? '$ErrorActionPreference = "Stop"\n' : "set -euo pipefail\n";
|
|
const next = current.includes(start)
|
|
? current.replace(new RegExp(`${start}[\\s\\S]*?${end}`, "u"), block)
|
|
: current.replace(anchor, `${anchor}\n${block}\n`);
|
|
if (!next.includes(block)) {
|
|
throw new Error(`Missing update network budget anchor in ${file}`);
|
|
}
|
|
if (current === next) {
|
|
continue;
|
|
}
|
|
if (check) {
|
|
console.error(`${file} is stale; run node scripts/generate-update-network-budget.mjs`);
|
|
process.exitCode = 1;
|
|
} else {
|
|
writeFileSync(file, next);
|
|
}
|
|
}
|