Factories are workers, not special entities #115

Closed
opened 2026-04-10 19:40:22 +00:00 by Mark · 0 comments
Owner

Architecture Violation

Factories (worker_factory, skill_factory, etc.) are treated as special infrastructure entities with unique routing and behavior. This violates the worker-centric architecture.

Correct Architecture

Per AGENTS.md:

  • Factories are workers - Not special entities
  • worker_factory is a worker with a skill bundle for provisioning
  • No special factory routing
  • Factories bid, execute, emit results like normal workers

Current Incorrect Behavior

Evidence of factory-as-special-entity violations:

  • Special routing logic for worker_factory in mesh_node
  • Factory fallback when no workers found for intent type
  • Factories don't follow normal bidding/execution flow
  • Unique spawning logic for factories vs normal workers

Required Fix

Refactor all factories to follow normal worker protocol:

  1. Bid on intents - Like any other worker
  2. Execute via skills - Use skill bundle to provision/mutate
  3. Emit results - Normal result.committed flow
  4. No special routing - Same bidding competition as workers

worker_factory Specific Fix

The worker_factory should:

  1. Bid on provision_worker intents (not fallback for all intents)
  2. Execute provisioning via spawn_workers skill
  3. Hand minted worker the original intent via factory_init skill
  4. Emit provisioning result, let minted worker handle original intent

Impact

Without this fix:

  • Factory pattern remains confused
  • Worker spawning broken
  • Intent routing falls back incorrectly
  • Architecture violations cascade

References

  • AGENTS.md - Factory pattern section
  • docs/reference/FACTORY_PATTERN.md - Factory specification
  • docker/mesh_node.py - Special factory routing logic
  • capabilities/_muscle/worker_factory/run.py - Current factory implementation
## Architecture Violation Factories (worker_factory, skill_factory, etc.) are treated as special infrastructure entities with unique routing and behavior. This violates the worker-centric architecture. ## Correct Architecture Per AGENTS.md: - **Factories are workers** - Not special entities - **worker_factory is a worker with a skill bundle for provisioning** - **No special factory routing** - **Factories bid, execute, emit results like normal workers** ## Current Incorrect Behavior Evidence of factory-as-special-entity violations: - Special routing logic for worker_factory in mesh_node - Factory fallback when no workers found for intent type - Factories don't follow normal bidding/execution flow - Unique spawning logic for factories vs normal workers ## Required Fix Refactor all factories to follow normal worker protocol: 1. **Bid on intents** - Like any other worker 2. **Execute via skills** - Use skill bundle to provision/mutate 3. **Emit results** - Normal `result.committed` flow 4. **No special routing** - Same bidding competition as workers ## worker_factory Specific Fix The worker_factory should: 1. Bid on `provision_worker` intents (not fallback for all intents) 2. Execute provisioning via `spawn_workers` skill 3. Hand minted worker the original intent via `factory_init` skill 4. Emit provisioning result, let minted worker handle original intent ## Impact Without this fix: - Factory pattern remains confused - Worker spawning broken - Intent routing falls back incorrectly - Architecture violations cascade ## References - AGENTS.md - Factory pattern section - docs/reference/FACTORY_PATTERN.md - Factory specification - docker/mesh_node.py - Special factory routing logic - capabilities/_muscle/worker_factory/run.py - Current factory implementation
Mark 2026-05-27 17:28:07 +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#115
No description provided.