Skip to content

feat(vibe-coding-mad-libs): publish each app to the gallery as a screenshot and its prompt - #41

Merged
theycallmeswift merged 3 commits into
mainfrom
feat/mad-libs-gallery
Nov 3, 2026
Merged

theycallmeswift merged 3 commits into
mainfrom
feat/mad-libs-gallery

Conversation

@theycallmeswift

@theycallmeswift theycallmeswift commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

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 saves screenshot.png (1280x800, the preview's first screen) with a new package-local screenshot.mjs and publishes a kind app, renderer mad-libs-v1 item whose payload is the prompt and its four blanks.

Decide

  • Mac check before the event. screenshot.mjs captures over the DevTools protocol, using Node's built-in WebSocket, instead of Chrome's --screenshot flag, which hung without writing a file in testing. It runs Chrome with TMPDIR=. and MAC_CHROMIUM_TMPDIR=. from the throwaway profile, so Chrome's singleton socket stays inside the profile. A deep session TMPDIR would otherwise abort Chrome, and every write stays inside TMPDIR and the workspace. This is verified only on Linux. Recommend: before the event, run one gallery yes on a macOS station with its deep session TMPDIR, because no Linux test can catch a macOS-only difference in how Chromium resolves a relative temporary directory.

Ready gate

Step Evidence
Tests and lint npm run verify: 4 packages ok. npm test: 311 pass, 0 fail, 0 skipped. npm run lint: 0 issues in 18 files.
Red run Under a deep TMPDIR, the screenshot test fails without the relative TMPDIR (Chrome exited (SIGABRT) before opening DevTools). The test that SIGKILLs a detached sh -c wrapper'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.
Sibling sweep Searched the repo README and 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.
Docs and specs Package README: a screenshot.mjs row, 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"].
Standalone run Not run, because it needs a Gemini key. setup, cleanup and the extension are unchanged. Without publish_gallery_item, step 4 skips to step 5.
Editorial pass Checked against 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 reports improve-app, and a successful publish is announced.
Skipped tests The real-Chrome tests skip, with a reason, when no Chrome is installed. None skipped in CI.
Secrets, permissions Not touched.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ViFVZYRAJqKE37BqgFZCii

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e204becd-8827-4d92-af5f-433be7555419
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

CodeRabbit Verify

  • Run CodeRabbit Verify to test the changes in this pull request.

@theycallmeswift theycallmeswift left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Review of baa51f1: changes needed. Two blocking issues and four nits.

Blocking

  1. challenges/vibe-coding-mad-libs/screenshot.mjs (the spawn at ~line 102): detached: true calls 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 tool timeout by 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 the mad-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: true so Chrome shares the helper's group and Pi's group SIGKILL reaches it. Stop Chrome with SIGTERM to child.pid, then SIGKILL after a short grace, instead of process.kill(-pid). Correct the comment. Add a test that SIGKILLs a detached sh -c wrapper's group and asserts the stand-in Chrome stops.

  2. skills/start-challenge/SKILL.md (~line 58): the helper's worst case is about 35 s or more: the 5 s assertAnswering, then CAPTURE_TIMEOUT_MS of 30 s, then the stop. Nothing tells Pi how long to allow, so a model-chosen timeout such 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, make CAPTURE_TIMEOUT_MS cover 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 (boothstrap packages/station/src/browser/chrome-process.ts) always passes it, because a login-Keychain lookup can prompt or block on macOS. Also add --disable-background-networking and --disable-component-update, so the real-Chrome tests stay offline per docs/style/testing.md.
  • TMPDIR=. and MAC_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_PROXY loopback;
  • the payload and gallery.kinds match the mad-libs-v1 contract;
  • 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) and npm 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
@theycallmeswift
theycallmeswift marked this pull request as ready for review November 3, 2026 01:04
@theycallmeswift
theycallmeswift merged commit 188d961 into main Nov 3, 2026
2 checks passed
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