architecture

A project reference for PS3D CAD Studio, a browser CAD application with local and remote model tools. It records the repository, languages, libraries, versions, build commands, and project constraints.

In plain words
What is it for?
Use it when editing the PS3D repository, choosing compatible technologies, running checks, or reviewing build and test requirements.
Why use it?
It gives coding agents reliable technical context instead of making them infer the project's setup and verification rules.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/sagar25-code-it/ps3d-cad-studio/architecture
Clone the repo
git clone --depth 1 https://github.com/sagar25-Code-it/ps3d-cad-studio

Made for: Cursor.

Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,232 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00014 $0.01232
Opus 5 $0.00007 $0.00616
Sonnet 5 $0.00003 $0.00246
Haiku 4.5 $0.00001 $0.00123

Measured 2d ago against content hash fce00b01de4e, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

architecture scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/project-context/architecture.mdc · 130 lines

How it starts

The opening of the file, as written. The whole thing — 130 lines — stays where its author put it; the contents beside it link to each section on GitHub.

PS3D architecture context

architecture:
  summary: >-
    PS3D CAD Studio is an original local-first browser CAD research application.
    A strict semantic document and revision journal are authoritative; a serial
    Web Worker evaluates bounded geometry and evidence; IndexedDB stores atomic
    committed revisions; and a Three.js adapter renders disposable mesh buffers.
    The Phase 0 worker-qualified slice models one centered-bore bracket. The
    current public-preview release candidate implements a bounded multi-workbench preview for
    sketching, parts, assemblies, surfaces, drawings, and consent-gated
    model-neutral automation. Vercel Web Functions expose account, personal
    access-token, OAuth metadata/consent, health, and remote HTTPS MCP routes;
    Supabase Auth and Postgres provide the optional tenant boundary. Preview
    geometry remains truth-labeled and does not inherit the qualified solid claim.

  style: modular-monolith

  layers:
    - name: http
      paths:
        - apps/studio-web/index.html
        - apps/studio-web/src/main.tsx
        - apps/studio-web/src/App.tsx
        - apps/studio-web/src/styles.css
        - api
    - name: business
      paths:
        - packages/model-schema/src
        - packages/commands/src
        - packages/sketch-kernel/src
        - packages/solid-kernel-api/src
        - packages/solid-bracket-kernel/src
        - packages/evidence/src
        - packages/import-export/src
        - packages/workbench-core/src
        - packages/workbench-sketch/src
        - packages/workbench-geometry/src
        - packages/workbench-drawing/src
        - packages/workbench-mcp/src
    - name: infrastructure
      paths:
        - apps/studio-web/src/worker-client.ts
        - packages/model-worker/src
        - packages/worker-protocol/src
        - packages/persistence/src
        - packages/viewport-three/src
        - packages/solid-manifold-adapter/src
        - apps/mcp-server/src
        - supabase/migrations
        - scripts

  boundaries:
    - The semantic document and journal are authoritative; kernel and renderer state are derived
    - Geometry evaluation runs serially in a dedicated worker and commits only after validation and persistence
    - Dependency-specific objects, WASM pointers, mutable meshes, and renderer objects never cross package or worker boundaries
    - Main-thread code independently verifies correlated worker results before accepting a revision
    - The viewport receives render artifacts only and must not mutate the model
    - Native input and automation input use exact bounded schemas and fail closed on unknown fields
    - Production geometry must remain project-owned until a separately qualified permissive adapter passes all gates
    - MCP or other automation is read-only by default; mutations require preview, explicit consent, commit, and undo evidence
    - The official MCP SDK and Zod are Node-only transport dependencies; browser automation uses the pure project-owned handler layer
    - Cloud sessions are validated server-side; raw personal tokens are shown once, stored only as HMAC-SHA-256 digests, scoped, expiring, revocable, tenant-isolated, and rate-limited
    - Remote APIs fail closed when required cloud configuration is absent and never expose Supabase administrative credentials to browser code

  integrations:
    - Browser Web Worker for model evaluation and failure containment
    - Browser IndexedDB for atomic committed revision persistence
    - Three.js for disposable 3D visualization and picking
    - File API and object URLs for bounded native JSON and binary STL exchange
    - Web Crypto SHA-256 for semantic, journal, evidence, and mesh identities
    - Vercel static hosting plus Web-standard Node.js functions for authenticated APIs and remote MCP
    - Supabase Auth and Postgres with forced row-level security and service-only token digest/quota operations
    - Local Node stdio MCP server plus a pure-handler remote HTTPS MCP transport
    - OAuth protected-resource metadata and consent bridge for capable AI hosts; scoped personal access tokens remain the explicit fallback

  auth:
    userFacingPattern: Supabase verified-email password sessions with recovery and browser-session storage
    partnerPattern: OAuth 2.1-style delegated access where supported, otherwise unique scoped expiring PS3D personal access tokens
    configPaths:
      - api/_lib/cloud.ts
      - api/auth.ts
      - api/access-tokens.ts
      - api/oauth-consent.ts
      - supabase/migrations/202608220001_remote_mcp.sql

  errorHandling:
    businessException: typed Diagnostic result returned across exact schemas
    codes:
      - INVALID_NUMBER
      - UNIT_MISMATCH
      - OUTSIDE_SUPPORTED_ENVELOPE
      - RESOURCE_LIMIT
      - INVALID_GRAPH
      - UNDERCONSTRAINED
      - CONSTRAINT_CONFLICT
      - DEGENERATE_GEOMETRY
      - OPEN_PROFILE
      - SELF_INTERSECTING_PROFILE
      - AMBIGUOUS_PROFILE
      - UNSUPPORTED_GEOMETRIC_CASE
      - INVALID_SOLID_INPUT
      - INVALID_SOLID_OUTPUT
      - IDEMPOTENCY_CONFLICT
      - REVISION_CONFLICT
      - WORKER_FAILURE
      - PERSISTENCE_FAILURE
      - UNSUPPORTED_OR_CORRUPT_FILE
      - UNSUPPORTED_CAPABILITY
      - CONFIRMATION_REQUIRED
      - PREVIEW_RECEIPT_MISMATCH

  diagrams:
    existing:
      - docs/architecture/SYSTEM_ARCHITECTURE.md
      - docs/architecture/NUMERICAL_AND_GEOMETRY_CONTRACT.md
    preferredFormat: mermaid

  repositoryRelationships:
    - primary: https://github.com/sagar25-Code-it/ps3d-cad-studio
      consumes: []

Read the full file on GitHub · 130 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 130 lines · 14 tokens per session scan A fce00b01de4e

Subscribe to this mod's changes

architecture is a cursor rule published in the GitHub repository sagar25-Code-it/ps3d-cad-studio (0 stars, last pushed 3d ago), licensed MIT. It adds 14 tokens to every session and 1,232 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.