spawnfile 0.1.33 → 0.1.34

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 (585) hide show
  1. package/README.md +1 -1
  2. package/dist/auth/trainingAuth.d.ts +2 -5
  3. package/dist/cli/devCommands.d.ts +1 -1
  4. package/dist/cli/devCommands.js +0 -66
  5. package/dist/cli/runCli.d.ts +1 -4
  6. package/dist/cli/runCli.js +2 -2
  7. package/dist/cli/trainCommand.js +9 -15
  8. package/dist/cli/trainingBooted.d.ts +7 -0
  9. package/dist/cli/trainingBooted.js +41 -0
  10. package/dist/cli/trainingExecution.d.ts +4 -7
  11. package/dist/cli/trainingExecution.js +4 -32
  12. package/dist/compiler/containerArtifacts.js +0 -5
  13. package/dist/compiler/containerBackedMountRender.js +5 -1
  14. package/dist/compiler/containerDaimonBrokerRender.d.ts +5 -50
  15. package/dist/compiler/containerDaimonBrokerRender.js +7 -88
  16. package/dist/compiler/containerDaimonGatewayRender.d.ts +50 -0
  17. package/dist/compiler/containerDaimonGatewayRender.js +157 -0
  18. package/dist/compiler/containerDaimonGrokWorkerProvisioning.d.ts +2 -10
  19. package/dist/compiler/containerDaimonGrokWorkerProvisioning.js +13 -25
  20. package/dist/compiler/containerDaimonGrokWorkerRender.d.ts +11 -49
  21. package/dist/compiler/containerDaimonGrokWorkerRender.js +15 -39
  22. package/dist/compiler/containerDaimonStartupSupervision.d.ts +8 -0
  23. package/dist/compiler/containerDaimonStartupSupervision.js +39 -0
  24. package/dist/compiler/containerDaimonUidEntrypointRender.d.ts +1 -2
  25. package/dist/compiler/containerDaimonUidEntrypointRender.js +26 -46
  26. package/dist/compiler/containerRuntimeReadinessRender.js +1 -1
  27. package/dist/compiler/memoryArtifacts.js +0 -1
  28. package/dist/compiler/moltnetArtifacts.js +1 -17
  29. package/dist/compiler/moltnetClientConfig.js +1 -1
  30. package/dist/compiler/moltnetRuntimeConfig.js +0 -10
  31. package/dist/compiler/runProject.d.ts +1 -0
  32. package/dist/compiler/runProject.js +9 -3
  33. package/dist/compiler/runProjectAuth.js +2 -17
  34. package/dist/compiler/training/contract.d.ts +0 -2
  35. package/dist/compiler/training/contract.js +0 -2
  36. package/dist/compiler/training/execution.d.ts +1 -128
  37. package/dist/compiler/training/execution.js +7 -68
  38. package/dist/compiler/training/index.d.ts +0 -8
  39. package/dist/compiler/training/index.js +0 -7
  40. package/dist/compiler/training/output.d.ts +1 -0
  41. package/dist/compiler/training/output.js +1 -1
  42. package/dist/compiler/training/trial/boot.d.ts +53 -0
  43. package/dist/compiler/training/trial/boot.js +147 -0
  44. package/dist/compiler/training/trial/docker.d.ts +8 -0
  45. package/dist/compiler/training/trial/docker.js +22 -0
  46. package/dist/compiler/training/trial/gateway.d.ts +42 -0
  47. package/dist/compiler/training/trial/gateway.js +98 -0
  48. package/dist/compiler/training/trial/index.d.ts +4 -0
  49. package/dist/compiler/training/trial/index.js +4 -0
  50. package/dist/compiler/training/trial/launcher.d.ts +32 -0
  51. package/dist/compiler/training/trial/launcher.js +49 -0
  52. package/dist/compiler/training/trial/project.d.ts +11 -0
  53. package/dist/compiler/training/trial/project.js +31 -0
  54. package/dist/compiler/upReceipt.d.ts +2 -17
  55. package/dist/compiler/upReceipt.js +2 -17
  56. package/dist/deployment/artifactsExportPlan.js +2 -18
  57. package/dist/deployment/privateArtifactsExport.js +1 -1
  58. package/dist/dev/docker.d.ts +0 -5
  59. package/dist/dev/docker.js +0 -46
  60. package/dist/dev/index.d.ts +0 -1
  61. package/dist/dev/index.js +0 -1
  62. package/dist/dev/project.d.ts +0 -16
  63. package/dist/dev/project.js +1 -128
  64. package/dist/distribution/distributionReportSchema.js +1 -1
  65. package/dist/distribution/imageRuntimeAuth.js +3 -2
  66. package/dist/release/drainControl.d.ts +5 -19
  67. package/dist/release/drainControl.js +12 -67
  68. package/dist/report/types.d.ts +3 -6
  69. package/dist/runtime/common.d.ts +1 -1
  70. package/dist/runtime/common.js +1 -1
  71. package/dist/runtime/container.d.ts +2 -2
  72. package/dist/runtime/container.js +1 -39
  73. package/dist/runtime/daimon/config.js +6 -12
  74. package/dist/runtime/daimon/contractManifest.js +0 -1
  75. package/dist/runtime/daimon/contractManifestSchema.js +0 -1
  76. package/dist/runtime/daimon/control.d.ts +31 -0
  77. package/dist/runtime/daimon/control.js +83 -0
  78. package/dist/runtime/daimon/engineDescriptorSchema.js +0 -1
  79. package/dist/runtime/daimon/engineDescriptors.generated.d.ts +1 -1
  80. package/dist/runtime/daimon/engineDescriptors.generated.js +1 -2
  81. package/dist/runtime/daimon/engines.js +0 -1
  82. package/dist/runtime/daimon/gateway.d.ts +62 -0
  83. package/dist/runtime/daimon/gateway.js +77 -0
  84. package/dist/runtime/daimon/grokWorkerContract.d.ts +0 -5
  85. package/dist/runtime/daimon/grokWorkerContract.js +1 -13
  86. package/dist/runtime/daimon/index.d.ts +2 -0
  87. package/dist/runtime/daimon/index.js +2 -1
  88. package/dist/runtime/daimon/memory.js +1 -1
  89. package/dist/runtime/daimon/packageName.js +0 -1
  90. package/dist/runtime/daimon/runAuth.js +7 -4
  91. package/dist/runtime/daimon/runtimeIdentity.d.ts +2 -0
  92. package/dist/runtime/daimon/runtimeIdentity.js +2 -0
  93. package/dist/runtime/daimon/subscriptionRealms.d.ts +9 -3
  94. package/dist/runtime/daimon/subscriptionRealms.js +22 -13
  95. package/dist/runtime/daimon/testHelpers.d.ts +2 -0
  96. package/dist/runtime/{pi → daimon}/testHelpers.js +3 -3
  97. package/dist/runtime/daimon/training/booted/adapter.d.ts +46 -0
  98. package/dist/runtime/daimon/training/booted/adapter.js +59 -0
  99. package/dist/runtime/daimon/training/booted/adapter.js.map +1 -0
  100. package/dist/runtime/daimon/training/booted/index.d.ts +2 -0
  101. package/dist/runtime/daimon/training/booted/index.js +2 -0
  102. package/dist/runtime/daimon/training/booted/index.js.map +1 -0
  103. package/dist/runtime/daimon/training/index.d.ts +5 -0
  104. package/dist/runtime/daimon/training/index.js +8 -4
  105. package/dist/runtime/daimon/training/index.js.map +1 -1
  106. package/dist/runtime/daimon/training/providers/codex-subscription/index.js.map +1 -0
  107. package/dist/runtime/daimon/training/providers/codex-subscription/protocol.js.map +1 -0
  108. package/dist/runtime/daimon/training/providers/codex-subscription/provider.js.map +1 -0
  109. package/dist/runtime/daimon/training/providers/codex-subscription/strict-schema.js.map +1 -0
  110. package/dist/runtime/daimon/training/providers/grok-subscription/cli.d.ts +1 -3
  111. package/dist/runtime/daimon/training/providers/grok-subscription/cli.js +5 -5
  112. package/dist/runtime/daimon/training/providers/grok-subscription/cli.js.map +1 -1
  113. package/dist/runtime/daimon/training/providers/grok-subscription/index.d.ts +1 -2
  114. package/dist/runtime/daimon/training/providers/grok-subscription/index.js +0 -1
  115. package/dist/runtime/daimon/training/providers/grok-subscription/index.js.map +1 -1
  116. package/dist/runtime/daimon/training/providers/grok-subscription/protocol.d.ts +5 -17
  117. package/dist/runtime/daimon/training/providers/grok-subscription/protocol.js +18 -31
  118. package/dist/runtime/daimon/training/providers/grok-subscription/protocol.js.map +1 -1
  119. package/dist/runtime/daimon/training/providers/grok-subscription/provider.js +1 -2
  120. package/dist/runtime/daimon/training/providers/grok-subscription/provider.js.map +1 -1
  121. package/dist/runtime/daimon/wakeMoments.js +0 -1
  122. package/dist/runtime/install.js +0 -21
  123. package/dist/runtime/registry.js +0 -2
  124. package/dist/runtime/trainingGraderProviders.js +1 -1
  125. package/dist/runtime/trainingProviders.d.ts +1 -2
  126. package/dist/runtime/trainingProviders.js +9 -19
  127. package/dist/runtime/trainingSubjects.d.ts +0 -121
  128. package/dist/runtime/trainingSubjects.js +2 -13
  129. package/dist/runtime/types.d.ts +1 -8
  130. package/dist/shared/errors.js +0 -1
  131. package/dist/status/lifecycleProbes.js +3 -6
  132. package/dist/status/moltnetWiringProbes.js +1 -17
  133. package/dist/training/subjects/index.d.ts +0 -1
  134. package/dist/training/subjects/index.js +0 -1
  135. package/dist/training/subjects/index.js.map +1 -1
  136. package/examples/README.md +0 -1
  137. package/examples/daimon-org/agents/mapper/Spawnfile +4 -1
  138. package/examples/daimon-org/teams/review/agents/reviewer/Spawnfile +4 -1
  139. package/examples/jungian-daimon-org/teams/luna/agents/animus/Spawnfile +5 -8
  140. package/examples/jungian-daimon-org/teams/luna/agents/representative/Spawnfile +1 -1
  141. package/examples/jungian-daimon-org/teams/luna/agents/shadow/Spawnfile +5 -8
  142. package/examples/jungian-daimon-org/teams/selene/agents/animus/Spawnfile +5 -8
  143. package/examples/jungian-daimon-org/teams/selene/agents/representative/Spawnfile +5 -8
  144. package/examples/jungian-daimon-org/teams/selene/agents/shadow/Spawnfile +1 -1
  145. package/examples/mixed-runtime-org/agents/localist/Spawnfile +7 -7
  146. package/package.json +4 -13
  147. package/runtimes.yaml +5 -15
  148. package/dist/compiler/containerDaimonGrokTaskClock.d.ts +0 -5
  149. package/dist/compiler/containerDaimonGrokTaskClock.js +0 -29
  150. package/dist/compiler/daimonTelemetryArtifacts.d.ts +0 -22
  151. package/dist/compiler/daimonTelemetryArtifacts.js +0 -56
  152. package/dist/compiler/training/broker/clockProbe.d.ts +0 -6
  153. package/dist/compiler/training/broker/clockProbe.js +0 -27
  154. package/dist/compiler/training/broker/declaration.d.ts +0 -54
  155. package/dist/compiler/training/broker/declaration.js +0 -70
  156. package/dist/compiler/training/broker/entrypoint.d.ts +0 -39
  157. package/dist/compiler/training/broker/entrypoint.js +0 -124
  158. package/dist/compiler/training/broker/evaluatorSecrets.d.ts +0 -2
  159. package/dist/compiler/training/broker/evaluatorSecrets.js +0 -62
  160. package/dist/compiler/training/broker/index.d.ts +0 -12
  161. package/dist/compiler/training/broker/index.js +0 -12
  162. package/dist/compiler/training/broker/main.d.ts +0 -2
  163. package/dist/compiler/training/broker/main.js +0 -14
  164. package/dist/compiler/training/broker/paths.d.ts +0 -236
  165. package/dist/compiler/training/broker/paths.js +0 -249
  166. package/dist/compiler/training/broker/processes.d.ts +0 -51
  167. package/dist/compiler/training/broker/processes.js +0 -102
  168. package/dist/compiler/training/broker/projection.d.ts +0 -61
  169. package/dist/compiler/training/broker/projection.js +0 -109
  170. package/dist/compiler/training/broker/provisioning.d.ts +0 -78
  171. package/dist/compiler/training/broker/provisioning.js +0 -231
  172. package/dist/compiler/training/broker/receipt.d.ts +0 -77
  173. package/dist/compiler/training/broker/receipt.js +0 -110
  174. package/dist/compiler/training/broker/recycleClient.d.ts +0 -33
  175. package/dist/compiler/training/broker/recycleClient.js +0 -112
  176. package/dist/compiler/training/broker/registration.d.ts +0 -46
  177. package/dist/compiler/training/broker/registration.js +0 -113
  178. package/dist/compiler/training/broker/reset.d.ts +0 -9
  179. package/dist/compiler/training/broker/reset.js +0 -71
  180. package/dist/compiler/training/broker/rootScript.d.ts +0 -32
  181. package/dist/compiler/training/broker/rootScript.js +0 -33
  182. package/dist/compiler/training/broker/runtime.d.ts +0 -22
  183. package/dist/compiler/training/broker/runtime.js +0 -128
  184. package/dist/compiler/training/broker/seccompRoutes.d.ts +0 -31
  185. package/dist/compiler/training/broker/seccompRoutes.js +0 -36
  186. package/dist/compiler/training/broker/supervisor.d.ts +0 -108
  187. package/dist/compiler/training/broker/supervisor.js +0 -172
  188. package/dist/compiler/training/broker/taskClock.d.ts +0 -5
  189. package/dist/compiler/training/broker/taskClock.js +0 -41
  190. package/dist/compiler/training/container/contract.d.ts +0 -54
  191. package/dist/compiler/training/container/contract.js +0 -52
  192. package/dist/compiler/training/container/evaluators.d.ts +0 -48
  193. package/dist/compiler/training/container/evaluators.js +0 -50
  194. package/dist/compiler/training/container/grokWriteback.d.ts +0 -8
  195. package/dist/compiler/training/container/grokWriteback.js +0 -26
  196. package/dist/compiler/training/container/index.d.ts +0 -5
  197. package/dist/compiler/training/container/index.js +0 -3
  198. package/dist/compiler/training/container/launch.d.ts +0 -21
  199. package/dist/compiler/training/container/launch.js +0 -280
  200. package/dist/compiler/training/container/nativeSlots.d.ts +0 -14
  201. package/dist/compiler/training/container/nativeSlots.js +0 -13
  202. package/dist/compiler/training/container/outputCopy.d.ts +0 -2
  203. package/dist/compiler/training/container/outputCopy.js +0 -72
  204. package/dist/compiler/training/container/outputVolume.d.ts +0 -28
  205. package/dist/compiler/training/container/outputVolume.js +0 -185
  206. package/dist/compiler/training/container/prepare.d.ts +0 -10
  207. package/dist/compiler/training/container/prepare.js +0 -125
  208. package/dist/compiler/training/container/process.d.ts +0 -14
  209. package/dist/compiler/training/container/process.js +0 -70
  210. package/dist/compiler/training/container/security.d.ts +0 -38
  211. package/dist/compiler/training/container/security.js +0 -68
  212. package/dist/compiler/training/container/subjectIsolation.d.ts +0 -5
  213. package/dist/compiler/training/container/subjectIsolation.js +0 -16
  214. package/dist/compiler/training/preparation/assets/Dockerfile +0 -100
  215. package/dist/compiler/training/preparation/assets/package-lock.json +0 -5483
  216. package/dist/compiler/training/preparation/broker.d.ts +0 -30
  217. package/dist/compiler/training/preparation/broker.js +0 -68
  218. package/dist/compiler/training/preparation/contextModes.d.ts +0 -12
  219. package/dist/compiler/training/preparation/contextModes.js +0 -38
  220. package/dist/compiler/training/preparation/contract.d.ts +0 -203
  221. package/dist/compiler/training/preparation/contract.js +0 -114
  222. package/dist/compiler/training/preparation/copyAssets.d.ts +0 -1
  223. package/dist/compiler/training/preparation/copyAssets.js +0 -8
  224. package/dist/compiler/training/preparation/daimonParent.d.ts +0 -42
  225. package/dist/compiler/training/preparation/daimonParent.js +0 -114
  226. package/dist/compiler/training/preparation/files.d.ts +0 -29
  227. package/dist/compiler/training/preparation/files.js +0 -146
  228. package/dist/compiler/training/preparation/image.d.ts +0 -28
  229. package/dist/compiler/training/preparation/image.js +0 -105
  230. package/dist/compiler/training/preparation/index.d.ts +0 -3
  231. package/dist/compiler/training/preparation/index.js +0 -2
  232. package/dist/compiler/training/preparation/inputs.d.ts +0 -24
  233. package/dist/compiler/training/preparation/inputs.js +0 -101
  234. package/dist/compiler/training/preparation/prepare.d.ts +0 -38
  235. package/dist/compiler/training/preparation/prepare.js +0 -224
  236. package/dist/compiler/training/preparation/scratch.d.ts +0 -8
  237. package/dist/compiler/training/preparation/scratch.js +0 -114
  238. package/dist/compiler/training/repair/compatibility.d.ts +0 -11
  239. package/dist/compiler/training/repair/compatibility.js +0 -45
  240. package/dist/compiler/training/repair/contract.d.ts +0 -832
  241. package/dist/compiler/training/repair/contract.js +0 -34
  242. package/dist/compiler/training/repair/index.d.ts +0 -3
  243. package/dist/compiler/training/repair/index.js +0 -3
  244. package/dist/compiler/training/repair/prepare.d.ts +0 -378
  245. package/dist/compiler/training/repair/prepare.js +0 -84
  246. package/dist/compiler/training/repair/witness.d.ts +0 -348
  247. package/dist/compiler/training/repair/witness.js +0 -62
  248. package/dist/compiler/training/subjectDeclaration.d.ts +0 -26
  249. package/dist/compiler/training/subjectDeclaration.js +0 -54
  250. package/dist/compiler/training/subjectLease.d.ts +0 -115
  251. package/dist/compiler/training/subjectLease.js +0 -179
  252. package/dist/dev/activity.d.ts +0 -14
  253. package/dist/dev/activity.js +0 -48
  254. package/dist/runtime/codex-exec/training/adapter.d.ts +0 -13
  255. package/dist/runtime/codex-exec/training/adapter.js +0 -101
  256. package/dist/runtime/codex-exec/training/adapter.js.map +0 -1
  257. package/dist/runtime/codex-exec/training/environment.d.ts +0 -3
  258. package/dist/runtime/codex-exec/training/environment.js +0 -26
  259. package/dist/runtime/codex-exec/training/environment.js.map +0 -1
  260. package/dist/runtime/codex-exec/training/index.d.ts +0 -2
  261. package/dist/runtime/codex-exec/training/index.js +0 -3
  262. package/dist/runtime/codex-exec/training/index.js.map +0 -1
  263. package/dist/runtime/codex-exec/training/protocol.d.ts +0 -15
  264. package/dist/runtime/codex-exec/training/protocol.js +0 -102
  265. package/dist/runtime/codex-exec/training/protocol.js.map +0 -1
  266. package/dist/runtime/codex-exec/training/providers/codex-subscription/index.js.map +0 -1
  267. package/dist/runtime/codex-exec/training/providers/codex-subscription/protocol.js.map +0 -1
  268. package/dist/runtime/codex-exec/training/providers/codex-subscription/provider.js.map +0 -1
  269. package/dist/runtime/codex-exec/training/providers/codex-subscription/strict-schema.js.map +0 -1
  270. package/dist/runtime/daimon/contractManifest.js.map +0 -1
  271. package/dist/runtime/daimon/contractManifestSchema.js.map +0 -1
  272. package/dist/runtime/daimon/engineDescriptorSchema.js.map +0 -1
  273. package/dist/runtime/daimon/engineDescriptors.generated.js.map +0 -1
  274. package/dist/runtime/daimon/engines.js.map +0 -1
  275. package/dist/runtime/daimon/index.js.map +0 -1
  276. package/dist/runtime/daimon/packageName.js.map +0 -1
  277. package/dist/runtime/daimon/training/legacy/adapter.d.ts +0 -11
  278. package/dist/runtime/daimon/training/legacy/adapter.js +0 -175
  279. package/dist/runtime/daimon/training/legacy/adapter.js.map +0 -1
  280. package/dist/runtime/daimon/training/legacy/index.d.ts +0 -2
  281. package/dist/runtime/daimon/training/legacy/index.js +0 -3
  282. package/dist/runtime/daimon/training/legacy/index.js.map +0 -1
  283. package/dist/runtime/daimon/training/legacy/public.d.ts +0 -49
  284. package/dist/runtime/daimon/training/legacy/public.js +0 -16
  285. package/dist/runtime/daimon/training/legacy/public.js.map +0 -1
  286. package/dist/runtime/daimon/training/native/adapter.d.ts +0 -18
  287. package/dist/runtime/daimon/training/native/adapter.js +0 -252
  288. package/dist/runtime/daimon/training/native/adapter.js.map +0 -1
  289. package/dist/runtime/daimon/training/native/admission.d.ts +0 -7
  290. package/dist/runtime/daimon/training/native/admission.js +0 -52
  291. package/dist/runtime/daimon/training/native/admission.js.map +0 -1
  292. package/dist/runtime/daimon/training/native/child/arguments.d.ts +0 -16
  293. package/dist/runtime/daimon/training/native/child/arguments.js +0 -70
  294. package/dist/runtime/daimon/training/native/child/arguments.js.map +0 -1
  295. package/dist/runtime/daimon/training/native/child/deferred-trial.d.ts +0 -24
  296. package/dist/runtime/daimon/training/native/child/deferred-trial.js +0 -63
  297. package/dist/runtime/daimon/training/native/child/deferred-trial.js.map +0 -1
  298. package/dist/runtime/daimon/training/native/child/diagnostics.d.ts +0 -58
  299. package/dist/runtime/daimon/training/native/child/diagnostics.js +0 -215
  300. package/dist/runtime/daimon/training/native/child/diagnostics.js.map +0 -1
  301. package/dist/runtime/daimon/training/native/child/fixture.d.ts +0 -16
  302. package/dist/runtime/daimon/training/native/child/fixture.js +0 -159
  303. package/dist/runtime/daimon/training/native/child/fixture.js.map +0 -1
  304. package/dist/runtime/daimon/training/native/child/grok.d.ts +0 -14
  305. package/dist/runtime/daimon/training/native/child/grok.js +0 -47
  306. package/dist/runtime/daimon/training/native/child/grok.js.map +0 -1
  307. package/dist/runtime/daimon/training/native/child/index.d.ts +0 -7
  308. package/dist/runtime/daimon/training/native/child/index.js +0 -5
  309. package/dist/runtime/daimon/training/native/child/index.js.map +0 -1
  310. package/dist/runtime/daimon/training/native/child/lifecycle.d.ts +0 -40
  311. package/dist/runtime/daimon/training/native/child/lifecycle.js +0 -400
  312. package/dist/runtime/daimon/training/native/child/lifecycle.js.map +0 -1
  313. package/dist/runtime/daimon/training/native/child/probe.d.ts +0 -2
  314. package/dist/runtime/daimon/training/native/child/probe.js +0 -11
  315. package/dist/runtime/daimon/training/native/child/probe.js.map +0 -1
  316. package/dist/runtime/daimon/training/native/child/sandbox.d.ts +0 -4
  317. package/dist/runtime/daimon/training/native/child/sandbox.js +0 -76
  318. package/dist/runtime/daimon/training/native/child/sandbox.js.map +0 -1
  319. package/dist/runtime/daimon/training/native/child/types.d.ts +0 -15
  320. package/dist/runtime/daimon/training/native/child/types.js +0 -2
  321. package/dist/runtime/daimon/training/native/child/types.js.map +0 -1
  322. package/dist/runtime/daimon/training/native/container/docker.d.ts +0 -29
  323. package/dist/runtime/daimon/training/native/container/docker.js +0 -105
  324. package/dist/runtime/daimon/training/native/container/docker.js.map +0 -1
  325. package/dist/runtime/daimon/training/native/container/grok-slot.d.ts +0 -22
  326. package/dist/runtime/daimon/training/native/container/grok-slot.js +0 -38
  327. package/dist/runtime/daimon/training/native/container/grok-slot.js.map +0 -1
  328. package/dist/runtime/daimon/training/native/container/index.d.ts +0 -6
  329. package/dist/runtime/daimon/training/native/container/index.js +0 -6
  330. package/dist/runtime/daimon/training/native/container/index.js.map +0 -1
  331. package/dist/runtime/daimon/training/native/container/lifecycle.d.ts +0 -8
  332. package/dist/runtime/daimon/training/native/container/lifecycle.js +0 -111
  333. package/dist/runtime/daimon/training/native/container/lifecycle.js.map +0 -1
  334. package/dist/runtime/daimon/training/native/container/manifest.d.ts +0 -17
  335. package/dist/runtime/daimon/training/native/container/manifest.js +0 -164
  336. package/dist/runtime/daimon/training/native/container/manifest.js.map +0 -1
  337. package/dist/runtime/daimon/training/native/container/native-preflight.d.ts +0 -8
  338. package/dist/runtime/daimon/training/native/container/native-preflight.js +0 -40
  339. package/dist/runtime/daimon/training/native/container/native-preflight.js.map +0 -1
  340. package/dist/runtime/daimon/training/native/container/preflight.d.ts +0 -15
  341. package/dist/runtime/daimon/training/native/container/preflight.js +0 -79
  342. package/dist/runtime/daimon/training/native/container/preflight.js.map +0 -1
  343. package/dist/runtime/daimon/training/native/container/slot.d.ts +0 -4
  344. package/dist/runtime/daimon/training/native/container/slot.js +0 -58
  345. package/dist/runtime/daimon/training/native/container/slot.js.map +0 -1
  346. package/dist/runtime/daimon/training/native/external.d.ts +0 -37
  347. package/dist/runtime/daimon/training/native/external.js +0 -75
  348. package/dist/runtime/daimon/training/native/external.js.map +0 -1
  349. package/dist/runtime/daimon/training/native/grants/authority.d.ts +0 -36
  350. package/dist/runtime/daimon/training/native/grants/authority.js +0 -49
  351. package/dist/runtime/daimon/training/native/grants/authority.js.map +0 -1
  352. package/dist/runtime/daimon/training/native/grants/index.d.ts +0 -2
  353. package/dist/runtime/daimon/training/native/grants/index.js +0 -3
  354. package/dist/runtime/daimon/training/native/grants/index.js.map +0 -1
  355. package/dist/runtime/daimon/training/native/grants/pins.d.ts +0 -30
  356. package/dist/runtime/daimon/training/native/grants/pins.js +0 -20
  357. package/dist/runtime/daimon/training/native/grants/pins.js.map +0 -1
  358. package/dist/runtime/daimon/training/native/grants/test-socket.d.ts +0 -6
  359. package/dist/runtime/daimon/training/native/grants/test-socket.js +0 -35
  360. package/dist/runtime/daimon/training/native/grants/test-socket.js.map +0 -1
  361. package/dist/runtime/daimon/training/native/grok-fixtures.d.ts +0 -34
  362. package/dist/runtime/daimon/training/native/grok-fixtures.js +0 -179
  363. package/dist/runtime/daimon/training/native/grok-fixtures.js.map +0 -1
  364. package/dist/runtime/daimon/training/native/index.d.ts +0 -38
  365. package/dist/runtime/daimon/training/native/index.js +0 -27
  366. package/dist/runtime/daimon/training/native/index.js.map +0 -1
  367. package/dist/runtime/daimon/training/native/live-checkout.d.ts +0 -2
  368. package/dist/runtime/daimon/training/native/live-checkout.js +0 -15
  369. package/dist/runtime/daimon/training/native/live-checkout.js.map +0 -1
  370. package/dist/runtime/daimon/training/native/observations.d.ts +0 -51
  371. package/dist/runtime/daimon/training/native/observations.js +0 -217
  372. package/dist/runtime/daimon/training/native/observations.js.map +0 -1
  373. package/dist/runtime/daimon/training/native/outcome.d.ts +0 -13
  374. package/dist/runtime/daimon/training/native/outcome.js +0 -37
  375. package/dist/runtime/daimon/training/native/outcome.js.map +0 -1
  376. package/dist/runtime/daimon/training/native/preparation/engine-config.d.ts +0 -21
  377. package/dist/runtime/daimon/training/native/preparation/engine-config.js +0 -30
  378. package/dist/runtime/daimon/training/native/preparation/engine-config.js.map +0 -1
  379. package/dist/runtime/daimon/training/native/preparation/fixtures.d.ts +0 -17
  380. package/dist/runtime/daimon/training/native/preparation/fixtures.js +0 -52
  381. package/dist/runtime/daimon/training/native/preparation/fixtures.js.map +0 -1
  382. package/dist/runtime/daimon/training/native/preparation/index.d.ts +0 -7
  383. package/dist/runtime/daimon/training/native/preparation/index.js +0 -5
  384. package/dist/runtime/daimon/training/native/preparation/index.js.map +0 -1
  385. package/dist/runtime/daimon/training/native/preparation/layout.d.ts +0 -66
  386. package/dist/runtime/daimon/training/native/preparation/layout.js +0 -87
  387. package/dist/runtime/daimon/training/native/preparation/layout.js.map +0 -1
  388. package/dist/runtime/daimon/training/native/preparation/subject.d.ts +0 -14
  389. package/dist/runtime/daimon/training/native/preparation/subject.js +0 -67
  390. package/dist/runtime/daimon/training/native/preparation/subject.js.map +0 -1
  391. package/dist/runtime/daimon/training/native/preparation/types.d.ts +0 -69
  392. package/dist/runtime/daimon/training/native/preparation/types.js +0 -2
  393. package/dist/runtime/daimon/training/native/preparation/types.js.map +0 -1
  394. package/dist/runtime/daimon/training/native/receipt/artifacts.d.ts +0 -25
  395. package/dist/runtime/daimon/training/native/receipt/artifacts.js +0 -32
  396. package/dist/runtime/daimon/training/native/receipt/artifacts.js.map +0 -1
  397. package/dist/runtime/daimon/training/native/receipt/grok-clocked-pins.d.ts +0 -129
  398. package/dist/runtime/daimon/training/native/receipt/grok-clocked-pins.js +0 -45
  399. package/dist/runtime/daimon/training/native/receipt/grok-clocked-pins.js.map +0 -1
  400. package/dist/runtime/daimon/training/native/receipt/grok.d.ts +0 -246
  401. package/dist/runtime/daimon/training/native/receipt/grok.js +0 -195
  402. package/dist/runtime/daimon/training/native/receipt/grok.js.map +0 -1
  403. package/dist/runtime/daimon/training/native/receipt/index.d.ts +0 -11
  404. package/dist/runtime/daimon/training/native/receipt/index.js +0 -8
  405. package/dist/runtime/daimon/training/native/receipt/index.js.map +0 -1
  406. package/dist/runtime/daimon/training/native/receipt/paths.d.ts +0 -3
  407. package/dist/runtime/daimon/training/native/receipt/paths.js +0 -18
  408. package/dist/runtime/daimon/training/native/receipt/paths.js.map +0 -1
  409. package/dist/runtime/daimon/training/native/receipt/sandbox.d.ts +0 -42
  410. package/dist/runtime/daimon/training/native/receipt/sandbox.js +0 -35
  411. package/dist/runtime/daimon/training/native/receipt/sandbox.js.map +0 -1
  412. package/dist/runtime/daimon/training/native/receipt/schema.d.ts +0 -490
  413. package/dist/runtime/daimon/training/native/receipt/schema.js +0 -138
  414. package/dist/runtime/daimon/training/native/receipt/schema.js.map +0 -1
  415. package/dist/runtime/daimon/training/native/receipt/subscription.d.ts +0 -13
  416. package/dist/runtime/daimon/training/native/receipt/subscription.js +0 -13
  417. package/dist/runtime/daimon/training/native/receipt/subscription.js.map +0 -1
  418. package/dist/runtime/daimon/training/native/receipt/task-clock.d.ts +0 -19
  419. package/dist/runtime/daimon/training/native/receipt/task-clock.js +0 -49
  420. package/dist/runtime/daimon/training/native/receipt/task-clock.js.map +0 -1
  421. package/dist/runtime/daimon/training/native/sealed-usage.d.ts +0 -218
  422. package/dist/runtime/daimon/training/native/sealed-usage.js +0 -261
  423. package/dist/runtime/daimon/training/native/sealed-usage.js.map +0 -1
  424. package/dist/runtime/daimon/training/native/test-fixtures.d.ts +0 -27
  425. package/dist/runtime/daimon/training/native/test-fixtures.js +0 -162
  426. package/dist/runtime/daimon/training/native/test-fixtures.js.map +0 -1
  427. package/dist/runtime/daimon/training/native/transcript.d.ts +0 -96
  428. package/dist/runtime/daimon/training/native/transcript.js +0 -239
  429. package/dist/runtime/daimon/training/native/transcript.js.map +0 -1
  430. package/dist/runtime/daimon/training/native/transport/delivery.d.ts +0 -27
  431. package/dist/runtime/daimon/training/native/transport/delivery.js +0 -98
  432. package/dist/runtime/daimon/training/native/transport/delivery.js.map +0 -1
  433. package/dist/runtime/daimon/training/native/transport/http.d.ts +0 -3
  434. package/dist/runtime/daimon/training/native/transport/http.js +0 -81
  435. package/dist/runtime/daimon/training/native/transport/http.js.map +0 -1
  436. package/dist/runtime/daimon/training/native/transport/index.d.ts +0 -4
  437. package/dist/runtime/daimon/training/native/transport/index.js +0 -3
  438. package/dist/runtime/daimon/training/native/transport/index.js.map +0 -1
  439. package/dist/runtime/daimon/training/native/transport/types.d.ts +0 -15
  440. package/dist/runtime/daimon/training/native/transport/types.js +0 -2
  441. package/dist/runtime/daimon/training/native/transport/types.js.map +0 -1
  442. package/dist/runtime/daimon/training/native/worker/cli.d.ts +0 -1
  443. package/dist/runtime/daimon/training/native/worker/cli.js +0 -17
  444. package/dist/runtime/daimon/training/native/worker/cli.js.map +0 -1
  445. package/dist/runtime/daimon/training/native/worker/control.d.ts +0 -20
  446. package/dist/runtime/daimon/training/native/worker/control.js +0 -266
  447. package/dist/runtime/daimon/training/native/worker/control.js.map +0 -1
  448. package/dist/runtime/daimon/training/native/worker/deliveries.d.ts +0 -38
  449. package/dist/runtime/daimon/training/native/worker/deliveries.js +0 -91
  450. package/dist/runtime/daimon/training/native/worker/deliveries.js.map +0 -1
  451. package/dist/runtime/daimon/training/native/worker/evidence/collect.d.ts +0 -54
  452. package/dist/runtime/daimon/training/native/worker/evidence/collect.js +0 -278
  453. package/dist/runtime/daimon/training/native/worker/evidence/collect.js.map +0 -1
  454. package/dist/runtime/daimon/training/native/worker/evidence/execution.d.ts +0 -102
  455. package/dist/runtime/daimon/training/native/worker/evidence/execution.js +0 -191
  456. package/dist/runtime/daimon/training/native/worker/evidence/execution.js.map +0 -1
  457. package/dist/runtime/daimon/training/native/worker/evidence/index.d.ts +0 -3
  458. package/dist/runtime/daimon/training/native/worker/evidence/index.js +0 -4
  459. package/dist/runtime/daimon/training/native/worker/evidence/index.js.map +0 -1
  460. package/dist/runtime/daimon/training/native/worker/evidence/io.d.ts +0 -20
  461. package/dist/runtime/daimon/training/native/worker/evidence/io.js +0 -130
  462. package/dist/runtime/daimon/training/native/worker/evidence/io.js.map +0 -1
  463. package/dist/runtime/daimon/training/native/worker/evidence/seal.d.ts +0 -3
  464. package/dist/runtime/daimon/training/native/worker/evidence/seal.js +0 -67
  465. package/dist/runtime/daimon/training/native/worker/evidence/seal.js.map +0 -1
  466. package/dist/runtime/daimon/training/native/worker/index.d.ts +0 -11
  467. package/dist/runtime/daimon/training/native/worker/index.js +0 -8
  468. package/dist/runtime/daimon/training/native/worker/index.js.map +0 -1
  469. package/dist/runtime/daimon/training/native/worker/profile.d.ts +0 -23
  470. package/dist/runtime/daimon/training/native/worker/profile.js +0 -149
  471. package/dist/runtime/daimon/training/native/worker/profile.js.map +0 -1
  472. package/dist/runtime/daimon/training/native/worker/public.d.ts +0 -53
  473. package/dist/runtime/daimon/training/native/worker/public.js +0 -22
  474. package/dist/runtime/daimon/training/native/worker/public.js.map +0 -1
  475. package/dist/runtime/daimon/training/native/worker/sandbox.d.ts +0 -4
  476. package/dist/runtime/daimon/training/native/worker/sandbox.js +0 -54
  477. package/dist/runtime/daimon/training/native/worker/sandbox.js.map +0 -1
  478. package/dist/runtime/daimon/training/native/worker/server.d.ts +0 -4
  479. package/dist/runtime/daimon/training/native/worker/server.js +0 -102
  480. package/dist/runtime/daimon/training/native/worker/server.js.map +0 -1
  481. package/dist/runtime/daimon/training/native/worker/types.d.ts +0 -318
  482. package/dist/runtime/daimon/training/native/worker/types.js +0 -2
  483. package/dist/runtime/daimon/training/native/worker/types.js.map +0 -1
  484. package/dist/runtime/daimon/training/native/worker/wake-delivery/index.d.ts +0 -4
  485. package/dist/runtime/daimon/training/native/worker/wake-delivery/index.js +0 -4
  486. package/dist/runtime/daimon/training/native/worker/wake-delivery/index.js.map +0 -1
  487. package/dist/runtime/daimon/training/native/worker/wake-delivery/source.d.ts +0 -3
  488. package/dist/runtime/daimon/training/native/worker/wake-delivery/source.js +0 -16
  489. package/dist/runtime/daimon/training/native/worker/wake-delivery/source.js.map +0 -1
  490. package/dist/runtime/daimon/training/native/worker/wake-delivery/terminal.d.ts +0 -4
  491. package/dist/runtime/daimon/training/native/worker/wake-delivery/terminal.js +0 -52
  492. package/dist/runtime/daimon/training/native/worker/wake-delivery/terminal.js.map +0 -1
  493. package/dist/runtime/daimon/training/native/worker/wake-delivery/transport.d.ts +0 -21
  494. package/dist/runtime/daimon/training/native/worker/wake-delivery/transport.js +0 -198
  495. package/dist/runtime/daimon/training/native/worker/wake-delivery/transport.js.map +0 -1
  496. package/dist/runtime/daimon/training/native/worker/wake-delivery/types.d.ts +0 -91
  497. package/dist/runtime/daimon/training/native/worker/wake-delivery/types.js +0 -2
  498. package/dist/runtime/daimon/training/native/worker/wake-delivery/types.js.map +0 -1
  499. package/dist/runtime/daimon/training/native/worker/worker.d.ts +0 -1
  500. package/dist/runtime/daimon/training/native/worker/worker.js +0 -105
  501. package/dist/runtime/daimon/training/native/worker/worker.js.map +0 -1
  502. package/dist/runtime/daimon/training/providers/grok-broker/broker.d.ts +0 -20
  503. package/dist/runtime/daimon/training/providers/grok-broker/broker.js +0 -55
  504. package/dist/runtime/daimon/training/providers/grok-broker/broker.js.map +0 -1
  505. package/dist/runtime/daimon/training/providers/grok-broker/grant-fixtures.d.ts +0 -15
  506. package/dist/runtime/daimon/training/providers/grok-broker/grant-fixtures.js +0 -29
  507. package/dist/runtime/daimon/training/providers/grok-broker/grant-fixtures.js.map +0 -1
  508. package/dist/runtime/daimon/training/providers/grok-broker/grant-home.d.ts +0 -16
  509. package/dist/runtime/daimon/training/providers/grok-broker/grant-home.js +0 -60
  510. package/dist/runtime/daimon/training/providers/grok-broker/grant-home.js.map +0 -1
  511. package/dist/runtime/daimon/training/providers/grok-broker/grant-pool.d.ts +0 -81
  512. package/dist/runtime/daimon/training/providers/grok-broker/grant-pool.js +0 -221
  513. package/dist/runtime/daimon/training/providers/grok-broker/grant-pool.js.map +0 -1
  514. package/dist/runtime/daimon/training/providers/grok-broker/grant-releases.d.ts +0 -31
  515. package/dist/runtime/daimon/training/providers/grok-broker/grant-releases.js +0 -78
  516. package/dist/runtime/daimon/training/providers/grok-broker/grant-releases.js.map +0 -1
  517. package/dist/runtime/daimon/training/providers/grok-broker/grants.d.ts +0 -63
  518. package/dist/runtime/daimon/training/providers/grok-broker/grants.js +0 -20
  519. package/dist/runtime/daimon/training/providers/grok-broker/grants.js.map +0 -1
  520. package/dist/runtime/daimon/training/providers/grok-broker/index.d.ts +0 -3
  521. package/dist/runtime/daimon/training/providers/grok-broker/index.js +0 -4
  522. package/dist/runtime/daimon/training/providers/grok-broker/index.js.map +0 -1
  523. package/dist/runtime/daimon/training/public.d.ts +0 -6
  524. package/dist/runtime/daimon/training/public.js +0 -5
  525. package/dist/runtime/daimon/training/public.js.map +0 -1
  526. package/dist/runtime/daimon/training/services/account-lease.d.ts +0 -7
  527. package/dist/runtime/daimon/training/services/account-lease.js +0 -76
  528. package/dist/runtime/daimon/training/services/account-lease.js.map +0 -1
  529. package/dist/runtime/daimon/training/services/freshness.d.ts +0 -15
  530. package/dist/runtime/daimon/training/services/freshness.js +0 -19
  531. package/dist/runtime/daimon/training/services/freshness.js.map +0 -1
  532. package/dist/runtime/daimon/training/services/index.d.ts +0 -4
  533. package/dist/runtime/daimon/training/services/index.js +0 -4
  534. package/dist/runtime/daimon/training/services/index.js.map +0 -1
  535. package/dist/runtime/daimon/training/services/slot-freshness.d.ts +0 -34
  536. package/dist/runtime/daimon/training/services/slot-freshness.js +0 -178
  537. package/dist/runtime/daimon/training/services/slot-freshness.js.map +0 -1
  538. package/dist/runtime/daimon/wakeMoments.js.map +0 -1
  539. package/dist/runtime/pi/adapter.d.ts +0 -3
  540. package/dist/runtime/pi/adapter.js +0 -230
  541. package/dist/runtime/pi/appActivitySource.d.ts +0 -1
  542. package/dist/runtime/pi/appActivitySource.js +0 -199
  543. package/dist/runtime/pi/appAgentConfig.d.ts +0 -11
  544. package/dist/runtime/pi/appAgentConfig.js +0 -264
  545. package/dist/runtime/pi/appCliEnginesSource.d.ts +0 -1
  546. package/dist/runtime/pi/appCliEnginesSource.js +0 -183
  547. package/dist/runtime/pi/appCliSource.d.ts +0 -1
  548. package/dist/runtime/pi/appCliSource.js +0 -353
  549. package/dist/runtime/pi/appControlSource.d.ts +0 -1
  550. package/dist/runtime/pi/appControlSource.js +0 -390
  551. package/dist/runtime/pi/appControlWakeIdentitySource.d.ts +0 -1
  552. package/dist/runtime/pi/appControlWakeIdentitySource.js +0 -19
  553. package/dist/runtime/pi/appCoreSource.d.ts +0 -4
  554. package/dist/runtime/pi/appCoreSource.js +0 -244
  555. package/dist/runtime/pi/appPreludeSource.d.ts +0 -1
  556. package/dist/runtime/pi/appPreludeSource.js +0 -192
  557. package/dist/runtime/pi/appScheduleSource.d.ts +0 -1
  558. package/dist/runtime/pi/appScheduleSource.js +0 -84
  559. package/dist/runtime/pi/appScriptedEngine.d.ts +0 -31
  560. package/dist/runtime/pi/appScriptedEngine.js +0 -42
  561. package/dist/runtime/pi/appSource.d.ts +0 -4
  562. package/dist/runtime/pi/appSource.js +0 -12
  563. package/dist/runtime/pi/appTemplate.d.ts +0 -14
  564. package/dist/runtime/pi/appTemplate.js +0 -28
  565. package/dist/runtime/pi/appTemplateTypes.d.ts +0 -64
  566. package/dist/runtime/pi/appTemplateTypes.js +0 -18
  567. package/dist/runtime/pi/appWakeContextSource.d.ts +0 -1
  568. package/dist/runtime/pi/appWakeContextSource.js +0 -398
  569. package/dist/runtime/pi/containerTargets.d.ts +0 -4
  570. package/dist/runtime/pi/containerTargets.js +0 -63
  571. package/dist/runtime/pi/runAuth.d.ts +0 -2
  572. package/dist/runtime/pi/runAuth.js +0 -185
  573. package/dist/runtime/pi/testHelpers.d.ts +0 -2
  574. package/dist/shared/errors.js.map +0 -1
  575. package/dist/training/subjects/environment.d.ts +0 -2
  576. package/dist/training/subjects/environment.js +0 -14
  577. package/dist/training/subjects/environment.js.map +0 -1
  578. /package/dist/runtime/{codex-exec → daimon}/training/providers/codex-subscription/index.d.ts +0 -0
  579. /package/dist/runtime/{codex-exec → daimon}/training/providers/codex-subscription/index.js +0 -0
  580. /package/dist/runtime/{codex-exec → daimon}/training/providers/codex-subscription/protocol.d.ts +0 -0
  581. /package/dist/runtime/{codex-exec → daimon}/training/providers/codex-subscription/protocol.js +0 -0
  582. /package/dist/runtime/{codex-exec → daimon}/training/providers/codex-subscription/provider.d.ts +0 -0
  583. /package/dist/runtime/{codex-exec → daimon}/training/providers/codex-subscription/provider.js +0 -0
  584. /package/dist/runtime/{codex-exec → daimon}/training/providers/codex-subscription/strict-schema.d.ts +0 -0
  585. /package/dist/runtime/{codex-exec → daimon}/training/providers/codex-subscription/strict-schema.js +0 -0
