ARCH-003: Remove all direct LLM calls from infrastructure code #121

Closed
opened 2026-04-11 01:22:14 +00:00 by Mark · 1 comment
Owner

Problem

LLM calls exist outside of worker execution context. Infrastructure components (mesh_node, evolution, validation) directly call LLMs instead of routing through workers.

Current Violations

Location LLM Usage Problem
mesh_node.py None currently (after recent fixes) Fixed
evolution/championship.py run_writer_capability() Evolution should use workers
validation_agent.py AgenticValidator calls Ollama Validation should be a worker
ingress_controller/run.py _call_llm() method Should be worker task

Why This Is Wrong

  • Infrastructure thinks - breaks agentic design
  • Cannot track resource usage - bypasses ledger
  • No skill/tool integration - direct LLM calls miss capabilities
  • Testing complexity - infrastructure shouldn't need LLM mocking

Fix Required

  1. Evolution - Submit test intents to mesh, let workers execute, score results
  2. Validation - Make ValidationAgent a proper worker that bids on validation intents
  3. Ingress Controller - Route to workers instead of direct LLM calls
  4. All LLM calls go through call_llm() in worker execution context only

Files Affected

  • evolution/championship.py - Remove direct capability calls
  • substrate/validation_agent.py - Convert to worker
  • capabilities/_muscle/ingress_controller/run.py - Route to workers

Acceptance Criteria

  • No LLM imports in infrastructure code
  • All LLM calls happen in worker context
  • Evolution uses mesh intent flow
  • Validation is a worker, not infrastructure

Notes

This ensures only agents (workers) think, infrastructure just routes.

See also: issues/04_remove_llm_from_infrastructure.md

## Problem LLM calls exist outside of worker execution context. Infrastructure components (mesh_node, evolution, validation) directly call LLMs instead of routing through workers. ### Current Violations | Location | LLM Usage | Problem | |----------|-----------|---------| | `mesh_node.py` | None currently (after recent fixes) | Fixed | | `evolution/championship.py` | `run_writer_capability()` | Evolution should use workers | | `validation_agent.py` | `AgenticValidator` calls Ollama | Validation should be a worker | | `ingress_controller/run.py` | `_call_llm()` method | Should be worker task | ### Why This Is Wrong - **Infrastructure thinks** - breaks agentic design - **Cannot track resource usage** - bypasses ledger - **No skill/tool integration** - direct LLM calls miss capabilities - **Testing complexity** - infrastructure shouldn't need LLM mocking ### Fix Required 1. **Evolution** - Submit test intents to mesh, let workers execute, score results 2. **Validation** - Make ValidationAgent a proper worker that bids on validation intents 3. **Ingress Controller** - Route to workers instead of direct LLM calls 4. All LLM calls go through `call_llm()` in worker execution context only ### Files Affected - `evolution/championship.py` - Remove direct capability calls - `substrate/validation_agent.py` - Convert to worker - `capabilities/_muscle/ingress_controller/run.py` - Route to workers ### Acceptance Criteria - [ ] No LLM imports in infrastructure code - [ ] All LLM calls happen in worker context - [ ] Evolution uses mesh intent flow - [ ] Validation is a worker, not infrastructure ## Notes This ensures only agents (workers) think, infrastructure just routes. See also: issues/04_remove_llm_from_infrastructure.md
Author
Owner

Closing — RESOLVED per M008 validation and code inspection:

  • All openai/anthropic imports removed from docker/*.py (verified via grep — zero matches)
  • Infrastructure code (mesh_node.py, bid_manager.py, worker_spawner.py, etc.) has zero direct LLM calls
  • Workers at primitives/_muscle/* handle LLM calls through their own run.py execute functions
  • Verified by R121 and PROJECT.md
Closing — RESOLVED per M008 validation and code inspection: - All openai/anthropic imports removed from docker/*.py (verified via grep — zero matches) - Infrastructure code (mesh_node.py, bid_manager.py, worker_spawner.py, etc.) has zero direct LLM calls - Workers at primitives/_muscle/* handle LLM calls through their own run.py execute functions - Verified by R121 and PROJECT.md
Mark closed this issue 2026-05-05 01:14:15 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Mark/mesh-seed#121
No description provided.