feat: hierarchical dispatch model for meta orchestrator#99
Open
feat: hierarchical dispatch model for meta orchestrator#99
Conversation
- Add psid (parent_sid) to SessionPayload for parent-child session correlation - Add dispatch_workflow tool: creates independent client sessions with dispatch packages - Add get_workflow_status tool: polls client workflow status without sharing tokens - Replace meta workflow activities (start-workflow → dispatch-workflow) - Update orchestrator/worker management skills for inline dispatch-and-manage pattern - Add client dispatch protocol documentation - Update worker prompt template for independent client agents - Add tests for dispatch, status, and parent-child correlation Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
…ma violations Update test workflow paths from ../workflows to ../.engineering/workflows to match the current project layout. Update engineering submodule pointer to include meta workflow fixes (missing version/name on dispatch-workflow, missing YAML frontmatter on 6 resource files). Made-with: Cursor
Made-with: Cursor
- Make executionModel optional in Zod and JSON schemas - Remove executionModel from meta workflow - Update refine guard to handle undefined executionModel - Fix missing response object in dispatch_workflow tool handler - Update test to accept workflows without executionModel Made-with: Cursor
Made-with: Cursor
- Ensure all prompt content is loaded from the workflow resource (meta/05)
- Throw error if template fails to load rather than falling back to hardcoded strings
- Add support for {initial_activity} placeholder substitution
Made-with: Cursor
Made-with: Cursor
- Update dispatch_workflow tool to use activity-orchestrator prompt - Update tests for renamed workflow-orchestrator and activity-worker skills - Update .engineering submodule reference Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
…docs Made-with: Cursor
…or rename Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
…mpt rename Made-with: Cursor
…nt yields Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
This reverts commit 262ab65.
This reverts commit ce71a3b.
Reverts changes made in a previous commit that pointed `WORKFLOW_DIR` to `.engineering/workflows`. The correct path is `workflows`, which is an active worktree containing the workflow files. Made-with: Cursor
The discover tool's output of available_workflows duplicates the functionality of list_workflows and was confusing. Removing it focuses discover on providing the server identity and bootstrap procedure. Made-with: Cursor
…ills Made-with: Cursor
Made-with: Cursor
…rce resolution Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
…current activity definitions - Update test assumptions to use current activity IDs - Modify tests checking for decisions/checkpoints to use appropriate target workflows - Handle TOON schema constraints related to array indices in activities Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The actual workflow-state.json files already contain a sessionToken field at the top level, but the stateSaveFile schema definition was missing it. Add the property and include it in the required array. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…esources
Schema JSON was being prepended to every get_workflow response (~64KB),
bloating tool output ~20x. Schemas are now served as individual MCP
resources at workflow-server://schemas/{id} for granular access, with the
combined resource at workflow-server://schemas preserved. Resources read
directly from the on-disk .schema.json files with no duplication.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add indentation (null, 2) to all JSON.stringify calls in tool handlers so output is human-readable in IDE tool output panels. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
discover, get_resource, and dispatch_workflow were embedding multiline content (markdown, prompts) inside JSON objects, causing newlines to render as escaped \n sequences. Return text content directly instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Activities, skills, and resources were stored as TOON on disk but re-serialized as JSON for tool responses, negating the token efficiency of the format. Now: - next_activity, get_skill, get_skills serve raw TOON file content - get_workflow (full) serves raw workflow.toon - get_workflow (summary), list_workflows, present_checkpoint use encodeToon - dispatch_workflow metadata uses encodeToon - Removed _resources enrichment (agents use raw resources array + get_resource) - Added readSkillRaw, readActivityRaw, readWorkflowRaw loader variants Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The protocolStep definition was never referenced by any in the schema, making it dead code. Removed to keep the schema clean.
…orkflow - WorkflowManifestEntry: replace description?: string with tags?: string[] - listWorkflows() reads tags from TOON instead of description - Update tool description to reflect tag-based output - Fix skill-loader tests: replace tools field assertions with protocol/rules checks (tools removed from skill TOON files)
…nsert primary skill in get_workflow, update schemas - Split next_activity: now returns only activity_id/name/session_token; new get_activity tool returns full activity definition for the worker - list_workflows: replace verbose description with tag-list per workflow - get_workflow: insert workflow primary skill TOON at beginning of response - Update activity schema: add description to actions/loops, condition to actions, skill_args to steps, triggers to steps, remove loops from steps - Update workflow schema: make activities accept strings or objects - Update skill schema: add action field to output artifacts - Fix workflow-loader test to use work-package instead of prism-audit - Fix skill-loader test rules count for activity-worker - Add parseWorkflowResponse helper and get_activity tests - Update API reference docs for all tool changes
0cfba4a to
b3117aa
Compare
…tion Session and trace token validation errors now include verbose explanations of why the token failed and explicit remediation steps the calling agent can follow. Previously, errors like 'signature verification failed' and 'missing signature' gave no actionable guidance. - session.ts decode: all four error paths now explain the likely cause and direct the agent to call start_session for a fresh token - session.ts assertCheckpointsResolved: now tells the orchestrator to call respond_checkpoint with the checkpoint_handle - trace.ts decodeTraceToken: same pattern, suggests omitting trace_tokens parameter as fallback - Updated test assertions to match new error message substrings
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
dispatch_workflowandget_workflow_statusMCP tools for creating independent client sessions with parent-child correlationstart-workflow→resume-workflow) withdispatch-workflowthat manages client lifecycle inline (dispatch → await result → handle checkpoints → evaluate transitions)Key Changes
Server code:
SessionPayload.psid— optional parent SID field for trace correlationdispatch_workflowtool — creates client session, generates dispatch package (token, prompt, metadata)get_workflow_statustool — polls client session status without requiring its tokenWorkflow data:
02-dispatch-workflow.toonactivity with 7-step inline dispatch lifecycle10-orchestrator-management.toonwith dispatch-client, handle-client-checkpoint, process-client-result phases11-worker-management.toonfor independent client agents with checkpoint yield protocol05-worker-prompt-template.mdfor client agents using their own session tokens09-client-dispatch-protocol.mddocumenting the dispatch → manage → complete lifecycle03-end-workflow.toonto verify all dispatched clients completedTests:
Test plan
npm run typecheckpassesnpm testpasses (28 tests total, 13 new)