rsmp 0.46.0 → 0.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (433) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/copilot-setup-steps.yml +1 -1
  3. data/.github/workflows/rubocop.yaml +1 -1
  4. data/.github/workflows/sus.yaml +1 -1
  5. data/CHANGELOG.md +14 -0
  6. data/Gemfile.lock +5 -5
  7. data/README.md +3 -1
  8. data/documentation/cli.md +225 -0
  9. data/documentation/configuration.md +83 -0
  10. data/lib/rsmp/cli/configuration.rb +30 -0
  11. data/lib/rsmp/cli.rb +45 -45
  12. data/lib/rsmp/collect/command_matcher.rb +13 -4
  13. data/lib/rsmp/collect/status_matcher.rb +14 -4
  14. data/lib/rsmp/command_list.rb +1 -1
  15. data/lib/rsmp/config.rb +63 -0
  16. data/lib/rsmp/convert/export/json_schema/index.rb +64 -0
  17. data/lib/rsmp/convert/export/json_schema/items.rb +9 -1
  18. data/lib/rsmp/convert/export/json_schema/outputs.rb +65 -25
  19. data/lib/rsmp/convert/export/json_schema/values.rb +40 -11
  20. data/lib/rsmp/convert/export/json_schema.rb +3 -1
  21. data/lib/rsmp/message/sxl_codec.rb +194 -0
  22. data/lib/rsmp/message.rb +2 -0
  23. data/lib/rsmp/node/site/connections.rb +80 -0
  24. data/lib/rsmp/node/site/site.rb +21 -35
  25. data/lib/rsmp/node/supervisor/supervisor.rb +42 -0
  26. data/lib/rsmp/options/options.rb +21 -9
  27. data/lib/rsmp/options/schemas/config_common.json +129 -0
  28. data/lib/rsmp/options/schemas/log.json +71 -0
  29. data/lib/rsmp/options/schemas/site.json +12 -57
  30. data/lib/rsmp/options/schemas/supervisor.json +4 -29
  31. data/lib/rsmp/options/schemas/supervisor_site.json +19 -31
  32. data/lib/rsmp/options/schemas/traffic_controller_site.json +1 -2
  33. data/lib/rsmp/options/site_options.rb +31 -23
  34. data/lib/rsmp/options/supervisor_options.rb +1 -0
  35. data/lib/rsmp/proxy/modules/receive.rb +3 -1
  36. data/lib/rsmp/proxy/modules/send.rb +26 -14
  37. data/lib/rsmp/proxy/proxy.rb +17 -0
  38. data/lib/rsmp/proxy/site/connection.rb +79 -0
  39. data/lib/rsmp/proxy/site/modules/commands.rb +24 -1
  40. data/lib/rsmp/proxy/site/site_proxy.rb +6 -15
  41. data/lib/rsmp/proxy/supervisor/modules/commands.rb +55 -0
  42. data/lib/rsmp/proxy/supervisor/modules/message_buffer.rb +0 -5
  43. data/lib/rsmp/proxy/supervisor/modules/status.rb +13 -104
  44. data/lib/rsmp/proxy/supervisor/modules/status_updates.rb +148 -0
  45. data/lib/rsmp/proxy/supervisor/supervisor_proxy.rb +19 -0
  46. data/lib/rsmp/schema.rb +38 -1
  47. data/lib/rsmp/tlc/detector_logic.rb +2 -2
  48. data/lib/rsmp/tlc/modules/helpers.rb +0 -22
  49. data/lib/rsmp/tlc/modules/inputs.rb +4 -3
  50. data/lib/rsmp/tlc/modules/modes.rb +2 -2
  51. data/lib/rsmp/tlc/modules/plans.rb +7 -3
  52. data/lib/rsmp/tlc/modules/system.rb +1 -1
  53. data/lib/rsmp/tlc/proxy/control.rb +19 -19
  54. data/lib/rsmp/tlc/proxy/detectors.rb +3 -3
  55. data/lib/rsmp/tlc/proxy/io.rb +15 -12
  56. data/lib/rsmp/tlc/proxy/plans.rb +14 -14
  57. data/lib/rsmp/tlc/proxy/status.rb +9 -5
  58. data/lib/rsmp/tlc/proxy/system.rb +12 -6
  59. data/lib/rsmp/tlc/signal_group.rb +2 -2
  60. data/lib/rsmp/tlc/supervisor_interface.rb +42 -0
  61. data/lib/rsmp/tlc/traffic_controller_site.rb +1 -18
  62. data/lib/rsmp/version.rb +1 -1
  63. data/lib/rsmp.rb +5 -0
  64. data/schemas/core/3.1.4/command_response.json +11 -0
  65. data/schemas/core/3.1.5/command_response.json +11 -0
  66. data/schemas/core/3.2.0/command_response.json +11 -0
  67. data/schemas/core/3.2.1/command_response.json +11 -0
  68. data/schemas/core/3.2.2/command_response.json +11 -0
  69. data/schemas/core/3.3.0/command_response.json +11 -0
  70. data/schemas/tlc/1.0.10/alarms/A0008.json +21 -15
  71. data/schemas/tlc/1.0.10/alarms/A0201.json +26 -20
  72. data/schemas/tlc/1.0.10/alarms/A0202.json +26 -20
  73. data/schemas/tlc/1.0.10/alarms/A0301.json +69 -63
  74. data/schemas/tlc/1.0.10/alarms/A0302.json +87 -81
  75. data/schemas/tlc/1.0.10/commands/M0001.json +66 -60
  76. data/schemas/tlc/1.0.10/commands/M0002.json +48 -42
  77. data/schemas/tlc/1.0.10/commands/M0003.json +48 -42
  78. data/schemas/tlc/1.0.10/commands/M0004.json +35 -29
  79. data/schemas/tlc/1.0.10/commands/M0005.json +48 -42
  80. data/schemas/tlc/1.0.10/commands/M0006.json +48 -42
  81. data/schemas/tlc/1.0.10/commands/M0007.json +35 -29
  82. data/schemas/tlc/1.0.10/commands/M0008.json +48 -42
  83. data/schemas/tlc/1.0.10/commands/M0010.json +35 -29
  84. data/schemas/tlc/1.0.10/commands/M0011.json +35 -29
  85. data/schemas/tlc/1.0.10/commands/M0012.json +35 -29
  86. data/schemas/tlc/1.0.10/commands/M0013.json +35 -29
  87. data/schemas/tlc/1.0.10/commands/M0019.json +61 -55
  88. data/schemas/tlc/1.0.10/commands/M0103.json +51 -45
  89. data/schemas/tlc/1.0.10/commands/M0104.json +100 -94
  90. data/schemas/tlc/1.0.10/commands/command_requests.json +995 -1
  91. data/schemas/tlc/1.0.10/defs/guards.json +19 -0
  92. data/schemas/tlc/1.0.10/sxl.yaml +56 -56
  93. data/schemas/tlc/1.0.10/sxl_index.json +226 -244
  94. data/schemas/tlc/1.0.13/alarms/A0008.json +21 -15
  95. data/schemas/tlc/1.0.13/alarms/A0201.json +26 -20
  96. data/schemas/tlc/1.0.13/alarms/A0202.json +26 -20
  97. data/schemas/tlc/1.0.13/alarms/A0301.json +69 -63
  98. data/schemas/tlc/1.0.13/alarms/A0302.json +87 -81
  99. data/schemas/tlc/1.0.13/commands/M0001.json +66 -60
  100. data/schemas/tlc/1.0.13/commands/M0002.json +48 -42
  101. data/schemas/tlc/1.0.13/commands/M0003.json +48 -42
  102. data/schemas/tlc/1.0.13/commands/M0004.json +35 -29
  103. data/schemas/tlc/1.0.13/commands/M0005.json +48 -42
  104. data/schemas/tlc/1.0.13/commands/M0006.json +48 -42
  105. data/schemas/tlc/1.0.13/commands/M0007.json +35 -29
  106. data/schemas/tlc/1.0.13/commands/M0008.json +48 -42
  107. data/schemas/tlc/1.0.13/commands/M0010.json +35 -29
  108. data/schemas/tlc/1.0.13/commands/M0011.json +35 -29
  109. data/schemas/tlc/1.0.13/commands/M0012.json +35 -29
  110. data/schemas/tlc/1.0.13/commands/M0013.json +35 -29
  111. data/schemas/tlc/1.0.13/commands/M0014.json +48 -42
  112. data/schemas/tlc/1.0.13/commands/M0015.json +48 -42
  113. data/schemas/tlc/1.0.13/commands/M0016.json +35 -29
  114. data/schemas/tlc/1.0.13/commands/M0017.json +35 -29
  115. data/schemas/tlc/1.0.13/commands/M0018.json +48 -42
  116. data/schemas/tlc/1.0.13/commands/M0019.json +61 -55
  117. data/schemas/tlc/1.0.13/commands/M0103.json +51 -45
  118. data/schemas/tlc/1.0.13/commands/M0104.json +100 -94
  119. data/schemas/tlc/1.0.13/commands/command_requests.json +1293 -1
  120. data/schemas/tlc/1.0.13/defs/guards.json +19 -0
  121. data/schemas/tlc/1.0.13/sxl.yaml +63 -63
  122. data/schemas/tlc/1.0.13/sxl_index.json +280 -298
  123. data/schemas/tlc/1.0.14/alarms/A0008.json +21 -15
  124. data/schemas/tlc/1.0.14/alarms/A0201.json +26 -20
  125. data/schemas/tlc/1.0.14/alarms/A0202.json +26 -20
  126. data/schemas/tlc/1.0.14/alarms/A0301.json +69 -63
  127. data/schemas/tlc/1.0.14/alarms/A0302.json +87 -81
  128. data/schemas/tlc/1.0.14/commands/M0001.json +66 -60
  129. data/schemas/tlc/1.0.14/commands/M0002.json +48 -42
  130. data/schemas/tlc/1.0.14/commands/M0003.json +48 -42
  131. data/schemas/tlc/1.0.14/commands/M0004.json +35 -29
  132. data/schemas/tlc/1.0.14/commands/M0005.json +48 -42
  133. data/schemas/tlc/1.0.14/commands/M0006.json +48 -42
  134. data/schemas/tlc/1.0.14/commands/M0007.json +35 -29
  135. data/schemas/tlc/1.0.14/commands/M0008.json +48 -42
  136. data/schemas/tlc/1.0.14/commands/M0010.json +35 -29
  137. data/schemas/tlc/1.0.14/commands/M0011.json +35 -29
  138. data/schemas/tlc/1.0.14/commands/M0012.json +35 -29
  139. data/schemas/tlc/1.0.14/commands/M0013.json +35 -29
  140. data/schemas/tlc/1.0.14/commands/M0014.json +48 -42
  141. data/schemas/tlc/1.0.14/commands/M0015.json +48 -42
  142. data/schemas/tlc/1.0.14/commands/M0016.json +35 -29
  143. data/schemas/tlc/1.0.14/commands/M0017.json +35 -29
  144. data/schemas/tlc/1.0.14/commands/M0018.json +48 -42
  145. data/schemas/tlc/1.0.14/commands/M0019.json +61 -55
  146. data/schemas/tlc/1.0.14/commands/M0103.json +51 -45
  147. data/schemas/tlc/1.0.14/commands/M0104.json +100 -94
  148. data/schemas/tlc/1.0.14/commands/command_requests.json +1293 -1
  149. data/schemas/tlc/1.0.14/defs/guards.json +19 -0
  150. data/schemas/tlc/1.0.14/sxl.yaml +63 -63
  151. data/schemas/tlc/1.0.14/sxl_index.json +304 -322
  152. data/schemas/tlc/1.0.15/alarms/A0008.json +21 -15
  153. data/schemas/tlc/1.0.15/alarms/A0201.json +26 -20
  154. data/schemas/tlc/1.0.15/alarms/A0202.json +26 -20
  155. data/schemas/tlc/1.0.15/alarms/A0301.json +69 -63
  156. data/schemas/tlc/1.0.15/alarms/A0302.json +87 -81
  157. data/schemas/tlc/1.0.15/commands/M0001.json +66 -60
  158. data/schemas/tlc/1.0.15/commands/M0002.json +48 -42
  159. data/schemas/tlc/1.0.15/commands/M0003.json +48 -42
  160. data/schemas/tlc/1.0.15/commands/M0004.json +35 -29
  161. data/schemas/tlc/1.0.15/commands/M0005.json +48 -42
  162. data/schemas/tlc/1.0.15/commands/M0006.json +48 -42
  163. data/schemas/tlc/1.0.15/commands/M0007.json +35 -29
  164. data/schemas/tlc/1.0.15/commands/M0008.json +48 -42
  165. data/schemas/tlc/1.0.15/commands/M0010.json +35 -29
  166. data/schemas/tlc/1.0.15/commands/M0011.json +35 -29
  167. data/schemas/tlc/1.0.15/commands/M0012.json +35 -29
  168. data/schemas/tlc/1.0.15/commands/M0013.json +35 -29
  169. data/schemas/tlc/1.0.15/commands/M0014.json +48 -42
  170. data/schemas/tlc/1.0.15/commands/M0015.json +48 -42
  171. data/schemas/tlc/1.0.15/commands/M0016.json +35 -29
  172. data/schemas/tlc/1.0.15/commands/M0017.json +35 -29
  173. data/schemas/tlc/1.0.15/commands/M0018.json +48 -42
  174. data/schemas/tlc/1.0.15/commands/M0019.json +61 -55
  175. data/schemas/tlc/1.0.15/commands/M0020.json +61 -55
  176. data/schemas/tlc/1.0.15/commands/M0021.json +35 -29
  177. data/schemas/tlc/1.0.15/commands/M0103.json +51 -45
  178. data/schemas/tlc/1.0.15/commands/M0104.json +100 -94
  179. data/schemas/tlc/1.0.15/commands/command_requests.json +1425 -1
  180. data/schemas/tlc/1.0.15/defs/guards.json +19 -0
  181. data/schemas/tlc/1.0.15/sxl.yaml +66 -66
  182. data/schemas/tlc/1.0.15/sxl_index.json +330 -350
  183. data/schemas/tlc/1.0.7/alarms/A0008.json +21 -15
  184. data/schemas/tlc/1.0.7/alarms/A0201.json +26 -20
  185. data/schemas/tlc/1.0.7/alarms/A0202.json +26 -20
  186. data/schemas/tlc/1.0.7/alarms/A0301.json +69 -63
  187. data/schemas/tlc/1.0.7/alarms/A0302.json +87 -81
  188. data/schemas/tlc/1.0.7/commands/M0001.json +66 -60
  189. data/schemas/tlc/1.0.7/commands/M0002.json +48 -42
  190. data/schemas/tlc/1.0.7/commands/M0003.json +48 -42
  191. data/schemas/tlc/1.0.7/commands/M0004.json +35 -29
  192. data/schemas/tlc/1.0.7/commands/M0005.json +48 -42
  193. data/schemas/tlc/1.0.7/commands/M0006.json +48 -42
  194. data/schemas/tlc/1.0.7/commands/M0007.json +35 -29
  195. data/schemas/tlc/1.0.7/commands/M0008.json +48 -42
  196. data/schemas/tlc/1.0.7/commands/M0010.json +35 -29
  197. data/schemas/tlc/1.0.7/commands/M0011.json +35 -29
  198. data/schemas/tlc/1.0.7/commands/M0019.json +61 -55
  199. data/schemas/tlc/1.0.7/commands/M0103.json +51 -45
  200. data/schemas/tlc/1.0.7/commands/M0104.json +100 -94
  201. data/schemas/tlc/1.0.7/commands/command_requests.json +895 -1
  202. data/schemas/tlc/1.0.7/defs/guards.json +19 -0
  203. data/schemas/tlc/1.0.7/sxl.yaml +58 -58
  204. data/schemas/tlc/1.0.7/sxl_index.json +228 -246
  205. data/schemas/tlc/1.0.8/alarms/A0008.json +21 -15
  206. data/schemas/tlc/1.0.8/alarms/A0201.json +26 -20
  207. data/schemas/tlc/1.0.8/alarms/A0202.json +26 -20
  208. data/schemas/tlc/1.0.8/alarms/A0301.json +69 -63
  209. data/schemas/tlc/1.0.8/alarms/A0302.json +87 -81
  210. data/schemas/tlc/1.0.8/commands/M0001.json +66 -60
  211. data/schemas/tlc/1.0.8/commands/M0002.json +48 -42
  212. data/schemas/tlc/1.0.8/commands/M0003.json +48 -42
  213. data/schemas/tlc/1.0.8/commands/M0004.json +35 -29
  214. data/schemas/tlc/1.0.8/commands/M0005.json +48 -42
  215. data/schemas/tlc/1.0.8/commands/M0006.json +48 -42
  216. data/schemas/tlc/1.0.8/commands/M0007.json +35 -29
  217. data/schemas/tlc/1.0.8/commands/M0008.json +48 -42
  218. data/schemas/tlc/1.0.8/commands/M0010.json +35 -29
  219. data/schemas/tlc/1.0.8/commands/M0011.json +35 -29
  220. data/schemas/tlc/1.0.8/commands/M0012.json +35 -29
  221. data/schemas/tlc/1.0.8/commands/M0013.json +35 -29
  222. data/schemas/tlc/1.0.8/commands/M0019.json +61 -55
  223. data/schemas/tlc/1.0.8/commands/M0103.json +51 -45
  224. data/schemas/tlc/1.0.8/commands/M0104.json +100 -94
  225. data/schemas/tlc/1.0.8/commands/command_requests.json +995 -1
  226. data/schemas/tlc/1.0.8/defs/guards.json +19 -0
  227. data/schemas/tlc/1.0.8/sxl.yaml +56 -56
  228. data/schemas/tlc/1.0.8/sxl_index.json +226 -244
  229. data/schemas/tlc/1.0.9/alarms/A0008.json +21 -15
  230. data/schemas/tlc/1.0.9/alarms/A0201.json +26 -20
  231. data/schemas/tlc/1.0.9/alarms/A0202.json +26 -20
  232. data/schemas/tlc/1.0.9/alarms/A0301.json +69 -63
  233. data/schemas/tlc/1.0.9/alarms/A0302.json +87 -81
  234. data/schemas/tlc/1.0.9/commands/M0001.json +66 -60
  235. data/schemas/tlc/1.0.9/commands/M0002.json +48 -42
  236. data/schemas/tlc/1.0.9/commands/M0003.json +48 -42
  237. data/schemas/tlc/1.0.9/commands/M0004.json +35 -29
  238. data/schemas/tlc/1.0.9/commands/M0005.json +48 -42
  239. data/schemas/tlc/1.0.9/commands/M0006.json +48 -42
  240. data/schemas/tlc/1.0.9/commands/M0007.json +35 -29
  241. data/schemas/tlc/1.0.9/commands/M0008.json +48 -42
  242. data/schemas/tlc/1.0.9/commands/M0010.json +35 -29
  243. data/schemas/tlc/1.0.9/commands/M0011.json +35 -29
  244. data/schemas/tlc/1.0.9/commands/M0012.json +35 -29
  245. data/schemas/tlc/1.0.9/commands/M0013.json +35 -29
  246. data/schemas/tlc/1.0.9/commands/M0019.json +61 -55
  247. data/schemas/tlc/1.0.9/commands/M0103.json +51 -45
  248. data/schemas/tlc/1.0.9/commands/M0104.json +100 -94
  249. data/schemas/tlc/1.0.9/commands/command_requests.json +995 -1
  250. data/schemas/tlc/1.0.9/defs/guards.json +19 -0
  251. data/schemas/tlc/1.0.9/sxl.yaml +56 -56
  252. data/schemas/tlc/1.0.9/sxl_index.json +226 -244
  253. data/schemas/tlc/1.1.0/alarms/A0007.json +25 -19
  254. data/schemas/tlc/1.1.0/alarms/A0008.json +21 -15
  255. data/schemas/tlc/1.1.0/alarms/A0201.json +26 -20
  256. data/schemas/tlc/1.1.0/alarms/A0202.json +26 -20
  257. data/schemas/tlc/1.1.0/alarms/A0301.json +69 -63
  258. data/schemas/tlc/1.1.0/alarms/A0302.json +87 -81
  259. data/schemas/tlc/1.1.0/alarms/A0303.json +69 -63
  260. data/schemas/tlc/1.1.0/alarms/A0304.json +87 -81
  261. data/schemas/tlc/1.1.0/commands/M0001.json +66 -60
  262. data/schemas/tlc/1.1.0/commands/M0002.json +48 -42
  263. data/schemas/tlc/1.1.0/commands/M0003.json +48 -42
  264. data/schemas/tlc/1.1.0/commands/M0004.json +35 -29
  265. data/schemas/tlc/1.1.0/commands/M0005.json +48 -42
  266. data/schemas/tlc/1.1.0/commands/M0006.json +48 -42
  267. data/schemas/tlc/1.1.0/commands/M0007.json +35 -29
  268. data/schemas/tlc/1.1.0/commands/M0008.json +48 -42
  269. data/schemas/tlc/1.1.0/commands/M0010.json +35 -29
  270. data/schemas/tlc/1.1.0/commands/M0011.json +35 -29
  271. data/schemas/tlc/1.1.0/commands/M0012.json +35 -29
  272. data/schemas/tlc/1.1.0/commands/M0013.json +35 -29
  273. data/schemas/tlc/1.1.0/commands/M0014.json +48 -42
  274. data/schemas/tlc/1.1.0/commands/M0015.json +48 -42
  275. data/schemas/tlc/1.1.0/commands/M0016.json +35 -29
  276. data/schemas/tlc/1.1.0/commands/M0017.json +35 -29
  277. data/schemas/tlc/1.1.0/commands/M0018.json +48 -42
  278. data/schemas/tlc/1.1.0/commands/M0019.json +61 -55
  279. data/schemas/tlc/1.1.0/commands/M0020.json +61 -55
  280. data/schemas/tlc/1.1.0/commands/M0021.json +35 -29
  281. data/schemas/tlc/1.1.0/commands/M0022.json +194 -188
  282. data/schemas/tlc/1.1.0/commands/M0023.json +35 -29
  283. data/schemas/tlc/1.1.0/commands/M0103.json +51 -45
  284. data/schemas/tlc/1.1.0/commands/M0104.json +100 -94
  285. data/schemas/tlc/1.1.0/commands/command_requests.json +1525 -1
  286. data/schemas/tlc/1.1.0/defs/guards.json +19 -0
  287. data/schemas/tlc/1.1.0/statuses/S0033.json +2 -2
  288. data/schemas/tlc/1.1.0/sxl.yaml +75 -74
  289. data/schemas/tlc/1.1.0/sxl_index.json +391 -398
  290. data/schemas/tlc/1.2.0/alarms/A0007.json +25 -19
  291. data/schemas/tlc/1.2.0/alarms/A0008.json +21 -15
  292. data/schemas/tlc/1.2.0/alarms/A0201.json +26 -20
  293. data/schemas/tlc/1.2.0/alarms/A0202.json +26 -20
  294. data/schemas/tlc/1.2.0/alarms/A0301.json +69 -63
  295. data/schemas/tlc/1.2.0/alarms/A0302.json +87 -81
  296. data/schemas/tlc/1.2.0/alarms/A0303.json +69 -63
  297. data/schemas/tlc/1.2.0/alarms/A0304.json +87 -81
  298. data/schemas/tlc/1.2.0/commands/M0001.json +66 -60
  299. data/schemas/tlc/1.2.0/commands/M0002.json +48 -42
  300. data/schemas/tlc/1.2.0/commands/M0003.json +48 -42
  301. data/schemas/tlc/1.2.0/commands/M0004.json +35 -29
  302. data/schemas/tlc/1.2.0/commands/M0005.json +48 -42
  303. data/schemas/tlc/1.2.0/commands/M0006.json +48 -42
  304. data/schemas/tlc/1.2.0/commands/M0007.json +35 -29
  305. data/schemas/tlc/1.2.0/commands/M0008.json +48 -42
  306. data/schemas/tlc/1.2.0/commands/M0010.json +35 -29
  307. data/schemas/tlc/1.2.0/commands/M0011.json +35 -29
  308. data/schemas/tlc/1.2.0/commands/M0012.json +35 -29
  309. data/schemas/tlc/1.2.0/commands/M0013.json +35 -29
  310. data/schemas/tlc/1.2.0/commands/M0014.json +48 -42
  311. data/schemas/tlc/1.2.0/commands/M0015.json +48 -42
  312. data/schemas/tlc/1.2.0/commands/M0016.json +35 -29
  313. data/schemas/tlc/1.2.0/commands/M0017.json +35 -29
  314. data/schemas/tlc/1.2.0/commands/M0018.json +48 -42
  315. data/schemas/tlc/1.2.0/commands/M0019.json +61 -55
  316. data/schemas/tlc/1.2.0/commands/M0020.json +61 -55
  317. data/schemas/tlc/1.2.0/commands/M0021.json +35 -29
  318. data/schemas/tlc/1.2.0/commands/M0022.json +194 -188
  319. data/schemas/tlc/1.2.0/commands/M0023.json +35 -29
  320. data/schemas/tlc/1.2.0/commands/M0103.json +51 -45
  321. data/schemas/tlc/1.2.0/commands/M0104.json +100 -94
  322. data/schemas/tlc/1.2.0/commands/command_requests.json +1525 -1
  323. data/schemas/tlc/1.2.0/defs/guards.json +19 -0
  324. data/schemas/tlc/1.2.0/statuses/S0033.json +2 -2
  325. data/schemas/tlc/1.2.0/sxl.yaml +77 -76
  326. data/schemas/tlc/1.2.0/sxl_index.json +401 -397
  327. data/schemas/tlc/1.2.1/alarms/A0007.json +25 -19
  328. data/schemas/tlc/1.2.1/alarms/A0008.json +21 -15
  329. data/schemas/tlc/1.2.1/alarms/A0201.json +26 -20
  330. data/schemas/tlc/1.2.1/alarms/A0202.json +26 -20
  331. data/schemas/tlc/1.2.1/alarms/A0301.json +69 -63
  332. data/schemas/tlc/1.2.1/alarms/A0302.json +87 -81
  333. data/schemas/tlc/1.2.1/alarms/A0303.json +69 -63
  334. data/schemas/tlc/1.2.1/alarms/A0304.json +87 -81
  335. data/schemas/tlc/1.2.1/commands/M0001.json +66 -60
  336. data/schemas/tlc/1.2.1/commands/M0002.json +48 -42
  337. data/schemas/tlc/1.2.1/commands/M0003.json +48 -42
  338. data/schemas/tlc/1.2.1/commands/M0004.json +35 -29
  339. data/schemas/tlc/1.2.1/commands/M0005.json +48 -42
  340. data/schemas/tlc/1.2.1/commands/M0006.json +48 -42
  341. data/schemas/tlc/1.2.1/commands/M0007.json +35 -29
  342. data/schemas/tlc/1.2.1/commands/M0008.json +48 -42
  343. data/schemas/tlc/1.2.1/commands/M0010.json +35 -29
  344. data/schemas/tlc/1.2.1/commands/M0011.json +35 -29
  345. data/schemas/tlc/1.2.1/commands/M0012.json +35 -29
  346. data/schemas/tlc/1.2.1/commands/M0013.json +35 -29
  347. data/schemas/tlc/1.2.1/commands/M0014.json +48 -42
  348. data/schemas/tlc/1.2.1/commands/M0015.json +48 -42
  349. data/schemas/tlc/1.2.1/commands/M0016.json +35 -29
  350. data/schemas/tlc/1.2.1/commands/M0017.json +35 -29
  351. data/schemas/tlc/1.2.1/commands/M0018.json +48 -42
  352. data/schemas/tlc/1.2.1/commands/M0019.json +61 -55
  353. data/schemas/tlc/1.2.1/commands/M0020.json +61 -55
  354. data/schemas/tlc/1.2.1/commands/M0021.json +35 -29
  355. data/schemas/tlc/1.2.1/commands/M0022.json +194 -188
  356. data/schemas/tlc/1.2.1/commands/M0023.json +35 -29
  357. data/schemas/tlc/1.2.1/commands/M0103.json +51 -45
  358. data/schemas/tlc/1.2.1/commands/M0104.json +100 -94
  359. data/schemas/tlc/1.2.1/commands/command_requests.json +1525 -1
  360. data/schemas/tlc/1.2.1/defs/guards.json +19 -0
  361. data/schemas/tlc/1.2.1/statuses/S0033.json +2 -2
  362. data/schemas/tlc/1.2.1/sxl.yaml +77 -76
  363. data/schemas/tlc/1.2.1/sxl_index.json +401 -397
  364. data/schemas/tlc/1.3.0/alarms/A0007.json +25 -19
  365. data/schemas/tlc/1.3.0/alarms/A0008.json +21 -15
  366. data/schemas/tlc/1.3.0/alarms/A0201.json +26 -20
  367. data/schemas/tlc/1.3.0/alarms/A0202.json +26 -20
  368. data/schemas/tlc/1.3.0/alarms/A0301.json +69 -63
  369. data/schemas/tlc/1.3.0/alarms/A0302.json +87 -81
  370. data/schemas/tlc/1.3.0/alarms/A0303.json +70 -64
  371. data/schemas/tlc/1.3.0/alarms/A0304.json +88 -82
  372. data/schemas/tlc/1.3.0/commands/M0001.json +66 -60
  373. data/schemas/tlc/1.3.0/commands/M0002.json +48 -42
  374. data/schemas/tlc/1.3.0/commands/M0003.json +48 -42
  375. data/schemas/tlc/1.3.0/commands/M0004.json +35 -29
  376. data/schemas/tlc/1.3.0/commands/M0005.json +48 -42
  377. data/schemas/tlc/1.3.0/commands/M0006.json +48 -42
  378. data/schemas/tlc/1.3.0/commands/M0007.json +35 -29
  379. data/schemas/tlc/1.3.0/commands/M0008.json +61 -55
  380. data/schemas/tlc/1.3.0/commands/M0010.json +35 -29
  381. data/schemas/tlc/1.3.0/commands/M0011.json +35 -29
  382. data/schemas/tlc/1.3.0/commands/M0012.json +35 -29
  383. data/schemas/tlc/1.3.0/commands/M0013.json +36 -30
  384. data/schemas/tlc/1.3.0/commands/M0014.json +48 -42
  385. data/schemas/tlc/1.3.0/commands/M0015.json +48 -42
  386. data/schemas/tlc/1.3.0/commands/M0016.json +35 -29
  387. data/schemas/tlc/1.3.0/commands/M0017.json +35 -29
  388. data/schemas/tlc/1.3.0/commands/M0018.json +48 -42
  389. data/schemas/tlc/1.3.0/commands/M0019.json +61 -55
  390. data/schemas/tlc/1.3.0/commands/M0020.json +61 -55
  391. data/schemas/tlc/1.3.0/commands/M0021.json +35 -29
  392. data/schemas/tlc/1.3.0/commands/M0022.json +195 -189
  393. data/schemas/tlc/1.3.0/commands/M0023.json +35 -29
  394. data/schemas/tlc/1.3.0/commands/M0024.json +21 -15
  395. data/schemas/tlc/1.3.0/commands/M0103.json +51 -45
  396. data/schemas/tlc/1.3.0/commands/M0104.json +100 -94
  397. data/schemas/tlc/1.3.0/commands/command_requests.json +1559 -1
  398. data/schemas/tlc/1.3.0/defs/guards.json +19 -0
  399. data/schemas/tlc/1.3.0/statuses/S0001.json +4 -4
  400. data/schemas/tlc/1.3.0/statuses/S0005.json +3 -3
  401. data/schemas/tlc/1.3.0/statuses/S0006.json +2 -2
  402. data/schemas/tlc/1.3.0/statuses/S0007.json +1 -1
  403. data/schemas/tlc/1.3.0/statuses/S0008.json +1 -1
  404. data/schemas/tlc/1.3.0/statuses/S0009.json +1 -1
  405. data/schemas/tlc/1.3.0/statuses/S0010.json +1 -1
  406. data/schemas/tlc/1.3.0/statuses/S0011.json +1 -1
  407. data/schemas/tlc/1.3.0/statuses/S0012.json +1 -1
  408. data/schemas/tlc/1.3.0/statuses/S0013.json +1 -1
  409. data/schemas/tlc/1.3.0/statuses/S0014.json +1 -1
  410. data/schemas/tlc/1.3.0/statuses/S0015.json +1 -1
  411. data/schemas/tlc/1.3.0/statuses/S0016.json +1 -1
  412. data/schemas/tlc/1.3.0/statuses/S0017.json +1 -1
  413. data/schemas/tlc/1.3.0/statuses/S0019.json +1 -1
  414. data/schemas/tlc/1.3.0/statuses/S0020.json +1 -1
  415. data/schemas/tlc/1.3.0/statuses/S0025.json +2 -2
  416. data/schemas/tlc/1.3.0/statuses/S0027.json +1 -1
  417. data/schemas/tlc/1.3.0/statuses/S0032.json +2 -2
  418. data/schemas/tlc/1.3.0/statuses/S0033.json +5 -5
  419. data/schemas/tlc/1.3.0/statuses/S0034.json +1 -1
  420. data/schemas/tlc/1.3.0/statuses/S0035.json +1 -1
  421. data/schemas/tlc/1.3.0/statuses/S0091.json +1 -1
  422. data/schemas/tlc/1.3.0/statuses/S0092.json +1 -1
  423. data/schemas/tlc/1.3.0/statuses/S0096.json +6 -6
  424. data/schemas/tlc/1.3.0/statuses/S0201.json +1 -1
  425. data/schemas/tlc/1.3.0/statuses/S0202.json +1 -1
  426. data/schemas/tlc/1.3.0/statuses/S0203.json +1 -1
  427. data/schemas/tlc/1.3.0/statuses/S0204.json +9 -9
  428. data/schemas/tlc/1.3.0/statuses/S0205.json +1 -1
  429. data/schemas/tlc/1.3.0/statuses/S0206.json +1 -1
  430. data/schemas/tlc/1.3.0/statuses/S0207.json +1 -1
  431. data/schemas/tlc/1.3.0/statuses/S0208.json +9 -9
  432. data/schemas/tlc/1.3.0/sxl_index.json +408 -402
  433. metadata +11 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a5a5d66114ac44b96bc823b0366eddc9225abeb1686ec75cdd60d25373c8e53b
