agentscape3d-engine 0.0.0-stage → 1.0.0-beta.2
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/LICENSE +21 -0
- package/README.md +19 -2
- package/cli.mjs +53 -0
- package/dist/AssetCompiler-A99wKf7H.js +2424 -0
- package/dist/AssetCompiler-A99wKf7H.js.map +1 -0
- package/dist/AssetInputContracts-uKYeQu-X.js +245 -0
- package/dist/AssetInputContracts-uKYeQu-X.js.map +1 -0
- package/dist/AssetRecipe-DCaLLXvG.js +67 -0
- package/dist/AssetRecipe-DCaLLXvG.js.map +1 -0
- package/dist/BrowserCodeWorker.js +53850 -0
- package/dist/BrowserCodeWorker.js.map +1 -0
- package/dist/KinematicHypothesisScreen-4v7GBwdv.js +241 -0
- package/dist/KinematicHypothesisScreen-4v7GBwdv.js.map +1 -0
- package/dist/SceneSerializer-CLCzQjL_.js +350 -0
- package/dist/SceneSerializer-CLCzQjL_.js.map +1 -0
- package/dist/StylePack-CD_BC-Mv.js +6317 -0
- package/dist/StylePack-CD_BC-Mv.js.map +1 -0
- package/dist/WorldArchive-dYf1OpSe.js +417 -0
- package/dist/WorldArchive-dYf1OpSe.js.map +1 -0
- package/dist/WorldIO-Dqz4MqTQ.js +149 -0
- package/dist/WorldIO-Dqz4MqTQ.js.map +1 -0
- package/dist/blankWorld-OoOvN_IK.js +75 -0
- package/dist/blankWorld-OoOvN_IK.js.map +1 -0
- package/dist/core.d.ts +68 -0
- package/dist/core.js +209 -0
- package/dist/core.js.map +1 -0
- package/dist/disposeObject3D-B3HCflvO.js +128 -0
- package/dist/disposeObject3D-B3HCflvO.js.map +1 -0
- package/dist/environments-B1WaICAN.js +4197 -0
- package/dist/environments-B1WaICAN.js.map +1 -0
- package/dist/gltfIO-BMK1hc2D.js +9 -0
- package/dist/gltfIO-BMK1hc2D.js.map +1 -0
- package/dist/grandUrbanBlock-Bdjgc6ZT.js +515 -0
- package/dist/grandUrbanBlock-Bdjgc6ZT.js.map +1 -0
- package/dist/index.d.ts +275 -0
- package/dist/index.js +16239 -0
- package/dist/index.js.map +1 -0
- package/dist/magicCabin-DPQi_jh-.js +11019 -0
- package/dist/magicCabin-DPQi_jh-.js.map +1 -0
- package/dist/mcp.d.ts +2 -0
- package/dist/mcp.js +1 -0
- package/dist/monumentHall-IOLbRZQC.js +403 -0
- package/dist/monumentHall-IOLbRZQC.js.map +1 -0
- package/dist/node.d.ts +16 -0
- package/dist/node.js +26 -0
- package/dist/rolldown-runtime-D3KUYPsf.js +12 -0
- package/dist/ruinedCourtyard-BtaF_aOi.js +696 -0
- package/dist/ruinedCourtyard-BtaF_aOi.js.map +1 -0
- package/dist/runtime/application/AgentTools.js +28 -0
- package/dist/runtime/application/README.md +14 -0
- package/dist/runtime/application/agent/ProgressiveAgentTools.js +92 -0
- package/dist/runtime/application/agent/StudioMcpAllowlist.js +8 -0
- package/dist/runtime/application/buildTaskObservation.js +117 -0
- package/dist/runtime/application/code-execution/AuthoringSandboxEntry.js +46 -0
- package/dist/runtime/application/code-execution/BrowserCodeExecutor.js +35 -0
- package/dist/runtime/application/code-execution/BrowserCodeWorker.js +17 -0
- package/dist/runtime/application/code-execution/RemoteAuthoringDocument.js +72 -0
- package/dist/runtime/application/createSession.js +66 -0
- package/dist/runtime/application/createWorldAuthoringContext.js +400 -0
- package/dist/runtime/application/generation/GenerationOrchestrator.js +629 -0
- package/dist/runtime/application/generation/GenerationRuntime.js +214 -0
- package/dist/runtime/application/generation/PromptHybridWorldOrchestrator.js +285 -0
- package/dist/runtime/application/native-scene/CodeProject.js +119 -0
- package/dist/runtime/application/native-scene/CodeProjectModules.js +128 -0
- package/dist/runtime/application/native-scene/NativeEnvironmentGeometry.js +62 -0
- package/dist/runtime/application/native-scene/NativeOverlayCheckpoint.js +127 -0
- package/dist/runtime/application/native-scene/NativeRenderDiscovery.js +51 -0
- package/dist/runtime/application/native-scene/NativeSceneHost.js +319 -0
- package/dist/runtime/application/native-scene/NativeSceneOverlay.js +116 -0
- package/dist/runtime/application/native-scene/NativeThreeModule.js +16 -0
- package/dist/runtime/application/object-forge/SceneObjectForge.js +232 -0
- package/dist/runtime/application/programmatic-assets/ProgrammaticAssetBuilder.js +59 -0
- package/dist/runtime/application/programmatic-assets/ProgrammaticAssetContract.js +22 -0
- package/dist/runtime/application/programmatic-assets/ThreeCodeAsset.js +40 -0
- package/dist/runtime/application/scene/CapabilityResolver.js +79 -0
- package/dist/runtime/application/scene/RequestWindow.js +54 -0
- package/dist/runtime/application/scene/SceneAgentTools.js +21 -0
- package/dist/runtime/application/scene/SceneContracts.js +45 -0
- package/dist/runtime/application/scene/SceneEditService.js +144 -0
- package/dist/runtime/application/scene/SceneFacade.js +261 -0
- package/dist/runtime/application/scene/SceneInteractionAdapters.js +40 -0
- package/dist/runtime/application/scene/SceneJobController.js +229 -0
- package/dist/runtime/application/scene/SceneLifecycle.js +57 -0
- package/dist/runtime/application/scene/ScenePackage.js +162 -0
- package/dist/runtime/application/scene/ScenePersistence.js +50 -0
- package/dist/runtime/application/scene/SceneProject.js +95 -0
- package/dist/runtime/application/scene/SceneSkillNames.js +5 -0
- package/dist/runtime/application/scene/StarterScene.js +56 -0
- package/dist/runtime/application/scene/WorldArchive.js +87 -0
- package/dist/runtime/application/scene/WorldDirectory.js +20 -0
- package/dist/runtime/application/scene/WorldDocument.js +74 -0
- package/dist/runtime/application/scene/WorldIO.js +103 -0
- package/dist/runtime/application/scene/WorldStorage.js +137 -0
- package/dist/runtime/application/skills/SkillRegistry.js +189 -0
- package/dist/runtime/application/skills/packs/acceptanceSkills.js +32 -0
- package/dist/runtime/application/skills/packs/affordanceSkills.js +36 -0
- package/dist/runtime/application/skills/packs/assetSkills.js +46 -0
- package/dist/runtime/application/skills/packs/authoringSkills.js +16 -0
- package/dist/runtime/application/skills/packs/batchSkills.js +22 -0
- package/dist/runtime/application/skills/packs/codeSkills.js +106 -0
- package/dist/runtime/application/skills/packs/generationSkills.js +45 -0
- package/dist/runtime/application/skills/packs/interactionSkills.js +46 -0
- package/dist/runtime/application/skills/packs/recoverySkills.js +80 -0
- package/dist/runtime/application/skills/packs/sceneSkills.js +24 -0
- package/dist/runtime/application/skills/packs/spatialSkills.js +35 -0
- package/dist/runtime/application/skills/packs/verificationSkills.js +14 -0
- package/dist/runtime/application/skills/packs/worldSkills.js +45 -0
- package/dist/runtime/application/skills/registerCoreSkills.js +31 -0
- package/dist/runtime/application/skills/skillPrimitives.js +4 -0
- package/dist/runtime/application/tasks/CabinetCupTask.js +76 -0
- package/dist/runtime/application/tasks.jsonl +67 -0
- package/dist/runtime/application/world-authoring/AuthoringAssetProducer.js +42 -0
- package/dist/runtime/application/world-authoring/AuthoringDiff.js +149 -0
- package/dist/runtime/application/world-authoring/AuthoringDocument.js +825 -0
- package/dist/runtime/application/world-authoring/AuthoringExecutionHost.js +109 -0
- package/dist/runtime/application/world-authoring/AuthoringIdentity.js +17 -0
- package/dist/runtime/application/world-authoring/AuthoringModelResolver.js +29 -0
- package/dist/runtime/application/world-authoring/AuthoringPatch.js +118 -0
- package/dist/runtime/application/world-authoring/AuthoringPromotionController.js +334 -0
- package/dist/runtime/application/world-authoring/AuthoringPromotionSource.js +126 -0
- package/dist/runtime/application/world-authoring/AuthoringRevisionHistory.js +144 -0
- package/dist/runtime/application/world-authoring/HeadlessImageExport.js +174 -0
- package/dist/runtime/application/world-authoring/ModelRef.js +62 -0
- package/dist/runtime/apps/mcp-server/AUTHORING.md +71 -0
- package/dist/runtime/apps/mcp-server/AgentMcpCompat.js +77 -0
- package/dist/runtime/apps/mcp-server/AuthoringSandboxEntry.js +1 -0
- package/dist/runtime/apps/mcp-server/AuthoringSandboxWorker.mjs +30 -0
- package/dist/runtime/apps/mcp-server/BuildEnvironment.js +17 -0
- package/dist/runtime/apps/mcp-server/CodeExecutor.js +71 -0
- package/dist/runtime/apps/mcp-server/DEPLOYMENT-PC2.md +42 -0
- package/dist/runtime/apps/mcp-server/DockerBuildRunner.js +66 -0
- package/dist/runtime/apps/mcp-server/FileAssetRepository.js +159 -0
- package/dist/runtime/apps/mcp-server/HeadlessAssetIO.js +8 -0
- package/dist/runtime/apps/mcp-server/HeadlessGLTFLoader.js +47 -0
- package/dist/runtime/apps/mcp-server/HeadlessWorldHost.js +132 -0
- package/dist/runtime/apps/mcp-server/IsolatedAuthoringExecutor.js +6 -0
- package/dist/runtime/apps/mcp-server/PROGRAMMATIC-ASSETS.md +116 -0
- package/dist/runtime/apps/mcp-server/ProgrammaticAssets.js +60 -0
- package/dist/runtime/apps/mcp-server/README.md +150 -0
- package/dist/runtime/apps/mcp-server/RemoteAuthoringDocument.js +1 -0
- package/dist/runtime/apps/mcp-server/SandboxBundle.js +13 -0
- package/dist/runtime/apps/mcp-server/SessionManager.js +80 -0
- package/dist/runtime/apps/mcp-server/StudioBridgeHttp.js +58 -0
- package/dist/runtime/apps/mcp-server/StudioLiveBridge.js +190 -0
- package/dist/runtime/apps/mcp-server/TrustedAuthoringWorker.mjs +16 -0
- package/dist/runtime/apps/mcp-server/VALIDATION.md +45 -0
- package/dist/runtime/apps/mcp-server/acceptance-evidence.json +332 -0
- package/dist/runtime/apps/mcp-server/errorDiagnostics.js +32 -0
- package/dist/runtime/apps/mcp-server/examples/code-house.js +24 -0
- package/dist/runtime/apps/mcp-server/examples/procedural-assets.js +85 -0
- package/dist/runtime/apps/mcp-server/main.mjs +65 -0
- package/dist/runtime/apps/mcp-server/registerTools.js +225 -0
- package/dist/runtime/apps/mcp-server/sandbox/run.mjs +23 -0
- package/dist/runtime/apps/mcp-server/security.js +21 -0
- package/dist/runtime/apps/mcp-server/tasks.jsonl +9 -0
- package/dist/runtime/apps/server/CapabilityAdapterRegistry.js +157 -0
- package/dist/runtime/apps/server/README.md +7 -0
- package/dist/runtime/apps/server/WorldDiskStorage.js +51 -0
- package/dist/runtime/apps/server/openai-compatible-agent-gateway.mjs +278 -0
- package/dist/runtime/apps/server/tasks.jsonl +10 -0
- package/dist/runtime/foundation/EventBus.js +18 -0
- package/dist/runtime/foundation/JsonGateway.js +47 -0
- package/dist/runtime/foundation/PolicyEngine.js +21 -0
- package/dist/runtime/foundation/README.md +7 -0
- package/dist/runtime/foundation/TraceRecorder.js +76 -0
- package/dist/runtime/foundation/errors.js +8 -0
- package/dist/runtime/foundation/simulation/SimulationProfile.js +143 -0
- package/dist/runtime/foundation/version.js +2 -0
- package/dist/runtime/modules/agent/README.md +11 -0
- package/dist/runtime/modules/agent/ToolCallingAgent.js +19 -0
- package/dist/runtime/modules/agent/bootstrapWorld.js +10 -0
- package/dist/runtime/modules/agent/buildRecoveryProposals.js +533 -0
- package/dist/runtime/modules/agent/execution/AgentExecutionRules.js +128 -0
- package/dist/runtime/modules/agent/execution/AgentRunResults.js +55 -0
- package/dist/runtime/modules/agent/execution/AgentRunSession.js +393 -0
- package/dist/runtime/modules/agent/execution/AgentToolInvoker.js +40 -0
- package/dist/runtime/modules/agent/gateway/HttpLLMGateway.js +19 -0
- package/dist/runtime/modules/agent/prompt/index.js +52 -0
- package/dist/runtime/modules/agent/tasks.jsonl +94 -0
- package/dist/runtime/modules/artifact/ArtifactContentGate.js +144 -0
- package/dist/runtime/modules/artifact/ArtifactDescriptor.js +280 -0
- package/dist/runtime/modules/artifact/ArtifactImporter.js +185 -0
- package/dist/runtime/modules/artifact/ArtifactModule.js +111 -0
- package/dist/runtime/modules/artifact/ArtifactRegistry.js +197 -0
- package/dist/runtime/modules/artifact/IncrementalSha256.js +129 -0
- package/dist/runtime/modules/artifact/MemoryArtifactByteStore.js +115 -0
- package/dist/runtime/modules/artifact/README.md +7 -0
- package/dist/runtime/modules/artifact/storage/IndexedDbArtifactStore.js +67 -0
- package/dist/runtime/modules/artifact/tasks.jsonl +31 -0
- package/dist/runtime/modules/asset/AssetModule.js +399 -0
- package/dist/runtime/modules/asset/README.md +54 -0
- package/dist/runtime/modules/asset/loading/AssetLoader.js +157 -0
- package/dist/runtime/modules/asset/loading/GltfAssetLoader.js +61 -0
- package/dist/runtime/modules/asset/loading/builtins/BuiltinAssets.js +95 -0
- package/dist/runtime/modules/asset/loading/builtins/HouseDoor.js +33 -0
- package/dist/runtime/modules/asset/loading/builtins/IndustrialCabinet.js +103 -0
- package/dist/runtime/modules/asset/model/AssetInputContracts.js +100 -0
- package/dist/runtime/modules/asset/model/AssetRef.js +12 -0
- package/dist/runtime/modules/asset/model/MechanicalAssetDraft.js +172 -0
- package/dist/runtime/modules/asset/model/admission.js +117 -0
- package/dist/runtime/modules/asset/model/errors.js +6 -0
- package/dist/runtime/modules/asset/model/parts.js +27 -0
- package/dist/runtime/modules/asset/model/resourceBudget.js +10 -0
- package/dist/runtime/modules/asset/model/schema.js +150 -0
- package/dist/runtime/modules/asset/persistence/AssetManifestStore.js +78 -0
- package/dist/runtime/modules/asset/persistence/CompiledAssetStore.js +84 -0
- package/dist/runtime/modules/asset/persistence/LocalAssetLibrary.js +86 -0
- package/dist/runtime/modules/asset/persistence/LocalAssetLibraryStore.js +81 -0
- package/dist/runtime/modules/asset/production/AssetProductionPipeline.js +272 -0
- package/dist/runtime/modules/asset/production/AssetRecipe.js +47 -0
- package/dist/runtime/modules/asset/production/adapters/EmbodiedGenAdapter.js +45 -0
- package/dist/runtime/modules/asset/production/adapters/EmbodiedGenBundleAdapter.js +590 -0
- package/dist/runtime/modules/asset/production/compiler/AssetCompiler.js +173 -0
- package/dist/runtime/modules/asset/production/compiler/evidence/AnimationMotionEvidence.js +124 -0
- package/dist/runtime/modules/asset/production/compiler/evidence/StaticPanelEvidence.js +56 -0
- package/dist/runtime/modules/asset/production/compiler/gltfIO.js +6 -0
- package/dist/runtime/modules/asset/production/compiler/partGeometry.js +74 -0
- package/dist/runtime/modules/asset/production/compiler/passes/ArticulatedCollisionPass.js +63 -0
- package/dist/runtime/modules/asset/production/compiler/passes/ArticulationCandidatePass.js +48 -0
- package/dist/runtime/modules/asset/production/compiler/passes/AuthoringIntentPass.js +16 -0
- package/dist/runtime/modules/asset/production/compiler/passes/ColliderFallbackPass.js +30 -0
- package/dist/runtime/modules/asset/production/compiler/passes/CompileQualityPass.js +75 -0
- package/dist/runtime/modules/asset/production/compiler/passes/ExplicitDefinitionPass.js +20 -0
- package/dist/runtime/modules/asset/production/compiler/passes/GLTFInspectPass.js +34 -0
- package/dist/runtime/modules/asset/production/compiler/passes/GeometryPass.js +32 -0
- package/dist/runtime/modules/asset/production/compiler/passes/JointFramePass.js +116 -0
- package/dist/runtime/modules/asset/production/compiler/passes/KinematicEvidencePass.js +84 -0
- package/dist/runtime/modules/asset/production/compiler/passes/ManifestPass.js +63 -0
- package/dist/runtime/modules/asset/production/compiler/passes/NormalizeTransformPass.js +16 -0
- package/dist/runtime/modules/asset/production/compiler/passes/OptimizeGLBPass.js +23 -0
- package/dist/runtime/modules/asset/production/compiler/passes/PartColliderPass.js +50 -0
- package/dist/runtime/modules/asset/production/compiler/passes/PartGeometryEnrichmentPass.js +60 -0
- package/dist/runtime/modules/asset/production/compiler/passes/PartProposalPass.js +93 -0
- package/dist/runtime/modules/asset/production/compiler/passes/RemoteEnrichmentPass.js +32 -0
- package/dist/runtime/modules/asset/production/compiler/passes/ResourceBudgetPass.js +55 -0
- package/dist/runtime/modules/asset/production/compiler/passes/SegmentMaterializePass.js +203 -0
- package/dist/runtime/modules/asset/production/compiler/passes/SegmentationEvidencePass.js +43 -0
- package/dist/runtime/modules/asset/production/compiler/passes/SemanticHeuristicPass.js +33 -0
- package/dist/runtime/modules/asset/production/compiler/passes/StructurePass.js +60 -0
- package/dist/runtime/modules/asset/production/compiler/providers/HttpCompilerProvider.js +23 -0
- package/dist/runtime/modules/asset/production/verification/KinematicHypothesisScreen.js +198 -0
- package/dist/runtime/modules/asset/registry/AssetCatalog.js +72 -0
- package/dist/runtime/modules/asset/registry/AssetRegistry.js +51 -0
- package/dist/runtime/modules/asset/registry/manifests/index.js +173 -0
- package/dist/runtime/modules/asset/tasks.jsonl +87 -0
- package/dist/runtime/modules/generation/README.md +9 -0
- package/dist/runtime/modules/generation/connector/ConnectorArtifactClient.js +45 -0
- package/dist/runtime/modules/generation/connector/ConnectorCapabilityAdapter.js +169 -0
- package/dist/runtime/modules/generation/connector/ConnectorClient.js +192 -0
- package/dist/runtime/modules/generation/connector/ConnectorJobClient.js +167 -0
- package/dist/runtime/modules/generation/connector/ConnectorJobEventClient.js +179 -0
- package/dist/runtime/modules/generation/connector/ConnectorSession.js +202 -0
- package/dist/runtime/modules/generation/jobs/GenerationJobProjection.js +239 -0
- package/dist/runtime/modules/generation/jobs/GenerationJobReconciler.js +99 -0
- package/dist/runtime/modules/generation/jobs/GenerationJobStore.js +91 -0
- package/dist/runtime/modules/generation/jobs/GenerationJobTransportOverlay.js +50 -0
- package/dist/runtime/modules/generation/providers/ProviderRegistry.js +304 -0
- package/dist/runtime/modules/generation/tasks.jsonl +35 -0
- package/dist/runtime/modules/navigation/NavigationBackend.js +17 -0
- package/dist/runtime/modules/navigation/RecastNavigationBackend.js +245 -0
- package/dist/runtime/modules/physics/JoltPhysicsBackend.js +850 -0
- package/dist/runtime/modules/physics/PhysicsApiSurface.js +651 -0
- package/dist/runtime/modules/physics/PhysicsBackend.js +88 -0
- package/dist/runtime/modules/physics/RapierPhysicsBackend.js +410 -0
- package/dist/runtime/modules/rendering/README.md +7 -0
- package/dist/runtime/modules/rendering/RendererProbe.js +153 -0
- package/dist/runtime/modules/rendering/WebGpuPostFxPipeline.js +140 -0
- package/dist/runtime/modules/rendering/createRenderer.js +76 -0
- package/dist/runtime/modules/rendering/disposeObject3D.js +37 -0
- package/dist/runtime/modules/rendering/loadGaussianSplatVisual.js +74 -0
- package/dist/runtime/modules/rendering/spatial/ThreeBvhRuntime.js +107 -0
- package/dist/runtime/modules/rendering/style/StylePack.js +34 -0
- package/dist/runtime/modules/rendering/style/StyleSystem.js +173 -0
- package/dist/runtime/modules/rendering/tasks.jsonl +7 -0
- package/dist/runtime/modules/world/README.md +13 -0
- package/dist/runtime/modules/world/build/WorldBuilder.js +170 -0
- package/dist/runtime/modules/world/compiler/PipelineEngine.js +32 -0
- package/dist/runtime/modules/world/compiler/WorldAdmission.js +43 -0
- package/dist/runtime/modules/world/compiler/WorldBehaviorCompiler.js +68 -0
- package/dist/runtime/modules/world/compiler/WorldCompilation.js +157 -0
- package/dist/runtime/modules/world/compiler/WorldComposer.js +201 -0
- package/dist/runtime/modules/world/compiler/WorldPhysicsAdmission.js +76 -0
- package/dist/runtime/modules/world/compiler/WorldRecompiler.js +356 -0
- package/dist/runtime/modules/world/compiler/WorldRetry.js +75 -0
- package/dist/runtime/modules/world/compiler/createWorldPipeline.js +379 -0
- package/dist/runtime/modules/world/content/blankWorld.js +35 -0
- package/dist/runtime/modules/world/content/environments.js +84 -0
- package/dist/runtime/modules/world/content/grandUrbanBlock.js +189 -0
- package/dist/runtime/modules/world/content/magic-cabin/README.md +28 -0
- package/dist/runtime/modules/world/content/magic-cabin/affordances.js +64 -0
- package/dist/runtime/modules/world/content/magic-cabin/cabinContents.js +7078 -0
- package/dist/runtime/modules/world/content/magic-cabin/lighting.js +26 -0
- package/dist/runtime/modules/world/content/magic-cabin/materials.js +20 -0
- package/dist/runtime/modules/world/content/magicCabin.js +190 -0
- package/dist/runtime/modules/world/content/monumentHall.js +154 -0
- package/dist/runtime/modules/world/content/ruinedCourtyard.js +196 -0
- package/dist/runtime/modules/world/content/suzhouGarden/README.md +141 -0
- package/dist/runtime/modules/world/content/suzhouGarden/index.js +137 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/arch.js +491 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/buildings.js +670 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/core.js +578 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/lod.js +127 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/main.js +642 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/nature.js +650 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/rockery.js +280 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/sky.js +242 -0
- package/dist/runtime/modules/world/content/suzhouGarden/src/water.js +215 -0
- package/dist/runtime/modules/world/content/woodlandWorkshop.js +192 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/README.md +36 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/arch.js +351 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/buildings.js +490 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/core.js +505 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/index.js +101 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/nature.js +435 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/sky.js +169 -0
- package/dist/runtime/modules/world/content/yuanmingyuan/water.js +245 -0
- package/dist/runtime/modules/world/errors.js +9 -0
- package/dist/runtime/modules/world/generated/GeneratedWorldCoordinates.js +50 -0
- package/dist/runtime/modules/world/generated/GeneratedWorldLoader.js +297 -0
- package/dist/runtime/modules/world/runtime/CommandHistory.js +80 -0
- package/dist/runtime/modules/world/runtime/EntityCapabilityRegistry.js +150 -0
- package/dist/runtime/modules/world/runtime/ObjectStore.js +31 -0
- package/dist/runtime/modules/world/runtime/ObjectTransform.js +62 -0
- package/dist/runtime/modules/world/runtime/ObservedEntity.js +37 -0
- package/dist/runtime/modules/world/runtime/ProjectCapabilities.js +207 -0
- package/dist/runtime/modules/world/runtime/SceneSerializer.js +246 -0
- package/dist/runtime/modules/world/runtime/WorldAuthority.js +41 -0
- package/dist/runtime/modules/world/runtime/WorldCollisionSignature.js +14 -0
- package/dist/runtime/modules/world/runtime/WorldCommands.js +502 -0
- package/dist/runtime/modules/world/runtime/WorldObservation.js +71 -0
- package/dist/runtime/modules/world/runtime/WorldQueries.js +340 -0
- package/dist/runtime/modules/world/runtime/WorldRecovery.js +78 -0
- package/dist/runtime/modules/world/runtime/WorldRuntime.js +665 -0
- package/dist/runtime/modules/world/runtime/affordance/ObjectAffordances.js +107 -0
- package/dist/runtime/modules/world/runtime/affordance/WorldAffordances.js +130 -0
- package/dist/runtime/modules/world/runtime/behavior/BehaviorCompiler.js +79 -0
- package/dist/runtime/modules/world/runtime/behavior/ProjectStateMachine.js +195 -0
- package/dist/runtime/modules/world/runtime/behavior/RuleGraph.js +70 -0
- package/dist/runtime/modules/world/runtime/behavior/RuleRuntime.js +115 -0
- package/dist/runtime/modules/world/runtime/graph/SceneGraph.js +305 -0
- package/dist/runtime/modules/world/runtime/interaction/ArticulationRuntime.js +214 -0
- package/dist/runtime/modules/world/runtime/interaction/CarryCapability.js +65 -0
- package/dist/runtime/modules/world/runtime/interaction/CarryRuntime.js +222 -0
- package/dist/runtime/modules/world/runtime/interaction/InteractionApproach.js +130 -0
- package/dist/runtime/modules/world/runtime/interaction/InteractionContract.js +57 -0
- package/dist/runtime/modules/world/runtime/interaction/RecoveryRuntime.js +123 -0
- package/dist/runtime/modules/world/runtime/interaction/SettleRuntime.js +120 -0
- package/dist/runtime/modules/world/runtime/semantic/SemanticWorldView.js +102 -0
- package/dist/runtime/modules/world/runtime/simulation/SimulationClock.js +89 -0
- package/dist/runtime/modules/world/runtime/simulation/SimulationSession.js +99 -0
- package/dist/runtime/modules/world/runtime/simulation/ThermalSystem.js +269 -0
- package/dist/runtime/modules/world/runtime/spatial/SpatialSnapshot.js +56 -0
- package/dist/runtime/modules/world/runtime/systems/AudioSystem.js +125 -0
- package/dist/runtime/modules/world/runtime/systems/Instrument.js +38 -0
- package/dist/runtime/modules/world/runtime/systems/InteractionSystem.js +728 -0
- package/dist/runtime/modules/world/runtime/systems/LocomotionSystem.js +269 -0
- package/dist/runtime/modules/world/runtime/systems/NavigationSystem.js +469 -0
- package/dist/runtime/modules/world/runtime/systems/PhysicsSystem.js +1673 -0
- package/dist/runtime/modules/world/runtime/systems/RenderingSystem.js +457 -0
- package/dist/runtime/modules/world/runtime/systems/SpatialSystem.js +284 -0
- package/dist/runtime/modules/world/spec/WorldIR.js +165 -0
- package/dist/runtime/modules/world/spec/WorldIRToolSchema.js +86 -0
- package/dist/runtime/modules/world/spec/WorldPlannerProposal.js +51 -0
- package/dist/runtime/modules/world/spec/WorldRevision.js +231 -0
- package/dist/runtime/modules/world/spec/WorldSpec.js +86 -0
- package/dist/runtime/modules/world/tasks.jsonl +530 -0
- package/dist/runtime/modules/world/verification/ArticulationVerifier.js +254 -0
- package/dist/runtime/modules/world/verification/Finding.js +105 -0
- package/dist/runtime/modules/world/verification/InteractionEvidence.js +69 -0
- package/dist/runtime/modules/world/verification/RepairEngine.js +49 -0
- package/dist/runtime/modules/world/verification/WorldAcceptance.js +158 -0
- package/dist/runtime/modules/world/verification/WorldValidator.js +65 -0
- package/dist/runtime/package-lock.json +16048 -0
- package/dist/runtime/package.json +105 -0
- package/dist/runtime/public/assets/cabinet.glb +0 -0
- package/dist/runtime/public/assets/grand-urban-block/clean_asphalt_diff_1k.jpg +0 -0
- package/dist/runtime/public/assets/grand-urban-block/clean_asphalt_nor_gl_1k.jpg +0 -0
- package/dist/runtime/public/assets/grand-urban-block/concrete_pavement_diff_1k.jpg +0 -0
- package/dist/runtime/public/assets/grand-urban-block/urban_street_01_1k.hdr +0 -0
- package/dist/runtime/public/assets/monument-hall/marble_diff_1k.jpg +0 -0
- package/dist/runtime/public/assets/monument-hall/marble_nor_gl_1k.jpg +0 -0
- package/dist/runtime/public/assets/monument-hall/marble_rough_1k.jpg +0 -0
- package/dist/runtime/public/assets/monument-hall/solitude_interior_1k.hdr +0 -0
- package/dist/runtime/public/assets/ruined-courtyard/courtyard_1k.hdr +0 -0
- package/dist/runtime/public/assets/ruined-courtyard/mossy_cobblestone_diff_1k.jpg +0 -0
- package/dist/runtime/public/assets/ruined-courtyard/mossy_cobblestone_nor_gl_1k.jpg +0 -0
- package/dist/runtime/public/assets/ruined-courtyard/mossy_sandstone_diff_1k.jpg +0 -0
- package/dist/schema-BWpTl0Wj.js +359 -0
- package/dist/schema-BWpTl0Wj.js.map +1 -0
- package/dist/suzhouGarden-H9tiPgxq.js +6150 -0
- package/dist/suzhouGarden-H9tiPgxq.js.map +1 -0
- package/dist/woodlandWorkshop-D6zzSbHr.js +483 -0
- package/dist/woodlandWorkshop-D6zzSbHr.js.map +1 -0
- package/dist/yuanmingyuan-D6IHqjZ-.js +4955 -0
- package/dist/yuanmingyuan-D6IHqjZ-.js.map +1 -0
- package/package.json +70 -4
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ARTIFACT_LEASE_HOLDER_KINDS,
|
|
3
|
+
ArtifactContractError,
|
|
4
|
+
artifactImmutableSignature,
|
|
5
|
+
normalizeArtifactDescriptor,
|
|
6
|
+
normalizeArtifactHash,
|
|
7
|
+
normalizeArtifactLocation,
|
|
8
|
+
requireSafeArtifactId
|
|
9
|
+
} from './ArtifactDescriptor.js';
|
|
10
|
+
|
|
11
|
+
const HOLDER_KIND_SET=new Set(ARTIFACT_LEASE_HOLDER_KINDS);
|
|
12
|
+
const SAFE_REASON=/^[A-Za-z0-9][A-Za-z0-9 ._:-]{0,199}$/;
|
|
13
|
+
const SAFE_CODE=/^[A-Z0-9][A-Z0-9._:-]{0,119}$/i;
|
|
14
|
+
const UNSAFE_REASON_RE=/https?:\/\/|Bearer\s+/i;
|
|
15
|
+
const clone=(value)=>value == null ? value : structuredClone(value);
|
|
16
|
+
|
|
17
|
+
function normalizeTime(value,field,{required=false}={}) {
|
|
18
|
+
if (value==null||value==='') {
|
|
19
|
+
if (required) throw new ArtifactContractError('ARTIFACT_LEASE_INVALID',`Artifact lease requires ${field}`,{field});
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
const time=Date.parse(String(value));
|
|
23
|
+
if (!Number.isFinite(time)) throw new ArtifactContractError('ARTIFACT_LEASE_INVALID',`Artifact lease has invalid ${field}`,{field});
|
|
24
|
+
return new Date(time).toISOString();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function normalizeLease(value={},artifactId) {
|
|
28
|
+
if (!value || typeof value!=='object' || Array.isArray(value)) throw new ArtifactContractError('ARTIFACT_LEASE_INVALID','Artifact lease must be an object');
|
|
29
|
+
const holder=value.holder;
|
|
30
|
+
if (!holder || typeof holder!=='object' || Array.isArray(holder)) throw new ArtifactContractError('ARTIFACT_LEASE_INVALID','Artifact lease requires holder');
|
|
31
|
+
const holderKind=String(holder.kind||'');
|
|
32
|
+
if (!HOLDER_KIND_SET.has(holderKind)) throw new ArtifactContractError('ARTIFACT_LEASE_INVALID',`Unsupported artifact lease holder kind: ${holderKind}`);
|
|
33
|
+
const reason=String(value.reason||'').trim();
|
|
34
|
+
if (!SAFE_REASON.test(reason) || UNSAFE_REASON_RE.test(reason)) throw new ArtifactContractError('ARTIFACT_LEASE_INVALID','Artifact lease reason is invalid');
|
|
35
|
+
const createdAt=normalizeTime(value.createdAt,'createdAt',{required:true});
|
|
36
|
+
const expiresAt=normalizeTime(value.expiresAt,'expiresAt');
|
|
37
|
+
if (expiresAt && Date.parse(expiresAt)<=Date.parse(createdAt)) throw new ArtifactContractError('ARTIFACT_LEASE_INVALID','Artifact lease expiry must be after creation');
|
|
38
|
+
return {
|
|
39
|
+
id:requireSafeArtifactId(value.id,'lease.id'),
|
|
40
|
+
artifactId,
|
|
41
|
+
locationId:value.locationId==null?null:requireSafeArtifactId(value.locationId,'lease.locationId'),
|
|
42
|
+
holder:{kind:holderKind,id:requireSafeArtifactId(holder.id,'lease.holder.id')},
|
|
43
|
+
reason,
|
|
44
|
+
createdAt,
|
|
45
|
+
expiresAt
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export class ArtifactRegistry {
|
|
50
|
+
#now;
|
|
51
|
+
#artifacts=new Map();
|
|
52
|
+
#hashIndex=new Map();
|
|
53
|
+
#leases=new Map();
|
|
54
|
+
|
|
55
|
+
constructor({now=()=>Date.now()}={}) {
|
|
56
|
+
this.#now=now;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
register(payload) {
|
|
60
|
+
const descriptor=normalizeArtifactDescriptor(payload);
|
|
61
|
+
const previous=this.#artifacts.get(descriptor.id);
|
|
62
|
+
if (previous) {
|
|
63
|
+
if (artifactImmutableSignature(previous)!==artifactImmutableSignature(descriptor)) {
|
|
64
|
+
throw new ArtifactContractError('ARTIFACT_IDENTITY_CONFLICT','Artifact ID already exists with different immutable identity',{id:descriptor.id});
|
|
65
|
+
}
|
|
66
|
+
return this.get(descriptor.id);
|
|
67
|
+
}
|
|
68
|
+
this.#artifacts.set(descriptor.id,descriptor);
|
|
69
|
+
if (!this.#hashIndex.has(descriptor.hash)) this.#hashIndex.set(descriptor.hash,new Set());
|
|
70
|
+
this.#hashIndex.get(descriptor.hash).add(descriptor.id);
|
|
71
|
+
return this.get(descriptor.id);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
has(id) { return this.#artifacts.has(id); }
|
|
75
|
+
|
|
76
|
+
get(id) {
|
|
77
|
+
const artifact=this.#artifacts.get(id);
|
|
78
|
+
return artifact?clone(artifact):null;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
list() {
|
|
82
|
+
return [...this.#artifacts.values()].map(clone).sort((a,b)=>Date.parse(b.createdAt)-Date.parse(a.createdAt)||a.id.localeCompare(b.id));
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
findByHash(hash) {
|
|
86
|
+
const canonical=normalizeArtifactHash(hash);
|
|
87
|
+
return [...(this.#hashIndex.get(canonical)||[])].sort();
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
updateLocation(id,locationPayload) {
|
|
91
|
+
const artifactId=requireSafeArtifactId(id);
|
|
92
|
+
const artifact=this.#artifacts.get(artifactId);
|
|
93
|
+
if (!artifact) throw new ArtifactContractError('ARTIFACT_NOT_FOUND','Artifact does not exist',{id:artifactId});
|
|
94
|
+
const location=normalizeArtifactLocation(locationPayload,artifactId);
|
|
95
|
+
const next=clone(artifact);
|
|
96
|
+
const index=next.locations.findIndex((item)=>item.id===location.id);
|
|
97
|
+
if (index===-1) {
|
|
98
|
+
next.locations.push(location);
|
|
99
|
+
} else {
|
|
100
|
+
const previous=next.locations[index];
|
|
101
|
+
const accessConflict=previous.access && location.access && JSON.stringify(previous.access)!==JSON.stringify(location.access);
|
|
102
|
+
if (previous.kind!==location.kind || previous.scope!==location.scope || accessConflict) {
|
|
103
|
+
throw new ArtifactContractError('ARTIFACT_LOCATION_IDENTITY_CONFLICT','Artifact location ID cannot change kind, scope, or active access identity',{
|
|
104
|
+
id:artifactId,locationId:location.id
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
next.locations[index]=location;
|
|
108
|
+
}
|
|
109
|
+
this.#artifacts.set(artifactId,next);
|
|
110
|
+
return this.get(artifactId);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
removeLocation(id,locationId) {
|
|
114
|
+
const artifactId=requireSafeArtifactId(id);
|
|
115
|
+
const locationKey=requireSafeArtifactId(locationId,'locationId');
|
|
116
|
+
const artifact=this.#artifacts.get(artifactId);
|
|
117
|
+
if (!artifact) throw new ArtifactContractError('ARTIFACT_NOT_FOUND','Artifact does not exist',{id:artifactId});
|
|
118
|
+
if (!artifact.locations.some((item)=>item.id===locationKey)) return {removed:false,artifact:this.get(artifactId)};
|
|
119
|
+
if (this.isLeased(artifactId,{locationId:locationKey})) {
|
|
120
|
+
throw new ArtifactContractError('ARTIFACT_LOCATION_LEASED','Artifact location is protected by an active lease',{id:artifactId,locationId:locationKey});
|
|
121
|
+
}
|
|
122
|
+
const next=clone(artifact);
|
|
123
|
+
next.locations=next.locations.filter((item)=>item.id!==locationKey);
|
|
124
|
+
this.#artifacts.set(artifactId,next);
|
|
125
|
+
return {removed:true,artifact:this.get(artifactId)};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
verifyIntegrity(id,evidence={}) {
|
|
129
|
+
const artifactId=requireSafeArtifactId(id);
|
|
130
|
+
const artifact=this.#artifacts.get(artifactId);
|
|
131
|
+
if (!artifact) throw new ArtifactContractError('ARTIFACT_NOT_FOUND','Artifact does not exist',{id:artifactId});
|
|
132
|
+
const hash=normalizeArtifactHash(evidence.hash,'integrity.hash');
|
|
133
|
+
const bytes=Number(evidence.bytes);
|
|
134
|
+
if (!Number.isSafeInteger(bytes)||bytes<0) throw new ArtifactContractError('ARTIFACT_INTEGRITY_INVALID','Integrity evidence bytes are invalid');
|
|
135
|
+
const mime=String(evidence.mime||'').trim().toLowerCase();
|
|
136
|
+
if (hash!==artifact.hash||bytes!==artifact.bytes||mime!==artifact.mime) {
|
|
137
|
+
throw new ArtifactContractError('ARTIFACT_INTEGRITY_MISMATCH','Integrity evidence does not match the declared descriptor',{id:artifactId});
|
|
138
|
+
}
|
|
139
|
+
const verifiedAt=normalizeTime(evidence.verifiedAt,'verifiedAt',{required:true});
|
|
140
|
+
const method=String(evidence.method||'').trim();
|
|
141
|
+
if (!method || !SAFE_CODE.test(method)) throw new ArtifactContractError('ARTIFACT_INTEGRITY_INVALID','Integrity verification method must be a stable safe identifier');
|
|
142
|
+
const next=clone(artifact);
|
|
143
|
+
next.integrity={state:'verified',verifiedAt,method,rejection:null};
|
|
144
|
+
this.#artifacts.set(artifactId,next);
|
|
145
|
+
return this.get(artifactId);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
rejectIntegrity(id,evidence={}) {
|
|
149
|
+
const artifactId=requireSafeArtifactId(id);
|
|
150
|
+
const artifact=this.#artifacts.get(artifactId);
|
|
151
|
+
if (!artifact) throw new ArtifactContractError('ARTIFACT_NOT_FOUND','Artifact does not exist',{id:artifactId});
|
|
152
|
+
const code=String(evidence.code||'').trim();
|
|
153
|
+
if (!code || !SAFE_CODE.test(code)) throw new ArtifactContractError('ARTIFACT_INTEGRITY_INVALID','Integrity rejection code must be a stable safe identifier');
|
|
154
|
+
const checkedAt=normalizeTime(evidence.checkedAt,'checkedAt',{required:true});
|
|
155
|
+
const next=clone(artifact);
|
|
156
|
+
next.integrity={state:'rejected',verifiedAt:null,method:null,rejection:{code,checkedAt}};
|
|
157
|
+
this.#artifacts.set(artifactId,next);
|
|
158
|
+
return this.get(artifactId);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
acquireLease(artifactId,leasePayload) {
|
|
162
|
+
const id=requireSafeArtifactId(artifactId);
|
|
163
|
+
const artifact=this.#artifacts.get(id);
|
|
164
|
+
if (!artifact) throw new ArtifactContractError('ARTIFACT_NOT_FOUND','Artifact does not exist',{id});
|
|
165
|
+
const lease=normalizeLease(leasePayload,id);
|
|
166
|
+
if (lease.expiresAt && Date.parse(lease.expiresAt)<=this.#now()) {
|
|
167
|
+
throw new ArtifactContractError('ARTIFACT_LEASE_INVALID','Artifact lease is already expired',{leaseId:lease.id});
|
|
168
|
+
}
|
|
169
|
+
if (lease.locationId && !artifact.locations.some((location)=>location.id===lease.locationId)) {
|
|
170
|
+
throw new ArtifactContractError('ARTIFACT_LEASE_INVALID','Artifact lease references an unknown location',{id,locationId:lease.locationId});
|
|
171
|
+
}
|
|
172
|
+
const previous=this.#leases.get(lease.id);
|
|
173
|
+
if (previous && JSON.stringify(previous)!==JSON.stringify(lease)) throw new ArtifactContractError('ARTIFACT_LEASE_CONFLICT','Artifact lease ID already exists with different semantics',{leaseId:lease.id});
|
|
174
|
+
this.#leases.set(lease.id,lease);
|
|
175
|
+
return clone(lease);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
releaseLease(leaseId) {
|
|
179
|
+
const id=requireSafeArtifactId(leaseId,'leaseId');
|
|
180
|
+
return this.#leases.delete(id);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
leasesFor(artifactId,{includeExpired=false}={}) {
|
|
184
|
+
const id=requireSafeArtifactId(artifactId);
|
|
185
|
+
const now=this.#now();
|
|
186
|
+
return [...this.#leases.values()]
|
|
187
|
+
.filter((lease)=>lease.artifactId===id && (includeExpired || !lease.expiresAt || Date.parse(lease.expiresAt)>now))
|
|
188
|
+
.map(clone)
|
|
189
|
+
.sort((a,b)=>a.id.localeCompare(b.id));
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
isLeased(artifactId,{locationId=null}={}) {
|
|
193
|
+
const id=requireSafeArtifactId(artifactId);
|
|
194
|
+
const location=locationId==null?null:requireSafeArtifactId(locationId,'locationId');
|
|
195
|
+
return this.leasesFor(id).some((lease)=>lease.locationId==null || location==null || lease.locationId===location);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
const K=new Uint32Array([
|
|
2
|
+
0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,
|
|
3
|
+
0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,
|
|
4
|
+
0xe49b69c1,0xefbe4786,0x0fc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,
|
|
5
|
+
0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x06ca6351,0x14292967,
|
|
6
|
+
0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,
|
|
7
|
+
0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,
|
|
8
|
+
0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,
|
|
9
|
+
0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2
|
|
10
|
+
]);
|
|
11
|
+
|
|
12
|
+
const INITIAL=new Uint32Array([
|
|
13
|
+
0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,
|
|
14
|
+
0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19
|
|
15
|
+
]);
|
|
16
|
+
const rotr=(x,n)=>(x>>>n)|(x<<(32-n));
|
|
17
|
+
const asBytes=(value)=>{
|
|
18
|
+
if (value instanceof Uint8Array) return value;
|
|
19
|
+
if (value instanceof ArrayBuffer) return new Uint8Array(value);
|
|
20
|
+
if (ArrayBuffer.isView(value)) return new Uint8Array(value.buffer,value.byteOffset,value.byteLength);
|
|
21
|
+
throw new TypeError('SHA-256 update requires Uint8Array or ArrayBuffer data');
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export class IncrementalSha256 {
|
|
25
|
+
constructor() {
|
|
26
|
+
this.state=new Uint32Array(INITIAL);
|
|
27
|
+
this.buffer=new Uint8Array(64);
|
|
28
|
+
this.bufferLength=0;
|
|
29
|
+
this.bytesHashed=0;
|
|
30
|
+
this.finished=false;
|
|
31
|
+
this.words=new Uint32Array(64);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
update(value) {
|
|
35
|
+
if (this.finished) throw new Error('SHA-256 digest is already finalized');
|
|
36
|
+
const bytes=asBytes(value);
|
|
37
|
+
if (!bytes.byteLength) return this;
|
|
38
|
+
if (!Number.isSafeInteger(this.bytesHashed+bytes.byteLength)) throw new Error('SHA-256 input exceeds safe byte count');
|
|
39
|
+
this.bytesHashed+=bytes.byteLength;
|
|
40
|
+
let offset=0;
|
|
41
|
+
if (this.bufferLength) {
|
|
42
|
+
const take=Math.min(64-this.bufferLength,bytes.byteLength);
|
|
43
|
+
this.buffer.set(bytes.subarray(0,take),this.bufferLength);
|
|
44
|
+
this.bufferLength+=take;
|
|
45
|
+
offset+=take;
|
|
46
|
+
if (this.bufferLength===64) {
|
|
47
|
+
this.#process(this.buffer,0);
|
|
48
|
+
this.bufferLength=0;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
while (offset+64<=bytes.byteLength) {
|
|
52
|
+
this.#process(bytes,offset);
|
|
53
|
+
offset+=64;
|
|
54
|
+
}
|
|
55
|
+
if (offset<bytes.byteLength) {
|
|
56
|
+
this.buffer.set(bytes.subarray(offset),0);
|
|
57
|
+
this.bufferLength=bytes.byteLength-offset;
|
|
58
|
+
}
|
|
59
|
+
return this;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
digestBytes() {
|
|
63
|
+
if (!this.finished) this.#finish();
|
|
64
|
+
const out=new Uint8Array(32);
|
|
65
|
+
const view=new DataView(out.buffer);
|
|
66
|
+
for (let i=0;i<8;i++) view.setUint32(i*4,this.state[i],false);
|
|
67
|
+
return out;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
digestHex() {
|
|
71
|
+
return [...this.digestBytes()].map((byte)=>byte.toString(16).padStart(2,'0')).join('');
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
digestArtifactHash() { return `sha256:${this.digestHex()}`; }
|
|
75
|
+
|
|
76
|
+
#finish() {
|
|
77
|
+
const block=new Uint8Array(128);
|
|
78
|
+
block.set(this.buffer.subarray(0,this.bufferLength),0);
|
|
79
|
+
block[this.bufferLength]=0x80;
|
|
80
|
+
const padLength=this.bufferLength<56?64:128;
|
|
81
|
+
const high=Math.floor(this.bytesHashed/0x20000000)>>>0;
|
|
82
|
+
const low=(this.bytesHashed*8)>>>0;
|
|
83
|
+
const view=new DataView(block.buffer);
|
|
84
|
+
view.setUint32(padLength-8,high,false);
|
|
85
|
+
view.setUint32(padLength-4,low,false);
|
|
86
|
+
this.#process(block,0);
|
|
87
|
+
if (padLength===128) this.#process(block,64);
|
|
88
|
+
this.finished=true;
|
|
89
|
+
this.bufferLength=0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
#process(bytes,offset) {
|
|
93
|
+
const w=this.words;
|
|
94
|
+
for (let i=0;i<16;i++) {
|
|
95
|
+
const j=offset+i*4;
|
|
96
|
+
w[i]=((bytes[j]<<24)|(bytes[j+1]<<16)|(bytes[j+2]<<8)|bytes[j+3])>>>0;
|
|
97
|
+
}
|
|
98
|
+
for (let i=16;i<64;i++) {
|
|
99
|
+
const x=w[i-15],y=w[i-2];
|
|
100
|
+
const s0=(rotr(x,7)^rotr(x,18)^(x>>>3))>>>0;
|
|
101
|
+
const s1=(rotr(y,17)^rotr(y,19)^(y>>>10))>>>0;
|
|
102
|
+
w[i]=(w[i-16]+s0+w[i-7]+s1)>>>0;
|
|
103
|
+
}
|
|
104
|
+
let [a,b,c,d,e,f,g,h]=this.state;
|
|
105
|
+
for (let i=0;i<64;i++) {
|
|
106
|
+
const S1=(rotr(e,6)^rotr(e,11)^rotr(e,25))>>>0;
|
|
107
|
+
const ch=((e&f)^((~e)&g))>>>0;
|
|
108
|
+
const t1=(h+S1+ch+K[i]+w[i])>>>0;
|
|
109
|
+
const S0=(rotr(a,2)^rotr(a,13)^rotr(a,22))>>>0;
|
|
110
|
+
const maj=((a&b)^(a&c)^(b&c))>>>0;
|
|
111
|
+
const t2=(S0+maj)>>>0;
|
|
112
|
+
h=g; g=f; f=e; e=(d+t1)>>>0; d=c; c=b; b=a; a=(t1+t2)>>>0;
|
|
113
|
+
}
|
|
114
|
+
this.state[0]=(this.state[0]+a)>>>0;
|
|
115
|
+
this.state[1]=(this.state[1]+b)>>>0;
|
|
116
|
+
this.state[2]=(this.state[2]+c)>>>0;
|
|
117
|
+
this.state[3]=(this.state[3]+d)>>>0;
|
|
118
|
+
this.state[4]=(this.state[4]+e)>>>0;
|
|
119
|
+
this.state[5]=(this.state[5]+f)>>>0;
|
|
120
|
+
this.state[6]=(this.state[6]+g)>>>0;
|
|
121
|
+
this.state[7]=(this.state[7]+h)>>>0;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export function sha256ArtifactHash(chunks) {
|
|
126
|
+
const hash=new IncrementalSha256();
|
|
127
|
+
for (const chunk of chunks) hash.update(chunk);
|
|
128
|
+
return hash.digestArtifactHash();
|
|
129
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { ArtifactContractError, normalizeArtifactHash, requireSafeArtifactId } from './ArtifactDescriptor.js';
|
|
2
|
+
|
|
3
|
+
const COMMIT_TOKEN=Symbol('artifact-byte-store-commit');
|
|
4
|
+
|
|
5
|
+
const cloneEntry=(entry)=>entry?{
|
|
6
|
+
key:entry.key,artifactId:entry.artifactId,hash:entry.hash,mime:entry.mime,bytes:entry.bytes,
|
|
7
|
+
data:new Uint8Array(entry.data)
|
|
8
|
+
}:null;
|
|
9
|
+
|
|
10
|
+
class MemoryArtifactByteWriter {
|
|
11
|
+
#store;
|
|
12
|
+
#artifactId;
|
|
13
|
+
#maxBytes;
|
|
14
|
+
#chunks=[];
|
|
15
|
+
#bytes=0;
|
|
16
|
+
#state='open';
|
|
17
|
+
|
|
18
|
+
constructor(store,{artifactId,maxBytes}) {
|
|
19
|
+
this.#store=store;
|
|
20
|
+
this.#artifactId=requireSafeArtifactId(artifactId);
|
|
21
|
+
this.#maxBytes=maxBytes;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
get state() { return this.#state; }
|
|
25
|
+
get bytesWritten() { return this.#bytes; }
|
|
26
|
+
|
|
27
|
+
async write(chunk) {
|
|
28
|
+
if (this.#state!=='open') throw new ArtifactContractError('ARTIFACT_BYTE_STORE_STATE','Artifact byte writer is not open');
|
|
29
|
+
if (!(chunk instanceof Uint8Array)) throw new ArtifactContractError('ARTIFACT_BYTE_STORE_INVALID','Artifact byte writer requires Uint8Array chunks');
|
|
30
|
+
if (this.#bytes+chunk.byteLength>this.#maxBytes) throw new ArtifactContractError('ARTIFACT_BYTES_LIMIT','Artifact temporary byte store exceeded maxBytes');
|
|
31
|
+
this.#chunks.push(new Uint8Array(chunk));
|
|
32
|
+
this.#bytes+=chunk.byteLength;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async commit({key,hash,mime,bytes}) {
|
|
36
|
+
if (this.#state!=='open') throw new ArtifactContractError('ARTIFACT_BYTE_STORE_STATE','Artifact byte writer is not open');
|
|
37
|
+
const cacheKey=requireSafeArtifactId(key,'cacheKey');
|
|
38
|
+
const canonicalHash=normalizeArtifactHash(hash);
|
|
39
|
+
const expected=Number(bytes);
|
|
40
|
+
if (!Number.isSafeInteger(expected)||expected<0||expected!==this.#bytes) throw new ArtifactContractError('ARTIFACT_BYTE_STORE_INVALID','Artifact byte store commit length mismatch');
|
|
41
|
+
const data=new Uint8Array(this.#bytes);
|
|
42
|
+
let offset=0;
|
|
43
|
+
for (const chunk of this.#chunks) { data.set(chunk,offset); offset+=chunk.byteLength; }
|
|
44
|
+
const result=this.#store._commit(COMMIT_TOKEN,{
|
|
45
|
+
key:cacheKey,artifactId:this.#artifactId,hash:canonicalHash,mime:String(mime||'').toLowerCase(),bytes:expected,data
|
|
46
|
+
});
|
|
47
|
+
this.#chunks=[];
|
|
48
|
+
this.#state='committed';
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async abort() {
|
|
53
|
+
if (this.#state==='open') {
|
|
54
|
+
this.#chunks=[];
|
|
55
|
+
this.#bytes=0;
|
|
56
|
+
this.#state='aborted';
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export class MemoryArtifactByteStore {
|
|
62
|
+
#entries=new Map();
|
|
63
|
+
#hashIndex=new Map();
|
|
64
|
+
|
|
65
|
+
restore(entry={}) {
|
|
66
|
+
const key=requireSafeArtifactId(entry.key,'cacheKey');
|
|
67
|
+
const artifactId=requireSafeArtifactId(entry.artifactId);
|
|
68
|
+
const hash=normalizeArtifactHash(entry.hash);
|
|
69
|
+
const mime=String(entry.mime||'').trim().toLowerCase();
|
|
70
|
+
const bytes=Number(entry.bytes);
|
|
71
|
+
const data=entry.data instanceof Uint8Array ? new Uint8Array(entry.data) : null;
|
|
72
|
+
if (!mime || !Number.isSafeInteger(bytes) || bytes<0 || !data || data.byteLength!==bytes) {
|
|
73
|
+
throw new ArtifactContractError('ARTIFACT_BYTE_STORE_INVALID','Persisted Artifact cache entry is invalid',{key});
|
|
74
|
+
}
|
|
75
|
+
return this._commit(COMMIT_TOKEN,{key,artifactId,hash,mime,bytes,data});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
begin({artifactId,maxBytes}) {
|
|
79
|
+
const limit=Number(maxBytes);
|
|
80
|
+
if (!Number.isSafeInteger(limit)||limit<0) throw new ArtifactContractError('ARTIFACT_BYTES_LIMIT','Artifact byte store maxBytes must be a non-negative safe integer');
|
|
81
|
+
return new MemoryArtifactByteWriter(this,{artifactId,maxBytes:limit});
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
_commit(token,entry) {
|
|
85
|
+
if (token!==COMMIT_TOKEN) throw new ArtifactContractError('ARTIFACT_BYTE_STORE_STATE','Artifact byte store commit is writer-managed only');
|
|
86
|
+
const previous=this.#entries.get(entry.key);
|
|
87
|
+
if (previous) {
|
|
88
|
+
if (previous.hash!==entry.hash || previous.bytes!==entry.bytes || previous.mime!==entry.mime || previous.artifactId!==entry.artifactId) {
|
|
89
|
+
throw new ArtifactContractError('ARTIFACT_CACHE_KEY_CONFLICT','Artifact cache key already contains different content',{key:entry.key});
|
|
90
|
+
}
|
|
91
|
+
return {key:entry.key,hash:entry.hash,mime:entry.mime,bytes:entry.bytes};
|
|
92
|
+
}
|
|
93
|
+
this.#entries.set(entry.key,entry);
|
|
94
|
+
if (!this.#hashIndex.has(entry.hash)) this.#hashIndex.set(entry.hash,new Set());
|
|
95
|
+
this.#hashIndex.get(entry.hash).add(entry.key);
|
|
96
|
+
return {key:entry.key,hash:entry.hash,mime:entry.mime,bytes:entry.bytes};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
get(key) { return cloneEntry(this.#entries.get(key)); }
|
|
100
|
+
|
|
101
|
+
remove(key) {
|
|
102
|
+
const entry=this.#entries.get(key);
|
|
103
|
+
if (!entry) return false;
|
|
104
|
+
this.#entries.delete(key);
|
|
105
|
+
const keys=this.#hashIndex.get(entry.hash);
|
|
106
|
+
keys?.delete(key);
|
|
107
|
+
if (keys && !keys.size) this.#hashIndex.delete(entry.hash);
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
findByHash(hash) {
|
|
112
|
+
const canonical=normalizeArtifactHash(hash);
|
|
113
|
+
return [...(this.#hashIndex.get(canonical)||[])].sort();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
const DB_NAME = 'agentscape-artifacts';
|
|
2
|
+
const DB_VERSION = 1;
|
|
3
|
+
const DESCRIPTOR_STORE = 'descriptors';
|
|
4
|
+
const BYTE_STORE = 'bytes';
|
|
5
|
+
|
|
6
|
+
const clone = (value) => value == null ? value : structuredClone(value);
|
|
7
|
+
|
|
8
|
+
export class IndexedDbArtifactStore {
|
|
9
|
+
constructor({ indexedDBImpl = globalThis.indexedDB } = {}) {
|
|
10
|
+
this.indexedDB = indexedDBImpl;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
async open() {
|
|
14
|
+
if (!this.indexedDB) return null;
|
|
15
|
+
return new Promise((resolve, reject) => {
|
|
16
|
+
const request = this.indexedDB.open(DB_NAME, DB_VERSION);
|
|
17
|
+
request.onupgradeneeded = () => {
|
|
18
|
+
const db = request.result;
|
|
19
|
+
if (!db.objectStoreNames.contains(DESCRIPTOR_STORE)) db.createObjectStore(DESCRIPTOR_STORE);
|
|
20
|
+
if (!db.objectStoreNames.contains(BYTE_STORE)) db.createObjectStore(BYTE_STORE);
|
|
21
|
+
};
|
|
22
|
+
request.onsuccess = () => resolve(request.result);
|
|
23
|
+
request.onerror = () => reject(request.error);
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async load() {
|
|
28
|
+
const db = await this.open();
|
|
29
|
+
if (!db) return { descriptors: [], entries: [] };
|
|
30
|
+
try {
|
|
31
|
+
const tx = db.transaction([DESCRIPTOR_STORE, BYTE_STORE], 'readonly');
|
|
32
|
+
const readAll = (storeName) => new Promise((resolve, reject) => {
|
|
33
|
+
const request = tx.objectStore(storeName).getAll();
|
|
34
|
+
request.onsuccess = () => resolve(request.result || []);
|
|
35
|
+
request.onerror = () => reject(request.error);
|
|
36
|
+
});
|
|
37
|
+
const [descriptors, entries] = await Promise.all([
|
|
38
|
+
readAll(DESCRIPTOR_STORE),
|
|
39
|
+
readAll(BYTE_STORE)
|
|
40
|
+
]);
|
|
41
|
+
return {
|
|
42
|
+
descriptors: descriptors.map(clone),
|
|
43
|
+
entries: entries.map((entry) => ({ ...clone(entry), data: new Uint8Array(entry.data) }))
|
|
44
|
+
};
|
|
45
|
+
} finally {
|
|
46
|
+
db.close();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async putArtifact(descriptor, entry) {
|
|
51
|
+
const db = await this.open();
|
|
52
|
+
if (!db) return false;
|
|
53
|
+
try {
|
|
54
|
+
await new Promise((resolve, reject) => {
|
|
55
|
+
const tx = db.transaction([DESCRIPTOR_STORE, BYTE_STORE], 'readwrite');
|
|
56
|
+
tx.objectStore(DESCRIPTOR_STORE).put(clone(descriptor), descriptor.id);
|
|
57
|
+
tx.objectStore(BYTE_STORE).put({ ...clone(entry), data: new Uint8Array(entry.data) }, entry.key);
|
|
58
|
+
tx.oncomplete = resolve;
|
|
59
|
+
tx.onerror = () => reject(tx.error);
|
|
60
|
+
tx.onabort = () => reject(tx.error);
|
|
61
|
+
});
|
|
62
|
+
return true;
|
|
63
|
+
} finally {
|
|
64
|
+
db.close();
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{"id": "ARTIFACT-001", "type": "test", "title": "descriptor id 拒绝斜杠/空格/控制字符", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactDescriptor.js"], "criteria": ["三类非法 ID 都返回 ARTIFACT_ID_INVALID"]}
|
|
2
|
+
{"id": "ARTIFACT-002", "type": "test", "title": "descriptor hash 只接受 lowercase canonical sha256", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactDescriptor.js"], "criteria": ["uppercase/长度错误 hash 被拒绝"]}
|
|
3
|
+
{"id": "ARTIFACT-003", "type": "test", "title": "descriptor 禁止 signedUrl/token/filePath 字段", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactDescriptor.js"], "criteria": ["深层嵌套 forbidden field 也被拒绝"]}
|
|
4
|
+
{"id": "ARTIFACT-004", "type": "test", "title": "producer operation 必须 provider-scoped + .vN", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactDescriptor.js"], "criteria": ["非稳定 operation 被拒绝"]}
|
|
5
|
+
{"id": "ARTIFACT-005", "type": "test", "title": "lineage 禁止 self-reference", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactDescriptor.js"], "criteria": ["自引用返回 ARTIFACT_LINEAGE_INVALID"]}
|
|
6
|
+
{"id": "ARTIFACT-006", "type": "test", "title": "lineage 禁止重复 parent edge", "status": "DONE", "priority": "P1", "path": "artifact", "depends": ["ARTIFACT-005"], "files": ["modules/artifact/ArtifactDescriptor.js"], "criteria": ["同 artifact+relation 第二次被拒绝"]}
|
|
7
|
+
{"id": "ARTIFACT-007", "type": "test", "title": "available connector location 必须有 safe access handle", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactDescriptor.js"], "criteria": ["缺 access 被拒绝"]}
|
|
8
|
+
{"id": "ARTIFACT-008", "type": "test", "title": "local-cache access key 只能 safe artifact id 字符集", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactDescriptor.js"], "criteria": ["path-like cache key 被拒绝"]}
|
|
9
|
+
{"id": "ARTIFACT-009", "type": "test", "title": "retention expiry 早于 createdAt 被拒绝", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactDescriptor.js"], "criteria": ["返回稳定 contract error"]}
|
|
10
|
+
{"id": "ARTIFACT-010", "type": "test", "title": "untrusted descriptor 不能自报 integrity=verified", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactDescriptor.js"], "criteria": ["返回 ARTIFACT_INTEGRITY_EVIDENCE_REQUIRED"]}
|
|
11
|
+
{"id": "ARTIFACT-011", "type": "test", "title": "Registry 相同 ID+相同 immutable signature 幂等", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactRegistry.js"], "criteria": ["第二次 register 返回同事实不新增索引"]}
|
|
12
|
+
{"id": "ARTIFACT-012", "type": "test", "title": "Registry 相同 ID+不同 hash 冲突", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactRegistry.js"], "criteria": ["ARTIFACT_IDENTITY_CONFLICT"]}
|
|
13
|
+
{"id": "ARTIFACT-013", "type": "test", "title": "hash index 对多个不同 ID 同 hash 可检索", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactRegistry.js"], "criteria": ["findByHash 返回排序稳定的全部 IDs"]}
|
|
14
|
+
{"id": "ARTIFACT-014", "type": "test", "title": "location 更新不能改变 kind/scope/access identity", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactRegistry.js"], "criteria": ["冲突返回 ARTIFACT_LOCATION_IDENTITY_CONFLICT"]}
|
|
15
|
+
{"id": "ARTIFACT-015", "type": "test", "title": "被 lease 的 location 不能删除", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactRegistry.js"], "criteria": ["ARTIFACT_LOCATION_LEASED"]}
|
|
16
|
+
{"id": "ARTIFACT-016", "type": "test", "title": "expired lease 不阻塞 location 删除", "status": "DONE", "priority": "P1", "path": "artifact", "depends": ["ARTIFACT-015"], "files": ["modules/artifact/ArtifactRegistry.js"], "criteria": ["includeExpired=false 后可删除"]}
|
|
17
|
+
{"id": "ARTIFACT-017", "type": "test", "title": "integrity verify 的 bytes/hash/mime 任一不匹配均失败", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactRegistry.js"], "criteria": ["三个独立 case 都是 mismatch"]}
|
|
18
|
+
{"id": "ARTIFACT-018", "type": "test", "title": "integrity reject 后状态保存 rejection code/time", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactRegistry.js"], "criteria": ["get() 返回 rejected evidence"]}
|
|
19
|
+
{"id": "ARTIFACT-019", "type": "test", "title": "Importer Content-Length 大于 maxBytes 在读 stream 前拒绝", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactImporter.js"], "criteria": ["reader 未启动、无 byteStore commit"]}
|
|
20
|
+
{"id": "ARTIFACT-020", "type": "test", "title": "Importer stream 实际 bytes 超 descriptor 时立即 cancel", "status": "DONE", "priority": "P1", "path": "artifact", "depends": ["ARTIFACT-019"], "files": ["modules/artifact/ArtifactImporter.js"], "criteria": ["reader.cancel 被调用且 cache 回滚"]}
|
|
21
|
+
{"id": "ARTIFACT-021", "type": "test", "title": "Importer hash mismatch 后不留下 local-cache location", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactImporter.js"], "criteria": ["Registry/location/byteStore 三者无残留"]}
|
|
22
|
+
{"id": "ARTIFACT-022", "type": "test", "title": "Importer writer commit 后 registry 更新失败时删除 committed cache", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactImporter.js"], "criteria": ["无 orphan cache"]}
|
|
23
|
+
{"id": "ARTIFACT-023", "type": "test", "title": "Importer chunkCount 超上限 fail-closed", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactImporter.js"], "criteria": ["ARTIFACT_STREAM_LIMIT"]}
|
|
24
|
+
{"id": "ARTIFACT-024", "type": "test", "title": "GLB magic/version/declared length 分别验证", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactContentGate.js"], "criteria": ["每种坏 header 有稳定错误"]}
|
|
25
|
+
{"id": "ARTIFACT-025", "type": "test", "title": "PNG/JPEG/WebP signature 分别验证", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactContentGate.js"], "criteria": ["MIME spoof 三个 case 被拒绝"]}
|
|
26
|
+
{"id": "ARTIFACT-026", "type": "test", "title": "PLY/SPZ signature 分别验证", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactContentGate.js"], "criteria": ["错 magic 被拒绝"]}
|
|
27
|
+
{"id": "ARTIFACT-027", "type": "test", "title": "JSON maxDepth 与 maxNodes 各自触发限制", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactContentGate.js"], "criteria": ["两类结构炸弹不进入无界解析路径"]}
|
|
28
|
+
{"id": "ARTIFACT-028", "type": "test", "title": "archive MIME 明确 fail-closed", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactContentGate.js"], "criteria": ["zip/tar/gzip 返回 ARTIFACT_ARCHIVE_UNSUPPORTED"]}
|
|
29
|
+
{"id": "ARTIFACT-031", "type": "test", "title": "persisted verified descriptor 缺 byte entry 时 hydrate fail-closed", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactModule.js"], "criteria": ["ARTIFACT_PERSISTENCE_INTEGRITY_MISMATCH"]}
|
|
30
|
+
{"id": "ARTIFACT-032", "type": "test", "title": "persisted byte hash 被改后 hydrate 拒绝", "status": "DONE", "priority": "P1", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactModule.js"], "criteria": ["contentHash mismatch 被捕获"]}
|
|
31
|
+
{"id": "ARTIFACT-033", "type": "test", "title": "persistArtifact 缺 descriptor 或 entry 返回 false", "status": "DONE", "priority": "P2", "path": "artifact", "depends": [], "files": ["modules/artifact/ArtifactModule.js"], "criteria": ["无异常、无部分写入"]}
|