feat(nodebench): real ScratchNode->NodeBench bridge route /events/:slug/wiki#489
Merged
Conversation
feat(nodebench): real ScratchNode->NodeBench bridge receiving route /events/:slug/wiki The bridge was broken end-to-end: nodebenchai.com/events/<slug>/wiki 404d because the src/App.tsx /events matcher (^/events/([^/]+)/?$) rejects trailing segments, and no surface read the source=scratchnode/room params. That is why the ScratchNode wiki reader shipped WITHOUT a "Continue in NodeBench" CTA (a 404 violates HONEST_STATUS). Build the real receiving surface: - ScratchnodeWikiBridge: reads slug (+source/room), loads the PUBLIC no-account getPublishedWikiBySlug, renders the recap inside the NodeBench shell with a conversion frame (Explore NodeBench + View public wiki + Open in ScratchNode). No cross-domain session needed (slug in URL, query is public). - Route in App.tsx matched ABOVE /events/:eventId so the trailing /wiki is captured first (the exact bug that 404d). - Honesty + security: unpublished/unknown -> real empty state (no fake recap); loading state; bodyHtml is server-public-safe AND DOMPurify-sanitized (XSS defense). Tests: ScratchnodeWikiBridge.test.tsx (4: published+CTA+reverse paths; unpublished empty; loading; sanitization strips script/onerror). 4/4 green; full tsc clean. Route-first: ships before the wiki reader CTA is re-added, so the CTA cant dead-end. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> @
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
✅ Dogfood Visual QA Gate: PASSED
ArtifactsDownload the Generated by Dogfood QA Gate |
|
Demo: walkthrough of the surfaces this PR changed is available as a workflow artifact ( |
This was referenced Jun 3, 2026
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.
@
Why
The ScratchNode → NodeBench bridge was broken end-to-end (found during the viral audit):
nodebenchai.com/events/<slug>/wiki404d — thesrc/App.tsx/eventsmatcher^/events/([^/]+)/?$rejects trailing segments, no surface read thesource=scratchnode/roomparams, and the "Now in NodeBench" overlay was hidden demo theater. Thats exactly why the ScratchNode wiki reader (#487) shipped without a "Continue in NodeBench" CTA — pointing at a 404 violates HONEST_STATUS.What (the real receiving surface)
ScratchnodeWikiBridge— reads the slug (+ optionalsource/room), loads the PUBLIC, no-accountevents:getPublishedWikiBySlug(#486, live), and renders the recap inside the NodeBench shell with a conversion frame ("Keep this in NodeBench" →Explore NodeBench, plus "View the public wiki" / "Open in ScratchNode"). No cross-domain session needed — slug is in the URL, query is public.App.tsx—/events/:slug/wikimatched above the single-segment/events/:eventIdroute so the trailing/wikiis captured first (the exact 404 bug).bodyHtmlis server-public-safe (private notes excluded at publish) and DOMPurify-sanitized before render (XSS defense in the main app).Tests
ScratchnodeWikiBridge.test.tsx— 4 cases: published render + NodeBench CTA + reverse paths; unpublished → honest empty; loading; and a sanitization case asserting a<script>+onerrorhandler inbodyHtmlnever reach the DOM. 4/4 green; full-projecttscclean.Route-first: ships before the wiki readers "Continue in NodeBench" CTA is re-added (follow-up), so the CTA can never dead-end. Deeper event→workspace data carryover remains a follow-up.
🤖 Generated with Claude Code
@