RESEARCH · Evulgare · NOT OFFICIAL EVIULON DOCTRINE

Evulgare Simulations Product Evaluation and Development Brief

Research section 5 of 10

Layer Recommendation Advantages Tradeoffs Migration approach
Web application shell TypeScript, React, Vite initially Mature component ecosystem, strong accessibility libraries, incremental embedding in existing server-rendered pages, fast development loop Adds a framework where current pages may be simpler; requires hydration discipline Mount the workbench only inside simulation routes; preserve server-rendered content outside the mount point; migrate one scene at a time
Three-dimensional runtime Babylon.js Integrated WebGPU/WebGL, WebXR, materials, inspector, asset loading, animation, and optional Havok physics Larger and more opinionated than a renderer-only library Build a SceneAdapter interface; reproduce one representative scene; keep legacy scenes available behind a feature flag until parity is proven
Alternative renderer Three.js where justified Lower-level control, broad ecosystem, flexible integration More custom work for asset management, physics, inspector tooling, XR behavior, and scene conventions Retain as a fallback architectural option if a prototype shows materially lower size or migration risk
UI state XState or explicit reducer-based state machines Makes idle → validating → running → replaying → comparing → exporting → error states inspectable and testable Requires state-model discipline and training Start with the workbench lifecycle and collaboration connection state
Server-state client TanStack Query Caching, cancellation, retries, invalidation, and request-state consistency Must not obscure deterministic run identity Key all run queries by normalized input hash, schema version, and engine version
Runtime validation Zod on the client; Pydantic on the server Shared conceptual schemas, generated documentation, bounded input validation Duplicated validation definitions unless code generation is used Generate TypeScript schemas from OpenAPI/JSON Schema where practical
Accessible components React Aria or similarly mature primitives Keyboard and screen-reader behavior without locking the product into a visual theme Complex composite widgets still require manual testing Use for dialogs, tabs, menus, sliders, grids, tooltips, and focus management
Backend API FastAPI, introduced through a strangler migration Typed request models, OpenAPI and JSON Schema generation, WebSocket support, testing utilities, and Python compatibility Running Flask and FastAPI temporarily adds operational complexity Put FastAPI beside Flask; route new endpoints to FastAPI; wrap existing pure service functions; migrate only after golden-contract parity
Domain engine Preserve pure deterministic Python functions Existing proof logic, reproducibility, auditability, and low rewrite risk Python may not suit every future high-throughput numerical workload Define a strict engine interface; optimize only measured hotspots; allow optional Rust/WASM/native kernels behind the same contract
Client concurrency Web Workers with Comlink; optional Rust/WASM Keeps layout, interpolation, parsing, and non-authoritative visual computation off the main thread Serialization and worker lifecycle add complexity Move one measurable long task at a time; do not duplicate canonical server logic without parity tests
Physics Use selectively: Havok for visual scenes; Rapier for deterministic WASM experiments Havok integrates with Babylon; Rapier supports browser deployment and an enhanced determinism mode Most existing scenes are abstract graphs and do not need physics; visual physics can imply false realism Treat physics as presentation unless the same versioned kernel is authoritative; never add physics merely for spectacle citeturn5search0turn12search0turn12search3turn12search6
Real-time communication WebSocket for collaboration; WebRTC only where necessary WebSocket is straightforward for presence, annotations, and synchronized replay; WebRTC is appropriate for media, XR poses, or GPU streaming WebSocket scaling requires connection-state infrastructure; WebRTC is operationally complex Launch asynchronous annotations first, then presenter synchronization; reserve WebRTC for voice/video or streamed laboratories
Primary database Managed PostgreSQL Transactions, relational integrity, JSON support, tenant metadata, mature operations Requires schema governance and migration discipline Store users, workspaces, saved scenario references, annotations, API keys, and billing metadata—not transient frame state
Short-lived state Redis Presence, quotas, ephemeral collaboration state, caching, distributed rate limiting Incorrect use can create hidden durable state Assign TTLs to all transient keys and document whether each key is reconstructable
Event transport NATS JetStream or a managed equivalent Lightweight event fan-out, replayable streams, good fit for run completion, exports, collaboration, and webhooks Another operational system; ordering and delivery semantics must be designed Introduce when asynchronous jobs and webhooks appear, not before
Object storage S3-compatible storage with CDN Durable exports, assets, signed packages, cost-efficient distribution Requires lifecycle, malware scanning, access-policy, and tenancy controls Store immutable content-addressed artifacts; issue short-lived signed URLs
Asset pipeline glTF/GLB, KTX2/Basis textures, Draco or meshopt compression Efficient web-standard asset delivery and GPU-friendly texture compression Compression adds build complexity and can delay first render if overused Establish per-scene asset budgets and progressive levels of detail
Observability OpenTelemetry Vendor-neutral traces, metrics, logs, and collector architecture Instrumentation still requires careful semantic conventions and privacy controls Define run ID, trace ID, engine version, scene version, and capability tier as standard attributes; exclude scenario content by default citeturn12search2turn12search15
CI/CD GitHub Actions or equivalent with preview environments Familiar automation, pull-request validation, reproducible delivery GPU and XR testing require specialized runners or device labs Split fast required checks from scheduled browser, GPU, security, and soak suites
Hosting CDN plus managed containers and managed data services Independent scaling of static assets, APIs, collaboration, and workers More components than a single Flask deployment Begin with a small number of services; split only where scaling, security, or availability boundaries justify it
Premium rendering Optional Unreal or Omniverse GPU pool Enables scenes beyond client hardware and supports premium enterprise experiences High session cost, regional capacity planning, WebRTC operations, latency Keep isolated from the core product and provision only after demonstrated demand

