Repository navigation
feat(material): add gamut coverage and solver cache workbench - #299
sandboxdream wants to merge 1 commit into
Conversation
Add material gamut coverage and fixed/dynamic cache management pages. Preserve current converter controls and harden cache concurrency, ownership, asynchronous status updates, and domain error mapping. 新增耗材色域覆盖与固定、动态层数缓存管理页面。 保留当前转换界面,完善缓存并发与归属、异步状态及领域错误映射。
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 12f889ef63
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| try: | ||
| return await anyio.to_thread.run_sync(run) |
There was a problem hiding this comment.
Dispatch heavy material computations to process workers
For cold-cache coverage, contribution analysis, and dynamic preparation, this executes candidate generation, catalog merging, and gamut analysis inside the API process rather than a process worker. Moving the closure to an AnyIO thread does not provide the required process isolation, and concurrent requests also occupy shared thread-pool slots while waiting up to 30 seconds for the build semaphore, potentially delaying unrelated synchronous API work. Dispatch the heavy operations through top-level, picklable worker entry points, keeping validation and error translation in the route. This violates the CPU-heavy-work placement requirement in AGENTS.md.
AGENTS.md reference: AGENTS.md:L33-L33
Useful? React with 👍 / 👎.
Summary
Material Management lacked a dedicated workflow for comparing a combination’s reachable gamut and each material’s contribution. Fixed-layer cache controls were confined to a converter dialog. This PR adds Gamut Coverage and Solver Cache pages under the existing Material Management section. They share the material combination, layer height, and fixed layer count or dynamic layer range:
Dynamic per-layer candidates are stored apart from fixed-layer caches. Dynamic mode can reuse manual smart caches, but deleting prebuilt dynamic caches never removes the manual ones. Compute requests share the build concurrency limit. A request that waits more than 30 s for a slot gets a retryable structured 503. Endpoints are documented in
docs/material-workbench.md.Validation
Codex ran the backend checks with Python 3.12 and the frontend checks with the pinned pnpm toolchain:
-m smoketest selection was unchanged. Lint excluded only pre-existing untracked.scratchscripts.pnpm buildandgit diff --checkpassed.Not run: the full regression suite and manual browser checks.
AI assistance
Models and tools: GPT-6 Astra via Codex; Claude Fable 5.2 (
claude-fable-5-2) via Claude Code; Claude Opus 5.5 (claude-opus-5-5) via Claude Code.What each model helped with: GPT-6 Astra implemented the final change on a topic branch based on
main, fixed review findings, added tests and documentation, and ran the checks. Claude Fable 5.2 reviewed the diff and re-checked the fixes without editing code. Claude Opus 5.5 (claude-opus-5-5) drafted this description.Notes
摘要
耗材管理此前缺少组合色域与逐耗材贡献的分析入口,固定层数缓存管理集中在转换页弹窗中。本 PR 在现有「耗材管理」下新增「色域覆盖」与「求解缓存」两个页面,共享耗材组合、层高,以及固定层数或动态层数范围:
动态逐层候选与固定层数缓存分开存放。动态模式可以复用手动智能缓存,但删除动态预构建缓存时不会删除手动缓存。计算请求共享构建并发限制,等待构建名额超过 30 秒时返回可重试的结构化 503。接口说明见
docs/material-workbench.md。验证
以下检查由 Codex 使用 Python 3.12 和项目固定版本的 pnpm 运行:
-m smoke测试选择没有改动。lint 只排除了已有的、未跟踪的.scratch脚本。pnpm build和git diff --check通过。未运行:完整回归测试、浏览器手动验证。
AI 协助
模型与工具: GPT-6 Astra,通过 Codex;Claude Fable 5.2(
claude-fable-5-2),通过 Claude Code;Claude Opus 5.5 (claude-opus-5-5),通过 Claude Code。各模型的作用: GPT-6 Astra 在基于
main的主题分支上实现了最终改动,修复审阅中发现的问题,补充了测试和文档,并运行了检查。Claude Fable 5.2 审阅了 diff 并复核修复,没有修改代码。Claude Opus 5.5 (claude-opus-5-5) 撰写了本说明。备注