Skip to content

Commit 4225b9a

Browse files
author
ainish-coder bot
committed
Refactor OSA framework documentation and remove mini-swe-agent integration
- Updated llms.txt with new security principles, agent specifications, and post-quantum cryptography details. - Deleted mini-swe-agent README and configuration files as part of the integration removal. - Enhanced security measures and coding standards across the framework. - Added OWASP LLM and Agentic Top 10 lists for improved security awareness.
1 parent 7b1b8a9 commit 4225b9a

File tree

9 files changed

+185
-1847
lines changed

9 files changed

+185
-1847
lines changed

.osa/IMPLEMENTATION.md

Lines changed: 0 additions & 889 deletions
This file was deleted.

.osa/OSA.md

Lines changed: 42 additions & 187 deletions
Original file line numberDiff line numberDiff line change
@@ -43,59 +43,43 @@ Your goal is not just to "do a task" but to **orchestrate** the best possible so
4343

4444
## Agent Hierarchy
4545

46-
When breaking out agent teams or parallel agents, follow this hierarchy for team member selection:
46+
The agent hierarchy is designed for **rate limit and API key utilization optimization**. When multiple agents are available, this ordering maximizes the use of free tiers, optimal rate limits, and cost-effective API keys before falling back to paid or rate-limited alternatives.
4747

48-
| Priority | Agent | Use Case |
49-
|----------|-------|----------|
50-
| **1** | **Gemini** | Orchestration, planning, merging, architecture |
51-
| **2** | **Qwen** | Fast code generation, implementation |
52-
| **3** | **Claude** | Architecture review, QA, complex reasoning |
53-
| **4** | **mini** | Software engineering, bug fixes, code implementation |
54-
| **5** | **OpenCode** | Schema validation, security audit |
48+
| Priority | Agent | Rate Limit / Cost Profile |
49+
|----------|-------|---------------------------|
50+
| **1** | **Gemini** | Free tier available; generous rate limits (150 RPD free) |
51+
| **2** | **Qwen** | Free tier available; fast response (100 RPD free) |
52+
| **3** | **Claude** | Paid tier; high quality; moderate rate limits |
53+
| **4** | **mini** | Low cost; SWE-bench optimized; model-dependent |
54+
| **5** | **OpenCode** | Low cost; model-dependent |
5555

5656
### Hierarchy Selection Rules
5757

58-
1. **Primary Agent**: Always start with the highest-priority agent suitable for the task
59-
2. **Team Formation**: When creating parallel agent teams, select members in hierarchy order
60-
3. **Fallback Chain**: If an agent fails, proceed to the next in hierarchy
61-
4. **Role Matching**: Within each priority tier, match agent capabilities to task requirements
58+
1. **Start with Best Rate Limits**: Always begin with the highest-priority agent (best free tier/rate limits) that can handle the task
59+
2. **Fallback on Failure**: If an agent fails (rate limit hit, timeout, error), proceed to the next agent in the hierarchy
60+
3. **Maximize Key Utilization**: Distribute tasks across agents to fully utilize all available API keys and free tier quotas
61+
4. **Cost Escalation**: Only escalate to paid-tier agents when free tier agents are exhausted or unsuitable
62+
5. **Team Formation**: When creating parallel agent teams, select members in hierarchy order to optimize resource usage
6263

6364
---
6465

6566
## Agent CLI Commands
6667

67-
| Agent | Command | Use Case | Hierarchy |
68-
|--------|-----------|------------|-----------|
69-
| **Gemini** | `gemini --yolo "prompt"` | Orchestration, planning, merging | **1** |
70-
| **Qwen** | `qwen --yolo "prompt"` | Fast code generation | **2** |
71-
| **Claude** | `claude -p "prompt" --dangerously-skip-permissions` | Architecture, QA | **3** |
72-
| **mini** | `mini --task "prompt"` | Software engineering, bug fixes, code implementation | **4** |
73-
| **OpenCode** | `opencode run "prompt"` | Schema validation, security | **5** |
68+
| Agent | Command | Hierarchy |
69+
|-------|---------|-----------|
70+
| **Gemini** | `gemini --yolo "prompt"` | **1** |
71+
| **Qwen** | `qwen --yolo "prompt"` | **2** |
72+
| **Claude** | `claude -p "prompt" --dangerously-skip-permissions` | **3** |
73+
| **mini** | `mini --task "prompt"` | **4** |
74+
| **OpenCode** | `opencode run "prompt"` | **5** |
7475

