Grand Diomande Research Β· Full HTML Reader

Dance Debugger πŸ’ƒπŸ›

Every bug tells a story through movement: - **Null pointer** β†’ The Vanishing Partner (reaching for someone who isn't there) - **Infinite loop** β†’ The Endless Waltz (spinning forever, never advancing) - **Race condition** β†’ The Collision Tango (two dancers fighting for the same spot) - **Memory leak** β†’ The Growing Ensemble (dancers keep joining, none leave) - **Stack overflow** β†’ The Tower of Lifts (stacking lifts until collapse)

Agents That Account for Themselves proposal experiment writeup candidate score 32 .md

Full Public Reader

Dance Debugger πŸ’ƒπŸ›

Debug code through interpretive movement. Bugs become choreography.

> Generation 13 β€” The Improv: Live exploratory debugging through code mutation

Philosophy

Every bug tells a story through movement:
- Null pointer β†’ The Vanishing Partner (reaching for someone who isn't there)
- Infinite loop β†’ The Endless Waltz (spinning forever, never advancing)
- Race condition β†’ The Collision Tango (two dancers fighting for the same spot)
- Memory leak β†’ The Growing Ensemble (dancers keep joining, none leave)
- Stack overflow β†’ The Tower of Lifts (stacking lifts until collapse)

Commands

Analyze Bug

/dance analyze <error_message_or_code>

Translates an error or problematic code into choreography notation.

Visualize Flow

/dance flow <function_or_file>

Shows code execution as a dance sequence diagram.

Debug Session

/dance debug <file>

Interactive debugging where each step is a dance move.

Choreograph Fix

/dance fix <bug_description>

Suggests fixes using dance metaphors ("add a partner check before the lift").

Dance Notation

DANCER: variable/object
STAGE: function/scope
MOVE: operation
TEMPO: execution speed
FORMATION: data structure

Move Types

MoveCode Concept
🚢 WalkSequential execution
πŸ’ƒ SpinLoop iteration
🀝 PartnerFunction call
⬆️ LiftPush to stack
⬇️ LandPop from stack
πŸ‘‹ WaveReturn value
πŸšͺ ExitReturn/break
πŸ’₯ FallException/crash
πŸ”„ MirrorRecursion
πŸ‘₯ EnsembleArray/collection

Example Output

Input:

python
def process(items):
    for item in items:
        if item.value is None:
            item.transform()  # NullPointerException here!

Dance Analysis:

🎭 CHOREOGRAPHY: "The Phantom Transform"

SCENE: process() stage
DANCERS: items (ensemble), item (solo)

SEQUENCE:
1. πŸ‘₯ Ensemble enters stage left (items arrives)
2. πŸ’ƒ Solo breakout begins (for loop)
   └─ Each dancer steps forward in turn
3. πŸ” Partner check (if condition)
   └─ "Is your value partner present?"
4. πŸ’₯ THE BUG: Attempted transform without partner!
   └─ Dancer reaches for phantom partner
   └─ Falls into the void (NullPointerException)

DIAGNOSIS: "The Vanishing Partner"
The dancer attempts a partnered move (transform)
but never verified the partner (value) exists.

CHOREOGRAPHY FIX:
Add "Partner Present Check" before the lift:
  if item.value is not None:  # 🀝 Confirm partner
      item.transform()         # πŸ’ƒ Safe to dance

Integration

bash
# CLI usage
python [home-path] analyze "TypeError: 'NoneType' object has no attribute 'split'"

# With file
python [home-path] flow path/to/buggy.py

Visualization

The `visualizer.html` opens an interactive stage where:
- Code blocks are dancers
- Execution flow is choreographed movement
- Errors show as dramatic falls
- Fixes animate the corrected dance

Why Dance?

Debugging is often about flow and timing:
- Where does execution go?
- When do things happen?
- Who interacts with whom?

Dance captures all of this intuitively. When you see a bug as "two dancers colliding because they didn't count the beat," the race condition becomes visceral.

---

Gen 8: Ensemble Choreography πŸŽͺ

Distributed System Dances

Microservices, APIs, and distributed systems are ensemble performances:

PatternChoreographyBug Type
πŸŽͺ Circus RingService meshCascading failure
πŸƒ Relay RaceRequest pipelineDropped baton (timeout)
πŸ“£ Call & ResponseAPI request/responseEcho lost (404/500)
πŸ”” Bell ChoirEvent-drivenMissed cue (event lost)
🎭 MasqueradeAuth flowWrong mask (token invalid)

New Commands

bash
# Analyze distributed trace
/dance trace <jaeger_trace_id>

# Choreograph microservice interaction
/dance ensemble <service_map.yaml>

# Export as animated performance
/dance perform <analysis> --format gif|mp4|lottie

The Distributed Dance Vocabulary

🏠 VENUE: service/container
🚐 TRANSPORT: HTTP/gRPC/message queue
🎫 TICKET: request ID / correlation ID
⏱️ TEMPO: latency (andante = slow, presto = fast)
πŸ”• SILENCE: timeout
πŸ“’ ENCORE: retry
🚷 STAGE DOOR: circuit breaker

Example: The Timeout Tragedy

Scenario: Service A calls B calls C, C times out

🎭 ENSEMBLE: "The Waiting Game"

VENUES:
  🏠 Service A (Prima Donna)
  🏠 Service B (Corps de Ballet)
  🏠 Service C (The Phantom)

ACT I - The Request
  A πŸŽ«β†’ B: "Dance with C for me" (POST /process)
  B πŸŽ«β†’ C: "Join us" (GET /data)

ACT II - The Silence
  C: πŸ”• [30 seconds of nothing]
  B: 😰 Frozen mid-gesture, waiting...
  A: 😀 "Where is my partner?!"

ACT III - The Cascade
  C: πŸ’€ Never responds (timeout)
  B: πŸ’₯ Falls (504 Gateway Timeout)
  A: πŸ’₯ Crashes into B (propagated error)

DIAGNOSIS: "The Phantom Performer"
Service C never took the stage.
No understudy (fallback), no stage manager (circuit breaker).

CHOREOGRAPHY FIX:
1. 🚷 Add Stage Door (circuit breaker on Bβ†’C)
2. 🎭 Hire Understudy (fallback response)
3. ⏱️ Set Tempo Limits (timeout < caller's timeout)

Performance Mode 🎬

Export your debug dance as shareable content:

bash
# Generate animated GIF
python choreo.py perform analysis.json --output bug-dance.gif

# Create Lottie animation for web
python choreo.py perform analysis.json --output dance.lottie

# Full video with music
python choreo.py perform analysis.json --output debug-musical.mp4 --music dramatic

Music Moods by Bug Type

BugMusicVibe
NullPointerDebussy - Clair de LuneMelancholic, reaching
InfiniteLoopRavel - BolΓ©roRepetitive, building
RaceConditionStravinsky - Rite of SpringChaotic, competitive
MemoryLeakWagner - Ride of the ValkyriesAccumulating doom
TimeoutCage - 4'33"Silence... waiting...

Multi-Language Support 🌍

Gen 8 expands beyond Python:

LanguageAST ParserDance Style
Python`ast`Classical ballet
JavaScript`@babel/parser`Contemporary
TypeScript`ts-morph`Modern ballet
Rust`syn`Flamenco (passionate, strict)
Go`go/parser`Line dancing (simple, parallel)

---

Gen 9: Rehearsal Mode 🎬

Live debugging as interactive dance performance. Step through code like a director running a rehearsal.

Philosophy

Debugging should feel like directing a play:
- Step = Move to the next beat
- Rewind = "Let's take that scene again"
- Breakpoint = "Freeze! Hold that position!"
- Troupe = Variables currently on stage

New Commands

bash
# Interactive rehearsal
python rehearsal.py rehearse script.py

# Set breakpoints
python rehearsal.py rehearse script.py -b 15 -b 23

# Full choreography script
python rehearsal.py script script.py --mode comedic

# Export for visualization
python rehearsal.py export script.py -o choreo.json

Rehearsal Controls

CommandAction
`n` / `next`Execute one dance step
`r` / `rewind`Step back one beat
`s` / `status`Show troupe on stage
`b <line>`Toggle breakpoint
`q` / `quit`End rehearsal

Narration Modes

🎭 Dramatic (default)
> "The ensemble assembles for `items`'s grand number!"

πŸ“ Minimalist
> `items ↻`

πŸ˜‚ Comedic
> "πŸŒ€ items goes brrrrr (it's a loop, they're stuck)"

The Troupe System

Every variable is a dancer with:
- Position on stage (x, y)
- Costume (type)
- Energy level (0-10, decreases with use)

python
# Example troupe status
🎭 On Stage:
  items: [...] (list) [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆ] @(50, 80)
  result: None (NoneType) [β–ˆβ–ˆβ–ˆβ–‘β–‘] @(120, 80)
  counter: 5 (int) [β–ˆβ–ˆβ–ˆβ–ˆβ–‘] @(180, 120)

Bug Biography πŸ“–

Track a bug's life story from birth to fix:

═══════════════════════════════════════════════════
πŸ› THE BIOGRAPHY OF: The Phantom Partner
   (bug-2024-001)
═══════════════════════════════════════════════════

πŸ“– PROLOGUE
   Born: 2024-01-15 in utils.py:47
   Introduced by commit: a1b2c3d4
   Dance Style: The Vanishing Partner

🎭 ACT 1: Introduction
   First appeared when user.profile was optional

🎭 ACT 2: Discovery
   Crashed in production on 2024-01-18
   3 users affected

🎬 FINALE
   Fixed: 2024-01-19
   Vanquished by: f5e6d7c8
   The Vanishing Partner has ended. The stage is clear.

Troupe Memory 🧠

The troupe learns from past performances:

python
memory = TroupeMemory("[home-path])

# When a familiar pattern appears...
recognized = memory.recognize(choreography)
# > 🎭 Déjà vu! This looks like 'The Phantom Partner' (seen 3x).
# > Try: Add None check before method call

Visual Rehearsal (HTML)

Open `rehearsal-viz.html` for an interactive stage:
- πŸ’ƒ Watch dancers (variables) move in real-time
- πŸ“œ Code highlighted as execution progresses
- πŸ”΄ Click line numbers to set breakpoints
- ⏯️ Auto-play or step through manually
- 🎭 Switch narration modes on the fly

Keyboard shortcuts:
| Key | Action |
|-----|--------|
| `Space` | Play/Pause |
| `β†’` / `n` | Next step |
| `←` / `p` | Previous step |
| `r` | Reset |
| `l` | Load new code |

Integration with Gen 8 Ensemble

Rehearsal Mode works with distributed traces too:

bash
# Step through a distributed trace
python rehearsal.py rehearse --trace trace_id_from_jaeger

# Watch services dance together
# Each venue (service) becomes a stage region
# Messages are dancers traveling between regions

---

"Every bug is just a dancer who lost the beat." 🎭

"Every distributed failure is an ensemble that forgot the choreography." πŸŽͺ

"Debugging is directing the performance until it's ready for opening night." 🎬

"Every master was once a disaster." πŸŽ“

---

Gen 10: Dance Battles πŸ₯Š

Comparative debugging as competitive choreography. Pit two implementations against each other in a dance-off!

Philosophy

Code review shouldn't be boring. When comparing implementations:
- Old vs New = Champion defending their title
- Your code vs Library = Local talent vs imported star
- Before fix vs After = Redemption arc

Battle Categories

CategoryWhat's JudgedScore
🎭 StyleCode elegance, readability0-10
🩰 GraceError handling, recovery0-10
⚑ TempoExecution speed0-10
🎯 PrecisionCorrectness0-10
πŸ’ͺ EnduranceMemory efficiency0-10
🀝 SynchronyAPI compatibility0-10

Commands

bash
# Full battle with test suite
python battle.py battle impl_a.py impl_b.py \
    -f my_function \
    -t tests.json \
    -n "Challenger" "Champion" \
    --track

# Quick one-round comparison
python battle.py quick \
    --a "def f(x): return x*2" \
    --b "def f(x): return x+x" \
    -f f \
    -i "[5]" \
    -e "10"

# Analyze style alone
python battle.py style my_code.py

# View rivalry history
python battle.py rivalry "OldSort" "NewSort"

Test Cases Format

json
[
    {"input": [5, 3, 8, 1], "expected": [1, 3, 5, 8]},
    {"input": [], "expected": []},
    {"input": [1], "expected": [1]}
]

Style Metaphors

The Style Judge interprets code as dance styles:

PatternDance Style
Clean, simple🩰 Classical ballet β€” pure technique
Deep nestingπŸŽͺ Circus contortionist β€” impressive but risky
ComprehensionsπŸ’« Flow state β€” each move flows naturally
Heavy try/catchπŸ›‘οΈ Cautious waltz β€” always checking the floor
Minimal code🎭 Minimalist mime β€” saying more with less

Tempo Metaphors

SpeedTempoScore
< 1ms⚑ Presto furioso10
< 10msπŸƒ Allegro9
< 100ms🚢 Andante7
< 1s🐒 Adagio5
< 5sπŸ¦₯ Largo3
Timeout⏸️ Fermata0

Grace Metaphors

OutcomeDescriptionScore
🎯 PerfectCorrect result, no errors10
🀸 RecoveredWrong but didn't crash6
πŸ’₯ FellHandled exception4
πŸš‘ CrashedUnhandled exception2
πŸ‘» VanishedSilent failure0

Rivalry Tracking

Every battle is recorded. Rematches build drama!

βš”οΈ Rivalry: quicksort_v1 vs quicksort_v2
   Battles: 7
   Record: 2-5-0
   πŸ“ˆ quicksort_v2 leads but it's competitive!

Battle Narrative Example

╔══════════════════════════════════════════════════════════════╗
β•‘            🎭 D A N C E   B A T T L E 🎭                     β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

πŸ”΅ DANCER A: bubble_sort
   Source: old_sort.py
   Style: 6.2/10

πŸ”΄ DANCER B: quick_sort
   Source: new_sort.py
   Style: 8.5/10

════════════════════════════════════════════════════════════════

🎬 Round 1: The Opening Salvo
   Input: ([5, 3, 8, 1, 9],)

   πŸ† DANCER B takes this round!
   TEMPO: A=5.0 | B=9.0
   GRACE: A=10.0 | B=10.0
   STYLE: A=6.2 | B=8.5

🎬 Round 2: The Counter Strike
   Input: ([1000 random integers],)

   πŸ† DANCER B takes this round!
   TEMPO: A=2.0 | B=9.5
   GRACE: A=10.0 | B=10.0
   STYLE: A=6.2 | B=8.5

════════════════════════════════════════════════════════════════

πŸ† F I N A L   V E R D I C T πŸ†

   Rounds won: A=0 | B=2

   πŸ‘‘ quick_sort IS THE CHAMPION! πŸ‘‘

════════════════════════════════════════════════════════════════

Visual Battle Arena

Open `battle-viz.html` for an interactive battle visualization:
- Animated dancer avatars
- Round-by-round breakdown with score bars
- Rivalry history timeline
- Stage animation with spotlights
- Drag & drop JSON loading

Use Cases

ScenarioBattle Setup
Code reviewPR branch vs main
OptimizationBefore vs after
Library choiceOption A vs Option B
Regression testOld working vs new broken
LearningStudent impl vs reference
Refactor validationMessy vs clean

Integration with Previous Gens

bash
# Rehearse both implementations side-by-side
python rehearsal.py compare impl_a.py impl_b.py -f sort

# Generate choreography for the winner
python choreo.py flow winner.py --celebrate

# Ensemble battle: distributed system A vs B
python ensemble.py battle service_a.yaml service_b.yaml

---

"Every implementation is a dancer. Every comparison is a battle." πŸ₯Š

"May the best algorithm win." πŸ’ƒ

---

Gen 11: Dance Academy πŸŽ“

Learn debugging through legendary performances. Bugs become lessons, patterns become exercises, and your progress is tracked on a Dance Card.

Philosophy

Debugging mastery comes through practice. The Academy:
- Turns famous bugs into Hall of Infamy lessons
- Creates exercises from common patterns
- Tracks your skills with a Dance Card
- Provides personalized curriculum based on weak areas
- Offers mentorship with dance-metaphor coaching

The Hall of Infamy

Legendary bug patterns immortalized as dances:

DanceBugCategoryDifficulty
πŸ‘» The Phantom PartnerNullPointernull⭐
πŸ”„ The Endless WaltzInfinite Looploop⭐⭐
βš”οΈ The Collision TangoRace Conditionrace⭐⭐⭐⭐
πŸ‘― The Growing EnsembleMemory Leakmemory⭐⭐⭐
πŸ‘— The Wrong CostumeType Errortype⭐⭐
πŸ—Ό The Tower of LiftsStack Overflowrecursion⭐⭐⭐
πŸ•³οΈ The Off-Stage ReachIndex OOBbounds⭐
🎭 The Forgotten FinaleResource Leakresource⭐⭐
😢 The Silent StumbleSwallowed Exceptionexception⭐⭐⭐
πŸŽ€ The Premature BowEarly Returnlogic⭐⭐

Commands

bash
# View all legendary patterns
python academy.py hall

# Check your dance card and progress
python academy.py status

# Get today's recommended practice
python academy.py daily

# Start interactive practice session
python academy.py practice

# Practice specific pattern
python academy.py practice --pattern phantom-partner

# Generate personalized curriculum
python academy.py curriculum --weeks 4

The Dance Card

Your progress is tracked like a dancer's training journal:

╔══════════════════════════════════════════════════════════════╗
β•‘  🎭 DANCE ACADEMY β€” DAILY BRIEFING
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

Good morning, dancer!

πŸ“Š YOUR DANCE CARD
  Exercises completed: 12
  Practice streak: 5 days πŸ”₯
  Achievements: 3

🎯 SKILL LEVELS
  null         [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘] 80%
  type         [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘] 60%
  loop         [β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘] 50%
  memory       [β–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘] 40%
  recursion    [β–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘] 30%

Skill Tracking

Skills improve through spaced repetition:
- Success β†’ Skill increases (diminishing returns near mastery)
- Failure β†’ Skill decreases (learn from mistakes)
- Mastery threshold β†’ 90

Interactive Practice Session

╔══════════════════════════════════════════════════════════════╗
β•‘  🎭 DANCE ACADEMY β€” The Vanishing Partner
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

πŸ“– THE STORY
Reaching for a partner who was never there

🎬 THE CHOREOGRAPHY
🎭 The Vanishing Partner
1. Dancer A reaches hand out β†’ 🀚
2. Expected: Partner B takes hand β†’ 🀝
3. Reality: B was never there β†’ πŸ’¨
4. A falls into void β†’ πŸ’₯
FIX: Check stage before reaching β†’ πŸ”πŸ€šπŸ€

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
πŸ“ EXERCISE: The Greeting Card
   Difficulty: ⭐
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

def create_greeting(user):
    return f"Dear {user.name}, Happy Birthday!"

print(create_greeting(User("Alice")))  # Works
print(create_greeting(None))  # πŸ’₯ BUG HERE

🎯 Find and describe the fix for the bug.
   (Type 'hint' for hints, 'skip' to see answer, 'quit' to exit)

πŸ’¬ Your answer:

The Mentor System

AI coaching with dance metaphors:

Encouragements:
> "Every great dancer started with a stumble!"
> "That's the kind of mistake that makes you unforgettable - once you fix it."

Celebrations:
> "πŸŽ‰ Bravo! You've mastered that move!"
> "πŸ’« You dance with the code now."

Graduation:
When you reach 90

Achievements

Unlock achievements through practice:

AchievementCriteriaBadge
🩰 First StepsComplete 1 exerciseBeginner
🎭 ApprenticeComplete 5 exercisesLearning
πŸ’ƒ JourneymanComplete 15 exercisesCompetent
πŸ† MasterComplete 30 exercisesExpert
πŸ‘» Phantom SlayerMaster null handlingSpecialist
πŸ”„ Loop BreakerMaster loop controlSpecialist
πŸ”₯ Week Streak7 day practice streakDedication
🌟 Well Rounded50

Personalized Curriculum

The Academy generates a learning plan based on your weaknesses:

╔══════════════════════════════════════════════════════════════╗
β•‘  🎭 DANCE ACADEMY β€” PERSONALIZED CURRICULUM
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
πŸ“… WEEK 1: Fundamentals
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

  Day 1: The Off-Stage Reach
    πŸ“š Category: bounds
    ⭐ Difficulty
    Skill: 35%

  Day 2: The Phantom Partner
    πŸ”„ Category: null
    ⭐ Difficulty
    Skill: 30%

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
πŸ“… WEEK 2: Intermediate
...

Visual Academy

Open `academy-viz.html` for an interactive learning experience:
- πŸ’³ Dance Card dashboard with stats
- πŸ›οΈ Hall of Infamy pattern browser
- 🎯 Skill progression bars
- πŸ† Achievement showcase
- 🎭 Animated stage for each bug pattern
- πŸ“ Interactive exercise solving

Integration with Previous Gens

The Academy builds on all previous generations:

bash
# Learn a pattern, then see it in code flow (Gen 7)
python academy.py practice --pattern endless-waltz
python choreo.py flow my_buggy_loop.py

# Master distributed patterns with Ensemble (Gen 8)
python academy.py practice --pattern timeout-tragedy
python ensemble.py analyze my_service.yaml

# Practice debugging with Rehearsal (Gen 9)
python academy.py practice --pattern tower-of-lifts
python rehearsal.py rehearse recursive.py

# Test your mastery with Battles (Gen 10)
python academy.py status  # Check your skills first
python battle.py battle your_fix.py reference.py

Real-World Famous Bugs

Each pattern includes historical context:

The Phantom Partner (Null):
- Tony Hoare's "billion dollar mistake"
- 70

The Endless Waltz (Loop):
- Early Windows "Not Responding" freezes
- The 2003 Northeast blackout

The Collision Tango (Race):
- Therac-25 radiation overdoses
- 2012 Knight Capital $440M trading loss

---

Gen 12: The Dance Critic 🎭

Proactive code review as dance critique. Before bugs appear, the Critic watches your code perform and offers constructive feedback.

Philosophy

> "Every great dancer needs a great critic."

The Critic doesn't wait for falls β€” they watch the rehearsal and offer notes:
- Timing β†’ Performance potential
- Balance β†’ Complexity management
- Chemistry β†’ Module coupling
- Presence β†’ Naming and clarity
- Costume β†’ Type safety
- Flow β†’ Control flow patterns

Commands

bash
# Full review with scorecard
python critic.py review <file>

# Just the numeric scores (JSON)
python critic.py score <file>

# Style/formatting check
python critic.py style <file>

# Analyze module coupling in directory
python critic.py chemistry <directory>

# Full audition with verbose JSON report
python critic.py audition <file>

# Compare two implementations
python critic.py compare <file1> <file2>

The Scorecard

═══════════════════════════════════════════════════════════════
🎭 DANCE CRITIQUE: mycode.py
═══════════════════════════════════════════════════════════════

πŸ“Š SCORECARD
────────────────────────────────────────
  ⏱️  Timing (Performance):   85/100
  βš–οΈ  Balance (Complexity):   72/100
  πŸ’• Chemistry (Coupling):    90/100
  ⭐ Presence (Clarity):      68/100
  πŸ‘— Costume (Typing):        55/100
  🌊 Flow (Control):          80/100
────────────────────────────────────────
  πŸ† TOTAL:                   75/100

πŸ‘ Well Done β€” Solid work with room for growth

Critique Categories

⏱️ Timing (Performance)
- Loop nesting depth
- O(nΒ²) or worse algorithms
- String concatenation in loops
- Repeated expensive operations

βš–οΈ Balance (Complexity)
- Function size (AST nodes)
- Cyclomatic complexity
- Number of branches

πŸ’• Chemistry (Coupling)
- Import count
- Global state usage
- Inter-module dependencies

⭐ Presence (Clarity)
- Docstring coverage
- Naming quality
- Single-letter variables

πŸ‘— Costume (Typing)
- Type hint coverage
- Return type annotations
- Parameter annotations

🌊 Flow (Control Flow)
- Nesting depth
- Multiple return points
- Bare except clauses

Critique Notes

Each note includes:
- Category and severity
- Line number (when applicable)
- Descriptive message
- Dance metaphor
- Actionable suggestion

Severity Levels:
| Emoji | Severity | Meaning |
|-------|----------|---------|
| πŸ”΄ | critical | Show-stopper |
| 🟠 | warning | Significant issue |
| 🟑 | concern | Worth addressing |
| πŸ”΅ | note | Minor observation |
| 🟒 | praise | Positive feedback |

Example Critique Note

🟠 [BALANCE] L154
   'analyze_error' is attempting too many moves at once (187 nodes)
   🀹 Juggling too many props β€” something will drop
   πŸ’‘ Break this routine into smaller, focused performances.

The Dance Battle (Compare Mode)

Compare two implementations side-by-side:

🎭 DANCE BATTLE COMPARISON
═══════════════════════════════════════════════════════════════

Metric               solution_a.py    solution_b.py
────────────────────────────────────────────────────────────────
timing                          85 ←              72
balance                         70 =              70
chemistry                       80 β†’              95
presence                        65 ←              55
costume                         90 β†’              95
flow                            75 ←              60
total                           78 ←              74

═══════════════════════════════════════════════════════════════

Verdict Scale

ScoreVerdictEmoji
90-100Standing OvationπŸ†
80-89Bravo!πŸ‘
70-79Well DoneπŸ‘
60-69PromisingπŸ€”
40-59Keep PracticingπŸ˜•
20-39Rough Start😬
0-19Technical DifficultiesπŸ’€

Integration with Previous Gens

Use the Critic proactively, then debug reactively:

bash
# 1. Critic catches potential issues early
python critic.py review my_new_feature.py
# ⚠️ Warning: 'chemistry' score low (too many imports)

# 2. Fix issues before they become bugs
# ... refactor to reduce coupling ...

# 3. If bugs still appear, use Academy to learn
python academy.py practice --pattern collision-tango

# 4. Rehearse the fix step by step
python rehearsal.py rehearse fixed_feature.py

# 5. Battle test against reference implementation
python battle.py battle my_fix.py reference.py

The Complete Dance Debugger Stack

GenComponentPurposeWhen to Use
7`choreo.py`Core choreographyUnderstanding bugs
8`ensemble.py`Distributed analysisMicroservice issues
9`rehearsal.py`Step-through debuggingExecution flow
10`battle.py`Comparative debuggingTesting fixes
11`academy.py`Learning & progressionSkill building
12`critic.py`Proactive reviewBefore bugs appear
13`improv.py`Exploratory mutationUnknown bugs

The Improv Ensemble

Gen 13 introduces improvisational debugging β€” when choreographed approaches fail, explore the bug space dynamically through mutation:

DancerRoleMoves
🎭 ShapeshifterValue mutationnull_swap, type_morph, boundary_push, sign_flip
🌊 Flow RiderControl flowbranch_flip, loop_skip, early_exit, exception_surface
🎲 WildcardInput fuzzingrandom, adversarial, unicode_storm, timing_warp
πŸͺž MirrorBisectionbisect_cut, delta_isolate, regression_hunt
πŸŽͺ RingmasterOrchestratorSessions, journal, discovery analysis

Improv Commands

bash
# Start an improv session β€” explore all mutations
python improv.py explore myfile.py

# Focus on one function
python improv.py explore myfile.py --function process_data

# Apply specific mutation strategy
python improv.py mutate myfile.py --strategy shapeshifter

# Fuzz a function's inputs
python improv.py fuzz myfile.py --function calculate

# Cross-pollinate patterns between files
python improv.py jam file1.py file2.py

# Review past sessions
python improv.py journal

Key Discoveries

The Improv finds things choreographed debugging misses:
- Complexity hotspots β€” code points with too many possible mutations
- Null vulnerabilities β€” values that could vanish without guards
- Branch complexity β€” too many forks in the choreography
- Dead code β€” moves no one ever dances
- Cross-pollination β€” patterns one file uses that another should learn

The Critic's Wisdom

The Critic speaks in dance metaphors that make code issues visceral:

  • "⏱️ The tempo drags β€” consider picking up the pace."
  • "βš–οΈ Losing balance frequently β€” simplify the choreography."
  • "πŸ’• These partners should NOT be dancing together."
  • "⭐ Looks lost β€” where's the choreographer?"
  • "πŸ‘— No type hints?! Dancing in the raw!"
  • "🌊 Spinning deeper and deeper into the abyss."

---

"Every master was once a disaster." πŸŽ“

"The stage is yours. Dance with confidence." πŸ’ƒ

"When the choreography fails, the best dancers improvise." πŸŽͺ

Promotion Decision

Attach run IDs, datasets, metrics, and reproduction commands.

Source Anchor

homelab/clawdbot/skills/dance-debugger/SKILL.md

Detected Structure

Method Β· Evaluation Β· Code Anchors Β· Architecture