spawnfile 0.1.33 → 0.1.35

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 (606) hide show
  1. package/README.md +1 -1
  2. package/dist/audit/readAudit.d.ts +3 -3
  3. package/dist/auth/profileStore.d.ts +3 -1
  4. package/dist/auth/profileStore.js +31 -30
  5. package/dist/auth/trainingAuth.d.ts +2 -5
  6. package/dist/auth/types.d.ts +16 -0
  7. package/dist/cli/authCommands.d.ts +1 -1
  8. package/dist/cli/authCommands.js +21 -1
  9. package/dist/cli/devCommands.d.ts +1 -1
  10. package/dist/cli/devCommands.js +0 -66
  11. package/dist/cli/runCli.d.ts +3 -4
  12. package/dist/cli/runCli.js +4 -3
  13. package/dist/cli/trainCommand.js +9 -15
  14. package/dist/cli/trainingBooted.d.ts +9 -0
  15. package/dist/cli/trainingBooted.js +45 -0
  16. package/dist/cli/trainingExecution.d.ts +4 -7
  17. package/dist/cli/trainingExecution.js +4 -32
  18. package/dist/compiler/containerArtifacts.js +0 -5
  19. package/dist/compiler/containerBackedMountRender.js +5 -1
  20. package/dist/compiler/containerDaimonBrokerRender.d.ts +5 -50
  21. package/dist/compiler/containerDaimonBrokerRender.js +19 -90
  22. package/dist/compiler/containerDaimonGatewayRender.d.ts +50 -0
  23. package/dist/compiler/containerDaimonGatewayRender.js +161 -0
  24. package/dist/compiler/containerDaimonGrokWorkerProvisioning.d.ts +2 -10
  25. package/dist/compiler/containerDaimonGrokWorkerProvisioning.js +13 -25
  26. package/dist/compiler/containerDaimonGrokWorkerRender.d.ts +11 -49
  27. package/dist/compiler/containerDaimonGrokWorkerRender.js +15 -39
  28. package/dist/compiler/containerDaimonStartupSupervision.d.ts +8 -0
  29. package/dist/compiler/containerDaimonStartupSupervision.js +39 -0
  30. package/dist/compiler/containerDaimonUidEntrypointRender.d.ts +1 -2
  31. package/dist/compiler/containerDaimonUidEntrypointRender.js +29 -47
  32. package/dist/compiler/containerRuntimeReadinessRender.js +1 -1
  33. package/dist/compiler/memoryArtifacts.js +0 -1
  34. package/dist/compiler/moltnetArtifacts.js +1 -17
  35. package/dist/compiler/moltnetClientConfig.js +1 -1
  36. package/dist/compiler/moltnetRuntimeConfig.js +0 -10
  37. package/dist/compiler/runProject.d.ts +3 -0
  38. package/dist/compiler/runProject.js +12 -5
  39. package/dist/compiler/runProjectAuth.js +6 -18
  40. package/dist/compiler/training/contract.d.ts +0 -2
  41. package/dist/compiler/training/contract.js +0 -2
  42. package/dist/compiler/training/execution.d.ts +1 -128
  43. package/dist/compiler/training/execution.js +7 -68
  44. package/dist/compiler/training/index.d.ts +0 -8
  45. package/dist/compiler/training/index.js +0 -7
  46. package/dist/compiler/training/output.d.ts +1 -0
  47. package/dist/compiler/training/output.js +1 -1
  48. package/dist/compiler/training/rewind/contract.d.ts +6 -6
  49. package/dist/compiler/training/trial/boot.d.ts +72 -0
  50. package/dist/compiler/training/trial/boot.js +225 -0
  51. package/dist/compiler/training/trial/docker.d.ts +10 -0
  52. package/dist/compiler/training/trial/docker.js +22 -0
  53. package/dist/compiler/training/trial/gateway.d.ts +47 -0
  54. package/dist/compiler/training/trial/gateway.js +113 -0
  55. package/dist/compiler/training/trial/homeLogin.d.ts +31 -0
  56. package/dist/compiler/training/trial/homeLogin.js +69 -0
  57. package/dist/compiler/training/trial/index.d.ts +8 -0
  58. package/dist/compiler/training/trial/index.js +8 -0
  59. package/dist/compiler/training/trial/judge.d.ts +15 -0
  60. package/dist/compiler/training/trial/judge.js +42 -0
  61. package/dist/compiler/training/trial/launcher.d.ts +47 -0
  62. package/dist/compiler/training/trial/launcher.js +193 -0
  63. package/dist/compiler/training/trial/login.d.ts +35 -0
  64. package/dist/compiler/training/trial/login.js +85 -0
  65. package/dist/compiler/training/trial/project.d.ts +11 -0
  66. package/dist/compiler/training/trial/project.js +31 -0
  67. package/dist/compiler/training/trial/realmTurns.d.ts +20 -0
  68. package/dist/compiler/training/trial/realmTurns.js +69 -0
  69. package/dist/compiler/upReceipt.d.ts +2 -17
  70. package/dist/compiler/upReceipt.js +2 -17
  71. package/dist/deployment/artifactsExportPlan.js +2 -18
  72. package/dist/deployment/privateArtifactsExport.js +1 -1
  73. package/dist/dev/docker.d.ts +0 -5
  74. package/dist/dev/docker.js +0 -46
  75. package/dist/dev/index.d.ts +0 -1
  76. package/dist/dev/index.js +0 -1
  77. package/dist/dev/project.d.ts +0 -16
  78. package/dist/dev/project.js +1 -128
  79. package/dist/distribution/distributionReportSchema.js +1 -1
  80. package/dist/distribution/imageRuntimeAuth.js +3 -2
  81. package/dist/manifest/renderSpawnfile.js +2 -1
  82. package/dist/release/drainControl.d.ts +5 -19
  83. package/dist/release/drainControl.js +12 -67
  84. package/dist/report/types.d.ts +3 -6
  85. package/dist/runtime/common.d.ts +1 -1
  86. package/dist/runtime/common.js +1 -1
  87. package/dist/runtime/container.d.ts +2 -2
  88. package/dist/runtime/container.js +1 -39
  89. package/dist/runtime/daimon/config.js +8 -14
  90. package/dist/runtime/daimon/contractManifest.js +0 -1
  91. package/dist/runtime/daimon/contractManifestSchema.js +0 -1
  92. package/dist/runtime/daimon/control.d.ts +31 -0
  93. package/dist/runtime/daimon/control.js +83 -0
  94. package/dist/runtime/daimon/engineDescriptorSchema.js +0 -1
  95. package/dist/runtime/daimon/engineDescriptors.generated.d.ts +1 -1
  96. package/dist/runtime/daimon/engineDescriptors.generated.js +1 -2
  97. package/dist/runtime/daimon/engines.js +0 -1
  98. package/dist/runtime/daimon/gateway.d.ts +62 -0
  99. package/dist/runtime/daimon/gateway.js +77 -0
  100. package/dist/runtime/daimon/grokWorkerContract.d.ts +0 -5
  101. package/dist/runtime/daimon/grokWorkerContract.js +1 -13
  102. package/dist/runtime/daimon/index.d.ts +2 -0
  103. package/dist/runtime/daimon/index.js +2 -1
  104. package/dist/runtime/daimon/memory.js +1 -1
  105. package/dist/runtime/daimon/packageName.js +0 -1
  106. package/dist/runtime/daimon/runAuth.js +15 -4
  107. package/dist/runtime/daimon/runtimeIdentity.d.ts +2 -0
  108. package/dist/runtime/daimon/runtimeIdentity.js +2 -0
  109. package/dist/runtime/daimon/subscriptionRealms.d.ts +27 -3
  110. package/dist/runtime/daimon/subscriptionRealms.js +35 -13
  111. package/dist/runtime/daimon/testHelpers.d.ts +2 -0
  112. package/dist/runtime/{pi → daimon}/testHelpers.js +3 -3
  113. package/dist/runtime/daimon/training/booted/adapter.d.ts +50 -0
  114. package/dist/runtime/daimon/training/booted/adapter.js +60 -0
  115. package/dist/runtime/daimon/training/booted/adapter.js.map +1 -0
  116. package/dist/runtime/daimon/training/booted/index.d.ts +4 -0
  117. package/dist/runtime/daimon/training/booted/index.js +3 -0
  118. package/dist/runtime/daimon/training/booted/index.js.map +1 -0
  119. package/dist/runtime/daimon/training/booted/judge.d.ts +39 -0
  120. package/dist/runtime/daimon/training/booted/judge.js +122 -0
  121. package/dist/runtime/daimon/training/booted/judge.js.map +1 -0
  122. package/dist/runtime/daimon/training/index.d.ts +5 -0
  123. package/dist/runtime/daimon/training/index.js +8 -4
  124. package/dist/runtime/daimon/training/index.js.map +1 -1
  125. package/dist/runtime/daimon/wakeMoments.js +0 -1
  126. package/dist/runtime/install.js +0 -21
  127. package/dist/runtime/registry.js +0 -2
  128. package/dist/runtime/trainingGraderProviders.js +10 -4
  129. package/dist/runtime/trainingProviders.d.ts +5 -3
  130. package/dist/runtime/trainingProviders.js +21 -24
  131. package/dist/runtime/trainingSubjects.d.ts +0 -121
  132. package/dist/runtime/trainingSubjects.js +2 -13
  133. package/dist/runtime/types.d.ts +1 -8
  134. package/dist/runtime/usageRequestLedger.d.ts +2 -0
  135. package/dist/runtime/usageRequestLedger.js +3 -1
  136. package/dist/shared/errors.js +0 -1
  137. package/dist/shared/trainingLegacy/trainingLegacyHashDomains.d.ts +1 -0
  138. package/dist/shared/trainingLegacy/trainingLegacyHashDomains.js +1 -0
  139. package/dist/shared/trainingLegacy/trainingLegacyHashDomains.js.map +1 -1
  140. package/dist/status/lifecycleProbes.js +3 -6
  141. package/dist/status/moltnetWiringProbes.js +1 -17
  142. package/dist/training/subjects/index.d.ts +0 -1
  143. package/dist/training/subjects/index.js +0 -1
  144. package/dist/training/subjects/index.js.map +1 -1
  145. package/examples/README.md +0 -1
  146. package/examples/daimon-org/agents/mapper/Spawnfile +4 -1
  147. package/examples/daimon-org/teams/review/agents/reviewer/Spawnfile +4 -1
  148. package/examples/jungian-daimon-org/teams/luna/agents/animus/Spawnfile +5 -8
  149. package/examples/jungian-daimon-org/teams/luna/agents/representative/Spawnfile +1 -1
  150. package/examples/jungian-daimon-org/teams/luna/agents/shadow/Spawnfile +5 -8
  151. package/examples/jungian-daimon-org/teams/selene/agents/animus/Spawnfile +5 -8
  152. package/examples/jungian-daimon-org/teams/selene/agents/representative/Spawnfile +5 -8
  153. package/examples/jungian-daimon-org/teams/selene/agents/shadow/Spawnfile +1 -1
  154. package/examples/mixed-runtime-org/agents/localist/Spawnfile +7 -7
  155. package/package.json +4 -13
  156. package/runtimes.yaml +5 -15
  157. package/dist/compiler/containerDaimonGrokTaskClock.d.ts +0 -5
  158. package/dist/compiler/containerDaimonGrokTaskClock.js +0 -29
  159. package/dist/compiler/daimonTelemetryArtifacts.d.ts +0 -22
  160. package/dist/compiler/daimonTelemetryArtifacts.js +0 -56
  161. package/dist/compiler/training/broker/clockProbe.d.ts +0 -6
  162. package/dist/compiler/training/broker/clockProbe.js +0 -27
  163. package/dist/compiler/training/broker/declaration.d.ts +0 -54
  164. package/dist/compiler/training/broker/declaration.js +0 -70
  165. package/dist/compiler/training/broker/entrypoint.d.ts +0 -39
  166. package/dist/compiler/training/broker/entrypoint.js +0 -124
  167. package/dist/compiler/training/broker/evaluatorSecrets.d.ts +0 -2
  168. package/dist/compiler/training/broker/evaluatorSecrets.js +0 -62
  169. package/dist/compiler/training/broker/index.d.ts +0 -12
  170. package/dist/compiler/training/broker/index.js +0 -12
  171. package/dist/compiler/training/broker/main.d.ts +0 -2
  172. package/dist/compiler/training/broker/main.js +0 -14
  173. package/dist/compiler/training/broker/paths.d.ts +0 -236
  174. package/dist/compiler/training/broker/paths.js +0 -249
  175. package/dist/compiler/training/broker/processes.d.ts +0 -51
  176. package/dist/compiler/training/broker/processes.js +0 -102
  177. package/dist/compiler/training/broker/projection.d.ts +0 -61
  178. package/dist/compiler/training/broker/projection.js +0 -109
  179. package/dist/compiler/training/broker/provisioning.d.ts +0 -78
  180. package/dist/compiler/training/broker/provisioning.js +0 -231
  181. package/dist/compiler/training/broker/receipt.d.ts +0 -77
  182. package/dist/compiler/training/broker/receipt.js +0 -110
  183. package/dist/compiler/training/broker/recycleClient.d.ts +0 -33
  184. package/dist/compiler/training/broker/recycleClient.js +0 -112
  185. package/dist/compiler/training/broker/registration.d.ts +0 -46
  186. package/dist/compiler/training/broker/registration.js +0 -113
  187. package/dist/compiler/training/broker/reset.d.ts +0 -9
  188. package/dist/compiler/training/broker/reset.js +0 -71
  189. package/dist/compiler/training/broker/rootScript.d.ts +0 -32
  190. package/dist/compiler/training/broker/rootScript.js +0 -33
  191. package/dist/compiler/training/broker/runtime.d.ts +0 -22
  192. package/dist/compiler/training/broker/runtime.js +0 -128
  193. package/dist/compiler/training/broker/seccompRoutes.d.ts +0 -31
  194. package/dist/compiler/training/broker/seccompRoutes.js +0 -36
  195. package/dist/compiler/training/broker/supervisor.d.ts +0 -108
  196. package/dist/compiler/training/broker/supervisor.js +0 -172
  197. package/dist/compiler/training/broker/taskClock.d.ts +0 -5
  198. package/dist/compiler/training/broker/taskClock.js +0 -41
  199. package/dist/compiler/training/container/contract.d.ts +0 -54
  200. package/dist/compiler/training/container/contract.js +0 -52
  201. package/dist/compiler/training/container/evaluators.d.ts +0 -48
  202. package/dist/compiler/training/container/evaluators.js +0 -50
  203. package/dist/compiler/training/container/grokWriteback.d.ts +0 -8
  204. package/dist/compiler/training/container/grokWriteback.js +0 -26
  205. package/dist/compiler/training/container/index.d.ts +0 -5
  206. package/dist/compiler/training/container/index.js +0 -3
  207. package/dist/compiler/training/container/launch.d.ts +0 -21
  208. package/dist/compiler/training/container/launch.js +0 -280
  209. package/dist/compiler/training/container/nativeSlots.d.ts +0 -14
  210. package/dist/compiler/training/container/nativeSlots.js +0 -13
  211. package/dist/compiler/training/container/outputCopy.d.ts +0 -2
  212. package/dist/compiler/training/container/outputCopy.js +0 -72
  213. package/dist/compiler/training/container/outputVolume.d.ts +0 -28
  214. package/dist/compiler/training/container/outputVolume.js +0 -185
  215. package/dist/compiler/training/container/prepare.d.ts +0 -10
  216. package/dist/compiler/training/container/prepare.js +0 -125
  217. package/dist/compiler/training/container/process.d.ts +0 -14
  218. package/dist/compiler/training/container/process.js +0 -70
  219. package/dist/compiler/training/container/security.d.ts +0 -38
  220. package/dist/compiler/training/container/security.js +0 -68
  221. package/dist/compiler/training/container/subjectIsolation.d.ts +0 -5
  222. package/dist/compiler/training/container/subjectIsolation.js +0 -16
  223. package/dist/compiler/training/preparation/assets/Dockerfile +0 -100
  224. package/dist/compiler/training/preparation/assets/package-lock.json +0 -5483
  225. package/dist/compiler/training/preparation/broker.d.ts +0 -30
  226. package/dist/compiler/training/preparation/broker.js +0 -68
  227. package/dist/compiler/training/preparation/contextModes.d.ts +0 -12
  228. package/dist/compiler/training/preparation/contextModes.js +0 -38
  229. package/dist/compiler/training/preparation/contract.d.ts +0 -203
  230. package/dist/compiler/training/preparation/contract.js +0 -114
  231. package/dist/compiler/training/preparation/copyAssets.d.ts +0 -1
  232. package/dist/compiler/training/preparation/copyAssets.js +0 -8
  233. package/dist/compiler/training/preparation/daimonParent.d.ts +0 -42
  234. package/dist/compiler/training/preparation/daimonParent.js +0 -114
  235. package/dist/compiler/training/preparation/files.d.ts +0 -29
  236. package/dist/compiler/training/preparation/files.js +0 -146
  237. package/dist/compiler/training/preparation/image.d.ts +0 -28
  238. package/dist/compiler/training/preparation/image.js +0 -105
  239. package/dist/compiler/training/preparation/index.d.ts +0 -3
  240. package/dist/compiler/training/preparation/index.js +0 -2
  241. package/dist/compiler/training/preparation/inputs.d.ts +0 -24
  242. package/dist/compiler/training/preparation/inputs.js +0 -101
  243. package/dist/compiler/training/preparation/prepare.d.ts +0 -38
  244. package/dist/compiler/training/preparation/prepare.js +0 -224
  245. package/dist/compiler/training/preparation/scratch.d.ts +0 -8
  246. package/dist/compiler/training/preparation/scratch.js +0 -114
  247. package/dist/compiler/training/repair/compatibility.d.ts +0 -11
  248. package/dist/compiler/training/repair/compatibility.js +0 -45
  249. package/dist/compiler/training/repair/contract.d.ts +0 -832
  250. package/dist/compiler/training/repair/contract.js +0 -34
  251. package/dist/compiler/training/repair/index.d.ts +0 -3
  252. package/dist/compiler/training/repair/index.js +0 -3
  253. package/dist/compiler/training/repair/prepare.d.ts +0 -378
  254. package/dist/compiler/training/repair/prepare.js +0 -84
  255. package/dist/compiler/training/repair/witness.d.ts +0 -348
  256. package/dist/compiler/training/repair/witness.js +0 -62
  257. package/dist/compiler/training/subjectDeclaration.d.ts +0 -26
  258. package/dist/compiler/training/subjectDeclaration.js +0 -54
  259. package/dist/compiler/training/subjectLease.d.ts +0 -115
  260. package/dist/compiler/training/subjectLease.js +0 -179
  261. package/dist/dev/activity.d.ts +0 -14
  262. package/dist/dev/activity.js +0 -48
  263. package/dist/runtime/codex-exec/training/adapter.d.ts +0 -13
  264. package/dist/runtime/codex-exec/training/adapter.js +0 -101
  265. package/dist/runtime/codex-exec/training/adapter.js.map +0 -1
  266. package/dist/runtime/codex-exec/training/environment.d.ts +0 -3
  267. package/dist/runtime/codex-exec/training/environment.js +0 -26
  268. package/dist/runtime/codex-exec/training/environment.js.map +0 -1
  269. package/dist/runtime/codex-exec/training/index.d.ts +0 -2
  270. package/dist/runtime/codex-exec/training/index.js +0 -3
  271. package/dist/runtime/codex-exec/training/index.js.map +0 -1
  272. package/dist/runtime/codex-exec/training/protocol.d.ts +0 -15
  273. package/dist/runtime/codex-exec/training/protocol.js +0 -102
  274. package/dist/runtime/codex-exec/training/protocol.js.map +0 -1
  275. package/dist/runtime/codex-exec/training/providers/codex-subscription/index.d.ts +0 -1
  276. package/dist/runtime/codex-exec/training/providers/codex-subscription/index.js +0 -2
  277. package/dist/runtime/codex-exec/training/providers/codex-subscription/index.js.map +0 -1
  278. package/dist/runtime/codex-exec/training/providers/codex-subscription/protocol.d.ts +0 -17
  279. package/dist/runtime/codex-exec/training/providers/codex-subscription/protocol.js +0 -80
  280. package/dist/runtime/codex-exec/training/providers/codex-subscription/protocol.js.map +0 -1
  281. package/dist/runtime/codex-exec/training/providers/codex-subscription/provider.d.ts +0 -12
  282. package/dist/runtime/codex-exec/training/providers/codex-subscription/provider.js +0 -125
  283. package/dist/runtime/codex-exec/training/providers/codex-subscription/provider.js.map +0 -1
  284. package/dist/runtime/codex-exec/training/providers/codex-subscription/strict-schema.d.ts +0 -6
  285. package/dist/runtime/codex-exec/training/providers/codex-subscription/strict-schema.js +0 -219
  286. package/dist/runtime/codex-exec/training/providers/codex-subscription/strict-schema.js.map +0 -1
  287. package/dist/runtime/daimon/contractManifest.js.map +0 -1
  288. package/dist/runtime/daimon/contractManifestSchema.js.map +0 -1
  289. package/dist/runtime/daimon/engineDescriptorSchema.js.map +0 -1
  290. package/dist/runtime/daimon/engineDescriptors.generated.js.map +0 -1
  291. package/dist/runtime/daimon/engines.js.map +0 -1
  292. package/dist/runtime/daimon/index.js.map +0 -1
  293. package/dist/runtime/daimon/packageName.js.map +0 -1
  294. package/dist/runtime/daimon/training/legacy/adapter.d.ts +0 -11
  295. package/dist/runtime/daimon/training/legacy/adapter.js +0 -175
  296. package/dist/runtime/daimon/training/legacy/adapter.js.map +0 -1
  297. package/dist/runtime/daimon/training/legacy/index.d.ts +0 -2
  298. package/dist/runtime/daimon/training/legacy/index.js +0 -3
  299. package/dist/runtime/daimon/training/legacy/index.js.map +0 -1
  300. package/dist/runtime/daimon/training/legacy/public.d.ts +0 -49
  301. package/dist/runtime/daimon/training/legacy/public.js +0 -16
  302. package/dist/runtime/daimon/training/legacy/public.js.map +0 -1
  303. package/dist/runtime/daimon/training/native/adapter.d.ts +0 -18
  304. package/dist/runtime/daimon/training/native/adapter.js +0 -252
  305. package/dist/runtime/daimon/training/native/adapter.js.map +0 -1
  306. package/dist/runtime/daimon/training/native/admission.d.ts +0 -7
  307. package/dist/runtime/daimon/training/native/admission.js +0 -52
  308. package/dist/runtime/daimon/training/native/admission.js.map +0 -1
  309. package/dist/runtime/daimon/training/native/child/arguments.d.ts +0 -16
  310. package/dist/runtime/daimon/training/native/child/arguments.js +0 -70
  311. package/dist/runtime/daimon/training/native/child/arguments.js.map +0 -1
  312. package/dist/runtime/daimon/training/native/child/deferred-trial.d.ts +0 -24
  313. package/dist/runtime/daimon/training/native/child/deferred-trial.js +0 -63
  314. package/dist/runtime/daimon/training/native/child/deferred-trial.js.map +0 -1
  315. package/dist/runtime/daimon/training/native/child/diagnostics.d.ts +0 -58
  316. package/dist/runtime/daimon/training/native/child/diagnostics.js +0 -215
  317. package/dist/runtime/daimon/training/native/child/diagnostics.js.map +0 -1
  318. package/dist/runtime/daimon/training/native/child/fixture.d.ts +0 -16
  319. package/dist/runtime/daimon/training/native/child/fixture.js +0 -159
  320. package/dist/runtime/daimon/training/native/child/fixture.js.map +0 -1
  321. package/dist/runtime/daimon/training/native/child/grok.d.ts +0 -14
  322. package/dist/runtime/daimon/training/native/child/grok.js +0 -47
  323. package/dist/runtime/daimon/training/native/child/grok.js.map +0 -1
  324. package/dist/runtime/daimon/training/native/child/index.d.ts +0 -7
  325. package/dist/runtime/daimon/training/native/child/index.js +0 -5
  326. package/dist/runtime/daimon/training/native/child/index.js.map +0 -1
  327. package/dist/runtime/daimon/training/native/child/lifecycle.d.ts +0 -40
  328. package/dist/runtime/daimon/training/native/child/lifecycle.js +0 -400
  329. package/dist/runtime/daimon/training/native/child/lifecycle.js.map +0 -1
  330. package/dist/runtime/daimon/training/native/child/probe.d.ts +0 -2
  331. package/dist/runtime/daimon/training/native/child/probe.js +0 -11
  332. package/dist/runtime/daimon/training/native/child/probe.js.map +0 -1
  333. package/dist/runtime/daimon/training/native/child/sandbox.d.ts +0 -4
  334. package/dist/runtime/daimon/training/native/child/sandbox.js +0 -76
  335. package/dist/runtime/daimon/training/native/child/sandbox.js.map +0 -1
  336. package/dist/runtime/daimon/training/native/child/types.d.ts +0 -15
  337. package/dist/runtime/daimon/training/native/child/types.js +0 -2
  338. package/dist/runtime/daimon/training/native/child/types.js.map +0 -1
  339. package/dist/runtime/daimon/training/native/container/docker.d.ts +0 -29
  340. package/dist/runtime/daimon/training/native/container/docker.js +0 -105
  341. package/dist/runtime/daimon/training/native/container/docker.js.map +0 -1
  342. package/dist/runtime/daimon/training/native/container/grok-slot.d.ts +0 -22
  343. package/dist/runtime/daimon/training/native/container/grok-slot.js +0 -38
  344. package/dist/runtime/daimon/training/native/container/grok-slot.js.map +0 -1
  345. package/dist/runtime/daimon/training/native/container/index.d.ts +0 -6
  346. package/dist/runtime/daimon/training/native/container/index.js +0 -6
  347. package/dist/runtime/daimon/training/native/container/index.js.map +0 -1
  348. package/dist/runtime/daimon/training/native/container/lifecycle.d.ts +0 -8
  349. package/dist/runtime/daimon/training/native/container/lifecycle.js +0 -111
  350. package/dist/runtime/daimon/training/native/container/lifecycle.js.map +0 -1
  351. package/dist/runtime/daimon/training/native/container/manifest.d.ts +0 -17
  352. package/dist/runtime/daimon/training/native/container/manifest.js +0 -164
  353. package/dist/runtime/daimon/training/native/container/manifest.js.map +0 -1
  354. package/dist/runtime/daimon/training/native/container/native-preflight.d.ts +0 -8
  355. package/dist/runtime/daimon/training/native/container/native-preflight.js +0 -40
  356. package/dist/runtime/daimon/training/native/container/native-preflight.js.map +0 -1
  357. package/dist/runtime/daimon/training/native/container/preflight.d.ts +0 -15
  358. package/dist/runtime/daimon/training/native/container/preflight.js +0 -79
  359. package/dist/runtime/daimon/training/native/container/preflight.js.map +0 -1
  360. package/dist/runtime/daimon/training/native/container/slot.d.ts +0 -4
  361. package/dist/runtime/daimon/training/native/container/slot.js +0 -58
  362. package/dist/runtime/daimon/training/native/container/slot.js.map +0 -1
  363. package/dist/runtime/daimon/training/native/external.d.ts +0 -37
  364. package/dist/runtime/daimon/training/native/external.js +0 -75
  365. package/dist/runtime/daimon/training/native/external.js.map +0 -1
  366. package/dist/runtime/daimon/training/native/grants/authority.d.ts +0 -36
  367. package/dist/runtime/daimon/training/native/grants/authority.js +0 -49
  368. package/dist/runtime/daimon/training/native/grants/authority.js.map +0 -1
  369. package/dist/runtime/daimon/training/native/grants/index.d.ts +0 -2
  370. package/dist/runtime/daimon/training/native/grants/index.js +0 -3
  371. package/dist/runtime/daimon/training/native/grants/index.js.map +0 -1
  372. package/dist/runtime/daimon/training/native/grants/pins.d.ts +0 -30
  373. package/dist/runtime/daimon/training/native/grants/pins.js +0 -20
  374. package/dist/runtime/daimon/training/native/grants/pins.js.map +0 -1
  375. package/dist/runtime/daimon/training/native/grants/test-socket.d.ts +0 -6
  376. package/dist/runtime/daimon/training/native/grants/test-socket.js +0 -35
  377. package/dist/runtime/daimon/training/native/grants/test-socket.js.map +0 -1
  378. package/dist/runtime/daimon/training/native/grok-fixtures.d.ts +0 -34
  379. package/dist/runtime/daimon/training/native/grok-fixtures.js +0 -179
  380. package/dist/runtime/daimon/training/native/grok-fixtures.js.map +0 -1
  381. package/dist/runtime/daimon/training/native/index.d.ts +0 -38
  382. package/dist/runtime/daimon/training/native/index.js +0 -27
  383. package/dist/runtime/daimon/training/native/index.js.map +0 -1
  384. package/dist/runtime/daimon/training/native/live-checkout.d.ts +0 -2
  385. package/dist/runtime/daimon/training/native/live-checkout.js +0 -15
  386. package/dist/runtime/daimon/training/native/live-checkout.js.map +0 -1
  387. package/dist/runtime/daimon/training/native/observations.d.ts +0 -51
  388. package/dist/runtime/daimon/training/native/observations.js +0 -217
  389. package/dist/runtime/daimon/training/native/observations.js.map +0 -1
  390. package/dist/runtime/daimon/training/native/outcome.d.ts +0 -13
  391. package/dist/runtime/daimon/training/native/outcome.js +0 -37
  392. package/dist/runtime/daimon/training/native/outcome.js.map +0 -1
  393. package/dist/runtime/daimon/training/native/preparation/engine-config.d.ts +0 -21
  394. package/dist/runtime/daimon/training/native/preparation/engine-config.js +0 -30
  395. package/dist/runtime/daimon/training/native/preparation/engine-config.js.map +0 -1
  396. package/dist/runtime/daimon/training/native/preparation/fixtures.d.ts +0 -17
  397. package/dist/runtime/daimon/training/native/preparation/fixtures.js +0 -52
  398. package/dist/runtime/daimon/training/native/preparation/fixtures.js.map +0 -1
  399. package/dist/runtime/daimon/training/native/preparation/index.d.ts +0 -7
  400. package/dist/runtime/daimon/training/native/preparation/index.js +0 -5
  401. package/dist/runtime/daimon/training/native/preparation/index.js.map +0 -1
  402. package/dist/runtime/daimon/training/native/preparation/layout.d.ts +0 -66
  403. package/dist/runtime/daimon/training/native/preparation/layout.js +0 -87
  404. package/dist/runtime/daimon/training/native/preparation/layout.js.map +0 -1
  405. package/dist/runtime/daimon/training/native/preparation/subject.d.ts +0 -14
  406. package/dist/runtime/daimon/training/native/preparation/subject.js +0 -67
  407. package/dist/runtime/daimon/training/native/preparation/subject.js.map +0 -1
  408. package/dist/runtime/daimon/training/native/preparation/types.d.ts +0 -69
  409. package/dist/runtime/daimon/training/native/preparation/types.js +0 -2
  410. package/dist/runtime/daimon/training/native/preparation/types.js.map +0 -1
  411. package/dist/runtime/daimon/training/native/receipt/artifacts.d.ts +0 -25
  412. package/dist/runtime/daimon/training/native/receipt/artifacts.js +0 -32
  413. package/dist/runtime/daimon/training/native/receipt/artifacts.js.map +0 -1
  414. package/dist/runtime/daimon/training/native/receipt/grok-clocked-pins.d.ts +0 -129
  415. package/dist/runtime/daimon/training/native/receipt/grok-clocked-pins.js +0 -45
  416. package/dist/runtime/daimon/training/native/receipt/grok-clocked-pins.js.map +0 -1
  417. package/dist/runtime/daimon/training/native/receipt/grok.d.ts +0 -246
  418. package/dist/runtime/daimon/training/native/receipt/grok.js +0 -195
  419. package/dist/runtime/daimon/training/native/receipt/grok.js.map +0 -1
  420. package/dist/runtime/daimon/training/native/receipt/index.d.ts +0 -11
  421. package/dist/runtime/daimon/training/native/receipt/index.js +0 -8
  422. package/dist/runtime/daimon/training/native/receipt/index.js.map +0 -1
  423. package/dist/runtime/daimon/training/native/receipt/paths.d.ts +0 -3
  424. package/dist/runtime/daimon/training/native/receipt/paths.js +0 -18
  425. package/dist/runtime/daimon/training/native/receipt/paths.js.map +0 -1
  426. package/dist/runtime/daimon/training/native/receipt/sandbox.d.ts +0 -42
  427. package/dist/runtime/daimon/training/native/receipt/sandbox.js +0 -35
  428. package/dist/runtime/daimon/training/native/receipt/sandbox.js.map +0 -1
  429. package/dist/runtime/daimon/training/native/receipt/schema.d.ts +0 -490
  430. package/dist/runtime/daimon/training/native/receipt/schema.js +0 -138
  431. package/dist/runtime/daimon/training/native/receipt/schema.js.map +0 -1
  432. package/dist/runtime/daimon/training/native/receipt/subscription.d.ts +0 -13
  433. package/dist/runtime/daimon/training/native/receipt/subscription.js +0 -13
  434. package/dist/runtime/daimon/training/native/receipt/subscription.js.map +0 -1
  435. package/dist/runtime/daimon/training/native/receipt/task-clock.d.ts +0 -19
  436. package/dist/runtime/daimon/training/native/receipt/task-clock.js +0 -49
  437. package/dist/runtime/daimon/training/native/receipt/task-clock.js.map +0 -1
  438. package/dist/runtime/daimon/training/native/sealed-usage.d.ts +0 -218
  439. package/dist/runtime/daimon/training/native/sealed-usage.js +0 -261
  440. package/dist/runtime/daimon/training/native/sealed-usage.js.map +0 -1
  441. package/dist/runtime/daimon/training/native/test-fixtures.d.ts +0 -27
  442. package/dist/runtime/daimon/training/native/test-fixtures.js +0 -162
  443. package/dist/runtime/daimon/training/native/test-fixtures.js.map +0 -1
  444. package/dist/runtime/daimon/training/native/transcript.d.ts +0 -96
  445. package/dist/runtime/daimon/training/native/transcript.js +0 -239
  446. package/dist/runtime/daimon/training/native/transcript.js.map +0 -1
  447. package/dist/runtime/daimon/training/native/transport/delivery.d.ts +0 -27
  448. package/dist/runtime/daimon/training/native/transport/delivery.js +0 -98
  449. package/dist/runtime/daimon/training/native/transport/delivery.js.map +0 -1
  450. package/dist/runtime/daimon/training/native/transport/http.d.ts +0 -3
  451. package/dist/runtime/daimon/training/native/transport/http.js +0 -81
  452. package/dist/runtime/daimon/training/native/transport/http.js.map +0 -1
  453. package/dist/runtime/daimon/training/native/transport/index.d.ts +0 -4
  454. package/dist/runtime/daimon/training/native/transport/index.js +0 -3
  455. package/dist/runtime/daimon/training/native/transport/index.js.map +0 -1
  456. package/dist/runtime/daimon/training/native/transport/types.d.ts +0 -15
  457. package/dist/runtime/daimon/training/native/transport/types.js +0 -2
  458. package/dist/runtime/daimon/training/native/transport/types.js.map +0 -1
  459. package/dist/runtime/daimon/training/native/worker/cli.d.ts +0 -1
  460. package/dist/runtime/daimon/training/native/worker/cli.js +0 -17
  461. package/dist/runtime/daimon/training/native/worker/cli.js.map +0 -1
  462. package/dist/runtime/daimon/training/native/worker/control.d.ts +0 -20
  463. package/dist/runtime/daimon/training/native/worker/control.js +0 -266
  464. package/dist/runtime/daimon/training/native/worker/control.js.map +0 -1
  465. package/dist/runtime/daimon/training/native/worker/deliveries.d.ts +0 -38
  466. package/dist/runtime/daimon/training/native/worker/deliveries.js +0 -91
  467. package/dist/runtime/daimon/training/native/worker/deliveries.js.map +0 -1
  468. package/dist/runtime/daimon/training/native/worker/evidence/collect.d.ts +0 -54
  469. package/dist/runtime/daimon/training/native/worker/evidence/collect.js +0 -278
  470. package/dist/runtime/daimon/training/native/worker/evidence/collect.js.map +0 -1
  471. package/dist/runtime/daimon/training/native/worker/evidence/execution.d.ts +0 -102
  472. package/dist/runtime/daimon/training/native/worker/evidence/execution.js +0 -191
  473. package/dist/runtime/daimon/training/native/worker/evidence/execution.js.map +0 -1
  474. package/dist/runtime/daimon/training/native/worker/evidence/index.d.ts +0 -3
  475. package/dist/runtime/daimon/training/native/worker/evidence/index.js +0 -4
  476. package/dist/runtime/daimon/training/native/worker/evidence/index.js.map +0 -1
  477. package/dist/runtime/daimon/training/native/worker/evidence/io.d.ts +0 -20
  478. package/dist/runtime/daimon/training/native/worker/evidence/io.js +0 -130
  479. package/dist/runtime/daimon/training/native/worker/evidence/io.js.map +0 -1
  480. package/dist/runtime/daimon/training/native/worker/evidence/seal.d.ts +0 -3
  481. package/dist/runtime/daimon/training/native/worker/evidence/seal.js +0 -67
  482. package/dist/runtime/daimon/training/native/worker/evidence/seal.js.map +0 -1
  483. package/dist/runtime/daimon/training/native/worker/index.d.ts +0 -11
  484. package/dist/runtime/daimon/training/native/worker/index.js +0 -8
  485. package/dist/runtime/daimon/training/native/worker/index.js.map +0 -1
  486. package/dist/runtime/daimon/training/native/worker/profile.d.ts +0 -23
  487. package/dist/runtime/daimon/training/native/worker/profile.js +0 -149
  488. package/dist/runtime/daimon/training/native/worker/profile.js.map +0 -1
  489. package/dist/runtime/daimon/training/native/worker/public.d.ts +0 -53
  490. package/dist/runtime/daimon/training/native/worker/public.js +0 -22
  491. package/dist/runtime/daimon/training/native/worker/public.js.map +0 -1
  492. package/dist/runtime/daimon/training/native/worker/sandbox.d.ts +0 -4
  493. package/dist/runtime/daimon/training/native/worker/sandbox.js +0 -54
  494. package/dist/runtime/daimon/training/native/worker/sandbox.js.map +0 -1
  495. package/dist/runtime/daimon/training/native/worker/server.d.ts +0 -4
  496. package/dist/runtime/daimon/training/native/worker/server.js +0 -102
  497. package/dist/runtime/daimon/training/native/worker/server.js.map +0 -1
  498. package/dist/runtime/daimon/training/native/worker/types.d.ts +0 -318
  499. package/dist/runtime/daimon/training/native/worker/types.js +0 -2
  500. package/dist/runtime/daimon/training/native/worker/types.js.map +0 -1
  501. package/dist/runtime/daimon/training/native/worker/wake-delivery/index.d.ts +0 -4
  502. package/dist/runtime/daimon/training/native/worker/wake-delivery/index.js +0 -4
  503. package/dist/runtime/daimon/training/native/worker/wake-delivery/index.js.map +0 -1
  504. package/dist/runtime/daimon/training/native/worker/wake-delivery/source.d.ts +0 -3
  505. package/dist/runtime/daimon/training/native/worker/wake-delivery/source.js +0 -16
  506. package/dist/runtime/daimon/training/native/worker/wake-delivery/source.js.map +0 -1
  507. package/dist/runtime/daimon/training/native/worker/wake-delivery/terminal.d.ts +0 -4
  508. package/dist/runtime/daimon/training/native/worker/wake-delivery/terminal.js +0 -52
  509. package/dist/runtime/daimon/training/native/worker/wake-delivery/terminal.js.map +0 -1
  510. package/dist/runtime/daimon/training/native/worker/wake-delivery/transport.d.ts +0 -21
  511. package/dist/runtime/daimon/training/native/worker/wake-delivery/transport.js +0 -198
  512. package/dist/runtime/daimon/training/native/worker/wake-delivery/transport.js.map +0 -1
  513. package/dist/runtime/daimon/training/native/worker/wake-delivery/types.d.ts +0 -91
  514. package/dist/runtime/daimon/training/native/worker/wake-delivery/types.js +0 -2
  515. package/dist/runtime/daimon/training/native/worker/wake-delivery/types.js.map +0 -1
  516. package/dist/runtime/daimon/training/native/worker/worker.d.ts +0 -1
  517. package/dist/runtime/daimon/training/native/worker/worker.js +0 -105
  518. package/dist/runtime/daimon/training/native/worker/worker.js.map +0 -1
  519. package/dist/runtime/daimon/training/providers/grok-broker/broker.d.ts +0 -20
  520. package/dist/runtime/daimon/training/providers/grok-broker/broker.js +0 -55
  521. package/dist/runtime/daimon/training/providers/grok-broker/broker.js.map +0 -1
  522. package/dist/runtime/daimon/training/providers/grok-broker/grant-fixtures.d.ts +0 -15
  523. package/dist/runtime/daimon/training/providers/grok-broker/grant-fixtures.js +0 -29
  524. package/dist/runtime/daimon/training/providers/grok-broker/grant-fixtures.js.map +0 -1
  525. package/dist/runtime/daimon/training/providers/grok-broker/grant-home.d.ts +0 -16
  526. package/dist/runtime/daimon/training/providers/grok-broker/grant-home.js +0 -60
  527. package/dist/runtime/daimon/training/providers/grok-broker/grant-home.js.map +0 -1
  528. package/dist/runtime/daimon/training/providers/grok-broker/grant-pool.d.ts +0 -81
  529. package/dist/runtime/daimon/training/providers/grok-broker/grant-pool.js +0 -221
  530. package/dist/runtime/daimon/training/providers/grok-broker/grant-pool.js.map +0 -1
  531. package/dist/runtime/daimon/training/providers/grok-broker/grant-releases.d.ts +0 -31
  532. package/dist/runtime/daimon/training/providers/grok-broker/grant-releases.js +0 -78
  533. package/dist/runtime/daimon/training/providers/grok-broker/grant-releases.js.map +0 -1
  534. package/dist/runtime/daimon/training/providers/grok-broker/grants.d.ts +0 -63
  535. package/dist/runtime/daimon/training/providers/grok-broker/grants.js +0 -20
  536. package/dist/runtime/daimon/training/providers/grok-broker/grants.js.map +0 -1
  537. package/dist/runtime/daimon/training/providers/grok-broker/index.d.ts +0 -3
  538. package/dist/runtime/daimon/training/providers/grok-broker/index.js +0 -4
  539. package/dist/runtime/daimon/training/providers/grok-broker/index.js.map +0 -1
  540. package/dist/runtime/daimon/training/providers/grok-subscription/cli.d.ts +0 -21
  541. package/dist/runtime/daimon/training/providers/grok-subscription/cli.js +0 -81
  542. package/dist/runtime/daimon/training/providers/grok-subscription/cli.js.map +0 -1
  543. package/dist/runtime/daimon/training/providers/grok-subscription/index.d.ts +0 -4
  544. package/dist/runtime/daimon/training/providers/grok-subscription/index.js +0 -5
  545. package/dist/runtime/daimon/training/providers/grok-subscription/index.js.map +0 -1
  546. package/dist/runtime/daimon/training/providers/grok-subscription/protocol.d.ts +0 -26
  547. package/dist/runtime/daimon/training/providers/grok-subscription/protocol.js +0 -102
  548. package/dist/runtime/daimon/training/providers/grok-subscription/protocol.js.map +0 -1
  549. package/dist/runtime/daimon/training/providers/grok-subscription/provider.d.ts +0 -9
  550. package/dist/runtime/daimon/training/providers/grok-subscription/provider.js +0 -38
  551. package/dist/runtime/daimon/training/providers/grok-subscription/provider.js.map +0 -1
  552. package/dist/runtime/daimon/training/public.d.ts +0 -6
  553. package/dist/runtime/daimon/training/public.js +0 -5
  554. package/dist/runtime/daimon/training/public.js.map +0 -1
  555. package/dist/runtime/daimon/training/services/account-lease.d.ts +0 -7
  556. package/dist/runtime/daimon/training/services/account-lease.js +0 -76
  557. package/dist/runtime/daimon/training/services/account-lease.js.map +0 -1
  558. package/dist/runtime/daimon/training/services/freshness.d.ts +0 -15
  559. package/dist/runtime/daimon/training/services/freshness.js +0 -19
  560. package/dist/runtime/daimon/training/services/freshness.js.map +0 -1
  561. package/dist/runtime/daimon/training/services/index.d.ts +0 -4
  562. package/dist/runtime/daimon/training/services/index.js +0 -4
  563. package/dist/runtime/daimon/training/services/index.js.map +0 -1
  564. package/dist/runtime/daimon/training/services/slot-freshness.d.ts +0 -34
  565. package/dist/runtime/daimon/training/services/slot-freshness.js +0 -178
  566. package/dist/runtime/daimon/training/services/slot-freshness.js.map +0 -1
  567. package/dist/runtime/daimon/wakeMoments.js.map +0 -1
  568. package/dist/runtime/pi/adapter.d.ts +0 -3
  569. package/dist/runtime/pi/adapter.js +0 -230
  570. package/dist/runtime/pi/appActivitySource.d.ts +0 -1
  571. package/dist/runtime/pi/appActivitySource.js +0 -199
  572. package/dist/runtime/pi/appAgentConfig.d.ts +0 -11
  573. package/dist/runtime/pi/appAgentConfig.js +0 -264
  574. package/dist/runtime/pi/appCliEnginesSource.d.ts +0 -1
  575. package/dist/runtime/pi/appCliEnginesSource.js +0 -183
  576. package/dist/runtime/pi/appCliSource.d.ts +0 -1
  577. package/dist/runtime/pi/appCliSource.js +0 -353
  578. package/dist/runtime/pi/appControlSource.d.ts +0 -1
  579. package/dist/runtime/pi/appControlSource.js +0 -390
  580. package/dist/runtime/pi/appControlWakeIdentitySource.d.ts +0 -1
  581. package/dist/runtime/pi/appControlWakeIdentitySource.js +0 -19
  582. package/dist/runtime/pi/appCoreSource.d.ts +0 -4
  583. package/dist/runtime/pi/appCoreSource.js +0 -244
  584. package/dist/runtime/pi/appPreludeSource.d.ts +0 -1
  585. package/dist/runtime/pi/appPreludeSource.js +0 -192
  586. package/dist/runtime/pi/appScheduleSource.d.ts +0 -1
  587. package/dist/runtime/pi/appScheduleSource.js +0 -84
  588. package/dist/runtime/pi/appScriptedEngine.d.ts +0 -31
  589. package/dist/runtime/pi/appScriptedEngine.js +0 -42
  590. package/dist/runtime/pi/appSource.d.ts +0 -4
  591. package/dist/runtime/pi/appSource.js +0 -12
  592. package/dist/runtime/pi/appTemplate.d.ts +0 -14
  593. package/dist/runtime/pi/appTemplate.js +0 -28
  594. package/dist/runtime/pi/appTemplateTypes.d.ts +0 -64
  595. package/dist/runtime/pi/appTemplateTypes.js +0 -18
  596. package/dist/runtime/pi/appWakeContextSource.d.ts +0 -1
  597. package/dist/runtime/pi/appWakeContextSource.js +0 -398
  598. package/dist/runtime/pi/containerTargets.d.ts +0 -4
  599. package/dist/runtime/pi/containerTargets.js +0 -63
  600. package/dist/runtime/pi/runAuth.d.ts +0 -2
  601. package/dist/runtime/pi/runAuth.js +0 -185
  602. package/dist/runtime/pi/testHelpers.d.ts +0 -2
  603. package/dist/shared/errors.js.map +0 -1
  604. package/dist/training/subjects/environment.d.ts +0 -2
  605. package/dist/training/subjects/environment.js +0 -14
  606. package/dist/training/subjects/environment.js.map +0 -1
