Skip to content

Debug-only demo modes: no-server DemoSuasApi and LOCAL Worker launcher - #13

Merged
scrimshawlife-ctrl merged 5 commits into
mainfrom
demo-data-mode
Oct 7, 2026
Merged

scrimshawlife-ctrl merged 5 commits into
mainfrom
demo-data-mode

Conversation

@scrimshawlife-ctrl

@scrimshawlife-ctrl scrimshawlife-ctrl commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds a no-server demo mode and a LOCAL Worker launcher to debug builds only. Release builds are unchanged: the release APK still declares only RootActivity and contains no fixtures.

Launcher (debug APK) Activity Backend Class
SUAS RootActivity STAGING https://suasqrf.com STAGING
SUAS Demo (no server) DemoRootActivity in-memory DemoSuasApi, no network LOCAL
SUAS Local Worker LocalRootActivity http://10.0.2.2:3000 (npm run dev:demo in suas, scrimshawlife-ctrl/suas#187) LOCAL
./gradlew :app:installDebug
adb shell am start -n com.example.suas/.DemoRootActivity   # sign in: demo@example.invalid, code 123456
adb shell am start -n com.example.suas/.LocalRootActivity  # needs npm run dev:demo on the host

What was missing

  • There was no way to show the app without a reachable backend.
  • The real client had no LOCAL launcher. Backend.LOCAL_BASE existed, but nothing used it.

Changes

  • main (small, behavior-neutral):
    • ProductShell became SuasProductShell(api, hooks).
    • New ShellHooks carries the environment class, an optional banner, a sign-in hint and prefill, an optional "existing request" lookup, and an optional demo advance.
    • RootActivity passes the pinned STAGING client and ShellHooks.NONE, so it looks and behaves exactly as before.
    • Optional parameters were added to LauncherHome, SignInScreen and ConnectedRequestScreen.
  • debug only:
    • DemoRootActivity and LocalRootActivity, with labels in src/debug/res.
    • demo/DemoSuasApi.kt: an in-memory SuasApi with Worker-like 401/403/404/409 answers, idempotent keys, single-use challenges, and a demo stand-in for LOCAL simulate.
    • The fixture at src/debug/resources/demo/demo-fixtures.json.
  • contract/demo-fixtures.json is captured from the real LOCAL Worker (npm run demo:fixtures in suas). The copy is byte-identical, and a drift test guards it.
  • testDebug: 17 JUnit tests in DemoFixturesAndAuthTest and DemoJourneyTest. They cover:
    • fixtures: synthetic emails and phones, no em dash, drift
    • auth: same answer for enrolled and unknown emails, single-use codes, 401s
    • cases: case idempotency
    • request journeys: create, submit, cancel (reason required), confirm, 403 and 409
    • resources paging, consents, logout
  • README: a "Demo modes" section.

Demo journey: sign in with the prefilled email and the shown code. Each need screen opens with that category's seeded request:

  • Transportation: MATCHING
  • Food: FULFILLED, ready to confirm
  • Shelter: CANCELLED
  • Peer Support: CREATED

New requests can be submitted, advanced with "Demo only: advance status", confirmed or cancelled. State lives in memory only (D-034).

Verification (Linux, JDK 25, Android SDK 37)

  • scripts/forbidden-capabilities.sh passes.
  • ./gradlew :app:testDebugUnitTest :app:lintDebug :app:assembleDebug :app:assembleRelease succeeds:
    • 39 unit tests pass, including the 17 new ones.
    • The 10 lint findings are all pre-existing dependency-version notes plus one existing UseKtx in CrisisNotice.kt.
  • aapt2 manifest dump:
    • debug APK: Root, Demo, Local and Main activities, plus the fixture
    • release APK: RootActivity only, no fixture
  • Not verified on a device. The emulator could not boot on this box: the nested /dev/kvm never brought the device online. So there are no screenshots and no manual UI pass. Danny or Louis should run the two launchers once on an emulator.

Easy demo sign-in (Danny, Oct 7 2026)

