PartMode has two authoring surfaces and one document and geometry boundary. People use the browser interface. Agents use typed operations with explicit permissions, preview, revision checks, and commit. Both paths edit canonical schema-5 documents and use the same exact kernel-worker implementation.
flowchart LR
H["Human UI<br/>page.html and studio.js"] --> D["Canonical schema-5 document"]
M["MCP client"] --> S["server.ts and mcp.ts"]
S --> R["Browser-approved relay"]
S --> X["Server-headless session"]
R --> A["CadCommandService<br/>typed preview and commit"]
X --> A
A --> D
D --> K["studio-kernel.worker.js"]
K --> O["replicad and OpenCascade WASM"]
O --> E["Exact B-rep evidence and exports"]
src/page.htmldefines the visible application shell and controls.src/static/studio.jscoordinates document, worker, interaction, recovery, export, and browser-approved agent behavior.- Focused modules under
src/static/studio-*.jsown document, feature, assembly, drawing, topology, storage, and interaction behavior.
src/static/studio-project-v5.jsdefines canonical schema-5 project data.src/static/studio-v5-runtime-document.jsprepares and canonicalizes the effective runtime document.src/static/studio-agent-service.jsvalidates typed operations, creates detached previews, enforces revisions, and commits accepted changes.
src/static/studio-kernel.worker.jsisolates exact modeling work from the UI thread and dispatches rebuild, validation, import, export, drawing, and inspection requests.src/static/studio-brep-evidence.jsand the topology modules retain the evidence required to distinguish an exact result from a visible mesh.src/static/vendor/replicad-oc.module.jsandsrc/static/vendor/replicad_single.wasmprovide the bundled replicad and OpenCascade runtime.
src/server.tscomposes the HTTP product, accounts, MCP endpoint, live relay, and server-headless sessions.src/mcp.tsexposes the typed MCP tools and routes work tosrc/relay-hub.tsorsrc/headless-sessions.ts.src/headless/agent-host.tsdeliberately reuses the same command service and kernel-worker implementation used by the visible Studio.
Browser-approved projects remain in the browser and require visible session approval. Server-headless projects use an explicit per-key grant and persist under the account. These are separate authority and storage choices.
| Area | Primary entry points | Typical focused checks |
|---|---|---|
| Browser UI and recovery | src/page.html, src/static/studio.js, src/static/studio-storage.js |
npm run smoke:browser, npm run smoke:usability-ui |
| Document and feature behavior | studio-project-v5.js, studio-v5-runtime-document.js, studio-v5-feature-types.js |
the affected npm run smoke:* command |
| Exact geometry and topology | studio-kernel.worker.js, studio-brep-evidence.js, studio-topo-naming.js |
npm run smoke:brep-evidence, npm run smoke:topology-hash, npm run smoke:cad-regression |
| Assemblies | studio-v5-assembly.js, studio-assembly-* |
npm run smoke:assembly-runtime plus the affected assembly smoke |
| Typed agents | studio-agent-service.js, studio-cloud-agent-bridge.js |
npm run smoke:cloud, npm run smoke:agent-headless |
| MCP, relay, and headless | src/mcp.ts, src/relay-hub.ts, src/headless-sessions.ts, src/headless/* |
npm run smoke:mcp, npm run smoke:headless-mcp |
| Drawings and exchange | studio-drawing-*, kernel import and export handlers |
affected smoke:drawing-*, npm run smoke:step-determinism |
npm run ci:gate is the focused baseline, not the entire CAD or browser suite.
Every contribution issue should name the extra runtime, kernel, assembly,
artifact, or browser evidence required for that scope.
- Saved-project compatibility is a product boundary. Do not silently rewrite unrelated document fields or discard unknown extensions.
- A shaded result is not exact completion. Require the relevant settled document, valid B-rep, persistent topology, or artifact evidence.
- Preview and commit are separate operations. A stale revision must fail rather than applying to a different document state.
- Browser-approved and server-headless modes must retain their distinct permission, storage, visibility, and artifact boundaries.
- Keep changes narrow enough that their evidence can be reviewed.