From f2b7eb45e0c79f09e19a8f5cce1f0e5ca9506b9d Mon Sep 17 00:00:00 2001 From: shaoxiang <519517384@qq.com> Date: Fri, 27 Nov 2026 06:32:38 +0800 Subject: [PATCH 1/3] Document the dev2 download and first-delivery workflow --- README.md | 37 +++++++------- docs/packaging.md | 45 ++++++++--------- ...53\351\200\237\345\274\200\345\247\213.md" | 22 ++++----- examples/first_delivery/README.md | 48 +++++++++++++------ 4 files changed, 80 insertions(+), 72 deletions(-) diff --git a/README.md b/README.md index e61ad55..098d208 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ assets, composing editable USD scenes, running NVIDIA Isaac Sim, and producing videos from real simulation recordings. Agents can inspect images, measured motion, and contacts to check and improve a scene. -**Current public preview:** [v0.2.0-dev.1](https://github.com/ros-claw/simscene/releases/tag/v0.2.0-dev.1) +**Current public preview** [v0.2.0-dev.2](https://github.com/ros-claw/simscene/releases/tag/v0.2.0-dev.2) · [Supported asset sources](#supported-asset-sources) · [Get started](#get-started) · [Connect your agent](#connect-your-agent) @@ -39,8 +39,8 @@ can receive images and results while those files remain on the GPU host. ## Supported asset sources This table is generated from the -[development registry](src/simscene/catalog/data/sources.yaml). The public -preview tag has its own +[packaged registry](src/simscene/catalog/data/sources.yaml). The earlier +`v0.2.0-dev.1` tag has its own [source list](https://github.com/ros-claw/simscene/blob/v0.2.0-dev.1/docs/assets/SOURCES.md). @@ -90,14 +90,13 @@ it does not execute arbitrary code returned by search. ## Get started -### First delivery on the development branch +### First delivery from the download bundle -Build and install the current dev2 portable package using -[the package guide](docs/packaging.md). Then run the -[one-object first delivery](examples/first_delivery/README.md) to search for a -pinned GSO scan, drop it onto an editable worktop, verify the run and export a -four-second native video. See the [integration results](docs/validation/integration-release-matrix.md) -for tested cases and client qualification scope. +Download the [Linux x86_64 / Python 3.10 preview bundle](https://github.com/ros-claw/simscene/releases/tag/v0.2.0-dev.2) and follow the +[one-object first delivery](examples/first_delivery/README.md). The example +fetches one pinned GSO scan, drops it onto an editable worktop, verifies contact +and settling, and exports a four-second native video. See the +[integration results](docs/validation/integration-release-matrix.md) for the tested scope. ### 1. Search metadata in the public preview @@ -105,7 +104,7 @@ Use **Python 3.10+** and pin the public preview. These catalog commands do not start Isaac Sim or require the optional GLB decoder: ```bash -git clone --branch v0.2.0-dev.1 https://github.com/ros-claw/simscene.git +git clone --branch v0.2.0-dev.2 https://github.com/ros-claw/simscene.git cd simscene python3 -m venv .venv . .venv/bin/activate @@ -118,7 +117,7 @@ simscene recipe list The first query may fetch a bounded metadata index. It does not download the model library. For a prebuilt installation, the -[preview release](https://github.com/ros-claw/simscene/releases/tag/v0.2.0-dev.1) +[preview release](https://github.com/ros-claw/simscene/releases/tag/v0.2.0-dev.2) includes a Python wheel and a **Linux x86_64 / Python 3.10** client bundle; see [installation and relocation](docs/packaging.md). @@ -149,7 +148,7 @@ to configure the decoder and probe the runtime before GLB physics. `doctor` checks configuration; `asset probe` starts the preparation runtime and records its capabilities. -The public preview includes the +The earlier preview also includes the [cross-catalog gravity cell](examples/catalog_gravity_cell/README.md). Its reproduction starts with a pinned ABO notebook and an NVIDIA table, then checks fall, contact, and settling before expanding to several notebook @@ -195,7 +194,7 @@ For a client that accepts an `mcpServers` configuration: | Client | Integration | Recorded public-preview evidence | | --- | --- | --- | -| Codex | Portable package, matching skills, optional explicit MCP registration | Two authenticated tasks covering native video/physics and imported GLB preparation/physics. | +| Codex | Portable package, matching skills, optional explicit MCP registration | The dev2 release qualification covers the fixed GSO first delivery. The earlier preview recorded two authenticated tasks covering native video/physics and imported GLB preparation/physics. | | Claude Code | Claude plugin layout and matching skills | Packaged stdio and host skill/MCP loading; no authenticated Claude model task claimed. | | DeepSeek Harness | MCP overlay plus skill-directory configuration | Packaged stdio, overlay loading, and tool listing; no authenticated DeepSeek model task claimed. | | Other MCP clients | Stdio configuration | Compatibility depends on the client; complete tasks need their own validation. | @@ -218,13 +217,11 @@ The two skills divide the work: - [deliver-scene-video](skills/deliver-scene-video/SKILL.md): plan cameras, inspect native footage, and export a traceable film. -Start with a small request: +Start with the installed first-delivery example. -> Reproduce the gravity-cell example with its pinned ABO notebook and documented -> table acquisition route. Prepare the notebook as a rigid body and run the -> fall/contact/settling check. -> Enable native capture, inspect the actual result, and deliver the editable scene, a short native -> video, and the verification result. Download only the selected dependencies. +> Run the first_delivery example with the pinned GSO object and editable +> worktop. Check direct contact and settling, review the native video, and +> deliver the editable scene, checks, and video source map. Then try a composition task: diff --git a/docs/packaging.md b/docs/packaging.md index fa72e8b..284af00 100644 --- a/docs/packaging.md +++ b/docs/packaging.md @@ -1,29 +1,22 @@ # Plugin packages -Python package version `0.2.0.dev2` is an unreleased experimental V2 candidate. The single version -source is `pyproject.toml`; the builder maps its development suffix explicitly to -plugin version `0.2.0-dev.2`. Building or installing files does not publish a -release or establish physical compatibility for arbitrary assets. - -The [V2 preview release](https://github.com/ros-claw/simscene/releases/tag/v0.2.0-dev.1) -provides an unmodified Python wheel, a Linux x86_64/Python 3.10 client bundle, -checksums and artifact provenance. Use a matching Python for the binary bundle; -other supported environments can build from source or install the wheel with -their own platform dependencies. Models and SDKs are acquired separately. - -Release transport removes optional local pip origin records and uses a DeepSeek -relocation template. Runtime modules, matching skills and dependency versions -are unchanged. After extracting the ZIP, generate a local DeepSeek overlay: - -```sh -PYTHONPATH=deepseek/simscene/server/vendor python3 configure_deepseek.py \ - --plugin-root deepseek/simscene --output /your/new/cordis.local.yml -``` - -The extracted release bundle passed the client/package suite after this -documented relocation. Its portable installation completed two actual Codex -tasks: native video with full pixel/physics checks and imported GLB preparation -with a new physical run. See [qualification records](../examples/catalog_benchmark/results/release-qualification.json). +The [v0.2.0-dev.2 preview](https://github.com/ros-claw/simscene/releases/tag/v0.2.0-dev.2) provides +the Python wheel `0.2.0.dev2`, a Linux x86_64/Python 3.10 client bundle, +checksums, and build provenance. The builder maps the Python development +suffix to plugin version `0.2.0-dev.2`. Use a matching Python for the bundle. +Compatible platforms can install the wheel or build their own bundle. +Models and SDKs are acquired separately. + +For an end-to-end install from the download bundle, follow +[the GSO first delivery](../examples/first_delivery/README.md). It uses +a fresh cache and a pinned simulation profile. Read its release qualification +record on the download page. + +The [v0.2.0-dev.1 notes](releases/v0.2.0-dev.1.md) describe the earlier +relocation template and two authenticated Codex tasks. That release's +[qualification record](../examples/catalog_benchmark/results/release-qualification.json) +covers native video and physical checks, and real GLB preparation followed by a +separate physical run. The builder preserves three layouts: portable Agent Plugins, Claude Code, and a DeepSeek Harness overlay. Each includes the wheel's Python code, catalog source @@ -120,7 +113,7 @@ The evaluator forwards these names to both packages. On the tested host, this resolved a case where a direct metadata request worked while the MCP request timed out. Other clients need their corresponding environment-forwarding setup. -The DeepSeek development package includes an overlay generator. Move or +The dev2 DeepSeek package includes an overlay generator. Move or extract the package to its final location, then run these commands with the local Python version that matches the package. @@ -142,7 +135,7 @@ not install a skill or replace a host profile. | Client | Evidence boundary | | --- | --- | -| Portable/Codex | Final release transport: stdio, resources, cached metadata, isolated registration/readback, and two authenticated Codex tasks passed. The tasks independently checked native video/physics and real GLB preparation/physics. No desktop marketplace installation is claimed. | +| Portable/Codex | The dev2 bundle supports packaged stdio, resources and isolated registration. The fixed GSO first delivery has its own Codex release qualification. Two earlier authenticated tasks are recorded in the dev1 qualification. | | Claude Code | Packaged stdio is tested. Existing host evidence covers skill/MCP loading; no authenticated Claude model task is claimed. | | DeepSeek Harness | Packaged stdio is tested with an overlay generated after relocation. Existing host evidence covers overlay loading and ListTools; no authenticated DeepSeek model task is claimed. | diff --git "a/docs/\345\277\253\351\200\237\345\274\200\345\247\213.md" "b/docs/\345\277\253\351\200\237\345\274\200\345\247\213.md" index ea50db5..83d0553 100644 --- "a/docs/\345\277\253\351\200\237\345\274\200\345\247\213.md" +++ "b/docs/\345\277\253\351\200\237\345\274\200\345\247\213.md" @@ -3,25 +3,23 @@ SimScene 为智能体提供在线资产检索、可编辑 USD 场景、Isaac Sim 运行和原生视频交付工具。 可以先查看资源与搜索元数据,再配置仿真主机;不需要预下载完整资产库。 -## 开发分支首次交付 +## 从下载包完成首次交付 -按[插件打包与安装](packaging.md)安装开发包,再运行[单物体首次交付](../examples/first_delivery/README.md)。 -这个例子使用锁定的 GSO 扫描物体和项目自建台面,完成选定资产获取、跌落与稳定检查、 +在 [v0.2.0-dev.2 预览版](https://github.com/ros-claw/simscene/releases/tag/v0.2.0-dev.2)下载 Linux x86_64/Python 3.10 安装包, +按[单物体首次交付](../examples/first_delivery/README.md)校验、解包和安装。 +这个例子使用固定的 GSO 扫描物体与项目自建台面,提供按需获取、跌落和稳定检查、 4 秒原生视频及来源映射。 -## 公开预览版入门 - -下文的公开版命令固定使用 **v0.2.0-dev.1**。该版本的注册范围见 -[公开预览版来源清单](https://github.com/ros-claw/simscene/blob/v0.2.0-dev.1/docs/assets/SOURCES.md)。 -当前开发分支的来源见 [README 资源表](../README.md#supported-asset-sources)。 -来源可检索、模型能准备、物理实验通过是不同结果。 +本页命令固定使用 **v0.2.0-dev.2**。来源和能力范围见 +[注册表生成的资源表](../README.md#supported-asset-sources)。 +来源可检索、模型能准备、物理实验通过各有对应的证据。 ## 1. 安装基础包,先搜索元数据 需要 Python 3.10 或以上版本及网络。下面的目录查询不会启动 Isaac Sim,也不要求先安装 GLB 解码器。 ```bash -git clone --branch v0.2.0-dev.1 https://github.com/ros-claw/simscene.git +git clone --branch v0.2.0-dev.2 https://github.com/ros-claw/simscene.git cd simscene python3 -m venv .venv . .venv/bin/activate @@ -69,7 +67,7 @@ simscene doctor 机器人 IK 的附加依赖可通过 `python -m pip install -e '.[ik]'` 安装;普通元数据搜索不需要它。 预构建客户端包为 Linux x86_64/Python 3.10,对应 wheel 和迁移方法见[插件安装说明](packaging.md)。 -## 3. 复现预览版物理示例 +## 3. 进一步复现跨目录示例 [跨目录重力单元](../examples/catalog_gravity_cell/README.md)包含固定 ABO 笔记本道具的 单物体检查和四实例场景。它保存资产身份、准备参数和物理 case,适合先检查跌落、接触与稳定。 @@ -98,7 +96,7 @@ Isaac 路径、GLB 解码器和缓存配置应在实际启动 MCP 的环境中 安装包和客户端的验证范围见[客户端表](../README.md#connect-your-agent); Claude/DeepSeek 的加载检查不等于真实模型已经完成端到端场景任务。 -在开发分支可用这条提示完成首次交付。 +安装 dev2 后,可用这条提示开始首次交付。 > 运行 `first_delivery` 示例,让锁定的 GSO 扫描物体落到自建台面。检查接触与稳定结果, > 导出原生短视频并审阅动作,交付可编辑场景、验证结果和视频来源映射。 diff --git a/examples/first_delivery/README.md b/examples/first_delivery/README.md index 370e77c..de45001 100644 --- a/examples/first_delivery/README.md +++ b/examples/first_delivery/README.md @@ -1,20 +1,40 @@ # First delivery · one gravity drop -Use an installed development package that includes this example. The fixed input -is one GSO scan of a fondant box. The scene uses editable SimScene boxes for its +The fixed input is one GSO scan of a fondant box. The scene uses editable SimScene boxes for its worktop, stand and floor. The model is fetched on demand with its source notice. The prepared 120 mm size and 0.12 kg mass are experimental parameters. +## Install the download bundle + +On a Linux x86_64 simulation host, use Python 3.10 with pip, the tested +Isaac Sim 6.2.0-rc.14 runtime, Node.js 22.23.2 with npm, and FFmpeg with libx264 +and zscale. The documented host Python uses `usd-core==26.5`. Isaac runs in its +own Python environment with its bundled OpenUSD. + +Download `simscene-0.2.0-dev.2-py310-linux-x86_64.zip` and `SHA256SUMS.txt` +from [the dev2 preview](https://github.com/ros-claw/simscene/releases/tag/v0.2.0-dev.2). +In a new working directory containing the downloads, run these commands. + +~~~sh +sha256sum --ignore-missing -c SHA256SUMS.txt +export DIST="$PWD/simscene-dev2" +unzip -q simscene-0.2.0-dev.2-py310-linux-x86_64.zip -d "$DIST" + +python3.10 -m venv --without-pip .venv +python3.10 -m pip --python .venv/bin/python install usd-core==26.5 +. .venv/bin/activate + +export PLUGIN="$PWD/installed/simscene" +export WHEEL="$DIST/wheels/rosclaw_simscene-0.2.0.dev2-py3-none-any.whl" +python "$DIST/portable/simscene/install.py" --destination "$PLUGIN" --project "$PWD" +~~~ + ## Run on the simulation host -Use a Python with USD bindings, the tested Isaac Sim 6.2.0-rc.14 runtime, -Node.js 22.23.2 with npm, and FFmpeg with libx264 and zscale. Supply paths to an -installed portable plugin and the matching wheel. Use a directory you own for -this example's state and cache. +Choose the actual Isaac launcher path. Use a new work directory for the example +so any earlier model and prepared caches stay outside the run. ~~~sh -export PLUGIN=/absolute/path/to/installed/simscene -export WHEEL=/absolute/path/to/rosclaw_simscene-0.2.0.dev2-py3-none-any.whl export SIMSCENE_ISAAC_PYTHON=/absolute/path/to/isaac-sim/python.sh export WORK="$PWD/first-delivery-local" export SIMSCENE_HOME="$WORK/state" @@ -24,9 +44,9 @@ export SIMSCENE_GLTF_TRANSFORM_PREFIX="$WORK/decoder" export PYTHONPATH="$PLUGIN/server/vendor" mkdir "$WORK" -python3 -m simscene.cli asset setup-decoder --output "$SIMSCENE_GLTF_TRANSFORM_PREFIX" -python3 -m simscene.cli asset probe -python3 "$PLUGIN/experiments/run_first_delivery.py" --wheel "$WHEEL" --output "$WORK/output" +python -m simscene.cli asset setup-decoder --output "$SIMSCENE_GLTF_TRANSFORM_PREFIX" +python -m simscene.cli asset probe +python "$PLUGIN/experiments/run_first_delivery.py" --wheel "$WHEEL" --output "$WORK/output" ~~~ Setup and probing are reusable within this environment. Repeat the last command @@ -54,7 +74,7 @@ are visible. Save a JSON review with `reviewer`, `decision` (`accept` or entry after reviewing the whole clip. ~~~sh -python3 "$PLUGIN/experiments/run_first_delivery.py" --output "$WORK/output" --review "$WORK/review.json" +python "$PLUGIN/experiments/run_first_delivery.py" --output "$WORK/output" --review "$WORK/review.json" ~~~ The reviewed receipt binds the declaration to the checked movie and can reach @@ -63,8 +83,8 @@ that requested the work. This example verifies a fixed asset and configuration. ## Qualified host-assisted Codex route -From the source checkout, a host with a configured Codex CLI login can use -the first-delivery qualification driver. Use a fresh attempt directory and +From the matching source checkout, a host with a configured Codex CLI login can +use the first-delivery qualification driver. Use a fresh attempt directory and the same runtime setup as above. ~~~sh From 1a1bf7adcb4a98182bb2817e4bd42d2854f0e21d Mon Sep 17 00:00:00 2001 From: shaoxiang <519517384@qq.com> Date: Fri, 27 Nov 2026 06:38:54 +0800 Subject: [PATCH 2/3] Load bundled dependencies in detached preparation workers --- examples/first_delivery/README.md | 15 +++++----- src/simscene/preparation/jobs.py | 13 ++++++--- tests/agent/test_package.py | 48 ++++++++++++++++++++++++++++++- 3 files changed, 64 insertions(+), 12 deletions(-) diff --git a/examples/first_delivery/README.md b/examples/first_delivery/README.md index de45001..824f65e 100644 --- a/examples/first_delivery/README.md +++ b/examples/first_delivery/README.md @@ -1,14 +1,14 @@ # First delivery · one gravity drop -The fixed input is one GSO scan of a fondant box. The scene uses editable SimScene boxes for its -worktop, stand and floor. The model is fetched on demand with its source notice. +The fixed input is one GSO scan of a fondant box. The scene uses editable +SimScene boxes for its worktop, stand and floor. The model is fetched on demand with its source notice. The prepared 120 mm size and 0.12 kg mass are experimental parameters. ## Install the download bundle -On a Linux x86_64 simulation host, use Python 3.10 with pip, the tested -Isaac Sim 6.2.0-rc.14 runtime, Node.js 22.23.2 with npm, and FFmpeg with libx264 -and zscale. The documented host Python uses `usd-core==26.5`. Isaac runs in its +On a Linux x86_64 simulation host, use Python 3.10 with a pip that supports +`--python`, the tested Isaac Sim 6.2.0-rc.14 runtime, Node.js 22.23.2 with npm, +and FFmpeg with libx264 and zscale. The documented host Python uses `usd-core==26.5`. Isaac runs in its own Python environment with its bundled OpenUSD. Download `simscene-0.2.0-dev.2-py310-linux-x86_64.zip` and `SHA256SUMS.txt` @@ -16,9 +16,10 @@ from [the dev2 preview](https://github.com/ros-claw/simscene/releases/tag/v0.2.0 In a new working directory containing the downloads, run these commands. ~~~sh -sha256sum --ignore-missing -c SHA256SUMS.txt export DIST="$PWD/simscene-dev2" -unzip -q simscene-0.2.0-dev.2-py310-linux-x86_64.zip -d "$DIST" +ARCHIVE=simscene-0.2.0-dev.2-py310-linux-x86_64.zip +awk -v file="$ARCHIVE" '$2 == file' SHA256SUMS.txt | sha256sum --check - && + unzip -q "$ARCHIVE" -d "$DIST" python3.10 -m venv --without-pip .venv python3.10 -m pip --python .venv/bin/python install usd-core==26.5 diff --git a/src/simscene/preparation/jobs.py b/src/simscene/preparation/jobs.py index fcc8547..d05ce4e 100644 --- a/src/simscene/preparation/jobs.py +++ b/src/simscene/preparation/jobs.py @@ -78,17 +78,22 @@ def launch(identifier, digest): job_id = 'prep-'+uuid.uuid4().hex; root = directory(job_id, config=config) root.mkdir(parents=True) write(root/'plan.json', plan); write(root/'config.json', config) - package = root/'runtime'/'simscene' - shutil.copytree(Path(__file__).parents[1], package, ignore=shutil.ignore_patterns('__pycache__', '*.pyc')) + runtime = root/'runtime' + source_package = Path(__file__).resolve().parents[1] + shutil.copytree(source_package, runtime/'simscene', ignore=shutil.ignore_patterns('__pycache__', '*.pyc')) record = {'schema_version':1, 'job_id':job_id, 'type':'asset_preparation', 'plan_id':plan_id, 'state':'queued', 'request_id':identifier, 'request_payload_sha256':digest, 'created_unix_ns':time.time_ns(), 'checkpoints':[]} # A durable reservation precedes launch. Crash here is uncertain, never a retry. write(root/'job.json', record) - env = dict(os.environ, PYTHONPATH=str(root/'runtime'), PYTHONUNBUFFERED='1') + # Import SimScene from the frozen runtime first. Bundled third-party + # modules live beside the original package and may be absent from site-packages. + imports = os.pathsep.join((str(runtime), str(source_package.parent))) + env = dict(os.environ, PYTHONPATH=imports, PYTHONUNBUFFERED='1') with (root/'worker.log').open('ab') as log: process = subprocess.Popen([sys.executable, '-m', 'simscene.preparation.worker', str(root)], - env=env, stdout=log, stderr=subprocess.STDOUT, start_new_session=True) + cwd=root, env=env, stdout=log, stderr=subprocess.STDOUT, + start_new_session=True) write(root/'launch.json', {'pid':process.pid, 'identity':_identity(process.pid)}) return _receipt(record) return invoke(config['home'], request_id, payload, launch, diff --git a/tests/agent/test_package.py b/tests/agent/test_package.py index 2bdf137..28c351e 100644 --- a/tests/agent/test_package.py +++ b/tests/agent/test_package.py @@ -59,11 +59,45 @@ async def check_independent_metadata(root,plugin): try:predecoder_fingerprint(str(root/'missing-decoder')) except PreparationError as error:assert error.code=='dependency_missing' else:raise AssertionError('missing optional decoder was reported available') + +# Exercise the production detached worker without network or Isaac. The plan +# has a valid digest but intentionally points at a different repository. +from simscene.acquisition.plans import payload_hash +from simscene.catalog.config import read +from simscene.preparation.environment import installation_fingerprint +from simscene.preparation.glb_convert import CONVERTER + +launcher = Path(sys.argv[3]) +launcher.parent.mkdir() +launcher.write_text("#!/bin/sh\nexit 99\n") +(launcher.parent/'VERSION').write_text('fixture SDK') +config = read() +target = {'engine': 'physx', 'isaac_version': 'fixture SDK', 'usd_version': '0.25.11', + 'platform': 'linux-x86_64'} +installation = installation_fingerprint() +Path(config['runtime_manifest']).write_text(json.dumps({ + 'schema_version': 1, 'target': target, 'converter': CONVERTER, + 'installation': installation, +})) +plan = { + 'schema_version': 1, 'ready_to_fetch': True, 'asset_ref': ref.to_dict(), + 'target': target, 'toolchain_requirements': installation, + 'converter_selection': CONVERTER, + 'budget_breakdown': {'download_bytes': 1024, 'unpacked_bytes': 1024, 'staging_bytes': 1024}, + 'acquisition': {'kind': 'hf_glb', 'repository': 'fixture/unregistered'}, +} +plan_id = payload_hash(plan) +path = Path(config['home'])/'asset-plans'/f'{plan_id}.json' +path.parent.mkdir(parents=True) +path.write_text(json.dumps(dict(plan, plan_id=plan_id, plan_payload_sha256=plan_id))) +(root/'fixture-plan-id').write_text(plan_id) """ env={key:value for key,value in os.environ.items() if not key.startswith(('SIMSCENE_','USD_SEARCH_'))} env.update(PYTHONPATH='',PYTHONNOUSERSITE='1',HOME=str(root/'home'),XDG_CONFIG_HOME=str(root/'config'), SIMSCENE_HOME=str(root/'state'),SIMSCENE_CACHE=str(root/'cache'),SIMSCENE_V2_CONFIG=str(root/'v2.json')) - subprocess.run([str(python),'-I','-c',bootstrap,str(vendor),str(root)],cwd=root,env=env,check=True) + launcher = root/'fixture-sdk'/'python.sh' + env['SIMSCENE_ISAAC_PYTHON'] = str(launcher) + subprocess.run([str(python),'-I','-c',bootstrap,str(vendor),str(root),str(launcher)],cwd=root,env=env,check=True) server=StdioServerParameters(command=str(python),args=['-I',str(plugin/'server/launch.py')],env=env,cwd=str(root)) async with stdio_client(server) as (reader,writer): async with ClientSession(reader,writer) as session: @@ -85,6 +119,18 @@ async def check_independent_metadata(root,plugin): page=json.loads(response.content[0].text);self.assertEqual(len(page['items']),1) unavailable=await session.call_tool('asset_generate',{'recipe_id':'guide_plate_v1','parameters':{}}) self.assertTrue(unavailable.isError);self.assertIn('generation_runtime_unavailable',str(unavailable)) + + response = await session.call_tool('asset_prepare', {'plan_id': (root/'fixture-plan-id').read_text()}) + self.assertFalse(response.isError, str(response)) + job = json.loads(response.content[0].text) + waited = await session.call_tool('job_status', { + 'job_id': job['job_id'], 'wait_seconds': 5, 'receipt_path': str(root/'prep-wait.json'), + }) + self.assertFalse(waited.isError, str(waited)) + status = await session.call_tool('job_status', {'job_id': job['job_id']}) + failure = json.loads(status.content[0].text) + self.assertEqual(failure['state'], 'failed', failure) + self.assertIn('GLB selection requires its audited source repository', failure['error']) with tempfile.TemporaryDirectory() as directory: root=Path(directory) supplied=os.environ.get('SIMSCENE_TEST_PACKAGE_OUTPUT') From e5de299f7ebd17d0e3edb4761186fce6cba9ac81 Mon Sep 17 00:00:00 2001 From: shaoxiang <519517384@qq.com> Date: Fri, 27 Nov 2026 06:44:57 +0800 Subject: [PATCH 3/3] Preserve relative SDK paths in the packaged preparation worker --- src/simscene/preparation/jobs.py | 16 ++++++++++++---- tests/agent/test_package.py | 5 ++++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/simscene/preparation/jobs.py b/src/simscene/preparation/jobs.py index d05ce4e..35a4305 100644 --- a/src/simscene/preparation/jobs.py +++ b/src/simscene/preparation/jobs.py @@ -81,18 +81,26 @@ def launch(identifier, digest): runtime = root/'runtime' source_package = Path(__file__).resolve().parents[1] shutil.copytree(source_package, runtime/'simscene', ignore=shutil.ignore_patterns('__pycache__', '*.pyc')) + # The launcher lives with the frozen SimScene snapshot so the project + # directory cannot shadow it. Keep the caller's cwd for relative settings. + launcher = runtime/'launch-preparation.py' + launcher.write_text( + "import sys\n" + "from simscene.preparation.worker import execute\n" + "execute(sys.argv[1])\n", + encoding='utf8', + ) record = {'schema_version':1, 'job_id':job_id, 'type':'asset_preparation', 'plan_id':plan_id, 'state':'queued', 'request_id':identifier, 'request_payload_sha256':digest, 'created_unix_ns':time.time_ns(), 'checkpoints':[]} # A durable reservation precedes launch. Crash here is uncertain, never a retry. write(root/'job.json', record) - # Import SimScene from the frozen runtime first. Bundled third-party - # modules live beside the original package and may be absent from site-packages. + # The bundled third-party modules live beside the original package. imports = os.pathsep.join((str(runtime), str(source_package.parent))) env = dict(os.environ, PYTHONPATH=imports, PYTHONUNBUFFERED='1') with (root/'worker.log').open('ab') as log: - process = subprocess.Popen([sys.executable, '-m', 'simscene.preparation.worker', str(root)], - cwd=root, env=env, stdout=log, stderr=subprocess.STDOUT, + process = subprocess.Popen([sys.executable, str(launcher), str(root)], + env=env, stdout=log, stderr=subprocess.STDOUT, start_new_session=True) write(root/'launch.json', {'pid':process.pid, 'identity':_identity(process.pid)}) return _receipt(record) diff --git a/tests/agent/test_package.py b/tests/agent/test_package.py index 28c351e..57aca23 100644 --- a/tests/agent/test_package.py +++ b/tests/agent/test_package.py @@ -96,7 +96,10 @@ async def check_independent_metadata(root,plugin): env.update(PYTHONPATH='',PYTHONNOUSERSITE='1',HOME=str(root/'home'),XDG_CONFIG_HOME=str(root/'config'), SIMSCENE_HOME=str(root/'state'),SIMSCENE_CACHE=str(root/'cache'),SIMSCENE_V2_CONFIG=str(root/'v2.json')) launcher = root/'fixture-sdk'/'python.sh' - env['SIMSCENE_ISAAC_PYTHON'] = str(launcher) + env['SIMSCENE_ISAAC_PYTHON'] = str(launcher.relative_to(root)) + shadow = root/'simscene' + shadow.mkdir() + (shadow/'__init__.py').write_text('raise AssertionError("project must not shadow task code")') subprocess.run([str(python),'-I','-c',bootstrap,str(vendor),str(root),str(launcher)],cwd=root,env=env,check=True) server=StdioServerParameters(command=str(python),args=['-I',str(plugin/'server/launch.py')],env=env,cwd=str(root)) async with stdio_client(server) as (reader,writer):