feat(core): Phase G — hierarchical subgraphs, role catalog, TaskNodeKind#511
Merged
Conversation
…ted/TeamSynthesized events
- Add RoleId newtype + RoleSpec + RoleCatalog with 7 built-in specialist roles
(researcher, red-team, fact-checker, writer, editor, critic, synthesizer)
- Add TaskNodeKind enum (Leaf | Team { subgraph }) with serde + Box for recursion
- Add role: Option<RoleId> field to TaskNode
- Add MAX_TOTAL_NODES = 32 (soft aggregate budget)
- Extend validate_acyclic() to recurse into Team subgraphs
- Add TaskGraph::total_node_count() for aggregate node counting
- Add TeamStarted / TeamSynthesized variants to OrchestratorEvent
- Update mod.rs to re-export all new public items
- Fix TaskNode construction in director.rs, executor.rs, proxy test
- Handle new event variants in orchestrator_proxy.rs and CLI render_event
- Add phase_f_baseline.json fixture for backward-compat deserialization test
- All unit tests + doc-tests pass; clippy clean; boundaries pass
7 tasks
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.
Summary
Implements Phase G of the v2 orchestrator architecture (closes #508): hierarchical task decomposition via
TaskNodeKind::Team { subgraph }, a built-in role catalog, and team lifecycle SSE events.Changes
gglib-core— domain typesrole_catalog.rs(new)RoleIdnewtype (pub struct RoleId(pub String)) withnew(),as_str(),Display,Serialize/DeserializeRoleSpec— display name, system prompt fragment, default tool allowlist, suggested temperature, requires_approval flagRoleCatalog—HashMap<RoleId, RoleSpec>withDefaultimpl populating 7 built-in specialist roles:researcher,red-team,fact-checker,writer,editor,critic,synthesizertask_graph.rsTaskNodeKindenum:Leaf(default) |Team { subgraph: Box<TaskGraph> }— serdesnake_case,#[serde(default)]on the field for backward compatMAX_NODES/MAX_DEPTHdocs clarified as per-subgraph limitsMAX_TOTAL_NODES = 32soft aggregate budget (not enforced yet — Phase H)TaskNode.role: Option<RoleId>— specialist role assignmentvalidate_acyclic()recurses intoTeamsubgraphsTaskGraph::total_node_count()— recursive aggregate countevents.rsTeamStarted { team_id, role: Option<RoleId> }— emitted before team subgraph beginsTeamSynthesized { team_id, compacted_output }— emitted when team subgraph completesmod.rspub mod role_catalogaddedRoleCatalog,RoleId,RoleSpec,TaskNodeKind,MAX_TOTAL_NODESCaller updates
gglib-agent/orchestrator/director.rs—TaskNodeconstruction gainskind: TaskNodeKind::Leaf, role: Nonegglib-agent/orchestrator/executor.rs—make_node()test helper updatedgglib-proxy/src/orchestrator_proxy.rs— new event variants added to exhaustive matchgglib-cli/src/handlers/orchestrate.rs—render_event()handlesTeamStarted/TeamSynthesizedgglib-proxy/tests/integration_virtual_models.rs—test_graph()helper updatedTest fixtures
tests/fixtures/orchestrator/phase_f_baseline.json— Phase F regression fixture (flat graph withoutkind/rolefields; verifies backward-compat deserialization)Tests
cargo test -p gglib-core)cargo test --doc -p gglib-core)cargo clippy --all-targets -- -D warnings— clean./scripts/check_boundaries.sh— all PASSIssue
Closes #508