Repository navigation
feat(vibe-coding-mad-libs): publish each app to the gallery as a screenshot and its prompt - #41
Conversation
…enshot and its prompt
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
theycallmeswift
left a comment
There was a problem hiding this comment.
Review of baa51f1: changes needed. Two blocking issues and four nits.
Blocking
-
challenges/vibe-coding-mad-libs/screenshot.mjs(the spawn at ~line 102):detached: truecalls setsid and puts Chrome in its own process group, which the challenge spec's Lifecycle section forbids ("don't daemonize or call setsid"). Pi's bash tool (pi-coding-agent 1.0.4,killProcessTree) handles an abort (Esc) or a tooltimeoutby sending SIGKILL to the shell's process group. The helper can't catch it, so it dies without cleaning up and Chrome keeps running. This reproduces on Linux:sh -c "node screenshot.mjs <url>"spawned detached as Pi does, its group SIGKILLed after 0.7 s, leaves headless Chrome and its zygotes running, and themad-libs-screenshot-*profile stays in TMPDIR until teardown's sweep.- The comment at ~line 31 says Pi's bash tool sends SIGINT/SIGTERM/SIGHUP. It sends SIGKILL.
- The interrupt test (~test/vibe-coding-mad-libs.test.mjs:806) sends only SIGTERM, which Pi never sends.
Fix: drop
detached: trueso Chrome shares the helper's group and Pi's group SIGKILL reaches it. Stop Chrome with SIGTERM tochild.pid, then SIGKILL after a short grace, instead ofprocess.kill(-pid). Correct the comment. Add a test that SIGKILLs a detachedsh -cwrapper's group and asserts the stand-in Chrome stops. -
skills/start-challenge/SKILL.md(~line 58): the helper's worst case is about 35 s or more: the 5 sassertAnswering, thenCAPTURE_TIMEOUT_MSof 30 s, then the stop. Nothing tells Pi how long to allow, so a model-chosentimeoutsuch as 30 s on a cold macOS Chrome start ends in the SIGKILL path above.Fix: tell Pi to run the command with no
timeout, or one of at least 60 s. Alternatively, makeCAPTURE_TIMEOUT_MScover the whole helper, the preview check included, and keep it well under any timeout the skill names.
Nits
screenshot.mjs(~line 94): add--use-mock-keychain. The station's own launcher (boothstrappackages/station/src/browser/chrome-process.ts) always passes it, because a login-Keychain lookup can prompt or block on macOS. Also add--disable-background-networkingand--disable-component-update, so the real-Chrome tests stay offline per docs/style/testing.md.TMPDIR=.andMAC_CHROMIUM_TMPDIR=.are verified only on Linux. Note in the PR's Decide section that it needs one run on a Mac with a deep TMPDIR before the event.SKILL.md(~line 61): end the yes-and-success branch with "tell them it's on its way to the booth screens, then go on to step 5."- PR body, "Editorial pass" row: "A subagent reviewed the diff ... found six issues, all fixed" is process narrative, which CLAUDE.md bars from PR bodies. State only what the pass checked and changed.
Checked and fine:
- spec compliance for package-launched headless Chrome, the profile in TMPDIR, and the workspace
screenshot.png; NO_PROXYloopback;- the payload and
gallery.kindsmatch themad-libs-v1contract; - the consent flow: asked once, skipped without the tool, and the last step reported after the gallery answer;
- the README;
npm run verify,npm test(310 pass) andnpm run lint.
Generated by Claude Code
…ss group and bound the whole capture Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ViFVZYRAJqKE37BqgFZCii
…'s late helpers stop recreating it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ViFVZYRAJqKE37BqgFZCii
Vibe Coding Mad Libs now asks, once and only with
publish_gallery_item, whether to put the participant's app on the booth screens. On a yes it savesscreenshot.png(1280x800, the preview's first screen) with a new package-localscreenshot.mjsand publishes a kindapp, renderermad-libs-v1item whose payload is the prompt and its four blanks.Decide
screenshot.mjscaptures over the DevTools protocol, using Node's built-in WebSocket, instead of Chrome's--screenshotflag, which hung without writing a file in testing. It runs Chrome withTMPDIR=.andMAC_CHROMIUM_TMPDIR=.from the throwaway profile, so Chrome's singleton socket stays inside the profile. A deep sessionTMPDIRwould otherwise abort Chrome, and every write stays insideTMPDIRand the workspace. This is verified only on Linux. Recommend: before the event, run one gallery yes on a macOS station with its deep sessionTMPDIR, because no Linux test can catch a macOS-only difference in how Chromium resolves a relative temporary directory.Ready gate
npm run verify: 4 packages ok.npm test: 311 pass, 0 fail, 0 skipped.npm run lint: 0 issues in 18 files.TMPDIR(Chrome exited (SIGABRT) before opening DevTools). The test that SIGKILLs a detachedsh -cwrapper's process group, as Pi's bash tool does on abort or timeout, fails with Chrome in its own group (process … is still running). Both pass now. With real Chrome, a group SIGKILL during a capture leaves no Chrome process.docs/for gallery and mad-libs mentions. Only the challenge index row matched, and it doesn't change. In the skill, "don't offer to publish" now reads as deploy only.screenshot.mjsrow, a "Gallery payload" section, the 30-second limit, process-group behavior, and a standalone note. Skill: steps 4 (Gallery) and 5 (Finish).challenge.json:gallery.kinds: ["app"].setup,cleanupand the extension are unchanged. Withoutpublish_gallery_item, step 4 skips to step 5.docs/style/and the challenge spec's Lifecycle, Environment, Gallery, and Author rules. Chrome stays in the helper's process group, as the spec requires. One 30-second deadline covers the preview check, Chrome's start, and the capture, and the skill gives the command at least 60. Chrome gets--use-mock-keychain,--disable-background-networking, and--disable-component-update. Every gallery outcome reportsimprove-app, and a successful publish is announced.🤖 Generated with Claude Code
https://claude.ai/code/session_01ViFVZYRAJqKE37BqgFZCii