diff --git a/archive/20260515-coach-bootstrap.md b/archive/20260515-coach-bootstrap.md new file mode 100644 index 0000000..8eb8545 --- /dev/null +++ b/archive/20260515-coach-bootstrap.md @@ -0,0 +1,20 @@ +# 2026-05-15 COACH Bootstrap + +## Context + +The user reported that the multi-agent workflow was becoming hard to follow because internal task IDs, sync failures, and cross-window coordination required too much manual intervention. + +## Decision + +Add COACH as a guidance role carried by the main user-facing chat. Do not open a separate COACH agent by default. + +## Outcomes + +- `USER_STATUS.md` becomes the user-facing state page. +- ORCHESTRATOR remains responsible for task state and acceptance gates. +- CORRECTION remains responsible for sync-health and drift monitoring. +- COACH focuses on usability, next-action clarity, session freeze, and knowledge capture. + +## Follow-Up + +Before entering OpenClaw connection/setup work, confirm the target system design and acceptance criteria with the user. diff --git a/archive/README.md b/archive/README.md new file mode 100644 index 0000000..4e611a5 --- /dev/null +++ b/archive/README.md @@ -0,0 +1,18 @@ +# Archive + +Use this directory for phase snapshots, incident summaries, and handoff freezes that are worth preserving as historical records. + +Naming: + +```text +YYYYMMDD-short-topic.md +``` + +Examples: + +```text +20260515-sync-heartbeat-incident.md +20260515-g0a-collaboration-mechanism.md +``` + +Archive notes should not contain secrets. diff --git a/docs/MULTI_AGENT_CURSOR_PLAYBOOK.md b/docs/MULTI_AGENT_CURSOR_PLAYBOOK.md new file mode 100644 index 0000000..38612af --- /dev/null +++ b/docs/MULTI_AGENT_CURSOR_PLAYBOOK.md @@ -0,0 +1,49 @@ +# Multi-Agent Cursor Playbook + +This playbook captures the OpenClaw control-plane practice so it can be reused for other long-running Cursor multi-agent tasks. + +## Core Pattern + +Use three layers: + +- User layer: `USER_STATUS.md` and COACH guidance. This is the only layer the user should need to read. +- Orchestration layer: `AGENT_BOARD.md`, `tasks/`, and role handoffs. ORCHESTRATOR owns this layer. +- Evidence layer: `evidence/`, `rollback/`, `sync-state/`, and phase archives. Executors and verifiers write durable facts here. + +## Cursor Window Layout + +Recommended windows: + +- COACH window: main user conversation, guidance, workflow design, and knowledge capture. +- PC control-plane window: ORCHESTRATOR, CORRECTION, PC executor/verifier roles. +- VPS control-plane window: VPS executor/verifier roles. +- Dedicated terminals: PC and VPS sync scripts. Do not let normal chat agents own these long-running terminals. + +## Role Boundaries + +- ORCHESTRATOR owns requirements, task split, dependency state, and acceptance gates. +- EXECUTOR roles do only assigned work and do not accept their own output. +- VERIFIER roles independently review evidence. +- CORRECTION detects drift, sync-health failures, safety violations, and missing evidence. +- COACH helps the user navigate the workflow and preserves lessons learned. + +## Communication + +The MVP uses Git polling: + +- PC script: `sync/sync-agent.ps1` +- VPS script: `sync/sync-agent.sh` +- Health files: `sync-state/heartbeat-*.json` and `sync-state/error-*.md` + +Git is the durable source of truth. It is not a real-time message bus. Upgrade later to webhooks, Gitea Issues, OpenClaw events, or a Cursor SDK coordinator. + +## Safety Gates + +- Freeze `smartmotor.cloud` website output during filing review. +- Do not store secrets in files, evidence, commits, or chat. +- Do not enter mutation stages while sync health is blocked. +- Require rollback notes before persistent service, routing, firewall, Docker, or environment changes. + +## User Experience Rule + +Do not ask the user to manage internal task numbers. When status is confusing, update `USER_STATUS.md` and give one next action. diff --git a/docs/SESSION_FREEZE_PROTOCOL.md b/docs/SESSION_FREEZE_PROTOCOL.md new file mode 100644 index 0000000..9d93683 --- /dev/null +++ b/docs/SESSION_FREEZE_PROTOCOL.md @@ -0,0 +1,50 @@ +# Session Freeze Protocol + +Session freeze is how long Cursor agent work survives context exhaustion, window changes, and human interruptions. + +## When To Freeze + +Freeze before: + +- A chat window approaches context exhaustion. +- A role finishes a phase or hands work to another role. +- The user reports confusion or asks for a status reset. +- A significant incident occurs, such as sync failure, credential friction, or a blocked safety gate. + +## Required Freeze Outputs + +Update: + +- `USER_STATUS.md`: human-facing current state and single next action. +- Relevant `handoff/*.md`: role-specific state and next owner. +- Relevant `tasks/*.md`: machine-readable task status. +- `knowledge/LESSONS_LEARNED.md`: reusable insight from the session. + +Create archive note when useful: + +```text +archive/YYYYMMDD-short-topic.md +``` + +## Freeze Template + +```text +Current phase: +Completed: +Blocked: +Safety constraints: +Next owner: +Single next action: +Files updated: +Resume prompt: +``` + +## Resume Prompt + +Every freeze should leave a prompt that a new session can use: + +```text +You are resuming the OpenClaw COACH/ORCHESTRATOR workflow. +Read USER_STATUS.md, AGENT_BOARD.md, relevant handoff files, sync-state/README.md, and knowledge/LESSONS_LEARNED.md. +Do not start mutation work unless USER_STATUS.md and AGENT_BOARD.md both allow it. +``` diff --git a/knowledge/LESSONS_LEARNED.md b/knowledge/LESSONS_LEARNED.md new file mode 100644 index 0000000..32dd5d6 --- /dev/null +++ b/knowledge/LESSONS_LEARNED.md @@ -0,0 +1,14 @@ +# Lessons Learned + +Reusable lessons from this OpenClaw multi-agent Cursor workflow. + +## 2026-05-15 + +- A public Gitea repository can be cloned anonymously over HTTPS, but push still requires credentials. Do not treat clone success as sync readiness. +- Cursor's Git askpass can surface authentication failures differently from a normal terminal. Use explicit credential setup or SSH remote when long-running sync scripts need push access. +- Git polling is useful as an MVP control plane, but it needs heartbeat files and CORRECTION monitoring. Otherwise silent sync failure makes agents reason from stale state. +- Push can be rejected when PC and VPS sync scripts race. Sync scripts should rebase and retry once before blocking. +- The user should not manage internal task IDs such as `T3` or `T7`. Maintain `USER_STATUS.md` as the user-facing status page. +- COACH and ORCHESTRATOR should remain separate roles: ORCHESTRATOR manages tasks; COACH manages usability, method, and knowledge capture. +- Sync scripts are infrastructure and should not be owned by normal chat agents. They should remain in dedicated terminals for now and later become managed services after safety gates allow persistence. +- Session freeze is mandatory for long-running work. Handoff files and lessons are more reliable than chat memory. diff --git a/sync-state/heartbeat-pc.json b/sync-state/heartbeat-pc.json index e6d03a5..903d655 100644 --- a/sync-state/heartbeat-pc.json +++ b/sync-state/heartbeat-pc.json @@ -1,8 +1,8 @@ { "host": "pc", - "time": "2026-05-15T16:49:32+08:00", + "time": "2026-05-15T16:49:51+08:00", "branch": "main", - "head": "e8640ea", + "head": "787cd33", "status": "dirty", "intervalSeconds": 30, "heartbeatEverySeconds": 60