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.
- package/README.md +1 -1
- package/dist/audit/readAudit.d.ts +3 -3
- package/dist/auth/profileStore.d.ts +3 -1
- package/dist/auth/profileStore.js +31 -30
- package/dist/auth/trainingAuth.d.ts +2 -5
- package/dist/auth/types.d.ts +16 -0
- package/dist/cli/authCommands.d.ts +1 -1
- package/dist/cli/authCommands.js +21 -1
- package/dist/cli/devCommands.d.ts +1 -1
- package/dist/cli/devCommands.js +0 -66
- package/dist/cli/runCli.d.ts +3 -4
- package/dist/cli/runCli.js +4 -3
- package/dist/cli/trainCommand.js +9 -15
- package/dist/cli/trainingBooted.d.ts +9 -0
- package/dist/cli/trainingBooted.js +45 -0
- package/dist/cli/trainingExecution.d.ts +4 -7
- package/dist/cli/trainingExecution.js +4 -32
- package/dist/compiler/containerArtifacts.js +0 -5
- package/dist/compiler/containerBackedMountRender.js +5 -1
- package/dist/compiler/containerDaimonBrokerRender.d.ts +5 -50
- package/dist/compiler/containerDaimonBrokerRender.js +19 -90
- package/dist/compiler/containerDaimonGatewayRender.d.ts +50 -0
- package/dist/compiler/containerDaimonGatewayRender.js +161 -0
- package/dist/compiler/containerDaimonGrokWorkerProvisioning.d.ts +2 -10
- package/dist/compiler/containerDaimonGrokWorkerProvisioning.js +13 -25
- package/dist/compiler/containerDaimonGrokWorkerRender.d.ts +11 -49
- package/dist/compiler/containerDaimonGrokWorkerRender.js +15 -39
- package/dist/compiler/containerDaimonStartupSupervision.d.ts +8 -0
- package/dist/compiler/containerDaimonStartupSupervision.js +39 -0
- package/dist/compiler/containerDaimonUidEntrypointRender.d.ts +1 -2
- package/dist/compiler/containerDaimonUidEntrypointRender.js +29 -47
- package/dist/compiler/containerRuntimeReadinessRender.js +1 -1
- package/dist/compiler/memoryArtifacts.js +0 -1
- package/dist/compiler/moltnetArtifacts.js +1 -17
- package/dist/compiler/moltnetClientConfig.js +1 -1
- package/dist/compiler/moltnetRuntimeConfig.js +0 -10
- package/dist/compiler/runProject.d.ts +3 -0
- package/dist/compiler/runProject.js +12 -5
- package/dist/compiler/runProjectAuth.js +6 -18
- package/dist/compiler/training/contract.d.ts +0 -2
- package/dist/compiler/training/contract.js +0 -2
- package/dist/compiler/training/execution.d.ts +1 -128
- package/dist/compiler/training/execution.js +7 -68
- package/dist/compiler/training/index.d.ts +0 -8
- package/dist/compiler/training/index.js +0 -7
- package/dist/compiler/training/output.d.ts +1 -0
- package/dist/compiler/training/output.js +1 -1
- package/dist/compiler/training/rewind/contract.d.ts +6 -6
- package/dist/compiler/training/trial/boot.d.ts +72 -0
- package/dist/compiler/training/trial/boot.js +225 -0
- package/dist/compiler/training/trial/docker.d.ts +10 -0
- package/dist/compiler/training/trial/docker.js +22 -0
- package/dist/compiler/training/trial/gateway.d.ts +47 -0
- package/dist/compiler/training/trial/gateway.js +113 -0
- package/dist/compiler/training/trial/homeLogin.d.ts +31 -0
- package/dist/compiler/training/trial/homeLogin.js +69 -0
- package/dist/compiler/training/trial/index.d.ts +8 -0
- package/dist/compiler/training/trial/index.js +8 -0
- package/dist/compiler/training/trial/judge.d.ts +15 -0
- package/dist/compiler/training/trial/judge.js +42 -0
- package/dist/compiler/training/trial/launcher.d.ts +47 -0
- package/dist/compiler/training/trial/launcher.js +193 -0
- package/dist/compiler/training/trial/login.d.ts +35 -0
- package/dist/compiler/training/trial/login.js +85 -0
- package/dist/compiler/training/trial/project.d.ts +11 -0
- package/dist/compiler/training/trial/project.js +31 -0
- package/dist/compiler/training/trial/realmTurns.d.ts +20 -0
- package/dist/compiler/training/trial/realmTurns.js +69 -0
- package/dist/compiler/upReceipt.d.ts +2 -17
- package/dist/compiler/upReceipt.js +2 -17
- package/dist/deployment/artifactsExportPlan.js +2 -18
- package/dist/deployment/privateArtifactsExport.js +1 -1
- package/dist/dev/docker.d.ts +0 -5
- package/dist/dev/docker.js +0 -46
- package/dist/dev/index.d.ts +0 -1
- package/dist/dev/index.js +0 -1
- package/dist/dev/project.d.ts +0 -16
- package/dist/dev/project.js +1 -128
- package/dist/distribution/distributionReportSchema.js +1 -1
- package/dist/distribution/imageRuntimeAuth.js +3 -2
- package/dist/manifest/renderSpawnfile.js +2 -1
- package/dist/release/drainControl.d.ts +5 -19
- package/dist/release/drainControl.js +12 -67
- package/dist/report/types.d.ts +3 -6
- package/dist/runtime/common.d.ts +1 -1
- package/dist/runtime/common.js +1 -1
- package/dist/runtime/container.d.ts +2 -2
- package/dist/runtime/container.js +1 -39
- package/dist/runtime/daimon/config.js +8 -14
- package/dist/runtime/daimon/contractManifest.js +0 -1
- package/dist/runtime/daimon/contractManifestSchema.js +0 -1
- package/dist/runtime/daimon/control.d.ts +31 -0
- package/dist/runtime/daimon/control.js +83 -0
- package/dist/runtime/daimon/engineDescriptorSchema.js +0 -1
- package/dist/runtime/daimon/engineDescriptors.generated.d.ts +1 -1
- package/dist/runtime/daimon/engineDescriptors.generated.js +1 -2
- package/dist/runtime/daimon/engines.js +0 -1
- package/dist/runtime/daimon/gateway.d.ts +62 -0
- package/dist/runtime/daimon/gateway.js +77 -0
- package/dist/runtime/daimon/grokWorkerContract.d.ts +0 -5
- package/dist/runtime/daimon/grokWorkerContract.js +1 -13
- package/dist/runtime/daimon/index.d.ts +2 -0
- package/dist/runtime/daimon/index.js +2 -1
- package/dist/runtime/daimon/memory.js +1 -1
- package/dist/runtime/daimon/packageName.js +0 -1
- package/dist/runtime/daimon/runAuth.js +15 -4
- package/dist/runtime/daimon/runtimeIdentity.d.ts +2 -0
- package/dist/runtime/daimon/runtimeIdentity.js +2 -0
- package/dist/runtime/daimon/subscriptionRealms.d.ts +27 -3
- package/dist/runtime/daimon/subscriptionRealms.js +35 -13
- package/dist/runtime/daimon/testHelpers.d.ts +2 -0
- package/dist/runtime/{pi → daimon}/testHelpers.js +3 -3
- package/dist/runtime/daimon/training/booted/adapter.d.ts +50 -0
- package/dist/runtime/daimon/training/booted/adapter.js +60 -0
- package/dist/runtime/daimon/training/booted/adapter.js.map +1 -0
- package/dist/runtime/daimon/training/booted/index.d.ts +4 -0
- package/dist/runtime/daimon/training/booted/index.js +3 -0
- package/dist/runtime/daimon/training/booted/index.js.map +1 -0
- package/dist/runtime/daimon/training/booted/judge.d.ts +39 -0
- package/dist/runtime/daimon/training/booted/judge.js +122 -0
- package/dist/runtime/daimon/training/booted/judge.js.map +1 -0
- package/dist/runtime/daimon/training/index.d.ts +5 -0
- package/dist/runtime/daimon/training/index.js +8 -4
- package/dist/runtime/daimon/training/index.js.map +1 -1
- package/dist/runtime/daimon/wakeMoments.js +0 -1
- package/dist/runtime/install.js +0 -21
- package/dist/runtime/registry.js +0 -2
- package/dist/runtime/trainingGraderProviders.js +10 -4
- package/dist/runtime/trainingProviders.d.ts +5 -3
- package/dist/runtime/trainingProviders.js +21 -24
- package/dist/runtime/trainingSubjects.d.ts +0 -121
- package/dist/runtime/trainingSubjects.js +2 -13
- package/dist/runtime/types.d.ts +1 -8
- package/dist/runtime/usageRequestLedger.d.ts +2 -0
- package/dist/runtime/usageRequestLedger.js +3 -1
- package/dist/shared/errors.js +0 -1
- package/dist/shared/trainingLegacy/trainingLegacyHashDomains.d.ts +1 -0
- package/dist/shared/trainingLegacy/trainingLegacyHashDomains.js +1 -0
- package/dist/shared/trainingLegacy/trainingLegacyHashDomains.js.map +1 -1
- package/dist/status/lifecycleProbes.js +3 -6
- package/dist/status/moltnetWiringProbes.js +1 -17
- package/dist/training/subjects/index.d.ts +0 -1
- package/dist/training/subjects/index.js +0 -1
- package/dist/training/subjects/index.js.map +1 -1
- package/examples/README.md +0 -1
- package/examples/daimon-org/agents/mapper/Spawnfile +4 -1
- package/examples/daimon-org/teams/review/agents/reviewer/Spawnfile +4 -1
- package/examples/jungian-daimon-org/teams/luna/agents/animus/Spawnfile +5 -8
- package/examples/jungian-daimon-org/teams/luna/agents/representative/Spawnfile +1 -1
- package/examples/jungian-daimon-org/teams/luna/agents/shadow/Spawnfile +5 -8
- package/examples/jungian-daimon-org/teams/selene/agents/animus/Spawnfile +5 -8
- package/examples/jungian-daimon-org/teams/selene/agents/representative/Spawnfile +5 -8
- package/examples/jungian-daimon-org/teams/selene/agents/shadow/Spawnfile +1 -1
- package/examples/mixed-runtime-org/agents/localist/Spawnfile +7 -7
- package/package.json +4 -13
- package/runtimes.yaml +5 -15
- package/dist/compiler/containerDaimonGrokTaskClock.d.ts +0 -5
- package/dist/compiler/containerDaimonGrokTaskClock.js +0 -29
- package/dist/compiler/daimonTelemetryArtifacts.d.ts +0 -22
- package/dist/compiler/daimonTelemetryArtifacts.js +0 -56
- package/dist/compiler/training/broker/clockProbe.d.ts +0 -6
- package/dist/compiler/training/broker/clockProbe.js +0 -27
- package/dist/compiler/training/broker/declaration.d.ts +0 -54
- package/dist/compiler/training/broker/declaration.js +0 -70
- package/dist/compiler/training/broker/entrypoint.d.ts +0 -39
- package/dist/compiler/training/broker/entrypoint.js +0 -124
- package/dist/compiler/training/broker/evaluatorSecrets.d.ts +0 -2
- package/dist/compiler/training/broker/evaluatorSecrets.js +0 -62
- package/dist/compiler/training/broker/index.d.ts +0 -12
- package/dist/compiler/training/broker/index.js +0 -12
- package/dist/compiler/training/broker/main.d.ts +0 -2
- package/dist/compiler/training/broker/main.js +0 -14
- package/dist/compiler/training/broker/paths.d.ts +0 -236
- package/dist/compiler/training/broker/paths.js +0 -249
- package/dist/compiler/training/broker/processes.d.ts +0 -51
- package/dist/compiler/training/broker/processes.js +0 -102
- package/dist/compiler/training/broker/projection.d.ts +0 -61
- package/dist/compiler/training/broker/projection.js +0 -109
- package/dist/compiler/training/broker/provisioning.d.ts +0 -78
- package/dist/compiler/training/broker/provisioning.js +0 -231
- package/dist/compiler/training/broker/receipt.d.ts +0 -77
- package/dist/compiler/training/broker/receipt.js +0 -110
- package/dist/compiler/training/broker/recycleClient.d.ts +0 -33
- package/dist/compiler/training/broker/recycleClient.js +0 -112
- package/dist/compiler/training/broker/registration.d.ts +0 -46
- package/dist/compiler/training/broker/registration.js +0 -113
- package/dist/compiler/training/broker/reset.d.ts +0 -9
- package/dist/compiler/training/broker/reset.js +0 -71
- package/dist/compiler/training/broker/rootScript.d.ts +0 -32
- package/dist/compiler/training/broker/rootScript.js +0 -33
- package/dist/compiler/training/broker/runtime.d.ts +0 -22
- package/dist/compiler/training/broker/runtime.js +0 -128
- package/dist/compiler/training/broker/seccompRoutes.d.ts +0 -31
- package/dist/compiler/training/broker/seccompRoutes.js +0 -36
- package/dist/compiler/training/broker/supervisor.d.ts +0 -108
- package/dist/compiler/training/broker/supervisor.js +0 -172
- package/dist/compiler/training/broker/taskClock.d.ts +0 -5
- package/dist/compiler/training/broker/taskClock.js +0 -41
- package/dist/compiler/training/container/contract.d.ts +0 -54
- package/dist/compiler/training/container/contract.js +0 -52
- package/dist/compiler/training/container/evaluators.d.ts +0 -48
- package/dist/compiler/training/container/evaluators.js +0 -50
- package/dist/compiler/training/container/grokWriteback.d.ts +0 -8
- package/dist/compiler/training/container/grokWriteback.js +0 -26
- package/dist/compiler/training/container/index.d.ts +0 -5
- package/dist/compiler/training/container/index.js +0 -3
- package/dist/compiler/training/container/launch.d.ts +0 -21
- package/dist/compiler/training/container/launch.js +0 -280
- package/dist/compiler/training/container/nativeSlots.d.ts +0 -14
- package/dist/compiler/training/container/nativeSlots.js +0 -13
- package/dist/compiler/training/container/outputCopy.d.ts +0 -2
- package/dist/compiler/training/container/outputCopy.js +0 -72
- package/dist/compiler/training/container/outputVolume.d.ts +0 -28
- package/dist/compiler/training/container/outputVolume.js +0 -185
- package/dist/compiler/training/container/prepare.d.ts +0 -10
- package/dist/compiler/training/container/prepare.js +0 -125
- package/dist/compiler/training/container/process.d.ts +0 -14
- package/dist/compiler/training/container/process.js +0 -70
- package/dist/compiler/training/container/security.d.ts +0 -38
- package/dist/compiler/training/container/security.js +0 -68
- package/dist/compiler/training/container/subjectIsolation.d.ts +0 -5
- package/dist/compiler/training/container/subjectIsolation.js +0 -16
- package/dist/compiler/training/preparation/assets/Dockerfile +0 -100
- package/dist/compiler/training/preparation/assets/package-lock.json +0 -5483
- package/dist/compiler/training/preparation/broker.d.ts +0 -30
- package/dist/compiler/training/preparation/broker.js +0 -68
- package/dist/compiler/training/preparation/contextModes.d.ts +0 -12
- package/dist/compiler/training/preparation/contextModes.js +0 -38
- package/dist/compiler/training/preparation/contract.d.ts +0 -203
- package/dist/compiler/training/preparation/contract.js +0 -114
- package/dist/compiler/training/preparation/copyAssets.d.ts +0 -1
- package/dist/compiler/training/preparation/copyAssets.js +0 -8
- package/dist/compiler/training/preparation/daimonParent.d.ts +0 -42
- package/dist/compiler/training/preparation/daimonParent.js +0 -114
- package/dist/compiler/training/preparation/files.d.ts +0 -29
- package/dist/compiler/training/preparation/files.js +0 -146
- package/dist/compiler/training/preparation/image.d.ts +0 -28
- package/dist/compiler/training/preparation/image.js +0 -105
- package/dist/compiler/training/preparation/index.d.ts +0 -3
- package/dist/compiler/training/preparation/index.js +0 -2
- package/dist/compiler/training/preparation/inputs.d.ts +0 -24
- package/dist/compiler/training/preparation/inputs.js +0 -101
- package/dist/compiler/training/preparation/prepare.d.ts +0 -38
- package/dist/compiler/training/preparation/prepare.js +0 -224
- package/dist/compiler/training/preparation/scratch.d.ts +0 -8
- package/dist/compiler/training/preparation/scratch.js +0 -114
- package/dist/compiler/training/repair/compatibility.d.ts +0 -11
- package/dist/compiler/training/repair/compatibility.js +0 -45
- package/dist/compiler/training/repair/contract.d.ts +0 -832
- package/dist/compiler/training/repair/contract.js +0 -34
- package/dist/compiler/training/repair/index.d.ts +0 -3
- package/dist/compiler/training/repair/index.js +0 -3
- package/dist/compiler/training/repair/prepare.d.ts +0 -378
- package/dist/compiler/training/repair/prepare.js +0 -84
- package/dist/compiler/training/repair/witness.d.ts +0 -348
- package/dist/compiler/training/repair/witness.js +0 -62
- package/dist/compiler/training/subjectDeclaration.d.ts +0 -26
- package/dist/compiler/training/subjectDeclaration.js +0 -54
- package/dist/compiler/training/subjectLease.d.ts +0 -115
- package/dist/compiler/training/subjectLease.js +0 -179
- package/dist/dev/activity.d.ts +0 -14
- package/dist/dev/activity.js +0 -48
- package/dist/runtime/codex-exec/training/adapter.d.ts +0 -13
- package/dist/runtime/codex-exec/training/adapter.js +0 -101
- package/dist/runtime/codex-exec/training/adapter.js.map +0 -1
- package/dist/runtime/codex-exec/training/environment.d.ts +0 -3
- package/dist/runtime/codex-exec/training/environment.js +0 -26
- package/dist/runtime/codex-exec/training/environment.js.map +0 -1
- package/dist/runtime/codex-exec/training/index.d.ts +0 -2
- package/dist/runtime/codex-exec/training/index.js +0 -3
- package/dist/runtime/codex-exec/training/index.js.map +0 -1
- package/dist/runtime/codex-exec/training/protocol.d.ts +0 -15
- package/dist/runtime/codex-exec/training/protocol.js +0 -102
- package/dist/runtime/codex-exec/training/protocol.js.map +0 -1
- package/dist/runtime/codex-exec/training/providers/codex-subscription/index.d.ts +0 -1
- package/dist/runtime/codex-exec/training/providers/codex-subscription/index.js +0 -2
- package/dist/runtime/codex-exec/training/providers/codex-subscription/index.js.map +0 -1
- package/dist/runtime/codex-exec/training/providers/codex-subscription/protocol.d.ts +0 -17
- package/dist/runtime/codex-exec/training/providers/codex-subscription/protocol.js +0 -80
- package/dist/runtime/codex-exec/training/providers/codex-subscription/protocol.js.map +0 -1
- package/dist/runtime/codex-exec/training/providers/codex-subscription/provider.d.ts +0 -12
- package/dist/runtime/codex-exec/training/providers/codex-subscription/provider.js +0 -125
- package/dist/runtime/codex-exec/training/providers/codex-subscription/provider.js.map +0 -1
- package/dist/runtime/codex-exec/training/providers/codex-subscription/strict-schema.d.ts +0 -6
- package/dist/runtime/codex-exec/training/providers/codex-subscription/strict-schema.js +0 -219
- package/dist/runtime/codex-exec/training/providers/codex-subscription/strict-schema.js.map +0 -1
- package/dist/runtime/daimon/contractManifest.js.map +0 -1
- package/dist/runtime/daimon/contractManifestSchema.js.map +0 -1
- package/dist/runtime/daimon/engineDescriptorSchema.js.map +0 -1
- package/dist/runtime/daimon/engineDescriptors.generated.js.map +0 -1
- package/dist/runtime/daimon/engines.js.map +0 -1
- package/dist/runtime/daimon/index.js.map +0 -1
- package/dist/runtime/daimon/packageName.js.map +0 -1
- package/dist/runtime/daimon/training/legacy/adapter.d.ts +0 -11
- package/dist/runtime/daimon/training/legacy/adapter.js +0 -175
- package/dist/runtime/daimon/training/legacy/adapter.js.map +0 -1
- package/dist/runtime/daimon/training/legacy/index.d.ts +0 -2
- package/dist/runtime/daimon/training/legacy/index.js +0 -3
- package/dist/runtime/daimon/training/legacy/index.js.map +0 -1
- package/dist/runtime/daimon/training/legacy/public.d.ts +0 -49
- package/dist/runtime/daimon/training/legacy/public.js +0 -16
- package/dist/runtime/daimon/training/legacy/public.js.map +0 -1
- package/dist/runtime/daimon/training/native/adapter.d.ts +0 -18
- package/dist/runtime/daimon/training/native/adapter.js +0 -252
- package/dist/runtime/daimon/training/native/adapter.js.map +0 -1
- package/dist/runtime/daimon/training/native/admission.d.ts +0 -7
- package/dist/runtime/daimon/training/native/admission.js +0 -52
- package/dist/runtime/daimon/training/native/admission.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/arguments.d.ts +0 -16
- package/dist/runtime/daimon/training/native/child/arguments.js +0 -70
- package/dist/runtime/daimon/training/native/child/arguments.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/deferred-trial.d.ts +0 -24
- package/dist/runtime/daimon/training/native/child/deferred-trial.js +0 -63
- package/dist/runtime/daimon/training/native/child/deferred-trial.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/diagnostics.d.ts +0 -58
- package/dist/runtime/daimon/training/native/child/diagnostics.js +0 -215
- package/dist/runtime/daimon/training/native/child/diagnostics.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/fixture.d.ts +0 -16
- package/dist/runtime/daimon/training/native/child/fixture.js +0 -159
- package/dist/runtime/daimon/training/native/child/fixture.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/grok.d.ts +0 -14
- package/dist/runtime/daimon/training/native/child/grok.js +0 -47
- package/dist/runtime/daimon/training/native/child/grok.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/index.d.ts +0 -7
- package/dist/runtime/daimon/training/native/child/index.js +0 -5
- package/dist/runtime/daimon/training/native/child/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/lifecycle.d.ts +0 -40
- package/dist/runtime/daimon/training/native/child/lifecycle.js +0 -400
- package/dist/runtime/daimon/training/native/child/lifecycle.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/probe.d.ts +0 -2
- package/dist/runtime/daimon/training/native/child/probe.js +0 -11
- package/dist/runtime/daimon/training/native/child/probe.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/sandbox.d.ts +0 -4
- package/dist/runtime/daimon/training/native/child/sandbox.js +0 -76
- package/dist/runtime/daimon/training/native/child/sandbox.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/types.d.ts +0 -15
- package/dist/runtime/daimon/training/native/child/types.js +0 -2
- package/dist/runtime/daimon/training/native/child/types.js.map +0 -1
- package/dist/runtime/daimon/training/native/container/docker.d.ts +0 -29
- package/dist/runtime/daimon/training/native/container/docker.js +0 -105
- package/dist/runtime/daimon/training/native/container/docker.js.map +0 -1
- package/dist/runtime/daimon/training/native/container/grok-slot.d.ts +0 -22
- package/dist/runtime/daimon/training/native/container/grok-slot.js +0 -38
- package/dist/runtime/daimon/training/native/container/grok-slot.js.map +0 -1
- package/dist/runtime/daimon/training/native/container/index.d.ts +0 -6
- package/dist/runtime/daimon/training/native/container/index.js +0 -6
- package/dist/runtime/daimon/training/native/container/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/container/lifecycle.d.ts +0 -8
- package/dist/runtime/daimon/training/native/container/lifecycle.js +0 -111
- package/dist/runtime/daimon/training/native/container/lifecycle.js.map +0 -1
- package/dist/runtime/daimon/training/native/container/manifest.d.ts +0 -17
- package/dist/runtime/daimon/training/native/container/manifest.js +0 -164
- package/dist/runtime/daimon/training/native/container/manifest.js.map +0 -1
- package/dist/runtime/daimon/training/native/container/native-preflight.d.ts +0 -8
- package/dist/runtime/daimon/training/native/container/native-preflight.js +0 -40
- package/dist/runtime/daimon/training/native/container/native-preflight.js.map +0 -1
- package/dist/runtime/daimon/training/native/container/preflight.d.ts +0 -15
- package/dist/runtime/daimon/training/native/container/preflight.js +0 -79
- package/dist/runtime/daimon/training/native/container/preflight.js.map +0 -1
- package/dist/runtime/daimon/training/native/container/slot.d.ts +0 -4
- package/dist/runtime/daimon/training/native/container/slot.js +0 -58
- package/dist/runtime/daimon/training/native/container/slot.js.map +0 -1
- package/dist/runtime/daimon/training/native/external.d.ts +0 -37
- package/dist/runtime/daimon/training/native/external.js +0 -75
- package/dist/runtime/daimon/training/native/external.js.map +0 -1
- package/dist/runtime/daimon/training/native/grants/authority.d.ts +0 -36
- package/dist/runtime/daimon/training/native/grants/authority.js +0 -49
- package/dist/runtime/daimon/training/native/grants/authority.js.map +0 -1
- package/dist/runtime/daimon/training/native/grants/index.d.ts +0 -2
- package/dist/runtime/daimon/training/native/grants/index.js +0 -3
- package/dist/runtime/daimon/training/native/grants/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/grants/pins.d.ts +0 -30
- package/dist/runtime/daimon/training/native/grants/pins.js +0 -20
- package/dist/runtime/daimon/training/native/grants/pins.js.map +0 -1
- package/dist/runtime/daimon/training/native/grants/test-socket.d.ts +0 -6
- package/dist/runtime/daimon/training/native/grants/test-socket.js +0 -35
- package/dist/runtime/daimon/training/native/grants/test-socket.js.map +0 -1
- package/dist/runtime/daimon/training/native/grok-fixtures.d.ts +0 -34
- package/dist/runtime/daimon/training/native/grok-fixtures.js +0 -179
- package/dist/runtime/daimon/training/native/grok-fixtures.js.map +0 -1
- package/dist/runtime/daimon/training/native/index.d.ts +0 -38
- package/dist/runtime/daimon/training/native/index.js +0 -27
- package/dist/runtime/daimon/training/native/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/live-checkout.d.ts +0 -2
- package/dist/runtime/daimon/training/native/live-checkout.js +0 -15
- package/dist/runtime/daimon/training/native/live-checkout.js.map +0 -1
- package/dist/runtime/daimon/training/native/observations.d.ts +0 -51
- package/dist/runtime/daimon/training/native/observations.js +0 -217
- package/dist/runtime/daimon/training/native/observations.js.map +0 -1
- package/dist/runtime/daimon/training/native/outcome.d.ts +0 -13
- package/dist/runtime/daimon/training/native/outcome.js +0 -37
- package/dist/runtime/daimon/training/native/outcome.js.map +0 -1
- package/dist/runtime/daimon/training/native/preparation/engine-config.d.ts +0 -21
- package/dist/runtime/daimon/training/native/preparation/engine-config.js +0 -30
- package/dist/runtime/daimon/training/native/preparation/engine-config.js.map +0 -1
- package/dist/runtime/daimon/training/native/preparation/fixtures.d.ts +0 -17
- package/dist/runtime/daimon/training/native/preparation/fixtures.js +0 -52
- package/dist/runtime/daimon/training/native/preparation/fixtures.js.map +0 -1
- package/dist/runtime/daimon/training/native/preparation/index.d.ts +0 -7
- package/dist/runtime/daimon/training/native/preparation/index.js +0 -5
- package/dist/runtime/daimon/training/native/preparation/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/preparation/layout.d.ts +0 -66
- package/dist/runtime/daimon/training/native/preparation/layout.js +0 -87
- package/dist/runtime/daimon/training/native/preparation/layout.js.map +0 -1
- package/dist/runtime/daimon/training/native/preparation/subject.d.ts +0 -14
- package/dist/runtime/daimon/training/native/preparation/subject.js +0 -67
- package/dist/runtime/daimon/training/native/preparation/subject.js.map +0 -1
- package/dist/runtime/daimon/training/native/preparation/types.d.ts +0 -69
- package/dist/runtime/daimon/training/native/preparation/types.js +0 -2
- package/dist/runtime/daimon/training/native/preparation/types.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/artifacts.d.ts +0 -25
- package/dist/runtime/daimon/training/native/receipt/artifacts.js +0 -32
- package/dist/runtime/daimon/training/native/receipt/artifacts.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/grok-clocked-pins.d.ts +0 -129
- package/dist/runtime/daimon/training/native/receipt/grok-clocked-pins.js +0 -45
- package/dist/runtime/daimon/training/native/receipt/grok-clocked-pins.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/grok.d.ts +0 -246
- package/dist/runtime/daimon/training/native/receipt/grok.js +0 -195
- package/dist/runtime/daimon/training/native/receipt/grok.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/index.d.ts +0 -11
- package/dist/runtime/daimon/training/native/receipt/index.js +0 -8
- package/dist/runtime/daimon/training/native/receipt/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/paths.d.ts +0 -3
- package/dist/runtime/daimon/training/native/receipt/paths.js +0 -18
- package/dist/runtime/daimon/training/native/receipt/paths.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/sandbox.d.ts +0 -42
- package/dist/runtime/daimon/training/native/receipt/sandbox.js +0 -35
- package/dist/runtime/daimon/training/native/receipt/sandbox.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/schema.d.ts +0 -490
- package/dist/runtime/daimon/training/native/receipt/schema.js +0 -138
- package/dist/runtime/daimon/training/native/receipt/schema.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/subscription.d.ts +0 -13
- package/dist/runtime/daimon/training/native/receipt/subscription.js +0 -13
- package/dist/runtime/daimon/training/native/receipt/subscription.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/task-clock.d.ts +0 -19
- package/dist/runtime/daimon/training/native/receipt/task-clock.js +0 -49
- package/dist/runtime/daimon/training/native/receipt/task-clock.js.map +0 -1
- package/dist/runtime/daimon/training/native/sealed-usage.d.ts +0 -218
- package/dist/runtime/daimon/training/native/sealed-usage.js +0 -261
- package/dist/runtime/daimon/training/native/sealed-usage.js.map +0 -1
- package/dist/runtime/daimon/training/native/test-fixtures.d.ts +0 -27
- package/dist/runtime/daimon/training/native/test-fixtures.js +0 -162
- package/dist/runtime/daimon/training/native/test-fixtures.js.map +0 -1
- package/dist/runtime/daimon/training/native/transcript.d.ts +0 -96
- package/dist/runtime/daimon/training/native/transcript.js +0 -239
- package/dist/runtime/daimon/training/native/transcript.js.map +0 -1
- package/dist/runtime/daimon/training/native/transport/delivery.d.ts +0 -27
- package/dist/runtime/daimon/training/native/transport/delivery.js +0 -98
- package/dist/runtime/daimon/training/native/transport/delivery.js.map +0 -1
- package/dist/runtime/daimon/training/native/transport/http.d.ts +0 -3
- package/dist/runtime/daimon/training/native/transport/http.js +0 -81
- package/dist/runtime/daimon/training/native/transport/http.js.map +0 -1
- package/dist/runtime/daimon/training/native/transport/index.d.ts +0 -4
- package/dist/runtime/daimon/training/native/transport/index.js +0 -3
- package/dist/runtime/daimon/training/native/transport/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/transport/types.d.ts +0 -15
- package/dist/runtime/daimon/training/native/transport/types.js +0 -2
- package/dist/runtime/daimon/training/native/transport/types.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/cli.d.ts +0 -1
- package/dist/runtime/daimon/training/native/worker/cli.js +0 -17
- package/dist/runtime/daimon/training/native/worker/cli.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/control.d.ts +0 -20
- package/dist/runtime/daimon/training/native/worker/control.js +0 -266
- package/dist/runtime/daimon/training/native/worker/control.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/deliveries.d.ts +0 -38
- package/dist/runtime/daimon/training/native/worker/deliveries.js +0 -91
- package/dist/runtime/daimon/training/native/worker/deliveries.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/evidence/collect.d.ts +0 -54
- package/dist/runtime/daimon/training/native/worker/evidence/collect.js +0 -278
- package/dist/runtime/daimon/training/native/worker/evidence/collect.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/evidence/execution.d.ts +0 -102
- package/dist/runtime/daimon/training/native/worker/evidence/execution.js +0 -191
- package/dist/runtime/daimon/training/native/worker/evidence/execution.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/evidence/index.d.ts +0 -3
- package/dist/runtime/daimon/training/native/worker/evidence/index.js +0 -4
- package/dist/runtime/daimon/training/native/worker/evidence/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/evidence/io.d.ts +0 -20
- package/dist/runtime/daimon/training/native/worker/evidence/io.js +0 -130
- package/dist/runtime/daimon/training/native/worker/evidence/io.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/evidence/seal.d.ts +0 -3
- package/dist/runtime/daimon/training/native/worker/evidence/seal.js +0 -67
- package/dist/runtime/daimon/training/native/worker/evidence/seal.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/index.d.ts +0 -11
- package/dist/runtime/daimon/training/native/worker/index.js +0 -8
- package/dist/runtime/daimon/training/native/worker/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/profile.d.ts +0 -23
- package/dist/runtime/daimon/training/native/worker/profile.js +0 -149
- package/dist/runtime/daimon/training/native/worker/profile.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/public.d.ts +0 -53
- package/dist/runtime/daimon/training/native/worker/public.js +0 -22
- package/dist/runtime/daimon/training/native/worker/public.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/sandbox.d.ts +0 -4
- package/dist/runtime/daimon/training/native/worker/sandbox.js +0 -54
- package/dist/runtime/daimon/training/native/worker/sandbox.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/server.d.ts +0 -4
- package/dist/runtime/daimon/training/native/worker/server.js +0 -102
- package/dist/runtime/daimon/training/native/worker/server.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/types.d.ts +0 -318
- package/dist/runtime/daimon/training/native/worker/types.js +0 -2
- package/dist/runtime/daimon/training/native/worker/types.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/wake-delivery/index.d.ts +0 -4
- package/dist/runtime/daimon/training/native/worker/wake-delivery/index.js +0 -4
- package/dist/runtime/daimon/training/native/worker/wake-delivery/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/wake-delivery/source.d.ts +0 -3
- package/dist/runtime/daimon/training/native/worker/wake-delivery/source.js +0 -16
- package/dist/runtime/daimon/training/native/worker/wake-delivery/source.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/wake-delivery/terminal.d.ts +0 -4
- package/dist/runtime/daimon/training/native/worker/wake-delivery/terminal.js +0 -52
- package/dist/runtime/daimon/training/native/worker/wake-delivery/terminal.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/wake-delivery/transport.d.ts +0 -21
- package/dist/runtime/daimon/training/native/worker/wake-delivery/transport.js +0 -198
- package/dist/runtime/daimon/training/native/worker/wake-delivery/transport.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/wake-delivery/types.d.ts +0 -91
- package/dist/runtime/daimon/training/native/worker/wake-delivery/types.js +0 -2
- package/dist/runtime/daimon/training/native/worker/wake-delivery/types.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/worker.d.ts +0 -1
- package/dist/runtime/daimon/training/native/worker/worker.js +0 -105
- package/dist/runtime/daimon/training/native/worker/worker.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-broker/broker.d.ts +0 -20
- package/dist/runtime/daimon/training/providers/grok-broker/broker.js +0 -55
- package/dist/runtime/daimon/training/providers/grok-broker/broker.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-broker/grant-fixtures.d.ts +0 -15
- package/dist/runtime/daimon/training/providers/grok-broker/grant-fixtures.js +0 -29
- package/dist/runtime/daimon/training/providers/grok-broker/grant-fixtures.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-broker/grant-home.d.ts +0 -16
- package/dist/runtime/daimon/training/providers/grok-broker/grant-home.js +0 -60
- package/dist/runtime/daimon/training/providers/grok-broker/grant-home.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-broker/grant-pool.d.ts +0 -81
- package/dist/runtime/daimon/training/providers/grok-broker/grant-pool.js +0 -221
- package/dist/runtime/daimon/training/providers/grok-broker/grant-pool.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-broker/grant-releases.d.ts +0 -31
- package/dist/runtime/daimon/training/providers/grok-broker/grant-releases.js +0 -78
- package/dist/runtime/daimon/training/providers/grok-broker/grant-releases.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-broker/grants.d.ts +0 -63
- package/dist/runtime/daimon/training/providers/grok-broker/grants.js +0 -20
- package/dist/runtime/daimon/training/providers/grok-broker/grants.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-broker/index.d.ts +0 -3
- package/dist/runtime/daimon/training/providers/grok-broker/index.js +0 -4
- package/dist/runtime/daimon/training/providers/grok-broker/index.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-subscription/cli.d.ts +0 -21
- package/dist/runtime/daimon/training/providers/grok-subscription/cli.js +0 -81
- package/dist/runtime/daimon/training/providers/grok-subscription/cli.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-subscription/index.d.ts +0 -4
- package/dist/runtime/daimon/training/providers/grok-subscription/index.js +0 -5
- package/dist/runtime/daimon/training/providers/grok-subscription/index.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-subscription/protocol.d.ts +0 -26
- package/dist/runtime/daimon/training/providers/grok-subscription/protocol.js +0 -102
- package/dist/runtime/daimon/training/providers/grok-subscription/protocol.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-subscription/provider.d.ts +0 -9
- package/dist/runtime/daimon/training/providers/grok-subscription/provider.js +0 -38
- package/dist/runtime/daimon/training/providers/grok-subscription/provider.js.map +0 -1
- package/dist/runtime/daimon/training/public.d.ts +0 -6
- package/dist/runtime/daimon/training/public.js +0 -5
- package/dist/runtime/daimon/training/public.js.map +0 -1
- package/dist/runtime/daimon/training/services/account-lease.d.ts +0 -7
- package/dist/runtime/daimon/training/services/account-lease.js +0 -76
- package/dist/runtime/daimon/training/services/account-lease.js.map +0 -1
- package/dist/runtime/daimon/training/services/freshness.d.ts +0 -15
- package/dist/runtime/daimon/training/services/freshness.js +0 -19
- package/dist/runtime/daimon/training/services/freshness.js.map +0 -1
- package/dist/runtime/daimon/training/services/index.d.ts +0 -4
- package/dist/runtime/daimon/training/services/index.js +0 -4
- package/dist/runtime/daimon/training/services/index.js.map +0 -1
- package/dist/runtime/daimon/training/services/slot-freshness.d.ts +0 -34
- package/dist/runtime/daimon/training/services/slot-freshness.js +0 -178
- package/dist/runtime/daimon/training/services/slot-freshness.js.map +0 -1
- package/dist/runtime/daimon/wakeMoments.js.map +0 -1
- package/dist/runtime/pi/adapter.d.ts +0 -3
- package/dist/runtime/pi/adapter.js +0 -230
- package/dist/runtime/pi/appActivitySource.d.ts +0 -1
- package/dist/runtime/pi/appActivitySource.js +0 -199
- package/dist/runtime/pi/appAgentConfig.d.ts +0 -11
- package/dist/runtime/pi/appAgentConfig.js +0 -264
- package/dist/runtime/pi/appCliEnginesSource.d.ts +0 -1
- package/dist/runtime/pi/appCliEnginesSource.js +0 -183
- package/dist/runtime/pi/appCliSource.d.ts +0 -1
- package/dist/runtime/pi/appCliSource.js +0 -353
- package/dist/runtime/pi/appControlSource.d.ts +0 -1
- package/dist/runtime/pi/appControlSource.js +0 -390
- package/dist/runtime/pi/appControlWakeIdentitySource.d.ts +0 -1
- package/dist/runtime/pi/appControlWakeIdentitySource.js +0 -19
- package/dist/runtime/pi/appCoreSource.d.ts +0 -4
- package/dist/runtime/pi/appCoreSource.js +0 -244
- package/dist/runtime/pi/appPreludeSource.d.ts +0 -1
- package/dist/runtime/pi/appPreludeSource.js +0 -192
- package/dist/runtime/pi/appScheduleSource.d.ts +0 -1
- package/dist/runtime/pi/appScheduleSource.js +0 -84
- package/dist/runtime/pi/appScriptedEngine.d.ts +0 -31
- package/dist/runtime/pi/appScriptedEngine.js +0 -42
- package/dist/runtime/pi/appSource.d.ts +0 -4
- package/dist/runtime/pi/appSource.js +0 -12
- package/dist/runtime/pi/appTemplate.d.ts +0 -14
- package/dist/runtime/pi/appTemplate.js +0 -28
- package/dist/runtime/pi/appTemplateTypes.d.ts +0 -64
- package/dist/runtime/pi/appTemplateTypes.js +0 -18
- package/dist/runtime/pi/appWakeContextSource.d.ts +0 -1
- package/dist/runtime/pi/appWakeContextSource.js +0 -398
- package/dist/runtime/pi/containerTargets.d.ts +0 -4
- package/dist/runtime/pi/containerTargets.js +0 -63
- package/dist/runtime/pi/runAuth.d.ts +0 -2
- package/dist/runtime/pi/runAuth.js +0 -185
- package/dist/runtime/pi/testHelpers.d.ts +0 -2
- package/dist/shared/errors.js.map +0 -1
- package/dist/training/subjects/environment.d.ts +0 -2
- package/dist/training/subjects/environment.js +0 -14
- package/dist/training/subjects/environment.js.map +0 -1
|
@@ -1,400 +0,0 @@
|
|
|
1
|
-
import { canonicalWireId } from '../../../../../training/index.js';
|
|
2
|
-
import { spawn } from 'node:child_process';
|
|
3
|
-
import { dirname } from 'node:path';
|
|
4
|
-
import { setTimeout as pause } from 'node:timers/promises';
|
|
5
|
-
import { isGrokLaunch, nativeTrialArtifactsRoot, readPrivateFile } from '../receipt/index.js';
|
|
6
|
-
import { admittedExecutions, declaredLimitStop, executionClosed, validateNativeFrame, AMBIGUOUS_NATIVE_EXECUTION } from '../worker/index.js';
|
|
7
|
-
import { createNativeHttpClient, transportTerminalBinding } from '../transport/index.js';
|
|
8
|
-
import { engineWakeTimeoutMs, parseTransportSource } from '../worker/index.js';
|
|
9
|
-
import { ensureNativeTrialArtifacts, nativeChildArguments, nativeChildEnvironment, validateChildPaths } from './arguments.js';
|
|
10
|
-
import { verifyChildSandbox } from './sandbox.js';
|
|
11
|
-
import { recordNativeStartupClosure } from '../../services/index.js';
|
|
12
|
-
import { childDiagnostics } from './diagnostics.js';
|
|
13
|
-
/** One fresh worker process in the caller's existing container; no Docker or remote proof. */
|
|
14
|
-
export async function startOwnedChild(execution, launch, trialId, timeoutMs, signal, startupMs = 60_000, protectedPaths = []) {
|
|
15
|
-
if (!Number.isSafeInteger(startupMs) || startupMs < 1 || startupMs > 3_600_000)
|
|
16
|
-
throw new Error('Invalid native startup deadline');
|
|
17
|
-
const startup = new AbortController();
|
|
18
|
-
const abort = () => startup.abort();
|
|
19
|
-
signal?.addEventListener('abort', abort, { once: true });
|
|
20
|
-
const timer = setTimeout(abort, Math.min(startupMs, timeoutMs));
|
|
21
|
-
let launched = false;
|
|
22
|
-
try {
|
|
23
|
-
signal?.throwIfAborted();
|
|
24
|
-
if (execution.prepare)
|
|
25
|
-
await bounded(execution.prepare({ launch: structuredClone(launch), trialId, signal: startup.signal }), startup.signal);
|
|
26
|
-
startup.signal.throwIfAborted();
|
|
27
|
-
await validateChildPaths(launch);
|
|
28
|
-
await ensureNativeTrialArtifacts(launch, trialId);
|
|
29
|
-
const env = await nativeChildEnvironment(launch);
|
|
30
|
-
const token = (await readPrivateFile(launch.tokenFile, 4096)).trim();
|
|
31
|
-
return await launchChild(launch, trialId, timeoutMs, env, token, startup.signal, protectedPaths, () => { launched = true; }, execution.grokSlots);
|
|
32
|
-
}
|
|
33
|
-
catch (error) {
|
|
34
|
-
throw recordNativeStartupClosure(error, !launched);
|
|
35
|
-
}
|
|
36
|
-
finally {
|
|
37
|
-
clearTimeout(timer);
|
|
38
|
-
signal?.removeEventListener('abort', abort);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Every value a captured stream must never publish: the control token and every
|
|
43
|
-
* declared environment value (locale and path variables excepted, which are not
|
|
44
|
-
* secret and are useful in a diagnostic), plus the credential file paths.
|
|
45
|
-
*/
|
|
46
|
-
function childSecrets(launch, env, token) {
|
|
47
|
-
const safe = new Set(['HOME', 'PATH', 'LANG', 'LC_ALL', 'TZ']);
|
|
48
|
-
return [token, launch.tokenFile, launch.envFile,
|
|
49
|
-
...Object.entries(env).filter(([key]) => !safe.has(key)).map(([, value]) => value ?? '')].filter(Boolean);
|
|
50
|
-
}
|
|
51
|
-
async function launchChild(launch, trialId, timeoutMs, env, token, startup, protectedPaths, onSpawn, grokSlots) {
|
|
52
|
-
const http = createNativeHttpClient(`http://${launch.host.bindHost}:${launch.host.port}`, token, launch.delivery);
|
|
53
|
-
const diagnostics = await childDiagnostics(nativeTrialArtifactsRoot(launch, trialId), trialId, launch.configSha256, childSecrets(launch, env, token));
|
|
54
|
-
const group = process.platform !== 'win32';
|
|
55
|
-
const child = spawn(process.execPath, nativeChildArguments(launch, trialId, timeoutMs), {
|
|
56
|
-
cwd: dirname(launch.workerRoot), env, detached: group, stdio: ['ignore', 'pipe', 'pipe'],
|
|
57
|
-
});
|
|
58
|
-
const pid = child.pid;
|
|
59
|
-
// Preparation and synchronous spawn failures own no process. A returned pid
|
|
60
|
-
// is the boundary after which absence needs the ordinary closure proof.
|
|
61
|
-
if (pid !== undefined)
|
|
62
|
-
onSpawn();
|
|
63
|
-
let reaped = false;
|
|
64
|
-
let exited = false;
|
|
65
|
-
let exitCode = null;
|
|
66
|
-
let exitSignal = null;
|
|
67
|
-
let ready = false;
|
|
68
|
-
let failure = false;
|
|
69
|
-
let buffer = '';
|
|
70
|
-
let bytes = 0;
|
|
71
|
-
child.once('error', () => { failure = true; });
|
|
72
|
-
child.once('exit', () => { reaped = true; });
|
|
73
|
-
child.once('close', (code, signal) => { exited = true; exitCode = code; exitSignal = signal; });
|
|
74
|
-
const groupGone = () => {
|
|
75
|
-
// Only ESRCH proves absence. Unsupported inspection and EPERM stay unknown.
|
|
76
|
-
if (!group || pid === undefined)
|
|
77
|
-
return false;
|
|
78
|
-
try {
|
|
79
|
-
process.kill(-pid, 0);
|
|
80
|
-
return false;
|
|
81
|
-
}
|
|
82
|
-
catch (error) {
|
|
83
|
-
return error.code === 'ESRCH';
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
const send = (signal) => {
|
|
87
|
-
// Reaping ends signaling authority: a retained numeric PID/PGID can be reused.
|
|
88
|
-
if (pid === undefined || reaped)
|
|
89
|
-
return;
|
|
90
|
-
try {
|
|
91
|
-
process.kill(group ? -pid : pid, signal);
|
|
92
|
-
}
|
|
93
|
-
catch { /* Closure observation decides, never signal success. */ }
|
|
94
|
-
};
|
|
95
|
-
const consume = (chunk, stdout) => {
|
|
96
|
-
diagnostics.append(chunk, stdout);
|
|
97
|
-
bytes += chunk.length;
|
|
98
|
-
if (bytes > 1_048_576) {
|
|
99
|
-
failure = true;
|
|
100
|
-
send('SIGTERM');
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
if (!stdout)
|
|
104
|
-
return;
|
|
105
|
-
buffer += chunk.toString('utf8');
|
|
106
|
-
for (;;) {
|
|
107
|
-
const end = buffer.indexOf('\n');
|
|
108
|
-
if (end < 0)
|
|
109
|
-
break;
|
|
110
|
-
const line = buffer.slice(0, end);
|
|
111
|
-
buffer = buffer.slice(end + 1);
|
|
112
|
-
try {
|
|
113
|
-
const row = JSON.parse(line);
|
|
114
|
-
if (canonicalWireId(row.schema) === 'spawnfile.training.daimon-native.ready.v1' && row.trialId === trialId && row.configSha256 === launch.configSha256 &&
|
|
115
|
-
row.agentId === launch.agent.id && row.model === launch.agent.model && row.port === launch.host.port &&
|
|
116
|
-
(!isGrokLaunch(launch) || row.engine === 'grok' && row.reasoningEffort === launch.agent.reasoningEffort))
|
|
117
|
-
ready = true;
|
|
118
|
-
}
|
|
119
|
-
catch { /* Bootstrap may emit non-protocol logging; never treat it as readiness. */ }
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
child.stdout.on('data', (chunk) => consume(chunk, true));
|
|
123
|
-
child.stderr.on('data', (chunk) => consume(chunk, false));
|
|
124
|
-
let stopping;
|
|
125
|
-
/**
|
|
126
|
-
* One entry per delivery this trial made, in order: which wake it was, and why
|
|
127
|
-
* that wake's own frame cannot be scored from. `terminal-absent` is no frame at
|
|
128
|
-
* all for that delivery; `terminal-unbound` is a frame whose identity, closed
|
|
129
|
-
* trace or resolved execution disagreed, including one belonging to another
|
|
130
|
-
* trial; `terminal-ambiguous` is a frame whose named execution has more than
|
|
131
|
-
* one closed trace answering to it. Kept apart rather than collapsed, because
|
|
132
|
-
* they call for fixes in different places.
|
|
133
|
-
*
|
|
134
|
-
* A ledger rather than one verdict, because a trial whose subject defers runs
|
|
135
|
-
* several wakes and each one publishes its own frame. Holding only the newest
|
|
136
|
-
* meant a continuation that did not bind erased the account of a wake that HAD
|
|
137
|
-
* bound, over a closed trace, on a runtime the same stop proves quiet — and the
|
|
138
|
-
* trial then reported that it had no terminal evidence at all, which was false.
|
|
139
|
-
*/
|
|
140
|
-
const wakes = [];
|
|
141
|
-
/**
|
|
142
|
-
* A fault that belongs to the TRIAL rather than to one of its wakes, and which
|
|
143
|
-
* therefore no other wake's frame may be scored past.
|
|
144
|
-
*
|
|
145
|
-
* Isolation is the property: a frame from another trial, agent, model, config
|
|
146
|
-
* or delivery, a foreign execution among the traces, or one execution answering
|
|
147
|
-
* to two closed traces all say that what this runtime published cannot be
|
|
148
|
-
* attributed, and attribution is exactly what selection would be doing. A wake
|
|
149
|
-
* that simply named no closed execution of its own is the other kind — that
|
|
150
|
-
* wake is unscorable and the trial's earlier frames are untouched.
|
|
151
|
-
*/
|
|
152
|
-
let sealed;
|
|
153
|
-
let diagnosed;
|
|
154
|
-
/**
|
|
155
|
-
* Closure is one question — is anything still running or still spending? — and
|
|
156
|
-
* it is the conjunction of four independent live proofs: the runtime admits no
|
|
157
|
-
* execution of this agent's, it sealed and acknowledged its own stop, and the
|
|
158
|
-
* owned child exited cleanly, and its process group disappeared (decided below,
|
|
159
|
-
* after the kill escalation). Escaped descendants and remote work stay unknown.
|
|
160
|
-
*
|
|
161
|
-
* It used to demand a fourth: that the last delivery's terminal frame bind to a
|
|
162
|
-
* resolved execution. That was interrogating another service's inbox
|
|
163
|
-
* bookkeeping over HTTP — a fact about the last delivery's paperwork, derived
|
|
164
|
-
* from a snapshot the runtime had already published, which cannot say whether
|
|
165
|
-
* anything is spending NOW. Everything it could claim comes from the same
|
|
166
|
-
* runtime that answers `/v2/activity` live, so it added no authority while it
|
|
167
|
-
* did subtract scorable runs: across seven investigations this predicate failed
|
|
168
|
-
* a different way each time on a run that was healthy. The binding still
|
|
169
|
-
* happens and still rejects a foreign trial's frame; it reports as missing
|
|
170
|
-
* EVIDENCE instead.
|
|
171
|
-
*
|
|
172
|
-
* Each proof names itself on the receipt, which publishes durably with the
|
|
173
|
-
* turn, because the evidence that would identify a missing one lives in the
|
|
174
|
-
* worker's control root and a training slot puts that on tmpfs. The vocabulary
|
|
175
|
-
* is closed, so nothing here can leak a path, a token, a body or an error
|
|
176
|
-
* string.
|
|
177
|
-
*/
|
|
178
|
-
const proveClosure = async () => {
|
|
179
|
-
if (!ready || exited)
|
|
180
|
-
return 'worker-unavailable';
|
|
181
|
-
// Read before the stop, so the query is answered by the runtime that owns the
|
|
182
|
-
// execution; a host the worker already stopped seals this projection instead.
|
|
183
|
-
let activity;
|
|
184
|
-
try {
|
|
185
|
-
activity = await http('/v2/activity', undefined, 1500);
|
|
186
|
-
}
|
|
187
|
-
catch {
|
|
188
|
-
return 'activity-unreadable';
|
|
189
|
-
}
|
|
190
|
-
// Requested even when the projection already refuses closure: a runtime that
|
|
191
|
-
// can still be told to stop should be, and the cause below names the busier
|
|
192
|
-
// fault first rather than whichever one this request happens to return.
|
|
193
|
-
let native;
|
|
194
|
-
try {
|
|
195
|
-
native = await http('/trial/stop', {}, 6000);
|
|
196
|
-
}
|
|
197
|
-
catch {
|
|
198
|
-
native = undefined;
|
|
199
|
-
}
|
|
200
|
-
// A projection with no execution authority, or carrying another agent's
|
|
201
|
-
// execution, cannot be counted at all; an unfinished runtime answers with the
|
|
202
|
-
// execution it is still running. Different faults, different names.
|
|
203
|
-
let admitted;
|
|
204
|
-
try {
|
|
205
|
-
admitted = admittedExecutions(activity, launch.agent.id);
|
|
206
|
-
}
|
|
207
|
-
catch {
|
|
208
|
-
return 'execution-unbound';
|
|
209
|
-
}
|
|
210
|
-
if (admitted > 0)
|
|
211
|
-
return 'activity-busy';
|
|
212
|
-
if (native?.state !== 'acknowledged')
|
|
213
|
-
return 'native-stop-unacknowledged';
|
|
214
|
-
return undefined;
|
|
215
|
-
};
|
|
216
|
-
const stop = (reason) => stopping ??= (async () => {
|
|
217
|
-
// The trial's own evidence, selected rather than taken from whichever delivery
|
|
218
|
-
// answered last: the most recent wake that bound is the most recent account of
|
|
219
|
-
// this trial, and it is named so a scored report can say which wake it read. A
|
|
220
|
-
// trial-wide fault outranks every frame, and with no admissible wake at all the
|
|
221
|
-
// refusal keeps the last delivery's own cause.
|
|
222
|
-
const scored = sealed ? undefined : [...wakes].reverse().find(entry => entry.unevidenced === undefined);
|
|
223
|
-
const last = wakes[wakes.length - 1];
|
|
224
|
-
const evidence = scored ? undefined : sealed ?? last?.unevidenced ?? 'terminal-absent';
|
|
225
|
-
let cause;
|
|
226
|
-
try {
|
|
227
|
-
cause = await proveClosure();
|
|
228
|
-
}
|
|
229
|
-
catch {
|
|
230
|
-
cause = 'activity-unreadable'; /* Uncertain native work requires outer-container termination. */
|
|
231
|
-
}
|
|
232
|
-
if (!exited)
|
|
233
|
-
send('SIGTERM');
|
|
234
|
-
const until = Date.now() + 2000;
|
|
235
|
-
while ((!exited || !groupGone()) && Date.now() < until)
|
|
236
|
-
await pause(20);
|
|
237
|
-
if (!exited || !groupGone()) {
|
|
238
|
-
send('SIGKILL');
|
|
239
|
-
const forced = Date.now() + 1000;
|
|
240
|
-
while ((!exited || !groupGone()) && Date.now() < forced)
|
|
241
|
-
await pause(20);
|
|
242
|
-
}
|
|
243
|
-
await diagnostics.save(exitCode, exitSignal);
|
|
244
|
-
cause ??= !exited || !groupGone() ? 'child-running' : exitCode === 0 ? undefined : 'child-exit';
|
|
245
|
-
const confirmed = cause === undefined;
|
|
246
|
-
// A worker that died mid-turn published nothing: startup owns the only
|
|
247
|
-
// other route this record takes, and the protected file it is built from
|
|
248
|
-
// lives on a slot tmpfs that dies with the container. Build it here so the
|
|
249
|
-
// durable event stream carries why the worker stopped answering — for a
|
|
250
|
-
// frame that never arrived as much as for an unproven closure, since its
|
|
251
|
-
// last words are exactly what explains a missing one.
|
|
252
|
-
if (!confirmed || evidence) {
|
|
253
|
-
try {
|
|
254
|
-
diagnosed = diagnostics.record(new Error(reason));
|
|
255
|
-
}
|
|
256
|
-
catch { /* never fails a stop */ }
|
|
257
|
-
}
|
|
258
|
-
return { state: confirmed ? 'acknowledged' : 'unknown', scope: 'native-handle', quiescence: confirmed ? 'confirmed' : 'unknown', remoteWork: 'unknown', reason,
|
|
259
|
-
...(cause ? { unconfirmed: cause } : {}),
|
|
260
|
-
// Two separate questions, two separate names: a run can be provably quiet
|
|
261
|
-
// AND unscorable, and a report that cannot say which one it is sends the
|
|
262
|
-
// next investigation to the wrong layer.
|
|
263
|
-
...(evidence ? { unevidenced: evidence } : {}),
|
|
264
|
-
// Which wake the verdict rests on, and every wake's own verdict beside it.
|
|
265
|
-
// Selection must not become suppression: a continuation that did not bind is
|
|
266
|
-
// a real account of that wake, and it travels here because the worker's own
|
|
267
|
-
// per-wake files live on a control root a training slot puts on tmpfs.
|
|
268
|
-
...(scored ? { evidenced: scored.wakeId } : {}),
|
|
269
|
-
...(wakes.length ? { wakes: wakes.map(entry => ({ wakeId: entry.wakeId, ...(entry.unevidenced ? { unevidenced: entry.unevidenced } : {}) })) } : {}),
|
|
270
|
-
detail: !confirmed ? `Native child closure unconfirmed (${cause}); caller must stop the shared container`
|
|
271
|
-
: evidence ? `Idle native runtime, acknowledged native stop, worker exit and process group gone; no terminal evidence to score this trial (${evidence})${last ? ` on wake ${last.wakeId}` : ''}`
|
|
272
|
-
: `Closed native execution, idle runtime, acknowledged native stop, worker exit and process group gone${scored === last ? '' : `; scored from wake ${scored.wakeId}, not wake ${last.wakeId} (${last.unevidenced})`}` };
|
|
273
|
-
})();
|
|
274
|
-
try {
|
|
275
|
-
while (!ready) {
|
|
276
|
-
startup.throwIfAborted();
|
|
277
|
-
if (failure || exited)
|
|
278
|
-
throw new Error('Native worker exited or failed before readiness');
|
|
279
|
-
await pause(20);
|
|
280
|
-
}
|
|
281
|
-
const health = await http('/trial/health', undefined, 1000, startup);
|
|
282
|
-
if (health.version !== 'noopolis.daimon.organization-runtime-health.v1' || health.state !== 'running' || health.agents.length !== 1 || health.agents[0]?.agentId !== launch.agent.id)
|
|
283
|
-
throw new Error('Native worker readiness identity mismatch');
|
|
284
|
-
await verifyChildSandbox(launch, trialId, protectedPaths, startup, grokSlots);
|
|
285
|
-
startup.throwIfAborted();
|
|
286
|
-
const request = async (path, body, ms, signal) => {
|
|
287
|
-
if (failure || exited)
|
|
288
|
-
throw new Error('Owned native worker is no longer alive');
|
|
289
|
-
// Recorded before the call, so a delivery whose frame never arrives is still
|
|
290
|
-
// this trial's own wake with its own cause rather than a gap in the ledger.
|
|
291
|
-
const wake = path !== '/trial/run' || body === undefined ? undefined : named(body?.wakeId);
|
|
292
|
-
if (wake && launch.delivery === 'transport')
|
|
293
|
-
wake.source = parseTransportSource(body.source);
|
|
294
|
-
if (wake)
|
|
295
|
-
wakes.push(wake);
|
|
296
|
-
const result = await http(path, body, ms, signal);
|
|
297
|
-
if (wake)
|
|
298
|
-
bindTerminalEvidence(wake, result, launch, trialId, fault => { sealed ??= fault; }, engineWakeTimeoutMs(timeoutMs, launch));
|
|
299
|
-
return result;
|
|
300
|
-
};
|
|
301
|
-
return { name: `child:${child.pid}`, request, stop, diagnostic: () => diagnosed };
|
|
302
|
-
}
|
|
303
|
-
catch (error) {
|
|
304
|
-
// The protected capture lives on the control root, which a training slot puts on tmpfs; the thrown
|
|
305
|
-
// carrier holds the redacted record so the caller can persist the failure class durably.
|
|
306
|
-
const outcome = await stop('Native child startup failed');
|
|
307
|
-
throw recordNativeStartupClosure(diagnostics.startupFailure(error), outcome.state === 'acknowledged' && outcome.quiescence === 'confirmed');
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
/**
|
|
311
|
-
* The delivery's own wake name, at the bound the worker's gate admits.
|
|
312
|
-
*
|
|
313
|
-
* The receipt publishes durably and its vocabulary is closed, so the name a
|
|
314
|
-
* caller passed is either one of those bounded identifiers or it is not
|
|
315
|
-
* published at all: `unnamed` is a statement about the ledger entry, never a
|
|
316
|
-
* path, a token or a body smuggled onto the record by a caller's own string.
|
|
317
|
-
*/
|
|
318
|
-
const WAKE_NAME = /^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/u;
|
|
319
|
-
function named(wakeId) {
|
|
320
|
-
return { wakeId: typeof wakeId === 'string' && WAKE_NAME.test(wakeId) ? wakeId : 'unnamed', unevidenced: 'terminal-absent' };
|
|
321
|
-
}
|
|
322
|
-
/**
|
|
323
|
-
* Whether ONE wake's frame can be scored from — never whether something is still
|
|
324
|
-
* spending, and never a verdict about the trial around it.
|
|
325
|
-
*
|
|
326
|
-
* A frame from another trial, agent, wake or config is not this trial's evidence,
|
|
327
|
-
* and that check lives here rather than in the closure predicate. The receipt has
|
|
328
|
-
* to name this trial's own delivery too: the frame's identity and the delivery the
|
|
329
|
-
* runtime answered for are one delivery, or the frame is accounting for somebody
|
|
330
|
-
* else's wake. Those are attribution failures, so they `seal` the whole trial:
|
|
331
|
-
* nothing this runtime published can be scored past one.
|
|
332
|
-
*
|
|
333
|
-
* A trial whose subject deferred runs its continuations as further wakes, and each
|
|
334
|
-
* one closes an execution of its own. The trace that answers for THIS frame is the
|
|
335
|
-
* one the frame names; the rest are this same trial's earlier, already-closed
|
|
336
|
-
* wakes, and counting them was refusing a healthy run for the arity of its own
|
|
337
|
-
* history. Nothing is admitted by position: an unnamed execution resolves to no
|
|
338
|
-
* trace at all, and that is this wake's own fault rather than the trial's.
|
|
339
|
-
*
|
|
340
|
-
* An identity conflict still throws, because it must fail the turn rather than
|
|
341
|
-
* pass as verified work; it only records what it was first. Two traces answering
|
|
342
|
-
* to the named execution is its own word: the frame is not unbound, it is
|
|
343
|
-
* unreadable, and that distinction is what sends the next look at it upstream
|
|
344
|
-
* instead of here.
|
|
345
|
-
*/
|
|
346
|
-
export function bindTerminalEvidence(wake, value, launch, trialId, seal, wakeTimeoutMs) {
|
|
347
|
-
const own = canonicalWireId(value.schema) === 'spawnfile.training.daimon-native.trial.v1' && value.trialId === trialId && value.agentId === launch.agent.id &&
|
|
348
|
-
value.model === launch.agent.model && value.configSha256 === launch.configSha256 &&
|
|
349
|
-
value.wakeId === wake.wakeId;
|
|
350
|
-
const binding = launch.delivery === 'transport' ? transportTerminalBinding(value, wake.source)
|
|
351
|
-
: value.receipt && value.activity && value.receipt.agent_id === launch.agent.id &&
|
|
352
|
-
value.receipt.delivery_id === `${trialId}:${value.wakeId}` ? 'bound' : 'conflict';
|
|
353
|
-
wake.unevidenced = 'terminal-unbound';
|
|
354
|
-
if (!own || binding === 'conflict') {
|
|
355
|
-
seal('terminal-unbound');
|
|
356
|
-
return;
|
|
357
|
-
}
|
|
358
|
-
try {
|
|
359
|
-
if (binding === 'incomplete') {
|
|
360
|
-
if (value.activity)
|
|
361
|
-
admittedExecutions(value.activity, launch.agent.id);
|
|
362
|
-
const ids = new Set();
|
|
363
|
-
for (const trace of value.native.traces) {
|
|
364
|
-
if (trace.agent_id !== launch.agent.id)
|
|
365
|
-
throw new Error('Native execution evidence identity mismatch');
|
|
366
|
-
if (ids.has(trace.turn_id))
|
|
367
|
-
throw new Error(AMBIGUOUS_NATIVE_EXECUTION);
|
|
368
|
-
ids.add(trace.turn_id);
|
|
369
|
-
}
|
|
370
|
-
return;
|
|
371
|
-
}
|
|
372
|
-
validateNativeFrame(value.activity, value.receipt, value.native.traces, launch.agent.id, value.executionId);
|
|
373
|
-
const trace = typeof value.executionId === 'string' ? value.native.traces.find(row => row.turn_id === value.executionId) : undefined;
|
|
374
|
-
// A failed trace binds only as the declared-limit stop the worker labelled and
|
|
375
|
-
// its own sealed usage row still states; any other failure stays unscorable.
|
|
376
|
-
const limited = value.limit !== undefined && declaredLimitStop(trace, value.native.usage, wakeTimeoutMs) === value.limit;
|
|
377
|
-
if (!trace || trace.status !== 'completed' && !limited)
|
|
378
|
-
return;
|
|
379
|
-
if (executionClosed(value.activity, value.receipt, value.native.traces, launch.agent.id, trace.turn_id) === value.executionId)
|
|
380
|
-
wake.unevidenced = undefined;
|
|
381
|
-
}
|
|
382
|
-
catch (conflict) {
|
|
383
|
-
const fault = conflict.message === AMBIGUOUS_NATIVE_EXECUTION ? 'terminal-ambiguous' : 'terminal-unbound';
|
|
384
|
-
wake.unevidenced = fault;
|
|
385
|
-
seal(fault);
|
|
386
|
-
throw conflict;
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
async function bounded(pending, signal) {
|
|
390
|
-
signal.throwIfAborted();
|
|
391
|
-
let abort;
|
|
392
|
-
const cancelled = new Promise((_resolve, reject) => { abort = () => reject(new Error('Native child preparation cancelled')); signal.addEventListener('abort', abort, { once: true }); });
|
|
393
|
-
try {
|
|
394
|
-
return await Promise.race([pending, cancelled]);
|
|
395
|
-
}
|
|
396
|
-
finally {
|
|
397
|
-
signal.removeEventListener('abort', abort);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
//# sourceMappingURL=lifecycle.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"lifecycle.js","sourceRoot":"","sources":["../../../../../../src/runtime/daimon/training/native/child/lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,IAAI,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,wBAAwB,EAAE,eAAe,EAA6B,MAAM,qBAAqB,CAAC;AACzH,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAE,mBAAmB,EAAE,0BAA0B,EACvF,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAA8B,MAAM,uBAAuB,CAAC;AACrH,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAgC,MAAM,oBAAoB,CAAC;AAC7G,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB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AClB,MAAM,KAAK,GAAI,QAAkB,CAAC,OAAO,KAAK,0BAA0B,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,kBAAkB,CAAC;QACrH,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,IAAI,CAAC,KAAK,CAAC,CAAC;QACZ,MAAM,QAAQ,CAAC;IACjB,CAAC;AACH,CAAC;AAED,KAAK,UAAU,OAAO,CAAI,OAAmB,EAAE,MAAmB;IAChE,MAAM,CAAC,cAAc,EAAE,CAAC;IAAC,IAAI,KAAkB,CAAC;IAChD,MAAM,SAAS,GAAG,IAAI,OAAO,CAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,GAAG,KAAK,GAAG,GAAG,EAAE,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChM,IAAI,CAAC;QAAC,OAAO,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;IAAC,CAAC;YAAS,CAAC;QAAC,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAAC,CAAC;AAClH,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/** Executed verbatim inside the native sandbox; success is an on-disk terminal marker. */
|
|
2
|
-
export function nativeChildProbe(input, complete, denied, port) {
|
|
3
|
-
return `const fs=require('node:fs'),net=require('node:net');
|
|
4
|
-
if(fs.readFileSync(${JSON.stringify(input)},'utf8')!=='NATIVE_READ')throw Error('Workspace read failed');
|
|
5
|
-
for(const p of ${JSON.stringify(denied)}){let fd;try{fd=fs.openSync(p,'r');}catch{continue;}fs.closeSync(fd);throw Error('Protected path readable');}
|
|
6
|
-
let settled=false;const s=net.connect({host:'127.0.0.1',port:${port}});
|
|
7
|
-
s.once('connect',()=>{settled=true;s.destroy();process.exitCode=1;});
|
|
8
|
-
s.once('error',()=>{if(settled)return;settled=true;s.destroy();fs.writeFileSync(${JSON.stringify(complete)},'NATIVE_POLICY_COMPLETE');});
|
|
9
|
-
s.setTimeout(750,()=>{settled=true;s.destroy();process.exitCode=1;});`;
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=probe.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"probe.js","sourceRoot":"","sources":["../../../../../../src/runtime/daimon/training/native/child/probe.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,MAAM,UAAU,gBAAgB,CAAC,KAAa,EAAE,QAAgB,EAAE,MAAyB,EAAE,IAAY;IACvG,OAAO;qBACY,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;iBACzB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC;+DACwB,IAAI;;kFAEe,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;sEACpC,CAAC;AACvE,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type VerifiedNativeLaunch } from '../receipt/index.js';
|
|
2
|
-
import type { GrokSlotFreshnessStore } from '../../services/index.js';
|
|
3
|
-
/** Runs the actual owner-produced permission projection, not an approximate test profile. */
|
|
4
|
-
export declare function verifyChildSandbox(launch: VerifiedNativeLaunch, trialId: string, protectedPaths: readonly string[], signal: AbortSignal, grokSlots?: GrokSlotFreshnessStore): Promise<void>;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { trainingEnvironment } from '../../../../../training/index.js';
|
|
2
|
-
import { execFile } from 'node:child_process';
|
|
3
|
-
import { promisify } from 'node:util';
|
|
4
|
-
import { lstat, mkdir, mkdtemp, open, readFile, rm, writeFile } from 'node:fs/promises';
|
|
5
|
-
import { join, resolve } from 'node:path';
|
|
6
|
-
import { createServer } from 'node:net';
|
|
7
|
-
import { nativeChildProbe } from './probe.js';
|
|
8
|
-
import { isGrokLaunch, nativeTrialArtifactsRoot, parseNativeSandboxReceipt, readPrivateFile } from '../receipt/index.js';
|
|
9
|
-
import { verifyChildGrokSlot } from './grok.js';
|
|
10
|
-
/** Runs the actual owner-produced permission projection, not an approximate test profile. */
|
|
11
|
-
export async function verifyChildSandbox(launch, trialId, protectedPaths, signal, grokSlots) {
|
|
12
|
-
if (isGrokLaunch(launch))
|
|
13
|
-
return verifyChildGrokSlot(launch, trialId, protectedPaths, grokSlots);
|
|
14
|
-
const home = launch.projections.find(row => row.role === 'home').target;
|
|
15
|
-
const artifacts = nativeTrialArtifactsRoot(launch, trialId);
|
|
16
|
-
const receipt = parseNativeSandboxReceipt(JSON.parse(await readPrivateFile(join(artifacts, 'sandbox-projection.json'), 262144)), {
|
|
17
|
-
trialId, configSha256: launch.configSha256, agentId: launch.agent.id, workspacePath: launch.workspace.target, runtimeHomePath: home,
|
|
18
|
-
});
|
|
19
|
-
const scratch = await mkdtemp(join(launch.workspace.target, '.spawnfile-training-native-policy-'));
|
|
20
|
-
const owned = [];
|
|
21
|
-
const denied = [];
|
|
22
|
-
const server = createServer(socket => socket.destroy());
|
|
23
|
-
try {
|
|
24
|
-
// An absent configured secret has nothing to deny; the TypeSafe transport refuses it on use.
|
|
25
|
-
const secretFile = trainingEnvironment('SPAWNFILE_TRAINING_TYPESAFE_SECRET_FILE');
|
|
26
|
-
const evaluatorSecret = secretFile ? resolve(secretFile) : undefined;
|
|
27
|
-
const secretPresent = evaluatorSecret !== undefined && await lstat(evaluatorSecret).then(() => true, (error) => {
|
|
28
|
-
if (error.code === 'ENOENT')
|
|
29
|
-
return false;
|
|
30
|
-
throw error;
|
|
31
|
-
});
|
|
32
|
-
for (const path of [...new Set([...protectedPaths, launch.controlRoot, launch.config, launch.tokenFile, launch.envFile,
|
|
33
|
-
...(secretPresent ? [evaluatorSecret] : [])])]) {
|
|
34
|
-
const entry = await lstat(path);
|
|
35
|
-
if (!entry.isDirectory() && !entry.isFile())
|
|
36
|
-
throw new Error('Unsupported protected native path');
|
|
37
|
-
denied.push(path);
|
|
38
|
-
}
|
|
39
|
-
// Verify the declared auth/ingress rule with canaries only when no credential exists.
|
|
40
|
-
await mkdir(join(home, '.codex'), { recursive: true, mode: 0o700 });
|
|
41
|
-
await mkdir(join(home, '.daimon-inbound'), { recursive: true, mode: 0o700 });
|
|
42
|
-
for (const file of [join(home, '.codex/auth.json'), join(home, '.daimon-inbound/.spawnfile-training-canary')]) {
|
|
43
|
-
try {
|
|
44
|
-
const handle = await open(file, 'wx', 0o600);
|
|
45
|
-
await handle.writeFile('{}');
|
|
46
|
-
await handle.close();
|
|
47
|
-
owned.push(file);
|
|
48
|
-
}
|
|
49
|
-
catch (error) {
|
|
50
|
-
if (error.code !== 'EEXIST')
|
|
51
|
-
throw error;
|
|
52
|
-
}
|
|
53
|
-
denied.push(file);
|
|
54
|
-
}
|
|
55
|
-
const input = join(scratch, 'input'), complete = join(scratch, 'complete');
|
|
56
|
-
await writeFile(input, 'NATIVE_READ');
|
|
57
|
-
await new Promise(resolve => server.listen(0, '127.0.0.1', resolve));
|
|
58
|
-
const port = server.address().port;
|
|
59
|
-
const code = nativeChildProbe(input, complete, denied, port);
|
|
60
|
-
await promisify(execFile)(receipt.projection.executablePath, [...receipt.projection.sandboxArgs, '--', process.execPath, '-e', code], {
|
|
61
|
-
cwd: launch.workspace.target, env: { PATH: process.env.PATH, HOME: home, CODEX_HOME: join(home, '.codex'), TMPDIR: '/tmp', LANG: 'C.UTF-8' }, signal, timeout: 15000, maxBuffer: 65536,
|
|
62
|
-
});
|
|
63
|
-
if (await readFile(complete, 'utf8') !== 'NATIVE_POLICY_COMPLETE')
|
|
64
|
-
throw new Error('Native sandbox did not finish enforcement checks');
|
|
65
|
-
await writeFile(join(artifacts, 'child-sandbox-preflight.json'), JSON.stringify({ schema: 'spawnfile.training.daimon-native.child-sandbox-preflight.v1',
|
|
66
|
-
trialId, configSha256: launch.configSha256, projectionSha256: receipt.projectionSha256, modelCallsMade: 0, workspaceReadWrite: true, protectedPathsDenied: true, networkDenied: true }), { flag: 'wx', mode: 0o600 });
|
|
67
|
-
}
|
|
68
|
-
catch (error) {
|
|
69
|
-
throw new Error('Exact native child sandbox failed before cognition', { cause: error });
|
|
70
|
-
}
|
|
71
|
-
finally {
|
|
72
|
-
server.close();
|
|
73
|
-
await Promise.all([...owned, scratch].map(path => rm(path, { recursive: true, force: true })));
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
//# sourceMappingURL=sandbox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox.js","sourceRoot":"","sources":["../../../../../../src/runtime/daimon/training/native/child/sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACxF,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,eAAe,EAA6B,MAAM,qBAAqB,CAAC;AACpJ,OAAO,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC;AAGhD,6FAA6F;AAC7F,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,MAA4B,EAAE,OAAe,EAAE,cAAiC,EAAE,MAAmB,EAC5I,SAAkC;IAClC,IAAI,YAAY,CAAC,MAAM,CAAC;QAAE,OAAO,mBAAmB,CAAC,MA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SAAS,EAAE,KAAK;SACvL,CAAC,CAAC;QACH,IAAI,MAAM,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,wBAAwB;YAAE,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;QACvI,MAAM,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,8BAA8B,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,6DAA6D;YACrJ,OAAO,EAAE,YAAY,EAAE,MAAM,CAAC,YAAY,EAAE,gBAAgB,EAAE,OAAO,CAAC,gBAAgB,EAAE,cAAc,EAAE,CAAC,EAAE,kBAAkB,EAAE,IAAI,EAAE,oBAAoB,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;IAC1N,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAAC,MAAM,IAAI,KAAK,CAAC,oDAAoD,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAAC,CAAC;YACpG,CAAC;QAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAAC,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,EAAE,OAAO,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAAC,CAAC;AAC7H,CAAC"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { NativeChildExternalInputs } from '../index.js';
|
|
2
|
-
import type { VerifiedNativeLaunch } from '../receipt/index.js';
|
|
3
|
-
import type { GrokSlotFreshnessStore } from '../../services/index.js';
|
|
4
|
-
export interface NativeChildExecution {
|
|
5
|
-
kind: 'child-process';
|
|
6
|
-
externalInputs?: NativeChildExternalInputs;
|
|
7
|
-
/** Caller-owned staging only; the package does not import subscription credentials. */
|
|
8
|
-
/** Required for Grok launches: the experiment's persisted slot recycle freshness (nonce and generation floor). */
|
|
9
|
-
grokSlots?: GrokSlotFreshnessStore;
|
|
10
|
-
prepare?(context: {
|
|
11
|
-
launch: VerifiedNativeLaunch;
|
|
12
|
-
trialId: string;
|
|
13
|
-
signal: AbortSignal;
|
|
14
|
-
}): Promise<void>;
|
|
15
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../src/runtime/daimon/training/native/child/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { type VerifiedNativeLaunch } from '../receipt/index.js';
|
|
2
|
-
export interface DockerResult {
|
|
3
|
-
code: number;
|
|
4
|
-
stdout: string;
|
|
5
|
-
stderr: string;
|
|
6
|
-
}
|
|
7
|
-
export type DockerCommand = (args: string[], options?: {
|
|
8
|
-
signal?: AbortSignal;
|
|
9
|
-
timeoutMs?: number;
|
|
10
|
-
stdin?: string;
|
|
11
|
-
}) => Promise<DockerResult>;
|
|
12
|
-
export interface ContainerInspection {
|
|
13
|
-
Id: string;
|
|
14
|
-
State: {
|
|
15
|
-
Running: boolean;
|
|
16
|
-
Status: string;
|
|
17
|
-
ExitCode: number;
|
|
18
|
-
};
|
|
19
|
-
Config: {
|
|
20
|
-
Labels?: Record<string, string>;
|
|
21
|
-
Image: string;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
export declare const ownerLabel = "training.daimon-native.owner";
|
|
25
|
-
export declare const trialLabel = "training.daimon-native.trial";
|
|
26
|
-
export declare function dockerCommand(command?: string): DockerCommand;
|
|
27
|
-
export declare function createContainerArguments(launch: VerifiedNativeLaunch, name: string, owner: string, trialId: string, timeoutMs: number, user?: string): string[];
|
|
28
|
-
export declare function inspectOwned(run: DockerCommand, name: string, owner: string): Promise<ContainerInspection | undefined>;
|
|
29
|
-
export declare function workerRequest<T>(run: DockerCommand, name: string, path: string, body?: unknown, timeoutMs?: number, signal?: AbortSignal, port?: number, tokenFile?: string): Promise<T>;
|