Files
workinf_Blender_Wasm/tools/web/run-wbv2-evidence-capture.py
mes123456 f3e21c6b98
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled
chore: checkpoint web Blender migration source, tools and docs
Accumulated uncommitted work: GHOST Web backend, WebGL/GPU web layer,
web workflow engine and protocol, tooling, docs and task records.
Large generated evidence, user-testing archives, build snapshots and
imported test assets remain untracked.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-10 11:18:01 +08:00

22 lines
1.4 KiB
Python
Executable File

#!/usr/bin/env python3
"""Unattended evidence-capture dispatcher for WBV2-P1424-001.
It emits concrete commands from the behavior contracts. Execution is opt-in via
--execute; default mode only writes a reproducible handoff manifest.
"""
import argparse, json, pathlib, subprocess, sys, shutil, os
TASK='WBV2-P1424-001'; ROOT=pathlib.Path(__file__).resolve().parents[2]
CONTRACT=ROOT/'tests/golden'/TASK/'behavior-contracts.json'; OUT=ROOT/'tests/golden'/TASK/'evidence-capture-handoff.json'
def main():
p=argparse.ArgumentParser(); p.add_argument('--execute',action='store_true'); a=p.parse_args()
chrome = os.environ.get('CHROME_PATH') or shutil.which('google-chrome') or shutil.which('google-chrome-stable')
cs=json.loads(CONTRACT.read_text())['contracts']; steps=[]
for c in cs:
steps.append({'module':c['module'],'commands':[c['positive']['command'],c['negative']['command']],'runner':'Chromium + native WebEngine/WASM','status':'NOT_RUN'})
hand={'schemaVersion':1,'task':TASK,'status':'READY_FOR_EXECUTION' if chrome else 'BLOCKED_CHROMIUM_MISSING','execute':a.execute,'runner':{'browser':'Chromium','executablePath':chrome,'config':'web/playwright.config.ts'},'steps':steps}
if a.execute and not chrome:
hand['error']='No Chromium executable found; install or expose CHROME_PATH.'
OUT.write_text(json.dumps(hand,indent=2,ensure_ascii=False)+'\n')
return 0
if __name__=='__main__': sys.exit(main())