feat(teaching): browser console that runs the functional suite by workbench

A lesson-oriented page plus a loopback job service: click a lesson and the
page really runs tools/web-freecad-functional-suite.mjs, tools/layout-probe.mjs
or tools/static-host.mjs, streaming logs and rendering verdicts from the
suite's own manifest/checkpoint/results files.

- web/tools/teaching-console: catalog derived from scenarios + registry,
  73 workbench lessons, template, builder (--check), Playwright gate,
  no-browser self-test for every spawn validation path
- web/teaching/suite-runner.mjs: argv whitelist, env whitelist, single
  concurrent job, process-group cancel, ring-buffered logs, preflight
- web/teaching/server.mjs: /api/console/* routes with startup token,
  Origin check, SSE events, artifact serving; existing routes untouched
- preflight blocks runs (E_PREFLIGHT) instead of starting without dist,
  Chrome, DISPLAY, kernel or Playwright
- gates: self-test OK, build --check idempotent, offline + live Playwright
  (MOD-Part-01 pass, cancel path) OK

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
2026-11-25 04:12:31 +08:00
parent 5b61c77c2c
commit dd8ba17591
12 changed files with 2714 additions and 1 deletions

View File

@@ -44,6 +44,9 @@
"check:manual": "node tools/manual/check-page.mjs",
"manual:tools": "node ../tools/build-tools-manual.mjs",
"check:tools-manual": "node ../tools/build-tools-manual.mjs --verify && node ../tools/check-tools-manual.mjs",
"build:console": "node tools/teaching-console/build-console.mjs",
"check:console": "node tools/teaching-console/build-console.mjs --check && node tools/teaching-console/self-test.mjs",
"teach:console": "node teaching/server.mjs",
"prebuild": "npm run sync-show-python-family-fixture && npm run check:geometry-boundary",
"dev": "npm run sync-api-index && npm run sync-object-index && npm run sync-format-index && npm run sync-module-registry && npm run sync-part-tier2-adapter && npm run sync-partdesign-tier2-adapter && npm run sync-sketcher-tier2-adapter && npm run sync-techdraw-tier2-adapter && npm run sync-import-tier2-adapter && npm run sync-mesh-tier2-adapter && npm run sync-material-tier1-adapter && npm run sync-tier2-remainder && npm run sync-tier3-stateful && npm run sync-viewprovider-index && npm run sync-property-index && npm run sync-geometry-index && npm run sync-document-graph-index && npm run sync-capability-index && npm run sync-tier1-readonly && npm run sync-tier4-restricted && npm run sync-api-adapter-fill && npm run sync-format-extensions && npm run sync-kernel && npm run sync-release-manifest && vite --host 0.0.0.0",
"build": "npm run sync-api-index && npm run sync-object-index && npm run sync-format-index && npm run sync-module-registry && npm run sync-part-tier2-adapter && npm run sync-partdesign-tier2-adapter && npm run sync-sketcher-tier2-adapter && npm run sync-techdraw-tier2-adapter && npm run sync-import-tier2-adapter && npm run sync-mesh-tier2-adapter && npm run sync-material-tier1-adapter && npm run sync-tier2-remainder && npm run sync-tier3-stateful && npm run sync-viewprovider-index && npm run sync-property-index && npm run sync-geometry-index && npm run sync-document-graph-index && npm run sync-capability-index && npm run sync-tier1-readonly && npm run sync-tier4-restricted && npm run sync-api-adapter-fill && npm run sync-format-extensions && npm run sync-kernel && npm run sync-release-manifest && tsc --noEmit && vite build",