Repository navigation
feat: demo mode for a public demonstration (spec 003) - #12
Draft
AnaLauraFFerraz wants to merge 29 commits into
Draft
AnaLauraFFerraz wants to merge 29 commits into
AnaLauraFFerraz wants to merge 29 commits into
Conversation
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.
Summary
Spec 003 adds a demo mode to the API, selected with
DEMO_MODE=trueand off by default, so the API can run as a self-contained public demonstration on a free web service (one port, 0.1 CPU, 512 MB, temporary disk, sleep after 15 minutes, 5 GB of outbound bandwidth a month). Local mode stays as it is.In demo mode the server will verify the published recording, build the whole session in memory before answering, use the recording's capture times, seed the coach cache from a versioned file, switch the database to read-only, and replay the recording at
1xin a loop on the single port, sending only the player's car, compressed, to at most 5 connections of at most 5 minutes each. It never makes a paid call: it refuses to start with an Anthropic key.This is a draft: the work lands phase by phase, following the tasks.
specs/003-demo-mode/spec.mdspecs/003-demo-mode/plan.mdandresearch.mdspecs/003-demo-mode/tasks.mdDone so far
npm run build, its owntsconfig.build.json) andnpm start; paths resolved from the project root, so the compiled server usesdata/telemetry.dband notdist/data/.PORT,DEMO_ALLOWED_ORIGIN, limits,DEMO_WS_COMPRESSION; refusesANTHROPIC_API_KEYandDB_PATH). With a valid configuration the server still stops: the demo itself is not wired yet.persistTelemetryreturns the lap a packet completed (used later for the capture times).Changes the frontend sees (for the frontend's spec 003)
None of these exist yet in this draft; they are what the finished feature will expose, from
plan.md:dataholds only the player's car (a contract change with the same shape).playerCarIndexis always0(read the car through it, as today).4001"demo full" and4002"time limit" (after 5 minutes); reconnect only on the visitor's action.403for a foreign origin.Cache-Control: no-cacheplus the ETag on reads (304on revalidation);no-storeon the coach and on health.1.GET /health, in both modes.429: the per-IP limit is not adopted.ANTHROPIC_API_KEY.Out of scope
The deploy itself, a build check in the CI (a separate small spec), and any frontend change.