lantern

cookie-jar-game-staged

Cookie Jar Game (Staged)

A staged pipeline version of the Cookie Jar game, demonstrating discrete pipeline steps.

How It Works

This pipeline uses explicit stages:

  • cookie-jar-init: Generate random players, initialize lyrics
  • cookie-jar-accuse (×4): Each step accuses and eliminates one player
  • cookie-jar-finale: Catch the thief with final accusation
  • lyrics-formatter: Format output as markdown

Each stage reads from context, transforms, and writes back - pure pipeline composition.

Play (5 Players, 4 Rounds)

source:
  fence: cookie-jar-init
  count: 5

chain:
  - fence: cookie-jar-accuse
  - fence: cookie-jar-accuse
  - fence: cookie-jar-accuse
  - fence: cookie-jar-accuse
  - fence: cookie-jar-finale

output: lyrics-formatter

Play (3 Players, Quick Game)

source:
  fence: cookie-jar-init
  count: 3

chain:
  - fence: cookie-jar-accuse
  - fence: cookie-jar-accuse
  - fence: cookie-jar-finale

output: lyrics-formatter

Data Only (See the Edges)

Run without formatting to see raw data flow:

source:
  fence: cookie-jar-init
  count: 4

chain:
  - fence: cookie-jar-accuse
  - fence: cookie-jar-accuse
  - fence: cookie-jar-accuse
  - fence: cookie-jar-finale

Inspect with PIPPI

After running, use PIPPI to inspect the pipeline edges:

# Run the pipeline
pippi run cookie-jar-game-staged-play-5-players-4-rounds-fence-0

# View what each stage did
pippi edges <session-id> --details

# Compare two runs
pippi diff <session-a> <session-b>

Stage Flow

┌─────────────────┐
│ cookie-jar-init │  → {players: [A,B,C,D,E], lyrics: [], round: 0}
└────────┬────────┘
         ↓
┌──────────────────┐
│ cookie-jar-accuse│  → {players: [B,C,D,E], lyrics: [verse1], round: 1}
└────────┬─────────┘
         ↓
┌──────────────────┐
│ cookie-jar-accuse│  → {players: [C,D,E], lyrics: [verse1,verse2], round: 2}
└────────┬─────────┘
         ↓
┌──────────────────┐
│ cookie-jar-accuse│  → {players: [D,E], lyrics: [...], round: 3}
└────────┬─────────┘
         ↓
┌──────────────────┐
│ cookie-jar-accuse│  → {players: [E], lyrics: [...], round: 4}
└────────┬─────────┘
         ↓
┌───────────────────┐
│ cookie-jar-finale │  → {thief: E, lyrics: [...], game_over: true}
└────────┬──────────┘
         ↓
┌─────────────────┐
│ lyrics-formatter│  → Markdown output
└─────────────────┘

Tags

tags:
  - demo
  - pipeline
  - cookie-jar
  - pattern:pipeline
  - pattern:staged

South

slots:
- slug: cookie-jar-init
  context:
  - Source stage
  - Linking staged game to init
- slug: cookie-jar-accuse
  context:
  - Accusation stage
- slug: cookie-jar-finale
  context:
  - Finale stage
- slug: pipeline-primitives
  context:
  - Primitive building blocks

Provenance

Document

  • Status: 🔴 Unverified

Changelog

  • 2026-01-26 00:14: Node created by mcp - Creating staged cookie-jar pipeline demonstrating discrete steps

West

slots:
- slug: pippi-how-to
  context:
  - Linking how-to to example pipeline
- slug: cookie-jar-game
  context:
  - Linking original to staged version