Sync agent state from PC at 2026-05-15 16:32:18

This commit is contained in:
wangzhendong
2026-05-15 16:32:18 +08:00
parent 8e12d018dd
commit c090ee8359
11 changed files with 71 additions and 86 deletions

View File

@@ -19,7 +19,6 @@ Bring the Windows 11 always-on PC, Tencent Cloud VPS OpenClaw Gateway, phone Con
- Frozen website policy: strict freeze during ICP/public-security filing review. Agents must not change the `smartmotor.cloud` homepage, content reachable from homepage links, static assets, Nginx routing, bind mounts, container images, or `/opt/services/docker-composite.yml` entries that could alter public website output. - Frozen website policy: strict freeze during ICP/public-security filing review. Agents must not change the `smartmotor.cloud` homepage, content reachable from homepage links, static assets, Nginx routing, bind mounts, container images, or `/opt/services/docker-composite.yml` entries that could alter public website output.
- Communication MVP: use Git-backed polling sync scripts under `sync/` plus task files under `tasks/`. This reduces manual pull/push but is not the final async-notification design. - Communication MVP: use Git-backed polling sync scripts under `sync/` plus task files under `tasks/`. This reduces manual pull/push but is not the final async-notification design.
- Sync-health monitoring: CORRECTION monitors tracked heartbeat and error files under `sync-state/`; no separate sync monitor agent is used at this stage. - Sync-health monitoring: CORRECTION monitors tracked heartbeat and error files under `sync-state/`; no separate sync monitor agent is used at this stage.
- User-facing status entry: `USER_STATUS.md`. Users should not need to read internal task, handoff, evidence, or sync-state files for routine status.
- Future communication target: when the baseline path is stable, design an event-driven coordinator using Gitea webhooks, Gitea Issues, OpenClaw events, or Cursor SDK agent orchestration. - Future communication target: when the baseline path is stable, design an event-driven coordinator using Gitea webhooks, Gitea Issues, OpenClaw events, or Cursor SDK agent orchestration.
## Agent Roles ## Agent Roles
@@ -37,9 +36,8 @@ Bring the Windows 11 always-on PC, Tencent Cloud VPS OpenClaw Gateway, phone Con
| Gate | Required Evidence | Owner | Status | | Gate | Required Evidence | Owner | Status |
|---|---|---|---| |---|---|---|---|
| G0A Collaboration mechanism aligned | User-approved agent roles, Git polling MVP, sync-health handling, status entry, and hard safety boundaries | ORCHESTRATOR | Done | | G0 Requirements aligned | User-approved mission, roles, and acceptance criteria | ORCHESTRATOR | Pending |
| G0B OpenClaw system requirements aligned | User-approved final system effect, component responsibilities, PC execution permissions, Tailscale role, phone Control UI path, later channels, and G2/G3/G4 acceptance criteria | ORCHESTRATOR | Pending | | G1 Baseline discovered | PC and VPS read-only status snapshots | PC_EXECUTOR, VPS_EXECUTOR, verifiers | Pending |
| G1 Baseline discovered | PC and VPS read-only status snapshots accepted by independent verifiers | PC_EXECUTOR, VPS_EXECUTOR, verifiers | Done |
| G2 Gateway/node pairing ready | PC `node run` evidence and VPS approval evidence | PC_EXECUTOR, VPS_EXECUTOR | Pending | | G2 Gateway/node pairing ready | PC `node run` evidence and VPS approval evidence | PC_EXECUTOR, VPS_EXECUTOR | Pending |
| G3 Execution smoke test | Harmless command result proves execution came from the PC node | PC_VERIFIER | Pending | | G3 Execution smoke test | Harmless command result proves execution came from the PC node | PC_VERIFIER | Pending |
| G4 Persistent service verified | `node install/start/status` and reboot survival evidence | PC_VERIFIER, CORRECTION | Pending | | G4 Persistent service verified | `node install/start/status` and reboot survival evidence | PC_VERIFIER, CORRECTION | Pending |
@@ -53,26 +51,12 @@ Bring the Windows 11 always-on PC, Tencent Cloud VPS OpenClaw Gateway, phone Con
| T1 | Create standalone Gitea repo for this control plane | User + ORCHESTRATOR | T0 | Done | | T1 | Create standalone Gitea repo for this control plane | User + ORCHESTRATOR | T0 | Done |
| T2 | Sync this scaffold to Gitea and open on PC/VPS Cursor | ORCHESTRATOR + VPS_EXECUTOR | T1 | Done | | T2 | Sync this scaffold to Gitea and open on PC/VPS Cursor | ORCHESTRATOR + VPS_EXECUTOR | T1 | Done |
| T2.1 | Add polling sync and task-file communication MVP | ORCHESTRATOR | T2 | In Progress | | T2.1 | Add polling sync and task-file communication MVP | ORCHESTRATOR | T2 | In Progress |
| T3 | Run read-only PC baseline discovery | PC_EXECUTOR | T2.1 | Accepted | | T3 | Run read-only PC baseline discovery | PC_EXECUTOR | T2.1 | Ready |
| T4 | Run read-only VPS baseline discovery | VPS_EXECUTOR | T2.1 | Accepted | | T4 | Run read-only VPS baseline discovery | VPS_EXECUTOR | T2.1 | Ready |
| T5 | Verify PC baseline before any PC change | PC_VERIFIER | T3 | Accepted | | T5 | Verify both baselines before any config change | PC_VERIFIER + VPS_VERIFIER | T3, T4 | Pending |
| T6 | Verify VPS baseline before any VPS change | VPS_VERIFIER | T4 | Accepted |
| T7 | Monitor drift, sync-health failures, conflicts, unsafe changes, and missing evidence | CORRECTION | G0A | Claimed |
## Acceptance Criteria Draft ## Acceptance Criteria Draft
G0B is still pending. Before G2 can open, ORCHESTRATOR must discuss and freeze:
- Final effect: how phone, PC, and VPS should collaborate through OpenClaw.
- Responsibility boundaries for the VPS Gateway, DeepSeek, and the Docker stack.
- Windows PC execution-node allowed capabilities and forbidden capabilities.
- Whether Tailscale is an optional enhancement or a required prerequisite.
- Phone Control UI access path and acceptance method.
- Whether QQ or later channels are included in the current stage or deferred.
- Concrete acceptance criteria for G2 Gateway/node pairing, G3 execution smoke test, and G4 persistent service verification.
Existing draft outcomes:
- The PC can act as an OpenClaw execution node connected to the existing Gateway. - The PC can act as an OpenClaw execution node connected to the existing Gateway.
- The Gateway continues to coexist with Nginx, Gitea, Confluence, and Postgres on the VPS. - The Gateway continues to coexist with Nginx, Gitea, Confluence, and Postgres on the VPS.
- The existing `smartmotor.cloud` website content remains unchanged during filing review, including homepage content and linked content reachable from the homepage. - The existing `smartmotor.cloud` website content remains unchanged during filing review, including homepage content and linked content reachable from the homepage.
@@ -89,7 +73,6 @@ Existing draft outcomes:
- VPS-related agents must treat the `smartmotor.cloud` website defined by `/opt/services/docker-composite.yml` as frozen: no edits to homepage content, linked page content, routing, static assets, bind mounts, container images, or Nginx rules that could alter what public visitors see. - VPS-related agents must treat the `smartmotor.cloud` website defined by `/opt/services/docker-composite.yml` as frozen: no edits to homepage content, linked page content, routing, static assets, bind mounts, container images, or Nginx rules that could alter what public visitors see.
- Polling sync scripts are convenience automation only. If they report conflict, authentication failure, or unexpected files, stop and let CORRECTION review. - Polling sync scripts are convenience automation only. If they report conflict, authentication failure, or unexpected files, stop and let CORRECTION review.
- Sync scripts must publish non-secret heartbeat/error status under `sync-state/`. Heartbeat older than 2 minutes is warning; older than 5 minutes is blocked. - Sync scripts must publish non-secret heartbeat/error status under `sync-state/`. Heartbeat older than 2 minutes is warning; older than 5 minutes is blocked.
- Keep `USER_STATUS.md` updated as the concise user-facing status page; `AGENT_BOARD.md` and `tasks/*.md` remain internal agent ledgers.
- Task files under `tasks/` are the agent-to-agent work contract. Chat messages are not the source of truth. - Task files under `tasks/` are the agent-to-agent work contract. Chat messages are not the source of truth.
- Any system-level change requires a rollback note before execution. - Any system-level change requires a rollback note before execution.
- Any blocking issue must be recorded in the relevant handoff file and surfaced to ORCHESTRATOR. - Any blocking issue must be recorded in the relevant handoff file and surfaced to ORCHESTRATOR.