4
- data.tar.gz: 49387a2b58f4aa7cfd0e36226240cbb1e93d2f49e5fd5636eb9cf3cabd0e3b53
3
+ metadata.gz: 24b3e3fbb36a769054061eeb10f070096ec576468f20196932d43d1e4c3915c7
4
+ data.tar.gz: 3b6830d24f1225b721e21680b35c71c8dc508eb5bd6d684c595c71256c207ea0
5
5
  SHA512:
6
- metadata.gz: f0cf699c114f7c61b03e42e199ecddee74270bb6a3fabe980c95f89951e7edc557cebc9b7c3eb1668614dc73a2c69a6c849be3010c6cdcb3210459a506ca04ef
7
- data.tar.gz: 7b53bd11a26ad80c150862fbd28fe98b6a9fb0be238a613e2500ac0ffb439c34188b10f962f120c54fa491a371db05688a98d0f9ca27549eb9658a498f1d2d2a
6
+ metadata.gz: 1208ed7baf84741848f268c28a66d5410afdd172f8fd1f1010280816d8f16cc184870b3f979fcaa6e566f5746fd164608504a9bc00c9447f36bdfac77b457f34
7
+ data.tar.gz: b5c71f21c3369585b7740d85669a9fd4b3ebb030697984faeceb43f280fe9f6d86f6f78b3a005f0c133ceee50daef748868f6206c380726beb883fdfdbb1f295
@@ -26,7 +26,7 @@ jobs:
26
26
  # If you do not check out your code, Copilot will do this for you.