FastAPI’s official capabilities include OpenAPI and JSON Schema generation, typed Python request models, WebSocket endpoints, and documented test-client patterns, making it a pragmatic modernization path without abandoning the existing Python domain layer. citeturn12search10turn12search1turn12search4turn12search14

Canonical data contracts

The platform should define a versioned envelope similar to:

{
  "schemaVersion": "2.0.0",
  "simulationId": "autonomy-assurance-lab",
  "simulationVersion": "2.3.1",
  "engineVersion": "1.8.0",
  "scenario": {
    "presetId": "unexpected-object-baseline",
    "parameters": {}
  },
  "run": {
    "id": "content-addressed-or-generated-id",
    "startedAt": "ISO-8601 timestamp",
    "determinismProfile": "python-authoritative-v1"
  },
  "events": [],
  "outputs": {},
  "metrics": {},
  "proof": {
    "invariants": [],
    "canonicalDigest": "..."
  },
  "representations": {
    "narrative": {},
    "table": {},
    "scene": {}
  },
  "provenance": {
    "researchReferences": [],
    "parentRunId": null,
    "branchEventIndex": null
  }
}

Canonical serialization must specify field ordering or canonical JSON rules, numerical precision, Unicode treatment, absent-versus-null behavior, and schema-version inclusion. Otherwise, equivalent records may produce different digests across languages or runtime versions.

A digest proves integrity relative to the selected canonical representation; it does not prove that assumptions are correct, that reality matches the model, or that a system is certified. Evulgare’s existing proof language already preserves this distinction and should continue doing so. citeturn9view3

Migration sequence

Migration step Work Exit condition
Baseline Capture all current routes, payloads, outputs, proof vectors, screenshots, keyboard workflows, and no-JavaScript representations. Golden regression suite passes against the current production behavior.
Contract extraction Create shared JSON Schema/OpenAPI definitions and a Python domain-engine interface. Every simulation can execute through one typed internal interface without changing results.
Workbench shell Add the TypeScript workbench around one representative simulation, preferably the Accountability Evidence Room or Drone Assurance Lab. Feature parity exists for controls, visual state, table, narrative, proof, and fallback.
Scene adapters Introduce adapters for data-to-scene mapping, camera policy, interaction, selection, and accessibility narration. A second materially different simulation can reuse the shell without page-specific duplication.
FastAPI sidecar Route new versioned endpoints to FastAPI while retaining legacy Flask endpoints. Golden payload and digest tests prove compatibility; generated SDK clients pass contract tests.
Standardized replay and compare Normalize events and snapshots across engines. At least three simulations share the same timeline and comparison components.
Full scene migration Move remaining scenes incrementally behind per-scene feature flags. All public simulations meet shared capability, accessibility, and performance gates.
Opt-in persistence Add identity, workspaces, saved runs, and annotations without changing anonymous defaults. Anonymous public runs remain ephemeral; saved content is tenant-isolated and auditable.
Realtime and authoring Add collaboration and bounded authoring after schemas and authorization stabilize. Threat models, load tests, and abuse controls pass release criteria.
WebGPU and premium rendering Add enhanced rendering and optional GPU streaming. WebGL2 and accessible modes retain full functional parity; costs and quality are measurable.

Experience, quality, security, and commercial strategy

Interaction and visual design

The desired visual direction should be technical, spatial, and cinematic without becoming decorative or militarized. A productive design vocabulary would combine:

The gallery should use still or lightweight animated previews. Motion should pause when cards leave the viewport, when the page is hidden, or when reduced motion is requested. Full engine initialization should occur only after a user launches a simulation.

A recommended desktop workbench structure is:

Source: Evulgare/Evulgare Simulations Product Evaluation and Development Brief.md · SHA-256: 75a3b2a7f03b308d70cf338574c818441001622e6fa0b649cf38f705eda2e862