Browser playground with BETH operator console#6
Merged
Conversation
The unmodified Go compiler built for js/wasm, running against an in-memory Node-style fs shim, with a dependency-free static UI: live recompilation, artifact browser, embedding graph (including computed structural-interface satisfaction), resolved-bundle view, shareable gzip+base64url links, and the determinism digest in the status bar. Deployed to GitHub Pages on push to main. The in-memory source directory is named after the loaded example and the ARD publisher domain matches the repository's own build commands, so the Helio example reproduces the committed dist/ digest exactly and the maintainer example reproduces the repository-root AGENTS.md byte for byte — verified against the Windows CLI during development. Generated assets (typeference.wasm, wasm_exec.js, examples.json) are gitignored and produced by 'make playground'; wasm_exec.js is copied from the building toolchain so it cannot skew from the wasm binary. CI builds the wasm bridge and example packer to prevent bitrot. See ADR-0010. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…nsole Working, browser-verified bring-your-own-key Run tab (Anthropic, OpenAI Responses API, Gemini, GitHub Models; SSE streaming verified against synthetic wire-format streams; error paths verified against live endpoints; keys memory-only, opt-in persistence, CSP pinning connect-src). Kept as scaffolding only: ADR-0011 records the decision to replace it with a no-secrets BETH operator console (pack in wasm, copy/paste collection per ADR-0009's operator model, tar.gz export, local scoring, scorecard visualization) before this branch merges. Also captures the typed-context-shapes idea as a design note (docs/design-notes/) for a future ADR. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The Equivalence tab walks the full BETH loop (ADR-0009) with no secrets in the browser (ADR-0011): the wasm bridge grows a pack entry point over the real eval.Pack; examples ship scenarios (helio's from evals/scenarios, inline ones for starter and maintainer); cells render as copy-prompt/paste-response cards (BETH's operator model); the assembled run exports as a deterministic ustar+gzip archive (fixed mtime); the console prints the local score command; and dropping scorecard.json back in renders adherence, agreement, and divergences. providers.js and the key UI are deleted; the CSP now pins connect-src to the page's own origin. Verified end to end with the real toolchain: browser-packed starter run exported, extracted with system tar, scored by the CLI with zero workspace drift (digest-verified bytes), judged via seeded judge-response.json including a deliberate divergence, and the resulting scorecard.json rendered back in the browser. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… link Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
buchk
added a commit
that referenced
this pull request
Jul 15, 2026
Browser playground with BETH operator console
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A zero-install, zero-backend playground deployed to GitHub Pages (
https://buchk.github.io/TypeFerence/) on every push tomain: edit typed source in the browser and watch compiled Codex/Copilot/Cursor/neutral artifacts, diagnostics, the embedding graph, and the determinism digest update live — plus an Equivalence tab that walks the full BETH loop without ever asking for a credential.How
go/cmd/typeference-wasm— a js/wasm entry point over the existinginternal/packages, exposingcompileandpack. The compiler is not forked, wrapped, or reimplemented; the wasm runs the samecompile.Validate→compile.Build→compile.HashDirectoryandeval.Packpipelines as the CLI.web/playground/memfs.js— an in-memory implementation of the Node-stylefsAPI that Go's js/wasm syscall layer expects, so the compiler's ordinaryoscalls work unchanged inside the tab.web/playground/— dependency-free HTML/CSS/JS: syntax-colored editor, artifact browser, embedding graph (computed structural-interface satisfaction shown as dashed edges), resolved-bundle view, shareable gzip+base64url links, light/dark theme, CSP pinningconnect-srcto the page's own origin.beth.js, ADR-0011) — packs scenario × surface cells in-browser with the realequivalence packcode (examples ship scenarios); cells render as copy-prompt/paste-response cards, which is exactly BETH's attested-operator collection model (ADR-0009); the assembled run exports as a deterministic ustar+gzip archive (fixed mtime); scoring happens locally (typeference equivalence score <run> --live— the judge key stays in your terminal); droppingscorecard.jsonback onto the page renders adherence per surface, cross-surface agreement, and every divergence with the judge's reasoning.make playgroundbuilds the gitignored assets;wasm_exec.jsis copied from the building toolchain's GOROOT so it can never skew from the wasm binary. CI builds the bridge and packer to prevent bitrot.Determinism, made interactive
The in-memory source dir is named after the loaded example and the ARD publisher domain matches the repo's own build commands, so the Helio example reproduces the committed
dist/digest exactly (a22f5410ba5f8e17…) and the maintainer example recompiles the repository-rootAGENTS.mdbyte for byte (8b21fee0…) — browser, Windows CLI, and CI's Linux build all agree on the bytes.No secrets in the browser (ADR-0011)
A bring-your-own-key run surface was built first, worked, and was rejected anyway: asking visitors to paste provider keys into a hosted page is the anti-pattern this project's trust posture argues against. The ADR records the decision and preserves the verified transport knowledge (e.g. OpenAI only answers browser CORS on the Responses API). The console needs no keys at any step that touches this page.
Verified end to end
gofmt/go vet/go test ./...clean; wasm bridge and packer build in CI.tar→ scored by the CLI with zero workspace drift (the CLI's SHA-256 digest check verified the browser-written bytes exactly) → judged via seededjudge-response.jsonincluding a deliberate divergence → the CLI'sscorecard.jsonrendered back in the browser (fail banner, 3/3·3/3·3/3·2/3 adherence, 2/3 agreement, divergence with all four verdicts).Also
docs/design-notes/typed-context-shapes.md).enablement: true, which usually handles this on first deploy).🤖 Generated with Claude Code