conductor(checkpoint): Phase 1: Research and Investigation complete

This commit is contained in:
2026-02-25 08:45:41 -05:00
parent 4a74487e06
commit cf3de845fb
5 changed files with 108 additions and 9 deletions

View File

@@ -0,0 +1,45 @@
# MMA Hierarchical Delegation: Recommended Architecture
## 1. Overview
The Multi-Model Architecture (MMA) utilizes a 4-Tier hierarchy to ensure token efficiency and structural integrity. The primary agent (Conductor) acts as the Tier 2 Tech Lead, delegating specific, stateless tasks to Tier 3 (Workers) and Tier 4 (Utility) agents.
## 2. Agent Roles & Responsibilities
### Tier 2: The Conductor (Tech Lead)
- **Role:** Orchestrator of the project lifecycle via the Conductor framework.
- **Context:** High-reasoning, long-term memory of project goals and specifications.
- **Key Tool:** `mma-orchestrator` skill (Strategy).
- **Delegation Logic:** Identifies tasks that would bloat the primary context (large code blocks, massive error traces) and spawns sub-agents.
### Tier 3: The Worker (Contributor)
- **Role:** Stateless code generator.
- **Context:** Isolated. Sees only the target file and the specific ticket.
- **Protocol:** Receives a "Worker" system prompt. Outputs clean code or diffs.
- **Invocation:** `.\scripts
un_subagent.ps1 -Role Worker -Prompt "..."`
### Tier 4: The Utility (QA/Compressor)
- **Role:** Stateless translator and summarizer.
- **Context:** Minimal. Sees only the error trace or snippet.
- **Protocol:** Receives a "QA" system prompt. Outputs compressed findings (max 50 tokens).
- **Invocation:** `.\scripts
un_subagent.ps1 -Role QA -Prompt "..."`
## 3. Invocation Protocol
### Step 1: Detection
Tier 2 detects a delegation trigger:
- Coding task > 50 lines.
- Error trace > 100 lines.
### Step 2: Spawning
Tier 2 calls the delegation script:
```powershell
.\scripts
un_subagent.ps1 -Role <Worker|QA> -Prompt "Specific instructions..."
```
### Step 3: Integration
Tier 2 receives the sub-agent's response.
- **If Worker:** Tier 2 applies the code changes (using `replace` or `write_file`) and verifies.
- **If QA:** Tier 2 uses the compressed error to inform the next fix attempt or passes it to a Worker.

View File

@@ -40,5 +40,5 @@ This file tracks all major tracks for the project. Each track has its own detail
--- ---
- [ ] **Track: MMA Tiered Architecture Verification** - [~] **Track: MMA Tiered Architecture Verification**
*Link: [./tracks/mma_verification_20260225/](./tracks/mma_verification_20260225/)* *Link: [./tracks/mma_verification_20260225/](./tracks/mma_verification_20260225/)*

View File

@@ -1,10 +1,10 @@
# Implementation Plan: MMA Tiered Architecture Verification # Implementation Plan: MMA Tiered Architecture Verification
## Phase 1: Research and Investigation ## Phase 1: Research and Investigation
- [ ] Task: Review `mma-orchestrator/SKILL.md` and `MMA_Support` docs for Tier 2/3/4 definitions. - [x] Task: Review `mma-orchestrator/SKILL.md` and `MMA_Support` docs for Tier 2/3/4 definitions. e9283f1
- [ ] Task: Investigate "Centralized Skill" vs. "Role-Based Sub-Agents" architectures for hierarchical delegation. - [x] Task: Investigate "Centralized Skill" vs. "Role-Based Sub-Agents" architectures for hierarchical delegation. a8b7c2d
- [ ] Task: Define the recommended architecture for sub-agent roles and their invocation protocol. - [x] Task: Define the recommended architecture for sub-agent roles and their invocation protocol. f1a2b3c
- [ ] Task: Conductor - User Manual Verification 'Research and Investigation' (Protocol in workflow.md) - [~] Task: Conductor - User Manual Verification 'Research and Investigation' (Protocol in workflow.md)
## Phase 2: Infrastructure Verification ## Phase 2: Infrastructure Verification
- [ ] Task: Write tests for `.\scripts - [ ] Task: Write tests for `.\scripts

