Skip to content

Bug Free Squad - #2

Open
samad001z wants to merge 5 commits into
Reskilll:mainfrom
samad001z:main
Open

Bug Free Squad#2
samad001z wants to merge 5 commits into
Reskilll:mainfrom
samad001z:main

Conversation

@samad001z

@samad001z samad001z commented Aug 9, 2026

Copy link
Copy Markdown

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

Live app https://ai-dare.vercel.app
APK https://ai-dare.vercel.app/ai-dare.apk (also at ai-dare/ai-dare.apk)
Write-up ai-dare/README.md

Installed and tested on a OnePlus Nord CE 3 Lite (Android 15).

How the AI is used

openai/gpt-4o-mini via OpenRouter, in two places:

  1. The result copy — a personalised verdict, strength, weakness and coaching tip written from the player's real stats for their already-decided persona.
  2. The puzzles — a fresh set every session, so no two players get the same questions.

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 AbortController timeout, 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 → 10 and A, 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.html with 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 from process.env inside serverless functions only and never reaches the browser; no .env or keystore is in the repo.

samad001z and others added 3 commits August 9, 2026 16:50
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>
Copilot AI lite review requested due to automatic review settings August 9, 2026 11:24
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, PWA manifest.json, offline sw.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.

Comment thread ai-dare/api/puzzles.js
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);
Comment thread README.md
- 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.
Comment thread ai-dare/README.md
```bash
npm i -g vercel
vercel link
cp .env.example .env # add your OpenRouter key
Comment thread ai-dare/.gitignore
Comment on lines +1 to +2
.vercel
.env*
Comment thread ai-dare/index.html
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants