Skip to content

Implement Android app features and enhance release readiness - #10

Merged
djblackett merged 10 commits into
mainfrom
dev
Nov 3, 2026
Merged

djblackett merged 10 commits into
mainfrom
dev

Conversation

@djblackett

Copy link
Copy Markdown
Owner

No description provided.

djblackett and others added 10 commits November 2, 2026 03:02
…ures

- Added support for fullscreen detection and handling in the Android app.
- Implemented app update prompts for outdated versions in the Android app.
- Configured production API URL for the Android app in a new .env.android file.
- Created documentation for building and testing the Android app.
- Developed build script for the Android app to ensure proper configuration and assets.
- Added tests for Android-specific functionality and configurations.
- Integrated native back button handling and lifecycle management for the Android app.
- Ensured system bars are hidden and safe areas are respected in the Android app.
The audit of the ranked backend, replay security and the failing touch/menu
browser suites, moved from a scratch file into the repository. Probe output
is kept as evidence; references to the scratch folder are described instead
of linked. File and line references are to a8acf66.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Chain Lightning added a seventh entry to POWERUP_INFO, but the guide still
laid rows out at a fixed 74 px pitch from y=130, so the last row (Revive)
and its two-line description ran under the BACK button at every phone and
desktop size. The rows now start higher and their pitch shrinks to fit the
space between the title and BACK (capped at the old 74 px).

Found by the menu.mjs layout review once the suite could run past its
stale PLAY tap.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Point-to-Fly "four diagonals" check failed at random (2 of 5 runs in
the audit). recentre() emptied the asteroids but never the UFOs: a UFO was
alive in every direction case, and when it hit the ship (lives 99 -> 98)
the ship respawned facing 0 and was still re-turning when the window
ended. recentre() and quiet() now remove UFOs and their shots and stop new
ones; the failure detail includes the ship's lives so a hit shows up.
Movement section: 6/6 clean runs afterwards, against 1 hit in 4 before.

The "Assisted Flight gets going up sooner" check measured between two
wall-clock snapshots, so its window varied by a tick or more (~5 px) with
browser latency, once landing inside the 10 px margin. It now traces
sim.step and measures exactly 0.35 s of simulation time from the step that
first received the flick. Same assertion and margins; the result is now
identical on every run (Assisted 91 px up / 26 px sideways, Point-to-Fly
75 / 55).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5033ac8 made PLAY on a one-player phone the ranked entry (casual play is
PRACTICE) and a740fe1 / ccce3ce changed some texts, but touch.mjs,
menu.mjs and ranked-browser.mjs still expected the old behaviour. Each
stale PLAY tap timed out and aborted the rest of its suite.

- touch.mjs / menu.mjs: tap PRACTICE where a casual game is wanted; a phone
  in keyboard mode keeps the PLAY / PRACTICE entry, so check that, and that
  a tap on PRACTICE asks for a keyboard first and a finger cannot press
  START WITH KEYBOARD; ?touch=0 is checked by the touch-on button rather
  than the old "PLAY WITH KEYBOARD" label; the rotate-prompt check taps
  where PRACTICE is (a tap on PLAY never starts a game on a phone).
- menu.mjs: the legend lists six one-player power-ups (LIGHTNING / Chain
  hits, and MEGA POWER says "4 powers!").
- ranked-browser.mjs: nicknames are shown as typed, and the outage page
  says "YOU CAN STILL PLAY PRACTICE.".

touch 360/360, menu 127/127, ranked-browser 61/61.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The router counted every POST /runs/:id/submit against submit:global
before submitRun had loaded the run or checked its token, so junk requests
to random run ids from many addresses could use up the hourly verification
budget (default 1200) and make every honest submission fail with 429.

The per-address bucket still runs first, before any work. The global
bucket is now charged by submitRun once the run exists, the caller has
shown its token and the run is still open (not rejected or expired), just
before the body is read. Authentication, the per-address limit and the
global ceiling on verification are unchanged for requests that can
actually reach verification.

