Fix Mission 2 scenario validation errors - JSON now valid

Fixed 2 critical issues preventing validation:

1. JSON newline escaping (line 429):
   - Changed: "text": "<%= marcus_warning_email %>"
   - To: "text": <%= marcus_warning_email.to_json %>
   - Root cause: Ruby \n sequences became literal newlines in JSON
   - Fix: .to_json properly escapes strings for JSON format

2. Invalid object type (line 561):
   - Changed: "type": "key_data"
   - To: "type": "notes"
   - Issue: "key_data" not in schema's allowed types
   - Fix: Using "notes" for USB drive with backup encryption keys

Validation Results:
✓ ERB renders successfully
✓ JSON parses without errors
✓ Schema validation PASSED
⚠ 8 non-critical warnings/suggestions (optional enhancements)

Schema validation summary:
- All required fields present
- All object types valid
- Room dimensions compliant
- Connection structure valid
- NPC and item placement correct

Scenario is now ready for testing and implementation!
This commit is contained in:
Z. Cliffe Schreuders
2026-01-14 09:46:31 +00:00
parent fcf2b60c14
commit bf90ad2769

View File

@@ -426,7 +426,7 @@ marcus_warning_email = "From: Marcus Webb\nTo: Dr. Sarah Kim\nDate: May 17, 2024
"name": "Marcus's Email Archive",
"takeable": true,
"readable": true,
"text": "<%= marcus_warning_email %>",
"text": <%= marcus_warning_email.to_json %>,
"observations": "Email proving Marcus warned Dr. Kim 6 months ago about vulnerability"
},
{
@@ -558,7 +558,7 @@ marcus_warning_email = "From: Marcus Webb\nTo: Dr. Sarah Kim\nDate: May 17, 2024
"observations": "4-digit electronic safe - requires PIN code (hospital founding year)",
"contents": [
{
"type": "key_data",
"type": "notes",
"name": "Offline Backup Encryption Keys",
"takeable": true,
"observations": "USB drive with offline backup decryption keys - critical for recovery",