Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ jobs:
run: pnpm preview:typecheck
- name: Bundle local preview
run: pnpm preview:build
- name: Bundle public authoring studio
run: pnpm studio:build
- name: Compiler, release performance and hostile-input tests
env:
THL_SOURCE_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
Expand All @@ -76,6 +78,8 @@ jobs:
run: pnpm exec playwright install --with-deps chromium
- name: Browser tests
run: pnpm test:browser:run
- name: Built public studio smoke test
run: pnpm audit:playground
- name: Record verified Chromium browser evidence
env:
THL_SOURCE_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
Expand Down Expand Up @@ -136,11 +140,13 @@ jobs:
pnpm typecheck
pnpm preview:typecheck
pnpm preview:build
pnpm studio:build
pnpm test:run
node scripts/verify-release-evidence.mjs
node scripts/test-release-evidence.mjs
node --test scripts/release-candidate-gate.test.mjs
pnpm test:browser:run
pnpm audit:playground
pnpm build
pnpm audit:licenses
pnpm audit:pack
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ All notable changes to Throughline are recorded here. Package versions follow

## [Unreleased]

- Reconcile the public authoring studio with current schema-2 source and the native compact player, keeping the Mermaid feasibility host and its build separate. Add independent studio build and browser smoke coverage; no deployment or npm publication is implied.

- Reconcile compact-player documentation and manual AT instructions with supported view tabs, Inspect toggle, responsive Workflow inspector and source-detail tools; preserve the NOT PERFORMED human acceptance record.
- Separate authored mutable shapes from readonly validated/derived public declarations, with source and packed declaration regressions.
- Enforce strict release evidence identity and schemas, immutable exact-archive preparation and separately authorized staging. Production audit and final human acceptance remain mandatory and outstanding.
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,15 @@ Open http://localhost:5173 to inspect states and source events and
read the matched explanations/questions at desktop, tablet and mobile
widths. The preview is excluded from the published npm package.

## Public authoring studio

The [Playground authoring studio](playground/studio/README.md) uses the current
native public React player with four reference artifacts, strict JSON editing,
compiler diagnostics and validated JSON/Markdown export. Run `pnpm studio:dev`
and open http://localhost:5174. Build with `pnpm studio:build`; the static site
is separate from the experimental Mermaid host above and from the npm package.
Deployment requires separate maintainer approval.

## Behind the model

1. **Validate:** strict schema-2 input is detached and checked for
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
"dev": "vite --config playground/vite.config.ts",
"preview:build": "vite build --config playground/vite.config.ts",
"preview:typecheck": "tsc -p tsconfig.preview.json",
"studio:dev": "vite --config playground/studio/vite.config.ts",
"studio:build": "vite build --config playground/studio/vite.config.ts",
"audit:playground": "node scripts/audit-playground.mjs",
"build": "tsdown && node scripts/verify-dist.mjs",
"typecheck": "tsc --noEmit",
"test:run": "vitest run",
Expand Down
90 changes: 90 additions & 0 deletions playground/studio/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Throughline Playground

A static, browser-only authoring workspace for schema-2 VisualArtifact JSON. This
is the public-facing experience, not a fixed development preview or a separately
published package. It imports the current repository source, so deployment must
be aligned with a reviewed and tested commit.

## User workflow

- Load one of four reference artifacts, or select **New trace**.
- Edit strict schema-2 JSON and see semantic compiler diagnostics after a brief
pause. The path in a diagnostic refers to the JSON artifact. While an edit
is being checked, the old visualization is not presented as current evidence.
- On a valid artifact, use Graph, Sequence, State table and Inspect in
the native player; change its width, presentation theme or playback settings.
- **Format** canonicalizes an already valid artifact into indented JSON.
- **Copy thl** copies a fenced Markdown snippet; **Export** downloads a validated
JSON artifact. Invalid or unreviewed prose is not exported as runnable data.
- Pasting a single complete `thl` Markdown fence unwraps it into editable JSON.
- Edits remain in the current browser tab; there is deliberately no account,
save service, telemetry, network-backed compiler or automatic AI generation.

The editor interprets a body beginning with `{` as strict schema-2 JSON, just
as the source library does. Any other nonempty body is descriptive intent:
it needs independently reviewed materialization and a trusted host's approved
sidecar. The public playground deliberately does not fabricate that step.

## Local development

From the repository root, with Node.js >=24 and the pinned pnpm:

```sh
pnpm install --frozen-lockfile
pnpm preview:typecheck
pnpm studio:dev
```

Visit http://localhost:5174. Before release, run:

```sh
pnpm test:run
pnpm studio:build
pnpm test:browser:run
pnpm audit:playground
```

The existing `pnpm dev` and `pnpm preview:build` commands still serve/build
only the separate Checkout Mermaid feasibility host; they are not public studio
builds. The studio uses the native public React entry and does not import the
experimental Mermaid adapter. Change the Pages project build command/output
only with maintainer approval.

The static output lives in **playground/studio/dist**. No backend routes, API keys or
service bindings are necessary. The package's own `pnpm build` and tarball do
not include the playground.

## Cloudflare Pages deployment (maintainer setup)

Suggested hostname: **playground.0xbuff.com**, after the maintainer has
confirmed DNS ownership. This proposal does not create DNS or deploy the app.

Connect this public repository to a Cloudflare Pages project and configure:

| Setting | Value |
| --- | --- |
| Source branch | `main` after the PR is reviewed and merged |
| Root directory | Repository root |
| Build command | `corepack enable && pnpm install --frozen-lockfile && pnpm studio:build` |
| Output directory | `playground/studio/dist` |
| Build environment | Node.js 24 (set `NODE_VERSION=24` if needed) |
| Environment variables / secrets | None required by the playground |

The pinned `packageManager` is `[email protected]`. Ensure the Pages build
environment supports Corepack/pnpm for that version. Verify the Pages preview
deployment, keyboard navigation, paste/edit/validation, theme, narrow viewport,
console errors and actual artifact export **before** attaching a public custom
domain. In Cloudflare Pages, use the project's **Custom domains** control to
attach the chosen subdomain and follow the DNS guidance for the zone; confirm
the certificate and HTTPS before announcing the URL.

The `public/_headers` file is copied into the static build and adds basic
security and privacy headers when served by Cloudflare Pages. Cloudflare
deployment credentials and DNS records must never be committed to this repo.

## Release boundaries

The playground follows the checked-out schema-2 **source**, not the currently
published npm release. A successful preview deployment is not evidence of npm
v0.2.0 publication, TL-U18 real screen-reader acceptance or completion of
the planned higher-level ThroughlineDocument/VisualPlan capabilities.
19 changes: 19 additions & 0 deletions playground/studio/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#f7f8fc" />
<meta name="description" content="Author and explore deterministic state visualizations. Edit a schema-2 artifact, validate its semantics, and preview every step with Throughline." />
<meta property="og:type" content="website" />
<meta property="og:title" content="Throughline Playground — Make state visible" />
<meta property="og:description" content="Write, validate, and explore state traces with the interactive Throughline authoring playground." />
<meta name="twitter:card" content="summary" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<title>Throughline Playground — Make state visible</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/main.tsx"></script>
</body>
</html>
Loading