Plan D: web Socket.IO bridge + LangGraph retirement - #8
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plan D — Web bridge + LangGraph retirement
Makes the parallel engine the sole orchestrator and gives it a live web UI. Stacked on #7 (Plan C) — merge #7 first, then this (GitHub retargets to
mainonce #7 lands).What this does
backend/main.pynow drives the engine over Socket.IO.start_projectboots a real engine run (state server + worker subprocesses, human-approval mode); a snapshot-diff poller translates engine state into the React frontend's existing events (agent_status,phase_complete,approval_requiredprd/plan,budget_update).approve/reject→submit_approval. So the existing React graph UI renders live engine runs — the old working web UI is preserved, now engine-backed.run.start_run()/stop_run()— a reusable, self-cleaning run handle extracted fromrun_pipeline(atomic: tears down on mid-spawn failure).backend/engine/webbridge.py— pure, unit-tested snapshot→frontend mappers (incl. the discrete budget-threshold bucket{0,50,75,85,95,100}the frontend meter expects, and a"downgraded"agent status when budget swaps a model).backend/graph.py+backend/orchestrator.py+ ~13 coupled/obsolete tests deleted;langgraph+langgraph-checkpoint-sqlitedeps and the mypy override dropped. Zero legacy references remain.Evidence
stop_run+ a FastAPI lifespanshutdown()reclaims everything). Final opus whole-branch review: ready-to-merge (one Important frontend-id mismatch,qa→qa_test, fixed here and confirmed withtsc --noEmit).pytest tests/= 154 passed, 86.93% coverage (gate 70%). Frontend type-checks.Manual check + tracked follow-ups (not blocking)
python -m backend.main+cd frontend && npm run dev) — the emitted event shapes are reproduced verbatim fromfrontend/src/types/index.tsand every phase-worker node id now matches the engine.start_projectdedup /disconnectteardown / poller-retry — all reclaimed at server shutdown), the design-inherited in-memory-onlyload_projectafter restart, and the ADR-only (vs combined) plan-gate card are noted as follow-ups.