diff --git a/agent-bus/README.md b/agent-bus/README.md new file mode 100644 index 0000000..545324d --- /dev/null +++ b/agent-bus/README.md @@ -0,0 +1,19 @@ +# Agent Bus + +This folder is the optional asynchronous command and status bus for machines that participate in multi-agent work. + +## Structure + +- `commands//` - requested tasks for a machine. +- `results//` - task results written by that machine. +- `heartbeats/.md` - last known machine state. +- `locks/` - lock files for running tasks. + +## Rules + +- Do not store secrets. +- Prefer SSH for live control. +- Use this bus for durable, auditable handoff. +- Machine daemons must execute only allowed command types. +- Results should link to project files, commits, logs, or summaries. + diff --git a/agent-bus/commands/.gitkeep b/agent-bus/commands/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/agent-bus/commands/.gitkeep @@ -0,0 +1 @@ + diff --git a/agent-bus/heartbeats/.gitkeep b/agent-bus/heartbeats/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/agent-bus/heartbeats/.gitkeep @@ -0,0 +1 @@ + diff --git a/agent-bus/locks/.gitkeep b/agent-bus/locks/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/agent-bus/locks/.gitkeep @@ -0,0 +1 @@ + diff --git a/agent-bus/results/.gitkeep b/agent-bus/results/.gitkeep new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/agent-bus/results/.gitkeep @@ -0,0 +1 @@ + diff --git a/projects/garage/agent-log.md b/projects/garage/agent-log.md index 89f8dd3..262cf89 100644 --- a/projects/garage/agent-log.md +++ b/projects/garage/agent-log.md @@ -142,3 +142,12 @@ - Files changed: Added `skills/remote-visual-access.md`, `templates/remote-visual-access.md`, and updated global/project instructions. - Verified: Requirement captured without storing any camera/VNC credentials. - Next handoff: Inventory available cameras and choose VNC setup per machine, preferring TigerVNC where suitable. + +## 2026-05-24 - Multi-Machine Agent Orchestration Requirement + +- Machine: current Codex desktop machine. +- Agent: Codex. +- Summary: User asked how to coordinate agents on `wuu`, `qore`, and `pump` so this dialogue can issue commands, read changes, and orchestrate work across computers. +- Files changed: Added `skills/multi-machine-agent-orchestration.md`, `agent-bus/`, command/heartbeat templates, and `projects/garage/orchestration.md`; updated project computer map and TЗ. +- Verified: Architecture documented as SSH for live control plus GitHub command/status bus for durable async coordination. +- Next handoff: Document SSH access for `wuu`, `qore`, and `pump`, then start with SSH/tmux control before installing a persistent daemon. diff --git a/projects/garage/computers.md b/projects/garage/computers.md index c1834bd..61f5603 100644 --- a/projects/garage/computers.md +++ b/projects/garage/computers.md @@ -19,10 +19,11 @@ Track the three computers that contain scattered parts of the `garage` auto-simu | Name | Role | OS | Access Method | Local Repositories | Status | | --- | --- | --- | --- | --- | --- | -| Pump | expected final runtime computer; also source computer for existing project parts | unknown | unknown | unknown | known by name, needs inventory | +| pump | expected final runtime computer; also source computer for existing project parts | unknown | unknown | unknown | known by name, needs inventory | +| qore | source/work computer for garage project parts | unknown | unknown | unknown | needs access setup | +| wuu | source/work computer for garage project parts | unknown | unknown | unknown | needs access setup | | proxmox-192-168-1-60 | Proxmox host `prxmx`; contains LXC `git-stereowallnd` | Proxmox 9.1.11 | `https://192.168.1.60:8006`, root known outside repo | VMID 101 contains project repo source computer | reachable, needs VM/container inventory | | project-repos-192-168-1-66 | LXC `git-stereowallnd`; source computer with local project repositories | Linux container | SSH `airM1@192.168.1.66` with local key `/Users/post/.ssh/airM1_garage` | `/srv/git/StereoWallND.git`, `/srv/git/Kamaz_Cleaner.git` | reachable, inventory started | -| unknown-3 | source computer for existing project parts | unknown | unknown | unknown | needs identification | ## Required Inventory Per Computer @@ -44,7 +45,9 @@ Track the three computers that contain scattered parts of the `garage` auto-simu - Clone or inspect `/srv/git/StereoWallND.git` and `/srv/git/Kamaz_Cleaner.git` as `airM1`. - Add missing root `AGENTS.md` to `Kamaz_Cleaner` before active development. -- Identify name and role for the remaining unknown source computer. +- Document SSH access and roles for `wuu`, `qore`, and `pump`. +- Create heartbeat files for `wuu`, `qore`, and `pump`. +- Decide first implementation of the machine runner: SSH/tmux first, daemon later. - Inspect each computer for simulator-related repositories. - Inventory Proxmox at `192.168.1.60:8006` for VMs/containers related to `garage`. - Add each computer to `locations/`. diff --git a/projects/garage/orchestration.md b/projects/garage/orchestration.md new file mode 100644 index 0000000..b98984c --- /dev/null +++ b/projects/garage/orchestration.md @@ -0,0 +1,72 @@ +# Garage Agent Orchestration + +## Goal + +Coordinate work across `wuu`, `qore`, and `pump` so this Codex session or another controller can issue tasks, read status, and direct the merge/finish process for the auto-simulators. + +## Architecture + +Use: + +- SSH for live commands; +- GitHub `agent-bus/` for asynchronous commands, results, locks, and heartbeats; +- per-machine Git identity for commits; +- optional `tmux` sessions for long-running agent work; +- optional `garage-agent-runner` daemon after the command workflow is proven. + +## Machines + +| Machine | Role | Access | Status | +| --- | --- | --- | --- | +| pump | expected final simulator runtime computer | not documented yet | needs setup | +| qore | source/work computer | not documented yet | needs setup | +| wuu | source/work computer | not documented yet | needs setup | +| git-stereowallnd | LXC with bare Git repositories | SSH `airM1@192.168.1.66` | reachable | + +## Required Per-Machine Setup + +Each of `wuu`, `qore`, and `pump` should have: + +- SSH access from controller machine; +- Git installed; +- access to `krustophski/agent-knowledge-base`; +- Git identity configured for that machine; +- optional TigerVNC documented in `locations/`; +- optional cameras/webcams documented in `locations/`; +- local `AGENTS.md` in each active repository; +- heartbeat file in `agent-bus/heartbeats/`. + +## Control Model + +For immediate commands: + +```bash +ssh @ '' +``` + +For durable async tasks: + +1. Create command file in `agent-bus/commands//`. +2. Machine pulls repository. +3. Machine runs allowed task. +4. Machine writes result to `agent-bus/results//`. +5. Machine updates `agent-bus/heartbeats/.md`. +6. Machine commits and pushes. + +## Initial Tasks + +- Document SSH access for `wuu`. +- Document SSH access for `qore`. +- Document SSH access for `pump`. +- Create heartbeat files for all three machines. +- Decide whether `garage-agent-runner` should be a systemd service, launchd job, scheduled task, or manual tmux workflow on each OS. +- Inventory local repositories on each machine. +- Install/document VNC and camera access where useful. + +## Safety + +- Do not store passwords, tokens, camera credentials, VNC credentials, or SSH private keys. +- Do not run destructive commands through the async bus. +- Use SSH for sensitive setup steps. +- Keep all agent results auditable through commits and logs. + diff --git a/projects/garage/technical-spec.md b/projects/garage/technical-spec.md index a25cfa2..a01a248 100644 --- a/projects/garage/technical-spec.md +++ b/projects/garage/technical-spec.md @@ -17,6 +17,7 @@ The simulator must support: - inventory and consolidation of scattered local projects/repositories from three computers; - completion of existing auto-simulator work; - remote visual access for setup/debugging through cameras and VNC where useful; +- multi-machine agent orchestration for `wuu`, `qore`, and `pump`; - a controllable snow-removal truck; - a snow-covered area; - a snow-clearing mechanic; @@ -39,6 +40,7 @@ The simulator must support: - Use case: consolidate scattered local projects into a coherent garage simulator project without losing useful history or solutions. - Use case: connect cameras/webcams so agents can inspect the physical simulator environment and calibration state. - Use case: control project computers remotely through VNC, preferably TigerVNC when suitable. +- Use case: direct agents on `wuu`, `qore`, and `pump` through SSH and a shared GitHub command/status bus. ## Functional Requirements @@ -50,6 +52,7 @@ The simulator must support: - Project consolidation must preserve useful work, decisions, and reusable solutions. - Project computers should support camera/webcam viewing for physical environment analysis where useful. - Project computers should support VNC remote control where useful; TigerVNC is the preferred open-source option unless a better native/official option is selected. +- Project computers should support agent orchestration through SSH and/or an approved local runner. - The user must be able to control the truck. - The environment must include snow that can be removed, pushed, reduced, or marked as cleared. - The simulator must track snow-clearing progress. @@ -78,6 +81,7 @@ The simulator must support: - Source-computer inventory must be documented so agents can understand where each project fragment came from. - Repository/project merging must follow the shared multi-repository workflow and avoid destructive actions until inventory is complete. - Camera and VNC credentials must not be stored in this repository. +- Agent orchestration must be auditable and must not store secrets in command files. ## Technical Assumptions @@ -105,6 +109,7 @@ The simulator must support: - Mirror camera definitions and NDI stream names for tablets. - Camera/webcam inventory for external environment analysis. - VNC endpoint inventory for remote control. +- Agent command bus files and heartbeat files for managed machines. ## Hardware And Installation @@ -175,6 +180,7 @@ The simulator must support: - Inventory local projects and repositories on all three source computers. - Inventory cameras/webcams useful for setup and calibration analysis. - Configure or document VNC access for project computers, preferably TigerVNC where suitable. +- Set up orchestration for `wuu`, `qore`, and `pump`. - Decide merge strategy for scattered simulator projects. - Confirm the final runtime computer, expected to be `Pump`. - Choose target platform and engine. @@ -211,3 +217,4 @@ The simulator must support: - What is the final joystick hardware interface for the plow controller? - Which cameras/webcams are available for physical environment analysis? - Which computers should run VNC, and should TigerVNC be used on each? +- Should `garage-agent-runner` start as a system service, or should the first phase use SSH plus `tmux` sessions only? diff --git a/skills/index.md b/skills/index.md index dd3de50..f63ffdb 100644 --- a/skills/index.md +++ b/skills/index.md @@ -11,3 +11,4 @@ - `mcp-server-management.md` - how agents keep a shared MCP server set synchronized across machines. - `dialog-summary-import.md` - how agents summarize useful context from separate dialogues into this repository. - `remote-visual-access.md` - how agents set up webcams/cameras and VNC for remote visual analysis and control. +- `multi-machine-agent-orchestration.md` - how to coordinate agents and daemon-like workers across multiple computers. diff --git a/skills/multi-machine-agent-orchestration.md b/skills/multi-machine-agent-orchestration.md new file mode 100644 index 0000000..2290986 --- /dev/null +++ b/skills/multi-machine-agent-orchestration.md @@ -0,0 +1,134 @@ +# Multi-Machine Agent Orchestration + +## Purpose + +Coordinate agents running on multiple computers while keeping commands auditable, recoverable, and safe. + +## Recommended Architecture + +Use two channels: + +1. SSH for live control. +2. GitHub repository command bus for asynchronous coordination and durable logs. + +Avoid exposing a custom always-open command API unless it is explicitly needed and secured. + +## Machine Agent Daemon + +Each managed computer can run a local daemon or scheduled service called `garage-agent-runner`. + +Responsibilities: + +- pull the shared knowledge repository; +- read commands addressed to its machine; +- execute only allowed command types; +- write status, logs, and results back to the repository; +- push updates using that machine's configured Git identity; +- keep a heartbeat file current. + +## Command Bus Layout + +Use this structure: + +```text +agent-bus/ + commands// + results// + heartbeats/.md + locks/ +``` + +Command files should be Markdown or YAML text files. Do not store secrets. + +## Command Lifecycle + +1. Controller writes a command file to `agent-bus/commands//`. +2. Machine daemon pulls the repository. +3. Daemon validates the command against an allowlist. +4. Daemon creates a lock in `agent-bus/locks/`. +5. Daemon runs the task. +6. Daemon writes result to `agent-bus/results//`. +7. Daemon updates heartbeat. +8. Daemon commits and pushes. + +## Live Control + +For immediate work, use SSH: + +```bash +ssh @ '' +``` + +Use SSH for: + +- starting/stopping services; +- checking process state; +- running inventory commands; +- launching interactive agent sessions through `tmux`; +- troubleshooting network or daemon failures. + +## Safety Rules + +- Use per-machine users such as `airM1`, not root, for normal repository work. +- Do not store passwords, API tokens, VNC passwords, camera credentials, or SSH private keys. +- Commands must be logged. +- Destructive commands require explicit user approval. +- Daemons should reject commands outside the project allowlist. +- Git commits from a machine should use that machine's configured identity. + +## Minimum Machine Setup + +Each machine should have: + +- SSH access; +- Git; +- access to `krustophski/agent-knowledge-base`; +- machine identity configured in Git; +- local `AGENTS.md` where applicable; +- optional VNC/camera access documented in `locations/`; +- optional `garage-agent-runner` service. + +## Heartbeat Format + +```markdown +# Machine Heartbeat + +## Machine + +machine-name + +## Last Seen + +YYYY-MM-DD HH:MM TZ + +## Current Task + +Task or `idle`. + +## Repositories + +- path: +- branch: +- dirty: + +## Services + +- service: +- status: + +## Notes + +- note: +``` + +## First Implementation Recommendation + +Start simple: + +1. Use SSH for direct control. +2. Use GitHub files for durable handoff. +3. Add a `tmux` session per machine for long-running agent work. +4. Add a daemon only after command patterns are clear. + +This gives control now without prematurely building an unsafe custom remote execution service. + diff --git a/templates/agent-command.md b/templates/agent-command.md new file mode 100644 index 0000000..37946c0 --- /dev/null +++ b/templates/agent-command.md @@ -0,0 +1,36 @@ +# Agent Command + +## Command ID + +YYYY-MM-DD-machine-short-task + +## Target Machine + +machine-name + +## Requested By + +controller or user. + +## Task + +Describe the task. + +## Allowed Scope + +- Repository/path: +- Commands allowed: +- Commands not allowed: + +## Expected Output + +- Status update: +- Files changed: +- Verification: + +## Safety + +- Secrets required: no +- Destructive action: no +- User approval required: no + diff --git a/templates/machine-heartbeat.md b/templates/machine-heartbeat.md new file mode 100644 index 0000000..8eafa04 --- /dev/null +++ b/templates/machine-heartbeat.md @@ -0,0 +1,37 @@ +# Machine Heartbeat + +## Machine + +machine-name + +## Last Seen + +YYYY-MM-DD HH:MM TZ + +## Current Task + +idle + +## Repositories + +| Path | Branch | Dirty | Notes | +| --- | --- | --- | --- | +| path | branch | no | notes | + +## Services + +| Service | Status | Notes | +| --- | --- | --- | +| service | status | notes | + +## Connectivity + +- SSH: +- VNC: +- Camera: +- GitHub push: + +## Notes + +- None. +