27
27
  steps:
28
28
  - name: Checkout code
29
- uses: actions/checkout@v4
29
+ uses: actions/checkout@v6
30
30
 
31
31
  - uses: ruby/setup-ruby@v1
32
32
  with:
@@ -9,7 +9,7 @@ jobs:
9
9
  fail-fast: false
10
10
  runs-on: ubuntu-latest
11
11
  steps:
12
- - uses: actions/checkout@v4
12
+ - uses: actions/checkout@v6
13
13
  - uses: ruby/setup-ruby@v1
14
14
  with:
15
15
  bundler-cache: true
@@ -11,7 +11,7 @@ jobs:
11
11
  os: [ubuntu-latest, macos-latest, windows-latest]
12
12
  runs-on: ${{ matrix.os }}
13
13
  steps:
14
- - uses: actions/checkout@v4
14
+ - uses: actions/checkout@v6
15
15
  - uses: ruby/setup-ruby@v1
16
16
  with:
17
17
  ruby-version: 4.0
data/CHANGELOG.md CHANGED
@@ -685,3 +685,17 @@ Initial release.
685
685
 
686
686
  ## 0.46.0
687
687
  - add outgoing message buffering for sites
688
+
689
+ ## 0.47.0
690
+ - add cli command for checking configs
691
+ - tighten config schemas
692
+
693
+ ## 0.48.0
694
+ - implement RSMP Core 3.3.0 connection roles, allowing a site to listen and a supervisor to connect
695
+ - enforce 3.3.0 command message rules, including one command code per CommandRequest/CommandResponse
696
+ - update TLC schemas with JSON-native values and required/optional command arguments
697
+ - add argument types to SXL indexes
698
+ - encode/decode message values based on SXL type defintions
699
+ - return `unknown` for unimplemented commands and statuses instead of rejecting the whole request
700
+ - omit legacy NTS message attributes from outgoing Core 3.3.0 messages
701
+ - `CORE_VERSION` or `SXLS` environment variables with command line options `--core` and `--sxls`
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rsmp (0.46.0)
4
+ rsmp (0.48.0)
5
5
  async (~> 2.39)
