spawnfile 0.1.14 → 0.1.18
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 +60 -159
- package/dist/audit/checksShared.d.ts +1 -1
- package/dist/auth/importers.d.ts +10 -0
- package/dist/auth/importers.js +46 -5
- package/dist/auth/index.d.ts +3 -0
- package/dist/auth/index.js +2 -0
- package/dist/auth/paths.d.ts +1 -1
- package/dist/auth/profileStore.js +13 -10
- package/dist/auth/targetSecretSourceFsIdentity.d.ts +40 -0
- package/dist/auth/targetSecretSourceFsIdentity.js +42 -0
- package/dist/auth/targetSecretSourceFsPublish.d.ts +2 -0
- package/dist/auth/targetSecretSourceFsPublish.js +3 -1
- package/dist/auth/targetSecretSourceFsPublishImmutable.d.ts +2 -1
- package/dist/auth/targetSecretSourceFsPublishImmutable.js +104 -71
- package/dist/auth/targetSecretSourceFsRead.js +5 -14
- package/dist/auth/trainingAuth.d.ts +21 -0
- package/dist/auth/trainingAuth.js +86 -0
- package/dist/auth/trainingGrokWriteback.d.ts +4 -0
- package/dist/auth/trainingGrokWriteback.js +119 -0
- package/dist/auth/trainingGrokWritebackLock.d.ts +5 -0
- package/dist/auth/trainingGrokWritebackLock.js +56 -0
- package/dist/auth/types.d.ts +1 -1
- package/dist/cli/authCommands.d.ts +1 -1
- package/dist/cli/authCommands.js +18 -5
- package/dist/cli/canaryCutoverCommand.d.ts +2 -0
- package/dist/cli/canaryCutoverCommand.js +30 -0
- package/dist/cli/capabilitiesCommand.d.ts +3 -0
- package/dist/cli/capabilitiesCommand.js +12 -0
- package/dist/cli/capabilitiesReceipt.d.ts +56 -0
- package/dist/cli/capabilitiesReceipt.js +56 -0
- package/dist/cli/compileBuildCommands.js +17 -0
- package/dist/cli/composedLifecycleContractSet.d.ts +21 -0
- package/dist/cli/composedLifecycleContractSet.js +204 -0
- package/dist/cli/devCommands.js +6 -2
- package/dist/cli/downCommand.d.ts +2 -0
- package/dist/cli/downCommand.js +22 -8
- package/dist/cli/envFileOption.d.ts +18 -0
- package/dist/cli/envFileOption.js +20 -0
- package/dist/cli/evidenceExportHelperCommand.d.ts +13 -0
- package/dist/cli/evidenceExportHelperCommand.js +51 -0
- package/dist/cli/index.js +12 -3
- package/dist/cli/lifecycleCommands.d.ts +1 -1
- package/dist/cli/lifecycleCommands.js +3 -1
- package/dist/cli/lifecycleMachine.d.ts +7 -1
- package/dist/cli/lifecycleMachine.js +2 -2
- package/dist/cli/lifecyclePlan.d.ts +1 -0
- package/dist/cli/lifecyclePlan.js +2 -0
- package/dist/cli/paideiaDelegation.d.ts +18 -0
- package/dist/cli/paideiaDelegation.js +211 -0
- package/dist/cli/paideiaSupervisor.d.ts +17 -0
- package/dist/cli/paideiaSupervisor.js +48 -0
- package/dist/cli/productStateCloneCommand.d.ts +2 -0
- package/dist/cli/productStateCloneCommand.js +34 -0
- package/dist/cli/recordCommands.d.ts +17 -0
- package/dist/cli/recordCommands.js +43 -0
- package/dist/cli/releaseCommand.d.ts +6 -0
- package/dist/cli/releaseCommand.js +91 -0
- package/dist/cli/runCli.d.ts +19 -3
- package/dist/cli/runCli.js +43 -10
- package/dist/cli/runPublishCommands.js +5 -3
- package/dist/cli/targetCommands.d.ts +4 -7
- package/dist/cli/targetCommands.js +16 -46
- package/dist/cli/targetConfigPreparedPlan.d.ts +3 -0
- package/dist/cli/targetConfigPreparedPlan.js +74 -0
- package/dist/cli/targetConfigResolver.d.ts +3 -0
- package/dist/cli/targetConfigResolver.js +111 -0
- package/dist/cli/targetConfigResolverCommand.d.ts +6 -0
- package/dist/cli/targetConfigResolverCommand.js +43 -0
- package/dist/cli/targetConfigResolverContracts.d.ts +56 -0
- package/dist/cli/targetConfigResolverContracts.js +30 -0
- package/dist/cli/targetConfigResolverDocker.d.ts +4 -0
- package/dist/cli/targetConfigResolverDocker.js +47 -0
- package/dist/cli/targetConfigResolverValidation.d.ts +10 -0
- package/dist/cli/targetConfigResolverValidation.js +94 -0
- package/dist/cli/targetDefaultAuthorities.d.ts +2 -0
- package/dist/cli/targetDefaultAuthorities.js +3 -0
- package/dist/cli/targetDefaultConfig.d.ts +7 -0
- package/dist/cli/targetDefaultConfig.js +22 -5
- package/dist/cli/targetDefaultConfigStdin.js +7 -1
- package/dist/cli/targetDefaultHandlerFactory.js +23 -2
- package/dist/cli/targetDefaultHandlers.d.ts +2 -2
- package/dist/cli/targetProductionCommands.d.ts +5 -0
- package/dist/cli/targetProductionCommands.js +45 -0
- package/dist/cli/trainCommand.d.ts +3 -0
- package/dist/cli/trainCommand.js +114 -0
- package/dist/cli/upCommand.js +40 -7
- package/dist/cli/upLifecycleRecovery.d.ts +2 -2
- package/dist/cli/upLifecycleRecovery.js +188 -44
- package/dist/cli/usageCommand.d.ts +40 -0
- package/dist/cli/usageCommand.js +284 -0
- package/dist/cli/usageCommandLive.d.ts +84 -0
- package/dist/cli/usageCommandLive.js +95 -0
- package/dist/cli/usageDeploymentSource.d.ts +9 -0
- package/dist/cli/usageDeploymentSource.js +22 -0
- package/dist/cli/volumeCommands.d.ts +8 -0
- package/dist/cli/volumeCommands.js +53 -0
- package/dist/cli/workspaceResourceMigrationCommand.d.ts +8 -0
- package/dist/cli/workspaceResourceMigrationCommand.js +36 -0
- package/dist/compiler/agentNodeMerge.js +3 -2
- package/dist/compiler/buildCompilePlan.js +4 -0
- package/dist/compiler/buildCompilePlanAgent.js +3 -1
- package/dist/compiler/buildCompilePlanTeams.d.ts +1 -1
- package/dist/compiler/buildCompilePlanTeams.js +6 -1
- package/dist/compiler/buildCompilePlanTraversal.js +2 -0
- package/dist/compiler/buildCompilePlanTraversalHelpers.d.ts +2 -2
- package/dist/compiler/buildCompilePlanTraversalHelpers.js +4 -3
- package/dist/compiler/buildProject.d.ts +10 -0
- package/dist/compiler/buildProject.js +14 -2
- package/dist/compiler/cleanCompileOutput.d.ts +2 -0
- package/dist/compiler/cleanCompileOutput.js +14 -0
- package/dist/compiler/compilePlanHelpers.js +5 -0
- package/dist/compiler/compileProject.d.ts +12 -0
- package/dist/compiler/compileProject.js +33 -3
- package/dist/compiler/compileProjectSupport.js +9 -0
- package/dist/compiler/containerArtifactSummaries.js +1 -0
- package/dist/compiler/containerArtifacts.d.ts +7 -5
- package/dist/compiler/containerArtifacts.js +77 -41
- package/dist/compiler/containerArtifactsPlans.d.ts +1 -1
- package/dist/compiler/containerArtifactsPlans.js +31 -7
- package/dist/compiler/containerArtifactsRender.d.ts +2 -1
- package/dist/compiler/containerArtifactsRender.js +91 -58
- package/dist/compiler/containerArtifactsTypes.d.ts +15 -0
- package/dist/compiler/containerBackedMountRender.d.ts +56 -0
- package/dist/compiler/containerBackedMountRender.js +101 -0
- package/dist/compiler/containerDaimonBrokerRender.d.ts +114 -0
- package/dist/compiler/containerDaimonBrokerRender.js +194 -0
- package/dist/compiler/containerDaimonGrokTaskClock.d.ts +5 -0
- package/dist/compiler/containerDaimonGrokTaskClock.js +29 -0
- package/dist/compiler/containerDaimonGrokWorkerProvisioning.d.ts +38 -0
- package/dist/compiler/containerDaimonGrokWorkerProvisioning.js +130 -0
- package/dist/compiler/containerDaimonGrokWorkerRender.d.ts +197 -0
- package/dist/compiler/containerDaimonGrokWorkerRender.js +281 -0
- package/dist/compiler/containerDaimonOwnershipGuardRender.d.ts +25 -0
- package/dist/compiler/containerDaimonOwnershipGuardRender.js +204 -0
- package/dist/compiler/containerDaimonUidEntrypointRender.d.ts +24 -0
- package/dist/compiler/containerDaimonUidEntrypointRender.js +291 -0
- package/dist/compiler/containerEntrypointRender.d.ts +7 -0
- package/dist/compiler/containerEntrypointRender.js +28 -22
- package/dist/compiler/containerPersistentMounts.d.ts +30 -0
- package/dist/compiler/containerPersistentMounts.js +66 -0
- package/dist/compiler/containerReadinessPaths.d.ts +1 -0
- package/dist/compiler/containerReadinessPaths.js +1 -0
- package/dist/compiler/containerRuntimeLinkMaterializer.d.ts +2 -0
- package/dist/compiler/containerRuntimeLinkMaterializer.js +12 -0
- package/dist/compiler/containerRuntimeReadinessRender.d.ts +7 -0
- package/dist/compiler/containerRuntimeReadinessRender.js +40 -0
- package/dist/compiler/containerStateOwnershipRender.d.ts +4 -0
- package/dist/compiler/containerStateOwnershipRender.js +75 -0
- package/dist/compiler/containerTargetResources.d.ts +32 -1
- package/dist/compiler/containerTargetResources.js +115 -15
- package/dist/compiler/containerVolumeBootstrap.d.ts +3 -0
- package/dist/compiler/containerVolumeBootstrap.js +3 -0
- package/dist/compiler/containerWorkspaceResourceRender.js +52 -1
- package/dist/compiler/daimonTelemetryArtifacts.d.ts +2 -2
- package/dist/compiler/daimonTelemetryArtifacts.js +5 -10
- package/dist/compiler/deploymentLineage.d.ts +40 -0
- package/dist/compiler/deploymentLineage.js +50 -0
- package/dist/compiler/index.d.ts +5 -0
- package/dist/compiler/index.js +5 -0
- package/dist/compiler/initProject.d.ts +2 -0
- package/dist/compiler/initProject.js +39 -1
- package/dist/compiler/localMoltnetAuthority.d.ts +64 -0
- package/dist/compiler/localMoltnetAuthority.js +177 -0
- package/dist/compiler/mcpPlaceholders.d.ts +11 -0
- package/dist/compiler/mcpPlaceholders.js +58 -0
- package/dist/compiler/mcpServerInheritance.d.ts +18 -0
- package/dist/compiler/mcpServerInheritance.js +43 -0
- package/dist/compiler/memoryArtifacts.d.ts +1 -1
- package/dist/compiler/memoryArtifacts.js +108 -32
- package/dist/compiler/modelEnv.d.ts +5 -0
- package/dist/compiler/modelEnv.js +8 -2
- package/dist/compiler/moltnetArtifactPaths.d.ts +17 -12
- package/dist/compiler/moltnetArtifactPaths.js +17 -15
- package/dist/compiler/moltnetArtifactTypes.d.ts +11 -0
- package/dist/compiler/moltnetArtifacts.d.ts +1 -1
- package/dist/compiler/moltnetArtifacts.js +53 -12
- package/dist/compiler/moltnetBinaries.d.ts +16 -4
- package/dist/compiler/moltnetBinaries.js +46 -6
- package/dist/compiler/moltnetClientConfig.js +1 -1
- package/dist/compiler/moltnetConfigLowering.d.ts +3 -1
- package/dist/compiler/moltnetConfigLowering.js +30 -6
- package/dist/compiler/moltnetNodeConfig.js +1 -1
- package/dist/compiler/moltnetReleaseAuthority.d.ts +24 -1
- package/dist/compiler/moltnetReleaseAuthority.js +33 -4
- package/dist/compiler/moltnetRepresentativeResolution.d.ts +1 -1
- package/dist/compiler/moltnetRepresentativeResolution.js +2 -2
- package/dist/compiler/moltnetResolution.js +9 -15
- package/dist/compiler/moltnetRoomMemberships.js +20 -5
- package/dist/compiler/moltnetRoomPolicyCompatibility.d.ts +1 -1
- package/dist/compiler/moltnetRoomPolicyCompatibility.js +3 -1
- package/dist/compiler/moltnetRuntimeConfig.d.ts +1 -1
- package/dist/compiler/moltnetRuntimeConfig.js +22 -2
- package/dist/compiler/moltnetServerPlans.js +19 -0
- package/dist/compiler/organizationExternalParticipants.d.ts +3 -0
- package/dist/compiler/organizationExternalParticipants.js +176 -0
- package/dist/compiler/organizationIdentity.d.ts +3 -9
- package/dist/compiler/organizationIdentity.js +37 -270
- package/dist/compiler/organizationIdentityGraph.d.ts +15 -0
- package/dist/compiler/organizationIdentityGraph.js +115 -0
- package/dist/compiler/organizationReadyEvidence.d.ts +8 -0
- package/dist/compiler/organizationReadyEvidence.js +23 -3
- package/dist/compiler/preflightCompilePlan.d.ts +9 -0
- package/dist/compiler/preflightCompilePlan.js +38 -0
- package/dist/compiler/recordingAgentFacts.d.ts +4 -0
- package/dist/compiler/recordingAgentFacts.js +35 -0
- package/dist/compiler/recordingCapability.d.ts +4 -0
- package/dist/compiler/recordingCapability.js +22 -0
- package/dist/compiler/recordingReport.d.ts +4 -0
- package/dist/compiler/recordingReport.js +18 -0
- package/dist/compiler/runProject.d.ts +6 -3
- package/dist/compiler/runProject.js +34 -6
- package/dist/compiler/runProjectAuth.d.ts +3 -1
- package/dist/compiler/runProjectAuth.js +19 -3
- package/dist/compiler/runProjectDaimonCodexDocker.d.ts +3 -0
- package/dist/compiler/runProjectDaimonCodexDocker.js +36 -0
- package/dist/compiler/runProjectDocker.d.ts +8 -4
- package/dist/compiler/runProjectDocker.js +43 -18
- package/dist/compiler/runProjectDockerDaimonGuards.d.ts +15 -0
- package/dist/compiler/runProjectDockerDaimonGuards.js +122 -0
- package/dist/compiler/runProjectDockerReservation.d.ts +3 -0
- package/dist/compiler/runProjectDockerReservation.js +118 -0
- package/dist/compiler/runProjectLifecycle.js +1 -1
- package/dist/compiler/surfaces.d.ts +1 -2
- package/dist/compiler/surfaces.js +0 -1
- package/dist/compiler/syncProjectAuth.js +2 -1
- package/dist/compiler/training/broker/clockProbe.d.ts +6 -0
- package/dist/compiler/training/broker/clockProbe.js +27 -0
- package/dist/compiler/training/broker/declaration.d.ts +47 -0
- package/dist/compiler/training/broker/declaration.js +57 -0
- package/dist/compiler/training/broker/entrypoint.d.ts +39 -0
- package/dist/compiler/training/broker/entrypoint.js +126 -0
- package/dist/compiler/training/broker/evaluatorSecrets.d.ts +2 -0
- package/dist/compiler/training/broker/evaluatorSecrets.js +60 -0
- package/dist/compiler/training/broker/index.d.ts +11 -0
- package/dist/compiler/training/broker/index.js +11 -0
- package/dist/compiler/training/broker/main.d.ts +2 -0
- package/dist/compiler/training/broker/main.js +14 -0
- package/dist/compiler/training/broker/paths.d.ts +236 -0
- package/dist/compiler/training/broker/paths.js +249 -0
- package/dist/compiler/training/broker/processes.d.ts +51 -0
- package/dist/compiler/training/broker/processes.js +102 -0
- package/dist/compiler/training/broker/projection.d.ts +52 -0
- package/dist/compiler/training/broker/projection.js +88 -0
- package/dist/compiler/training/broker/provisioning.d.ts +78 -0
- package/dist/compiler/training/broker/provisioning.js +231 -0
- package/dist/compiler/training/broker/receipt.d.ts +77 -0
- package/dist/compiler/training/broker/receipt.js +110 -0
- package/dist/compiler/training/broker/registration.d.ts +43 -0
- package/dist/compiler/training/broker/registration.js +110 -0
- package/dist/compiler/training/broker/reset.d.ts +9 -0
- package/dist/compiler/training/broker/reset.js +71 -0
- package/dist/compiler/training/broker/runtime.d.ts +22 -0
- package/dist/compiler/training/broker/runtime.js +127 -0
- package/dist/compiler/training/broker/seccompRoutes.d.ts +31 -0
- package/dist/compiler/training/broker/seccompRoutes.js +36 -0
- package/dist/compiler/training/broker/supervisor.d.ts +108 -0
- package/dist/compiler/training/broker/supervisor.js +172 -0
- package/dist/compiler/training/broker/taskClock.d.ts +5 -0
- package/dist/compiler/training/broker/taskClock.js +41 -0
- package/dist/compiler/training/compiledAgent.d.ts +21 -0
- package/dist/compiler/training/compiledAgent.js +62 -0
- package/dist/compiler/training/container/contract.d.ts +54 -0
- package/dist/compiler/training/container/contract.js +51 -0
- package/dist/compiler/training/container/evaluators.d.ts +48 -0
- package/dist/compiler/training/container/evaluators.js +50 -0
- package/dist/compiler/training/container/grokWriteback.d.ts +8 -0
- package/dist/compiler/training/container/grokWriteback.js +26 -0
- package/dist/compiler/training/container/index.d.ts +5 -0
- package/dist/compiler/training/container/index.js +3 -0
- package/dist/compiler/training/container/launch.d.ts +21 -0
- package/dist/compiler/training/container/launch.js +264 -0
- package/dist/compiler/training/container/nativeSlots.d.ts +14 -0
- package/dist/compiler/training/container/nativeSlots.js +13 -0
- package/dist/compiler/training/container/outputCopy.d.ts +2 -0
- package/dist/compiler/training/container/outputCopy.js +72 -0
- package/dist/compiler/training/container/outputVolume.d.ts +27 -0
- package/dist/compiler/training/container/outputVolume.js +161 -0
- package/dist/compiler/training/container/prepare.d.ts +10 -0
- package/dist/compiler/training/container/prepare.js +125 -0
- package/dist/compiler/training/container/process.d.ts +14 -0
- package/dist/compiler/training/container/process.js +70 -0
- package/dist/compiler/training/container/security.d.ts +38 -0
- package/dist/compiler/training/container/security.js +68 -0
- package/dist/compiler/training/container/subjectIsolation.d.ts +5 -0
- package/dist/compiler/training/container/subjectIsolation.js +15 -0
- package/dist/compiler/training/context.d.ts +15 -0
- package/dist/compiler/training/context.js +93 -0
- package/dist/compiler/training/contract.d.ts +144 -0
- package/dist/compiler/training/contract.js +36 -0
- package/dist/compiler/training/execution.d.ts +417 -0
- package/dist/compiler/training/execution.js +160 -0
- package/dist/compiler/training/index.d.ts +12 -0
- package/dist/compiler/training/index.js +10 -0
- package/dist/compiler/training/moments.d.ts +80 -0
- package/dist/compiler/training/moments.js +118 -0
- package/dist/compiler/training/output.d.ts +2 -0
- package/dist/compiler/training/output.js +20 -0
- package/dist/compiler/training/plan/contract.d.ts +287 -0
- package/dist/compiler/training/plan/contract.js +49 -0
- package/dist/compiler/training/plan/index.d.ts +5 -0
- package/dist/compiler/training/plan/index.js +4 -0
- package/dist/compiler/training/plan/load.d.ts +9 -0
- package/dist/compiler/training/plan/load.js +153 -0
- package/dist/compiler/training/plan/references.d.ts +19 -0
- package/dist/compiler/training/plan/references.js +57 -0
- package/dist/compiler/training/plan/resolve.d.ts +4 -0
- package/dist/compiler/training/plan/resolve.js +73 -0
- package/dist/compiler/training/plan/targets.d.ts +11 -0
- package/dist/compiler/training/plan/targets.js +71 -0
- package/dist/compiler/training/plan/types.d.ts +36 -0
- package/dist/compiler/training/plan/types.js +1 -0
- package/dist/compiler/training/preparation/assets/Dockerfile +109 -0
- package/dist/compiler/training/preparation/assets/package-lock.json +3787 -0
- package/dist/compiler/training/preparation/broker.d.ts +21 -0
- package/dist/compiler/training/preparation/broker.js +45 -0
- package/dist/compiler/training/preparation/contextModes.d.ts +12 -0
- package/dist/compiler/training/preparation/contextModes.js +38 -0
- package/dist/compiler/training/preparation/contract.d.ts +207 -0
- package/dist/compiler/training/preparation/contract.js +113 -0
- package/dist/compiler/training/preparation/copyAssets.d.ts +1 -0
- package/dist/compiler/training/preparation/copyAssets.js +8 -0
- package/dist/compiler/training/preparation/daimonParent.d.ts +42 -0
- package/dist/compiler/training/preparation/daimonParent.js +114 -0
- package/dist/compiler/training/preparation/files.d.ts +29 -0
- package/dist/compiler/training/preparation/files.js +146 -0
- package/dist/compiler/training/preparation/image.d.ts +28 -0
- package/dist/compiler/training/preparation/image.js +107 -0
- package/dist/compiler/training/preparation/index.d.ts +3 -0
- package/dist/compiler/training/preparation/index.js +2 -0
- package/dist/compiler/training/preparation/inputs.d.ts +24 -0
- package/dist/compiler/training/preparation/inputs.js +101 -0
- package/dist/compiler/training/preparation/prepare.d.ts +38 -0
- package/dist/compiler/training/preparation/prepare.js +223 -0
- package/dist/compiler/training/preparation/scratch.d.ts +8 -0
- package/dist/compiler/training/preparation/scratch.js +114 -0
- package/dist/compiler/training/repair/compatibility.d.ts +11 -0
- package/dist/compiler/training/repair/compatibility.js +34 -0
- package/dist/compiler/training/repair/contract.d.ts +840 -0
- package/dist/compiler/training/repair/contract.js +33 -0
- package/dist/compiler/training/repair/index.d.ts +3 -0
- package/dist/compiler/training/repair/index.js +3 -0
- package/dist/compiler/training/repair/prepare.d.ts +382 -0
- package/dist/compiler/training/repair/prepare.js +78 -0
- package/dist/compiler/training/repair/witness.d.ts +352 -0
- package/dist/compiler/training/repair/witness.js +48 -0
- package/dist/compiler/training/resolution.d.ts +25 -0
- package/dist/compiler/training/resolution.js +69 -0
- package/dist/compiler/training/rewind/contract.d.ts +321 -0
- package/dist/compiler/training/rewind/contract.js +39 -0
- package/dist/compiler/training/rewind/deployedResource.d.ts +22 -0
- package/dist/compiler/training/rewind/deployedResource.js +19 -0
- package/dist/compiler/training/rewind/feed.d.ts +12 -0
- package/dist/compiler/training/rewind/feed.js +182 -0
- package/dist/compiler/training/rewind/feedContent.d.ts +6 -0
- package/dist/compiler/training/rewind/feedContent.js +38 -0
- package/dist/compiler/training/rewind/git.d.ts +8 -0
- package/dist/compiler/training/rewind/git.js +159 -0
- package/dist/compiler/training/rewind/gitArchive.d.ts +2 -0
- package/dist/compiler/training/rewind/gitArchive.js +7 -0
- package/dist/compiler/training/rewind/gitHistory.d.ts +3 -0
- package/dist/compiler/training/rewind/gitHistory.js +55 -0
- package/dist/compiler/training/rewind/gitProcess.d.ts +19 -0
- package/dist/compiler/training/rewind/gitProcess.js +81 -0
- package/dist/compiler/training/rewind/gitTree.d.ts +14 -0
- package/dist/compiler/training/rewind/gitTree.js +90 -0
- package/dist/compiler/training/rewind/history.d.ts +28 -0
- package/dist/compiler/training/rewind/history.js +239 -0
- package/dist/compiler/training/rewind/index.d.ts +18 -0
- package/dist/compiler/training/rewind/index.js +15 -0
- package/dist/compiler/training/rewind/inputs.d.ts +9 -0
- package/dist/compiler/training/rewind/inputs.js +67 -0
- package/dist/compiler/training/rewind/instant.d.ts +4 -0
- package/dist/compiler/training/rewind/instant.js +24 -0
- package/dist/compiler/training/rewind/leakCheck.d.ts +10 -0
- package/dist/compiler/training/rewind/leakCheck.js +56 -0
- package/dist/compiler/training/rewind/leakFeed.d.ts +5 -0
- package/dist/compiler/training/rewind/leakFeed.js +25 -0
- package/dist/compiler/training/rewind/leakFiles.d.ts +10 -0
- package/dist/compiler/training/rewind/leakFiles.js +106 -0
- package/dist/compiler/training/rewind/leakGit.d.ts +3 -0
- package/dist/compiler/training/rewind/leakGit.js +78 -0
- package/dist/compiler/training/rewind/leakGitPayload.d.ts +4 -0
- package/dist/compiler/training/rewind/leakGitPayload.js +57 -0
- package/dist/compiler/training/rewind/leakInputs.d.ts +7 -0
- package/dist/compiler/training/rewind/leakInputs.js +135 -0
- package/dist/compiler/training/rewind/leakLayout.d.ts +2 -0
- package/dist/compiler/training/rewind/leakLayout.js +17 -0
- package/dist/compiler/training/rewind/leakProvenance.d.ts +3 -0
- package/dist/compiler/training/rewind/leakProvenance.js +88 -0
- package/dist/compiler/training/rewind/materialize.d.ts +136 -0
- package/dist/compiler/training/rewind/materialize.js +212 -0
- package/dist/compiler/training/rewind/memory.d.ts +10 -0
- package/dist/compiler/training/rewind/memory.js +84 -0
- package/dist/compiler/training/rewind/memorySchemas.d.ts +87 -0
- package/dist/compiler/training/rewind/memorySchemas.js +50 -0
- package/dist/compiler/training/rewind/moltnet.d.ts +2 -0
- package/dist/compiler/training/rewind/moltnet.js +54 -0
- package/dist/compiler/training/rewind/moltnetJson.d.ts +13 -0
- package/dist/compiler/training/rewind/moltnetJson.js +180 -0
- package/dist/compiler/training/rewind/moltnetSchemas.d.ts +1226 -0
- package/dist/compiler/training/rewind/moltnetSchemas.js +75 -0
- package/dist/compiler/training/rewind/moltnetSqlite.d.ts +31 -0
- package/dist/compiler/training/rewind/moltnetSqlite.js +192 -0
- package/dist/compiler/training/rewind/moltnetSqliteData.d.ts +10 -0
- package/dist/compiler/training/rewind/moltnetSqliteData.js +113 -0
- package/dist/compiler/training/rewind/recordInput.d.ts +40 -0
- package/dist/compiler/training/rewind/recordInput.js +49 -0
- package/dist/compiler/training/rewind/recordedBundle.d.ts +4 -0
- package/dist/compiler/training/rewind/recordedBundle.js +58 -0
- package/dist/compiler/training/rewind/recordedCommit.d.ts +2 -0
- package/dist/compiler/training/rewind/recordedCommit.js +10 -0
- package/dist/compiler/training/rewind/select.d.ts +18 -0
- package/dist/compiler/training/rewind/select.js +64 -0
- package/dist/compiler/training/rewind/snapshotManifest.d.ts +42 -0
- package/dist/compiler/training/rewind/snapshotManifest.js +134 -0
- package/dist/compiler/training/rewind/taskClock.d.ts +12 -0
- package/dist/compiler/training/rewind/taskClock.js +40 -0
- package/dist/compiler/training/rewind/timestamps.d.ts +4 -0
- package/dist/compiler/training/rewind/timestamps.js +26 -0
- package/dist/compiler/training/rewind/types.d.ts +43 -0
- package/dist/compiler/training/rewind/types.js +1 -0
- package/dist/compiler/training/rewind/volumes.d.ts +12 -0
- package/dist/compiler/training/rewind/volumes.js +58 -0
- package/dist/compiler/training/selection.d.ts +7 -0
- package/dist/compiler/training/selection.js +15 -0
- package/dist/compiler/types.d.ts +7 -2
- package/dist/compiler/upProject.d.ts +27 -1
- package/dist/compiler/upProject.js +135 -180
- package/dist/compiler/upProjectHandoff.d.ts +62 -0
- package/dist/compiler/upProjectHandoff.js +204 -0
- package/dist/compiler/upReceipt.js +49 -4
- package/dist/compiler/updateProjectModels.js +1 -0
- package/dist/compiler/view/types.d.ts +1 -1
- package/dist/compiler/workspaceBundleArtifacts.d.ts +18 -0
- package/dist/compiler/workspaceBundleArtifacts.js +155 -0
- package/dist/compiler/workspaceBundleCache.d.ts +23 -0
- package/dist/compiler/workspaceBundleCache.js +79 -0
- package/dist/compiler/workspaceBundleDependencies.d.ts +21 -0
- package/dist/compiler/workspaceBundleDependencies.js +122 -0
- package/dist/compiler/workspaceBundleFiles.d.ts +51 -0
- package/dist/compiler/workspaceBundleFiles.js +251 -0
- package/dist/compiler/workspaceBundleGenerated.d.ts +25 -0
- package/dist/compiler/workspaceBundleGenerated.js +103 -0
- package/dist/compiler/workspaceBundleGit.d.ts +64 -0
- package/dist/compiler/workspaceBundleGit.js +154 -0
- package/dist/compiler/workspaceBundleKey.d.ts +34 -0
- package/dist/compiler/workspaceBundleKey.js +17 -0
- package/dist/compiler/workspaceBundleResolve.d.ts +56 -0
- package/dist/compiler/workspaceBundleResolve.js +144 -0
- package/dist/compiler/workspaceBundleRun.d.ts +41 -0
- package/dist/compiler/workspaceBundleRun.js +79 -0
- package/dist/compiler/workspaceBundleTar.d.ts +47 -0
- package/dist/compiler/workspaceBundleTar.js +140 -0
- package/dist/compiler/workspaceBundleTree.d.ts +15 -0
- package/dist/compiler/workspaceBundleTree.js +58 -0
- package/dist/compiler/workspaceGitFetch.d.ts +41 -0
- package/dist/compiler/workspaceGitFetch.js +155 -0
- package/dist/compiler/workspaceGitPins.d.ts +33 -0
- package/dist/compiler/workspaceGitPins.js +127 -0
- package/dist/compiler/workspaceResources.d.ts +9 -2
- package/dist/compiler/workspaceResources.js +39 -7
- package/dist/deployment/activation.d.ts +3 -0
- package/dist/deployment/activation.js +12 -0
- package/dist/deployment/artifactsExportPlan.js +51 -1
- package/dist/deployment/canaryCutover.d.ts +42 -0
- package/dist/deployment/canaryCutover.js +140 -0
- package/dist/deployment/candidateDiagnostics.d.ts +15 -0
- package/dist/deployment/candidateDiagnostics.js +90 -0
- package/dist/deployment/candidateRecording.d.ts +8 -0
- package/dist/deployment/candidateRecording.js +22 -0
- package/dist/deployment/dockerLogs.js +4 -1
- package/dist/deployment/dockerManager.d.ts +5 -3
- package/dist/deployment/dockerManager.js +21 -5
- package/dist/deployment/dockerProbeGateway.d.ts +17 -0
- package/dist/deployment/dockerProbeGateway.js +17 -2
- package/dist/deployment/downDeployment.d.ts +7 -0
- package/dist/deployment/downDeployment.js +114 -9
- package/dist/deployment/downReceiptTypes.d.ts +17 -2
- package/dist/deployment/downReceiptTypes.js +17 -2
- package/dist/deployment/homeStore.d.ts +9 -1
- package/dist/deployment/homeStore.js +16 -53
- package/dist/deployment/index.d.ts +10 -0
- package/dist/deployment/index.js +10 -0
- package/dist/deployment/lifecycleCompletionContracts.d.ts +66 -0
- package/dist/deployment/lifecycleCompletionContracts.js +34 -0
- package/dist/deployment/lifecycleCompletionPaths.d.ts +4 -1
- package/dist/deployment/lifecycleCompletionPaths.js +3 -0
- package/dist/deployment/lifecycleCompletionPublication.d.ts +2 -0
- package/dist/deployment/lifecycleCompletionPublication.js +18 -4
- package/dist/deployment/lifecycleCompletionStore.d.ts +1 -1
- package/dist/deployment/lifecycleCompletionStore.js +7 -7
- package/dist/deployment/lifecycleUpRecords.d.ts +11 -0
- package/dist/deployment/lifecycleUpRecords.js +127 -0
- package/dist/deployment/native/AGENTS.md +11 -0
- package/dist/deployment/native/rename-noreplace-arm64 +0 -0
- package/dist/deployment/native/rename-noreplace-arm64.provenance.json +1 -0
- package/dist/deployment/native/rename-noreplace-x64 +0 -0
- package/dist/deployment/native/rename-noreplace-x64.provenance.json +1 -0
- package/dist/deployment/noReplaceActivation.d.ts +17 -0
- package/dist/deployment/noReplaceActivation.js +50 -0
- package/dist/deployment/organizationHandoffAuthorityFsBudget.d.ts +110 -0
- package/dist/deployment/organizationHandoffAuthorityFsBudget.js +156 -0
- package/dist/deployment/organizationHandoffAuthorityFsClient.js +82 -27
- package/dist/deployment/organizationHandoffAuthorityFsElection.d.ts +21 -0
- package/dist/deployment/organizationHandoffAuthorityFsElection.js +57 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorker.js +254 -108
- package/dist/deployment/organizationHandoffAuthorityFsWorkerStall.fixture.d.ts +1 -0
- package/dist/deployment/organizationHandoffAuthorityFsWorkerStall.fixture.js +16 -0
- package/dist/deployment/organizationHandoffAuthorityStore.js +14 -7
- package/dist/deployment/organizationHandoffAuthorityTypes.d.ts +2 -2
- package/dist/deployment/organizationHandoffAuthorityTypes.js +2 -1
- package/dist/deployment/organizationReady.d.ts +2 -0
- package/dist/deployment/organizationReady.js +36 -4
- package/dist/deployment/pidLock.d.ts +25 -0
- package/dist/deployment/pidLock.js +81 -0
- package/dist/deployment/productStateClone.d.ts +43 -0
- package/dist/deployment/productStateClone.js +319 -0
- package/dist/deployment/record.d.ts +85 -1
- package/dist/deployment/record.js +11 -5
- package/dist/deployment/recordPublication.d.ts +15 -0
- package/dist/deployment/recordPublication.js +76 -0
- package/dist/deployment/recordedMemoryRetention.d.ts +18 -0
- package/dist/deployment/recordedMemoryRetention.js +27 -0
- package/dist/deployment/resourceLog.d.ts +140 -0
- package/dist/deployment/resourceLog.js +78 -0
- package/dist/deployment/upLifecycleRecoveryState.d.ts +23 -0
- package/dist/deployment/upLifecycleRecoveryState.js +12 -0
- package/dist/deployment/upReceiptTypes.d.ts +32 -6
- package/dist/deployment/upReceiptTypes.js +29 -2
- package/dist/deployment/workspaceResourceMigration.d.ts +55 -0
- package/dist/deployment/workspaceResourceMigration.js +315 -0
- package/dist/dev/project.d.ts +7 -0
- package/dist/dev/project.js +9 -0
- package/dist/distribution/buildDistributionReport.d.ts +3 -0
- package/dist/distribution/buildDistributionReport.js +5 -0
- package/dist/distribution/consumeImage.d.ts +5 -0
- package/dist/distribution/consumeImage.js +115 -98
- package/dist/distribution/consumeImageDaimonDocker.d.ts +3 -0
- package/dist/distribution/consumeImageDaimonDocker.js +45 -0
- package/dist/distribution/consumeImageLifecycle.d.ts +20 -0
- package/dist/distribution/consumeImageLifecycle.js +242 -0
- package/dist/distribution/consumeImageSupport.d.ts +19 -0
- package/dist/distribution/consumeImageSupport.js +40 -0
- package/dist/distribution/distributionReportSchema.d.ts +58 -1
- package/dist/distribution/distributionReportSchema.js +35 -2
- package/dist/distribution/dockerRunner.d.ts +6 -1
- package/dist/distribution/dockerRunner.js +31 -4
- package/dist/distribution/imageRuntimeAuth.d.ts +9 -1
- package/dist/distribution/imageRuntimeAuth.js +70 -1
- package/dist/distribution/index.d.ts +1 -1
- package/dist/distribution/index.js +1 -1
- package/dist/distribution/preflight.js +5 -1
- package/dist/distribution/renderImageInterface.js +1 -1
- package/dist/distribution/types.d.ts +29 -1
- package/dist/distribution/types.js +3 -0
- package/dist/evidenceExportHelper/boundedExecutor.d.ts +3 -0
- package/dist/evidenceExportHelper/boundedExecutor.js +33 -0
- package/dist/evidenceExportHelper/helperProgram.mjs +156 -0
- package/dist/evidenceExportHelper/index.d.ts +4 -0
- package/dist/evidenceExportHelper/index.js +4 -0
- package/dist/evidenceExportHelper/preparedAuthority.d.ts +64 -0
- package/dist/evidenceExportHelper/preparedAuthority.js +228 -0
- package/dist/evidenceExportHelper/preparedBuilder.d.ts +10 -0
- package/dist/evidenceExportHelper/preparedBuilder.js +183 -0
- package/dist/evidenceExportHelper/preparedBuilderTypes.d.ts +19 -0
- package/dist/evidenceExportHelper/preparedBuilderTypes.js +1 -0
- package/dist/evidenceExportHelper/recipe.d.ts +7 -0
- package/dist/evidenceExportHelper/recipe.js +83 -0
- package/dist/filesystem/durableWrite.d.ts +10 -0
- package/dist/filesystem/durableWrite.js +87 -0
- package/dist/filesystem/index.d.ts +2 -0
- package/dist/filesystem/index.js +2 -0
- package/dist/filesystem/io.d.ts +2 -0
- package/dist/filesystem/io.js +16 -1
- package/dist/filesystem/retainedJsonl.d.ts +23 -0
- package/dist/filesystem/retainedJsonl.js +123 -0
- package/dist/manifest/commandSchemas.d.ts +5 -0
- package/dist/manifest/commandSchemas.js +5 -0
- package/dist/manifest/executionSchemas.d.ts +47 -0
- package/dist/manifest/executionSchemas.js +31 -2
- package/dist/manifest/index.d.ts +2 -0
- package/dist/manifest/index.js +2 -0
- package/dist/manifest/loadManifest.js +3 -26
- package/dist/manifest/mcpSchemas.d.ts +62 -0
- package/dist/manifest/mcpSchemas.js +57 -8
- package/dist/manifest/memorySchemas.d.ts +1 -1
- package/dist/manifest/memorySchemas.js +1 -1
- package/dist/manifest/parseManifest.d.ts +7 -0
- package/dist/manifest/parseManifest.js +65 -0
- package/dist/manifest/renderSpawnfile.js +4 -1
- package/dist/manifest/renderSpawnfileNetworks.js +11 -0
- package/dist/manifest/renderSpawnfileWorkspace.js +10 -1
- package/dist/manifest/scheduleSchemas.d.ts +3 -1
- package/dist/manifest/scheduleSchemas.js +91 -5
- package/dist/manifest/schemas.d.ts +1419 -120
- package/dist/manifest/schemas.js +19 -6
- package/dist/manifest/teamNetworkAccessSchemas.d.ts +5 -1
- package/dist/manifest/teamNetworkAccessSchemas.js +11 -0
- package/dist/manifest/teamNetworkAuthSchemas.d.ts +1 -1
- package/dist/manifest/teamNetworkSchemas.d.ts +18 -4
- package/dist/manifest/teamNetworkSchemas.js +19 -1
- package/dist/manifest/teamNetworkServerSchemas.d.ts +8 -3
- package/dist/manifest/teamNetworkServerSchemas.js +18 -2
- package/dist/manifest/trainingDataSchemas.d.ts +357 -0
- package/dist/manifest/trainingDataSchemas.js +31 -0
- package/dist/manifest/trainingSchemas.d.ts +49 -0
- package/dist/manifest/trainingSchemas.js +44 -0
- package/dist/manifest/volumeFeedSchemas.d.ts +52 -0
- package/dist/manifest/volumeFeedSchemas.js +104 -0
- package/dist/manifest/workspaceSchemas.d.ts +194 -1
- package/dist/manifest/workspaceSchemas.js +117 -2
- package/dist/recording/compose.d.ts +3 -0
- package/dist/recording/compose.js +93 -0
- package/dist/recording/deployment.d.ts +15 -0
- package/dist/recording/deployment.js +38 -0
- package/dist/recording/history.d.ts +16 -0
- package/dist/recording/history.js +47 -0
- package/dist/recording/index.d.ts +9 -0
- package/dist/recording/index.js +9 -0
- package/dist/recording/moment.d.ts +61 -0
- package/dist/recording/moment.js +36 -0
- package/dist/recording/parse.d.ts +15 -0
- package/dist/recording/parse.js +74 -0
- package/dist/recording/read.d.ts +8 -0
- package/dist/recording/read.js +61 -0
- package/dist/recording/store.d.ts +10 -0
- package/dist/recording/store.js +94 -0
- package/dist/recording/sync.d.ts +24 -0
- package/dist/recording/sync.js +126 -0
- package/dist/recording/types.d.ts +45 -0
- package/dist/recording/types.js +2 -0
- package/dist/release/drainControl.d.ts +54 -0
- package/dist/release/drainControl.js +137 -0
- package/dist/release/drainPhase.d.ts +37 -0
- package/dist/release/drainPhase.js +161 -0
- package/dist/release/index.d.ts +11 -0
- package/dist/release/index.js +11 -0
- package/dist/release/ledger.d.ts +75 -0
- package/dist/release/ledger.js +111 -0
- package/dist/release/notify.d.ts +58 -0
- package/dist/release/notify.js +126 -0
- package/dist/release/pending.d.ts +35 -0
- package/dist/release/pending.js +60 -0
- package/dist/release/postDeploy.d.ts +32 -0
- package/dist/release/postDeploy.js +62 -0
- package/dist/release/releaseDefaults.d.ts +9 -0
- package/dist/release/releaseDefaults.js +115 -0
- package/dist/release/releaseDocker.d.ts +38 -0
- package/dist/release/releaseDocker.js +94 -0
- package/dist/release/releaseTypes.d.ts +94 -0
- package/dist/release/releaseTypes.js +1 -0
- package/dist/release/runRelease.d.ts +9 -0
- package/dist/release/runRelease.js +218 -0
- package/dist/release/swap.d.ts +23 -0
- package/dist/release/swap.js +55 -0
- package/dist/release/types.d.ts +50 -0
- package/dist/release/types.js +29 -0
- package/dist/report/index.d.ts +1 -0
- package/dist/report/index.js +1 -0
- package/dist/report/recording.d.ts +57 -0
- package/dist/report/recording.js +26 -0
- package/dist/report/types.d.ts +92 -4
- package/dist/runtime/common.d.ts +28 -1
- package/dist/runtime/common.js +33 -3
- package/dist/runtime/container.js +46 -35
- package/dist/runtime/daimon/adapter.d.ts +14 -0
- package/dist/runtime/daimon/adapter.js +254 -0
- package/dist/runtime/daimon/attention.d.ts +8 -0
- package/dist/runtime/daimon/attention.js +32 -0
- package/dist/runtime/daimon/config.d.ts +29 -0
- package/dist/runtime/daimon/config.js +321 -0
- package/dist/runtime/daimon/contract-manifest.json +1 -0
- package/dist/runtime/daimon/contract-manifest.sha256 +1 -0
- package/dist/runtime/daimon/contractManifest.d.ts +346 -0
- package/dist/runtime/daimon/contractManifest.js +335 -0
- package/dist/runtime/daimon/grokModel.d.ts +19 -0
- package/dist/runtime/daimon/grokModel.js +33 -0
- package/dist/runtime/daimon/grokTurnLimits.d.ts +25 -0
- package/dist/runtime/daimon/grokTurnLimits.js +51 -0
- package/dist/runtime/daimon/grokWorkerConfigBytes.d.ts +43 -0
- package/dist/runtime/daimon/grokWorkerConfigBytes.js +53 -0
- package/dist/runtime/daimon/grokWorkerContract.d.ts +27 -0
- package/dist/runtime/daimon/grokWorkerContract.js +60 -0
- package/dist/runtime/daimon/memory.d.ts +57 -0
- package/dist/runtime/daimon/memory.js +125 -0
- package/dist/runtime/daimon/recording.d.ts +19 -0
- package/dist/runtime/daimon/recording.js +50 -0
- package/dist/runtime/daimon/runAuth.d.ts +51 -0
- package/dist/runtime/daimon/runAuth.js +279 -0
- package/dist/runtime/daimon/runtimeIdentity.d.ts +22 -0
- package/dist/runtime/daimon/runtimeIdentity.js +22 -0
- package/dist/runtime/daimon/scheduleAuthority.d.ts +11 -0
- package/dist/runtime/daimon/scheduleAuthority.js +31 -0
- package/dist/runtime/daimon/wakeMoments.d.ts +15 -0
- package/dist/runtime/daimon/wakeMoments.js +17 -0
- package/dist/runtime/daimonInstall.d.ts +3 -0
- package/dist/runtime/daimonInstall.js +25 -0
- package/dist/runtime/index.d.ts +5 -0
- package/dist/runtime/index.js +5 -0
- package/dist/runtime/install.d.ts +5 -0
- package/dist/runtime/install.js +4 -0
- package/dist/runtime/localDaimonAuthority.d.ts +11 -0
- package/dist/runtime/localDaimonAuthority.js +77 -0
- package/dist/runtime/mnemeMcp.d.ts +13 -0
- package/dist/runtime/mnemeMcp.js +26 -0
- package/dist/runtime/openclaw/adapter.js +5 -2
- package/dist/runtime/pi/adapter.d.ts +0 -1
- package/dist/runtime/pi/adapter.js +5 -6
- package/dist/runtime/pi/appCliSource.js +1 -1
- package/dist/runtime/pi/appScheduleSource.js +6 -2
- package/dist/runtime/pi/appTemplateTypes.d.ts +1 -1
- package/dist/runtime/pi/containerTargets.js +6 -0
- package/dist/runtime/picoclaw/adapter.js +5 -2
- package/dist/runtime/registry.d.ts +6 -0
- package/dist/runtime/registry.js +32 -3
- package/dist/runtime/scheduleUtils.d.ts +1 -0
- package/dist/runtime/scheduleUtils.js +5 -1
- package/dist/runtime/types.d.ts +40 -0
- package/dist/runtime/usageLedger.d.ts +158 -0
- package/dist/runtime/usageLedger.js +269 -0
- package/dist/runtime/usageLedgerRead.d.ts +54 -0
- package/dist/runtime/usageLedgerRead.js +102 -0
- package/dist/runtime/usageRequestLedger.d.ts +42 -0
- package/dist/runtime/usageRequestLedger.js +72 -0
- package/dist/shared/daimonCodexDocker.d.ts +32 -0
- package/dist/shared/daimonCodexDocker.js +120 -0
- package/dist/shared/daimonGrokSeccompProfile.d.ts +10 -0
- package/dist/shared/daimonGrokSeccompProfile.js +11 -0
- package/dist/shared/index.d.ts +3 -0
- package/dist/shared/index.js +3 -0
- package/dist/shared/recording.d.ts +8 -0
- package/dist/shared/recording.js +25 -0
- package/dist/shared/types.d.ts +1 -1
- package/dist/shared/volumeNames.d.ts +6 -0
- package/dist/shared/volumeNames.js +14 -0
- package/dist/target/dockerArtifactsProvider.js +34 -7
- package/dist/target/dockerBaseImage.d.ts +2 -0
- package/dist/target/dockerBaseImage.js +11 -0
- package/dist/target/dockerCommandExecutor.d.ts +11 -0
- package/dist/target/dockerCommandExecutor.js +53 -2
- package/dist/target/dockerCommandExecutorCore.d.ts +2 -1
- package/dist/target/dockerCommandExecutorCore.js +5 -3
- package/dist/target/dockerPublicArtifactSnapshot.d.ts +3 -3
- package/dist/target/dockerPublicArtifactSnapshot.js +17 -33
- package/dist/target/dockerTarget.d.ts +1 -0
- package/dist/target/dockerTargetBinding.d.ts +1 -2
- package/dist/target/dockerTargetBinding.js +4 -4
- package/dist/target/dockerTargetExecFile.d.ts +19 -0
- package/dist/target/dockerTargetExecFile.js +194 -0
- package/dist/target/dockerWorldServiceProvider.d.ts +4 -0
- package/dist/target/dockerWorldServiceProvider.js +13 -1
- package/dist/target/evidenceExport.d.ts +3 -1
- package/dist/target/evidenceExport.js +12 -3
- package/dist/target/evidenceExportOperationsTestKit.js +3 -3
- package/dist/target/evidenceExportProvider.d.ts +2 -0
- package/dist/target/evidenceExportProvider.js +15 -5
- package/dist/target/publicArtifactSnapshot.d.ts +31 -0
- package/dist/target/publicArtifactSnapshot.js +37 -3
- package/dist/volume/feedLand.d.ts +31 -0
- package/dist/volume/feedLand.js +174 -0
- package/dist/volume/feedLandings.d.ts +45 -0
- package/dist/volume/feedLandings.js +111 -0
- package/dist/volume/feedLayout.d.ts +61 -0
- package/dist/volume/feedLayout.js +234 -0
- package/dist/volume/feedLock.d.ts +7 -0
- package/dist/volume/feedLock.js +131 -0
- package/dist/volume/feedManifest.d.ts +27 -0
- package/dist/volume/feedManifest.js +123 -0
- package/dist/volume/feedPrepare.d.ts +16 -0
- package/dist/volume/feedPrepare.js +228 -0
- package/dist/volume/feedProject.d.ts +39 -0
- package/dist/volume/feedProject.js +92 -0
- package/dist/volume/feedRecord.d.ts +55 -0
- package/dist/volume/feedRecord.js +148 -0
- package/dist/volume/feedRef.d.ts +43 -0
- package/dist/volume/feedRef.js +117 -0
- package/dist/volume/feedRefresh.d.ts +15 -0
- package/dist/volume/feedRefresh.js +187 -0
- package/dist/volume/feedSource.d.ts +66 -0
- package/dist/volume/feedSource.js +104 -0
- package/dist/volume/feedTarget.d.ts +70 -0
- package/dist/volume/feedTarget.js +9 -0
- package/dist/volume/feedTestKit.d.ts +11 -0
- package/dist/volume/feedTestKit.js +45 -0
- package/dist/volume/feedVerify.d.ts +18 -0
- package/dist/volume/feedVerify.js +104 -0
- package/dist/volume/index.d.ts +13 -0
- package/dist/volume/index.js +13 -0
- package/examples/README.md +45 -0
- package/examples/agent-with-subagents/AGENTS.md +3 -0
- package/examples/agent-with-subagents/Spawnfile +30 -0
- package/examples/agent-with-subagents/subagents/critic/AGENTS.md +3 -0
- package/examples/agent-with-subagents/subagents/critic/Spawnfile +15 -0
- package/examples/agent-with-subagents/subagents/researcher/AGENTS.md +3 -0
- package/examples/agent-with-subagents/subagents/researcher/Spawnfile +17 -0
- package/examples/daimon-org/Spawnfile +68 -0
- package/examples/daimon-org/TEAM.md +4 -0
- package/examples/daimon-org/agents/mapper/AGENTS.md +4 -0
- package/examples/daimon-org/agents/mapper/Spawnfile +37 -0
- package/examples/daimon-org/shared/skills/file-note/SKILL.md +9 -0
- package/examples/daimon-org/teams/review/Spawnfile +53 -0
- package/examples/daimon-org/teams/review/agents/reviewer/AGENTS.md +4 -0
- package/examples/daimon-org/teams/review/agents/reviewer/Spawnfile +37 -0
- package/examples/daimon-public-host/AGENTS.md +3 -0
- package/examples/daimon-public-host/Spawnfile +21 -0
- package/examples/distribution-org/Spawnfile +43 -0
- package/examples/distribution-org/TEAM.md +4 -0
- package/examples/distribution-org/agents/coordinator/AGENTS.md +1 -0
- package/examples/distribution-org/agents/coordinator/Spawnfile +20 -0
- package/examples/distribution-org/agents/researcher/AGENTS.md +1 -0
- package/examples/distribution-org/agents/researcher/Spawnfile +20 -0
- package/examples/jungian-daimon-org/Spawnfile +41 -0
- package/examples/jungian-daimon-org/TEAM.md +21 -0
- package/examples/jungian-daimon-org/teams/luna/Spawnfile +47 -0
- package/examples/jungian-daimon-org/teams/luna/TEAM.md +4 -0
- package/examples/jungian-daimon-org/teams/luna/agents/animus/AGENTS.md +10 -0
- package/examples/jungian-daimon-org/teams/luna/agents/animus/Spawnfile +33 -0
- package/examples/jungian-daimon-org/teams/luna/agents/representative/AGENTS.md +21 -0
- package/examples/jungian-daimon-org/teams/luna/agents/representative/Spawnfile +30 -0
- package/examples/jungian-daimon-org/teams/luna/agents/shadow/AGENTS.md +10 -0
- package/examples/jungian-daimon-org/teams/luna/agents/shadow/Spawnfile +33 -0
- package/examples/jungian-daimon-org/teams/selene/Spawnfile +47 -0
- package/examples/jungian-daimon-org/teams/selene/TEAM.md +4 -0
- package/examples/jungian-daimon-org/teams/selene/agents/animus/AGENTS.md +10 -0
- package/examples/jungian-daimon-org/teams/selene/agents/animus/Spawnfile +33 -0
- package/examples/jungian-daimon-org/teams/selene/agents/representative/AGENTS.md +19 -0
- package/examples/jungian-daimon-org/teams/selene/agents/representative/Spawnfile +33 -0
- package/examples/jungian-daimon-org/teams/selene/agents/shadow/AGENTS.md +10 -0
- package/examples/jungian-daimon-org/teams/selene/agents/shadow/Spawnfile +30 -0
- package/examples/mixed-runtime-org/Spawnfile +71 -0
- package/examples/mixed-runtime-org/TEAM.md +8 -0
- package/examples/mixed-runtime-org/agents/analyst/AGENTS.md +8 -0
- package/examples/mixed-runtime-org/agents/analyst/Spawnfile +27 -0
- package/examples/mixed-runtime-org/agents/conductor/AGENTS.md +8 -0
- package/examples/mixed-runtime-org/agents/conductor/Spawnfile +27 -0
- package/examples/mixed-runtime-org/agents/localist/AGENTS.md +7 -0
- package/examples/mixed-runtime-org/agents/localist/Spawnfile +50 -0
- package/examples/moltnet-team-chat/Spawnfile +43 -0
- package/examples/moltnet-team-chat/TEAM.md +5 -0
- package/examples/moltnet-team-chat/agents/coordinator/AGENTS.md +9 -0
- package/examples/moltnet-team-chat/agents/coordinator/Spawnfile +26 -0
- package/examples/moltnet-team-chat/teams/analysis/Spawnfile +23 -0
- package/examples/moltnet-team-chat/teams/analysis/TEAM.md +3 -0
- package/examples/moltnet-team-chat/teams/analysis/agents/observer/AGENTS.md +5 -0
- package/examples/moltnet-team-chat/teams/analysis/agents/observer/Spawnfile +19 -0
- package/examples/moltnet-team-chat/teams/analysis/agents/representative/AGENTS.md +5 -0
- package/examples/moltnet-team-chat/teams/analysis/agents/representative/Spawnfile +19 -0
- package/examples/moltnet-team-chat/teams/field/Spawnfile +41 -0
- package/examples/moltnet-team-chat/teams/field/TEAM.md +3 -0
- package/examples/moltnet-team-chat/teams/field/agents/observer/AGENTS.md +5 -0
- package/examples/moltnet-team-chat/teams/field/agents/observer/Spawnfile +26 -0
- package/examples/moltnet-team-chat/teams/field/agents/representative/AGENTS.md +11 -0
- package/examples/moltnet-team-chat/teams/field/agents/representative/Spawnfile +26 -0
- package/examples/single-agent/AGENTS.md +3 -0
- package/examples/single-agent/HEARTBEAT.md +3 -0
- package/examples/single-agent/IDENTITY.md +3 -0
- package/examples/single-agent/MEMORY.md +3 -0
- package/examples/single-agent/SOUL.md +3 -0
- package/examples/single-agent/Spawnfile +41 -0
- package/examples/single-agent/skills/web_search/SKILL.md +6 -0
- package/moltnet-releases.json +5 -4
- package/package.json +36 -9
- package/runtimes.yaml +8 -3
- package/dist/cli/targetWorldClockCrossProcess.test-helper.d.ts +0 -13
- package/dist/cli/targetWorldClockCrossProcess.test-helper.js +0 -109
- package/dist/deployment/providerRuntimeBoundaryScanner.test-helper.d.ts +0 -8
- package/dist/deployment/providerRuntimeBoundaryScanner.test-helper.js +0 -60
- package/dist/deployment/simfileFixtureBoundary.test-helper.d.ts +0 -8
- package/dist/deployment/simfileFixtureBoundary.test-helper.js +0 -103
- package/dist/ownership/simfileRunOperatorInputs.d.ts +0 -103
- package/dist/ownership/simfileRunOperatorInputs.js +0 -139
- package/dist/target/cleanupRunDocker.test-helper.d.ts +0 -67
- package/dist/target/cleanupRunDocker.test-helper.js +0 -238
|
@@ -1,28 +1,47 @@
|
|
|
1
1
|
import { constants } from "node:fs";
|
|
2
2
|
import { link, lstat, open, unlink } from "node:fs/promises";
|
|
3
|
+
import { OrganizationHandoffAuthorityBudget, OrganizationHandoffAuthorityFailure, toOrganizationHandoffAuthorityFailureDetail } from "./organizationHandoffAuthorityFsBudget.js";
|
|
4
|
+
import { createAuthorityLeafInspector } from "./organizationHandoffAuthorityFsElection.js";
|
|
3
5
|
const VERSION = "spawnfile.organization-handoff-fs-worker.v1";
|
|
4
6
|
const MAX_BYTES = 32_768;
|
|
5
7
|
// Store keys encode either a 64-character pending key or a 71-character
|
|
6
8
|
// `opaque_` handoff handle. No other leaf namespace is reachable.
|
|
7
9
|
const NAME = /^(?:[a-f0-9]{128}|[a-f0-9]{142})\.json$/u;
|
|
8
10
|
const owner = typeof process.getuid === "function" ? process.getuid() : undefined;
|
|
9
|
-
const fail = () => {
|
|
11
|
+
const fail = (code, state) => {
|
|
12
|
+
throw new OrganizationHandoffAuthorityFailure({ code, ...(state === undefined ? {} : { state }) });
|
|
13
|
+
};
|
|
14
|
+
/** Fail with the budget's attempt/wall-clock accounting and the contending shape. */
|
|
15
|
+
const failBudget = (budget, code, loop, state) => {
|
|
16
|
+
throw new OrganizationHandoffAuthorityFailure(budget.snapshot(code, loop, state));
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Re-raise a race failure that the election check refused to retry, recording
|
|
20
|
+
* the verdict. Without it a fail-closed admission decision is indistinguishable
|
|
21
|
+
* from the underlying race in a log.
|
|
22
|
+
*/
|
|
23
|
+
const failElection = (error, election, loop) => {
|
|
24
|
+
const detail = toOrganizationHandoffAuthorityFailureDetail(error);
|
|
25
|
+
throw new OrganizationHandoffAuthorityFailure({
|
|
26
|
+
...detail,
|
|
27
|
+
state: `${detail.state === undefined ? "" : `${detail.state} `}loop=${loop} election=${String(election)}`
|
|
28
|
+
});
|
|
29
|
+
};
|
|
10
30
|
const bytes = (value) => Buffer.byteLength(value, "utf8");
|
|
11
|
-
const
|
|
12
|
-
const validName = (value) => typeof value === "string" && NAME.test(value) ? value : fail();
|
|
31
|
+
const validName = (value) => typeof value === "string" && NAME.test(value) ? value : fail("invalid_name");
|
|
13
32
|
const validRequest = (raw) => {
|
|
14
33
|
if (!raw || typeof raw !== "object" || Array.isArray(raw) || Object.getPrototypeOf(raw) !== Object.prototype)
|
|
15
|
-
return fail();
|
|
34
|
+
return fail("malformed_request");
|
|
16
35
|
const value = raw;
|
|
17
36
|
if (value.version !== VERSION || !Number.isSafeInteger(value.id) || typeof value.op !== "string" || (value.op !== "read" && value.op !== "write" && value.op !== "create"))
|
|
18
|
-
return fail();
|
|
37
|
+
return fail("unsupported_request");
|
|
19
38
|
const content = value.content;
|
|
20
39
|
const keys = Object.keys(value).sort();
|
|
21
40
|
const expected = value.op === "read" ? ["id", "name", "op", "version"] : ["content", "id", "name", "op", "version"];
|
|
22
41
|
if (keys.length !== expected.length || keys.some((key, index) => key !== expected[index]))
|
|
23
|
-
return fail();
|
|
42
|
+
return fail("unexpected_request_keys");
|
|
24
43
|
if (content !== undefined && (typeof content !== "string" || bytes(content) > MAX_BYTES))
|
|
25
|
-
return fail();
|
|
44
|
+
return fail("oversized_content");
|
|
26
45
|
return { version: VERSION, id: value.id, op: value.op, name: validName(value.name), ...(content === undefined ? {} : { content }) };
|
|
27
46
|
};
|
|
28
47
|
const send = (value) => {
|
|
@@ -31,31 +50,34 @@ const send = (value) => {
|
|
|
31
50
|
process.exit(1);
|
|
32
51
|
process.send(JSON.parse(serialized));
|
|
33
52
|
};
|
|
34
|
-
const statFile =
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
53
|
+
const { aliasesOf, expectedElectionState, statFile } = createAuthorityLeafInspector(owner === undefined ? {} : { owner });
|
|
54
|
+
const publicationSidecars = (name) => [`${name}.pending`, `${name}.recovery`];
|
|
55
|
+
/**
|
|
56
|
+
* Structural description of the contending state for a diagnostic. Reports
|
|
57
|
+
* only shape — presence, link count, size, mode. Never record bytes, leaf
|
|
58
|
+
* names, or paths: this is the secret-publication path.
|
|
59
|
+
*/
|
|
60
|
+
const describeContention = async (name) => {
|
|
61
|
+
const roles = [["final", name], ["pending", `${name}.pending`], ["recovery", `${name}.recovery`]];
|
|
62
|
+
const parts = await Promise.all(roles.map(async ([role, leaf]) => {
|
|
63
|
+
const stat = await lstat(leaf).catch(() => null);
|
|
64
|
+
return stat === null
|
|
65
|
+
? `${role}:absent`
|
|
66
|
+
: `${role}:nlink=${stat.nlink},size=${stat.size},mode=${(stat.mode & 0o777).toString(8)}`;
|
|
67
|
+
}));
|
|
68
|
+
return parts.join(" ");
|
|
42
69
|
};
|
|
43
70
|
const read = async (name) => {
|
|
44
71
|
let before = await statFile(name);
|
|
45
72
|
if (before === null)
|
|
46
73
|
return null;
|
|
47
74
|
if (before.nlink === 2) {
|
|
48
|
-
const aliases = [
|
|
49
|
-
`${name}.pending`, `${name}.recovery`,
|
|
50
|
-
...(name.endsWith(".pending") ? [name.slice(0, -".pending".length)] : []),
|
|
51
|
-
...(name.endsWith(".recovery") ? [name.slice(0, -".recovery".length)] : [])
|
|
52
|
-
];
|
|
53
75
|
let match;
|
|
54
|
-
for (const alias of
|
|
55
|
-
const stat = await lstat(alias).catch((error) => error.code === "ENOENT" ? null : fail());
|
|
76
|
+
for (const alias of aliasesOf(name)) {
|
|
77
|
+
const stat = await lstat(alias).catch((error) => error.code === "ENOENT" ? null : fail("alias_lstat_failed"));
|
|
56
78
|
if (stat && stat.isFile() && !stat.isSymbolicLink() && stat.nlink === 2 && stat.dev === before.dev && stat.ino === before.ino) {
|
|
57
79
|
if (match)
|
|
58
|
-
return fail();
|
|
80
|
+
return fail("ambiguous_link_alias");
|
|
59
81
|
match = alias;
|
|
60
82
|
}
|
|
61
83
|
}
|
|
@@ -67,7 +89,7 @@ const read = async (name) => {
|
|
|
67
89
|
if (current === null)
|
|
68
90
|
return null;
|
|
69
91
|
if (current.nlink !== 1)
|
|
70
|
-
return fail();
|
|
92
|
+
return fail("unresolved_second_link");
|
|
71
93
|
before = current;
|
|
72
94
|
}
|
|
73
95
|
// Reading the canonical record completes a crashed publisher. An
|
|
@@ -75,14 +97,14 @@ const read = async (name) => {
|
|
|
75
97
|
// observes the linked content and lets its normal publish path converge.
|
|
76
98
|
if (match && !name.endsWith(".pending") && !name.endsWith(".recovery")) {
|
|
77
99
|
await unlink(match).catch((error) => { if (error.code !== "ENOENT")
|
|
78
|
-
fail(); });
|
|
100
|
+
fail("alias_unlink_failed"); });
|
|
79
101
|
await sync();
|
|
80
102
|
before = await statFile(name);
|
|
81
103
|
if (before === null)
|
|
82
|
-
return fail();
|
|
104
|
+
return fail("record_vanished_after_join");
|
|
83
105
|
}
|
|
84
106
|
}
|
|
85
|
-
const handle = await open(name, constants.O_RDONLY | constants.O_NOFOLLOW).catch((error) => error.code === "ENOENT" ? null : fail());
|
|
107
|
+
const handle = await open(name, constants.O_RDONLY | constants.O_NOFOLLOW).catch((error) => error.code === "ENOENT" ? null : fail("open_failed"));
|
|
86
108
|
if (handle === null)
|
|
87
109
|
return null;
|
|
88
110
|
try {
|
|
@@ -92,93 +114,185 @@ const read = async (name) => {
|
|
|
92
114
|
// sole permitted link-count transition; inode, device, size, and all
|
|
93
115
|
// increases remain fail-closed.
|
|
94
116
|
if (!stat.isFile() || stat.nlink < 1 || stat.nlink > before.nlink || stat.dev !== before.dev || stat.ino !== before.ino || stat.size !== before.size)
|
|
95
|
-
return fail();
|
|
117
|
+
return fail("record_drifted_while_open");
|
|
96
118
|
return await handle.readFile({ encoding: "utf8" });
|
|
97
119
|
}
|
|
98
|
-
catch {
|
|
99
|
-
|
|
120
|
+
catch (error) {
|
|
121
|
+
if (error instanceof OrganizationHandoffAuthorityFailure)
|
|
122
|
+
throw error;
|
|
123
|
+
return fail("read_failed");
|
|
100
124
|
}
|
|
101
125
|
finally {
|
|
102
126
|
await handle.close().catch(() => undefined);
|
|
103
127
|
}
|
|
104
128
|
};
|
|
105
|
-
const sync = async () => { const handle = await open(".", constants.O_RDONLY | constants.O_DIRECTORY).catch(fail); try {
|
|
129
|
+
const sync = async () => { const handle = await open(".", constants.O_RDONLY | constants.O_DIRECTORY).catch(() => fail("directory_open_failed")); try {
|
|
106
130
|
await handle.sync();
|
|
107
131
|
}
|
|
108
132
|
finally {
|
|
109
133
|
await handle.close().catch(() => undefined);
|
|
110
134
|
} };
|
|
111
|
-
const
|
|
112
|
-
let stat = await statFile(name);
|
|
113
|
-
if (stat === null)
|
|
114
|
-
return null;
|
|
115
|
-
if (stat.nlink === 1)
|
|
116
|
-
return true;
|
|
117
|
-
const aliases = [
|
|
118
|
-
`${name}.pending`, `${name}.recovery`,
|
|
119
|
-
...(name.endsWith(".pending") ? [name.slice(0, -".pending".length)] : []),
|
|
120
|
-
...(name.endsWith(".recovery") ? [name.slice(0, -".recovery".length)] : [])
|
|
121
|
-
];
|
|
122
|
-
for (const alias of aliases) {
|
|
123
|
-
const counterpart = await lstat(alias).catch((error) => error.code === "ENOENT" ? null : fail());
|
|
124
|
-
if (counterpart?.isFile() && !counterpart.isSymbolicLink() && counterpart.nlink === 2 && counterpart.dev === stat.dev && counterpart.ino === stat.ino)
|
|
125
|
-
return true;
|
|
126
|
-
}
|
|
127
|
-
// The counterpart may have disappeared just before this check. Accept only
|
|
128
|
-
// the resulting ordinary single-link state, never an unknown hard link.
|
|
129
|
-
stat = await statFile(name);
|
|
130
|
-
return stat?.nlink === 1;
|
|
131
|
-
};
|
|
132
|
-
const readDuringPublication = async (name, attempt = 0) => {
|
|
135
|
+
const readDuringPublication = async (name, budget) => {
|
|
133
136
|
try {
|
|
134
137
|
return await read(name);
|
|
135
138
|
}
|
|
136
|
-
catch {
|
|
139
|
+
catch (error) {
|
|
137
140
|
// Re-validate the leaf before retrying. This permits only a checked,
|
|
138
141
|
// ordinary one/two-link publication race; symlinks, mode/owner drift,
|
|
139
142
|
// extra links, and other malformed states still fail immediately.
|
|
140
143
|
const election = await expectedElectionState(name);
|
|
141
144
|
if (election === null)
|
|
142
145
|
return null;
|
|
143
|
-
if (
|
|
144
|
-
return
|
|
145
|
-
|
|
146
|
-
|
|
146
|
+
if (election !== true)
|
|
147
|
+
return failElection(error, election, "read");
|
|
148
|
+
if (budget.exhausted())
|
|
149
|
+
return failBudget(budget, "read_budget_exhausted", "read", await describeContention(name));
|
|
150
|
+
await budget.wait();
|
|
151
|
+
return readDuringPublication(name, budget);
|
|
147
152
|
}
|
|
148
153
|
};
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
154
|
+
/**
|
|
155
|
+
* A sidecar may change between lstat and fd inspection while another worker
|
|
156
|
+
* publishes. Re-prove an exact immutable final first, then retry the sidecar
|
|
157
|
+
* so cleanup still relies on a stable checked sidecar rather than an inference.
|
|
158
|
+
*/
|
|
159
|
+
const readStaging = async (staging, final, content, budget) => {
|
|
160
|
+
try {
|
|
161
|
+
const observed = await read(staging);
|
|
162
|
+
if (observed === null)
|
|
163
|
+
return "absent";
|
|
164
|
+
if (observed === content)
|
|
165
|
+
return "exact";
|
|
166
|
+
return content.startsWith(observed) ? "expected-prefix" : fail("staging_content_unrelated");
|
|
167
|
+
}
|
|
168
|
+
catch (error) {
|
|
169
|
+
if (error instanceof OrganizationHandoffAuthorityFailure && error.detail.budget !== undefined)
|
|
170
|
+
throw error;
|
|
171
|
+
const published = await readDuringPublication(final, budget);
|
|
172
|
+
if (published !== null) {
|
|
173
|
+
if (published !== content)
|
|
174
|
+
return fail("published_content_mismatch");
|
|
175
|
+
if (budget.exhausted())
|
|
176
|
+
return failBudget(budget, "staging_budget_exhausted", "staging", await describeContention(final));
|
|
177
|
+
await budget.wait();
|
|
178
|
+
return readStaging(staging, final, content, budget);
|
|
179
|
+
}
|
|
180
|
+
const election = await expectedElectionState(staging);
|
|
181
|
+
if (election === null)
|
|
182
|
+
return "absent";
|
|
183
|
+
if (election !== true)
|
|
184
|
+
return failElection(error, election, "staging");
|
|
185
|
+
if (budget.exhausted())
|
|
186
|
+
return failBudget(budget, "staging_budget_exhausted", "staging", await describeContention(final));
|
|
187
|
+
await budget.wait();
|
|
188
|
+
return readStaging(staging, final, content, budget);
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* A successful link election can race a peer which had already created the
|
|
193
|
+
* other staging leaf. The final immutable record is authoritative, but the
|
|
194
|
+
* stale leaf must not survive a completed join: it would otherwise be
|
|
195
|
+
* mistaken for an in-progress publication after restart. Delete exact bytes
|
|
196
|
+
* immediately. An incomplete expected prefix may still belong to a publisher,
|
|
197
|
+
* so wait for it first; once the budget's patience expires, removing that
|
|
198
|
+
* proven prefix is safe because the final record already prevents it from
|
|
199
|
+
* winning a later link election.
|
|
200
|
+
*/
|
|
201
|
+
const settlePublished = async (name, content, budget) => {
|
|
202
|
+
if (budget.exhausted())
|
|
203
|
+
return failBudget(budget, "settle_budget_exhausted", "settle", await describeContention(name));
|
|
204
|
+
if (await readDuringPublication(name, budget) !== content)
|
|
205
|
+
return fail("settle_record_mismatch");
|
|
206
|
+
let incomplete = false;
|
|
207
|
+
for (const sidecar of publicationSidecars(name)) {
|
|
208
|
+
const observed = await readStaging(sidecar, name, content, budget);
|
|
209
|
+
if (observed === "absent")
|
|
210
|
+
continue;
|
|
211
|
+
if (observed === "expected-prefix" && budget.patient()) {
|
|
212
|
+
incomplete = true;
|
|
213
|
+
continue;
|
|
214
|
+
}
|
|
215
|
+
await unlink(sidecar).catch((error) => { if (error.code !== "ENOENT")
|
|
216
|
+
fail("sidecar_unlink_failed"); });
|
|
217
|
+
await sync();
|
|
218
|
+
}
|
|
219
|
+
if (incomplete) {
|
|
220
|
+
await budget.wait();
|
|
221
|
+
return settlePublished(name, content, budget);
|
|
222
|
+
}
|
|
223
|
+
if (await readDuringPublication(name, budget) !== content)
|
|
224
|
+
return fail("settle_record_mismatch");
|
|
225
|
+
const remaining = await Promise.all(publicationSidecars(name).map(async (sidecar) => readStaging(sidecar, name, content, budget)));
|
|
226
|
+
if (remaining.every((sidecar) => sidecar === "absent"))
|
|
227
|
+
return;
|
|
228
|
+
if (budget.exhausted())
|
|
229
|
+
return failBudget(budget, "settle_budget_exhausted", "settle", await describeContention(name));
|
|
230
|
+
await budget.wait();
|
|
231
|
+
return settlePublished(name, content, budget);
|
|
232
|
+
};
|
|
233
|
+
const readPublished = async (name, budget) => {
|
|
234
|
+
const content = await readDuringPublication(name, budget);
|
|
235
|
+
if (content === null)
|
|
236
|
+
return null;
|
|
237
|
+
await settlePublished(name, content, budget);
|
|
238
|
+
return content;
|
|
239
|
+
};
|
|
240
|
+
const write = async (name, content, budget) => {
|
|
241
|
+
if (budget.exhausted())
|
|
242
|
+
return failBudget(budget, "write_budget_exhausted", "write", await describeContention(name));
|
|
152
243
|
const joinOrRetry = async () => {
|
|
153
|
-
const published = await readDuringPublication(name);
|
|
244
|
+
const published = await readDuringPublication(name, budget);
|
|
154
245
|
if (published !== null) {
|
|
155
246
|
if (published !== content)
|
|
156
|
-
return fail();
|
|
247
|
+
return fail("join_content_mismatch");
|
|
248
|
+
await settlePublished(name, content, budget);
|
|
157
249
|
return false;
|
|
158
250
|
}
|
|
159
|
-
await
|
|
160
|
-
return write(name, content,
|
|
251
|
+
await budget.wait();
|
|
252
|
+
return write(name, content, budget);
|
|
161
253
|
};
|
|
162
|
-
const
|
|
254
|
+
const reproveStaging = async () => {
|
|
255
|
+
const published = await readDuringPublication(name, budget);
|
|
256
|
+
if (published === content) {
|
|
257
|
+
await settlePublished(name, content, budget);
|
|
258
|
+
return true;
|
|
259
|
+
}
|
|
260
|
+
if (published !== null)
|
|
261
|
+
return fail("reprove_content_mismatch");
|
|
262
|
+
await budget.wait();
|
|
263
|
+
return false;
|
|
264
|
+
};
|
|
265
|
+
const existing = await readDuringPublication(name, budget);
|
|
163
266
|
if (existing !== null) {
|
|
164
267
|
if (existing !== content)
|
|
165
|
-
fail();
|
|
268
|
+
fail("existing_content_mismatch");
|
|
269
|
+
await settlePublished(name, content, budget);
|
|
166
270
|
return false;
|
|
167
271
|
}
|
|
168
272
|
const pending = `${name}.pending`;
|
|
169
273
|
const recovery = `${name}.recovery`;
|
|
170
|
-
const incomplete = await
|
|
171
|
-
if (incomplete
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
274
|
+
const incomplete = await readStaging(pending, name, content, budget);
|
|
275
|
+
if (incomplete === "expected-prefix") {
|
|
276
|
+
let recovered = await readStaging(recovery, name, content, budget);
|
|
277
|
+
if (recovered === "expected-prefix") {
|
|
278
|
+
if (budget.patient()) {
|
|
279
|
+
await budget.wait();
|
|
280
|
+
return write(name, content, budget);
|
|
281
|
+
}
|
|
282
|
+
// A crashed recovery publisher can leave the same bounded prefix. It
|
|
283
|
+
// cannot win after this writer links the immutable final record, so
|
|
284
|
+
// retire it only after the budget's patience expires and reconstruct it
|
|
285
|
+
// below.
|
|
286
|
+
await unlink(recovery).catch((error) => { if (error.code !== "ENOENT")
|
|
287
|
+
fail("recovery_unlink_failed"); });
|
|
288
|
+
await sync();
|
|
289
|
+
recovered = "absent";
|
|
290
|
+
}
|
|
291
|
+
if (recovered === "absent") {
|
|
292
|
+
const handle = await open(recovery, constants.O_CREAT | constants.O_EXCL | constants.O_WRONLY | constants.O_NOFOLLOW, 0o600).catch((error) => error.code === "EEXIST" ? null : fail("recovery_create_failed"));
|
|
179
293
|
if (handle === null) {
|
|
180
|
-
await
|
|
181
|
-
return write(name, content,
|
|
294
|
+
await budget.wait();
|
|
295
|
+
return write(name, content, budget);
|
|
182
296
|
}
|
|
183
297
|
try {
|
|
184
298
|
await handle.writeFile(content, "utf8");
|
|
@@ -187,11 +301,12 @@ const write = async (name, content, attempt = 0) => {
|
|
|
187
301
|
finally {
|
|
188
302
|
await handle.close().catch(() => undefined);
|
|
189
303
|
}
|
|
190
|
-
const staged = await
|
|
191
|
-
if (staged
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
return
|
|
304
|
+
const staged = await readStaging(recovery, name, content, budget);
|
|
305
|
+
if (staged !== "exact") {
|
|
306
|
+
if (await reproveStaging())
|
|
307
|
+
return false;
|
|
308
|
+
return write(name, content, budget);
|
|
309
|
+
}
|
|
195
310
|
await sync();
|
|
196
311
|
}
|
|
197
312
|
const recoveredLinked = await link(recovery, name).then(() => true).catch((error) => {
|
|
@@ -199,23 +314,24 @@ const write = async (name, content, attempt = 0) => {
|
|
|
199
314
|
return false;
|
|
200
315
|
if (error.code === "ENOENT")
|
|
201
316
|
return null;
|
|
202
|
-
return fail();
|
|
317
|
+
return fail("recovery_link_failed");
|
|
203
318
|
});
|
|
204
319
|
if (recoveredLinked !== true)
|
|
205
320
|
return joinOrRetry();
|
|
206
321
|
await sync();
|
|
207
322
|
await unlink(recovery).catch((error) => { if (error.code !== "ENOENT")
|
|
208
|
-
fail(); });
|
|
323
|
+
fail("recovery_unlink_failed"); });
|
|
209
324
|
await sync();
|
|
210
|
-
if (await readDuringPublication(name) !== content)
|
|
211
|
-
fail();
|
|
325
|
+
if (await readDuringPublication(name, budget) !== content)
|
|
326
|
+
fail("recovery_publish_mismatch");
|
|
327
|
+
await settlePublished(name, content, budget);
|
|
212
328
|
return true;
|
|
213
329
|
}
|
|
214
|
-
if (incomplete ===
|
|
215
|
-
const handle = await open(pending, constants.O_CREAT | constants.O_EXCL | constants.O_WRONLY | constants.O_NOFOLLOW, 0o600).catch((error) => error.code === "EEXIST" ? null : fail());
|
|
330
|
+
if (incomplete === "absent") {
|
|
331
|
+
const handle = await open(pending, constants.O_CREAT | constants.O_EXCL | constants.O_WRONLY | constants.O_NOFOLLOW, 0o600).catch((error) => error.code === "EEXIST" ? null : fail("pending_create_failed"));
|
|
216
332
|
if (handle === null) {
|
|
217
|
-
await
|
|
218
|
-
return write(name, content,
|
|
333
|
+
await budget.wait();
|
|
334
|
+
return write(name, content, budget);
|
|
219
335
|
}
|
|
220
336
|
try {
|
|
221
337
|
await handle.writeFile(content, "utf8");
|
|
@@ -224,11 +340,12 @@ const write = async (name, content, attempt = 0) => {
|
|
|
224
340
|
finally {
|
|
225
341
|
await handle.close().catch(() => undefined);
|
|
226
342
|
}
|
|
227
|
-
const staged = await
|
|
228
|
-
if (staged
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
return
|
|
343
|
+
const staged = await readStaging(pending, name, content, budget);
|
|
344
|
+
if (staged !== "exact") {
|
|
345
|
+
if (await reproveStaging())
|
|
346
|
+
return false;
|
|
347
|
+
return write(name, content, budget);
|
|
348
|
+
}
|
|
232
349
|
await sync();
|
|
233
350
|
}
|
|
234
351
|
const linked = await link(pending, name).then(() => true).catch((error) => {
|
|
@@ -236,16 +353,17 @@ const write = async (name, content, attempt = 0) => {
|
|
|
236
353
|
return false;
|
|
237
354
|
if (error.code === "ENOENT")
|
|
238
355
|
return null;
|
|
239
|
-
return fail();
|
|
356
|
+
return fail("pending_link_failed");
|
|
240
357
|
});
|
|
241
358
|
if (linked !== true)
|
|
242
359
|
return joinOrRetry();
|
|
243
360
|
await sync();
|
|
244
361
|
await unlink(pending).catch((error) => { if (error.code !== "ENOENT")
|
|
245
|
-
fail(); });
|
|
362
|
+
fail("pending_unlink_failed"); });
|
|
246
363
|
await sync();
|
|
247
|
-
if (await readDuringPublication(name) !== content)
|
|
248
|
-
fail();
|
|
364
|
+
if (await readDuringPublication(name, budget) !== content)
|
|
365
|
+
fail("pending_publish_mismatch");
|
|
366
|
+
await settlePublished(name, content, budget);
|
|
249
367
|
return true;
|
|
250
368
|
};
|
|
251
369
|
let anchor;
|
|
@@ -253,13 +371,13 @@ let queue = Promise.resolve();
|
|
|
253
371
|
const start = async () => {
|
|
254
372
|
const raw = process.env.SPAWNFILE_AUTHORITY_FS_ANCHOR;
|
|
255
373
|
if (!raw)
|
|
256
|
-
return fail();
|
|
374
|
+
return fail("missing_anchor");
|
|
257
375
|
const expected = JSON.parse(raw);
|
|
258
376
|
const stat = await lstat(".");
|
|
259
377
|
if (!stat.isDirectory() || stat.isSymbolicLink() || stat.dev !== expected.dev || stat.ino !== expected.ino
|
|
260
378
|
|| (stat.mode & 0o077) !== 0 || owner !== undefined && stat.uid !== expected.uid
|
|
261
379
|
|| !Number.isSafeInteger(expected.parent_pid) || expected.parent_pid < 1 || process.ppid !== expected.parent_pid)
|
|
262
|
-
return fail();
|
|
380
|
+
return fail("anchor_mismatch");
|
|
263
381
|
anchor = expected;
|
|
264
382
|
send({ version: VERSION, ready: true });
|
|
265
383
|
};
|
|
@@ -267,19 +385,47 @@ process.on("message", (raw) => {
|
|
|
267
385
|
queue = queue.then(async () => {
|
|
268
386
|
const request = validRequest(raw);
|
|
269
387
|
if (!anchor)
|
|
270
|
-
return fail();
|
|
388
|
+
return fail("not_ready");
|
|
271
389
|
const stat = await lstat(".");
|
|
272
390
|
if (stat.dev !== anchor.dev || stat.ino !== anchor.ino || (stat.mode & 0o077) !== 0)
|
|
273
|
-
return fail();
|
|
391
|
+
return fail("anchor_drifted");
|
|
392
|
+
// One budget per request: the request is the thing with a deadline, and
|
|
393
|
+
// the client's own request deadline must exceed it.
|
|
394
|
+
const budget = new OrganizationHandoffAuthorityBudget();
|
|
274
395
|
const result = request.op === "read"
|
|
275
|
-
? { content: await
|
|
276
|
-
: { created: request.content === undefined ? fail() : await write(request.name, request.content) };
|
|
396
|
+
? { content: await readPublished(request.name, budget) }
|
|
397
|
+
: { created: request.content === undefined ? fail("missing_content") : await write(request.name, request.content, budget) };
|
|
277
398
|
send({ version: VERSION, id: request.id, ok: true, ...(result.content === null ? {} : { content: result.content }), ...(request.op === "create" ? { created: result.created } : {}) });
|
|
278
|
-
}).catch(() => send({
|
|
399
|
+
}).catch((error) => send({
|
|
400
|
+
version: VERSION,
|
|
401
|
+
id: typeof raw === "object" && raw !== null && Number.isSafeInteger(raw.id) ? raw.id : 0,
|
|
402
|
+
ok: false,
|
|
403
|
+
failure: toOrganizationHandoffAuthorityFailureDetail(error)
|
|
404
|
+
}));
|
|
279
405
|
});
|
|
280
406
|
process.on("disconnect", () => process.exit(0));
|
|
407
|
+
/**
|
|
408
|
+
* Expected parent pid read synchronously at module load, before any await.
|
|
409
|
+
*
|
|
410
|
+
* The watchdog below previously exited whenever `anchor` was still unset. That
|
|
411
|
+
* made a liveness net race the startup path: on a loaded host the interpreter
|
|
412
|
+
* and the anchor's `lstat` can take longer than one 100ms tick, and the helper
|
|
413
|
+
* killed itself before it could ever report ready. Deriving the pid from the
|
|
414
|
+
* environment removes the dependency on startup having finished, without
|
|
415
|
+
* weakening anything: `start` still validates the full anchor independently,
|
|
416
|
+
* and no request is served until it does.
|
|
417
|
+
*/
|
|
418
|
+
const watchedParentPid = (() => {
|
|
419
|
+
try {
|
|
420
|
+
const value = JSON.parse(process.env.SPAWNFILE_AUTHORITY_FS_ANCHOR ?? "{}");
|
|
421
|
+
return Number.isSafeInteger(value.parent_pid) ? value.parent_pid : undefined;
|
|
422
|
+
}
|
|
423
|
+
catch {
|
|
424
|
+
return undefined;
|
|
425
|
+
}
|
|
426
|
+
})();
|
|
281
427
|
// IPC disconnect covers a cooperative parent shutdown. ppid surveillance also
|
|
282
428
|
// covers abrupt parent death, where an orphan might otherwise retain its cwd.
|
|
283
|
-
setInterval(() => { if (
|
|
429
|
+
setInterval(() => { if (watchedParentPid === undefined || process.ppid !== watchedParentPid)
|
|
284
430
|
process.exit(0); }, 100).unref();
|
|
285
431
|
void start().catch(() => process.exit(1));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { pbkdf2 } from "node:crypto";
|
|
2
|
+
/**
|
|
3
|
+
* Test-only preload that delays the authority worker's startup filesystem call.
|
|
4
|
+
*
|
|
5
|
+
* The worker validates its anchor with an `lstat`, which libuv runs on the
|
|
6
|
+
* threadpool. Forked with `UV_THREADPOOL_SIZE=1`, this preload occupies that
|
|
7
|
+
* single slot long enough that the anchor cannot be established until well
|
|
8
|
+
* after the worker's 100ms liveness watchdog has ticked several times — the
|
|
9
|
+
* deterministic equivalent of what CPU contention does to worker startup on a
|
|
10
|
+
* loaded host, and the condition under which the watchdog used to reap the
|
|
11
|
+
* helper before it could ever report readiness.
|
|
12
|
+
*
|
|
13
|
+
* The event loop itself stays free throughout, so the watchdog does tick.
|
|
14
|
+
*/
|
|
15
|
+
const STALL_ITERATIONS = 1_500_000;
|
|
16
|
+
pbkdf2("spawnfile-stall", "spawnfile-stall", STALL_ITERATIONS, 64, "sha512", () => undefined);
|
|
@@ -8,7 +8,14 @@ import { ORGANIZATION_HANDOFF_AUTHORITY_ERROR, createOrganizationHandoffCapabili
|
|
|
8
8
|
import { parseOrganizationHandoff } from "./organizationHandoffTypes.js";
|
|
9
9
|
import { initializeOrganizationHandoffAuthorityFsClient } from "./organizationHandoffAuthorityFsClient.js";
|
|
10
10
|
const owner = typeof process.getuid === "function" ? process.getuid() : undefined;
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* The store's public message stays uniform: it reaches CLI output and must not
|
|
13
|
+
* describe private resolution state. Diagnostics from the helper are preserved
|
|
14
|
+
* on `cause` so an operator log still shows which budget or invariant failed.
|
|
15
|
+
*/
|
|
16
|
+
const fail = (cause) => {
|
|
17
|
+
throw new Error(ORGANIZATION_HANDOFF_AUTHORITY_ERROR, ...(cause === undefined ? [] : [{ cause }]));
|
|
18
|
+
};
|
|
12
19
|
const key = (value) => Buffer.from(value, "utf8").toString("hex");
|
|
13
20
|
const same = (left, right) => JSON.stringify(left) === JSON.stringify(right);
|
|
14
21
|
const pendingKey = (value) => typeof value === "string" && /^[a-f0-9]{64}$/u.test(value) ? value : fail();
|
|
@@ -27,8 +34,8 @@ const closeRequest = (value) => {
|
|
|
27
34
|
organizationHandoffHandle: parseOpaqueTargetHandle(input.organizationHandoffHandle)
|
|
28
35
|
});
|
|
29
36
|
}
|
|
30
|
-
catch {
|
|
31
|
-
return fail();
|
|
37
|
+
catch (error) {
|
|
38
|
+
return fail(error);
|
|
32
39
|
}
|
|
33
40
|
};
|
|
34
41
|
export const resolveOrganizationHandoffAuthorityRoot = () => path.join(resolveSpawnfileHome(), "deployments", "organization-handoff-authority");
|
|
@@ -309,8 +316,8 @@ class Store {
|
|
|
309
316
|
network_attachment_handle: final.handoff.network_attachment_handle }), selected_target_binding: Object.freeze({ receipt: final.selected_target,
|
|
310
317
|
receipt_digest: final.selected_target_receipt_digest }) });
|
|
311
318
|
}
|
|
312
|
-
catch {
|
|
313
|
-
return fail();
|
|
319
|
+
catch (error) {
|
|
320
|
+
return fail(error);
|
|
314
321
|
}
|
|
315
322
|
}
|
|
316
323
|
}
|
|
@@ -339,10 +346,10 @@ export const initializeOrganizationHandoffAuthorityStore = async (options = {})
|
|
|
339
346
|
clients.set(part, client);
|
|
340
347
|
}
|
|
341
348
|
}
|
|
342
|
-
catch {
|
|
349
|
+
catch (error) {
|
|
343
350
|
await Promise.all([...clients.values()].map(async (client) => client.dispose()));
|
|
344
351
|
await Promise.all([...anchors.values()].map(async ({ handle }) => { await handle.close().catch(() => undefined); }));
|
|
345
|
-
return fail();
|
|
352
|
+
return fail(error);
|
|
346
353
|
}
|
|
347
354
|
return new Store(root, anchors, clients, options.testHooks);
|
|
348
355
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type OpaqueTargetHandle, type SelectedTargetReceipt } from "../target/index.js";
|
|
2
|
+
import { ORGANIZATION_HANDOFF_AUTHORITY_ERROR } from "./organizationHandoffAuthorityFsBudget.js";
|
|
2
3
|
import { type OrganizationHandoff } from "./organizationHandoffTypes.js";
|
|
3
4
|
export declare const ORGANIZATION_HANDOFF_CAPABILITY_VERSION: "spawnfile.organization-handoff-capability.private.v1";
|
|
4
5
|
export declare const ORGANIZATION_HANDOFF_RECOVERY_VERSION: "spawnfile.organization-handoff-recovery.private.v1";
|
|
5
|
-
export
|
|
6
|
+
export { ORGANIZATION_HANDOFF_AUTHORITY_ERROR };
|
|
6
7
|
declare const labels: ("com.spawnfile.compile_fingerprint" | "com.spawnfile.project" | "com.spawnfile.deployment" | "com.spawnfile.run_id" | "com.spawnfile.unit" | "com.spawnfile.version")[];
|
|
7
8
|
export type OrganizationHandoffCapabilityState = "pending" | "finalized" | "attach_closed";
|
|
8
9
|
export type OrganizationHandoffDeploymentLabels = Readonly<Record<(typeof labels)[number], string>>;
|
|
@@ -73,4 +74,3 @@ export declare const parseOrganizationAttachmentAuthorizationForDeployment: (raw
|
|
|
73
74
|
};
|
|
74
75
|
readonly version: "spawnfile.target-organization-attachment.authorization.v1";
|
|
75
76
|
};
|
|
76
|
-
export {};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { assertOrdinaryJsonGraph, createCanonicalSelectedTargetReceiptBytes, parseOpaqueTargetHandle, parseRunId, parseSelectedTargetReceipt } from "../target/index.js";
|
|
3
3
|
import { dockerDeploymentLabelKeys } from "./dockerLabels.js";
|
|
4
|
+
import { ORGANIZATION_HANDOFF_AUTHORITY_ERROR } from "./organizationHandoffAuthorityFsBudget.js";
|
|
4
5
|
import { parseOrganizationHandoff } from "./organizationHandoffTypes.js";
|
|
5
6
|
export const ORGANIZATION_HANDOFF_CAPABILITY_VERSION = "spawnfile.organization-handoff-capability.private.v1";
|
|
6
7
|
export const ORGANIZATION_HANDOFF_RECOVERY_VERSION = "spawnfile.organization-handoff-recovery.private.v1";
|
|
7
|
-
export
|
|
8
|
+
export { ORGANIZATION_HANDOFF_AUTHORITY_ERROR };
|
|
8
9
|
const DIGEST = /^sha256:[a-f0-9]{64}$/u;
|
|
9
10
|
const CONTAINER = /^[a-f0-9]{64}$/u;
|
|
10
11
|
const NAME = /^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$/u;
|
|
@@ -16,7 +16,9 @@ export interface OrganizationReadiness {
|
|
|
16
16
|
readonly reason?: string;
|
|
17
17
|
}
|
|
18
18
|
export interface OrganizationReadinessProbeData {
|
|
19
|
+
readonly daimonReceipt?: string | null;
|
|
19
20
|
readonly configs: ReadonlyMap<string, string>;
|
|
21
|
+
readonly attachmentReceipts?: ReadonlyMap<string, string>;
|
|
20
22
|
readonly networks: readonly {
|
|
21
23
|
readonly healthOk: boolean;
|
|
22
24
|
readonly id: string;
|