@@ -1,15 +0,0 @@
1
- import type { VerifiedNativeLaunch } from '../receipt/index.js';
2
- import type { DockerCommand } from './docker.js';
3
- /** Same namespace compatibility policy as Spawnfile's strict native Codex launch. */
4
- export declare const codexSandboxContainerSecurity: readonly ["--security-opt", "seccomp=unconfined", "--security-opt", "apparmor=unconfined"];
5
- /** Separate-container Grok needs a broker, realm and root slot supervisor this adapter does not own. */
6
- export declare const grokContainerUnsupported = "Separate-container Grok native trials are unsupported: run Grok through child-process execution in the broker-capable training container";
7
- /** Codex's bubblewrap needs unconfined outer profiles; no other engine inherits them. */
8
- export declare function containerSecurityOptions(launch: VerifiedNativeLaunch): readonly string[];
9
- export declare const sandboxPreflightSchema = "spawnfile.training.daimon-native.sandbox-preflight.v1";
10
- export declare const sandboxChecks: readonly ["namespace", "workspaceRead", "workspaceWrite", "runDenied", "authDenied", "ingressDenied", "networkDenied"];
11
- /** Shared verbatim by the emitted command and transition tests. A timeout proves nothing. */
12
- export declare const sandboxNetworkProbeScript = "\nlet settled=false;\nconst socket=net.connect({host:'127.0.0.1',port});\nconst fail=message=>{if(settled)return;settled=true;socket.destroy();process.stderr.write(message);process.exitCode=1;};\nsocket.once('connect',()=>fail('Sandbox network reachable'));\nsocket.once('error',()=>{if(settled)return;settled=true;socket.destroy();fs.writeFileSync('complete','SANDBOX_CHECKS_PASSED');});\nsocket.setTimeout(750,()=>fail('Sandbox network probe timed out'));";
13
- /** Runs only local sandbox commands with non-secret canaries and a fresh Codex home. */
14
- export declare const sandboxPreflightScript: string;
15
- export declare function verifyNativeSandbox(run: DockerCommand, name: string, launch: VerifiedNativeLaunch, trialId: string, signal?: AbortSignal): Promise<void>;
@@ -1,79 +0,0 @@
1
- import { canonicalWireId } from '../../../../../training/index.js';
2
- import { writeFile } from 'node:fs/promises';
3
- import { dirname, join } from 'node:path';
4
- import { verifyPreparedNativeSandbox } from './native-preflight.js';
5
- /** Same namespace compatibility policy as Spawnfile's strict native Codex launch. */
6
- export const codexSandboxContainerSecurity = ['--security-opt', 'seccomp=unconfined', '--security-opt', 'apparmor=unconfined'];
7
- /** Separate-container Grok needs a broker, realm and root slot supervisor this adapter does not own. */
8
- export const grokContainerUnsupported = 'Separate-container Grok native trials are unsupported: run Grok through child-process execution in the broker-capable training container';
9
- /** Codex's bubblewrap needs unconfined outer profiles; no other engine inherits them. */
10
- export function containerSecurityOptions(launch) {
11
- if (launch.agent.engine !== 'codex')
12
- throw new Error(grokContainerUnsupported);
13
- return codexSandboxContainerSecurity;
14
- }
15
- export const sandboxPreflightSchema = 'spawnfile.training.daimon-native.sandbox-preflight.v1';
16
- export const sandboxChecks = ['namespace', 'workspaceRead', 'workspaceWrite', 'runDenied', 'authDenied', 'ingressDenied', 'networkDenied'];
17
- /** Shared verbatim by the emitted command and transition tests. A timeout proves nothing. */
18
- export const sandboxNetworkProbeScript = `
19
- let settled=false;
20
- const socket=net.connect({host:'127.0.0.1',port});
21
- const fail=message=>{if(settled)return;settled=true;socket.destroy();process.stderr.write(message);process.exitCode=1;};
22
- socket.once('connect',()=>fail('Sandbox network reachable'));
23
- socket.once('error',()=>{if(settled)return;settled=true;socket.destroy();fs.writeFileSync('complete','SANDBOX_CHECKS_PASSED');});
24
- socket.setTimeout(750,()=>fail('Sandbox network probe timed out'));`;
25
- /** Runs only local sandbox commands with non-secret canaries and a fresh Codex home. */
26
- export const sandboxPreflightScript = `
27
- import {execFile} from 'node:child_process';
28
- import {promisify} from 'node:util';
29
- import {mkdtemp,mkdir,readFile,writeFile,rm} from 'node:fs/promises';
30
- import {join} from 'node:path';
31
- import {createServer} from 'node:net';
32
- const execute=promisify(execFile);
33
- const input=JSON.parse(await new Promise(resolve=>{let s='';process.stdin.setEncoding('utf8');process.stdin.on('data',v=>s+=v);process.stdin.on('end',()=>resolve(s));}));
34
- const scratch=await mkdtemp(join(input.workspace,'.spawnfile-training-sandbox-preflight-'));
35
- let controls; let server;
36
- try {
37
- controls=await mkdtemp(join(input.controlRoot,'.sandbox-preflight-'));
38
- const home=join(scratch,'home'), workspace=join(scratch,'workspace'), ingress=join(home,'.daimon-inbound');
39
- await mkdir(join(home,'.codex'),{recursive:true,mode:448}); await mkdir(workspace,{mode:448}); await mkdir(ingress,{mode:448});
40
- const auth=join(home,'.codex','auth.json'), inbound=join(ingress,'canary'), control=join(controls,'canary');
41
- await writeFile(auth,'{}',{mode:384}); await writeFile(inbound,'non-secret ingress canary',{mode:384}); await writeFile(control,'non-secret control canary',{mode:384});
42
- await writeFile(join(workspace,'input'),'read-proof',{mode:384});
43
- for (const file of [auth,inbound,control]) if (!(await readFile(file)).length) throw Error('Missing outside-sandbox canary');
44
- server=createServer(socket=>socket.destroy());
45
- await new Promise((resolve,reject)=>{server.once('error',reject);server.listen(0,'127.0.0.1',resolve);});
46
- const port=server.address().port;
47
- const env={PATH:process.env.PATH,HOME:home,CODEX_HOME:join(home,'.codex'),TMPDIR:'/tmp',LANG:'C.UTF-8'};
48
- await execute('bwrap',['--unshare-user','--uid','0','--gid','0','--ro-bind','/','/','--proc','/proc','--dev','/dev','--','/bin/true'],{env,timeout:10000,maxBuffer:65536});
49
- const profile='permissions={preflight={extends=":workspace",filesystem={":workspace_roots"={"."="write"},"/run"="deny","/proc"="deny",'+JSON.stringify(auth)+'="deny",'+JSON.stringify(ingress)+'="deny"},network={enabled=false}}}';
50
- const command=\`const fs=require('node:fs'),net=require('node:net');
51
- if(fs.readFileSync('input','utf8')!=='read-proof')throw Error('Workspace read failed');
52
- fs.writeFileSync('output','write-proof');
53
- for(const file of \${JSON.stringify([control,auth,inbound])}) { let denied=false; try{fs.readFileSync(file);}catch{denied=true;} if(!denied)throw Error('Protected canary is readable'); }
54
- const port=\${port};
55
- ${sandboxNetworkProbeScript}\`;
56
- await execute('codex',['sandbox','-P','preflight','-C',workspace,'-c',profile,'--','/usr/local/bin/node','-e',command],{env,timeout:12000,maxBuffer:65536});
57
- if(await readFile(join(workspace,'complete'),'utf8')!=='SANDBOX_CHECKS_PASSED'||await readFile(join(workspace,'output'),'utf8')!=='write-proof')throw Error('Sandbox did not complete its actual command');
58
- process.stdout.write(JSON.stringify({schema:'${sandboxPreflightSchema}',modelCallsMade:0,checks:Object.fromEntries(${JSON.stringify(sandboxChecks)}.map(key=>[key,true]))}));
59
- } finally {
60
- if(server)await new Promise(resolve=>server.close(resolve));
61
- if(controls)await rm(controls,{recursive:true,force:true});
62
- await rm(scratch,{recursive:true,force:true});
63
- }
64
- `;
65
- export async function verifyNativeSandbox(run, name, launch, trialId, signal) {
66
- const result = await run(['exec', '-i', name, '/usr/local/bin/node', '--input-type=module', '-e', sandboxPreflightScript], {
67
- signal, timeoutMs: 25_000, stdin: JSON.stringify({ path: 'sandbox-preflight', workspace: launch.workspace.target, controlRoot: '/run/spawnfile-training/control' }),
68
- });
69
- if (result.code !== 0)
70
- throw new Error(`Native sandbox preflight failed before cognition: ${result.stderr.slice(-3000)}`);
71
- const proof = JSON.parse(result.stdout);
72
- if (canonicalWireId(proof.schema) !== sandboxPreflightSchema || proof.modelCallsMade !== 0 || sandboxChecks.some(check => proof.checks?.[check] !== true)) {
73
- throw new Error('Native sandbox preflight omitted substantive enforcement evidence');
74
- }
75
- const nativePolicy = await verifyPreparedNativeSandbox(run, name, launch, trialId, signal);
76
- await writeFile(join(dirname(launch.receiptFile), 'sandbox-preflight.json'), `${JSON.stringify({ ...proof, trialId,
77
- image: launch.image, configSha256: launch.configSha256, nativePolicy, outerCompatibility: [...codexSandboxContainerSecurity] }, null, 2)}\n`, { flag: 'wx', mode: 0o600 });
78
- }
79
- //# sourceMappingURL=preflight.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"preflight.js","sourceRoot":"","sources":["../../../../../../src/runtime/daimon/training/native/container/preflight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAG1C,OAAO,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAEpE,qFAAqF;AACrF,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,gBAAg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C;IACH,IAAI,MAAM,CAAC,IAAI,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,qDAAqD,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1H,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAmF,CAAC;IAC1H,IAAI,eAAe,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,sBAAsB,IAAI,KAAK,CAAC,cAAc,KAAK,CAAC,IAAI,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,EAAE,CAAC;QAC1J,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;IACvF,CAAC;IACD,MAAM,YAAY,GAAG,MAAM,2BAA2B,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC3F,MAAM,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,wBAAwB,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,KAAK,EAAE,OAAO;QAChH,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,CAAC,GAAG,6BAA6B,CAAC,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;AAC/K,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { TrialSlot } from '../../../../../training/index.js';
2
- import { type NativeLaunch } from '../receipt/index.js';
3
- /** Verify the project-written receipt before copying it to the owned child. */
4
- export declare function assertLeasedLaunch(launch: NativeLaunch, slot: TrialSlot): void;
@@ -1,58 +0,0 @@
1
- import { isGrokLaunch } from '../receipt/index.js';
2
- /** Verify the project-written receipt before copying it to the owned child. */
3
- export function assertLeasedLaunch(launch, slot) {
4
- if (slot.isolation === 'shared-uid') {
5
- if (isGrokLaunch(launch) || slot.workerUid !== process.geteuid?.()) {
6
- throw new Error('Native launch does not belong to the leased shared-uid slot');
7
- }
8
- if (!Number.isSafeInteger(slot.ports.base) || slot.ports.base < 1024 ||
9
- !Number.isSafeInteger(slot.ports.count) || slot.ports.count < 1 || slot.ports.base + slot.ports.count > 65536) {
10
- throw new Error('Invalid native leased port block');
11
- }
12
- if (!Number.isSafeInteger(launch.host.port))
13
- throw new Error('Native control port must be an integer');
14
- if (launch.host.port < slot.ports.base || launch.host.port >= slot.ports.base + slot.ports.count) {
15
- throw new Error('Native control port escapes the leased slot');
16
- }
17
- const paths = {
18
- workspace: [launch.workspace],
19
- controlRoot: [{ source: launch.controlRoot, target: launch.controlRoot }],
20
- };
21
- for (const row of launch.projections) {
22
- const name = row.role === 'home' ? 'runtimeHome' : row.role;
23
- (paths[name] ??= []).push(row);
24
- }
25
- for (const [name, root] of Object.entries(slot.roots)) {
26
- const matches = paths[name];
27
- const declared = matches?.[0];
28
- if (matches?.length !== 1 || !declared || declared.source !== root || declared.target !== root) {
29
- throw new Error(`Native launch differs from leased slot root: ${name}`);
30
- }
31
- }
32
- return;
33
- }
34
- if (!isGrokLaunch(launch))
35
- throw new Error('Leased native launch requires broker slot evidence');
36
- if (launch.broker.slot !== slot.index || launch.broker.workerUid !== slot.workerUid) {
37
- throw new Error('Native launch does not belong to the leased slot identity');
38
- }
39
- const paths = {
40
- workspace: launch.workspace.source,
41
- runtimeHome: launch.projections.find(row => row.role === 'home').source,
42
- workerHome: launch.broker.workerHomePath,
43
- usageLedger: launch.broker.usageLedgerPath,
44
- preflightReceipt: launch.broker.slotPreflightReceipt,
45
- controlRoot: launch.controlRoot,
46
- };
47
- for (const [name, path] of Object.entries(paths)) {
48
- if (slot.roots[name] !== path)
49
- throw new Error(`Native launch differs from leased slot root: ${name}`);
50
- }
51
- if (!Number.isSafeInteger(launch.host.port))
52
- throw new Error('Native control port must be an integer');
53
- if (launch.workspace.target !== paths.workspace || launch.projections[0].target !== paths.runtimeHome ||
54
- launch.host.port < slot.ports.base || launch.host.port >= slot.ports.base + slot.ports.count) {
55
- throw new Error('Native launch paths or control port escape the leased slot');
56
- }
57
- }
58
- //# sourceMappingURL=slot.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"slot.js","sourceRoot":"","sources":["../../../../../../src/runtime/daimon/training/native/container/slot.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAqB,MAAM,qBAAqB,CAAC;AAEtE,+EAA+E;AAC/E,MAAM,UAAU,kBAAkB,CAAC,MAAoB,EAAE,IAAe;IACtE,IAAI,IAAI,CAAC,SAAS,KAAK,YAAY,EAAE,CAAC;QACpC,IAAI,YAAY,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,SAAS,KAAK,OAAO,CAAC,OAAO,EAAE,EAAE,EAAE,CAAC;YACnE,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;QACjF,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI;YAChE,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,EAAE,CAAC;YAClH,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;QACtD,CAAC;QACD,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,wCA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I,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;QACjG,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;IAChF,CAAC;AACH,CAAC"}
@@ -1,37 +0,0 @@
1
- import type { ObservationCoverage, Usage } from '../../../../training/index.js';
2
- import type { NativeLaunch } from './receipt/index.js';
3
- import { type ExternalInputSource, type TerminalEvidence } from './worker/index.js';
4
- import { type PreparedTransportDelivery } from './transport/index.js';
5
- export interface NativeExternalInput {
6
- id: string;
7
- text: string;
8
- source: ExternalInputSource;
9
- transport?: PreparedTransportDelivery;
10
- }
11
- export interface NativeExternalInputs {
12
- maxDeliveries: number;
13
- next(context: {
14
- trialId: string;
15
- turnId: string;
16
- containerName: string;
17
- launch: NativeLaunch;
18
- terminal: TerminalEvidence;
19
- }, signal: AbortSignal): Promise<NativeExternalInput | null>;
20
- }
21
- export interface NativeChildExternalInputs {
22
- maxDeliveries: number;
23
- next(context: {
24
- trialId: string;
25
- turnId: string;
26
- executionId: string;
27
- launch: NativeLaunch;
28
- terminal: TerminalEvidence;
29
- }, signal: AbortSignal): Promise<NativeExternalInput | null>;
30
- }
31
- /** A callback may supply evidence; it cannot extend the task deadline or invent a retry. */
32
- export declare function nextExternalInput<T>(policy: {
33
- next(context: T, signal: AbortSignal): Promise<NativeExternalInput | null>;
34
- }, context: T, deadline: number, signal: AbortSignal): Promise<NativeExternalInput | null>;
35
- export declare function sumNativeUsage(rows: readonly (Usage | null)[]): Usage | null;
36
- /** Missing coverage in any wake cannot be repaired by a later complete wake. */
37
- export declare function weakestNativeCoverage(rows: readonly (readonly ObservationCoverage[] | undefined)[]): ObservationCoverage[];
@@ -1,75 +0,0 @@
1
- import { verifyExternalSource } from './worker/index.js';
2
- import { verifyPreparedTransport } from './transport/index.js';
3
- /** A callback may supply evidence; it cannot extend the task deadline or invent a retry. */
4
- export async function nextExternalInput(policy, context, deadline, signal) {
5
- if (signal.aborted)
6
- throw new Error('External input cancelled');
7
- const remaining = deadline - Date.now();
8
- if (remaining <= 0)
9
- throw new Error('Native trial deadline exceeded awaiting external input');
10
- const controller = new AbortController();
11
- let timer;
12
- let abort;
13
- const interrupted = new Promise((_resolve, reject) => {
14
- abort = () => { controller.abort(); reject(new Error('External input cancelled')); };
15
- signal.addEventListener('abort', abort, { once: true });
16
- timer = setTimeout(() => { controller.abort(); reject(new Error('Native trial deadline exceeded awaiting external input')); }, remaining);
17
- });
18
- try {
19
- const input = await Promise.race([policy.next(context, controller.signal), interrupted]);
20
- if (signal.aborted)
21
- throw new Error('External input cancelled');
22
- if (input !== null) {
23
- const keys = Object.keys(input).sort().join(',');
24
- if ((keys !== 'id,source,text' && keys !== 'id,source,text,transport') ||
25
- !/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/u.test(input.id) || !input.text.trim() || Buffer.byteLength(input.text) > 16384)
26
- throw new Error('Invalid external input');
27
- verifyExternalSource(input.source, input.text);
28
- if (keys.endsWith(',transport'))
29
- verifyPreparedTransport(input.transport, true);
30
- }
31
- return input;
32
- }
33
- finally {
34
- clearTimeout(timer);
35
- signal.removeEventListener('abort', abort);
36
- controller.abort();
37
- }
38
- }
39
- export function sumNativeUsage(rows) {
40
- if (!rows.length || rows.some(row => row === null))
41
- return null;
42
- const sum = (key) => {
43
- const values = rows.map(row => row[key]);
44
- if (values.some(value => value === null))
45
- return null;
46
- const total = values.reduce((sum, value) => sum + value, 0);
47
- if (!Number.isSafeInteger(total) || total < 0)
48
- throw new Error('Invalid aggregate native usage');
49
- return total;
50
- };
51
- const totals = { inputTokens: sum('inputTokens'), cachedInputTokens: sum('cachedInputTokens'), outputTokens: sum('outputTokens') };
52
- // Optional members appear only when a wake reported them, so Codex aggregates keep their exact shape.
53
- const extra = {};
54
- if (rows.some(row => row.cacheWriteInputTokens !== undefined))
55
- extra.cacheWriteInputTokens = rows.some(row => row.cacheWriteInputTokens == null) ? null
56
- : rows.reduce((total, row) => total + row.cacheWriteInputTokens, 0);
57
- if (rows.some(row => row.notionalUsd !== undefined))
58
- extra.notionalUsd = rows.some(row => row.notionalUsd == null) ? null
59
- : rows.reduce((total, row) => total + row.notionalUsd, 0);
60
- return rows.length === 1 ? { ...rows[0], ...totals }
61
- : { ...totals, ...extra, reasoningTokens: null, source: 'noopolis.daimon.turn-usage.v1' };
62
- }
63
- /** Missing coverage in any wake cannot be repaired by a later complete wake. */
64
- export function weakestNativeCoverage(rows) {
65
- const channels = new Set(rows.flatMap(row => row?.map(item => item.channel) ?? []));
66
- return [...channels].map(channel => {
67
- const values = rows.map(row => row?.find(item => item.channel === channel));
68
- const completeness = values.some(value => !value || value.completeness === 'absent') ? 'absent'
69
- : values.some(value => value?.completeness === 'partial') ? 'partial' : 'complete';
70
- const ordering = values.every(value => value?.ordering === 'causal') ? 'causal'
71
- : values.every(value => value && value.ordering !== 'none') ? 'source' : 'none';
72
- return { channel, completeness, ordering };
73
- });
74
- }
75
- //# sourceMappingURL=external.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"external.js","sourceRoot":"","sources":["../../../../../src/runtime/daimon/training/native/external.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAmD,MAAM,mBAAmB,CAAC;AAC1G,OAAO,EAAE,uBAAuB,EAAkC,MAAM,sBAAsB,CAAC;AAe/F,4FAA4F;AAC5F,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAI,MAAsF,EAAE,OAAU,EAC3I,QAAgB,EAAE,MAAmB;IACrC,IAAI,MAAM,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAChE,MAAM,SAAS,GAAG,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACxC,IAAI,SAAS,IAAI,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,wDAA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AAC"}
@@ -1,36 +0,0 @@
1
- import { type GrokClientConfigInput, type GrokInferenceGrant, type GrokInferenceGrantAuthority } from '../../providers/grok-broker/index.js';
2
- /** Structural slice of `@noopolis/daimon/runtime` this binding uses. */
3
- export interface DaimonGrantModule {
4
- EngineBrokerControlClient: new (socketPath: string) => {
5
- requestInferenceGrant(request: {
6
- model: string;
7
- reasoningEffort: string;
8
- purpose: string;
9
- }): Promise<GrokInferenceGrant>;
10
- releaseInferenceGrant(grantId: string): Promise<boolean>;
11
- };
12
- EngineBrokerInferenceGrantRefused: new (...args: never[]) => Error & {
13
- code: string;
14
- };
15
- renderGrokInferenceClientConfig(input: GrokClientConfigInput): string;
16
- GROK_INFERENCE_CLIENT_MODEL_ID: string;
17
- GROK_INFERENCE_GRANT_ENV: string;
18
- GROK_INFERENCE_PROXY_BASE_URL: string;
19
- GROK_ENGINE_BROKER: {
20
- inferenceGrants: {
21
- maxLiveGrants: number;
22
- failureCodes: readonly string[];
23
- client: {
24
- modelId: string;
25
- envKey: string;
26
- configSha256: unknown;
27
- };
28
- };
29
- };
30
- }
31
- export { grokBrokerControlSocketEnv, grokGrantHomeRootEnv } from '../../providers/grok-broker/index.js';
32
- /**
33
- * Daimon-backed grant authority over the control socket the training container
34
- * supplies. Every precondition failure throws; nothing falls back to a desktop login.
35
- */
36
- export declare function loadDaimonGrokGrantAuthority(socketPath: string | undefined, load?: () => Promise<unknown>): Promise<GrokInferenceGrantAuthority>;
@@ -1,49 +0,0 @@
1
- import { lstat } from 'node:fs/promises';
2
- import path from 'node:path';
3
- import { isDeepStrictEqual } from 'node:util';
4
- import { GrokGrantRefusal, grokGrantRefusalCodes } from '../../providers/grok-broker/index.js';
5
- import { daimonGrokInferenceClientPin as PIN } from './pins.js';
6
- import { grokBrokerControlSocketEnv } from '../../providers/grok-broker/index.js';
7
- export { grokBrokerControlSocketEnv, grokGrantHomeRootEnv } from '../../providers/grok-broker/index.js';
8
- const loadRuntime = async () => {
9
- const packageName = '@noopolis/daimon/runtime';
10
- return import(packageName);
11
- };
12
- /**
13
- * Daimon-backed grant authority over the control socket the training container
14
- * supplies. Every precondition failure throws; nothing falls back to a desktop login.
15
- */
16
- export async function loadDaimonGrokGrantAuthority(socketPath, load = loadRuntime) {
17
- if (socketPath === undefined || !path.isAbsolute(socketPath))
18
- throw new Error(`${grokBrokerControlSocketEnv} must name the broker control socket`);
19
- const socket = await lstat(socketPath).catch(() => undefined);
20
- if (socket === undefined || !socket.isSocket())
21
- throw new Error('Grok broker control socket is unavailable');
22
- let daimon;
23
- try {
24
- daimon = await load();
25
- }
26
- catch (error) {
27
- throw new Error('Install optional @noopolis/daimon with its public /runtime export for broker-grant inference', { cause: error });
28
- }
29
- const grants = daimon.GROK_ENGINE_BROKER?.inferenceGrants;
30
- if (typeof daimon.EngineBrokerControlClient !== 'function' || typeof daimon.EngineBrokerInferenceGrantRefused !== 'function' ||
31
- typeof daimon.renderGrokInferenceClientConfig !== 'function' || grants === undefined)
32
- throw new Error('Installed Daimon lacks evaluator inference grants');
33
- if (daimon.GROK_INFERENCE_CLIENT_MODEL_ID !== PIN.modelId || daimon.GROK_INFERENCE_GRANT_ENV !== PIN.envKey || daimon.GROK_INFERENCE_PROXY_BASE_URL !== PIN.proxyBaseUrl ||
34
- grants.maxLiveGrants !== PIN.maxLiveGrants || !isDeepStrictEqual([...grants.failureCodes], PIN.failureCodes) || grants.client.modelId !== PIN.modelId ||
35
- grants.client.envKey !== PIN.envKey || !isDeepStrictEqual(grants.client.configSha256, PIN.configSha256)) {
36
- throw new Error('Installed Daimon inference client contract differs from the Training pin');
37
- }
38
- const client = new daimon.EngineBrokerControlClient(socketPath);
39
- const refusal = (error) => error instanceof daimon.EngineBrokerInferenceGrantRefused && grokGrantRefusalCodes.includes(error.code)
40
- ? new GrokGrantRefusal(error.code) : error;
41
- return Object.freeze({
42
- clientModelId: PIN.modelId, envKey: PIN.envKey, maxLiveGrants: PIN.maxLiveGrants,
43
- request: input => client.requestInferenceGrant(input).catch((error) => { throw refusal(error); }),
44
- release: grantId => client.releaseInferenceGrant(grantId).catch((error) => { throw refusal(error); }),
45
- renderClientConfig: input => daimon.renderGrokInferenceClientConfig(input),
46
- pinnedClientConfigSha256: (model, reasoningEffort) => PIN.configSha256[model]?.[reasoningEffort],
47
- });
48
- }
49
- //# sourceMappingURL=authority.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"authority.js","sourceRoot":"","sources":["../../../../../../src/runtime/daimon/training/native/grants/authority.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,qBAAqB,EACZ,MAAM,sCAAsC,CAAC;AACjF,OAAO,EAAE,4BAA4B,IAAI,GAAG,EAAE,MAAM,WAAW,CAAC;AAgBhE,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAClF,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAExG,MAAM,WAAW,GAAG,KAAK,IAAsB,EAAE;IAC/C,MAAM,WAAW,GAAG,0BAA0B,CAAC;IAC/C,OAAO,MAAM,CAAC,WAAW,CAAC,CAAC;AAC7B,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAAC,UAA8B,EAAE,OAA+B,WAAW;IAC3H,IAAI,UAAU,KAAK,SAAS,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,0BAA0B,sCAAsC,CAAC,CAAC;IACnJ,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;IAC9D,IAAI,MAAM,KAAK,SAAS,IAAI,C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AAU,CAAC,CAAC;IAChE,MAAM,OAAO,GAAG,CAAC,KAAc,EAAW,EAAE,CAAC,KAAK,YAAY,MAAM,CAAC,iCAAiC,IAAK,qBAA2C,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC;QACzK,CAAC,CAAC,IAAI,gBAAgB,CAAC,KAAK,CAAC,IAA4B,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACrE,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,aAAa,EAAE,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,GAAG,CAAC,aAAa;QAChF,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1G,OAAO,EAAE,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE,GAAG,MAAM,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAC9G,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,MAAM,CAAC,+BAA+B,CAAC,KAAK,CAAC;QAC1E,wBAAwB,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,EAAE,CAAE,GAAG,CAAC,YAAyE,CAAC,KAAK,CAAC,EAAE,CAAC,eAAe,CAAC;KACzH,CAAC,CAAC;AAC3C,CAAC"}
@@ -1,2 +0,0 @@
1
- export { grokBrokerControlSocketEnv, grokGrantHomeRootEnv, loadDaimonGrokGrantAuthority, type DaimonGrantModule } from './authority.js';
2
- export { daimonGrokInferenceClientPin } from './pins.js';
@@ -1,3 +0,0 @@
1
- export { grokBrokerControlSocketEnv, grokGrantHomeRootEnv, loadDaimonGrokGrantAuthority } from './authority.js';
2
- export { daimonGrokInferenceClientPin } from './pins.js';
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/runtime/daimon/training/native/grants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,4BAA4B,EAA0B,MAAM,gBAAgB,CAAC;AACxI,OAAO,EAAE,4BAA4B,EAAE,MAAM,WAAW,CAAC"}
@@ -1,30 +0,0 @@
1
- /**
2
- * Training's pin of Daimon's evaluator inference client contract
3
- * (`GROK_ENGINE_BROKER.inferenceGrants` in runtime-contract-manifest v4, Grok CLI 1.0.34).
4
- * These inference-only bytes are unchanged by the clocked subject worker config.
5
- * Independent of the installed Daimon so drift in either side fails closed.
6
- */
7
- export declare const daimonGrokInferenceClientPin: Readonly<{
8
- modelId: "daimon-inference-grok";
9
- envKey: "DAIMON_INFERENCE_GRANT";
10
- proxyBaseUrl: "http://127.0.0.1:43123/v1";
11
- maxLiveGrants: 8;
12
- failureCodes: string[];
13
- configSha256: {
14
- 'grok-4.6': {
15
- low: string;
16
- medium: string;
17
- high: string;
18
- };
19
- 'grok-4.5': {
20
- low: string;
21
- medium: string;
22
- high: string;
23
- };
24
- 'grok-build': {
25
- low: string;
26
- medium: string;
27
- high: string;
28
- };
29
- };
30
- }>;
@@ -1,20 +0,0 @@
1
- import { grokGrantEnvKey } from '../../providers/grok-broker/index.js';
2
- /**
3
- * Training's pin of Daimon's evaluator inference client contract
4
- * (`GROK_ENGINE_BROKER.inferenceGrants` in runtime-contract-manifest v4, Grok CLI 1.0.34).
5
- * These inference-only bytes are unchanged by the clocked subject worker config.
6
- * Independent of the installed Daimon so drift in either side fails closed.
7
- */
8
- export const daimonGrokInferenceClientPin = Object.freeze({
9
- modelId: 'daimon-inference-grok',
10
- envKey: grokGrantEnvKey,
11
- proxyBaseUrl: 'http://127.0.0.1:43123/v1',
12
- maxLiveGrants: 8,
13
- failureCodes: ['auth_stale', 'grant_limit', 'invalid_request', 'unavailable'],
14
- configSha256: {
15
- 'grok-4.6': { low: '79314d039f787e4ebfec7dacf57adc969086b948f564dec008f0ed6367e6062f', medium: '6f538de0547c0c4e6a3f04ae08595ceadadabb06b75f6b6ee4c428744bb95cd8', high: '5652656effa82f0c4f09cf8226b16e6140332a5a358b571194bb5563312367ac' },
16
- 'grok-4.5': { low: 'a07f7436f1268bb399ec233c65d3b3d8fb99a11a1f175f8da1ca133c9367bc74', medium: '1f4c0d4dad1f3b09419b5739db6423a09e0049abc091594c64123a75dd53dfb9', high: 'ffbc33728b821e9854fbc7c93601e599225da421ecfd6ebf10d314afcc28d6f2' },
17
- 'grok-build': { low: 'ca15c6a562a008227d39c51d3a3a83715663089b3784e8b46debb1fb67b3c4a1', medium: '01783fb6beadcf6f8486fff0836820ad43fab5662b812a907fe9cfdb83e9804d', high: '98d16f2b7d12f4eb540d625c853e51d227933e204923e43e8b9b4176f10aca2c' },
18
- },
19
- });
20
- //# sourceMappingURL=pins.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pins.js","sourceRoot":"","sources":["../../../../../../src/runtime/daimon/training/native/grants/pins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAsD,MAAM,sCAAsC,CAAC;AAE3H;;;;;GAKG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,MAAM,CAAC,MAAM,CAAC;IACxD,OAAO,EAAE,uBAAuB;IAChC,MAAM,EAAE,eAAe;IACvB,YAAY,EAAE,2BAA2B;IACzC,aAAa,EAAE,CAAC;IAChB,YAAY,EAAE,CAAC,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,aAAa,CAAC;IAC7E,YAAY,EAAE;QACZ,UAAU,EAAE,EAAE,GAAG,EAAE,kEAAkE,EAAE,MAAM,EAAE,kEAAkE,EAAE,IAAI,EAAE,kEAAkE,EAAE;QAC7O,UAAU,EAAE,EAAE,GAAG,EAAE,kEAAkE,EAAE,MAAM,EAAE,kEAAkE,EAAE,IAAI,EAAE,kEAAkE,EAAE;QAC7O,YAAY,EAAE,EAAE,GAAG,EAAE,kEAAkE,EAAE,MAAM,EAAE,kEAAkE,EAAE,IAAI,EAAE,kEAAkE,EAAE;KACrK;CAC7E,CAAC,CAAC"}
@@ -1,6 +0,0 @@
1
- /** Test-only broker control socket speaking Daimon's length-prefixed JSON frames with scripted answers. */
2
- export declare function scriptedBrokerSocket(answer: (request: Record<string, unknown>) => Record<string, unknown> | undefined): Promise<{
3
- socketPath: string;
4
- received: Record<string, unknown>[];
5
- close: () => Promise<void>;
6
- }>;
@@ -1,35 +0,0 @@
1
- import { mkdtemp, rm } from 'node:fs/promises';
2
- import { createServer } from 'node:net';
3
- import { tmpdir } from 'node:os';
4
- import path from 'node:path';
5
- /** Test-only broker control socket speaking Daimon's length-prefixed JSON frames with scripted answers. */
6
- export async function scriptedBrokerSocket(answer) {
7
- const dir = await mkdtemp(path.join(tmpdir(), 'training-broker-'));
8
- const socketPath = path.join(dir, 'control.sock');
9
- const received = [];
10
- const server = createServer(connection => {
11
- let buffered = Buffer.alloc(0);
12
- connection.on('data', chunk => {
13
- buffered = Buffer.concat([buffered, chunk]);
14
- while (buffered.length >= 4 && buffered.length >= buffered.readUInt32BE(0) + 4) {
15
- const length = buffered.readUInt32BE(0);
16
- const request = JSON.parse(buffered.subarray(4, 4 + length).toString('utf8'));
17
- buffered = buffered.subarray(4 + length);
18
- received.push(request);
19
- const response = answer(request);
20
- if (response === undefined) {
21
- connection.destroy();
22
- return;
23
- }
24
- const body = Buffer.from(JSON.stringify({ version: request['version'], requestId: request['requestId'], ...response }));
25
- const frame = Buffer.alloc(4 + body.length);
26
- frame.writeUInt32BE(body.length);
27
- body.copy(frame, 4);
28
- connection.write(frame);
29
- }
30
- });
31
- });
32
- await new Promise(resolve => server.listen(socketPath, resolve));
33
- return { socketPath, received, close: async () => { await new Promise(resolve => server.close(resolve)); await rm(dir, { recursive: true, force: true }); } };
34
- }
35
- //# sourceMappingURL=test-socket.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"test-socket.js","sourceRoot":"","sources":["../../../../../../src/runtime/daimon/training/native/grants/test-socket.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAe,MAAM,UAAU,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,2GAA2G;AAC3G,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,MAAiF;IAC1H,MAAM,GAAG,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,kBAAkB,CAAC,CAAC,CAAC;IACnE,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;IAClD,MAAM,QAAQ,GAA8B,EAAE,CAAC;IAC/C,MAAM,MAAM,GAAW,YAAY,CAAC,UAAU,CAAC,EAAE;QAC/C,IAAI,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC/B,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE;YAC5B,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;YAC5C,OAAO,QAAQ,CAAC,MAAM,IAAI,CAAC,IAAI,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC/E,MAAM,MAAM,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;gBACxC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,CAAC,QAAQ,CAAC,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,CAAC,CAAC,EAAE,CAAC;AAChK,CAAC"}
@@ -1,34 +0,0 @@
1
- import { type GrokBrokerProjection, type GrokSlotPreflight } from './receipt/grok.js';
2
- import type { GrokNativeLaunch, NativeLaunch } from './receipt/index.js';
3
- import type { NativeConfig } from './worker/index.js';
4
- /** Byte-exact outputs from Daimon public projection v3 resolver. */
5
- export declare const daimonProjectionGolden: GrokBrokerProjection;
6
- export declare const daimonProjectionGoldenSha256 = "eb9fe5430db97b3e9aea8d3a4ec4b2a4771db15917d7c41594338599d96932f5";
7
- export declare const daimonClockedProjectionGolden: GrokBrokerProjection;
8
- export declare const daimonClockedProjectionGoldenSha256 = "c06709c076b4ba1a15c10f0f3f7c1bcd46217355d81e1cfb7d1d2c25194fbd68";
9
- export declare const fixtureNonce = "5f0e2a1c9b8d7e6f5a4b3c2d1e0f9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f";
10
- /**
11
- * The caller-protected paths a Grok trial declares.
12
- *
13
- * Always evaluator roots the slot receipt denies to the worker uid — never the
14
- * subject's own workspace or runtime home, which are the two writable roots.
15
- */
16
- export declare const grokProtectedPaths: (root: string) => string[];
17
- /**
18
- * Turns a Codex launch fixture into a Grok v2 child launch shaped like the
19
- * broker-capable training container.
20
- *
21
- * The container fixes `<slot>/workspace`, `<slot>/runtime-home` and
22
- * `<slot>/state` as siblings and keeps every Training control input in the
23
- * denied `/run/spawnfile-training` root, so the fixture root stands in for the slot root:
24
- * the trial runtime home is the single writable projection, the control root is
25
- * its sibling `state/`, and config/token/env move into the denied `training/`
26
- * evaluator root. Every evaluator root is a real directory under `root`.
27
- */
28
- export declare function grokLaunchFrom<T extends NativeLaunch>(launch: T, root: string, runtimeHome?: string): Promise<T & GrokNativeLaunch>;
29
- /** The training container resolves the slot projection from a one-agent config with no peers and no Mneme projection. */
30
- export declare function grokConfigFor(config: NativeConfig): NativeConfig;
31
- /** What Daimon's resolver returns for this launch when its inputs are passed through unchanged. */
32
- export declare function grokProjectionFor(launch: GrokNativeLaunch, extraDeny?: readonly string[]): GrokBrokerProjection;
33
- export declare function slotPreflightFor(projection: GrokBrokerProjection, paths?: string[], generation?: number, nonce?: string): GrokSlotPreflight;
34
- export declare function writeGrokSlotReceipt(launch: GrokNativeLaunch, value?: unknown): Promise<void>;