-
Notifications
You must be signed in to change notification settings - Fork 1
Orchestrator and worker bypass mandatory workflow phases — semantic traces never generated, worker bootstrap pre-digested #86
Description
Problem Statement
The workflow-server defines a mandatory orchestrator/worker execution model with specific phase requirements. In practice, both the orchestrator and worker routinely violate these requirements: the orchestrator pre-digests activity instructions instead of letting the worker self-bootstrap via next_activity and get_skills, and the worker skips mandatory phases — most critically the write-semantic-trace phase defined in the execute-activity skill, which has never produced a trace file in any work package execution.
Current state:
- The orchestrator pre-processes and summarizes activity definitions, skill protocols, and resources before dispatching to the worker, rather than passing the session token and letting the worker call
next_activityandget_skillsitself - The
write-semantic-tracephase (marked MANDATORY in theexecute-activityskill) has never generated a trace file — the worker consistently skips it before callingreport-completion - The worker does not follow the complete skill protocol sequence; phases are arbitrarily omitted without error or enforcement
- The orchestrator selectively ignores its own discipline rules (e.g., rule docs: Schema documentation with usage examples #10: "The orchestrator MUST NOT execute activity steps, write code, review code, or produce artifacts")
Desired state:
- The worker self-bootstraps by calling
next_activityandget_skillswith only a session token, receiving unprocessed activity definitions and skill protocols - All mandatory phases in skill protocols — including
write-semantic-trace— are executed and produce their expected outputs - The orchestrator delegates cleanly without pre-digesting instructions or performing domain work
- Violations of mandatory phases are observable and traceable
Goal
Ensure the orchestrator/worker execution model is followed faithfully, with all mandatory skill phases executed and the worker self-bootstrapping from workflow-server MCP calls rather than receiving pre-digested instructions.
Scope
In Scope
- Orchestrator dispatch behavior: what it passes to the worker and what it pre-processes
- Worker bootstrap protocol: how the worker discovers its activity and skills
- Mandatory phase compliance: ensuring
write-semantic-traceand other required phases produce outputs - Worker skill protocol execution order and completeness
Out of Scope
- Server-side structural enforcement mechanisms (tracked separately in work-package: orchestrator/worker execution rules lack structural enforcement #65)
- Changes to the TOON schema or workflow-server source code
- Checkpoint enforcement reliability (tracked in Workflow orchestration checkpoint enforcement is unreliable #51)
User Stories
US-1: Worker Self-Bootstrap
As a workflow operator, I want the worker to discover its own activity definition and skills via MCP calls so that the orchestrator cannot inadvertently filter, summarize, or distort the instructions.
Acceptance Criteria:
- Worker receives only a session token and target context from the orchestrator (not pre-digested activity content)
- Worker calls
next_activityandget_skillsto load its own instructions - Worker reads and follows skill protocols as returned by the server, not as paraphrased by the orchestrator
US-2: Mandatory Phase Execution
As a workflow operator, I want all mandatory skill phases to execute and produce their defined outputs so that I can verify the workflow was followed completely.
Acceptance Criteria:
- The
write-semantic-tracephase produces a trace file in the planning folder for every activity execution - No mandatory phase is skipped without an observable error or documented skip reason
- The
report-completionphase is only reached after all preceding mandatory phases have executed
US-3: Orchestrator Discipline
As a workflow operator, I want the orchestrator to limit itself to dispatching, checkpoint mediation, and transitions so that context separation is maintained and the worker operates from authoritative instructions.
Acceptance Criteria:
- The orchestrator does not include activity step descriptions, skill protocol content, or resource text in worker dispatch
- The orchestrator does not execute domain work (code review, artifact writing, implementation)
- Checkpoint responses are relayed without the orchestrator interpreting or acting on them
References
- Related: work-package: orchestrator/worker execution rules lack structural enforcement #65 (structural enforcement of orchestrator/worker rules)
- Related: Workflow orchestration checkpoint enforcement is unreliable #51 (checkpoint enforcement reliability)