Skip to main content

4.2 Workflow Plan Design

The WorkflowSynapse is an OSS submission: the miner's full DAG plan is visible to the validator. There are no black-box miners in C-SWON v1.

Input: Task Package from Validator

{
"task_id": "uuid-v4",
"task_type": "code_generation_pipeline",
"description": "Generate a Python FastAPI endpoint for user authentication with JWT tokens, including unit tests",
"quality_criteria": {
"functional_correctness": true,
"test_coverage": ">80%",
"code_style": "PEP8"
},
"constraints": {
"max_budget_tao": 0.05,
"max_latency_seconds": 10.0,
"allowed_subnets": ["SN1", "SN62", "SN64", "SN45", "SN70"]
},
"available_tools": {
"SN1": { "type": "text_generation", "avg_cost": 0.001, "avg_latency": 0.5 },
"SN62": { "type": "code_review", "avg_cost": 0.003, "avg_latency": 1.2 },
"SN45": { "type": "code_testing", "avg_cost": 0.002, "avg_latency": 2.0 }
},
"routing_policy": {
"default": {
"miner_selection": "top_k_stake_weighted",
"top_k": 3,
"aggregation": "majority_vote"
}
}
}

Output: Workflow Plan from Miner

{
"task_id": "uuid-v4",
"miner_uid": 42,
"scoring_version": "1.0.0",
"workflow_plan": {
"nodes": [
{
"id": "step_1", "subnet": "SN1", "action": "generate_code",
"params": { "prompt": "Generate FastAPI endpoint with JWT auth...", "max_tokens": 2000 },
"estimated_cost": 0.0012, "estimated_latency": 0.6
},
{
"id": "step_2", "subnet": "SN62", "action": "review_code",
"params": { "code_input": "${step_1.output.text}", "review_criteria": ["security", "style"] },
"estimated_cost": 0.0035, "estimated_latency": 1.5
},
{
"id": "step_3", "subnet": "SN45", "action": "generate_tests",
"params": { "code_input": "${step_2.output.artifacts.code}", "coverage_target": 0.85 },
"estimated_cost": 0.0025, "estimated_latency": 2.2
}
],
"edges": [
{ "from": "step_1", "to": "step_2" },
{ "from": "step_2", "to": "step_3" }
],
"error_handling": {
"step_1": { "retry_count": 2 },
"step_2": { "retry_count": 1, "timeout_seconds": 3.0 }
}
},
"total_estimated_cost": 0.0072,
"total_estimated_latency": 4.3,
"confidence": 0.88,
"reasoning": "Sequential pipeline: generate → review → test."
}

Routing Policy

The routing_policy field controls how validators select which miners on partner subnets to call:

  • "median_logit" — take the median of numeric outputs (e.g. token logits)
  • "majority_vote" — take the modal text output across the top-k miners

Validators must not override this policy with their own routing logic.


← Previous4.1 Registration & Requirements
→ Next4.3 Miner Development Lifecycle
IndexDocumentation Index