Workflow Router
Goal
Map an instructor request to exactly one workflow in workflows/*/workflow-spec.json, with explicit rationale and fallback behavior.
Inputs
- Instructor request (free text)
- Optional
mission.json - Repository workflow inventory under
workflows/
Produce
Write routing-decision.json with:
request_summarycandidate_workflows(ranked)selected_workflowselected_reasonconfidence(high|medium|low)required_skillsoptional_skills_selectedskip_conditions_appliedhuman_confirmation_required(bool)fallback_workflow
Selection policy
- Discover candidates by reading all
workflow-spec.jsonfiles. - Score candidates on:
- intent match (create, redesign, evaluate, validate, benchmark);
- artifact intent (exam/lab/course/project/grading/figures);
- constraints (language_mode, evaluation_mode, level, duration, toolchain);
- required input availability.
- Select the highest score only if score gap to second candidate is significant.
- If ambiguity remains, set
human_confirmation_required: true.
Skill-chain policy
- Start from workflow
execution_order. - Apply
skip_conditionsif artifacts already exist and pass validators. - Add optional skills only when their trigger in
optional_extensionsis satisfied. - Never invent a skill not present in workflow spec.
Rules
- Do not use hardcoded workflow names in logic; load from repository each run.
- Emit one selected workflow, never multiple.
- If confidence is low, provide a fallback and require confirmation before generation.
- Keep routing deterministic for same inputs and same repository state.