6
6
  colorize (~> 1.1)
7
7
  io-endpoint (~> 0.17)
@@ -15,7 +15,7 @@ GEM
15
15
  remote: https://rubygems.org/
16
16
  specs:
17
17
  ast (2.4.3)
18
- async (2.39.0)
18
+ async (2.40.0)
19
19
  console (~> 1.29)
20
20
  fiber-annotation
21
21
  io-event (~> 1.11)
@@ -33,9 +33,9 @@ GEM
33
33
  fiber-storage (1.0.1)
34
34
  hana (1.3.7)
35
35
  io-endpoint (0.17.2)
36
- io-event (1.16.1)
37
- io-stream (0.13.0)
38
- json (2.19.9)
36
+ io-event (1.16.4)
37
+ io-stream (0.13.1)
38
+ json (2.20.0)
39
39
  json_schemer (2.5.0)
40
40
  bigdecimal
41
41
  hana (~> 1.3)
data/README.md CHANGED
@@ -28,7 +28,7 @@ require 'rsmp'
28
28
  RSMP::Supervisor.new.start # run supervisor until Ctlr-C is pressed
29
29
  ```
30
30
 
31
- Be default, a site will try to connect to a single supervisor on localhost 127.0.0.1, port 12111. By default, a supervisor will listen for sites on port 12111 and accept any site.
31
+ By default, a site will try to connect to a single supervisor on localhost 127.0.0.1, port 12111. By default, a supervisor will listen for sites on port 12111 and accept any site.
32
32
 
33
33
  You can pass options to control ip adresseses, ports, logging and other behaviour:
34
34
 
@@ -144,6 +144,8 @@ sxls:
144
144
  tlc: '1.3.0'
145
145
  ```
