Skip to content

fix(studio): browser tests run the page runtime built from the checkout's own source - #9099

Merged
miguel-heygen merged 3 commits into
mainfrom
fix/studio-long-text-sealed-typing
Nov 30, 2026
Merged

miguel-heygen merged 3 commits into
mainfrom
fix/studio-long-text-sealed-typing

Conversation

@miguel-heygen

Copy link
Copy Markdown
Collaborator

What

Studio's browser tests now build core's page runtime from the checkout's own source before they run. Before, they loaded whatever runtime build was already in packages/core/dist, which can be older than the source.

Why

These tests put core's page runtime into their frames (require.resolve("@hyperframes/core/runtime"), in 20 files and fixtures). CI builds core first, so CI tests current code. A local checkout tests whatever it last built. On a machine whose build predated #9074, the sealed case "words typed after a sealed text over 200,000 characters save" timed out, because that runtime still refused text over 200,000 characters. Unsealed passed, so a local run of the sealed parity job reported that row as differing between modes, though the code had no such difference.

How

  • tests/buildCoreRuntime.ts runs core's own build:hyperframes-runtime script (0.3 s).
  • vitest.config.ts runs it as the browser project's globalSetup, once before any browser test. Unit tests are unchanged.

Test plan

  • fails without the fix: inlineTextTyping.browser.test.ts ("words typed after a sealed text over 200,000 characters save") times out sealed, waiting 30 s, when core's runtime build predates fix(studio): a sealed preview edits text over 200,000 characters in place, as unsealed does #9074. With the fix, starting from that same old build, it passes.
  • The test still guards the long-text case: with core's MAX_TEXT_MARKUP set back to 200,000 in source, the setup builds that runtime and the sealed case fails while unsealed passes.
  • The whole sealed parity job, locally, starting from the old build: check, run unsealed, run sealed, compare and gate pass, with 38 of 40 at parity. The 200,000-character row is now at parity. The two rows not measured are edit-accuracy bench rows, which only CI runs.
  • inlineTextTyping.browser.test.ts passes all 6 cases, 3 runs in a row in each mode.
  • Studio tsc --noEmit, oxlint, oxfmt and the comment ratchet are clean.
  • Unit tests added/updated: test setup only
  • Manual testing performed: the parity job above
  • Comments follow CONTRIBUTING.md "Comments"

No visible change

Test setup only.

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at 09fb746. Requesting changes for one thing; the change itself reads right.

Blocker:

  • Test reachability is red at this head because of this PR. scripts/test-reachability.json pins packages/studio/vitest.config.ts at 9336af81… (main's file); the file here hashes to b4d43faa51cd0faae3c4899b5237d377df3a6d9f1848889d484a9a6c62b711c8. Re-pin that entry (and its reason text if you want it to mention the setup) and this is an approve.

Read whole: tests/buildCoreRuntime.ts, vitest.config.ts. Checked against source: core's build:hyperframes-runtime script exists and ./runtime resolves to dist/hyperframe.runtime.iife.js, the file that script writes. Nothing run locally (no install on this box); the two hashes above were computed from the files at this head and at main.

What reads right:

  • globalSetup sits on the browser project only, so unit runs are unchanged, and it runs once per vitest process before any browser file.
  • The fails without the fix: line names a real row and the body says how it fails (stale build) and that the row still guards the long-text case.

Note, not a blocker:

  • Each CI shard now rebuilds the runtime after CI's own core build. Same source, same output, about 0.3 s each.

Need: yes, local runs tested a stale build · Size: 11 lines · Reuse: core's own script · Simpler: no · Structure: fine
Risk: low once the pin is updated.

— Rames

@miguel-heygen

Copy link
Copy Markdown
Collaborator Author

Re-pinned in 1f7ae56: scripts/test-reachability.json now pins packages/studio/vitest.config.ts at b4d43faa…, its sha256 at this head. node scripts/check-test-reachability.mjs reports zero orphan tests, also after merging main (head 807d1f9).

@jrusso1020 jrusso1020 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed at 807d1f9. Re-review of my change request at 09fb746.

My one blocker is resolved: scripts/test-reachability.json now pins packages/studio/vitest.config.ts at b4d43faa…. I recomputed the file's sha256 at this head and it matches (b4d43faa51cd0faae3c4899b5237d377df3a6d9f1848889d484a9a6c62b711c8). The reachability check and all other checks are green.

Delta: main was merged in, so I compared the PR's own diff against main at the old head and at this head. The only difference is that one pin line. tests/buildCoreRuntime.ts and the vitest.config.ts line are byte-identical to what I read whole at 09fb746.

Not run locally (no install on this box).

Need: yes, local runs tested a stale build · Size: +12 −1 · Reuse: core's own build script · Simpler: no · Structure: fine
Risk: low; test setup only.

— Rames

@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 30, 2026
@miguel-heygen
miguel-heygen removed this pull request from the merge queue due to a manual request Nov 30, 2026
@miguel-heygen
miguel-heygen added this pull request to the merge queue Nov 30, 2026
Merged via the queue into main with commit 8293568 Nov 30, 2026
76 checks passed
@miguel-heygen
miguel-heygen deleted the fix/studio-long-text-sealed-typing branch November 30, 2026 07:56
@miguel-heygen miguel-heygen mentioned this pull request Nov 30, 2026
4 of 5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants