diff --git a/.trellis/spec/pipeline/native-road-package.md b/.trellis/spec/pipeline/native-road-package.md index c941d56..b49c28e 100644 --- a/.trellis/spec/pipeline/native-road-package.md +++ b/.trellis/spec/pipeline/native-road-package.md @@ -1,16 +1,16 @@ -# Native Road Compiler Contract +# Native Road Package Contract The native-road package is maintained in the private `road-compiler` repository: `https://git.app.que01.top/que01/road-compiler` -This host consumes the exact git tag recorded in `package.json` and lockfile. The host owns area configuration normalization and writes `RoadCompilerInput`; the compiler owns the `native-road-package/v1` file contract and CLI. Production code must invoke the installed compiler CLI through `scripts/lib/road-compiler-cli.js`, not import compiler source files or read `packages/road-compiler`. +The host consumes a read-only ZIP exported by the private `road-compiler` repository. The host never installs or invokes the compiler. `nativeRoadPackage` is resolved relative to the area config, hashed, validated, and extracted into `_pipeline/native-road-import//` before native consumers start. The completion marker is `NATIVE_ROAD_COMPILE_DONE `. `build-area.js` validates the marker's count, JSON payload, area id, output path, process status, and signal before starting Blender. ## Scope / Trigger -This contract applies to native-road compilation from `scripts/build-area.js`, `scripts/compile-native-roads.js`, and the road workbench fresh-compile callback. +This contract applies to native-road consumption from `scripts/build-area.js`, diagnostics, parity, Blender, and native preview generation. ## Signatures diff --git a/.trellis/tasks/08-26-rc-p5b-zip-import/task.json b/.trellis/tasks/08-26-rc-p5b-zip-import/task.json new file mode 100644 index 0000000..9d1c546 --- /dev/null +++ b/.trellis/tasks/08-26-rc-p5b-zip-import/task.json @@ -0,0 +1,26 @@ +{ + "id": "rc-p5b-zip-import", + "name": "rc-p5b-zip-import", + "title": "ZIP 道路包安全导入与纯消费", + "description": "让 osmWorkflow 配置、校验、解压并消费 road-compiler Web 导出的 ZIP 道路包,移除 compiler runtime 耦合。", + "status": "completed", + "dev_type": null, + "scope": null, + "package": null, + "priority": "P2", + "creator": "dingkang", + "assignee": "dingkang", + "createdAt": "2026-08-26", + "completedAt": null, + "branch": null, + "base_branch": "experiment/road-compiler-rethink", + "worktree_path": null, + "commit": null, + "pr_url": null, + "subtasks": [], + "children": [], + "parent": "08-26-rc-p5-artifact-consumption", + "relatedFiles": [], + "notes": "", + "meta": {} +} diff --git a/scripts/lib/area-diagnostics.js b/scripts/lib/area-diagnostics.js index b0ddbde..0140139 100644 --- a/scripts/lib/area-diagnostics.js +++ b/scripts/lib/area-diagnostics.js @@ -486,13 +486,11 @@ function stageManifestStatus(area, configPath = null) { network: path.join(area.outputs.geojsonDir, "network.json"), intersectionSurface: path.join(area.outputs.geojsonDir, "intersection_surface.geojson"), }), - ...(native ? { trafficSimulation: area.outputs.trafficSimulation } : {}), previewCss: path.join(path.resolve(__dirname, ".."), "lib", "cesium-preview.css"), previewJs: path.join(path.resolve(__dirname, ".."), "lib", "cesium-preview.js"), }, outputs: compressionComplete ? { vehicleRoute: native ? optionalExpectedFile(area.outputs.vehicleRoute) : area.outputs.vehicleRoute, - ...(native ? { trafficSimulation: area.outputs.trafficSimulation } : {}), vehicleModel: area.outputs.vehicleModel, } : { cesiumPreview: area.outputs.cesiumPreview, diff --git a/scripts/road-parity.js b/scripts/road-parity.js index ecd1c38..e502c8e 100644 --- a/scripts/road-parity.js +++ b/scripts/road-parity.js @@ -5,6 +5,7 @@ const crypto = require("crypto"); const fs = require("fs"); const path = require("path"); const { readAreaConfig } = require("./lib/area-config"); +const { importNativeRoadPackage } = require("./lib/native-road-package"); const repoRoot = path.resolve(__dirname, ".."); @@ -77,10 +78,11 @@ function filesBelow(directory) { function snapshot(configPath) { const area = readAreaConfig(configPath, { repoRoot }); - if (!fs.existsSync(area.outputs.nativeRoadDir)) throw new Error(`Native road output not found: ${area.outputs.nativeRoadDir}`); + const nativePackage = importNativeRoadPackage(area); + const nativeRoadDir = nativePackage.rootDir; const files = {}; - for (const file of filesBelow(area.outputs.nativeRoadDir).sort()) { - const relative = path.relative(area.outputs.nativeRoadDir, file).split(path.sep).join("/"); + for (const file of filesBelow(nativeRoadDir).sort()) { + const relative = path.relative(nativeRoadDir, file).split(path.sep).join("/"); const text = fs.readFileSync(file, "utf8"); files[relative] = jsonRecord(text, Buffer.byteLength(text)); }