#!/usr/bin/env bash # WEB-04 domain acceptance: three composition cases through the unique web Tool # plus the real production delivery trial (Express app with API and E2E). set -eu : "${MARQDO_BIN:?set MARQDO_BIN to the verified marqdo executable}" : "${MARQDO_WEB_TOOL_JSON:?set MARQDO_WEB_TOOL_JSON to the built preview tool.json}" cd "$(dirname "$0")/.." work="$(mktemp -d)" trap 'rm -rf "$work"' EXIT export MARQDO_TOOL_HOME="$work/tool-home" "$MARQDO_BIN" tool install "$MARQDO_WEB_TOOL_JSON" run_case() { case_name="$1" unit="$2" root="examples/$case_name" entry="$root/index.mq.md" "$MARQDO_BIN" web check "$entry" --unit "$unit" --root "$root" preview="$work/$case_name-preview" "$MARQDO_BIN" web preview "$entry" --unit "$unit" --root "$root" --out "$preview" test -f "$preview/index.html" grep -q "Content-Security-Policy" "$preview/index.html" grep -q "data-scenario\|data-instance" "$preview/index.html" handoff="$work/$case_name-handoff.md" "$MARQDO_BIN" web handoff "$entry" --unit "$unit" --root "$root" --out "$handoff" test -s "$handoff" grep -q "Design handoff" "$handoff" echo "case $case_name: PASS" } run_case research-workspace 工作台 run_case doc-site 首页 run_case quantum-editor 编辑器 # Production delivery trial: a real framework application, not the prototype. ( cd examples/research-workbench-app npm install --no-audit --no-fund ${MARQDO_NPM_CACHE:+--cache "$MARQDO_NPM_CACHE"} npm test WORKBENCH_DATA="$work/e2e-data.json" npx playwright test ) "$MARQDO_BIN" tool remove web echo "PASS: WEB-04 domain composition + production delivery trial"