This document focuses on deploy shape and externally relevant runtime behavior. Internal implementation details belong in architecture docs or source comments.
- 1 —
opencad_kernel.api(default port8000)GET /healthzGET /operationsGET /operations/{name}/schemaPOST /operations/{name}- Operations include:
create_assembly_mate,delete_assembly_mate,list_assembly_mates
- 2 —
opencad_solver.api(default port8001)GET /healthzGET /backend— active solver backend and capabilitiesPOST /sketch/solvePOST /sketch/checkPOST /sketch/diagnose— constraint-graph introspection (DOF, Jacobian, mappings)- Backend selection:
OPENCAD_SOLVER_BACKEND=solvespace|python|auto
- 3 —
opencad_tree.api(default port8002)GET /healthz- tree CRUD + rebuild + serialize/deserialize
- Assembly mate nodes:
is_assembly_mate=truewith bidirectional stale propagation
- 5 —
opencad_agent.api(default port8003)GET /healthzPOST /chat
- 4 —
opencad_viewportruns as a separate React app. - Mock geometry/solver mode is enabled by default (
VITE_USE_MOCK=truebehavior). - Chat targets the live agent service by default; set
VITE_USE_CHAT_MOCK=trueonly when you intentionally want mocked chat responses. - Toggle the rest of the viewport to backend mode by setting
VITE_USE_MOCK=falseand configuring service URLs.
- Kernel registry never throws unhandled payload/lookup exceptions.
- Assembly mate operations validate entity references against the shape store before creation.
- Duplicate mates (same type between same entities) are rejected with
MATE_DUPLICATE. - Tree DAG validation rejects missing parent dependencies and self-dependencies.
- Tree rebuild IDs in API mock kernel are deterministic and parent-lineage aware.
- Assembly mate feature nodes go stale when either constrained shape rebuilds.
- Solver backend auto-selects SolveSpace when available, falls back to Python.
- Solver pre-validates malformed constraint references before optimization.
POST /sketch/diagnosereturns full Jacobian sparsity and DOF analysis.- Agent planning executes tool sequences and returns structured operation logs.
- Reverse proxy routes:
/kernel/* -> 8000/solver/* -> 8001/tree/* -> 8002/agent/* -> 8003
- Serve
opencad_viewportstatic bundle from CDN or edge cache. - Solver backend: set
OPENCAD_SOLVER_BACKEND=auto(orsolvespaceifpython-solvespaceis installed in the deploy image).
- Disable docs/OpenAPI routes in production:
OPENCAD_ENABLE_DOCS=false. - Restrict browser origins with
OPENCAD_CORS_ALLOW_ORIGINS. - Keep services private behind a gateway; expose only intended public routes.
- Terminate TLS at the edge and enforce authentication/authorization there.
- Never commit
.envfiles, secrets, or private datasets.
Part-level 3-D constraints require a topology reference strategy. See TOPOLOGY.md for the problem statement, prior-art analysis, failure-mode checklist, and community proposal template. This is an open research question and contribution opportunity.
pytest
cd opencad_viewport
npm install
npm run devValidate:
- viewport renders mock mesh
- feature tree selection highlights shapes
- sketch overlay shows icons and solve status
- chat panel streams response and operation statuses
- reasoning toggle changes agent response style