mirror of
https://github.com/cliffe/BreakEscape.git
synced 2026-02-21 11:18:08 +00:00
ac23d5c68803adef652e76b0b8413f33a39ada39
Created initial design documentation for Mission 7, the climactic branching crisis
response mission where The Architect launches coordinated attacks on four simultaneous
targets.
Design Documentation:
- README.md: Complete mission overview explaining branching structure, shared mechanics,
outcomes matrix, and development strategy
- mission.json: Metadata with CyBOK mappings covering crisis response, multi-vector
defense, and ethical decision-making under pressure
Stage 0 Initialization Documents (4 branches):
Option A: Infrastructure Collapse
- Target: Pacific Northwest Power Grid Control Facility
- Threat: Critical Mass cell power grid attack
- Stakes: 240-385 civilian deaths (immediate casualties)
- Cell Leader: Marcus "Blackout" Chen
- Antagonist: Former DoE engineer, believes infrastructure vulnerabilities need exposing
Option B: Data Apocalypse
- Target: Federal Election Security Data Center
- Threat: Ghost Protocol + Social Fabric dual attack (data breach + disinformation)
- Stakes: 187M voter records stolen, democratic integrity collapsed, 20-40 deaths from unrest
- Cell Leaders: "Specter" (Ghost Protocol) + Rachel Morrow (Social Fabric)
- Antagonist: Rachel recruitable, believes she's exposing corruption
Option C: Supply Chain Infection
- Target: TechForge Software Distribution Platform
- Threat: Supply Chain Saboteurs backdoor injection into 47M systems
- Stakes: Long-term national security catastrophe, $240-420B damage over 10 years
- Cell Leader: Adrian Cross
- Antagonist: Former software engineer, valid criticisms of industry security
Option D: Corporate Warfare
- Target: TechCore Security Operations Center (monitoring 12 Fortune 500 corporations)
- Threat: Digital Vanguard + Zero Day Syndicate deploying 47 zero-days simultaneously
- Stakes: $280-420B economic damage, 140K-220K job losses, 80-140 healthcare deaths
- Cell Leaders: Victoria "V1per" Zhang + Marcus "Shadow" Chen
- Antagonist: Victoria recruitable, anti-corporate ideology with valid points
Shared Systems Across All Options:
- 30-minute in-game timer (maximum pressure)
- SecGen scenario: "Putting it together" (NFS shares, netcat, privilege escalation)
- First direct contact with The Architect (voice/text taunts throughout)
- Tomb Gamma location discovery (47.2382° N, 112.5156° W - Montana)
- SAFETYNET mole evidence confirmed
- The Architect's identity narrowed to 3 suspects
Key Design Elements:
- THE IMPOSSIBLE CHOICE: Player chooses one operation knowing others partially fail
- Deterministic outcomes matrix: Based on player choice, 1 operation succeeds fully,
1 partially succeeds, 1 fails completely
- Moral complexity: All choices valid, all have consequences, no "right" answer
- Recruitable antagonists in 3 of 4 options (if shown ENTROPY casualty evidence)
- Consequences persist to M8-10 finale
Educational Objectives (CyBOK):
- Security Operations & Incident Management (crisis response, triage, resource allocation)
- Systems Security (multi-vector defense, coordinated threats)
- Human Factors (professional judgment under pressure, ethical decision-making)
- Infrastructure/Election/Supply Chain/Corporate security (option-specific)
Narrative Integration:
- First appearance of The Architect (philosophy revealed: "Entropy is inevitable")
- Sets up M8 (The Mole investigation of SAFETYNET infiltration)
- Sets up M9-10 (Tomb Gamma confrontation with The Architect)
- Campaign branches based on which operations succeeded/failed
Development Strategy:
- Phase 1: Build shared systems (choice sequence, timer, outcomes, The Architect comms)
- Phase 2: Develop individual options in parallel (4 separate scenario files)
- Phase 3: Integration and cross-path testing
File Structure Created:
scenarios/m07_architects_gambit/
├── README.md (design overview)
├── mission.json (metadata)
├── ink/ (dialogue scripts directory)
└── planning/
├── stage_0_option_a_infrastructure.md
├── stage_0_option_b_data.md
├── stage_0_option_c_supply_chain.md
└── stage_0_option_d_corporate.md
Total: 6 files, comprehensive design for most complex Season 1 mission
BreakEscape Rails Engine
Cybersecurity training escape room game as a mountable Rails Engine.
Features
- 24+ cybersecurity escape room scenarios
- Server-side progress tracking with 2-table schema
- Randomized passwords per game instance via ERB
- JIT Ink script compilation for NPC dialogue
- Polymorphic player support (User/DemoUser)
- Pundit authorization
- RESTful API for game state management
- Session-based state persistence
Installation
In your Gemfile:
gem 'break_escape', path: 'path/to/break_escape'
Then:
bundle install
rails break_escape:install:migrations
rails db:migrate
rails db:seed # Optional: creates missions from scenarios
Mounting in Host App
In your config/routes.rb:
mount BreakEscape::Engine => "/break_escape"
Usage
Standalone Mode (Development)
export BREAK_ESCAPE_STANDALONE=true
rails server
# Visit http://localhost:3000/break_escape/
Mounted Mode (Production)
Mount in Hacktivity or another Rails app. The engine will use the host app's current_user via Devise.
Configuration
# config/initializers/break_escape.rb
BreakEscape.configure do |config|
config.standalone_mode = false # true for development
config.demo_user_handle = 'demo_player'
end
Database Schema
break_escape_missions- Scenario metadata (name, display_name, published, difficulty)break_escape_games- Player state + scenario snapshot (JSONB)break_escape_demo_users- Standalone mode only (optional)
API Endpoints
GET /games/:id/scenario- Scenario JSON (ERB-generated)GET /games/:id/ink?npc=X- NPC script (JIT compiled from .ink)GET /games/:id/bootstrap- Initial game dataPUT /games/:id/sync_state- Sync player statePOST /games/:id/unlock- Validate unlock attemptPOST /games/:id/inventory- Update inventory
Architecture
ERB Scenario Generation
Scenarios are stored as .json.erb templates and rendered on-demand with randomized values:
<%= random_password %>- Generates unique password per game<%= random_pin %>- Generates unique 4-digit PIN<%= random_code %>- Generates unique hex code
JIT Ink Compilation
NPC dialogue scripts compile on first request (~300ms):
- Check if
.jsonexists and is newer than.ink - If needed, run
inklecateto compile - Cache compiled JSON for subsequent requests
State Management
Player state stored in JSONB column:
- Current room and unlocked rooms
- Inventory and collected items
- NPC encounters
- Global variables (synced with client)
- Health and minigame state
Testing
rails test
License
AGPL v3 - See LICENSE file for details
Documentation
See HACKTIVITY_INTEGRATION.md for integration guide.
Description
Languages
JavaScript
86.5%
Ink
7%
HTML
2.9%
CSS
2.5%
Ruby
0.9%
Other
0.2%