Skip to content

Vox playground architecture (research)

Scope: Architecture-only — no playground runtime ships with this note. It folds Phase 4 monitor ideas (vox-language-rules-phase4-runtime-monitors-2026.md) into a concrete product surface.

Authors today rely on:

SurfaceStrengthGap
vox check / vox fmtFull compiler pipelineNot browser-local; no embeddable UX.
vox shell replFast feedback loopNot a structured teaching surface; limited linkage to diagnostics / fixes.
IDEs via vox lspRich editingRequires install; blocks zero-install tutorials.

A playground closes the zero-install loop while staying inside telemetry + sandbox policy (telemetry-trust-ssot.md).

  1. Syntax & diagnostics tier — Wasm bundle of lexer/parser/typecheck read-only stages (mirrors crates/vox-compiler algorithms). Emits the same structured payloads as VoxCompilerDiagnosticPayload / vox check --for-llm.
  2. Formatter tier — Optional second Wasm module wrapping vox_compiler::fmt::format; must respect idempotency tests (format_round_trip.rs).
  3. Execution tier (optional) — Behind explicit Run consent: vox-actor-runtime wasm/isolation lane (vox run --isolation wasm semantics), fuel + allocation caps per Phase 4 plan. No ambient filesystem writes — vox-bounded-fs only.
  4. Telemetry tier — Default local-only mirrors CLI trust boundaries; remote upload remains opt-in per ADR-023. Planned vox.idiom.* families are specified in contracts/telemetry/idiom-events.v1.yaml.
  • Share URL encodes compressed source + syntax_version (never secrets).
  • Diff pane shows structured fixes coming from LSP-shaped JSON (parity with IDE quick-fixes).
  • Deterministic mode exposes --seed contracts from Phase 4 (vox playground --deterministic) once wired.
  • Hosting arbitrary network calls from the playground Wasm tier (would violate effect policy until Phase 5 UX exists).
  • Replacing vox shell repl — playground optimizes documentation + teaching, not power-user shell ergonomics.

When implementation lands, require:

  1. Snapshot parity tests mirroring diagnostic_snapshots / vox-lsp/tests/diagnostic_snapshots.rs.
  2. vox ci parse-status alignment for golden corpus examples (examples/PARSE_STATUS.md).