spawnfile 0.1.32 → 0.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,20 +0,0 @@
|
|
|
1
|
-
/** Retry observations only: never replay a native acceptance or other mutation. */
|
|
2
|
-
export declare function settleNativeRead<T>(kind: string, read: () => Promise<T>, timeoutMs?: number): Promise<T>;
|
|
3
|
-
export declare function readJson(file: string, kind: string, maximum: number): Promise<unknown>;
|
|
4
|
-
export declare function object(value: unknown): Record<string, unknown>;
|
|
5
|
-
export declare function timestamp(value: unknown): value is string;
|
|
6
|
-
export declare function jsonLines(file: string, kind: string, maximum?: number, maximumLine?: number, settleEmpty?: boolean): Promise<unknown[]>;
|
|
7
|
-
export declare function files(directory: string): Promise<string[]>;
|
|
8
|
-
/**
|
|
9
|
-
* Where a single wake's terminal frame is filed, beside the trial's latest one.
|
|
10
|
-
*
|
|
11
|
-
* `evidence.json` is renamed over on every delivery, so a trial that ran several
|
|
12
|
-
* wakes kept only its last frame and the account of every earlier wake — the
|
|
13
|
-
* assignment that really bound, over a closed trace — was gone by the time
|
|
14
|
-
* anything read it. Each delivery now also files its own frame under its
|
|
15
|
-
* delivery ordinal, which is never reused within a trial, so the frames
|
|
16
|
-
* accumulate instead of replacing one another. Nothing is merged: each file
|
|
17
|
-
* holds exactly one wake's frame and that frame names its own wake.
|
|
18
|
-
*/
|
|
19
|
-
export declare function wakeEvidenceFile(file: string, ordinal: number): string;
|
|
20
|
-
export declare function writeEvidence(file: string, value: unknown): Promise<void>;
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { lstat, readdir, readFile, rename, open } from 'node:fs/promises';
|
|
2
|
-
import { dirname, extname } from 'node:path';
|
|
3
|
-
import { randomUUID } from 'node:crypto';
|
|
4
|
-
import { readPrivateFile } from '../../receipt/index.js';
|
|
5
|
-
const MAX_STREAM = 64 * 1024 * 1024;
|
|
6
|
-
class IncompleteNativeStreamError extends Error {
|
|
7
|
-
}
|
|
8
|
-
/** Retry observations only: never replay a native acceptance or other mutation. */
|
|
9
|
-
export async function settleNativeRead(kind, read, timeoutMs = 1000) {
|
|
10
|
-
const deadline = performance.now() + timeoutMs;
|
|
11
|
-
for (;;) {
|
|
12
|
-
try {
|
|
13
|
-
return await read();
|
|
14
|
-
}
|
|
15
|
-
catch (error) {
|
|
16
|
-
if (!(error instanceof SyntaxError) && !(error instanceof IncompleteNativeStreamError))
|
|
17
|
-
throw error;
|
|
18
|
-
const remaining = deadline - performance.now();
|
|
19
|
-
// SyntaxError messages may contain evidence bytes. Publish only our label.
|
|
20
|
-
if (remaining <= 0) {
|
|
21
|
-
const Failure = error instanceof SyntaxError ? SyntaxError : Error;
|
|
22
|
-
throw new Failure(`Native ${kind} JSON did not settle before deadline (empty, torn, truncated or corrupt)`, { cause: new Error('Native JSON decoding failed') });
|
|
23
|
-
}
|
|
24
|
-
await new Promise(resolve => setTimeout(resolve, Math.min(25, remaining)));
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export async function readJson(file, kind, maximum) {
|
|
29
|
-
return settleNativeRead(kind, async () => JSON.parse(await readPrivateFile(file, maximum)));
|
|
30
|
-
}
|
|
31
|
-
export function object(value) {
|
|
32
|
-
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
33
|
-
throw new Error('Malformed native evidence record');
|
|
34
|
-
return value;
|
|
35
|
-
}
|
|
36
|
-
export function timestamp(value) {
|
|
37
|
-
return typeof value === 'string' && !Number.isNaN(Date.parse(value));
|
|
38
|
-
}
|
|
39
|
-
export async function jsonLines(file, kind, maximum = MAX_STREAM, maximumLine = maximum, settleEmpty = false) {
|
|
40
|
-
let incomplete = false;
|
|
41
|
-
return settleNativeRead(kind, async () => {
|
|
42
|
-
let source;
|
|
43
|
-
try {
|
|
44
|
-
source = await readPrivateFile(file, maximum);
|
|
45
|
-
}
|
|
46
|
-
catch (error) {
|
|
47
|
-
if (error.code !== 'ENOENT')
|
|
48
|
-
throw error;
|
|
49
|
-
if (!incomplete)
|
|
50
|
-
return [];
|
|
51
|
-
throw new IncompleteNativeStreamError('incomplete stream disappeared', { cause: new Error('Native stream unavailable') });
|
|
52
|
-
}
|
|
53
|
-
// An empty append-only ledger is valid before its first row. After observing
|
|
54
|
-
// a torn row it cannot erase that row by temporarily becoming empty.
|
|
55
|
-
if ((incomplete || settleEmpty) && !source || source && !source.endsWith('\n')) {
|
|
56
|
-
incomplete = true;
|
|
57
|
-
throw new IncompleteNativeStreamError('torn final record');
|
|
58
|
-
}
|
|
59
|
-
try {
|
|
60
|
-
return source.split('\n').filter(Boolean).map(line => {
|
|
61
|
-
if (Buffer.byteLength(line, 'utf8') + 1 > maximumLine)
|
|
62
|
-
throw new Error(`Native ${kind} record exceeds its byte bound`);
|
|
63
|
-
return JSON.parse(line);
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
catch (error) {
|
|
67
|
-
incomplete = true;
|
|
68
|
-
throw error;
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
export async function files(directory) {
|
|
73
|
-
try {
|
|
74
|
-
const info = await lstat(directory);
|
|
75
|
-
if (!info.isDirectory() || info.isSymbolicLink())
|
|
76
|
-
throw new Error('Native evidence directory must be real');
|
|
77
|
-
return await readdir(directory);
|
|
78
|
-
}
|
|
79
|
-
catch (error) {
|
|
80
|
-
if (error.code === 'ENOENT')
|
|
81
|
-
return [];
|
|
82
|
-
throw error;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Where a single wake's terminal frame is filed, beside the trial's latest one.
|
|
87
|
-
*
|
|
88
|
-
* `evidence.json` is renamed over on every delivery, so a trial that ran several
|
|
89
|
-
* wakes kept only its last frame and the account of every earlier wake — the
|
|
90
|
-
* assignment that really bound, over a closed trace — was gone by the time
|
|
91
|
-
* anything read it. Each delivery now also files its own frame under its
|
|
92
|
-
* delivery ordinal, which is never reused within a trial, so the frames
|
|
93
|
-
* accumulate instead of replacing one another. Nothing is merged: each file
|
|
94
|
-
* holds exactly one wake's frame and that frame names its own wake.
|
|
95
|
-
*/
|
|
96
|
-
export function wakeEvidenceFile(file, ordinal) {
|
|
97
|
-
if (!Number.isSafeInteger(ordinal) || ordinal < 1)
|
|
98
|
-
throw new Error('Invalid native evidence delivery ordinal');
|
|
99
|
-
const extension = extname(file);
|
|
100
|
-
return `${file.slice(0, file.length - extension.length)}.${ordinal}${extension}`;
|
|
101
|
-
}
|
|
102
|
-
export async function writeEvidence(file, value) {
|
|
103
|
-
const temporary = `${file}.${randomUUID()}.tmp`;
|
|
104
|
-
const handle = await open(temporary, 'wx', 0o600);
|
|
105
|
-
try {
|
|
106
|
-
await handle.writeFile(`${JSON.stringify(value, null, 2)}\n`);
|
|
107
|
-
await handle.sync();
|
|
108
|
-
}
|
|
109
|
-
finally {
|
|
110
|
-
await handle.close();
|
|
111
|
-
}
|
|
112
|
-
await rename(temporary, file);
|
|
113
|
-
const directory = await open(dirname(file), 'r');
|
|
114
|
-
try {
|
|
115
|
-
await directory.sync();
|
|
116
|
-
}
|
|
117
|
-
finally {
|
|
118
|
-
await directory.close();
|
|
119
|
-
}
|
|
120
|
-
let written;
|
|
121
|
-
try {
|
|
122
|
-
written = JSON.parse(await readFile(file, 'utf8'));
|
|
123
|
-
}
|
|
124
|
-
catch {
|
|
125
|
-
throw new Error('Native terminal evidence JSON readback failed');
|
|
126
|
-
}
|
|
127
|
-
if (JSON.stringify(written) !== JSON.stringify(value))
|
|
128
|
-
throw new Error('Native evidence readback differs');
|
|
129
|
-
}
|
|
130
|
-
//# sourceMappingURL=io.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"io.js","sourceRoot":"","sources":["../../../../../../../src/runtime/daimon/training/native/worker/evidence/io.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,MAAM,UAAU,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AACpC,MAAM,2BAA4B,SAAQ,KAAK;CAAG;AAClD,mFAAmF;AACnF,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAI,IAAY,EAAE,IAAsB,EAAE,SAAS,GAAG,IAAI;IAC9F,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,EAAE,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AC,IAAY,EAAE,KAAc;IAC9D,MAAM,SAAS,GAAG,GAAG,IAAI,IAAI,UAAU,EAAE,MAAM,CAAC;IAChD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IAClD,IAAI,CAAC;QAAC,MAAM,MAAM,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;QAAC,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;IAAC,CAAC;YACnF,CAAC;QAAC,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;IAAC,CAAC;IACjC,MAAM,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAC9B,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;IACjD,IAAI,CAAC;QAAC,MAAM,SAAS,CAAC,IAAI,EAAE,CAAC;IAAC,CAAC;YAAS,CAAC;QAAC,MAAM,SAAS,CAAC,KAAK,EAAE,CAAC;IAAC,CAAC;IACpE,IAAI,OAAgB,CAAC;IACrB,IAAI,CAAC;QAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAY,CAAC;IAAC,CAAC;IACtE,MAAM,CAAC;QAAC,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IAAC,CAAC;IAC3E,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;AAC7G,CAAC"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { NativeTurnSeal } from '../types.js';
|
|
2
|
-
/** Unknown members at every level are refused, including protocol-only fields the seal writer omits. */
|
|
3
|
-
export declare function parseNativeTurnSeal(value: unknown, agentId: string, expectedModel: string): NativeTurnSeal;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
import { grokModels } from '../../receipt/index.js';
|
|
3
|
-
import { timestamp } from './io.js';
|
|
4
|
-
// Mirrors Daimon's validated terminal projection, including pre-instrumentation rows.
|
|
5
|
-
// The installed-writer contract test detects drift; product code never loads Daimon internals.
|
|
6
|
-
const count = z.number().int().nonnegative();
|
|
7
|
-
const identifier = z.string().regex(/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/u);
|
|
8
|
-
const callName = z.string().regex(/^(?:<invalid>|<truncated>|[A-Za-z0-9_.-]{1,64})$/u);
|
|
9
|
-
const reason = z.string().min(1).refine(value => Buffer.byteLength(value, 'utf8') <= 768 &&
|
|
10
|
-
[...value].every(character => character.charCodeAt(0) >= 0x20 && character.charCodeAt(0) !== 0x7f));
|
|
11
|
-
const diagnostic = z.strictObject({
|
|
12
|
-
status: z.enum(['prelaunch_failed', 'worker_failed', 'output_failed', 'cancelled']),
|
|
13
|
-
stage: z.enum(['peer', 'request', 'registration', 'executable', 'exec', 'wait', 'output', 'attestation']),
|
|
14
|
-
failure_class: z.enum(['peer', 'protocol', 'registration', 'executable', 'exec', 'wait', 'output_limit', 'cancelled', 'profile_missing', 'profile_invalid']),
|
|
15
|
-
// The terminal protocol accepts signed safe integers here, unlike counters.
|
|
16
|
-
exit_code: z.number().int(), term_signal: z.number().int(), reason: reason.optional(),
|
|
17
|
-
}).refine(row => {
|
|
18
|
-
if (row.status === 'prelaunch_failed') {
|
|
19
|
-
const stages = { peer: 'peer', request: 'protocol', registration: 'registration', executable: 'executable', exec: 'exec' };
|
|
20
|
-
return row.reason === undefined && stages[row.stage] === row.failure_class;
|
|
21
|
-
}
|
|
22
|
-
if (row.status === 'worker_failed' && row.stage === 'attestation') {
|
|
23
|
-
return row.reason === undefined && ['profile_missing', 'profile_invalid'].includes(row.failure_class);
|
|
24
|
-
}
|
|
25
|
-
if (row.status === 'worker_failed')
|
|
26
|
-
return row.stage === 'wait' && ['exec', 'wait'].includes(row.failure_class);
|
|
27
|
-
if (row.status === 'output_failed')
|
|
28
|
-
return row.stage === 'output' && row.failure_class === 'output_limit';
|
|
29
|
-
return row.stage === 'wait' && row.failure_class === 'cancelled';
|
|
30
|
-
});
|
|
31
|
-
const tunnels = z.strictObject({
|
|
32
|
-
opened: count, closed: count, delivered: count,
|
|
33
|
-
open: z.array(z.strictObject({ open_ms: count, delivered: z.boolean() })).max(8),
|
|
34
|
-
}).refine(row => row.closed <= row.opened && row.delivered <= row.opened && row.open.length <= row.opened - row.closed);
|
|
35
|
-
const mcp = z.strictObject({
|
|
36
|
-
started: count, answered: count, undecoded: count,
|
|
37
|
-
outstanding: z.array(z.strictObject({ name: callName, outstanding_ms: count })).max(16),
|
|
38
|
-
refusals: z.strictObject({ route: count, expired: count, exhausted: count, unrouted: count, oversized: count }).optional(),
|
|
39
|
-
tunnels: tunnels.optional(),
|
|
40
|
-
}).refine(row => row.answered <= row.started && row.outstanding.length <= row.started - row.answered);
|
|
41
|
-
const providerClock = z.strictObject({
|
|
42
|
-
requests: count, linesRewritten: count, requestsWithoutDateLine: count, linesIgnored: count.optional(),
|
|
43
|
-
injectedDate: z.string().regex(/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/u).nullable(),
|
|
44
|
-
taskDate: z.string().regex(/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/u).nullable(),
|
|
45
|
-
}).refine(row => row.requestsWithoutDateLine <= row.requests &&
|
|
46
|
-
(row.linesRewritten === 0 || row.requestsWithoutDateLine !== row.requests) &&
|
|
47
|
-
[row.injectedDate, row.taskDate].every(date => row.linesRewritten === 0 ? date === null : date !== null));
|
|
48
|
-
const seal = z.strictObject({
|
|
49
|
-
v: z.literal('noopolis.daimon.turn-seal.v1'), agent: identifier, wake: identifier, engine: z.literal('grok'),
|
|
50
|
-
at: z.string().refine(timestamp), turn: identifier, outcome: z.enum(['completed', 'failed']),
|
|
51
|
-
requests: count.max(1024), model: z.enum(grokModels), limit_reason: z.enum(['tokens', 'requests', 'timeout', 'none']),
|
|
52
|
-
shell_clock: z.enum(['task', 'real', 'gap']).optional(), provider_clock: providerClock.optional(),
|
|
53
|
-
code: z.enum(['auth_stale', 'cancelled', 'engine_failed', 'invalid_request', 'limit_exceeded', 'turn_conflict', 'unavailable']).optional(),
|
|
54
|
-
diagnostic: diagnostic.optional(), mcp: mcp.optional(),
|
|
55
|
-
}).refine(row => row.outcome === 'completed'
|
|
56
|
-
? row.code === undefined && row.diagnostic === undefined && row.mcp === undefined && row.limit_reason === 'none'
|
|
57
|
-
: row.code !== undefined && (row.code === 'limit_exceeded') === (row.limit_reason !== 'none'));
|
|
58
|
-
/** Unknown members at every level are refused, including protocol-only fields the seal writer omits. */
|
|
59
|
-
export function parseNativeTurnSeal(value, agentId, expectedModel) {
|
|
60
|
-
const parsed = seal.safeParse(value);
|
|
61
|
-
if (!parsed.success || parsed.data.agent !== agentId || parsed.data.model !== expectedModel) {
|
|
62
|
-
throw new Error('Native Grok seal schema or execution identity mismatch');
|
|
63
|
-
}
|
|
64
|
-
// Keep writer ordering for the ledger's byte-identical replay/conflict check.
|
|
65
|
-
return value;
|
|
66
|
-
}
|
|
67
|
-
//# sourceMappingURL=seal.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"seal.js","sourceRoot":"","sources":["../../../../../../../src/runtime/daimon/training/native/worker/evidence/seal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEpC,sFAAsF;AACtF,+FAA+F;AAC/F,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,WAAW,EAAE,CAAC;AAC7C,MA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';
|
|
2
|
-
/** Startup validation without starting a worker; importing this subpath never runs one. */
|
|
3
|
-
export { verifyNativeWorkerStartup, parseWorkerArguments, assertNativeProfile, verifyWorkerPaths } from './profile.js';
|
|
4
|
-
export { createWorkerController, executionClosed, validateNativeFrame, claimedExecution, disposedWakeExecution, admittedExecutions, AMBIGUOUS_NATIVE_EXECUTION, AMBIGUOUS_WAKE_EXECUTION } from './control.js';
|
|
5
|
-
export { readToolReceipts, readClosedTraces, collectNativeEvidence, assertFreshNativeEvidence, readSealedGrokUsage, readSealedGrokRequests, readSealedGrokTurnSeals, writeEvidence, wakeEvidenceFile, GROK_TURN_NOTIONAL_USD_MAX, plausibleNotionalUsd, declaredLimitStop } from './evidence/index.js';
|
|
6
|
-
export type { NativeStopEvidence } from './control.js';
|
|
7
|
-
export type { NativeConfig, NativeHost, NativeReceipt, NativeActivity, NativeAvailability, NativeTrace, NativeUsage, NativeCodexUsage, NativeGrokUsage, NativeRequestUsage, NativeTurnSeal, NativeEvidence, NativeEvidenceSource, TerminalEvidence, WorkerOptions } from './types.js';
|
|
8
|
-
export { verifyExternalSource, MAX_EXTERNAL_DELIVERIES, MAX_TRIAL_WAKES, engineWakeTimeoutMs } from './deliveries.js';
|
|
9
|
-
export type { ExternalInputSource, DeliveryControls } from './deliveries.js';
|
|
10
|
-
export { parseTransportSource, matchTransportSource } from './wake-delivery/index.js';
|
|
11
|
-
export type { TransportDeliverySource, TransportRunState, TransportEvidence } from './wake-delivery/index.js';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export { runDaimonNativeWorker } from './worker.js';
|
|
2
|
-
/** Startup validation without starting a worker; importing this subpath never runs one. */
|
|
3
|
-
export { verifyNativeWorkerStartup, parseWorkerArguments, assertNativeProfile, verifyWorkerPaths } from './profile.js';
|
|
4
|
-
export { createWorkerController, executionClosed, validateNativeFrame, claimedExecution, disposedWakeExecution, admittedExecutions, AMBIGUOUS_NATIVE_EXECUTION, AMBIGUOUS_WAKE_EXECUTION } from './control.js';
|
|
5
|
-
export { readToolReceipts, readClosedTraces, collectNativeEvidence, assertFreshNativeEvidence, readSealedGrokUsage, readSealedGrokRequests, readSealedGrokTurnSeals, writeEvidence, wakeEvidenceFile, GROK_TURN_NOTIONAL_USD_MAX, plausibleNotionalUsd, declaredLimitStop } from './evidence/index.js';
|
|
6
|
-
export { verifyExternalSource, MAX_EXTERNAL_DELIVERIES, MAX_TRIAL_WAKES, engineWakeTimeoutMs } from './deliveries.js';
|
|
7
|
-
export { parseTransportSource, matchTransportSource } from './wake-delivery/index.js';
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/runtime/daimon/training/native/worker/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,2FAA2F;AAC3F,OAAO,EAAE,yBAAyB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACvH,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,kBAAkB,EAChI,0BAA0B,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,aAAa,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAKvS,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAEtH,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { type NativeLaunch } from '../receipt/index.js';
|
|
2
|
-
import type { NativeConfig, WorkerOptions } from './types.js';
|
|
3
|
-
export declare function parseWorkerArguments(args: readonly string[]): WorkerOptions;
|
|
4
|
-
export declare function assertNativeProfile(config: NativeConfig, launch: NativeLaunch): void;
|
|
5
|
-
export declare function verifyWorkerPaths(config: NativeConfig, options: WorkerOptions, launch: NativeLaunch): Promise<void>;
|
|
6
|
-
/**
|
|
7
|
-
* The worker's own startup validation, run without starting anything.
|
|
8
|
-
*
|
|
9
|
-
* Preparation can check exactly what the worker checks — argument shape, the
|
|
10
|
-
* compiled-config digest, the launch receipt, the profile agreement and the
|
|
11
|
-
* control path rules — instead of reaching past the package export for the
|
|
12
|
-
* pieces. Daimon's own `parseOrganizationRuntimeConfig` is the single step left
|
|
13
|
-
* out: it needs the installed runtime peer, so this validates Training's side of
|
|
14
|
-
* startup and never claims to have validated Daimon's.
|
|
15
|
-
*
|
|
16
|
-
* It composes the same exported functions the worker calls, in the worker's
|
|
17
|
-
* order, so a rule cannot hold here and fail there.
|
|
18
|
-
*/
|
|
19
|
-
export declare function verifyNativeWorkerStartup(args: readonly string[]): Promise<{
|
|
20
|
-
options: WorkerOptions;
|
|
21
|
-
launch: NativeLaunch;
|
|
22
|
-
config: NativeConfig;
|
|
23
|
-
}>;
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { lstat, realpath } from 'node:fs/promises';
|
|
2
|
-
import { isAbsolute, join } from 'node:path';
|
|
3
|
-
import { isGrokLaunch, parseNativeLaunch, readPrivateFile, sha256, within } from '../receipt/index.js';
|
|
4
|
-
export function parseWorkerArguments(args) {
|
|
5
|
-
const keys = ['launch', 'config', 'config-sha256', 'control-root', 'token-file', 'evidence', 'trial-id', 'timeout-ms', 'schedule-override'];
|
|
6
|
-
const values = new Map();
|
|
7
|
-
for (let index = 0; index < args.length; index += 2) {
|
|
8
|
-
const key = args[index]?.slice(2);
|
|
9
|
-
const value = args[index + 1];
|
|
10
|
-
if (!args[index]?.startsWith('--') || !key || !keys.includes(key) || values.has(key) || !value) {
|
|
11
|
-
throw new Error('Worker arguments require one explicit value for each supported option');
|
|
12
|
-
}
|
|
13
|
-
values.set(key, value);
|
|
14
|
-
}
|
|
15
|
-
if (keys.some(key => !values.has(key)))
|
|
16
|
-
throw new Error(`Required worker options: ${keys.join(', ')}`);
|
|
17
|
-
const timeoutMs = Number(values.get('timeout-ms'));
|
|
18
|
-
if (!Number.isSafeInteger(timeoutMs) || timeoutMs < 100 || timeoutMs > 86_400_000)
|
|
19
|
-
throw new Error('Invalid worker timeout');
|
|
20
|
-
const configSha256 = values.get('config-sha256');
|
|
21
|
-
if (!/^[a-f0-9]{64}$/u.test(configSha256))
|
|
22
|
-
throw new Error('Expected config SHA-256 is required');
|
|
23
|
-
if (values.get('schedule-override') !== 'disabled')
|
|
24
|
-
throw new Error('Explicit isolated schedule override is required');
|
|
25
|
-
const result = { launch: values.get('launch'), config: values.get('config'), configSha256,
|
|
26
|
-
controlRoot: values.get('control-root'), tokenFile: values.get('token-file'), evidence: values.get('evidence'),
|
|
27
|
-
trialId: values.get('trial-id'), timeoutMs, scheduleOverride: 'disabled' };
|
|
28
|
-
for (const value of [result.launch, result.config, result.controlRoot, result.tokenFile, result.evidence]) {
|
|
29
|
-
if (!isAbsolute(value))
|
|
30
|
-
throw new Error('Worker paths must be absolute');
|
|
31
|
-
}
|
|
32
|
-
if (!/^[A-Za-z0-9][A-Za-z0-9._:-]{0,127}$/u.test(result.trialId))
|
|
33
|
-
throw new Error('Invalid trial identity');
|
|
34
|
-
if (!within(result.controlRoot, result.evidence) || result.evidence === result.controlRoot)
|
|
35
|
-
throw new Error('Terminal evidence must be inside the protected control root');
|
|
36
|
-
return result;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Whether the config's declared Mneme root is one the launch actually admits.
|
|
40
|
-
*
|
|
41
|
-
* Codex answers it with its own fresh `memory` projection, which
|
|
42
|
-
* `loadNativeLaunch` validated as separate, non-overlapping trial data.
|
|
43
|
-
*
|
|
44
|
-
* A Grok launch admits exactly one projection — the slot runtime home — so the
|
|
45
|
-
* only placement it can offer is inside that home, and containment rather than
|
|
46
|
-
* exact match is what admits it. That is safe because the question here is
|
|
47
|
-
* different from the caller-protected-path exemption, which stayed exact-match:
|
|
48
|
-
* there, a descendant rule would *subtract* protection from an evaluator-owned
|
|
49
|
-
* file the subject must not read. Here nothing is subtracted. The home
|
|
50
|
-
* projection is already wholly writable, wholly inside the subject's reach and
|
|
51
|
-
* digest-bound as the projection's `runtimeHomePath`, so a root inside it adds
|
|
52
|
-
* no path, no writability and no reachability the launch did not already grant,
|
|
53
|
-
* and it inherits the home's freshness (the slot supervisor's recycle wipes the
|
|
54
|
-
* runtime home whole). A root outside the home is a root no projection admits
|
|
55
|
-
* and no digest covers, and stays refused; so does the home itself, which would
|
|
56
|
-
* make Mneme's store the runtime home rather than a place inside it.
|
|
57
|
-
*/
|
|
58
|
-
const nativeMemoryAdmitted = (launch, home, memory) => (isGrokLaunch(launch)
|
|
59
|
-
? memory !== home && within(home, memory)
|
|
60
|
-
: launch.projections.some(row => row.role === 'memory' && row.target === memory));
|
|
61
|
-
export function assertNativeProfile(config, launch) {
|
|
62
|
-
const agent = config.agents[0];
|
|
63
|
-
if (config.version !== 'noopolis.daimon.organization-runtime.v2' || config.agents.length !== 1 || agent?.id !== launch.agent.id) {
|
|
64
|
-
throw new Error('Native config must contain exactly the selected agent');
|
|
65
|
-
}
|
|
66
|
-
if (isGrokLaunch(launch)) {
|
|
67
|
-
if (agent.engine.kind !== 'grok' || agent.engine.model !== launch.agent.model || agent.engine.reasoningEffort !== launch.agent.reasoningEffort) {
|
|
68
|
-
throw new Error('Only the declared Grok model and reasoning effort are supported');
|
|
69
|
-
}
|
|
70
|
-
if (agent.engine.codexSandbox !== undefined)
|
|
71
|
-
throw new Error('Grok broker trials cannot declare a Codex sandbox');
|
|
72
|
-
if (launch.broker.limits.maxTokens > launch.limits.wakeTokenCeiling)
|
|
73
|
-
throw new Error('Grok broker token limit exceeds the launch wake ceiling');
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
if (agent.engine.kind !== 'codex' || agent.engine.model !== launch.agent.model)
|
|
77
|
-
throw new Error('Only the declared Codex model is supported');
|
|
78
|
-
const sandbox = agent.engine.codexSandbox;
|
|
79
|
-
if (!sandbox || sandbox.mode !== 'workspace-write' || sandbox.networkAccess !== false || sandbox.webSearch !== 'disabled') {
|
|
80
|
-
throw new Error('Native trials require the Codex workspace-no-network sandbox');
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
if (!agent.attention)
|
|
84
|
-
throw new Error('Native trials require durable attention admission');
|
|
85
|
-
if (agent.schedule?.kind !== 'disabled')
|
|
86
|
-
throw new Error('The receipted isolated schedule override must be applied');
|
|
87
|
-
if (config.host.bindHost !== launch.host.bindHost || config.host.port !== launch.host.port)
|
|
88
|
-
throw new Error('Native host differs from the declared loopback endpoint');
|
|
89
|
-
const home = launch.projections.find(row => row.role === 'home');
|
|
90
|
-
if (!home || agent.workspacePath !== launch.workspace.target || agent.runtimeHomePath !== home.target) {
|
|
91
|
-
throw new Error('Native workspace or home projection identity mismatch');
|
|
92
|
-
}
|
|
93
|
-
if (agent.memory && !nativeMemoryAdmitted(launch, home.target, agent.memory.runtimeHomePath)) {
|
|
94
|
-
throw new Error(isGrokLaunch(launch)
|
|
95
|
-
? 'Grok Mneme state must be declared inside the single projected runtime home'
|
|
96
|
-
: 'Native Mneme state requires its declared fresh memory projection');
|
|
97
|
-
}
|
|
98
|
-
if (launch.limits.maxTokens > agent.attention.maxTokens)
|
|
99
|
-
throw new Error('Trial token budget exceeds native attention policy');
|
|
100
|
-
}
|
|
101
|
-
export async function verifyWorkerPaths(config, options, launch) {
|
|
102
|
-
const agent = config.agents[0];
|
|
103
|
-
for (const file of [options.launch, options.config, options.tokenFile]) {
|
|
104
|
-
if ((await realpath(file)) !== file)
|
|
105
|
-
throw new Error('Worker control files must not traverse symlinks');
|
|
106
|
-
if (within(agent.workspacePath, file))
|
|
107
|
-
throw new Error('Worker controls must be outside the writable workspace');
|
|
108
|
-
}
|
|
109
|
-
if (within(agent.workspacePath, options.controlRoot) || within(options.controlRoot, agent.workspacePath))
|
|
110
|
-
throw new Error('The protected control root must be separate from the workspace');
|
|
111
|
-
const entry = await lstat(options.controlRoot);
|
|
112
|
-
if (!entry.isDirectory() || entry.isSymbolicLink() || (entry.mode & 0o077) !== 0 || await realpath(options.controlRoot) !== options.controlRoot) {
|
|
113
|
-
throw new Error('The control root must be a private real directory');
|
|
114
|
-
}
|
|
115
|
-
if (((await lstat(options.tokenFile)).mode & 0o077) !== 0)
|
|
116
|
-
throw new Error('The control token file must be private');
|
|
117
|
-
const instructions = await readPrivateFile(join(agent.workspacePath, launch.instructions.relativePath));
|
|
118
|
-
const rendering = launch.instructions.rendering;
|
|
119
|
-
const nativeInstructions = rendering.prefix + instructions.trim() + rendering.suffix;
|
|
120
|
-
if (!instructions.trim() || sha256(instructions) !== launch.instructions.sha256 || agent.instructions !== nativeInstructions ||
|
|
121
|
-
sha256(agent.instructions) !== rendering.nativeSha256) {
|
|
122
|
-
throw new Error('Declared candidate bytes are absent from the compiled native instructions');
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* The worker's own startup validation, run without starting anything.
|
|
127
|
-
*
|
|
128
|
-
* Preparation can check exactly what the worker checks — argument shape, the
|
|
129
|
-
* compiled-config digest, the launch receipt, the profile agreement and the
|
|
130
|
-
* control path rules — instead of reaching past the package export for the
|
|
131
|
-
* pieces. Daimon's own `parseOrganizationRuntimeConfig` is the single step left
|
|
132
|
-
* out: it needs the installed runtime peer, so this validates Training's side of
|
|
133
|
-
* startup and never claims to have validated Daimon's.
|
|
134
|
-
*
|
|
135
|
-
* It composes the same exported functions the worker calls, in the worker's
|
|
136
|
-
* order, so a rule cannot hold here and fail there.
|
|
137
|
-
*/
|
|
138
|
-
export async function verifyNativeWorkerStartup(args) {
|
|
139
|
-
const options = parseWorkerArguments(args);
|
|
140
|
-
const launch = parseNativeLaunch(JSON.parse(await readPrivateFile(options.launch, 65_536)));
|
|
141
|
-
const bytes = await readPrivateFile(options.config);
|
|
142
|
-
if (sha256(bytes) !== options.configSha256 || launch.configSha256 !== options.configSha256)
|
|
143
|
-
throw new Error('Compiled native config digest mismatch');
|
|
144
|
-
const config = JSON.parse(bytes);
|
|
145
|
-
assertNativeProfile(config, launch);
|
|
146
|
-
await verifyWorkerPaths(config, options, launch);
|
|
147
|
-
return { options, launch, config };
|
|
148
|
-
}
|
|
149
|
-
//# sourceMappingURL=profile.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../../../../../src/runtime/daimon/training/native/worker/profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,EAAqB,MAAM,qBAAqB,CAAC;AAG1H,MAAM,UAAU,oBAAoB,CAAC,IAAuB;IAC1D,MAAM,IAAI,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,mBAAmB,CAAC,CAAC;IAC5I,MAAM,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IACzC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QACpD,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;QAClC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QAC9B,IAAI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AAC;IACjD,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,MAAM,iBAAiB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACjD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AACrC,CAAC"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { NativeConfig, NativeHost } from './types.js';
|
|
2
|
-
import type { NativeSandboxProjection } from '../receipt/index.js';
|
|
3
|
-
import type { NativeWakeRequest } from './wake-delivery/index.js';
|
|
4
|
-
/** Grok projection options passed to Daimon verbatim from the launch receipt's broker section. */
|
|
5
|
-
export interface GrokBrokerProjectionOptions {
|
|
6
|
-
workerConfigVariant: 'unclocked' | 'clocked';
|
|
7
|
-
slot: number;
|
|
8
|
-
workerUid: number;
|
|
9
|
-
workerHomePath: string;
|
|
10
|
-
architecture: 'arm64' | 'x64';
|
|
11
|
-
usageLedgerPath: string;
|
|
12
|
-
limits: {
|
|
13
|
-
maxRequests: number;
|
|
14
|
-
maxTokens: number;
|
|
15
|
-
timeoutMs: number;
|
|
16
|
-
};
|
|
17
|
-
acceptanceStorePath: string;
|
|
18
|
-
denyPaths: readonly string[];
|
|
19
|
-
seccompProfileSha256: string;
|
|
20
|
-
/** The provisioner's sandbox profile digest; Daimon refuses a value that differs from its own render. */
|
|
21
|
-
profileSha256: string;
|
|
22
|
-
}
|
|
23
|
-
/** Structural public seam keeps the optional runtime out of Training core installs. */
|
|
24
|
-
export interface NativeRuntimeModule {
|
|
25
|
-
parseWakeAcceptanceRequest?(value: unknown): NativeWakeRequest;
|
|
26
|
-
parseOrganizationRuntimeConfig(value: unknown): NativeConfig;
|
|
27
|
-
createOrganizationRuntimeControlHost(value: unknown, options: {
|
|
28
|
-
acceptanceStorePath: string;
|
|
29
|
-
controlToken: string;
|
|
30
|
-
subscriptionRealmPaths?: {
|
|
31
|
-
codex: {
|
|
32
|
-
durablePath: string;
|
|
33
|
-
bootstrapPath: string;
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
}): NativeHost;
|
|
37
|
-
resolveOrganizationCodexSandboxProjection(value: unknown, agentId: string, options: {
|
|
38
|
-
acceptanceStorePath: string;
|
|
39
|
-
subscriptionRealmPaths?: {
|
|
40
|
-
codex: {
|
|
41
|
-
durablePath: string;
|
|
42
|
-
bootstrapPath: string;
|
|
43
|
-
};
|
|
44
|
-
};
|
|
45
|
-
}): Promise<NativeSandboxProjection>;
|
|
46
|
-
resolveOrganizationGrokBrokerProjection?(value: unknown, agentId: string, options: GrokBrokerProjectionOptions): unknown;
|
|
47
|
-
grokBrokerProjectionSha256?(projection: unknown): string;
|
|
48
|
-
verifyGrokSlotPreflightReceipt?(value: unknown, projection: unknown, freshness: {
|
|
49
|
-
expectedNonce: string;
|
|
50
|
-
minGeneration: number;
|
|
51
|
-
}): unknown;
|
|
52
|
-
}
|
|
53
|
-
export declare function loadDaimonRuntime(engine?: 'codex' | 'grok', _delivery?: 'direct' | 'transport'): Promise<NativeRuntimeModule>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
const grokExports = ['resolveOrganizationGrokBrokerProjection', 'grokBrokerProjectionSha256', 'verifyGrokSlotPreflightReceipt'];
|
|
2
|
-
export async function loadDaimonRuntime(engine = 'codex', _delivery = 'direct') {
|
|
3
|
-
const packageName = '@noopolis/daimon/runtime';
|
|
4
|
-
let loaded;
|
|
5
|
-
try {
|
|
6
|
-
loaded = await import(packageName);
|
|
7
|
-
}
|
|
8
|
-
catch (error) {
|
|
9
|
-
throw new Error('Install optional @noopolis/daimon with its public /runtime export', { cause: error });
|
|
10
|
-
}
|
|
11
|
-
if (typeof loaded['parseOrganizationRuntimeConfig'] !== 'function' || typeof loaded['createOrganizationRuntimeControlHost'] !== 'function') {
|
|
12
|
-
throw new Error('Installed Daimon lacks the native organization control host');
|
|
13
|
-
}
|
|
14
|
-
if (engine === 'grok') {
|
|
15
|
-
if (grokExports.some(name => typeof loaded[name] !== 'function'))
|
|
16
|
-
throw new Error('Installed Daimon lacks the Grok broker projection and slot preflight capability');
|
|
17
|
-
}
|
|
18
|
-
else if (typeof loaded['resolveOrganizationCodexSandboxProjection'] !== 'function')
|
|
19
|
-
throw new Error('Installed Daimon lacks exact native sandbox projection capability');
|
|
20
|
-
return loaded;
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=public.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../../../../../src/runtime/daimon/training/native/worker/public.ts"],"names":[],"mappings":"AA0BA,MAAM,WAAW,GAAG,CAAC,yCAAyC,EAAE,4BAA4B,EAAE,gCAAgC,CAAU,CAAC;AAEzI,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,SAA2B,OAAO,EAAE,YAAoC,QAAQ;IACtH,MAAM,WAAW,GAAG,0BAA0B,CAAC;IAC/C,IAAI,MAA+B,CAAC;IACpC,IAAI,CAAC;QAAC,MAAM,GAAG,MAAM,MAAM,CAAC,WAAW,CAA4B,CAAC;IAAC,CAAC;IACtE,OAAO,KAAK,EAAE,CAAC;QAAC,MAAM,IAAI,KAAK,CAAC,mEAAmE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IAAC,CAAC;IACzH,IAAI,OAAO,MAAM,CAAC,gCAAgC,CAAC,KAAK,UAAU,IAAI,OAAO,MAAM,CAAC,sCAAsC,CAAC,KAAK,UAAU,EAAE,CAAC;QAC3I,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;IACjF,CAAC;IACD,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,UAAU,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,iFAAiF,CAAC,CAAC;IACvK,CAAC;SAAM,IAAI,OAAO,MAAM,CAAC,2CAA2C,CAAC,KAAK,UAAU;QAAE,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAC;IAC3K,OAAO,MAAwC,CAAC;AAClD,CAAC"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { type NativeLaunch } from '../receipt/index.js';
|
|
2
|
-
import type { NativeRuntimeModule } from './public.js';
|
|
3
|
-
import type { NativeConfig, WorkerOptions } from './types.js';
|
|
4
|
-
export declare function persistNativeSandboxProjection(runtime: NativeRuntimeModule, config: NativeConfig, options: WorkerOptions, launch?: NativeLaunch): Promise<void>;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { writeFile } from 'node:fs/promises';
|
|
2
|
-
import { join } from 'node:path';
|
|
3
|
-
import { bindGrokBrokerProjection, bindNativeSandboxProjection, grokBrokerProjectionSchema, grokProjectionSha256, isGrokLaunch, nativeCodexAccount, nativeTrialArtifactsRoot, parseGrokBrokerReceipt, parseNativeSandboxReceipt, readPrivateFile } from '../receipt/index.js';
|
|
4
|
-
export async function persistNativeSandboxProjection(runtime, config, options, launch) {
|
|
5
|
-
if (launch && isGrokLaunch(launch))
|
|
6
|
-
return persistGrokBrokerProjection(runtime, config, options, launch);
|
|
7
|
-
const agent = config.agents[0];
|
|
8
|
-
const account = launch && nativeCodexAccount(launch);
|
|
9
|
-
const value = await runtime.resolveOrganizationCodexSandboxProjection(config, agent.id, { acceptanceStorePath: options.controlRoot,
|
|
10
|
-
...(account ? { subscriptionRealmPaths: { codex: { durablePath: account.realm.target, bootstrapPath: account.bootstrap.target } } } : {}) });
|
|
11
|
-
const receipt = bindNativeSandboxProjection(value, options.trialId, options.configSha256);
|
|
12
|
-
parseNativeSandboxReceipt(receipt, { trialId: options.trialId, configSha256: options.configSha256,
|
|
13
|
-
agentId: agent.id, workspacePath: agent.workspacePath, runtimeHomePath: agent.runtimeHomePath });
|
|
14
|
-
const artifacts = launch ? nativeTrialArtifactsRoot(launch, options.trialId) : options.controlRoot;
|
|
15
|
-
await writeFile(join(artifacts, 'sandbox-projection.json'), `${JSON.stringify(receipt)}\n`, { flag: 'wx', mode: 0o600 });
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* Grok never runs a `codex sandbox` probe. Daimon resolves the slot projection
|
|
19
|
-
* from the launch's broker inputs; its digest must equal the launch receipt and
|
|
20
|
-
* Daimon's own digest, and the root supervisor's slot preflight receipt must
|
|
21
|
-
* verify against it (Daimon's verifier) and deny every evaluator root.
|
|
22
|
-
*/
|
|
23
|
-
async function persistGrokBrokerProjection(runtime, config, options, launch) {
|
|
24
|
-
const { resolveOrganizationGrokBrokerProjection: resolve, grokBrokerProjectionSha256: digest, verifyGrokSlotPreflightReceipt: verify } = runtime;
|
|
25
|
-
if (!resolve || !digest || !verify)
|
|
26
|
-
throw new Error('Installed Daimon lacks the Grok broker projection and slot preflight capability');
|
|
27
|
-
const agent = config.agents[0];
|
|
28
|
-
const { broker } = launch;
|
|
29
|
-
const projection = grokBrokerProjectionSchema.parse(resolve(config, agent.id, { slot: broker.slot, workerUid: broker.workerUid,
|
|
30
|
-
workerConfigVariant: broker.workerConfigVariant,
|
|
31
|
-
workerHomePath: broker.workerHomePath, architecture: broker.architecture, usageLedgerPath: broker.usageLedgerPath, limits: broker.limits,
|
|
32
|
-
// The deny mask Daimon lifts, and the value `projection_sha256` binds: never the per-trial artifact directory inside it.
|
|
33
|
-
// `denyPaths` and `profileSha256` are the provisioner's verbatim values (see grokBrokerLaunchSchema): deriving the deny
|
|
34
|
-
// list from `evaluatorPaths` recomputes a different set and forks the digest.
|
|
35
|
-
acceptanceStorePath: options.controlRoot, denyPaths: [...broker.denyPaths],
|
|
36
|
-
seccompProfileSha256: broker.seccompProfileSha256, profileSha256: broker.profileSha256 }));
|
|
37
|
-
const sha = grokProjectionSha256(projection);
|
|
38
|
-
if (digest(projection) !== sha)
|
|
39
|
-
throw new Error('Training and Daimon disagree on the Grok broker projection digest');
|
|
40
|
-
if (projection.version !== broker.projectionVersion || sha !== broker.projectionSha256)
|
|
41
|
-
throw new Error('Grok broker projection digest differs from the launch receipt');
|
|
42
|
-
// The registration is a ceiling. worker.ts lowers the per-wake override to the trial deadline.
|
|
43
|
-
let slot;
|
|
44
|
-
try {
|
|
45
|
-
slot = JSON.parse(await readPrivateFile(broker.slotPreflightReceipt, 262144));
|
|
46
|
-
}
|
|
47
|
-
catch (error) {
|
|
48
|
-
throw new Error('Grok subject turns require the root slot supervisor preflight receipt', { cause: error });
|
|
49
|
-
}
|
|
50
|
-
const verified = verify(slot, projection, { expectedNonce: broker.expectedNonce, minGeneration: broker.minGeneration });
|
|
51
|
-
const receipt = parseGrokBrokerReceipt(bindGrokBrokerProjection(projection, verified, options.trialId, options.configSha256), launch, options.trialId);
|
|
52
|
-
await writeFile(join(nativeTrialArtifactsRoot(launch, options.trialId), 'sandbox-projection.json'), `${JSON.stringify(receipt)}\n`, { flag: 'wx', mode: 0o600 });
|
|
53
|
-
}
|
|
54
|
-
//# sourceMappingURL=sandbox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox.js","sourceRoot":"","sources":["../../../../../../src/runtime/daimon/training/native/worker/sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,YAAY,EAC5H,kBAAkB,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,eAAe,EACtE,MAAM,qBAAqB,CAAC;AAIxE,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAAC,OAA4B,EAAE,MAAoB,EAAE,OAAsB,EAAE,MAAqB;IACpJ,IAAI,MAAM,IAAI,YAAY,CAAC,MAAM,CAAC;QAAE,OAAO,2BAA2B,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,CA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