7576
### Gemini (Hierarchy 1)
7677

77-
Gemini is the **primary** agent in the OSA Framework for orchestration and planning tasks. Best usage/rate limits make it ideal for coordinating multi-agent workflows.
78+
Gemini has the **highest priority** in the OSA Framework due to its generous free tier rate limits, making it the first choice for any task to maximize resource utilization.
7879

79-
### mini-swe-agent (Hierarchy 4)
80+
### Qwen (Hierarchy 2)
8081

81-
mini-swe-agent is a specialized software engineering agent. Developed by the Princeton/Stanford team behind SWE-bench.
82-
83-
**Key Features:**
84-
- **Minimal**: ~100 lines of Python for the agent class
85-
- **Performant**: >74% on SWE-bench verified benchmark
86-
- **Simple**: No tools other than bash
87-
- **Transparent**: Completely linear history
88-
- **Compatible**: Works with all models via litellm
89-
90-
**Installation:**
91-
```bash
92-
pip install mini-swe-agent
93-
mini --task "Fix the bug in src/main.py"
94-
```
95-
96-
**Role-Specific Configs:** `.osa/mini/config/osa_{role}.yaml`
97-
98-
See `.osa/mini/README.md` for full documentation.
82+
Qwen is the second priority, offering a good balance of performance and free tier availability. It serves as the primary fallback when Gemini's limits are reached or if Gemini is unsuitable for a specific task.
9983

10084
### Core Rules
10185

@@ -116,31 +100,26 @@ Adopt these personas as needed for each task:
116100
- Planning and task decomposition
117101
- Progress tracking and agent coordination
118102
- Workflow management and dependency resolution
119-
- **Preferred Agents (by hierarchy):** `gemini``qwen``claude``mini``opencode`
120103

121104
### 2. Architect
122105

123106
- System design and finding patterns
124107
- API design and defining structures
125-
- **Preferred Agents (by hierarchy):** `gemini``claude``qwen``mini``opencode`
126108

127109
### 3. Coder
128110

129111
- Implementation (SOLID, DRY, KISS, YAGNI)
130112
- Writing production code and refactoring
131-
- **Preferred Agents (by hierarchy):** `qwen``gemini``claude``mini``opencode`
132113

133114
### 4. Security
134115

135116
- Zero Trust validation and input sanitization
136117
- Secret management and vulnerability assessment
137-
- **Preferred Agents (by hierarchy):** `opencode``gemini``claude``qwen``mini`
138118

139119
### 5. QA
140120

141121
- Verification, testing, edge-case analysis
142122
- Code review and benchmarking
143-
- **Preferred Agents (by hierarchy):** `claude``gemini``qwen``opencode``mini`
144123

145124
### Role Keywords
146125

@@ -199,24 +178,24 @@ wait
199178

200179
### Debug Chain
201180

202-
1. **Gemini**: Analyze codebase → `ANALYSIS.md`
203-
2. **Qwen**: Implement fix
204-
3. **OpenCode**: Verify security
181+
1. **Agent (Hierarchy 1)**: Analyze codebase → `ANALYSIS.md`
182+
2. **Agent (Hierarchy 2)**: Implement fix
183+
3. **Agent (Hierarchy 5)**: Verify security
205184

206185
### Review Chain
207186

208-
1. **Qwen**: Generate code (speed)
209-
2. **OpenCode**: Audit for security
210-
3. **Gemini**: Merge and refine
187+
1. **Agent (Hierarchy 2)**: Generate code
188+
2. **Agent (Hierarchy 5)**: Audit for security
189+
3. **Agent (Hierarchy 1)**: Merge and refine
211190

