2026-06-12 13:22:10 -04:00
# Automaton
2026-05-30 23:27:09 -04:00
2026-06-09 23:58:48 -04:00
A contract-based operating system for LLM agents, designed to enforce disciplined engineering workflows.
2026-05-30 23:27:09 -04:00
2026-06-10 14:46:11 -04:00
## 1. Global Framework Installation (One-time setup)
Before you can use the framework in any project, you must install the core logic into your local environment.
**Run these commands in your terminal:**
```bash
# Clone the framework into the global config directory
2026-06-14 11:24:36 -04:00
git clone http://10.37.0.86:3003/hermes/automaton ~/.automaton
2026-06-10 14:46:11 -04:00
# Enter the directory
2026-06-12 12:40:15 -04:00
cd ~/.automaton
2026-06-10 14:46:11 -04:00
# Make the installation script executable and run it
chmod +x install.sh
./install.sh
```
*Note: This creates the "brain" of the framework (prompts, state machines, and rules) in your home directory.*
2026-06-10 23:48:43 -04:00
### Updating the Framework
When the framework is updated, you can update your global installation:
```bash
2026-06-12 12:40:15 -04:00
cd ~/.automaton
2026-06-10 23:48:43 -04:00
./update.sh
```
This will:
- Fetch the latest changes from the repository
- Check for uncommitted changes and warn you
- Pull the latest updates
2026-06-13 12:26:27 -04:00
**Upgrading existing projects:** The framework reads prompts, contracts, and scripts from `~/.automaton/` at runtime. Projects only override `.agent.md` and `.rules.md` . This means updating the global framework (`git pull` ) automatically applies to all projects. No per-project upgrade is needed.
If a project was set up under the old model (with copies of framework files), it needs migration first. Tell the agent: "Upgrade automaton for this project" to run the migration.
2026-06-10 23:48:43 -04:00
2026-06-10 14:46:11 -04:00
---
## 2. Project Setup (Per project)
Once the framework is installed globally, you must "onboard" every individual project you work on.
### Option A: The Agent-Driven Way (Recommended)
If you want the agent to handle the configuration for you, navigate to your project root and run:
2026-06-12 13:22:10 -04:00
> *"Onboard this project into automaton."
2026-06-10 14:46:11 -04:00
The agent will automatically:
1. Detect your project type (New, Existing, or Upgrade).
2026-06-12 12:40:15 -04:00
2. Create the `./.automaton/` directory.
3. Generate your `.agent.md` and `.rules.md` files.
2026-06-10 14:46:11 -04:00
4. Initiate the "Exploration Ritual" to understand your codebase.
### Option B: The Manual Way
2026-06-12 12:40:15 -04:00
If you prefer to set it up manually, create a `.automaton/` directory in your project root and add:
- `.agent.md` : Project-specific configuration (Mode, rules, etc.).
- `.rules.md` : Project-specific constraints and past failure modes.
2026-06-10 14:46:11 -04:00
2026-06-15 14:56:33 -04:00
Then install the git pre-commit hook:
```bash
ln -sf ~/.automaton/scripts/git-hooks/pre-commit .git/hooks/pre-commit
```
This hook blocks commits when no task is in `implement` or `doc_review` phase, preventing accidental code changes without a tracked task.
2026-06-10 14:46:11 -04:00
---
2026-05-30 23:27:09 -04:00
2026-06-09 23:58:48 -04:00
## The Autopilot Workflow
The framework features an **Autopilot** mode that allows the agent to drive a project to completion with minimal intervention.
2026-05-30 23:27:09 -04:00
2026-06-09 23:58:48 -04:00
### Lifecycle of a Task
2026-06-10 23:44:55 -04:00
1. **Research** : Produce a `SPEC.md` (Contract). No code allowed. **Interactive** — agent grills you for requirements and gets sign-off.
2026-06-11 20:25:27 -04:00
2. **Decomposition** (optional): Break the task into sub-tasks sized for your VRAM. **Interactive** — agent analyzes the spec and proposes sub-tasks with token budget estimates, gets sign-off. See [VRAM Configuration ](#vram-configuration ) below.
3. **Design** (optional): Produce a `DESIGN.md` (Architecture). No code allowed. **Interactive** — agent grills you for design decisions and gets sign-off.
2026-06-11 09:25:45 -04:00
3. **Test Design** (optional): Produce a `TEST_PLAN.md` (Test specification). No code allowed. **Interactive** — agent grills you for test coverage and edge cases, then presents draft test cases for review and sign-off.
4. **Implement** : Write code and tests based *only* on the `SPEC.md` , `DESIGN.md` (if present), and `TEST_PLAN.md` (if present). Follow TDD (Red/Green/Refactor). The TEST_PLAN.md (if present) serves as the test specification the implementer follows.
5. **Bug Find** : Aggressive search for bugs and spec deviations.
6. **Adversarial Bug Find** : Deep search for complex logic errors, race conditions, and performance issues.
7. **Doc Review** : Review documentation against DESIGN.md plan and fix missing docs.
8. **Referee** : Objective evaluation of all bugs, docs, and the final verdict.
2026-05-30 23:27:09 -04:00
2026-06-09 23:58:48 -04:00
### How to use Autopilot
2026-05-30 23:27:09 -04:00
2026-06-10 23:59:37 -04:00
#### Autopilot mode (default)
The default mode is **Autopilot: Enabled** . The Orchestrator automatically drives tasks through all phases. Just say:
2026-06-10 23:44:55 -04:00
- **Start a new task**: "Research add user authentication" (the Orchestrator creates the task and drives it all the way to completion)
2026-06-11 20:25:27 -04:00
- **Decompose a task**: "Decompose the add-user-auth task" (the Orchestrator breaks it into sub-tasks sized for your VRAM)
2026-06-10 23:44:55 -04:00
- **Continue**: "orchestrate" or "continue" (the Orchestrator finds the most advanced task and drives it)
2026-06-11 20:25:27 -04:00
#### VRAM Configuration
2026-06-12 12:40:15 -04:00
For low-VRAM systems (8GB, 16GB), set your VRAM limits in `~/.automaton/config.md` :
2026-06-11 20:25:27 -04:00
```markdown
## VRAM Configuration
- **Auto-detect**: Yes # Let the agent detect your VRAM automatically
- **Target VRAM context**: 16k tokens # Override auto-detect if needed
- **Headroom**: 25%
- **Max peak context per sub-task**: 12k tokens
```
2026-06-14 11:24:36 -04:00
**Auto-detection** : When `Auto-detect: Yes` , the Orchestrator runs `scripts/vram_detect.py` to probe:
2026-06-11 20:25:27 -04:00
- GPU VRAM (via `nvidia-smi` )
- System RAM (via `free` )
- Model context window (from config.md or API config files)
- Framework overhead (by counting token load in loaded prompts)
**Manual override** : When `Auto-detect: No` , use the manually specified values:
```markdown
## VRAM Configuration
- **Auto-detect**: No
- **Target VRAM context**: 8k
- **Headroom**: 30%
- **Max peak context per sub-task**: 5.6k
```
#### Model Configuration
2026-06-12 12:40:15 -04:00
When using a local LLM or a specific API model, set the model in `~/.automaton/config.md` :
2026-06-11 20:25:27 -04:00
```markdown
## Model Configuration
- **Model**: auto # Use auto-detection from API config files
- **Override context window**: auto # Override auto-detection, or specify (e.g., 128k, 200k)
```
**Auto-detection** : When `Model: auto` , the framework detects the model name from API config files (`.env` , `config.yaml` , etc.) and looks up its context window.
**Manual override** : When you know your model name, specify it:
```markdown
## Model Configuration
- **Model**: gpt-4o
- **Override context window**: 128k
```
When you run "Decompose the X task", the Orchestrator will:
1. Analyze the task's SPEC.md
2. Detect VRAM limits (auto or manual)
3. Break it into sub-tasks, each sized to fit within your VRAM limit
4. Estimate the token budget for each sub-task
5. Create sub-task folders under `tasks/{parent-task}/subtasks/{sub-task}/`
6. Propagate VRAM config to each sub-task
Sub-tasks run independently through the full lifecycle. The parent task is complete only when ALL sub-tasks pass.
2026-06-10 23:59:37 -04:00
#### Manual mode (opt-in)
2026-06-12 12:40:15 -04:00
Set `Autopilot: Disabled` in your project's `.automaton/.agent.md` if you prefer to manually run each phase. The Orchestrator reports the current state and tells you the next command. Then run phases by saying things like:
2026-06-10 23:44:55 -04:00
- "Research add user authentication" — starts a new task
2026-06-11 20:25:27 -04:00
- "Decompose the add-user-auth task" — breaks into VRAM-sized sub-tasks (optional)
2026-06-10 23:44:55 -04:00
- "Design the add-user-auth task" — designs the architecture (optional)
2026-06-11 09:25:45 -04:00
- "Design tests for the add-user-auth task" — designs test cases (optional)
- "Implement the add-user-auth task" — implements the task with tests
2026-06-10 23:44:55 -04:00
- "Find bugs in the add-user-auth task" — finds bugs
- "Perform adversarial bug find for add-user-auth" — deep bug search
- "Review docs for the add-user-auth task" — reviews documentation
- "Review the add-user-auth task" — referee evaluates
- "orchestrate" — asks the Orchestrator what to do next
2026-05-30 23:27:09 -04:00
2026-06-11 20:25:27 -04:00
## Sub-Task Management
When a task is decomposed, the Orchestrator creates sub-tasks under `tasks/{parent-task}/subtasks/` . Each sub-task:
- Has its own full lifecycle (Research → Decomposition → Design → ... → Complete)
- Starts at the Research phase with an empty folder
- Receives a `PARENT_SPEC.md` with the parent task's context
- Receives a `VRAM_CONFIG.md` with the VRAM constraints
- Runs independently — sub-tasks in the same wave can run in parallel
- The parent task is NOT complete until ALL sub-tasks pass
2026-06-09 23:58:48 -04:00
## Key Components
2026-06-15 14:16:46 -04:00
- `.agent.md` : Project-specific agent behavior (Autopilot mode, routing rules, optional Agent Configuration for multi-agent).
- `config.md` : Global framework settings (VRAM, model, system requirements, version).
2026-06-12 12:40:15 -04:00
- `.rules.md` : Living document of project constraints and past failure modes.
2026-06-15 14:16:46 -04:00
- `prompts/` : Specialized system prompts for each phase with ALLOWED/FORBIDDEN sections and approval gates.
- `workflow.md` : The state machine governing the task lifecycle, with `.state` file as canonical phase indicator.
2026-06-15 14:56:33 -04:00
- `scripts/status.py` : Enforcement script — task status, phase transitions, approval gates, folder validation, audits, pre-edit hook (`--can-edit` ), multi-agent claiming.
2026-06-14 11:24:36 -04:00
- `scripts/vram_detect.py` : Auto-detects GPU VRAM, RAM, model context window, and framework overhead.
2026-06-15 14:56:33 -04:00
- `scripts/git-hooks/pre-commit` : Blocks commits when no task is in an edit-allowed phase.
- `contracts/harness-integration.md` : Integration contract for agent harnesses (opencode, aider, etc.).
- `plugins/automaton-guard/` : opencode plugin that intercepts `edit` /`write` calls and checks `--can-edit` before allowing them.
2026-05-30 23:27:09 -04:00
2026-06-15 14:16:46 -04:00
## State Enforcement (v2.0)
Automaton v2.0 enforces the state machine computationally, not just via prompts:
- **`.state` file**: Each task has a `.state` file that is the single source of truth for its current phase
- **`status.py --transition` **: All phase transitions must go through this command; illegal transitions are refused
- **Approval gates**: Research, Design, Decomposition, and Test Design phases require explicit user approval before proceeding
- **`status.py --validate-folder` **: Detects out-of-order artifacts (phase skipping)
- **`status.py --audit` **: Comprehensive audit across all tasks for violations
- **`status.py --create-task` **: The only valid way to create task folders
- **FORBIDDEN actions in prompts**: Each phase prompt explicitly lists what agents cannot do
### Quick Reference
```bash
# Create a new task
2026-06-21 18:28:15 -04:00
python3 ~/.automaton/scripts/status.py --create-task add-user-auth --project /path/to/project
2026-06-15 14:16:46 -04:00
# Check task status
2026-06-21 18:28:15 -04:00
python3 ~/.automaton/scripts/status.py --task add-user-auth --project /path/to/project
2026-06-15 14:16:46 -04:00
# List all tasks
2026-06-21 18:28:15 -04:00
python3 ~/.automaton/scripts/status.py --list --project /path/to/project
2026-06-15 14:16:46 -04:00
# Transition to next phase
2026-06-21 18:28:15 -04:00
python3 ~/.automaton/scripts/status.py --transition research --task add-user-auth --project /path/to/project
python3 ~/.automaton/scripts/status.py --transition research:awaiting_approval --task add-user-auth --project /path/to/project
2026-06-15 14:16:46 -04:00
# Approve a phase (after user sign-off)
2026-06-21 18:28:15 -04:00
python3 ~/.automaton/scripts/status.py --approve --task add-user-auth --project /path/to/project
2026-06-15 14:16:46 -04:00
# Validate task folder
2026-06-21 18:28:15 -04:00
python3 ~/.automaton/scripts/status.py --validate-folder --task add-user-auth --project /path/to/project
2026-06-15 14:16:46 -04:00
# Audit all tasks
2026-06-21 18:28:15 -04:00
python3 ~/.automaton/scripts/status.py --audit --project /path/to/project
2026-06-15 14:16:46 -04:00
2026-06-15 14:56:33 -04:00
# Upgrade pre-v2.0 tasks (bootstrap .state files)
2026-06-21 18:28:15 -04:00
python3 ~/.automaton/scripts/status.py --upgrade --project /path/to/project
2026-06-15 14:56:33 -04:00
# Check if code edits are allowed (harness integration)
2026-06-21 18:28:15 -04:00
python3 ~/.automaton/scripts/status.py --can-edit --project /path/to/project
python3 ~/.automaton/scripts/status.py --can-edit --project /path/to/project --file src/main.py
python3 ~/.automaton/scripts/status.py --can-edit --project /path/to/project --task add-user-auth --json
2026-06-15 14:16:46 -04:00
```
2026-06-15 14:56:33 -04:00
**Important** : Always pass `--project` to ensure correct scoping when multiple projects exist. Without it, `status.py` resolves the project from the current directory and errors if not in a project.
### Untracked Tasks
Tasks without `.state` files are UNTRACKED — all commands (`--transition` , `--can-edit` , `--task` , `--approve` ) refuse to operate on them. This prevents agents from working on tasks created before v2.0 state enforcement.
To fix untracked tasks:
```bash
# Upgrade a single task
2026-06-21 18:28:15 -04:00
python3 ~/.automaton/scripts/status.py --upgrade --task my-old-task --project /path/to/project
2026-06-15 14:56:33 -04:00
# Upgrade all tasks at once
2026-06-21 18:28:15 -04:00
python3 ~/.automaton/scripts/status.py --upgrade --project /path/to/project
2026-06-15 14:56:33 -04:00
```
### Enforcement
The framework enforces the state machine computationally. No phase can be skipped, no approval can be bypassed, and no code edits can happen without a task in an edit-allowed phase. This is enforced through three layers:
1. **Harness pre-edit hook** (`--can-edit` ) — blocks edits before they happen. Supported by opencode via the `automaton-guard` plugin.
2. **Git pre-commit hook** — blocks commits when no task is in `implement` or `doc_review` phase. Works for ALL harnesses.
3. **Prompt-based rules** (ALLOWED/FORBIDDEN sections) — advisory only, relies on agent discipline.
See `contracts/harness-integration.md` for integration details.
2026-06-15 14:16:46 -04:00
### Multi-Agent (Optional)
Add an `Agent Configuration` section to `.agent.md` to enable multi-agent mode:
```markdown
## Agent Configuration
Mode: multi-agent
Agents:
- id: researcher
phases: [research, decomposition, design, test_design]
- id: implementer
phases: [implement]
- id: bug-hunter
phases: [bug_find, adversarial_bug_find]
- id: referee
phases: [referee]
- id: orchestrator
phases: [new, complete, human_intervention]
role: coordinator
Lock timeout: 30m
```
In multi-agent mode, agents claim tasks and discover work via `status.py --claim` and `--next-available` . In single-agent mode (the default), these commands are no-ops.
2026-06-11 22:25:09 -04:00
## Layered File System
The framework uses a **layered approach** to file management, with a clear precedence:
2026-06-12 12:40:15 -04:00
1. **Project overrides** (highest precedence): `{project}/.automaton/` — contains project-specific customizations
2. **Global framework** (default): `~/.automaton/` — contains the base framework files
2026-06-11 22:25:09 -04:00
2026-06-12 12:40:15 -04:00
**Precedence rule** : If a file exists in the project's `.automaton/` directory, the Orchestrator reads it from there. If it doesn't exist, the Orchestrator reads it from the global `~/.automaton/` directory.
2026-06-11 22:25:09 -04:00
### What files belong in each layer?
2026-06-13 12:26:27 -04:00
- **Project's `.automaton/` **: .agent.md (project-specific settings like Autopilot mode, rules override), .rules.md (project-specific constraints), extensions/ (optional additive overrides)
2026-06-12 12:40:15 -04:00
- **Global `~/.automaton/` **: All prompt files, contracts, scripts, config.md, workflow.md
2026-06-11 22:25:09 -04:00
### Upgrading
2026-06-15 14:56:33 -04:00
#### Updating the framework
2026-06-13 12:26:27 -04:00
The framework reads all base files from `~/.automaton/` at runtime. To update the framework:
2026-06-11 22:25:09 -04:00
2026-06-13 12:26:27 -04:00
```bash
cd ~/.automaton && git pull
```
2026-06-15 14:56:33 -04:00
This automatically applies changes to all projects — no per-project file update needed.
#### Upgrading an existing project to v2.0
If a project was created before v2.0 state enforcement (`.state` files), it needs an upgrade to bootstrap `.state` files and install the pre-commit hook:
```bash
# From the project root:
bash ~/.automaton/scripts/upgrade.sh /path/to/project
```
This will:
1. Bootstrap `.state` files for all existing tasks (inferring phase from artifacts)
2. Add a version marker to `~/.automaton/config.md`
3. Install the git pre-commit hook (blocks commits without a task in implement/doc_review)
You can also upgrade tasks individually:
```bash
2026-06-21 18:28:15 -04:00
python3 ~/.automaton/scripts/status.py --upgrade --task my-task --project /path/to/project
2026-06-15 14:56:33 -04:00
```
#### Installing the pre-commit hook manually
If you skipped the upgrade script or are setting up a new project:
```bash
# From the project root:
ln -sf ~/.automaton/scripts/git-hooks/pre-commit .git/hooks/pre-commit
```
To verify the hook is working:
```bash
2026-06-21 18:28:15 -04:00
python3 ~/.automaton/scripts/status.py --can-edit --project /path/to/project
2026-06-15 14:56:33 -04:00
# Should return exit code 1 (DENIED) if no tasks are in implement/doc_review
```
2026-06-13 12:26:27 -04:00
If a project has stale framework file copies (from the old model), tell the agent:
2026-06-12 13:22:10 -04:00
> "Upgrade automaton for this project."
2026-06-11 22:25:09 -04:00
2026-06-13 12:26:27 -04:00
The agent will run `migrate-project.sh` to clean up stale files and move customizations to `extensions/` .
2026-06-11 22:25:09 -04:00
2026-06-13 21:09:57 -04:00
## Dashboard
The dashboard provides a web-based Kanban board, statistics, and timeline views for monitoring task progress.
```bash
# Start from any project root or ~/.automaton/
2026-06-21 18:28:15 -04:00
python3 -m automaton.dashboard
2026-06-15 14:16:46 -04:00
# Or use the convenience wrapper
bash ~/.automaton/scripts/dashboard.sh
2026-06-13 21:09:57 -04:00
```
See `automaton/dashboard/README.md` for full documentation on views, keyboard shortcuts, configuration, and scope detection.
2026-06-10 14:46:11 -04:00
## Contact & Support
[Insert Contact Info]