Skip to content

Commit 2ace363

Browse files
authored
feat: add live updater maintainer skill (#104202)
* feat: add live updater maintainer skill * fix: restore updater dependencies before probes
1 parent 82abf72 commit 2ace363

7 files changed

Lines changed: 1569 additions & 11 deletions

File tree

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
---
2+
name: openclaw-live-updater
3+
description: "Maintain the canonical live OpenClaw main checkout, managed Gateway, local macOS app, exact-head main CI, and recurring full release validation. Use for fast-forward update heartbeats, post-update runtime verification, attributable CI repair and repo-native landing, or non-publishing Full Release Validation of current main."
4+
---
5+
6+
# OpenClaw Live Updater
7+
8+
Keep `/Users/steipete/openclaw` a read-only-to-the-agent deployment mirror: clean, standalone, full, on `main`, and fast-forwarded only. Make every repair in the controlling Codex project worktree.
9+
10+
## Boundaries
11+
12+
- Report only in the controlling Codex thread. Never send Slack, Discord, email, or other external messages.
13+
- Never release, tag, bump versions, publish npm, create a GitHub Release, rotate credentials, or weaken a gate.
14+
- Escalate only irreversible or materially risky security, privacy, auth, destructive migration/data-loss, protocol-version, credential-rotation, dependency patch/override, or product choices.
15+
- Diagnose ordinary update, runtime, app, CI, test, and release-validation failures; fix them through a focused PR; prove exact head; land with `scripts/pr`.
16+
- Never edit, stash, reset, clean, or create a branch in the live mirror.
17+
18+
## Fast Update And Maintenance
19+
20+
1. Run the deterministic updater and retain its JSON:
21+
22+
```bash
23+
node .agents/skills/openclaw-live-updater/scripts/update-main.mjs
24+
```
25+
26+
Stop on any failed invariant. Do not repair the mirror destructively. The helper holds one checkout-scoped lock across update, build, Gateway proof, and Mac work. A concurrent heartbeat returns `reason: "overlap"`; it must not start another build. A dead owner lock may be recovered, but unreadable or unsafe lock state fails closed.
27+
28+
2. The helper verifies one unrewritten expected origin, an owned non-symlinked standalone/full clone, single worktree, clean `main`, fetches `origin/main`, rechecks for concurrent changes, and merges `--ff-only`. It then uses the source runner's canonical local-build metadata contract and parser: both `dist/.buildstamp` and `dist/.runtime-postbuildstamp` heads, required runtime-postbuild outputs, `dist/entry.js`, Control UI index plus referenced local assets, and `dist/build-info.json` must all match exact `afterSha`.
29+
30+
- Every successful update sets `actions.gatewayBuild` and rebuilds exact new `main` before any restart.
31+
- Missing, invalid, or stale build output also forces a build, even when Git did not move.
32+
- A dependency-input change, absent `node_modules`, or missing/invalid build provenance first runs `pnpm install --frozen-lockfile`.
33+
- `pnpm build` must leave both canonical stamp heads and `dist/build-info.json.commit` equal to post-update `afterSha`; any missing/mismatched stamp or required artifact blocks restart.
34+
- Only after exact-SHA build proof may it restart the managed Gateway and require `gateway status --deep --require-rpc --json` plus `health --verbose --json`.
35+
36+
Treat supervisor state alone as insufficient. If build or proof fails, leave the new mirror head intact and retry the stale/missing build on the next heartbeat; never run the old `dist` against new source.
37+
38+
Re-run the canonical freshness check immediately before every `pnpm openclaw` restart or probe so the source runner cannot hide stale output with an implicit auto-build. Every pass, including a no-update/current-build pass, must run deep RPC status and verbose health. If that first probe fails while the build is already exact-current, perform one managed Gateway restart and repeat both probes once. Do not rebuild a current exact-SHA artifact merely to self-heal the managed process; fail and diagnose if the one restart does not recover it.
39+
40+
3. If changed paths can affect macOS, the helper runs `scripts/restart-mac.sh --sign --wait --target-only` only after the exact-SHA JS/UI build completes. Target-only mode may stop the canonical `/Applications/OpenClaw.app` process and this checkout's exact `dist` process before launching the rebuilt `dist` app. It defers when another worktree, temporary bundle, test, or agent-owned OpenClaw process is active; it never kills that process. The script's immediate `OK` is not proof. The helper waits and requires the exact executable `/Users/steipete/openclaw/dist/OpenClaw.app/Contents/MacOS/OpenClaw`, then repeats Gateway RPC and health proof.
41+
42+
Never kill another worktree, temporary bundle, test, or agent-owned OpenClaw process. If a foreign app prevents the exact target from staying alive, record the pending Mac attempt, report it, and retry on the next heartbeat. Escalate only after the conflict persists across repeated heartbeats; never claim Mac proof from another bundle or the short launch check. If `actions.macUiVerification` is true, exercise the changed behavior with the existing macOS/UI automation workflow after delayed exact-bundle proof.
43+
44+
4. Load `$openclaw-testing`. Resolve exact current `origin/main`, then inspect only relevant required checks and workflow jobs whose `headSha` equals it. Ignore skipped jobs and routine noise such as Auto response, Labeler, docs agents, performance advisory jobs, and stale/cancelled runs superseded by a newer run for the same SHA.
45+
46+
5. For an attributable failure, leave the mirror untouched. Use the controlling Codex worktree, trace the failed surface, add focused proof, run `$autoreview`, open a focused PR, and land through `$openclaw-pr-maintainer`'s exact `scripts/pr` sequence. Never weaken or bypass the failing gate. After landing, begin again at step 1 so the mirror, Gateway, app classification, and exact-head checks all converge on new `main`.
47+
48+
If no update, build repair, pending Mac retry, or exact-head failure exists, report a terse no-op with the SHA and proof checked.
49+
50+
## Full Release Validation
51+
52+
Load `$release-openclaw-ci` and `$openclaw-testing`. This is validation only, never release preparation or publication.
53+
54+
1. Treat 12 hours as wall-clock cadence, not per-SHA cadence. Inspect Full Release Validation runs from the last 12 hours and verify effective `release_profile=full`, `rerun_group=all`, and expected child-job shape. Any valid active or successful full/all umbrella in that window satisfies the cadence even if `main` advanced afterward. Never duplicate an active full/all run.
55+
2. Only when the cadence is due, confirm no full/all run is active, then snapshot exact current `origin/main` after checking mirror invariants. Run the provider-secret preflight without printing secrets and dispatch the trusted workflow once:
56+
57+
```bash
58+
gh workflow run full-release-validation.yml \
59+
--repo openclaw/openclaw \
60+
--ref main \
61+
-f ref=<exact-main-sha> \
62+
-f provider=openai \
63+
-f mode=both \
64+
-f release_profile=full \
65+
-f rerun_group=all
66+
```
67+
68+
3. Watch the parent with `release-ci-summary.mjs`; require its recorded target SHA and children to match the dispatch snapshot. Fetch logs only for failed or blocking jobs. Do not cancel unrelated release checks.
69+
4. For a code or harness failure, repair and land from the Codex worktree as above. Then target new exact `main` with the narrowest supported `rerun_group` that covers the failed child; use `live_suite_filter` for one live/E2E shard. A targeted recovery run does not create a second full/all cadence dispatch.
70+
5. Report exact SHA, parent and child run URLs/IDs, conclusions, repairs and landed PRs, targeted reruns, and any genuine proof gap. Do not write release evidence or publish artifacts unless separately authorized.
71+
72+
## Failure Discipline
73+
74+
- Recheck live mirror invariants before every mutation and after every fetch.
75+
- Attribute failures from exact SHA, job, logs, and current source. Provider or infrastructure flakes need independent proof before code edits.
76+
- Keep the task branch focused. No `CHANGELOG.md` change.
77+
- Finish with the mirror clean/on `main`, the Codex worktree clean on the expected branch, remote Testbox stopped, and every public GitHub write linked in the controlling thread.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
interface:
2+
display_name: "OpenClaw Live Updater"
3+
short_description: "Maintain live main, CI, gateway, and Mac app"
4+
default_prompt: "Use $openclaw-live-updater to fast-forward the canonical OpenClaw main mirror, verify the managed runtime and exact-head CI, repair failures through a PR, or run full release validation without publishing."

0 commit comments

Comments
 (0)