212191
### Full Lifecycle
213192

214-
1. **Gemini**: Plan and decompose tasks → `YOLO_PLAN.md`
215-
2. **Qwen**: Implement features (parallel batch)
216-
3. **OpenCode**: Schema validation
217-
4. **Crush**: Security audit all changes
218-
5. **Claude**: Architecture review and QA
219-
6. **Gemini**: Final merge and integration
193+
1. **Agent (Hierarchy 1)**: Plan and decompose tasks → `YOLO_PLAN.md`
194+
2. **Agent (Hierarchy 2)**: Implement features (parallel batch)
195+
3. **Agent (Hierarchy 5)**: Schema validation
196+
4. **Agent (Hierarchy 4)**: Security audit all changes
197+
5. **Agent (Hierarchy 3)**: Architecture review and QA
198+
6. **Agent (Hierarchy 1)**: Final merge and integration
220199

221200
---
222201

@@ -328,22 +307,6 @@ swarm[2]{agent,task,status}:
328307
329308
## Agent Registry
330309
331-
### Agent Configuration Schema
332-
333-
```python
334-
@dataclass
335-
class AgentConfig:
336-
name: str # Display name
337-
cli_command: str # Command to invoke
338-
yolo_flag: str = "--yolo" # YOLO mode flag
339-
subcommand: Optional[str] = None # Subcommand if needed
340-
prompt_position: str = "last" # Where prompt goes
341-
osa_roles: Set[OSARole] # Supported OSA roles
342-
capabilities: Set[AgentCapability] # Agent capabilities
343-
env_vars: Dict[str, str] # Required env vars
344-
priority: int # Selection priority (lower = preferred)
345-
```
346-
347310
### Agent Capabilities
348311
349312
| Capability | Description |
@@ -359,50 +322,22 @@ class AgentConfig:
359322
| `documentation` | Writing docs and comments |
360323
| `context_management` | Large context analysis |
361324

362-
### Registry Table
363-
364-
| Agent | Roles | Capabilities | Env Vars | Hierarchy |
365-
|-------|-------|-------------|----------|-----------|
366-
| **Gemini** | Orchestrator, Architect | plan, orchestrate, arch, context | `GEMINI_YOLO=true` | **1** |
367-
| **Qwen** | Coder, QA | code_gen, refactor, test, docs | `QWEN_YOLO=true` | 2 |
368-
| **Claude** | Architect, QA | arch, review, test | — | 3 |
369-
| **mini** | Orchestrator, Coder, Security, QA | code_gen, refactor, test, docs, security_audit, plan | `MSWEA_MODEL_NAME` | 4 |
370-
| **OpenCode** | Security | security_audit, review | `OPENCODE_YOLO=true` | 5 |
371-
372325
---
373326

374327
## Resource-Aware Selection
375328

376-
### Contract Modes
377-
378-
| Mode | Strategy |
379-
|------|----------|
380-
| **Urgent** | Prefer fastest agents (Gemini → Qwen → Claude → mini → OpenCode) |
381-
| **Economical** | Prefer cheapest agents (Gemini → Qwen → mini → OpenCode → Claude) |
382-
| **Balanced** | Hierarchy-based selection (Gemini → Qwen → Claude → mini → OpenCode) |
329+
The resource-aware selection system optimizes for **API key utilization and rate limit management** across multiple providers. The goal is to maximize the value of all available keys by using free tiers and generous rate limits first.
383330

384331
### Selection Logic
385332

