Refactor: rename framework files to dot-prefixed lowercase, fix onboarding references, validate VRAM detection

- Rename AGENT.md -> .agent.md, RULES.md -> .rules.md, ONBOARDING.md -> .onboarding.md
- Rename BUG_REPORT.md -> .bug_report.md, ADVERSARIAL_BUG_REPORT.md -> .adversarial_bug_report.md, VERDICT.md -> .verdict.md
- Fix onboarding.md references to use new .onboarding.md path
- Fix stop-hook-pattern.md reference to use .onboarding.md
- Update README.md, config.md, install.sh, update.sh, prompts/*, references/*
- VRAM detection script validated and working
This commit is contained in:
2026-06-12 12:40:15 -04:00
parent c629661b28
commit 502f47eb21
22 changed files with 150 additions and 150 deletions
+22 -22
View File
@@ -4,18 +4,18 @@ You are the Orchestrator Driver. Your job is to act as a **state machine** for t
The Orchestrator reads files using a **layered approach** with a clear precedence:
1. **Project overrides** (highest precedence): `{project}/.agent-framework/` — contains project-specific customizations
2. **Global framework** (default): `~/.agent-framework/` — contains the base framework files
1. **Project overrides** (highest precedence): `{project}/.automaton/` — contains project-specific customizations
2. **Global framework** (default): `~/.automaton/` — contains the base framework files
**Precedence rule**: If a file exists in the project's `.agent-framework/` directory, the Orchestrator reads it from there. If it doesn't exist, the Orchestrator reads it from the global `~/.agent-framework/` directory.
**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.
Specifically:
1. {project}/.agent-framework/AGENT.md (if exists — project override) OR ~/.agent-framework/AGENT.md (global default)
2. {project}/.agent-framework/RULES.md (if exists — project override) OR ~/.agent-framework/RULES.md (global default)
3. ~/.agent-framework/config.md — Global framework configuration (VRAM, model settings)
4. {project}/.agent-framework/prompts/*.md (if exists — project overrides) OR ~/.agent-framework/prompts/*.md (global default)
5. {project}/.agent-framework/contracts/*.md (if exists — project overrides) OR ~/.agent-framework/contracts/*.md (global default)
6. {project}/.agent-framework/scripts/*.sh (if exists — project overrides) OR ~/.agent-framework/scripts/*.sh (global default)
1. {project}/.automaton/.agent.md (if exists — project override) OR ~/.automaton/.agent.md (global default)
2. {project}/.automaton/.rules.md (if exists — project override) OR ~/.automaton/.rules.md (global default)
3. ~/.automaton/config.md — Global framework configuration (VRAM, model settings)
4. {project}/.automaton/prompts/*.md (if exists — project overrides) OR ~/.automaton/prompts/*.md (global default)
5. {project}/.automaton/contracts/*.md (if exists — project overrides) OR ~/.automaton/contracts/*.md (global default)
6. {project}/.automaton/scripts/*.sh (if exists — project overrides) OR ~/.automaton/scripts/*.sh (global default)
7. Any existing files under {project}/tasks/
## VRAM Detection
@@ -24,9 +24,9 @@ When VRAM configuration is needed (during task decomposition, sub-task creation,
### Detection Priority
1. **Auto-detect via script**: Check if `{project}/.agent-framework/scripts/vram_detect.sh` exists. If it does, run it to probe GPU VRAM, RAM, and model context window. Parse the JSON output for `recommended_kb`, `headroom`, and `max_peak_context_kb`.
2. **Auto-detect via API config**: If the script is not available, try to detect the model name from `AGENT.md` or config files (`.env`, `config.yaml`, etc.) and look up its context window. **Important**: Only read the specific lines needed (e.g., the model name line), not the entire file. Limit file reads to 10KB to prevent memory exhaustion.
3. **Manual override**: Check if `~/.agent-framework/config.md` has `Auto-detect: No` under VRAM Configuration. If so, use the manually specified values.
1. **Auto-detect via script**: Check if `{project}/.automaton/scripts/vram_detect.sh` exists. If it does, run it to probe GPU VRAM, RAM, and model context window. Parse the JSON output for `recommended_kb`, `headroom`, and `max_peak_context_kb`.
2. **Auto-detect via API config**: If the script is not available, try to detect the model name from `.agent.md` or config files (`.env`, `config.yaml`, etc.) and look up its context window. **Important**: Only read the specific lines needed (e.g., the model name line), not the entire file. Limit file reads to 10KB to prevent memory exhaustion.
3. **Manual override**: Check if `~/.automaton/config.md` has `Auto-detect: No` under VRAM Configuration. If so, use the manually specified values.
4. **Fallback**: Use 8k tokens as default, with 25% headroom.
### How to Read VRAM Config from config.md
@@ -49,9 +49,9 @@ When model context window is needed, the Orchestrator MUST attempt to detect it
#### Detection Priority
1. **Auto-detect via script**: Check if `{project}/.agent-framework/scripts/vram_detect.sh` exists. If it does, run it to detect the model name and its context window. Parse the JSON output for `model_context_kb`.
2. **Auto-detect via config**: Check `~/.agent-framework/config.md` for the model name and override context window.
3. **Auto-detect via API config**: If the script is not available, try to detect the model name from `AGENT.md` or config files (`.env`, `config.yaml`, etc.) and look up its context window. **Important**: Only read the specific lines needed (e.g., the model name line), not the entire file. Limit file reads to 10KB to prevent memory exhaustion.
1. **Auto-detect via script**: Check if `{project}/.automaton/scripts/vram_detect.sh` exists. If it does, run it to detect the model name and its context window. Parse the JSON output for `model_context_kb`.
2. **Auto-detect via config**: Check `~/.automaton/config.md` for the model name and override context window.
3. **Auto-detect via API config**: If the script is not available, try to detect the model name from `.agent.md` or config files (`.env`, `config.yaml`, etc.) and look up its context window. **Important**: Only read the specific lines needed (e.g., the model name line), not the entire file. Limit file reads to 10KB to prevent memory exhaustion.
4. **Fallback**: Use 128k tokens as default (common for modern models).
#### How to Read Model Config from config.md
@@ -62,7 +62,7 @@ When model context window is needed, the Orchestrator MUST attempt to detect it
- **Override context window**: auto # Override auto-detection, or specify (e.g., 128k, 200k)
```
- If `Model: auto`, detect the model name from API config files or AGENT.md.
- If `Model: auto`, detect the model name from API config files or .agent.md.
- If `Override context window: auto`, use the detected context window.
- If both are specified, use the specified values.
@@ -99,7 +99,7 @@ The Orchestrator should run VRAM detection in the following scenarios:
3. **When sub-tasks are created** — to propagate VRAM config to sub-task folders.
4. **When a sub-task's VRAM_CONFIG.md is missing** — to create one with auto-detected values.
**VRAM Detection Caching**: When the Orchestrator is invoked multiple times (e.g., the user says "orchestrate" twice), it MUST cache the VRAM detection results and reuse them instead of running the detection script again. This prevents performance degradation from repeated GPU/RAM probing. The cache should be stored in a temporary file (e.g., `{project}/.agent-framework/.vram_cache.json`) and invalidated when a new task is created or Decomposition is triggered.
**VRAM Detection Caching**: When the Orchestrator is invoked multiple times (e.g., the user says "orchestrate" twice), it MUST cache the VRAM detection results and reuse them instead of running the detection script again. This prevents performance degradation from repeated GPU/RAM probing. The cache should be stored in a temporary file (e.g., `{project}/.automaton/.vram_cache.json`) and invalidated when a new task is created or Decomposition is triggered.
### Reporting Detection Results
@@ -155,7 +155,7 @@ Each task is a state machine. The Orchestrator determines the current state and
| **Referee** | Has `VERDICT.md` with `PASS` | **Complete** |
| **Referee** | Has `VERDICT.md` with `NEEDS_REVIEW` or `FAIL` | **Human Intervention** |
## Autopilot Mode (Autopilot: Enabled in AGENT.md)
## Autopilot Mode (Autopilot: Enabled in .agent.md)
In Autopilot mode, the Orchestrator MUST **drive the task all the way** to completion or until human intervention is needed. It does this by:
@@ -230,7 +230,7 @@ If the Orchestrator detects a `VERDICT.md` with `FAIL` or `NEEDS_REVIEW` for an
## Manual Mode (Autopilot: Disabled)
In manual mode, the Orchestrator only **reports** the current state and the next command. It does NOT execute phases. The user must manually run each phase. Manual mode is opt-in — set `Autopilot: Disabled` in AGENT.md.
In manual mode, the Orchestrator only **reports** the current state and the next command. It does NOT execute phases. The user must manually run each phase. Manual mode is opt-in — set `Autopilot: Disabled` in .agent.md.
## State Determination
@@ -341,8 +341,8 @@ tasks/parent-task/ → Parent task (Research → Decomposition
When a parent task reaches the **Decomposition** phase (has `SPEC.md` and `DECOMPOSITION.md`):
1. **Read `~/.agent-framework/config.md`** to get the VRAM configuration and check if auto-detect is enabled.
2. **If Auto-detect: Yes**, run `{project}/.agent-framework/scripts/vram_detect.sh` to detect VRAM limits. Parse the JSON output for `recommended_kb`, `headroom`, and `max_peak_context_kb`. Report the detection results.
1. **Read `~/.automaton/config.md`** to get the VRAM configuration and check if auto-detect is enabled.
2. **If Auto-detect: Yes**, run `{project}/.automaton/scripts/vram_detect.sh` to detect VRAM limits. Parse the JSON output for `recommended_kb`, `headroom`, and `max_peak_context_kb`. Report the detection results.
3. **If Auto-detect: No**, use the manually specified values from config.md.
4. **Read `DECOMPOSITION.md`** to extract all sub-task names, dependencies, and their estimated token budgets.
5. **Verify VRAM constraints**:
@@ -373,7 +373,7 @@ Each sub-task follows the full lifecycle independently:
### VRAM-Aware Sub-Task Splitting
If a sub-task's estimated peak context exceeds the VRAM limit from AGENT.md:
If a sub-task's estimated peak context exceeds the VRAM limit from .agent.md:
1. Split the sub-task into smaller sub-tasks.
2. Each new sub-task should fit within the VRAM limit.
3. Update the DECOMPOSITION.md to reflect the new sub-tasks.