bot_orchestration.proto
1 syntax = "proto3"; 2 3 package adnet.testbots; 4 5 // Bot Orchestration Service 6 service BotOrchestration { 7 // Worker registration 8 rpc RegisterWorker(WorkerInfo) returns (WorkerAck); 9 10 // Bot lifecycle management 11 rpc SpawnBot(BotSpec) returns (BotHandle); 12 rpc StopBot(BotId) returns (StopAck); 13 rpc GetBotStatus(BotId) returns (BotStatus); 14 15 // Metrics streaming 16 rpc StreamMetrics(stream WorkerMetrics) returns (Empty); 17 18 // Health monitoring 19 rpc Heartbeat(WorkerHealth) returns (CoordinatorDirective); 20 21 // Scenario distribution 22 rpc DistributeScenario(ScenarioSpec) returns (DistributionPlan); 23 } 24 25 // Worker registration information 26 message WorkerInfo { 27 string worker_id = 1; 28 uint32 cpu_cores = 2; 29 uint64 memory_bytes = 3; 30 uint32 max_bots = 4; 31 repeated string capabilities = 5; // ["trader", "validator", "prover"] 32 string address = 6; // Worker's network address 33 } 34 35 message WorkerAck { 36 bool success = 1; 37 string message = 2; 38 string coordinator_id = 3; 39 } 40 41 // Bot specification for spawning 42 message BotSpec { 43 string bot_id = 1; 44 string role = 2; // "general_user", "trader", etc. 45 string role_variant = 3; // "casual", "power", "whale" 46 string behavior = 4; // Behavior pattern to execute 47 bytes config = 5; // Serialized BotConfig 48 string target_network = 6; // Network endpoint 49 repeated string tags = 7; // Metadata tags 50 } 51 52 message BotHandle { 53 string bot_id = 1; 54 string worker_id = 2; 55 bool success = 3; 56 string message = 4; 57 } 58 59 message BotId { 60 string bot_id = 1; 61 } 62 63 message StopAck { 64 bool success = 1; 65 string message = 2; 66 } 67 68 message BotStatus { 69 string bot_id = 1; 70 string status = 2; // "running", "stopped", "error" 71 string message = 3; 72 int64 uptime_ms = 4; 73 uint64 operations_count = 5; 74 } 75 76 // Worker metrics for aggregation 77 message WorkerMetrics { 78 string worker_id = 1; 79 uint32 active_bots = 2; 80 repeated BotMetric bot_metrics = 3; 81 uint64 cpu_usage_percent = 4; 82 uint64 memory_usage_bytes = 5; 83 int64 timestamp_ms = 6; 84 } 85 86 message BotMetric { 87 string bot_id = 1; 88 uint64 operations_total = 2; 89 uint64 errors_total = 3; 90 double latency_p50_ms = 4; 91 double latency_p95_ms = 5; 92 double latency_p99_ms = 6; 93 } 94 95 // Worker health status 96 message WorkerHealth { 97 string worker_id = 1; 98 bool healthy = 2; 99 uint32 active_bots = 3; 100 int64 timestamp_ms = 4; 101 } 102 103 message CoordinatorDirective { 104 enum Action { 105 CONTINUE = 0; 106 SHUTDOWN = 1; 107 SPAWN_BOTS = 2; 108 STOP_BOTS = 3; 109 } 110 Action action = 1; 111 repeated BotSpec spawn_specs = 2; 112 repeated string stop_bot_ids = 3; 113 } 114 115 // Scenario distribution 116 message ScenarioSpec { 117 string scenario_id = 1; 118 string name = 2; 119 uint32 total_bots = 3; 120 repeated BotSpec bot_specs = 4; 121 bytes config = 5; // Serialized scenario configuration 122 } 123 124 message DistributionPlan { 125 string scenario_id = 1; 126 repeated WorkerAssignment assignments = 2; 127 bool success = 3; 128 string message = 4; 129 } 130 131 message WorkerAssignment { 132 string worker_id = 1; 133 repeated BotSpec bot_specs = 2; 134 } 135 136 message Empty {}