Architecture¶
Product runtime constraints for cadmcp: what any CAD COM maintainer must
preserve. This is not an internal agent playbook.
Backends¶
| Backend | Role |
|---|---|
| Protocol | Shared models, validators, CADBackend surface |
| Fake | Offline engine for CI and local verification |
| Live CAD | Real application automation (SolidWorks 2025 on Windows today) |
Fake and live CAD are peer implementations of the same protocol. Business mixins must not open their own COM connections or import composition modules casually across domains.
STA (live CAD / COM)¶
All COM work runs on a dedicated Single-Threaded Apartment (STA) thread:
- Every COM call goes through the STA executor.
- Business mixins must not open their own COM connections.
- COM objects must not be used from other threads.
- COM objects must not be passed across threads.
- COM init / attach / release / exception mapping stay on the STA lifecycle.
- Thread start / stop / ready / error state remain explicit.
- COM reference release is audited carefully.
Business code reaches COM only through infrastructure.py, the sole
business-side facade over sta.py.
Layering¶
toolsets / kernel / executor
↓
backend protocol models
↓
fake ⊥ live CAD (solidworks)
↓
infrastructure → sta
- Naming / feature aliases and sketch lifecycle stay in their owning modules.
- COM failure codes are mapped in
sta.pyonly. - Tool results use a typed OpResult envelope (
ok/error.code/delta/state_version).
API stability¶
Do not casually rename public tools, change default arguments, reorder COM call sequences, or alter OpResult / error envelopes.
Skills and resources¶
Skills under cadmcp/resources/content/skills/ are exposed as
cadmcp://skill/... (and related cadmcp://help/... topics).