#!/usr/bin/env python3 """Admit sequencer authoring to independent local verification.""" import hashlib import json import pathlib import subprocess from wbv2_execution_phase import implementation_only ROOT = pathlib.Path(__file__).resolve().parents[1] JOB = "SEQUENCER-STILL-AUTHORING" UNIT = "web-command:setSequencerStrips" KINDS = ("positive", "negative", "undo_redo", "save_reopen", "determinism") def main(): context = json.loads(subprocess.check_output( ["node", "tools/web/print-task-context.mjs"], cwd=ROOT, text=True)) if not implementation_only(ROOT): subprocess.run(["node", "tools/web/check-task-context.mjs"], cwd=ROOT, check=True, stdout=subprocess.DEVNULL) parent = ROOT / context["sourceDocuments"]["parentManifest"] backlog_path = ROOT / "tests/golden/WBV2/web-product-backlog.json" backlog = json.loads(backlog_path.read_text()) parent_job = next(job for job in backlog["tasks"] if job["id"] == "SEQUENCER-AUTHORING") if not any(job["id"] == JOB for job in backlog["tasks"]): backlog["tasks"].append({ "id": JOB, "parentJob": parent_job["id"], "module": parent_job["module"], "title": "Verify native sequencer still-image editing and resource preservation", "status": "pending", "commands": ["setSequencerStrips"], "ownedPaths": parent_job["ownedPaths"], "resultPath": f"tests/golden/WBV2/product-migration/{JOB}-result.json", "implementation": "Move, trim, split, mute and remove still-image strips; preserve existing sound and effect resources; add and remove META strips with native persistence and history.", }) backlog_path.write_text(json.dumps(backlog, indent=2, ensure_ascii=False) + "\n") references = [ "blender-5.2.0/source/blender/sequencer/intern/sequencer.cc", "blender-5.2.0/source/blender/sequencer/intern/strip_add.cc", "blender-5.2.0/source/blender/sequencer/intern/strip_edit.cc", "blender-5.2.0/source/blender/blenkernel/intern/idtype.cc", "blender-5.2.0/source/blender/blenkernel/intern/sound.cc", "blender-5.2.0/source/blender/web_engine/web_engine_api.cpp", "blender-5.2.0/source/blender/web_engine/web_engine_main_state.cpp", "blender-5.2.0/source/blender/web_engine/web_engine_headless_fallback.cpp", ] changed = [ "web/app/src/app/App.tsx", "web/tests/e2e/sequencer-authoring-ui-production.spec.ts", "web/tests/fixtures/sequencer-main-snapshots.py", "my-tools/diagnose_local_sequencer.mjs", "my-tools/prepare_wbv2_sequencer_workflow.py", "blender-5.2.0/source/blender/web_engine/web_engine_main_state.cpp", "blender-5.2.0/source/blender/blenkernel/intern/idtype.cc", references[-1], ] dependencies = sorted(set(references + changed + [ ".emscripten-web", "build_web_blender6/CMakeCache.txt", "tests/files/web/sequencer_scene.blend", "my-tools/build_local_webengine.py", "tools/web/sync-web-engine-runtime.mjs", "tools/web/incremental-web-build.mjs", "tools/web/run-incremental-typecheck.mjs", "tools/web/web-build-fingerprint.mjs", "web/tests/fixtures/native-ui-workflow.ts", "web/app/src/app/App.tsx", "web/app/src/workers/web-engine.worker.ts", "web/app/src/engine-client/WebEngineClient.ts", "web/app/src/sequencer/SequencerTimeline.ts", "web/app/src/capabilities/blender-feature-route-catalog.json", "web/app/vite.config.ts", "web/package.json", "web/playwright.config.ts", "web/protocol/sequencer.ts", "web/protocol/scene-ir.ts", "web/protocol/web-engine.ts", "web/tsconfig.json", ])) missing = [name for name in dependencies if not (ROOT / name).is_file()] if missing: raise RuntimeError("Missing local dependencies: " + ", ".join(missing)) checks = [ {"id": "wasm-source-build", "argv": ["python3", "my-tools/build_local_webengine.py"], "cwd": ".", "kinds": ["source_build"], "timeoutSeconds": 1200, "continueOnFailure": True}, {"id": "native-minimal", "argv": ["node", "my-tools/diagnose_local_sequencer.mjs"], "cwd": ".", "kinds": ["unit"], "dependsOn": ["wasm-source-build"], "timeoutSeconds": 30, "continueOnFailure": True}, {"id": "web-build", "argv": ["node", "tools/web/incremental-web-build.mjs"], "cwd": ".", "kinds": ["typecheck"], "dependsOn": ["wasm-source-build", "native-minimal"], "timeoutSeconds": 300, "continueOnFailure": True}, {"id": "authoring-lint", "argv": ["node", "node_modules/eslint/bin/eslint.js", "app/src/app/App.tsx"], "cwd": "web", "kinds": ["lint"], "timeoutSeconds": 60, "continueOnFailure": True}, {"id": "chromium-authoring", "argv": ["env", f"BLENDER_BIN={ROOT / 'build_blender_native/bin/blender'}", "WEB_TEST_PORT=5358", "node", "node_modules/@playwright/test/cli.js", "test", "--config", "playwright.config.ts", "tests/e2e/sequencer-authoring-ui-production.spec.ts", "--workers=1", "--max-failures=1"], "cwd": "web", "kinds": ["chromium", *KINDS], "dependsOn": ["wasm-source-build", "web-build", "native-minimal"], "timeoutSeconds": 180, "continueOnFailure": True}, ] document = { "schemaVersion": 1, "task": context["task"], "job": JOB, "parentSha256": hashlib.sha256(parent.read_bytes()).hexdigest(), "acceptance": "pending independent local validation", "result": { "status": "ready", "summary": "Native sequencer authoring requires independent behavioral validation", "workflow": "Move, trim, split, mute and remove a still-image strip; preserve sound and effect resources; create and remove a META strip in native Main", "sourceUnits": [UNIT], "routeIds": [UNIT], "sourceReferences": references, "changedFiles": changed, "dependencies": dependencies, "artifacts": ["build_blender_native/bin/blender", "build_web_blender6/bin/web_engine.wasm", "build_web_blender6/bin/web_engine.js", "web/app/public/vendor/blender/web_engine.wasm", "web/app/public/vendor/blender/web_engine.js", "web/app/public/wasm-module-manifest.json"], "checks": checks, "cases": [{"id": f"sequencer-authoring-{kind}", "kind": kind, "checkId": "chromium-authoring", "receipt": f"unallocated/{kind}.json", "unitIds": [UNIT]} for kind in KINDS], }, } output = ROOT / "my-tools/local-workflows" / f"{JOB}.json" output.parent.mkdir(parents=True, exist_ok=True) output.write_text(json.dumps(document, indent=2) + "\n") print(json.dumps({"job": JOB, "state": "prepared", "contract": str(output.relative_to(ROOT))})) if __name__ == "__main__": main()