Inspiration
Most Twitch interactions let viewers vote, trigger an effect, or watch someone else play. I wanted to give chat a more memorable role: build the opponent the streamer has to fight. But simply stacking viewer-selected hazards can produce an impossible or unfair fight. That led to the core idea behind BOSSMINT: the world gets to push back.
Same chat. Different world. Different boss.
What it does
BOSSMINT is a Twitch-connected, real-time boss-combat prototype with a streamer dashboard and an OBS-ready browser overlay.
Viewers send !laser, !wall, and !dash in Twitch chat. BOSSMINT receives authenticated channel-chat events through Twitch EventSub, attributes the contributions to distinct viewers, and uses those inputs to compose an attack.
Before a round begins, the composer probes a hidden world to find a survivable attack configuration. It may reject its first candidate and choose another one. The game then runs an authoritative timed combat round, while a deterministic verifier checks the result against the trusted rules. Survivable does not mean guaranteed victory: the streamer can still make a mistake and lose.
A real Twitch-connected test made the difference visible:
- Same three commands, two real Twitch accounts, zero mock commands.
- World A: gap 4 accepted (21 explored states); the player survived all 8 ticks.
- World B: gap 4 rejected (12 explored states), gap 5 accepted (18 explored states); the player was hit at tick 3.
- The overlay displays the boss, hazards, contributors and round outcome.
This is the winning moment: chat creates the threat, the world forces the boss to adapt, and the streamer owns the outcome.
How we built it
The application uses Node.js and JavaScript for its Twitch connector, game server, composition engine and verifier; Twitch OAuth + EventSub WebSockets for authentic chat input; Canvas 2D, HTML and CSS for the arena; server-sent events for synchronized UI state; and an OBS browser-source overlay for stream presentation.
I started with a functioning local Gate 1 prototype and used OpenAI Codex as a hands-on coding and debugging partner for substantial improvements to the actual repository:
- Baseline inspection: Codex mapped the components, ran existing tests, preserved historical evidence and established a Git baseline without misrepresenting earlier work as Codex-generated.
- Combat verification: Codex found that forged terminal transcripts could pass verification. It reproduced the flaws with failing adversarial tests, then implemented strict state and schema checks, trusted-plan verification, chronological validation and deterministic action replay.
- Twitch reliability: Codex improved socket ownership, Twitch-initiated migration, reconnect behavior, bounded message-ID deduplication, authorization errors and shutdown cleanup.
- Real-world debugging: a live EventSub test exposed repeated heartbeat timeouts despite green simulated tests. Codex traced the watchdog's near-zero timing margin and migration timer risks, then implemented monotonic deadlines, a bounded grace period and stale-callback protection.
The latest reported local regression run completed 73/73 automated tests. Gate 0 and Gate 1 causal comparison proofs also passed locally. Real Twitch observations and synthetic test evidence remain clearly labeled as different kinds of evidence.
Challenges we ran into
Fairness versus player agency. The attack must admit a real survival route without making the fight automatically winnable. World B demonstrates this distinction: the composer found a safe route, yet the player's actual inputs still led to a loss.
A verifier that initially trusted too much. Early regression tests showed fabricated outcomes and malformed transcripts being accepted. The fix required replaying authoritative transitions rather than trusting labels in the submitted transcript.
Real Twitch is not a mock transport. EventSub worked with authentic chat, but a subsequent reliability change caused repeated HEARTBEAT_TIMEOUT reconnects. That live feedback exposed timing assumptions the unit tests had missed.
Proof integrity. We preserved baseline file hashes and kept mock/local proofs separate from real Twitch observations. Deterministic replay verifies consistency with trusted game rules; it is not a cryptographic attestation of a viewer's identity or a live broadcast.
Accomplishments that we're proud of
- Authentic Twitch chat-to-gameplay: three real commands from two users composed a boss without mock inputs.
- A visible causal counterfactual: identical contributions produced different valid configurations in Worlds A and B.
- Real consequences: both an eight-tick survival and a tick-three defeat were recorded and checked by the server-side combat system.
- A defensible verification process: Codex helped turn failing adversarial tests into passing integrity regressions, rather than merely adding more happy-path assertions.
- A capture-ready overlay: the boss and combat state can be shown through an OBS browser source without moving the authoritative referee into the browser.
What we learned
The most important ingredient in interactive AI-assisted software is not a flashy generated answer: it is a visible cause-and-effect loop. Chat needs to see its contribution become a challenge, and the streamer needs a meaningful decision.
Codex was most valuable when used to investigate failures, write tests that initially failed, modify real code and check regressions. We also learned that a local green test suite cannot replace live Twitch validation.
What's next for BOSSMINT
- Make laser, wall and dash attacks more visually distinctive and expressive.
- Add faster rounds, richer boss transformations and more audience-driven combinations.
- Expand the world generator beyond the two proof scenarios while preserving fairness and independent verification.
- Improve stream production tooling and broaden playtests with independent Twitch communities.
BOSSMINT: The chat builds the boss. The world pushes back. The streamer fights.
Built With
- canvas-2d
- css3
- git
- github
- html5
- javascript
- node.js
- oauth-2.0
- obs-studio
- openai-codex
- server-sent-events
- twitch
- twitch-eventsub
- websockets