View File

@@ -38,9 +38,4 @@ Detect drift, unsafe assumptions, missing evidence, sync-health failures, confli
## Last Update ## Last Update
2026-05-15 16:03 UTC+8 sync-health check completed after `git pull`. Template created during control-plane bootstrap.
- `sync-state/heartbeat-pc.json`: present, status `clean`, age about 41 seconds at check time.
- `sync-state/heartbeat-vps.json`: present, status `clean`, age about 52 seconds at check time.
- `sync-state/error-*.md`: none present.
- Decision: sync-health is not blocked; any prior sync-health blocked state is cleared. T7 remains `claimed` for ongoing CORRECTION monitoring.

View File

@@ -21,23 +21,17 @@ Bootstrap the shared Gitea-backed control plane, then coordinate read-only basel
- VPS target path: `/home/ubuntu/openclaw-control-plane`. - VPS target path: `/home/ubuntu/openclaw-control-plane`.
- Access mode: HTTPS. - Access mode: HTTPS.
- Default branch: `main`. - Default branch: `main`.
- G0A collaboration mechanism is complete: the user confirmed agent roles, Git polling MVP, sync-health handling, `USER_STATUS.md` as user entry, and non-mutation/freeze boundaries.
- G0B OpenClaw system requirements are pending: final system effect, component responsibilities, PC execution permissions, Tailscale role, phone Control UI path, later channels, and G2/G3/G4 acceptance criteria must be discussed and frozen with the user.
- G1 baseline is complete: PC_VERIFIER accepted T5 and VPS_VERIFIER accepted T6.
- Strict `smartmotor.cloud` website freeze is a hard requirement during filing review. - Strict `smartmotor.cloud` website freeze is a hard requirement during filing review.
- Communication MVP uses polling Git sync scripts in `sync/` and task files in `tasks/`. - Communication MVP uses polling Git sync scripts in `sync/` and task files in `tasks/`.
- Sync-health recovered; T7 is no longer blocked and remains claimed for ongoing CORRECTION monitoring.
- Mutation-stage work and G2 are not authorized while G0B is pending.
- `USER_STATUS.md` is the user-facing status entry; internal agent ledgers should not be required reading for the user.
- The polling sync is intentionally temporary; design an async notification/coordinator layer when PC/VPS baseline work is stable. - The polling sync is intentionally temporary; design an async notification/coordinator layer when PC/VPS baseline work is stable.
## Next Actions ## Next Actions
1. Complete G0B with the user before opening G2. 1. Commit and push the communication MVP files to Gitea.
2. Keep T7 active for CORRECTION monitoring of sync-health, drift, missing evidence, and freeze-policy risk. 2. Ask the user to start or approve starting one sync script on PC and one on VPS.
3. Keep `USER_STATUS.md` current when gate, blocker, heartbeat, or required user decision changes. 3. Run G0 requirements and acceptance review with the user.
4. Track the VPS verifier follow-up observations before any future mutation task: service path naming drift and Nginx route/config anomaly. 4. Assign PC and VPS read-only baseline tasks in their respective Cursor windows.
5. Do not open G2 or any mutation-stage task until G0B is accepted and the user explicitly authorizes the next stage. 5. Require verifier review before any mutation.
## Open Questions ## Open Questions
@@ -47,4 +41,4 @@ Bootstrap the shared Gitea-backed control plane, then coordinate read-only basel
## Last Update ## Last Update
Corrected gate model: G0A is complete, G0B is pending, and G1 baseline remains complete. G2 and mutation-stage work remain unauthorized until OpenClaw system requirements and acceptance criteria are confirmed with the user. Control-plane repository scaffold prepared locally.