146
146
 
147
+ See [configuration](documentation/configuration.md) for connection-role examples and other YAML settings.
148
+
147
149
  ## Command-line tool
148
150
  Tools for easily running RSMP supervisors and sites. The binary is called ```rsmp```.
149
151
 
@@ -0,0 +1,225 @@
1
+ # RSMP CLI
2
+
3
+ The `rsmp` command can run a site, run a supervisor, validate config files, generate JSON Schemas from an SXL, and print the gem version.
4
+
5
+ Use help at any level:
6
+
7
+ ```console
8
+ $ rsmp help
9
+ $ rsmp help site
10
+ $ rsmp help supervisor
11
+ $ rsmp help config check
12
+ $ rsmp help schema generate
13
+ ```
14
+
15
+ ## Quick Examples
16
+
17
+ Run a TLC site that connects to the default supervisor endpoint, `127.0.0.1:12111`:
18
+
19
+ ```console
20
+ $ rsmp site
21
+ ```
22
+
23
+ Run a supervisor that listens on the default port, `12111`:
24
+
25
+ ```console
26
+ $ rsmp supervisor
27
+ ```
28
+
29
+ Run both with explicit config files:
30
+
31
+ ```console
32
+ $ rsmp supervisor --config config/supervisor.yaml
33
+ $ rsmp site --config config/tlc.yaml
34
+ ```
35
+
36
+ Run a site against a specific supervisor endpoint:
37
+
38
+ ```console
39
+ $ rsmp site --supervisors 192.0.2.10:12111
40
+ ```
41
+
42
+ Show raw JSON messages in the log:
43
+
44
+ ```console
45
+ $ rsmp site --json
46
+ $ rsmp supervisor --json
47
+ ```
48
+
49
+ Write logs to a file:
50
+
51
+ ```console
52
+ $ rsmp supervisor --log log/supervisor.log
53
+ $ rsmp site --log log/site.log
54
+ ```
55
+
56
+ Validate config files before starting anything:
57
+
58
+ ```console
59
+ $ rsmp config check config/tlc.yaml --type tlc
60
+ $ rsmp config check config/supervisor.yaml --type supervisor
61
+ ```
62
+
63
+ Generate JSON Schema files from an SXL YAML file:
64
+
65
+ ```console
66
+ $ rsmp schema generate --in schemas/tlc/1.3.0/sxl.yaml --out /tmp/tlc-schema
67
+ ```
68
+
69
+ ## Configuration Files
70
+
71
+ Most real runs should use YAML config files. The CLI accepts `--config`, `-c`, and `--options` as aliases:
72
+
73
+ ```console
74
+ $ rsmp site -c config/tlc.yaml
75
+ $ rsmp supervisor --options config/supervisor.yaml
76
+ ```
77
+
78
+ CLI options override or add to settings loaded from the config file. For example, this loads `config/tlc.yaml` but changes the site id and supervisor endpoint for this run:
79
+
80
+ ```console
81
+ $ rsmp site -c config/tlc.yaml --id RN+SI0420 --supervisors 127.0.0.1:13111
82
+ ```
83
+
84
+ Core and SXL version overrides are command-line options.
85
+
86
+ See `documentation/configuration.md` for the YAML format.
87
+
88
+ ## Commands
89
+
90
+ ### `rsmp site`
91
+
92
+ Runs an RSMP site. The default site type is `tlc`, so this starts a TLC traffic controller site implementation.
93
+
94
+ ```console
95
+ $ rsmp site
96
+ ```
97
+
98
+ Common options:
99
+
100
+ - `--config PATH`, `-c PATH`, `--options PATH`: load site settings from a YAML file.
101
+ - `--id ID`, `-i ID`: set the site id.
102
+ - `--supervisors LIST`, `-s LIST`: set one or more supervisor endpoints.
103
+ - `--core VERSION`: set the RSMP Core version.
104
+ - `--sxls LIST`: set the SXLs announced by the site as a comma-separated `name:version` list.
105
+ - `--type tlc`, `-t tlc`: choose the site type. Currently `tlc` is the supported CLI type.
106
+ - `--log PATH`, `-l PATH`: write log output to a file.
107
+ - `--json`, `-j`: include raw JSON messages in the log.
108
+
109
+ The `--supervisors` option accepts a comma-separated list:
110
+
111
+ ```console
112
+ $ rsmp site --supervisors 127.0.0.1:12111,192.0.2.10:12111
113
+ ```
114
+
115
+ If the IP address is omitted, `127.0.0.1` is used:
116
+
117
+ ```console
118
+ $ rsmp site --supervisors :13111
119
+ ```
120
+
121
+ If the port is omitted, the configured site default is used:
122
+
123
+ ```console
124
+ $ rsmp site --supervisors 127.0.0.1
125
+ ```
126
+
127
+ Use `--sxls` to specify several SXLs for a site:
128
+
129
+ ```console
130
+ $ rsmp site --sxls tlc:1.3.0,vms:1.0.0
131
+ ```
132
+
133
+ Example with explicit core and SXL versions:
134
+
135
+ ```console
136
+ $ rsmp site -c config/tlc.yaml --core 3.3.0 --sxls tlc:1.3.0
137
+ ```
138
+
139
+ ### `rsmp supervisor`
140
+
141
+ Runs an RSMP supervisor. By default it listens for site connections on port `12111`.
142
+
143
+ ```console
144
+ $ rsmp supervisor
145
+ ```
146
+
147
+ Common options:
148
+
149
+ - `--config PATH`, `-c PATH`, `--options PATH`: load supervisor settings from a YAML file.
150
+ - `--id ID`, `-i ID`: set the supervisor site id.
151
+ - `--ip ADDRESS`: set the listen address.
152
+ - `--port PORT`, `-p PORT`: set the listen port.
153
+ - `--core VERSION`: override the accepted RSMP Core version.
154
+ - `--sxls LIST`: override SXL versions as a comma-separated `name:version` list.
155
+ - `--log PATH`, `-l PATH`: write log output to a file.
156
+ - `--json`, `-j`: include raw JSON messages in the log.
157
+
158
+ Example:
159
+
160
+ ```console
161
+ $ rsmp supervisor --ip 0.0.0.0 --port 13111 --core 3.3.0 --sxls tlc:1.3.0 --json
162
+ ```
163
+
164
+ When `--core` or `--sxls` is used with the supervisor command, it overrides `default` and any configured `sites` entries for that run.
165
+
166
+ ### `rsmp config check`
167
+
168
+ Validates one or more YAML config files without starting a site or supervisor.
169
+
170
+ ```console
171
+ $ rsmp config check config/tlc.yaml
172
+ $ rsmp config check config/tlc.yaml config/supervisor.yaml
173
+ ```
174
+
175
+ Options:
176
+
177
+ - `--type TYPE`, `-t TYPE`: choose the config type. Supported values are `auto`, `site`, `tlc`, and `supervisor`.
178
+
179
+ The default type is `auto`. Auto-detection works when the config shape is clear. If the CLI cannot infer the type, pass `--type` explicitly:
180
+
181
+ ```console
182
+ $ rsmp config check config/tlc.yaml --type tlc
183
+ $ rsmp config check config/supervisor.yaml --type supervisor
184
+ ```
185
+
186
+ Successful validation prints `OK` for each valid file. Invalid files print an error and the command exits with status `1`.
187
+
188
+ Common validation errors include:
189
+
190
+ - The file does not exist.
191
+ - The path is a directory.
192
+ - The file is not YAML.
193
+ - A setting has the wrong type.
194
+ - A config key is not allowed by the schema.
195
+
196
+ ### `rsmp schema generate`
197
+
198
+ Generates JSON Schema files from an `sxl.yaml` file.
199
+
200
+ ```console
201
+ $ rsmp schema generate --in schemas/tlc/1.3.0/sxl.yaml --out /tmp/tlc-schema
202
+ ```
203
+
204
+ Options:
205
+
206
+ - `--in PATH`, `-i PATH`: path to the input `sxl.yaml`. Defaults to `sxl.yaml`.
207
+ - `--out PATH`, `-o PATH`: output directory. Defaults to the current directory.
208
+
209
+ The command writes the generated status, command, alarm, root schema, definitions, and `sxl_index.json` files to the output directory.
210
+
211
+ If the input file is missing, the command prints an error and exits with status `1`.
212
+
213
+ ### `rsmp version`
214
+
215
+ Prints the installed `rsmp` gem version:
216
+
217
+ ```console
218
+ $ rsmp version
219
+ ```
220
+
221
+ ## Exit Status
222
+
223
+ Commands return status `0` on success. Validation and argument errors return a non-zero status.
224
+
225
+ Long-running commands such as `rsmp site` and `rsmp supervisor` run until interrupted or until startup fails.
@@ -38,6 +38,7 @@ Both `--config` and `--options` are accepted as aliases.
38
38
 
39
39
  ```yaml
40
40
  site_id: RN+SI0001
41
+ connection_role: client
41
42
  supervisors:
42
43
  - ip: 127.0.0.1
43
44
  port: 12111
@@ -46,14 +47,60 @@ sxls:
46
47
  components:
47
48
  main:
48
49
  TC:
50
+ message_buffer:
51
+ max_messages: 10000
52
+ statuses: true
49
53
  log:
50
54
  json: true
51
55
  ```
52
56
 
57
+ `connection_role` controls which side opens the TCP connection:
58
+
59
+ - `client` means the node connects to configured remote endpoints.
60
+ - `server` means the node listens for incoming connections.
61
+
62
+ Configurable connection roles are available from Core 3.3.0.
63
+
64
+ For sites, `client` is the default and uses the `supervisors` endpoint list. A site in `server` role listens on `ip` and `port` instead.
65
+
66
+ ```yaml
67
+ site_id: RN+SI0001
68
+ connection_role: server
69
+ ip: 0.0.0.0
70
+ port: 12111
71
+ core_version: "3.3.0"
72
+ sxls:
73
+ tlc: "1.3.0"
74
+ ```
75
+
76
+ ## Message Buffer
77
+
78
+ Sites buffer outgoing alarm and aggregated status messages while a supervisor connection is down. Status updates are buffered according to `message_buffer.statuses`, which defaults to `true`.
79
+
80
+ ```yaml
81
+ message_buffer:
82
+ max_messages: 10000
83
+ statuses: true
84
+ ```
85
+
86
+ `statuses: true` buffers all subscribed status updates during communication disruption. To buffer only selected statuses, provide selectors:
87
+
88
+ ```yaml
89
+ message_buffer:
90
+ statuses:
91
+ - sCI: S0001
92
+ n: signalgroupstatus
93
+ ```
94
+
95
+ Use `statuses: false` or an empty list to avoid buffering status updates. Subscriptions for statuses that are not buffered are removed when the connection is lost.
96
+
97
+ The current implementation uses an in-memory buffer per supervisor connection. Buffered messages survive reconnects while the process keeps running, but are lost if the process exits, crashes, or the host loses power. The RSMP core specification requires the outgoing communication buffer to survive communication failure and power outage, so this is not yet a complete persistent buffer implementation.
98
+
53
99
  ## Example: supervisor YAML
