spawnfile 0.1.32 → 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,252 +0,0 @@
1
- import { canonicalWireId } from '../../../../training/index.js';
2
- import { join } from 'node:path';
3
- import { nativeCodexAccount, nativeTrialArtifactsRoot } from './receipt/index.js';
4
- import { acquireNativeAccountLease, nativeStartupClosureConfirmed } from '../services/index.js';
5
- import { admittedNativeEvidence } from './outcome.js';
6
- import { boundedTransportCall, requestTransportDelivery, transportTerminalBinding, verifyPreparedTransport } from './transport/index.js';
7
- import { startOwnedChild } from './child/index.js';
8
- import { nextExternalInput, weakestNativeCoverage } from './external.js';
9
- import { MAX_EXTERNAL_DELIVERIES, engineWakeTimeoutMs } from './worker/index.js';
10
- import { dockerCommand, workerRequest } from './container/index.js';
11
- import { startOwnedContainer } from './container/index.js';
12
- import { loadNativeLaunch } from './container/index.js';
13
- import { createNativeObserver } from './observations.js';
14
- import { readSealedBrokerRequests, readSealedBrokerSeal, readSealedBrokerUsage } from './sealed-usage.js';
15
- import { nativeAdmission, unknownNativeAdmission } from './admission.js';
16
- export function createDaimonNativeAdapter(options = {}) {
17
- const timeoutMs = options.timeoutMs ?? 900_000;
18
- if (!Number.isSafeInteger(timeoutMs) || timeoutMs < 100 || timeoutMs > 86_400_000)
19
- throw new Error('Invalid native adapter deadline');
20
- if (options.startupMs !== undefined && (!Number.isSafeInteger(options.startupMs) || options.startupMs < 1 || options.startupMs > 3_600_000))
21
- throw new Error('Invalid native startup deadline');
22
- if (options.execution && options.externalInputs)
23
- throw new Error('Child execution requires execution.externalInputs, not Docker externalInputs');
24
- const sealedUsage = options.sealedUsage;
25
- const execution = options.execution;
26
- if (execution && execution.kind !== 'child-process')
27
- throw new Error('Unsupported native execution mode');
28
- const childExternal = execution?.externalInputs ? { ...execution.externalInputs } : undefined;
29
- const dockerExternal = options.externalInputs ? { ...options.externalInputs } : undefined;
30
- const external = childExternal ?? dockerExternal;
31
- if (external && (!Number.isSafeInteger(external.maxDeliveries) || external.maxDeliveries < 1 || external.maxDeliveries > MAX_EXTERNAL_DELIVERIES || typeof external.next !== 'function'))
32
- throw new Error('Invalid external input policy');
33
- if (options.execution && options.docker)
34
- throw new Error('Select one native execution transport');
35
- if (options.transportDelivery && typeof options.transportDelivery.prepare !== 'function')
36
- throw new Error('Invalid transport delivery provider');
37
- const docker = options.docker ?? dockerCommand();
38
- return {
39
- id: 'daimon-native',
40
- capabilities: { toolTrace: 'partial', liveObservations: true, cancellation: 'native-handle', multiTurn: false,
41
- resources: ['instructions', 'native-skills', 'supporting-files'], readIsolation: 'declared-paths', protectedPaths: true,
42
- isolation: execution ? 'Fresh worker child in shared caller container; exact native sandbox protects declared paths' :
43
- 'Fresh local Linux container; canonical native sandbox denies /run and runtime credentials; evaluator files excluded from mounts' },
44
- async start(input) {
45
- if (input.signal?.aborted)
46
- throw new Error('Native subject start aborted');
47
- const launch = await loadNativeLaunch(input, !!execution);
48
- if (launch.delivery === 'transport' && !options.transportDelivery)
49
- throw new Error('Transport delivery mode requires a transport delivery provider');
50
- const account = nativeCodexAccount(launch);
51
- // Admission is cancellable and outside both startup and cognition clocks.
52
- const releaseAccount = account ? await acquireNativeAccountLease(account.realm.source, input.signal) : undefined;
53
- const deadline = Date.now() + timeoutMs;
54
- let container;
55
- try {
56
- container = execution
57
- ? await startOwnedChild(execution, launch, input.trialId, timeoutMs, input.signal, options.startupMs, input.protectedPaths)
58
- : await startOwnedContainer(docker, launch, input.trialId, timeoutMs, input.signal, options.startupMs).then(owned => ({
59
- ...owned, request: (path, body, ms, signal) => workerRequest(docker, owned.name, path, body, ms, signal, launch.host.port),
60
- }));
61
- }
62
- catch (error) {
63
- if (nativeStartupClosureConfirmed(error))
64
- releaseAccount?.();
65
- throw error;
66
- }
67
- const observer = createNativeObserver(input, launch.projections.find(row => row.role === 'home').source, launch.agent.id, launch.agent.engine);
68
- const evidence = { schema: 'spawnfile.training.daimon-native.evidence.v1', wakes: [] };
69
- const admittedDeliveries = new Set();
70
- let attributionInvalid = false;
71
- let ordinal = 0;
72
- let used = false;
73
- let stopped = false;
74
- const sessionCancellation = new AbortController();
75
- const stop = async (reason) => {
76
- stopped = true;
77
- sessionCancellation.abort();
78
- const receipt = await container.stop(reason);
79
- if (receipt.state === 'acknowledged' && receipt.quiescence === 'confirmed')
80
- releaseAccount?.();
81
- return receipt;
82
- };
83
- const deliver = async (turn, signal, controls, observedWakeId = turn.id, transport) => {
84
- if (stopped || signal?.aborted || input.signal?.aborted)
85
- throw new Error('Native subject cancelled before delivery');
86
- const signals = [input.signal, signal].filter((value) => value !== undefined);
87
- const cancelled = new AbortController();
88
- const abort = () => { cancelled.abort(); if (!stopped)
89
- void stop('Native subject aborted'); };
90
- for (const source of signals)
91
- source.addEventListener('abort', abort, { once: true });
92
- if (signals.some(source => source.aborted))
93
- abort();
94
- let done = false;
95
- let terminal;
96
- let failure;
97
- const deliveryOrdinal = ++ordinal;
98
- const body = { wakeId: turn.id, text: turn.text, ...(controls ? { controls } : {}) };
99
- const response = (transport
100
- ? requestTransportDelivery(container.request, { ...body, source: transport.source }, transport, deadline, cancelled.signal)
101
- : container.request('/trial/run', body, Math.max(1, deadline - Date.now()) + 8000, cancelled.signal))
102
- .then(value => { terminal = value; }, error => { failure = error; }).finally(() => { done = true; });
103
- try {
104
- while (!done) {
105
- await observer.checkpoint(observedWakeId);
106
- await Promise.race([response, new Promise(resolve => setTimeout(resolve, 200))]);
107
- }
108
- if (failure)
109
- throw failure;
110
- if (!terminal || canonicalWireId(terminal.schema) !== 'spawnfile.training.daimon-native.trial.v1' || terminal.trialId !== input.trialId ||
111
- terminal.wakeId !== turn.id || terminal.agentId !== launch.agent.id || terminal.model !== launch.agent.model ||
112
- terminal.configSha256 !== launch.configSha256) {
113
- if (terminal)
114
- attributionInvalid = true;
115
- throw new Error('Native terminal evidence identity mismatch');
116
- }
117
- const binding = transport ? transportTerminalBinding(terminal, transport.source) : 'bound';
118
- if (binding === 'conflict') {
119
- attributionInvalid = true;
120
- throw new Error('Native transport terminal evidence identity mismatch');
121
- }
122
- let admitted;
123
- try {
124
- admitted = admittedNativeEvidence(terminal, launch, input.trialId, turn.id, deliveryOrdinal, join(nativeTrialArtifactsRoot(launch, input.trialId), 'evidence.json'), transport?.source, admittedDeliveries, engineWakeTimeoutMs(timeoutMs, launch));
125
- // Evidence admission only withholds evidence from collect(); the turn's own verdict is unchanged.
126
- }
127
- catch {
128
- attributionInvalid = true;
129
- }
130
- if (admitted)
131
- evidence.wakes.push(admitted);
132
- if (terminal.blocked && terminal.status !== 'failed')
133
- throw new Error('Blocked native terminal cannot claim completion');
134
- const admission = terminal.status === 'failed' && !terminal.blocked ? nativeAdmission(terminal) : undefined;
135
- await observer.checkpoint(observedWakeId);
136
- // No execution has no usage/output to publish. Retain its admission
137
- // evidence in the turn before collectors demand an execution binding.
138
- const usage = admission && Object.values(admission).every(value => value === 0)
139
- ? null : await observer.terminal(observedWakeId, terminal);
140
- // The blocked receipt travels with the verified terminal evidence: the trace
141
- // closed, the delivery stayed accepted and deferred, and the identity checks
142
- // above matched. The caller needs that apart from the bare `failed` status.
143
- return { result: { status: terminal.status, text: '', usage, error: terminal.error, coverage: terminal.coverage,
144
- ...(admission ? { admission } : {}),
145
- ...(terminal.blocked ? { blocked: terminal.blocked } : {}),
146
- ...(terminal.limit && terminal.status === 'failed' ? { limit: terminal.limit } : {}) }, terminal, verified: binding === 'bound' };
147
- }
148
- catch (error) {
149
- const wasCancelled = stopped || signals.some(source => source.aborted);
150
- cancelled.abort();
151
- const receipt = await stop('Native subject execution failed');
152
- // The worker's reply was the only route usage normally takes here,
153
- // and it never came — but a wake that fails spends the same money
154
- // as one that publishes, and the broker sealed what its own proxy
155
- // measured. Read that rather than reporting a zero nobody measured.
156
- // The broker's own two ledgers, read on one bounded wait: what the
157
- // turn spent, and — the only record that can tell a provider
158
- // request issued and never answered from one never issued at all —
159
- // when each request started and whether it ended.
160
- // And the sealed terminal record itself, which a hung turn's HTTP
161
- // reply can never carry: the failure code, the worker's redacted
162
- // last words, and the MCP tool call it was still blocked on.
163
- const [sealed, requests, seal] = await Promise.all([
164
- readSealedBrokerUsage(launch, sealedUsage), readSealedBrokerRequests(launch, sealedUsage),
165
- readSealedBrokerSeal(launch, sealedUsage),
166
- ]);
167
- const usage = await observer.sealedUsage(observedWakeId, sealed.rows);
168
- if (requests)
169
- await observer.brokerRequests(observedWakeId, requests);
170
- if (seal)
171
- await observer.brokerSeal(observedWakeId, seal);
172
- // Whatever the worker said before it stopped answering, redacted.
173
- const record = container.diagnostic?.();
174
- if (record)
175
- await observer.childDiagnostic(observedWakeId, record);
176
- return { result: { status: wasCancelled ? 'cancelled' : 'failed',
177
- admission: unknownNativeAdmission(),
178
- text: '', usage, error: String(error), stop: receipt,
179
- coverage: [{ channel: 'tools', completeness: 'partial', ordering: 'none' },
180
- { channel: 'output', completeness: 'absent', ordering: 'none' },
181
- // Measured, but never complete: the execution it belongs to never closed.
182
- { channel: 'usage', completeness: usage ? 'partial' : 'absent',
183
- ordering: usage ? 'source' : 'none' }] }, terminal, verified: false };
184
- }
185
- finally {
186
- for (const source of signals)
187
- source.removeEventListener('abort', abort);
188
- }
189
- };
190
- return { stop, async run(turn, signal) {
191
- const result = await run(turn, signal);
192
- return { ...result, ...(!attributionInvalid && evidence.wakes.length ? { evidence: { adapterId: 'daimon-native', payload: structuredClone(evidence) } } : {}) };
193
- } };
194
- async function run(turn, signal) {
195
- if (used || stopped)
196
- throw new Error('Native Daimon session permits one delivery');
197
- used = true;
198
- const combined = AbortSignal.any([sessionCancellation.signal, input.signal, signal].filter((value) => value !== undefined));
199
- const coverages = [];
200
- const ids = new Set([turn.id]);
201
- let current = turn;
202
- let transport;
203
- let controls = external ? { maxExternalDeliveries: external.maxDeliveries } : undefined;
204
- try {
205
- if (launch.delivery === 'transport') {
206
- transport = await boundedTransportCall(bound => options.transportDelivery.prepare({ trialId: input.trialId, turnId: turn.id,
207
- text: turn.text, launch, executionId: container.name }, bound), deadline, combined);
208
- verifyPreparedTransport(transport);
209
- }
210
- for (let ordinal = 0;; ordinal++) {
211
- const { result, terminal, verified } = await deliver(current, combined, controls, turn.id, transport);
212
- coverages.push(result.coverage);
213
- // A cancelled wake never carries the deferral: cancellation is the machine's outcome.
214
- if (verified && stopped)
215
- return { ...result, status: 'cancelled', blocked: undefined, limit: undefined, usage: observer.usage(),
216
- coverage: weakestNativeCoverage(coverages), stop: await stop('Native subject stopped after verified wake') };
217
- if (!verified || !external || terminal?.blocked !== 'awaiting-external-input')
218
- return { ...result, usage: observer.usage(), coverage: weakestNativeCoverage(coverages) };
219
- if (ordinal >= external.maxDeliveries)
220
- return { ...result, status: 'failed', usage: observer.usage(), coverage: weakestNativeCoverage(coverages), stop: await stop('External input delivery budget exhausted') };
221
- const common = { trialId: input.trialId, turnId: turn.id, launch, terminal };
222
- const next = execution
223
- ? await nextExternalInput(childExternal, { ...common, executionId: container.name }, deadline, combined)
224
- : await nextExternalInput(dockerExternal, { ...common, containerName: container.name }, deadline, combined);
225
- combined.throwIfAborted();
226
- if (!next)
227
- return { ...result, status: 'failed', usage: observer.usage(), coverage: weakestNativeCoverage(coverages), stop: await stop('No matching external input') };
228
- if (launch.delivery === 'transport' && !next.transport)
229
- throw new Error('Transport continuation requires a declared transport delivery');
230
- if (launch.delivery !== 'transport' && next.transport)
231
- throw new Error('Direct delivery cannot publish a transport continuation');
232
- if (ids.has(next.id))
233
- throw new Error('External input delivery ID was reused');
234
- ids.add(next.id);
235
- await observer.externalInput(turn.id, next);
236
- current = { id: next.id, text: next.text };
237
- controls = { source: next.source };
238
- transport = next.transport;
239
- }
240
- }
241
- catch (error) {
242
- const wasCancelled = combined.aborted;
243
- const receipt = await stop('External input continuation failed');
244
- return { status: wasCancelled ? 'cancelled' : 'failed', text: '', usage: observer.usage(), error: String(error), stop: receipt,
245
- admission: unknownNativeAdmission(),
246
- coverage: weakestNativeCoverage(coverages) };
247
- }
248
- }
249
- },
250
- };
251
- }
252
- //# sourceMappingURL=adapter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"adapter.js","sourceRoot":"","sources":["../../../../../src/runtime/daimon/training/native/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,MAAM,W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AAE,EAAE,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC;wBAC3C,QAAQ,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,CAAC;wBACnC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;oBAC7B,CAAC;gBACH,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,MAAM,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC;oBACtC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,oCAAoC,CAAC,CAAC;oBACjE,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,OAAO;wBAC5H,SAAS,EAAE,sBAAsB,EAAE;wBACnC,QAAQ,EAAE,qBAAqB,CAAC,SAAS,CAAC,EAAE,CAAC;gBACjD,CAAC;YACH,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,7 +0,0 @@
1
- import type { SubjectTurnResult } from '../../../../training/index.js';
2
- import type { TerminalEvidence } from './worker/index.js';
3
- type Admission = NonNullable<SubjectTurnResult['admission']>;
4
- export declare const unknownNativeAdmission: () => Admission;
5
- /** Called only after the adapter binds trial, wake, agent, model, config and transport source. */
6
- export declare function nativeAdmission(value: TerminalEvidence): Admission;
7
- export {};
@@ -1,52 +0,0 @@
1
- export const unknownNativeAdmission = () => ({ executionRecords: null, executionsUsed: null, agentExecutionsUsed: null,
2
- tokensUsed: null, agentTokensUsed: null, toolEvents: null, outputEvents: null });
3
- const count = (value) => Array.isArray(value) ? value.length : null;
4
- const counter = (value) => Number.isSafeInteger(value) && Number(value) >= 0 ? Number(value) : null;
5
- /** Called only after the adapter binds trial, wake, agent, model, config and transport source. */
6
- export function nativeAdmission(value) {
7
- const receipt = value.receipt;
8
- const activity = value.activity;
9
- const availability = value.availability;
10
- const native = value.native;
11
- if (!receipt || receipt.version !== 'noopolis.daimon.wake-receipt-status.v2' || receipt.agent_id !== value.agentId ||
12
- typeof receipt.acceptance_id !== 'string' || receipt.acceptance_id.trim().length === 0 ||
13
- receipt.state !== 'accepted' || receipt.deferred || receipt.execution_id !== undefined ||
14
- receipt.delivery_id !== (value.transport?.deliveryId ?? `${value.trialId}:${value.wakeId}`) ||
15
- !activity || activity.version !== 'noopolis.daimon.organization-runtime-activity.v2' || !Array.isArray(activity.items) ||
16
- !activity.items.length || activity.items.some(item => !item || item.agent_id !== value.agentId ||
17
- item.delivery_id !== receipt.delivery_id || item.acceptance_id !== receipt.acceptance_id ||
18
- item.execution_id !== undefined || item.state !== 'accepted' || item.active !== false || item.deferred) ||
19
- availability?.version !== 'noopolis.daimon.work-availability.v1' || !Array.isArray(availability.agents) ||
20
- availability.agents.length !== 1 || availability.agents[0]?.agent_id !== value.agentId ||
21
- availability.agents[0].running !== false || !native)
22
- return unknownNativeAdmission();
23
- const budget = availability.agents[0].budget;
24
- if (!budget || budget.armed !== true || budget.epoch !== value.trialId)
25
- return unknownNativeAdmission();
26
- const records = [count(activity.executions), count(native.traces), count(native.usage), count(native.modelContexts),
27
- count(native.accounting?.usage), value.executionId === undefined ? 0 : 1,
28
- native.requests === undefined ? 0 : count(native.requests), native.turnSeals === undefined ? 0 : count(native.turnSeals)];
29
- if (value.transport) {
30
- const transport = value.transport;
31
- if (transport.acceptanceId !== receipt.acceptance_id || !Array.isArray(transport.selectedDeliveries) ||
32
- !transport.selectedDeliveries.length || transport.selectedDeliveries.some(row => !row ||
33
- row.deliveryId !== receipt.delivery_id || !Array.isArray(row.executionIds) || row.executionIds.length !== 0 ||
34
- row.receipt?.execution_id !== undefined || row.receipt?.agent_id !== value.agentId ||
35
- row.receipt?.delivery_id !== receipt.delivery_id || row.receipt?.acceptance_id !== receipt.acceptance_id ||
36
- row.receipt?.state !== 'accepted' || row.receipt?.deferred))
37
- return unknownNativeAdmission();
38
- records.push(count(transport.batches), transport.batch === undefined ? 0 : 1);
39
- }
40
- const texts = [receipt.text, ...activity.items.map(item => item.text),
41
- ...(value.transport?.selectedDeliveries ?? []).map(row => row.receipt?.text)];
42
- return {
43
- executionRecords: records.includes(null) ? null : records.reduce((sum, item) => sum + item, 0),
44
- executionsUsed: counter(budget.executions_used), agentExecutionsUsed: counter(budget.agent_executions_used),
45
- tokensUsed: counter(budget.tokens_used), agentTokensUsed: counter(budget.agent_tokens_used),
46
- toolEvents: count(native.toolReceipts),
47
- outputEvents: texts.some(text => text !== undefined && typeof text !== 'string') ? null
48
- : texts.some(text => !!text) ? 1
49
- : value.coverage?.some(row => row.channel === 'output' && row.completeness === 'absent') ? 0 : null,
50
- };
51
- }
52
- //# sourceMappingURL=admission.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"admission.js","sourceRoot":"","sources":["../../../../../src/runtime/daimon/training/native/admission.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAc,EAAE,CAAC,CAAC,EAAE,gBAAgB,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI;IAC/H,UAAU,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;AACnF,MAAM,KAAK,GAAG,CAAC,KAAc,EAAiB,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AAC5F,MAAM,OAAO,GAAG,CAAC,KAAc,EAAiB,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,K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C,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IAChF,OAAO;QACL,gBAAgB,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAS,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,CAAC,GAAG,GAAG,IAAK,EAAE,CAAC,CAAC;QACvG,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,CAAC,EAAE,mBAAmB,EAAE,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAC;QAC3G,UAAU,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE,eAAe,EAAE,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC;QAC3F,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC;QACtC,YAAY,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,SAAS,IAAI,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI;YACrF,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;gBAChC,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,KAAK,QAAQ,IAAI,GAAG,CAAC,YAAY,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI;KACtG,CAAC;AACJ,CAAC"}
@@ -1,16 +0,0 @@
1
- import { type VerifiedNativeLaunch } from '../receipt/index.js';
2
- export declare function nativeChildArguments(launch: VerifiedNativeLaunch, trialId: string, timeoutMs: number): string[];
3
- /**
4
- * Creates this trial's private artifact directory before the worker starts.
5
- *
6
- * A Codex control root is already per-trial, so it is returned untouched. A Grok
7
- * slot control root is fixed by the container and shared across trials: the
8
- * non-recursive `mkdir` below is what separates them, and it fails with EEXIST
9
- * rather than colliding with, or silently overwriting, the previous trial's
10
- * exclusive artifacts. Nothing outside this directory is Training's to clear, so
11
- * the slot supervisor's recycle never has to wipe on Training's behalf.
12
- */
13
- export declare function ensureNativeTrialArtifacts(launch: VerifiedNativeLaunch, trialId: string): Promise<string>;
14
- export declare function validateChildPaths(launch: VerifiedNativeLaunch): Promise<void>;
15
- /** Docker env-file semantics: literal values, no shell expansion or inherited host provider settings. */
16
- export declare function nativeChildEnvironment(launch: VerifiedNativeLaunch): Promise<NodeJS.ProcessEnv>;
@@ -1,70 +0,0 @@
1
- import { normalizedTrainingEnvironment } from '../../../../../training/index.js';
2
- import { dirname, join } from 'node:path';
3
- import { chmod, lstat, mkdir, realpath } from 'node:fs/promises';
4
- import { nativeTrialArtifactsRoot, readPrivateFile } from '../receipt/index.js';
5
- export function nativeChildArguments(launch, trialId, timeoutMs) {
6
- return ['--experimental-strip-types', launch.bootstrap ? join(launch.bootstrap.root, launch.bootstrap.entrypoint) : join(launch.workerRoot, 'worker/cli.js'),
7
- '--launch', launch.receiptFile, '--config', launch.config, '--config-sha256', launch.configSha256,
8
- '--control-root', launch.controlRoot, '--token-file', launch.tokenFile,
9
- '--evidence', join(nativeTrialArtifactsRoot(launch, trialId), 'evidence.json'),
10
- '--trial-id', trialId, '--timeout-ms', String(timeoutMs), '--schedule-override', 'disabled'];
11
- }
12
- /**
13
- * Creates this trial's private artifact directory before the worker starts.
14
- *
15
- * A Codex control root is already per-trial, so it is returned untouched. A Grok
16
- * slot control root is fixed by the container and shared across trials: the
17
- * non-recursive `mkdir` below is what separates them, and it fails with EEXIST
18
- * rather than colliding with, or silently overwriting, the previous trial's
19
- * exclusive artifacts. Nothing outside this directory is Training's to clear, so
20
- * the slot supervisor's recycle never has to wipe on Training's behalf.
21
- */
22
- export async function ensureNativeTrialArtifacts(launch, trialId) {
23
- const root = nativeTrialArtifactsRoot(launch, trialId);
24
- if (root === launch.controlRoot)
25
- return root;
26
- const shared = dirname(root);
27
- await mkdir(shared, { recursive: true, mode: 0o700 });
28
- await chmod(shared, 0o700);
29
- await mkdir(root, { mode: 0o700 });
30
- await chmod(root, 0o700);
31
- return root;
32
- }
33
- export async function validateChildPaths(launch) {
34
- for (const projection of [launch.workspace, ...launch.projections]) {
35
- if (projection.source !== projection.target)
36
- throw new Error('Child execution requires actual source and target paths to match');
37
- }
38
- for (const credential of launch.credentials) {
39
- const target = await lstat(credential.target);
40
- if (!target.isFile() || target.isSymbolicLink() || target.nlink !== 1 || target.uid !== process.getuid?.() || (target.mode & 0o777) !== 0o600 || await realpath(credential.target) !== credential.target) {
41
- throw new Error('Caller-owned native credential ingress was not safely staged');
42
- }
43
- const directory = await lstat(dirname(credential.target));
44
- if (!directory.isDirectory() || directory.isSymbolicLink() || (directory.mode & 0o022) !== 0
45
- || directory.uid !== 0 && directory.uid !== process.getuid?.())
46
- throw new Error('Caller-owned native credential directory is unsafe');
47
- }
48
- }
49
- /** Docker env-file semantics: literal values, no shell expansion or inherited host provider settings. */
50
- export async function nativeChildEnvironment(launch) {
51
- const home = launch.projections.find(row => row.role === 'home');
52
- if (!home || home.source !== home.target)
53
- throw new Error('Native child HOME requires the verified materialized home projection');
54
- const env = { HOME: home.target };
55
- for (const key of ['PATH', 'LANG', 'LC_ALL', 'TZ'])
56
- if (process.env[key] !== undefined)
57
- env[key] = process.env[key];
58
- const keys = new Set(['HOME']);
59
- for (const line of (await readPrivateFile(launch.envFile, 65536)).split(/\r?\n/u)) {
60
- if (!line.trim() || line.trimStart().startsWith('#'))
61
- continue;
62
- const match = /^([A-Za-z_][A-Za-z0-9_]*)=(.*)$/u.exec(line);
63
- if (!match || keys.has(match[1]))
64
- throw new Error('Invalid explicit native child environment');
65
- keys.add(match[1]);
66
- env[match[1]] = match[2];
67
- }
68
- return normalizedTrainingEnvironment(env);
69
- }
70
- //# sourceMappingURL=arguments.js.map
@@ -1 +0,0 @@
1
- {"version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C,UAAU,CAAC,GAAG,CAAC;YAAE,SAAS;QAC/D,MAAM,KAAK,GAAG,kCAAkC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5D,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;QAChG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,CAAC;QAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,GAAG,KAAK,CAAC,CAAC,CAAE,CAAC;IAClD,CAAC;IACD,OAAO,6BAA6B,CAAC,GAAG,CAAC,CAAC;AAC5C,CAAC"}
@@ -1,24 +0,0 @@
1
- import { type TrialReport } from '../../../../../training/index.js';
2
- import type { SubjectTurnResult } from '../../../../../training/index.js';
3
- /** One required artifact the filing would produce, so the verdict is exactly the subject's. */
4
- export declare const filing: () => import("../../../../../training/index.js").ResolvedRecord;
5
- /**
6
- * No sidecar artifact is registered for these trials, so a read is a defect rather
7
- * than a missing file: the verdict has to be exactly the subject's own evidence.
8
- */
9
- export declare const unregisteredSidecar: () => Promise<never>;
10
- /**
11
- * The real child, the real loopback protocol and the real closure query: the only
12
- * thing borrowed is the trial's own stimulus, because the worker owns the fresh
13
- * workspace the launch receipt pins. Every continuation the budget admits defers,
14
- * so the last one exhausts it — and by then the worker has stopped its own host.
15
- *
16
- * The caller owns the returned root: these trials write a real workspace and a real
17
- * control root, and nothing here removes them.
18
- */
19
- export declare function nativeDeferredTrial(mode: string, maxDeliveries?: number, supplied?: () => Promise<null>): Promise<{
20
- report: TrialReport;
21
- turn: SubjectTurnResult;
22
- deliveries: number;
23
- root: string;
24
- }>;
@@ -1,63 +0,0 @@
1
- import { createHash } from 'node:crypto';
2
- import { childFixture } from './fixture.js';
3
- import { parseDatasetYaml, resolveDataset } from '../../../../../training/index.js';
4
- import { createEvaluationRegistry } from '../../../../../training/index.js';
5
- import { runTrial } from '../../../../../training/index.js';
6
- import { createDaimonNativeAdapter } from '../index.js';
7
- /** One required artifact the filing would produce, so the verdict is exactly the subject's. */
8
- export const filing = () => resolveDataset(parseDatasetYaml(`schema: spawnfile.training.dataset.v1
9
- id: newsroom
10
- stages:
11
- - id: accepted-article
12
- checks:
13
- - {id: filed, eval: tool-called, tool: mcp_newsroom_file_article}
14
- - {id: body, eval: contains-any, input: 'artifact:accepted-article#/body', values: [Filed]}
15
- score:
16
- linear: {filed: 0.5, body: 0.5}
17
- gate: {all: [{passed: filed}, {passed: body}]}
18
- records:
19
- - id: record
20
- group: unique
21
- input: {prompt: file the assigned story}
22
- outputs: {accepted-article: article.json}
23
- `)).records[0];
24
- /**
25
- * No sidecar artifact is registered for these trials, so a read is a defect rather
26
- * than a missing file: the verdict has to be exactly the subject's own evidence.
27
- */
28
- export const unregisteredSidecar = async () => { throw new Error('unregistered sidecar'); };
29
- /**
30
- * The real child, the real loopback protocol and the real closure query: the only
31
- * thing borrowed is the trial's own stimulus, because the worker owns the fresh
32
- * workspace the launch receipt pins. Every continuation the budget admits defers,
33
- * so the last one exhausts it — and by then the worker has stopped its own host.
34
- *
35
- * The caller owns the returned root: these trials write a real workspace and a real
36
- * control root, and nothing here removes them.
37
- */
38
- export async function nativeDeferredTrial(mode, maxDeliveries = 1, supplied) {
39
- const fixture = await childFixture(mode);
40
- const text = 'Sourced research reply';
41
- let asked = 0;
42
- const sourced = async () => {
43
- const id = `answer-${asked++}`;
44
- return { id, text, source: { kind: 'transport', id, sha256: `sha256:${createHash('sha256').update(text).digest('hex')}` } };
45
- };
46
- const next = supplied ? async () => { asked++; return supplied(); } : sourced;
47
- const native = createDaimonNativeAdapter({ timeoutMs: 20_000, execution: { kind: 'child-process', externalInputs: { maxDeliveries, next } } });
48
- const session = await native.start(fixture.input);
49
- let turn;
50
- const adapter = { id: 'daimon-native-child', capabilities: native.capabilities,
51
- async start() {
52
- return { run: async (value, signal) => { turn = await session.run({ id: value.id, text: value.text }, signal); return turn; },
53
- stop: reason => session.stop(reason) };
54
- } };
55
- const options = { id: fixture.input.trialId, phase: 'train', record: filing(), candidateId: 'candidate',
56
- datasetDigest: 'dataset', planDigest: 'plan', adapter, model: fixture.input.model, root: fixture.root, timeoutMs: 20_000,
57
- prepare: async () => ({ instructions: fixture.input.instructions }), registry: createEvaluationRegistry(),
58
- evaluation: { judges: {}, embeddings: {}, readText: unregisteredSidecar },
59
- persist: async () => undefined };
60
- const report = await runTrial(options);
61
- return { report, turn: turn, deliveries: asked, root: fixture.root };
62
- }
63
- //# sourceMappingURL=deferred-trial.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deferred-trial.js","sourceRoot":"","sources":["../../../../../../src/runtime/daimon/training/native/child/deferred-trial.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACpF,OAAO,EAAE,wBAAwB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAuC,MAAM,kCAAkC,CAAC;AACjG,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAGxD,+FAA+F;AAC/F,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,cAAc,CAAC,gBAAgB,CAAC;;;;;;;;;;;;;;;CAe3D,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAE,CAAC;AAEhB;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,IAAoB,EAAE,GAAG,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC;AAE5G;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,IAAY,EAAE,aAAa,GAAG,CAAC,EACvE,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,IAAI,EAAE,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,CAAC;gBAC3H,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3C,CAAC,EAAE,CAAC;IACN,MAAM,OAAO,GAAiB,EAAE,EAAE,EAAE,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,WAAW,EAAE,WAAW;QACnH,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,CAAC,KAAM,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM;QACzH,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,EAAE,QAAQ,EAAE,wBAAwB,EAAE;QACzG,UAAU,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE,QAAQ,EAAE,mBAAmB,EAAE;QACzE,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC,SAAS,EAAE,CAAC;IACnC,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,CAAC;IACvC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAK,EAAE,UAAU,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;AACxE,CAAC"}
@@ -1,58 +0,0 @@
1
- import type { SubjectStartupCapture, SubjectStartupDiagnostic } from '../../../../../training/index.js';
2
- export declare const redactedMarker = "[redacted]";
3
- export declare const redactedPathMarker = "[redacted-path]";
4
- export declare const withholdDetectors: readonly ["declared-secret", "bearer", "pem", "opaque-run"];
5
- export type WithholdDetector = typeof withholdDetectors[number];
6
- /**
7
- * Removes every value this adapter knows to be secret, then refuses to call the
8
- * result clean if anything credential-shaped is left.
9
- *
10
- * Substitution covers the control token, the declared environment values and the
11
- * credential file paths. The assignment scrub covers a secret nobody declared: a
12
- * line that echoes `SOMETHING=value` publishes the name and drops the value. What
13
- * substitution cannot reach is an undeclared credential printed on its own — a
14
- * bearer header, a PEM block, a long opaque token — so its presence makes the
15
- * text unpublishable rather than published in the hope that it is harmless.
16
- */
17
- export declare function redactNativeDiagnostic(text: string, secrets: readonly string[]): {
18
- text: string;
19
- clean: boolean;
20
- detectors: readonly WithholdDetector[];
21
- };
22
- /**
23
- * Carries the publishable record, and the unredacted capture, out of startup.
24
- *
25
- * The caller persists the record durably and writes the capture to the
26
- * operator's own run output as an operator-only file. The capture never reaches
27
- * the event stream, a report or a viewer projection.
28
- */
29
- export declare class NativeStartupFailure extends Error {
30
- readonly diagnostic: SubjectStartupDiagnostic;
31
- readonly capture: SubjectStartupCapture;
32
- constructor(message: string, diagnostic: SubjectStartupDiagnostic, capture: SubjectStartupCapture);
33
- }
34
- /** Protected process output, never a public observation or a model/judge input. */
35
- export declare function childDiagnostics(root: string, trialId: string, configSha256: string, secrets?: readonly string[]): Promise<{
36
- file: string;
37
- append(chunk: Buffer, stdout: boolean): void;
38
- save(exitCode: number | null, exitSignal: NodeJS.Signals | null): Promise<void>;
39
- /**
40
- * The durable half of the protected file above.
41
- *
42
- * The full capture stays in the control root, which on a training slot is
43
- * tmpfs that dies with the container; this redacted record is what an
44
- * operator can still read afterwards, and it always names the failure class
45
- * even when the bytes themselves have to be withheld.
46
- */
47
- /**
48
- * The publishable record on its own, for a worker that died *after*
49
- * readiness. Startup already published one; a mid-turn death published
50
- * nothing at all, so the one account of why the worker stopped answering
51
- * lived only in the protected file on the slot's tmpfs and died with the
52
- * container. Same redaction, same withholding rules, no capture: this
53
- * travels in the durable event stream, which outlives the container, and an
54
- * unredacted capture has no business there.
55
- */
56
- record(caught: unknown): SubjectStartupDiagnostic;
57
- startupFailure(caught: unknown): NativeStartupFailure;
58
- }>;