Regression tests: unknown runs, malformed ids, missing and wrong tokens
leave the global counter at zero and a real run still verifies; token
holders are still capped (third of three gets 429 and stays issued);
expired and rejected runs answer 410 / 409, not 429.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Until now the Worker verified exactly one gameplay rules version, compiled
in from src/replay, and ignored what the client played. Since PLAY on a
phone is ranked, the first rules bump after the Android release would have
broken the main button of every installed app, and rejected any run in
progress at deploy time (see docs/android-release-audit.md, #1).

- server/rules/<version>/engine.mjs: the simulation + verifier for one
  rules version, built from src/replay exactly like dist/node (one
  self-contained module, no imports), plus engine.d.mts and gzipped
  reference replays with the results that engine computes. Written by
  `npm run rules:freeze`; hashes recorded in server/rules/versions.json;
  stored byte-for-byte (-text) so Windows and CI agree. 1.2.0 frozen from
  a8acf66 (identical to today's dist/node build).
- server/src/engines.ts: the explicit allowlist. Untrusted version strings
  only match the registry's own keys (no prototype keys).
- Issue: POST /api/v1/runs?rules=&schema= gets that version when it is
  registered with that schema; anything else, or no query (existing web
  clients), gets the current version as before, which the client already
  refuses with "update". No new error path, no client change needed for
  old builds.
- Verify: the engine is chosen by runs.rules_version, stored at issue,
  never by the submission; a replay naming other rules is rejected before
  any engine runs; an unregistered version is rules_mismatch. Tokens,
  idempotency, claim races, limits, elapsed-time and expiry rules are
  untouched. No migration: each engine reads exactly one schema, so the
  stored rules version fixes both.
- Health adds supportedRules; rulesVersion / schemaVersion keep their
  meaning (the current version).
- Client: requestChallenge names GAMEPLAY_RULES_VERSION and
  REPLAY_SCHEMA_VERSION in the query string (keeps the request CORS-simple).
- The Worker bundle now contains no live simulation code: 121 KiB
  (32.6 KiB gzipped) in a wrangler --dry-run build.

Tests: issuing by version (fallbacks, hostile values, body ignored),
a 1.2.0 run verified by the frozen engine on a server whose current
version is newer, a rules update mid-run not invalidating the run, a
submission unable to pick its verifier, retirement. Browser suites match
the challenge request by path now that it has a query string, and
ranked-browser / worker-e2e check the query and supportedRules for real
(worker-e2e also stops expecting the old 1.1.0). The chain-lightning
verifier test spies on the frozen engine's GameSim, which is now the
authoritative one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- server/rules/released.json: every Android build handed out, the rules
  it plays, and when a successor replaced it; policy.supportDays = 90.
  The release candidate (1.0, versionCode 1, rules 1.2.0) is recorded with
  distributed: null, so 1.2.0 is protected from now on.
- server/tests/rulesCompat.test.ts (runs with npm test, before the Worker
  deploys): engines.ts registers exactly the versions in versions.json; the
  current GAMEPLAY_RULES_VERSION is frozen and registered; every version a
  released build still needs is supported; each frozen file matches its
  pinned hash and nothing is added or missing; engines import nothing; the
  reference replays give the recorded results through their frozen engine,
  and the current version's also through the live sources, so a gameplay
  change without a rules bump fails here (checked: a 1-degree turn-speed
  change fails 4 reference checks and the lifecycle tests).
- scripts/rules-guard.mjs (CI step, against the merge base; checkout now
  fetches full history): frozen files may be added, never modified, and
  deleted only once retired; versions.json entries never change;
  released.json records are permanent and only gain their dates, without
  backdating supersededOn. node:test runs it against scratch git repos.
- scripts/production-health.mjs: after deploy, the Worker's supportedRules
  must include the current rules and every version distributed builds
  still need.
- scripts/build-android.mjs: refuses to package unless the app's rules are
  frozen and its versionCode is recorded in released.json with those rules.
  Its tests now run in CI too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…licy

server/rules/README.md describes the frozen engines, how a version is
chosen at issue and verify, what each check protects, the rules-bump
procedure (backend serves both versions -> web and the new app ship ->
the old version retires after its support period) and the initial
retirement policy: Android rules stay supported at least 90 days after
their last build is superseded (CI-enforced) and until they are under
about 2% of issued runs; web-only versions at least 7 days.

leaderboard-backend.md, deployment.md and android.md drop the
one-version-at-a-time description (android.md keeps it as history), and
the audit gets a status note listing what has been done since.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@djblackett
djblackett merged commit 532f8fb into main Nov 3, 2026
4 checks passed
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.

1 participant