View File

@@ -13,24 +13,14 @@ Independently validate PC-side execution results. Prefer read-only checks and ev
## Current State ## Current State
- PC baseline evidence `evidence/pc-baseline-20260515.md` reviewed and accepted for the PC half of G1. - Waiting for PC_EXECUTOR baseline evidence.
- Review scope was limited to independent read-only validation of T3 PC baseline evidence.
## Review Result - 2026-05-15
- `git pull` completed before review; repository was already up to date.
- PC_EXECUTOR baseline evidence includes required `openclaw --version`, `openclaw node --help`, Tailscale executable/status summary, outbound Gateway TCP 443 test, and public port exposure check.
- PC_EXECUTOR did not mark its own work accepted; the evidence says it is ready for PC_VERIFIER review.
- No token was set, printed, or written in the reviewed evidence.
- No executed `openclaw node run`, `install`, `start`, `stop`, `restart`, or `uninstall` command was found. Those words only appear in `openclaw node --help` output/examples.
- No evidence of PC service, scheduled task, firewall rule, environment variable, OpenClaw config, or public port exposure mutation was found.
- Verdict: accepted.
## Next Actions ## Next Actions
1. Wait for ORCHESTRATOR to count the PC half of G1 as accepted. 1. Review `evidence/pc-*` after PC_EXECUTOR completes baseline discovery.
2. Do not mutate PC configuration unless explicitly reassigned as an executor. 2. Record pass/fail findings in this file and, if needed, `evidence/verify-pc-*`.
3. Do not mutate PC configuration unless explicitly reassigned as an executor.
## Last Update ## Last Update
2026-05-15: PC baseline independent review accepted. No PC configuration was changed by PC_VERIFIER. Template created during control-plane bootstrap.

