Skip to content

Plan A: parallel MCP orchestration engine — coordination core - #5

Merged
adbarc92 merged 15 commits into
mainfrom
feat/parallel-mcp-orchestration-engine
Jul 25, 2026
Merged

Plan A: parallel MCP orchestration engine — coordination core#5
adbarc92 merged 15 commits into
mainfrom
feat/parallel-mcp-orchestration-engine

Conversation

@adbarc92

Copy link
Copy Markdown
Owner

Plan A — Coordination Core of the parallel MCP orchestration engine

Context. A publication-prep verification pass found three resume claims that the codebase did not actually back: an MCP-based state server, a six-phase dependency graph, and independent processes resolving execution order and shared state without collision. Rather than soften the claims, we're building the real architecture — a full replacement of the single-process LangGraph orchestrator — designed to be maximally parallelizable. Full design (3 rounds of adversarial critique) and plan are in docs/superpowers/.

This is Plan A of three. It delivers the spike-independent coordination core; Plans B (MCP server + worker processes) and C (live budget wiring, concurrency stress test, documented run, LangGraph cutover) follow.

What's in this PR

  • MCP go/no-go spike (a6b7d0e) — proved FastMCP streamable-HTTP handles 8 concurrent client sessions × 100 tool calls (800/800), pinning mcp==1.28.1. The whole engine was gated on this.
  • config/phases.yaml + backend/engine/phases.py — the six-phase source of truth: Clarify → Design → Code → Test → Deploy → Iterate, with the 13 phase-worker agents, intra-phase dependency edges, and approval gates after Clarify/Design.
  • backend/engine/models.py — SQLite schema (runs/phases/tasks/state/spend/events) + typed ClaimResult.
  • backend/engine/scheduler.py — pure functions: readiness, phase advance, gate/seeding, budget model-resolution (with critical-agent skip-list).
  • backend/engine/store.py — single-writer aiosqlite/WAL store, asyncio-lock + _txn (commit-on-success / rollback-on-exception) discipline: atomic task claim (single guarded UPDATE … RETURNING), versioned state CAS, single-transaction completion, owner-guarded heartbeat, version-bumping reaper, fail/retry with cap. These are the collision-freedom + exactly-once-effect primitives.
  • BudgetBudgetGuard.downgrade_model_for + authoritative downgrade_paths moved into config/budget.yaml; two dead registry accessors removed; engine settings added to config.py.

Evidence

  • New engine test suite is green; the pre-existing LangGraph/Socket.IO suite is unaffected (uv run pytest tests -q → exit 0).
  • Every task went through TDD + an independent spec/quality review; three tasks took a review-driven fix (schema-column assertion, fail_task status guard, transaction-safety helper).
  • Final whole-branch review verdict: ready to merge. No Critical/Important findings; concurrency and exactly-once properties verified under adversarial interleaving analysis. Remaining Minor items were fixed (b8f93b8) or carried forward to Plan B/C.

Deferred to Plan B/C (by design — placeholders here, not broken paths)

  • MCP server + worker processes (the _downgrade_config hook returns empty paths, events/current_phase unwritten, spawn_tasks inert until dynamic expansion).
  • Live claim-time budget downgrade wiring + the documented run.
  • Reaper MAX_ATTEMPTS cap enforcement (only fail_task enforces it today).
  • LangGraph retirement + migration of the ~25 coupled tests.

adbarc92 added 15 commits July 23, 2026 17:00
Full-replacement engine that makes three unbacked resume claims true and
testable: an MCP state server (FastMCP/streamable-HTTP, SQLite/WAL), a
six-phase dependency graph (Clarify->Design->Code->Test->Deploy->Iterate),
and independent OS worker processes coordinating shared state without
collision (serialized DB ops + versioned CAS). Preserves 16 agents,
approval gates, and budget auto-downgrade. Survived three independent
adversarial critique rounds (log appended).
@adbarc92
adbarc92 merged commit cc70f47 into main Jul 25, 2026
0 of 5 checks passed
@adbarc92
adbarc92 deleted the feat/parallel-mcp-orchestration-engine branch July 25, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant