@gpustack/loopwright 0.0.0-stage → 0.0.2

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 (477) hide show
  1. package/LICENSE +191 -0
  2. package/README.md +356 -2
  3. package/bin/loopwright.js +3 -0
  4. package/node_modules/@loopwright/agent-pi/dist/adapter-v2.d.ts +9 -0
  5. package/node_modules/@loopwright/agent-pi/dist/adapter-v2.js +122 -0
  6. package/node_modules/@loopwright/agent-pi/dist/adapter.d.ts +30 -0
  7. package/node_modules/@loopwright/agent-pi/dist/adapter.js +340 -0
  8. package/node_modules/@loopwright/agent-pi/dist/admission.d.ts +25 -0
  9. package/node_modules/@loopwright/agent-pi/dist/admission.js +65 -0
  10. package/node_modules/@loopwright/agent-pi/dist/artifacts.d.ts +15 -0
  11. package/node_modules/@loopwright/agent-pi/dist/artifacts.js +76 -0
  12. package/node_modules/@loopwright/agent-pi/dist/boundary.d.ts +18 -0
  13. package/node_modules/@loopwright/agent-pi/dist/boundary.js +113 -0
  14. package/node_modules/@loopwright/agent-pi/dist/broker-channel.d.ts +4 -0
  15. package/node_modules/@loopwright/agent-pi/dist/broker-channel.js +121 -0
  16. package/node_modules/@loopwright/agent-pi/dist/candidate.d.ts +96 -0
  17. package/node_modules/@loopwright/agent-pi/dist/candidate.js +1712 -0
  18. package/node_modules/@loopwright/agent-pi/dist/capture.d.ts +39 -0
  19. package/node_modules/@loopwright/agent-pi/dist/capture.js +146 -0
  20. package/node_modules/@loopwright/agent-pi/dist/cas.d.ts +51 -0
  21. package/node_modules/@loopwright/agent-pi/dist/cas.js +836 -0
  22. package/node_modules/@loopwright/agent-pi/dist/catalog-api.d.ts +3 -0
  23. package/node_modules/@loopwright/agent-pi/dist/catalog-api.js +2 -0
  24. package/node_modules/@loopwright/agent-pi/dist/catalog.d.ts +39 -0
  25. package/node_modules/@loopwright/agent-pi/dist/catalog.js +280 -0
  26. package/node_modules/@loopwright/agent-pi/dist/circuit-breaker-limits.d.ts +9 -0
  27. package/node_modules/@loopwright/agent-pi/dist/circuit-breaker-limits.js +12 -0
  28. package/node_modules/@loopwright/agent-pi/dist/containers.d.ts +29 -0
  29. package/node_modules/@loopwright/agent-pi/dist/containers.js +160 -0
  30. package/node_modules/@loopwright/agent-pi/dist/context.d.ts +56 -0
  31. package/node_modules/@loopwright/agent-pi/dist/context.js +351 -0
  32. package/node_modules/@loopwright/agent-pi/dist/daemon.d.ts +8 -0
  33. package/node_modules/@loopwright/agent-pi/dist/daemon.js +52 -0
  34. package/node_modules/@loopwright/agent-pi/dist/deadline.d.ts +6 -0
  35. package/node_modules/@loopwright/agent-pi/dist/deadline.js +18 -0
  36. package/node_modules/@loopwright/agent-pi/dist/decode-capture.d.ts +39 -0
  37. package/node_modules/@loopwright/agent-pi/dist/decode-capture.js +287 -0
  38. package/node_modules/@loopwright/agent-pi/dist/descriptor.d.ts +12 -0
  39. package/node_modules/@loopwright/agent-pi/dist/descriptor.js +17 -0
  40. package/node_modules/@loopwright/agent-pi/dist/docker-absence.d.ts +2 -0
  41. package/node_modules/@loopwright/agent-pi/dist/docker-absence.js +9 -0
  42. package/node_modules/@loopwright/agent-pi/dist/errors.d.ts +7 -0
  43. package/node_modules/@loopwright/agent-pi/dist/errors.js +19 -0
  44. package/node_modules/@loopwright/agent-pi/dist/event-sequence.d.ts +6 -0
  45. package/node_modules/@loopwright/agent-pi/dist/event-sequence.js +64 -0
  46. package/node_modules/@loopwright/agent-pi/dist/events.d.ts +19 -0
  47. package/node_modules/@loopwright/agent-pi/dist/events.js +132 -0
  48. package/node_modules/@loopwright/agent-pi/dist/execution-guard.d.ts +9 -0
  49. package/node_modules/@loopwright/agent-pi/dist/execution-guard.js +25 -0
  50. package/node_modules/@loopwright/agent-pi/dist/execution-lease.d.ts +24 -0
  51. package/node_modules/@loopwright/agent-pi/dist/execution-lease.js +316 -0
  52. package/node_modules/@loopwright/agent-pi/dist/execution.d.ts +32 -0
  53. package/node_modules/@loopwright/agent-pi/dist/execution.js +476 -0
  54. package/node_modules/@loopwright/agent-pi/dist/external-mcp.d.ts +87 -0
  55. package/node_modules/@loopwright/agent-pi/dist/external-mcp.js +526 -0
  56. package/node_modules/@loopwright/agent-pi/dist/factory-bootstrap.d.ts +15 -0
  57. package/node_modules/@loopwright/agent-pi/dist/factory-bootstrap.js +74 -0
  58. package/node_modules/@loopwright/agent-pi/dist/host-session.d.ts +51 -0
  59. package/node_modules/@loopwright/agent-pi/dist/host-session.js +2083 -0
  60. package/node_modules/@loopwright/agent-pi/dist/http-mcp.d.ts +32 -0
  61. package/node_modules/@loopwright/agent-pi/dist/http-mcp.js +353 -0
  62. package/node_modules/@loopwright/agent-pi/dist/index.d.ts +7 -0
  63. package/node_modules/@loopwright/agent-pi/dist/index.js +4 -0
  64. package/node_modules/@loopwright/agent-pi/dist/lifecycle.d.ts +13 -0
  65. package/node_modules/@loopwright/agent-pi/dist/lifecycle.js +11 -0
  66. package/node_modules/@loopwright/agent-pi/dist/mcp-process.d.ts +35 -0
  67. package/node_modules/@loopwright/agent-pi/dist/mcp-process.js +92 -0
  68. package/node_modules/@loopwright/agent-pi/dist/mcp-transport.d.ts +25 -0
  69. package/node_modules/@loopwright/agent-pi/dist/mcp-transport.js +63 -0
  70. package/node_modules/@loopwright/agent-pi/dist/mcp.d.ts +23 -0
  71. package/node_modules/@loopwright/agent-pi/dist/mcp.js +212 -0
  72. package/node_modules/@loopwright/agent-pi/dist/operation.d.ts +5 -0
  73. package/node_modules/@loopwright/agent-pi/dist/operation.js +28 -0
  74. package/node_modules/@loopwright/agent-pi/dist/policy-v2.d.ts +10 -0
  75. package/node_modules/@loopwright/agent-pi/dist/policy-v2.js +64 -0
  76. package/node_modules/@loopwright/agent-pi/dist/policy.d.ts +13 -0
  77. package/node_modules/@loopwright/agent-pi/dist/policy.js +260 -0
  78. package/node_modules/@loopwright/agent-pi/dist/preflight.d.ts +60 -0
  79. package/node_modules/@loopwright/agent-pi/dist/preflight.js +700 -0
  80. package/node_modules/@loopwright/agent-pi/dist/progress-summary.d.ts +1 -0
  81. package/node_modules/@loopwright/agent-pi/dist/progress-summary.js +119 -0
  82. package/node_modules/@loopwright/agent-pi/dist/protocol.d.ts +17 -0
  83. package/node_modules/@loopwright/agent-pi/dist/protocol.js +131 -0
  84. package/node_modules/@loopwright/agent-pi/dist/provider.d.ts +62 -0
  85. package/node_modules/@loopwright/agent-pi/dist/provider.js +217 -0
  86. package/node_modules/@loopwright/agent-pi/dist/receipt.d.ts +3 -0
  87. package/node_modules/@loopwright/agent-pi/dist/receipt.js +64 -0
  88. package/node_modules/@loopwright/agent-pi/dist/recovery.d.ts +6 -0
  89. package/node_modules/@loopwright/agent-pi/dist/recovery.js +188 -0
  90. package/node_modules/@loopwright/agent-pi/dist/resources.d.ts +13 -0
  91. package/node_modules/@loopwright/agent-pi/dist/resources.js +81 -0
  92. package/node_modules/@loopwright/agent-pi/dist/response.d.ts +20 -0
  93. package/node_modules/@loopwright/agent-pi/dist/response.js +259 -0
  94. package/node_modules/@loopwright/agent-pi/dist/runtime-profile.d.ts +6 -0
  95. package/node_modules/@loopwright/agent-pi/dist/runtime-profile.js +37 -0
  96. package/node_modules/@loopwright/agent-pi/dist/sdk-worker.d.ts +14 -0
  97. package/node_modules/@loopwright/agent-pi/dist/sdk-worker.js +633 -0
  98. package/node_modules/@loopwright/agent-pi/dist/sender.d.ts +46 -0
  99. package/node_modules/@loopwright/agent-pi/dist/sender.js +553 -0
  100. package/node_modules/@loopwright/agent-pi/dist/session-host.d.ts +21 -0
  101. package/node_modules/@loopwright/agent-pi/dist/session-host.js +315 -0
  102. package/node_modules/@loopwright/agent-pi/dist/snapshot-transfer.d.ts +14 -0
  103. package/node_modules/@loopwright/agent-pi/dist/snapshot-transfer.js +102 -0
  104. package/node_modules/@loopwright/agent-pi/dist/snapshot.d.ts +19 -0
  105. package/node_modules/@loopwright/agent-pi/dist/snapshot.js +121 -0
  106. package/node_modules/@loopwright/agent-pi/dist/tool-process.d.ts +32 -0
  107. package/node_modules/@loopwright/agent-pi/dist/tool-process.js +85 -0
  108. package/node_modules/@loopwright/agent-pi/dist/tool-worker.d.ts +2 -0
  109. package/node_modules/@loopwright/agent-pi/dist/tool-worker.js +105 -0
  110. package/node_modules/@loopwright/agent-pi/dist/tools.d.ts +36 -0
  111. package/node_modules/@loopwright/agent-pi/dist/tools.js +128 -0
  112. package/node_modules/@loopwright/agent-pi/dist/types-v2.d.ts +71 -0
  113. package/node_modules/@loopwright/agent-pi/dist/types-v2.js +1 -0
  114. package/node_modules/@loopwright/agent-pi/dist/types.d.ts +314 -0
  115. package/node_modules/@loopwright/agent-pi/dist/types.js +1 -0
  116. package/node_modules/@loopwright/agent-pi/dist/usage.d.ts +18 -0
  117. package/node_modules/@loopwright/agent-pi/dist/usage.js +314 -0
  118. package/node_modules/@loopwright/agent-pi/dist/workspace-mcp.d.ts +27 -0
  119. package/node_modules/@loopwright/agent-pi/dist/workspace-mcp.js +142 -0
  120. package/node_modules/@loopwright/agent-pi/package.json +24 -0
  121. package/node_modules/@loopwright/agent-pi/runtime/Dockerfile +8 -0
  122. package/node_modules/@loopwright/agent-pi/runtime/seccomp.json +1 -0
  123. package/node_modules/@loopwright/cli/dist/arguments.d.ts +19 -0
  124. package/node_modules/@loopwright/cli/dist/arguments.js +358 -0
  125. package/node_modules/@loopwright/cli/dist/closure.d.ts +93 -0
  126. package/node_modules/@loopwright/cli/dist/closure.js +230 -0
  127. package/node_modules/@loopwright/cli/dist/draft.d.ts +9 -0
  128. package/node_modules/@loopwright/cli/dist/draft.js +106 -0
  129. package/node_modules/@loopwright/cli/dist/failure-matrix.d.ts +9 -0
  130. package/node_modules/@loopwright/cli/dist/failure-matrix.js +701 -0
  131. package/node_modules/@loopwright/cli/dist/index.d.ts +6 -0
  132. package/node_modules/@loopwright/cli/dist/index.js +5 -0
  133. package/node_modules/@loopwright/cli/dist/main.d.ts +22 -0
  134. package/node_modules/@loopwright/cli/dist/main.js +1855 -0
  135. package/node_modules/@loopwright/cli/package.json +16 -0
  136. package/node_modules/@loopwright/controller/dist/acceptance.d.ts +43 -0
  137. package/node_modules/@loopwright/controller/dist/acceptance.js +446 -0
  138. package/node_modules/@loopwright/controller/dist/benchmark-gate.d.ts +273 -0
  139. package/node_modules/@loopwright/controller/dist/benchmark-gate.js +3147 -0
  140. package/node_modules/@loopwright/controller/dist/budget-observations.d.ts +25 -0
  141. package/node_modules/@loopwright/controller/dist/budget-observations.js +139 -0
  142. package/node_modules/@loopwright/controller/dist/bundle.d.ts +26 -0
  143. package/node_modules/@loopwright/controller/dist/bundle.js +64 -0
  144. package/node_modules/@loopwright/controller/dist/capture.d.ts +89 -0
  145. package/node_modules/@loopwright/controller/dist/capture.js +587 -0
  146. package/node_modules/@loopwright/controller/dist/compile.d.ts +3 -0
  147. package/node_modules/@loopwright/controller/dist/compile.js +402 -0
  148. package/node_modules/@loopwright/controller/dist/config.d.ts +22 -0
  149. package/node_modules/@loopwright/controller/dist/config.js +255 -0
  150. package/node_modules/@loopwright/controller/dist/controller.d.ts +177 -0
  151. package/node_modules/@loopwright/controller/dist/controller.js +2135 -0
  152. package/node_modules/@loopwright/controller/dist/credentials.d.ts +29 -0
  153. package/node_modules/@loopwright/controller/dist/credentials.js +189 -0
  154. package/node_modules/@loopwright/controller/dist/deadlines.d.ts +18 -0
  155. package/node_modules/@loopwright/controller/dist/deadlines.js +71 -0
  156. package/node_modules/@loopwright/controller/dist/errors.d.ts +27 -0
  157. package/node_modules/@loopwright/controller/dist/errors.js +41 -0
  158. package/node_modules/@loopwright/controller/dist/events.d.ts +52 -0
  159. package/node_modules/@loopwright/controller/dist/events.js +228 -0
  160. package/node_modules/@loopwright/controller/dist/files.d.ts +51 -0
  161. package/node_modules/@loopwright/controller/dist/files.js +386 -0
  162. package/node_modules/@loopwright/controller/dist/finalize.d.ts +25 -0
  163. package/node_modules/@loopwright/controller/dist/finalize.js +32 -0
  164. package/node_modules/@loopwright/controller/dist/gate.d.ts +84 -0
  165. package/node_modules/@loopwright/controller/dist/gate.js +640 -0
  166. package/node_modules/@loopwright/controller/dist/git-objects.d.ts +11 -0
  167. package/node_modules/@loopwright/controller/dist/git-objects.js +59 -0
  168. package/node_modules/@loopwright/controller/dist/git-reader.d.ts +17 -0
  169. package/node_modules/@loopwright/controller/dist/git-reader.js +40 -0
  170. package/node_modules/@loopwright/controller/dist/handlers.d.ts +6 -0
  171. package/node_modules/@loopwright/controller/dist/handlers.js +45 -0
  172. package/node_modules/@loopwright/controller/dist/handoff.d.ts +71 -0
  173. package/node_modules/@loopwright/controller/dist/handoff.js +554 -0
  174. package/node_modules/@loopwright/controller/dist/index.d.ts +41 -0
  175. package/node_modules/@loopwright/controller/dist/index.js +21 -0
  176. package/node_modules/@loopwright/controller/dist/inspect.d.ts +30 -0
  177. package/node_modules/@loopwright/controller/dist/inspect.js +372 -0
  178. package/node_modules/@loopwright/controller/dist/interpolation.d.ts +9 -0
  179. package/node_modules/@loopwright/controller/dist/interpolation.js +79 -0
  180. package/node_modules/@loopwright/controller/dist/ownership.d.ts +41 -0
  181. package/node_modules/@loopwright/controller/dist/ownership.js +666 -0
  182. package/node_modules/@loopwright/controller/dist/parser.d.ts +5 -0
  183. package/node_modules/@loopwright/controller/dist/parser.js +200 -0
  184. package/node_modules/@loopwright/controller/dist/progress.d.ts +41 -0
  185. package/node_modules/@loopwright/controller/dist/progress.js +904 -0
  186. package/node_modules/@loopwright/controller/dist/publication.d.ts +60 -0
  187. package/node_modules/@loopwright/controller/dist/publication.js +329 -0
  188. package/node_modules/@loopwright/controller/dist/reconcile.d.ts +26 -0
  189. package/node_modules/@loopwright/controller/dist/reconcile.js +1378 -0
  190. package/node_modules/@loopwright/controller/dist/recovery.d.ts +10 -0
  191. package/node_modules/@loopwright/controller/dist/recovery.js +315 -0
  192. package/node_modules/@loopwright/controller/dist/refusal-record.d.ts +43 -0
  193. package/node_modules/@loopwright/controller/dist/refusal-record.js +150 -0
  194. package/node_modules/@loopwright/controller/dist/registry.d.ts +6 -0
  195. package/node_modules/@loopwright/controller/dist/registry.js +374 -0
  196. package/node_modules/@loopwright/controller/dist/repair.d.ts +31 -0
  197. package/node_modules/@loopwright/controller/dist/repair.js +102 -0
  198. package/node_modules/@loopwright/controller/dist/report.d.ts +64 -0
  199. package/node_modules/@loopwright/controller/dist/report.js +596 -0
  200. package/node_modules/@loopwright/controller/dist/retained.d.ts +284 -0
  201. package/node_modules/@loopwright/controller/dist/retained.js +193 -0
  202. package/node_modules/@loopwright/controller/dist/rules.d.ts +31 -0
  203. package/node_modules/@loopwright/controller/dist/rules.js +110 -0
  204. package/node_modules/@loopwright/controller/dist/run-eval.d.ts +115 -0
  205. package/node_modules/@loopwright/controller/dist/run-eval.js +959 -0
  206. package/node_modules/@loopwright/controller/dist/scheduler.d.ts +10 -0
  207. package/node_modules/@loopwright/controller/dist/scheduler.js +41 -0
  208. package/node_modules/@loopwright/controller/dist/schema.d.ts +17 -0
  209. package/node_modules/@loopwright/controller/dist/schema.js +78 -0
  210. package/node_modules/@loopwright/controller/dist/source.d.ts +69 -0
  211. package/node_modules/@loopwright/controller/dist/source.js +872 -0
  212. package/node_modules/@loopwright/controller/dist/step.d.ts +38 -0
  213. package/node_modules/@loopwright/controller/dist/step.js +1776 -0
  214. package/node_modules/@loopwright/controller/dist/storage.d.ts +90 -0
  215. package/node_modules/@loopwright/controller/dist/storage.js +1345 -0
  216. package/node_modules/@loopwright/controller/dist/submission.d.ts +51 -0
  217. package/node_modules/@loopwright/controller/dist/submission.js +292 -0
  218. package/node_modules/@loopwright/controller/dist/types.d.ts +585 -0
  219. package/node_modules/@loopwright/controller/dist/types.js +9 -0
  220. package/node_modules/@loopwright/controller/dist/verification.d.ts +124 -0
  221. package/node_modules/@loopwright/controller/dist/verification.js +1308 -0
  222. package/node_modules/@loopwright/controller/dist/verifier-protocol.d.ts +105 -0
  223. package/node_modules/@loopwright/controller/dist/verifier-protocol.js +1312 -0
  224. package/node_modules/@loopwright/controller/dist/verifier-worker.d.ts +1 -0
  225. package/node_modules/@loopwright/controller/dist/verifier-worker.js +33 -0
  226. package/node_modules/@loopwright/controller/package.json +12 -0
  227. package/node_modules/@loopwright/core/dist/acceptance.d.ts +108 -0
  228. package/node_modules/@loopwright/core/dist/acceptance.js +327 -0
  229. package/node_modules/@loopwright/core/dist/artifacts.d.ts +63 -0
  230. package/node_modules/@loopwright/core/dist/artifacts.js +356 -0
  231. package/node_modules/@loopwright/core/dist/boundary.d.ts +21 -0
  232. package/node_modules/@loopwright/core/dist/boundary.js +484 -0
  233. package/node_modules/@loopwright/core/dist/contracts.d.ts +287 -0
  234. package/node_modules/@loopwright/core/dist/contracts.js +694 -0
  235. package/node_modules/@loopwright/core/dist/diagnostics.d.ts +21 -0
  236. package/node_modules/@loopwright/core/dist/diagnostics.js +51 -0
  237. package/node_modules/@loopwright/core/dist/evidence.d.ts +92 -0
  238. package/node_modules/@loopwright/core/dist/evidence.js +85 -0
  239. package/node_modules/@loopwright/core/dist/graph.d.ts +8 -0
  240. package/node_modules/@loopwright/core/dist/graph.js +44 -0
  241. package/node_modules/@loopwright/core/dist/identity.d.ts +162 -0
  242. package/node_modules/@loopwright/core/dist/identity.js +80 -0
  243. package/node_modules/@loopwright/core/dist/index.d.ts +30 -0
  244. package/node_modules/@loopwright/core/dist/index.js +39 -0
  245. package/node_modules/@loopwright/core/dist/limits.d.ts +99 -0
  246. package/node_modules/@loopwright/core/dist/limits.js +59 -0
  247. package/node_modules/@loopwright/core/dist/results.d.ts +161 -0
  248. package/node_modules/@loopwright/core/dist/results.js +98 -0
  249. package/node_modules/@loopwright/core/dist/scope.d.ts +13 -0
  250. package/node_modules/@loopwright/core/dist/scope.js +154 -0
  251. package/node_modules/@loopwright/core/dist/scrubber.d.ts +13 -0
  252. package/node_modules/@loopwright/core/dist/scrubber.js +63 -0
  253. package/node_modules/@loopwright/core/dist/usage.d.ts +68 -0
  254. package/node_modules/@loopwright/core/dist/usage.js +56 -0
  255. package/node_modules/@loopwright/core/package.json +12 -0
  256. package/node_modules/@loopwright/decisions/dist/benchmark.d.ts +23 -0
  257. package/node_modules/@loopwright/decisions/dist/benchmark.js +337 -0
  258. package/node_modules/@loopwright/decisions/dist/client.d.ts +74 -0
  259. package/node_modules/@loopwright/decisions/dist/client.js +292 -0
  260. package/node_modules/@loopwright/decisions/dist/index.d.ts +15 -0
  261. package/node_modules/@loopwright/decisions/dist/index.js +8 -0
  262. package/node_modules/@loopwright/decisions/dist/nodes.d.ts +63 -0
  263. package/node_modules/@loopwright/decisions/dist/nodes.js +282 -0
  264. package/node_modules/@loopwright/decisions/dist/primitives.d.ts +36 -0
  265. package/node_modules/@loopwright/decisions/dist/primitives.js +300 -0
  266. package/node_modules/@loopwright/decisions/dist/redaction.d.ts +23 -0
  267. package/node_modules/@loopwright/decisions/dist/redaction.js +146 -0
  268. package/node_modules/@loopwright/decisions/dist/router.d.ts +55 -0
  269. package/node_modules/@loopwright/decisions/dist/router.js +248 -0
  270. package/node_modules/@loopwright/decisions/dist/schema.d.ts +25 -0
  271. package/node_modules/@loopwright/decisions/dist/schema.js +536 -0
  272. package/node_modules/@loopwright/decisions/dist/types.d.ts +394 -0
  273. package/node_modules/@loopwright/decisions/dist/types.js +80 -0
  274. package/node_modules/@loopwright/decisions/package.json +12 -0
  275. package/node_modules/@loopwright/github-app/dist/action.d.ts +90 -0
  276. package/node_modules/@loopwright/github-app/dist/action.js +2429 -0
  277. package/node_modules/@loopwright/github-app/dist/config.d.ts +23 -0
  278. package/node_modules/@loopwright/github-app/dist/config.js +297 -0
  279. package/node_modules/@loopwright/github-app/dist/digests.d.ts +1 -0
  280. package/node_modules/@loopwright/github-app/dist/digests.js +1 -0
  281. package/node_modules/@loopwright/github-app/dist/index.d.ts +14 -0
  282. package/node_modules/@loopwright/github-app/dist/index.js +13 -0
  283. package/node_modules/@loopwright/github-app/dist/models-config.d.ts +1 -0
  284. package/node_modules/@loopwright/github-app/dist/models-config.js +1 -0
  285. package/node_modules/@loopwright/github-app/dist/output-format.d.ts +1 -0
  286. package/node_modules/@loopwright/github-app/dist/output-format.js +1 -0
  287. package/node_modules/@loopwright/github-app/dist/preflight.d.ts +1 -0
  288. package/node_modules/@loopwright/github-app/dist/preflight.js +1 -0
  289. package/node_modules/@loopwright/github-app/dist/publisher.d.ts +58 -0
  290. package/node_modules/@loopwright/github-app/dist/publisher.js +1368 -0
  291. package/node_modules/@loopwright/github-app/dist/qualification.d.ts +1 -0
  292. package/node_modules/@loopwright/github-app/dist/qualification.js +1 -0
  293. package/node_modules/@loopwright/github-app/dist/sandbox.d.ts +1 -0
  294. package/node_modules/@loopwright/github-app/dist/sandbox.js +1 -0
  295. package/node_modules/@loopwright/github-app/dist/schema.d.ts +1 -0
  296. package/node_modules/@loopwright/github-app/dist/schema.js +1 -0
  297. package/node_modules/@loopwright/github-app/dist/service.d.ts +52 -0
  298. package/node_modules/@loopwright/github-app/dist/service.js +1658 -0
  299. package/node_modules/@loopwright/github-app/dist/suite-pr-lookup.d.ts +90 -0
  300. package/node_modules/@loopwright/github-app/dist/suite-pr-lookup.js +392 -0
  301. package/node_modules/@loopwright/github-app/dist/taskpack.d.ts +1 -0
  302. package/node_modules/@loopwright/github-app/dist/taskpack.js +1 -0
  303. package/node_modules/@loopwright/github-app/dist/tenant-queue.d.ts +44 -0
  304. package/node_modules/@loopwright/github-app/dist/tenant-queue.js +423 -0
  305. package/node_modules/@loopwright/github-app/dist/token-broker.d.ts +50 -0
  306. package/node_modules/@loopwright/github-app/dist/token-broker.js +262 -0
  307. package/node_modules/@loopwright/github-app/dist/turnkey-memory.d.ts +35 -0
  308. package/node_modules/@loopwright/github-app/dist/turnkey-memory.js +1654 -0
  309. package/node_modules/@loopwright/github-app/dist/turnkey.d.ts +16 -0
  310. package/node_modules/@loopwright/github-app/dist/turnkey.js +34 -0
  311. package/node_modules/@loopwright/github-app/dist/types.d.ts +220 -0
  312. package/node_modules/@loopwright/github-app/dist/types.js +14 -0
  313. package/node_modules/@loopwright/github-app/dist/upstreams.d.ts +13 -0
  314. package/node_modules/@loopwright/github-app/dist/upstreams.js +65 -0
  315. package/node_modules/@loopwright/github-app/dist/webhook.d.ts +34 -0
  316. package/node_modules/@loopwright/github-app/dist/webhook.js +241 -0
  317. package/node_modules/@loopwright/github-app/dist/yaml.d.ts +1 -0
  318. package/node_modules/@loopwright/github-app/dist/yaml.js +1 -0
  319. package/node_modules/@loopwright/github-app/package.json +12 -0
  320. package/node_modules/@loopwright/hardware-runner/dist/config.d.ts +48 -0
  321. package/node_modules/@loopwright/hardware-runner/dist/config.js +719 -0
  322. package/node_modules/@loopwright/hardware-runner/dist/evaluator.d.ts +230 -0
  323. package/node_modules/@loopwright/hardware-runner/dist/evaluator.js +3178 -0
  324. package/node_modules/@loopwright/hardware-runner/dist/index.d.ts +13 -0
  325. package/node_modules/@loopwright/hardware-runner/dist/index.js +9 -0
  326. package/node_modules/@loopwright/hardware-runner/dist/provenance.d.ts +128 -0
  327. package/node_modules/@loopwright/hardware-runner/dist/provenance.js +1500 -0
  328. package/node_modules/@loopwright/hardware-runner/dist/queue.d.ts +81 -0
  329. package/node_modules/@loopwright/hardware-runner/dist/queue.js +1081 -0
  330. package/node_modules/@loopwright/hardware-runner/dist/relay-server.d.ts +13 -0
  331. package/node_modules/@loopwright/hardware-runner/dist/relay-server.js +2997 -0
  332. package/node_modules/@loopwright/hardware-runner/dist/types.d.ts +239 -0
  333. package/node_modules/@loopwright/hardware-runner/dist/types.js +12 -0
  334. package/node_modules/@loopwright/hardware-runner/dist/worker.d.ts +49 -0
  335. package/node_modules/@loopwright/hardware-runner/dist/worker.js +1646 -0
  336. package/node_modules/@loopwright/hardware-runner/package.json +12 -0
  337. package/node_modules/@loopwright/memory/dist/cas.d.ts +21 -0
  338. package/node_modules/@loopwright/memory/dist/cas.js +510 -0
  339. package/node_modules/@loopwright/memory/dist/compaction.d.ts +18 -0
  340. package/node_modules/@loopwright/memory/dist/compaction.js +110 -0
  341. package/node_modules/@loopwright/memory/dist/finalizer.d.ts +23 -0
  342. package/node_modules/@loopwright/memory/dist/finalizer.js +538 -0
  343. package/node_modules/@loopwright/memory/dist/index.d.ts +9 -0
  344. package/node_modules/@loopwright/memory/dist/index.js +8 -0
  345. package/node_modules/@loopwright/memory/dist/schema.d.ts +36 -0
  346. package/node_modules/@loopwright/memory/dist/schema.js +510 -0
  347. package/node_modules/@loopwright/memory/dist/selector.d.ts +7 -0
  348. package/node_modules/@loopwright/memory/dist/selector.js +157 -0
  349. package/node_modules/@loopwright/memory/dist/store.d.ts +51 -0
  350. package/node_modules/@loopwright/memory/dist/store.js +554 -0
  351. package/node_modules/@loopwright/memory/dist/types.d.ts +442 -0
  352. package/node_modules/@loopwright/memory/dist/types.js +8 -0
  353. package/node_modules/@loopwright/memory/dist/verifier.d.ts +5 -0
  354. package/node_modules/@loopwright/memory/dist/verifier.js +328 -0
  355. package/node_modules/@loopwright/memory/package.json +12 -0
  356. package/node_modules/@loopwright/state/dist/admission.d.ts +321 -0
  357. package/node_modules/@loopwright/state/dist/admission.js +199 -0
  358. package/node_modules/@loopwright/state/dist/boundary.d.ts +53 -0
  359. package/node_modules/@loopwright/state/dist/boundary.js +194 -0
  360. package/node_modules/@loopwright/state/dist/checkpoint.d.ts +16 -0
  361. package/node_modules/@loopwright/state/dist/checkpoint.js +84 -0
  362. package/node_modules/@loopwright/state/dist/clock.d.ts +8 -0
  363. package/node_modules/@loopwright/state/dist/clock.js +27 -0
  364. package/node_modules/@loopwright/state/dist/connection.d.ts +55 -0
  365. package/node_modules/@loopwright/state/dist/connection.js +391 -0
  366. package/node_modules/@loopwright/state/dist/errors.d.ts +13 -0
  367. package/node_modules/@loopwright/state/dist/errors.js +34 -0
  368. package/node_modules/@loopwright/state/dist/index.d.ts +3 -0
  369. package/node_modules/@loopwright/state/dist/index.js +1 -0
  370. package/node_modules/@loopwright/state/dist/journal.d.ts +119 -0
  371. package/node_modules/@loopwright/state/dist/journal.js +72 -0
  372. package/node_modules/@loopwright/state/dist/model.d.ts +40 -0
  373. package/node_modules/@loopwright/state/dist/model.js +58 -0
  374. package/node_modules/@loopwright/state/dist/ownership.d.ts +14 -0
  375. package/node_modules/@loopwright/state/dist/ownership.js +45 -0
  376. package/node_modules/@loopwright/state/dist/pages.d.ts +11 -0
  377. package/node_modules/@loopwright/state/dist/pages.js +41 -0
  378. package/node_modules/@loopwright/state/dist/receipts.d.ts +33 -0
  379. package/node_modules/@loopwright/state/dist/receipts.js +97 -0
  380. package/node_modules/@loopwright/state/dist/schema.d.ts +28 -0
  381. package/node_modules/@loopwright/state/dist/schema.js +41 -0
  382. package/node_modules/@loopwright/state/dist/settlement.d.ts +10 -0
  383. package/node_modules/@loopwright/state/dist/settlement.js +129 -0
  384. package/node_modules/@loopwright/state/dist/store.d.ts +52 -0
  385. package/node_modules/@loopwright/state/dist/store.js +100 -0
  386. package/node_modules/@loopwright/state/dist/types.d.ts +315 -0
  387. package/node_modules/@loopwright/state/dist/types.js +1 -0
  388. package/node_modules/@loopwright/state/package.json +12 -0
  389. package/node_modules/@loopwright/taskpack/dist/baseline-align.d.ts +195 -0
  390. package/node_modules/@loopwright/taskpack/dist/baseline-align.js +1847 -0
  391. package/node_modules/@loopwright/taskpack/dist/digests.d.ts +61 -0
  392. package/node_modules/@loopwright/taskpack/dist/digests.js +715 -0
  393. package/node_modules/@loopwright/taskpack/dist/index.d.ts +18 -0
  394. package/node_modules/@loopwright/taskpack/dist/index.js +17 -0
  395. package/node_modules/@loopwright/taskpack/dist/models-config.d.ts +112 -0
  396. package/node_modules/@loopwright/taskpack/dist/models-config.js +1026 -0
  397. package/node_modules/@loopwright/taskpack/dist/output-format.d.ts +28 -0
  398. package/node_modules/@loopwright/taskpack/dist/output-format.js +157 -0
  399. package/node_modules/@loopwright/taskpack/dist/preflight.d.ts +130 -0
  400. package/node_modules/@loopwright/taskpack/dist/preflight.js +1497 -0
  401. package/node_modules/@loopwright/taskpack/dist/qualification.d.ts +23 -0
  402. package/node_modules/@loopwright/taskpack/dist/qualification.js +120 -0
  403. package/node_modules/@loopwright/taskpack/dist/sandbox.d.ts +121 -0
  404. package/node_modules/@loopwright/taskpack/dist/sandbox.js +2605 -0
  405. package/node_modules/@loopwright/taskpack/dist/schema.d.ts +197 -0
  406. package/node_modules/@loopwright/taskpack/dist/schema.js +4189 -0
  407. package/node_modules/@loopwright/taskpack/dist/scrubber.d.ts +47 -0
  408. package/node_modules/@loopwright/taskpack/dist/scrubber.js +283 -0
  409. package/node_modules/@loopwright/taskpack/dist/suite.d.ts +124 -0
  410. package/node_modules/@loopwright/taskpack/dist/suite.js +3256 -0
  411. package/node_modules/@loopwright/taskpack/dist/taskpack.d.ts +154 -0
  412. package/node_modules/@loopwright/taskpack/dist/taskpack.js +3634 -0
  413. package/node_modules/@loopwright/taskpack/dist/turnkey-memory.d.ts +122 -0
  414. package/node_modules/@loopwright/taskpack/dist/turnkey-memory.js +483 -0
  415. package/node_modules/@loopwright/taskpack/dist/turnkey.d.ts +437 -0
  416. package/node_modules/@loopwright/taskpack/dist/turnkey.js +7313 -0
  417. package/node_modules/@loopwright/taskpack/dist/types.d.ts +1274 -0
  418. package/node_modules/@loopwright/taskpack/dist/types.js +99 -0
  419. package/node_modules/@loopwright/taskpack/dist/upstreams.d.ts +261 -0
  420. package/node_modules/@loopwright/taskpack/dist/upstreams.js +2242 -0
  421. package/node_modules/@loopwright/taskpack/dist/yaml.d.ts +18 -0
  422. package/node_modules/@loopwright/taskpack/dist/yaml.js +167 -0
  423. package/node_modules/@loopwright/taskpack/package.json +12 -0
  424. package/node_modules/@loopwright/taskpack-runner/dist/compile-taskpack.d.ts +137 -0
  425. package/node_modules/@loopwright/taskpack-runner/dist/compile-taskpack.js +474 -0
  426. package/node_modules/@loopwright/taskpack-runner/dist/corpus.d.ts +8 -0
  427. package/node_modules/@loopwright/taskpack-runner/dist/corpus.js +129 -0
  428. package/node_modules/@loopwright/taskpack-runner/dist/index.d.ts +13 -0
  429. package/node_modules/@loopwright/taskpack-runner/dist/index.js +7 -0
  430. package/node_modules/@loopwright/taskpack-runner/dist/intake.d.ts +149 -0
  431. package/node_modules/@loopwright/taskpack-runner/dist/intake.js +135 -0
  432. package/node_modules/@loopwright/taskpack-runner/dist/parity.d.ts +130 -0
  433. package/node_modules/@loopwright/taskpack-runner/dist/parity.js +927 -0
  434. package/node_modules/@loopwright/taskpack-runner/dist/python-bridge.d.ts +68 -0
  435. package/node_modules/@loopwright/taskpack-runner/dist/python-bridge.js +517 -0
  436. package/node_modules/@loopwright/taskpack-runner/dist/service.d.ts +149 -0
  437. package/node_modules/@loopwright/taskpack-runner/dist/service.js +1796 -0
  438. package/node_modules/@loopwright/taskpack-runner/dist/types.d.ts +29 -0
  439. package/node_modules/@loopwright/taskpack-runner/dist/types.js +11 -0
  440. package/node_modules/@loopwright/taskpack-runner/package.json +12 -0
  441. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/README.md +77 -0
  442. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/docs/support-records.md +57 -0
  443. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/docs/supported-runners.md +98 -0
  444. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/manifest.json +205 -0
  445. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/pack/expand_matrix.sh +273 -0
  446. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/pack/matrix.yaml +280 -0
  447. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/pack/resolve_dockerfile.sh +24 -0
  448. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/pyproject.toml +46 -0
  449. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/runtime_runner/runner.py.json +5270 -0
  450. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/fixtures/discovery/legacy-support.md +86 -0
  451. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/fixtures/github/service.py +401 -0
  452. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/fixtures/proposals/analysis.json +95 -0
  453. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/fixtures/proposals/ready.json +109 -0
  454. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/test_assemble.py +263 -0
  455. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/test_check_draft.py +333 -0
  456. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/test_checks.py +1099 -0
  457. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/test_discovery.py +817 -0
  458. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/test_proposal.py +658 -0
  459. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/test_publish.py +987 -0
  460. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tests/auto_sync/test_summary.py +107 -0
  461. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/agent.py +610 -0
  462. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/assemble.py +84 -0
  463. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/check_draft.py +94 -0
  464. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/checks.py +1002 -0
  465. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/discovery.py +789 -0
  466. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/model.py +557 -0
  467. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/progress.py +174 -0
  468. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/prompts/analysis.md +40 -0
  469. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/prompts/proposal.md +65 -0
  470. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/prompts/repair.md +17 -0
  471. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/proposal.py +903 -0
  472. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/publish.py +997 -0
  473. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/summary.py +131 -0
  474. package/node_modules/@loopwright/taskpack-runner/vendor/runner-auto-sync/tools/auto_sync/tool-versions.json +133 -0
  475. package/node_modules/package-lock.json +3021 -0
  476. package/package-lock.json +3021 -0
  477. package/package.json +52 -4
@@ -0,0 +1,1099 @@
1
+ """Checks use frozen trusted code and never execute candidate configuration."""
2
+
3
+ import copy
4
+ import difflib
5
+ import hashlib
6
+ import json
7
+ import os
8
+ import subprocess
9
+ import sys
10
+ from pathlib import Path
11
+
12
+ import pytest
13
+
14
+ sys.path.insert(0, str(Path(__file__).resolve().parents[2]))
15
+ from tools.auto_sync.checks import report_digest, validate_candidate, verify_artifact
16
+ from tools.auto_sync.discovery import promote_support
17
+ from tools.auto_sync.proposal import ProposalError
18
+
19
+ FIXTURE = Path(__file__).parent / "fixtures/proposals/ready.json"
20
+ SUPPORT = "docs/support-records.md"
21
+ SUPPORT_START = "<!-- runner-support-records:start -->\n| Backend | Runtime | Service | Variant | Engine | Plugin | Platforms | Status |\n| --- | --- | --- | --- | --- | --- | --- | --- |\n"
22
+ SUPPORT_END = "<!-- runner-support-records:end -->\n"
23
+ CANN_SGLANG_RECIPE = (
24
+ "ARG SGLANG_VERSION=0.5.20\n"
25
+ "ARG CANN_VERSION=9.0.0\n"
26
+ "ARG CANN_ARCHS=a3\n"
27
+ "ARG SGLANG_BASE_IMAGE=example.invalid/sglang:v${SGLANG_VERSION}-${CANN_ARCHS}\n"
28
+ "ARG PYTHON_VERSION=3.12\n"
29
+ "FROM ${SGLANG_BASE_IMAGE} AS sglang\n"
30
+ )
31
+ CANN_SGLANG_MATRIX = (
32
+ "rules:\n"
33
+ " - backend: cann\n"
34
+ " services: [sglang]\n"
35
+ " platforms: [linux/amd64]\n"
36
+ " args: [CANN_VERSION=9.0.0, CANN_ARCHS=a3, SGLANG_VERSION=0.5.20]\n"
37
+ " - backend: cann\n"
38
+ " services: [sglang]\n"
39
+ " platforms: [linux/amd64]\n"
40
+ " args: [CANN_VERSION=9.0.0, CANN_ARCHS=910b, SGLANG_VERSION=0.5.20]\n"
41
+ )
42
+ CANN_SGLANG_SUPPORT = (
43
+ "| cann | 9.0 | sglang | a3 | 0.5.20 | - | linux/amd64 | published |\n"
44
+ "| cann | 9.0 | sglang | 910b | 0.5.20 | - | linux/amd64 | published |\n"
45
+ )
46
+ CANN_SGLANG_RETIRED = (
47
+ " - backend: cann\n"
48
+ " services: [sglang]\n"
49
+ " platforms: [linux/amd64]\n"
50
+ " args: [CANN_VERSION=9.0.0, CANN_ARCHS=910b, SGLANG_VERSION=0.5.20]\n"
51
+ )
52
+
53
+
54
+ def support_row(engine="0.30.0", platforms="linux/amd64"):
55
+ return f"| cuda | 13.0 | vllm | - | {engine} | - | {platforms} | prepared |\n"
56
+
57
+
58
+ def git(repo, *args):
59
+ return subprocess.run( # noqa: S603 - local fixture repositories only.
60
+ ["git", "-c", "core.hooksPath=/dev/null", "-C", str(repo), *args], # noqa: S607 - local fixture repositories only.
61
+ check=True,
62
+ capture_output=True,
63
+ text=True,
64
+ ).stdout.strip()
65
+
66
+
67
+ @pytest.fixture
68
+ def candidate(tmp_path):
69
+ repo = tmp_path / "repo"
70
+ repo.mkdir()
71
+ git(repo, "init", "-q")
72
+ git(repo, "config", "user.name", "Fixture")
73
+ git(repo, "config", "user.email", "fixture@example.invalid")
74
+ (repo / "pack/cuda").mkdir(parents=True)
75
+ (repo / "pack/cuda/Dockerfile.vllm").write_text(
76
+ "ARG VLLM_VERSION=0.29.0\nARG CUDA_VERSION=13.0.1\nARG VLLM_BASE_IMAGE=vllm/vllm-openai:v${VLLM_VERSION}\nARG PYTHON_VERSION=3.12\nARG VLLM_LMCACHE_VERSION=0.5.4\nFROM ${VLLM_BASE_IMAGE} AS vllm\n",
77
+ )
78
+ (repo / "pack/matrix.yaml").write_text(
79
+ "rules:\n - backend: cuda\n services: [vllm]\n platforms: [linux/amd64]\n args: [VLLM_VERSION=0.29.0]\n",
80
+ )
81
+ (repo / "README.md").write_text(
82
+ "# Runner\n[Supported runners](docs/supported-runners.md)\n",
83
+ )
84
+ (repo / "docs").mkdir()
85
+ (repo / SUPPORT).write_text(SUPPORT_START + support_row("0.29.0") + SUPPORT_END)
86
+ (repo / "runtime_runner").mkdir()
87
+ (repo / "runtime_runner/runner.py.json").write_text("[]\n")
88
+ git(repo, "add", ".")
89
+ git(repo, "commit", "-qm", "fixture")
90
+ proposal = json.loads(FIXTURE.read_text())
91
+ sha = git(repo, "rev-parse", "HEAD")
92
+ proposal["identity"].update(default_sha=sha, head_sha=sha)
93
+ return repo, proposal
94
+
95
+
96
+ def diff(path, old, new):
97
+ return f"diff --git a/{path} b/{path}\n" + "".join(
98
+ difflib.unified_diff(
99
+ old.splitlines(keepends=True),
100
+ new.splitlines(keepends=True),
101
+ fromfile="a/" + path,
102
+ tofile="b/" + path,
103
+ ),
104
+ )
105
+
106
+
107
+ def validate(candidate, **kwargs):
108
+ repo, proposal = candidate
109
+ return validate_candidate(repo, proposal, proposal["identity"], **kwargs)
110
+
111
+
112
+ def test_clean_validation_binds_patch_report_and_leaves_input_untouched(candidate):
113
+ repo, proposal = candidate
114
+ before = copy.deepcopy(proposal)
115
+ result = validate(candidate)
116
+ assert result["groups"][0]["status"] == "ready"
117
+ assert result["patch"] == proposal["groups"][0]["patch"]
118
+ assert len(result["patch_digest"]) == 64
119
+ assert len(result["report_digest"]) == 64
120
+ assert result["identity"] == proposal["identity"]
121
+ assert proposal == before
122
+ assert git(repo, "status", "--porcelain") == ""
123
+ assert "0.29.0" in (repo / "pack/cuda/Dockerfile.vllm").read_text()
124
+
125
+
126
+ def test_support_promotes_using_the_actual_pack_runtime_line(candidate, tmp_path):
127
+ repo, _ = candidate
128
+ checked = validate(candidate)
129
+ assert checked["patch"]
130
+ subprocess.run( # noqa: S603 - validated patch in a disposable fixture.
131
+ ["git", "-C", str(repo), "apply", "-"], # noqa: S607
132
+ input=checked["patch"],
133
+ text=True,
134
+ check=True,
135
+ capture_output=True,
136
+ )
137
+ output = tmp_path / "expanded"
138
+ subprocess.run( # noqa: S603 - trusted Pack expansion with fixed fixture data.
139
+ ["bash", str(Path(__file__).resolve().parents[2] / "pack/expand_matrix.sh")], # noqa: S607
140
+ env={
141
+ **os.environ,
142
+ "INPUT_BACKEND": "cuda",
143
+ "INPUT_TARGET": "vllm",
144
+ "INPUT_FOR_RELEASE": "true",
145
+ "INPUT_ARGS": "",
146
+ "INPUT_POST_OPERATION": "",
147
+ "INPUT_WORKSPACE": str(repo / "pack"),
148
+ "INPUT_TEMPDIR": str(tmp_path),
149
+ "GITHUB_OUTPUT": str(output),
150
+ },
151
+ check=True,
152
+ capture_output=True,
153
+ text=True,
154
+ )
155
+ expanded = dict(line.split("=", 1) for line in output.read_text().splitlines())
156
+ jobs = json.loads(expanded["build_jobs"])
157
+ assert jobs[0]["backend_version"] == "13.0"
158
+ assert jobs[0]["original_backend_version"] == "13.0.1"
159
+ support = (repo / SUPPORT).read_text()
160
+ measured = {jobs[0]["platform_tag"]: {"vllm": "0.30.0"}}
161
+ assert "0.30.0 | - | linux/amd64 | published" in promote_support(
162
+ support,
163
+ jobs,
164
+ measured,
165
+ )
166
+ assert promote_support(support, jobs, {}) == support
167
+
168
+
169
+ def test_new_support_record_rejects_a_full_runtime_patch_version(candidate):
170
+ group = candidate[1]["groups"][0]
171
+ group["patch"] = group["patch"].replace(
172
+ "+| cuda | 13.0 |",
173
+ "+| cuda | 13.0.1 |",
174
+ )
175
+ result = validate(candidate)
176
+ assert result["groups"][0]["status"] == "failed"
177
+ assert "runtime line" in result["groups"][0]["validation"]["error"]
178
+
179
+
180
+ def mooncake(candidate, entries):
181
+ """Pin mooncake in the fixture recipe and declare the given package choices."""
182
+ repo, proposal = candidate
183
+ dockerfile = repo / "pack/cuda/Dockerfile.vllm"
184
+ dockerfile.write_text(
185
+ dockerfile.read_text().replace(
186
+ "FROM ${VLLM_BASE_IMAGE} AS vllm\n",
187
+ "ARG VLLM_MOONCAKE_VERSION=0.3.13.post1\nFROM ${VLLM_BASE_IMAGE} AS vllm\n",
188
+ ),
189
+ )
190
+ git(repo, "add", ".")
191
+ git(repo, "commit", "-qm", "mooncake pin")
192
+ sha = git(repo, "rev-parse", "HEAD")
193
+ proposal["identity"].update(default_sha=sha, head_sha=sha)
194
+ for name, choice_version in entries:
195
+ proposal["groups"][0]["rows"][0]["packages"].append(
196
+ {
197
+ "name": name,
198
+ "version": choice_version,
199
+ "decision": "retain",
200
+ "reason": "Keep the mooncake pin.",
201
+ "sources": ["https://github.com/mooncake-project/mooncake"],
202
+ },
203
+ )
204
+ return candidate
205
+
206
+
207
+ def test_additional_package_distribution_name_matches_the_canonical_pin(candidate):
208
+ # The production failure: the ROCm recipe pins mooncake through the
209
+ # mooncake-transfer-engine-rocm distribution, which the model declared
210
+ # instead of the canonical mooncake choice key.
211
+ checked = validate(
212
+ mooncake(candidate, [("mooncake-transfer-engine-rocm", "0.3.13.post1")]),
213
+ )
214
+ assert checked["groups"][0]["status"] == "ready"
215
+
216
+
217
+ def test_additional_package_distribution_name_requires_the_exact_pin(candidate):
218
+ result = validate(
219
+ mooncake(candidate, [("mooncake-transfer-engine-rocm", "0.3.12")]),
220
+ )
221
+ assert result["groups"][0]["status"] == "failed"
222
+ assert (
223
+ "differs from the effective recipe pin"
224
+ in (result["groups"][0]["validation"]["error"])
225
+ )
226
+
227
+
228
+ def test_additional_package_alias_collision_is_rejected(candidate):
229
+ result = validate(
230
+ mooncake(
231
+ candidate,
232
+ [
233
+ ("mooncake", "0.3.13.post1"),
234
+ ("mooncake-transfer-engine-rocm", "0.3.13.post1"),
235
+ ],
236
+ ),
237
+ )
238
+ assert result["groups"][0]["status"] == "failed"
239
+ assert (
240
+ "duplicate additional packages" in (result["groups"][0]["validation"]["error"])
241
+ )
242
+
243
+
244
+ @pytest.mark.parametrize(
245
+ "path",
246
+ [
247
+ ".github/workflows/pack.yml",
248
+ "AGENTS.md",
249
+ ".qwen/settings.json",
250
+ ".env",
251
+ "tools/auto_sync/checks.py",
252
+ "runtime_runner/runner.py.json",
253
+ "pack/dependencies.json",
254
+ "pack/dtk/Dockerfile.vllm",
255
+ "pack/cuda/Dockerfile.sglang",
256
+ "../escape",
257
+ "/absolute/escape",
258
+ ],
259
+ )
260
+ def test_policy_generated_metadata_and_unselected_paths_rejected(candidate, path):
261
+ candidate[1]["groups"][0]["patch"] = diff(path, "old\n", "new\n")
262
+ with pytest.raises(ProposalError, match="path"):
263
+ validate(candidate)
264
+
265
+
266
+ @pytest.mark.parametrize("mode", ["120000", "100755"])
267
+ def test_candidate_symlink_and_executable_modes_rejected(candidate, mode):
268
+ group = candidate[1]["groups"][0]
269
+ group["patch"] = (
270
+ f"diff --git a/README.md b/README.md\nold mode 100644\nnew mode {mode}\n"
271
+ )
272
+ with pytest.raises(ProposalError, match="mode"):
273
+ validate(candidate)
274
+
275
+
276
+ def test_base_symlink_escape_is_rejected_without_touching_target(candidate, tmp_path):
277
+ repo, proposal = candidate
278
+ target = tmp_path / "outside"
279
+ target.write_text("protected\n")
280
+ recipe = repo / "pack/cuda/Dockerfile.vllm"
281
+ recipe.unlink()
282
+ recipe.symlink_to(target)
283
+ git(repo, "add", ".")
284
+ git(repo, "commit", "-qm", "symlink")
285
+ sha = git(repo, "rev-parse", "HEAD")
286
+ proposal["identity"].update(default_sha=sha, head_sha=sha)
287
+ result = validate(candidate)
288
+ assert result["groups"][0]["status"] == "failed"
289
+ assert "symlink" in result["groups"][0]["validation"]["error"]
290
+ assert result["patch"] == ""
291
+ assert target.read_text() == "protected\n"
292
+
293
+
294
+ @pytest.mark.parametrize(
295
+ "argument",
296
+ [
297
+ "VLLM_VERSION=$(touch SENTINEL)",
298
+ "VLLM_VERSION=0.30.0;touch SENTINEL",
299
+ "VLLM_VERSION=`touch SENTINEL`",
300
+ "VLLM_VERSION=${TOKEN}",
301
+ "VLLM_VERSION=0.30.0\nexport X=1",
302
+ ],
303
+ )
304
+ def test_matrix_injection_fails_without_execution(candidate, argument):
305
+ repo, proposal = candidate
306
+ old = (repo / "pack/matrix.yaml").read_text()
307
+ new = (
308
+ json.dumps(
309
+ {"rules": [{"backend": "cuda", "services": ["vllm"], "args": [argument]}]},
310
+ )
311
+ + "\n"
312
+ )
313
+ proposal["groups"][0]["patch"] = diff("pack/matrix.yaml", old, new)
314
+ result = validate(candidate)
315
+ assert result["groups"][0]["status"] == "failed"
316
+ assert result["patch"] == ""
317
+ assert "matrix" in result["groups"][0]["validation"]["error"]
318
+ assert not (repo / "SENTINEL").exists()
319
+
320
+
321
+ def test_candidate_hook_settings_and_tests_are_never_run(candidate, tmp_path):
322
+ repo, _ = candidate
323
+ sentinel = tmp_path / "executed"
324
+ hook = repo / ".git/hooks/post-checkout"
325
+ hook.write_text(f"#!/bin/sh\ntouch '{sentinel}'\n")
326
+ hook.chmod(0o755)
327
+ (repo / ".qwen").mkdir()
328
+ (repo / ".qwen/settings.json").write_text(
329
+ '{"hooks":{"PreToolUse":"touch executed"}}',
330
+ )
331
+ (repo / "tests").mkdir()
332
+ (repo / "tests/conftest.py").write_text(
333
+ f"from pathlib import Path\nPath({str(sentinel)!r}).touch()\n",
334
+ )
335
+ git(repo, "add", ".")
336
+ git(repo, "commit", "-qm", "candidate settings")
337
+ sha = git(repo, "rev-parse", "HEAD")
338
+ candidate[1]["identity"].update(default_sha=sha, head_sha=sha)
339
+ assert validate(candidate)["groups"][0]["status"] == "ready"
340
+ assert not sentinel.exists()
341
+
342
+
343
+ def test_check_processes_do_not_receive_credentials(candidate, monkeypatch):
344
+ monkeypatch.setenv("AUTO_SYNC_MODEL_TOKEN", "fake-model-secret")
345
+ monkeypatch.setenv("GH_TOKEN", "fake-write-secret")
346
+ monkeypatch.setenv("GITHUB_TOKEN", "fake-write-secret")
347
+ original = subprocess.run
348
+ environments = []
349
+
350
+ def observe(*args, **kwargs):
351
+ environments.append(kwargs["env"])
352
+ assert kwargs.get("shell", False) is False
353
+ return original(*args, **kwargs)
354
+
355
+ monkeypatch.setattr(subprocess, "run", observe)
356
+ validate(candidate)
357
+ assert environments
358
+ assert all("fake-" not in json.dumps(env) for env in environments)
359
+
360
+
361
+ def test_wrong_source_sha_fails_before_changes(candidate):
362
+ candidate[1]["identity"]["head_sha"] = "d" * 40
363
+ with pytest.raises(ProposalError, match="revision"):
364
+ validate(candidate)
365
+
366
+
367
+ def test_failed_group_keeps_report_independent_ready_group_survives(candidate):
368
+ _, proposal = candidate
369
+ blocked = copy.deepcopy(proposal["groups"][0])
370
+ blocked.update(
371
+ id="blocked",
372
+ status="blocked",
373
+ reason="Missing upstream compatibility",
374
+ report="Keep this blocker visible.",
375
+ patch="",
376
+ )
377
+ proposal["groups"].append(blocked)
378
+ proposal["candidates"][0]["groups"].append("blocked")
379
+ result = validate(candidate)
380
+ assert [g["status"] for g in result["groups"]] == ["ready", "blocked"]
381
+ assert result["groups"][1]["report"] == "Keep this blocker visible."
382
+ assert result["patch"] == proposal["groups"][0]["patch"]
383
+
384
+
385
+ def test_patch_context_failure_is_reported_not_published(candidate):
386
+ candidate[1]["groups"][0]["patch"] = candidate[1]["groups"][0]["patch"].replace(
387
+ "0.29.0",
388
+ "9.99.0",
389
+ )
390
+ result = validate(candidate)
391
+ assert result["groups"][0]["status"] == "failed"
392
+ assert result["patch"] == ""
393
+ assert result["candidates"][0]["status"] == "failed"
394
+
395
+
396
+ @pytest.mark.parametrize(
397
+ "field,value",
398
+ [
399
+ ("engine_version", "0.31.0"),
400
+ ("runtime", "12.9.1"),
401
+ ("base_image", "vllm/vllm-openai:invented"),
402
+ ("platform", "linux/arm64"),
403
+ ("python", "3.11"),
404
+ ],
405
+ )
406
+ def test_ready_report_must_match_proposed_matrix_and_recipe(candidate, field, value):
407
+ row = candidate[1]["groups"][0]["rows"][0]
408
+ row[field] = value
409
+ if field == "platform":
410
+ row["manifest"].update(platform=value, config_platform=value)
411
+ result = validate(candidate)
412
+ assert result["groups"][0]["status"] == "failed"
413
+ assert result["patch"] == ""
414
+
415
+
416
+ def test_matrix_override_cannot_hide_an_old_engine_pin(candidate):
417
+ group = candidate[1]["groups"][0]
418
+ group["patch"] = group["patch"].split("diff --git a/pack/matrix.yaml")[0]
419
+ result = validate(candidate)
420
+ assert result["groups"][0]["status"] == "failed"
421
+
422
+
423
+ def test_additional_package_pin_must_match_recipe(candidate):
424
+ candidate[1]["groups"][0]["rows"][0]["packages"][0]["version"] = "0.9.9"
425
+ result = validate(candidate)
426
+ assert result["groups"][0]["status"] == "failed"
427
+
428
+
429
+ def test_two_ready_groups_are_applied_and_reported(candidate):
430
+ repo, proposal = candidate
431
+ second = copy.deepcopy(proposal["groups"][0])
432
+ second.update(
433
+ id="docs",
434
+ patch=diff(
435
+ "README.md",
436
+ (repo / "README.md").read_text(),
437
+ (repo / "README.md").read_text() + "Prepared update.\n",
438
+ ),
439
+ )
440
+ proposal["groups"].append(second)
441
+ proposal["candidates"][0]["groups"].append("docs")
442
+ result = validate(candidate)
443
+ assert [g["status"] for g in result["groups"]] == ["ready", "ready"]
444
+ assert "Prepared update." in result["patch"]
445
+
446
+
447
+ def test_rejected_dependency_keeps_dependent_patch_out(candidate):
448
+ _, proposal = candidate
449
+ prerequisite = copy.deepcopy(proposal["groups"][0])
450
+ prerequisite.update(
451
+ id="prerequisite",
452
+ status="blocked",
453
+ patch="",
454
+ report="Missing upstream source.",
455
+ )
456
+ proposal["groups"].insert(0, prerequisite)
457
+ proposal["groups"][1]["depends_on"] = ["prerequisite"]
458
+ proposal["candidates"][0]["groups"].append("prerequisite")
459
+ result = validate(candidate)
460
+ assert [g["status"] for g in result["groups"]] == ["blocked", "blocked"]
461
+ assert result["patch"] == ""
462
+
463
+
464
+ def test_support_cannot_claim_a_prepared_image_is_published(candidate):
465
+ repo, proposal = candidate
466
+ text = (repo / SUPPORT).read_text()
467
+ new = text.replace(
468
+ "<!-- runner-support-records:end -->",
469
+ "| cuda | 13.0 | vllm | - | 0.30.0 | - | linux/amd64 | published |\n<!-- runner-support-records:end -->",
470
+ )
471
+ proposal["groups"][0]["patch"] = proposal["groups"][0]["patch"].split(
472
+ "diff --git a/docs/",
473
+ )[0] + diff(SUPPORT, text, new)
474
+ result = validate(candidate)
475
+ assert result["groups"][0]["status"] == "failed"
476
+ assert "published" in result["groups"][0]["validation"]["error"]
477
+
478
+
479
+ def test_source_patch_application_uses_exact_revision(candidate, tmp_path):
480
+ repo, proposal = candidate
481
+ source = tmp_path / "upstream"
482
+ source.mkdir()
483
+ git(source, "init", "-q")
484
+ git(source, "config", "user.name", "Fixture")
485
+ git(source, "config", "user.email", "fixture@example.invalid")
486
+ (source / "engine.py").write_text("value = 1\n")
487
+ git(source, "add", ".")
488
+ git(source, "commit", "-qm", "source")
489
+ revision = git(source, "rev-parse", "HEAD")
490
+ patch_path = "pack/cuda/patches/vllm/fix.patch"
491
+ patch_text = diff("engine.py", "value = 1\n", "value = 2\n")
492
+ target = repo / patch_path
493
+ target.parent.mkdir(parents=True)
494
+ target.write_text(patch_text)
495
+ git(repo, "add", ".")
496
+ git(repo, "commit", "-qm", "patch")
497
+ sha = git(repo, "rev-parse", "HEAD")
498
+ proposal["identity"].update(default_sha=sha, head_sha=sha)
499
+ proposal["groups"][0]["rows"][0]["patches"] = [
500
+ {
501
+ "path": patch_path,
502
+ "disposition": "retain",
503
+ "reason": "Existing fix",
504
+ "versions": ["0.30.0"],
505
+ "platforms": ["linux/amd64"],
506
+ "sources": ["https://github.com/vllm-project/vllm/issues/1"],
507
+ "source_repository": "vllm-project/vllm",
508
+ "source_revision": revision,
509
+ },
510
+ ]
511
+ result = validate(candidate, sources={"vllm-project/vllm": source})
512
+ assert result["groups"][0]["validation"]["patches"][0]["status"] == "passed"
513
+ # Available HEAD differs; the declared revision must still govern the check.
514
+ (source / "engine.py").write_text("value = 100\n")
515
+ git(source, "add", ".")
516
+ git(source, "commit", "-qm", "new source")
517
+ assert (
518
+ validate(candidate, sources={"vllm-project/vllm": source})["groups"][0][
519
+ "status"
520
+ ]
521
+ == "ready"
522
+ )
523
+ target.write_text(patch_text.replace("value = 1", "value = 77"))
524
+ git(repo, "add", ".")
525
+ git(repo, "commit", "-qm", "bad patch")
526
+ sha = git(repo, "rev-parse", "HEAD")
527
+ proposal["identity"].update(default_sha=sha, head_sha=sha)
528
+ assert (
529
+ validate(candidate, sources={"vllm-project/vllm": source})["groups"][0][
530
+ "status"
531
+ ]
532
+ == "failed"
533
+ )
534
+ assert "value = 100" in (source / "engine.py").read_text()
535
+ result = validate(candidate)
536
+ assert result["groups"][0]["validation"]["patches"][0]["status"] == "unverified"
537
+
538
+
539
+ def test_verified_artifact_can_be_rechecked_on_a_clean_publication_runner(candidate):
540
+ result = validate(candidate)
541
+ raw = verify_artifact(result, candidate[1]["identity"])
542
+ assert raw == candidate[1]
543
+ rechecked = validate_candidate(candidate[0], raw, raw["identity"])
544
+ assert rechecked == result
545
+
546
+
547
+ @pytest.mark.parametrize(
548
+ "change",
549
+ ["patch", "report", "status", "identity", "digest", "rehashed_extra_patch"],
550
+ )
551
+ def test_publication_rejects_tampered_artifact(candidate, change):
552
+ result = validate(candidate)
553
+ if change == "patch":
554
+ result["patch"] += "fabricated"
555
+ elif change == "report":
556
+ result["groups"][0]["report"] += "fabricated"
557
+ elif change == "status":
558
+ result["groups"][0]["status"] = "unchanged"
559
+ elif change == "identity":
560
+ result["identity"]["head_sha"] = "d" * 40
561
+ elif change == "digest":
562
+ result["patch_digest"] = "d" * 64
563
+ else:
564
+ result["patch"] += diff("AGENTS.md", "old\n", "new\n")
565
+ result["patch_digest"] = hashlib.sha256(result["patch"].encode()).hexdigest()
566
+ result["report_digest"] = report_digest(result)
567
+ with pytest.raises(ProposalError):
568
+ verify_artifact(result, candidate[1]["identity"])
569
+
570
+
571
+ def test_each_selected_platform_requires_distinct_manifest_evidence(candidate):
572
+ repo, proposal = candidate
573
+ old = (repo / "pack/matrix.yaml").read_text()
574
+ new = old.replace("0.29.0", "0.30.0").replace(
575
+ "[linux/amd64]",
576
+ "[linux/amd64, linux/arm64]",
577
+ )
578
+ group = proposal["groups"][0]
579
+ group["patch"] = group["patch"].split("diff --git a/pack/matrix.yaml")[0] + diff(
580
+ "pack/matrix.yaml",
581
+ old,
582
+ new,
583
+ )
584
+ assert validate(candidate)["groups"][0]["status"] == "failed"
585
+ arm64 = copy.deepcopy(group["rows"][0])
586
+ arm64.update(platform="linux/arm64", old_engine_version=None)
587
+ arm64["manifest"].update(
588
+ platform="linux/arm64",
589
+ config_platform="linux/arm64",
590
+ platform_digest="sha256:" + "d" * 64,
591
+ )
592
+ group["rows"].append(arm64)
593
+ group["patch"] += diff(
594
+ SUPPORT,
595
+ (repo / SUPPORT).read_text(),
596
+ SUPPORT_START
597
+ + support_row("0.29.0")
598
+ + support_row(platforms="linux/amd64, linux/arm64")
599
+ + SUPPORT_END,
600
+ )
601
+ result = validate(candidate)
602
+ assert result["groups"][0]["status"] == "ready"
603
+ assert len(result["groups"][0]["rows"]) == 2
604
+ assert (
605
+ verify_artifact(result, proposal["identity"])["groups"][0]["rows"]
606
+ == group["rows"]
607
+ )
608
+
609
+
610
+ def test_dependency_order_is_preserved_in_publication_patch(candidate):
611
+ repo, proposal = candidate
612
+ prerequisite = copy.deepcopy(proposal["groups"][0])
613
+ prerequisite.update(
614
+ id="docs",
615
+ patch=diff(
616
+ "README.md",
617
+ (repo / "README.md").read_text(),
618
+ (repo / "README.md").read_text() + "Evidence.\n",
619
+ ),
620
+ )
621
+ prerequisite["rows"][0].update(
622
+ engine_version="0.29.0",
623
+ base_image="vllm/vllm-openai:v0.29.0",
624
+ )
625
+ proposal["groups"][0]["depends_on"] = ["docs"]
626
+ proposal["groups"].append(prerequisite)
627
+ proposal["candidates"][0]["groups"].append("docs")
628
+ result = validate(candidate)
629
+ assert all(g["status"] == "ready" for g in result["groups"])
630
+ raw = verify_artifact(result, proposal["identity"])
631
+ assert validate_candidate(repo, raw, raw["identity"])["patch"] == result["patch"]
632
+
633
+
634
+ def replace_patch(group, path, old, new):
635
+ blocks = [
636
+ "diff --git " + block for block in group["patch"].split("diff --git ")[1:]
637
+ ]
638
+ group["patch"] = "".join(
639
+ block for block in blocks if not block.startswith(f"diff --git a/{path} ")
640
+ )
641
+ if old != new:
642
+ group["patch"] += diff(path, old, new)
643
+
644
+
645
+ @pytest.fixture
646
+ def retirement(tmp_path):
647
+ """Two published CANN SGLang variants sharing one recipe."""
648
+ repo = tmp_path / "repo"
649
+ repo.mkdir()
650
+ git(repo, "init", "-q")
651
+ git(repo, "config", "user.name", "Fixture")
652
+ git(repo, "config", "user.email", "fixture@example.invalid")
653
+ (repo / "pack/cann").mkdir(parents=True)
654
+ (repo / "pack/cann/Dockerfile.sglang").write_text(CANN_SGLANG_RECIPE)
655
+ (repo / "pack/matrix.yaml").write_text(CANN_SGLANG_MATRIX)
656
+ (repo / "README.md").write_text(
657
+ "# Runner\n[Supported runners](docs/supported-runners.md)\n",
658
+ )
659
+ (repo / "docs").mkdir()
660
+ (repo / SUPPORT).write_text(SUPPORT_START + CANN_SGLANG_SUPPORT + SUPPORT_END)
661
+ (repo / "runtime_runner").mkdir()
662
+ (repo / "runtime_runner/runner.py.json").write_text("[]\n")
663
+ git(repo, "add", ".")
664
+ git(repo, "commit", "-qm", "fixture")
665
+ return repo, git(repo, "rev-parse", "HEAD")
666
+
667
+
668
+ def cann_sglang_proposal(sha, patch):
669
+ """Proposal advancing the a3 variant of the shared CANN SGLang recipe."""
670
+ row = {
671
+ "backend": "cann",
672
+ "service": "sglang",
673
+ "variant": "a3",
674
+ "runtime": "9.0.0",
675
+ "old_engine_version": "0.5.20",
676
+ "engine_version": "0.5.22",
677
+ "plugin_version": None,
678
+ "platform": "linux/amd64",
679
+ "base_image": "example.invalid/sglang:v0.5.22-a3",
680
+ "manifest": {
681
+ "digest": "sha256:" + "b" * 64,
682
+ "platform_digest": "sha256:" + "c" * 64,
683
+ "platform": "linux/amd64",
684
+ "config_platform": "linux/amd64",
685
+ "sources": [
686
+ "https://github.com/sgl-project/sglang/releases/tag/v0.5.22",
687
+ ],
688
+ },
689
+ "python": "3.12",
690
+ "torch": None,
691
+ "packages": [],
692
+ "patches": [],
693
+ "conclusion": "inference",
694
+ "sources": ["https://github.com/sgl-project/sglang/releases/tag/v0.5.22"],
695
+ "checks": ["Validate the source diff without executing it."],
696
+ "deferred": ["Pack image builds", "GPU inference"],
697
+ }
698
+ return {
699
+ "schema_version": 1,
700
+ "identity": {
701
+ "repository": "example-org/runtime-runner",
702
+ "default_sha": sha,
703
+ "head_sha": sha,
704
+ "mode": "discover",
705
+ "pr_number": None,
706
+ "command_id": None,
707
+ "command_digest": None,
708
+ },
709
+ "candidates": [
710
+ {
711
+ "subscription": name,
712
+ "status": status,
713
+ "groups": groups,
714
+ "reason": reason,
715
+ }
716
+ for name, status, groups, reason in (
717
+ ("cuda/vllm", "unchanged", [], "Already represented."),
718
+ ("cuda/sglang", "unchanged", [], "Already represented."),
719
+ ("rocm/vllm", "unchanged", [], "Already represented."),
720
+ ("rocm/sglang", "unchanged", [], "Already represented."),
721
+ ("cann/vllm", "unchanged", [], "Already represented."),
722
+ (
723
+ "cann/sglang",
724
+ "ready",
725
+ ["cann-sglang"],
726
+ "Advance the surviving variant.",
727
+ ),
728
+ )
729
+ ],
730
+ "groups": [
731
+ {
732
+ "id": "cann-sglang",
733
+ "status": "ready",
734
+ "reason": "Advance a3 and retire 910b.",
735
+ "depends_on": [],
736
+ "report": "Advance the surviving CANN SGLang variant to 0.5.22.",
737
+ "patch": patch,
738
+ "rows": [row],
739
+ },
740
+ ],
741
+ }
742
+
743
+
744
+ def retirement_patch(repo, *, retire=True, drop_published=False):
745
+ """Advance the shared recipe and the a3 pin; optionally retire 910b."""
746
+ recipe = repo / "pack/cann/Dockerfile.sglang"
747
+ old_recipe = recipe.read_text()
748
+ new_recipe = old_recipe.replace(
749
+ "ARG SGLANG_VERSION=0.5.20",
750
+ "ARG SGLANG_VERSION=0.5.22",
751
+ )
752
+ matrix = repo / "pack/matrix.yaml"
753
+ old_matrix = matrix.read_text()
754
+ new_matrix = old_matrix.replace(
755
+ "CANN_ARCHS=a3, SGLANG_VERSION=0.5.20]",
756
+ "CANN_ARCHS=a3, SGLANG_VERSION=0.5.22]",
757
+ )
758
+ if retire:
759
+ new_matrix = new_matrix.replace(
760
+ CANN_SGLANG_RETIRED,
761
+ " ## Upstream publishes no 910b SGLang image for 0.5.22.\n",
762
+ )
763
+ support = repo / SUPPORT
764
+ old_support = support.read_text()
765
+ new_support = old_support.replace(
766
+ SUPPORT_END,
767
+ "| cann | 9.0 | sglang | a3 | 0.5.22 | - | linux/amd64 | prepared |\n"
768
+ + SUPPORT_END,
769
+ )
770
+ if drop_published:
771
+ new_support = new_support.replace(
772
+ "| cann | 9.0 | sglang | 910b | 0.5.20 | - | linux/amd64 | published |\n",
773
+ "",
774
+ )
775
+ return (
776
+ diff("pack/cann/Dockerfile.sglang", old_recipe, new_recipe)
777
+ + diff("pack/matrix.yaml", old_matrix, new_matrix)
778
+ + diff(SUPPORT, old_support, new_support)
779
+ )
780
+
781
+
782
+ def validate_retirement(repo, proposal):
783
+ return validate_candidate(repo, proposal, proposal["identity"])
784
+
785
+
786
+ def test_variant_retirement_in_advancing_group_validates_as_ready(retirement):
787
+ repo, sha = retirement
788
+ proposal = cann_sglang_proposal(sha, retirement_patch(repo))
789
+ result = validate_retirement(repo, proposal)
790
+ assert result["groups"][0]["status"] == "ready"
791
+
792
+
793
+ def test_holding_variant_on_changed_shared_recipe_fails_naming_combination(retirement):
794
+ repo, sha = retirement
795
+ proposal = cann_sglang_proposal(sha, retirement_patch(repo, retire=False))
796
+ result = validate_retirement(repo, proposal)
797
+ group = result["groups"][0]
798
+ assert group["status"] == "failed"
799
+ assert "910b" in group["validation"]["error"]
800
+ assert "retire" in group["validation"]["error"]
801
+
802
+
803
+ def test_retiring_variant_cannot_remove_published_support_row(retirement):
804
+ repo, sha = retirement
805
+ proposal = cann_sglang_proposal(
806
+ sha,
807
+ retirement_patch(repo, drop_published=True),
808
+ )
809
+ result = validate_retirement(repo, proposal)
810
+ group = result["groups"][0]
811
+ assert group["status"] == "failed"
812
+ assert (
813
+ "removes previously accepted support metadata" in group["validation"]["error"]
814
+ )
815
+
816
+
817
+ def freeze(candidate):
818
+ repo, proposal = candidate
819
+ git(repo, "add", ".")
820
+ git(repo, "commit", "-qm", "fixture configuration")
821
+ sha = git(repo, "rev-parse", "HEAD")
822
+ proposal["identity"].update(default_sha=sha, head_sha=sha)
823
+
824
+
825
+ def test_all_changed_runtimes_need_reported_evidence(candidate):
826
+ repo, proposal = candidate
827
+ matrix = repo / "pack/matrix.yaml"
828
+ old = (
829
+ matrix.read_text()
830
+ + " - backend: cuda\n services: [vllm]\n platforms: [linux/amd64]\n args: [VLLM_VERSION=0.29.0, CUDA_VERSION=12.9.1]\n"
831
+ )
832
+ matrix.write_text(old)
833
+ freeze(candidate)
834
+ group = proposal["groups"][0]
835
+ replace_patch(group, "pack/matrix.yaml", old, old.replace("0.29.0", "0.30.0"))
836
+ assert validate(candidate)["groups"][0]["status"] == "failed"
837
+ other = copy.deepcopy(group["rows"][0])
838
+ other["runtime"] = "12.9.1"
839
+ group["rows"].append(other)
840
+ before = (repo / SUPPORT).read_text()
841
+ after = before.replace(
842
+ SUPPORT_END,
843
+ support_row() + support_row().replace("13.0", "12.9") + SUPPORT_END,
844
+ )
845
+ replace_patch(group, SUPPORT, before, after)
846
+ assert validate(candidate)["groups"][0]["status"] == "ready"
847
+
848
+
849
+ @pytest.mark.parametrize("change", ["from", "old_engine", "old_engine_new_runtime"])
850
+ def test_report_must_match_actual_image_and_baseline(candidate, change):
851
+ repo, proposal = candidate
852
+ group = proposal["groups"][0]
853
+ if change == "from":
854
+ path = "pack/cuda/Dockerfile.vllm"
855
+ old = (repo / path).read_text()
856
+ new = old.replace("VLLM_VERSION=0.29.0", "VLLM_VERSION=0.30.0").replace(
857
+ "FROM ${VLLM_BASE_IMAGE}",
858
+ "FROM example.invalid/wrong:1",
859
+ )
860
+ replace_patch(group, path, old, new)
861
+ else:
862
+ group["rows"][0]["old_engine_version"] = "8.88.0"
863
+ if change == "old_engine_new_runtime":
864
+ group["rows"][0]["runtime"] = "14.0.0"
865
+ old = (repo / "pack/matrix.yaml").read_text()
866
+ new = old.replace(
867
+ "VLLM_VERSION=0.29.0]",
868
+ "VLLM_VERSION=0.30.0, CUDA_VERSION=14.0.0]",
869
+ )
870
+ replace_patch(group, "pack/matrix.yaml", old, new)
871
+ old = (repo / SUPPORT).read_text()
872
+ replace_patch(
873
+ group,
874
+ SUPPORT,
875
+ old,
876
+ old.replace(
877
+ SUPPORT_END,
878
+ support_row().replace("13.0.1", "14.0.0") + SUPPORT_END,
879
+ ),
880
+ )
881
+ assert validate(candidate)["groups"][0]["status"] == "failed"
882
+
883
+
884
+ @pytest.mark.parametrize(
885
+ "change",
886
+ ["missing", "unrelated", "platform", "link", "remove_history"],
887
+ )
888
+ def test_prepared_records_match_the_proposed_configuration(candidate, change):
889
+ repo, proposal = candidate
890
+ group = proposal["groups"][0]
891
+ old = (repo / SUPPORT).read_text()
892
+ if change == "missing":
893
+ replace_patch(group, SUPPORT, old, old)
894
+ elif change == "link":
895
+ before = (repo / "README.md").read_text()
896
+ group["patch"] += diff("README.md", before, "# Runner\n")
897
+ else:
898
+ row = (
899
+ support_row("9.99.0")
900
+ if change == "unrelated"
901
+ else support_row(platforms="linux/amd64, linux/arm64")
902
+ if change == "platform"
903
+ else support_row()
904
+ )
905
+ new = (
906
+ SUPPORT_START
907
+ + ("" if change == "remove_history" else support_row("0.29.0"))
908
+ + row
909
+ + SUPPORT_END
910
+ )
911
+ replace_patch(group, SUPPORT, old, new)
912
+ assert validate(candidate)["groups"][0]["status"] == "failed"
913
+
914
+
915
+ def test_matrix_overrides_cannot_break_lmcache_protocol_alignment(candidate):
916
+ repo, proposal = candidate
917
+ for backend, service in [("cuda", "sglang"), ("rocm", "vllm"), ("rocm", "sglang")]:
918
+ path = repo / f"pack/{backend}/Dockerfile.{service}"
919
+ path.parent.mkdir(parents=True, exist_ok=True)
920
+ path.write_text(
921
+ f"ARG {service.upper()}_LMCACHE_VERSION=0.5.4\nFROM fixture AS {service}\n",
922
+ )
923
+ freeze(candidate)
924
+ old = (repo / "pack/matrix.yaml").read_text()
925
+ new = old.replace(
926
+ "VLLM_VERSION=0.29.0]",
927
+ "VLLM_VERSION=0.30.0, VLLM_LMCACHE_VERSION=0.5.5]",
928
+ )
929
+ group = proposal["groups"][0]
930
+ replace_patch(group, "pack/matrix.yaml", old, new)
931
+ group["rows"][0]["packages"][0].update(version="0.5.5", decision="update")
932
+ result = validate(candidate)
933
+ assert result["groups"][0]["status"] == "failed"
934
+ assert "LMCache" in result["groups"][0]["validation"]["error"]
935
+
936
+
937
+ @pytest.mark.parametrize("dependent", [False, True])
938
+ def test_source_patches_are_checked_in_recipe_order(candidate, tmp_path, dependent):
939
+ repo, proposal = candidate
940
+ source = tmp_path / "source"
941
+ source.mkdir()
942
+ git(source, "init", "-q")
943
+ git(source, "config", "user.name", "Fixture")
944
+ git(source, "config", "user.email", "fixture@example.invalid")
945
+ (source / "engine.py").write_text("value = 1\n")
946
+ git(source, "add", ".")
947
+ git(source, "commit", "-qm", "source")
948
+ revision = git(source, "rev-parse", "HEAD")
949
+ patches = []
950
+ for name, before, after in [
951
+ ("001_first", 1, 2),
952
+ ("002_second", 2 if dependent else 1, 3),
953
+ ]:
954
+ path = f"pack/cuda/patches/vllm/{name}.patch"
955
+ target = repo / path
956
+ target.parent.mkdir(parents=True, exist_ok=True)
957
+ target.write_text(
958
+ diff("engine.py", f"value = {before}\n", f"value = {after}\n"),
959
+ )
960
+ patches.append(
961
+ {
962
+ "path": path,
963
+ "disposition": "retain",
964
+ "reason": "Check the installed patch sequence.",
965
+ "versions": ["0.30.0"],
966
+ "platforms": ["linux/amd64"],
967
+ "sources": ["https://github.com/vllm-project/vllm"],
968
+ "source_repository": "vllm-project/vllm",
969
+ "source_revision": revision,
970
+ },
971
+ )
972
+ freeze(candidate)
973
+ # Report order must not override the recipe's lexical patch order.
974
+ proposal["groups"][0]["rows"][0]["patches"] = list(reversed(patches))
975
+ result = validate(candidate, sources={"vllm-project/vllm": source})
976
+ assert result["groups"][0]["status"] == ("ready" if dependent else "failed")
977
+ assert (source / "engine.py").read_text() == "value = 1\n"
978
+
979
+
980
+ @pytest.mark.parametrize(
981
+ "plugin,tagged,expected",
982
+ [
983
+ ("0.30.0rc1", True, "ready"),
984
+ ("9.99.0rc1", True, "failed"),
985
+ ("0.30.0rc1", False, "ready"),
986
+ ],
987
+ )
988
+ def test_ascend_plugin_uses_sourced_pairing_not_image_tag_spelling(
989
+ candidate,
990
+ plugin,
991
+ tagged,
992
+ expected,
993
+ ):
994
+ repo, proposal = candidate
995
+ (repo / "pack/cuda").rename(repo / "pack/cann")
996
+ path = "pack/cann/Dockerfile.vllm"
997
+ before = (
998
+ (repo / path)
999
+ .read_text()
1000
+ .replace("CUDA_VERSION=13.0.1", "CANN_VERSION=9.1.0\nARG CANN_ARCHS=910b")
1001
+ .replace("VLLM_BASE_IMAGE", "CANN_BASE_IMAGE")
1002
+ .replace(
1003
+ "vllm/vllm-openai:v${VLLM_VERSION}",
1004
+ "quay.io/ascend/vllm-ascend:v0.29.0rc1",
1005
+ )
1006
+ )
1007
+ (repo / path).write_text(before)
1008
+ old_matrix = (
1009
+ (repo / "pack/matrix.yaml")
1010
+ .read_text()
1011
+ .replace("backend: cuda", "backend: cann")
1012
+ )
1013
+ (repo / "pack/matrix.yaml").write_text(old_matrix)
1014
+ old_support = (
1015
+ SUPPORT_START
1016
+ + "| cann | 9.1 | vllm | 910b | 0.29.0 | 0.29.0rc1 | linux/amd64 | prepared |\n"
1017
+ + SUPPORT_END
1018
+ )
1019
+ (repo / SUPPORT).write_text(old_support)
1020
+ freeze(candidate)
1021
+ image = (
1022
+ "quay.io/ascend/vllm-ascend:" + "v0.30.0"
1023
+ if tagged
1024
+ else "quay.io/ascend/vllm-ascend@sha256:" + "b" * 64
1025
+ )
1026
+ after = before.replace("VLLM_VERSION=0.29.0", "VLLM_VERSION=0.30.0").replace(
1027
+ "quay.io/ascend/vllm-ascend:v0.29.0rc1",
1028
+ image,
1029
+ )
1030
+ group = proposal["groups"][0]
1031
+ group["rows"][0].update(
1032
+ backend="cann",
1033
+ variant="910b",
1034
+ runtime="9.1.0",
1035
+ plugin_version=plugin,
1036
+ base_image=image,
1037
+ )
1038
+ new_support = old_support.replace(
1039
+ SUPPORT_END,
1040
+ f"| cann | 9.1 | vllm | 910b | 0.30.0 | {plugin} | linux/amd64 | prepared |\n"
1041
+ + SUPPORT_END,
1042
+ )
1043
+ group["patch"] = (
1044
+ diff(path, before, after)
1045
+ + diff("pack/matrix.yaml", old_matrix, old_matrix.replace("0.29.0", "0.30.0"))
1046
+ + diff(SUPPORT, old_support, new_support)
1047
+ )
1048
+ for entry in proposal["candidates"]:
1049
+ entry.update(
1050
+ status="ready" if entry["subscription"] == "cann/vllm" else "unchanged",
1051
+ groups=[group["id"]] if entry["subscription"] == "cann/vllm" else [],
1052
+ )
1053
+ pairs = {
1054
+ "0.30.0rc1": {
1055
+ "engine_version": "0.30.0",
1056
+ "source": "https://github.com/vllm-project/vllm-ascend/releases/tag/v0.30.0rc1",
1057
+ },
1058
+ }
1059
+ result = validate(candidate, ascend_pairs=pairs)
1060
+ assert result["groups"][0]["status"] == expected
1061
+ assert validate(candidate)["groups"][0]["status"] == "failed"
1062
+ if expected == "ready":
1063
+ raw = verify_artifact(result, proposal["identity"])
1064
+ assert (
1065
+ validate_candidate(repo, raw, raw["identity"], ascend_pairs=pairs)["patch"]
1066
+ == result["patch"]
1067
+ )
1068
+ pairs["0.30.0rc1"]["engine_version"] = "0.29.0"
1069
+ assert (
1070
+ validate(candidate, ascend_pairs=pairs)["groups"][0]["status"] == "failed"
1071
+ )
1072
+
1073
+
1074
+ def test_prerelease_checks_and_transport_require_same_trusted_permission(candidate):
1075
+ repo, raw = candidate
1076
+ raw = json.loads(json.dumps(raw).replace("0.30.0", "0.30.0rc1"))
1077
+ raw["identity"].update(
1078
+ mode="revise",
1079
+ pr_number=1,
1080
+ command_id=7,
1081
+ command_digest="b" * 64,
1082
+ )
1083
+ permission = {("cuda", "vllm", "0.30.0rc1")}
1084
+ checked = validate_candidate(
1085
+ repo,
1086
+ raw,
1087
+ raw["identity"],
1088
+ engine_prereleases=permission,
1089
+ )
1090
+ assert checked["patch"]
1091
+ assert checked["groups"][0]["validation"]["status"] == "passed"
1092
+ with pytest.raises(ProposalError, match="stable"):
1093
+ verify_artifact(checked, raw["identity"])
1094
+ assert (
1095
+ verify_artifact(checked, raw["identity"], engine_prereleases=permission)[
1096
+ "groups"
1097
+ ][0]["status"]
1098
+ == "ready"
1099
+ )