🧩 Core Components
- YAML Swarms (
~/.omp/extensions/swarm-extension-fixed): Ejected extension executing DAGs via workspace/ in sequential, parallel, or pipeline modes.
- Swarm Validator (
docs/omp/examples/validate-swarm.sh): Bun-based static validator to prevent token waste.
- Python Swarms (
workflowz): Dynamic orchestration supporting parallel(), pipeline(), and agent(schema=...).
⚖️ Engine Selection
- YAML: Best for deep checkpointing (
.swarm_<name>/state/pipeline.json), fixed multi-persona phases, and looped iterations.
- Python: Best for dynamic map-reduce, programmatic control flows, and advanced cognitive patterns.
⚠️ v1 Limitations
- No Isolation: Parallel Python tasks share a mutable filesystem.
isolated=True is invalid/hallucinated.
- Exception Cascades: Bare lambda thunks crash execution waves. Wrap all thunks in try/except blocks.
- Token Leaks: Interpolating raw LLM outputs into prompts explodes context. Pass file digests or write data to disk instead.
- YAML Collisions: Concurrent agents race when writing to shared files.
🛠️ Python Primitives
agent(prompt, schema=SCHEMA): Forces structured JSON output for deterministic routing.
parallel(thunks): Executes thunks concurrently in a bounded pool.
pipeline(items, *stages): Maps items sequentially through processing barriers.
🧠 Cognitive Patterns
- Adversarial Verification: Spawn skeptic agents to actively refute claims.
- Perspective-Diverse: Assign distinct lenses (security, performance, correctness) to different agents.
- Judge Panels: Run parallel attempts, then score and synthesize results using independent judges.
- Loop-Until-Dry: Spawn finder agents iteratively and deduplicate results aggressively until no new data is found.
- Completeness Critic: Use a final agent to identify missing claims and feed them into the next iteration.
⚡ Execution Rules
- Validate First: Run
validate-swarm.sh before executing any YAML swarm.
- Explicit Deps: Define all dependencies explicitly. A single
waits_for disables automatic chaining.
- Schema Branching: Route Python control logic using structured output from
schema=.
- Catch Errors: Wrap code inside
parallel() in try/except blocks to isolate execution failures.