spawnfile 0.1.33 → 0.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/audit/readAudit.d.ts +3 -3
- package/dist/auth/profileStore.d.ts +3 -1
- package/dist/auth/profileStore.js +31 -30
- package/dist/auth/trainingAuth.d.ts +2 -5
- package/dist/auth/types.d.ts +16 -0
- package/dist/cli/authCommands.d.ts +1 -1
- package/dist/cli/authCommands.js +21 -1
- package/dist/cli/devCommands.d.ts +1 -1
- package/dist/cli/devCommands.js +0 -66
- package/dist/cli/runCli.d.ts +3 -4
- package/dist/cli/runCli.js +4 -3
- package/dist/cli/trainCommand.js +9 -15
- package/dist/cli/trainingBooted.d.ts +9 -0
- package/dist/cli/trainingBooted.js +45 -0
- package/dist/cli/trainingExecution.d.ts +4 -7
- package/dist/cli/trainingExecution.js +4 -32
- package/dist/compiler/containerArtifacts.js +0 -5
- package/dist/compiler/containerBackedMountRender.js +5 -1
- package/dist/compiler/containerDaimonBrokerRender.d.ts +5 -50
- package/dist/compiler/containerDaimonBrokerRender.js +19 -90
- package/dist/compiler/containerDaimonGatewayRender.d.ts +50 -0
- package/dist/compiler/containerDaimonGatewayRender.js +161 -0
- package/dist/compiler/containerDaimonGrokWorkerProvisioning.d.ts +2 -10
- package/dist/compiler/containerDaimonGrokWorkerProvisioning.js +13 -25
- package/dist/compiler/containerDaimonGrokWorkerRender.d.ts +11 -49
- package/dist/compiler/containerDaimonGrokWorkerRender.js +15 -39
- package/dist/compiler/containerDaimonStartupSupervision.d.ts +8 -0
- package/dist/compiler/containerDaimonStartupSupervision.js +39 -0
- package/dist/compiler/containerDaimonUidEntrypointRender.d.ts +1 -2
- package/dist/compiler/containerDaimonUidEntrypointRender.js +29 -47
- package/dist/compiler/containerRuntimeReadinessRender.js +1 -1
- package/dist/compiler/memoryArtifacts.js +0 -1
- package/dist/compiler/moltnetArtifacts.js +1 -17
- package/dist/compiler/moltnetClientConfig.js +1 -1
- package/dist/compiler/moltnetRuntimeConfig.js +0 -10
- package/dist/compiler/runProject.d.ts +3 -0
- package/dist/compiler/runProject.js +12 -5
- package/dist/compiler/runProjectAuth.js +6 -18
- package/dist/compiler/training/contract.d.ts +0 -2
- package/dist/compiler/training/contract.js +0 -2
- package/dist/compiler/training/execution.d.ts +1 -128
- package/dist/compiler/training/execution.js +7 -68
- package/dist/compiler/training/index.d.ts +0 -8
- package/dist/compiler/training/index.js +0 -7
- package/dist/compiler/training/output.d.ts +1 -0
- package/dist/compiler/training/output.js +1 -1
- package/dist/compiler/training/rewind/contract.d.ts +6 -6
- package/dist/compiler/training/trial/boot.d.ts +72 -0
- package/dist/compiler/training/trial/boot.js +225 -0
- package/dist/compiler/training/trial/docker.d.ts +10 -0
- package/dist/compiler/training/trial/docker.js +22 -0
- package/dist/compiler/training/trial/gateway.d.ts +47 -0
- package/dist/compiler/training/trial/gateway.js +113 -0
- package/dist/compiler/training/trial/homeLogin.d.ts +31 -0
- package/dist/compiler/training/trial/homeLogin.js +69 -0
- package/dist/compiler/training/trial/index.d.ts +8 -0
- package/dist/compiler/training/trial/index.js +8 -0
- package/dist/compiler/training/trial/judge.d.ts +15 -0
- package/dist/compiler/training/trial/judge.js +42 -0
- package/dist/compiler/training/trial/launcher.d.ts +47 -0
- package/dist/compiler/training/trial/launcher.js +193 -0
- package/dist/compiler/training/trial/login.d.ts +35 -0
- package/dist/compiler/training/trial/login.js +85 -0
- package/dist/compiler/training/trial/project.d.ts +11 -0
- package/dist/compiler/training/trial/project.js +31 -0
- package/dist/compiler/training/trial/realmTurns.d.ts +20 -0
- package/dist/compiler/training/trial/realmTurns.js +69 -0
- package/dist/compiler/upReceipt.d.ts +2 -17
- package/dist/compiler/upReceipt.js +2 -17
- package/dist/deployment/artifactsExportPlan.js +2 -18
- package/dist/deployment/privateArtifactsExport.js +1 -1
- package/dist/dev/docker.d.ts +0 -5
- package/dist/dev/docker.js +0 -46
- package/dist/dev/index.d.ts +0 -1
- package/dist/dev/index.js +0 -1
- package/dist/dev/project.d.ts +0 -16
- package/dist/dev/project.js +1 -128
- package/dist/distribution/distributionReportSchema.js +1 -1
- package/dist/distribution/imageRuntimeAuth.js +3 -2
- package/dist/manifest/renderSpawnfile.js +2 -1
- package/dist/release/drainControl.d.ts +5 -19
- package/dist/release/drainControl.js +12 -67
- package/dist/report/types.d.ts +3 -6
- package/dist/runtime/common.d.ts +1 -1
- package/dist/runtime/common.js +1 -1
- package/dist/runtime/container.d.ts +2 -2
- package/dist/runtime/container.js +1 -39
- package/dist/runtime/daimon/config.js +8 -14
- package/dist/runtime/daimon/contractManifest.js +0 -1
- package/dist/runtime/daimon/contractManifestSchema.js +0 -1
- package/dist/runtime/daimon/control.d.ts +31 -0
- package/dist/runtime/daimon/control.js +83 -0
- package/dist/runtime/daimon/engineDescriptorSchema.js +0 -1
- package/dist/runtime/daimon/engineDescriptors.generated.d.ts +1 -1
- package/dist/runtime/daimon/engineDescriptors.generated.js +1 -2
- package/dist/runtime/daimon/engines.js +0 -1
- package/dist/runtime/daimon/gateway.d.ts +62 -0
- package/dist/runtime/daimon/gateway.js +77 -0
- package/dist/runtime/daimon/grokWorkerContract.d.ts +0 -5
- package/dist/runtime/daimon/grokWorkerContract.js +1 -13
- package/dist/runtime/daimon/index.d.ts +2 -0
- package/dist/runtime/daimon/index.js +2 -1
- package/dist/runtime/daimon/memory.js +1 -1
- package/dist/runtime/daimon/packageName.js +0 -1
- package/dist/runtime/daimon/runAuth.js +15 -4
- package/dist/runtime/daimon/runtimeIdentity.d.ts +2 -0
- package/dist/runtime/daimon/runtimeIdentity.js +2 -0
- package/dist/runtime/daimon/subscriptionRealms.d.ts +27 -3
- package/dist/runtime/daimon/subscriptionRealms.js +35 -13
- package/dist/runtime/daimon/testHelpers.d.ts +2 -0
- package/dist/runtime/{pi → daimon}/testHelpers.js +3 -3
- package/dist/runtime/daimon/training/booted/adapter.d.ts +50 -0
- package/dist/runtime/daimon/training/booted/adapter.js +60 -0
- package/dist/runtime/daimon/training/booted/adapter.js.map +1 -0
- package/dist/runtime/daimon/training/booted/index.d.ts +4 -0
- package/dist/runtime/daimon/training/booted/index.js +3 -0
- package/dist/runtime/daimon/training/booted/index.js.map +1 -0
- package/dist/runtime/daimon/training/booted/judge.d.ts +39 -0
- package/dist/runtime/daimon/training/booted/judge.js +122 -0
- package/dist/runtime/daimon/training/booted/judge.js.map +1 -0
- package/dist/runtime/daimon/training/index.d.ts +5 -0
- package/dist/runtime/daimon/training/index.js +8 -4
- package/dist/runtime/daimon/training/index.js.map +1 -1
- package/dist/runtime/daimon/wakeMoments.js +0 -1
- package/dist/runtime/install.js +0 -21
- package/dist/runtime/registry.js +0 -2
- package/dist/runtime/trainingGraderProviders.js +10 -4
- package/dist/runtime/trainingProviders.d.ts +5 -3
- package/dist/runtime/trainingProviders.js +21 -24
- package/dist/runtime/trainingSubjects.d.ts +0 -121
- package/dist/runtime/trainingSubjects.js +2 -13
- package/dist/runtime/types.d.ts +1 -8
- package/dist/runtime/usageRequestLedger.d.ts +2 -0
- package/dist/runtime/usageRequestLedger.js +3 -1
- package/dist/shared/errors.js +0 -1
- package/dist/shared/trainingLegacy/trainingLegacyHashDomains.d.ts +1 -0
- package/dist/shared/trainingLegacy/trainingLegacyHashDomains.js +1 -0
- package/dist/shared/trainingLegacy/trainingLegacyHashDomains.js.map +1 -1
- package/dist/status/lifecycleProbes.js +3 -6
- package/dist/status/moltnetWiringProbes.js +1 -17
- package/dist/training/subjects/index.d.ts +0 -1
- package/dist/training/subjects/index.js +0 -1
- package/dist/training/subjects/index.js.map +1 -1
- package/examples/README.md +0 -1
- package/examples/daimon-org/agents/mapper/Spawnfile +4 -1
- package/examples/daimon-org/teams/review/agents/reviewer/Spawnfile +4 -1
- package/examples/jungian-daimon-org/teams/luna/agents/animus/Spawnfile +5 -8
- package/examples/jungian-daimon-org/teams/luna/agents/representative/Spawnfile +1 -1
- package/examples/jungian-daimon-org/teams/luna/agents/shadow/Spawnfile +5 -8
- package/examples/jungian-daimon-org/teams/selene/agents/animus/Spawnfile +5 -8
- package/examples/jungian-daimon-org/teams/selene/agents/representative/Spawnfile +5 -8
- package/examples/jungian-daimon-org/teams/selene/agents/shadow/Spawnfile +1 -1
- package/examples/mixed-runtime-org/agents/localist/Spawnfile +7 -7
- package/package.json +4 -13
- package/runtimes.yaml +5 -15
- package/dist/compiler/containerDaimonGrokTaskClock.d.ts +0 -5
- package/dist/compiler/containerDaimonGrokTaskClock.js +0 -29
- package/dist/compiler/daimonTelemetryArtifacts.d.ts +0 -22
- package/dist/compiler/daimonTelemetryArtifacts.js +0 -56
- package/dist/compiler/training/broker/clockProbe.d.ts +0 -6
- package/dist/compiler/training/broker/clockProbe.js +0 -27
- package/dist/compiler/training/broker/declaration.d.ts +0 -54
- package/dist/compiler/training/broker/declaration.js +0 -70
- package/dist/compiler/training/broker/entrypoint.d.ts +0 -39
- package/dist/compiler/training/broker/entrypoint.js +0 -124
- package/dist/compiler/training/broker/evaluatorSecrets.d.ts +0 -2
- package/dist/compiler/training/broker/evaluatorSecrets.js +0 -62
- package/dist/compiler/training/broker/index.d.ts +0 -12
- package/dist/compiler/training/broker/index.js +0 -12
- package/dist/compiler/training/broker/main.d.ts +0 -2
- package/dist/compiler/training/broker/main.js +0 -14
- package/dist/compiler/training/broker/paths.d.ts +0 -236
- package/dist/compiler/training/broker/paths.js +0 -249
- package/dist/compiler/training/broker/processes.d.ts +0 -51
- package/dist/compiler/training/broker/processes.js +0 -102
- package/dist/compiler/training/broker/projection.d.ts +0 -61
- package/dist/compiler/training/broker/projection.js +0 -109
- package/dist/compiler/training/broker/provisioning.d.ts +0 -78
- package/dist/compiler/training/broker/provisioning.js +0 -231
- package/dist/compiler/training/broker/receipt.d.ts +0 -77
- package/dist/compiler/training/broker/receipt.js +0 -110
- package/dist/compiler/training/broker/recycleClient.d.ts +0 -33
- package/dist/compiler/training/broker/recycleClient.js +0 -112
- package/dist/compiler/training/broker/registration.d.ts +0 -46
- package/dist/compiler/training/broker/registration.js +0 -113
- package/dist/compiler/training/broker/reset.d.ts +0 -9
- package/dist/compiler/training/broker/reset.js +0 -71
- package/dist/compiler/training/broker/rootScript.d.ts +0 -32
- package/dist/compiler/training/broker/rootScript.js +0 -33
- package/dist/compiler/training/broker/runtime.d.ts +0 -22
- package/dist/compiler/training/broker/runtime.js +0 -128
- package/dist/compiler/training/broker/seccompRoutes.d.ts +0 -31
- package/dist/compiler/training/broker/seccompRoutes.js +0 -36
- package/dist/compiler/training/broker/supervisor.d.ts +0 -108
- package/dist/compiler/training/broker/supervisor.js +0 -172
- package/dist/compiler/training/broker/taskClock.d.ts +0 -5
- package/dist/compiler/training/broker/taskClock.js +0 -41
- package/dist/compiler/training/container/contract.d.ts +0 -54
- package/dist/compiler/training/container/contract.js +0 -52
- package/dist/compiler/training/container/evaluators.d.ts +0 -48
- package/dist/compiler/training/container/evaluators.js +0 -50
- package/dist/compiler/training/container/grokWriteback.d.ts +0 -8
- package/dist/compiler/training/container/grokWriteback.js +0 -26
- package/dist/compiler/training/container/index.d.ts +0 -5
- package/dist/compiler/training/container/index.js +0 -3
- package/dist/compiler/training/container/launch.d.ts +0 -21
- package/dist/compiler/training/container/launch.js +0 -280
- package/dist/compiler/training/container/nativeSlots.d.ts +0 -14
- package/dist/compiler/training/container/nativeSlots.js +0 -13
- package/dist/compiler/training/container/outputCopy.d.ts +0 -2
- package/dist/compiler/training/container/outputCopy.js +0 -72
- package/dist/compiler/training/container/outputVolume.d.ts +0 -28
- package/dist/compiler/training/container/outputVolume.js +0 -185
- package/dist/compiler/training/container/prepare.d.ts +0 -10
- package/dist/compiler/training/container/prepare.js +0 -125
- package/dist/compiler/training/container/process.d.ts +0 -14
- package/dist/compiler/training/container/process.js +0 -70
- package/dist/compiler/training/container/security.d.ts +0 -38
- package/dist/compiler/training/container/security.js +0 -68
- package/dist/compiler/training/container/subjectIsolation.d.ts +0 -5
- package/dist/compiler/training/container/subjectIsolation.js +0 -16
- package/dist/compiler/training/preparation/assets/Dockerfile +0 -100
- package/dist/compiler/training/preparation/assets/package-lock.json +0 -5483
- package/dist/compiler/training/preparation/broker.d.ts +0 -30
- package/dist/compiler/training/preparation/broker.js +0 -68
- package/dist/compiler/training/preparation/contextModes.d.ts +0 -12
- package/dist/compiler/training/preparation/contextModes.js +0 -38
- package/dist/compiler/training/preparation/contract.d.ts +0 -203
- package/dist/compiler/training/preparation/contract.js +0 -114
- package/dist/compiler/training/preparation/copyAssets.d.ts +0 -1
- package/dist/compiler/training/preparation/copyAssets.js +0 -8
- package/dist/compiler/training/preparation/daimonParent.d.ts +0 -42
- package/dist/compiler/training/preparation/daimonParent.js +0 -114
- package/dist/compiler/training/preparation/files.d.ts +0 -29
- package/dist/compiler/training/preparation/files.js +0 -146
- package/dist/compiler/training/preparation/image.d.ts +0 -28
- package/dist/compiler/training/preparation/image.js +0 -105
- package/dist/compiler/training/preparation/index.d.ts +0 -3
- package/dist/compiler/training/preparation/index.js +0 -2
- package/dist/compiler/training/preparation/inputs.d.ts +0 -24
- package/dist/compiler/training/preparation/inputs.js +0 -101
- package/dist/compiler/training/preparation/prepare.d.ts +0 -38
- package/dist/compiler/training/preparation/prepare.js +0 -224
- package/dist/compiler/training/preparation/scratch.d.ts +0 -8
- package/dist/compiler/training/preparation/scratch.js +0 -114
- package/dist/compiler/training/repair/compatibility.d.ts +0 -11
- package/dist/compiler/training/repair/compatibility.js +0 -45
- package/dist/compiler/training/repair/contract.d.ts +0 -832
- package/dist/compiler/training/repair/contract.js +0 -34
- package/dist/compiler/training/repair/index.d.ts +0 -3
- package/dist/compiler/training/repair/index.js +0 -3
- package/dist/compiler/training/repair/prepare.d.ts +0 -378
- package/dist/compiler/training/repair/prepare.js +0 -84
- package/dist/compiler/training/repair/witness.d.ts +0 -348
- package/dist/compiler/training/repair/witness.js +0 -62
- package/dist/compiler/training/subjectDeclaration.d.ts +0 -26
- package/dist/compiler/training/subjectDeclaration.js +0 -54
- package/dist/compiler/training/subjectLease.d.ts +0 -115
- package/dist/compiler/training/subjectLease.js +0 -179
- package/dist/dev/activity.d.ts +0 -14
- package/dist/dev/activity.js +0 -48
- package/dist/runtime/codex-exec/training/adapter.d.ts +0 -13
- package/dist/runtime/codex-exec/training/adapter.js +0 -101
- package/dist/runtime/codex-exec/training/adapter.js.map +0 -1
- package/dist/runtime/codex-exec/training/environment.d.ts +0 -3
- package/dist/runtime/codex-exec/training/environment.js +0 -26
- package/dist/runtime/codex-exec/training/environment.js.map +0 -1
- package/dist/runtime/codex-exec/training/index.d.ts +0 -2
- package/dist/runtime/codex-exec/training/index.js +0 -3
- package/dist/runtime/codex-exec/training/index.js.map +0 -1
- package/dist/runtime/codex-exec/training/protocol.d.ts +0 -15
- package/dist/runtime/codex-exec/training/protocol.js +0 -102
- package/dist/runtime/codex-exec/training/protocol.js.map +0 -1
- package/dist/runtime/codex-exec/training/providers/codex-subscription/index.d.ts +0 -1
- package/dist/runtime/codex-exec/training/providers/codex-subscription/index.js +0 -2
- package/dist/runtime/codex-exec/training/providers/codex-subscription/index.js.map +0 -1
- package/dist/runtime/codex-exec/training/providers/codex-subscription/protocol.d.ts +0 -17
- package/dist/runtime/codex-exec/training/providers/codex-subscription/protocol.js +0 -80
- package/dist/runtime/codex-exec/training/providers/codex-subscription/protocol.js.map +0 -1
- package/dist/runtime/codex-exec/training/providers/codex-subscription/provider.d.ts +0 -12
- package/dist/runtime/codex-exec/training/providers/codex-subscription/provider.js +0 -125
- package/dist/runtime/codex-exec/training/providers/codex-subscription/provider.js.map +0 -1
- package/dist/runtime/codex-exec/training/providers/codex-subscription/strict-schema.d.ts +0 -6
- package/dist/runtime/codex-exec/training/providers/codex-subscription/strict-schema.js +0 -219
- package/dist/runtime/codex-exec/training/providers/codex-subscription/strict-schema.js.map +0 -1
- package/dist/runtime/daimon/contractManifest.js.map +0 -1
- package/dist/runtime/daimon/contractManifestSchema.js.map +0 -1
- package/dist/runtime/daimon/engineDescriptorSchema.js.map +0 -1
- package/dist/runtime/daimon/engineDescriptors.generated.js.map +0 -1
- package/dist/runtime/daimon/engines.js.map +0 -1
- package/dist/runtime/daimon/index.js.map +0 -1
- package/dist/runtime/daimon/packageName.js.map +0 -1
- package/dist/runtime/daimon/training/legacy/adapter.d.ts +0 -11
- package/dist/runtime/daimon/training/legacy/adapter.js +0 -175
- package/dist/runtime/daimon/training/legacy/adapter.js.map +0 -1
- package/dist/runtime/daimon/training/legacy/index.d.ts +0 -2
- package/dist/runtime/daimon/training/legacy/index.js +0 -3
- package/dist/runtime/daimon/training/legacy/index.js.map +0 -1
- package/dist/runtime/daimon/training/legacy/public.d.ts +0 -49
- package/dist/runtime/daimon/training/legacy/public.js +0 -16
- package/dist/runtime/daimon/training/legacy/public.js.map +0 -1
- package/dist/runtime/daimon/training/native/adapter.d.ts +0 -18
- package/dist/runtime/daimon/training/native/adapter.js +0 -252
- package/dist/runtime/daimon/training/native/adapter.js.map +0 -1
- package/dist/runtime/daimon/training/native/admission.d.ts +0 -7
- package/dist/runtime/daimon/training/native/admission.js +0 -52
- package/dist/runtime/daimon/training/native/admission.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/arguments.d.ts +0 -16
- package/dist/runtime/daimon/training/native/child/arguments.js +0 -70
- package/dist/runtime/daimon/training/native/child/arguments.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/deferred-trial.d.ts +0 -24
- package/dist/runtime/daimon/training/native/child/deferred-trial.js +0 -63
- package/dist/runtime/daimon/training/native/child/deferred-trial.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/diagnostics.d.ts +0 -58
- package/dist/runtime/daimon/training/native/child/diagnostics.js +0 -215
- package/dist/runtime/daimon/training/native/child/diagnostics.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/fixture.d.ts +0 -16
- package/dist/runtime/daimon/training/native/child/fixture.js +0 -159
- package/dist/runtime/daimon/training/native/child/fixture.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/grok.d.ts +0 -14
- package/dist/runtime/daimon/training/native/child/grok.js +0 -47
- package/dist/runtime/daimon/training/native/child/grok.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/index.d.ts +0 -7
- package/dist/runtime/daimon/training/native/child/index.js +0 -5
- package/dist/runtime/daimon/training/native/child/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/lifecycle.d.ts +0 -40
- package/dist/runtime/daimon/training/native/child/lifecycle.js +0 -400
- package/dist/runtime/daimon/training/native/child/lifecycle.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/probe.d.ts +0 -2
- package/dist/runtime/daimon/training/native/child/probe.js +0 -11
- package/dist/runtime/daimon/training/native/child/probe.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/sandbox.d.ts +0 -4
- package/dist/runtime/daimon/training/native/child/sandbox.js +0 -76
- package/dist/runtime/daimon/training/native/child/sandbox.js.map +0 -1
- package/dist/runtime/daimon/training/native/child/types.d.ts +0 -15
- package/dist/runtime/daimon/training/native/child/types.js +0 -2
- package/dist/runtime/daimon/training/native/child/types.js.map +0 -1
- package/dist/runtime/daimon/training/native/container/docker.d.ts +0 -29
- package/dist/runtime/daimon/training/native/container/docker.js +0 -105
- package/dist/runtime/daimon/training/native/container/docker.js.map +0 -1
- package/dist/runtime/daimon/training/native/container/grok-slot.d.ts +0 -22
- package/dist/runtime/daimon/training/native/container/grok-slot.js +0 -38
- package/dist/runtime/daimon/training/native/container/grok-slot.js.map +0 -1
- package/dist/runtime/daimon/training/native/container/index.d.ts +0 -6
- package/dist/runtime/daimon/training/native/container/index.js +0 -6
- package/dist/runtime/daimon/training/native/container/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/container/lifecycle.d.ts +0 -8
- package/dist/runtime/daimon/training/native/container/lifecycle.js +0 -111
- package/dist/runtime/daimon/training/native/container/lifecycle.js.map +0 -1
- package/dist/runtime/daimon/training/native/container/manifest.d.ts +0 -17
- package/dist/runtime/daimon/training/native/container/manifest.js +0 -164
- package/dist/runtime/daimon/training/native/container/manifest.js.map +0 -1
- package/dist/runtime/daimon/training/native/container/native-preflight.d.ts +0 -8
- package/dist/runtime/daimon/training/native/container/native-preflight.js +0 -40
- package/dist/runtime/daimon/training/native/container/native-preflight.js.map +0 -1
- package/dist/runtime/daimon/training/native/container/preflight.d.ts +0 -15
- package/dist/runtime/daimon/training/native/container/preflight.js +0 -79
- package/dist/runtime/daimon/training/native/container/preflight.js.map +0 -1
- package/dist/runtime/daimon/training/native/container/slot.d.ts +0 -4
- package/dist/runtime/daimon/training/native/container/slot.js +0 -58
- package/dist/runtime/daimon/training/native/container/slot.js.map +0 -1
- package/dist/runtime/daimon/training/native/external.d.ts +0 -37
- package/dist/runtime/daimon/training/native/external.js +0 -75
- package/dist/runtime/daimon/training/native/external.js.map +0 -1
- package/dist/runtime/daimon/training/native/grants/authority.d.ts +0 -36
- package/dist/runtime/daimon/training/native/grants/authority.js +0 -49
- package/dist/runtime/daimon/training/native/grants/authority.js.map +0 -1
- package/dist/runtime/daimon/training/native/grants/index.d.ts +0 -2
- package/dist/runtime/daimon/training/native/grants/index.js +0 -3
- package/dist/runtime/daimon/training/native/grants/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/grants/pins.d.ts +0 -30
- package/dist/runtime/daimon/training/native/grants/pins.js +0 -20
- package/dist/runtime/daimon/training/native/grants/pins.js.map +0 -1
- package/dist/runtime/daimon/training/native/grants/test-socket.d.ts +0 -6
- package/dist/runtime/daimon/training/native/grants/test-socket.js +0 -35
- package/dist/runtime/daimon/training/native/grants/test-socket.js.map +0 -1
- package/dist/runtime/daimon/training/native/grok-fixtures.d.ts +0 -34
- package/dist/runtime/daimon/training/native/grok-fixtures.js +0 -179
- package/dist/runtime/daimon/training/native/grok-fixtures.js.map +0 -1
- package/dist/runtime/daimon/training/native/index.d.ts +0 -38
- package/dist/runtime/daimon/training/native/index.js +0 -27
- package/dist/runtime/daimon/training/native/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/live-checkout.d.ts +0 -2
- package/dist/runtime/daimon/training/native/live-checkout.js +0 -15
- package/dist/runtime/daimon/training/native/live-checkout.js.map +0 -1
- package/dist/runtime/daimon/training/native/observations.d.ts +0 -51
- package/dist/runtime/daimon/training/native/observations.js +0 -217
- package/dist/runtime/daimon/training/native/observations.js.map +0 -1
- package/dist/runtime/daimon/training/native/outcome.d.ts +0 -13
- package/dist/runtime/daimon/training/native/outcome.js +0 -37
- package/dist/runtime/daimon/training/native/outcome.js.map +0 -1
- package/dist/runtime/daimon/training/native/preparation/engine-config.d.ts +0 -21
- package/dist/runtime/daimon/training/native/preparation/engine-config.js +0 -30
- package/dist/runtime/daimon/training/native/preparation/engine-config.js.map +0 -1
- package/dist/runtime/daimon/training/native/preparation/fixtures.d.ts +0 -17
- package/dist/runtime/daimon/training/native/preparation/fixtures.js +0 -52
- package/dist/runtime/daimon/training/native/preparation/fixtures.js.map +0 -1
- package/dist/runtime/daimon/training/native/preparation/index.d.ts +0 -7
- package/dist/runtime/daimon/training/native/preparation/index.js +0 -5
- package/dist/runtime/daimon/training/native/preparation/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/preparation/layout.d.ts +0 -66
- package/dist/runtime/daimon/training/native/preparation/layout.js +0 -87
- package/dist/runtime/daimon/training/native/preparation/layout.js.map +0 -1
- package/dist/runtime/daimon/training/native/preparation/subject.d.ts +0 -14
- package/dist/runtime/daimon/training/native/preparation/subject.js +0 -67
- package/dist/runtime/daimon/training/native/preparation/subject.js.map +0 -1
- package/dist/runtime/daimon/training/native/preparation/types.d.ts +0 -69
- package/dist/runtime/daimon/training/native/preparation/types.js +0 -2
- package/dist/runtime/daimon/training/native/preparation/types.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/artifacts.d.ts +0 -25
- package/dist/runtime/daimon/training/native/receipt/artifacts.js +0 -32
- package/dist/runtime/daimon/training/native/receipt/artifacts.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/grok-clocked-pins.d.ts +0 -129
- package/dist/runtime/daimon/training/native/receipt/grok-clocked-pins.js +0 -45
- package/dist/runtime/daimon/training/native/receipt/grok-clocked-pins.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/grok.d.ts +0 -246
- package/dist/runtime/daimon/training/native/receipt/grok.js +0 -195
- package/dist/runtime/daimon/training/native/receipt/grok.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/index.d.ts +0 -11
- package/dist/runtime/daimon/training/native/receipt/index.js +0 -8
- package/dist/runtime/daimon/training/native/receipt/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/paths.d.ts +0 -3
- package/dist/runtime/daimon/training/native/receipt/paths.js +0 -18
- package/dist/runtime/daimon/training/native/receipt/paths.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/sandbox.d.ts +0 -42
- package/dist/runtime/daimon/training/native/receipt/sandbox.js +0 -35
- package/dist/runtime/daimon/training/native/receipt/sandbox.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/schema.d.ts +0 -490
- package/dist/runtime/daimon/training/native/receipt/schema.js +0 -138
- package/dist/runtime/daimon/training/native/receipt/schema.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/subscription.d.ts +0 -13
- package/dist/runtime/daimon/training/native/receipt/subscription.js +0 -13
- package/dist/runtime/daimon/training/native/receipt/subscription.js.map +0 -1
- package/dist/runtime/daimon/training/native/receipt/task-clock.d.ts +0 -19
- package/dist/runtime/daimon/training/native/receipt/task-clock.js +0 -49
- package/dist/runtime/daimon/training/native/receipt/task-clock.js.map +0 -1
- package/dist/runtime/daimon/training/native/sealed-usage.d.ts +0 -218
- package/dist/runtime/daimon/training/native/sealed-usage.js +0 -261
- package/dist/runtime/daimon/training/native/sealed-usage.js.map +0 -1
- package/dist/runtime/daimon/training/native/test-fixtures.d.ts +0 -27
- package/dist/runtime/daimon/training/native/test-fixtures.js +0 -162
- package/dist/runtime/daimon/training/native/test-fixtures.js.map +0 -1
- package/dist/runtime/daimon/training/native/transcript.d.ts +0 -96
- package/dist/runtime/daimon/training/native/transcript.js +0 -239
- package/dist/runtime/daimon/training/native/transcript.js.map +0 -1
- package/dist/runtime/daimon/training/native/transport/delivery.d.ts +0 -27
- package/dist/runtime/daimon/training/native/transport/delivery.js +0 -98
- package/dist/runtime/daimon/training/native/transport/delivery.js.map +0 -1
- package/dist/runtime/daimon/training/native/transport/http.d.ts +0 -3
- package/dist/runtime/daimon/training/native/transport/http.js +0 -81
- package/dist/runtime/daimon/training/native/transport/http.js.map +0 -1
- package/dist/runtime/daimon/training/native/transport/index.d.ts +0 -4
- package/dist/runtime/daimon/training/native/transport/index.js +0 -3
- package/dist/runtime/daimon/training/native/transport/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/transport/types.d.ts +0 -15
- package/dist/runtime/daimon/training/native/transport/types.js +0 -2
- package/dist/runtime/daimon/training/native/transport/types.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/cli.d.ts +0 -1
- package/dist/runtime/daimon/training/native/worker/cli.js +0 -17
- package/dist/runtime/daimon/training/native/worker/cli.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/control.d.ts +0 -20
- package/dist/runtime/daimon/training/native/worker/control.js +0 -266
- package/dist/runtime/daimon/training/native/worker/control.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/deliveries.d.ts +0 -38
- package/dist/runtime/daimon/training/native/worker/deliveries.js +0 -91
- package/dist/runtime/daimon/training/native/worker/deliveries.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/evidence/collect.d.ts +0 -54
- package/dist/runtime/daimon/training/native/worker/evidence/collect.js +0 -278
- package/dist/runtime/daimon/training/native/worker/evidence/collect.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/evidence/execution.d.ts +0 -102
- package/dist/runtime/daimon/training/native/worker/evidence/execution.js +0 -191
- package/dist/runtime/daimon/training/native/worker/evidence/execution.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/evidence/index.d.ts +0 -3
- package/dist/runtime/daimon/training/native/worker/evidence/index.js +0 -4
- package/dist/runtime/daimon/training/native/worker/evidence/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/evidence/io.d.ts +0 -20
- package/dist/runtime/daimon/training/native/worker/evidence/io.js +0 -130
- package/dist/runtime/daimon/training/native/worker/evidence/io.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/evidence/seal.d.ts +0 -3
- package/dist/runtime/daimon/training/native/worker/evidence/seal.js +0 -67
- package/dist/runtime/daimon/training/native/worker/evidence/seal.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/index.d.ts +0 -11
- package/dist/runtime/daimon/training/native/worker/index.js +0 -8
- package/dist/runtime/daimon/training/native/worker/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/profile.d.ts +0 -23
- package/dist/runtime/daimon/training/native/worker/profile.js +0 -149
- package/dist/runtime/daimon/training/native/worker/profile.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/public.d.ts +0 -53
- package/dist/runtime/daimon/training/native/worker/public.js +0 -22
- package/dist/runtime/daimon/training/native/worker/public.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/sandbox.d.ts +0 -4
- package/dist/runtime/daimon/training/native/worker/sandbox.js +0 -54
- package/dist/runtime/daimon/training/native/worker/sandbox.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/server.d.ts +0 -4
- package/dist/runtime/daimon/training/native/worker/server.js +0 -102
- package/dist/runtime/daimon/training/native/worker/server.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/types.d.ts +0 -318
- package/dist/runtime/daimon/training/native/worker/types.js +0 -2
- package/dist/runtime/daimon/training/native/worker/types.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/wake-delivery/index.d.ts +0 -4
- package/dist/runtime/daimon/training/native/worker/wake-delivery/index.js +0 -4
- package/dist/runtime/daimon/training/native/worker/wake-delivery/index.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/wake-delivery/source.d.ts +0 -3
- package/dist/runtime/daimon/training/native/worker/wake-delivery/source.js +0 -16
- package/dist/runtime/daimon/training/native/worker/wake-delivery/source.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/wake-delivery/terminal.d.ts +0 -4
- package/dist/runtime/daimon/training/native/worker/wake-delivery/terminal.js +0 -52
- package/dist/runtime/daimon/training/native/worker/wake-delivery/terminal.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/wake-delivery/transport.d.ts +0 -21
- package/dist/runtime/daimon/training/native/worker/wake-delivery/transport.js +0 -198
- package/dist/runtime/daimon/training/native/worker/wake-delivery/transport.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/wake-delivery/types.d.ts +0 -91
- package/dist/runtime/daimon/training/native/worker/wake-delivery/types.js +0 -2
- package/dist/runtime/daimon/training/native/worker/wake-delivery/types.js.map +0 -1
- package/dist/runtime/daimon/training/native/worker/worker.d.ts +0 -1
- package/dist/runtime/daimon/training/native/worker/worker.js +0 -105
- package/dist/runtime/daimon/training/native/worker/worker.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-broker/broker.d.ts +0 -20
- package/dist/runtime/daimon/training/providers/grok-broker/broker.js +0 -55
- package/dist/runtime/daimon/training/providers/grok-broker/broker.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-broker/grant-fixtures.d.ts +0 -15
- package/dist/runtime/daimon/training/providers/grok-broker/grant-fixtures.js +0 -29
- package/dist/runtime/daimon/training/providers/grok-broker/grant-fixtures.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-broker/grant-home.d.ts +0 -16
- package/dist/runtime/daimon/training/providers/grok-broker/grant-home.js +0 -60
- package/dist/runtime/daimon/training/providers/grok-broker/grant-home.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-broker/grant-pool.d.ts +0 -81
- package/dist/runtime/daimon/training/providers/grok-broker/grant-pool.js +0 -221
- package/dist/runtime/daimon/training/providers/grok-broker/grant-pool.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-broker/grant-releases.d.ts +0 -31
- package/dist/runtime/daimon/training/providers/grok-broker/grant-releases.js +0 -78
- package/dist/runtime/daimon/training/providers/grok-broker/grant-releases.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-broker/grants.d.ts +0 -63
- package/dist/runtime/daimon/training/providers/grok-broker/grants.js +0 -20
- package/dist/runtime/daimon/training/providers/grok-broker/grants.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-broker/index.d.ts +0 -3
- package/dist/runtime/daimon/training/providers/grok-broker/index.js +0 -4
- package/dist/runtime/daimon/training/providers/grok-broker/index.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-subscription/cli.d.ts +0 -21
- package/dist/runtime/daimon/training/providers/grok-subscription/cli.js +0 -81
- package/dist/runtime/daimon/training/providers/grok-subscription/cli.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-subscription/index.d.ts +0 -4
- package/dist/runtime/daimon/training/providers/grok-subscription/index.js +0 -5
- package/dist/runtime/daimon/training/providers/grok-subscription/index.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-subscription/protocol.d.ts +0 -26
- package/dist/runtime/daimon/training/providers/grok-subscription/protocol.js +0 -102
- package/dist/runtime/daimon/training/providers/grok-subscription/protocol.js.map +0 -1
- package/dist/runtime/daimon/training/providers/grok-subscription/provider.d.ts +0 -9
- package/dist/runtime/daimon/training/providers/grok-subscription/provider.js +0 -38
- package/dist/runtime/daimon/training/providers/grok-subscription/provider.js.map +0 -1
- package/dist/runtime/daimon/training/public.d.ts +0 -6
- package/dist/runtime/daimon/training/public.js +0 -5
- package/dist/runtime/daimon/training/public.js.map +0 -1
- package/dist/runtime/daimon/training/services/account-lease.d.ts +0 -7
- package/dist/runtime/daimon/training/services/account-lease.js +0 -76
- package/dist/runtime/daimon/training/services/account-lease.js.map +0 -1
- package/dist/runtime/daimon/training/services/freshness.d.ts +0 -15
- package/dist/runtime/daimon/training/services/freshness.js +0 -19
- package/dist/runtime/daimon/training/services/freshness.js.map +0 -1
- package/dist/runtime/daimon/training/services/index.d.ts +0 -4
- package/dist/runtime/daimon/training/services/index.js +0 -4
- package/dist/runtime/daimon/training/services/index.js.map +0 -1
- package/dist/runtime/daimon/training/services/slot-freshness.d.ts +0 -34
- package/dist/runtime/daimon/training/services/slot-freshness.js +0 -178
- package/dist/runtime/daimon/training/services/slot-freshness.js.map +0 -1
- package/dist/runtime/daimon/wakeMoments.js.map +0 -1
- package/dist/runtime/pi/adapter.d.ts +0 -3
- package/dist/runtime/pi/adapter.js +0 -230
- package/dist/runtime/pi/appActivitySource.d.ts +0 -1
- package/dist/runtime/pi/appActivitySource.js +0 -199
- package/dist/runtime/pi/appAgentConfig.d.ts +0 -11
- package/dist/runtime/pi/appAgentConfig.js +0 -264
- package/dist/runtime/pi/appCliEnginesSource.d.ts +0 -1
- package/dist/runtime/pi/appCliEnginesSource.js +0 -183
- package/dist/runtime/pi/appCliSource.d.ts +0 -1
- package/dist/runtime/pi/appCliSource.js +0 -353
- package/dist/runtime/pi/appControlSource.d.ts +0 -1
- package/dist/runtime/pi/appControlSource.js +0 -390
- package/dist/runtime/pi/appControlWakeIdentitySource.d.ts +0 -1
- package/dist/runtime/pi/appControlWakeIdentitySource.js +0 -19
- package/dist/runtime/pi/appCoreSource.d.ts +0 -4
- package/dist/runtime/pi/appCoreSource.js +0 -244
- package/dist/runtime/pi/appPreludeSource.d.ts +0 -1
- package/dist/runtime/pi/appPreludeSource.js +0 -192
- package/dist/runtime/pi/appScheduleSource.d.ts +0 -1
- package/dist/runtime/pi/appScheduleSource.js +0 -84
- package/dist/runtime/pi/appScriptedEngine.d.ts +0 -31
- package/dist/runtime/pi/appScriptedEngine.js +0 -42
- package/dist/runtime/pi/appSource.d.ts +0 -4
- package/dist/runtime/pi/appSource.js +0 -12
- package/dist/runtime/pi/appTemplate.d.ts +0 -14
- package/dist/runtime/pi/appTemplate.js +0 -28
- package/dist/runtime/pi/appTemplateTypes.d.ts +0 -64
- package/dist/runtime/pi/appTemplateTypes.js +0 -18
- package/dist/runtime/pi/appWakeContextSource.d.ts +0 -1
- package/dist/runtime/pi/appWakeContextSource.js +0 -398
- package/dist/runtime/pi/containerTargets.d.ts +0 -4
- package/dist/runtime/pi/containerTargets.js +0 -63
- package/dist/runtime/pi/runAuth.d.ts +0 -2
- package/dist/runtime/pi/runAuth.js +0 -185
- package/dist/runtime/pi/testHelpers.d.ts +0 -2
- package/dist/shared/errors.js.map +0 -1
- package/dist/training/subjects/environment.d.ts +0 -2
- package/dist/training/subjects/environment.js +0 -14
- package/dist/training/subjects/environment.js.map +0 -1
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
import { dirname, join } from 'node:path';
|
|
2
|
-
import { aggregateUsage } from './observations.js';
|
|
3
|
-
import { isGrokLaunch } from './receipt/index.js';
|
|
4
|
-
import { readSealedGrokUsage, readSealedGrokRequests, readSealedGrokTurnSeals } from './worker/index.js';
|
|
5
|
-
const nothing = { usage: null, rows: [] };
|
|
6
|
-
const pause = (milliseconds) => new Promise(resolve => { setTimeout(resolve, milliseconds).unref?.(); });
|
|
7
|
-
/** The bounded wait both sealed reads share, or `null` for a bound that is not one. */
|
|
8
|
-
function schedule(options) {
|
|
9
|
-
const attempts = options.attempts ?? 20, intervalMs = options.intervalMs ?? 100;
|
|
10
|
-
if (!Number.isSafeInteger(attempts) || attempts < 1 || !Number.isSafeInteger(intervalMs) || intervalMs < 0)
|
|
11
|
-
return null;
|
|
12
|
-
return { attempts, intervalMs };
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* What a brokered turn spent, when its terminal frame never arrived.
|
|
16
|
-
*
|
|
17
|
-
* A wake that fails spends the same money as one that publishes. The worker's
|
|
18
|
-
* HTTP reply is the only route usage normally takes to this adapter, so a
|
|
19
|
-
* worker that dies mid-turn used to report `usage: null` for a turn whose tool
|
|
20
|
-
* calls had already succeeded — a fabricated zero, byte-identical to a measured
|
|
21
|
-
* one, for spend that really happened. The broker is the single sealed usage
|
|
22
|
-
* writer and it seals a failed turn's partial usage from what its own proxy
|
|
23
|
-
* metered, so the record exists; in child-process execution this adapter shares
|
|
24
|
-
* that filesystem and the launch receipt names the file.
|
|
25
|
-
*
|
|
26
|
-
* Three rules, all of them the ledger's own:
|
|
27
|
-
*
|
|
28
|
-
* - **Absence stays absence.** A missing, unreadable, malformed or empty ledger
|
|
29
|
-
* returns `null`, never `0`. Reading nothing is not the same as measuring
|
|
30
|
-
* nothing, and the difference is exactly what a fabricated zero destroys.
|
|
31
|
-
* - **Dedupe by `turn`.** Daimon may append one sealed turn's identical bytes
|
|
32
|
-
* twice (a replay racing another replay), so every ledger consumer collapses
|
|
33
|
-
* them; `readSealedGrokUsage` does it and refuses rows that disagree under
|
|
34
|
-
* one key.
|
|
35
|
-
* - **It cannot fail the trial.** This runs on a path that has already failed,
|
|
36
|
-
* and an instrumentation fault there would replace a diagnosable failure with
|
|
37
|
-
* a confusing one. Every fault is swallowed into `null`.
|
|
38
|
-
*
|
|
39
|
-
* The recovered spend is deliberately *not* promoted to complete coverage: the
|
|
40
|
-
* execution it belongs to never closed, so nothing here can prove the ledger
|
|
41
|
-
* holds all of it. It is `partial` — measured, bounded below, and honest about
|
|
42
|
-
* being the broker's account rather than the turn's.
|
|
43
|
-
*
|
|
44
|
-
* The short poll exists because sealing is the broker's reaction to losing its
|
|
45
|
-
* client: the worker dies, its control socket closes, and only then does the
|
|
46
|
-
* broker seal and append. Reading once, immediately, would race that append and
|
|
47
|
-
* report absence for a row written a moment later — which is the same
|
|
48
|
-
* fabricated zero by a different route. The wait is bounded and always
|
|
49
|
-
* terminates; giving up returns absence, not zero.
|
|
50
|
-
*/
|
|
51
|
-
export async function readSealedBrokerUsage(launch, options = {}) {
|
|
52
|
-
if (!isGrokLaunch(launch))
|
|
53
|
-
return nothing;
|
|
54
|
-
const bound = schedule(options);
|
|
55
|
-
if (!bound)
|
|
56
|
-
return nothing;
|
|
57
|
-
const { attempts, intervalMs } = bound;
|
|
58
|
-
for (let attempt = 0; attempt < attempts; attempt++) {
|
|
59
|
-
if (attempt > 0)
|
|
60
|
-
await pause(intervalMs);
|
|
61
|
-
try {
|
|
62
|
-
const rows = await readSealedGrokUsage(launch.broker.usageLedgerPath, launch.agent.id, launch.agent.model);
|
|
63
|
-
// A non-empty read is the answer, whatever it aggregates to: `aggregateUsage`
|
|
64
|
-
// reports absence only for no rows at all, which is the case still waiting.
|
|
65
|
-
if (rows.length)
|
|
66
|
-
return { usage: aggregateUsage(rows), rows };
|
|
67
|
-
}
|
|
68
|
-
catch {
|
|
69
|
-
return nothing;
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return nothing;
|
|
73
|
-
}
|
|
74
|
-
export const BROKER_REQUESTS_SCHEMA = 'spawnfile.training.daimon-native.broker-requests.v1';
|
|
75
|
-
/** Published rows per failed turn. A hung turn is read from its requests, not archived as a corpus. */
|
|
76
|
-
const publishedRows = 256;
|
|
77
|
-
/** Issued, never answered. The single most important row in the file, and never filled in or dropped. */
|
|
78
|
-
const isOpen = (row) => row.startedAt !== undefined && row.endedAt === undefined;
|
|
79
|
-
/**
|
|
80
|
-
* The published projection, built field by field.
|
|
81
|
-
*
|
|
82
|
-
* An allow-list, not a filter: the broker's schema permits unknown members, so
|
|
83
|
-
* spreading a row would publish whatever it happened to carry. Every field here
|
|
84
|
-
* is a timing, a count, or a value from a closed set (`model` is checked against
|
|
85
|
-
* the declared model, `usage_source` against three literals), so nothing
|
|
86
|
-
* free-form — no request body, no prompt, no bearer — has a route in.
|
|
87
|
-
*/
|
|
88
|
-
const timing = (row) => ({
|
|
89
|
-
// `at` is the broker's own append clock, validated as a timestamp by the reader that produced this row.
|
|
90
|
-
turn: row.turn, request: row.request, requests: row.requests, model: row.model, at: String(row.at),
|
|
91
|
-
...(row.started_at === undefined ? {} : { startedAt: row.started_at }),
|
|
92
|
-
...(row.ended_at === undefined ? {} : { endedAt: row.ended_at }),
|
|
93
|
-
...(row.started_at === undefined || row.ended_at === undefined ? {} : { durationMs: Date.parse(row.ended_at) - Date.parse(row.started_at) }),
|
|
94
|
-
...(row.usage_source === undefined ? {} : { usageSource: row.usage_source }),
|
|
95
|
-
input: row.input, cachedInput: row.cached_input, freshInput: row.fresh_input,
|
|
96
|
-
cacheWrite: row.cache_write, output: row.output, total: row.total,
|
|
97
|
-
});
|
|
98
|
-
/** Bound the published rows, keeping every unanswered one and then the most recent, in file order. */
|
|
99
|
-
function bounded(rows) {
|
|
100
|
-
if (rows.length <= publishedRows)
|
|
101
|
-
return [...rows];
|
|
102
|
-
const kept = new Set();
|
|
103
|
-
for (let index = rows.length - 1; index >= 0 && kept.size < publishedRows; index--)
|
|
104
|
-
if (isOpen(rows[index]))
|
|
105
|
-
kept.add(index);
|
|
106
|
-
for (let index = rows.length - 1; index >= 0 && kept.size < publishedRows; index--)
|
|
107
|
-
kept.add(index);
|
|
108
|
-
return rows.filter((_, index) => kept.has(index));
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* A parse error can quote the bad line, so the fault publishes as a
|
|
112
|
-
* classification rather than a message. `readPrivateFile`'s own guards are the
|
|
113
|
-
* only I/O refusals that reach here; anything else is a row this reader refused.
|
|
114
|
-
*/
|
|
115
|
-
const classify = (error) => error instanceof SyntaxError ? 'malformed' : error instanceof Error && !/native input/iu.test(error.message) ? 'schema' : 'unreadable';
|
|
116
|
-
/**
|
|
117
|
-
* When a brokered turn last spoke to the provider, and whether it was answered.
|
|
118
|
-
*
|
|
119
|
-
* A turn killed by its deadline leaves two indistinguishable shapes in the
|
|
120
|
-
* published event stream: a request was issued and never came back, or the
|
|
121
|
-
* worker never issued the next request at all. Nothing on the adapter's side of
|
|
122
|
-
* the wake can separate them — but the broker's proxy writes a second ledger
|
|
123
|
-
* beside the usage one, a row per request with its own `started_at` and
|
|
124
|
-
* `ended_at`, and there the first shape is a row with no end and the second is
|
|
125
|
-
* no row. That file dies with the slot's tmpfs unless the failure path reads
|
|
126
|
-
* it, so this reads it there and publishes it as an operator-only diagnostic.
|
|
127
|
-
*
|
|
128
|
-
* It keeps the rules of the ledger beside it:
|
|
129
|
-
*
|
|
130
|
-
* - **Absence stays absence.** A missing or empty ledger returns `undefined` —
|
|
131
|
-
* nothing is published. A fabricated empty list would read as "no requests
|
|
132
|
-
* were made", which is one of the two answers this change exists to
|
|
133
|
-
* distinguish. A ledger that is present but unreadable publishes a failure
|
|
134
|
-
* classification instead, which is neither answer.
|
|
135
|
-
* - **An unanswered row survives as one.** `endedAt` is omitted, never filled,
|
|
136
|
-
* never normalised, and the bound keeps open rows before any other.
|
|
137
|
-
* - **Timings and counts only**, through an allow-list projection.
|
|
138
|
-
* - **It cannot fail the trial.** Every fault becomes a classification or
|
|
139
|
-
* absence, and the observer swallows a publish fault.
|
|
140
|
-
*
|
|
141
|
-
* The poll is the usage reader's, for the usage reader's reason: an unanswered
|
|
142
|
-
* request has no row until the broker seals the turn it belongs to, so reading
|
|
143
|
-
* once would race the append and report "never issued" for a request that was.
|
|
144
|
-
*/
|
|
145
|
-
export async function readSealedBrokerRequests(launch, options = {}) {
|
|
146
|
-
if (!isGrokLaunch(launch))
|
|
147
|
-
return undefined;
|
|
148
|
-
const bound = schedule(options);
|
|
149
|
-
if (!bound)
|
|
150
|
-
return undefined;
|
|
151
|
-
// The broker writes both streams into one slot ledger directory; every reader here derives the sibling the same way.
|
|
152
|
-
const file = join(dirname(launch.broker.usageLedgerPath), 'requests.jsonl');
|
|
153
|
-
for (let attempt = 0; attempt < bound.attempts; attempt++) {
|
|
154
|
-
if (attempt > 0)
|
|
155
|
-
await pause(bound.intervalMs);
|
|
156
|
-
// The projection stays inside the same guard as the read: no fault of this
|
|
157
|
-
// record's own may escape onto a path that has already failed.
|
|
158
|
-
try {
|
|
159
|
-
const rows = await readSealedGrokRequests(file, launch.agent.id, launch.agent.model);
|
|
160
|
-
if (!rows.length)
|
|
161
|
-
continue;
|
|
162
|
-
const timings = rows.map(timing);
|
|
163
|
-
const published = bounded(timings);
|
|
164
|
-
return { schema: BROKER_REQUESTS_SCHEMA, outcome: 'read', read: timings.length, published: published.length,
|
|
165
|
-
open: timings.filter(isOpen).length, truncated: published.length < timings.length, rows: published };
|
|
166
|
-
}
|
|
167
|
-
catch (error) {
|
|
168
|
-
return { schema: BROKER_REQUESTS_SCHEMA, outcome: 'unreadable', failure: classify(error) };
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
return undefined;
|
|
172
|
-
}
|
|
173
|
-
export const BROKER_SEAL_SCHEMA = 'spawnfile.training.daimon-native.broker-seal.v1';
|
|
174
|
-
/** Published seal rows per failed turn; a slot ledger is wiped per recycle, so this is a ceiling, not a window. */
|
|
175
|
-
const publishedSeals = 64;
|
|
176
|
-
const sealRecord = (row) => ({
|
|
177
|
-
turn: row.turn, wake: row.wake, at: String(row.at), model: row.model,
|
|
178
|
-
outcome: row.outcome, requests: row.requests, limitReason: row.limit_reason,
|
|
179
|
-
...(row.shell_clock === undefined ? {} : { shellClock: row.shell_clock }),
|
|
180
|
-
...(row.provider_clock === undefined ? {} : { providerClock: {
|
|
181
|
-
requests: row.provider_clock.requests, linesRewritten: row.provider_clock.linesRewritten,
|
|
182
|
-
requestsWithoutDateLine: row.provider_clock.requestsWithoutDateLine,
|
|
183
|
-
...(row.provider_clock.linesIgnored === undefined ? {} : { linesIgnored: row.provider_clock.linesIgnored }),
|
|
184
|
-
injectedDate: row.provider_clock.injectedDate, taskDate: row.provider_clock.taskDate,
|
|
185
|
-
} }),
|
|
186
|
-
...(row.code === undefined ? {} : { code: row.code }),
|
|
187
|
-
...(row.diagnostic === undefined ? {} : {
|
|
188
|
-
status: row.diagnostic.status, stage: row.diagnostic.stage, failureClass: row.diagnostic.failure_class,
|
|
189
|
-
exitCode: row.diagnostic.exit_code, termSignal: row.diagnostic.term_signal,
|
|
190
|
-
...(row.diagnostic.reason === undefined ? {} : { reason: row.diagnostic.reason }),
|
|
191
|
-
}),
|
|
192
|
-
...(row.mcp === undefined ? {} : {
|
|
193
|
-
mcp: {
|
|
194
|
-
started: row.mcp.started, answered: row.mcp.answered, undecoded: row.mcp.undecoded,
|
|
195
|
-
outstanding: row.mcp.outstanding.map(call => ({ name: call.name, outstandingMs: call.outstanding_ms })),
|
|
196
|
-
...(row.mcp.refusals === undefined ? {} : { refusals: {
|
|
197
|
-
route: row.mcp.refusals.route, expired: row.mcp.refusals.expired, exhausted: row.mcp.refusals.exhausted,
|
|
198
|
-
unrouted: row.mcp.refusals.unrouted, oversized: row.mcp.refusals.oversized,
|
|
199
|
-
} }),
|
|
200
|
-
// Absent when the row predates the tunnel observation: not `opened: 0`.
|
|
201
|
-
...(row.mcp.tunnels === undefined ? {} : {
|
|
202
|
-
tunnels: {
|
|
203
|
-
opened: row.mcp.tunnels.opened, closed: row.mcp.tunnels.closed, delivered: row.mcp.tunnels.delivered,
|
|
204
|
-
open: row.mcp.tunnels.open.map(tunnel => ({ openMs: tunnel.open_ms, delivered: tunnel.delivered })),
|
|
205
|
-
},
|
|
206
|
-
}),
|
|
207
|
-
},
|
|
208
|
-
}),
|
|
209
|
-
});
|
|
210
|
-
/**
|
|
211
|
-
* What the broker sealed about a turn that never answered.
|
|
212
|
-
*
|
|
213
|
-
* A worker that CRASHES still produces a terminal HTTP reply, and its failure
|
|
214
|
-
* code and last words ride that reply here. A worker that HANGS is killed by
|
|
215
|
-
* the trial deadline, so there is no reply at all — and the sealed terminal
|
|
216
|
-
* response, with the MCP call the worker was still blocked on riding on it,
|
|
217
|
-
* is written only into the broker's own turn record, in a `0700` store this
|
|
218
|
-
* uid cannot read, on a control root a training slot puts on tmpfs. Six live
|
|
219
|
-
* runs ended exactly that way: usage recovered, `output: absent`, and no
|
|
220
|
-
* account of what the turn was waiting for.
|
|
221
|
-
*
|
|
222
|
-
* The broker now projects that sealed response into a third stream beside the
|
|
223
|
-
* two ledgers this module already recovers, and this reads it there, on the
|
|
224
|
-
* same bounded poll and for the same reason: the seal is the broker's reaction
|
|
225
|
-
* to losing its client, so reading once would race the append.
|
|
226
|
-
*
|
|
227
|
-
* Same rules as the requests ledger beside it. Absence stays absence — a
|
|
228
|
-
* missing or empty stream publishes nothing, because a fabricated empty record
|
|
229
|
-
* would read as "the turn sealed nothing", which is one of the answers this
|
|
230
|
-
* exists to tell apart, and an `mcp` member is never invented for a turn the
|
|
231
|
-
* facade did not observe. Numbers, names, timings, closed vocabularies and one
|
|
232
|
-
* already-redacted reason. A fault publishes a classification, never a message
|
|
233
|
-
* that could quote the bad line. And it cannot fail the trial: every fault
|
|
234
|
-
* becomes a classification or absence.
|
|
235
|
-
*/
|
|
236
|
-
export async function readSealedBrokerSeal(launch, options = {}) {
|
|
237
|
-
if (!isGrokLaunch(launch))
|
|
238
|
-
return undefined;
|
|
239
|
-
const bound = schedule(options);
|
|
240
|
-
if (!bound)
|
|
241
|
-
return undefined;
|
|
242
|
-
const file = join(dirname(launch.broker.usageLedgerPath), 'turns.jsonl');
|
|
243
|
-
for (let attempt = 0; attempt < bound.attempts; attempt++) {
|
|
244
|
-
if (attempt > 0)
|
|
245
|
-
await pause(bound.intervalMs);
|
|
246
|
-
try {
|
|
247
|
-
const rows = await readSealedGrokTurnSeals(file, launch.agent.id, launch.agent.model);
|
|
248
|
-
if (!rows.length)
|
|
249
|
-
continue;
|
|
250
|
-
const records = rows.slice(-publishedSeals).map(sealRecord);
|
|
251
|
-
return { schema: BROKER_SEAL_SCHEMA, outcome: 'read', read: rows.length,
|
|
252
|
-
outstanding: records.reduce((total, row) => total + (row.mcp?.outstanding.length ?? 0), 0),
|
|
253
|
-
openTunnels: records.reduce((total, row) => total + (row.mcp?.tunnels?.open.length ?? 0), 0), rows: records };
|
|
254
|
-
}
|
|
255
|
-
catch (error) {
|
|
256
|
-
return { schema: BROKER_SEAL_SCHEMA, outcome: 'unreadable', failure: classify(error) };
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
return undefined;
|
|
260
|
-
}
|
|
261
|
-
//# sourceMappingURL=sealed-usage.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sealed-usage.js","sourceRoot":"","sources":["../../../../../src/runtime/daimon/training/native/sealed-usage.ts"],"names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,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;YAC5D,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM;gBACrE,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,WAAW,CAAC,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;gBAC1F,WAAW,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QAClH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAAC,OAAO,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAAC,CAAC;IAC7G,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { NativeActivity, NativeConfig, NativeReceipt, NativeTrace, TerminalEvidence } from './worker/index.js';
|
|
2
|
-
import type { SubjectStart } from '../../../../training/index.js';
|
|
3
|
-
import { type NativeSandboxProjection, type VerifiedNativeLaunch } from './receipt/index.js';
|
|
4
|
-
import { type DockerCommand } from './container/index.js';
|
|
5
|
-
export declare function configFixture(root?: string): NativeConfig;
|
|
6
|
-
export declare const executionId = "11111111-1111-4111-8111-111111111111";
|
|
7
|
-
export declare function receiptFixture(): NativeReceipt;
|
|
8
|
-
export declare function traceFixture(): NativeTrace;
|
|
9
|
-
export declare function activityFixture(active?: boolean): NativeActivity;
|
|
10
|
-
/** Terminal failure before admission, matching the retained run-39 public projections. */
|
|
11
|
-
export declare function unadmittedFixture(trialId?: string, wakeId?: string): TerminalEvidence;
|
|
12
|
-
export declare function sandboxProjectionFixture(agentId?: string, workspacePath?: string, runtimeHomePath?: string): NativeSandboxProjection;
|
|
13
|
-
export declare function writeSandboxProjectionFixture(launch: VerifiedNativeLaunch, trialId: string): Promise<void>;
|
|
14
|
-
export declare function launchFixture(): Promise<{
|
|
15
|
-
root: string;
|
|
16
|
-
input: SubjectStart;
|
|
17
|
-
launch: VerifiedNativeLaunch;
|
|
18
|
-
save(): Promise<void>;
|
|
19
|
-
}>;
|
|
20
|
-
/** Explicit unit command double; never native runtime acceptance evidence. */
|
|
21
|
-
export declare function dockerFixture(launch: VerifiedNativeLaunch, trialId: string): {
|
|
22
|
-
run: DockerCommand;
|
|
23
|
-
calls: string[][];
|
|
24
|
-
forgeOwner: () => void;
|
|
25
|
-
requireKill: () => void;
|
|
26
|
-
setTerminal: (value: unknown) => void;
|
|
27
|
-
};
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { chmod, mkdtemp, mkdir, realpath, writeFile } from 'node:fs/promises';
|
|
2
|
-
import { tmpdir } from 'node:os';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
import { bindNativeSandboxProjection, sha256 } from './receipt/index.js';
|
|
5
|
-
import { ownerLabel } from './container/index.js';
|
|
6
|
-
import { DAIMON_CODEX_SUBSCRIPTION_REALM } from '../../index.js';
|
|
7
|
-
export function configFixture(root = '/isolated') {
|
|
8
|
-
return { version: 'noopolis.daimon.organization-runtime.v2',
|
|
9
|
-
host: { bindHost: '127.0.0.1', port: 19700, controlTokenEnv: 'TRIAL_TOKEN' },
|
|
10
|
-
agents: [{ id: 'agent:writer', name: 'writer', instructions: 'Compiler-owned identity',
|
|
11
|
-
workspacePath: `${root}/workspace`, runtimeHomePath: `${root}/runtime`,
|
|
12
|
-
engine: { kind: 'codex', model: 'test-model-v1', codexSandbox: { mode: 'workspace-write', networkAccess: false, webSearch: 'disabled' } },
|
|
13
|
-
attention: { maxBatchMessages: 8, maxBatchBytes: 12000, maxExecutions: 30, maxTokens: 8000000 },
|
|
14
|
-
schedule: { kind: 'disabled' }, memory: { runtimeHomePath: `${root}/memory` },
|
|
15
|
-
moltnet: { cliPath: '/usr/local/bin/moltnet', configPath: `${root}/client.json`,
|
|
16
|
-
networks: [{ id: 'local-test', rooms: ['tasks', 'results'], dms: false }] },
|
|
17
|
-
mcp: [{ name: 'project', transport: 'stdio', command: '/usr/local/bin/node', args: [], env: {}, tools: ['save_record'] },
|
|
18
|
-
{ name: 'validation', transport: 'stdio', command: '/usr/local/bin/node', args: [], env: {}, tools: ['validate_record'] }] }] };
|
|
19
|
-
}
|
|
20
|
-
export const executionId = '11111111-1111-4111-8111-111111111111';
|
|
21
|
-
export function receiptFixture() {
|
|
22
|
-
return { version: 'noopolis.daimon.wake-receipt-status.v2', acceptance_id: '22222222-2222-4222-8222-222222222222',
|
|
23
|
-
agent_id: 'agent:writer', delivery_id: 'trial:wake', request_digest: 'a'.repeat(64), state: 'completed',
|
|
24
|
-
accepted_at: '2026-09-13T00:00:00.000Z', updated_at: '2026-09-13T00:00:01.000Z', execution_id: executionId, text: '' };
|
|
25
|
-
}
|
|
26
|
-
export function traceFixture() {
|
|
27
|
-
return { schema: 'daimon.turn_trace.v1', agent_id: 'agent:writer', turn_id: executionId,
|
|
28
|
-
started_at: '2026-09-13T00:00:00.000Z', completed_at: '2026-09-13T00:00:01.000Z', status: 'completed', tools: [] };
|
|
29
|
-
}
|
|
30
|
-
export function activityFixture(active = false) {
|
|
31
|
-
return { version: 'noopolis.daimon.organization-runtime-activity.v2', items: [{ ...receiptFixture(), active }],
|
|
32
|
-
executions: active ? [{ agent_id: 'agent:writer', execution_id: executionId, delivery_ids: ['trial:wake'], state: 'running' }] : [] };
|
|
33
|
-
}
|
|
34
|
-
/** Terminal failure before admission, matching the retained run-39 public projections. */
|
|
35
|
-
export function unadmittedFixture(trialId = 'trial', wakeId = 'task') {
|
|
36
|
-
const receipt = { ...receiptFixture(), delivery_id: `${trialId}:${wakeId}`, state: 'accepted' };
|
|
37
|
-
delete receipt.execution_id;
|
|
38
|
-
return { schema: 'spawnfile.training.daimon-native.trial.v1', trialId, wakeId, agentId: 'agent:writer', model: 'test-model-v1',
|
|
39
|
-
configSha256: 'a'.repeat(64), scheduleOverride: 'disabled', status: 'failed',
|
|
40
|
-
startedAt: receipt.accepted_at, completedAt: receipt.updated_at, receipt,
|
|
41
|
-
activity: { version: 'noopolis.daimon.organization-runtime-activity.v2', items: [{ ...receipt, active: false }], executions: [] },
|
|
42
|
-
availability: { version: 'noopolis.daimon.work-availability.v1', state: 'paused', agents: [{ agent_id: receipt.agent_id,
|
|
43
|
-
pending: 1, running: false, deferred: 0, budget: { armed: true, epoch: trialId,
|
|
44
|
-
executions_used: 0, agent_executions_used: 0, tokens_used: 0, agent_tokens_used: 0 } }] },
|
|
45
|
-
native: { traces: [], usage: [], toolReceipts: [], modelContexts: [], accounting: { usage: [], coverage: 'absent' } },
|
|
46
|
-
coverage: ['tools', 'output', 'usage'].map(channel => ({ channel: channel, completeness: 'absent', ordering: 'none' })),
|
|
47
|
-
error: 'Native execution failed before terminal telemetry' };
|
|
48
|
-
}
|
|
49
|
-
export function sandboxProjectionFixture(agentId = 'agent:writer', workspacePath = '/native/workspace', runtimeHomePath = '/native/home') {
|
|
50
|
-
const permissionConfig = 'permissions={unit={extends=":workspace",network={enabled=false}}}';
|
|
51
|
-
return { version: 'noopolis.daimon.codex-sandbox-projection.v1', agentId, workspacePath, runtimeHomePath,
|
|
52
|
-
engineHomePath: `${runtimeHomePath}/.codex`, executablePath: '/unit/codex', profileName: 'unit', permissionConfig,
|
|
53
|
-
sandboxArgs: ['sandbox', '-P', 'unit', '-C', workspacePath, '-c', permissionConfig] };
|
|
54
|
-
}
|
|
55
|
-
export async function writeSandboxProjectionFixture(launch, trialId) {
|
|
56
|
-
const projection = sandboxProjectionFixture(launch.agent.id, launch.workspace.target, launch.projections.find(item => item.role === 'home').target);
|
|
57
|
-
await writeFile(join(launch.controlRoot, 'sandbox-projection.json'), JSON.stringify(bindNativeSandboxProjection(projection, trialId, launch.configSha256)), { mode: 0o600 });
|
|
58
|
-
}
|
|
59
|
-
export async function launchFixture() {
|
|
60
|
-
const root = await realpath(await mkdtemp(join(tmpdir(), 'native-adapter-unit-')));
|
|
61
|
-
const workspace = join(root, 'workspace');
|
|
62
|
-
const runtime = join(root, 'runtime');
|
|
63
|
-
const native = join(runtime, 'native');
|
|
64
|
-
for (const directory of [workspace, join(root, 'control'), join(native, 'home'), join(native, 'memory'), join(native, 'state'),
|
|
65
|
-
join(native, 'inputs'), join(native, 'acceptance'), join(root, 'worker'), join(root, 'bootstrap'), join(root, 'account')]) {
|
|
66
|
-
await mkdir(directory, { recursive: true, mode: 0o700 });
|
|
67
|
-
}
|
|
68
|
-
const instructions = 'Compiler-owned identity';
|
|
69
|
-
await writeFile(join(root, 'codex-bootstrap'), 'unit-bootstrap-never-a-login', { mode: 0o600 });
|
|
70
|
-
await writeFile(join(workspace, 'AGENTS.md'), instructions);
|
|
71
|
-
const inputs = join(native, 'inputs');
|
|
72
|
-
const config = configFixture('/native');
|
|
73
|
-
config.agents[0].runtimeHomePath = '/native/home';
|
|
74
|
-
const bytes = JSON.stringify(config);
|
|
75
|
-
await writeFile(join(inputs, 'config.json'), bytes);
|
|
76
|
-
await writeFile(join(inputs, 'token'), 'unit-secret-that-is-not-a-login', { mode: 0o600 });
|
|
77
|
-
await writeFile(join(inputs, 'environment'), 'TRIAL_FIXTURE=unit\n');
|
|
78
|
-
const launch = {
|
|
79
|
-
schema: 'spawnfile.training.daimon-native.launch.v1', receiptFile: join(runtime, 'native-launch.json'),
|
|
80
|
-
image: `sha256:${'a'.repeat(64)}`, config: join(inputs, 'config.json'), configSha256: sha256(bytes), sourceConfigSha256: sha256(bytes),
|
|
81
|
-
tokenFile: join(inputs, 'token'), envFile: join(inputs, 'environment'), controlRoot: join(native, 'acceptance'), workerRoot: join(root, 'worker'),
|
|
82
|
-
bootstrap: { root: join(root, 'bootstrap'), entrypoint: 'bootstrap.js' }, host: { bindHost: '127.0.0.1', port: 19700 },
|
|
83
|
-
agent: { id: 'agent:writer', engine: 'codex', model: 'test-model-v1' }, instructions: { relativePath: 'AGENTS.md', sha256: sha256(instructions),
|
|
84
|
-
rendering: { kind: 'trim-surround', prefix: '', suffix: '', nativeSha256: sha256(instructions) } },
|
|
85
|
-
workspace: { source: workspace, target: '/native/workspace' },
|
|
86
|
-
projections: [{ role: 'home', source: join(native, 'home'), target: '/native/home' },
|
|
87
|
-
{ role: 'memory', source: join(native, 'memory'), target: '/native/memory' },
|
|
88
|
-
{ role: 'state', source: join(native, 'state'), target: '/native/state' },
|
|
89
|
-
{ role: 'subscription', source: join(root, 'account'), target: DAIMON_CODEX_SUBSCRIPTION_REALM.durableMountPath }],
|
|
90
|
-
credentials: [{ source: join(root, 'codex-bootstrap'), target: DAIMON_CODEX_SUBSCRIPTION_REALM.bootstrapMountPath }],
|
|
91
|
-
limits: { maxTokens: 8000000, wakeTokenCeiling: 1000000 },
|
|
92
|
-
overrides: { schedule: { before: { kind: 'every', interval_ms: 60000 }, after: { kind: 'disabled' }, reason: 'Isolated single trial' },
|
|
93
|
-
selection: { before: ['agent:writer', 'agent:editor'], after: ['agent:writer'], reason: 'Selected subject only' } },
|
|
94
|
-
};
|
|
95
|
-
const input = { trialId: 'unit-trial', workspacePath: workspace, runtimeHomePath: runtime,
|
|
96
|
-
protectedPaths: [runtime, join(root, 'control')], instructions, model: 'test-model-v1', onObservation: () => undefined };
|
|
97
|
-
const save = async () => { const { receiptFile, ...receipt } = launch; await writeFile(receiptFile, JSON.stringify(receipt), { mode: 0o600 }); await chmod(receiptFile, 0o600); };
|
|
98
|
-
await save();
|
|
99
|
-
return { root, input, launch, save };
|
|
100
|
-
}
|
|
101
|
-
/** Explicit unit command double; never native runtime acceptance evidence. */
|
|
102
|
-
export function dockerFixture(launch, trialId) {
|
|
103
|
-
const calls = [];
|
|
104
|
-
let owner = '';
|
|
105
|
-
let exists = false;
|
|
106
|
-
let running = false;
|
|
107
|
-
let forged = false;
|
|
108
|
-
let stickyStop = false;
|
|
109
|
-
let terminal;
|
|
110
|
-
const run = async (args, options) => {
|
|
111
|
-
calls.push(args);
|
|
112
|
-
const response = (value) => ({ code: 0, stdout: typeof value === 'string' ? value : JSON.stringify(value), stderr: '' });
|
|
113
|
-
if (args[0] === 'context')
|
|
114
|
-
return response('"unix:///unit-docker.sock"');
|
|
115
|
-
if (args[0] === 'create') {
|
|
116
|
-
owner = args.find(value => value.startsWith(`${ownerLabel}=`)).slice(ownerLabel.length + 1);
|
|
117
|
-
exists = true;
|
|
118
|
-
return response('b'.repeat(64));
|
|
119
|
-
}
|
|
120
|
-
if (args[0] === 'inspect')
|
|
121
|
-
return exists ? response({ Id: 'b'.repeat(64), State: { Running: running, Status: running ? 'running' : 'exited', ExitCode: 0 }, Config: { Labels: { [ownerLabel]: forged ? 'foreign' : owner }, Image: launch.image } })
|
|
122
|
-
: { code: 1, stdout: '', stderr: 'Error: No such object' };
|
|
123
|
-
if (args[0] === 'start') {
|
|
124
|
-
await writeSandboxProjectionFixture(launch, trialId);
|
|
125
|
-
running = true;
|
|
126
|
-
return response('started');
|
|
127
|
-
}
|
|
128
|
-
if (args[0] === 'logs')
|
|
129
|
-
return response({ schema: 'spawnfile.training.daimon-native.ready.v1', trialId, configSha256: launch.configSha256 });
|
|
130
|
-
if (args[0] === 'exec') {
|
|
131
|
-
const request = JSON.parse(options?.stdin ?? '{}');
|
|
132
|
-
if (request.path === 'sandbox-preflight')
|
|
133
|
-
return response({ schema: 'spawnfile.training.daimon-native.sandbox-preflight.v1', modelCallsMade: 0,
|
|
134
|
-
checks: { namespace: true, workspaceRead: true, workspaceWrite: true, runDenied: true, authDenied: true, ingressDenied: true, networkDenied: true } });
|
|
135
|
-
if (request.path === 'native-policy-preflight')
|
|
136
|
-
return response({ schema: 'spawnfile.training.daimon-native.policy-preflight.v1',
|
|
137
|
-
projectionSha256: request.projectionSha256, modelCallsMade: 0, workspaceReadWrite: true });
|
|
138
|
-
if (request.path === '/trial/health')
|
|
139
|
-
return response({ version: 'noopolis.daimon.organization-runtime-health.v1', state: 'running', agents: [{ agentId: launch.agent.id }] });
|
|
140
|
-
if (request.path === '/trial/stop')
|
|
141
|
-
return response({ state: 'acknowledged' });
|
|
142
|
-
if (request.path === '/trial/run')
|
|
143
|
-
return response(terminal);
|
|
144
|
-
}
|
|
145
|
-
if (args[0] === 'stop') {
|
|
146
|
-
if (!stickyStop)
|
|
147
|
-
running = false;
|
|
148
|
-
return response('stopped');
|
|
149
|
-
}
|
|
150
|
-
if (args[0] === 'kill') {
|
|
151
|
-
running = false;
|
|
152
|
-
return response('killed');
|
|
153
|
-
}
|
|
154
|
-
if (args[0] === 'rm') {
|
|
155
|
-
exists = false;
|
|
156
|
-
return response('removed');
|
|
157
|
-
}
|
|
158
|
-
throw new Error(`Unexpected unit Docker command: ${args[0]}`);
|
|
159
|
-
};
|
|
160
|
-
return { run, calls, forgeOwner: () => { forged = true; }, requireKill: () => { stickyStop = true; }, setTerminal: (value) => { terminal = value; } };
|
|
161
|
-
}
|
|
162
|
-
//# sourceMappingURL=test-fixtures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-fixtures.js","sourceRoot":"","sources":["../../../../../src/runtime/daimon/training/native/test-fixtures.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,2BAA2B,EAAE,MAAM,EAA2D,MAAM,oBAAoB,CAAC;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,GAAG,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,KAAc,EAAE,EAAE,GAAG,QAAQ,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AACjK,CAAC"}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { type WithholdDetector } from './child/index.js';
|
|
2
|
-
import type { NativeTrace } from './worker/index.js';
|
|
3
|
-
/**
|
|
4
|
-
* Recovers what the engine was actually asked, and what it actually answered.
|
|
5
|
-
*
|
|
6
|
-
* Daimon reduces both to a digest and a character count before either leaves
|
|
7
|
-
* its runtime, which is enough to detect a change and not enough to diagnose
|
|
8
|
-
* one: a turn that files nothing looks identical to a turn that was never asked
|
|
9
|
-
* to. The Grok CLI writes its own transcript inside the Daimon-owned
|
|
10
|
-
* `$GROK_HOME`, the same runtime home this adapter already reads tool receipts
|
|
11
|
-
* and closed traces from, so the text is recoverable as observed evidence
|
|
12
|
-
* rather than reconstructed from the adapter's side of the wake.
|
|
13
|
-
*
|
|
14
|
-
* This capture is operator-only. Every trial observation persists at `raw`
|
|
15
|
-
* visibility, which no viewer, optimizer or evaluator projection can read, and
|
|
16
|
-
* it is published as a `diagnostic` so it never becomes `snapshot.output`, a
|
|
17
|
-
* captured tool call, or any judge's input. Nothing here changes what a trial
|
|
18
|
-
* evaluates.
|
|
19
|
-
*/
|
|
20
|
-
export declare const NATIVE_TRANSCRIPT_SCHEMA = "spawnfile.training.daimon-native.transcript.v1";
|
|
21
|
-
export interface NativeTranscriptText {
|
|
22
|
-
chars: number;
|
|
23
|
-
sha256: string;
|
|
24
|
-
/** Present only when redaction left nothing credential-shaped behind. */
|
|
25
|
-
text?: string;
|
|
26
|
-
truncated: boolean;
|
|
27
|
-
redaction: 'applied' | 'withheld';
|
|
28
|
-
detectors?: readonly WithholdDetector[];
|
|
29
|
-
}
|
|
30
|
-
export interface NativeTranscriptSession {
|
|
31
|
-
sessionId: string;
|
|
32
|
-
rows: number;
|
|
33
|
-
/** The wake text the engine received, unwrapped from the CLI's own query envelope when it used one. */
|
|
34
|
-
prompt?: NativeTranscriptText;
|
|
35
|
-
promptEnvelope: 'user_query' | 'bare' | 'absent';
|
|
36
|
-
/** The engine's final assistant message. */
|
|
37
|
-
reply?: NativeTranscriptText;
|
|
38
|
-
}
|
|
39
|
-
export interface NativeTranscriptCapture {
|
|
40
|
-
schema: typeof NATIVE_TRANSCRIPT_SCHEMA;
|
|
41
|
-
engine: 'grok';
|
|
42
|
-
sessions: NativeTranscriptSession[];
|
|
43
|
-
/** Which session this turn's closed Daimon trace identifies, when it identifies one. */
|
|
44
|
-
selected?: string;
|
|
45
|
-
/** Daimon's own reduction of the same turn, the only thing that can confirm this capture. */
|
|
46
|
-
trace?: {
|
|
47
|
-
turnId: string;
|
|
48
|
-
promptSha256?: string;
|
|
49
|
-
promptChars?: number;
|
|
50
|
-
replyChars?: number;
|
|
51
|
-
};
|
|
52
|
-
agreement: {
|
|
53
|
-
promptSha256: 'match' | 'differs' | 'unknown';
|
|
54
|
-
replyChars: 'match' | 'differs' | 'unknown';
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Publishes a transcript field, or refuses to.
|
|
59
|
-
*
|
|
60
|
-
* The digest and the character count are identities, never secrets, so they
|
|
61
|
-
* publish unconditionally — they are what Daimon's trace can be checked
|
|
62
|
-
* against. The text itself publishes only when the shared native redactor finds
|
|
63
|
-
* nothing credential-shaped left in it; otherwise the named detectors say why
|
|
64
|
-
* the bytes were withheld, which is the difference between "the reply could not
|
|
65
|
-
* be published" and "there was no reply".
|
|
66
|
-
*/
|
|
67
|
-
export declare function transcriptText(value: string): NativeTranscriptText;
|
|
68
|
-
/**
|
|
69
|
-
* The wake text and the final reply in one session transcript.
|
|
70
|
-
*
|
|
71
|
-
* The CLI prepends its own user rows (environment, skills, reminders) before the
|
|
72
|
-
* wake, and wraps the wake itself in `<user_query>`. The last wrapped row is
|
|
73
|
-
* therefore the delivered prompt; a transcript with no wrapper at all reports
|
|
74
|
-
* the last user row as `bare` rather than silently presenting a CLI preamble as
|
|
75
|
-
* the assignment.
|
|
76
|
-
*/
|
|
77
|
-
export declare function parseGrokTranscript(id: string, lines: readonly string[]): NativeTranscriptSession;
|
|
78
|
-
/**
|
|
79
|
-
* Which captured session is the turn Daimon closed.
|
|
80
|
-
*
|
|
81
|
-
* The digest is the only authority: one session whose prompt hashes to what the
|
|
82
|
-
* trace recorded IS that turn. Failing that, a single captured session in an
|
|
83
|
-
* isolated trial is it by construction. Anything else selects nothing rather
|
|
84
|
-
* than guessing, and every session still publishes.
|
|
85
|
-
*/
|
|
86
|
-
export declare function selectTranscriptSession(sessions: readonly NativeTranscriptSession[], promptSha256?: string): NativeTranscriptSession | undefined;
|
|
87
|
-
/** Daimon's `daimon.turn_trace.v1` reduction of the same turn, read structurally. */
|
|
88
|
-
export declare function traceReduction(trace: NativeTrace | undefined): NativeTranscriptCapture['trace'];
|
|
89
|
-
/**
|
|
90
|
-
* Reads the engine's own transcript out of the Daimon-owned engine home.
|
|
91
|
-
*
|
|
92
|
-
* Returns `undefined` when there is nothing to publish, so a Codex trial and a
|
|
93
|
-
* turn whose runtime home was already recycled both stay silent rather than
|
|
94
|
-
* publishing an empty capture that reads like evidence.
|
|
95
|
-
*/
|
|
96
|
-
export declare function readNativeTranscript(runtimeHome: string, trace?: NativeTrace): Promise<NativeTranscriptCapture | undefined>;
|