Bug Free Squad - #2
Open
samad001z wants to merge 5 commits into
Open
Conversation
A 60-second mobile web game testing reaction, memory and logic, built as an installable PWA with a Trusted Web Activity APK. - Three timed challenges scored to 1000, on one global 60s timer - Eight personas from a pure local rule function over three 0-100 axes - OpenRouter writes the verdict, strength, weakness and coaching tip - AI-generated puzzles with server-side answer-key verification: answers are recomputed, mis-keyed indexes repaired, ambiguous or unprovable puzzles dropped - Live leaderboard on an Upstash Redis sorted set, polled while visible - Offline-capable via a cache-first service worker; /api never cached - Every AI path is best-effort: 4s abort, never a 500, hardcoded fallback rendered first and only upgraded on source:"ai" Team: Bug Free Squad Members: Syed Saad Ur Rahman, Astha Kumari, Bhanodai Gupta Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Team, theme, one-liner, AI usage, run instructions, demo links and tech stack for Bug Free Squad / AI DARE. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adds the AI DARE — Human vs AI mini-game as a self-contained PWA inside ai-dare/, including a single-file frontend, a service worker for offline play, and Vercel serverless endpoints for AI-generated puzzles/verdicts and a live leaderboard. It also updates the repository README with the team/submission details and run instructions.
Changes:
- Fill in submission metadata and detailed run/setup instructions in the root
README.md. - Add the
ai-dare/web app:index.html, PWAmanifest.json, offlinesw.js, and Vercel config for APK/assetlinks headers. - Add serverless endpoints for AI verdicts and puzzle generation (OpenRouter-backed with fallbacks).
Reviewed changes
Copilot reviewed 13 out of 18 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Submission details + run instructions and demo links for AI DARE |
| ai-dare/vercel.json | Vercel headers for .apk downloads and assetlinks.json |
| ai-dare/tools/make_icons.py | Script to generate icon PNGs |
| ai-dare/sw.js | Service worker for offline cache-first shell (skips /api and .apk) |
| ai-dare/README.md | Full technical write-up and operational notes |
| ai-dare/package.json | Marks API handlers as ES modules (type: module) |
| ai-dare/manifest.json | PWA manifest (standalone, portrait, maskable icons) |
| ai-dare/index.html | Single-file game UI + logic + API calls for puzzles/verdict/leaderboard |
| ai-dare/api/verdict.js | Serverless endpoint: AI-written result copy with strict fallback behavior |
| ai-dare/api/puzzles.js | Serverless endpoint: AI puzzle generation + server-side answer verification |
| ai-dare/.well-known/assetlinks.json | TWA domain verification for fullscreen launch |
| ai-dare/.vercelignore | Excludes env files and non-runtime assets from deployment uploads |
| ai-dare/.gitignore | Ignores local Vercel + env files for ai-dare/ |
| .gitignore | Repo-wide ignores for env/secrets, build outputs, editors, etc. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| const numbers = (question.match(/-?\d+\.?\d*/g) || []).length; | ||
| if (numbers < 3) return false; | ||
| if (/,\s*\?/.test(question)) return true; | ||
| return /next|comes after|follows|continue|finish the sequence/i.test(question); |
| - API key: read from `process.env.OPENROUTER_API_KEY` **inside serverless | ||
| functions only** — it is never sent to the browser. Locally it goes in | ||
| `ai-dare/.env` (gitignored); in production it's a Vercel environment variable. | ||
| Copy `ai-dare/.env.example` to get started. |
| ```bash | ||
| npm i -g vercel | ||
| vercel link | ||
| cp .env.example .env # add your OpenRouter key |
Comment on lines
+1
to
+2
| .vercel | ||
| .env* |
| Entirely optional: if the store is unreachable the board says | ||
| so and the game is completely unaffected. | ||
| ========================================================= */ | ||
| var LEADERBOARD_URL = '/api/leaderboard'; |
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AI DARE — Human vs AI
Team: Bug Free Squad
Members: Syed Saad Ur Rahman, Astha Kumari, Bhanodai Gupta
Venue: Hyderabad
Theme: Simple game
A 60-second challenge that measures your reaction, memory and logic, then has an AI roast and coach you on your actual numbers.
Demo
ai-dare/ai-dare.apk)ai-dare/README.mdInstalled and tested on a OnePlus Nord CE 3 Lite (Android 15).
How the AI is used
openai/gpt-4o-minivia OpenRouter, in two places:Scoring and the 8 personas are decided by local rules, not the model — the AI writes about a result it cannot change.
Two things we're proud of
The AI never gates the game. Every call has a 4s
AbortControllertimeout, never returns a 500, and falls back to hardcoded content. The result screen renders fallback copy immediately and only swaps in AI text if it arrives — there is never a spinner in place of content. The app is fully playable offline via a service worker.We don't trust the model's answer keys. An LLM writing its own multiple-choice answers is wrong often enough to ruin a demo — in testing it gave us
3+5*2 → 10andA, C, E, G → H, both of which would have marked a correct player wrong. So the server recomputes every answer it can (a recursive-descent arithmetic parser, plus arithmetic / geometric / Fibonacci / alternating / prime / quadratic sequence rules and letter sequences), repairs a mis-keyed index, and drops any puzzle whose answer it cannot prove.Stack
Single
index.htmlwith no framework, bundler, build step or dependencies · Vercel serverless functions · OpenRouter · Upstash Redis sorted set for the live leaderboard · PWA + service worker · PWABuilder TWA for the APK · Python/Pillow for the icons.Animation is transform/opacity only, with no blur, backdrop-filter, animated shadows or canvas — built to stay smooth on a 144 Hz device.
Note on the checklist
This is a web app packaged as an Android TWA rather than an Android Studio project, so there's no Gradle build — the APK is built with PWABuilder and domain-verified via
ai-dare/.well-known/assetlinks.json, so it launches fullscreen with no browser address bar. The OpenRouter key is read fromprocess.envinside serverless functions only and never reaches the browser; no.envor keystore is in the repo.