docs: update DRAFT_PLAN.md with problem definitions & gRPC justification, move agent rules to .agents/

This commit is contained in:
2026-07-06 09:53:36 +09:00
parent 403793cbb9
commit ee9ae41195
29 changed files with 1294 additions and 2139 deletions
+46 -26
View File
@@ -10,30 +10,50 @@ A new agent can follow the steps in this guide sequentially to establish a stabl
Before cloning this project into a new environment, you must first understand the locations and roles of its core components:
* `.agents/skills/`: A collection of shell scripts that execute multi-agent coordination and asynchronous job processing.
* `lib.sh`: The core orchestration shell functions and virtual environment (venv) auto-loading library.
* `multi-agent-mux-create/`: Script to launch isolated tmux agent sessions.
* `multi-agent-mux-stop/`: Script to gracefully stop agent sessions and update states.
* `multi-agent-mux-resume/`: Script to restore stopped agent sessions back to their previous conversation state.
* `multi-agent-mux-status/`: Script to query the current running state of all agent sessions.
* `multi-agent-mux-monitor/`: Monitor script to sync tmux states with the registry.
* `multi-agent-mux-delegate-job/`: Asynchronous job splitting and delegation module.
* `requirements.txt`: Python dependency list (`paho-mqtt`, `pyyaml`).
* `scripts/`: Python scripts running the core business logic.
* `registry.py`: Job registration, claiming, and atomic file lock control (CLI supported).
* `job_subscriber.py`: Background event subscriber and audit log generator.
* `publish_event.py`: Event publisher for runtime states and error traps.
* `mqtt_common.py`: Common utility for connecting to the MQTT broker.
* `AGENT.md`: Definition of agent roles (PM, Worker, Reviewer) and event publication rules.
* `.agents/`: Orchestration and custom agent skills root.
* `AGENT.md`: Definition of agent roles (PM, Worker, Reviewer) and event publication rules.
* `AGENT.ko.md`: Definition of agent roles (PM, Worker, Reviewer) and event publication rules (Korean).
* `skills/`: A collection of shell scripts that execute multi-agent coordination and asynchronous job processing.
* `lib.sh`: The core orchestration shell functions and virtual environment (venv) auto-loading library.
* `multi-agent-mux-create/`: Script to launch isolated tmux agent sessions.
* `multi-agent-mux-stop/`: Script to gracefully stop agent sessions and update states.
* `multi-agent-mux-resume/`: Script to restore stopped agent sessions back to their previous conversation state.
* `multi-agent-mux-status/`: Script to query the current running state of all agent sessions.
* `multi-agent-mux-monitor/`: Monitor script to sync tmux states with the registry.
* `multi-agent-mux-delegate-job/`: Asynchronous job splitting and delegation module.
* `requirements.txt`: Python dependency list (`paho-mqtt`, `pyyaml`).
* `scripts/`: Python scripts running the core business logic.
* `registry.py`: Job registration, claiming, and atomic file lock control (CLI supported).
* `job_subscriber.py`: Background event subscriber and audit log generator.
* `publish_event.py`: Event publisher for runtime states and error traps.
* `mqtt_common.py`: Common utility for connecting to the MQTT broker.
* `MESSAGING.md`: Messaging scheme and wire protocol guidelines for MQTT communication between agents.
---
## 2. Environment Configuration (.env)
## 2. Workspace Provisioning (Step 0 — Reference Only)
Before any agent can read this guide, the workspace must be provisioned. This step has already been performed by the human developer using the installer. It is documented here strictly as a reference for verifying agents to understand how the assets arrived.
### Step 0.1: Run the Installer One-Liner (Pre-Cloned/Provisioned)
The human developer bootstrapped the workspace by running:
```bash
curl -fsSL https://git.godopu.com/tmpl/multi-agent-mux/raw/branch/main/deploy/install.sh | bash
```
The installer verified system dependencies, staged the repository, copied the runtime `.agents/` scaffolding and documentation files (including this `BOOTSTRAP.md`), and set up the default `.env` and `.venv` environments.
> [!NOTE]
> **Verify Only**: AI agents reading this guide must **not** attempt to run the installation script again. Proceed directly to configuration and verification steps.
---
## 3. Environment Configuration (.env)
To set up the messaging broker and execution paths, you must create and modify a local environment configuration file (`.env`).
### Step 2.1: Run the Generation Script
### Step 3.1: Run the Generation Script
Run the environment template copy script provided in the project root:
```bash
@@ -44,7 +64,7 @@ Run the environment template copy script provided in the project root:
./scripts/generate-env.sh --force
```
### Step 2.2: Modify Environment Variables
### Step 3.2: Modify Environment Variables
Open the generated `.env` file to configure settings as needed.
> [!NOTE]
@@ -60,15 +80,15 @@ Open the generated `.env` file to configure settings as needed.
> [!WARNING]
> **Security Mode Default Warning**:
> The system's default setting is the **unauthenticated PoC mode**. If an `auth_token` is not explicitly provided (or is `null`) during job registration, HMAC signature verification is skipped.
> In a public broker environment or production phase, you must generate and inject a unique random `auth_token` during job registration to enable HMAC signature security. (For detailed security protocols, refer to section `2.3 Security Protocol` in [MESSAGING.md](./MESSAGING.md) and [AGENT.md](./AGENT.md). Automated token generation and injection via CLI is on the roadmap under task `FW-N6`.)
> In a public broker environment or production phase, you must generate and inject a unique random `auth_token` during job registration to enable HMAC signature security. (For detailed security protocols, refer to section `2.3 Security Protocol` in [MESSAGING.md](./MESSAGING.md) and [AGENT.md](.agents/AGENT.md). Automated token generation and injection via CLI is on the roadmap under task `FW-N6`.)
---
## 3. Dependency and Virtualenv Setup
## 4. Dependency and Virtualenv Setup
Set up the Python 3 dependencies required to run the orchestration and MQTT messaging backplane.
### Step 3.1: Build Python Virtual Environment
### Step 4.1: Build Python Virtual Environment
Create and activate a `.venv` virtual environment in the project root:
```bash
@@ -79,7 +99,7 @@ python3 -m venv .venv
source .venv/bin/activate
```
### Step 3.2: Install Dependency Packages
### Step 4.2: Install Dependency Packages
Install the required packages listed in `requirements.txt` under `multi-agent-mux-delegate-job`:
```bash
@@ -89,7 +109,7 @@ pip install -r .agents/skills/multi-agent-mux-delegate-job/requirements.txt
---
## 4. Directory Structure and Security Audit Guide
## 5. Directory Structure and Security Audit Guide
Ensure that the local registry directories required to track agent states and jobs are successfully created:
@@ -110,7 +130,7 @@ Ensure that the local registry directories required to track agent states and jo
---
## 5. Execution Verification and Bootstrap Tests
## 6. Execution Verification and Bootstrap Tests
To verify that the environment has been successfully built without runtime errors, run the following verification checklist.
@@ -159,8 +179,8 @@ rm -f ".mam/jobs/$JID.json" ".mam/jobs/$JID.lock"
---
## 6. Onboarding Collaborating Agents (New Agent Onboarding)
## 7. Onboarding Collaborating Agents (New Agent Onboarding)
Once the setup is verified, onboarding agents should immediately read the **[AGENT.md](./AGENT.md)** guidelines in the project root.
Once the setup is verified, onboarding agents should immediately read the **[AGENT.md](.agents/AGENT.md)** guidelines in the .agents/ directory.
The guidelines describe essential workflows—such as **surgical change constraints, cross-verification review loops, and pane snapshotting to prevent viewport truncation**—allowing new agents to quickly and safely integrate with the multi-agent workflow.