spawnfile 0.1.33 → 0.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/auth/trainingAuth.d.ts +2 -5
- package/dist/cli/devCommands.d.ts +1 -1
- package/dist/cli/devCommands.js +0 -66
- package/dist/cli/runCli.d.ts +1 -4
- package/dist/cli/runCli.js +2 -2
- package/dist/cli/trainCommand.js +9 -15
- package/dist/cli/trainingBooted.d.ts +7 -0
- package/dist/cli/trainingBooted.js +41 -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 +7 -88
- package/dist/compiler/containerDaimonGatewayRender.d.ts +50 -0
- package/dist/compiler/containerDaimonGatewayRender.js +157 -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 +26 -46
- 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 +1 -0
- package/dist/compiler/runProject.js +9 -3
- package/dist/compiler/runProjectAuth.js +2 -17
- 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/trial/boot.d.ts +53 -0
- package/dist/compiler/training/trial/boot.js +147 -0
- package/dist/compiler/training/trial/docker.d.ts +8 -0
- package/dist/compiler/training/trial/docker.js +22 -0
- package/dist/compiler/training/trial/gateway.d.ts +42 -0
- package/dist/compiler/training/trial/gateway.js +98 -0
- package/dist/compiler/training/trial/index.d.ts +4 -0
- package/dist/compiler/training/trial/index.js +4 -0
- package/dist/compiler/training/trial/launcher.d.ts +32 -0
- package/dist/compiler/training/trial/launcher.js +49 -0
- package/dist/compiler/training/trial/project.d.ts +11 -0
- package/dist/compiler/training/trial/project.js +31 -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/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 +6 -12
- 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 +7 -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 +9 -3
- package/dist/runtime/daimon/subscriptionRealms.js +22 -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 +46 -0
- package/dist/runtime/daimon/training/booted/adapter.js +59 -0
- package/dist/runtime/daimon/training/booted/adapter.js.map +1 -0
- package/dist/runtime/daimon/training/booted/index.d.ts +2 -0
- package/dist/runtime/daimon/training/booted/index.js +2 -0
- package/dist/runtime/daimon/training/booted/index.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/training/providers/codex-subscription/index.js.map +1 -0
- package/dist/runtime/daimon/training/providers/codex-subscription/protocol.js.map +1 -0
- package/dist/runtime/daimon/training/providers/codex-subscription/provider.js.map +1 -0
- package/dist/runtime/daimon/training/providers/codex-subscription/strict-schema.js.map +1 -0
- package/dist/runtime/daimon/training/providers/grok-subscription/cli.d.ts +1 -3
- package/dist/runtime/daimon/training/providers/grok-subscription/cli.js +5 -5
- package/dist/runtime/daimon/training/providers/grok-subscription/cli.js.map +1 -1
- package/dist/runtime/daimon/training/providers/grok-subscription/index.d.ts +1 -2
- package/dist/runtime/daimon/training/providers/grok-subscription/index.js +0 -1
- package/dist/runtime/daimon/training/providers/grok-subscription/index.js.map +1 -1
- package/dist/runtime/daimon/training/providers/grok-subscription/protocol.d.ts +5 -17
- package/dist/runtime/daimon/training/providers/grok-subscription/protocol.js +18 -31
- package/dist/runtime/daimon/training/providers/grok-subscription/protocol.js.map +1 -1
- package/dist/runtime/daimon/training/providers/grok-subscription/provider.js +1 -2
- package/dist/runtime/daimon/training/providers/grok-subscription/provider.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 +1 -1
- package/dist/runtime/trainingProviders.d.ts +1 -2
- package/dist/runtime/trainingProviders.js +9 -19
- 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/shared/errors.js +0 -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.js.map +0 -1
- package/dist/runtime/codex-exec/training/providers/codex-subscription/protocol.js.map +0 -1
- 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.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/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
- /package/dist/runtime/{codex-exec → daimon}/training/providers/codex-subscription/index.d.ts +0 -0
- /package/dist/runtime/{codex-exec → daimon}/training/providers/codex-subscription/index.js +0 -0
- /package/dist/runtime/{codex-exec → daimon}/training/providers/codex-subscription/protocol.d.ts +0 -0
- /package/dist/runtime/{codex-exec → daimon}/training/providers/codex-subscription/protocol.js +0 -0
- /package/dist/runtime/{codex-exec → daimon}/training/providers/codex-subscription/provider.d.ts +0 -0
- /package/dist/runtime/{codex-exec → daimon}/training/providers/codex-subscription/provider.js +0 -0
- /package/dist/runtime/{codex-exec → daimon}/training/providers/codex-subscription/strict-schema.d.ts +0 -0
- /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,WAAW,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAClF,OAAO,EAAE,yBAAyB,EAAE,6BAA6B,EAAE,MAAM,sBAAsB,CAAC;AAChG,OAAO,EAAE,sBAAsB,EAA2B,MAAM,cAAc,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,wBAAwB,EAAE,wBAAwB,EAAE,uBAAuB,EACd,MAAM,sBAAsB,CAAC;AACzH,OAAO,EAAE,eAAe,EAA6B,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAA6B,MAAM,eAAe,CAAC;AAEpG,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAgD,MAAM,mBAAmB,CAAC;AAC/H,OAAO,EAAE,aAAa,EAAE,aAAa,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,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,C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G,CAAC,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":3,"file":"arguments.js","sourceRoot":"","sources":["../../../../../../src/runtime/daimon/training/native/child/arguments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,kCAAkC,CAAC;AACjF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EAAE,wBAAwB,EAAE,eAAe,EAA6B,MAAM,qBAAqB,CAAC;AAE3G,MAAM,UAAU,oBAAoB,CAAC,MAA4B,EAAE,OAAe,EAAE,SAAiB;IACnG,OAAO,CAAC,4BAA4B,EAAE,MAAM,CAAC,SAAS,CA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|
@@ -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;;;;;;;;;;;;;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,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
|
-
}>;
|