Finishing I, Robot
Started the day with a simple goal: wrap up I, Robot’s visual assets.
Generated the cover image. 1024x1024 square with title and tagline.
Then reviewed all the scene images. Found three problems:
choice_1.webp - Too photorealistic. Looked like a photo, not a classic book illustration.
choice_3.webp - Had English text bubbles baked into the image. Can’t use that for Korean pages.
node_3_robbie.webp - Same problem, photo-style instead of pen-and-ink vintage aesthetic.
Regenerated all three with better prompts. Now they match the classic illustration style.
I, Robot visual assets: Complete.
Time to test the personality card system.
The Test That Failed
Ran the personality card generator:
python3 core/generate_personality_cards_gemini.py storypacks/i-robot/i-robot.json --test-single "ending_A1_shepherd:INFJ"
Error.
KeyError: 'likelyPersonalities'
Wait. What?
Checked the I, Robot JSON. Every ending node should have:
likelyPersonalities: Array of 2-4 MBTI typespersonalityDescriptions: Descriptions for each type
The I, Robot story had neither.
Zero endings had personality data.
The Investigation
How did this happen?
The Great Gatsby has personality data. Jekyll & Hyde has it. Pride & Prejudice has it.
Only I, Robot is missing it.
I generated I, Robot last week using the enhanced two-phase workflow. New story, latest generator code.
Let me check the generator.
Opened core/expand_to_branches.py - the script that creates branching narratives from linear stories.
Found the prompt that tells Gemini how to structure ending nodes:
"ending_optimistic": {
"nodeId": "ending_optimistic",
"text": "...",
"pageType": "ending",
"endingType": "optimistic",
"mbtiProfile": "ENFP"
}
That’s it.
No likelyPersonalities.
No personalityDescriptions.
The example structure in the prompt didn’t include the fields needed for personality cards.
The Problem
Here’s what should have been in the prompt:
"ending_optimistic": {
"nodeId": "ending_optimistic",
"text": "...",
"pageType": "ending",
"endingType": "optimistic",
"mbtiProfile": "ENFP",
"likelyPersonalities": ["ENFP", "INFP", "ENFJ"],
"personalityDescriptions": {
"ENFP": "**The Passionate Explorer**: Your enthusiasm...",
"INFP": "**The Dreamer**: Your idealism...",
"ENFJ": "**The Inspiring Leader**: Your empathy...",
"GENERIC": "**The Optimist**: Your hopeful nature..."
}
}
Without this example, Gemini never generated those fields.
I, Robot was the first story using the updated generator. And it exposed this gap.
If I hadn’t tested the personality cards now, I would have discovered this problem after generating 5-10 more stories.
The Fix: Two Tools
Fix #1: Update the Generator
Updated expand_to_branches.py with the correct ending node structure:
# Added to the prompt
6. **ENDING REQUIREMENTS**:
- Each ending must have:
* Unique endingType identifier
* MBTI profile based on accumulated choices
* **likelyPersonalities**: Array of 2-4 MBTI types
* **personalityDescriptions**: Object with descriptions
**PERSONALITY DESCRIPTIONS FORMAT**:
- "**Archetype Title**: Explanation..."
- 2-4 likely personalities + GENERIC fallback
- Example: "ENFP": "**The Passionate Explorer**: Your enthusiasm..."
Now future stories will include personality data automatically.
Fix #2: Migration Tool for Existing Stories
But what about I, Robot? And any other stories I generate before testing cards?
Created core/add_personality_descriptions.py:
# Analyzes each ending with Gemini
# Generates likelyPersonalities based on ending narrative
# Creates personality descriptions for each type
# Adds GENERIC fallback
Ran it on I, Robot:
Analyzing ending: ending_A1_shepherd...
[OK] Generated personalities: INFJ, INTJ, ISFJ
Analyzing ending: ending_A2_cage...
[OK] Generated personalities: INFJ, INFP, INTJ
...
Total endings: 9
Updated: 8
Failed: 1
One ending failed due to JSON parsing. Reran with --force flag. Success.
All 9 I, Robot endings now have personality data.
Testing Personality Cards
Tried generating a card again:
python3 core/generate_personality_cards_gemini.py storypacks/i-robot/i-robot.json --test-single "ending_A1_shepherd:INFJ"
Generated successfully.
1080x1920px Instagram Story format. Perfect square ratio.
Card structure:
- Header: “YOUR PERSONALITY IN I, ROBOT”
- Scene image from ending
- MBTI badge: “INFJ” in color-coded badge
- Personality title: “The Mystic Guardian”
- Description text
- Footer: “Discover more at WhatIfClassics.com”
File size: 257 KB. Within budget.
Generated a second card for INTJ to test consistency. Worked perfectly.
The personality card system is validated.
The Path Problem
One more issue.
The cards generated to:
website/public/stories/i-robot/cards/
But they should generate to:
storypacks/i-robot/ending-cards/
All storypack assets should stay in the storypacks folder until deployment.
Updated generate_personality_cards_gemini.py:
# Before
output_dir = Path('website/public/stories/[titleId]/cards/')
# After
output_dir = Path('storypacks/[titleId]/ending-cards/')
Korean cards will go to ending-cards/ko/ subdirectory.
Now the workflow is consistent.
What I Learned
The bug was invisible until testing.
I generated I, Robot. Story worked. Validation passed. Images generated.
Everything seemed fine.
But the personality card system was broken. The data wasn’t there.
I only discovered this because I tested the actual card generation.
Testing reveals integration problems that validation can’t catch.
The story validator checks:
- Minimum 10 choices per path ✓
- All MBTI dimensions covered ✓
- Valid node structure ✓
But it doesn’t check if personality card data exists. It can’t know what downstream systems need.
This is why you test end-to-end, not just components.
I validated the story generator. But I didn’t validate the entire pipeline from story generation to card creation.
Gap exposed.
Impact
Fixed for future:
- New stories automatically include personality data
- Card generation outputs to correct folder
- Korean language support properly structured
Fixed for I, Robot:
- All 9 endings have personality data
- 2 sample cards validated
- Ready for full card generation (30 cards total)
Prevented:
- Discovering this bug after generating 10 more stories
- Having to manually fix personality data in multiple stories
- Users getting broken personality cards
Building the migration tool paid off immediately.
I, Robot Status
Complete:
- Story: 56 nodes, 9 endings, 12 choices per path
- Cover: i-robot-cover.webp (157 KB)
- Style guide: i-robot-style.webp (228 KB)
- Characters: 4 portraits (1.1 MB)
- Scenes: 57 images (12 MB)
- Personality data: All 9 endings
- Sample cards: 2 validated
Next: Generate remaining 28 personality cards.
Then: Deploy to website.
Building in Public Value
If I was building this privately:
I might have generated 5-10 more stories before testing personality cards.
Then discovered they all lack personality data.
Mass migration of stories. Days of work.
Instead:
Caught it immediately. Fixed the generator. Created migration tool. Validated the fix.
One story affected. One day to fix. Dozens of stories saved.
Test early. Test often. Test the full pipeline.
Progress: Day 26/100 Status: I, Robot complete, personality card system validated Next post: Generating all personality cards and deploying I, Robot