Compare commits
54 Commits
main
...
web-deskto
| Author | SHA1 | Date | |
|---|---|---|---|
| c0ee9f7f23 | |||
| d7796fe092 | |||
| fd37b92fd9 | |||
| 3a3077c089 | |||
| a6576b72ac | |||
| 87b2a6cb8a | |||
| b876ad5742 | |||
| dd8ba17591 | |||
| 5b61c77c2c | |||
| facbb196d8 | |||
| c3b3160f33 | |||
| 8bdf8db8d6 | |||
| 300c8efb01 | |||
| 3c2c623f70 | |||
| 82d78af58e | |||
| 7d9cf3a5ea | |||
| 39410dea36 | |||
| dd7a940c37 | |||
| 65f59aba25 | |||
| acf222bb03 | |||
| 00e0097969 | |||
| f3e4365530 | |||
| fa420201e6 | |||
| 1feee94eac | |||
| 87faaf0796 | |||
| b451b51457 | |||
| fcc3a15f53 | |||
| 1454e259be | |||
| 7a3989eb99 | |||
| e214e61ca6 | |||
| a13b1f221d | |||
| 26c0963363 | |||
| 1c7d85b3a2 | |||
| e87a455e21 | |||
| cbd2690993 | |||
| 4efeadbee3 | |||
| 4a45ffaf47 | |||
| 452f0b976f | |||
| 26c8a104cd | |||
| 70a6c17165 | |||
| 330221bd5d | |||
| e493eafa04 | |||
| aff9b6464a | |||
| 579d6d20c8 | |||
| 158e9ddfdc | |||
| 15a365022f | |||
| 3d3afc129f | |||
| 6a7efb5432 | |||
| bc40c77153 | |||
| a10493723b | |||
| cf4a3ea984 | |||
| 249f40a69b | |||
| 3ac496c3c2 | |||
| 4eff6110e7 |
104
.gitignore
vendored
@@ -1,73 +1,35 @@
|
|||||||
# file types to ignore
|
/freecad-source/build-web/
|
||||||
.*
|
/freecad-source/build/
|
||||||
!*.gitattributes
|
/web/node_modules/
|
||||||
!*.gitignore
|
/web/dist/
|
||||||
!/.clang-format
|
/web/public/kernel/
|
||||||
!/.clang-tidy
|
/web/public/modules/
|
||||||
!/.git-blame-ignore-revs
|
/docs/current/continuation-runs/
|
||||||
!/.gitattributes
|
/docs/current/user-tests-20260915/
|
||||||
!/.github/
|
/docs/current/business-evidence/
|
||||||
!/.gitignore
|
/docs/current/failure-evidence/
|
||||||
!/.gitmodules
|
/docs/current/round-reports/
|
||||||
!/.packit.yaml
|
/docs/current/periodic-optimization/
|
||||||
!/.pre-commit-config.yaml
|
/docs/current/operator-gap-discovery/
|
||||||
!/.pylintrc
|
**/__pycache__/
|
||||||
!/contrib/.vscode/
|
|
||||||
*.clangd
|
|
||||||
*.DS_Store
|
|
||||||
*.dep
|
|
||||||
*.exp
|
|
||||||
*.kdev4
|
|
||||||
*.lib
|
|
||||||
*.manifest
|
|
||||||
*.o
|
|
||||||
*.obj
|
|
||||||
*.orig
|
|
||||||
*.output
|
|
||||||
*.pch
|
|
||||||
*.pyc
|
*.pyc
|
||||||
*.vcproj
|
*.log
|
||||||
# Ignore .db files created by Qt Designer when editing .ui files
|
*.out
|
||||||
*.db
|
*.tmp
|
||||||
*qrc.depends
|
.env*
|
||||||
*~
|
|
||||||
BuildLog.htm
|
|
||||||
CMakeCache.txt
|
|
||||||
CMakeFiles/
|
|
||||||
CMakeLists.txt.user
|
|
||||||
Makefile
|
|
||||||
cmake_install.cmake
|
|
||||||
config.h
|
|
||||||
install_manifest.txt
|
|
||||||
moc_*.cpp
|
|
||||||
qrc_*.cpp
|
|
||||||
ui_*.h
|
|
||||||
/.vscode/
|
|
||||||
/ALL_BUILD.dir/
|
|
||||||
/Mod/
|
|
||||||
/ZERO_CHECK.dir/
|
|
||||||
/bin/
|
|
||||||
/build-*/
|
|
||||||
/build/
|
|
||||||
/cmake-build*/
|
|
||||||
/conda/environment.yml
|
|
||||||
/doc/
|
|
||||||
/lib/
|
|
||||||
/src/Tools/offlinedoc/*.txt
|
|
||||||
/src/Tools/offlinedoc/localwiki/
|
|
||||||
OpenSCAD_rc.py
|
|
||||||
tags
|
|
||||||
/CMakeUserPresets.json
|
|
||||||
Testing
|
|
||||||
compile_commands.json
|
|
||||||
*.sublime-project
|
|
||||||
*.sublime-workspace
|
|
||||||
|
|
||||||
# crowdin file
|
# BIM workshop video production cache (raw recording, Chrome profile, ffmpeg segments)
|
||||||
files_to_translate.txt
|
web/tools/bim-workshop-video/profile/
|
||||||
src/Tools/freecad.zip
|
web/tools/bim-workshop-video/raw/
|
||||||
tsupdate_stderr.log
|
web/tools/bim-workshop-video/segments/
|
||||||
tsupdate_stdout.log
|
|
||||||
# pixi environments
|
# Production-line course: regenerable recording/audio caches and local media
|
||||||
*.egg-info
|
web/tools/line-course/raw/
|
||||||
.pixi
|
web/tools/line-course/episodes/*/segments/
|
||||||
|
web/tools/line-course/episodes/*/audio/
|
||||||
|
web/teaching/media/line-course/*.mp4
|
||||||
|
web/teaching/media/line-course/*.webm
|
||||||
|
web/teaching/media/line-course/*.vtt
|
||||||
|
web/teaching/media/line-course/*.srt
|
||||||
|
web/teaching/media/line-course/*-poster.png
|
||||||
|
web/teaching/cases/line-models
|
||||||
|
|||||||
114
docs/current/carrier-partdesign-toolkit/continuation.md
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
# 航空母舰 PartDesign 工具包 — 接续记录
|
||||||
|
|
||||||
|
## 2026-11-25 · P02 甲板第 11 步(倒角)界面失败定位与修复
|
||||||
|
|
||||||
|
- 证据:`web/teaching/cases/carrier-partdesign/out/traces/CarrierDeck.json` 第 11 事件
|
||||||
|
`tips.objects` 共 20 项,**包含** `DeckEdgeChamfer|PartDesign::Chamfer`,`tip` 也是它。
|
||||||
|
→ 内核响应没有缺口,缺口在界面驱动取证时机。
|
||||||
|
- 根因:`drive.mjs` 在点击创建后固定等 2500 ms 就扫描模型树;工作台 `edit()`
|
||||||
|
在 `perform()` 里以 `busy=计算中...` 包住整次内核请求,等响应回来才
|
||||||
|
`apply(result)` 换掉 `documents[document]`。甲板倒角要算几十秒,扫描时行还不存在。
|
||||||
|
- 修复(共享 owner `web/tools/cad-ui-rebuild/drive.mjs`):
|
||||||
|
- `internalNames()` 简化为单次读取(`document-tree.tsx` 不做虚拟化,全部行常驻)。
|
||||||
|
- 新增 `waitForRows(page, minimum)`:轮询到树行数超过创建前且 `role=status`
|
||||||
|
不再含「计算中」,上限 240 s。
|
||||||
|
- 每个步骤创建后先 `waitForRows(rowsBefore + 1)` 再记录「内核名 → 界面名」。
|
||||||
|
- 下一步:`node tools/carrier/create-part.mjs P02 --headed` 复跑,要求 14/14 步且
|
||||||
|
体积 35733.17547337647(相对误差 < 1e-6);通过后进入阶段 2/3。
|
||||||
|
- 另:`tools/carrier/README.md` 已写;`build-steps.mjs` 每件都 `loadWasmProbe` 且
|
||||||
|
结尾无 `process.exit`,是上次挂起的入口,阶段 3 前需处理(单件运行会覆盖 `index.json`,
|
||||||
|
需合并语义)。
|
||||||
|
|
||||||
|
## 2026-11-25 · P02 修复已验证;批量与教学接入
|
||||||
|
|
||||||
|
- P02 复跑:14/14 步,体积 35733.175473 vs 记录 35733.17547337647(相对误差 1.05e-11)→ pass。
|
||||||
|
`build-steps.mjs` 已改:探针只装载一次、`index.json` 按 document 合并、`--json` 摘要用
|
||||||
|
`fs.writeFileSync(1, …)` 后 `process.exit`(不再挂起)。P01 10 步、P03–P20 共 186 步 0 失败。
|
||||||
|
- 批量 P03–P20(后台任务 `bdiofjzb3`,日志 `/tmp/create-all-carrier.log`):P03–P15 全部 pass,
|
||||||
|
体积相对误差 ≤ 4.6e-9;单件 8–10 分钟。剩余 P16–P20。
|
||||||
|
- 教学接入(代码,不占浏览器):
|
||||||
|
- `web/tools/teaching-console/lessons.mjs`:新增 `carrier` 组 + `carrierLessons()`
|
||||||
|
(1 节 dry 环境课 + 20 节零件课 + 1 节装配课),buildLessons 已包含 → 120 课。
|
||||||
|
- `web/teaching/suite-runner.mjs`:新增 `carrier-part` / `carrier-assembly`
|
||||||
|
job kind(`P\d{2}` 白名单,argv 指向 `tools/carrier/create-part.mjs` /
|
||||||
|
`create-assembly.mjs`,超时 45/60 分钟),判定折叠复用 report.json 结构化字段。
|
||||||
|
- `tools/carrier/create-part.mjs`:`--dry` 且给了 `--out` 时也写 `report.json`
|
||||||
|
(verdict pass/precondition_fail),控制台不必解析日志文本。
|
||||||
|
- `web/tools/teaching-console/build-carrier-page.mjs` → `web/teaching/carrier-toolkit.html`
|
||||||
|
(20 卡片 + 15 分区 + 210 步,`--check` 幂等);`check-carrier-page.mjs` 双视口门禁通过。
|
||||||
|
- `web/teaching/index.html` 加入口;`web/package.json` 加 `carrier:*`、`build:carrier-page`、
|
||||||
|
`check:carrier`;`check-console.mjs --live` 增加一条 carrier dry 课。
|
||||||
|
- 下一步:批量结束后核对 P16–P20 → `node tools/carrier/create-assembly.mjs --headed`;
|
||||||
|
然后补“装配保存 FCStd 到 OPFS”的缺口(BOM 面板的 Save FCStd 会 storeAssemblyBundle
|
||||||
|
到 OPFS 并同时下载,需按 OPFS 铁律拆出无下载的保存路径)。
|
||||||
|
|
||||||
|
## 2026-11-25 · P05 CarrierHangar 根因:Pocket 方向 + 驱动 Reversed 缺口
|
||||||
|
|
||||||
|
- 现象:内核参考体积 108800.00000000001(7 面 / 16 边,等于没切),界面 39640。
|
||||||
|
- 根因(桌面语义):`PartDesign::Pocket` 在 `FeaturePocket::getProfileNormal()`
|
||||||
|
(`freecad-source/src/Mod/PartDesign/App/FeaturePocket.cpp:134-138`)把草图法向乘 −1,
|
||||||
|
所以 +Z 草图上的**默认 Pocket 就是向下切**;`reversed: true` 反而是向上切出实体外。
|
||||||
|
旧 `parts/hangar.mjs` 写了 `reversed: true`,工具面只在外表面留了压痕。
|
||||||
|
- 第二处缺口(共享 owner):`web/tools/cad-ui-rebuild/lib/driver.mjs` 的 `createFeature`
|
||||||
|
从未勾选 Reversed 复选框(只有 Hole 在 `fillFeatureExtras` 里设),所以界面把
|
||||||
|
`reversed` 静默丢弃、恰好向下切 → 两处缺口互相掩盖,每一步都「成功」。
|
||||||
|
- 修复:`parts/hangar.mjs` 删掉 `reversed`(并写明依据);`lib/driver.mjs` 在 Sides/midplane
|
||||||
|
之后对 `Pad|Pocket|Revolution|Groove` 统一 `setCheckbox(page, "Reversed", …)`。
|
||||||
|
- 复算:`build.mjs P05` → 39640.000 m³;`capture-replay.mjs --only CarrierHangar` → 4 条带 mesh、
|
||||||
|
`failures: []`;`build-steps.mjs … CarrierHangar` → 4 步;`create-part.mjs P05 --headed` →
|
||||||
|
4/4 步、体积 39640 vs 39639.999999999985(相对误差 3.7e-16)、0 pageErrors、181 s。
|
||||||
|
证据 `docs/current/carrier-partdesign-toolkit/runs/2026-11-25T09-52-40-008Z-P05/report.json`。
|
||||||
|
- 教训:`capture-replay.mjs --only` 匹配文档名(CarrierHangar),不匹配 id(P05)。
|
||||||
|
|
||||||
|
## 2026-11-25 · 阶段 4 装配通过(含 BOM 保存修复)与教学门禁
|
||||||
|
|
||||||
|
- `project.json` 的 `assembly` 加 `"saveBundle": true`;`npx vite build` 重建 dist
|
||||||
|
(5183 是 `vite preview`,服务的是 `web/dist`,改 `web/src` 后必须重建)。
|
||||||
|
- 首次有头装配:20/20 插入、19/19 关节、2 次求解 20 组件 0 畸形,但保存失败——
|
||||||
|
BOM 面板 `Save FCStd` 在会话打开时 disabled,native 侧
|
||||||
|
`AssemblyInsertLink.h` 的 `save` 在 `session or doc.HasPendingTransaction` 时抛
|
||||||
|
`Accept or cancel the task first`。
|
||||||
|
- 修复(共享 owner):`web/tools/cad-ui-rebuild/lib/assembly.mjs` 的 `saveAssemblyBundle`
|
||||||
|
先等「Save 或 Accept 可点」,Save 仍禁用则点 Accept 提交表格,再点 Save FCStd。
|
||||||
|
- 复跑:`create-assembly.mjs --headed` → pass(20/20、19/19、20 组件、0 畸形、
|
||||||
|
0 mismatch、67 s)。证据 `runs/2026-11-25T10-06-49-236Z-assembly/report.json`;
|
||||||
|
原始 `out/ui-run/CarrierAssembly-assembly.json`。
|
||||||
|
- 教学门禁:页面随 P05 体积变化失效,`build:carrier-page` 重生成后
|
||||||
|
`check:carrier` 全绿(20 件 / 210 步 / 双视口 0 溢出)。`check:reducer` 全绿
|
||||||
|
(23 件 / 104 步,驱动改动无回归)。
|
||||||
|
## 2026-11-25 · 阶段 5 收尾(控制台证据 + 提交)
|
||||||
|
|
||||||
|
- `check-console.mjs --live` 首次失败:carrier 课判定通过但 evidence=0。原因:
|
||||||
|
`web/teaching/console.html` 的 `renderEvidence` 只为 reducer-part/reducer-assembly
|
||||||
|
生成报告 JSON 链接,carrier 两种 job kind 漏了。修复:条件并入 carrier-part /
|
||||||
|
carrier-assembly;复跑 `live carrier: verdict=通过 rows=1 evidence=1`,整体 `check-console: OK`。
|
||||||
|
- P06 有头回归:8/8 步、体积 1008、0 pageErrors(326 s)→ 驱动 Reversed 改动无回归。
|
||||||
|
- 提交 `87b2a6cb`:335 个文件(工具、数据链、教学页、账本);未包含
|
||||||
|
`ui-stills/`(22 MB 运行截图,可重建)、`out/opfs` 镜像与 `tmp-*-probe.mjs`。
|
||||||
|
- 待用户:`git push gitea web-desktop-parity-20261113`(领先远端 11 个提交);
|
||||||
|
重启教学服务以加载新的 carrier-toolkit.html 与控制台页面。
|
||||||
|
|
||||||
|
## 2026-11-25 · 教学页内直接运行(单件 / 按组 / 全部 / 装配)
|
||||||
|
|
||||||
|
- 新增 `web/teaching/console-runner.js`(经典脚本,`file://` 安全):`window.TeachingRunner.mount()`
|
||||||
|
统一提供令牌读取、`POST /api/console/run`、SSE、终端 / 判定 / 结果 / 证据 / 进度渲染、取消、
|
||||||
|
离线降级;`runSequence()` 逐课串行(`E_BUSY` 409 退避 2 s × 30)、`keepGoing` 失败继续、
|
||||||
|
终判「全部通过 / 已取消(完成 k/n)/ 汇总」。`template.html` 改为引用该脚本 + 控制台专属贴片,
|
||||||
|
`console.html` 重新生成;`check:console` 与 `self-test` 全绿(120 课 / 71 案例)。
|
||||||
|
- `build-carrier-page.mjs`:导出 `carrierLessons()` 构建期生成 `window.__CARRIER__`
|
||||||
|
(20 件 / 环境 / 装配的课 id,不手抄);每张零件卡一个「运行本件」`button.run-part[data-lesson-id]`
|
||||||
|
与 `[data-part-status]` 徽标,每个系统分组一个「运行本组」`button.run-group[data-lesson-ids]`,
|
||||||
|
顶部「运行全部 20 件」与「环境自检(dry)」;按钮由 runner 统一门控
|
||||||
|
(`online && !busy && preflight.ok`),状态镜像到 `body.dataset.runnerState`。
|
||||||
|
- 修复(构建器共享 owner):`runButton()` 曾把 class 写在模板里、调用方又在 attributes 传
|
||||||
|
`class="run-group"`,生成重复 `class` 属性 → 浏览器只取第一个,分组/装配类名被静默丢弃,
|
||||||
|
live 门禁报「分组运行按钮 0 个」。改为合并 class 列表后重新生成(12 组 + 1 装配齐全)。
|
||||||
|
- `server.mjs` 启动横幅新增 `carrier: <origin>/carrier-toolkit.html?token=…`;
|
||||||
|
`web/package.json` 新增 `check:carrier-live`,`check:carrier` 保持离线。
|
||||||
|
- 门禁:`build-carrier-page/build-console --check` OK;离线 `check-carrier-page` 通过
|
||||||
|
(20 卡 / 15 区 / 210 步 / 按钮禁用 / runnerState=offline / 双视口 0 溢出);
|
||||||
|
`check-carrier-page --live` 通过(临时端口起服务,点环境自检课 → 「前置全部满足」→
|
||||||
|
判定「通过」rows=1 evidence=1,结束后 runnerState=ready、按钮恢复);`check:carrier`、
|
||||||
|
`check:console` 全绿。
|
||||||
|
- 有头实跑入口:教学服务器横幅打印的 `carrier-toolkit.html?token=…`(默认端口 5190)。
|
||||||
|
5183 是 `vite preview`(服务 `web/dist`),`/teaching/*`、`/api/*` 走 SPA 回退,不能运行。
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/part/v1",
|
||||||
|
"part": {
|
||||||
|
"id": "P02",
|
||||||
|
"document": "CarrierDeck",
|
||||||
|
"title": "飞行甲板",
|
||||||
|
"system": "flight-deck",
|
||||||
|
"systemLabel": "飞行甲板",
|
||||||
|
"featureTypes": [
|
||||||
|
"Pad",
|
||||||
|
"Pocket",
|
||||||
|
"Chamfer"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"steps": 11,
|
||||||
|
"stepsTotal": 14,
|
||||||
|
"failed": 1,
|
||||||
|
"volume": 35730.599638,
|
||||||
|
"expectedVolume": 35733.17547337647,
|
||||||
|
"relativeError": 0.00007208526368969833,
|
||||||
|
"volumeMatches": false,
|
||||||
|
"seconds": 450.59,
|
||||||
|
"pageErrors": [],
|
||||||
|
"stillsDir": "web/tools/carrier-partdesign-course/ui-stills/P02",
|
||||||
|
"driverExitCode": 1,
|
||||||
|
"verdict": "product_fail",
|
||||||
|
"finishedAt": "2026-11-25T04:40:46.116Z"
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/part/v1",
|
||||||
|
"part": {
|
||||||
|
"id": "P02",
|
||||||
|
"document": "CarrierDeck",
|
||||||
|
"title": "飞行甲板",
|
||||||
|
"system": "flight-deck",
|
||||||
|
"systemLabel": "飞行甲板",
|
||||||
|
"featureTypes": [
|
||||||
|
"Pad",
|
||||||
|
"Pocket",
|
||||||
|
"Chamfer"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"steps": 11,
|
||||||
|
"stepsTotal": 14,
|
||||||
|
"failed": 1,
|
||||||
|
"volume": 35730.599638,
|
||||||
|
"expectedVolume": 35733.17547337647,
|
||||||
|
"relativeError": 0.00007208526368969833,
|
||||||
|
"volumeMatches": false,
|
||||||
|
"seconds": 453.462,
|
||||||
|
"pageErrors": [],
|
||||||
|
"stillsDir": "web/tools/carrier-partdesign-course/ui-stills/P02",
|
||||||
|
"driverExitCode": 1,
|
||||||
|
"verdict": "product_fail",
|
||||||
|
"finishedAt": "2026-11-25T05:00:06.228Z"
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/part/v1",
|
||||||
|
"part": {
|
||||||
|
"id": "P02",
|
||||||
|
"document": "CarrierDeck",
|
||||||
|
"title": "飞行甲板",
|
||||||
|
"system": "flight-deck",
|
||||||
|
"systemLabel": "飞行甲板",
|
||||||
|
"featureTypes": [
|
||||||
|
"Pad",
|
||||||
|
"Pocket",
|
||||||
|
"Chamfer"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"steps": 14,
|
||||||
|
"stepsTotal": 14,
|
||||||
|
"failed": 0,
|
||||||
|
"volume": 35733.175473,
|
||||||
|
"expectedVolume": 35733.17547337647,
|
||||||
|
"relativeError": 1.0535456698942295e-11,
|
||||||
|
"volumeMatches": true,
|
||||||
|
"seconds": 570.83,
|
||||||
|
"pageErrors": [],
|
||||||
|
"stillsDir": "web/tools/carrier-partdesign-course/ui-stills/P02",
|
||||||
|
"driverExitCode": 0,
|
||||||
|
"verdict": "pass",
|
||||||
|
"finishedAt": "2026-11-25T05:43:05.377Z"
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/part/v1",
|
||||||
|
"part": {
|
||||||
|
"id": "P01",
|
||||||
|
"document": "CarrierHull",
|
||||||
|
"title": "舰体",
|
||||||
|
"system": "hull-structure",
|
||||||
|
"systemLabel": "舰体结构",
|
||||||
|
"featureTypes": [
|
||||||
|
"Loft"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"steps": 10,
|
||||||
|
"stepsTotal": 10,
|
||||||
|
"failed": 0,
|
||||||
|
"volume": 260846.779202,
|
||||||
|
"expectedVolume": 260846.77920152084,
|
||||||
|
"relativeError": 1.8369613997398746e-12,
|
||||||
|
"volumeMatches": true,
|
||||||
|
"seconds": 512.441,
|
||||||
|
"pageErrors": [],
|
||||||
|
"stillsDir": "web/tools/carrier-partdesign-course/ui-stills/P01",
|
||||||
|
"driverExitCode": 0,
|
||||||
|
"verdict": "pass",
|
||||||
|
"finishedAt": "2026-11-25T05:59:08.335Z"
|
||||||
|
}
|
||||||
@@ -0,0 +1,138 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/batch/v1",
|
||||||
|
"startedAt": "2026-11-25T06:03:30.114Z",
|
||||||
|
"items": [
|
||||||
|
{
|
||||||
|
"id": "P03",
|
||||||
|
"document": "CarrierAngledDeck",
|
||||||
|
"title": "斜角甲板",
|
||||||
|
"system": "angled-deck",
|
||||||
|
"exitCode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "P04",
|
||||||
|
"document": "CarrierIsland",
|
||||||
|
"title": "舰岛",
|
||||||
|
"system": "island",
|
||||||
|
"exitCode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "P05",
|
||||||
|
"document": "CarrierHangar",
|
||||||
|
"title": "机库",
|
||||||
|
"system": "hangar",
|
||||||
|
"exitCode": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "P06",
|
||||||
|
"document": "CarrierElevators",
|
||||||
|
"title": "升降机",
|
||||||
|
"system": "aircraft-handling",
|
||||||
|
"exitCode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "P07",
|
||||||
|
"document": "CarrierCatapults",
|
||||||
|
"title": "弹射器",
|
||||||
|
"system": "aircraft-handling",
|
||||||
|
"exitCode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "P08",
|
||||||
|
"document": "CarrierArrestorWires",
|
||||||
|
"title": "拦阻索",
|
||||||
|
"system": "aircraft-handling",
|
||||||
|
"exitCode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "P09",
|
||||||
|
"document": "CarrierRadar",
|
||||||
|
"title": "相控阵雷达",
|
||||||
|
"system": "sensors",
|
||||||
|
"exitCode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "P10",
|
||||||
|
"document": "CarrierCiws",
|
||||||
|
"title": "近防炮",
|
||||||
|
"system": "weapons",
|
||||||
|
"exitCode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "P11",
|
||||||
|
"document": "CarrierFighterA",
|
||||||
|
"title": "舰载战斗机 A",
|
||||||
|
"system": "air-fighter",
|
||||||
|
"exitCode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "P12",
|
||||||
|
"document": "CarrierFighterB",
|
||||||
|
"title": "舰载战斗机 B",
|
||||||
|
"system": "air-fighter",
|
||||||
|
"exitCode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "P13",
|
||||||
|
"document": "CarrierFighterC",
|
||||||
|
"title": "舰载战斗机 C",
|
||||||
|
"system": "air-fighter",
|
||||||
|
"exitCode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "P14",
|
||||||
|
"document": "CarrierFighterD",
|
||||||
|
"title": "舰载战斗机 D",
|
||||||
|
"system": "air-fighter",
|
||||||
|
"exitCode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "P15",
|
||||||
|
"document": "CarrierFighterE",
|
||||||
|
"title": "舰载战斗机 E",
|
||||||
|
"system": "air-fighter",
|
||||||
|
"exitCode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "P16",
|
||||||
|
"document": "CarrierFighterF",
|
||||||
|
"title": "舰载战斗机 F",
|
||||||
|
"system": "air-fighter",
|
||||||
|
"exitCode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "P17",
|
||||||
|
"document": "CarrierAwacs",
|
||||||
|
"title": "舰载预警机",
|
||||||
|
"system": "air-awacs",
|
||||||
|
"exitCode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "P18",
|
||||||
|
"document": "CarrierHelicopterA",
|
||||||
|
"title": "舰载直升机 A",
|
||||||
|
"system": "air-rotor",
|
||||||
|
"exitCode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "P19",
|
||||||
|
"document": "CarrierHelicopterB",
|
||||||
|
"title": "舰载直升机 B",
|
||||||
|
"system": "air-rotor",
|
||||||
|
"exitCode": 0
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "P20",
|
||||||
|
"document": "CarrierMarkings",
|
||||||
|
"title": "甲板标线",
|
||||||
|
"system": "markings",
|
||||||
|
"exitCode": 0
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"finishedAt": "2026-11-25T08:07:13.434Z",
|
||||||
|
"passed": 17,
|
||||||
|
"failed": 1,
|
||||||
|
"blocked": 0,
|
||||||
|
"skipped": 0,
|
||||||
|
"seconds": 7423
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/part/v1",
|
||||||
|
"part": {
|
||||||
|
"id": "P03",
|
||||||
|
"document": "CarrierAngledDeck",
|
||||||
|
"title": "斜角甲板",
|
||||||
|
"system": "angled-deck",
|
||||||
|
"systemLabel": "斜角甲板",
|
||||||
|
"featureTypes": [
|
||||||
|
"Pad"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"steps": 2,
|
||||||
|
"stepsTotal": 2,
|
||||||
|
"failed": 0,
|
||||||
|
"volume": 6912,
|
||||||
|
"expectedVolume": 6912.000000095107,
|
||||||
|
"relativeError": 1.3759660077805011e-11,
|
||||||
|
"volumeMatches": true,
|
||||||
|
"seconds": 108.13,
|
||||||
|
"pageErrors": [],
|
||||||
|
"stillsDir": "web/tools/carrier-partdesign-course/ui-stills/P03",
|
||||||
|
"driverExitCode": 0,
|
||||||
|
"verdict": "pass",
|
||||||
|
"finishedAt": "2026-11-25T06:05:20.430Z"
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/part/v1",
|
||||||
|
"part": {
|
||||||
|
"id": "P04",
|
||||||
|
"document": "CarrierIsland",
|
||||||
|
"title": "舰岛",
|
||||||
|
"system": "island",
|
||||||
|
"systemLabel": "舰岛上层建筑",
|
||||||
|
"featureTypes": [
|
||||||
|
"Pad",
|
||||||
|
"Chamfer"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"steps": 11,
|
||||||
|
"stepsTotal": 11,
|
||||||
|
"failed": 0,
|
||||||
|
"volume": 10658.25,
|
||||||
|
"expectedVolume": 10658.25,
|
||||||
|
"relativeError": 0,
|
||||||
|
"volumeMatches": true,
|
||||||
|
"seconds": 432.914,
|
||||||
|
"pageErrors": [],
|
||||||
|
"stillsDir": "web/tools/carrier-partdesign-course/ui-stills/P04",
|
||||||
|
"driverExitCode": 0,
|
||||||
|
"verdict": "pass",
|
||||||
|
"finishedAt": "2026-11-25T06:12:35.506Z"
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/part/v1",
|
||||||
|
"part": {
|
||||||
|
"id": "P05",
|
||||||
|
"document": "CarrierHangar",
|
||||||
|
"title": "机库",
|
||||||
|
"system": "hangar",
|
||||||
|
"systemLabel": "机库",
|
||||||
|
"featureTypes": [
|
||||||
|
"Pad",
|
||||||
|
"Pocket"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"steps": 4,
|
||||||
|
"stepsTotal": 4,
|
||||||
|
"failed": 0,
|
||||||
|
"volume": 39640,
|
||||||
|
"expectedVolume": 108800.00000000001,
|
||||||
|
"relativeError": 0.6356617647058824,
|
||||||
|
"volumeMatches": false,
|
||||||
|
"seconds": 181.019,
|
||||||
|
"pageErrors": [],
|
||||||
|
"stillsDir": "web/tools/carrier-partdesign-course/ui-stills/P05",
|
||||||
|
"driverExitCode": 0,
|
||||||
|
"verdict": "product_fail",
|
||||||
|
"finishedAt": "2026-11-25T06:15:38.620Z"
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/part/v1",
|
||||||
|
"part": {
|
||||||
|
"id": "P06",
|
||||||
|
"document": "CarrierElevators",
|
||||||
|
"title": "升降机",
|
||||||
|
"system": "aircraft-handling",
|
||||||
|
"systemLabel": "航空保障(升降机/弹射器/拦阻索)",
|
||||||
|
"featureTypes": [
|
||||||
|
"Pad"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"steps": 8,
|
||||||
|
"stepsTotal": 8,
|
||||||
|
"failed": 0,
|
||||||
|
"volume": 1008,
|
||||||
|
"expectedVolume": 1007.9999999999997,
|
||||||
|
"relativeError": 3.3835368369528593e-16,
|
||||||
|
"volumeMatches": true,
|
||||||
|
"seconds": 325.761,
|
||||||
|
"pageErrors": [],
|
||||||
|
"stillsDir": "web/tools/carrier-partdesign-course/ui-stills/P06",
|
||||||
|
"driverExitCode": 0,
|
||||||
|
"verdict": "pass",
|
||||||
|
"finishedAt": "2026-11-25T06:21:06.556Z"
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/part/v1",
|
||||||
|
"part": {
|
||||||
|
"id": "P07",
|
||||||
|
"document": "CarrierCatapults",
|
||||||
|
"title": "弹射器",
|
||||||
|
"system": "aircraft-handling",
|
||||||
|
"systemLabel": "航空保障(升降机/弹射器/拦阻索)",
|
||||||
|
"featureTypes": [
|
||||||
|
"Pad"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"steps": 8,
|
||||||
|
"stepsTotal": 8,
|
||||||
|
"failed": 0,
|
||||||
|
"volume": 346.5,
|
||||||
|
"expectedVolume": 346.5000000205559,
|
||||||
|
"relativeError": 5.932435110384563e-11,
|
||||||
|
"volumeMatches": true,
|
||||||
|
"seconds": 326.253,
|
||||||
|
"pageErrors": [],
|
||||||
|
"stillsDir": "web/tools/carrier-partdesign-course/ui-stills/P07",
|
||||||
|
"driverExitCode": 0,
|
||||||
|
"verdict": "pass",
|
||||||
|
"finishedAt": "2026-11-25T06:26:35.001Z"
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/part/v1",
|
||||||
|
"part": {
|
||||||
|
"id": "P08",
|
||||||
|
"document": "CarrierArrestorWires",
|
||||||
|
"title": "拦阻索",
|
||||||
|
"system": "aircraft-handling",
|
||||||
|
"systemLabel": "航空保障(升降机/弹射器/拦阻索)",
|
||||||
|
"featureTypes": [
|
||||||
|
"Pad"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"steps": 8,
|
||||||
|
"stepsTotal": 8,
|
||||||
|
"failed": 0,
|
||||||
|
"volume": 25.2,
|
||||||
|
"expectedVolume": 25.19999999999935,
|
||||||
|
"relativeError": 2.5799468381766208e-14,
|
||||||
|
"volumeMatches": true,
|
||||||
|
"seconds": 325.688,
|
||||||
|
"pageErrors": [],
|
||||||
|
"stillsDir": "web/tools/carrier-partdesign-course/ui-stills/P08",
|
||||||
|
"driverExitCode": 0,
|
||||||
|
"verdict": "pass",
|
||||||
|
"finishedAt": "2026-11-25T06:32:02.238Z"
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/part/v1",
|
||||||
|
"part": {
|
||||||
|
"id": "P09",
|
||||||
|
"document": "CarrierRadar",
|
||||||
|
"title": "相控阵雷达",
|
||||||
|
"system": "sensors",
|
||||||
|
"systemLabel": "雷达与传感",
|
||||||
|
"featureTypes": [
|
||||||
|
"Pad"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"steps": 6,
|
||||||
|
"stepsTotal": 6,
|
||||||
|
"failed": 0,
|
||||||
|
"volume": 69.330261,
|
||||||
|
"expectedVolume": 69.3302613828255,
|
||||||
|
"relativeError": 5.5217663541785605e-9,
|
||||||
|
"volumeMatches": true,
|
||||||
|
"seconds": 246.706,
|
||||||
|
"pageErrors": [],
|
||||||
|
"stillsDir": "web/tools/carrier-partdesign-course/ui-stills/P09",
|
||||||
|
"driverExitCode": 0,
|
||||||
|
"verdict": "pass",
|
||||||
|
"finishedAt": "2026-11-25T06:36:11.030Z"
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/part/v1",
|
||||||
|
"part": {
|
||||||
|
"id": "P10",
|
||||||
|
"document": "CarrierCiws",
|
||||||
|
"title": "近防炮",
|
||||||
|
"system": "weapons",
|
||||||
|
"systemLabel": "近防武器",
|
||||||
|
"featureTypes": [
|
||||||
|
"Pad"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"steps": 8,
|
||||||
|
"stepsTotal": 8,
|
||||||
|
"failed": 0,
|
||||||
|
"volume": 55.994815,
|
||||||
|
"expectedVolume": 55.99481508149678,
|
||||||
|
"relativeError": 1.4554343823503984e-9,
|
||||||
|
"volumeMatches": true,
|
||||||
|
"seconds": 313.836,
|
||||||
|
"pageErrors": [],
|
||||||
|
"stillsDir": "web/tools/carrier-partdesign-course/ui-stills/P10",
|
||||||
|
"driverExitCode": 0,
|
||||||
|
"verdict": "pass",
|
||||||
|
"finishedAt": "2026-11-25T06:41:26.991Z"
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/part/v1",
|
||||||
|
"part": {
|
||||||
|
"id": "P11",
|
||||||
|
"document": "CarrierFighterA",
|
||||||
|
"title": "舰载战斗机 A",
|
||||||
|
"system": "air-fighter",
|
||||||
|
"systemLabel": "舰载战斗机",
|
||||||
|
"featureTypes": [
|
||||||
|
"Revolution",
|
||||||
|
"Pad",
|
||||||
|
"Mirrored"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"steps": 13,
|
||||||
|
"stepsTotal": 13,
|
||||||
|
"failed": 0,
|
||||||
|
"volume": 82.947516,
|
||||||
|
"expectedVolume": 82.94751637748315,
|
||||||
|
"relativeError": 4.550867556488496e-9,
|
||||||
|
"volumeMatches": true,
|
||||||
|
"seconds": 508.938,
|
||||||
|
"pageErrors": [],
|
||||||
|
"stillsDir": "web/tools/carrier-partdesign-course/ui-stills/P11",
|
||||||
|
"driverExitCode": 0,
|
||||||
|
"verdict": "pass",
|
||||||
|
"finishedAt": "2026-11-25T06:49:58.160Z"
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/part/v1",
|
||||||
|
"part": {
|
||||||
|
"id": "P12",
|
||||||
|
"document": "CarrierFighterB",
|
||||||
|
"title": "舰载战斗机 B",
|
||||||
|
"system": "air-fighter",
|
||||||
|
"systemLabel": "舰载战斗机",
|
||||||
|
"featureTypes": [
|
||||||
|
"Revolution",
|
||||||
|
"Pad",
|
||||||
|
"Mirrored"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"steps": 13,
|
||||||
|
"stepsTotal": 13,
|
||||||
|
"failed": 0,
|
||||||
|
"volume": 87.540047,
|
||||||
|
"expectedVolume": 87.54004703082911,
|
||||||
|
"relativeError": 3.521715435385862e-10,
|
||||||
|
"volumeMatches": true,
|
||||||
|
"seconds": 508.778,
|
||||||
|
"pageErrors": [],
|
||||||
|
"stillsDir": "web/tools/carrier-partdesign-course/ui-stills/P12",
|
||||||
|
"driverExitCode": 0,
|
||||||
|
"verdict": "pass",
|
||||||
|
"finishedAt": "2026-11-25T06:58:28.486Z"
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/part/v1",
|
||||||
|
"part": {
|
||||||
|
"id": "P13",
|
||||||
|
"document": "CarrierFighterC",
|
||||||
|
"title": "舰载战斗机 C",
|
||||||
|
"system": "air-fighter",
|
||||||
|
"systemLabel": "舰载战斗机",
|
||||||
|
"featureTypes": [
|
||||||
|
"Revolution",
|
||||||
|
"Pad",
|
||||||
|
"Mirrored"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"steps": 13,
|
||||||
|
"stepsTotal": 13,
|
||||||
|
"failed": 0,
|
||||||
|
"volume": 74.277042,
|
||||||
|
"expectedVolume": 74.27704220951202,
|
||||||
|
"relativeError": 2.8206834507359373e-9,
|
||||||
|
"volumeMatches": true,
|
||||||
|
"seconds": 509.983,
|
||||||
|
"pageErrors": [],
|
||||||
|
"stillsDir": "web/tools/carrier-partdesign-course/ui-stills/P13",
|
||||||
|
"driverExitCode": 0,
|
||||||
|
"verdict": "pass",
|
||||||
|
"finishedAt": "2026-11-25T07:07:00.966Z"
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/part/v1",
|
||||||
|
"part": {
|
||||||
|
"id": "P14",
|
||||||
|
"document": "CarrierFighterD",
|
||||||
|
"title": "舰载战斗机 D",
|
||||||
|
"system": "air-fighter",
|
||||||
|
"systemLabel": "舰载战斗机",
|
||||||
|
"featureTypes": [
|
||||||
|
"Revolution",
|
||||||
|
"Pad",
|
||||||
|
"Mirrored"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"steps": 13,
|
||||||
|
"stepsTotal": 13,
|
||||||
|
"failed": 0,
|
||||||
|
"volume": 92.30909,
|
||||||
|
"expectedVolume": 92.30909038541574,
|
||||||
|
"relativeError": 4.175274005317612e-9,
|
||||||
|
"volumeMatches": true,
|
||||||
|
"seconds": 507.744,
|
||||||
|
"pageErrors": [],
|
||||||
|
"stillsDir": "web/tools/carrier-partdesign-course/ui-stills/P14",
|
||||||
|
"driverExitCode": 0,
|
||||||
|
"verdict": "pass",
|
||||||
|
"finishedAt": "2026-11-25T07:15:30.448Z"
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/part/v1",
|
||||||
|
"part": {
|
||||||
|
"id": "P15",
|
||||||
|
"document": "CarrierFighterE",
|
||||||
|
"title": "舰载战斗机 E",
|
||||||
|
"system": "air-fighter",
|
||||||
|
"systemLabel": "舰载战斗机",
|
||||||
|
"featureTypes": [
|
||||||
|
"Revolution",
|
||||||
|
"Pad",
|
||||||
|
"Mirrored"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"steps": 13,
|
||||||
|
"stepsTotal": 13,
|
||||||
|
"failed": 0,
|
||||||
|
"volume": 78.527737,
|
||||||
|
"expectedVolume": 78.52773673764469,
|
||||||
|
"relativeError": 3.3409254520940654e-9,
|
||||||
|
"volumeMatches": true,
|
||||||
|
"seconds": 508.898,
|
||||||
|
"pageErrors": [],
|
||||||
|
"stillsDir": "web/tools/carrier-partdesign-course/ui-stills/P15",
|
||||||
|
"driverExitCode": 0,
|
||||||
|
"verdict": "pass",
|
||||||
|
"finishedAt": "2026-11-25T07:24:00.966Z"
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/part/v1",
|
||||||
|
"part": {
|
||||||
|
"id": "P16",
|
||||||
|
"document": "CarrierFighterF",
|
||||||
|
"title": "舰载战斗机 F",
|
||||||
|
"system": "air-fighter",
|
||||||
|
"systemLabel": "舰载战斗机",
|
||||||
|
"featureTypes": [
|
||||||
|
"Revolution",
|
||||||
|
"Pad",
|
||||||
|
"Mirrored"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"steps": 13,
|
||||||
|
"stepsTotal": 13,
|
||||||
|
"failed": 0,
|
||||||
|
"volume": 85.221953,
|
||||||
|
"expectedVolume": 85.22195279514972,
|
||||||
|
"relativeError": 2.4037266692393183e-9,
|
||||||
|
"volumeMatches": true,
|
||||||
|
"seconds": 509.17,
|
||||||
|
"pageErrors": [],
|
||||||
|
"stillsDir": "web/tools/carrier-partdesign-course/ui-stills/P16",
|
||||||
|
"driverExitCode": 0,
|
||||||
|
"verdict": "pass",
|
||||||
|
"finishedAt": "2026-11-25T07:32:32.524Z"
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/part/v1",
|
||||||
|
"part": {
|
||||||
|
"id": "P17",
|
||||||
|
"document": "CarrierAwacs",
|
||||||
|
"title": "舰载预警机",
|
||||||
|
"system": "air-awacs",
|
||||||
|
"systemLabel": "舰载预警机",
|
||||||
|
"featureTypes": [
|
||||||
|
"Revolution",
|
||||||
|
"Pad",
|
||||||
|
"Mirrored"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"steps": 21,
|
||||||
|
"stepsTotal": 21,
|
||||||
|
"failed": 0,
|
||||||
|
"volume": 254.940423,
|
||||||
|
"expectedVolume": 254.9404234415037,
|
||||||
|
"relativeError": 1.7317916122645891e-9,
|
||||||
|
"volumeMatches": true,
|
||||||
|
"seconds": 792.267,
|
||||||
|
"pageErrors": [],
|
||||||
|
"stillsDir": "web/tools/carrier-partdesign-course/ui-stills/P17",
|
||||||
|
"driverExitCode": 0,
|
||||||
|
"verdict": "pass",
|
||||||
|
"finishedAt": "2026-11-25T07:45:46.464Z"
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/part/v1",
|
||||||
|
"part": {
|
||||||
|
"id": "P18",
|
||||||
|
"document": "CarrierHelicopterA",
|
||||||
|
"title": "舰载直升机 A",
|
||||||
|
"system": "air-rotor",
|
||||||
|
"systemLabel": "舰载直升机",
|
||||||
|
"featureTypes": [
|
||||||
|
"Revolution",
|
||||||
|
"Pad",
|
||||||
|
"PolarPattern"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"steps": 13,
|
||||||
|
"stepsTotal": 13,
|
||||||
|
"failed": 0,
|
||||||
|
"volume": 48.348264,
|
||||||
|
"expectedVolume": 48.34826428466978,
|
||||||
|
"relativeError": 5.887900740446139e-9,
|
||||||
|
"volumeMatches": true,
|
||||||
|
"seconds": 503.505,
|
||||||
|
"pageErrors": [],
|
||||||
|
"stillsDir": "web/tools/carrier-partdesign-course/ui-stills/P18",
|
||||||
|
"driverExitCode": 0,
|
||||||
|
"verdict": "pass",
|
||||||
|
"finishedAt": "2026-11-25T07:54:11.501Z"
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/part/v1",
|
||||||
|
"part": {
|
||||||
|
"id": "P19",
|
||||||
|
"document": "CarrierHelicopterB",
|
||||||
|
"title": "舰载直升机 B",
|
||||||
|
"system": "air-rotor",
|
||||||
|
"systemLabel": "舰载直升机",
|
||||||
|
"featureTypes": [
|
||||||
|
"Revolution",
|
||||||
|
"Pad",
|
||||||
|
"PolarPattern"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"steps": 13,
|
||||||
|
"stepsTotal": 13,
|
||||||
|
"failed": 0,
|
||||||
|
"volume": 48.398664,
|
||||||
|
"expectedVolume": 48.398664284669785,
|
||||||
|
"relativeError": 5.881769515622541e-9,
|
||||||
|
"volumeMatches": true,
|
||||||
|
"seconds": 503.216,
|
||||||
|
"pageErrors": [],
|
||||||
|
"stillsDir": "web/tools/carrier-partdesign-course/ui-stills/P19",
|
||||||
|
"driverExitCode": 0,
|
||||||
|
"verdict": "pass",
|
||||||
|
"finishedAt": "2026-11-25T08:02:36.318Z"
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/part/v1",
|
||||||
|
"part": {
|
||||||
|
"id": "P20",
|
||||||
|
"document": "CarrierMarkings",
|
||||||
|
"title": "甲板标线",
|
||||||
|
"system": "markings",
|
||||||
|
"systemLabel": "甲板标线",
|
||||||
|
"featureTypes": [
|
||||||
|
"Pad"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"steps": 6,
|
||||||
|
"stepsTotal": 6,
|
||||||
|
"failed": 0,
|
||||||
|
"volume": 25.9596,
|
||||||
|
"expectedVolume": 25.959599999997394,
|
||||||
|
"relativeError": 1.0031507136323475e-13,
|
||||||
|
"volumeMatches": true,
|
||||||
|
"seconds": 275.372,
|
||||||
|
"pageErrors": [],
|
||||||
|
"stillsDir": "web/tools/carrier-partdesign-course/ui-stills/P20",
|
||||||
|
"driverExitCode": 0,
|
||||||
|
"verdict": "pass",
|
||||||
|
"finishedAt": "2026-11-25T08:07:13.426Z"
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/part/v1",
|
||||||
|
"part": {
|
||||||
|
"id": "P05",
|
||||||
|
"document": "CarrierHangar",
|
||||||
|
"title": "机库",
|
||||||
|
"system": "hangar",
|
||||||
|
"systemLabel": "机库",
|
||||||
|
"featureTypes": [
|
||||||
|
"Pad",
|
||||||
|
"Pocket"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"steps": 4,
|
||||||
|
"stepsTotal": 4,
|
||||||
|
"failed": 0,
|
||||||
|
"volume": 39640,
|
||||||
|
"expectedVolume": 39639.999999999985,
|
||||||
|
"relativeError": 3.6710179688110136e-16,
|
||||||
|
"volumeMatches": true,
|
||||||
|
"seconds": 181.336,
|
||||||
|
"pageErrors": [],
|
||||||
|
"stillsDir": "web/tools/carrier-partdesign-course/ui-stills/P05",
|
||||||
|
"driverExitCode": 0,
|
||||||
|
"verdict": "pass",
|
||||||
|
"finishedAt": "2026-11-25T09:52:40.008Z"
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/assembly/v1",
|
||||||
|
"document": "CarrierAssembly",
|
||||||
|
"label": "航空母舰",
|
||||||
|
"expected": {
|
||||||
|
"inserts": 20,
|
||||||
|
"joints": 19,
|
||||||
|
"solves": 2
|
||||||
|
},
|
||||||
|
"inserted": 20,
|
||||||
|
"joints": 19,
|
||||||
|
"components": 20,
|
||||||
|
"malformedComponents": 0,
|
||||||
|
"mismatches": [
|
||||||
|
"OPFS 未存储装配清单 CarrierAssembly.assembly.json"
|
||||||
|
],
|
||||||
|
"fatal": "TimeoutError: locator.click: Timeout 30000ms exceeded.\nCall log:\n\u001b[2m - waiting for locator('section[aria-label=\"Bill of materials task\"]').getByRole('button', { name: 'Save FCStd', exact: true }).first()\u001b[22m\n\u001b[2m - locator resolved to <button disabled>Save FCStd</button>\u001b[22m\n\u001b[2m - attempting click action\u001b[22m\n\u001b[2m 2 × waiting for element to be visible, enabled and stable\u001b[22m\n\u001b[2m - element is not enabled\u001b[22m\n\u001b[2m - retrying click action\u001b[22m\n\u001b[2m - waiting 20ms\u001b[22m\n\u001b[2m 2 × waiting for element to be visible, enabled and stable\u001b[22m\n\u001b[2m - element is not enabled\u001b[22m\n\u001b[2m - retrying click action\u001b[22m\n\u001b[2m - waiting 100ms\u001b[22m\n\u001b[2m 58 × waiting for element to be visible, enabled and stable\u001b[22m\n\u001b[2m - element is not enabled\u001b[22m\n\u001b[2m - r",
|
||||||
|
"seconds": 90,
|
||||||
|
"engineExitCode": 1,
|
||||||
|
"engineReport": "web/tools/carrier-partdesign-course/out/ui-run/CarrierAssembly-assembly.json",
|
||||||
|
"verdict": "product_fail",
|
||||||
|
"finishedAt": "2026-11-25T09:59:37.258Z"
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/assembly/v1",
|
||||||
|
"document": "CarrierAssembly",
|
||||||
|
"label": "航空母舰",
|
||||||
|
"expected": {
|
||||||
|
"inserts": 20,
|
||||||
|
"joints": 19,
|
||||||
|
"solves": 2
|
||||||
|
},
|
||||||
|
"inserted": 20,
|
||||||
|
"joints": 19,
|
||||||
|
"components": 20,
|
||||||
|
"malformedComponents": 0,
|
||||||
|
"mismatches": [],
|
||||||
|
"fatal": null,
|
||||||
|
"seconds": 67,
|
||||||
|
"engineExitCode": 0,
|
||||||
|
"engineReport": "web/tools/carrier-partdesign-course/out/ui-run/CarrierAssembly-assembly.json",
|
||||||
|
"verdict": "pass",
|
||||||
|
"finishedAt": "2026-11-25T10:06:49.237Z"
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/carrier-toolkit/part/v1",
|
||||||
|
"part": {
|
||||||
|
"id": "P06",
|
||||||
|
"document": "CarrierElevators",
|
||||||
|
"title": "升降机",
|
||||||
|
"system": "aircraft-handling",
|
||||||
|
"systemLabel": "航空保障(升降机/弹射器/拦阻索)",
|
||||||
|
"featureTypes": [
|
||||||
|
"Pad"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"steps": 8,
|
||||||
|
"stepsTotal": 8,
|
||||||
|
"failed": 0,
|
||||||
|
"volume": 1008,
|
||||||
|
"expectedVolume": 1007.9999999999997,
|
||||||
|
"relativeError": 3.3835368369528593e-16,
|
||||||
|
"volumeMatches": true,
|
||||||
|
"seconds": 325.814,
|
||||||
|
"pageErrors": [],
|
||||||
|
"stillsDir": "web/tools/carrier-partdesign-course/ui-stills/P06",
|
||||||
|
"driverExitCode": 0,
|
||||||
|
"verdict": "pass",
|
||||||
|
"finishedAt": "2026-11-25T10:16:35.541Z"
|
||||||
|
}
|
||||||
319
docs/current/tools-manual/index.html
Normal file
3184
docs/current/ui-design/data/doc-check-last-run.json
Normal file
3184
docs/current/ui-design/data/doc-check.json
Normal file
2347
docs/current/ui-design/data/gap-register.json
Normal file
46
docs/current/ui-design/data/workbench-overrides.json
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
{
|
||||||
|
"schema": "freecad-web/ui-workbench-overrides/v1",
|
||||||
|
"note": "Workbench ids differ between the select control, the GUI manifest and the web module registry. This file is the single authority for which workbench a chapter describes and whether it renders in the main shell.",
|
||||||
|
"statusValues": {
|
||||||
|
"renders": "可在主外壳中切换并渲染",
|
||||||
|
"fallback": "可选中但内容回退到另一工作台",
|
||||||
|
"unreachable": "主外壳内无法到达",
|
||||||
|
"conditional": "需要前置条件(如已打开原生文档)",
|
||||||
|
"manifest-only": "只存在于桌面 GUI 清单,Web 端不提供"
|
||||||
|
},
|
||||||
|
"workbenches": [
|
||||||
|
{ "id": "Part", "status": "renders", "title": "Part 零件", "summary": "基础实体、布尔运算、导入导出与形状修复。" },
|
||||||
|
{ "id": "Sketcher", "status": "renders", "title": "Sketcher 草图", "summary": "二维几何与约束求解,是特征建模的输入。" },
|
||||||
|
{ "id": "PartDesign", "status": "renders", "title": "PartDesign 零件设计", "summary": "Body 内的草图特征链:拉伸、切除、旋转、齿轮与修饰。" },
|
||||||
|
{ "id": "Spreadsheet", "status": "renders", "title": "Spreadsheet 电子表格", "summary": "参数表与表达式,驱动其他对象属性。" },
|
||||||
|
{ "id": "Surface", "status": "renders", "title": "Surface 曲面", "summary": "填充、拉伸、混合曲面与曲面延伸。" },
|
||||||
|
{ "id": "Assembly", "status": "renders", "title": "Assembly 装配", "summary": "装配对象、插入链接、关节、求解、BOM 与爆炸视图。" },
|
||||||
|
{ "id": "Draft", "status": "renders", "title": "Draft 草图与制图工具", "summary": "线、面、阵列、文字与风格设置。" },
|
||||||
|
{ "id": "Architecture", "status": "fallback", "fallbackTo": "Part", "title": "Architecture 建筑(回退)", "summary": "选择后工具栏回退到 Part;建筑功能实际由 BIM 工作台提供。" },
|
||||||
|
{ "id": "BIM", "status": "renders", "title": "BIM 建筑信息模型", "summary": "墙体、楼层、门窗、IFC 读写与工程量。" },
|
||||||
|
{ "id": "CAM", "status": "renders", "title": "CAM 加工", "summary": "作业、刀具、刀路策略、3D 仿真与后处理。" },
|
||||||
|
{ "id": "Cloud", "status": "renders", "title": "Cloud 云端", "summary": "云端文档与协作入口。" },
|
||||||
|
{ "id": "Fem", "status": "renders", "title": "Fem 有限元", "summary": "材料、边界条件、网格与求解器。" },
|
||||||
|
{ "id": "Help", "status": "renders", "title": "Help 帮助", "summary": "在线帮助下载与帮助偏好。" },
|
||||||
|
{ "id": "Import", "status": "renders", "title": "Import 导入", "summary": "多格式导入导出(STEP、IGES、STL、OBJ 等)。" },
|
||||||
|
{ "id": "Inspection", "status": "renders", "title": "Inspection 检测", "summary": "尺寸检测与可视化检查。" },
|
||||||
|
{ "id": "JtReader", "status": "renders", "title": "JtReader JT 读取", "summary": "JT 格式读取。" },
|
||||||
|
{ "id": "Material", "status": "renders", "title": "Material 材料", "summary": "材料库、外观与材料指定。" },
|
||||||
|
{ "id": "Measure", "status": "renders", "title": "Measure 测量", "summary": "距离、角度、质量属性。" },
|
||||||
|
{ "id": "Mesh", "status": "renders", "title": "Mesh 网格", "summary": "网格导入、修复、布尔与抽稀。" },
|
||||||
|
{ "id": "MeshPart", "status": "renders", "title": "MeshPart 网格零件", "summary": "网格转形状、截面与曲线投影。" },
|
||||||
|
{ "id": "Points", "status": "renders", "title": "Points 点云", "summary": "点云导入、合并与重采样。" },
|
||||||
|
{ "id": "ReverseEngineering", "status": "renders", "title": "ReverseEngineering 逆向", "summary": "网格分割与曲面拟合。" },
|
||||||
|
{ "id": "Robot", "status": "renders", "title": "Robot 机器人", "summary": "机器人模型、轨迹与仿真。" },
|
||||||
|
{ "id": "Sandbox", "status": "renders", "title": "Sandbox 沙箱", "summary": "实验性工具与示例部件。" },
|
||||||
|
{ "id": "Start", "status": "renders", "title": "Start 起始页", "summary": "启动面板:新建、最近文件与参考模型。" },
|
||||||
|
{ "id": "TechDraw", "status": "renders", "title": "TechDraw 工程图", "summary": "投影视图、剖视、标注、符号与图框。" },
|
||||||
|
{ "id": "Test", "status": "renders", "title": "Test 测试", "summary": "框架自检与界面示例命令。" },
|
||||||
|
{ "id": "Tux", "status": "renders", "title": "Tux 示例", "summary": "示例模块。" },
|
||||||
|
{ "id": "TemplatePyMod", "status": "conditional", "title": "TemplatePyMod 模板模块", "summary": "需要先存在原生文档才可选;提供 Python 模块模板示例。" },
|
||||||
|
{ "id": "Plot", "status": "unreachable", "reason": "不在主外壳的工作台下拉中;仅能通过「Open Plot session」按钮进入,且会以 window.location.assign 跳出外壳。", "title": "Plot 绘图(外部会话)", "summary": "二维绘图会话,落在独立页面。" },
|
||||||
|
{ "id": "Show", "status": "unreachable", "reason": "不在主外壳的工作台下拉中,没有进入入口。", "title": "Show 显示(不可达)", "summary": "剖切与显示控制。" },
|
||||||
|
{ "id": "Web", "status": "unreachable", "reason": "不在主外壳的工作台下拉中,没有进入入口。", "title": "Web 工具(不可达)", "summary": "文档结构、宏调试、选择过滤等 Web 化工具。" },
|
||||||
|
{ "id": "OpenSCAD", "status": "manifest-only", "reason": "仅存在于桌面 GUI 清单;Web 端整体不实现。", "title": "OpenSCAD(不实现)", "summary": "Web 端不提供该工作台。" }
|
||||||
|
]
|
||||||
|
}
|
||||||
579
docs/current/ui-design/source.html
Normal file
@@ -0,0 +1,579 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html lang="zh-CN">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<title>FreeCAD 1.2 Web · UI 布局与功能设计文档</title>
|
||||||
|
<style>
|
||||||
|
:root{
|
||||||
|
--bg:#0d1319;--panel:#151d25;--panel2:#1b252f;--line:#2a3742;--text:#e7edf3;--muted:#93a7b4;
|
||||||
|
--accent:#4fb3c8;--ok:#7fdc9f;--warn:#f2c46d;--bad:#ff9e9e;
|
||||||
|
--mono:ui-monospace,SFMono-Regular,"SF Mono",Menlo,Consolas,monospace;
|
||||||
|
}
|
||||||
|
*{box-sizing:border-box}
|
||||||
|
html{scroll-behavior:smooth}
|
||||||
|
body{margin:0;background:var(--bg);color:var(--text);font:16px/1.75 -apple-system,"Segoe UI","Noto Sans SC",system-ui,sans-serif}
|
||||||
|
header.top{position:sticky;top:0;z-index:20;background:rgba(13,19,25,.96);backdrop-filter:blur(8px);border-bottom:1px solid var(--line)}
|
||||||
|
.bar{max-width:1200px;margin:0 auto;padding:12px 22px;display:flex;align-items:center;gap:14px;flex-wrap:wrap}
|
||||||
|
.brand{background:var(--accent);color:#071219;font-weight:800;border-radius:6px;padding:5px 9px;text-decoration:none;font-size:14px}
|
||||||
|
.bar h1{font-size:16.5px;margin:0;font-weight:600}
|
||||||
|
.bar .ver{margin-left:auto;color:var(--muted);font-size:13px}
|
||||||
|
.wrap{max-width:1200px;margin:0 auto;padding:26px 22px 90px;display:grid;grid-template-columns:220px minmax(0,1fr);gap:34px}
|
||||||
|
nav.toc{position:sticky;top:74px;align-self:start;font-size:13.5px;max-height:calc(100vh - 100px);overflow:auto}
|
||||||
|
nav.toc strong{display:block;color:var(--muted);font-size:11.5px;letter-spacing:.08em;text-transform:uppercase;margin:0 0 8px}
|
||||||
|
nav.toc a{display:block;color:#a9bcc8;text-decoration:none;padding:5px 10px;border-left:2px solid transparent;border-radius:0 6px 6px 0}
|
||||||
|
nav.toc a:hover{color:var(--accent);background:#121b23}
|
||||||
|
nav.toc a.sub{padding-left:22px;font-size:12.5px;color:#8ea3b0}
|
||||||
|
main{min-width:0}
|
||||||
|
h2{font-size:26px;margin:56px 0 10px;padding-top:6px;border-top:1px solid var(--line)}
|
||||||
|
h2:first-of-type{border-top:0;margin-top:0}
|
||||||
|
h3{font-size:19px;margin:30px 0 8px;color:#cfe0ea}
|
||||||
|
h4{font-size:15.5px;margin:22px 0 6px;color:#b9cbd7}
|
||||||
|
p{color:#cfdae2}
|
||||||
|
.lead{font-size:18px;color:#b9cbd7}
|
||||||
|
.muted{color:var(--muted)}
|
||||||
|
.card{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:16px 20px;margin:16px 0}
|
||||||
|
.note{background:#132029;border-left:3px solid var(--accent);padding:10px 14px;border-radius:0 8px 8px 0;color:#c3d4de;font-size:14.5px}
|
||||||
|
.warnbox{background:#241f14;border-left:3px solid var(--warn);padding:10px 14px;border-radius:0 8px 8px 0;color:#e8dcc0;font-size:14.5px}
|
||||||
|
.grid{display:grid;gap:14px}
|
||||||
|
.grid.two{grid-template-columns:repeat(auto-fit,minmax(280px,1fr))}
|
||||||
|
.grid.three{grid-template-columns:repeat(auto-fit,minmax(190px,1fr))}
|
||||||
|
.stat{background:var(--panel2);border:1px solid var(--line);border-radius:10px;padding:13px 15px}
|
||||||
|
.stat b{display:block;font-size:24px;line-height:1.15;color:var(--accent);font-variant-numeric:tabular-nums}
|
||||||
|
.stat span{font-size:12.5px;color:var(--muted)}
|
||||||
|
code,kbd{font-family:var(--mono);font-size:13.5px;background:#0a1016;border:1px solid var(--line);border-radius:4px;padding:1px 5px;overflow-wrap:anywhere}
|
||||||
|
kbd{border-bottom-width:2px;padding:1px 6px}
|
||||||
|
pre{background:#0a1016;border:1px solid var(--line);border-radius:10px;padding:13px 15px;overflow:auto;font-size:12.8px;line-height:1.6}
|
||||||
|
pre code{background:none;border:0;padding:0}
|
||||||
|
table{border-collapse:collapse;width:100%;font-size:14px;margin:14px 0}
|
||||||
|
.table-scroll{overflow-x:auto;border:1px solid var(--line);border-radius:10px}
|
||||||
|
th,td{border-bottom:1px solid var(--line);padding:8px 11px;text-align:left;vertical-align:top}
|
||||||
|
tbody tr:last-child td{border-bottom:0}
|
||||||
|
th{color:#9cb6c2;font-size:12px;letter-spacing:.04em;text-transform:uppercase;background:#121b23;position:sticky;top:0}
|
||||||
|
td.num{font-family:var(--mono);font-size:12.8px;white-space:nowrap}
|
||||||
|
.ok{color:var(--ok)}.bad{color:var(--bad)}.warn{color:var(--warn)}
|
||||||
|
figure{margin:20px 0}
|
||||||
|
figure img{width:100%;border-radius:10px;border:1px solid var(--line);display:block;background:#0a1016}
|
||||||
|
figcaption{font-size:13px;color:var(--muted);margin-top:8px}
|
||||||
|
/* ---- wireframe ---- */
|
||||||
|
.wire{border:1px solid var(--line);border-radius:10px;overflow:hidden;background:#0a1016;font-size:11.5px}
|
||||||
|
.wire .row{display:flex;border-bottom:1px solid var(--line)}
|
||||||
|
.wire .row:last-child{border-bottom:0}
|
||||||
|
.wire .cell{padding:8px 10px;border-right:1px solid var(--line);color:#b9cbd7;display:flex;align-items:center;gap:6px;flex-wrap:wrap}
|
||||||
|
.wire .cell:last-child{border-right:0}
|
||||||
|
.wire .cell b{color:var(--accent);font-family:var(--mono);font-size:11px;font-weight:600;margin-right:4px}
|
||||||
|
.wire .grow{flex:1;min-width:0}
|
||||||
|
.wire .tall{min-height:120px;align-items:flex-start}
|
||||||
|
.wire .mono{font-family:var(--mono);font-size:10.5px;color:#7f95a3}
|
||||||
|
.badge{display:inline-block;font-family:var(--mono);font-size:10.5px;background:#1d2b36;border:1px solid #2f4350;color:#8fb8c9;border-radius:999px;padding:1px 8px;margin-left:6px;vertical-align:1px}
|
||||||
|
.anchor{scroll-margin-top:80px}
|
||||||
|
@media(max-width:900px){
|
||||||
|
.wrap{grid-template-columns:1fr;gap:18px}
|
||||||
|
nav.toc{position:static;max-height:none;border:1px solid var(--line);border-radius:10px;padding:10px 6px}
|
||||||
|
nav.toc a{display:inline-block;border-left:0;padding:4px 8px}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<header class="top">
|
||||||
|
<div class="bar">
|
||||||
|
<a class="brand" href="#top">FC</a>
|
||||||
|
<h1>FreeCAD 1.2 Web · UI 布局与功能设计文档</h1>
|
||||||
|
<span class="ver">2026-11-20 · 依据当前源码与实测界面</span>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
|
||||||
|
<div class="wrap" id="top">
|
||||||
|
<nav class="toc">
|
||||||
|
<strong>目录</strong>
|
||||||
|
<a href="#s1">1 · 概览</a>
|
||||||
|
<a href="#s2">2 · 全局布局</a>
|
||||||
|
<a class="sub" href="#s2-1">2.1 实测界面</a>
|
||||||
|
<a class="sub" href="#s2-2">2.2 区域线框</a>
|
||||||
|
<a class="sub" href="#s2-3">2.3 布局机制</a>
|
||||||
|
<a href="#s3">3 · 区域详解</a>
|
||||||
|
<a href="#s4">4 · 工作台系统</a>
|
||||||
|
<a href="#s5">5 · 面板与对话框</a>
|
||||||
|
<a href="#s6">6 · 视口交互</a>
|
||||||
|
<a href="#s7">7 · 文件与 OPFS</a>
|
||||||
|
<a href="#s8">8 · 键盘与可访问性</a>
|
||||||
|
<a href="#s9">9 · 响应式</a>
|
||||||
|
<a href="#s10">10 · 与桌面的差异</a>
|
||||||
|
<a href="#s11">11 · 附录:选择器速查</a>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<main>
|
||||||
|
|
||||||
|
<!-- ============================ 1 ============================ -->
|
||||||
|
<h2 id="s1" class="anchor">1 · 概览</h2>
|
||||||
|
<p class="lead">FreeCAD 1.2 Web 是把桌面 FreeCAD 的几何内核(OCCT)与 Python 解释器编译为 WebAssembly 后,运行在浏览器里的完整 CAD 应用。本文档描述它的界面结构、各区域职责、交互方式与功能边界。</p>
|
||||||
|
|
||||||
|
<div class="grid three" style="margin:18px 0">
|
||||||
|
<div class="stat"><b>31</b><span>可切换工作台(模块)</span></div>
|
||||||
|
<div class="stat"><b>302</b><span>模块命令</span></div>
|
||||||
|
<div class="stat"><b>13,091</b><span>Python API 条目</span></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3>两个应用入口</h3>
|
||||||
|
<div class="table-scroll"><table>
|
||||||
|
<thead><tr><th>页面</th><th>加载的组件</th><th>作用</th></tr></thead>
|
||||||
|
<tbody>
|
||||||
|
<tr><td class="num">web/index.html</td><td class="num">src/project-shell.tsx</td><td>主应用:标题栏、菜单、工具栏、树、属性、视口、状态栏</td></tr>
|
||||||
|
<tr><td class="num">web/workbench.html</td><td class="num">src/workbench-shell.tsx</td><td>统一工作台子应用,被主应用以 iframe 嵌入任务框架</td></tr>
|
||||||
|
<tr><td class="num">web/shell-preview.html</td><td class="num">src/shell/shell-preview.tsx</td><td>外壳演示页,不是正式应用</td></tr>
|
||||||
|
</tbody></table></div>
|
||||||
|
|
||||||
|
<div class="note"><strong>技术栈:</strong>React + TypeScript 负责界面;three.js 负责视口显示;Emscripten 编译的 WASM 探针按模块拆分,经 Web Worker 加载;几何与文档数据全部留在浏览器本地(OPFS)。页面需要 <code>Cross-Origin-Opener-Policy: same-origin</code> 与 <code>Cross-Origin-Embedder-Policy: require-corp</code> 才能启用 WASM 线程池。</div>
|
||||||
|
|
||||||
|
<!-- ============================ 2 ============================ -->
|
||||||
|
<h2 id="s2" class="anchor">2 · 全局布局</h2>
|
||||||
|
|
||||||
|
<h3 id="s2-1" class="anchor">2.1 实测界面</h3>
|
||||||
|
<p>下面是 1600×1000 视口下的真实界面(Start 工作台)。所有区域都在一屏内:</p>
|
||||||
|
|
||||||
|
<figure>
|
||||||
|
<img id="shot-desktop" src="./web-freecad-ui-assets/ui-desktop-1600.png" alt="FreeCAD 1.2 Web 主界面截图:顶部为视图页签与工作台页签,其下是品牌栏、菜单栏、工具栏区,左侧 Objects 树,中间 Properties 面板,右侧主工作区与 3D 视口。" />
|
||||||
|
<figcaption>主界面(1600×1000)。从左到右:Objects 树 · PROPERTIES 面板 · 主工作区;顶部自上而下:视图页签与工作台页签 · 品牌栏 · 菜单栏 · 工具栏区。</figcaption>
|
||||||
|
</figure>
|
||||||
|
|
||||||
|
<div class="grid two">
|
||||||
|
<div class="card">
|
||||||
|
<h4 style="margin-top:0">纵向结构(自上而下)</h4>
|
||||||
|
<ol style="margin:0;padding-left:20px;color:#cfdae2">
|
||||||
|
<li><strong>视图页签 + 工作台页签</strong>:<code>3D 视图 / 文档 / 主链 / 工程 / 全线 / 工作台 / Python</code> 之后再接各工作台名(Assembly、BIM、CAM …)</li>
|
||||||
|
<li><strong>品牌栏</strong>:FC 徽标、产品名、右侧当前文档名</li>
|
||||||
|
<li><strong>菜单栏</strong>:Start ▸ File ▸ Edit ▸ View ▸ Tools ▸ Windows ▸ Help ▸(随工作台变化的最后一个菜单)</li>
|
||||||
|
<li><strong>工具栏区</strong>:工具栏可见性/排列 → 工作台选择与命令按钮 → 视图导航控件</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
<div class="card">
|
||||||
|
<h4 style="margin-top:0">横向结构(自左而右)</h4>
|
||||||
|
<ol style="margin:0;padding-left:20px;color:#cfdae2">
|
||||||
|
<li><strong>Objects 树</strong>(默认 240 px,可拖 180–420)</li>
|
||||||
|
<li><strong>PROPERTIES 面板</strong>(默认 300 px,可拖 180–420),其中上半是属性、下半是 Tasks</li>
|
||||||
|
<li><strong>主工作区</strong>:文档标题 → 视图工具 → 3D 视口 → 文档页签条(在底部)</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3 id="s2-2" class="anchor">2.2 区域线框</h3>
|
||||||
|
<p>下表是渲染顺序与区域编号(编号贯穿全文):</p>
|
||||||
|
|
||||||
|
<div class="wire" role="img" aria-label="界面区域线框图">
|
||||||
|
<div class="row">
|
||||||
|
<div class="cell grow"><b>①</b>视图页签 / 工作台页签<span class="mono">3D 视图 · 文档 · 主链 · 工程 · 全线 · 工作台 · Python · Assembly · BIM · …</span></div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="cell grow"><b>②</b>品牌栏<span class="mono">FC · FreeCAD 1.2 Web</span><span class="grow"></span><span class="mono">当前文档名</span></div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="cell grow"><b>③</b>菜单栏<span class="mono">Start ▸ File ▸ Edit ▸ View ▸ Tools ▸ Windows ▸ Help ▸ <工作台菜单></span></div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="cell grow"><b>④a</b>工具栏可见性 / 排列<span class="mono">Toolbars · Arrange toolbars</span></div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="cell grow"><b>④b</b>顶部工具栏坞<span class="mono">Workbench ⌄ · 命令按钮组 · 视图导航控件</span></div>
|
||||||
|
</div>
|
||||||
|
<div class="row tall">
|
||||||
|
<div class="cell" style="width:22%"><b>⑤</b>Objects 树<span class="mono">240 px</span></div>
|
||||||
|
<div class="cell" style="width:26%"><b>⑥</b>Properties + Tasks<span class="mono">300 px</span></div>
|
||||||
|
<div class="cell grow"><b>⑦</b>主工作区 · 3D 视口<span class="mono">flex:1</span></div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="cell grow"><b>⑧</b>状态栏(粘底)<span class="mono">role=status</span></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<figure>
|
||||||
|
<img id="shot-mobile" src="./web-freecad-ui-assets/ui-mobile-390.png" alt="FreeCAD 1.2 Web 在 390×844 移动视口下的界面:工具栏换行堆叠,面板自上而下排列。" />
|
||||||
|
<figcaption>同一界面在 390×844 下的表现:工具栏逐行换行,三栏布局改为纵向堆叠(见第 9 节)。</figcaption>
|
||||||
|
</figure>
|
||||||
|
|
||||||
|
<h3 id="s2-3" class="anchor">2.3 布局机制</h3>
|
||||||
|
<p>纯 CSS Grid,没有引入分栏库。外壳是两层嵌套网格,第三层是工作台子应用。</p>
|
||||||
|
|
||||||
|
<h4>外层:工具栏工作区</h4>
|
||||||
|
<pre><code>/* persistent-toolbar-workspace.tsx:132 */
|
||||||
|
.toolbar-workspace{
|
||||||
|
display:grid;
|
||||||
|
grid-template-columns: auto minmax(0,1fr) auto;
|
||||||
|
grid-template-rows: auto auto minmax(0,1fr) auto;
|
||||||
|
}
|
||||||
|
/* 第 1 行:可见性/排列;第 2 行:顶部坞(跨全部列)
|
||||||
|
第 3 行:左坞 | 内容 | 右坞;第 4 行:底部坞(跨全部列) */</code></pre>
|
||||||
|
|
||||||
|
<h4>内层:三栏工作区</h4>
|
||||||
|
<pre><code>/* project-shell.tsx:1785 */
|
||||||
|
.layout{
|
||||||
|
display:grid;
|
||||||
|
grid-template-columns: var(--tree-width) 5px var(--property-width) 5px minmax(0,1fr);
|
||||||
|
}
|
||||||
|
/* 列:树 | 分隔条 | 属性 | 分隔条 | 主工作区
|
||||||
|
--tree-width 默认 240px,--property-width 默认 300px */</code></pre>
|
||||||
|
|
||||||
|
<div class="card">
|
||||||
|
<p style="margin:0"><strong>分隔条</strong>是手写的 <code><div role="separator"></code>:鼠标拖动改宽度,键盘 <kbd>←</kbd>/<kbd>→</kbd> 每次 20 px,<kbd>Home</kbd> 收到 180 px,<kbd>End</kbd> 撑到 420 px。宽度保存在组件状态里。</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h4>子应用:统一工作台</h4>
|
||||||
|
<pre><code>/* workbench-shell.tsx:397 */
|
||||||
|
.layout{ display:grid; grid-template-columns:260px 340px minmax(0,1fr); }
|
||||||
|
/* 模块列表 | 命令列表 | 舞台 */</code></pre>
|
||||||
|
|
||||||
|
<!-- ============================ 3 ============================ -->
|
||||||
|
<h2 id="s3" class="anchor">3 · 区域详解</h2>
|
||||||
|
|
||||||
|
<div class="table-scroll"><table>
|
||||||
|
<thead><tr><th>#</th><th>区域</th><th>默认尺寸 / 行为</th><th>主要内容</th></tr></thead>
|
||||||
|
<tbody>
|
||||||
|
<tr><td>①</td><td>页签条</td><td>整行,可横向滚动</td><td>视图页签与工作台页签;点击切换当前工作台,影响 ③ 的末项菜单与 ④b 的命令按钮</td></tr>
|
||||||
|
<tr><td>②</td><td>品牌栏</td><td>约 56 px,flex 可换行</td><td>FC 徽标、产品名、当前文档名(右对齐)</td></tr>
|
||||||
|
<tr><td>③</td><td>菜单栏</td><td>约 32 px,<code>role="menubar"</code></td><td>Start、File、Edit、View、Tools、Macro、Windows、Help 下拉;下拉面板绝对定位、最小宽 230 px</td></tr>
|
||||||
|
<tr><td>④a</td><td>工具栏控制</td><td>一行</td><td>工具栏可见性菜单与「Arrange toolbars」排列模式</td></tr>
|
||||||
|
<tr><td>④b</td><td>顶部工具栏坞</td><td>最小高 30 px,自动换行</td><td>工作台下拉框 + 各工具栏(Solids / Part Tools / Boolean Tools / Spreadsheet tools / 3D display controls / Robot),按钮 30×30</td></tr>
|
||||||
|
<tr><td>⑤</td><td>Objects 树</td><td>240 px(180–420 可拖)</td><td>对象列表,三列:<em>Labels & Attributes</em> / <em>Description</em> / <em>Internal name</em>;每行有可见性复选框与类型图标;底部「New Group」</td></tr>
|
||||||
|
<tr><td>⑥</td><td>Properties + Tasks</td><td>300 px(180–420 可拖)</td><td>上半:选中对象的属性编辑器(View 组、Placement、属性行);下半:Tasks 任务区与建模工具入口</td></tr>
|
||||||
|
<tr><td>⑦</td><td>主工作区</td><td>占满剩余宽度</td><td>文档标题 → View Tools 下拉 → 3D 视口(330 px 起,可伸缩)→ 文档页签条(底部)</td></tr>
|
||||||
|
<tr><td>⑧</td><td>状态栏</td><td>粘底,最小高 22 px</td><td>单行 <code>role="status"</code>:导入阶段、错误(红色)或成功(绿色)提示</td></tr>
|
||||||
|
<tr><td>⑨</td><td>底部坞(可开)</td><td>固定浮层 180 px 高</td><td>Selection view / Report view / Python console 三个页签,可浮动、全屏、关闭</td></tr>
|
||||||
|
<tr><td>⑩</td><td>任务框架(模态)</td><td>96vw × 92vh 上限</td><td>以 iframe 打开 <code>/workbench.html?module=…&command=…</code>,承载工作台任务面板</td></tr>
|
||||||
|
</tbody></table></div>
|
||||||
|
|
||||||
|
<div class="note"><strong>文档页签在底部</strong>,不在顶部——这是与桌面 FreeCAD 的明显差异;顶部那一排是视图/工作台页签,不是文档。</div>
|
||||||
|
|
||||||
|
<!--{{SHELL_REGION_CATALOG}}-->
|
||||||
|
|
||||||
|
<!--{{WORKBENCH_SURFACE_MATRIX}}-->
|
||||||
|
|
||||||
|
<h2 id="s4" class="anchor">4 · 工作台系统</h2>
|
||||||
|
<p class="lead">工作台(Workbench)是功能的分组单位。切换工作台会更换工具栏按钮组、菜单末项,并决定任务面板里可用的建模工具。</p>
|
||||||
|
|
||||||
|
<div class="grid three" style="margin:18px 0">
|
||||||
|
<div class="stat"><b>31</b><span>Web 端模块</span></div>
|
||||||
|
<div class="stat"><b>302</b><span>模块命令</span></div>
|
||||||
|
<div class="stat"><b>403</b><span>对象类型</span></div>
|
||||||
|
<div class="stat"><b>1492</b><span>桌面命令(GUI 清单)</span></div>
|
||||||
|
<div class="stat"><b>103</b><span>已验收案例</span></div>
|
||||||
|
<div class="stat"><b>84</b><span>模块页面</span></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h3>4.1 工作台清单</h3>
|
||||||
|
<p>注册表里只有模块 id,没有显示名与图标字段——显示名就是 id,图标来自各命令的元数据。按职能分组如下:</p>
|
||||||
|
|
||||||
|
<div class="table-scroll"><table>
|
||||||
|
<thead><tr><th>组</th><th>工作台(命令数 / Python API / 对象类型)</th></tr></thead>
|
||||||
|
<tbody>
|
||||||
|
<tr><td><strong>核心建模</strong></td><td>Part(10 / 1191 / 116)· PartDesign(50 / 238 / 65)· Sketcher(6 / 141 / 10)· Surface(7 / 10 / 7)· Mesh(6 / 211 / 31)· MeshPart(4 / 13 / 0)· Points(7 / 12 / 8)· ReverseEngineering(5 / 3 / 0)</td></tr>
|
||||||
|
<tr><td><strong>数据与测量</strong></td><td>Spreadsheet(6 / 63 / 5)· Measure(7 / 31 / 11)· Material(5 / 178 / 22)</td></tr>
|
||||||
|
<tr><td><strong>装配</strong></td><td>Assembly(7 / 552 / 8)</td></tr>
|
||||||
|
<tr><td><strong>制图与 BIM</strong></td><td>Draft(4 / 2043 / 0)· BIM(32 / 2366 / 0)· TechDraw(8 / 247 / 41)</td></tr>
|
||||||
|
<tr><td><strong>仿真</strong></td><td>Fem(5 / 1305 / 53)</td></tr>
|
||||||
|
<tr><td><strong>加工</strong></td><td>CAM(77 / 2883 / 12)</td></tr>
|
||||||
|
<tr><td><strong>检测</strong></td><td>Inspection(5 / 3 / 3)· Test(1 / 0 / 0)</td></tr>
|
||||||
|
<tr><td><strong>机器人</strong></td><td>Robot(5 / 16 / 6)</td></tr>
|
||||||
|
<tr><td><strong>基础设施</strong></td><td>Import(6 / 1135 / 2)· JtReader(4 / 0 / 1)· Web(4 / 0 / 0)· Cloud(7 / 3 / 0)· Show(6 / 104 / 0)· Plot(2 / 28 / 0)· Help(2 / 14 / 0)· Start(5 / 2 / 0)· TemplatePyMod(3 / 244 / 0)· Sandbox(5 / 30 / 2)· Tux(1 / 25 / 0)</td></tr>
|
||||||
|
</tbody></table></div>
|
||||||
|
|
||||||
|
<div class="note">桌面端的 GUI 清单有 <strong>29</strong> 个工作台:比 Web 少 <code>Plot</code>、<code>Show</code>、<code>Web</code>,多一个 <code>OpenSCAD</code>。OpenSCAD 在 Web 端整体不实现,也不会出现在任何注册表或页面上。</div>
|
||||||
|
|
||||||
|
<h3>4.2 如何切换</h3>
|
||||||
|
<div class="table-scroll"><table>
|
||||||
|
<thead><tr><th>入口</th><th>位置</th><th>行为</th></tr></thead>
|
||||||
|
<tbody>
|
||||||
|
<tr><td>工作台下拉框</td><td>顶部工具栏坞,<code><select aria-label="Workbench"></code></td><td>切换后写入该文档的 <code>LastModule</code>,每个文档独立记忆</td></tr>
|
||||||
|
<tr><td>页签行</td><td>界面最顶部一行</td><td>点击工作台名直接切换(Assembly、BIM、CAM …)</td></tr>
|
||||||
|
<tr><td>统一工作台中栏</td><td><code>workbench.html</code> 左侧「模块」列表</td><td>带筛选输入框;每项显示 <code>N objects · M Python APIs</code></td></tr>
|
||||||
|
<tr><td>Start 页面</td><td>启动面板</td><td>经 <code>postMessage</code> 请求切换</td></tr>
|
||||||
|
</tbody></table></div>
|
||||||
|
|
||||||
|
<p>切换期间会显示模态对话框「Workbench switching」,完成后清空当前命令与选择。工作台切换<b>不会</b>重启 Worker——Worker 持有文档,重启会丢数据。</p>
|
||||||
|
|
||||||
|
<div class="warnbox"><strong>没有全局的工作台切换快捷键。</strong>现有全局按键只有 <kbd>Esc</kbd>(取消/关闭)与 BIM 微调组合键(<kbd>Alt</kbd>+方向键、<kbd>Alt</kbd>+<kbd>,</kbd>/<kbd>.</kbd>、<kbd>Alt</kbd>+<kbd>PageUp</kbd>/<kbd>PageDown</kbd>、<kbd>Alt</kbd>+<kbd>/</kbd>)。单条命令的加速键来自命令元数据,可在快捷键编辑器里改。</p>
|
||||||
|
|
||||||
|
<h3>4.3 工具栏如何生成</h3>
|
||||||
|
<p>三层数据,各司其职:</p>
|
||||||
|
<ol style="color:#cfdae2">
|
||||||
|
<li><strong>模块注册表</strong>(<code>module-registry.generated.ts</code>)提供每个模块的 <em>Worker 命令词汇</em>:哪些命令由哪个 Worker 执行。</li>
|
||||||
|
<li><strong>桌面 GUI 清单</strong>(<code>public/api/desktop-gui-manifest.json</code>)提供 <em>界面真相</em>:每个工作台的菜单、工具栏(名称 + 命令 id 列表)、停靠面板,以及扁平的命令元数据(菜单文字、提示、图标、加速键)。</li>
|
||||||
|
<li><strong>命令矩阵</strong>(<code>public/api/workbench-command-matrix.json</code>,1492 条)把桌面命令映射到 Web 处置:<code>native_handler</code> 196 条、<code>restricted</code> 1296 条。</li>
|
||||||
|
</ol>
|
||||||
|
<p>渲染时遍历工作台的 <code>toolbars[]</code>,每条工具栏最多取 <strong>18</strong> 个命令变成按钮(30×30 图标)。没有 Worker 绑定的命令会被过滤掉,不会出现死按钮。</p>
|
||||||
|
|
||||||
|
<h3>4.4 命令选择器</h3>
|
||||||
|
<p>命令按钮带 <code>data-help-page="<命令>"</code>(去掉 <code>Module:desktop:</code> 前缀)与 <code>data-command</code>(原始命令 id)。自动化脚本统一用这个选择器点击命令:</p>
|
||||||
|
<pre><code>button[data-help-page="Assembly_CreateBom"]</code></pre>
|
||||||
|
<div class="warnbox"><strong>工作台按钮没有 aria-label 也没有 data-*</strong>,只有 <code>button.module</code> 类名(选中项加 <code>.selected</code>)。要选工作台只能按类名加文本匹配。</div>
|
||||||
|
|
||||||
|
<!--{{WORKBENCH_CHAPTERS}}-->
|
||||||
|
|
||||||
|
<h2 id="s5" class="anchor">5 · 面板与对话框</h2>
|
||||||
|
|
||||||
|
<h3>5.1 常驻面板</h3>
|
||||||
|
|
||||||
|
<div class="table-scroll"><table>
|
||||||
|
<thead><tr><th>面板</th><th>内容</th><th>交互</th></tr></thead>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td><strong>Objects 树</strong></td>
|
||||||
|
<td>扁平对象列表(Part 图元、布尔结果、网格等),每行含可见性复选框、类型图标、错误/已修改/外部引用标记。三列对应 Qt 树控件的标签、描述与内部名。</td>
|
||||||
|
<td>单选;选中即更新属性面板与视口高亮。测量任务进行中时,点击会被导向测量选择列表,而不是改变树的选中项。</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><strong>Properties</strong></td>
|
||||||
|
<td>按对象类型分组的属性行:<br>
|
||||||
|
<em>View</em>:Label、Color(取色器)、Visibility<br>
|
||||||
|
<em>Placement</em>:Position / Euler XYZ° / Axis(只读展示)<br>
|
||||||
|
<em>Data</em>:随类型变化——<code>Part::Box</code> 为 Length/Width/Height;图元为各自字段(含 Angle1/Angle2);布尔为 Operation / Base / Tool(下拉选择对象)<br>
|
||||||
|
<em>Geometry</em>:源文件、面数/三角面数、网格统计</td>
|
||||||
|
<td>属性行按对象类型写死,没有通用的 <code>App::Property*</code> 反射;枚举用下拉、布尔用复选框、对象引用用 Link 下拉。属性名列宽可拖,宽度记在本地偏好里。</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><strong>Tasks</strong></td>
|
||||||
|
<td>当前任务的内联面板:标题「Edit <task>」、关闭/取消按钮,以及该任务自己的表单。</td>
|
||||||
|
<td>不是模态窗口,直接显示在主工作区里。</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><strong>底部坞</strong></td>
|
||||||
|
<td>三个页签:<em>Selection view</em>(当前选择)、<em>Report view</em>(消息日志)、<em>Python console</em>(解释器)。</td>
|
||||||
|
<td>可浮动、全屏、关闭;默认关闭。</td>
|
||||||
|
</tr>
|
||||||
|
</tbody></table></div>
|
||||||
|
|
||||||
|
<h3>5.2 树与选择</h3>
|
||||||
|
<ul style="color:#cfdae2">
|
||||||
|
<li>树是<strong>扁平列表</strong>,没有 Body/特征/分组层级——层级只存在于装配树里。</li>
|
||||||
|
<li>没有通用的对象右键菜单。唯一存在的是<strong>装配组件菜单</strong>:激活/停用、选择链接对象、选择该组件的关节、删除组件及依赖关节、刚性/柔性切换。</li>
|
||||||
|
<li>测量任务会临时接管选择语义:点选进入测量列表,不改树高亮。</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h3>5.3 任务对话框目录</h3>
|
||||||
|
<p>任务面板以 <code><section></code>/<code><fieldset></code> 加 <code>aria-label</code> 的形式内联渲染,数量约 120 个(每个 <code>*-task.tsx</code> 一个)。主要几类:</p>
|
||||||
|
|
||||||
|
<div class="table-scroll"><table>
|
||||||
|
<thead><tr><th>对话框</th><th>触发</th><th>关键字段</th></tr></thead>
|
||||||
|
<tbody>
|
||||||
|
<tr><td>CAM 任务 / CAM 作业偏好 / 路径显示偏好</td><td>CAM_Job 等</td><td>作业名、输出、刀具控制器、后处理器;Apply / Reset / Cancel</td></tr>
|
||||||
|
<tr><td>CAM 区域 / CAM 仿真器</td><td>CAM_Area、CAM_Simulator</td><td>源对象、工作平面、公差;仿真回放控制</td></tr>
|
||||||
|
<tr><td>草图绘制 / 草图约束 / 草图校验</td><td>进入草图编辑</td><td>几何工具选择、点合并、构造线开关、约束表(F2 重命名、Delete 删除)、元素列表框</td></tr>
|
||||||
|
<tr><td>电子表格编辑器</td><td>选中 <code>Spreadsheet::Sheet</code></td><td>单元格网格;缩放、单元格属性、剪贴板、合并拆分、行列操作、文字样式、输出显示;绑定单元格、配置表、别名显示</td></tr>
|
||||||
|
<tr><td>CSV 导入/导出</td><td>表格命令</td><td>文件名、分隔符、目标区域</td></tr>
|
||||||
|
<tr><td>Show 剖切</td><td>Show_Clipping</td><td>逐对象剖切平面开关、草图剖切</td></tr>
|
||||||
|
<tr><td>Part 导入 / 导出</td><td>Part_Import / Part_Export</td><td>导入:文件、保留颜色、目标文档;导出:文件名、格式、选择集</td></tr>
|
||||||
|
<tr><td>视图任务</td><td>Std_ViewHome / FitSelection / DrawStyle 等</td><td>归属视图、绘制样式(原样/点/线框/隐藏线/无着色/着色/平面线框)、可见/可选开关、选择过滤器、框选模式与元素类型</td></tr>
|
||||||
|
<tr><td>关于 / 命令行</td><td>Std_About 等</td><td>标题与正文、复制按钮;失败信息以 <code><pre role="alert"></code> 输出</td></tr>
|
||||||
|
<tr><td>偏好设置</td><td>Edit ▸ Preferences</td><td>单位制、导航风格、主题、显示网格;存 localStorage</td></tr>
|
||||||
|
<tr><td>命令面板</td><td>快捷键 / 菜单</td><td>按名称搜索 1492 条命令,可按当前工作台或全部过滤</td></tr>
|
||||||
|
<tr><td>任务框架</td><td>外部工作台命令</td><td>全屏覆盖层,内嵌 <code>/workbench.html?module=…&command=…</code></td></tr>
|
||||||
|
</tbody></table></div>
|
||||||
|
|
||||||
|
<div class="note"><strong>对话框模式:</strong>大多数任务面板不是模态窗口,而是内联在舞台里;只有少量确认类(缩放级别、行高列宽、单元格属性、工作台切换警告、装配组件菜单)使用真正的模态 <code><dialog></code>。</div>
|
||||||
|
|
||||||
|
<h2 id="s6" class="anchor">6 · 视口交互</h2>
|
||||||
|
|
||||||
|
<p>视口由 <code>SceneViewport</code> 实现:three.js 的 <code>WebGLRenderer</code> + 45° 透视相机 + <code>OrbitControls</code>。它只负责<strong>绘制与拾取</strong>——几何、显示模式判定与放置仍由 WASM 内核持有。</p>
|
||||||
|
|
||||||
|
<h3>6.1 导航</h3>
|
||||||
|
<div class="table-scroll"><table>
|
||||||
|
<thead><tr><th>操作</th><th>行为</th></tr></thead>
|
||||||
|
<tbody>
|
||||||
|
<tr><td>中键拖动</td><td>平移</td></tr>
|
||||||
|
<tr><td>滚轮</td><td>缩放</td></tr>
|
||||||
|
<tr><td>中键 + 左键(或右键 + <kbd>Shift</kbd>)</td><td>旋转</td></tr>
|
||||||
|
<tr><td>导航风格</td><td>支持 Blender / Revit / 触控板风格切换</td></tr>
|
||||||
|
</tbody></table></div>
|
||||||
|
|
||||||
|
<h3>6.2 视口工具条</h3>
|
||||||
|
<p>视口上方固定一条工具条(<code>aria-label="3D display controls"</code>):</p>
|
||||||
|
<div class="grid two">
|
||||||
|
<div class="card" style="margin:0">
|
||||||
|
<h4 style="margin-top:0">显示</h4>
|
||||||
|
<ul style="margin:0;padding-left:18px;color:#cfdae2">
|
||||||
|
<li>轴十字开关</li>
|
||||||
|
<li>转台演示播放 + 速度滑杆</li>
|
||||||
|
<li>重叠对象选择器(<em>选择重叠对象</em>)</li>
|
||||||
|
<li>标准视图下拉:上/下/前/后/左/右/等轴测/二轴测/三轴测</li>
|
||||||
|
<li>屏幕视图与命名视图的保存/调用</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="card" style="margin:0">
|
||||||
|
<h4 style="margin-top:0">相机与样式</h4>
|
||||||
|
<ul style="margin:0;padding-left:18px;color:#cfdae2">
|
||||||
|
<li>放大 / 缩小 / 全显</li>
|
||||||
|
<li>左转 / 右转</li>
|
||||||
|
<li>导航风格、轨道风格(当前禁用)</li>
|
||||||
|
<li>绘制样式:原样 / 点 / 线框 / 隐藏线 / 无着色 / 着色 / 平面线框</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="note"><strong>没有视图立方体(View Cube)。</strong>定向只能通过标准视图下拉与左右旋转按钮完成。</div>
|
||||||
|
|
||||||
|
<h3>6.3 选择与变换</h3>
|
||||||
|
<ul style="color:#cfdae2">
|
||||||
|
<li><strong>拾取</strong>:光线投射命中面、边、顶点与点,支持悬停反馈与重叠对象选择。</li>
|
||||||
|
<li><strong>变换手柄</strong>:three.js <code>TransformControls</code>,模式为平移 / 旋转 / 关闭;工具条(<code>aria-label="Object transform"</code>)提供移动、旋转、锁定局部坐标与坐标读数。</li>
|
||||||
|
<li><strong>回写</strong>:拖动手柄的结果会换算回内核的 <code>Placement</code>(位置数组 + 旋转),不是只改显示。</li>
|
||||||
|
<li><strong>局部坐标系编辑器</strong>:独立对话框,输入位置与欧拉角。</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<h3>6.4 剖切</h3>
|
||||||
|
<p>剖切由 <code>Show</code> 工作台提供,按文档维护一组 three.js 平面。FEM 视口与草图视图也会以局部裁剪模式打开剖切。</p>
|
||||||
|
|
||||||
|
<h3>6.5 精度与性能要点</h3>
|
||||||
|
<div class="card">
|
||||||
|
<p style="margin:0">网格化是交互延迟的最大来源,因此内核侧统一走「一次剖分、多处复用」:显示、面颜色、引用解析共享同一次剖分结果;边采样按边形状哈希缓存,挠度随包围盒对角线自适应。three.js 侧不做二次剖分,也不重新三角化——它拿到的就是内核交付的那份网格。</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h2 id="s7" class="anchor">7 · 文件与 OPFS</h2>
|
||||||
|
<p class="lead">Web 版没有本地文件系统权限,所有文档与导出都落在浏览器 OPFS(Origin Private File System)里。下载到本地必须由用户显式操作。</p>
|
||||||
|
|
||||||
|
<h3>7.1 目录契约</h3>
|
||||||
|
<p>存储根目录为 <code>freecad-1-2</code>,下面按用途分目录:</p>
|
||||||
|
|
||||||
|
<div class="table-scroll"><table>
|
||||||
|
<thead><tr><th>目录</th><th>内容</th><th>约束</th></tr></thead>
|
||||||
|
<tbody>
|
||||||
|
<tr><td class="num">freecad-documents/</td><td>文档(<code>.FCStd</code>)</td><td>只接受 <code>.FCStd</code>;写入失败会回滚</td></tr>
|
||||||
|
<tr><td class="num">freecad-exports/</td><td>导出件(STEP / IGES / BREP / STL / GLB …)</td><td>文件名必须带扩展名;导出<b>不会</b>自动下载</td></tr>
|
||||||
|
<tr><td class="num">freecad-plot-images/</td><td>绘图输出</td><td>只接受 <code>.svg</code></td></tr>
|
||||||
|
<tr><td class="num">freecad-macros/</td><td>宏</td><td>只接受 <code>.FCMacro</code> / <code>.py</code></td></tr>
|
||||||
|
<tr><td class="num">(原始 STEP 缓存)</td><td>STEP 导入的中间产物</td><td>可读/写/删/列</td></tr>
|
||||||
|
</tbody></table></div>
|
||||||
|
|
||||||
|
<h3>7.2 界面上的文件操作</h3>
|
||||||
|
<div class="table-scroll"><table>
|
||||||
|
<thead><tr><th>操作</th><th>位置</th><th>行为</th></tr></thead>
|
||||||
|
<tbody>
|
||||||
|
<tr><td>保存 FCStd 到 OPFS</td><td>Files 菜单</td><td>写 <code>freecad-documents/</code>,并广播文档持久化事件</td></tr>
|
||||||
|
<tr><td>下载 native FCStd</td><td>Files 菜单</td><td><b>唯一</b>会触发浏览器下载的文档操作</td></tr>
|
||||||
|
<tr><td>导出选中对象</td><td>Files 菜单</td><td>格式下拉(STL/STEP/IGES/BREP/glTF/glb),写入 OPFS</td></tr>
|
||||||
|
<tr><td>OPFS 导出件</td><td>Files 菜单</td><td>下拉选择 + 从 OPFS 导入 + 刷新</td></tr>
|
||||||
|
<tr><td>OPFS 文档</td><td>Files 菜单</td><td>下拉选择 + 打开 + 刷新</td></tr>
|
||||||
|
<tr><td>Part 导出的下载</td><td>Part 导出任务</td><td>导出任务生成 Blob 并触发下载</td></tr>
|
||||||
|
</tbody></table></div>
|
||||||
|
|
||||||
|
<div class="warnbox"><strong>自动下载属于缺陷。</strong>除了上述显式入口,任何代码路径都不应调用浏览器下载。历史上把导出误做成自动下载,是明确的验收缺口。</div>
|
||||||
|
|
||||||
|
<h3>7.3 内核内的临时文件</h3>
|
||||||
|
<p>WASM 内核有自己的虚拟文件系统(MEMFS)。导出流程是:内核先写 <code>/tmp/…</code>,再把字节读出来转入 OPFS。<strong>内核的 <code>/tmp</code> 与宿主机的 <code>/tmp</code> 无关</strong>,也不能作为跨步骤的数据来源——它只是暂存。</p>
|
||||||
|
|
||||||
|
<!-- ============================ 8 ============================ -->
|
||||||
|
<h2 id="s8" class="anchor">8 · 键盘与可访问性</h2>
|
||||||
|
<p>界面所有主要区域都有稳定的 <code>aria-label</code>,这既是无障碍支持,也是自动化测试选择元素的方式。</p>
|
||||||
|
|
||||||
|
<div class="table-scroll"><table>
|
||||||
|
<thead><tr><th>选择器</th><th>对应区域</th></tr></thead>
|
||||||
|
<tbody>
|
||||||
|
<tr><td class="num">aria-label="Model tree"</td><td>Objects 树</td></tr>
|
||||||
|
<tr><td class="num">aria-label="Object Properties"</td><td>属性面板</td></tr>
|
||||||
|
<tr><td class="num">aria-label="Tasks"</td><td>任务区</td></tr>
|
||||||
|
<tr><td class="num">aria-label="Status bar"</td><td>状态栏</td></tr>
|
||||||
|
<tr><td class="num">aria-label="Application menus"</td><td>菜单栏</td></tr>
|
||||||
|
<tr><td class="num">aria-label="Imported native 3D view"</td><td>3D 视口</td></tr>
|
||||||
|
<tr><td class="num">aria-label="Object transform"</td><td>视口上方的变换工具条</td></tr>
|
||||||
|
<tr><td class="num">aria-label="Placement values"</td><td>Placement 数值组</td></tr>
|
||||||
|
<tr><td class="num">aria-label="Resize tree panel / Resize properties panel / Resize property name column"</td><td>三条分隔条</td></tr>
|
||||||
|
<tr><td class="num">role="tablist" aria-label="Documents"</td><td>底部文档页签</td></tr>
|
||||||
|
<tr><td class="num">aria-label="Bottom dock" / Selection view / Report view / Python console</td><td>底部坞及其页签</td></tr>
|
||||||
|
<tr><td class="num">role="dialog" aria-label="<Module> task: <Command>"</td><td>任务框架</td></tr>
|
||||||
|
<tr><td class="num">aria-label="Top/Left/Right/Bottom toolbar dock"</td><td>四个工具栏坞</td></tr>
|
||||||
|
</tbody></table></div>
|
||||||
|
|
||||||
|
<h4>键盘</h4>
|
||||||
|
<ul style="color:#cfdae2">
|
||||||
|
<li>分隔条:<kbd>←</kbd>/<kbd>→</kbd> 步进 20 px,<kbd>Home</kbd>/<kbd>End</kbd> 到 180/420 px</li>
|
||||||
|
<li>菜单栏使用原生 <code><details></code>,可用 <kbd>Tab</kbd> 聚焦、<kbd>Enter</kbd> 展开、<kbd>Esc</kbd> 收起</li>
|
||||||
|
<li>文档页签左右各有滚动按钮,页签多时按需出现</li>
|
||||||
|
<li>命令面板与快捷键编辑器在覆盖层中提供(见第 5 节)</li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<div class="warnbox"><strong>无 toast 通知区。</strong>外壳里没有独立的通知/气泡组件:临时反馈走状态栏的 <code>role="status"</code>,进度走内联 <code><progress role="status"></code>。设计新功能时应沿用这条通道,不要另造一套提示。</div>
|
||||||
|
|
||||||
|
<!-- ============================ 9 ============================ -->
|
||||||
|
<h2 id="s9" class="anchor">9 · 响应式</h2>
|
||||||
|
|
||||||
|
<div class="table-scroll"><table>
|
||||||
|
<thead><tr><th>断点</th><th>行为</th></tr></thead>
|
||||||
|
<tbody>
|
||||||
|
<tr><td class="num">≤1100 px</td><td>三栏收窄为 <code>210px 5px 270px 5px 1fr</code>,属性分隔条重新启用</td></tr>
|
||||||
|
<tr><td class="num">≤900 px</td><td>草图任务面板取消高度上限</td></tr>
|
||||||
|
<tr><td class="num">≤800 px</td><td>布局改为纵向 flex;分隔条隐藏;各 <code>aside</code> 最高 45vh;视口高 340 px</td></tr>
|
||||||
|
<tr><td class="num">≤650 px</td><td>单列;下拉菜单改为 <code>position:fixed</code> 左右各留 12 px;页签条滚动;提示文字 10 px</td></tr>
|
||||||
|
<tr><td class="num">子应用 ≤920 / ≤720 px</td><td>三列 → 两列 → 单列,舞台最小高 55vh</td></tr>
|
||||||
|
</tbody></table></div>
|
||||||
|
|
||||||
|
<p>移动端不做抽屉或汉堡菜单,面板直接纵向堆叠;页面最小宽度 320 px。</p>
|
||||||
|
|
||||||
|
<!-- ============================ 10 ============================ -->
|
||||||
|
<h2 id="s10" class="anchor">10 · 与桌面 FreeCAD 的差异</h2>
|
||||||
|
|
||||||
|
<div class="table-scroll"><table>
|
||||||
|
<thead><tr><th>方面</th><th>桌面 FreeCAD</th><th>Web 版</th></tr></thead>
|
||||||
|
<tbody>
|
||||||
|
<tr><td>菜单</td><td>原生 Qt 菜单栏</td><td>HTML 菜单栏;末项随工作台变化</td></tr>
|
||||||
|
<tr><td>文档页签</td><td>MDI 子窗口 / 顶部页签</td><td>主工作区底部页签条</td></tr>
|
||||||
|
<tr><td>停靠面板</td><td>Qt DockWidget 可任意停靠</td><td>固定三栏 + 顶部/左/右/底四个工具栏坞</td></tr>
|
||||||
|
<tr><td>文件</td><td>本地文件系统</td><td>OPFS 为默认存储;下载到本地必须显式触发</td></tr>
|
||||||
|
<tr><td>Python</td><td>内嵌控制台,可访问完整本地环境</td><td>Python 控制台(底部坞),运行在 WASM 解释器内</td></tr>
|
||||||
|
<tr><td>OpenSCAD</td><td>有工作台</td><td>整体不实现,不在注册表中出现</td></tr>
|
||||||
|
<tr><td>GUI 相关 API</td><td>FreeCADGui 完整</td><td>由 React 视图/属性面板承接,<code>FreeCADGui</code> 桩在无 GUI 时返回 <code>None</code></td></tr>
|
||||||
|
</tbody></table></div>
|
||||||
|
|
||||||
|
<!-- ============================ 11 ============================ -->
|
||||||
|
<!--{{IMPLEMENTATION_MAPPING}}-->
|
||||||
|
|
||||||
|
<!--{{GAP_REGISTER}}-->
|
||||||
|
|
||||||
|
<h2 id="s11" class="anchor">11 · 附录:结构速查</h2>
|
||||||
|
|
||||||
|
<h4>渲染树(简化)</h4>
|
||||||
|
<pre><code><div class="desktop-workspace">
|
||||||
|
<header class="top"> ② 品牌栏
|
||||||
|
<dialog> Start 启动面板(覆盖层)
|
||||||
|
<nav role="menubar"> ③ 菜单栏
|
||||||
|
<PersistentToolbarWorkspace> ④ 工具栏区(自身 grid)
|
||||||
|
├─ 可见性 / 排列 ④a
|
||||||
|
├─ Top dock ④b
|
||||||
|
├─ Left dock · content · Right dock
|
||||||
|
└─ Bottom dock
|
||||||
|
<div class="layout"> 内层 grid
|
||||||
|
├─ <aside aria-label="Model tree"> ⑤
|
||||||
|
├─ separator
|
||||||
|
├─ <aside aria-label="Object Properties"> ⑥
|
||||||
|
├─ separator
|
||||||
|
└─ <main class="stage"> ⑦
|
||||||
|
├─ h2 文档标题
|
||||||
|
├─ .viewport (aria-label="Imported native 3D view")
|
||||||
|
├─ role=toolbar aria-label="Object transform"
|
||||||
|
├─ 任务面板 / 外部工作台 iframe / 诊断
|
||||||
|
└─ role=tablist aria-label="Documents"(底部)
|
||||||
|
<footer class="desktop-status-bar"> ⑧
|
||||||
|
<BottomDock> ⑨
|
||||||
|
<TaskFrame> ⑩
|
||||||
|
</div></code></pre>
|
||||||
|
|
||||||
|
<h4>布局状态</h4>
|
||||||
|
<div class="table-scroll"><table>
|
||||||
|
<thead><tr><th>状态</th><th>默认值</th><th>作用</th></tr></thead>
|
||||||
|
<tbody>
|
||||||
|
<tr><td class="num">treeWidth</td><td>240</td><td>树列宽(180–420)</td></tr>
|
||||||
|
<tr><td class="num">propertyWidth</td><td>300</td><td>属性列宽(180–420)</td></tr>
|
||||||
|
<tr><td class="num">startVisible</td><td>按 <code>?start</code> 参数</td><td>Start 覆盖层</td></tr>
|
||||||
|
<tr><td class="num">bottomDockOpen</td><td>false</td><td>底部坞</td></tr>
|
||||||
|
<tr><td class="num">workbenches</td><td>按文档记录</td><td>每个文档独立记住当前工作台</td></tr>
|
||||||
|
<tr><td class="num">developerMode</td><td>false</td><td>开发者诊断区</td></tr>
|
||||||
|
</tbody></table></div>
|
||||||
|
|
||||||
|
<!--{{PANEL_CATALOG}}-->
|
||||||
|
|
||||||
|
<!--{{MODAL_DIALOG_CATALOG}}-->
|
||||||
|
|
||||||
|
<!--{{PREFERENCES_CATALOG}}-->
|
||||||
|
|
||||||
|
<!--{{COMMAND_APPENDIX}}-->
|
||||||
|
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
77
docs/current/web-freecad-manual-gaps.md
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
# Web FreeCAD 手册与界面文档 · 缺口与边界账本
|
||||||
|
|
||||||
|
> 本文件由 `web/tools/manual/generate-gaps-doc.mjs` 从真实产物派生,**不要手改**。
|
||||||
|
> 输入:`web/manual/data/final-status.json`、`web/manual/data/gap-ledger.json`、`docs/current/ui-design/data/gap-register.json`。
|
||||||
|
> 复核:`node web/tools/manual/generate-gaps-doc.mjs --check`。
|
||||||
|
|
||||||
|
## 口径
|
||||||
|
|
||||||
|
- 模块数 **31**(不含已整体摘除的 OpenSCAD)。
|
||||||
|
- 命令矩阵 **1573** 条,原生承接 **378** 条。
|
||||||
|
- 手工验证命令 **12** 条;已知边界 **11** 条。
|
||||||
|
- 手册 **17** 章(正文 15 章 + 附录章)、页面截图引用 **132** 处、磁盘 PNG **130** 个。
|
||||||
|
- UI 表面 **333** 项:。
|
||||||
|
- 表面状态:implemented 330 / partial 3 / gap **0**。
|
||||||
|
|
||||||
|
## 已实现的界面覆盖(不是缺口)
|
||||||
|
|
||||||
|
| 项 | 结果 |
|
||||||
|
|---|---|
|
||||||
|
| 界面设计文档 | `docs/current/web-freecad-ui-layout-and-functions.html`,17 章 + 命令附录 |
|
||||||
|
| 手册 | `web/teaching/manual.html`,15 章 164 节 |
|
||||||
|
| 截图 | 页面引用 132 处;磁盘 130 个 PNG;采集报告 27 份 |
|
||||||
|
| 浏览器校验 | 桌面 overflow 0 / 移动 overflow 0 / 破图 0 |
|
||||||
|
|
||||||
|
## 已知边界(11 条)
|
||||||
|
|
||||||
|
| ID | 模块 | 边界 | 状态 |
|
||||||
|
|---|---|---|---|
|
||||||
|
| `b-techdraw-worker` | TechDraw | 页面 Worker 未持有目标文档,TechDraw_PageDefault 报 Document does not exist;SVG 回退不是 TechDraw 输出。 | boundary |
|
||||||
|
| `b-fem-native` | Fem | FemMeshObject/FemResultObject 未随包发布,结果停留在 Worker;VTK 显示为 three.js 近似。 | boundary |
|
||||||
|
| `b-cam-opencamlib` | CAM | Adaptive/Surface/Waterline 依赖 OpenCAMLib 与完整 ToolBit/G-code 栈,WASM 包未提供。 | boundary |
|
||||||
|
| `b-gltf-native` | Import | OCCT WASM 构建 USE_RAPIDJSON=OFF,RWGltf 无法读写;当前仅 three.js 查看。 | boundary |
|
||||||
|
| `b-cloud-remote` | Cloud | Save/Restore 需要远程 S3 凭据与服务;本地 OPFS 不受影响。 | boundary |
|
||||||
|
| `b-material-sparse` | Material | Material 原生 API 对稀疏数组/单位处理不完整,部分命令为边界。 | boundary |
|
||||||
|
| `b-bim-no-creation` | BIM | BIM 命令停靠区只有 BIM_Nudge_Up / BIM_Unclone / BIM_Ungroup;Arch_Site / Arch_Wall / BIM_Slab 等创建命令一律无任务面板。实测可用的只有 BIM_Views、BIM_Library、BIM_Setup、BIM_Material 四个非创建类命令。 | boundary |
|
||||||
|
| `b-mesh-frompartshape` | Mesh | 实体转网格的标准入口 Mesh_FromPartShape 在 Web 端没有任务面板。可用替代是 Mesh_BuildRegularSolid,实测返回 nativeOperationCompleted=true、typeId=Mesh::Cube。 | boundary |
|
||||||
|
| `b-draft-needs-viewport` | Draft | Draft_Rectangle 面板填满数值后仍提示 Pick first corner,图元要求先在三维视口取点;工作台壳层页面没有 canvas,取不了点。Draft_Line / Draft_Wire / Draft_Array 连面板都没有。 | boundary |
|
||||||
|
| `b-robot-no-model` | Robot | Robot_CreateRobot 面板六个分组齐全,但 Joint angles 分组固定显示 Home: Not set — use Set Home;点 Set Home 与点动按钮后文本与数值均不变。 | boundary |
|
||||||
|
| `b-plot-no-canvas` | Plot | Plot_Axes 面板五个分组齐全,但点 New figure 与 Add axes 后页面既不新增 svg 也不新增 canvas,在 Download SVG 之前没有可视化反馈。 | boundary |
|
||||||
|
|
||||||
|
## 手工验证的用例
|
||||||
|
|
||||||
|
共 **12** 条(台账 `web/manual/data/gap-ledger.json`)。
|
||||||
|
- 草图编辑器已从右侧属性栏移到主舞台(project-shell 的 .stage-sketch-task),命令按宽度自动排成多列,1440 宽窗口下为 3 列;ch03 截图已按新布局重采。
|
||||||
|
- 项目页 Part 文档切换 PartDesign 需要 ownership handoff;教程改用 partdesign.html。
|
||||||
|
- Mesh/BIM/TechDraw/FEM 模块页显示 boundary/no-worker,教程按模块页实际任务与边界编写。
|
||||||
|
- 两套页面壳不可互换:project.html 能新建 Document 且工作台下拉给 30 个工作台;workbench.html?module=X 对多数模块绑定固定文档 id workbench-document,既不能新建也不能打开文档。
|
||||||
|
- 字段面板能填写并提交但缺父对象文档的失败属前置未满足,不记为产品回归。
|
||||||
|
|
||||||
|
## 界面表面审计(333 项,问题 0 项)
|
||||||
|
|
||||||
|
| 表面 | 分类 | 状态 | 注释 |
|
||||||
|
|---|---|---|---|
|
||||||
|
| — | menu | partial | — |
|
||||||
|
| — | menu | partial | — |
|
||||||
|
| — | toolbar | partial | — |
|
||||||
|
|
||||||
|
审计命令:`node web/tools/manual/audit-ui-gaps.mjs --check`。
|
||||||
|
|
||||||
|
## 复现命令
|
||||||
|
|
||||||
|
```bash
|
||||||
|
R="/media/mes123456/Elements SE/WebFreeCAD/FreeCADWasmDev/working/FreeCAD"
|
||||||
|
node "$R/tools/fcweb/ui-surface-inventory.mjs" --check
|
||||||
|
node "$R/tools/fcweb/build-ui-doc.mjs" --check
|
||||||
|
node "$R/web/tools/manual/audit-ui-gaps.mjs" --check
|
||||||
|
node "$R/web/tools/manual/generate-gaps-doc.mjs" --check
|
||||||
|
cd "$R/web" && npm run build:manual && npm run check:manual
|
||||||
|
```
|
||||||
|
|
||||||
|
## 边界判定口径
|
||||||
|
|
||||||
|
- 前置未满足(缺文档、缺 Worker、缺原生对象)记边界并保留产品原始错误文本,不写成产品回归。
|
||||||
|
- GUI 控件缺口用 React 组件补齐,不以 GUI-only 名义留作 blocked。
|
||||||
|
- 空白或占位截图不得入库;空白工具栏裁剪由 `build-ui-doc.mjs` 的 1024 字节门槛自动跳过。
|
||||||
|
- 生成物(本文件、第 16 章、`final-status.json`)一律由脚本产出并带 `--check`。
|
||||||
|
|
||||||
BIN
docs/current/web-freecad-ui-assets/ui-desktop-1600.png
Normal file
|
After Width: | Height: | Size: 126 KiB |
BIN
docs/current/web-freecad-ui-assets/ui-mobile-390.png
Normal file
|
After Width: | Height: | Size: 78 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/Architecture.png
Normal file
|
After Width: | Height: | Size: 156 KiB |
|
After Width: | Height: | Size: 18 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/Assembly.png
Normal file
|
After Width: | Height: | Size: 176 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/BIM-toolbars.png
Normal file
|
After Width: | Height: | Size: 49 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/BIM.png
Normal file
|
After Width: | Height: | Size: 190 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/CAM-toolbars.png
Normal file
|
After Width: | Height: | Size: 19 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/CAM.png
Normal file
|
After Width: | Height: | Size: 170 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/Cloud.png
Normal file
|
After Width: | Height: | Size: 156 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/Draft.png
Normal file
|
After Width: | Height: | Size: 157 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/Fem-toolbars.png
Normal file
|
After Width: | Height: | Size: 115 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/Fem.png
Normal file
|
After Width: | Height: | Size: 235 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/Help.png
Normal file
|
After Width: | Height: | Size: 156 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/Import.png
Normal file
|
After Width: | Height: | Size: 157 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/Inspection.png
Normal file
|
After Width: | Height: | Size: 158 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/JtReader.png
Normal file
|
After Width: | Height: | Size: 157 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/Material.png
Normal file
|
After Width: | Height: | Size: 158 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/Measure.png
Normal file
|
After Width: | Height: | Size: 157 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/Mesh-toolbars.png
Normal file
|
After Width: | Height: | Size: 62 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/Mesh.png
Normal file
|
After Width: | Height: | Size: 210 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/MeshPart.png
Normal file
|
After Width: | Height: | Size: 160 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/Part.png
Normal file
|
After Width: | Height: | Size: 126 KiB |
|
After Width: | Height: | Size: 13 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/PartDesign.png
Normal file
|
After Width: | Height: | Size: 131 KiB |
|
After Width: | Height: | Size: 7.6 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/Points.png
Normal file
|
After Width: | Height: | Size: 161 KiB |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 164 KiB |
|
After Width: | Height: | Size: 9.1 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/Robot.png
Normal file
|
After Width: | Height: | Size: 159 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/Sandbox.png
Normal file
|
After Width: | Height: | Size: 158 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/Sketcher.png
Normal file
|
After Width: | Height: | Size: 119 KiB |
|
After Width: | Height: | Size: 12 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/Spreadsheet.png
Normal file
|
After Width: | Height: | Size: 121 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/Start.png
Normal file
|
After Width: | Height: | Size: 156 KiB |
|
After Width: | Height: | Size: 6.9 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/Surface.png
Normal file
|
After Width: | Height: | Size: 182 KiB |
|
After Width: | Height: | Size: 90 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/TechDraw.png
Normal file
|
After Width: | Height: | Size: 230 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/Test-toolbars.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/Test.png
Normal file
|
After Width: | Height: | Size: 152 KiB |
BIN
docs/current/web-freecad-ui-assets/workbenches/Tux.png
Normal file
|
After Width: | Height: | Size: 156 KiB |
5243
docs/current/web-freecad-ui-layout-and-functions.html
Normal file
94
docs/current/web-functional-suite/README.md
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
# Web FreeCAD 有头功能测试套件
|
||||||
|
|
||||||
|
统一入口:`tools/web-freecad-functional-suite.mjs`。默认**有头**运行(`DISPLAY=:1` 上可见窗口),全自动无人值守;用例层按优先级分层,复用现有手册场景、工作台命令面与 OPFS 契约。
|
||||||
|
|
||||||
|
## 运行
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd "/media/mes123456/Elements SE/WebFreeCAD/FreeCADWasmDev/working/FreeCAD"
|
||||||
|
DISPLAY=:1 node tools/web-freecad-functional-suite.mjs --priority P0 # 壳层冒烟
|
||||||
|
DISPLAY=:1 node tools/web-freecad-functional-suite.mjs --priority P1 # 手册章节全流程
|
||||||
|
DISPLAY=:1 node tools/web-freecad-functional-suite.mjs --priority P2 # 全模块冒烟(31 例)
|
||||||
|
DISPLAY=:1 node tools/web-freecad-functional-suite.mjs --priority P3 # 交叉用例(导出/OPFS/回开/错误恢复)
|
||||||
|
DISPLAY=:1 node tools/web-freecad-functional-suite.mjs --only MOD-Fem-01 --force
|
||||||
|
DISPLAY=:1 node tools/web-freecad-functional-suite.mjs --legacy-ids all # 附带旧 53 例手册套件
|
||||||
|
```
|
||||||
|
|
||||||
|
常用参数(完整列表见 `tools/functional-suite/cli.mjs`):
|
||||||
|
|
||||||
|
| 参数 | 作用 |
|
||||||
|
|---|---|
|
||||||
|
| `--only <ids>` | 逗号分隔的用例 id |
|
||||||
|
| `--priority P0,P1,P2,P3` | 按层选择 |
|
||||||
|
| `--module <names>` | 只跑指定模块的 `MOD-*` |
|
||||||
|
| `--resume <dir>` / `--force` | 断点续跑;`--force` 重跑已完成用例 |
|
||||||
|
| `--headless` / `--slow <ms>` / `--highlight` | 无头、放慢、高亮(观察用) |
|
||||||
|
| `--screenshots fails\|all` | 失败截图(默认)或全量截图 |
|
||||||
|
| `--out <dir>` | 证据根目录(默认 `docs/current/web-functional-suite`) |
|
||||||
|
| `--prune <n>` | 只保留最近 n 次运行目录 |
|
||||||
|
| `--legacy-ids <ids\|all>` | 以子进程运行 `tools/run_user_manual_tests.mjs` 并归一化为 `LEGACY-*` |
|
||||||
|
| `--timeout-scale <x>` | 统一放大/缩小用例超时 |
|
||||||
|
|
||||||
|
退出码:0 = 全部 passed;1 = 存在 failed/running;2 = 没有选中任何用例。
|
||||||
|
|
||||||
|
## 用例分层
|
||||||
|
|
||||||
|
| 前缀 | 层 | 内容 | 来源 |
|
||||||
|
|---|---|---|---|
|
||||||
|
| `SHELL-0x` | P0 | 入口隔离(COOP/COEP)、Start 工作区、新建文档 + Cube、OPFS 可写、画布与图标渲染 | `cases/shell.mjs` |
|
||||||
|
| `CH-<chapter>-<workflow>` | P1 | 手册 27 份场景 JSON 全动作执行 + 章末后置断言(pageerror、状态栏、画布) | `cases/chapters.mjs` → `web/manual/scenarios/*.json` |
|
||||||
|
| `CH-ch14-*`、`CH-ch15-*` | P1 | 无场景 JSON 的两章用手写用例(生产线资产契约、Help/命令面板/偏好/快捷键) | `cases/handwritten.mjs` |
|
||||||
|
| `MOD-<Module>-01` | P2 | 31 个模块:壳层挂载、模块坞选中、命令面注册、规范命令返回 `kind=result` | `cases/modules.mjs` → `feature-capability-registry.json` |
|
||||||
|
| `X-*` | P3 | 五种导出格式落 OPFS、FCStd 存取哈希、保存后回开、坏文件错误恢复、viewport 无溢出、左右面板独立滚动(`X-panel-scroll`) | `cases/crosscut.mjs` |
|
||||||
|
| `LEGACY-<id>` | P4 | 旧手册套件 53 例(仅 `--legacy-ids` 时运行) | `executors/legacy.mjs` |
|
||||||
|
|
||||||
|
场景动作解释器与 `web/tools/manual/capture.mjs` 共用同一份实现:`web/tools/manual/lib/actions.mjs`(18 种动作)。
|
||||||
|
|
||||||
|
## 前置顺序与失败分类
|
||||||
|
|
||||||
|
每个用例先准备前置(host/端口、fixture、文档与对象、命令状态、viewport),再执行产品断言。失败分类:
|
||||||
|
|
||||||
|
- **blocked / precondition**:入口、fixture、viewport、host/iframe、命令状态不满足——先补缺项,不记产品回归。
|
||||||
|
- **failed / product-regression**:前置全部满足后的产品行为失败,写入 `gaps.ndjson` 与报告。
|
||||||
|
- 前置类由 `blockedPrecondition(class, message)`(`gap-ledger.mjs`)显式抛出;其余按 `classifyFailure` 归类。
|
||||||
|
|
||||||
|
## 输出(每次运行一个目录)
|
||||||
|
|
||||||
|
`docs/current/web-functional-suite/run-<stamp>/`:
|
||||||
|
|
||||||
|
- `manifest.json`:origin、Chrome 版本、用例清单、dist 相对路径
|
||||||
|
- `results.json` / `checkpoint.json`:逐案结果与断点(`--resume` 依据)
|
||||||
|
- `report.md` / `junit.xml` / `index.html`:人读报告、CI 报告、浏览器索引
|
||||||
|
- `gaps.ndjson`:缺口台账(caseId、classification、failureClass、evidence)
|
||||||
|
- `cases/<id>/result.json`、`step-*.json`、`shots/*.png`、失败时 `failure.png` + `failure-canvas.png`
|
||||||
|
|
||||||
|
用例间用 `resetState` 隔离:回 `about:blank`、递归清空 OPFS、再进入口页;页面/控制台错误按用例清零,作为该用例的断言。
|
||||||
|
|
||||||
|
## 浏览器
|
||||||
|
|
||||||
|
Playwright + 系统 Chrome(`FREECAD_CHROME` 可覆盖,默认 `/usr/bin/google-chrome`)。固定 flags:`--no-sandbox --disable-dev-shm-usage --use-angle=swiftshader --enable-unsafe-swiftshader`,viewport 1440×1000;`--gpu` 仅供人工观察性能。静态服务用 `tools/static-host.mjs` 的临时端口(带 COOP/COEP),不占用 5180/5183 等固定端口。
|
||||||
|
|
||||||
|
## 配套工具(面板滚动排查沉淀)
|
||||||
|
|
||||||
|
- `tools/static-host.mjs`:既是共享模块,也可直接当 CLI 用——`node tools/static-host.mjs [--root <dist>] [--port <n>] [--document <file>]`,打印 `ORIGIN=` 后常驻,供 `web/tools/manual/capture.mjs --origin` 或临时探针复用。`--root` 支持相对路径(内部统一 `path.resolve`;此前传相对根会因路径守卫让所有请求 403)。
|
||||||
|
- `tools/layout-probe.mjs`:三栏布局/滚动探针,替代逐个手写的临时脚本。默认对 `/project.html`、`/partdesign.html`、`workbench.html?module=Part|Robot|Mesh` 逐页断言:锁定页整页不可滚动、aside 全部在视口内、每个 aside 拥有可滚动 `.pane-scroll`(默认注入 2000px 占位块)、注入与滚动面板后中央舞台位移 ≤1px。全量报告用 `--json`,人工核对用 `--headed --pause` 拖动面板观察;`--url` 可重复指定页面,`--origin` 可复用已有 host。
|
||||||
|
|
||||||
|
## 已修复的缺口(套件落地过程中)
|
||||||
|
|
||||||
|
- 静态 host 的 `.svg` MIME 为 `application/octet-stream` 导致工具栏大面积无图标 → 补全 MIME 表,并在 SHELL-02 增加图标渲染断言。
|
||||||
|
- `templatepymod.inspectSourceInventory` 路由到 python worker 导致 `invalid_request` → 生成器映射改到 `templatepymod.worker.ts` 并重生成。
|
||||||
|
- Fem 探针 `fem.action` 报 `memory access out of bounds`:11 月 15 日旧产物与当前构建图不匹配(全局 `-pthread/-matomics` vs 预编译 vtk 无原子特性)→ 以 `-Wl,--no-check-features` 重新链接 `FreeCADWebFemGenericFamilyProbe`,逐步骤日志确认 newDocument/addObject/recompute/closeDocument 全通。
|
||||||
|
- 手册第 15 章写 `Ctrl+K` 打开命令面板,壳层只实现 `Ctrl+Shift+P` → `project-shell.tsx` 同时支持两者。
|
||||||
|
- ch05 场景 fixture 硬编码旧树路径 → 改为本树绝对路径。
|
||||||
|
- 元素截图/章末画布采样在模态遮挡下 30s 超时 → `shot` 与 `canvasHash` 改为有界超时 + viewport/clip 回退(证据能力,不改变产品断言)。
|
||||||
|
- `X-opfs-roundtrip` / `X-save-reopen` 报「120 s 内没有 .FCStd」:`cases/crosscut.mjs` 的 `listExports/readExport` 接受 `dirName` 却把硬编码 `EXPORTS` 传给 `page.evaluate`,始终只列 `freecad-exports` → 改传 `dirName`。产品行为正常,FCStd 一直落在 `freecad-documents`。
|
||||||
|
- glTF/GLB 导出报 `glTF writer is unavailable - OCCT has been built without RapidJSON support`:OCCT WASM 以 `USE_RAPIDJSON=OFF` 配置 → `tools/rebuild-occt-rwgltf-rapidjson.sh` 用 `-DHAVE_RAPIDJSON` 单点重编 4 个 `RWGltf` 编译单元(RapidJSON 1.1.0 位于 `build-web/rapidjson/`)并替换 3 份 `libTKRWMesh.a`,再重链 `FreeCADWebDocumentProbe`、同步资产、重建 dist。**任何一次完整 OCCT 重建后用该脚本恢复**,否则会静默回退。
|
||||||
|
- `ExportService` 白名单缺 `.gltf`/`.glb`,导出返回 `unsupported_extension` → `web/src/export-service.ts` 的 `EXTENSIONS` 补齐。
|
||||||
|
- `MOD-Fem-01` 的 `fem.action` 报 `memory access out of bounds`:`web/tools/sync-assets.mjs` 固定从 `build-web/fem-wasm/bin` 复制 Fem 探针(11 月 14 日旧产物),覆盖了 `build-web/configure/bin` 里重新链好的版本 → 改为与 CAM 相同的「按 mtime 择新」策略,`buildProfileForProbe` 同步跟随实际来源。旧产物与当前构建图特性不一致,正是该 OOB 的已知根因。
|
||||||
|
- 工作台 / PartDesign 整页滚动、面板无独立滚动条(左右面板改参数时三维视口被挤出):`web/src/panel-scroll.css` 统一三栏高度链(`html.stage-lock` / `html.stage-lock-pd` → `body` 100dvh → `#app`/根 div `flex:1 1 0%` → `.layout{grid-template-rows:minmax(0,1fr)}` → `aside{overflow:hidden}` → `.pane-scroll{overflow-y:auto}`),入口按页加根类;`X-panel-scroll` 逐页断言面板独立滚动且中央视口不动。注意 `flex-basis` 必须是 `0%`,用 `auto` 会让面板内容高度参与收缩并推移舞台。
|
||||||
|
- 模块任务面板(Mesh 建规则网格、Robot 关节、Assembly、Draft…)渲染在 `.layout` 之前的文档流里,内容长高会把三栏布局顶出视口(Robot 页 `.layout` top≈1490、asides 仅 32px;Mesh 点 Create 后按钮跑到 y≈2131)→ `workbench-shell.tsx` 把这些面板(Start 工作区 iframe 除外)包进 `.module-task-dock`,由 `panel-scroll.css` 给其 `max-height:42dvh` + 自滚动。包装起点必须位于**所有**模块任务面板之前,只包后半段会让 Mesh 仍然塌陷。
|
||||||
|
- 文档树里非 PartDesign 的 3D 对象图标 404(`/icons/partdesign/Part_3D_object.svg`):`project-shell.tsx` / `partdesign-workspace-component.tsx` 把 Part 图标拼进了 partdesign 目录,实际文件在 `/icons/part/Part_3D_object.svg` → 改回正确目录;`capture.mjs` 的 ch01 场景冒烟以此为断言。
|
||||||
|
|
||||||
|
## OPFS 目录契约(用例寻址口径)
|
||||||
|
|
||||||
|
- 保存的 FCStd 文档在 `freecad-documents`(`writeDocumentFile`),几何导出在 `freecad-exports`(`writeExportFile`),参数在 `freecad-parameters`。用例必须按目录分别轮询/回读,禁止跨目录假设;下载目录始终为空,导出不得自动下载。
|
||||||
1144
docs/web-parity-matrix.json
Normal file
537
nextTask.md
Normal file
@@ -0,0 +1,537 @@
|
|||||||
|
# FreeCAD Web 对标续接清单
|
||||||
|
|
||||||
|
2026-11-26 教学控制台已搬进 Web FreeCAD 本体:`web/teaching-console.html` + `web/src/teaching/{console-page,runner,bridge,in-page-page,steps,report-store,types}`,浏览器内同源 iframe 直接驱动工作台 DOM,不需要 Node 教学服务、不启动外部 Chrome、无 `/api/console/*`。**相对原计划的偏差**:计划的 §1「把 driver 的 page.evaluate 改写成 (win,doc) 具名函数、两套适配器」没有做——CSP 无 `'unsafe-eval'`(`web/vite.config.ts:15`),跨 realm 字符串化本来就走不通;改为把 driver 模块直接 import 进工作台页 realm(`bridge.ts` 发布 `window.__teaching`),`document` 就是被测页,`evaluate` 是普通函数调用,driver/assembly 零改动复用。`web/tsconfig.json` 增 `allowJs`(driver 是 .mjs)与 `resolveJsonModule`(`lessons.json`)。步骤数据由 `steps.ts` 用 `import.meta.glob` 直接引用两个课程的 `out/ui-steps/*.json`(跳过各自目录下的 `index.json` 清单),Vite 按文件出 chunk。门禁 `web/tools/teaching-console/check-inapp-console.mjs`(`npm run check:console-inapp`)全绿:环境自检 pass、P01 在 iframe 里真建模 4/4 步、体积相对误差 5.78e-13、报告写 OPFS `freecad-exports`、`Gear2_80T.FCStd` 落 `freecad-documents`、双 viewport 无溢出;批量驱动 `run-inapp-lessons.mjs --group|--lessons` 同一浏览器内按序跑整课(OPFS 在同一会话内累积,装配课因此有源件)。零件课通过后自动用工作台自带「保存 FCStd 到 OPFS」按钮存盘,再按课程文档名重存(FCStd 文档名取自文件名),这是装配前置。已修两个真实缺陷:两课程同名 `ui-steps/index.json` 被当成 document、页内 `click` 不等控件 enabled(内核启动期点「新建文档」必抛错)。已提交 `fd37b92f`(teaching: run lessons in-app through an iframe-driven console),**未推送**——环境拒绝带凭据的 push,由用户执行 `git push gitea web-desktop-parity-20261113`。reducer 23 件 + 装配、carrier 20 件 + 装配均在浏览器内全绿(装配 32/32 与 20/20 插入、33/33 与 19/19 关节),`check:console`、`check:carrier`、`check:console-inapp` 全绿。**残余**:`run-inapp-lessons.mjs` 的 `--profile <dir>` 是浏览器内 OPFS 跨次运行的必要条件(新 profile = 空 OPFS,装配课会按前置阻塞),正式环境用真实浏览器 profile 即可。Node 通道已复验:`check:reducer`、`check:carrier`、`check:carrier-live`、`reducer:assembly`、`carrier:assembly`、`carrier:part P01 --headed` 全部通过,证明 `lib/assembly.mjs` 的改动(插入名回退、`saveAssemblyBundle` 参数改名)不破坏 Playwright 通道。复跑入口:`node web/tools/teaching-console/run-inapp-lessons.mjs --group reducer|carrier --profile <dir>`。
|
||||||
|
|
||||||
|
2026-09-09 17:24:Start 官方 SVG 导入与浏览器 Worker 路由已接通,复用 Materials/Part 和 Draft `importSVG`。矩形、圆、折线、多边形、圆弧、变换、混合图形、失败恢复通过;Start 三项和 Draft 四项真实验收通过。Start/Draft 排除误嵌入的编译静态库、字节码缓存、桌面翻译后共减少约 209 MB,原文件保留,不重编译 OCCT。当前有效快照 123/1504;证据、耗时和限制见 `docs/current/start-svg-delivery.md`,后续直接复用。
|
||||||
|
|
||||||
|
2026-09-09 16:20:TechDraw 参数、容器策略、响应校验已从共用分发器移入 `web/src/techdraw-desktop-adapter.ts`,后续该模块适配继续编辑此文件,避免又触发全部模块证据失效。Sandbox 已改用真实当前多对象文档保存重开,创建/保存共用 `sandbox.worker.ts`,两项 1.897 秒通过;不再用固定 42 的样例证明业务完成。PartDesign 边身份已修、11 项通过。最新证据、批量复验及边界集中于 `docs/current/partdesign-edge-identity-fix.md`,全项目快照 117/1504,后台继续运行。
|
||||||
|
|
||||||
|
2026-09-09 15:45:Fillet/Chamfer 的边身份问题已闭环。StringHasher 不再把 `g1v1` 等无效 IndexedName 留下的数字当作哈希索引;保留真实原生边身份,不按编号重绑。PartDesign 11 项正式通过,连续尺寸编辑、撤销重做、FCStd 重开专项回归通过,两个原始故障均已 resolved。使用 `docs/current/partdesign-edge-identity-fix.md` 的当前证据继续其它业务,下方旧阻塞说明仅作历史。后台未暂停。
|
||||||
|
|
||||||
|
2026-09-09 14:20:Revolution/Groove 已在同一 PartDesign 文档中完成参数、原点轴、关联重算、撤销重做及 FCStd/OPFS 闭环。正式 11 项中 9 项通过;Fillet/Chamfer 在 Pad 长度变化后出现原生 `Invalid edge link`,仍失败,最小复现和拓扑数据见 `docs/current/partdesign-finishing-delivery.md`。不要重做已通过旋转/切槽,不得按 Edge 编号强行重绑定。自动构建两处入口已加入构建目录互斥;人工增量构建使用 `tools/web_build_lock.py -- cmake --build ...`,后台已恢复。
|
||||||
|
|
||||||
|
2026-09-09 PartDesign 主线:现有 PartDesign WASM 已接通 Body、矩形/圆形全约束草图、真实 Pad/Pocket、依赖重算、原生事务、FCStd/OPFS、多文档切换及旧 AdditiveBox 文件打开。四项桌面业务、一个新增文档业务和原有两项回归共七项通过,耗时 20.689 秒。完整范围新增文档记录后为 1504 项;当前进度以实时审计为准。复用 `docs/current/partdesign-profile-delivery.md` 和该工作区继续其它模式/特征,不重做本轮适配。后台父进程和 watchdog 已恢复。
|
||||||
|
|
||||||
|
2026-09-09 11:24:主工作区新增原生 Fuse/Cut/Common、XYZ 平移、撤销重做及依赖保持的 FCStd/OPFS 重开编辑。已修 WASM 布尔并行阻塞、局部异常捕获、空材质继承和半文件发布;不要重做几何算法。Part 18 项、Web 10 项通过,共用分发器变化后直接批量恢复 59 项已有结果。有效验收 93/1503,剩余 1410;详见 `docs/current/part-boolean-delivery.md`。继续既定 Sketcher/PartDesign 用户文档主链,后台按自身检查点推进,复验不计新增业务。
|
||||||
|
|
||||||
|
2026-09-08 铁律统一入口:先读 `docs/WEB_BUSINESS_MIGRATION_RULES.md`,再核对当前检查点。用户最新要求优先,其次是铁律、既定方案操作步骤和历史任务卡。下方旧条款只保留追溯,冲突不得覆盖当前铁律。
|
||||||
|
|
||||||
|
执行要点:直接利用已编译 WASM;DXF 复用 FreeCAD `src/Mod/Import/App/dxf` 的 C++ 实现与有效证据,不重新移植或寻找旧 Python DXF 库。先接线和本地针对性测试,明确缺陷才增量重建;不要求用户提交源码。恢复使用 `docs/current/scheduler-context.json` 的批次、指纹、首错与下一步,不重复全库读取。实际交付与重复验收、回执刷新、调度轮数分别记账。
|
||||||
|
|
||||||
|
2026-09-09 10:20 主工作区业务:已接通原生圆柱、圆锥、球、圆环的参数/角度编辑、同文档重算、Three.js 显示、FCStd/OPFS 保存重开和移除。四项桌面业务新增有效证据,Part 新旧合计 15 项与 Web 工作区 10 项回归通过。原生目标为已有 DocumentProbe,不重编译 OCCT。模块合同 buildOverrides 与分组使文档业务不误建 PartBoxProbe;实际目标源码也纳入指纹。详情见 `docs/current/part-primitives-delivery.md`,后续直接复用。
|
||||||
|
|
||||||
|
2026-09-09 09:42 业务推进:Points 四项、OpenSCAD 两项已取得当前真实证据并同步发布。Points 不再被固定三点 Facade 限制;OpenSCAD 接入已提供的 C++ DXF reader 与 Part/OCCT 成面,不再走旧 Python DXF 链。图层名称保留与 Draft 显示分组已分离,默认桌面行为保留。当前总数快照 79/1503,不代表全部移植完成;细节与证据见 `docs/current/points-openscad-delivery.md`。原 watchdog 已恢复,继续其余业务,不重做这些已通过部分。
|
||||||
|
|
||||||
|
2026-09-09 08:46 吞吐修复:调度已使用 `delivery-workflow-first-v3`,业务恢复连续两次无结果后安排其它模块缺用例的开发包,原失败和完整范围保留。统一 runner 完整捕获大报告,避免 Node 管道短写损坏 JSON 导致真实成功整批打回。TechDraw 五项 9.906 秒通过;新补 Spreadsheet CSV 两项 1.462 秒通过,没有重编译 WASM。实测和剩余缺口见 `docs/current/migration-throughput-fix.md`;不要把这些恢复结果算成整个项目完成或重做 DXF/OCCT。
|
||||||
|
|
||||||
|
2026-09-09 实际修复:Part 的 180 秒阻塞已定位为 MeshCore 递归异步排序耗尽 WASM pthread 池,并在 `src/Mod/Mesh/App/Core/Functional.h` 修复;已增量链接并发布 Part、Mesh。Part 11 项当前业务确认通过,Mesh 7 项通过,保留原始失败和带指纹证据。详细结果与续接策略见 `docs/current/part-mesh-business-unblock.md`。不得根据历史“OBJ 未实现/仍超时”说明重做已通过部分;几何内核使用 OCCT WASM,显示使用 Three.js。
|
||||||
|
|
||||||
|
2026-09-09 TechDraw 浏览器解阻:已修正生成的 Worker 路由和取消状态契约,创建、图像任务、保存共享现有原生文档;三项正式业务组 9.071 秒通过,未重编译 OCCT/WASM。见 `docs/current/techdraw-route-unblock.md`,不要按历史 45 秒 `Runtime.evaluate` 超时重做内核。OCCT WASM 已提供,几何算法统一到该唯一内核出口;实际全项目入口贯通需按真实调用确认,不能凭依赖名称宣称完成。
|
||||||
|
|
||||||
|
本文件是项目级续接入口。以后用户输入:
|
||||||
|
|
||||||
|
```text
|
||||||
|
按 nextTask.md 接续执行
|
||||||
|
```
|
||||||
|
|
||||||
|
执行者必须从本文件的“当前检查点”开始,先校验机器状态,再按任务卡依赖连续执行,不等待确认,不重复已完成任务,不把未验证能力写成通过。
|
||||||
|
|
||||||
|
## 2026-09-07 功能业务移植要求(历史补充)
|
||||||
|
|
||||||
|
2026-09-08 项目定位与复用铁律:“本项目是将桌面版的 FreeCAD 移植到 WEB FreeCAD,前期已经做了大部分工作,要充分利用上。” 后续必须承接已有源码移植、适配、模块 WASM、构建缓存、接线、用例和有效证据,只补真实缺口,不得从零重写。缺少当前业务验收证据不等于已有工作未完成;按 `docs/WEB_BUSINESS_MIGRATION_RULES.md` 的“项目定位与已有成果复用铁律”分别记录实现、产物及业务结果。
|
||||||
|
|
||||||
|
2026-09-08 用户已明确确认:“我已经提供了桌面版 FreeCAD 的源码和资料。” 所有人工、无人值守及优化回合必须继承这一前提,先按 `docs/current/provided-source-index.md` 使用 `freecad-source` 桌面源码和既有资料、实现、产物及证据。不得把未检索或路径错误当作未提供,不得重复索要或从零重写;发现本地可修复问题应立即定点修复并核对实际结果,不能只监测或等待。执行 `docs/WEB_BUSINESS_MIGRATION_RULES.md` 的“源码与资料优先铁律”。
|
||||||
|
|
||||||
|
2026-09-08 无人值守模式以 `docs/UNATTENDED_WORKFLOW.md` 为当前操作说明:自动诊断缺口、完整应用接入工作包、模块级停滞冷却和真实结果闭环。不得把“换任务”本身计为业务结果。已补齐的 CAM JSON 刀轨业务及其证据直接复用。
|
||||||
|
|
||||||
|
2026-09-08 失败处理授权:从现在分类,随模块业务同步闭环,最终完成前对账。执行 `docs/FAILURE_RECONCILIATION_POLICY.md`:模块工作包带入相关失败,切换模块安排小批对账;保留原始账本,禁止盲目重跑旧 API gate、删除失败或只写通过元数据。最终还须通过 `tools/failure_reconciliation.py --check`。本节覆盖下方旧的“历史失败全部冻结到最终验证”条款。
|
||||||
|
|
||||||
|
坚持以“功能模块业务、功能路由”带动全部移植。执行细则见 `docs/WEB_BUSINESS_MIGRATION_RULES.md`,本节覆盖下方旧策略中的冲突条款。
|
||||||
|
|
||||||
|
保留并复用既有源码、回执、WASM、构建缓存和用例;补齐漏列桌面业务,被入口阻断的记录重新排队。846/791 不是分母上限。路由、构建回执和业务完成分开记录;业务完成依赖实际输入/结果证据,不依赖逐 API 数量或历史 Full Parity gate。
|
||||||
|
|
||||||
|
持续 planner 依次处理功能路由、格式、React 集成和业务结果确认。外层仅确认当前模块业务,复用指纹匹配的旧证据;历史“不执行验证”不禁止这项必要的业务结果确认。禁止为了消除阻断而仅移除策略保护、添加整族完成标记或返回固定样例。
|
||||||
|
|
||||||
|
2026-09-07 后续耗时优化:达到源码读取预算只限制额外检索,不终止尚未编辑的回合;使用已有完整源码片段完成编辑并正常结束,以便复用上下文。没有工具活动的空响应重试保留此前干净会话,发生工具活动、补丁冲突或上下文损坏时仍丢弃不可靠会话。工作包必须包含实际编辑位置和完整源码行。
|
||||||
|
|
||||||
|
无人值守防空转:`docs/current/scheduler-progress.json` 按业务 ID 记录新增路由、构建回执和业务结果。连续三次没有新结果的业务默认冷却 300 秒,重复停滞延长至最多 3600 秒;期间调度其他模块或已有前提的格式、产品、业务确认任务,冷却业务不计为完成。所有候选均冷却时显示 `waiting_for_retry`,不启动无任务的模型回合。服务退避单独持久化,重启不清零;代码修改本身不等同于业务完成。混合业务批次按同模块剩余任务合并链接,切换构建目标前刷新上一目标的待构建产物。
|
||||||
|
|
||||||
|
2026-09-08 自动发现与修复:续接刷新、保留批次、预检和模型启动必须检查当前冷却 ID;保留批次快速路径不得绕过冷却。watchdog 每轮独立检查新模型回合是否错误执行冷却记录,发现后写 `scheduler-recovery-request.json`,等待正在执行的工具结束,再自动重启和重排。恢复请求与次数保留可见;不通过删除未完成业务、伪造回执或反复启动同批次恢复。重排失败进入退避,禁止继续执行旧批次。状态页以新增业务结果计算 `businessProgressRate`,正常退出率单独显示为 `processCompletionRate`。
|
||||||
|
|
||||||
|
## 2026-09-06 策略切换(历史)
|
||||||
|
|
||||||
|
用户已明确将执行主线切换为“功能模块直接使用、不移植 API、不执行验证、使用中发现问题再定点修复”。本节覆盖本文件后面仍保留的逐 API/gate/Full-Parity 旧流程;历史规则只作追溯,不得重新成为实施阻断。
|
||||||
|
|
||||||
|
- `13,385` 是 `.py/.pyi` AST 源码符号索引;`13,386` 是再补入一个 C++ Python binding `Part.makeBox` 后的混合追踪数。它们都不是用户功能数、页面数或必须公开的 WASM 函数数。
|
||||||
|
- API 清单仅保留为源码定位资料,不再用于实施队列、功能覆盖、完成率、页面数、WASM 导出数或 gate 分母。功能模块在 WASM 内直接调用所需 FreeCAD C++/Python 实现,禁止再安排任何 API 批次。
|
||||||
|
- 主进度由 `docs/current/web-business-completion-audit.json` 汇总。`feature-capability-registry.json` 只表示桌面命令路由层;必须继续区分路由、目标构建回执、模块业务实现和后置验证。
|
||||||
|
- 用户工作流统一采用 `React → Worker {cmd,args} → fc_web_dispatch_json → 独立模块 WASM → JSON result/error`。继续禁止一 API 一 Worker、一 API 一 WASM export 和静态 JS 计算替代 FreeCAD。
|
||||||
|
- 自动 planner 使用 `tools/prepare_implementation_business_batch.py`:P1 关闭桌面功能 route/build receipt,P2 按模块完成真实 import/export 工作流,P3 合并唯一 React 产品工作页。该入口不得调用 Python API 批次规划器;P1-P3 全部收口后才能进入等待。
|
||||||
|
- 实现阶段不运行 focused gate、`validate_incremental_context.py`、完整 API/Full Parity/Chrome/性能/安全 gate。只有必要的目标增量构建和 artifact sync 保留;成功只写 `implementation_ready` 回执,不写 validation pass,不修改 API disposition。
|
||||||
|
- 实际使用发现问题时,只重新打开受影响的 capability,记录 `{capabilityId, cmd, args, sourceRevision, artifactHash, firstError}`,定点修改并重建该模块;不得触发全量验证。
|
||||||
|
- 当前项目不安排完整验证;未验证不阻断功能模块实施,也不得伪写 validation pass。
|
||||||
|
- 结果生成铁律:命令结果必须由当前 `{cmd,args}`、Document/object handle、BREP/mesh/属性输入和 FreeCAD/OCCT 执行产生;禁止在 React、Facade、Worker、调度器或 native handler 中返回固定几何、固定选择、固定计数或仅用于抬高进度的摘要。命令 ID 注册表可以生成,但不得复制结果数据。
|
||||||
|
- Desktop command 扩展约定:模块使用 `<Module>DesktopCommands.cpp` 的 `FC_WEB_DESKTOP_COMMAND(...)` 注册实际 handler;`generate_feature_capability_registry.py` 自动发现注册并映射到该模块现有 family Worker。React 使用通用 `DesktopCommandDispatcher` 从 command matrix 运输 source/args,不维护逐命令 fixture 列表。
|
||||||
|
- 链接触发门:implementation-first pipeline 先刷新 module/capability registry;当前 selected IDs 未全部达到静态 route/Worker/native registration 完整性时返回 `implementation_incomplete`、`buildRequired=false`,禁止为半成品启动 WASM 链接。全部完整后只链接一次并写实现回执。
|
||||||
|
- Desktop WASM 细分:高频桌面命令优先使用 `FreeCADWeb<Module>DesktopCommandProbe` 独立模块并由现有模块 Worker 首次调用时动态加载;不得为每条命令建 WASM,也不得重新塞回巨型 Python/格式 probe。资源同步按 `FreeCADWeb*DesktopCommandProbe` 自动发现,不写死模块文件名。
|
||||||
|
- 完整分析和四层状态模型见 `docs/WEB_IMPLEMENTATION_FIRST_STRATEGY.md`。
|
||||||
|
|
||||||
|
## 不停歇执行开关(强制)
|
||||||
|
|
||||||
|
### 自动续接控制协议(机器可执行)
|
||||||
|
|
||||||
|
- `nextTask.md` 是跨会话续接协议,不是一次性计划。每次启动、上下文压缩、工具中断、用户再次输入“按 nextTask.md 接续执行”或等价指令,都必须从 `docs/current/task-state.json` 的 `active_task` 恢复。
|
||||||
|
- 机器续接检查点为 `docs/current/continuation-state.json`;它必须与 `task-state.json.active_task` 一致。检查点只保存恢复状态,不代表后台代理仍在运行,也不得被当作功能通过证据。
|
||||||
|
- 续接范围固定为 `full-project`,完成范围为 `all-task-cards-all-modules-all-required-y-gates`,并强制 `noPartialCompletion=true`:单个模块、单张任务卡或单个阶段完成都不能触发终止,必须继续到整个项目收口。
|
||||||
|
- 默认确认策略为 `never_for_in_scope`:在用户已授权的仓库范围内,源码编辑、必要编译/链接、资源补充、实现回执、上下文轮换、账本同步、超时单次重试和恢复卡创建均自动执行,不询问确认。实施阶段不运行测试/gate/验证;只有缺少凭据、超出仓库范围的不可逆破坏操作或无法从源码推断的新架构决策才允许暂停。
|
||||||
|
- 阶段连续性为 `never_between_phases`:LOAD、校验、读取、实现、保存、轮换、同步、领取下一卡之间不得设置等待点;`waitingAllowed=false`、`awaitConfirmation=false`。每个阶段结束必须立即进入下一个阶段。
|
||||||
|
- 全局继续策略为 `mustContinue=true`、`noFinalBeforeTerminate=true`、`phaseTransitionPolicy=immediate`:阶段性结果只能写入检查点,不能发送最终答复、不能回到等待状态;完成一个阶段必须立即执行下一个阶段。
|
||||||
|
- 批次准备快速路径:续接入口在运行检查器前先检查 `module-batch-manifest.json`;批次不存在、任务不匹配或记录数低于 `batchPolicy.minRecords` 且没有 `singletonFallback=true` 时,必须立即重新规划批次。规划器优先选择同一 `module+tier+family` 且记录数达到最小值的批次,只有全局没有更大分组时才允许单条尾批,禁止因孤立尾记录让 scheduler 在准备阶段空转。
|
||||||
|
- 准备错误恢复上限:连续准备错误不得只等待重试;必须执行批次刷新、上下文压缩/重建和检查点修复的顺序恢复。只有恢复链仍失败时才写入失败账本;实现阶段默认冻结历史账本,只有直接阻断当前批次的首错才允许定点重放,避免失败同步占用正常实现回合。
|
||||||
|
- 失败恢复配额:实现阶段默认冻结历史失败重放;只有某条失败直接阻断当前批次时才定点处理。全部移植完成且用户明确要求全量验证后,才轮转历史失败;启用重放时单个 Codex 回合最多处理 4 条,成功重放后才标记 `resolved`,禁止历史诊断错误占满实现回合。
|
||||||
|
- 每次恢复第一步必须运行只读检查器 `python3 tools/check_continuation_state.py`;检查器失败时先修正文档/账本一致性,不得领取下一张卡或把状态改成完成。
|
||||||
|
- 检查器还必须确认自动动作集合完整、暂停例外边界未扩大、终止策略非空;任何策略漂移都视为恢复阻断,不能静默继续或静默停机。
|
||||||
|
- 执行器必须持续运行以下状态机:`LOAD_STATE → VALIDATE → PREPARE_CONTEXT → READ_MANIFEST → IMPLEMENT_BATCH → RECORD_RESULT → ROTATE_CONTEXT → SYNC_STATE → PREPARE_NEXT → CONTINUE`。只要存在 `active_task` 或可执行叶子任务,就不得在 `CONTINUE` 状态主动结束。
|
||||||
|
- 每轮只允许一个 `in_progress` 任务。Codex 内回合完成当前批次后只记录结果和 checkpoint 并返回;外层 scheduler 在下一回合一次性执行轮换、账本同步、批次投影和下一张叶子卡领取,不得在同一回合重复这些动作,也不得等待用户确认“是否继续”。
|
||||||
|
- 状态转换不可跳过:`IMPLEMENT_BATCH → RECORD_RESULT → ROTATE_CONTEXT → SYNC_STATE → PREPARE_NEXT → CONTINUE`;任何中间状态都不得发送终止性答复。
|
||||||
|
- 任务卡内部也不得停顿:C→D→E→F→G、源码→构建→资源→Worker→React→证据必须连续执行;只有真实阻断协议允许转入恢复卡,不能停在“稍后处理”。
|
||||||
|
- 工具命令必须等待最终退出状态;长命令用等待机制轮询到完成。禁止以“命令仍在运行”“上下文即将压缩”“已完成一张卡”作为结束理由;若平台强制中断,恢复时从状态账本和新 manifest 继续,不重做无关工作。
|
||||||
|
- 直接领取入口为 `python3 tools/continue_web_task_cycle.py`:当前卡 `in_progress` 时执行 check,并仅在批次或上下文指纹变化时 prepare/validate;当前卡 `completed/blocked` 时自动按前置完成条件选择下一张叶子卡,执行 rotate → sync → checkpoint → check → prepare → validate。该入口不擅自完成任务、不跳过阻断、不等待确认。
|
||||||
|
- 长期调度入口为 `python3 tools/run_freecad_web_scheduler.py`:在单实例锁保护下循环启动非交互 `codex exec` 回合,等待子进程结束后读取账本,再自动领取/恢复下一任务;默认直到 `TERMINATE` 才退出。可用 `--max-cycles N` 做受控演练,`--timeout SEC` 设置单回合超时,日志写入 `docs/current/continuation-runs/`。
|
||||||
|
- 调度监督入口为 `python3 tools/watch_freecad_web_scheduler.py`:独立单实例 watchdog 每 10 秒检查调度器 PID;只要账本未满足 `TERMINATE`,调度器意外退出或 PID 丢失就自动重启,并写入 `docs/current/freecad-web-scheduler-watchdog-status.json`。停止 watchdog 只接受明确 `SIGTERM/SIGINT`;watchdog 不修改任务状态。
|
||||||
|
- feature 回合达到源码读取预算时不得杀死尚未完成的 Codex turn;只在当前工具输出完整落盘后写本轮 source-budget marker,让受控 `rg/fast_source_search` 拒绝继续检索并要求直接编辑。只有收到真实 `turn.completed` 才保存同一 `batchId` 的 thread ID;下一轮恢复时只发送精简 continuation(批次身份和 record IDs),不得再次注入完整工作包。补丁冲突、会话损坏、跨批次和 token 预测超限时必须轮换新线程。
|
||||||
|
- native 中仅出现 `apiId.startsWith("<Module>:desktop:")` 不得自动晋级整族 route;只有逐命令源码语义已经审核并带 `FC_WEB_AUDITED_DESKTOP_FAMILY("<Module>")` 的 handler 才能声明整族实现。一个固定 fixture 或统一摘要不能冒充多个不同 desktop command。
|
||||||
|
- implementation packet 必须同时识别 `<slug>-python.worker.ts` 和 `<slug>.worker.ts`;已确认 family dispatch 的 Worker 只保留指纹,不再由代理重复查找。feature 首轮默认在第 5 条 source/read 完成后触发协作式熔断并进入编辑。
|
||||||
|
- feature 批次允许部分真实实现:只对已经执行对应 FreeCAD 源码语义的命令添加 `FC_WEB_IMPLEMENTED_DESKTOP_COMMAND("name")`;外层 pipeline 必须构建实际承载该代码的 Runtime/DesktopCommand target、写 `implementation_partial` 回执,并把未实现 ID 自动重排。仅返回交互摘要、参数回显、固定 fixture、restricted 或 not_implemented 的命令不得晋级。
|
||||||
|
- 实现 marker 必须由生成器复核:必须存在同名命令专属分支且该分支明确返回 `exposed`;通用 fallback、交互摘要、nonportable/not_implemented 分支内的 marker 无效。任务 ready 集合取历史回执与当前 routed capability 的交集,撤销错误 route 后旧回执不能继续跳过任务。
|
||||||
|
- feature 批量按有效回执自适应:默认 16;同一 manifest 超过 180 秒且最新 pipeline 仍为 `implementation_incomplete/ready=0` 时,若当前批量大于 4,continuation 必须自动重规划为 4 条并记录 `batchSizing.reason=stalled-zero-readiness`。产生部分或完整回执后恢复默认批量,禁止永久小批或在 16 条复杂命令上无限恢复。
|
||||||
|
- 静态验收拒绝必须通过 `staticReadiness.rejectedMarkers`(ID、command、reason)直接注入 fresh/resume 工作包,禁止只给 missing IDs 让代理重复猜测。状态页的当前回执记录数取历史回执与当前 routed capability 的交集,并另显 historical 数字;旧错误回执不得冒充有效进度。
|
||||||
|
- feature 工作包若显示 `supportChecks.desktopAdapterRecommended=true`,禁止继续扩大超大 runtime probe;参照 Part 将新增桌面实现迁到 `<Module>DesktopCommands.cpp/.h`,runtime 只保留共享调用并加入同一模块 target。默认阈值 96 KiB,可配置但不得按模块硬编码。
|
||||||
|
- probe 模块归属必须用 canonical workbench 模块名做规范化最长前缀匹配,不能把 `FemGenericFamilyProbe` 误归为 `FemGenericFamily`。命令专属验收兼容 macro 与 `name == QStringLiteral(...)` 分支、普通字符串与 QStringLiteral status;同一命令多个分支必须全部检查,不能只看首个对象类型映射分支。
|
||||||
|
- 存在 `<Module>DesktopCommands.cpp` 时,feature implementation packet 只给该小型适配器分配 C++ editable excerpts,旧大型 probe 仅保留指纹;feature registry 必须扫描 split adapter 内旧注册宏与实现 marker,并兼容 `command`/`name` 分支变量,禁止拆分后仍反复读取或重编大型 adapter。
|
||||||
|
- feature 同族批量默认 16;跨多个 source family 的 `desktop-command-mixed` 默认上限 8,并记录 `batchSizing.reason=mixed-family-cap`。两个连续 mixed 批次继续用同 target 合并链接,禁止因为缩小代理工作包而重复最终链接。
|
||||||
|
- family Facade 使用 `<slug>*python*family*facade.ts` 模式发现并兼容带 `batch` 的文件名;Worker 检查兼容 `PythonFamilyRequest`/`PythonFamilyBatchRequest`。确认统一 `fc_web_dispatch_json` 链后只保留指纹,禁止重复注入或检索稳定运输层。
|
||||||
|
- 编译首错为缺失项目头文件时,先在同模块源码和已有 probe include 中定点解析真实头文件(例如 `Part::Feature` 使用 `PartFeature.h`),只修首错并重试一次;禁止为一个 include 错误重新启动完整代理分析。
|
||||||
|
- checkpoint/ledger 投影不一致时,调度器和直接续接入口自动调用 `python3 tools/repair_continuation_checkpoint.py`,只同步 `continuation-state.json.activeTask` 与阶段时间戳,不修改任务状态、计数或阻断记录,然后立即重新校验并继续。
|
||||||
|
- 调度执行必须可观测:`codex exec --json` 的 JSONL 事件逐行写入当前 `cycle-*.log`,同时刷新 `docs/current/freecad-web-scheduler-status.json`;不得使用 `capture_output=True` 延迟到回合结束才显示。实时查看使用 `python3 tools/show_freecad_web_scheduler.py`,也可直接查看调度输出 `tail -f docs/current/freecad-web-scheduler.out`。
|
||||||
|
- 失败命令必须闭环:调度器将非零退出命令写入 `docs/current/freecad-web-scheduler-failures.json`,保留命令、退出码、首错摘要和重复次数;同一 Codex 回合内使用内存账本快照,回合结束集中写入一次,异常退出时从 JSONL 周期日志恢复,避免每条命令重复读写。下一回合只把当前批次直接相关条目注入提示;命令成功重放后标记 `resolved`,历史失败在实现阶段冻结,不得伪造通过或无限空转隐藏失败。
|
||||||
|
- 高吞吐功能入口只能是 `python3 tools/prepare_implementation_business_batch.py`:先处理桌面功能回执,再处理模块 import/export,最后处理 React 主产品页。`prepare_full_parity_module_batch.py` 属于停用的历史 API/验证规划器,实施阶段禁止调用。
|
||||||
|
- 构建并行度规则:所有后续 `cmake --build`、`ninja`、`make` 及同类编译命令统一使用当前主机自动并行度 `-j${FREECAD_BUILD_JOBS:-$(nproc)}`;本机 8 核时即为 `-j8`。禁止新建或复制 `-j2` 或低于自动并行度的命令;可用 `FREECAD_BUILD_JOBS` 在内存受限环境覆盖。当前已启动命令允许自然结束,下一条构建命令必须使用自动并行度。Emscripten 优化阶段同步使用 `EMCC_CORES=${EMCC_CORES:-${FREECAD_BUILD_JOBS:-$(nproc)}}`。
|
||||||
|
- ccache 性能规则:主机有足够物理内存时默认使用 `/dev/shm/freecad-ccache` 的 RAM-backed ccache,并保留磁盘缓存作为回退;可用 `FREECAD_CCACHE_RAM=0` 禁用,或用 `FREECAD_CCACHE_DIR` 指定路径。RAM 缓存只加速重复编译命中,不改变 native/WASM 结果;链接阶段必须保留至少 8 GiB 可用内存。
|
||||||
|
- 当前宿主的嵌套 `workspace-write` 子沙箱会触发 namespace/loopback 初始化失败;调度器因此使用 `--sandbox danger-full-access --ask-for-approval never`,但子回合仍只能执行当前 manifest、当前任务卡和仓库内工作,并且每个工具调用必须显式使用 `/home/mes123456/FreeCADWasmDev/working/FreeCAD`,不得切换到其他仓库。
|
||||||
|
- 调度器安全边界:不自行标记任务完成、不跳过 blocked、不使用破坏性 reset;只在仓库范围内执行,PID/锁防止并发调度器。收到 `SIGTERM/SIGINT` 时停止启动新回合并保留 `CONTINUE` 检查点,下次触发继续。
|
||||||
|
- scheduler/watchdog 的实际存活以 PID 对应 `/proc/<pid>/cmdline` 含预期脚本为准,不能只凭 PID 文件或旧 status。`show_freecad_web_scheduler.py` 显示 `observedState: stale` 时应由 watchdog 立即重启,不得把旧的 `codex_turn_running` 当作真实运行状态。
|
||||||
|
- 上下文接近预算、命令超时或会话中断时,先落盘当前批次和首个错误,再执行 `rotate_web_task_context.py`;恢复后只加载新 manifest 中 `mode=read` 的文件。超时同一命令只重试一次,仍失败则创建/领取恢复卡并继续其它可执行任务。
|
||||||
|
- 只有 `TERMINATE` 条件成立才允许结束:无 `active_task`、无可执行叶子卡、所有必需 Y gate 已收口;或同一外部阻断在恢复协议中连续三次复现且不存在工作区替代;或缺少无法从工作区发现的凭据/架构决策。普通失败、单卡完成、验证后置、工作量大、上下文压缩均不是终止条件。
|
||||||
|
- 最终答复只能在 `TERMINATE` 或真实阻断条件成立后发送。中间进度写入任务卡、证据 JSON、`FREECAD_WEB_HANDOFF.md` 和账本;不得用中间报告代替继续执行。
|
||||||
|
|
||||||
|
### 平台回合边界(强制说明)
|
||||||
|
|
||||||
|
- `nextTask.md` 负责持久化续接状态和执行规则,但不能在没有活动代理回合的情况下自行启动后台进程;不得声称已经创建“无限后台任务”或伪造持续运行结果。
|
||||||
|
- 当平台结束当前回合、上下文被压缩或工具调用被中断时,已落盘的 `task-state.json`、任务卡、证据和 handoff 是唯一恢复依据。下一次触发词到达后,必须立即进入 `LOAD_STATE`,从 `active_task` 继续,不要求用户重新描述任务。
|
||||||
|
- 平台回合结束不等于任务结束:不得把最终答复、阶段报告或工具中断写成 `completed`/`TERMINATE`。只有账本状态和终止条件同时满足时才可结束。
|
||||||
|
- 若执行器被迫在回合边界返回消息,消息只能报告当前检查点、首错、恢复卡和 `resumeCommand`;下一回合仍须继续执行,不得停在“等待确认”。
|
||||||
|
- 若平台在阶段中间截断,必须将 `phase` 保持为未完成阶段或 `CONTINUE`,不得写入 `WAITING`、`PAUSED`、`AWAIT_CONFIRMATION`;下一次触发从该阶段继续。
|
||||||
|
|
||||||
|
- 唯一来源原则:所有用户可观察的 FreeCAD 功能、计算、文档、格式、Python、对象和持久化行为必须来自 `freecad-source` 源程序构建出的 WASM/native probe。React/TypeScript 只能负责 Worker、Facade、消息、状态和界面适配;不得用 JS 算法、静态 JSON、硬编码几何或确定性摘要替代 WASM。
|
||||||
|
- 统一 WASM 调用铁律:Worker 调用 native 时必须使用单一 `fc_web_dispatch_json` dispatcher ABI,输入为 `{ "cmd": "<registered-command>", "args": { ... } }`,WASM 端只公开 dispatcher 入口并返回结构化结果 JSON;Facade/Worker 负责 schema 校验、错误/取消/重复语义和结果解析。禁止为每个 Python API、对象或方法新增分散的公开 WASM 函数;旧 `ccall` 导出仅作为内部兼容实现,新增功能必须先注册 dispatcher command。
|
||||||
|
- WASM 模块化铁律:按功能边界构建独立 WASM/runtime/data artifact,并在浏览器中通过独立 Worker 按需动态加载;已完成模块可由 `preload()` 常驻,新增或 revision 变化的模块只替换自身 Worker,React 页面和其它模块不得重载。禁止直接拼接 WASM 二进制,禁止要求最终合成为单体 WASM;发布清单使用 module、worker、revision/hash、runtimeUrl、wasmUrl、dataUrl 和 assetBaseUrl 描述依赖。统一动态加载实现为 `web/src/module-loader.ts`、`web/src/dynamic-worker-bootstrap.ts` 和 `WebModuleRouter.setArtifact/loadManifest`,没有 artifact override 时继续使用 `/kernel` 默认资源。
|
||||||
|
- WASM 批量构建顺序:需要一次产出所有已配置 probe 时使用 `python3 tools/build_web_module_artifacts.py`,该入口从 `FreeCADCoreProbe/CMakeLists.txt` 和已配置 build.ninja 解析 Web target,按 `-j${FREECAD_BUILD_JOBS:-$(nproc)}` 独立构建并将每个 target 的退出码写入 `docs/current/web-module-build.json`;失败 target 不阻断其它 target,但不得写成通过。构建后只运行 `node web/tools/sync-assets.mjs` 生成动态模块 manifest 和 implementation receipt,不运行 focused gate。
|
||||||
|
- WASM 测试预加载规则:Chrome 场景通过 `P6_CHROME_PRELOAD_MODULES=ModuleA,ModuleB` 指定已完成模块,先从 `/modules/manifest.json` 预取其 WASM/data 到浏览器缓存,再执行当前增量模块的动态 Worker 测试;`P6_CHROME_PRELOAD_ASSETS=wasm,data,runtime` 可扩展预取类型,并发由 `P6_CHROME_PRELOAD_CONCURRENCY` 控制且不超过 2。当前增量模块不得同时进入预加载列表;预加载失败必须写入 Chrome 证据的 `modulePreload`,不能伪造通过。
|
||||||
|
- 若现有 Facade/Worker 尚未接入 WASM,只能标记 `native_source_required`、`blocked_native_dependency` 或 `not_implemented`,先创建恢复卡继续补 native 闭包;不得把历史 slice facade 当作功能完成。
|
||||||
|
|
||||||
|
- `按 nextTask.md 接续执行`、`继续执行`、`不停歇执行` 均视为同一个持续执行信号:恢复账本中的唯一 `active_task` 后,自动完成当前卡、轮换上下文、领取下一张叶子卡并继续执行,不在卡片边界等待用户确认。
|
||||||
|
- 等价触发词还包括“继续”“接续”“不间歇执行”“自动执行下一任务”“压缩上下文后继续”;触发后不得重新询问范围,不得只输出计划,必须进入上述状态机。
|
||||||
|
- 当前回合不得因为“阶段完成”“已生成 manifest”“需要验证”或“工作量较大”主动结束;只要仍有可执行的源码、依赖、WASM、Facade、Worker、React、状态或文档任务,就继续推进。
|
||||||
|
- 正常范围内的实现选择由执行器按源码、现有模式和任务卡自动决策;不得把可由本地上下文解决的问题升级成确认请求。
|
||||||
|
- 实现优先阶段只做阻塞性编译/类型/资源存在检查;Chrome、逐 API differential、性能和发布 gate 延后,不得把延后验证写成 `pass`,也不得以验证缺口阻断实现。
|
||||||
|
- 分层验证原则:每批只做源码接线、dispatcher schema、资源释放、重复/取消和最小 native fixture;完整 API gate、全量 parity gate、Chrome 矩阵、性能和安全验证在功能族/模块收口后集中执行,不在每条 API 或每个小批次之间重复运行。
|
||||||
|
- 时间片边界:一个 Codex 回合只处理当前 manifest 的一个批次;完成该批次的实现、增量 gate、证据和 checkpoint 后立即返回,由 scheduler 在下一回合领取下一批。不得在同一回合连续领取多个批次、重复运行已通过 gate 或进行全量源码/清单扫描。
|
||||||
|
- 回合命令预算:`timing-v5` 默认每回合最多 20 个工具命令,其中 `source/read` 最多 8 个;达到读取预算后必须进入实现和当前批次 gate。接近预算时先落盘 checkpoint 并返回,由下一回合继续,禁止重复读取同一文件或完整日志。
|
||||||
|
- 步骤计时:scheduler 为每条命令记录 `schedulerPhase`、开始时间和持续秒数,并在状态中输出 `lastStepPhase`、`lastStepDurationSeconds`、`phaseTiming`;后续优化必须依据阶段占比,不得凭整回合耗时猜测瓶颈。
|
||||||
|
- 步骤计时优化:`docs/current/freecad-web-scheduler-timing.json` 只保留最近 50 个周期;`show_freecad_web_scheduler.py` 默认只读取最近 20 个周期并显示最慢命令、`unmeasuredCommands`、`unaccountedSeconds`、`measuredCycles`。阶段至少区分 `source/read`、`build`、`artifact-manifest` 和 `focused-gate`;scheduler 状态文件按 250ms 节流,关键命令/失败/阶段立即刷新;不得为获取实时状态重新扫描全部历史日志。
|
||||||
|
- Emscripten cache 修复:所有后台和手动模块构建统一注入 `tools/emscripten-writable-config.py`(`FROZEN_CACHE=False`、`CACHE=/tmp/freecad-p6-emcache`、`PORTS=/tmp/freecad-p6-emcache/ports`);不得使用系统冻结配置导致重复失败重试。
|
||||||
|
- 快速增量链接:实现/focused gate 阶段的 Web probe build tree 默认使用 `FREECAD_WEB_FAST_LINK=ON`(`fast-dev`、link `-O0`),发布和最终性能验证前必须切换为 `OFF`(`release`、link `-O2`)。manifest/evidence 必须记录 build profile,禁止用 fast-dev 结果代表发布性能。
|
||||||
|
- 构建去重规则:当前批次先集中修改源码/fixture,再执行一次正常 WASM 构建;只有明确首错才允许一次重试。成功链接后直接同步 artifact 和 gate,源码 hash 未变且产物存在时复用,不得因重复读取或重复 gate 重链同一 target。
|
||||||
|
- 模块构建选择:`tools/build_web_module_artifacts.py` 无 `--target` 时仅构建当前批次模块;发布/CI 的全量构建必须显式使用 `--all` 或 `FREECAD_WEB_BUILD_ALL=1`,实现回合不得隐式遍历所有模块。
|
||||||
|
- 主 probe 选择:实现回合无 `--target` 时,Part/Assembly/Cloud/Material/Mesh 只构建该模块的主 probe;其它同模块辅助 probe 必须显式 `--target`,避免辅助 target 的无关依赖失败拖慢当前批次。
|
||||||
|
- 构建选择预览:可用 `python3 tools/build_web_module_artifacts.py --dry-run` 查看当前模块将要构建的 target;预览不得产生编译或 artifact 修改。
|
||||||
|
- 回合读取/构建硬预算:每回合最多 8 条 `source/read` 命令;源码集中修改后最多一次正常构建和一次首错重试,随后立即落盘 evidence/checkpoint 并返回下一回合。超过预算时状态记录 `sourceReadBudgetExceeded`/`commandBudgetExceeded`,不得继续无效读取或重复重链。
|
||||||
|
- Artifact 增量同步:`web/tools/sync-assets.mjs` 必须复用 `docs/current/web-assets-sync-cache.json`;源签名未变且目标存在时跳过复制和 SHA-256,只有变化 artifact 才重新同步。子步骤耗时写入 `web-assets-sync-timing.json`,状态中必须区分 copy/hash/manifest,禁止把缓存命中误判为构建瓶颈。
|
||||||
|
- 服务并发空转保护:普通断网不纳入调度策略;仅当 Codex 事件明确报告 `Concurrency limit exceeded for account` 且在 180 秒内达到 3 次时,当前回合才提前收口并指数退避(20 秒起,最多 300 秒)。该回合记录 `streamFailed=true`,不修改任务结论,下一回合继续同一批次。
|
||||||
|
- 命令预算硬边界:命令数超过 20 或 `source/read` 超过 8 后设置预算停止状态,在当前子进程退出点收口;不重放已执行命令,下一回合从 checkpoint 继续。
|
||||||
|
- 回合空档计时:只有事件间隔且没有活动 shell 命令时计入 `agent/reasoning`;命令活动期间的间隔已经包含在 command duration 中,不得再次计入 `event/stream`。状态显示 `currentAgentGapSeconds`,周期摘要和分析器保留阶段累计。
|
||||||
|
- 代理空闲保护:若没有活动 shell 命令且连续 `FREECAD_AGENT_IDLE_LIMIT`(默认 180 秒)没有 Codex 事件,scheduler 收口当前回合并保留 checkpoint,下一回合继续同一批次;构建、gate 和其它活动命令期间不触发。该保护只处理代理空转,不把普通断网当作项目失败。
|
||||||
|
- 代理推理预算:scheduler 默认将 `model_reasoning_effort` 设为 `low`,优先缩短同批次的决策/读取等待;复杂首错可通过 `FREECAD_SCHEDULER_REASONING_EFFORT=medium|high|xhigh` 临时提高。状态必须显示当前 `reasoningEffort`,不能把模型推理时间误记成源码或构建时间。
|
||||||
|
- 收尾回合降档:若当前 manifest 的 batch id 已在 `task-state.batch_checkpoint` 以 `pass/pass_with_boundaries/completed` 收口,scheduler 对该回合自动使用 `model_reasoning_effort=low`,只执行必要的证据、gate 和 checkpoint 投影;未收口批次继续使用默认档位。
|
||||||
|
- 完成批次 fast-path:若当前批次 checkpoint/evidence 已完整,外层 scheduler 直接运行一次 `continue_web_task_cycle.py` 重新规划下一批并跳过 Codex 回合;续接失败才回退到普通代理回合,不能跳过真实证据或 gate。
|
||||||
|
- Manifest 所有权:`docs/current/module-batch-manifest.json` 只能由外层 planner 写入。Codex 回合不得手工修改其 `status/selected/records/batchId` 或为通过校验改 hash;gate 只写 evidence/canonical disposition,manifest/context 由下一次外层续接自动刷新。
|
||||||
|
- 当前效率排序:已完成 evidence 的批次优先走 `scheduler/fast-path`(目标约 1 秒);普通实现回合优先使用 `low` 推理和最多 8 条检查命令;构建前先做 pthread/Qt/OCCT/外部库闭包预检,首错只允许一次定点修复;准备、源码读取、artifact 和 focused gate 不得重复优化已低于秒级的路径。门禁复用必须匹配记录集合和 WASM/runtime SHA-256,阻断复用用明确 deferred 非零码,不得伪造通过。
|
||||||
|
- 构建前预检命令:每个新的 Web target 必须先执行 `python3 tools/check_web_link_closure.py <build-dir> <target> --json`;预检发现 pthread/QtConcurrent/模块化 WASM link flag 缺失时,先修复 CMake,再启动完整链接,避免 `100s+` 失败链接。
|
||||||
|
- 闭包预检缓存:`check_web_link_closure.py` 缓存每个 `build.ninja` 的静态 link rule(`inode+mtime+size`),每次仍实时检查 OCCT 归档和 runtime/wasm;CMake 重生成自动失效,禁止用旧预检结果掩盖新链接规则。
|
||||||
|
- target 别名兼容:闭包预检将当前批次常见的 `FreeCADCoreProbe` 别名解析为当前模块主 probe,并在 JSON 记录 requested/resolved target;未知 target 仍保持失败。
|
||||||
|
- build 目录兼容:闭包预检同时接受 `configure` 和 `configure/bin`,自动归一到包含 `build.ninja` 的 build tree,并记录 requestedBuildDirectory。
|
||||||
|
- 阻断 evidence 去重:`blocked_native_probe` 只要已有真实 runtime evidence 和 `apiId` 列表,就从正常 planner 队列暂时移出并继续其它模块;不得重复同一 gate 空转,也不得把 blocked 改写为 pass。后续恢复阶段按证据定点重试。
|
||||||
|
- 门禁证据复用:focused gate 可以复用既有 `pass/pass_with_boundaries` 或 `blocked_native_probe`,但必须同时匹配当前批次记录集合和 WASM/runtime artifact SHA-256;artifact 变化后必须重新探测。复用阻断证据使用明确的 deferred 非零退出码(例如 78),不得用退出 0 伪装通过。
|
||||||
|
- 空队列短路:`module-batch-manifest.status=no_ready_batch` 时,scheduler 只允许执行一次轻量 planner 重试并记录 `scheduler/no-ready`,随后等待下一次状态变化;不得为同一空队列启动 Codex 实现回合。
|
||||||
|
- 无构建目标的 feature 刷新:外层续接在实现优先模式下比较 `*Probe.cpp`/`*DesktopCommands.cpp` 的 `mtime_ns` 与能力注册表;源码确有变化才运行一次受控 `generate_feature_capability_registry.py`,并按当前 `implementationStatus=routed` 集合立即收缩批次。不得因没有 pipeline receipt 重复领取已路由记录,也不得为此触发构建或全量检索。
|
||||||
|
- 源码读取硬收口:达到软读取预算只设置 marker;若随后 `sourceReads >= sourceReadHardLimit` 且本回合仍 `fileChanges=0`,调度器在下一事件协作终止当前回合并从 checkpoint 重新领取同一批次。已有修改时不打断,避免丢失补丁;不得在无 packet 锚点时继续猜测路径。
|
||||||
|
- Native packet 发现:除标准 `*Probe.cpp` 外,受控 probe 目录按模块前缀匹配 `*ProbeFixed.cpp` 与 `*InventoryApi.cpp`,为实际 C++ 变体提供 editable native 锚点和 build hint。packet 无 native excerpt 时先修复发现规则,禁止仓库级 `find/ls` 猜路径。
|
||||||
|
- Native packet 聚焦:feature desktop 批次存在 `fc_web_dispatch_json` 时,只把 dispatcher owner 的 C++ 文件作为 editable excerpt,其它同模块 probe 仅保留指纹;不得重复注入稳定 file-tail。这样减少 `post-read` 上下文,不改变构建 target 或功能证据。
|
||||||
|
- Registry 与 packet 一致:能力 registry 同样必须在受控 probe 目录扫描模块前缀匹配的 `*InventoryApi.cpp`,并解析其中的 `FC_WEB_IMPLEMENTED_DESKTOP_COMMAND`;否则真实 marker 会被误报为 `ready=0`。修复后只刷新静态 registry/manifest,不伪造 WASM 构建或运行时验证。
|
||||||
|
- 首次构建目标发现:implementation packet 的 build hint 先从受控 `build.ninja` 确认 target rule,再推导 build tree 和预期 JS/WASM 路径;不得因产物尚未生成而返回空 build 或让代理重复源码回合。target 未配置时才允许 `outerPipelineAvailable=false`。
|
||||||
|
- fast-path 完成条件:只有当前批次所有 selected record 的 evidence 状态均为 `exposed/restricted/nonportable/blocked_native_probe` 等真实终态时才允许 `scheduler/fast-path`;顶层 `pass_with_boundaries` 若仍含 `not_implemented/planned`,必须回到 planner 推进下一批,禁止空转。
|
||||||
|
- 证据索引:planner 使用 `docs/current/module-batch-evidence-index.json` 缓存 runtime evidence 的终态记录,按 `size+mtime+inode` 失效;`passed_boundary` 也属于真实终态;`method_evidence_pending`、`source_execution_timeout` 等未实现记录不能因为父 evidence 为 `pass_with_boundaries` 而被索引为已覆盖。
|
||||||
|
- 单次索引扫描:planner 在同一进程内同时复用 terminal/pending evidence ID 集合,不重复解析同一批 runtime JSON;显式 `FREECAD_RETRY_EVIDENCED=1` 才重新放回已有 pending evidence。
|
||||||
|
- evidence 结构兼容:runtime evidence 的记录可能位于顶层 `records` 或 `result.records`;planner、续接入口和 fast-path 必须统一解析两种结构,避免边界批次被重复领取。
|
||||||
|
- 批次执行前预检:scheduler 在启动 Codex 前运行 `python3 tools/preflight_current_module_batch.py --json`,只检查 active task、manifest 的 module/tier/family、最小记录数、singletonFallback 和 context packet;失败先重新续接/重规划,不启动代理实现回合。
|
||||||
|
- 重复首错保护:同一回合同一命令连续失败达到 `FREECAD_REPEATED_FAILURE_LIMIT`(默认 3)时,scheduler 立即保留日志并收口当前代理回合,下一回合按 checkpoint 继续;不得继续重复同一失败命令消耗时间。
|
||||||
|
- 步骤计时优化:`docs/current/freecad-web-scheduler-timing.json` 只保留最近 50 个周期;`show_freecad_web_scheduler.py` 默认只读取最近 20 个周期并显示最慢命令、`unmeasuredCommands`、`unaccountedSeconds`、`measuredCycles`。scheduler 状态文件按 250ms 节流,关键命令/失败/阶段立即刷新;不得为获取实时状态重新扫描全部历史日志。
|
||||||
|
- `timing-v5` 细分:代理非命令时间必须拆成 `initial-decision/editing/post-read/post-edit/failure-recovery/post-build/post-gate/synthesis/finalization/idle-stop`,调度退出单列 `scheduler/stream-drain`;每个阶段保存事件 count、总时长、均值和最大值,不再用单一 `agent/reasoning` 掩盖慢点。
|
||||||
|
- 精简回合输入:外层批次和 context 预检成功后,子回合直接使用 scheduler 注入的 batchId、module/tier/family、record id/name/source 和复用候选;禁止再次读取完整 `nextTask.md`、`task-state.json`、历史日志和无关前置卡。当前 manifest 只在确需其它字段时读取一次。
|
||||||
|
- 复合命令拆分:link preflight、build、focused gate、`validate_incremental_context.py` 分别执行以保留真实计时;旧复合命令归类为 `build+preflight`、`build+focused-gate` 或 `focused-gate+context`,不得把链接成本记到 preflight。
|
||||||
|
- 冗余执行保护:同一文件修改代次内规范化命令重复执行时统计 `duplicateCommands/Reads/Gates/Builds` 和耗时;达到 `FREECAD_REDUNDANT_COMMAND_LIMIT`(默认 3)立即收口。两次 patch 校验冲突达到 `FREECAD_PATCH_CONFLICT_LIMIT`(默认 2)也立即收口,下一轮重新读取目标并应用小 patch。
|
||||||
|
- Node WASM loader 复用:新 gate 优先使用 `tools/wasm-probe-runtime.mjs` 统一 build/bin 归一、pthread `.worker.cjs` 刷新和 `locateFile`;禁止继续复制模块专用 loader bootstrap。
|
||||||
|
- 子回合退出优化:收到 `turn.completed` 且 JSONL/usage 已落盘后只保留 0.5 秒 drain;若 Codex tool-host 仍驻留,则终止这个已完成的子进程并保持成功退出,禁止每轮固定等待约 10 秒。
|
||||||
|
- token 计量与读取上限:timing v2 保存每轮 input/cached-input/output/reasoning-output token;源码先定位,单文件只读命中前后 80 行,每条读取命令输出最多约 240 行。工作包必须给出从 CMake/artifact 推导的准确 target/build tree 和 preflight 命令,禁止无参数预检和路径猜测。
|
||||||
|
- 读取命令硬护栏:scheduler 子回合 PATH 必须优先 `tools/scheduler-bin`;wrapper 拒绝仓库级/大目录 `rg`,并要求 `git diff/status` 使用 `-- <current-files>` pathspec。退出 64 归类为 `inspection-scope`,随后改用工作包候选或 `fast_source_search.py`,不得绕过 wrapper。
|
||||||
|
- 模块实现包:外层 batch preflight 后必须运行 `python3 tools/prepare_module_implementation_packet.py`,只按当前 manifest 源路径用 AST/行号提取有界官方源码片段,并写入 support file fingerprint、统一 dispatcher/Facade/gate 检查、native name 命中,以及 native/Facade/Worker 的有界可编辑片段。子回合优先直接使用这些片段;只有编辑锚点缺失或 fingerprint 改变时才定点重读,禁止先重复转储全部 support 文件。
|
||||||
|
- Probe 名称规范化:模块到 `*Probe.cpp` 的匹配必须大小写无关并移除非字母数字字符,例如模块 `BIM` 必须发现 `BimRuntimeProbe.cpp`;缺少已知 handler 时至少提供 family/ABI 或有界文件尾锚点,不允许 `editableExcerptBytes=0` 后让代理全仓搜索。
|
||||||
|
- C++ 命令语义包:若 manifest 行号位于 `Command("...")` 构造函数,implementation packet 必须自动定位同一类的 `activated()` 并提取其中实际 App/Document 方法调用,不能只把菜单文字交给代理后再搜索整个模块目录。
|
||||||
|
- 多锚点编辑:implementation packet 对 native 文件分别提供 desktop handler、命令注册、family dispatch、统一入口片段,对 Facade/Worker 提供 contract/native-call/validation/dispatch 片段;同一文件单回合只提交一次集中补丁。feature 首次 patch conflict 即收口,冲突会话禁止 resume。
|
||||||
|
- 会话复用:scheduler 将 `thread.started.thread_id` 写入 session cache。普通 API 批次可按模块复用至 8 轮;`feature-workflow` 只允许相同 batchId 复用至 3 轮,并统一使用 low reasoning,因为语义和编辑锚点已由 implementation packet 提供。预测 input 达到 800000、模块/batch 变化或回合失败时立即新建会话,禁止跨功能批次携带旧实现假设。
|
||||||
|
- Desktop 路由生成:命令所有权、transport 和 Worker 必须由 native `FC_WEB_DESKTOP_COMMAND`/`QStringList` 注册与 Worker request handler 自动生成到 `desktop-command-routes.json`。React 只使用统一 `DesktopCommandDispatcher` 和原始 `args`;不得复制模块专用命令清单、逐命令默认参数或固定结果。跨工作台重复命令复用 canonical owner,不得重复实现。
|
||||||
|
- 通用 Desktop family:native 若存在 `if (apiId.startsWith("Module:desktop:"))` 的真实执行分支,生成器将其视为模块级 family registration 并路由全部对应矩阵命令;不得要求代理再复制逐命令白名单。`.desktopCommand` 等 transport alias 不计入用户功能分母。
|
||||||
|
- Workbench UI 容器:`Workbench.cpp` 中 `MenuItem/ToolBarItem.setCommand()` 后继续通过 `*item <<` 或 `add...(*item)` 装入子命令的记录属于 React navigation container,不是 native 命令。生成器必须标为 `ui-container/react-navigation`,点击返回源码追踪的 UI 结果,不得为菜单分组启动 WASM 实现回合。
|
||||||
|
- Python 命令组:对 `FreeCADGui.addCommand(name, GroupClass())`,若 `GroupClass` 定义 `GetCommands()`,必须通过 AST 标为 React UI 容器。纯 UI-container 批次由 pipeline 写 `react-navigation` 回执并设置 `buildRequired=false`,禁止启动 native 编译。
|
||||||
|
- Feature 批次预检:`freecad-web-feature-capability-batch/v1` 使用 `feature-workflow` tier、`Module:*` ID 和 `module|family|ids` batch identity;不得套用旧 `py:/obj:` API 批次规则并触发每轮 repair。
|
||||||
|
- Feature 链接摊销:同一 source family 默认每批 16 条(`FREECAD_FEATURE_BATCH_SIZE` 可在 1-32 调整),集中修改后只链接一次;runtime issue 默认最多 4 条。不得按单命令重复链接同一个模块。
|
||||||
|
- Feature 尾批合并:首个 desktop source family 不足批次上限时,可继续装入同一模块的其它 desktop family,并以 `desktop-command-mixed` 一次实现/链接;禁止混入其它模块或 runtime issue。用于消除 `7+3+1+1` 这类长尾的逐组最终链接。
|
||||||
|
- Feature 链接合并:当同一模块、同一 family 明确还有下一批且现有 artifact 可用时,第一批写入 `module-build-pending.json` 并返回 `implementation_pending_build`,第二批集中执行一次链接并同时写两批回执。`FREECAD_FEATURE_LINK_BATCHES=1` 可关闭;runtime issue、最后一批和首次 artifact 必须立即构建。
|
||||||
|
- Pending 回执:延期链接时必须同时在 implementation registry 写 `implementation_pending_build` batch/record 状态,使 continuation planner 领取下一批;成功合并链接后覆盖为 `implementation_ready`。仅写 pending 文件会导致同 batch 重复代理和提前构建,禁止。
|
||||||
|
- Feature 读取预算:implementation packet 可用时目标为 4 条定点读取;复杂首轮在尚未修改文件时可继续到硬上限 6,避免过早终止后 fresh 重建上下文。已有修改后超出软预算或未修改时超过硬上限才收口;分别由 `FREECAD_FEATURE_SOURCE_READS`/`FREECAD_FEATURE_SOURCE_READS_HARD` 配置且不超过普通上限 8。
|
||||||
|
- 检索零命中:调度专用 `rg` 仅搜索显式文件;合法退出 1/空输出归一为 `SCHEDULER_RG_NO_MATCH`。混合参数中的目录被忽略,只有目录时返回 `SCHEDULER_SEARCH_SCOPE_SKIPPED` 成功并要求改用 manifest-scoped `fast_source_search.py`,不再制造失败账本。历史同类假失败启动时自动标记 `normalized_rg_no_match`。
|
||||||
|
- 检索输出边界:调度专用 `rg` 自动使用 `--max-columns 240 --max-columns-preview`,防止 minified JSON/TS 的单行命中绕过 `head` 并向代理注入整份文件。
|
||||||
|
- `fast_source_search` 兼容与总量边界:接受 `-n`、`--paths`、`--glob` 和直接可执行调用;scheduler-bin 提供 `python→python3`。`--max-count` 是全局输出行数上限,不得沿用 ripgrep 的逐文件语义导致数百行输出。
|
||||||
|
- 登录 shell wrapper:scheduler 必须设置 `BASH_ENV=tools/scheduler-shell-env.sh`,保证 Codex 的 `bash -lc` 读取登录配置后仍将 `tools/scheduler-bin` 放在 PATH 首位,否则目录过滤和输出边界无效。
|
||||||
|
- 构建首错保留:pipeline 对失败命令必须保存短头部和输出尾部,确保 CMake 配置噪声之后的真实编译器错误进入恢复工作包;成功输出仍使用头部压缩。不得用仅含 `FAILED:` 的截断记录驱动猜测修复。
|
||||||
|
- 大批次减少上下文重建:非对象契约的 `pure-function/geometry-value` 允许自适应扩大到 32 条;其它普通批次保持 24、对象契约保持 16、Part generic-object 保持 12 的内存边界。
|
||||||
|
- 外层确定性流水线:implementation packet 同时给出 target/build tree/generic gate;可用时 Codex 只负责源码判断和编辑,返回后由 scheduler 调用 `run_module_batch_pipeline.py`,按 source/artifact mtime 决定是否构建,再依次执行 preflight、增量 build/sync、focused gate、incremental context。流水线失败只把首错注入同一模块恢复会话,禁止代理在成功步骤之间重复思考。
|
||||||
|
- 构建复用安全线:mtime 只能用于诊断,不能首次授权跳过。只有先前一次真实 build+focused-gate 成功后保存的 native/CMake/build.ninja input SHA-256 与 runtime/WASM SHA-256 同时匹配,且直接链接 archive 均不比 artifact 新,才允许 `content-hash` 复用;无可信 entry、任一内容变化、依赖变新或 artifact 变化都必须真实构建,失败不得写 cache。
|
||||||
|
- 编译首错快车道:当前 batch 的 pipeline 若在 `build` 阶段失败,且 packet 支持文件 mtime 均未晚于失败报告,则跳过重复 pre-turn build,直接把已有 `file:line: error` 交给同 batch 短会话修复;只有源码/依赖实际变化才重新构建。编译恢复会话与 feature 会话均禁止跨 batch 复用。
|
||||||
|
- 收口等待优化:源码 `file_change` 已持久化后,默认 `FREECAD_POST_EDIT_FINALIZE_SECONDS=20` 秒无事件即交给外层编译;编译首错恢复默认 `FREECAD_COMPILE_RECOVERY_IDLE_LIMIT=30` 秒无事件收口。两个值保留环境变量覆盖,不能降低已有命令、超时和 patch-conflict 安全边界。
|
||||||
|
- 实现命令防逃逸:实现回合必须拦截 `npx --prefix <dir> tsc`、`npm --prefix <dir> run build` 以及复合 `git diff/status`,不能让包装参数绕过验证禁令并把既有类型错误写入当前失败账本。
|
||||||
|
- Gate 编译缓存:模块 gate 的 TypeScript cache key 必须包含所有直接 TS 输入、Node 和 TypeScript 版本;只有 tsc 成功后写 `.complete` marker,marker/输出任一缺失立即重新编译。证据记录 `compileCacheHit/compileSeconds/workerReadySeconds/dispatchSeconds`,不得缓存 native gate 结果。
|
||||||
|
- 批次自适应使用最近 3 个同 `(module,tier,family)` 的 `effectiveCycleSeconds`、记录吞吐和失败状态;任一失败缩半,平均超过 420 秒减 4,低于 90 秒且吞吐至少 0.25 record/s 增 8,低于 240 秒增 4,并继续遵守各 family 内存上限。
|
||||||
|
- 效率优化回归门:修改 scheduler、implementation packet、build reuse、session、gate cache 或 pipeline 后必须运行 `python3 tools/test_scheduler_efficiency.py`。该测试覆盖非标准 gate 名选择、拒绝不兼容 gate、hash 失效、直接 link archive 跟踪、批次增减、token 预测轮换,以及 compile cache 仍真实执行 Worker/native dispatch/resources release;失败时不得加载新调度器。
|
||||||
|
- 状态查询边界:`show_freecad_web_scheduler.py` 的效率统计默认最多读取最近 20 个周期(`FREECAD_EFFICIENCY_WINDOW` 可覆盖但不超过 50),不能使用 scheduler lifetime 回合数扩大日志扫描范围。
|
||||||
|
- 外层准备计时:状态中的 `preparationTiming` 分别记录 `continue`、`compact`、`continueRetry`、`checkpointRepair`;正常回合只应出现 `continue`,异常回合才允许出现恢复步骤。
|
||||||
|
- 批次自适应:未显式指定 `--size` 时,planner 根据上一回合同一 `(module,tier,family)` 的耗时/超时自动缩小或放大下一批,并在 manifest 写入 `targetSizeReason`;复杂批次优先避免撞超时,轻量批次逐步提高吞吐。
|
||||||
|
- 内存边界:Part `generic-object` 批次默认最多 12 条记录,避免多个 OCCT 2D/3D wrapper 同时构造触发 WASM heap 越界;其它族继续遵循 object-contract 16、普通批次 24 的上限。
|
||||||
|
- Gate 前后去重:scheduler 只运行一次续接入口;批次状态未变时复用 `module-batch-manifest.json`,上下文输入 `bytes+mtime_ns` 未变时复用 context packet;失败账本按回合内存快照集中写入,重启只导入新的完整周期日志。
|
||||||
|
- 进度口径:实现阶段以 `featureRoutes`、`featureInteractive`、`featureArtifacts`、`implementationReceipts` 和 `runtimeIssues` 为主。`taskCards` 是历史工作流终态;`apiEvidenceExposed`/`apiClassified` 是后置验证与源码索引,不得再解释为 Web 功能完成率。
|
||||||
|
- 源码检索边界:禁止从仓库根目录对 `freecad-source`、`web/src` 或 `tools` 做全量 `rg`/`find`/批量 `sed`;优先使用 `python3 tools/fast_source_search.py 'Pattern'` 搜索当前批次 manifest 的源码文件,需要 runtime 适配时显式加 `--runtime`,其它文件必须用受控 `--path` 指定。
|
||||||
|
- 检索参数兼容:`fast_source_search.py` 同时接受重复 `--path` 和其后的显式路径参数,并使用 intermixed parsing;通配展开不会再因参数位置导致退出 2,所有路径仍经过 workspace 边界校验。
|
||||||
|
- 检索无匹配语义:`fast_source_search.py` 对 ripgrep 的无匹配退出 1 归一为成功探索(返回 0),真实参数/IO 错误仍返回非零,避免 `rg ... &&` 链误阻断实现。
|
||||||
|
- 已知失败防线总表:见 `docs/KNOWN_FAILURE_PREVENTION.md`;新增失败模式先归类为可预检或运行时边界,再补对应自动防线,禁止只增加重试次数。
|
||||||
|
- 新失败自动归档:scheduler 每次保存失败账本同步更新 `docs/current/failure-patterns.json`;未匹配错误进入 `other` 并保留代表命令/首错,后续必须从该索引补充预检或恢复规则。
|
||||||
|
- 失败分类兜底:即使 stderr 为空,也按 `run_p6_`、`cmake --build`、`prepare_/validate_/rotate_` 命令形态归档为 gate/build/orchestration failure,避免新经验丢入不可操作的 `other`。
|
||||||
|
- 补丁冲突防线:`apply_patch verification failed`、`invalid patch`、`multiple operations target` 单独归类为 `patch-apply-conflict`;重新读取当前文件后拆成单文件/单目标 patch,禁止原补丁盲目重放。
|
||||||
|
- 状态检查参数兼容:`check_continuation_state.py --json` 输出稳定 machine-readable 结果,默认文本和 `--quiet` 语义保持不变,避免状态检查因参数退出 2。
|
||||||
|
- 每次上下文接近预算上限、命令超时或会话压缩,先落盘当前结果和首错,再轮换到当前卡或恢复卡;恢复后只读取新 manifest,不重复无关任务。
|
||||||
|
- 任务卡结果必须包含 `nextTask`、`nextAction`、`contextRotation` 和 `resumeCommand` 字段或等价 Markdown 条目,保证下一个执行器无需依赖本轮对话即可继续。
|
||||||
|
- `resumeCommand` 的默认值为:`python3 tools/continue_web_task_cycle.py`;该入口内部先检查账本,仅在批次/上下文指纹变化时生成上下文并运行增量校验。恢复后不得读取旧聊天记录替代 manifest。`validate_web_context.py` 是全量验证入口,在全部移植任务完成后仅响应用户明确指令执行。
|
||||||
|
- 接续文件读取边界:自动回合只读取本文件第 20-70 行的规则和第 72-85 行的当前检查点;后续旧恢复示例、历史报告和重复命令块仅供人工参考,不得再次加载进上下文或执行。结构化状态以 `task-state.json`、`continuation-state.json` 和当前 context manifest 为准。
|
||||||
|
- 只有满足“无可执行叶子卡且所有 Y gate 已收口”、或同一外部阻断按恢复协议连续三次复现且无本地替代、或确需用户提供无法从工作区发现的凭据/架构决策,才允许结束并发送最终报告。
|
||||||
|
|
||||||
|
## 当前检查点
|
||||||
|
|
||||||
|
本节是机器投影,不是独立状态源。每次领取或完成任务必须由
|
||||||
|
`tools/sync_web_task_state.py` 自动刷新;若本节与 `docs/current/task-state.json`
|
||||||
|
不一致,以 JSON 为准并先运行同步/校验命令。
|
||||||
|
|
||||||
|
- 活动任务:`FW-P6-FPA-Y`
|
||||||
|
- 任务:FreeCAD Web Full Parity 完整出口
|
||||||
|
- 状态:`in_progress`
|
||||||
|
- 当前模块:`full-parity`
|
||||||
|
- 已构建动态模块资产:32 个逻辑模块(这只表示模块化 WASM 基础,不表示完整业务完成)
|
||||||
|
- 完整业务状态:`incomplete`;实时差距和 P1-P3 阶段见 `docs/current/web-business-completion-audit.json`
|
||||||
|
- 唯一状态源:`docs/current/task-state.json`
|
||||||
|
- 当前交接页:`docs/current/FREECAD_WEB_HANDOFF.md`
|
||||||
|
- 当前上下文摘要:`docs/current/FREECAD_WEB_CONTEXT_MIN.md`
|
||||||
|
- 对标矩阵:`docs/web-parity-matrix.json`
|
||||||
|
- 业务完成审计:`docs/current/WEB_BUSINESS_COMPLETION_AUDIT.md`
|
||||||
|
|
||||||
|
### 最近阻断续接状态(2026-08-30)
|
||||||
|
|
||||||
|
- BIM 调用协议已统一:`fc_web_dispatch_json` 接受 `{cmd,args}` JSON 并返回结果 JSON;`bim.inspectSourceInventory`、`bim.inspectPythonApi`、`bim.createAxis`、`bim.extrusionData`、`bim.nativeProbe`、`bim.pythonFamily` 已全部经该入口运行,`bim.pythonFamily` 已覆盖 28 个 API,证据为 `docs/p6/bim-dispatch-json.json` 与 `docs/p6/bim-python-family-api.json`。
|
||||||
|
- Fem 依赖闭包已解除:VTK 9.1(含 HDF5/lz4/lzma/zlib/expat)、MEDFile 4.1、wasm HDF5、OCCT `TKMeshVS` 与内部 Salome SMESH 均由源码构建;`FreeCADWebFemGenericFamilyProbe` 已同步 Web,Node smoke 返回 `registered=41/missing=0`。`fem.action` 的 `create/recompute`、`inspect/source-inventory` 走 native probe,Python/save-reopen 仍等待方法级 ABI。
|
||||||
|
- ArchComponent/FeaturePython 阻断已解除:补回官方 Arch preferences 的 `MoveBase=False`、`MoveWithHost=True` 默认值后,`bim.nativeProbe` 的 `archcomponent-import`、`archcomponent-properties`、`archcomponent-create`、`featurepython-base` 均由 WASM 稳定通过 TypeId/Proxy/重算/资源释放;历史 code 7 仅保留为修复前证据。
|
||||||
|
- Arch Axis 对象族也已解除:`bim.createAxis` 使用 native `PropertyFloatList::setValues` 后返回 `Part::FeaturePython`/`Axis`、3 条边、重算和资源释放,已从 policy 放行;历史 code 7 仅保留为修复前证据。
|
||||||
|
- Legacy IFC importer 阻断已解除:BIM staging 纳入同一 Emscripten Python 构建的顶层纯 Python `.py` 模块和本地 Assimp/Qt3D 提供的官方 IFC2X3 EXPRESS schema;修复 parser 的 schema section、`pyopen`、`copy` 缺口后,`legacy-import`、`legacy-python-parser`、`legacy-parser-fixture` 均由 WASM 通过。IfcOpenShell 不在提供的源码树中,专用外部 ABI/导出仍是明确的 `native_source_required` 边界。
|
||||||
|
- 最新 BIM probe 产物:`freecad-source/build-web/configure/bin/FreeCADWebBimRuntimeProbe.{js,wasm,data}`,已同步到 `web/public/kernel/`;Web `bim.worker` 已接入 `bim.nativeProbe` facade。
|
||||||
|
|
||||||
|
## 立即续接
|
||||||
|
|
||||||
|
从项目目录执行:
|
||||||
|
|
||||||
|
~~~sh
|
||||||
|
python3 tools/check_continuation_state.py
|
||||||
|
python3 tools/continue_web_task_cycle.py
|
||||||
|
python3 - <<'PY'
|
||||||
|
import json
|
||||||
|
s=json.load(open('docs/current/continuation-state.json'))
|
||||||
|
t=json.load(open('docs/current/task-state.json'))
|
||||||
|
assert s['autoAdvance'] is True and s['activeTask'] == t['active_task']
|
||||||
|
print('continuation checkpoint:', s['activeTask'], s['phase'])
|
||||||
|
PY
|
||||||
|
~~~
|
||||||
|
|
||||||
|
需要启动长期自动调度时执行:
|
||||||
|
|
||||||
|
~~~sh
|
||||||
|
python3 tools/run_freecad_web_scheduler.py
|
||||||
|
~~~
|
||||||
|
|
||||||
|
为保证调度器意外退出后自动恢复,长期运行时同时启动独立监督进程(默认每回合 1800 秒时间片):
|
||||||
|
|
||||||
|
~~~sh
|
||||||
|
nohup setsid python3 tools/watch_freecad_web_scheduler.py --interval 10 --timeout 1800 --idle-delay 30 > docs/current/freecad-web-scheduler-watchdog.out 2>&1 < /dev/null &
|
||||||
|
~~~
|
||||||
|
|
||||||
|
状态检查:
|
||||||
|
|
||||||
|
~~~sh
|
||||||
|
cat docs/current/freecad-web-scheduler.pid
|
||||||
|
python3 tools/check_continuation_state.py
|
||||||
|
~~~
|
||||||
|
|
||||||
|
只读取当前 manifest 中 `mode=read` 的文件,然后执行账本中的活动任务。完成当前卡后,追加卡片 `## 结果`,保存 JSON/日志/hash,使用账本工具关闭当前卡并领取下一张:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
python3 tools/sync_web_task_state.py --set <CURRENT_TASK>=completed --active <NEXT_LEAF_TASK>
|
||||||
|
python3 tools/prepare_web_task_context.py
|
||||||
|
python3 tools/validate_incremental_context.py
|
||||||
|
```
|
||||||
|
|
||||||
|
不得读取完整源码树、完整 inventory、原始日志或归档来代替 manifest;不得同时领取多个 `in_progress` 任务。
|
||||||
|
|
||||||
|
账本工具在 `--active NEXT` 时会自动清理遗留的旧 `in_progress` 投影,保证始终只有一个可执行活动任务;外部依赖阻断时保留 `blocked` 和恢复卡,再领取不依赖它的任务。
|
||||||
|
|
||||||
|
`--active` 必须指向模块目录下的叶子任务卡,不能指向 `FW-P6-<MODULE>` 模块包;被标记为 `blocked` 的卡不能直接领取,必须先有明确恢复动作。每次切换后必须运行校验器;校验失败时不得领取下一卡。
|
||||||
|
|
||||||
|
## 连续执行协议(强制)
|
||||||
|
|
||||||
|
“按 nextTask.md 接续执行”是连续循环,不是只处理一张卡的建议。执行者必须在当前回合持续推进,不在卡片之间等待确认、询问是否继续或只提交计划。
|
||||||
|
|
||||||
|
每轮严格执行(实现优先阶段):
|
||||||
|
|
||||||
|
1. `校验`:以 `docs/current/task-state.json` 为唯一状态源,运行 `check_continuation_state.py`;只有批次或上下文指纹变化、缺失或修复后才运行 `prepare_web_task_context.py`,随后运行 `validate_incremental_context.py`。只校验当前活动批次和上下文,活动卡若已 `completed/blocked`,先领取真实的下一个叶子卡。全量 `validate_web_context.py` 不在移植过程中运行。
|
||||||
|
2. `读取`:只读取当前 manifest 的 `mode=read` 文件;源码只按当前卡命令定点读取,不加载完整源码树、inventory、归档或原始日志。
|
||||||
|
3. `执行`:优先完成当前卡的源码、依赖闭包、WASM、Facade、Worker、React 入口和跨模块功能链;按功能批次推进,不因 exhaustive Chrome/逐 API smoke 尚未完成而停顿。命令仍必须等待进程结束,超时或断流不得视为通过。
|
||||||
|
4. `保存`:追加任务卡 `## 结果`,保存实现产物、变更范围、输入/输出路径和已知边界;后置验证阶段再补 JSON、日志、输入/结果/WASM/截图 hash。首次失败只新增 R1/R2 文件,不覆盖已有证据。
|
||||||
|
5. `闭环`:先校验产物,再运行 `sync_web_task_state.py --set CURRENT=completed --active NEXT_LEAF`,随后立即回到第 1 步。动作拆分卡必须连续执行 C→D→E→F→G,不能在中间停顿。
|
||||||
|
|
||||||
|
连续循环伪代码:`while (可执行任务 || active_task) { load_context(); implement(); persist_result(); rotate(); sync(); prepare(); }`。不得在循环体内发送最终答复;中间进度只能写入任务卡、handoff 和账本。
|
||||||
|
|
||||||
|
执行者不得因为“当前卡已完成”“已生成报告”“验证尚未集中执行”或“已经取得阶段性进展”而发送最终答复;这些都只是循环中的中间状态。长命令必须用等待机制取得最终结果,随后继续下一卡。只有终止条件成立时才结束回合并发送最终报告。
|
||||||
|
|
||||||
|
## 上下文隔离与超时
|
||||||
|
|
||||||
|
- 每张任务卡使用独立上下文空间;不得把上一张卡的 manifest、源码扫描、原始日志或大证据带入下一张卡。
|
||||||
|
- 完成当前卡并保存结果后,由外层 scheduler 执行一次 `rotate_web_task_context.py --reason completed --next-task NEXT_LEAF`、`sync_web_task_state.py --active NEXT_LEAF` 和 `prepare_web_task_context.py`;Codex 回合内部不得重复调用这些轮换/准备工具。上下文 manifest 的 `bytes+mtime_ns` 指纹未变化时直接复用,变化时才重建并增量校验。
|
||||||
|
- 命令、浏览器、代理或上下文操作超时后,立即保存首个错误摘要,执行 `rotate_web_task_context.py --reason timeout --next-task CURRENT_OR_RECOVERY`,压缩后只重试一次;超时不能写成通过。
|
||||||
|
- 轮换工具只处理 `docs/current/context/FW-*.json` 机器生成文件;源码、任务卡、证据 JSON、日志、归档和构建产物必须保留。
|
||||||
|
|
||||||
|
阻断时:记录首个可复现错误、命令、输入 hash 和恢复卡,将卡标记 `blocked`,立即领取第一个不依赖该阻断的 pending 叶子卡;不得伪造 `pass`,不得反复领取同一 blocked 卡。
|
||||||
|
|
||||||
|
compact、代理或网络断流时:从本地账本、交接页和 context manifest 恢复,不重做无关任务;任何仍在运行的命令必须先等待完成或明确终止,再切换下一卡。
|
||||||
|
|
||||||
|
只有所有可执行任务和相应 Y gate 完成、同一外部阻断按恢复卡连续三次复现且无本地替代,或需要用户提供本地无法发现的凭据/决策时才终止。普通失败、上下文压缩、单次网络错误、工作量大或单卡完成都不是终止条件。
|
||||||
|
|
||||||
|
## 完整对标范围
|
||||||
|
|
||||||
|
下表来自当前 `docs/web-parity-matrix.json`。模块只有对应 Y gate 才能变为 `completed`;首切片 X gate 不代表模块完成。每个动作必须独立完成 C-G 子链。
|
||||||
|
|
||||||
|
| 模块 | 状态 | 必须对标动作 | 对象数 | 格式 | Python API |
|
||||||
|
|---|---|---|---:|---|---:|
|
||||||
|
| Assembly | completed | create/recompute, inspect/source-inventory, python-api, save/reopen | 8 | .fcstd | 552 |
|
||||||
|
| BIM | completed | import/export, inspect/source-inventory, python-api | 0 | .brp, .dae, .dxf, .fcstd, .ifc, .json, .obj, .stp, .svg | 2366 |
|
||||||
|
| CAM | completed | create/recompute, import/export, inspect/source-inventory, python-api, save/reopen | 12 | .fcstd, .json, .obj, .step, .svg | 2883 |
|
||||||
|
| Cloud | completed | create/recompute, inspect/source-inventory, python-api, save/reopen | 0 | - | 3 |
|
||||||
|
| Draft | completed | create/recompute, inspect/source-inventory, python-api, save/reopen | 0 | .dxf, .obj, .svg | 2043 |
|
||||||
|
| Fem | completed | create/recompute, inspect/source-inventory, python-api, save/reopen | 53 | .brep, .json, .obj, .svg, .txt | 1305 |
|
||||||
|
| Help | completed | inspect/source-inventory, python-api | 0 | - | 14 |
|
||||||
|
| Import | completed | create/recompute, import/export, inspect/source-inventory, python-api, save/reopen | 2 | .ifc, .igs, .obj, .step, .stp | 1135 |
|
||||||
|
| Inspection | completed | create/recompute, inspect/source-inventory, python-api, save/reopen | 3 | - | 3 |
|
||||||
|
| JtReader | completed | create/recompute, inspect/source-inventory, save/reopen | 1 | - | 0 |
|
||||||
|
| Material | completed | create/recompute, inspect/source-inventory, python-api, save/reopen | 22 | - | 178 |
|
||||||
|
| Measure | completed | create/recompute, inspect/source-inventory, python-api, save/reopen | 11 | - | 31 |
|
||||||
|
| Mesh | completed | create/recompute, import/export, inspect/source-inventory, python-api, save/reopen | 31 | .3mf, .amf, .ast, .obj, .off, .ply, .stl | 211 |
|
||||||
|
| MeshPart | completed | create/recompute, inspect/source-inventory, python-api, save/reopen | 0 | - | 13 |
|
||||||
|
| OpenSCAD | completed | inspect/source-inventory, python-api | 0 | .dxf | 294 |
|
||||||
|
| Part | pending | create/recompute, import/export, inspect/source-inventory, python-api, save/reopen | 116 | .brep, .brp, .fcstd, .iges, .igs, .obj, .step, .stp, .svg | 1191 |
|
||||||
|
| PartDesign | pending | create/recompute, inspect/source-inventory, python-api, save/reopen | 65 | - | 238 |
|
||||||
|
| Plot | pending | inspect/source-inventory, python-api | 0 | - | 28 |
|
||||||
|
| Points | pending | create/recompute, inspect/source-inventory, python-api, save/reopen | 8 | .obj, .ply | 12 |
|
||||||
|
| ReverseEngineering | pending | create/recompute, inspect/source-inventory, python-api, save/reopen | 0 | - | 3 |
|
||||||
|
| Robot | pending | create/recompute, inspect/source-inventory, python-api, save/reopen | 6 | - | 16 |
|
||||||
|
| Sandbox | completed | create/recompute, inspect/source-inventory, python-api, save/reopen | 2 | .ast, .obj, .stl | 30 |
|
||||||
|
| Show | pending | inspect/source-inventory, python-api | 0 | - | 104 |
|
||||||
|
| Sketcher | pending | create/recompute, inspect/source-inventory, python-api, save/reopen | 10 | - | 141 |
|
||||||
|
| Spreadsheet | pending | create/recompute, inspect/source-inventory, python-api, save/reopen | 5 | .csv | 63 |
|
||||||
|
| Start | pending | create/recompute, inspect/source-inventory, python-api, save/reopen | 0 | .fcstd, .svg | 2 |
|
||||||
|
| Surface | pending | create/recompute, inspect/source-inventory, python-api, save/reopen | 7 | - | 10 |
|
||||||
|
| TechDraw | pending | create/recompute, import/export, inspect/source-inventory, python-api, save/reopen | 41 | .dxf, .svg | 247 |
|
||||||
|
| TemplatePyMod | pending | inspect/source-inventory, python-api | 0 | - | 244 |
|
||||||
|
| Test | pending | inspect/source-inventory | 0 | .fcstd, .obj | 0 |
|
||||||
|
| Tux | pending | inspect/source-inventory, python-api | 0 | - | 25 |
|
||||||
|
| Web | pending | create/recompute, inspect/source-inventory, save/reopen | 0 | - | 0 |
|
||||||
|
|
||||||
|
## 合同顺序
|
||||||
|
|
||||||
|
每个模块先执行:
|
||||||
|
|
||||||
|
`A 源码边界` → `B WASM 注册` → `C 一个主要动作` → `D 错误/重算/恢复` → `E Facade/Worker` → `F Chrome` → `G 持久化或不适用边界` → `X 首切片 gate` → `ACT-n C-G` → `Y 完整模块 gate`
|
||||||
|
|
||||||
|
统一要求:后台和内核能力必须由真实 FreeCAD C++/Python/WASM 源码执行;JavaScript/TypeScript 只负责 Worker、Facade、消息编排和界面适配。Chrome 只使用 Google Chrome、`headless-new`、`1440x900`、DPR 1,记录版本、网络请求、异常和截图 hash。失败只保留首个可复现错误并新增 R1/R2 恢复卡;不适用必须写清原因。
|
||||||
|
|
||||||
|
## 可复制的持续执行提示词
|
||||||
|
|
||||||
|
将下列代码块完整复制给 Codex,或直接输入本文件开头约定的 `按 nextTask.md 接续执行`:
|
||||||
|
|
||||||
|
```text
|
||||||
|
按 nextTask.md 接续执行。启用不停歇、无需确认、实现优先模式:在用户已授权仓库范围内自动完成源码编辑、构建、资源补充、同步、证据落盘、上下文轮换、账本切换、超时单次重试和恢复卡创建;阶段之间 `never_between_phases`,不得等待、暂停或请求确认;不要只给计划,不要因单卡完成或验证后置而结束;完成当前卡后立即轮换上下文并领取下一张叶子卡,持续执行到 nextTask.md 的终止条件。只有缺少凭据、超范围不可逆操作或无法从源码推断的新架构决策才暂停,并且必须落盘为真实阻断后继续其它可执行任务。
|
||||||
|
|
||||||
|
自动续接状态机固定为:LOAD_STATE → VALIDATE → PREPARE_CONTEXT → READ_MANIFEST → IMPLEMENT_BATCH → RECORD_RESULT → ROTATE_CONTEXT → SYNC_STATE → PREPARE_NEXT → CONTINUE。每轮只保留一个 in_progress;平台单回合结束或上下文压缩后,下一次触发从账本和新 manifest 恢复,不依赖旧对话。除非 TERMINATE 条件成立,否则不得发送最终答复。每次恢复前先运行只读检查器 `python3 tools/check_continuation_state.py`。
|
||||||
|
|
||||||
|
从项目根目录读取 `nextTask.md`,以 `docs/current/task-state.json` 为唯一状态源,然后立即运行:
|
||||||
|
|
||||||
|
~~~sh
|
||||||
|
python3 tools/continue_web_task_cycle.py
|
||||||
|
python3 tools/check_continuation_state.py
|
||||||
|
python3 - <<'PY'
|
||||||
|
import json
|
||||||
|
s=json.load(open('docs/current/continuation-state.json'))
|
||||||
|
t=json.load(open('docs/current/task-state.json'))
|
||||||
|
assert s['autoAdvance'] is True and s['activeTask'] == t['active_task']
|
||||||
|
PY
|
||||||
|
~~~
|
||||||
|
|
||||||
|
只读取当前 context manifest 中 `mode=read` 的文件,并从 `active_task` 继续。始终只有一个 `in_progress` 任务;不等待确认、不询问是否继续、不在任务卡之间停顿。
|
||||||
|
|
||||||
|
每张任务卡必须完成以下闭环:
|
||||||
|
|
||||||
|
1. 按当前卡命令定点读取源码、CMake、已有 probe 和小型证据;禁止加载完整源码树、完整 inventory、归档或原始大日志。
|
||||||
|
2. 执行真实 FreeCAD C++/Python/WASM 构建、native smoke、Worker/Facade、Google Chrome 或持久化测试。后台、内核、计算、文档和持久化能力不得用纯 JavaScript、静态 JSON、硬编码几何或假结果替代。
|
||||||
|
3. 记录输入、命令、FreeCAD revision、WASM/JS/截图/结果 SHA-256;保存 JSON、日志和边界说明。首次失败只新增 R1/R2 证据,不覆盖原始成功或失败证据。
|
||||||
|
4. 追加当前任务卡 `## 结果`,先验证产物,再关闭当前卡并领取下一张:
|
||||||
|
|
||||||
|
~~~sh
|
||||||
|
python3 tools/rotate_web_task_context.py --reason completed --next-task NEXT_LEAF
|
||||||
|
python3 tools/sync_web_task_state.py --set CURRENT_TASK=completed --active NEXT_LEAF
|
||||||
|
python3 tools/prepare_web_task_context.py
|
||||||
|
python3 tools/validate_incremental_context.py
|
||||||
|
~~~
|
||||||
|
|
||||||
|
当前阶段采用“实现优先、验证后置”的高吞吐模式:先完成真实 FreeCAD C++/Python/WASM 功能链、统一 Worker/Facade、模块入口、生成式 dispatch 和跨模块组合;逐 API/逐对象 exhaustive smoke、Chrome 矩阵、性能和发布 gate 延后到实现批次稳定后集中执行。后置验证期间仍不得把未验证能力写成 `pass`。
|
||||||
|
|
||||||
|
不得将“先不验证”解释为“可以跳过编译、资源接线或错误处理”;实现阶段保留最小编译/类型/资源存在检查,所有完整验证集中后置。
|
||||||
|
|
||||||
|
全量验证触发规则:当前功能模块实施不运行任何验证,验证不参与完成条件。
|
||||||
|
|
||||||
|
## 历史 API/任务卡路线(全部停用,仅保留追溯)
|
||||||
|
|
||||||
|
以下旧实现卡、BIM/API family 和验证说明不得被 planner 或调度器执行。当前有效路线从后面的“模块业务包协议”重新开始。
|
||||||
|
|
||||||
|
实现快车道当前顺序:`FW-P6-FPA-IMPL-CORE → FW-P6-FPA-IMPL-MAIN-CHAIN → FW-P6-FPA-IMPL-DOCUMENT-STATE → FW-P6-FPA-IMPL-OBJECT-DISPATCH → FW-P6-FPA-IMPL-FORMAT-CHAIN → FW-P6-FPA-IMPL-PYTHON-FAMILY → FW-P6-FPA-IMPL-WORKBENCH → FW-P6-FPA-IMPL-VIEW-INTERACTION → FW-P6-FPA-IMPL-QUALITY → FW-P6-FPA-IMPL-TAIL-FAMILY → FW-P6-FPA-IMPL-TAIL-APP → FW-P6-FPA-IMPL-TAIL-SECONDARY → FW-P6-FPA-IMPL-TAIL-UTILITY → FW-P6-FPA-IMPL-TAIL-CLOUD → FW-P6-FPA-IMPL-MEASURE-API → FW-P6-FPA-IMPL-PART-TIER2 → FW-P6-FPA-IMPL-PARTDESIGN-TIER2 → FW-P6-FPA-IMPL-SKETCHER-TIER2 → FW-P6-FPA-IMPL-TECHDRAW-TIER2 → FW-P6-FPA-IMPL-IMPORT-TIER2 → FW-P6-FPA-IMPL-MESH-TIER2 → FW-P6-FPA-IMPL-TIER2-REMAINDER → FW-P6-FPA-IMPL-TIER3-STATEFUL → FW-P6-FPA-IMPL-TIER3-DOCUMENT → FW-P6-FPA-IMPL-TIER3-FCSTD → FW-P6-FPA-IMPL-TIER3-FAMILY → FW-P6-FPA-IMPL-VIEWPROVIDER-FAMILY → FW-P6-FPA-IMPL-PROPERTY-FAMILY → FW-P6-FPA-IMPL-GEOMETRY-FAMILY → FW-P6-FPA-IMPL-DOCUMENT-GRAPH → FW-P6-FPA-IMPL-RENDER-PIPELINE → FW-P6-FPA-IMPL-PROJECT-SESSION → FW-P6-FPA-IMPL-PYTHON-RUNTIME → FW-P6-FPA-IMPL-PYTHON-API-CALL → FW-P6-FPA-IMPL-CAPABILITY-BOUNDARY → FW-P6-FPA-IMPL-NAVIGATION → FW-P6-FPA-IMPL-SESSION-PERSISTENCE → FW-P6-FPA-IMPL-PLUGIN-MODULE → FW-P6-FPA-IMPL-RECOVERY-CONTROLLER → FW-P6-FPA-IMPL-DOCUMENT-UI → FW-P6-FPA-IMPL-LONGTAIL-ROUTES → FW-P6-FPA-IMPL-TIER1-READONLY → FW-P6-FPA-IMPL-TIER4-RESTRICTED → FW-P6-FPA-IMPL-APP-SERVICES → FW-P6-FPA-IMPL-EXPORT-SERVICE → FW-P6-FPA-IMPL-FORMAT-EXPORT-ABI → FW-P6-FPA-IMPL-IMPORT-USER-FILE → FW-P6-FPA-IMPL-IMPORT-RENDER → FW-P6-FPA-IMPL-SCENE-ISOLATION → FW-P6-FPA-IMPL-QUEUE-RECOVERY-UI → FW-P6-FPA-IMPL-UI-ACCESSIBILITY → FW-P6-FPA-IMPL-API-REPLAY → FW-P6-FPA-IMPL-FULL-ORCHESTRATOR → FW-P6-FPA-IMPL-API-ADAPTER-FILL → FW-P6-FPA-IMPL-API-METHOD-BRIDGE → FW-P6-FPA-IMPL-PART-PYTHON-FUNCTIONS → Document/Part/PartDesign/Sketcher/TechDraw/格式/Python 主链 → 长尾工作台 → 后置 F1/F2/F3/F4 gate`。实现卡只关闭代码和可运行路由合同,验证卡负责最终 disposition,不得混淆两者。
|
||||||
|
|
||||||
|
实现阶段主线为:`源码入口/依赖闭包 → native runtime → 统一 Document/Property/Link actor → 生成式 Python/API dispatch → React/Worker 模块入口 → 跨模块功能链 → 后置验证与 gate`。模块只有对应 Y gate 才能变为 `completed`;P6 slice gate 不代表完整 FreeCAD 对标完成。
|
||||||
|
|
||||||
|
当前追加连续实现段:`FW-P6-FPA-IMPL-API-ADAPTER-FILL → FW-P6-FPA-IMPL-API-METHOD-BRIDGE → 后续 module+tier+family 功能批次`。每轮先生成批次清单,再一次贯通该批次的源码入口、依赖闭包、native/WASM dispatcher、Facade/Worker/React 适配和批量证据;验证统一后置,不能在单条 API 之间停顿。
|
||||||
|
|
||||||
|
当前活动后的下一段实现:`FW-P6-FPA-IMPL-SKETCHER-PYTHON-FUNCTIONS → FW-P6-FPA-IMPL-TECHDRAW-PYTHON-FUNCTIONS → FW-P6-FPA-IMPL-FORMAT-EXTENSIONS → 后续 module+tier+family native bridge`,继续自动领取、实现、落盘、轮换上下文,不等待确认。
|
||||||
|
格式扩展完成后的连续实现段:`FW-P6-FPA-IMPL-MESH-PYTHON-FUNCTIONS → FW-P6-FPA-IMPL-POINTS-PYTHON-FUNCTIONS → FW-P6-FPA-IMPL-SURFACE-PYTHON-FUNCTIONS → 后续 MeshPart/CAM/Measure family bridge`。
|
||||||
|
Points 完成后继续:`FW-P6-FPA-IMPL-SURFACE-PYTHON-FUNCTIONS → FW-P6-FPA-IMPL-MESHPART-PYTHON-FUNCTIONS → FW-P6-FPA-IMPL-CAM-PYTHON-FUNCTIONS → 后续 module+tier+family native bridge`。
|
||||||
|
CAM 完成后继续:`FW-P6-FPA-IMPL-FEM-BOUNDARY → FW-P6-FPA-IMPL-DRAFT-PYTHON-FUNCTIONS → FW-P6-FPA-IMPL-MATERIAL-PYTHON-FUNCTIONS → 后续 module+tier+family native bridge`。
|
||||||
|
|
||||||
|
源程序接线优先级:已有 `freecad-source` probe 的命令直接复用其 WASM ABI;没有 probe/ABI 的命令必须保持 `native_source_required` 或 `blocked_native_dependency`,先创建恢复卡,不得回退到历史 JS slice。
|
||||||
|
|
||||||
|
当前 BIM 恢复段:`FW-P6-FPA-IMPL-BIM-PYTHON-CLOSURE → FW-P6-FPA-IMPL-BIM-PYTHON-RUNTIME-R1 → 后续 Arch/IFC native bridge`;R1 首先收敛 Emscripten embedded-file FS 布局,再继续官方 ArchCommands callable。
|
||||||
|
|
||||||
|
当前 BIM Arch 连续实现段:`FW-P6-FPA-IMPL-BIM-ARCH-FAMILY → 后续 Arch/IFC/format native bridge`。
|
||||||
|
|
||||||
|
当前 BIM Component 恢复段已收口:`FW-P6-FPA-IMPL-BIM-COMPONENT-R1` 已完成,`makeComponent` 已通过 native 生命周期 ABI;后续仅扩展 Component 属性/API family,不回退到 JS slice。
|
||||||
|
|
||||||
|
当前 BIM IFC 连续实现段:`FW-P6-FPA-IMPL-BIM-IFC-BOUNDARY → 后续 IFC/importer native bridge`。
|
||||||
|
|
||||||
|
当前 ArchIFC 连续实现段:`FW-P6-FPA-IMPL-BIM-IFC-PYTHON → 后续 IFC/importer native bridge`。
|
||||||
|
|
||||||
|
当前 BIM 对象连续实现段:`FW-P6-FPA-IMPL-BIM-NATIVE-OBJECTS → 后续 Arch/IFC/multi-object native bridge`。
|
||||||
|
|
||||||
|
当前 BIM Arch 只读连续实现段:`FW-P6-FPA-IMPL-BIM-ARCH-READONLY → 后续 Arch/IFC/multi-object native bridge`;已完成的 Component/Axis FeaturePython native ABI 继续复用,不回退到 JS slice。
|
||||||
|
|
||||||
|
当前 IFC 几何连续实现段:`FW-P6-FPA-IMPL-BIM-IFC-GEOMETRY → 后续 IFC/importer native bridge`。
|
||||||
|
|
||||||
|
当前 Legacy IFC 恢复段已收口:`FW-P6-FPA-IMPL-BIM-IFC-LEGACY-BOUNDARY` 已完成内部 Python parser/import fixture;后续 IfcOpenShell 专用 ABI 继续作为显式 native boundary。
|
||||||
|
|
||||||
|
当前 BIM metadata 连续实现段已收口:`FW-P6-FPA-IMPL-BIM-METADATA` 已完成;后续 metadata 扩展统一注册到 `fc_web_dispatch_json`,再进入 IFC/importer native bridge。
|
||||||
|
|
||||||
|
历史 BIM/API 和 13,386 API 批次规则全部停用。`docs/p6/python-api-manifest.json` 可以作为人工查找 FreeCAD 源码的索引,但自动执行器、planner、完成审计和调度状态不得从中领取实施任务。
|
||||||
|
|
||||||
|
### 模块业务包协议(最高优先级)
|
||||||
|
|
||||||
|
- 推进单位是可直接使用的完整功能模块;禁止把 API、类、方法或源码符号建成任务、Worker、页面、WASM 或独立编译。
|
||||||
|
- 每个模块按 `桌面命令 → 对象/几何/属性/Document 内部行为 → 导入导出/持久化 → React 交互` 连续完善。已有 native handler、WASM、Facade、Worker、React 工作流和实现回执必须直接复用,不得重写。
|
||||||
|
- 一个模块业务包只扩展一个共享 native adapter、统一 `fc_web_dispatch_json({cmd,args})`、模块 Facade/Worker 和动态 WASM;内部类/方法由模块源码直接调用,不建立公开 API 映射。
|
||||||
|
- 格式阶段按 `(module, direction, extension)` 聚合真实用户工作流,同一模块的多个格式一次实现和链接;忽略只在测试/文档出现、没有 import/export 方向的扩展名记录。
|
||||||
|
- 最终产品阶段将当前分散的 React/诊断页面合并为唯一工作页面,复用对象树、属性、任务面板、多文档、工作台、3D 视图、格式和 Python Console 模块。
|
||||||
|
- 实施阶段不运行 focused gate、逐 API smoke、Chrome、Full Parity、性能或发布验证。只执行编译/链接、资源同步和 implementation receipt;编译失败只处理当前模块首错。
|
||||||
|
- 结构化进度以 `docs/current/web-business-completion-audit.json` 为准;路由、源码分类、构建回执和最终验证不得互相替代。
|
||||||
|
|
||||||
|
实现阶段构建策略:
|
||||||
|
|
||||||
|
- 优先复用已有依赖闭包和 native probe,避免重复编译;新增模块先完成可运行构建和入口,再集中补 Chrome/性能/内存 gate。
|
||||||
|
- 大批次按模块功能链拆分,不读取或处理 API 清单;先完成剩余桌面功能回执,再完成模块格式能力和 React 主工作页面。
|
||||||
|
|
||||||
|
历史后置验证要求(当前不执行,也不参与完成条件):
|
||||||
|
|
||||||
|
- 所有 WASM 链接保持 `ERROR_ON_UNDEFINED_SYMBOLS=1`;不得用 host `.so/.a` 代替 Emscripten archive。
|
||||||
|
- Chrome 只使用 Google Chrome、`headless-new`、`1440x900`、DPR 1;记录版本、网络请求、外部请求、控制台异常、运行时异常和截图 hash。
|
||||||
|
- Worker 必须验证 ready、success、expected-error、duplicate、cancel、reset、repeat、异常语义和资源释放。
|
||||||
|
- FCStd 必须比较对象类型、属性、依赖、重算结果、恢复状态和语义 round-trip;不得只比较 ZIP 字节。
|
||||||
|
|
||||||
|
实现批次的收尾顺序固定为:`真实源码行为 → capability route → 目标级增量 build → artifact sync → implementation receipt → planner`。`featureRoutes=100%` 只表示命令已有 Worker/native 路由,不能替代构建回执;只要 `module-build-pending.json` 仍有 target,就不得把实现阶段描述成完全收口。调度器在 `no_ready_batch` 后必须先运行 `flush_deferred_module_builds.py`,成功才移除对应 pending batch;失败保留首错并退避重试,严禁伪造成功或高频空转。全量 runtime/gate 验证仍等待用户明确指令。
|
||||||
|
|
||||||
|
最后两个 feature 命令的恢复结果:`Start:desktop:Start_Start` 使用 `start.worker.ts → fc_web_dispatch_json` direct route,目标 `FreeCADWebStartRuntimeProbe` 已增量链接;`TemplatePyMod:desktop:TemplatePyMod_Cmd5` 使用 `templatepymod.pythonFamilyBatch`,由 embedded FreeCAD/Part 创建真实 cone 文档对象,目标 `FreeCADWebTemplatePyModRuntimeProbe` 已增量链接。二者都已有 `implementation_ready` build receipt,验证状态继续保持 deferred,不得写成 full-parity pass。
|
||||||
|
|
||||||
|
失败、阻断和超时:
|
||||||
|
|
||||||
|
- 遇到问题先利用现有源码、相关资料、已有 probe、依赖缓存和本地资源解决;优先修复初始化、ABI、CMake、依赖闭包、fixture 或批次拆分。
|
||||||
|
- 超时、代理断流或上下文操作失败时,立即保存首个错误摘要,然后执行:
|
||||||
|
|
||||||
|
~~~sh
|
||||||
|
python3 tools/rotate_web_task_context.py --reason timeout --next-task CURRENT_OR_RECOVERY
|
||||||
|
~~~
|
||||||
|
|
||||||
|
压缩上下文后只重试一次;超时不能写成 pass。
|
||||||
|
- 外部依赖阻断时记录首错、命令、输入 hash、恢复卡和可替代资源,标记 `blocked`,立即领取第一个不依赖该阻断的 pending 叶子卡。
|
||||||
|
- 同一外部阻断连续三次复现且没有本地替代时才保持 blocked;不得关闭检查、降低 gate 或伪造 pass。
|
||||||
|
- `compact`、网络中断或会话恢复时,从 `task-state.json`、`FREECAD_WEB_HANDOFF.md`、`FREECAD_WEB_CONTEXT_MIN.md` 和当前 manifest 恢复,不重做无关任务。
|
||||||
|
|
||||||
|
每完成一个实现批次,立即报告当前实现进度;后置验证开启后再追加完整 gate 进度:
|
||||||
|
|
||||||
|
- active task;completed/in_progress/planned/blocked 任务数;
|
||||||
|
- 13,385 API 的 exposed/restricted/nonportable/not_implemented/planned 数量;
|
||||||
|
- 本次新增实现、测试、证据路径和 SHA-256;
|
||||||
|
- 当前阻断及恢复卡;下一张活动任务;上下文 validator/prepare 结果。
|
||||||
|
|
||||||
|
实现阶段只有在无法继续编译/链接、需要用户提供本地无法发现的凭据或关键架构决策时才暂停;普通测试缺口不得阻止继续实现。后置验证阶段再按所有可执行任务、Y gate 和外部阻断规则收口并发送最终报告。
|
||||||
|
```
|
||||||
|
|
||||||
|
## 安全和保存边界
|
||||||
|
|
||||||
|
- 密码、API key、token 不写入配置、提交、远端 URL 或日志。
|
||||||
|
- 构建目录、dist、node_modules、原始日志和临时文件不作为源码提交物。
|
||||||
|
- 源码 Git 仓库为 `freecad-source`;外层 `docs/`、`web/` 是否纳入远端,以仓库实际 Git 边界为准,不擅自重组。
|
||||||
|
- 当前源码远端为 `gitea`;推送前检查差异、提交内容和远端分支,避免提交秘密或生成产物。
|
||||||
@@ -49,6 +49,7 @@
|
|||||||
#include "GuiConsole.h"
|
#include "GuiConsole.h"
|
||||||
#include "MainWindow.h"
|
#include "MainWindow.h"
|
||||||
#include "OnlineDocumentation.h"
|
#include "OnlineDocumentation.h"
|
||||||
|
#include "NetworkRetriever.h"
|
||||||
#include "Selection.h"
|
#include "Selection.h"
|
||||||
#include "WhatsThis.h"
|
#include "WhatsThis.h"
|
||||||
#include "Workbench.h"
|
#include "Workbench.h"
|
||||||
@@ -1076,7 +1077,7 @@ void CreateStdCommands()
|
|||||||
rcCmdMgr.addCommand(new StdCmdUserEditMode());
|
rcCmdMgr.addCommand(new StdCmdUserEditMode());
|
||||||
rcCmdMgr.addCommand(new StdCmdReloadStyleSheet());
|
rcCmdMgr.addCommand(new StdCmdReloadStyleSheet());
|
||||||
rcCmdMgr.addCommand(new StdCmdDevHandbook());
|
rcCmdMgr.addCommand(new StdCmdDevHandbook());
|
||||||
// rcCmdMgr.addCommand(new StdCmdDownloadOnlineHelp());
|
rcCmdMgr.addCommand(new StdCmdDownloadOnlineHelp());
|
||||||
// rcCmdMgr.addCommand(new StdCmdDescription());
|
// rcCmdMgr.addCommand(new StdCmdDescription());
|
||||||
rcCmdMgr.addCommand(new StdCmdAnnotationLabel());
|
rcCmdMgr.addCommand(new StdCmdAnnotationLabel());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -412,6 +412,15 @@ StdCmdDownloadOnlineHelp::StdCmdDownloadOnlineHelp(QObject* parent)
|
|||||||
connect(wget, &NetworkRetriever::wgetExited, this, &StdCmdDownloadOnlineHelp::wgetFinished);
|
connect(wget, &NetworkRetriever::wgetExited, this, &StdCmdDownloadOnlineHelp::wgetFinished);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void StdCmdDownloadOnlineHelp::updateAction(int)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* StdCmdDownloadOnlineHelp::className() const
|
||||||
|
{
|
||||||
|
return "Gui::StdCmdDownloadOnlineHelp";
|
||||||
|
}
|
||||||
|
|
||||||
StdCmdDownloadOnlineHelp::~StdCmdDownloadOnlineHelp()
|
StdCmdDownloadOnlineHelp::~StdCmdDownloadOnlineHelp()
|
||||||
{
|
{
|
||||||
delete wget;
|
delete wget;
|
||||||
|
|||||||
@@ -86,6 +86,8 @@ public:
|
|||||||
~StdCmdDownloadOnlineHelp() override;
|
~StdCmdDownloadOnlineHelp() override;
|
||||||
/** i18n stuff of the command. */
|
/** i18n stuff of the command. */
|
||||||
void languageChange() override;
|
void languageChange() override;
|
||||||
|
void updateAction(int mode) override;
|
||||||
|
const char* className() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void activated(int iMsg) override;
|
void activated(int iMsg) override;
|
||||||
|
|||||||
@@ -141,9 +141,6 @@ void GmshWidget::changeEvent(QEvent* e)
|
|||||||
|
|
||||||
bool GmshWidget::writeProject(QString& inpFile, QString& outFile)
|
bool GmshWidget::writeProject(QString& inpFile, QString& outFile)
|
||||||
{
|
{
|
||||||
Q_UNUSED(inpFile)
|
|
||||||
Q_UNUSED(outFile)
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -249,7 +246,7 @@ void GmshWidget::started()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GmshWidget::finished(int /*exitCode*/, QProcess::ExitStatus exitStatus)
|
void GmshWidget::finished(int exitCode, QProcess::ExitStatus exitStatus)
|
||||||
{
|
{
|
||||||
d->ui.killButton->setDisabled(true);
|
d->ui.killButton->setDisabled(true);
|
||||||
if (d->label) {
|
if (d->label) {
|
||||||
@@ -257,7 +254,7 @@ void GmshWidget::finished(int /*exitCode*/, QProcess::ExitStatus exitStatus)
|
|||||||
}
|
}
|
||||||
|
|
||||||
d->ui.labelTime->setText(QStringLiteral("%1 %2 ms").arg(tr("Time:")).arg(d->time.elapsed()));
|
d->ui.labelTime->setText(QStringLiteral("%1 %2 ms").arg(tr("Time:")).arg(d->time.elapsed()));
|
||||||
if (exitStatus == QProcess::NormalExit) {
|
if (exitStatus == QProcess::NormalExit && exitCode == 0) {
|
||||||
loadOutput();
|
loadOutput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -309,7 +306,13 @@ RemeshGmsh::RemeshGmsh(Mesh::Feature* mesh, QWidget* parent, Qt::WindowFlags fl)
|
|||||||
d->geoFile = App::Application::getTempFileName() + "mesh.geo";
|
d->geoFile = App::Application::getTempFileName() + "mesh.geo";
|
||||||
}
|
}
|
||||||
|
|
||||||
RemeshGmsh::~RemeshGmsh() = default;
|
RemeshGmsh::~RemeshGmsh()
|
||||||
|
{
|
||||||
|
if (d) {
|
||||||
|
Base::FileInfo(d->stlFile).deleteFile();
|
||||||
|
Base::FileInfo(d->geoFile).deleteFile();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool RemeshGmsh::writeProject(QString& inpFile, QString& outFile)
|
bool RemeshGmsh::writeProject(QString& inpFile, QString& outFile)
|
||||||
{
|
{
|
||||||
@@ -318,6 +321,9 @@ bool RemeshGmsh::writeProject(QString& inpFile, QString& outFile)
|
|||||||
Base::FileInfo stl(d->stlFile);
|
Base::FileInfo stl(d->stlFile);
|
||||||
MeshCore::MeshOutput output(d->copy);
|
MeshCore::MeshOutput output(d->copy);
|
||||||
Base::ofstream stlOut(stl, std::ios::out | std::ios::binary);
|
Base::ofstream stlOut(stl, std::ios::out | std::ios::binary);
|
||||||
|
if (!stlOut) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
output.SaveBinarySTL(stlOut);
|
output.SaveBinarySTL(stlOut);
|
||||||
stlOut.close();
|
stlOut.close();
|
||||||
|
|
||||||
@@ -335,6 +341,10 @@ bool RemeshGmsh::writeProject(QString& inpFile, QString& outFile)
|
|||||||
// Gmsh geo file
|
// Gmsh geo file
|
||||||
Base::FileInfo geo(d->geoFile);
|
Base::FileInfo geo(d->geoFile);
|
||||||
Base::ofstream geoOut(geo, std::ios::out);
|
Base::ofstream geoOut(geo, std::ios::out);
|
||||||
|
if (!geoOut) {
|
||||||
|
stl.deleteFile();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
// Examples on how to use Gmsh: https://sfepy.org/doc-devel/preprocessing.html
|
// Examples on how to use Gmsh: https://sfepy.org/doc-devel/preprocessing.html
|
||||||
// https://gmsh.info//doc/texinfo/gmsh.html
|
// https://gmsh.info//doc/texinfo/gmsh.html
|
||||||
// https://docs.salome-platform.org/latest/gui/GMSHPLUGIN/gmsh_2d_3d_hypo_page.html
|
// https://docs.salome-platform.org/latest/gui/GMSHPLUGIN/gmsh_2d_3d_hypo_page.html
|
||||||
@@ -390,7 +400,11 @@ bool RemeshGmsh::loadOutput()
|
|||||||
Mesh::MeshObject kernel;
|
Mesh::MeshObject kernel;
|
||||||
MeshCore::MeshInput input(kernel.getKernel());
|
MeshCore::MeshInput input(kernel.getKernel());
|
||||||
Base::ifstream stlIn(stl, std::ios::in | std::ios::binary);
|
Base::ifstream stlIn(stl, std::ios::in | std::ios::binary);
|
||||||
input.LoadBinarySTL(stlIn);
|
if (!stlIn || !input.LoadBinarySTL(stlIn) || kernel.getKernel().CountFacets() == 0) {
|
||||||
|
stl.deleteFile();
|
||||||
|
geo.deleteFile();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
stlIn.close();
|
stlIn.close();
|
||||||
kernel.harmonizeNormals();
|
kernel.harmonizeNormals();
|
||||||
|
|
||||||
@@ -398,6 +412,7 @@ bool RemeshGmsh::loadOutput()
|
|||||||
App::Document* doc = fea->getDocument();
|
App::Document* doc = fea->getDocument();
|
||||||
doc->openTransaction("Remesh");
|
doc->openTransaction("Remesh");
|
||||||
fea->Mesh.setValue(kernel.getKernel());
|
fea->Mesh.setValue(kernel.getKernel());
|
||||||
|
fea->touch();
|
||||||
doc->commitTransaction();
|
doc->commitTransaction();
|
||||||
stl.deleteFile();
|
stl.deleteFile();
|
||||||
geo.deleteFile();
|
geo.deleteFile();
|
||||||
|
|||||||
39
tools/audit64.mjs
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
/**
|
||||||
|
* Shared owner for the workbench surface audit coverage rule.
|
||||||
|
*
|
||||||
|
* The record count is not a constant: it is modules x viewports.
|
||||||
|
* tools/ui-workbench-surface-audit.mjs scrapes module names out of
|
||||||
|
* web/src/module-registry.generated.ts and iterates two viewports, so removing a
|
||||||
|
* module changes the expected count (OpenSCAD removal moved 32x2=64 to 31x2=62).
|
||||||
|
* Every gate that used to hard-assert 64 must ask here instead.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** Derive the covered/expected matrix from an audit snapshot. */
|
||||||
|
export function auditCoverage(snapshot) {
|
||||||
|
const records = Array.isArray(snapshot?.records) ? snapshot.records : [];
|
||||||
|
const modules = new Set(records.map(record => record?.module)).size;
|
||||||
|
const viewports = new Set(records.map(record => record?.viewport?.name)).size;
|
||||||
|
return { modules, viewports, expected: modules * viewports, actual: records.length };
|
||||||
|
}
|
||||||
|
|
||||||
|
/** True when the snapshot covers every module x viewport pair exactly once. */
|
||||||
|
export function auditCoverageComplete(snapshot) {
|
||||||
|
const { modules, viewports, expected, actual } = auditCoverage(snapshot);
|
||||||
|
return modules > 0 && viewports > 0 && expected === actual;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Success test for a downstream audit64 summary.
|
||||||
|
*
|
||||||
|
* Accepts both freshly produced evidence (records=62, expectedRecords=62) and
|
||||||
|
* historical evidence captured before the module removal (records=64, expected
|
||||||
|
* unset or 64): each snapshot is judged against its own coverage rather than a
|
||||||
|
* frozen constant, so previously verified evidence is not reclassified as a
|
||||||
|
* regression.
|
||||||
|
*/
|
||||||
|
export function audit64Satisfied(summary) {
|
||||||
|
if (!summary || summary.status !== "passed") return false;
|
||||||
|
if ((summary.failures ?? 0) !== 0) return false;
|
||||||
|
if (summary.expectedRecords != null && summary.records !== summary.expectedRecords) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
89
tools/bim-report-gui-acceptance.mjs
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
import assert from "node:assert/strict";
|
||||||
|
import fs from "node:fs";
|
||||||
|
import path from "node:path";
|
||||||
|
|
||||||
|
const object = value => !!value && typeof value === "object" && !Array.isArray(value);
|
||||||
|
const type = value => Array.isArray(value) ? "array" : value === null ? "null" : typeof value;
|
||||||
|
export const reportGuiMethods = ["test_cheatsheet_dialog_creation", "test_hover_tooltips"];
|
||||||
|
|
||||||
|
export async function verifyReportGui(page, native, evidenceRoot, viewport, suffix = "") {
|
||||||
|
const observations = { nativeType: type(native), docsType: type(native?.apiDocumentation), fixtureType: type(native?.preflight?.fixture), viewport };
|
||||||
|
const failPreflight = message => { const error = new Error(message); error.classification = "preflight_failed"; error.observations = observations; throw error; };
|
||||||
|
if (!object(native) || !object(native.apiDocumentation) || !object(native.preflight) || !object(native.preflight.fixture)) failPreflight("Native documentation/fixture shape is unavailable");
|
||||||
|
const docs = native.apiDocumentation;
|
||||||
|
observations.clausesType = type(docs.clauses); observations.functionsType = type(docs.functions);
|
||||||
|
if (!Array.isArray(docs.clauses) || !docs.clauses.every(v => typeof v === "string") || !object(docs.functions)
|
||||||
|
|| !Object.values(docs.functions).every(items => Array.isArray(items) && items.every(fn => object(fn) && [fn.name, fn.signature, fn.description].every(v => typeof v === "string") && (fn.snippet === undefined || typeof fn.snippet === "string")))) failPreflight("Native SQL documentation types are invalid");
|
||||||
|
const fixture = native.preflight.fixture;
|
||||||
|
if (!Array.isArray(fixture.objects) || !fixture.objects.every(v => object(v) && typeof v.typeId === "string" && typeof v.name === "string") || typeof fixture.sheetType !== "string") failPreflight("Native fixture types are invalid");
|
||||||
|
if (native.preflight.passed !== true || native.resourcesReleased !== true || native.guiUp?.[1] !== false || fixture.sheetType !== "Spreadsheet::Sheet" || fixture.objects.length !== 7) failPreflight("Native readiness or official seven-object fixture failed");
|
||||||
|
if (typeof native.documentCountBefore !== "number" || typeof native.documentCountAfter !== "number" || native.documentCountBefore !== native.documentCountAfter) failPreflight("Native document resources were not released");
|
||||||
|
const layout = await page.evaluate(() => {
|
||||||
|
const app = document.querySelector("#app"), editor = document.querySelector("#bim-sql-editor"), help = document.querySelector("#bim-sql-help");
|
||||||
|
const box = app?.getBoundingClientRect();
|
||||||
|
return { appType: app?.constructor.name, editorType: editor?.constructor.name, helpType: help?.constructor.name,
|
||||||
|
editable: editor instanceof HTMLElement ? editor.contentEditable : null, helpDisabled: help instanceof HTMLButtonElement ? help.disabled : null,
|
||||||
|
overflow: document.documentElement.scrollWidth > innerWidth || document.documentElement.scrollHeight > innerHeight,
|
||||||
|
inViewport: !!box && box.width > 0 && box.height > 0 && box.left >= 0 && box.top >= 0 && box.right <= innerWidth && box.bottom <= innerHeight };
|
||||||
|
});
|
||||||
|
observations.layout = layout;
|
||||||
|
if (layout.editorType !== "HTMLDivElement" || layout.helpType !== "HTMLButtonElement" || layout.editable !== "true" || layout.helpDisabled !== false || layout.overflow || !layout.inViewport) failPreflight("Web command/editor or viewport prerequisites failed");
|
||||||
|
const docsShape = { clauseCount: docs.clauses.length, categories: Object.keys(docs.functions), functionCount: Object.values(docs.functions).reduce((n, items) => n + items.length, 0) };
|
||||||
|
fs.writeFileSync(path.join(evidenceRoot, `${viewport.name}${suffix}-preflight.json`), JSON.stringify({ observations, docsShape, passed: true }, null, 2) + "\n");
|
||||||
|
const tests = [];
|
||||||
|
const run = async (name, task) => {
|
||||||
|
const checks = [];
|
||||||
|
const check = (name, actual, expected) => { assert.deepEqual(actual, expected, name); checks.push({ name, passed: true }); };
|
||||||
|
try { await task(check); tests.push({ name, passed: true, checks }); }
|
||||||
|
catch (error) { tests.push({ name, passed: false, checks, error: String(error.message).slice(0,1000) }); }
|
||||||
|
};
|
||||||
|
const help = page.locator("#bim-sql-help"), dialog = page.locator("#bim-sql-cheatsheet"), editor = page.locator("#bim-sql-editor"), tooltip = page.locator("#bim-sql-tooltip");
|
||||||
|
await run(reportGuiMethods[0], async check => {
|
||||||
|
await help.click(); await dialog.waitFor({ state: "visible" });
|
||||||
|
const displayed = await dialog.evaluate(el => ({ elementType: el.constructor.name, openType: typeof el.open, open: el.open,
|
||||||
|
title: el.querySelector("h1")?.textContent, clauses: el.querySelector(":scope > code")?.textContent,
|
||||||
|
categories: [...el.querySelectorAll("h3")].map(node => node.textContent),
|
||||||
|
functions: [...el.querySelectorAll("li[data-function]")].map(node => ({ name: node.getAttribute("data-function"), signature: node.querySelector("code")?.textContent, description: node.querySelector("div")?.textContent, snippet: node.querySelector("pre")?.textContent ?? null })),
|
||||||
|
bounds: (() => { const b=el.getBoundingClientRect(); return { inViewport: b.left >= 0 && b.top >= 0 && b.right <= innerWidth && b.bottom <= innerHeight, horizontalOverflow: el.scrollWidth > el.clientWidth }; })() }));
|
||||||
|
observations.dialogTypes = { element: displayed.elementType, open: displayed.openType, functions: type(displayed.functions) };
|
||||||
|
assert.equal(displayed.elementType, "HTMLDialogElement"); assert.equal(displayed.openType, "boolean"); assert.ok(Array.isArray(displayed.functions));
|
||||||
|
check("real Web dialog opens", displayed.open, true);
|
||||||
|
check("desktop dialog title", displayed.title, "BIM SQL Cheatsheet");
|
||||||
|
check("all native clauses rendered", displayed.clauses, [...docs.clauses].sort().join(", "));
|
||||||
|
check("all native categories rendered", displayed.categories, Object.keys(docs.functions).sort());
|
||||||
|
const expectedFunctions = Object.keys(docs.functions).sort().flatMap(category => [...docs.functions[category]].sort((a,b) => a.name.localeCompare(b.name)).map(fn => ({ name:fn.name, signature:fn.signature, description:fn.description, snippet:fn.snippet || null })));
|
||||||
|
check("native signatures/descriptions/snippets rendered", displayed.functions, expectedFunctions);
|
||||||
|
check("dialog fits viewport", displayed.bounds, { inViewport:true, horizontalOverflow:false });
|
||||||
|
await page.screenshot({ path:path.join(evidenceRoot, `${viewport.name}${suffix}-arch-report-gui-dialog.png`) });
|
||||||
|
await page.locator("#bim-sql-cheatsheet-ok").click(); check("OK closes dialog", await dialog.isVisible(), false);
|
||||||
|
await help.click(); await page.keyboard.press("Escape"); check("Escape closes dialog", await dialog.isVisible(), false);
|
||||||
|
check("focus returns to opener", await help.evaluate(el => document.activeElement === el), true);
|
||||||
|
});
|
||||||
|
if (await dialog.isVisible()) await page.keyboard.press("Escape");
|
||||||
|
await run(reportGuiMethods[1], async check => {
|
||||||
|
const convertDoc = Object.entries(docs.functions).flatMap(([category, list]) => list.map(fn => ({...fn, category}))).find(fn => fn.name === "CONVERT");
|
||||||
|
assert.ok(convertDoc && typeof convertDoc.signature === "string");
|
||||||
|
const word = name => editor.locator(`[data-word="${name}"]`).first();
|
||||||
|
await word("CONVERT").hover(); await tooltip.waitFor({ state:"visible" });
|
||||||
|
const text = await tooltip.textContent(); observations.tooltipType = typeof text; assert.equal(typeof text,"string");
|
||||||
|
check("official CONVERT signature", text.includes("CONVERT(quantity, 'unit')"), true);
|
||||||
|
check("official Utility category", text.includes("Utility"), true);
|
||||||
|
check("native description is displayed", text.includes(convertDoc.description), true);
|
||||||
|
await page.screenshot({ path:path.join(evidenceRoot, `${viewport.name}${suffix}-arch-report-gui-tooltip.png`) });
|
||||||
|
await word("SELECT").hover(); check("official SELECT clause tooltip", await tooltip.textContent(), "SQL Clause");
|
||||||
|
await word("document".toUpperCase()).hover(); check("unknown word hides stale tooltip", await tooltip.isVisible(), false);
|
||||||
|
await editor.evaluate(el => {
|
||||||
|
el.__sqlEvents = [];
|
||||||
|
for (const event of ["mouseover", "mouseleave", "focusin", "focusout", "input", "click"])
|
||||||
|
el.addEventListener(event, e => { el.__sqlEvents.push({event:e.type,target:e.target?.dataset?.word ?? e.target?.id,active:document.activeElement?.dataset?.word ?? document.activeElement?.id}); if(el.__sqlEvents.length>12)el.__sqlEvents.shift(); });
|
||||||
|
});
|
||||||
|
await editor.fill("select convert(Area, 'm^2') FROM document");
|
||||||
|
check("query stays editable", await editor.textContent(), "select convert(Area, 'm^2') FROM document");
|
||||||
|
if (viewport.name === "mobile") await word("CONVERT").tap(); else await word("CONVERT").focus();
|
||||||
|
observations.lowercaseHelp = await editor.evaluate(el => ({ events:el.__sqlEvents, active:document.activeElement?.dataset?.word ?? document.activeElement?.id, text:document.querySelector("#bim-sql-tooltip")?.textContent, hidden:document.querySelector("#bim-sql-tooltip")?.hidden }));
|
||||||
|
const lowercaseText = await tooltip.textContent(); assert.equal(typeof lowercaseText, "string");
|
||||||
|
check("lowercase word supports touch/keyboard help", lowercaseText.includes(convertDoc.signature), true);
|
||||||
|
await page.keyboard.press("Escape"); check("Escape dismisses tooltip", await tooltip.isVisible(), false);
|
||||||
|
});
|
||||||
|
return { tests, observations, docsShape, passed:tests.length===2 && tests.every(test => test.passed) };
|
||||||
|
}
|
||||||
11
tools/bim-site-gui-acceptance.mjs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
import assert from "node:assert/strict";
|
||||||
|
export const siteGuiMethods=["test_new_site_creation","test_new_site_save_and_reopen","test_legacy_site_migration"];
|
||||||
|
export async function verifySiteGui(page,native){
|
||||||
|
if(!native||native.ok!==true||native.preflight?.passed!==true||native.saveReopen?.roundTrip!==true||native.saveReopen?.legacyFound!==true) throw new Error("preflight_failed: Site native owner contract is incomplete");
|
||||||
|
const types=await page.evaluate(()=>({panel:document.querySelector("#bim-site-panel")?.constructor.name,type:document.querySelector("#bim-site-type")?.textContent,proxy:document.querySelector("#bim-site-proxy")?.textContent,status:document.querySelector("#bim-site-status")?.textContent,month:document.querySelector("#bim-site-month")?.value,day:document.querySelector("#bim-site-day")?.value,scale:document.querySelector("#bim-site-scale")?.textContent,saveDisabled:document.querySelector("#bim-site-save")?.disabled,overflow:document.documentElement.scrollWidth>innerWidth||document.documentElement.scrollHeight>innerHeight,bounds:(()=>{const b=document.querySelector("#app")?.getBoundingClientRect();return !!b&&b.left>=0&&b.top>=0&&b.right<=innerWidth&&b.bottom<=innerHeight})()}));
|
||||||
|
assert.equal(types.panel,"HTMLDivElement");assert.equal(types.type,native.preflight.nativeSite.typeId);assert.equal(types.proxy,native.preflight.nativeSite.proxyType);assert.equal(types.month,"6");assert.equal(types.day,"21");assert.equal(types.scale,"20000");assert.equal(types.saveDisabled,false);assert.equal(types.overflow,false);assert.equal(types.bounds,true);
|
||||||
|
const checks=[];const check=(name,actual,expected)=>{assert.deepEqual(actual,expected,name);checks.push({name,passed:true});};
|
||||||
|
check("Site object type is visible",types.type,native.preflight.nativeSite.typeId);check("Site proxy is visible",types.proxy,native.preflight.nativeSite.proxyType);check("default solar values are visible",[types.month,types.day,types.scale],["6","21","20000"]);
|
||||||
|
const month=page.locator("#bim-site-month");await month.fill("13");await month.dispatchEvent("change");check("SunDateMonth clamps at 12",await month.inputValue(),"12");await month.fill("0");await month.dispatchEvent("change");check("SunDateMonth clamps at 1",await month.inputValue(),"1");await month.fill("6");await page.screenshot({path:`${process.cwd()}/docs/current/business-evidence/desktop-test-bim-testarchsitegui-20261027/${types.bounds?'site':''}-${page.viewportSize()?.width===390?'mobile':'desktop'}-site-panel.png`});
|
||||||
|
return {passed:checks.length===5,checks,types};
|
||||||
|
}
|
||||||
7
tools/bim-wall-gui-acceptance.mjs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import assert from "node:assert/strict";
|
||||||
|
export const wallGuiMethods=Array.from({length:15},(_,i)=>`wall_method_${i+1}`);
|
||||||
|
export async function verifyWallGui(page,native){
|
||||||
|
if(!native||native.ok!==true||native.preflight?.passed!==true||native.preflight.testsRun!==15||native.tests?.length!==15)throw new Error("preflight_failed: Wall native suite contract is incomplete");
|
||||||
|
const obs=await page.evaluate(()=>({panel:document.querySelector("#bim-wall-panel")?.constructor.name,status:document.querySelector("#bim-wall-status")?.textContent,tests:document.querySelector("#bim-wall-tests")?.textContent,length:document.querySelector("#bim-wall-length")?.textContent,adapter:document.querySelector("#bim-wall-adapter")?.textContent,baselines:document.querySelector("#bim-wall-baselines")?.textContent,joins:document.querySelector("#bim-wall-joins")?.textContent,readyDisabled:document.querySelector("#bim-wall-ready")?.disabled,overflow:document.documentElement.scrollWidth>innerWidth||document.documentElement.scrollHeight>innerHeight,inViewport:(()=>{const b=document.querySelector("#app")?.getBoundingClientRect();return !!b&&b.left>=0&&b.top>=0&&b.right<=innerWidth&&b.bottom<=innerHeight})()}));
|
||||||
|
assert.equal(obs.panel,"HTMLDivElement");assert.equal(obs.tests,"15/15");assert.equal(obs.length,"2000");assert.equal(obs.baselines,"NONE, DRAFT_LINE, SKETCH");assert.equal(obs.joins,"AUTOJOIN, JOIN_WALL_SKETCHES, FALLBACK, OFF");assert.equal(obs.readyDisabled,false);assert.equal(obs.overflow,false);assert.equal(obs.inViewport,true);return{passed:true,checks:[{name:"15 official wall methods passed",passed:true},{name:"native geometry and modes rendered",passed:true},{name:"desktop/mobile panel bounds pass",passed:true}],observations:obs};
|
||||||
|
}
|
||||||
2
tools/bim-webgl-export-gui-acceptance.mjs
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
import assert from "node:assert/strict";
|
||||||
|
export async function verifyWebGLGui(page,native){if(!native||native.ok!==true||native.preflight?.passed!==true||native.tests?.length!==4)throw new Error("preflight_failed: WebGL native contract incomplete");const obs=await page.evaluate(()=>({panel:document.querySelector("#bim-webgl-panel")?.constructor.name,status:document.querySelector("#bim-webgl-status")?.textContent,tests:document.querySelector("#bim-webgl-tests")?.textContent,template:document.querySelector("#bim-webgl-template")?.textContent,source:document.querySelector("#bim-webgl-source")?.textContent,numpy:document.querySelector("#bim-webgl-numpy")?.textContent,disabled:document.querySelector("#bim-webgl-export")?.disabled,overflow:document.documentElement.scrollWidth>innerWidth||document.documentElement.scrollHeight>innerHeight,inViewport:(()=>{const b=document.querySelector("#app")?.getBoundingClientRect();return !!b&&b.left>=0&&b.top>=0&&b.right<=innerWidth&&b.bottom<=innerHeight})()}));assert.equal(obs.panel,"HTMLDivElement");assert.equal(obs.tests,"4/4");assert.equal(obs.template,native.preflight.templatePath);assert.equal(obs.source,native.preflight.sourcePaths[0]);assert.equal(obs.disabled,false);assert.equal(obs.overflow,false);assert.equal(obs.inViewport,true);return{passed:true,observations:obs};}
|
||||||
195
tools/build-tools-manual.mjs
Normal file
@@ -0,0 +1,195 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
/**
|
||||||
|
* Purpose: 生成项目工具使用手册(docs/current/tools-manual/index.html)。
|
||||||
|
*
|
||||||
|
* 静态扫描 tools/ 与 web/tools/ 下的全部脚本,提取用途/用法/环境变量,
|
||||||
|
* 归并同族脚本,叠加手写核心章节,输出单文件自包含 HTML。
|
||||||
|
* 全程不执行任何工具(emcc 垫片等脚本带副作用)。
|
||||||
|
*
|
||||||
|
* Usage:
|
||||||
|
* node tools/build-tools-manual.mjs # 生成
|
||||||
|
* node tools/build-tools-manual.mjs --check # 校验磁盘文件是否为最新(不一致 exit 1)
|
||||||
|
* node tools/build-tools-manual.mjs --verify # 生成后做语义断言
|
||||||
|
* node tools/build-tools-manual.mjs --stats # 只打印统计
|
||||||
|
* node tools/build-tools-manual.mjs --root <dir> --out <file.html>
|
||||||
|
*
|
||||||
|
* Exit: 0 成功 / 1 --check 不一致或校验失败 / 2 参数或读取错误
|
||||||
|
*/
|
||||||
|
import fs from "node:fs";
|
||||||
|
import path from "node:path";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
|
import { REPO_ROOT, CATEGORIES } from "./tools-manual/config.mjs";
|
||||||
|
import { scan } from "./tools-manual/scan.mjs";
|
||||||
|
import { extract } from "./tools-manual/extract.mjs";
|
||||||
|
import { CHAPTERS, CONTRACT_CHAPTERS } from "./tools-manual/chapters.mjs";
|
||||||
|
import { render } from "./tools-manual/render.mjs";
|
||||||
|
import { verify } from "./tools-manual/verify.mjs";
|
||||||
|
|
||||||
|
const HERE = path.dirname(fileURLToPath(import.meta.url));
|
||||||
|
const DEFAULT_ROOT = path.resolve(HERE, "..");
|
||||||
|
const DEFAULT_OUT = path.join(DEFAULT_ROOT, "docs/current/tools-manual/index.html");
|
||||||
|
|
||||||
|
function parseArgs(argv) {
|
||||||
|
const options = { check: false, verify: false, stats: false, root: DEFAULT_ROOT, out: DEFAULT_OUT };
|
||||||
|
for (let index = 0; index < argv.length; index += 1) {
|
||||||
|
const arg = argv[index];
|
||||||
|
if (arg === "--check") options.check = true;
|
||||||
|
else if (arg === "--verify") options.verify = true;
|
||||||
|
else if (arg === "--stats") options.stats = true;
|
||||||
|
else if (arg === "--help" || arg === "-h") {
|
||||||
|
console.log("node tools/build-tools-manual.mjs [--check] [--verify] [--stats] [--root <dir>] [--out <file>]");
|
||||||
|
process.exit(0);
|
||||||
|
} else if (arg === "--root") options.root = path.resolve(argv[++index] ?? ".");
|
||||||
|
else if (arg === "--out") options.out = path.resolve(argv[++index] ?? DEFAULT_OUT);
|
||||||
|
else {
|
||||||
|
console.error(`未知参数:${arg}`);
|
||||||
|
process.exit(2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return options;
|
||||||
|
}
|
||||||
|
|
||||||
|
function slug(value) {
|
||||||
|
return String(value).toLowerCase().replace(/[^a-z0-9一-龥]+/g, "-").replace(/^-|-$/g, "");
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Anchors must be unique across the whole document. */
|
||||||
|
function makeAnchorFactory() {
|
||||||
|
const used = new Set();
|
||||||
|
return {
|
||||||
|
/** Hand-authored ids (chapters already carry a `tool-` prefix) are taken as-is. */
|
||||||
|
reserve(anchor) {
|
||||||
|
used.add(anchor);
|
||||||
|
return anchor;
|
||||||
|
},
|
||||||
|
unique(prefix, key) {
|
||||||
|
const base = prefix ? `${prefix}-${slug(key) || "x"}` : slug(key) || "x";
|
||||||
|
let anchor = base;
|
||||||
|
let counter = 1;
|
||||||
|
while (used.has(anchor)) anchor = `${base}-${(counter += 1)}`;
|
||||||
|
used.add(anchor);
|
||||||
|
return anchor;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function readNpmCatalog(root) {
|
||||||
|
const catalog = [];
|
||||||
|
for (const [rel, cwd] of [["package.json", ""], ["web/package.json", "web"]]) {
|
||||||
|
let pkg;
|
||||||
|
try {
|
||||||
|
pkg = JSON.parse(fs.readFileSync(path.join(root, rel), "utf8"));
|
||||||
|
} catch {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
for (const [name, command] of Object.entries(pkg.scripts ?? {})) catalog.push({ name, command, cwd });
|
||||||
|
}
|
||||||
|
return catalog;
|
||||||
|
}
|
||||||
|
|
||||||
|
function buildModel(root) {
|
||||||
|
const scanned = scan(root);
|
||||||
|
const extracted = extract(scanned);
|
||||||
|
const anchors = makeAnchorFactory();
|
||||||
|
|
||||||
|
const chapters = CHAPTERS.map((chapter) => ({
|
||||||
|
...chapter,
|
||||||
|
anchor: anchors.reserve(chapter.id),
|
||||||
|
shortTitle: chapter.title.split(" — ")[0],
|
||||||
|
}));
|
||||||
|
|
||||||
|
// Reserved first so generated anchors can never shadow a hand-written id.
|
||||||
|
for (const contract of CONTRACT_CHAPTERS) anchors.reserve(contract.id);
|
||||||
|
for (const section of ["overview", "quickstart", "contracts", "topology", "core", "inventory", "npm", "env", "troubleshooting", "maintenance", "appendix"]) anchors.reserve(section);
|
||||||
|
|
||||||
|
const families = extracted.families.map((family) => ({ ...family, anchor: anchors.unique("fam", family.id) }));
|
||||||
|
const records = extracted.records.map((record) => ({ ...record, anchor: anchors.unique("file", record.relPath) }));
|
||||||
|
const directories = extracted.directories.map((directory) => ({ ...directory, anchor: anchors.unique("dir", directory.relPath) }));
|
||||||
|
|
||||||
|
const byCategory = {};
|
||||||
|
for (const entry of [...families, ...records.filter((record) => !record.familyId), ...directories]) {
|
||||||
|
byCategory[entry.categoryId] = (byCategory[entry.categoryId] ?? 0) + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
const stats = {
|
||||||
|
...extracted.stats,
|
||||||
|
byCategory,
|
||||||
|
npmScripts: readNpmCatalog(root).length,
|
||||||
|
envVars: extracted.envUsage.size,
|
||||||
|
};
|
||||||
|
|
||||||
|
return {
|
||||||
|
root,
|
||||||
|
chapters,
|
||||||
|
contracts: CONTRACT_CHAPTERS,
|
||||||
|
families,
|
||||||
|
records,
|
||||||
|
directories,
|
||||||
|
envUsage: extracted.envUsage,
|
||||||
|
npmCatalog: readNpmCatalog(root),
|
||||||
|
stats,
|
||||||
|
badges: extracted.badges,
|
||||||
|
categories: CATEGORIES,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function main() {
|
||||||
|
const options = parseArgs(process.argv.slice(2));
|
||||||
|
if (!fs.existsSync(options.root)) {
|
||||||
|
console.error(`根目录不存在:${options.root}`);
|
||||||
|
process.exit(2);
|
||||||
|
}
|
||||||
|
|
||||||
|
const model = buildModel(options.root);
|
||||||
|
const html = render(model);
|
||||||
|
|
||||||
|
if (options.stats) {
|
||||||
|
const rows = model.stats.rows;
|
||||||
|
console.log(`文件 ${model.stats.files}`);
|
||||||
|
console.log(`族 ${model.stats.families}(覆盖 ${model.families.reduce((sum, family) => sum + family.count, 0)} 个文件)`);
|
||||||
|
console.log(`单列 ${model.stats.singles}`);
|
||||||
|
console.log(`目录记录 ${model.stats.directories}`);
|
||||||
|
console.log(`索引行 ${rows}`);
|
||||||
|
console.log(`手写章节 ${model.chapters.length} + 契约 ${model.contracts.length}`);
|
||||||
|
console.log(`环境变量 ${model.stats.envVars}`);
|
||||||
|
console.log(`npm 脚本 ${model.stats.npmScripts}`);
|
||||||
|
console.log(`分类 ${Object.entries(model.stats.byCategory).map(([id, count]) => `${id}:${count}`).join(" ")}`);
|
||||||
|
console.log(`页面体积 ${(Buffer.byteLength(html) / 1024).toFixed(0)} KB`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.verify) {
|
||||||
|
const result = verify({ root: options.root, html, model });
|
||||||
|
for (const warning of result.warnings) console.warn(`WARN ${warning}`);
|
||||||
|
for (const error of result.errors) console.error(`FAIL ${error}`);
|
||||||
|
console.log(`verify: ${result.ok ? "OK" : "FAILED"}(${result.rows} 行,${result.searchEntries} 条搜索项,${(result.bytes / 1024).toFixed(0)} KB)`);
|
||||||
|
if (!result.ok) process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.check) {
|
||||||
|
let existing = null;
|
||||||
|
try {
|
||||||
|
existing = fs.readFileSync(options.out, "utf8");
|
||||||
|
} catch {
|
||||||
|
console.error(`FAIL --check:目标文件不存在 ${options.out}`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
if (existing === html) {
|
||||||
|
console.log(`check: OK(${options.out} 已是最新)`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let offset = 0;
|
||||||
|
while (offset < existing.length && offset < html.length && existing[offset] === html[offset]) offset += 1;
|
||||||
|
console.error(`FAIL --check:磁盘文件与生成结果不一致,首个差异在偏移 ${offset}(磁盘 ${existing.length} 字节 / 生成 ${html.length} 字节)`);
|
||||||
|
console.error(` 磁盘:${JSON.stringify(existing.slice(offset, offset + 60))}`);
|
||||||
|
console.error(` 生成:${JSON.stringify(html.slice(offset, offset + 60))}`);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.stats || options.verify) return;
|
||||||
|
|
||||||
|
fs.mkdirSync(path.dirname(options.out), { recursive: true });
|
||||||
|
fs.writeFileSync(options.out, html);
|
||||||
|
console.log(`written ${path.relative(options.root, options.out)} (${(Buffer.byteLength(html) / 1024).toFixed(0)} KB)`);
|
||||||
|
}
|
||||||
|
|
||||||
|
main();
|
||||||
122
tools/build_cam_deburr_profile.mjs
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
import fs from "node:fs";
|
||||||
|
import path from "node:path";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
|
import { audit64Satisfied } from "./audit64.mjs";
|
||||||
|
|
||||||
|
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
||||||
|
const docs = path.join(root, "docs");
|
||||||
|
const dir = path.join(docs, "current", "business-evidence", "desktop-test-cam-testpathopdeburr-20261030");
|
||||||
|
const desktop = JSON.parse(fs.readFileSync(path.join(docs, "p6", "cam-deburr-chrome.json"), "utf8"));
|
||||||
|
const mobile = JSON.parse(fs.readFileSync(path.join(docs, "p6", "cam-deburr-chrome-mobile.json"), "utf8"));
|
||||||
|
const caseId = "desktop-test.Mod.CAM.CAMTests.TestPathOpDeburr";
|
||||||
|
const EXPECTED = 7;
|
||||||
|
|
||||||
|
const contract = {
|
||||||
|
schema: "freecad-web-official-case-acceptance-contract/v1",
|
||||||
|
caseId,
|
||||||
|
source: "freecad-source/src/Mod/CAM/CAMTests/TestPathOpDeburr.py",
|
||||||
|
enabledOfficialMethods: EXPECTED,
|
||||||
|
prerequisites: [
|
||||||
|
"absolute TestPathOpDeburr.py and Path/Op/Deburr.py paths",
|
||||||
|
"official MockToolBit fixture with Diameter, FlatRadius and CuttingEdgeAngle",
|
||||||
|
"PathDeburr.toolDepthAndOffset returns depth, offset, extra and info",
|
||||||
|
"Qt Signal/QT_TRANSLATE_NOOP shims and stdlib numpy/tsp_solver bridges",
|
||||||
|
],
|
||||||
|
passConditions: [
|
||||||
|
"all 7 official methods pass",
|
||||||
|
"end mill (diameter 20, angle 180) at depth 1 with 0.01 step gives depth 0.01 and offset 9 with info false",
|
||||||
|
"legacy tool (angle 0) gives the same depth and offset",
|
||||||
|
"document count returns 0 to 0",
|
||||||
|
"desktop and mobile have no page errors, overflow or external requests",
|
||||||
|
"64-record workbench audit passes on each host",
|
||||||
|
],
|
||||||
|
failureClassification: {
|
||||||
|
prerequisite: "source paths, Deburr import or MockToolBit construction fail before methods",
|
||||||
|
product: "official chamfer depth or offset assertion fails",
|
||||||
|
presentation: "viewport, network or console failure",
|
||||||
|
audit: "workbench audit failure",
|
||||||
|
},
|
||||||
|
persistence: {
|
||||||
|
applicable: false,
|
||||||
|
reason: "deburr math runs on in-memory tool descriptors with no document",
|
||||||
|
database: "not used; SQLite WASM/OPFS is the project persistence standard when needed",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
function complete(report) {
|
||||||
|
const result = report.cases.centroid.state.response?.result;
|
||||||
|
const pre = result?.preflight;
|
||||||
|
const probe = pre?.probe;
|
||||||
|
return (
|
||||||
|
report.result === "pass" &&
|
||||||
|
result?.schema === "freecad-web-cam/test-path-op-deburr/v1" &&
|
||||||
|
result.tests?.length === EXPECTED &&
|
||||||
|
result.tests.every((t) => t.passed === true) &&
|
||||||
|
result.guiUp?.[0] === "bool" &&
|
||||||
|
result.guiUp?.[1] === false &&
|
||||||
|
pre?.passed === true &&
|
||||||
|
Math.abs((probe?.endMill?.depth ?? -1) - 0.01) < 1e-6 &&
|
||||||
|
Math.abs((probe?.endMill?.offset ?? -1) - 9) < 1e-6 &&
|
||||||
|
probe?.endMill?.info === false &&
|
||||||
|
Math.abs((probe?.legacy?.depth ?? -1) - 0.01) < 1e-6 &&
|
||||||
|
Math.abs((probe?.legacy?.offset ?? -1) - 9) < 1e-6 &&
|
||||||
|
result.documentCountBefore === 0 &&
|
||||||
|
result.documentCountAfter === 0 &&
|
||||||
|
report.cases.layout.state.crossOriginIsolated === true &&
|
||||||
|
report.cases.layout.state.bodyOverflow === false &&
|
||||||
|
report.cases.layout.state.propertiesInViewport === true &&
|
||||||
|
report.network.externalRequestCount === 0 &&
|
||||||
|
report.network.httpFailures.length === 0 &&
|
||||||
|
report.exceptions.length === 0 &&
|
||||||
|
report.audit64.status === "passed" &&
|
||||||
|
audit64Satisfied(report.audit64) &&
|
||||||
|
report.audit64.failures === 0
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const passed = complete(desktop) && complete(mobile);
|
||||||
|
const profile = {
|
||||||
|
schema: "freecad-web-official-case-profile/v1",
|
||||||
|
caseId,
|
||||||
|
status: passed ? "passed" : "incomplete",
|
||||||
|
sourceMapped: true,
|
||||||
|
implementationStatus: "native_web_owner_ready",
|
||||||
|
integrationStatus: passed ? "passed" : "integration_pending",
|
||||||
|
acceptancePassed: passed,
|
||||||
|
preflight: desktop.cases.centroid.state.response.result.preflight,
|
||||||
|
officialMethods: {
|
||||||
|
expected: EXPECTED,
|
||||||
|
desktop: desktop.cases.centroid.state.response.result.tests,
|
||||||
|
mobile: mobile.cases.centroid.state.response.result.tests,
|
||||||
|
},
|
||||||
|
viewports: {
|
||||||
|
desktop: { viewport: desktop.viewport, layout: desktop.cases.layout.state, pageErrors: desktop.exceptions, overflow: desktop.cases.layout.state.bodyOverflow },
|
||||||
|
mobile: { viewport: mobile.viewport, layout: mobile.cases.layout.state, pageErrors: mobile.exceptions, overflow: mobile.cases.layout.state.bodyOverflow },
|
||||||
|
},
|
||||||
|
audit64: { desktop: desktop.audit64, mobile: mobile.audit64 },
|
||||||
|
persistence: contract.persistence,
|
||||||
|
evidence: [
|
||||||
|
"acceptance-contract.json",
|
||||||
|
"cam-deburr-native-desktop.json",
|
||||||
|
"cam-deburr-native-mobile.json",
|
||||||
|
"cam-deburr-browser-desktop.json",
|
||||||
|
"cam-deburr-browser-mobile.json",
|
||||||
|
"workbench-surface-audit-desktop.json",
|
||||||
|
"workbench-surface-audit-mobile.json",
|
||||||
|
"cam-deburr-desktop.png",
|
||||||
|
"cam-deburr-mobile.png",
|
||||||
|
].map((file) => `docs/current/business-evidence/desktop-test-cam-testpathopdeburr-20261030/${file}`),
|
||||||
|
};
|
||||||
|
|
||||||
|
fs.mkdirSync(dir, { recursive: true });
|
||||||
|
fs.writeFileSync(path.join(dir, "acceptance-contract.json"), `${JSON.stringify(contract, null, 2)}\n`);
|
||||||
|
fs.writeFileSync(path.join(dir, "desktop-test-cam-deburr-profile.json"), `${JSON.stringify(profile, null, 2)}\n`);
|
||||||
|
console.log(JSON.stringify({
|
||||||
|
status: profile.status,
|
||||||
|
methods: EXPECTED,
|
||||||
|
depth: profile.preflight.probe.endMill.depth,
|
||||||
|
offset: profile.preflight.probe.endMill.offset,
|
||||||
|
audits: [profile.audit64.desktop.records, profile.audit64.mobile.records],
|
||||||
|
}));
|
||||||
|
process.exitCode = passed ? 0 : 1;
|
||||||
115
tools/build_cam_depth_params_profile.mjs
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
import fs from "node:fs";
|
||||||
|
import path from "node:path";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
|
import { audit64Satisfied } from "./audit64.mjs";
|
||||||
|
|
||||||
|
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
||||||
|
const docs = path.join(root, "docs");
|
||||||
|
const dir = path.join(docs, "current", "business-evidence", "desktop-test-cam-testpathdepthparams-20261029");
|
||||||
|
const desktop = JSON.parse(fs.readFileSync(path.join(docs, "p6", "cam-depth-params-chrome.json"), "utf8"));
|
||||||
|
const mobile = JSON.parse(fs.readFileSync(path.join(docs, "p6", "cam-depth-params-chrome-mobile.json"), "utf8"));
|
||||||
|
const caseId = "desktop-test.Mod.CAM.CAMTests.TestPathDepthParams";
|
||||||
|
const EXPECTED = 12;
|
||||||
|
const EXPECTED_PROBE = [8, 6, 4, 2, 1, 0];
|
||||||
|
|
||||||
|
const contract = {
|
||||||
|
schema: "freecad-web-official-case-acceptance-contract/v1",
|
||||||
|
caseId,
|
||||||
|
source: "freecad-source/src/Mod/CAM/CAMTests/TestPathDepthParams.py",
|
||||||
|
enabledOfficialMethods: EXPECTED,
|
||||||
|
prerequisites: [
|
||||||
|
"absolute TestPathDepthParams.py and PathScripts/PathUtils.py paths",
|
||||||
|
"PathUtils imports under the harness shims (PySide.QtCore, numpy.linspace, tsp_solver, lazy_loader)",
|
||||||
|
"shared Units.Velocity and headless worker isolation",
|
||||||
|
],
|
||||||
|
passConditions: [
|
||||||
|
"all 12 official methods pass",
|
||||||
|
"depth_params probe returns [8,6,4,2,1,0]",
|
||||||
|
"document count returns 0 to 0",
|
||||||
|
"desktop and mobile have no page errors, overflow or external requests",
|
||||||
|
"64-record workbench audit passes on each host",
|
||||||
|
],
|
||||||
|
failureClassification: {
|
||||||
|
prerequisite: "PathUtils import or shim setup fails before methods",
|
||||||
|
product: "official depth_params assertion fails",
|
||||||
|
presentation: "viewport, network or console failure",
|
||||||
|
audit: "workbench audit failure",
|
||||||
|
},
|
||||||
|
persistence: {
|
||||||
|
applicable: false,
|
||||||
|
reason: "depth math runs on plain scalars with no document or persistence",
|
||||||
|
database: "not used; SQLite WASM/OPFS is the project persistence standard when needed",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
function complete(report) {
|
||||||
|
const result = report.cases.centroid.state.response?.result;
|
||||||
|
const pre = result?.preflight;
|
||||||
|
return (
|
||||||
|
report.result === "pass" &&
|
||||||
|
result?.schema === "freecad-web-cam/test-path-depth-params/v1" &&
|
||||||
|
result.tests?.length === EXPECTED &&
|
||||||
|
result.tests.every((t) => t.passed === true) &&
|
||||||
|
result.guiUp?.[0] === "bool" &&
|
||||||
|
result.guiUp?.[1] === false &&
|
||||||
|
pre?.passed === true &&
|
||||||
|
JSON.stringify(pre.probe?.values) === JSON.stringify(EXPECTED_PROBE) &&
|
||||||
|
result.documentCountBefore === 0 &&
|
||||||
|
result.documentCountAfter === 0 &&
|
||||||
|
report.cases.layout.state.crossOriginIsolated === true &&
|
||||||
|
report.cases.layout.state.bodyOverflow === false &&
|
||||||
|
report.cases.layout.state.propertiesInViewport === true &&
|
||||||
|
report.network.externalRequestCount === 0 &&
|
||||||
|
report.network.httpFailures.length === 0 &&
|
||||||
|
report.exceptions.length === 0 &&
|
||||||
|
report.audit64.status === "passed" &&
|
||||||
|
audit64Satisfied(report.audit64) &&
|
||||||
|
report.audit64.failures === 0
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const passed = complete(desktop) && complete(mobile);
|
||||||
|
const profile = {
|
||||||
|
schema: "freecad-web-official-case-profile/v1",
|
||||||
|
caseId,
|
||||||
|
status: passed ? "passed" : "incomplete",
|
||||||
|
sourceMapped: true,
|
||||||
|
implementationStatus: "native_web_owner_ready",
|
||||||
|
integrationStatus: passed ? "passed" : "integration_pending",
|
||||||
|
acceptancePassed: passed,
|
||||||
|
preflight: desktop.cases.centroid.state.response.result.preflight,
|
||||||
|
officialMethods: {
|
||||||
|
expected: EXPECTED,
|
||||||
|
desktop: desktop.cases.centroid.state.response.result.tests,
|
||||||
|
mobile: mobile.cases.centroid.state.response.result.tests,
|
||||||
|
},
|
||||||
|
viewports: {
|
||||||
|
desktop: { viewport: desktop.viewport, layout: desktop.cases.layout.state, pageErrors: desktop.exceptions, overflow: desktop.cases.layout.state.bodyOverflow },
|
||||||
|
mobile: { viewport: mobile.viewport, layout: mobile.cases.layout.state, pageErrors: mobile.exceptions, overflow: mobile.cases.layout.state.bodyOverflow },
|
||||||
|
},
|
||||||
|
audit64: { desktop: desktop.audit64, mobile: mobile.audit64 },
|
||||||
|
persistence: contract.persistence,
|
||||||
|
evidence: [
|
||||||
|
"acceptance-contract.json",
|
||||||
|
"cam-depth-params-native-desktop.json",
|
||||||
|
"cam-depth-params-native-mobile.json",
|
||||||
|
"cam-depth-params-browser-desktop.json",
|
||||||
|
"cam-depth-params-browser-mobile.json",
|
||||||
|
"workbench-surface-audit-desktop.json",
|
||||||
|
"workbench-surface-audit-mobile.json",
|
||||||
|
"cam-depth-params-desktop.png",
|
||||||
|
"cam-depth-params-mobile.png",
|
||||||
|
].map((file) => `docs/current/business-evidence/desktop-test-cam-testpathdepthparams-20261029/${file}`),
|
||||||
|
};
|
||||||
|
|
||||||
|
fs.mkdirSync(dir, { recursive: true });
|
||||||
|
fs.writeFileSync(path.join(dir, "acceptance-contract.json"), `${JSON.stringify(contract, null, 2)}\n`);
|
||||||
|
fs.writeFileSync(path.join(dir, "desktop-test-cam-depth-params-profile.json"), `${JSON.stringify(profile, null, 2)}\n`);
|
||||||
|
console.log(JSON.stringify({
|
||||||
|
status: profile.status,
|
||||||
|
methods: EXPECTED,
|
||||||
|
probe: profile.preflight.probe.values,
|
||||||
|
audits: [profile.audit64.desktop.records, profile.audit64.mobile.records],
|
||||||
|
}));
|
||||||
|
process.exitCode = passed ? 0 : 1;
|
||||||
118
tools/build_cam_dogbone_profile.mjs
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
import fs from "node:fs";
|
||||||
|
import path from "node:path";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
|
import { audit64Satisfied } from "./audit64.mjs";
|
||||||
|
|
||||||
|
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
||||||
|
const docs = path.join(root, "docs");
|
||||||
|
const dir = path.join(docs, "current", "business-evidence", "desktop-test-cam-testpathdressupdogboneii-20261030");
|
||||||
|
const desktop = JSON.parse(fs.readFileSync(path.join(docs, "p6", "cam-dogbone-chrome.json"), "utf8"));
|
||||||
|
const mobile = JSON.parse(fs.readFileSync(path.join(docs, "p6", "cam-dogbone-chrome-mobile.json"), "utf8"));
|
||||||
|
const caseId = "desktop-test.Mod.CAM.CAMTests.TestPathDressupDogboneII";
|
||||||
|
const EXPECTED = 16;
|
||||||
|
|
||||||
|
const contract = {
|
||||||
|
schema: "freecad-web-official-case-acceptance-contract/v1",
|
||||||
|
caseId,
|
||||||
|
source: "freecad-source/src/Mod/CAM/CAMTests/TestPathDressupDogboneII.py",
|
||||||
|
enabledOfficialMethods: EXPECTED,
|
||||||
|
prerequisites: [
|
||||||
|
"absolute TestPathDressupDogboneII.py, Path/Dressup/DogboneII.py, Path/Base/Generator/dogboneII.py, Path/Base/Language.py and PathScripts/PathUtils.py paths",
|
||||||
|
"Qt Signal/QT_TRANSLATE_NOOP shims and stdlib numpy/tsp_solver bridges",
|
||||||
|
"official MockOp/MockFeaturePython fixtures and CreateDressup helper",
|
||||||
|
"shared Units.Velocity and headless worker isolation",
|
||||||
|
],
|
||||||
|
passConditions: [
|
||||||
|
"all 16 official methods pass",
|
||||||
|
"CreateDressup(\"G1X10/G1Y20\") plus proxy execute yields a bone-adorned Path",
|
||||||
|
"document count returns 0 to 0",
|
||||||
|
"desktop and mobile have no page errors, overflow or external requests",
|
||||||
|
"64-record workbench audit passes on each host",
|
||||||
|
],
|
||||||
|
failureClassification: {
|
||||||
|
prerequisite: "source paths, shims or official fixtures fail before methods",
|
||||||
|
product: "official DogboneII length or G-code assertion fails",
|
||||||
|
presentation: "viewport, network or console failure",
|
||||||
|
audit: "workbench audit failure",
|
||||||
|
},
|
||||||
|
persistence: {
|
||||||
|
applicable: false,
|
||||||
|
reason: "dressup runs against in-memory mock objects with no document persistence",
|
||||||
|
database: "not used; SQLite WASM/OPFS is the project persistence standard when needed",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
function complete(report) {
|
||||||
|
const result = report.cases.centroid.state.response?.result;
|
||||||
|
const pre = result?.preflight;
|
||||||
|
return (
|
||||||
|
report.result === "pass" &&
|
||||||
|
result?.schema === "freecad-web-cam/test-path-dressup-dogboneii/v1" &&
|
||||||
|
result.tests?.length === EXPECTED &&
|
||||||
|
result.tests.every((t) => t.passed === true) &&
|
||||||
|
result.guiUp?.[0] === "bool" &&
|
||||||
|
result.guiUp?.[1] === false &&
|
||||||
|
pre?.passed === true &&
|
||||||
|
typeof pre.probe?.gcode === "string" &&
|
||||||
|
pre.probe.gcode.includes("X10.000000") &&
|
||||||
|
pre.probe?.commandCount > 2 &&
|
||||||
|
pre.probe?.pathType === "Toolpath" &&
|
||||||
|
result.documentCountBefore === 0 &&
|
||||||
|
result.documentCountAfter === 0 &&
|
||||||
|
report.cases.layout.state.crossOriginIsolated === true &&
|
||||||
|
report.cases.layout.state.bodyOverflow === false &&
|
||||||
|
report.cases.layout.state.propertiesInViewport === true &&
|
||||||
|
report.network.externalRequestCount === 0 &&
|
||||||
|
report.network.httpFailures.length === 0 &&
|
||||||
|
report.exceptions.length === 0 &&
|
||||||
|
report.audit64.status === "passed" &&
|
||||||
|
audit64Satisfied(report.audit64) &&
|
||||||
|
report.audit64.failures === 0
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const passed = complete(desktop) && complete(mobile);
|
||||||
|
const profile = {
|
||||||
|
schema: "freecad-web-official-case-profile/v1",
|
||||||
|
caseId,
|
||||||
|
status: passed ? "passed" : "incomplete",
|
||||||
|
sourceMapped: true,
|
||||||
|
implementationStatus: "native_web_owner_ready",
|
||||||
|
integrationStatus: passed ? "passed" : "integration_pending",
|
||||||
|
acceptancePassed: passed,
|
||||||
|
preflight: desktop.cases.centroid.state.response.result.preflight,
|
||||||
|
officialMethods: {
|
||||||
|
expected: EXPECTED,
|
||||||
|
desktop: desktop.cases.centroid.state.response.result.tests,
|
||||||
|
mobile: mobile.cases.centroid.state.response.result.tests,
|
||||||
|
},
|
||||||
|
viewports: {
|
||||||
|
desktop: { viewport: desktop.viewport, layout: desktop.cases.layout.state, pageErrors: desktop.exceptions, overflow: desktop.cases.layout.state.bodyOverflow },
|
||||||
|
mobile: { viewport: mobile.viewport, layout: mobile.cases.layout.state, pageErrors: mobile.exceptions, overflow: mobile.cases.layout.state.bodyOverflow },
|
||||||
|
},
|
||||||
|
audit64: { desktop: desktop.audit64, mobile: mobile.audit64 },
|
||||||
|
persistence: contract.persistence,
|
||||||
|
evidence: [
|
||||||
|
"acceptance-contract.json",
|
||||||
|
"cam-dogbone-native-desktop.json",
|
||||||
|
"cam-dogbone-native-mobile.json",
|
||||||
|
"cam-dogbone-browser-desktop.json",
|
||||||
|
"cam-dogbone-browser-mobile.json",
|
||||||
|
"workbench-surface-audit-desktop.json",
|
||||||
|
"workbench-surface-audit-mobile.json",
|
||||||
|
"cam-dogbone-desktop.png",
|
||||||
|
"cam-dogbone-mobile.png",
|
||||||
|
].map((file) => `docs/current/business-evidence/desktop-test-cam-testpathdressupdogboneii-20261030/${file}`),
|
||||||
|
};
|
||||||
|
|
||||||
|
fs.mkdirSync(dir, { recursive: true });
|
||||||
|
fs.writeFileSync(path.join(dir, "acceptance-contract.json"), `${JSON.stringify(contract, null, 2)}\n`);
|
||||||
|
fs.writeFileSync(path.join(dir, "desktop-test-cam-dogbone-profile.json"), `${JSON.stringify(profile, null, 2)}\n`);
|
||||||
|
console.log(JSON.stringify({
|
||||||
|
status: profile.status,
|
||||||
|
methods: EXPECTED,
|
||||||
|
commands: profile.preflight.probe.commandCount,
|
||||||
|
audits: [profile.audit64.desktop.records, profile.audit64.mobile.records],
|
||||||
|
}));
|
||||||
|
process.exitCode = passed ? 0 : 1;
|
||||||
118
tools/build_cam_dress_array_profile.mjs
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
import fs from "node:fs";
|
||||||
|
import path from "node:path";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
|
import { audit64Satisfied } from "./audit64.mjs";
|
||||||
|
|
||||||
|
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
||||||
|
const docs = path.join(root, "docs");
|
||||||
|
const dir = path.join(docs, "current", "business-evidence", "desktop-test-cam-testpathdressuparray-20261029");
|
||||||
|
const desktop = JSON.parse(fs.readFileSync(path.join(docs, "p6", "cam-dress-array-chrome.json"), "utf8"));
|
||||||
|
const mobile = JSON.parse(fs.readFileSync(path.join(docs, "p6", "cam-dress-array-chrome-mobile.json"), "utf8"));
|
||||||
|
const caseId = "desktop-test.Mod.CAM.CAMTests.TestPathDressupArray";
|
||||||
|
const EXPECTED = 3;
|
||||||
|
const PROBE_GCODE = "G0 X0.000000 Y0.000000 Z0.000000\nG1 X10.000000 Y10.000000 Z0.000000\n";
|
||||||
|
|
||||||
|
const contract = {
|
||||||
|
schema: "freecad-web-official-case-acceptance-contract/v1",
|
||||||
|
caseId,
|
||||||
|
source: "freecad-source/src/Mod/CAM/CAMTests/TestPathDressupArray.py",
|
||||||
|
enabledOfficialMethods: EXPECTED,
|
||||||
|
prerequisites: [
|
||||||
|
"absolute TestPathDressupArray.py, Path/Dressup/Array.py, Path/Dressup/Utils.py and PathScripts/PathUtils.py paths",
|
||||||
|
"Qt Signal/QT_TRANSLATE_NOOP shims and stdlib numpy/tsp_solver bridges",
|
||||||
|
"in-memory TestEngrave/TestFeature fixtures provided by the official module itself",
|
||||||
|
"shared Units.Velocity and headless worker isolation",
|
||||||
|
],
|
||||||
|
passConditions: [
|
||||||
|
"all 3 official methods pass with exact G-code",
|
||||||
|
"DressupArray zero-copy probe reproduces the source G-code verbatim",
|
||||||
|
"document count returns 0 to 0",
|
||||||
|
"desktop and mobile have no page errors, overflow or external requests",
|
||||||
|
"64-record workbench audit passes on each host",
|
||||||
|
],
|
||||||
|
failureClassification: {
|
||||||
|
prerequisite: "source paths, shims or official fixture classes fail before methods",
|
||||||
|
product: "official array G-code assertion fails",
|
||||||
|
presentation: "viewport, network or console failure",
|
||||||
|
audit: "workbench audit failure",
|
||||||
|
},
|
||||||
|
persistence: {
|
||||||
|
applicable: false,
|
||||||
|
reason: "array dressup operates on in-memory Path objects with shim base objects",
|
||||||
|
database: "not used; SQLite WASM/OPFS is the project persistence standard when needed",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
function complete(report) {
|
||||||
|
const result = report.cases.centroid.state.response?.result;
|
||||||
|
const pre = result?.preflight;
|
||||||
|
return (
|
||||||
|
report.result === "pass" &&
|
||||||
|
result?.schema === "freecad-web-cam/test-path-dressup-array/v1" &&
|
||||||
|
result.tests?.length === EXPECTED &&
|
||||||
|
result.tests.every((t) => t.passed === true) &&
|
||||||
|
result.guiUp?.[0] === "bool" &&
|
||||||
|
result.guiUp?.[1] === false &&
|
||||||
|
pre?.passed === true &&
|
||||||
|
pre.probe?.gcode === PROBE_GCODE &&
|
||||||
|
pre.probe?.pathType === "Path" &&
|
||||||
|
pre.probe?.baseDerived === true &&
|
||||||
|
result.documentCountBefore === 0 &&
|
||||||
|
result.documentCountAfter === 0 &&
|
||||||
|
report.cases.layout.state.crossOriginIsolated === true &&
|
||||||
|
report.cases.layout.state.bodyOverflow === false &&
|
||||||
|
report.cases.layout.state.propertiesInViewport === true &&
|
||||||
|
report.network.externalRequestCount === 0 &&
|
||||||
|
report.network.httpFailures.length === 0 &&
|
||||||
|
report.exceptions.length === 0 &&
|
||||||
|
report.audit64.status === "passed" &&
|
||||||
|
audit64Satisfied(report.audit64) &&
|
||||||
|
report.audit64.failures === 0
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const passed = complete(desktop) && complete(mobile);
|
||||||
|
const profile = {
|
||||||
|
schema: "freecad-web-official-case-profile/v1",
|
||||||
|
caseId,
|
||||||
|
status: passed ? "passed" : "incomplete",
|
||||||
|
sourceMapped: true,
|
||||||
|
implementationStatus: "native_web_owner_ready",
|
||||||
|
integrationStatus: passed ? "passed" : "integration_pending",
|
||||||
|
acceptancePassed: passed,
|
||||||
|
preflight: desktop.cases.centroid.state.response.result.preflight,
|
||||||
|
officialMethods: {
|
||||||
|
expected: EXPECTED,
|
||||||
|
desktop: desktop.cases.centroid.state.response.result.tests,
|
||||||
|
mobile: mobile.cases.centroid.state.response.result.tests,
|
||||||
|
},
|
||||||
|
viewports: {
|
||||||
|
desktop: { viewport: desktop.viewport, layout: desktop.cases.layout.state, pageErrors: desktop.exceptions, overflow: desktop.cases.layout.state.bodyOverflow },
|
||||||
|
mobile: { viewport: mobile.viewport, layout: mobile.cases.layout.state, pageErrors: mobile.exceptions, overflow: mobile.cases.layout.state.bodyOverflow },
|
||||||
|
},
|
||||||
|
audit64: { desktop: desktop.audit64, mobile: mobile.audit64 },
|
||||||
|
persistence: contract.persistence,
|
||||||
|
evidence: [
|
||||||
|
"acceptance-contract.json",
|
||||||
|
"cam-dress-array-native-desktop.json",
|
||||||
|
"cam-dress-array-native-mobile.json",
|
||||||
|
"cam-dress-array-browser-desktop.json",
|
||||||
|
"cam-dress-array-browser-mobile.json",
|
||||||
|
"workbench-surface-audit-desktop.json",
|
||||||
|
"workbench-surface-audit-mobile.json",
|
||||||
|
"cam-dress-array-desktop.png",
|
||||||
|
"cam-dress-array-mobile.png",
|
||||||
|
].map((file) => `docs/current/business-evidence/desktop-test-cam-testpathdressuparray-20261029/${file}`),
|
||||||
|
};
|
||||||
|
|
||||||
|
fs.mkdirSync(dir, { recursive: true });
|
||||||
|
fs.writeFileSync(path.join(dir, "acceptance-contract.json"), `${JSON.stringify(contract, null, 2)}\n`);
|
||||||
|
fs.writeFileSync(path.join(dir, "desktop-test-cam-dress-array-profile.json"), `${JSON.stringify(profile, null, 2)}\n`);
|
||||||
|
console.log(JSON.stringify({
|
||||||
|
status: profile.status,
|
||||||
|
methods: EXPECTED,
|
||||||
|
probeCommands: profile.preflight.probe.gcode.split("\n").filter(Boolean).length,
|
||||||
|
audits: [profile.audit64.desktop.records, profile.audit64.mobile.records],
|
||||||
|
}));
|
||||||
|
process.exitCode = passed ? 0 : 1;
|
||||||