View File

@@ -14,21 +14,14 @@ Independently validate VPS-side execution results. Prefer read-only checks and e
## Current State ## Current State
- VPS baseline evidence reviewed on 2026-05-15. - Waiting for VPS_EXECUTOR baseline evidence.
- Verdict: accepted for G1/T6 with follow-up observations; no VPS configuration changes are approved by verifier evidence.
- Verification evidence: `evidence/verify-vps-baseline-20260515.md`.
- Confirmed observations:
- Gateway, Docker, Nginx, Gitea, Confluence, and Postgres were observed healthy/running as applicable.
- OpenClaw approval-related CLI commands were verified with `--help` only; no approval, restart, reload, token rotation, or config mutation was performed.
- `/opt/service` and `/opt/services/docker-composite.yml` were absent; `/opt/services` and `/opt/services/docker-compose.openclaw.yml` were present.
- `nginx-proxy` had an empty mounted `/etc/nginx/conf.d`, and `nginx -T` showed no `openclaw.smartmotor.cloud`, `proxy_pass`, or `server_name` matches, while public endpoints still returned expected statuses.
- No reviewed evidence secret value was identified.
## Next Actions ## Next Actions
1. Ask ORCHESTRATOR/CORRECTION to track the service-path and Nginx-route anomalies before any future mutation task. 1. Review `evidence/vps-*` after VPS_EXECUTOR completes baseline discovery.
2. Do not mutate VPS configuration unless explicitly reassigned as an executor. 2. Record pass/fail findings in this file and, if needed, `evidence/verify-vps-*`.
3. Do not mutate VPS configuration unless explicitly reassigned as an executor.
## Last Update ## Last Update
2026-05-15: VPS baseline independently verified and accepted with follow-up observations. Template created during control-plane bootstrap.