54
100
 
55
101
  ```yaml
56
102
  port: 12111
103
+ connection_role: server
57
104
  default:
58
105
  sxls:
59
106
  tlc: "1.3.0"
@@ -79,6 +126,22 @@ sites:
79
126
 
80
127
  Per-site configuration follows the supervisor-side site schema (`lib/rsmp/options/schemas/supervisor_site.json`). Each site entry can define an `sxls` map, or inherit it from `default`. The SXL name `core` is reserved for the RSMP core schema and cannot be used as an SXL key.
81
128
 
129
+ For supervisors, `server` is the default and listens on `ip`/`port`. A supervisor in `client` role connects out to the endpoints listed under each configured site. The outbound endpoint list uses the existing `supervisors` key in the per-site settings:
130
+
131
+ ```yaml
132
+ connection_role: client
133
+ sites:
134
+ RN+SI0001:
135
+ core_version: "3.3.0"
136
+ sxls:
137
+ tlc: "1.3.0"
138
+ supervisors:
139
+ - ip: 127.0.0.1
140
+ port: 12111
141
+ ```
142
+
143
+ This reversed setup is used when the site listens and the supervision system initiates the connection.
144
+
82
145
  ## Supervisor settings
83
146
 
84
147
  The following lists the top-level supervisor settings and the keys available for per-site configuration under `sites`.
@@ -87,6 +150,7 @@ Top-level supervisor settings
87
150
 
88
151
  - `port`: integer|string - TCP port the supervisor listens on (default: `12111`).
89
152
  - `ip`: string - address to bind to.
153
+ - `connection_role`: string - `server` to listen for sites, or `client` to connect to configured site endpoints (default: `server`).
90
154
  - `ips`: string or array - `'all'` or a list of allowed IP addresses.
91
155
  - `site_id`: string - optional site identifier for the supervisor itself.
92
156
  - `max_sites`: integer - limit concurrent connected sites.
@@ -119,6 +183,25 @@ Common per-site keys
119
183
  - `skip_validation` (array[string]): list of message types to skip JSON schema validation for this site.
120
184
  - `security_codes` (object): map of security code levels to secrets.
121
185
 
186
+ ## Site settings
187
+
188
+ The following lists the top-level site settings.
189
+
190
+ - `site_id` (string): site identifier sent in the Version message.
191
+ - `type` (string): optional site type.
192
+ - `connection_role` (string): `client` to connect to supervisors, or `server` to listen for supervisor connections (default: `client`).
193
+ - `ip` (string): bind address when `connection_role` is `server` (default: `0.0.0.0`).
194
+ - `port` (integer|string): listen port when `connection_role` is `server`. If omitted, it defaults to the first configured supervisor port.
195
+ - `supervisors` (array): supervisor endpoints used when `connection_role` is `client`.
196
+ - `sxls` (object): SXL versions used by the site, keyed by SXL name.
197
+ - `core_version` (string): RSMP Core version to use.
198
+ - `intervals` (object): timer settings - `timer`, `watchdog`, `reconnect`.
199
+ - `timeouts` (object): timeout settings - `watchdog`, `acknowledgement`.
200
+ - `send_after_connect` (boolean): whether to send messages after connect without waiting for additional events.
201
+ - `message_buffer` (object): outgoing message buffer settings.
202
+ - `components` (object): component definitions.
203
+ - `security_codes` (object): map of security code levels to secrets.
204
+
122
205
  ### TLC-specific settings
123
206
 
124
207
  TLC-specific settings are used when a site uses the `tlc` SXL and include:
@@ -0,0 +1,30 @@
1
+ module RSMP
2
+ class CLI < Thor
3
+ # Private helpers for loading CLI configuration files.
4
+ module Configuration
5
+ private
6
+
7
+ def load_site_configuration
8
+ load_configuration(site_options_class)
9
+ end
10
+
11
+ def load_supervisor_configuration
12
+ load_configuration(RSMP::Supervisor::Options)
13
+ end
14
+
15
+ def load_configuration(options_class)
16
+ settings = {}
17
+ log_settings = { 'active' => true }
18
+ return [settings, log_settings] unless options[:config]
19
+
20
+ options_object = options_class.load_file(options[:config])
21
+ settings = options_object.to_h
22
+ log_settings = log_settings.deep_merge(options_object.log_settings)
23
+ [settings, log_settings]
24
+ rescue RSMP::ConfigurationError => e
25
+ puts "Error: #{e}"
26
+ exit
27
+ end
28
+ end
29
+ end
30
+ end
data/lib/rsmp/cli.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require 'thor'
2
2
  require_relative '../rsmp'
3
+ require_relative 'cli/configuration'
3
4
 
4
5
  module RSMP
5
6
  # CLI subcommands for SXL schema operations.
@@ -20,8 +21,36 @@ module RSMP
20
21
  end
21
22
  end
22
23
 
24
+ # CLI subcommands for RSMP configuration validation.
25
+ class ConfigCLI < Thor
26
+ namespace :config
27
+ desc 'check PATH...', 'Validate RSMP site or supervisor config files'
28
+ method_option :type, type: :string, aliases: '-t', default: 'auto',
29
+ enum: ['auto'] + RSMP::Config.types,
30
+ banner: 'Config type: auto, site, tlc or supervisor'
31
+ def check(*paths)
32
+ if paths.empty?
33
+ puts 'Error: config check requires at least one path'
34
+ exit 1
35
+ end
36
+
37
+ valid = true
38
+ paths.each do |path|
39
+ RSMP::Config.load_file(path, type: options[:type])
40
+ puts 'OK'
41
+ rescue RSMP::ConfigurationError => e
42
+ valid = false
43
+ puts "Error: #{e.message}"
44
+ end
45
+
46
+ exit 1 unless valid
47
+ end
48
+ end
49
+
23
50
  # CLI commands for running RSMP site and supervisor.
24
51
  class CLI < Thor
52
+ include Configuration
53
+
25
54
  desc 'version', 'Show version'
26
55
  def version
27
56
  puts RSMP::VERSION
@@ -33,6 +62,7 @@ module RSMP
33
62
  method_option :supervisors, type: :string, aliases: '-s',
34
63
  banner: 'ip:port,... list of supervisor to connect to'
35
64
  method_option :core, type: :string, banner: "Core version: [#{RSMP::Schema.core_versions.join(' ')}]", enum: RSMP::Schema.core_versions
65
+ method_option :sxls, type: :string, banner: 'SXL versions as name:version,...'
36
66
  method_option :type, type: :string, aliases: '-t', banner: 'Type of site: [tlc]', enum: ['tlc'],
37
67
  default: 'tlc'
38
68
  method_option :log, type: :string, aliases: '-l', banner: 'Path to log file'
@@ -58,6 +88,7 @@ module RSMP
58
88
  method_option :ip, type: :string, banner: 'IP address to listen on'
59
89
  method_option :port, type: :string, aliases: '-p', banner: 'Port to listen on'
60
90
  method_option :core, type: :string, banner: "Core version: [#{RSMP::Schema.core_versions.join(' ')}]", enum: RSMP::Schema.core_versions
91
+ method_option :sxls, type: :string, banner: 'Default SXL versions as name:version,...'
61
92
  method_option :log, type: :string, aliases: '-l', banner: 'Path to log file'
62
93
  method_option :json, type: :boolean, aliases: '-j', banner: 'Show JSON messages in log'
63
94
  def supervisor
@@ -69,26 +100,7 @@ module RSMP
69
100
  end
70
101
 
71
102
  register SchemaCLI, 'schema', 'schema COMMAND', 'SXL schema commands'
72
-
73
- no_commands do
74
- def load_site_configuration
75
- settings = {}
76
- log_settings = { 'active' => true }
77
-
78
- return [settings, log_settings] unless options[:config]
79
-
80
- begin
81
- options_object = site_options_class.load_file(options[:config])
82
- settings = options_object.to_h
83
- log_settings = log_settings.deep_merge(options_object.log_settings)
84
- rescue RSMP::ConfigurationError => e
85
- puts "Error: #{e}"
86
- exit
87
- end
88
-
89
- [settings, log_settings]
90
- end
91
- end
103
+ register ConfigCLI, 'config', 'config COMMAND', 'Configuration commands'
92
104
 
93
105
  private
94
106
 
@@ -109,8 +121,8 @@ module RSMP
109
121
 
110
122
  def apply_basic_site_options(settings)
111
123
  settings['site_id'] = options[:id] if options[:id]
112
- settings['core_version'] = options[:core] || ENV['CORE_VERSION'] if options[:core] || ENV['CORE_VERSION']
113
- settings['sxls'] = parse_sxls(ENV['SXLS']) if ENV['SXLS']
124
+ settings['core_version'] = options[:core] if options[:core]
125
+ settings['sxls'] = parse_sxls(options[:sxls]) if options[:sxls]
114
126
  end
115
127
 
116
128
  def parse_sxls(value)
@@ -196,27 +208,9 @@ module RSMP
196
208
  end
197
209
  end
198
210
 
199
- def load_supervisor_configuration
200
- settings = {}
201
- log_settings = { 'active' => true }
202
-
203
- return [settings, log_settings] unless options[:config]
204
-
205
- begin
206
- options_object = RSMP::Supervisor::Options.load_file(options[:config])
207
- settings = options_object.to_h
208
- log_settings = log_settings.deep_merge(options_object.log_settings)
209
- rescue RSMP::ConfigurationError => e
210
- puts "Error: #{e}"
211
- exit
212
- end
213
-
214
- [settings, log_settings]
215
- end
216
-
217
211
  def apply_supervisor_options(settings, log_settings)
218
212
  apply_basic_supervisor_options(settings)
219
- apply_core_version_option(settings)
213
+ apply_version_options(settings)
220
214
  apply_log_options(log_settings)
221
215
  end
222
216
 
@@ -226,11 +220,17 @@ module RSMP
226
220
  settings['port'] = options[:port] if options[:port]
227
221
  end
228
222
 
229
- def apply_core_version_option(settings)
230
- return unless options[:core]
223
+ def apply_version_options(settings)
224
+ return unless options[:core] || options[:sxls]
225
+
226
+ sxls = parse_sxls(options[:sxls]) if options[:sxls]
227
+ apply_version_overrides(settings['default'] ||= {}, sxls)
228
+ (settings['sites'] || {}).each_value { |site_settings| apply_version_overrides(site_settings, sxls) }
229
+ end
231
230
 
232
- settings['default'] ||= {}
233
- settings['default']['core_version'] = options[:core]
231
+ def apply_version_overrides(settings, sxls)
232
+ settings['core_version'] = options[:core] if options[:core]
233
+ settings['sxls'] = sxls if sxls
234
234
  end
235
235
 
236
236
  def apply_log_options(log_settings)
@@ -9,16 +9,25 @@ module RSMP
9
9
  end
10
10
 
11
11
  def match_value?(item)
12
- return true unless @want['v']
12
+ return true unless @want.key?('v')
13
13
 
14
- if @want['v'].is_a? Regexp
15
- return false if item['v'] !~ @want['v']
16
- elsif item['v'] != @want['v']
14
+ want = @want['v']
15
+ got = item['v']
16
+ if want.is_a? Regexp
17
+ return false unless regex_match?(got, want)
18
+ elsif got != want
17
19
  return false
18
20
  end
19
21
  true
20
22
  end
21
23
 
24
+ def regex_match?(got, want)
25
+ return got =~ want if got.is_a?(String)
26
+ return got.any? { |item| item.is_a?(String) && item =~ want } if got.is_a?(Array)
27
+
28
+ false
29
+ end
30
+
22
31
  def match(item)
23
32
  code_match = match_code(item)
24
33
  return code_match if code_match.nil?