Add multi-machine orchestration plan

This commit is contained in:
krustophski 2026-05-24 14:12:35 +03:00
parent 4ad3ff248d
commit b5abed8bab
13 changed files with 325 additions and 3 deletions

19
agent-bus/README.md Normal file
View file

@ -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/<machine>/` - requested tasks for a machine.
- `results/<machine>/` - task results written by that machine.
- `heartbeats/<machine>.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.

View file

@ -0,0 +1 @@

View file

@ -0,0 +1 @@

1
agent-bus/locks/.gitkeep Normal file
View file

@ -0,0 +1 @@

View file

@ -0,0 +1 @@

View file

@ -142,3 +142,12 @@
- Files changed: Added `skills/remote-visual-access.md`, `templates/remote-visual-access.md`, and updated global/project instructions. - 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. - Verified: Requirement captured without storing any camera/VNC credentials.
- Next handoff: Inventory available cameras and choose VNC setup per machine, preferring TigerVNC where suitable. - 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.

View file

@ -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 | | 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 | | 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 | | 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 ## 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`. - 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. - 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. - Inspect each computer for simulator-related repositories.
- Inventory Proxmox at `192.168.1.60:8006` for VMs/containers related to `garage`. - Inventory Proxmox at `192.168.1.60:8006` for VMs/containers related to `garage`.
- Add each computer to `locations/`. - Add each computer to `locations/`.

View file

@ -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 <user>@<machine> '<command>'
```
For durable async tasks:
1. Create command file in `agent-bus/commands/<machine>/`.
2. Machine pulls repository.
3. Machine runs allowed task.
4. Machine writes result to `agent-bus/results/<machine>/`.
5. Machine updates `agent-bus/heartbeats/<machine>.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.

View file

@ -17,6 +17,7 @@ The simulator must support:
- inventory and consolidation of scattered local projects/repositories from three computers; - inventory and consolidation of scattered local projects/repositories from three computers;
- completion of existing auto-simulator work; - completion of existing auto-simulator work;
- remote visual access for setup/debugging through cameras and VNC where useful; - 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 controllable snow-removal truck;
- a snow-covered area; - a snow-covered area;
- a snow-clearing mechanic; - 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: 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: 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: 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 ## Functional Requirements
@ -50,6 +52,7 @@ The simulator must support:
- Project consolidation must preserve useful work, decisions, and reusable solutions. - 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 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 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 user must be able to control the truck.
- The environment must include snow that can be removed, pushed, reduced, or marked as cleared. - The environment must include snow that can be removed, pushed, reduced, or marked as cleared.
- The simulator must track snow-clearing progress. - 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. - 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. - 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. - 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 ## Technical Assumptions
@ -105,6 +109,7 @@ The simulator must support:
- Mirror camera definitions and NDI stream names for tablets. - Mirror camera definitions and NDI stream names for tablets.
- Camera/webcam inventory for external environment analysis. - Camera/webcam inventory for external environment analysis.
- VNC endpoint inventory for remote control. - VNC endpoint inventory for remote control.
- Agent command bus files and heartbeat files for managed machines.
## Hardware And Installation ## Hardware And Installation
@ -175,6 +180,7 @@ The simulator must support:
- Inventory local projects and repositories on all three source computers. - Inventory local projects and repositories on all three source computers.
- Inventory cameras/webcams useful for setup and calibration analysis. - Inventory cameras/webcams useful for setup and calibration analysis.
- Configure or document VNC access for project computers, preferably TigerVNC where suitable. - 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. - Decide merge strategy for scattered simulator projects.
- Confirm the final runtime computer, expected to be `Pump`. - Confirm the final runtime computer, expected to be `Pump`.
- Choose target platform and engine. - Choose target platform and engine.
@ -211,3 +217,4 @@ The simulator must support:
- What is the final joystick hardware interface for the plow controller? - What is the final joystick hardware interface for the plow controller?
- Which cameras/webcams are available for physical environment analysis? - Which cameras/webcams are available for physical environment analysis?
- Which computers should run VNC, and should TigerVNC be used on each? - 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?

View file

@ -11,3 +11,4 @@
- `mcp-server-management.md` - how agents keep a shared MCP server set synchronized across machines. - `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. - `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. - `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.

View file

@ -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/<machine>/
results/<machine>/
heartbeats/<machine>.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/<machine>/`.
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/<machine>/`.
7. Daemon updates heartbeat.
8. Daemon commits and pushes.
## Live Control
For immediate work, use SSH:
```bash
ssh <user>@<host> '<command>'
```
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.

View file

@ -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

View file

@ -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.