A newer version of the Gradio SDK is available: 6.19.0
Hackathon Rescue Implementation Plan
Date: 2026-06-15
Goal
Turn the current Trans-Temporal Express prototype into one judge-ready endpoint:
- A polished intro.
- A clean first-person engine control.
- Real generated destination and character imagery.
- Real launch, travel, arrival, and ambient audio.
- A final conversation scene where the world and character are the center of the UI.
This plan supersedes the prior split /blank intro plus /app cockpit flow for the hackathon demo.
Product Decisions
- Use one endpoint for the whole experience. Prefer
/app/as the canonical app and redirect/,/blank, and/blank/to it. - Keep Gradio for backend wiring, but hide the default controls from the user-facing experience.
- The user should interact with the train cab, not with form fields.
- Do not silently demo fixture SVG images. If real image generation is unavailable, show a clear developer warning.
- Audio is part of the core experience, not a later nice-to-have.
Target User Flow
- User lands on
/app/. - Full-screen ticket/train intro plays for 10-14 seconds, with skip available.
- Intro dissolves into the train cab.
- A highlighted physical control prompts the user to choose Past or Future.
- The user chooses Past or Future using in-cockpit controls.
- The throttle illuminates and prompts the user to launch.
- User pulls/clicks the throttle.
- The app starts the backend launch through hidden Gradio components.
- Travel animation masks model latency: engine vibration, era signs, year counter, temporal tunnel, SFX.
- When image generation completes, braking and steam reveal play.
- Destination fills the windshield.
- Character is centered or near-centered in the destination scene.
- Chrome fades back; live voice becomes the primary action.
Phase 0: Asset And License Gate
Goal: import only safe, demo-appropriate assets from the internet.
Rules:
- Prefer Pixabay and Mixkit for sound effects and ambient loops because their license pages allow free use and modification without attribution, subject to prohibited-use restrictions.
- Use Freesound only for CC0 or CC BY assets. Do not use CC BY-NC or Sampling+ assets.
- Record every imported file in
static/audio/ASSET_LICENSES.mdorstatic/assets_licenses.md. - Store source URL, creator, license, download date, original filename, local filename, and any edits.
- Avoid recognizable brands, trademarked content, celebrity/person likenesses, copyrighted train IP, or commercial movie/game sounds.
Initial asset list:
static/audio/sfx/lever_pull.mp3static/audio/sfx/button_click.mp3static/audio/sfx/ticket_clang.mp3static/audio/sfx/charge_up.mp3static/audio/sfx/gears_grinding.mp3static/audio/sfx/train_whistle.mp3static/audio/sfx/materialize.mp3static/audio/sfx/time_warp.mp3static/audio/sfx/brake_screech.mp3static/audio/sfx/steam_burst.mp3static/audio/sfx/chime.mp3static/audio/ambient/temporal_storm.mp3static/audio/ambient/rain.mp3static/audio/ambient/marketplace.mp3static/audio/ambient/ocean.mp3static/audio/ambient/machinery.mp3static/audio/ambient/wind.mp3
Implementation tasks:
- Search and download candidates from approved sources.
- Normalize audio to small MP3/OGG files suitable for web playback.
- Trim long files into short loops where needed.
- Add a manifest mapping app keys to files.
- Add automated existence checks for required demo audio files.
Validation:
- All imported assets have a license entry.
- No NC assets are used.
- App still runs if an optional audio file is missing.
Phase 1: One Endpoint
Files:
app.pysrc/time_machine/ui/gradio_app.pysrc/time_machine/ui/blank_app.pysrc/time_machine/ui/assets/intro.*src/time_machine/ui/assets/cockpit.*
Tasks:
- Mount only the main app for the demo path.
- Redirect
/,/blank, and/blank/to/app/. - Move intro HTML/CSS/JS into the main app as an overlay.
- Remove the separate intro Gradio app from the happy path.
- Keep the intro skippable.
- Add a local flag such as
?skip_intro=1for repeated development testing.
Validation:
http://localhost:7865/lands in the full experience.http://localhost:7865/app/runs intro then cockpit.http://localhost:7865/blank/does not expose a half-finished alternate product.
Phase 2: Real Image Generation Contract
Files:
src/time_machine/application/container.pysrc/time_machine/adapters/image_gen/together.pysrc/time_machine/ui/view_models.pyconfig/app.yamlconfig/models.yaml
Tasks:
- Add explicit image generation readiness to startup/runtime state.
- In
modalanddevdemo profiles, requireTIME_MACHINE_IMAGE_API_KEYorTOGETHER_API_KEY. - Stop silently falling back to fixture SVG portraits for the hackathon profile.
- Keep fixture fallback only for tests and local no-network development.
- Add a UI developer warning if image generation is disabled.
- Improve prompts so the world scene has a clear empty/usable foreground area for the character.
- Improve portrait prompts so character output matches warm animated-film style and avoids crude flat avatar output.
- Cache generated images by encounter id to avoid flicker and repeated API calls.
Validation:
- With image API key: world and portrait are PNGs, not fixture SVGs.
- Without image API key in demo profile: app clearly reports missing image config.
- Fixture tests still pass.
Phase 3: Replace Form Controls With Engine Controls
Files:
src/time_machine/ui/assets/cockpit.htmlsrc/time_machine/ui/assets/cockpit.csssrc/time_machine/ui/assets/cockpit.jssrc/time_machine/ui/gradio_app.py
Tasks:
- Hide the visible Gradio dropdown, coordinate textarea, launch button, souvenir button, save button, markdown readouts, microphone controls, and audio widgets from the first-screen UI.
- Keep their
elem_ids and backend wiring intact. - Add custom in-cockpit controls:
- Past button or switch.
- Future button or switch.
- Throttle lever as the launch action.
- Optional surprise route as a small randomizer/lighted ticket slot.
- On Past/Future selection, set the hidden Gradio route dropdown.
- On throttle click, trigger the hidden Gradio launch button.
- Add guided highlight states:
- After intro: highlight Past/Future selector.
- After selection: highlight throttle.
- During launch: disable controls and show engine state.
- After arrival: fade controls and focus voice.
Validation:
- User can complete launch without seeing or using Gradio form controls.
- Keyboard and screen-reader users can still trigger the custom controls.
- Hidden Gradio components continue to receive the expected values.
Phase 4: Cinematic Layout Rescue
Files:
src/time_machine/ui/assets/cockpit.csssrc/time_machine/ui/assets/cockpit.jssrc/time_machine/ui/assets/cockpit.html
Tasks:
- Make the windshield/world area the dominant visual region.
- Center the generated character in the scene after arrival.
- Remove or collapse UI chrome that competes with the final world:
- Route card fades to a small top-left plate.
- Year module shrinks after reveal.
- Narration becomes a temporary subtitle, then clears.
- Throttle and dashboard dim once conversation is ready.
- Comm screen becomes the live voice affordance, not a competing panel.
- Avoid blocking the character with narration text.
- Replace current portrait crop behavior with a full-body or bust overlay treatment that feels intentionally staged.
- Add final state class
.tm-state-conversation-readylayout rules that prioritize scene/character.
Validation:
- In
conversation_ready, the screenshot reads as "I am looking at a person in another world." - Character is not hidden behind controls or placed as a side widget.
- Mobile view does not overlap controls, subtitles, and character.
Phase 5: Audio System
Files:
src/time_machine/ui/assets/cockpit.jssrc/time_machine/ui/assets/intro.jssrc/time_machine/ui/assets/cockpit.htmlsrc/time_machine/ui/assets/intro.htmlstatic/audio/**static/asset_manifest.json
Tasks:
- Add a shared
AudioManager. - Preload known SFX with graceful missing-file handling.
- Unlock Web Audio after first user interaction.
- Play intro SFX:
- ticket appears
- conductor punch
- charge-up
- materialization
- train whistle
- Play cockpit SFX:
- button click
- lever pull
- charge-up
- time warp
- brake screech
- steam burst
- arrival chime
- Add ambient loops:
- temporal storm during travel
- destination ambience based on
ambient_key
- Add ducking:
- ambient lower under narration
- ambient lower under character speech
- restore after speech
- Keep procedural tones only as fallback.
Validation:
- User hears distinct launch, travel, braking, arrival, and world ambience.
- Missing audio does not break the page.
- Browser autoplay restrictions are handled through user interaction.
Phase 6: Intro Polish
Files:
src/time_machine/ui/assets/intro.htmlsrc/time_machine/ui/assets/intro.csssrc/time_machine/ui/assets/intro.js
Tasks:
- Keep ticket/conductor/train beats, but shorten the total runtime.
- Avoid dark empty time at the beginning.
- Add tighter animation timing and audio hits.
- End with a direct dissolve into the cockpit, not a route navigation.
- Show skip affordance after 1 second.
Validation:
- Intro feels intentional in 10-14 seconds.
- Skip works immediately after it appears.
- Transition into cockpit feels continuous.
Phase 7: Tests And Demo Verification
Tasks:
- Unit tests:
- payload contains image readiness flags.
- missing image API warning path.
- hidden Gradio launch wiring is unchanged.
- Browser verification:
- intro first frame
- cockpit ready
- Past selected
- travel animation
- braking/steam
- final world/character
- Manual audio check:
- SFX fire at expected moments.
- ambience loops and ducks.
- Demo script:
- Past launch path.
- Future launch path.
- Live voice handoff.
Risk Register
- Real image generation latency may be longer than the intro/travel animation.
- Mitigation: keep travel loop alive until scene and portrait are ready.
- Browser autoplay restrictions can block audio.
- Mitigation: first user click after intro unlocks audio; intro skip and controls call
audioManager.unlock().
- Mitigation: first user click after intro unlocks audio; intro skip and controls call
- Downloaded audio licenses can be ambiguous.
- Mitigation: use only clear license pages and keep a ledger.
- Gradio DOM changes can break hidden-control automation.
- Mitigation: target stable
elem_ids and add smoke tests.
- Mitigation: target stable
- Network/image API failure could ruin demo.
- Mitigation: pre-generate and cache demo encounter images before judging where possible.
Suggested Implementation Order
- One endpoint and intro overlay.
- Hide Gradio controls and build engine controls.
- Final-state layout rescue.
- Real image generation hard gate and prompt improvements.
- Audio asset import and
AudioManager. - Intro timing/audio polish.
- Browser screenshots and demo rehearsal.
External License References
- Pixabay Content License Summary: https://pixabay.com/service/license-summary/
- Mixkit License: https://mixkit.co/license/
- Freesound FAQ Licenses: https://freesound.org/help/faq/#licenses-0