@@ -1,231 +0,0 @@
1
- import path from "node:path";
2
- import { renderTrainingTaskClockReset } from "./taskClock.js";
3
- import { DAIMON_GROK_SECCOMP_PROFILE_SHA256 } from "../../../shared/daimonGrokSeccompProfile.js";
4
- import { DAIMON_GROK_ENGINE_BROKER, DAIMON_GROK_TURN_USAGE_LEDGER } from "../../../runtime/daimon/contractManifest.js";
5
- import { DAIMON_WAKE_FUSE_DIRECTORY } from "../../../runtime/daimon/config.js";
6
- import { renderDaimonBrokerProvisioningProgram, renderDaimonWorkspaceResourceSecurity } from "../../containerDaimonBrokerRender.js";
7
- import { renderDaimonGrokHostPreflight, renderDaimonGrokWorkerProvisioning } from "../../containerDaimonGrokWorkerProvisioning.js";
8
- import { trainingSlotPaths, trainingSlotDescriptors, TRAINING_TURN_STORE_ROOT, TRAINING_RUN_REQUEST_STORE, DAIMON_BROKER_UID, DAIMON_ORGANIZATION_UID, TRAINING_GRANT_HOME_ROOT, TRAINING_INFERENCE_DIRECTORY, TRAINING_INFERENCE_LEDGER, TRAINING_OPTIONAL_DENY_DIRECTORIES, TRAINING_ROOT, TRAINING_SEALED_INPUTS_IDENTITY, TRAINING_SEALED_INPUTS_ROOT, TRAINING_SUPERVISOR_DIRECTORY, TRAINING_BROKER_TMPDIR, TRAINING_WORKER_ROOT, } from "./paths.js";
9
- import { trainingNamespaceDenialMechanism } from "./seccompRoutes.js";
10
- const quote = (value) => `'${value.replace(/'/g, `'"'"'`)}'`;
11
- /**
12
- * Root only ever chmods an inode it currently owns: the container's capability
13
- * set grants `CAP_CHOWN` but not `CAP_FOWNER` (P0 §2), so `install -d -o u -g g
14
- * -m m` — which chowns before it chmods — fails with `EPERM` for every
15
- * non-root owner. Reclaim, set the mode, then hand over.
16
- */
17
- const PROVISION_DIRECTORY_HELPER = [
18
- "provision_dir() {",
19
- " target=$1; mode=$2; owner=$3; group=$4",
20
- " test -d \"$target\" && test ! -L \"$target\"",
21
- " chown 0:0 \"$target\"; chmod \"$mode\" \"$target\"; chown \"$owner:$group\" \"$target\"",
22
- "}"
23
- ];
24
- /**
25
- * Every directory the training slot owns, with the identity that must hold it.
26
- *
27
- * The two ledger directories are setgid to the organization group on purpose:
28
- * the broker writes its rows `0640` owned by the broker group, so without
29
- * `2100:2000 2750` uid 2000 — Training, DSPy and every judge — cannot read a
30
- * single subject usage row or inference row it paid for.
31
- */
32
- export const trainingSlotDirectories = (slot = 0) => [
33
- // `/run/training` itself is deliberately absent: it is a mount-point parent on the read-only
34
- // image root, and every writable child below it is its own tmpfs or bind.
35
- { path: trainingSlotPaths(slot).root, mode: "0711", uid: 0, gid: 0 },
36
- { path: TRAINING_ROOT, mode: "0750", uid: DAIMON_ORGANIZATION_UID, gid: DAIMON_ORGANIZATION_UID },
37
- { path: "/home/training", mode: "0700", uid: DAIMON_ORGANIZATION_UID, gid: DAIMON_ORGANIZATION_UID },
38
- { path: "/work", mode: "0700", uid: DAIMON_ORGANIZATION_UID, gid: DAIMON_ORGANIZATION_UID },
39
- { path: trainingSlotPaths(slot).workspace, mode: "0750", uid: DAIMON_ORGANIZATION_UID, gid: trainingSlotPaths(slot).workerUid },
40
- // The agent runtime home is deliberately absent: the shared broker provisioning creates it root-owned,
41
- // fills its setgid `tool-output/`, and only then narrows it to `2000:<worker> 0710`. Handing it over here
42
- // would leave root — which holds no `CAP_DAC_OVERRIDE` — unable to create the spill directory inside it.
43
- { path: trainingSlotPaths(slot).state, mode: "0700", uid: DAIMON_ORGANIZATION_UID, gid: DAIMON_ORGANIZATION_UID },
44
- { path: trainingSlotPaths(slot).acceptanceStore, mode: "0700", uid: DAIMON_ORGANIZATION_UID, gid: DAIMON_ORGANIZATION_UID },
45
- { path: TRAINING_TURN_STORE_ROOT, mode: "0700", uid: DAIMON_BROKER_UID, gid: DAIMON_BROKER_UID },
46
- { path: TRAINING_RUN_REQUEST_STORE, mode: "0700", uid: DAIMON_BROKER_UID, gid: DAIMON_BROKER_UID },
47
- { path: trainingSlotPaths(slot).usageDirectory, mode: "2750", uid: DAIMON_BROKER_UID, gid: DAIMON_ORGANIZATION_UID },
48
- { path: TRAINING_INFERENCE_DIRECTORY, mode: "2750", uid: DAIMON_BROKER_UID, gid: DAIMON_ORGANIZATION_UID },
49
- { path: TRAINING_GRANT_HOME_ROOT, mode: "0700", uid: DAIMON_ORGANIZATION_UID, gid: DAIMON_ORGANIZATION_UID },
50
- // Traverse only: the supervisor socket inside it is the uid gate, and a directory nobody but root may
51
- // write is what keeps that socket from being replaced by a laxer one.
52
- { path: TRAINING_SUPERVISOR_DIRECTORY, mode: "0711", uid: 0, gid: 0 },
53
- // The broker and its relay run as uid 2100, outside the organization group, and shared `/tmp` is closed
54
- // to them; this is their own temp, outside every wipe target (see `TRAINING_BROKER_TMPDIR`).
55
- { path: TRAINING_BROKER_TMPDIR, mode: "0700", uid: DAIMON_BROKER_UID, gid: DAIMON_BROKER_UID },
56
- { path: TRAINING_WORKER_ROOT, mode: "0711", uid: 0, gid: 0 },
57
- // Denied and unused by training, which meters per slot — but a world-readable directory would make its
58
- // worker-uid canary meaningless, so both get the modes the production organization gives them.
59
- { path: DAIMON_GROK_TURN_USAGE_LEDGER.directoryPath, mode: "0750", uid: DAIMON_BROKER_UID, gid: DAIMON_ORGANIZATION_UID },
60
- { path: DAIMON_WAKE_FUSE_DIRECTORY, mode: "0700", uid: DAIMON_ORGANIZATION_UID, gid: DAIMON_ORGANIZATION_UID }
61
- ];
62
- /**
63
- * The fixed identities the slot needs, checked rather than created.
64
- *
65
- * The broker-capable training container runs on a read-only root, so
66
- * `/etc/passwd` and `/etc/group` cannot be written at start-up the way the
67
- * production Daimon entrypoint writes them. The image bakes uid/gid 2000, 2100
68
- * and the worker uid instead, and this refuses to provision a slot in an image
69
- * that did not.
70
- */
71
- export const renderTrainingIdentities = (slots = 4) => [
72
- `for fixed_uid in ${DAIMON_ORGANIZATION_UID} ${DAIMON_BROKER_UID} ${trainingSlotDescriptors(slots).map(p => p.workerUid).join(" ")}; do`,
73
- ' getent passwd "$fixed_uid" >/dev/null && getent group "$fixed_uid" >/dev/null || { echo "the training image must bake uid/gid $fixed_uid; the container root is read-only" >&2; exit 1; }',
74
- "done"
75
- ];
76
- /** Slot-local skeleton, shared by initial provisioning and recycle. */
77
- const slotDirectories = (slot) => trainingSlotDirectories(slot).filter(entry => entry.path === trainingSlotPaths(slot).root || entry.path.startsWith(`${trainingSlotPaths(slot).root}/`));
78
- const renderDirectories = (entries, ledgers) => [
79
- ...PROVISION_DIRECTORY_HELPER,
80
- ...entries.map(entry => `mkdir -p ${quote(entry.path)}`),
81
- ...ledgers.map(ledger => `if [ ! -e ${quote(ledger)} ]; then : > ${quote(ledger)}; fi; chown 0:0 ${quote(ledger)}; chmod 0640 ${quote(ledger)}; chown ${DAIMON_BROKER_UID}:${DAIMON_ORGANIZATION_UID} ${quote(ledger)}`),
82
- ...[...entries].sort((a, b) => b.path.split("/").length - a.path.split("/").length)
83
- .map(entry => `provision_dir ${quote(entry.path)} ${entry.mode} ${entry.uid} ${entry.gid}`)
84
- ];
85
- const renderSlotAssertions = (r) => [
86
- `test "$(stat -c '%u:%g %a' ${quote(trainingSlotPaths(r.slot).usageDirectory)})" = "${DAIMON_BROKER_UID}:${DAIMON_ORGANIZATION_UID} 2750"`,
87
- `test "$(stat -c '%u:%g %a' ${quote(TRAINING_INFERENCE_DIRECTORY)})" = "${DAIMON_BROKER_UID}:${DAIMON_ORGANIZATION_UID} 2750"`,
88
- `test "$(stat -c '%u:%g %a' ${quote(TRAINING_GRANT_HOME_ROOT)})" = "${DAIMON_ORGANIZATION_UID}:${DAIMON_ORGANIZATION_UID} 700"`,
89
- `setpriv --clear-groups --reuid ${r.uid} --regid ${r.uid} --inh-caps=-all --ambient-caps=-all --bounding-set=-all -- bash -ceu '! test -r ${quote(TRAINING_GRANT_HOME_ROOT)}'`,
90
- `setpriv --clear-groups --reuid ${DAIMON_ORGANIZATION_UID} --regid ${DAIMON_ORGANIZATION_UID} --inh-caps=-all --ambient-caps=-all --bounding-set=-all -- bash -ceu 'test -r ${quote(r.usageLedgerPath)} && test -r ${quote(TRAINING_INFERENCE_LEDGER)}'`
91
- ];
92
- /** Full container provisioning runs exactly once, before any broker process starts. */
93
- export const renderTrainingBrokerProvisioning = (input, maxRunRequests = 1000) => {
94
- if (!Number.isSafeInteger(maxRunRequests) || maxRunRequests < 1)
95
- throw new Error("Invalid run request cap");
96
- const registrations = Array.isArray(input) ? input : [input];
97
- const directories = [...new Map(registrations.flatMap(r => trainingSlotDirectories(r.slot)).map(d => [d.path, d])).values()];
98
- return [
99
- ...renderTrainingIdentities(registrations.length),
100
- ...renderTrainingTaskClockReset(),
101
- ...renderDirectories(directories, [...registrations.map(r => r.usageLedgerPath), TRAINING_INFERENCE_LEDGER]),
102
- ...renderDaimonGrokHostPreflight(),
103
- ...renderDaimonBrokerProvisioningProgram(registrations, [], {
104
- version: "v3", maxRunRequests, runRequestStore: TRAINING_RUN_REQUEST_STORE,
105
- turnStore: TRAINING_TURN_STORE_ROOT, inferenceLedgerPath: TRAINING_INFERENCE_LEDGER
106
- }, "clear", TRAINING_OPTIONAL_DENY_DIRECTORIES, TRAINING_BROKER_TMPDIR, [
107
- `mkdir -p ${quote(DAIMON_GROK_ENGINE_BROKER.worker.taskClock.rootDirectoryPath)}; chmod 0755 ${quote(DAIMON_GROK_ENGINE_BROKER.worker.taskClock.rootDirectoryPath)}`,
108
- ...registrations.flatMap(r => {
109
- const p = trainingSlotPaths(r.slot);
110
- return [
111
- `mkdir -p ${quote(p.clockDirectory)}; chown 0:0 ${quote(p.clockDirectory)}; chmod 0755 ${quote(p.clockDirectory)}`,
112
- `printf '+0\\n' > ${quote(p.clockFile)}; chmod 0644 ${quote(p.clockFile)}; chown ${DAIMON_BROKER_UID}:${DAIMON_BROKER_UID} ${quote(p.clockFile)}`,
113
- `chown ${DAIMON_BROKER_UID}:${DAIMON_BROKER_UID} ${quote(p.clockDirectory)}`
114
- ];
115
- })
116
- ]),
117
- `chmod 0550 /etc/daimon-engine-broker; chown 0:${DAIMON_BROKER_UID} /etc/daimon-engine-broker`,
118
- ...registrations.flatMap(r => [...renderSlotAssertions(r), ...renderTrainingSealedInputsAssertions(r.uid, r.privateTmp)])
119
- ];
120
- };
121
- /** Reuse the audited worker renderer; never touch service config, credentials, shared temps or siblings. */
122
- export const renderTrainingSlotProvisioning = (registration) => [
123
- ...renderDirectories(slotDirectories(registration.slot), [registration.usageLedgerPath]),
124
- // Keep worker-home and private-tmp identities stable: sibling turns attest them concurrently.
125
- `setpriv --clear-groups --reuid=${registration.uid} --regid=${registration.uid} --inh-caps=-all --ambient-caps=-all --bounding-set=-all -- mkdir -p ${quote(registration.grokHome)}`,
126
- `chown 0:0 ${quote(registration.grokHome)}; chmod 0700 ${quote(registration.grokHome)}`,
127
- "node <<'SPAWNFILE_TRAINING_SLOT_PROVISION'",
128
- "const crypto = require('node:crypto'); const fs = require('node:fs');",
129
- ...renderDaimonWorkspaceResourceSecurity([]),
130
- ...renderDaimonGrokWorkerProvisioning([registration], {}, [], "slot"),
131
- "SPAWNFILE_TRAINING_SLOT_PROVISION",
132
- ...renderSlotAssertions(registration),
133
- ...renderTrainingSealedInputsAssertions(registration.uid, registration.privateTmp)
134
- ];
135
- /**
136
- * The sealed-inputs seal, asserted and then attacked before any slot is used.
137
- *
138
- * The declared datasets are bind-mounted at `/run/training/inputs/<id>`, so
139
- * `/run/training/inputs` is their common ancestor and the only inode in the
140
- * chain the container controls: it lives on the read-only image root, the image
141
- * bakes it `0:<organization gid> 0750`, and nothing in the container can widen
142
- * it afterwards. The worker uid is in neither its owner nor its group class, so
143
- * it loses *search* permission on the directory every dataset read must
144
- * traverse.
145
- *
146
- * Four attacker routes, not a cooperating tool's read: a direct
147
- * read/search/list; a user + mount namespace of the worker's own with the
148
- * bubblewrap mask and its parent lazily unmounted; a fresh `mount --bind` of
149
- * `/run/training` made inside that namespace; and, per dataset, a `mount --bind`
150
- * of the dataset's *own* mount, which carries no mask and — unlike its parent —
151
- * is not refused for locked children. A live control container left at Docker's
152
- * own `0755 root:root` hands the held-out answer key to uid 2200 through routes
153
- * one, two and four (`.runtime/sealed-inputs-dac/EVIDENCE.md`).
154
- *
155
- * Every route reports one verdict, and the verdicts are deliberately not
156
- * interchangeable:
157
- *
158
- * - `reachable` — the bytes were read. Refuse.
159
- * - `denied at-read` — the route ran and the kernel's permission check refused
160
- * the open or the list. This is the DAC seal doing the work.
161
- * - `denied at-mount` — the mount the route needs was refused although the
162
- * syscall is available.
163
- * - `unavailable seccomp` / `unavailable kernel` — the worker uid cannot open
164
- * the namespace the route needs at all, so the route provably cannot happen.
165
- * That is a *stronger* denial than DAC, and naming which layer refused is
166
- * the point: `EPERM` from a seccomp filter and `EPERM` from a kernel or LSM
167
- * policy are indistinguishable by errno, so the mechanism is derived from
168
- * the pinned profile Spawnfile ships and the declaration's digest binds
169
- * (`seccompRoutes.ts`), never guessed.
170
- * - anything else — no verdict. Refuse. "Provably cannot happen" and "could
171
- * not tell" must never collapse into one pass.
172
- *
173
- * The probe's workspace is the worker's **private** tmp, never `/tmp`: the
174
- * shared temps are provisioned `root:<organization gid> 1774` so a worker lists
175
- * names only, and probing from there is what made the first live run refuse
176
- * every trial on `namespace-rebind reached no verdict` — the `mkdir` failed, not
177
- * the seal. The private tmp is also the workspace the subject itself has.
178
- */
179
- export const renderTrainingSealedInputsAssertions = (workerUid = trainingSlotPaths(0).workerUid, privateTmp = trainingSlotPaths(0).privateTmp, mechanism = trainingNamespaceDenialMechanism()) => [
180
- // Diagnostics go to a file rather than into the verdict: a route's stderr is util-linux prose that
181
- // would turn every real verdict into "unknown", but a no-verdict refusal with no diagnostic is what
182
- // made the first live failure unreadable, so the unknown branch prints it back.
183
- `seal_diagnostic=${quote(`${trainingSlotPaths(workerUid - trainingSlotPaths(0).workerUid).root}/seal-probe.err`)}`,
184
- `seal_worker() { setpriv --clear-groups --reuid ${workerUid} --regid ${workerUid} --inh-caps=-all --ambient-caps=-all --bounding-set=-all -- /bin/sh -c "$1" 2>"$seal_diagnostic"; }`,
185
- "seal_rows=''",
186
- 'seal_record() { if [ -n "$seal_rows" ]; then seal_rows="$seal_rows,"; fi; seal_rows="$seal_rows{\\"route\\":\\"$1\\",\\"verdict\\":\\"$2\\"}"; }',
187
- "seal_route() {",
188
- ' case "$2" in',
189
- ` reachable) echo "the sealed inputs root ${TRAINING_SEALED_INPUTS_ROOT} is REACHABLE by uid ${workerUid} via $1" >&2; exit 1 ;;`,
190
- ' "denied at-read"|"denied at-mount") echo "sealed inputs route $1: $2"; seal_record "$1" "$2" ;;',
191
- ' "unavailable seccomp"|"unavailable kernel") echo "sealed inputs route $1: $2 — the worker uid cannot open the namespace this route needs, so it provably cannot happen"; seal_record "$1" "$2" ;;',
192
- ' *) echo "sealed inputs route $1 reached no verdict, so the denial is unproven: ${2:-no stdout} [stderr: $(cat "$seal_diagnostic" 2>/dev/null | tr "\\n" " " | cut -c1-400)]" >&2; exit 1 ;;',
193
- " esac",
194
- "}",
195
- // One availability determination for every namespace route, so a filtered syscall is reported as the
196
- // verdict it is instead of surfacing as a route that mysteriously produced nothing.
197
- "seal_namespace=available",
198
- `if ! seal_worker 'unshare --user --map-root-user --mount true' >/dev/null 2>&1; then seal_namespace='unavailable ${mechanism}'; fi`,
199
- 'seal_ns_route() { if [ "$seal_namespace" != available ]; then seal_route "$1" "$seal_namespace"; else seal_route "$1" "$(seal_worker "$2")"; fi; }',
200
- // Asserted, never set: the root filesystem is read-only, so an image that did not bake this mode
201
- // cannot be corrected here — and that is the point. Refuse instead.
202
- `test ! -L ${quote(TRAINING_SEALED_INPUTS_ROOT)} && test -d ${quote(TRAINING_SEALED_INPUTS_ROOT)}`,
203
- `if [ "$(stat -c '%u:%g %a' ${quote(TRAINING_SEALED_INPUTS_ROOT)})" != "${TRAINING_SEALED_INPUTS_IDENTITY.uid}:${TRAINING_SEALED_INPUTS_IDENTITY.gid} ${TRAINING_SEALED_INPUTS_IDENTITY.mode}" ]; then`,
204
- ` echo "the training image must bake ${TRAINING_SEALED_INPUTS_ROOT} as ${TRAINING_SEALED_INPUTS_IDENTITY.uid}:${TRAINING_SEALED_INPUTS_IDENTITY.gid} ${TRAINING_SEALED_INPUTS_IDENTITY.mode} on its read-only root; the sealed datasets are unprotected otherwise" >&2; exit 1`,
205
- "fi",
206
- `seal_route direct-read "$(seal_worker 'if ls -1 ${TRAINING_SEALED_INPUTS_ROOT} >/dev/null 2>&1 || test -r ${TRAINING_SEALED_INPUTS_ROOT} || test -x ${TRAINING_SEALED_INPUTS_ROOT}; then echo reachable; else echo denied at-read; fi')"`,
207
- `seal_ns_route namespace-unmount "unshare --user --map-root-user --mount -- /bin/sh -c 'umount -l ${TRAINING_SEALED_INPUTS_ROOT} >/dev/null 2>&1; umount -l /run/training >/dev/null 2>&1; if ls -1 ${TRAINING_SEALED_INPUTS_ROOT} >/dev/null 2>&1; then echo reachable; else echo denied at-read; fi; exit 0'"`,
208
- `seal_ns_route namespace-rebind-parent "unshare --user --map-root-user --mount -- /bin/sh -c 'mkdir -p ${privateTmp}/seal-parent 2>/dev/null || { echo unknown private-tmp-unwritable; exit 0; }; if mount --bind /run/training ${privateTmp}/seal-parent 2>/dev/null; then ls -1 ${privateTmp}/seal-parent/inputs >/dev/null 2>&1 && echo reachable || echo denied at-read; else echo denied at-mount; fi; exit 0'"`,
209
- // Per dataset, because the strongest route is specific. Root enumerates the children; the worker may not.
210
- `for sealed_child in ${TRAINING_SEALED_INPUTS_ROOT}/*; do`,
211
- ' test -e "$sealed_child" || continue',
212
- ` seal_route "direct-read $sealed_child" "$(seal_worker "if ls -1 '$sealed_child' >/dev/null 2>&1 || cat '$sealed_child'/* >/dev/null 2>&1; then echo reachable; else echo denied at-read; fi")"`,
213
- ` seal_ns_route "namespace-rebind $sealed_child" "unshare --user --map-root-user --mount -- /bin/sh -c 'mkdir -p ${privateTmp}/seal-child 2>/dev/null || { echo unknown private-tmp-unwritable; exit 0; }; if mount --bind \\"$sealed_child\\" ${privateTmp}/seal-child 2>/dev/null; then ls -1 ${privateTmp}/seal-child >/dev/null 2>&1 && echo reachable || echo denied at-read; else echo denied at-mount; fi; exit 0'"`,
214
- "done",
215
- // A Spawnfile-owned attestation beside the slot receipt, readable by the organization uid. The
216
- // cross-repo `noopolis.daimon.grok-slot-preflight.v2` canary shape is deliberately untouched — its
217
- // schema lives in Daimon and no consumer here can validate an added member — so the per-route
218
- // mechanism is recorded here rather than implied by a bare `result: "denied"` there.
219
- `seal_attestation=${quote(trainingSlotPaths(workerUid - trainingSlotPaths(0).workerUid).sealedInputsAttestation)}`,
220
- `printf '{"version":"spawnfile.training-sealed-inputs.v1","root":"%s","worker_uid":%s,"identity":"%s","pinned_seccomp_profile_sha256":"%s","namespace_routes":"%s","routes":[%s]}\\n' `
221
- + `${quote(TRAINING_SEALED_INPUTS_ROOT)} ${workerUid} `
222
- + `"$(stat -c '%u:%g %a' ${quote(TRAINING_SEALED_INPUTS_ROOT)})" ${quote(DAIMON_GROK_SECCOMP_PROFILE_SHA256)} `
223
- + '"$seal_namespace" "$seal_rows" > "$seal_attestation.tmp"',
224
- 'chown 0:0 "$seal_attestation.tmp"; chmod 0640 "$seal_attestation.tmp"; chown 0:' + String(DAIMON_ORGANIZATION_UID) + ' "$seal_attestation.tmp"',
225
- 'mv "$seal_attestation.tmp" "$seal_attestation"',
226
- 'echo "sealed inputs attestation written to $seal_attestation"'
227
- ];
228
- /** Where the broker's own `service.json` lands, so the supervisor can prove the slot it restarted is the slot it provisioned. */
229
- export const TRAINING_SERVICE_CONFIG_PATH = DAIMON_GROK_ENGINE_BROKER.serviceConfigPath;
230
- export const TRAINING_REGISTRATION_PATH = DAIMON_GROK_ENGINE_BROKER.registrationPath;
231
- export const TRAINING_BROKER_CONTROL_ROOT = path.posix.dirname(DAIMON_GROK_ENGINE_BROKER.controlSocketPath);
@@ -1,77 +0,0 @@
1
- /** Filesystems that silently ignore `chown`/`chmod`, so a worker-uid probe over them proves nothing. */
2
- export declare const UNENFORCED_OWNERSHIP_FILESYSTEMS: readonly ["virtiofs", "9p", "nfs", "nfs4", "cifs", "smb3", "vboxsf", "grpcfuse"];
3
- /**
4
- * The filesystem type backing `target`, from the longest mount point that is a
5
- * prefix of it. `/proc/self/mountinfo` octal-escapes space, tab, newline and
6
- * backslash in the mount point field, exactly as the durable-mount guard
7
- * already handles elsewhere in this compiler.
8
- */
9
- export declare const resolveBackingFilesystem: (target: string, mountinfo: string) => string;
10
- export interface TrainingCanaryProbe {
11
- /**
12
- * Runs one worker-uid attempt and resolves true when it was denied.
13
- *
14
- * `read` is an `open()` for reading. `enter` additionally requires that the
15
- * worker uid cannot *search* the directory, which is the property a sealed
16
- * root actually needs: its protection is that every dataset read has to
17
- * traverse it, not that the directory listing itself is unreadable.
18
- */
19
- (target: string, depth: "read" | "enter"): Promise<boolean>;
20
- }
21
- export interface TrainingCanaryOptions {
22
- denyPaths: readonly string[];
23
- probe: TrainingCanaryProbe;
24
- mountinfo: string;
25
- /** Deny entries the launch bound from the host. Diagnostics only: the backing filesystem decides, not this list. */
26
- hostBindPaths: readonly string[];
27
- /** Deny entries no policy may waive; each one must be observed unenterable by the worker uid. */
28
- sealedPaths: readonly string[];
29
- unenforcedBindPolicy: "refuse" | "profile-only";
30
- log(line: string): void;
31
- }
32
- /**
33
- * One denied canary per deny path, or a refusal naming the first path whose
34
- * denial this container cannot prove.
35
- *
36
- * Three cases, in decreasing strength:
37
- *
38
- * - A **sealed** path (the datasets' root) must sit on a filesystem that
39
- * enforces unix ownership and must be observed *unenterable* by the worker
40
- * uid. `unenforcedBindPolicy` does not reach it: the sandbox profile alone
41
- * is a boundary the worker can lift from inside a namespace of its own, and
42
- * the held-out test set is the one thing that cannot rest on it.
43
- * - Any other path on an ownership-enforcing filesystem — a host bind over
44
- * ext4/xfs/btrfs/overlay included — gets a real worker-uid read probe. This
45
- * is what makes the documented `refuse` default reachable: a host bind is
46
- * only unprovable where the filesystem says so.
47
- * - A path on a filesystem that ignores ownership (virtiofs and grpcfuse under
48
- * Docker Desktop and Colima, 9p, nfs, cifs, fuse) cannot be probed at all.
49
- * `refuse` — the default — fails the recycle and writes no receipt;
50
- * `profile-only` accepts the attested deny entry as that path's only
51
- * boundary and names every such path in the supervisor log.
52
- */
53
- export declare const resolveTrainingCanaries: (options: TrainingCanaryOptions) => Promise<{
54
- path: string;
55
- method: "sandboxed-read";
56
- result: "denied";
57
- }[]>;
58
- export interface TrainingSlotReceiptInput {
59
- slot: number;
60
- workerUid: number;
61
- generation: number;
62
- nonce: string;
63
- projectionSha256: string;
64
- sandboxProfileSha256: string;
65
- seccompProfileSha256: string;
66
- grokExecutableSha256: string;
67
- canaries: readonly {
68
- path: string;
69
- method: "sandboxed-read";
70
- result: "denied";
71
- }[];
72
- createdAt: Date;
73
- }
74
- /** `noopolis.daimon.grok-slot-preflight.v2`, in the exact member order Daimon's strict schema accepts. */
75
- export declare const buildTrainingSlotReceipt: (input: TrainingSlotReceiptInput) => Record<string, unknown>;
76
- /** sha256 of the pinned Grok executable the slot's workers exec, refused unless it is a manifest-pinned 1.0.34 build. */
77
- export declare const readGrokExecutableSha256: (executable?: "/usr/local/bin/grok") => string;
@@ -1,110 +0,0 @@
1
- import { createHash } from "node:crypto";
2
- import { readFileSync } from "node:fs";
3
- import path from "node:path";
4
- import { SpawnfileError } from "../../../shared/index.js";
5
- import { DAIMON_GROK_ENGINE_BROKER } from "../../../runtime/daimon/contractManifest.js";
6
- /** Filesystems that silently ignore `chown`/`chmod`, so a worker-uid probe over them proves nothing. */
7
- export const UNENFORCED_OWNERSHIP_FILESYSTEMS = ["virtiofs", "9p", "nfs", "nfs4", "cifs", "smb3", "vboxsf", "grpcfuse"];
8
- const isUnenforced = (fstype) => UNENFORCED_OWNERSHIP_FILESYSTEMS.includes(fstype) || fstype.startsWith("fuse");
9
- /**
10
- * The filesystem type backing `target`, from the longest mount point that is a
11
- * prefix of it. `/proc/self/mountinfo` octal-escapes space, tab, newline and
12
- * backslash in the mount point field, exactly as the durable-mount guard
13
- * already handles elsewhere in this compiler.
14
- */
15
- export const resolveBackingFilesystem = (target, mountinfo) => {
16
- let best = "", fstype = "";
17
- for (const line of mountinfo.split("\n")) {
18
- const fields = line.split(" ");
19
- const separator = fields.indexOf("-");
20
- if (separator < 0 || fields.length < separator + 2)
21
- continue;
22
- const mountPoint = (fields[4] ?? "").replace(/\\(04[0011]|134)/gu, (match) => ({ "\\040": " ", "\\011": "\t", "\\012": "\n", "\\134": "\\" }[match] ?? match));
23
- if (mountPoint !== "/" && target !== mountPoint && !target.startsWith(`${mountPoint}/`))
24
- continue;
25
- if (mountPoint.length >= best.length) {
26
- best = mountPoint;
27
- fstype = fields[separator + 1] ?? "";
28
- }
29
- }
30
- return fstype;
31
- };
32
- /**
33
- * One denied canary per deny path, or a refusal naming the first path whose
34
- * denial this container cannot prove.
35
- *
36
- * Three cases, in decreasing strength:
37
- *
38
- * - A **sealed** path (the datasets' root) must sit on a filesystem that
39
- * enforces unix ownership and must be observed *unenterable* by the worker
40
- * uid. `unenforcedBindPolicy` does not reach it: the sandbox profile alone
41
- * is a boundary the worker can lift from inside a namespace of its own, and
42
- * the held-out test set is the one thing that cannot rest on it.
43
- * - Any other path on an ownership-enforcing filesystem — a host bind over
44
- * ext4/xfs/btrfs/overlay included — gets a real worker-uid read probe. This
45
- * is what makes the documented `refuse` default reachable: a host bind is
46
- * only unprovable where the filesystem says so.
47
- * - A path on a filesystem that ignores ownership (virtiofs and grpcfuse under
48
- * Docker Desktop and Colima, 9p, nfs, cifs, fuse) cannot be probed at all.
49
- * `refuse` — the default — fails the recycle and writes no receipt;
50
- * `profile-only` accepts the attested deny entry as that path's only
51
- * boundary and names every such path in the supervisor log.
52
- */
53
- export const resolveTrainingCanaries = async (options) => {
54
- const canaries = [];
55
- for (const target of options.denyPaths) {
56
- const fstype = resolveBackingFilesystem(target, options.mountinfo);
57
- const origin = `${options.hostBindPaths.includes(target) ? "a host bind mount on " : ""}${fstype || "an unknown filesystem"}`;
58
- if (options.sealedPaths.includes(target)) {
59
- if (isUnenforced(fstype)) {
60
- throw new SpawnfileError("runtime_error", `Grok slot sealed canary ${target} is backed by ${origin}, which ignores unix ownership, so the worker uid's denial cannot be proven; the sealed datasets must sit under a directory on an ownership-enforcing filesystem and no unenforcedBindPolicy waives this`);
61
- }
62
- if (!await options.probe(target, "enter")) {
63
- throw new SpawnfileError("runtime_error", `Grok slot sealed canary ${target} is still reachable by the worker uid`);
64
- }
65
- }
66
- else if (isUnenforced(fstype)) {
67
- if (options.unenforcedBindPolicy === "refuse") {
68
- throw new SpawnfileError("runtime_error", `Grok slot canary ${target} is backed by ${origin}, which ignores unix ownership; declare unenforcedBindPolicy "profile-only" to accept the bubblewrap deny list as its only boundary`);
69
- }
70
- options.log(`canary ${target} certified by the enforced sandbox profile only (${origin} ignores unix ownership)`);
71
- }
72
- else if (!await options.probe(target, "read")) {
73
- throw new SpawnfileError("runtime_error", `Grok slot canary ${target} is still readable by the worker uid`);
74
- }
75
- canaries.push({ path: target, method: "sandboxed-read", result: "denied" });
76
- }
77
- return canaries;
78
- };
79
- /** `noopolis.daimon.grok-slot-preflight.v2`, in the exact member order Daimon's strict schema accepts. */
80
- export const buildTrainingSlotReceipt = (input) => {
81
- if (!/^[a-f0-9]{64}$/u.test(input.nonce))
82
- throw new SpawnfileError("runtime_error", "Grok slot recycle nonce must be 32 random bytes in lowercase hex");
83
- if (!Number.isSafeInteger(input.generation) || input.generation < 1)
84
- throw new SpawnfileError("runtime_error", "Grok slot generation must be a positive integer");
85
- if (input.canaries.length === 0)
86
- throw new SpawnfileError("runtime_error", "Grok slot receipt requires at least one denied canary");
87
- return {
88
- version: DAIMON_GROK_ENGINE_BROKER.slotPreflightVersion,
89
- slot: input.slot,
90
- worker_uid: input.workerUid,
91
- generation: input.generation,
92
- nonce: input.nonce,
93
- projection_sha256: input.projectionSha256,
94
- sandbox_profile_sha256: input.sandboxProfileSha256,
95
- seccomp_profile_sha256: input.seccompProfileSha256,
96
- sandbox_runtime: "bubblewrap",
97
- grok_executable_sha256: input.grokExecutableSha256,
98
- canaries: [...input.canaries],
99
- created_at: `${input.createdAt.toISOString().slice(0, 23)}Z`
100
- };
101
- };
102
- /** sha256 of the pinned Grok executable the slot's workers exec, refused unless it is a manifest-pinned 1.0.34 build. */
103
- export const readGrokExecutableSha256 = (executable = DAIMON_GROK_ENGINE_BROKER.grokExecutablePath) => {
104
- const digest = createHash("sha256").update(readFileSync(executable)).digest("hex");
105
- const pinned = [DAIMON_GROK_ENGINE_BROKER.grokCliArtifacts.arm64.sha256, DAIMON_GROK_ENGINE_BROKER.grokCliArtifacts.x64.sha256];
106
- if (!pinned.includes(digest)) {
107
- throw new SpawnfileError("runtime_error", `${path.basename(executable)} is not the manifest-pinned Grok ${DAIMON_GROK_ENGINE_BROKER.grokCliVersion} build`);
108
- }
109
- return digest;
110
- };
@@ -1,33 +0,0 @@
1
- import { type Socket } from "node:net";
2
- /** A reply is one short JSON line; anything longer is not this supervisor. */
3
- export declare const TRAINING_RECYCLE_MAX_REPLY_BYTES = 65536;
4
- /** Above the supervisor's 120 s drain deadline plus wipe, provision and canaries. */
5
- export declare const TRAINING_RECYCLE_DEFAULT_TIMEOUT_MS = 180000;
6
- export interface RecycleTrainingSlotOptions {
7
- slot: number;
8
- /** This trial's 32-byte hex nonce; the published receipt must echo it. */
9
- nonce: string;
10
- signal?: AbortSignal;
11
- /** Opens the supervisor connection; defaults to the container's fixed supervisor socket. */
12
- connect?: () => Socket;
13
- timeoutMs?: number;
14
- }
15
- export interface TrainingSlotRecycleReceipt {
16
- slot: number;
17
- generation: number;
18
- nonce: string;
19
- /** The receipt path the supervisor says it published; callers compare it to the slot descriptor. */
20
- receipt: string;
21
- durationMs: number;
22
- }
23
- /**
24
- * One `recycle` over the root slot supervisor socket (`spawnfile.training-slot-supervisor.v2`).
25
- *
26
- * The verb takes a slot and a nonce, never a path or a command: the container
27
- * replays its own audited provisioning and publishes the slot preflight receipt
28
- * echoing this nonce. The answer must bind this request exactly (protocol,
29
- * verb, slot, nonce, a generation of at least 1) or it is refused; a supervisor
30
- * refusal surfaces with its own reason. The reply is bounded, and the call is
31
- * bounded by `timeoutMs` and `signal`.
32
- */
33
- export declare const recycleTrainingSlot: (options: RecycleTrainingSlotOptions) => Promise<TrainingSlotRecycleReceipt>;
@@ -1,112 +0,0 @@
1
- import { createConnection } from "node:net";
2
- import { SpawnfileError } from "../../../shared/index.js";
3
- import { TRAINING_MAX_SLOTS, TRAINING_SUPERVISOR_SOCKET } from "./paths.js";
4
- import { TRAINING_SUPERVISOR_PROTOCOL } from "./supervisor.js";
5
- /** A reply is one short JSON line; anything longer is not this supervisor. */
6
- export const TRAINING_RECYCLE_MAX_REPLY_BYTES = 65_536;
7
- /** Above the supervisor's 120 s drain deadline plus wipe, provision and canaries. */
8
- export const TRAINING_RECYCLE_DEFAULT_TIMEOUT_MS = 180_000;
9
- const NONCE = /^[a-f0-9]{64}$/u;
10
- const REPLY_KEYS = ["durationMs", "generation", "nonce", "ok", "receipt", "slot", "v", "verb"];
11
- const refuse = (message) => new SpawnfileError("runtime_error", message);
12
- /** The supervisor's refusal text is diagnostic only; keep it one bounded printable line. */
13
- const refusalText = (value) => typeof value === "string" ? value.replace(/[^\x20-\x7e]/gu, "?").slice(0, 512) || "unknown" : "unknown";
14
- const bindReply = (answer, slot, nonce) => {
15
- if (answer.ok !== true)
16
- throw refuse(`Training slot ${slot} recycle refused: ${refusalText(answer.error)}`);
17
- if (Object.keys(answer).sort().join(",") !== REPLY_KEYS.join(",") || answer.verb !== "recycle") {
18
- throw refuse("Training slot recycle answer is not a recycle receipt");
19
- }
20
- if (answer.slot !== slot)
21
- throw refuse(`Training slot recycle answer names slot ${String(answer.slot)}, not the leased slot ${slot}`);
22
- if (answer.nonce !== nonce)
23
- throw refuse("Training slot recycle answer does not echo this trial's nonce");
24
- if (!Number.isSafeInteger(answer.generation) || answer.generation < 1) {
25
- throw refuse("Training slot recycle answer carries no valid generation");
26
- }
27
- if (typeof answer.receipt !== "string" || answer.receipt.length === 0)
28
- throw refuse("Training slot recycle answer names no receipt");
29
- if (typeof answer.durationMs !== "number" || !Number.isFinite(answer.durationMs) || answer.durationMs < 0) {
30
- throw refuse("Training slot recycle answer carries no valid duration");
31
- }
32
- return { slot, generation: answer.generation, nonce, receipt: answer.receipt, durationMs: answer.durationMs };
33
- };
34
- /**
35
- * One `recycle` over the root slot supervisor socket (`spawnfile.training-slot-supervisor.v2`).
36
- *
37
- * The verb takes a slot and a nonce, never a path or a command: the container
38
- * replays its own audited provisioning and publishes the slot preflight receipt
39
- * echoing this nonce. The answer must bind this request exactly (protocol,
40
- * verb, slot, nonce, a generation of at least 1) or it is refused; a supervisor
41
- * refusal surfaces with its own reason. The reply is bounded, and the call is
42
- * bounded by `timeoutMs` and `signal`.
43
- */
44
- export const recycleTrainingSlot = (options) => {
45
- const { slot, nonce } = options;
46
- if (!Number.isInteger(slot) || slot < 0 || slot >= TRAINING_MAX_SLOTS) {
47
- return Promise.reject(new SpawnfileError("validation_error", `Training slot recycle requires a slot index from 0 to ${TRAINING_MAX_SLOTS - 1}`));
48
- }
49
- if (!NONCE.test(nonce))
50
- return Promise.reject(new SpawnfileError("validation_error", "Training slot recycle requires a 32-byte hex nonce"));
51
- try {
52
- options.signal?.throwIfAborted();
53
- }
54
- catch (error) {
55
- return Promise.reject(error);
56
- }
57
- return new Promise((resolve, reject) => {
58
- const socket = (options.connect ?? (() => createConnection(TRAINING_SUPERVISOR_SOCKET)))();
59
- let buffer = Buffer.alloc(0), settled = false;
60
- const onAbort = () => finish(options.signal?.reason instanceof Error ? options.signal.reason : refuse("Training slot recycle was aborted"));
61
- const timer = setTimeout(() => finish(refuse(`Training slot ${slot} recycle timed out before the supervisor answered`)), options.timeoutMs ?? TRAINING_RECYCLE_DEFAULT_TIMEOUT_MS);
62
- function finish(error, value) {
63
- if (settled)
64
- return;
65
- settled = true;
66
- clearTimeout(timer);
67
- options.signal?.removeEventListener("abort", onAbort);
68
- socket.destroy();
69
- if (error === undefined)
70
- resolve(value);
71
- else
72
- reject(error);
73
- }
74
- options.signal?.addEventListener("abort", onAbort, { once: true });
75
- socket.on("error", (error) => finish(refuse(`Training slot recycle could not reach the root supervisor: ${error.message}`)));
76
- socket.on("close", () => finish(refuse("Training slot recycle connection closed before an answer")));
77
- socket.on("connect", () => socket.write(`${JSON.stringify({ v: TRAINING_SUPERVISOR_PROTOCOL, verb: "recycle", slot, nonce })}\n`));
78
- socket.on("data", (chunk) => {
79
- buffer = Buffer.concat([buffer, chunk]);
80
- const end = buffer.indexOf(0x0a);
81
- if (end < 0 ? buffer.length > TRAINING_RECYCLE_MAX_REPLY_BYTES : end > TRAINING_RECYCLE_MAX_REPLY_BYTES) {
82
- finish(refuse("Training slot recycle answer exceeded its bound"));
83
- return;
84
- }
85
- if (end < 0)
86
- return;
87
- let answer;
88
- try {
89
- answer = JSON.parse(buffer.subarray(0, end).toString("utf8"));
90
- }
91
- catch {
92
- finish(refuse("Training slot recycle answer is not JSON"));
93
- return;
94
- }
95
- if (!answer || typeof answer !== "object" || Array.isArray(answer)) {
96
- finish(refuse("Training slot recycle answer is not an object"));
97
- return;
98
- }
99
- const record = answer;
100
- if (record.v !== TRAINING_SUPERVISOR_PROTOCOL) {
101
- finish(refuse("Training slot recycle answer names another protocol"));
102
- return;
103
- }
104
- try {
105
- finish(undefined, bindReply(record, slot, nonce));
106
- }
107
- catch (error) {
108
- finish(error);
109
- }
110
- });
111
- });
112
- };
@@ -1,46 +0,0 @@
1
- import { type DaimonGrokBrokerModel, type DaimonGrokBrokerReasoningEffort } from "../../../runtime/daimon/contractManifest.js";
2
- import { type DaimonAgentSkill } from "../../../runtime/daimon/grokWorkerSkills.js";
3
- import { type DaimonGrokRegistration } from "../../containerDaimonGrokWorkerRender.js";
4
- /**
5
- * The one training slot's deny list: Daimon's own protected set for a
6
- * single-agent organization (Grok bootstrap, realm, and the slot state root that
7
- * holds the wake-acceptance store) plus everything this container provisions that the subject must not read —
8
- * the evaluator roots, the caller's protected `/run/spawnfile-training` paths, the broker
9
- * control and registration roots, the grant home root, the inference ledger,
10
- * the per-slot ledger, turn store and supervisor socket directory.
11
- *
12
- * The same two refusals the production render enforces apply here: an entry
13
- * that equals or contains a Grok 1.0.34 base-profile grant makes Grok refuse
14
- * the profile outright, and masks cannot nest, so an entry covered by another
15
- * entry is a provisioning bug rather than something to silently drop.
16
- */
17
- export declare const resolveTrainingGrokDenyPaths: (added?: readonly string[] | undefined, slot?: number, slots?: number) => string[];
18
- export interface TrainingGrokSlotInput {
19
- slot?: number;
20
- slots?: number;
21
- agentId: string;
22
- model: DaimonGrokBrokerModel;
23
- reasoningEffort: DaimonGrokBrokerReasoningEffort;
24
- /** Deny entries this container adds beyond Daimon's own protected set; defaults to the fixed training set. */
25
- denyPaths?: readonly string[];
26
- /**
27
- * The declaration's per-turn limits. The broker registration must declare
28
- * them, because a wake may only LOWER a declared limit: a trial whose wake
29
- * ceiling exceeds the manifest defaults is refused as `invalid_request`.
30
- */
31
- limits?: {
32
- maxRequests: number;
33
- maxTokens: number;
34
- timeoutMs: number;
35
- };
36
- /** The declaration's skills; rendered into the slot's `$GROK_HOME/skills` and bound as `skillsSha256`. */
37
- skills?: readonly DaimonAgentSkill[];
38
- }
39
- /**
40
- * The single brokered Grok registration a training container runs, at the
41
- * fixed container paths in `paths.ts`. Unlike production it points
42
- * `usageLedgerPath` at the per-slot ledger, because each trial's spend must be
43
- * separable and a recycle wipes it; the container-wide ledger and wake fuse do
44
- * not exist here.
45
- */
46
- export declare const resolveTrainingGrokRegistration: (input: TrainingGrokSlotInput) => DaimonGrokRegistration;