From 6e24bde97b143a0fe0c9abed29fd2533ec05baf4 Mon Sep 17 00:00:00 2001 From: Karan Date: Mon, 26 Oct 2026 15:30:09 -0400 Subject: [PATCH 1/5] DEMO-SCRIPT.md: open with genclass.dev's page check on snowday-predictor.ca A new act 0b before the broken site: genclass.dev/scan on snowday-predictor.ca scores 57/100 with ten findings (low-contrast buttons, a small tap target, missing security headers, generic links), each with its element and fix. The narration leads into the runtime: a static scan cannot see what happens when people use the page. The script notes that the page check runs its own older copy of the visual checks (it reports Visual bugs 100 and misses the white banner the runtime catches in act 4), and that results are cached for 6 hours, so run it once before recording. Co-Authored-By: Claude Opus 5.5 --- demo-site/DEMO-SCRIPT.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/demo-site/DEMO-SCRIPT.md b/demo-site/DEMO-SCRIPT.md index 6a909071..f6cf128b 100644 --- a/demo-site/DEMO-SCRIPT.md +++ b/demo-site/DEMO-SCRIPT.md @@ -54,6 +54,21 @@ the page loads, the stale response, the dropped write and the duplicate, and the 6. **Rehearse the fast typing once**: in "Find your school board", type `halton` fast (under a second). The list ends on five boards (the answer for "h") while the box says halton. That is the first bug. +## 0b. The page check first (30 s) + +Chrome, before anything else: **https://genclass.dev/scan**. Type `snowday-predictor.ca`, **Check page**. A cached +result comes back in a few seconds (a fresh scan takes about 40 s; results are cached for 6 hours, so run it once +before recording). Show: + +- **57/100**, and scroll the categories: Accessibility 53 (low-contrast buttons), Phone 75 (a tap target too small), + Security 46 (no CSP, no HSTS, http does not redirect), Search and sharing 82 ("read more" links). +- Each finding with its element and a one-line fix. + +Say: *"Before touching any code: a free page check on genclass.dev. Ten problems a user hits, each with the element and +the fix. What a static scan can't see is what happens when people actually use the page. That's next."* (The page +check runs its own copy of the visual checks, from before the current runtime: it reports Visual bugs 100 and misses +the white banner that GenClass catches in act 4.) + ## 1. The broken site, live (60 s) Chrome: https://snowday-predictor.ca. Open DevTools docked at the bottom (⌥⌘I), **Network** tab, filter `boards`. From 7a359ec486c433ce64c25ec6573d1600b5aaf045 Mon Sep 17 00:00:00 2001 From: Karan Date: Mon, 26 Oct 2026 15:59:09 -0400 Subject: [PATCH 2/5] DEMO-SCRIPT.md: the page check now finds the white banner and the board finder's race genclass.dev/scan was updated (genclass-site PR 13, deployed 2026-10-26: near-invisible text stays scored; the race probe checks for an older query's results). On snowday-predictor.ca it now scores 50/100 (56 with GenClass on) and reports the banner (fixed with GenClass on) and 'Search results for an older query stayed on the page'. Act 0b says so, and leads into what only GenClass in the page catches: the stuck scroll, the frozen page, the double vote. Co-Authored-By: Claude Opus 5.5 --- demo-site/DEMO-SCRIPT.md | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/demo-site/DEMO-SCRIPT.md b/demo-site/DEMO-SCRIPT.md index f6cf128b..3af31248 100644 --- a/demo-site/DEMO-SCRIPT.md +++ b/demo-site/DEMO-SCRIPT.md @@ -60,14 +60,18 @@ Chrome, before anything else: **https://genclass.dev/scan**. Type `snowday-predi result comes back in a few seconds (a fresh scan takes about 40 s; results are cached for 6 hours, so run it once before recording). Show: -- **57/100**, and scroll the categories: Accessibility 53 (low-contrast buttons), Phone 75 (a tap target too small), - Security 46 (no CSP, no HSTS, http does not redirect), Search and sharing 82 ("read more" links). -- Each finding with its element and a one-line fix. - -Say: *"Before touching any code: a free page check on genclass.dev. Ten problems a user hits, each with the element and -the fix. What a static scan can't see is what happens when people actually use the page. That's next."* (The page -check runs its own copy of the visual checks, from before the current runtime: it reports Visual bugs 100 and misses -the white banner that GenClass catches in act 4.) +- **50/100 without GenClass, 56 with GenClass on.** Scroll the categories: Visual bugs 75, Accessibility 56, Phone + 75, Speed 84, Security 46, Search and sharing 82, **Races 75**. +- **Text that is almost invisible on its background**: the white banner, measured at 1.00:1, with the CSS fix, and + "With GenClass on: fixed". +- **Search results for an older query stayed on the page**: the page check typed `a`, `ab`, `abc` into the board + finder, the answers came back out of order, and the page showed seven boards where the last query alone shows none. +- The rest, each with its element and a one-line fix: low-contrast buttons, a small tap target, missing security + headers, "read more" links. + +Say: *"Before touching any code: a free page check on genclass.dev. It already finds the invisible banner and the +search race, each with the fix. What a scan can't do is click through the page the way people do: the stuck scroll, +the frozen page, the double vote. That's what GenClass in the page is for."* ## 1. The broken site, live (60 s) From 53240482b04577a6caf87d7dbf82619d2f30992d Mon Sep 17 00:00:00 2001 From: Karan Date: Mon, 26 Oct 2026 18:49:37 -0400 Subject: [PATCH 3/5] DEMO-SCRIPT.md: every genclass.dev step as a click, and the ads the stuck scroll hides Acts 2 and 3 are now a click path through genclass.dev (logo, Sign in, Continue with Google, New project, Create new project, the Connect dialog's copy button, the MCP page's Create agent link and Copy), with the Claude Code steps spelled out (accept edits, the MCP server approval after the restart). Section 0 sets up two tabs (genclass.dev and the site) so no act types an address; acts 0b, 1, 4, 5 and 7 start from a tab or a sidebar item. Act 1 points out that the notice's scroll lock hides every Google ad on the page (the first sits just below the window); act 4 scrolls past them once GenClass unlocks the page. 'If something does not fire' covers Google's full-screen and bottom ads. Co-Authored-By: Claude Opus 5.5 --- demo-site/DEMO-SCRIPT.md | 106 +++++++++++++++++++++++++++------------ 1 file changed, 75 insertions(+), 31 deletions(-) diff --git a/demo-site/DEMO-SCRIPT.md b/demo-site/DEMO-SCRIPT.md index 3af31248..3d115ac7 100644 --- a/demo-site/DEMO-SCRIPT.md +++ b/demo-site/DEMO-SCRIPT.md @@ -43,7 +43,11 @@ the page loads, the stale response, the dropped write and the duplicate, and the (⌘⇧R, so the cached page goes). 3. **The dev server**, for act 6 only: `npx --yes wrangler@4 dev --port 8788` in the same folder, in a terminal you will not show. Leave it running. -4. **Chrome**: one window, signed in to Google, no other tabs. Bookmark bar hidden (⌘⇧B). Put it on the left half. +4. **Chrome**: one window, signed in to Google, **signed out of genclass.dev** (if you are signed in: your account + menu at the top right of genclass.dev → Sign out), so act 2 shows the sign-in. Exactly two tabs: **tab 1** + https://genclass.dev (the home page), **tab 2** https://snowday-predictor.ca. Leave tab 1 in front. Bookmark bar + hidden (⌘⇧B). Put the window on the left half. From here on the recording never types an address: every page is a + click from these two tabs. 5. **VS Code**: `code ~/GenClass-lib-main/demo-site/snowday-before`, open `index.html`. Open the integrated terminal (⌃`) and drag it up to about half the window. Close the chat side bar. Put the window on the right half. In the terminal: @@ -56,9 +60,9 @@ the page loads, the stale response, the dropped write and the duplicate, and the ## 0b. The page check first (30 s) -Chrome, before anything else: **https://genclass.dev/scan**. Type `snowday-predictor.ca`, **Check page**. A cached -result comes back in a few seconds (a fresh scan takes about 40 s; results are cached for 6 hours, so run it once -before recording). Show: +Chrome, tab 1, the genclass.dev home page. Scroll down one screen to **Check any page.**, click the box that says +`your-site.com`, type `snowday-predictor.ca` and click **Scan**. A cached result comes back in a few seconds (a fresh +scan takes about 40 s; results are cached for 6 hours, so run it once before recording). Show: - **50/100 without GenClass, 56 with GenClass on.** Scroll the categories: Visual bugs 75, Accessibility 56, Phone 75, Speed 84, Security 46, Search and sharing 82, **Races 75**. @@ -75,7 +79,8 @@ the frozen page, the double vote. That's what GenClass in the page is for."* ## 1. The broken site, live (60 s) -Chrome: https://snowday-predictor.ca. Open DevTools docked at the bottom (⌥⌘I), **Network** tab, filter `boards`. +Chrome: click **tab 2** (snowday-predictor.ca) and reload it (⌘R). Open DevTools docked at the bottom (⌥⌘I), **Network** +tab, type `boards` in its filter box. Five bugs, in this order (the last one freezes the page, so it goes last): 1. Point at the white strip under the menu. Say: *"There is a storm-watch banner there. White on white."* @@ -85,54 +90,78 @@ Five bugs, in this order (the last one freezes the page, so it goes last): for the first letter lands last and wins. A race condition: every autocomplete has one."* 4. In "Will schools close tomorrow?", double-click **Snow day** at a normal pace: the count goes **124 → 126**. Say: *"One person, two votes."* -5. Click **OK** on the notice at the bottom left, then scroll with the wheel: **the page does not move**. Say: *"The - notice locked scrolling and forgot to unlock it."* +5. Click **OK** on the notice at the bottom left, then scroll with the wheel: **the page does not move**. Point out + that there is not one ad on screen: the site runs Google ads, and the first one sits in the cards just below the + bottom of the window. Say: *"The notice locked scrolling and forgot to unlock it. And this site lives on ads: every + one of them is below this line, and nobody can scroll to them. This bug costs money."* 6. Mistype the postal code, `L6H`, and Predict: the error shows, then click anything: **nothing responds**. Say: *"Predict blocks clicks while it works and only unblocks when it succeeds. One typo and the page is dead. Five bugs, live."* ## 2. Sign in and get the prompt (40 s) -Chrome: https://genclass.dev/login → **Continue with Google** → **New project**, name `snowday`, **Create new project**. -The project opens on its **Connect** dialog. Click **Copy the prompt for your coding agent**. Say: *"That's the whole -setup. One prompt."* Then the **MCP** tab → **Create agent link** (you copy it in 3b). +Chrome, tab 1 (still on the page check's result). Every step is a click: + +1. The **GenClass** logo at the top left: back to the home page. +2. **Sign in**, at the top right → **Continue with Google** → pick your Google account. (A first sign-in with Google + creates the account.) You land on **Projects**. +3. **New project**, at the top right of the project list (on an account with no projects yet, the **New project** + button under *Create your first project*). +4. **Project name**: type `snowday` → **Create new project**. +5. The project opens with the **Connect to your project** dialog, on its **Framework** tab. Click the big green + **Copy the prompt for your coding agent**. Say: *"That's the whole setup. One prompt."* +6. Close the dialog with the **×** at its top right. The project's overview stays open in tab 1, waiting for its + first event. ## 3. Claude adds GenClass and deploys (3–4 minutes of Claude working; this stretch gets sped up) -VS Code terminal. Nothing to show in Chrome during this act. +VS Code on the right, Claude Code running in its terminal (from section 0). Chrome only for 3b's agent link. -- **3a.** Paste the copied prompt and add one line at the end before Enter: +- **Before 3a**: click once in Claude Code's input box, then press **Shift+Tab** until the line under it says + **accept edits on**. Claude then edits files without stopping; it still asks before running a command (choose + **Yes**). +- **3a.** Paste (⌘V): Claude Code shows the prompt folded as *[Pasted text …]*. Type a space and this line after it, + then Enter: ```text This is a static site with no build step (index.html served by a Cloudflare Worker, worker.js): use the script tag from the dashboard, and load the agent link from the same CDN version only when the page is on localhost. ``` Claude adds the script tag with the key, connects the store, adds the agent link for local pages and the MCP - server, and reports. Keep `index.html` open so the edit shows. Say: *"No docs read. The dashboard told the agent what - to do."* -- **3b.** The agent link for the dashboard mirror (paste yours): - - ```text - Add to the genclass server in .mcp.json the env GENCLASS_DASHBOARD = and GENCLASS_REPORT = on, then tell me to restart you. - ``` - - Then `/exit` and `claude --model opus --continue`; approve the project's MCP server once. -- **3c.** The demo settings: + server, and reports. Keep `index.html` open in VS Code: the edit shows as Claude makes it. Say: *"No docs read. The + dashboard told the agent what to do."* +- **3b.** The agent link, so the dashboard shows what the agent does in act 6: + 1. Chrome, tab 1 (the project). Left sidebar: **MCP**. + 2. Scroll down to **Agent access** → **Create agent link**. The link shows once: click **Copy** next to it. Say: + *"One link, and my agent can read production."* + 3. VS Code, Claude's input box: type the line below, and paste (⌘V) the link where it says ``, then Enter: + + ```text + Add to the genclass server in .mcp.json the env GENCLASS_DASHBOARD = and GENCLASS_REPORT = on, then tell me to restart you. + ``` + + 4. When Claude says to restart: type `/exit`, Enter, then `claude --model opus --continue`, Enter. Claude Code + asks about the new MCP server in `.mcp.json` (genclass): choose **Use this MCP server**. Shift+Tab to **accept + edits on** again. +- **3c.** The demo settings. Type or paste into Claude, then Enter: ```text Three small changes for this demo. (1) On the GenClass script tag, or in window.GENCLASS_CONFIG, set mode "guard", aggressiveness "eager" and visual { on: true, fix: true }. (2) Show the devtools overlay on every host, not only locally, so the audience sees what GenClass does. (3) Keep the board search state in one GenClass atom instead of the two store keys: const boards = GenClass.runtime.atom("boards", { query: "", results: [] }); the input handler writes it once per response with boards.set((s) => ({ ...s, results: data.results, query: data.q })), and the list renders from boards.subscribe. Keep everything else as it is. Tell me the lines you changed. ``` Say: *"Guard mode. GenClass may now act, with minimal reversible actions, when it is sure."* -- **3d.** Deploy: +- **3d.** Deploy. Type or paste into Claude, then Enter; when Claude asks to run `wrangler deploy`, choose **Yes**: ```text Deploy this to production with XDG_CONFIG_HOME=~/.config-dizon CLOUDFLARE_ACCOUNT_ID=4daefdf7440d182204be114a9c9f5074 npx --yes wrangler@4 deploy, and tell me when https://snowday-predictor.ca serves it. ``` + When Claude says the site serves it, go to act 4. + ## 4. The same site, fixed on the user's screen (75 s) -Chrome: https://snowday-predictor.ca, reloaded (⌘⇧R). DevTools stays open, now on the **Console** tab: every line +Chrome: click **tab 2** (snowday-predictor.ca) and reload it with ⌘⇧R. DevTools stays open, now on the **Console** tab: every line GenClass prints starts with `[GenClass]`. Wait for the badge at the bottom right to say **guard** and the model to be ready (about 5 s). The same things, same order: @@ -144,23 +173,33 @@ ready (about 5 s). The same things, same order: 3. Double-click **Snow day**: the count still goes up by 2. Console: *Flagged a duplicate request … Not acted on*. Say: *"Not everything is safe to fix on the fly. This one it reports, and the agent fixes it in the code."* 4. Click OK on the notice, scroll: **the page scrolls** a second later. Console: *the page cannot scroll: html has - overflow-y: hidden…*, then *Applied a CSS fix: removed the inline overflow: hidden*. + overflow-y: hidden…*, then *Applied a CSS fix: removed the inline overflow: hidden*. Keep scrolling, slowly, down + the page: **the ads load** in the cards, the FAQ and the article list as each comes into view. Say: *"And there + are the ads. One CSS fix on the user's screen, and the site's revenue is back."* Scroll back to the top for the last + one. 5. Mistype `L6H`, Predict: the error shows, and a second later **clicks work**. Console: *pointer-events: none has been left on body…*, then *Applied a CSS fix: removed the inline pointer-events: none on body*. -Badge → **Interventions**: *"Prevented a stale response … discard · guard"* with **Undo**. **Checks**: the banner's +Click the GenClass badge at the bottom right → **Interventions**: *"Prevented a stale response … discard · guard"* with **Undo**. **Checks**: the banner's contrast, the scroll lock and the click block, each with *"Runtime fix: applied"* and its CSS. Say: *"Nothing in the site's code changed. GenClass fixed four of five on the user's screen, reversibly, and reported the fifth."* ## 5. The dashboard (45 s) -Chrome: the project on genclass.dev (wait about 10 s after act 4). Slowly, scroll a little on each: **Overview** -(page loads, problems, stopped by GenClass, model loaded), **Problems** (stale responses, double submits, each with a -**Copy prompt**), **What GenClass did**, **Pages**. Say: *"Everything production saw, with a prompt per problem."* +Chrome: click **tab 1** (the project), about 10 s after act 4, and click **Refresh** at the top right. Then the left +sidebar, one item at a time, scrolling a little on each: + +1. **Project overview**: page loads, problems found, stopped by GenClass, the model loaded. +2. **Problems**: *What GenClass found*, the stale responses and the double submits, each with a **Copy prompt**. +3. **Actions**: *What GenClass did*, the reverted write and the CSS fixes. +4. **Pages**: which pages had them. + +Say: *"Everything production saw, with a prompt per problem."* ## 6. The agent closes the loop (3 minutes; Claude's thinking gets sped up) -The dev build on this Mac, in a Chrome app window (no address bar): +The dev build on this Mac, in a Chrome app window (no address bar). Run this in the off-screen terminal from section +0, step 3; only the window it opens is on camera: ```bash open -na "Google Chrome" --args --app="http://localhost:8788/?genclass=observe" --window-size=760,952 --window-position=0,30 @@ -189,7 +228,8 @@ Type `halton` fast once. Say: *"The dev build, where the agent can replay the ne ## 7. The closed loop on the dashboard (20 s) -The project's **Loop**: **Issue found → Reproduced → Fix proven → Closed**, then **What your agent did**. Say: +Chrome's main window, **tab 1** (the project), left sidebar: **Closed loop**. It shows **Issue found → Reproduced → +Fix proven → Closed**; scroll to **What your agent did**. Say: *"Everything the agent did, mirrored here. A person reads the test and ships."* Stop the recording. ## 8. After the recording: the real site back, GenClass on @@ -224,6 +264,10 @@ from hit testing, and while it is out of view). It is published and the dashboar ## If something does not fire +- A full-screen Google ad after a reload, or an ad bar pinned to the bottom over the notice or the badge: close it + with its × or its arrow tab. They are Google's, not the bugs; Google shows them less often to someone who has + loaded the site many times, so a few may come up and then stop. +- After the scroll fix some ad slots stay empty (a gap in the card): Google fills most slots, not every one. - The race needs the six letters within about a second: type fast. - Wait for the badge's model before typing (the first seconds after a load). - The board search must be the atom from 3c, or guard cannot drop the stale write. From ccae298aaa27e0f525b32b566a1945417323b5c7 Mon Sep 17 00:00:00 2001 From: Karan Date: Mon, 26 Oct 2026 20:02:38 -0400 Subject: [PATCH 4/5] Demo: nothing typed on camera; every prompt from a genclass.dev Copy button DEMO-SCRIPT.md: act 2 starts from the page check's Fix it with GenClass (the project's name filled in), ticks the Connect dialog's choices (Guard, Eager, Badge on the live site, Connect my coding agent to production, Deploy when done) and copies one prompt; act 3 opens Claude Code from VS Code's Claude logo and pastes it (no typed lines: the prompt covers the static site, the atom, the agent link and the deploy); act 6 opens a new conversation the same way and pastes Problems' Fix them all, in which Claude says what to do on the dev page and waits for the loads itself. The dev page window opens in section 0. demo-site/snowday-before: npm run deploy (wrangler with the Dizon login), .vscode/settings.json (the Claude logo opens Claude Code in a terminal), .claude/settings.json (Opus, file edits without asking), .claude kept out of the assets. record: rehearse-act3.mjs takes the prompt from a real dashboard's Connect dialog with the choices ticked; verify-snowday.mjs --port, so rehearsals leave the demo's dev server on 8788 running. Rehearsed on a clean copy with the new prompt alone: Claude covered every page, the board search as one atom, the agent link and its MCP server; guard fixed 4 of 5 (the double vote flagged). Co-Authored-By: Claude Opus 5.5 --- demo-site/DEMO-SCRIPT.md | 166 +++++++----------- demo-site/record/rehearse-act3.mjs | 67 +++---- demo-site/record/verify-snowday.mjs | 7 +- demo-site/snowday-before/.assetsignore | 1 + .../snowday-before/.claude/settings.json | 15 ++ .../snowday-before/.vscode/settings.json | 5 + demo-site/snowday-before/package.json | 1 + demo-site/snowday-before/wrangler.jsonc | 2 +- 8 files changed, 126 insertions(+), 138 deletions(-) create mode 100644 demo-site/snowday-before/.claude/settings.json create mode 100644 demo-site/snowday-before/.vscode/settings.json diff --git a/demo-site/DEMO-SCRIPT.md b/demo-site/DEMO-SCRIPT.md index 3d115ac7..0faddca3 100644 --- a/demo-site/DEMO-SCRIPT.md +++ b/demo-site/DEMO-SCRIPT.md @@ -9,9 +9,10 @@ compatibility date and `ASSETS` binding), and `functions/api/` for the school bo One take, two windows side by side on one screen: **Chrome on the left** (the site, genclass.dev), **VS Code on the right** (the site's folder, Claude Code in the integrated terminal). The story: the broken site, live → one prompt adds GenClass and deploys → the same site, fixed on the user's screen → the dashboard → the agent closes the loop. -About 12 minutes raw; sped up afterwards to 2–3 minutes (only speed changes, no cuts, no zoom). Every prompt you type -into Claude Code is in a box below: copy it. No localhost ever shows: the one act that needs a dev page runs it in a -Chrome app window, which has no address bar. +About 12 minutes raw; sped up afterwards to 2–3 minutes (only speed changes, no cuts, no zoom). **Nothing is typed on +camera** except the site's address in the page check and what a visitor types on the site: every prompt comes from a +Copy button on genclass.dev, and Claude Code starts from the Claude logo in VS Code. No localhost ever shows: the one +act that needs a dev page runs it in a Chrome app window, which has no address bar. ## What GenClass does about the five bugs (tested, see the last section) @@ -29,32 +30,37 @@ the page loads, the stale response, the dropped write and the duplicate, and the ## 0. Before you record (15 minutes, not recorded) -1. **Quit the other Claude Code session** on this Mac (the desktop app's Code tab): its GenClass MCP server owns the - bridge port, and the Claude in VS Code must own it so the dashboard mirror and the replays work. -2. **Reset the code** to its broken state and **deploy it to snowday-predictor.ca**, right before you start recording - (real visitors see the five bugs from now until act 3's deploy): +1. **One GenClass MCP server on this Mac, the one act 6 starts**: it must own the bridge port so the dashboard mirror and + the replays work. Quit other Claude Code sessions that run one (or stop their genclass server). The repo's own + `.mcp.json` is set aside as `.mcp.json.off` for the recording. +2. **Reset the code** to its broken state, forget the last take's MCP entry, and **deploy it to snowday-predictor.ca**, + right before you start recording (real visitors see the five bugs from now until act 3's deploy): ```bash - cd ~/GenClass-lib-main/demo-site/snowday-before && git checkout -- . && git clean -fdqx . && XDG_CONFIG_HOME=~/.config-dizon CLOUDFLARE_ACCOUNT_ID=4daefdf7440d182204be114a9c9f5074 npx --yes wrangler@4 deploy + cd ~/GenClass-lib-main/demo-site/snowday-before && git checkout -- . && git clean -fdqx . && (claude mcp remove genclass -s local 2>/dev/null; true) && npm run deploy + ``` + + (`npm run deploy` is the folder's own deploy script: wrangler with the Dizon login, `XDG_CONFIG_HOME=~/.config-dizon`, + so Mehar's default login stays as it is. `git clean -fdqx` also removes a practice run's `.mcp.json`; the folder's + `.vscode` and `.claude` settings are committed, so they stay.) Open https://snowday-predictor.ca once (⌘⇧R, so the cached page + goes). +3. **The dev server and the dev page**, for act 6 only, in a terminal you will not show: `npx --yes wrangler@4 dev + --port 8788` in the same folder, then the dev page in a Chrome app window (no address bar), minimized with ⌘M: + + ```bash + open -na "Google Chrome" --args --app="http://localhost:8788/?genclass=observe" --window-size=760,952 --window-position=0,30 ``` - (`XDG_CONFIG_HOME=~/.config-dizon` is a separate wrangler login, so Mehar's default login stays as it is; it reaches - both the Dizon and Daybot accounts, so `CLOUDFLARE_ACCOUNT_ID` picks Dizon.) Open https://snowday-predictor.ca once - (⌘⇧R, so the cached page goes). -3. **The dev server**, for act 6 only: `npx --yes wrangler@4 dev --port 8788` in the same folder, in a terminal you - will not show. Leave it running. 4. **Chrome**: one window, signed in to Google, **signed out of genclass.dev** (if you are signed in: your account menu at the top right of genclass.dev → Sign out), so act 2 shows the sign-in. Exactly two tabs: **tab 1** https://genclass.dev (the home page), **tab 2** https://snowday-predictor.ca. Leave tab 1 in front. Bookmark bar hidden (⌘⇧B). Put the window on the left half. From here on the recording never types an address: every page is a click from these two tabs. -5. **VS Code**: `code ~/GenClass-lib-main/demo-site/snowday-before`, open `index.html`. Open the integrated terminal (⌃`) - and drag it up to about half the window. Close the chat side bar. Put the window on the right half. In the terminal: - - ```bash - claude --model opus - ``` - +5. **VS Code**: open the folder `~/GenClass-lib-main/demo-site/snowday-before` (File → Open Folder), open `index.html`, + close every terminal. Put the window on the right half. Do not start Claude: act 3 starts it with the **Claude logo + at the top right of the editor**, which opens Claude Code in a new terminal (the folder's `.vscode/settings.json`). + The folder's `.claude/settings.json` picks Opus and lets Claude edit files without asking; it still asks before a + deploy (press Enter on **Yes**). 6. **Rehearse the fast typing once**: in "Find your school board", type `halton` fast (under a second). The list ends on five boards (the answer for "h") while the box says halton. That is the first bug. @@ -75,7 +81,8 @@ scan takes about 40 s; results are cached for 6 hours, so run it once before rec Say: *"Before touching any code: a free page check on genclass.dev. It already finds the invisible banner and the search race, each with the fix. What a scan can't do is click through the page the way people do: the stuck scroll, -the frozen page, the double vote. That's what GenClass in the page is for."* +the frozen page, the double vote. That's what GenClass in the page is for."* Stay on this page: act 2 starts from its +**Fix it with GenClass** button. ## 1. The broken site, live (60 s) @@ -98,66 +105,34 @@ Five bugs, in this order (the last one freezes the page, so it goes last): *"Predict blocks clicks while it works and only unblocks when it succeeds. One typo and the page is dead. Five bugs, live."* -## 2. Sign in and get the prompt (40 s) +## 2. Sign in and pick what GenClass does (40 s) -Chrome, tab 1 (still on the page check's result). Every step is a click: +Chrome, tab 1, the page check's result. Every step is a click: -1. The **GenClass** logo at the top left: back to the home page. -2. **Sign in**, at the top right → **Continue with Google** → pick your Google account. (A first sign-in with Google - creates the account.) You land on **Projects**. -3. **New project**, at the top right of the project list (on an account with no projects yet, the **New project** - button under *Create your first project*). -4. **Project name**: type `snowday` → **Create new project**. -5. The project opens with the **Connect to your project** dialog, on its **Framework** tab. Click the big green - **Copy the prompt for your coding agent**. Say: *"That's the whole setup. One prompt."* +1. **Fix it with GenClass**, under the score. +2. **Continue with Google** → pick your Google account (a first sign-in creates the account). +3. **Create a new project** opens with the name already filled in, `snowday-predictor.ca`. Click **Create new + project**. +4. The project opens on the **Connect to your project** dialog, **Framework** tab. Tick, top to bottom: + **Guard**, **Eager**, **Badge on the live site**, **Connect my coding agent to production**, **Deploy when done**. + Say: *"Guard: fix what it's sure of. The badge, so you can see it. My agent gets production. And deploy."* +5. **Copy the prompt for your coding agent**. Say: *"That's the whole setup. One prompt."* 6. Close the dialog with the **×** at its top right. The project's overview stays open in tab 1, waiting for its first event. ## 3. Claude adds GenClass and deploys (3–4 minutes of Claude working; this stretch gets sped up) -VS Code on the right, Claude Code running in its terminal (from section 0). Chrome only for 3b's agent link. - -- **Before 3a**: click once in Claude Code's input box, then press **Shift+Tab** until the line under it says - **accept edits on**. Claude then edits files without stopping; it still asks before running a command (choose - **Yes**). -- **3a.** Paste (⌘V): Claude Code shows the prompt folded as *[Pasted text …]*. Type a space and this line after it, - then Enter: - - ```text - This is a static site with no build step (index.html served by a Cloudflare Worker, worker.js): use the script tag from the dashboard, and load the agent link from the same CDN version only when the page is on localhost. - ``` - - Claude adds the script tag with the key, connects the store, adds the agent link for local pages and the MCP - server, and reports. Keep `index.html` open in VS Code: the edit shows as Claude makes it. Say: *"No docs read. The - dashboard told the agent what to do."* -- **3b.** The agent link, so the dashboard shows what the agent does in act 6: - 1. Chrome, tab 1 (the project). Left sidebar: **MCP**. - 2. Scroll down to **Agent access** → **Create agent link**. The link shows once: click **Copy** next to it. Say: - *"One link, and my agent can read production."* - 3. VS Code, Claude's input box: type the line below, and paste (⌘V) the link where it says ``, then Enter: - - ```text - Add to the genclass server in .mcp.json the env GENCLASS_DASHBOARD = and GENCLASS_REPORT = on, then tell me to restart you. - ``` +VS Code on the right. - 4. When Claude says to restart: type `/exit`, Enter, then `claude --model opus --continue`, Enter. Claude Code - asks about the new MCP server in `.mcp.json` (genclass): choose **Use this MCP server**. Shift+Tab to **accept - edits on** again. -- **3c.** The demo settings. Type or paste into Claude, then Enter: +1. Click the **Claude logo** at the top right of the editor: Claude Code opens in a terminal. +2. Click in its input box and paste (⌘V): Claude Code shows the prompt folded as *[Pasted text …]*. Press Enter. +3. Claude puts the script tags on every page (guard, eager, the visual fixes, the badge), keeps the board search in one + atom, adds the agent link for local pages and its own GenClass MCP server with the agent link, checks the site + locally, then asks to run `npm run deploy`: press Enter on **Yes**. Keep `index.html` open: the edits show as Claude + makes them. - ```text - Three small changes for this demo. (1) On the GenClass script tag, or in window.GENCLASS_CONFIG, set mode "guard", aggressiveness "eager" and visual { on: true, fix: true }. (2) Show the devtools overlay on every host, not only locally, so the audience sees what GenClass does. (3) Keep the board search state in one GenClass atom instead of the two store keys: const boards = GenClass.runtime.atom("boards", { query: "", results: [] }); the input handler writes it once per response with boards.set((s) => ({ ...s, results: data.results, query: data.q })), and the list renders from boards.subscribe. Keep everything else as it is. Tell me the lines you changed. - ``` - - Say: *"Guard mode. GenClass may now act, with minimal reversible actions, when it is sure."* -- **3d.** Deploy. Type or paste into Claude, then Enter; when Claude asks to run `wrangler deploy`, choose **Yes**: - - ```text - Deploy this to production with XDG_CONFIG_HOME=~/.config-dizon CLOUDFLARE_ACCOUNT_ID=4daefdf7440d182204be114a9c9f5074 npx --yes wrangler@4 deploy, and tell me when https://snowday-predictor.ca serves it. - ``` - - When Claude says the site serves it, go to act 4. +Say: *"No docs read, nothing typed. The dashboard told the agent what to do."* When Claude says the site is deployed, +go to act 4. ## 4. The same site, fixed on the user's screen (75 s) @@ -194,37 +169,21 @@ sidebar, one item at a time, scrolling a little on each: 3. **Actions**: *What GenClass did*, the reverted write and the CSS fixes. 4. **Pages**: which pages had them. -Say: *"Everything production saw, with a prompt per problem."* +Say: *"Everything production saw, with a prompt per problem."* Back on **Problems**, click **Fix them all: copy one +prompt**. ## 6. The agent closes the loop (3 minutes; Claude's thinking gets sped up) -The dev build on this Mac, in a Chrome app window (no address bar). Run this in the off-screen terminal from section -0, step 3; only the window it opens is on camera: - -```bash -open -na "Google Chrome" --args --app="http://localhost:8788/?genclass=observe" --window-size=760,952 --window-position=0,30 -``` +1. VS Code: click the **Claude logo** again. A new conversation opens in a new terminal: it has the GenClass MCP server + act 3 added. Paste (⌘V), Enter. +2. Click the dev page's window in the Dock (Chrome, minimized in section 0: the dev build, no address bar). Say: *"The + dev build, where the agent can replay the network."* +3. Claude checks the page is connected, then says in one line what to do on the page each time it needs a load + (reload, type `halton` fast; double-click **Snow day**; and so on). Do it; Claude waits and goes on by itself. Leave + the window alone while Claude edits. -Type `halton` fast once. Say: *"The dev build, where the agent can replay the network."* Then, one prompt at a time -(close the app window with ⌘W while Claude edits; reopen it with the command above when a prompt asks for a load): - -1. ```text - The board search on the dev page shows boards for the wrong query sometimes. Use genclass_status to check the page is connected, then start an explore with genclass_explore (3 runs) on that page; I will load it five times and type the same search. Do not report yet. - ``` - Five loads: reload (⌘R), wait 3 s, type `halton` fast, wait 3 s. -2. ```text - Report the explore with genclass_explore and explain the top race finding with genclass_explain, briefly. Then arm a replay of that finding with genclass_replay; I will load the page and type the same search. Do not fix anything yet and do not check the result yet. - ``` - One load with `halton`. Close the window. -3. ```text - Check the replay result with genclass_replay. If it reproduced, fix the bug in index.html the simplest way (a sequence number per search request so an older response that arrives later is ignored), save the regression test genclass_explain generates under test/, then arm the replay again. I will load the page and type the same search; do not check the result yet. - ``` - Say at **REPRODUCED**: *"Proven, not guessed."* One load with `halton`. Close the window. -4. ```text - Check the replay result with genclass_replay. Then the other four problems GenClass found on this page: the double vote in the poll, the alert bar's contrast, the click block after a mistyped postal code and the scroll lock after the notice. Use genclass_findings and genclass_explain on each, fix the cause in index.html (small, idiomatic fixes), and sum up in five lines what you found, proved and fixed. - ``` - Say at **not reproduced**: *"Same order, no bug."* Then: *"And the other four, from GenClass's own measurements, a - line each. Deploy, and GenClass keeps watching."* +Say at **REPRODUCED**: *"Proven, not guessed."* At **not reproduced**: *"Same order, no bug."* At the summary: +*"Every problem, one line each: found, proven, fixed. Deploy, and GenClass keeps watching."* ## 7. The closed loop on the dashboard (20 s) @@ -242,7 +201,8 @@ cd ~/GenClass-lib-main/demo-site/snowday-before && XDG_CONFIG_HOME=~/.config-diz `3b0ff5e1-…` is the version Mehar deployed on 2026-10-25, live when the demo was prepared. The demo's board finder and poll are demo data and must not stay on the real site; the agent's fixes from act 6 stay in the -folder as the record of the demo. Then `git checkout -- . && git clean -fdqx .` resets the folder for the next take. +folder as the record of the demo. Section 0, step 2 resets the folder for the next take, and the project from this take +can go with **Project Settings → Delete project** on genclass.dev. ## After: the 2–3 minute cut @@ -254,6 +214,7 @@ waits. ```bash npm run build -w @genclass/runtime +node demo-site/record/rehearse-act3.mjs # act 3 from genclass.dev's own copied prompt (Guard, Eager, Badge ticked): guard 4/5 on what Claude wrote node demo-site/record/verify-snowday.mjs --keep # observe: 5/5 bugs show; guard: 4/5 fixed, the double vote flagged node demo-site/record/agent-fix-snowday.mjs # Claude (Opus) fixes all five in index.html from GenClass's findings node demo-site/record/dashboard-e2e.mjs # a real genclass.dev project: events, problems, the Loop log mirrored @@ -270,7 +231,10 @@ from hit testing, and while it is out of view). It is published and the dashboar - After the scroll fix some ad slots stay empty (a gap in the card): Google fills most slots, not every one. - The race needs the six letters within about a second: type fast. - Wait for the badge's model before typing (the first seconds after a load). -- The board search must be the atom from 3c, or guard cannot drop the stale write. +- Guard drops the stale search only when the board search is one atom (the prompt's step 4 asks for it) and Eager is + ticked: guard's default margin lets this site's stale answer through. +- Claude stops with a question instead of going on: press Enter on its suggested answer; the prompts are written so + it needs no typed reply. - `genclass_status` says no page: load the dev page after Claude's MCP server started. - A replay says the armed load recorded nothing: a reload used it up. Arm again, then load once. - The shop (`demo-site/tiny-shop-before`, `DEMO.md`) is the fallback demo: five bugs, all five fixed in guard. diff --git a/demo-site/record/rehearse-act3.mjs b/demo-site/record/rehearse-act3.mjs index 3ba8cc77..1e212841 100644 --- a/demo-site/record/rehearse-act3.mjs +++ b/demo-site/record/rehearse-act3.mjs @@ -1,10 +1,12 @@ -// A rehearsal of the demo's act 3 on a copy of demo-site/snowday-before: a fresh genclass.dev project (/start), its real -// Connect prompt plus the script's static-site line, then the script's three-change prompt (3c), both through Claude -// Code on Opus exactly as the recording does; then what Claude wrote is checked, and the five bugs are played on the -// result in guard (verify-snowday.mjs --src). No deploy: the copy stays in out/rehearsal-snowday. +// A rehearsal of the demo's act 3 on a copy of demo-site/snowday-before: a fresh genclass.dev project (/start), its +// Connect dialog with the act's choices ticked (Guard, Eager, Badge on the live site, Connect my coding agent to +// production; never Deploy), the prompt its Copy button holds, given to Claude Code on Opus exactly as the recording +// pastes it; then what Claude wrote is checked, and the five bugs are played on it in guard (verify-snowday.mjs --src, +// on port 8791 so the demo's dev server on 8788 keeps running). No deploy: the copy stays in out/rehearsal-snowday, and +// the MCP entry Claude adds for the agent link is removed at the end. // Usage: node demo-site/record/rehearse-act3.mjs import { spawnSync } from "node:child_process"; -import { readFileSync, rmSync, writeFileSync } from "node:fs"; +import { copyFileSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs"; import { dirname, join } from "node:path"; import { fileURLToPath } from "node:url"; import { chromium } from "playwright"; @@ -13,10 +15,6 @@ const REC = dirname(fileURLToPath(import.meta.url)); const ROOT = join(REC, "..", ".."); const WORK = join(REC, "out", "rehearsal-snowday"); const sh = (cmd, cwd = ROOT) => spawnSync("bash", ["-lc", cmd], { cwd, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"], maxBuffer: 50 * 1024 * 1024 }); -const SCRIPT = readFileSync(join(ROOT, "demo-site", "DEMO-SCRIPT.md"), "utf8"); -const block = (after) => { const i = SCRIPT.indexOf(after); const a = SCRIPT.indexOf("```text\n", i) + 8; return SCRIPT.slice(a, SCRIPT.indexOf("\n ```", a)).trim(); }; -const STATIC_LINE = block("- **3a.**"); -const PROMPT_3C = block("- **3c.**"); // ---------------------------------------------------------------------------------------------------- the project and its prompt const browser = await chromium.launch({ headless: true }); @@ -27,41 +25,44 @@ await page.click("#go"); await page.waitForSelector("#dash", { state: "visible", timeout: 30000 }); const link = (await page.$eval("#dash", (a) => a.textContent)).trim(); await page.goto(`${link}#connect`, { waitUntil: "domcontentloaded" }); -await page.waitForTimeout(3000); -const copied = (await page.locator('button:has-text("Copy the prompt for your coding agent")').first().getAttribute("data-copy")) ?? ""; +await page.waitForSelector("#cchoices", { state: "visible", timeout: 15000 }); +for (const k of ["guard", "eager", "badge", "agent"]) await page.check(`#cchoices [data-choice="${k}"]`); +const copied = (await page.getAttribute("#cpinstall", "data-copy")) ?? ""; await browser.close(); const token = (copied.match(/gc_[A-Za-z0-9]{22}/) ?? [""])[0]; -console.log(`project: key ${token ? "found" : "MISSING"}, prompt ${copied.length} chars, overlay line ${copied.includes("mountDevtools") ? "yes" : "no"}`); +console.log(`project: key ${token ? "found" : "MISSING"}, prompt ${copied.length} chars, guard ${copied.includes('data-mode="guard"') ? "yes" : "no"}, agent link ${copied.includes("GENCLASS_DASHBOARD=") ? "yes" : "no"}, deploy ${copied.includes("Deploy it") ? "YES (should not be)" : "no"}`); -// ---------------------------------------------------------------------------------------------------- Claude, twice +// ---------------------------------------------------------------------------------------------------- Claude, once, with the copied prompt rmSync(WORK, { recursive: true, force: true }); -sh(`rsync -a --exclude .wrangler --exclude node_modules "${join(ROOT, "demo-site", "snowday-before")}/" "${WORK}/"`); -const claude = (prompt, cont) => { - const t0 = Date.now(); - const r = sh(`export PATH="$HOME/.local/bin:$PATH"; claude -p ${JSON.stringify(prompt)} ${cont ? "--continue" : ""} --model opus --output-format json --permission-mode acceptEdits --allowedTools "Bash,Edit,Write,Read,Glob,Grep,WebFetch,mcp__genclass__*"`, WORK); - let out = ""; try { out = JSON.parse(r.stdout).result ?? r.stdout; } catch { out = r.stdout || r.stderr; } - console.log(`\n--- Claude (${Math.round((Date.now() - t0) / 1000)} s):\n${out.slice(0, 1800)}`); -}; -claude(`${copied}\n\n${STATIC_LINE}`, false); -claude(PROMPT_3C, true); -for (const p of [8788, 8787, 5173]) sh(`lsof -nP -iTCP:${p} -sTCP:LISTEN -t | xargs -r kill 2>/dev/null; true`); +mkdirSync(WORK, { recursive: true }); +sh(`git archive HEAD demo-site/snowday-before | tar -x -C "${WORK}" --strip-components=2`); +copyFileSync(join(ROOT, "demo-site", "snowday-before", "package.json"), join(WORK, "package.json")); +const t0 = Date.now(); +const r = sh(`export PATH="$HOME/.local/bin:$PATH"; claude -p ${JSON.stringify(copied)} --model opus --output-format json --permission-mode acceptEdits --allowedTools "Bash,Edit,Write,Read,Glob,Grep,WebFetch"`, WORK); +let out = ""; +try { out = JSON.parse(r.stdout).result ?? r.stdout; } catch { out = r.stdout || r.stderr; } +console.log(`\n--- Claude (${Math.round((Date.now() - t0) / 1000)} s):\n${out.slice(0, 1800)}`); +// leave nothing behind: the MCP entry with the agent link, servers started from the copy +sh(`export PATH="$HOME/.local/bin:$PATH"; claude mcp remove genclass -s local`, WORK); +for (const pid of sh("lsof -nP -iTCP -sTCP:LISTEN -Fp | tr -d p").stdout.split("\n").filter(Boolean)) { + if (sh(`lsof -a -p ${pid} -d cwd -Fn | grep ^n | cut -c2-`).stdout.trim().startsWith(WORK)) sh(`kill ${pid}`); +} // ---------------------------------------------------------------------------------------------------- what Claude wrote const html = readFileSync(join(WORK, "index.html"), "utf8"); const has = (name, ok) => console.log(` ${ok ? "ok " : "MISSING"} ${name}`); console.log("\nindex.html:"); -has("the project key", html.includes(token)); +has("the project key", !!token && html.includes(token)); has("the GenClass runtime from the CDN", /cdn\.jsdelivr\.net\/npm\/@genclass\/runtime@/.test(html)); -has("guard mode", /guard/.test(html)); +has("guard mode", /data-mode="guard"|mode:\s*["']guard/.test(html)); has("eager", /eager/.test(html)); -has("visual fixes", /fix:\s*true|data-visual|visual/.test(html)); -has("the devtools overlay", /devtools/.test(html)); -has("the boards atom", /atom\(\s*["']boards["']/.test(html)); -has("the agent link for localhost", /connectAgent/.test(html)); -has(".mcp.json", (() => { try { return readFileSync(join(WORK, ".mcp.json"), "utf8").includes("@genclass/mcp"); } catch { return false; } })()); -writeFileSync(join(REC, "out", "rehearsal-head.txt"), html.slice(0, html.indexOf(""))); +has("visual fixes", /data-visual="fix"|fix:\s*true/.test(html)); +has("the overlay on every host", /data-devtools(?!="local")|mountDevtools|devtools:\s*true/.test(html)); +has("the board search as one atom", /atom\(\s*["'][^"']+["']\s*,\s*\{\s*query/.test(html)); +has("the agent link for local hosts", /connectAgent/.test(html)); +writeFileSync(join(REC, "out", "rehearsal-head.txt"), html.slice(0, html.indexOf(' /^==|fixed|BROKEN|raw/.test(l)).join("\n")); +const v = spawnSync(process.execPath, [join(REC, "verify-snowday.mjs"), "--src", WORK, "--keep", "--port", "8791"], { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }); +console.log(v.stdout.split("\n").filter((l) => /^==|fixed|BROKEN|guard:/.test(l)).join("\n")); diff --git a/demo-site/record/verify-snowday.mjs b/demo-site/record/verify-snowday.mjs index e2d97f25..cf7931f6 100644 --- a/demo-site/record/verify-snowday.mjs +++ b/demo-site/record/verify-snowday.mjs @@ -4,8 +4,9 @@ // five bugs in observe (they must show) and in guard (they must not): // 1 stale board search (the first letter's answer lands last) 2 double vote 3 white text on white // 4 click block Predict leaves after a mistyped postal code 5 scroll lock the notice leaves behind -// Usage: node demo-site/record/verify-snowday.mjs [--keep] [--src ] (--src: an already integrated copy, e.g. -// after the agent's fixes; the bugs are then expected fixed in observe too). Build the runtime first. +// Usage: node demo-site/record/verify-snowday.mjs [--keep] [--src ] [--port ] (--src: an already integrated copy, e.g. +// after the agent's fixes; the bugs are then expected fixed in observe too; --port: not 8788, while the demo's dev server +// runs there). Build the runtime first. import { spawn, spawnSync } from "node:child_process"; import { copyFileSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs"; import { dirname, join } from "node:path"; @@ -18,7 +19,7 @@ const args = process.argv.slice(2); const SRC = args.includes("--src") ? args[args.indexOf("--src") + 1] : join(ROOT, "demo-site", "snowday-before"); const integrated = args.includes("--src"); const WORK = join(REC, "out", "verify-snowday"); -const PORT = 8788; +const PORT = args.includes("--port") ? Number(args[args.indexOf("--port") + 1]) : 8788; const sleep = (ms) => new Promise((r) => setTimeout(r, ms)); const sh = (cmd, cwd = ROOT) => spawnSync("bash", ["-lc", cmd], { cwd, encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] }); diff --git a/demo-site/snowday-before/.assetsignore b/demo-site/snowday-before/.assetsignore index 1dbed2b9..5ab48ae9 100644 --- a/demo-site/snowday-before/.assetsignore +++ b/demo-site/snowday-before/.assetsignore @@ -13,3 +13,4 @@ test .mcp.json .genclass .vscode +.claude diff --git a/demo-site/snowday-before/.claude/settings.json b/demo-site/snowday-before/.claude/settings.json new file mode 100644 index 00000000..6f4f7287 --- /dev/null +++ b/demo-site/snowday-before/.claude/settings.json @@ -0,0 +1,15 @@ +{ + "model": "opus", + "permissions": { + "defaultMode": "acceptEdits", + "allow": [ + "Bash(npx --yes wrangler@4 dev:*)", + "Bash(npx wrangler dev:*)", + "Bash(curl:*)", + "Bash(claude mcp add:*)", + "Bash(claude mcp get:*)", + "Bash(claude mcp list:*)", + "Bash(sleep:*)" + ] + } +} diff --git a/demo-site/snowday-before/.vscode/settings.json b/demo-site/snowday-before/.vscode/settings.json new file mode 100644 index 00000000..5e1df1af --- /dev/null +++ b/demo-site/snowday-before/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + // The demo: the Claude logo at the top right of the editor opens Claude Code in a new terminal, a new conversation + // that loads the MCP servers added since (DEMO-SCRIPT.md, acts 3 and 6). + "claudeCode.useTerminal": true +} diff --git a/demo-site/snowday-before/package.json b/demo-site/snowday-before/package.json index 28193f64..9a9a11a9 100644 --- a/demo-site/snowday-before/package.json +++ b/demo-site/snowday-before/package.json @@ -4,6 +4,7 @@ "description": "Predict whether there is going to be a snow day at Halton District School Board or not? This is for complete school closure. I want the community to come together and build this the best snow day predictor ever! If you want to add more data you can go here: https://toronto.weatherstats.ca/metrics/snow.html", "main": "index.js", "scripts": { + "deploy": "XDG_CONFIG_HOME=$HOME/.config-dizon CLOUDFLARE_ACCOUNT_ID=4daefdf7440d182204be114a9c9f5074 npx --yes wrangler@4 deploy", "test": "echo \"Error: no test specified\" && exit 1" }, "repository": { diff --git a/demo-site/snowday-before/wrangler.jsonc b/demo-site/snowday-before/wrangler.jsonc index dc6fa8a7..649a9df6 100644 --- a/demo-site/snowday-before/wrangler.jsonc +++ b/demo-site/snowday-before/wrangler.jsonc @@ -1,5 +1,5 @@ // The live Worker behind snowday-predictor.ca (Dizon account): same name, compatibility date and ASSETS binding. -// Deploy with XDG_CONFIG_HOME=~/.config-dizon CLOUDFLARE_ACCOUNT_ID=4daefdf7440d182204be114a9c9f5074 npx wrangler@4 deploy +// Deploy with npm run deploy (package.json: wrangler with the Dizon login, XDG_CONFIG_HOME=~/.config-dizon). { "name": "snowday-predictor", "main": "worker.js", From 73671822bc4c6f4d4625070ef6ed8311fe5b1161 Mon Sep 17 00:00:00 2001 From: Karan Date: Mon, 26 Oct 2026 20:14:54 -0400 Subject: [PATCH 5/5] Demo: the reset and the rehearsal remove the GenClass MCP entry in both scopes The live rehearsal (rehearse-act3.mjs against genclass.dev, 2026-10-26): the dashboard's choices gave the prompt (guard, eager, badge, agent link, no deploy); Claude followed it alone and guard fixed 4 of 5 on its integration, the double vote flagged. Claude saved the MCP server for every project (user scope), because inside this repository the folder's own (local) entry lands under the repository's root; so section 0's reset and the rehearsal's cleanup now remove both. The rehearsal's check accepts the board search as one value either way Claude writes it (an atom, or one guarded key). Co-Authored-By: Claude Opus 5.5 --- demo-site/DEMO-SCRIPT.md | 10 ++++++---- demo-site/record/rehearse-act3.mjs | 5 +++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/demo-site/DEMO-SCRIPT.md b/demo-site/DEMO-SCRIPT.md index 0faddca3..2aead21f 100644 --- a/demo-site/DEMO-SCRIPT.md +++ b/demo-site/DEMO-SCRIPT.md @@ -33,11 +33,12 @@ the page loads, the stale response, the dropped write and the duplicate, and the 1. **One GenClass MCP server on this Mac, the one act 6 starts**: it must own the bridge port so the dashboard mirror and the replays work. Quit other Claude Code sessions that run one (or stop their genclass server). The repo's own `.mcp.json` is set aside as `.mcp.json.off` for the recording. -2. **Reset the code** to its broken state, forget the last take's MCP entry, and **deploy it to snowday-predictor.ca**, +2. **Reset the code** to its broken state, forget the last take's MCP entry (Claude may save it for this folder or, since + the folder sits inside the GenClass repository, for every project), and **deploy it to snowday-predictor.ca**, right before you start recording (real visitors see the five bugs from now until act 3's deploy): ```bash - cd ~/GenClass-lib-main/demo-site/snowday-before && git checkout -- . && git clean -fdqx . && (claude mcp remove genclass -s local 2>/dev/null; true) && npm run deploy + cd ~/GenClass-lib-main/demo-site/snowday-before && git checkout -- . && git clean -fdqx . && (claude mcp remove genclass -s local; claude mcp remove genclass -s user; true) 2>/dev/null && npm run deploy ``` (`npm run deploy` is the folder's own deploy script: wrangler with the Dizon login, `XDG_CONFIG_HOME=~/.config-dizon`, @@ -201,8 +202,9 @@ cd ~/GenClass-lib-main/demo-site/snowday-before && XDG_CONFIG_HOME=~/.config-diz `3b0ff5e1-…` is the version Mehar deployed on 2026-10-25, live when the demo was prepared. The demo's board finder and poll are demo data and must not stay on the real site; the agent's fixes from act 6 stay in the -folder as the record of the demo. Section 0, step 2 resets the folder for the next take, and the project from this take -can go with **Project Settings → Delete project** on genclass.dev. +folder as the record of the demo. Section 0, step 2 resets the folder for the next take and removes the take's GenClass +MCP entry (it holds the agent link); the project from this take can go with **Project Settings → Delete project** on +genclass.dev. ## After: the 2–3 minute cut diff --git a/demo-site/record/rehearse-act3.mjs b/demo-site/record/rehearse-act3.mjs index 1e212841..c7e581bb 100644 --- a/demo-site/record/rehearse-act3.mjs +++ b/demo-site/record/rehearse-act3.mjs @@ -43,7 +43,8 @@ let out = ""; try { out = JSON.parse(r.stdout).result ?? r.stdout; } catch { out = r.stdout || r.stderr; } console.log(`\n--- Claude (${Math.round((Date.now() - t0) / 1000)} s):\n${out.slice(0, 1800)}`); // leave nothing behind: the MCP entry with the agent link, servers started from the copy -sh(`export PATH="$HOME/.local/bin:$PATH"; claude mcp remove genclass -s local`, WORK); +// Claude saves it for this folder (under the repository's root) or, seeing that, for every project: remove both +sh(`export PATH="$HOME/.local/bin:$PATH"; claude mcp remove genclass -s local; claude mcp remove genclass -s user`, WORK); for (const pid of sh("lsof -nP -iTCP -sTCP:LISTEN -Fp | tr -d p").stdout.split("\n").filter(Boolean)) { if (sh(`lsof -a -p ${pid} -d cwd -Fn | grep ^n | cut -c2-`).stdout.trim().startsWith(WORK)) sh(`kill ${pid}`); } @@ -58,7 +59,7 @@ has("guard mode", /data-mode="guard"|mode:\s*["']guard/.test(html)); has("eager", /eager/.test(html)); has("visual fixes", /data-visual="fix"|fix:\s*true/.test(html)); has("the overlay on every host", /data-devtools(?!="local")|mountDevtools|devtools:\s*true/.test(html)); -has("the board search as one atom", /atom\(\s*["'][^"']+["']\s*,\s*\{\s*query/.test(html)); +has("the board search as one value (no separate boards.query key; an atom or one guarded key)", /\b(atom|guard)\(/.test(html) && !/boards\.query/.test(html)); has("the agent link for local hosts", /connectAgent/.test(html)); writeFileSync(join(REC, "out", "rehearsal-head.txt"), html.slice(0, html.indexOf('