feat(web): reuse verified source dependencies
This commit is contained in:
@@ -93,6 +93,28 @@ PREFERRED_BATCHES = [
|
||||
"production": "tests/golden/{task}/modifier-reader-batch-production.json",
|
||||
"types": ["MESH_TO_VOLUME", "PARTICLE_INSTANCE", "SURFACE", "VERTEX_WEIGHT_EDIT", "VERTEX_WEIGHT_MIX", "VERTEX_WEIGHT_PROXIMITY"],
|
||||
},
|
||||
{
|
||||
"moduleId": "MODIFIER_SOURCE_DEPENDENCY_REUSE",
|
||||
"title": "reuse verified modifier receipts for shared source utilities",
|
||||
"owner": "MODIFIER",
|
||||
"identifiers": ["MOD_grease_pencil_util", "MOD_meshcache_mdd", "MOD_meshcache_pc2", "MOD_meshcache_util", "MOD_weightvg_util"],
|
||||
"rna": [],
|
||||
"test": "tools/web/reuse-wbv2-source-dependencies.mjs",
|
||||
"production": "tests/golden/{task}/source-dependency-reuse-production.json",
|
||||
"types": [],
|
||||
"reuseReceipts": [
|
||||
{"manifest": "tests/golden/WBV2-P1150-001/manifest.json", "report": "tests/golden/WBV2-P1150-001/module-receipt.json"},
|
||||
{"manifest": "tests/golden/WBV2-P1151-001/manifest.json", "report": "tests/golden/WBV2-P1151-001/module-receipt.json"},
|
||||
{"manifest": "tests/golden/WBV2-P1152-001/manifest.json", "report": "tests/golden/WBV2-P1152-001/module-receipt.json"},
|
||||
],
|
||||
"dependencyReuse": [
|
||||
{"unitId": "modifier-source:MOD_grease_pencil_util", "representativeUnitId": "modifier-source:MOD_grease_pencil_array", "proofSource": "blender-5.2.0/source/blender/modifiers/intern/MOD_grease_pencil_array.cc", "marker": "MOD_grease_pencil_util.hh", "productionEvidence": "tests/golden/WBV2-P1151-001/modifier-reader-batch-production.json"},
|
||||
{"unitId": "modifier-source:MOD_meshcache_mdd", "representativeUnitId": "modifier-source:MOD_meshcache", "proofSource": "blender-5.2.0/source/blender/modifiers/intern/MOD_meshcache.cc", "marker": "MOD_meshcache_read_mdd_times", "productionEvidence": "tests/golden/WBV2-P1150-001/modifier-reader-batch-production.json"},
|
||||
{"unitId": "modifier-source:MOD_meshcache_pc2", "representativeUnitId": "modifier-source:MOD_meshcache", "proofSource": "blender-5.2.0/source/blender/modifiers/intern/MOD_meshcache.cc", "marker": "MOD_meshcache_read_pc2_times", "productionEvidence": "tests/golden/WBV2-P1150-001/modifier-reader-batch-production.json"},
|
||||
{"unitId": "modifier-source:MOD_meshcache_util", "representativeUnitId": "modifier-source:MOD_meshcache", "proofSource": "blender-5.2.0/source/blender/modifiers/intern/MOD_meshcache.cc", "marker": "MOD_meshcache_util.hh", "productionEvidence": "tests/golden/WBV2-P1150-001/modifier-reader-batch-production.json"},
|
||||
{"unitId": "modifier-source:MOD_weightvg_util", "representativeUnitId": "modifier-source:MOD_weightvgedit", "proofSource": "blender-5.2.0/source/blender/modifiers/intern/MOD_weightvgedit.cc", "marker": "MOD_weightvg_util.hh", "productionEvidence": "tests/golden/WBV2-P1152-001/modifier-reader-batch-production.json"},
|
||||
],
|
||||
},
|
||||
{
|
||||
"moduleId": "GREASE_PENCIL_MODIFIER_READER_BATCH",
|
||||
"title": "verify Grease Pencil modifier reader batch",
|
||||
@@ -191,8 +213,10 @@ def snapshot(text: str, task: str, parent: str, next_task: str) -> str:
|
||||
|
||||
|
||||
def make_card(task: str, parent: str, status: str, batch: dict, entrypoint: str) -> str:
|
||||
fixture_paths = batch.get("fixtures") or [batch["fixture"]]
|
||||
fixture_paths = batch.get("fixtures") or ([batch["fixture"]] if batch.get("fixture") else [])
|
||||
fixture_text = ", ".join(f"`{fixture}`" for fixture in fixture_paths)
|
||||
if not fixture_text:
|
||||
fixture_text = "existing Chromium receipts"
|
||||
if task.endswith("-000"):
|
||||
return f"""# {task}: authorize module batch
|
||||
|
||||
@@ -269,7 +293,7 @@ def make_card(task: str, parent: str, status: str, batch: dict, entrypoint: str)
|
||||
"""
|
||||
names = ", ".join(batch["identifiers"])
|
||||
units = ", ".join(f"`modifier-source:{name}`" for name in batch["identifiers"])
|
||||
rna_units = ", ".join(f"`rna-struct:{name}`" for name in batch["rna"])
|
||||
rna_units = ", ".join(f"`rna-struct:{name}`" for name in batch["rna"]) or "none (source-only dependency batch)"
|
||||
return f"""# {task}: {batch['title']}
|
||||
|
||||
- task: {task}
|
||||
@@ -361,19 +385,32 @@ def main() -> int:
|
||||
write_json(current_manifest_path, current_manifest)
|
||||
|
||||
source_paths = [unit["locations"][0]["path"] for unit in batch["units"]]
|
||||
fixture_paths = batch.get("fixtures") or [batch["fixture"]]
|
||||
source_paths += ["blender-5.2.0/source/blender/web_engine/web_engine_blend_reader.cpp", batch["test"], *fixture_paths, "web/app/src/vendor/blender/web_engine.wasm"]
|
||||
fixture_paths = batch.get("fixtures") or ([batch["fixture"]] if batch.get("fixture") else [])
|
||||
if batch.get("dependencyReuse"):
|
||||
source_paths += [dependency["proofSource"] for dependency in batch["dependencyReuse"]]
|
||||
source_paths += [dependency["productionEvidence"] for dependency in batch["dependencyReuse"]]
|
||||
source_paths += [batch["test"]]
|
||||
else:
|
||||
source_paths += ["blender-5.2.0/source/blender/web_engine/web_engine_blend_reader.cpp", batch["test"], *fixture_paths, "web/app/src/vendor/blender/web_engine.wasm"]
|
||||
batch_types = json.dumps(batch["types"], separators=(',', ':'))
|
||||
batch_units = json.dumps([unit["id"] for unit in batch["units"]], separators=(',', ':'))
|
||||
fixture_env = f"WBV2_BATCH_FIXTURES='{json.dumps(fixture_paths, separators=(',', ':'))}'" if batch.get("fixtures") else f"WBV2_BATCH_FIXTURE={batch['fixture']}"
|
||||
commands = [
|
||||
"source tools/web/emscripten-env.sh && cmake --build build_web_blender6 --target web_engine -- -j8 && cp build_web_blender6/bin/web_engine.wasm web/app/src/vendor/blender/web_engine.wasm && cp build_web_blender6/bin/web_engine.wasm web/app/public/vendor/blender/web_engine.wasm",
|
||||
"npm --prefix web run typecheck",
|
||||
"npm --prefix web run build",
|
||||
f"WBV2_BATCH_TASK={module_task} {fixture_env} WBV2_BATCH_TYPES='{batch_types}' WBV2_BATCH_UNITS='{batch_units}' WEB_TEST_PORT=5371 npm --prefix web run test:e2e -- --workers=1 tests/e2e/{Path(batch['test']).name}",
|
||||
]
|
||||
if batch.get("dependencyReuse"):
|
||||
fixture_env = ""
|
||||
elif batch.get("fixtures"):
|
||||
fixture_env = f"WBV2_BATCH_FIXTURES='{json.dumps(fixture_paths, separators=(',', ':'))}'"
|
||||
else:
|
||||
fixture_env = f"WBV2_BATCH_FIXTURE={batch['fixture']}"
|
||||
if batch.get("dependencyReuse"):
|
||||
commands = [f"node tools/web/reuse-wbv2-source-dependencies.mjs --task {module_task} --write"]
|
||||
else:
|
||||
commands = [
|
||||
"source tools/web/emscripten-env.sh && cmake --build build_web_blender6 --target web_engine -- -j8 && cp build_web_blender6/bin/web_engine.wasm web/app/src/vendor/blender/web_engine.wasm && cp build_web_blender6/bin/web_engine.wasm web/app/public/vendor/blender/web_engine.wasm",
|
||||
"npm --prefix web run typecheck",
|
||||
"npm --prefix web run build",
|
||||
f"WBV2_BATCH_TASK={module_task} {fixture_env} WBV2_BATCH_TYPES='{batch_types}' WBV2_BATCH_UNITS='{batch_units}' WEB_TEST_PORT=5371 npm --prefix web run test:e2e -- --workers=1 tests/e2e/{Path(batch['test']).name}",
|
||||
]
|
||||
root_record = {"id": root_task, "phase": str(phase), "title": "authorize_modifier_reader_batch", "kind": "enabling", "owner": "PROGRAM", "dependsOn": [current], "parityId": None, "implementationClass": "QUEUE_ONLY", "parallelGroup": f"module-root-{phase}", "gate": "MODULE", "card": f"docs/tasks/{root_task}.md", "behavior": "Authorize one shared source-backed modifier reader batch.", "outputs": ["successor authorization", "module plan", "manifest", "status"], "acceptance": ["prior evidence remains hash-bound", "batch source mapping is explicit", "inventory remains source-derived"], "commands": ["node tools/web/check-execution-control-plane.mjs"], "status": "done", "ready": False, "queueMutationAllowed": True}
|
||||
module_record = {"id": module_task, "phase": str(phase), "title": batch["title"], "kind": "module", "owner": batch["owner"], "dependsOn": [root_task], "parityId": batch["moduleId"], "implementationClass": "LOCAL_EXACT", "parallelGroup": f"module-{batch['moduleId'].lower()}", "gate": "MODULE", "card": f"docs/tasks/{module_task}.md", "behavior": f"Verify the {batch['moduleId']} batch through Blender Main, WASM and Chromium recovery.", "outputs": ["aggregate module receipt", "coverage bindings", "manifest", "status"], "acceptance": ["source and protocol hashes are bound", "every selected Main reader type is proven", "negative no-mutation and recovery are proven", "Chromium and save/reopen evidence are exact"], "status": "in_progress", "ready": True, "queueMutationAllowed": True, "module": {"moduleId": batch["moduleId"], "sourceBacked": True, "capabilities": [f"CAP-{batch['moduleId']}-READER", f"CAP-{batch['moduleId']}-RECOVERY", f"CAP-{batch['moduleId']}-FAIL-CLOSED"], "sourcePaths": source_paths, "reuseReceipts": [{"manifest": "tests/golden/WBV2-P1107-000/manifest.json", "report": "tests/golden/WBV2-P1107-000/module-receipt.json"}], "positive": [f"{name} type is read from Blender Main" for name in batch["identifiers"]] + ["shared RNA metadata is preserved", "save/reopen preserves the batch metadata"], "negative": ["malformed blend is rejected without Main mutation", "unsupported batch data fails closed", "non-finite metadata is not synthesized"], "recovery": ["save/reopen", "worker termination", "deterministic second read"], "commands": commands, "fullFamilyParity": False, "evidencePaths": [batch["production"].format(task=module_task)], "coverageBindings": [unit["id"] for unit in batch["units"]]}}
|
||||
module_record = {"id": module_task, "phase": str(phase), "title": batch["title"], "kind": "module", "owner": batch["owner"], "dependsOn": [root_task], "parityId": batch["moduleId"], "implementationClass": "LOCAL_EXACT", "parallelGroup": f"module-{batch['moduleId'].lower()}", "gate": "MODULE", "card": f"docs/tasks/{module_task}.md", "behavior": f"Verify the {batch['moduleId']} batch through Blender Main, WASM and Chromium recovery.", "outputs": ["aggregate module receipt", "coverage bindings", "manifest", "status"], "acceptance": ["source and protocol hashes are bound", "every selected Main reader type is proven", "negative no-mutation and recovery are proven", "Chromium and save/reopen evidence are exact"], "status": "in_progress", "ready": True, "queueMutationAllowed": True, "module": {"moduleId": batch["moduleId"], "sourceBacked": True, "capabilities": [f"CAP-{batch['moduleId']}-READER", f"CAP-{batch['moduleId']}-RECOVERY", f"CAP-{batch['moduleId']}-FAIL-CLOSED"], "sourcePaths": source_paths, "reuseReceipts": batch.get("reuseReceipts", [{"manifest": "tests/golden/WBV2-P1107-000/manifest.json", "report": "tests/golden/WBV2-P1107-000/module-receipt.json"}]), "dependencyReuse": batch.get("dependencyReuse", []), "positive": [f"{name} type is read from Blender Main" for name in batch["identifiers"]] + ["shared RNA metadata is preserved", "save/reopen preserves the batch metadata"], "negative": ["malformed blend is rejected without Main mutation", "unsupported batch data fails closed", "non-finite metadata is not synthesized"], "recovery": ["save/reopen", "worker termination", "deterministic second read"], "commands": commands, "fullFamilyParity": False, "evidencePaths": [batch["production"].format(task=module_task)], "coverageBindings": [unit["id"] for unit in batch["units"]]}}
|
||||
|
||||
root_out = CONTROL_ROOT.parent / root_task
|
||||
root_plan_path = root_out / "module-execution-plan.json"
|
||||
|
||||
Reference in New Issue
Block a user