Files
cdsl-cad/backend
likang 994d06aaea feat(selector): 增加离线候选遍历与严格回放验证 Demo
- 新增 selector_candidate_demo,移除 provenance intent 后枚举候选 selector
- 对候选分支执行有界重建与严格 STEP 比较
- 仅在候选遍历完整且唯一 strict 通过时生成 selector 映射记录
- 增加 selector 候选搜索、预算限制和记录生成的测试
- 保持生产 selector resolver 不受 Demo 逻辑影响
- 更新 CADFS 能力台账,记录 IMPRINT 派生 profile 的 lineage selector 缺口
2026-09-10 15:12:57 +08:00
..
2026-08-25 17:41:24 +08:00
2026-08-19 19:34:30 +08:00
2026-09-01 14:10:23 +08:00
2026-08-19 19:34:30 +08:00
2026-09-09 18:41:56 +08:00
2026-09-09 18:41:56 +08:00
2026-08-26 14:13:11 +08:00
2026-09-01 14:10:23 +08:00

Backend

The backend owns the application API and CAD generation workflow:

  • app/: HTTP API, jobs, orchestration, and persistence adapters.
  • agent/: AI prompts, tools, and skills used by the generation agent.
  • engine/: CDSL compiler, sketch solver, and STEP generation runtime.
  • cdsl_library/: Official CDSL examples, metadata, and search index.
  • tests/: Engine, API, and end-to-end generation tests.

Expected development entrypoint: app.main:app, served by Uvicorn.

Reasoning Effort

The backend uses the Chat Completions API. Configure a provider's reasoning budget with CDSL_<PROVIDER>_REASONING_EFFORT; for the current OpenAI setup:

CDSL_OPENAI_REASONING_EFFORT=medium

Use low, medium, or high according to the latency/cost versus quality tradeoff. The setting is sent as the provider's reasoning_effort field to requirements analysis and Authoring CDSL generation. Leave it empty to use the provider/model default. The selected OpenAI-compatible endpoint must support the requested value.

Autonomous CDSL Agent Configuration

Each task has one bounded workflow:

request analysis -> complete cad.author.v1 -> server compilation -> runtime build
-> at most two complete repairs -> final or best-effort publication

The model outputs only local body/feature names and declarative selectors. The server validates strict schemas, allocates Runtime CDSL identities, compiles references, executes dependencies, and preserves the last executable prefix. STEP is the primary artifact; GLB and the CPU-only OpenCascade/Pillow render bundle are generated from the same published revision.

# Install Python rendering dependencies. The renderer reads the revision STEP
# file and creates canonical images without a browser or GPU driver.
pip install -r requirements.txt

The initial generation plus two repairs are the only model calls allowed after requirements analysis. A repair returns a complete replacement Authoring CDSL and may only alter diagnosed features. Runtime selector ambiguity, missing selectors, and unavailable dependencies produce stable diagnostics rather than topology guesses. Requirement compliance is reported independently as pass, fail, pending, or not_applicable; a partial executable model is still published after the repair budget is exhausted.