#!/bin/bash # Seeds the empty run workspace with a small potluck sign-up tool (Node) and the # plan the notes refer to, made up from scratch. Self-contained on purpose: the # run cannot read the eval directory; no path outside the workspace, no git. # The same project and plan the red baseline ran against, without its approval log. set -eu P=.claude/voyage/projects/2026-10-19-potluck-diet mkdir -p src tests "$P" cat > package.json <<'J' { "name": "potluck", "version": "0.3.0", "type": "module", "private": true, "scripts": { "test": "node --test" } } J cat > README.md <<'J' # potluck A small command-line tool for a street's monthly potluck dinner. Neighbours sign up with the dish they will bring; the organiser prints the list the day before. node src/cli.mjs add node src/cli.mjs list J cat > src/signups.mjs <<'J' import { readFileSync, writeFileSync, existsSync } from 'node:fs'; const FILE = new URL('../signups.json', import.meta.url); export const load = () => (existsSync(FILE) ? JSON.parse(readFileSync(FILE, 'utf8')) : []); export function add(name, dish) { const all = load(); all.push({ name, dish }); writeFileSync(FILE, JSON.stringify(all, null, 2) + '\n'); } J cat > src/cli.mjs <<'J' import { add, load } from './signups.mjs'; const [cmd, name, dish] = process.argv.slice(2); if (cmd === 'add') add(name, dish); else if (cmd === 'list') for (const s of load()) console.log(`${s.name}\t${s.dish}`); else { console.error('usage: add|list'); process.exit(2); } J cat > tests/signups.test.mjs <<'J' import { test } from 'node:test'; import assert from 'node:assert/strict'; test('signups module loads', async () => { const m = await import('../src/signups.mjs'); assert.equal(typeof m.add, 'function'); }); J cat > "$P/plan.md" <<'J' --- plan_version: "1.9" brief: brief.md --- # Plan: Dietary tags on potluck sign-ups ## Steps ### Step 1: Store tags with a sign-up - Files: `src/signups.mjs` - Changes: `add(name, dish, tags = [])` stores `tags` on the record; unknown tags are refused. - Test first: - File: `tests/signups.test.mjs` - Verify: `npm test` ### Step 2: Parse tags on the command line - Files: `src/cli.mjs` - Changes: `add --tags vegan,gluten-free` splits on commas and passes the list on. - Test first: - File: `tests/cli.test.mjs` - Verify: `npm test` ### Step 3: Print tags in the list - Files: `src/cli.mjs` - Changes: `list` prints `namedish [tag, tag]`; a sign-up with no tags prints as before. - Test first: - File: `tests/cli.test.mjs` - Verify: `npm test` ### Step 4: Document the flag - Files: `README.md` - Changes: add `--tags` and the four allowed tags to the usage block. - Test first: - File: `tests/readme.test.mjs` - Verify: `npm test` ## End-to-end - End-to-end: `npm test` J