View File

@@ -1,8 +1,8 @@
{ {
"host": "pc", "host": "pc",
"time": "2026-05-15T16:25:55+08:00", "time": "2026-05-15T16:32:17+08:00",
"branch": "main", "branch": "main",
"head": "9ad0008", "head": "8e12d01",
"status": "dirty", "status": "dirty",
"intervalSeconds": 30, "intervalSeconds": 30,
"heartbeatEverySeconds": 60 "heartbeatEverySeconds": 60

View File

@@ -13,7 +13,6 @@ $HeartbeatFile = Join-Path $PublicStateDir "heartbeat-pc.json"
$ErrorFile = Join-Path $PublicStateDir "error-pc.md" $ErrorFile = Join-Path $PublicStateDir "error-pc.md"
$AllowedPaths = @( $AllowedPaths = @(
"AGENT_BOARD.md", "AGENT_BOARD.md",
"USER_STATUS.md",
"README.md", "README.md",
".cursor/rules", ".cursor/rules",
"handoff", "handoff",
@@ -67,6 +66,26 @@ function Invoke-Git {
} }
} }
function Remove-StaleSyncError {
if (Test-Path $ErrorFile) {
Remove-Item $ErrorFile -Force
}
}
function Push-WithRetry {
& git push
if ($LASTEXITCODE -eq 0) {
return
}
# Another agent may have pushed between our pull and push. Rebase once and retry.
Invoke-Git @("pull", "--rebase", "--autostash")
if (Test-ConflictMarkers) {
throw "merge or rebase conflicts detected after push retry"
}
Invoke-Git @("push")
}
function Get-AllowedChanges { function Get-AllowedChanges {
$changes = & git -C $RepoRoot status --porcelain $changes = & git -C $RepoRoot status --porcelain
if ($LASTEXITCODE -ne 0) { if ($LASTEXITCODE -ne 0) {
@@ -148,6 +167,7 @@ function Sync-Once {
throw "merge or rebase conflicts detected" throw "merge or rebase conflicts detected"
} }
Remove-StaleSyncError
Write-Heartbeat Write-Heartbeat
$allowedChanges = @(Get-AllowedChanges) $allowedChanges = @(Get-AllowedChanges)
@@ -171,15 +191,12 @@ function Sync-Once {
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss" $timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss"
Invoke-Git @("commit", "-m", "Sync agent state from PC at $timestamp") Invoke-Git @("commit", "-m", "Sync agent state from PC at $timestamp")
Invoke-Git @("push") Push-WithRetry
} }
do { do {
try { try {
Sync-Once Sync-Once
if (Test-Path $ErrorFile) {
Remove-Item $ErrorFile -Force
}
} }
catch { catch {
Write-SyncError $_.Exception.Message Write-SyncError $_.Exception.Message

View File

@@ -14,7 +14,6 @@ ERROR_FILE="$PUBLIC_STATE_DIR/error-vps.md"
ALLOWED_PATHS=( ALLOWED_PATHS=(
"AGENT_BOARD.md" "AGENT_BOARD.md"
"USER_STATUS.md"
"README.md" "README.md"
".cursor/rules" ".cursor/rules"
"handoff" "handoff"
@@ -110,6 +109,23 @@ has_conflicts() {
[[ -n "$(git diff --name-only --diff-filter=U)" ]] [[ -n "$(git diff --name-only --diff-filter=U)" ]]
} }
remove_stale_sync_error() {
rm -f "$ERROR_FILE"
}
push_with_retry() {
if git push; then
return 0
fi
# Another agent may have pushed between our pull and push. Rebase once and retry.
git pull --rebase --autostash
if has_conflicts; then
return 20
fi
git push
}
sync_once() { sync_once() {
cd "$REPO_ROOT" cd "$REPO_ROOT"
ensure_state_dir ensure_state_dir
@@ -120,6 +136,7 @@ sync_once() {
return 20 return 20
fi fi
remove_stale_sync_error
write_heartbeat write_heartbeat
if ! has_allowed_changes; then if ! has_allowed_changes; then
@@ -138,13 +155,11 @@ sync_once() {
fi fi
git commit -m "Sync agent state from VPS at $(date '+%Y-%m-%d %H:%M:%S')" git commit -m "Sync agent state from VPS at $(date '+%Y-%m-%d %H:%M:%S')"
git push push_with_retry
} }
while true; do while true; do
if sync_once; then if ! sync_once; then
rm -f "$ERROR_FILE"
else
exit_code="$?" exit_code="$?"
write_sync_error "sync failed with exit code $exit_code" write_sync_error "sync failed with exit code $exit_code"
echo "sync failed with exit code $exit_code" >&2 echo "sync failed with exit code $exit_code" >&2

View File

@@ -2,7 +2,7 @@
## Status ## Status
accepted ready
## Owner ## Owner

View File

@@ -2,7 +2,7 @@
## Status ## Status
accepted ready
## Owner ## Owner

View File

@@ -28,13 +28,11 @@ This task does not authorize PC or VPS configuration mutation. CORRECTION may bl
## Monitoring Findings ## Monitoring Findings
- 2026-05-15 16:03 UTC+8: Re-ran sync-health after `git pull`. `sync-state/heartbeat-pc.json` and `sync-state/heartbeat-vps.json` both exist, both report `clean`, and both were under 5 minutes old at check time. No `sync-state/error-*.md` files were present. Sync-health blocked state is cleared; T7 remains `claimed` for ongoing CORRECTION monitoring.
- 2026-05-15 16:14 UTC+8: ORCHESTRATOR refreshed after `git pull`; repository was already up to date. `sync-state/heartbeat-pc.json` and `sync-state/heartbeat-vps.json` both report `clean`, and no `sync-state/error-*.md` files are present. PC baseline and VPS baseline have both been accepted by independent verifiers, so G1 can be treated as complete. Mutation-stage work remains unauthorized in this session.
- 2026-05-15 11:42 UTC+8: Read `AGENT_BOARD.md`, `README.md`, `.cursor/rules/agent-orchestration.mdc`, this task, and all relevant PC/VPS handoffs and baseline tasks. - 2026-05-15 11:42 UTC+8: Read `AGENT_BOARD.md`, `README.md`, `.cursor/rules/agent-orchestration.mdc`, this task, and all relevant PC/VPS handoffs and baseline tasks.
- Current state: T3/T4/T5/T6 are `accepted`; T7 remains `claimed`. - Current state: T3/T4 are `ready`, T5/T6 are `draft`, and G1 remains pending.
- Evidence state: PC baseline, VPS baseline, and VPS verifier evidence are present. PC verifier acceptance is recorded in `tasks/T5-PC-baseline-verify.md` and `handoff/PC_VERIFIER.md`. - Evidence state: only `evidence/README.md` exists; no PC/VPS baseline or verifier evidence exists yet.
- No executor overreach, frozen `smartmotor.cloud` website mutation, pre-G1 configuration mutation, rollback-note gap, sync conflict, or secret-bearing evidence was detected in tracked repository contents. - No executor overreach, frozen `smartmotor.cloud` website mutation, pre-G1 configuration mutation, rollback-note gap, sync conflict, or secret-bearing evidence was detected in tracked repository contents.
- Correction decision: no task is blocked in this pass, but no PC/VPS mutation-stage work is authorized until ORCHESTRATOR explicitly opens a later gate. - Correction decision: no task is blocked in this pass, but no PC/VPS mutation-stage work is authorized until G1 is independently verified and accepted.
## Stop Conditions ## Stop Conditions