Vox playground architecture (research)
Vox playground architecture (research)
Section titled “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.
Problem statement
Section titled “Problem statement”Authors today rely on:
| Surface | Strength | Gap |
|---|---|---|
vox check / vox fmt | Full compiler pipeline | Not browser-local; no embeddable UX. |
vox shell repl | Fast feedback loop | Not a structured teaching surface; limited linkage to diagnostics / fixes. |
IDEs via vox lsp | Rich editing | Requires install; blocks zero-install tutorials. |
A playground closes the zero-install loop while staying inside telemetry + sandbox policy (telemetry-trust-ssot.md).
Architectural slices
Section titled “Architectural slices”- Syntax & diagnostics tier — Wasm bundle of lexer/parser/typecheck read-only stages (mirrors
crates/vox-compileralgorithms). Emits the same structured payloads asVoxCompilerDiagnosticPayload/vox check --for-llm. - Formatter tier — Optional second Wasm module wrapping
vox_compiler::fmt::format; must respect idempotency tests (format_round_trip.rs). - Execution tier (optional) — Behind explicit Run consent:
vox-actor-runtimewasm/isolation lane (vox run --isolation wasmsemantics), fuel + allocation caps per Phase 4 plan. No ambient filesystem writes —vox-bounded-fsonly. - Telemetry tier — Default local-only mirrors CLI trust boundaries; remote upload remains opt-in per ADR-023. Planned
vox.idiom.*families are specified incontracts/telemetry/idiom-events.v1.yaml.
UX contours
Section titled “UX contours”- 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
--seedcontracts from Phase 4 (vox playground --deterministic) once wired.
Non-goals (near term)
Section titled “Non-goals (near term)”- 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.
Verification hooks
Section titled “Verification hooks”When implementation lands, require:
- Snapshot parity tests mirroring
diagnostic_snapshots/vox-lsp/tests/diagnostic_snapshots.rs. vox ci parse-statusalignment for golden corpus examples (examples/PARSE_STATUS.md).