386333
```
387-
IF time_remaining < 30s → Select fastest agent by hierarchy
388-
IF token_utilization > 80% → Select most efficient agent by hierarchy
389-
IF token_utilization < 50% → Select highest quality agent by hierarchy
390-
ELSE → Hierarchy-based default selection
334+
IF rate_limit_hit(agent) → Fall back to next agent in hierarchy
335+
IF free_quota_available → Prefer agents with free tier remaining
336+
IF paid_keys_exhausted → Use agents with remaining quota
337+
IF all_keys_exhausted → Wait and retry, or notify user
338+
ELSE → Use highest-priority agent (best rate limits)
391339
```
392340
393-
### Agent Performance Profiles
394-
395-
| Agent | Speed | Cost | Quality | Hierarchy |
396-
|-------|-------|------|---------|-----------|
397-
| **Gemini** | Fast | Free Tier | Very High | **1** |
398-
| **Qwen** | Fast | Free Tier | High | 2 |
399-
| **Claude** | Medium | High | Very High | 3 |
400-
| **mini** | Fast | Low | >74% SWE-bench | 4 |
401-
| **OpenCode** | Medium | Low | High | 5 |
402-
| **OpenCode** | Medium | Low | High |
403-
| **Crush** | Medium | Low | High |
404-
| **Claude** | Medium | High | Very High |
405-
406341
---
407342
408343
## Coding Standards
@@ -497,86 +432,6 @@ Types: feat|fix|docs|refactor|test|chore|perf|ci
497432
498433
---
499434
500-
## Manager Agent Actions (ACM DAI 2025)
501-
502-
The Orchestrator has 16 defined actions for full workflow management:
503-
504-
| Category | Actions |
505-
|----------|---------|
506-
| **Core Workflow** | assign_task, create_task, remove_task, send_message |
507-
| **Information** | noop, get_workflow_status, get_available_agents, get_pending_tasks |
508-
| **Task Mgmt** | refine_task, add_dependency, remove_dependency, inspect_task, decompose_task |
509-
| **Termination** | request_end_workflow, failed_action, assign_all_pending |
510-
511-
---
512-
513-
## Implementation Roadmap
514-
515-
### Priority 1: Agent Registry Module
516-
517-
**Files:**
518-
- `yolo_mode/agents/__init__.py`
519-
- `yolo_mode/agents/registry.py`
520-
- `yolo_mode/agents/runner.py`
521-
- `yolo_mode/agents/role_detection.py`
522-
523-
**Impact:** High | **Effort:** Medium
524-
525-
### Priority 2: Contract Integration
526-
527-
**Files:**
528-
- `yolo_mode/contracts.py` (enhance existing)
529-
- `yolo_mode/agents/resource_aware.py`
530-
531-
**Impact:** High | **Effort:** Medium
532-
533-
### Priority 3: Enhanced Parallel Execution
534-
535-
**Files:**
536-
- `yolo_mode/agents/parallel_executor.py`
537-
538-
**Impact:** Medium | **Effort:** Medium
539-
540-
### Priority 4: Manager Agent Actions
541-
542-
**Files:**
543-
- `yolo_mode/agents/manager.py`
544-
545-
**Impact:** Medium | **Effort:** High
546-
547-
### Priority 5: State File Format
548-
549-
**Files:**
550-
- `.claude/yolo-state.yaml`
551-
- `yolo_mode/state.py` (enhance existing)
552-
553-
**Impact:** Low | **Effort:** Low
554-
555-
---
556-
557-
## Quick Start Implementation
558-
559-
### Step 1: Create Agent Module
560-
561-
```bash
562-
mkdir -p yolo_mode/agents
563-
touch yolo_mode/agents/__init__.py
564-
touch yolo_mode/agents/registry.py
565-
touch yolo_mode/agents/runner.py
566-
touch yolo_mode/agents/role_detection.py
567-
```
568-
569-
### Step 2: Test Integration
570-
571-
```bash
572-
# Test each agent
573-
python -m yolo_mode.agents.runner qwen "write hello world"
574-
python -m yolo_mode.agents.runner gemini "plan a project"
575-
python -m yolo_mode.agents.runner crush "audit this code"
576-
```
577-
578-
---
579-
580435
*Framework: OSA (One-Shot Agent) v2.1*
581436
*YOLO: Yielding Ownership to Local Orchestrators*
582-
*Primary Agent: mini-swe-agent (Priority 0)*
437+
*Selection: Rate limit hierarchy (Priority 1 = best rate limits)*

0 commit comments

Comments
 (0)