- 新数据链 web/teaching/cases/carrier-partdesign:20 件零件(spec.json 唯一来源)、 内核建造器 parts/*.mjs、traces/FCStd/replay 全量产物;装配 20 插入 + 19 关节。 - 工具包 tools/carrier:catalog / preflight / create-part / create-assembly / create-all / list / self-test / README,按零件与装配拆分为独立工具。 - 共享驱动扩展 web/tools/cad-ui-rebuild:Loft/Pipe/Hole/Fillet/Chamfer/Mirrored/ LinearPattern 交互,Reversed 复选框补齐;装配 saveAssemblyBundle 先 Accept 再保存。 - 教学:lessons.mjs 新增 carrier 组(环境课 + 20 件 + 装配),suite-runner 增加 carrier-part/carrier-assembly,生成 carrier-toolkit.html 并接入 index 与控制台证据。 验证:20 件 210 步全部有头通过(P05 修复后 39640 m³;P06 回归 8/8); 装配 20/20 插入、19/19 关节、20 组件 0 畸形、0 mismatch;check:carrier、 check:reducer、check-console --live 全绿。 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
43 lines
1.3 KiB
Bash
Executable File
43 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Drive every part in a project through the real UI, one at a time.
|
|
#
|
|
# Sequential on purpose: one app server and one shared WASM kernel are the
|
|
# bottleneck, and a parallel sweep only trades wall clock for flaky browser
|
|
# timeouts.
|
|
#
|
|
# Usage: sweep.sh --project <dir> [partId ...] (no ids = every part)
|
|
set -u
|
|
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
PROJECT=""
|
|
IDS=()
|
|
while [ $# -gt 0 ]; do
|
|
case "$1" in
|
|
--project) PROJECT="$2"; shift 2 ;;
|
|
*) IDS+=("$1"); shift ;;
|
|
esac
|
|
done
|
|
if [ -z "$PROJECT" ]; then
|
|
echo "usage: sweep.sh --project <dir> [partId ...]" >&2
|
|
exit 2
|
|
fi
|
|
mkdir -p "$PROJECT/out/ui-run"
|
|
|
|
if [ ${#IDS[@]} -eq 0 ]; then
|
|
mapfile -t IDS < <(node "$HERE/manifest.mjs" --project "$PROJECT" 2>/dev/null \
|
|
|| node -e 'const p=require(process.argv[1]);for(const x of p.parts)console.log(x.id)' "$PROJECT/project.json")
|
|
fi
|
|
|
|
fail=0
|
|
for id in "${IDS[@]}"; do
|
|
log="$PROJECT/out/ui-run/$id.log"
|
|
started=$(date +%s)
|
|
if timeout 2400 node "$HERE/drive.mjs" --project "$PROJECT" "$id" > "$log" 2>&1; then
|
|
printf '%s ok %ss %s\n' "$id" "$(( $(date +%s) - started ))" "$(tail -1 "$log")"
|
|
else
|
|
printf '%s FAIL %ss %s\n' "$id" "$(( $(date +%s) - started ))" "$(tail -1 "$log")"
|
|
fail=$((fail + 1))
|
|
fi
|
|
done
|
|
echo "sweep done: $(( ${#IDS[@]} - fail ))/${#IDS[@]} passed"
|
|
exit $(( fail > 0 ? 1 : 0 ))
|