-
Notifications
You must be signed in to change notification settings - Fork 102
feat(orchestrator): goal-level coordination step (P2-ii-a) - #1128
Draft
najmuzzaman-mohammad wants to merge 1 commit into
Draft
feat(orchestrator): goal-level coordination step (P2-ii-a) #1128najmuzzaman-mohammad wants to merge 1 commit into
najmuzzaman-mohammad wants to merge 1 commit into
Conversation
...s children and apply a per-child action plan (P2-ii-a)
Wires the P2-i coordination kernel into a live goal-level step. A "goal" is a
top-level task that has children (the broker has no goal/epic struct — children
carry ParentIssueID); when one becomes executable, the broker coordinates its
children instead of dispatching the parent as a single agent turn.
Wire shape (new): CoordinateRequest{schema_version, goal_id, children[]} ->
CoordinationPlan{goal_id, actions{task_id->action}, ready[], cycle?}. extra="forbid"
+ server-side schema_version validation, matching the P2-0 contract discipline.
Orchestrator (Python):
- coordination.py `coordinate(graph)` -> CoordinationResult: per-child action,
the ready batch, and a cycle path. A dependency cycle is a deadlocked
decomposition: every child BLOCKs and the path is surfaced so the broker fails
loud rather than running an unrunnable plan.
- service.py `POST /coordinate`: pure (no harness, no checkpointer) over
TaskGraph.from_broker_records.
Broker (Go) — rides the existing dispatch loop (the chosen trigger):
- sendTaskUpdate routes a goal (taskIsGoal: top-level + has children) to
coordinateGoalViaOrchestrator; a leaf still takes the single-task /run path.
- coordinateGoalViaOrchestrator enumerates children and sends
depends_on = DependsOn ∪ BlockedOn, so the kernel's release rule matches the
broker's unblock cascade (which sweeps both — orchestratorRecord omits them).
- applyCoordinationPlan: START -> TransitionLifecycle(running) (the notify loop
dispatches it next tick); DISPATCH -> single-task /run now; BLOCK/IDLE/AWAIT ->
leave; UNKNOWN/cycle -> fail loud, act on nothing. Per-goal single-flight in a
key space distinct from per-task dispatch; panic-recover + shutdown-aware ctx
reuse the P2-0 guards.
- provider.DispatchClient.Coordinate over POST /coordinate; postStep refactored to
share postRaw with the new endpoint.
Tests: pytest +coordinate cases (serial/parallel/cycle/rejected-upstream + the
endpoint); Go provider Coordinate decode/validation/cycle; broker apply-plan,
union-deps, cycle-does-nothing, taskIsGoal; a real-client /coordinate E2E through
the broker. Live smoke adds a /coordinate assertion. pytest green; go vet +
golangci-lint clean; team/provider suites green under -race (except the
pre-existing env-only TestBrokerAuthRejectsUnauthenticated — gbrain on PATH).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Important
Review skipped
Draft detected.
Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 6a80d9c4-6794-4aa3-afdc-3ca46136e756
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
- 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
- Create PR with unit tests
- Commit unit tests in branch
deepagents/10-goal-coordinate
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
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.
P2-ii-a — Goal-level coordination step (stacked on #1127)
Wires the P2-i coordination kernel into a live goal-level step. A goal decomposes into ordered tasks and runs through LangGraph, one slice closer to the P2-ii gate.
Trigger (your pick): rides the existing dispatch loop. A goal (a top-level task that has children) becoming executable coordinates its children instead of dispatching the parent as a single turn. A leaf still takes the P1b single-task
/runpath. Single ownership either way.Wire shape (new)
CoordinateRequest{schema_version, goal_id, children[]}→CoordinationPlan{goal_id, actions{task_id→action}, ready[], cycle?}— withextra="forbid"+ server-sideschema_versionvalidation (the P2-0 discipline, so a half-landed field on the new shape fails loud).Orchestrator (Python)
coordination.pycoordinate(graph)→ per-child action + ready batch + cycle path. A dependency cycle ⇒ every childBLOCKand the path surfaced (deadlocked decomposition, never a runnable plan).POST /coordinate— pure (no harness/checkpointer) overTaskGraph.from_broker_records.Broker (Go)
taskIsGoal(top-level + has children) routes tocoordinateGoalViaOrchestrator.depends_on = DependsOn ∪ BlockedOnso the kernel's release rule matches the broker's unblock cascade (which sweeps both;orchestratorRecordomits them).TransitionLifecycle(running)(the notify loop dispatches it next tick), DISPATCH → single-task/runnow, BLOCK/IDLE/AWAIT → leave, UNKNOWN/cycle → fail loud and act on nothing. Per-goal single-flight (distinct key space), panic-recover, shutdown-aware ctx — reuses the P2-0 guards.DispatchClient.Coordinate;postSteprefactored to sharepostRaw.Verification
pytestgreen (+ coordinate kernel + endpoint cases: serial / parallel / cycle / rejected-upstream).SMOKE OK—/coordinatereturns{c1: start, c2: block}, ready[c1].go vet+golangci-lintclean;internal/team+internal/providergreen under-race, including a real-client/coordinateE2E through the broker (child enumeration → realDispatchClient→ real HTTP → START transition). Only the pre-existing env-onlyTestBrokerAuthRejectsUnauthenticatedfails (gbrain on local PATH; green in CI).Next (P2-ii-b): decompose-turn classification — a planning turn's
team_taskcreate calls → child specs (the CEO decompose node), feeding the children this PR coordinates.🤖 Generated with Claude Code