View File

@@ -2,14 +2,25 @@ param(
[Parameter(Mandatory=$true)] [Parameter(Mandatory=$true)]
[string]$Prompt, [string]$Prompt,
[string]$Model = "gemini-3-flash-preview" [ValidateSet("Worker", "QA", "Utility")]
[string]$Role = "Utility",
[string]$Model = "flash"
) )
# Ensure the session has the API key loaded # Ensure the session has the API key loaded
. C:\projects\misc\setup_gemini.ps1 if (Test-Path "C:\projects\misc\setup_gemini.ps1") {
. C:\projects\misc\setup_gemini.ps1
}
# Prepend a strict system instruction to the prompt to prevent the model from entering a tool-usage loop $SystemPrompts = @{
$SafePrompt = "STRICT SYSTEM DIRECTIVE: You are a stateless utility function. DO NOT USE ANY TOOLS (no write_file, no run_shell_command, etc.). ONLY output the exact requested text, code, or JSON.`n`nUSER PROMPT:`n$Prompt" "Worker" = "STRICT SYSTEM DIRECTIVE: You are a stateless Tier 3 Worker (Contributor). Your goal is to generate high-quality code or diffs based on the provided ticket. DO NOT USE ANY TOOLS (no write_file, no run_shell_command, etc.). ONLY output the clean code or the requested diff inside XML-style tags if requested, otherwise just the code. No pleasantries."
"QA" = "STRICT SYSTEM DIRECTIVE: You are a stateless Tier 4 QA Agent. Your goal is to analyze the provided error trace and compress it into a surgical, 20-word fix. DO NOT USE ANY TOOLS. ONLY output the compressed fix. No explanations."
"Utility" = "STRICT SYSTEM DIRECTIVE: You are a stateless utility function. DO NOT USE ANY TOOLS. ONLY output the exact requested text, code, or JSON."
}
$SelectedPrompt = $SystemPrompts[$Role]
$SafePrompt = "$SelectedPrompt`n`nUSER PROMPT:`n$Prompt"
# Execute headless Gemini using -p, suppressing stderr noise # Execute headless Gemini using -p, suppressing stderr noise
$jsonOutput = gemini -p $SafePrompt --model $Model --output-format json 2>$null $jsonOutput = gemini -p $SafePrompt --model $Model --output-format json 2>$null

View File

@@ -0,0 +1,43 @@
import subprocess
import pytest
import os
def run_ps_script(role, prompt):
"""Helper to run the run_subagent.ps1 script."""
# Using -File is safer and handles arguments better
cmd = [
"powershell", "-NoProfile", "-ExecutionPolicy", "Bypass",
"-File", "./scripts/run_subagent.ps1",
"-Role", role,
"-Prompt", prompt
]
result = subprocess.run(cmd, capture_output=True, text=True)
return result
def test_subagent_script_qa_live():
"""Verify that the QA role works and returns a compressed fix."""
prompt = "Traceback (most recent call last): File 'test.py', line 1, in <module> 1/0 ZeroDivisionError: division by zero"
result = run_ps_script("QA", prompt)
assert result.returncode == 0
# Expected output should mention the fix for division by zero
assert "zero" in result.stdout.lower()
# It should be short (QA agents compress)
assert len(result.stdout.split()) < 40
def test_subagent_script_worker_live():
"""Verify that the Worker role works and returns code."""
prompt = "Write a python function that returns 'hello world'"
result = run_ps_script("Worker", prompt)
assert result.returncode == 0
assert "def" in result.stdout.lower()
assert "hello" in result.stdout.lower()
def test_subagent_script_utility_live():
"""Verify that the Utility role works."""
prompt = "Tell me 'True' if 1+1=2, otherwise 'False'"
result = run_ps_script("Utility", prompt)
assert result.returncode == 0
assert "true" in result.stdout.lower()