The demo accounts are now demo@example.invalid with code 123456 (open case, four seeded requests) and newvet@example.invalid with the same code (no case yet). Both copies of the fixture were refreshed from the Worker export in scrimshawlife-ctrl/suas#189. That PR also makes the LOCAL demo Worker issue 123456 to demo@example.invalid, so the Local launcher signs in without reading the code from the host. Other accounts still read their code from /api/v0/dev/last-challenge.

Verified after the change: ./gradlew :app:testDebugUnitTest :app:assembleDebug :app:assembleRelease passes, with 39 unit tests and the updated fixture and journey tests. scripts/forbidden-capabilities.sh passes.

Decisions (Danny, Oct 7 2026)

  1. Debug source set, no flavor. Demo mode stays in app/src/debug with the two debug launchers. No build flavor is added, so the CI task names are unchanged and release APKs contain neither the fixture nor the launchers.
  2. Seeded requests. Demo request screens open on the seeded request for their category, as implemented: Transportation MATCHING, Food FULFILLED, Shelter CANCELLED, Peer Support CREATED. The real client path is unchanged (ShellHooks.NONE).
  3. Fixture ownership. The Worker repo (suas) owns contract/demo-fixtures.json and generates it with npm run demo:fixtures. Both copies here (contract/ and app/src/debug/resources/demo/) come from that export. The README now says not to hand-edit them and explains how to refresh them.
  4. Chat stays "Unavailable" per spec. Rate-limit reset stays in the Worker's LOCAL demo seed only.
  5. Worker PR suas#187 is approved for merge. This PR stays draft and needs Danny's yes to merge.

Still unverified: there are no emulator screenshots, because nested KVM on the build box never brought a device online. Danny or Louis should run DemoRootActivity and LocalRootActivity once.

No em dashes in new copy. Code for this PR was generated by DeepSeek v4.1 Flash through the model router, then reviewed, integrated and tested. Small glue edits were made by hand. Draft only, please do not merge without Danny's yes.

Versioning and docs (Oct 7 2026)

  • versionName 1.0 to 0.1.0 (versionCode 1) and ClientPins.APPLICATION_VERSION 0.1.0. "1.0" wrongly implied a launch; SPEC-018 is blocked. Implements SUAS-specs 0.6.0.
  • New unit test ContractTest.applicationVersionMatchesGradleVersionName keeps the two in sync.
  • New CHANGELOG.md (Keep a Changelog), RELEASING.md, and .github/workflows/release.yml (on a pushed v*.*.* tag, creates a GitHub Release from the CHANGELOG section on the default branch; uploads no APK, publishes nothing).
  • README: Version section, staging status (suas 0f7aeae, manual worker-deploy, path-param check), and the API contract section now points at SUAS-specs instead of restating /api/v0.
  • Board: https://github.com/users/scrimshawlife-ctrl/projects/6

Tag after Danny approves the merge (not before):

cd suas-android && git checkout main && git pull
git tag -a v0.1.0 <merge-sha> -m "suas-android v0.1.0 (implements SUAS-specs 0.6.0)"
git push origin v0.1.0

Merge approval

Danny approved merging this PR on 2026-10-07 at 2:41 PM PT ("Merge suas #190, specs #43, Android #13 and iOS #10, then cut the tags"). Squash-merged after CI was green on the final head.

- SuasProductShell takes the API and ShellHooks; RootActivity passes the pinned
  STAGING client and ShellHooks.NONE, so release behavior is unchanged
- DemoRootActivity (debug): in-memory DemoSuasApi over contract/demo-fixtures.json
  captured from the LOCAL Worker; demo banner, sign-in hint, advance button
- LocalRootActivity (debug): real client against http://10.0.2.2:3000, LOCAL class
- 17 JUnit tests for the demo repository, including a fixture drift check
- README: demo modes, LOCAL Worker steps, checks
Fixture copies refreshed from the Worker export (suas#189). Local launcher
prefills demo@example.invalid and shows the fixed LOCAL code.
@scrimshawlife-ctrl
scrimshawlife-ctrl marked this pull request as ready for review October 7, 2026 21:47
@scrimshawlife-ctrl
scrimshawlife-ctrl merged commit ece7bef into main Oct 7, 2026
1 check passed
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-07T21:50:38.351152Z 6188c1e Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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