Find a file
Jason Monk 6d5b82cc20
Fix #227, #228: classify pre-onboarding as Skipped, check CT HTTP status (#229)
Two related bugs in the security-check pipeline that produced noisy
and misleading notifications for a freshly-installed device:

#227: HttpCtLogFetcher passed the response body straight to the JSON
parser without checking the HTTP status. crt.sh's transient 502/503
HTML error pages got surfaced as "Malformed CT log response" -- wording
that reads as "the CT log itself is corrupt" when the actual cause is
a Sectigo outage. Now throw IOException on non-2xx so CtLogMonitor
classifies as "Could not reach CT log service" instead.

#228: Pre-onboarding devices (no cert, no subdomain) fired "Security
Check" warning notifications describing a state that is just "not set
up yet." Introduce SecurityCheckResult.Skipped for "not applicable"
cases and route it through the worker without firing a notification.
The Settings screen renders "Waiting for onboarding" in muted colours
so the audit trail is still visible for users who look.

Constraints preserved:
- Alert path unchanged -- real issuer mismatches still fire loudly.
- Genuine network / I/O failures still produce Warning notifications.
- Only pre-onboarding classifications were reclassified to Skipped.

Closes #227
Closes #228

Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>
2026-04-18 06:24:34 -04:00
.claude Add zombie-screen detector to CI and reviewer agent 2026-04-12 16:36:03 -04:00
.github Fix #215: Render relay env + firebase-sa from GH secrets at deploy time (#219) 2026-04-17 19:39:41 -04:00
.signing Fix #205: move release keystore passwords to env/.properties file 2026-04-17 14:36:01 -04:00
api Show the actual AI client name in outreach launch notifications 2026-04-16 16:35:06 -04:00
app Fix #227, #228: classify pre-onboarding as Skipped, check CT HTTP status (#229) 2026-04-18 06:24:34 -04:00
config/detekt Add Compose screens with mock data, Roborazzi screenshot tests, and HTML dashboard 2026-04-04 16:50:39 -04:00
core Fix #227, #228: classify pre-onboarding as Skipped, check CT HTTP status (#229) 2026-04-18 06:24:34 -04:00
deploy Fix systemd unit: ReadWritePaths for device CA, positional config arg 2026-04-06 13:34:40 -04:00
device-tests Fix #18: Update Gradle wrapper and dependencies to latest stable 2026-04-11 17:36:46 -04:00
docs Fix #215: Render relay env + firebase-sa from GH secrets at deploy time (#219) 2026-04-17 19:39:41 -04:00
e2e Fix e2e IntegrationToolsTest for #189 session-id routing 2026-04-17 18:20:34 -04:00
gradle Fix #145 (phase 3): Bump library deps to latest stable 2026-04-14 22:56:19 -04:00
integrations Fix #214: Trim tools/list descriptions and schemas (#220) 2026-04-17 19:29:11 -04:00
notifications Show the actual AI client name in outreach launch notifications 2026-04-16 16:35:06 -04:00
relay Fix #216: flaky rotate_secret_cache_rejects_secrets_not_in_list (#218) 2026-04-17 19:51:33 -04:00
scripts Fix #215: Render relay env + firebase-sa from GH secrets at deploy time (#219) 2026-04-17 19:39:41 -04:00
work Fix #227, #228: classify pre-onboarding as Skipped, check CT HTTP status (#229) 2026-04-18 06:24:34 -04:00
.editorconfig Add Compose screens with mock data, Roborazzi screenshot tests, and HTML dashboard 2026-04-04 16:50:39 -04:00
.gitignore Fix #205: move release keystore passwords to env/.properties file 2026-04-17 14:36:01 -04:00
BLOCKERS.md Configure mTLS client cert for relay WebSocket connection 2026-04-05 19:58:55 -04:00
build.gradle.kts Add Firebase: google-services.json, Google Services plugin, debug applicationIdSuffix 2026-04-05 15:38:40 -04:00
gradle.properties Initial project scaffold: multi-module Android/Kotlin Gradle project 2026-04-03 19:38:30 -04:00
gradlew Initial project scaffold: multi-module Android/Kotlin Gradle project 2026-04-03 19:38:30 -04:00
gradlew.bat Initial project scaffold: multi-module Android/Kotlin Gradle project 2026-04-03 19:38:30 -04:00
last_session Merge T-1 interfaces: TunnelState, TunnelError, CertificateStore, TunnelClient (KMP) 2026-04-05 07:25:50 -04:00
LICENSE Initial commit 2026-04-03 19:35:18 -04:00
README.md Fix #124: Wire :integrations, drop old modules 2026-04-14 21:45:10 -04:00
settings.gradle.kts Fix #124: Wire :integrations, drop old modules 2026-04-14 21:45:10 -04:00

Rouse Context

Your phone has context that AI doesn't — your health data, your notifications, your app usage. Rouse Context makes that context available to AI assistants on demand, without ever syncing your data to the cloud.

It's an Android app that turns your phone into an MCP server. AI clients like Claude connect to a URL, your phone wakes up, and a direct encrypted session is established. The AI asks for what it needs, your phone responds, and then it goes back to sleep. Your data never leaves your device except through that live session.

Status: Active development. The core e2e flow works — Claude can connect, wake the phone, authorize via OAuth, and call MCP tools. Health Connect, Notifications, Outreach, and Usage Stats integrations are implemented. See docs/design/ for detailed design documents.

How It Works

AI Client ──TLS──> Relay (SNI passthrough) ──mux WebSocket (mTLS)──> Your Phone
  1. You enable an integration (e.g. Health Connect) and get a URL like https://brave-falcon.abc123.rousecontext.com/health/mcp
  2. Add that URL to Claude, Cursor, or any MCP client
  3. When the client connects, the relay wakes your phone via FCM push
  4. Your phone connects back through a mTLS WebSocket, and the relay splices the two TLS streams together
  5. The AI client talks directly to your phone over end-to-end encrypted TLS — the relay never sees the plaintext

Sessions are ephemeral. The phone goes back to sleep when the client disconnects.

Integrations

Integration What it exposes
Health Connect Step count, heart rate, sleep, HRV, workout history
Notifications Active and historical device notifications
Outreach Send messages, make calls, toggle DND
Usage Stats App usage patterns and screen time

Each integration is independently enabled and gets its own MCP endpoint with OAuth authorization (PKCE).

Architecture

Android App

Module Purpose
:app Compose UI, Koin DI, navigation, theming
:core:tunnel Mux protocol, WebSocket client, TLS accept, CertificateStore
:core:mcp MCP session routing, HTTP server, OAuth (device code + auth code + PKCE), token management
:core:bridge Bridges tunnel mux streams to MCP sessions via TLS
:api McpIntegration interface, IntegrationStateStore
:integrations MCP providers: Health Connect, outreach (calls/SMS/DND), usage stats, notification capture
:notifications Cross-cutting notification infrastructure, audit persistence (Room)
:work Foreground service, FCM receiver, WorkManager

Relay Server (relay/)

Rust binary on a small VPS. Handles:

  • TLS passthrough — routes AI client connections to devices via SNI, never terminates inner TLS
  • Mux WebSocket — multiplexes multiple client sessions over one device connection
  • FCM wakeup — sends push notifications to wake sleeping devices
  • ACME certs — issues wildcard TLS certs per device via Let's Encrypt DNS-01 (Cloudflare API)
  • Bot protection — secret URL prefix validated before waking device, plus FCM throttle and IP rate limiting

Security

  • End-to-end encrypted — TLS terminates on your phone. The relay does SNI passthrough only.
  • No cloud sync — data is read from on-device sources and served live. Nothing stored remotely.
  • Per-device ACME certs — wildcard certs via Let's Encrypt, private key in Android Keystore (hardware-backed).
  • mTLS device auth — relay authenticates the device by client certificate before allowing connections.
  • Secret URL prefix — each device URL includes a rotatable secret (brave-falcon.abc123.rousecontext.com). Bots that discover the device subdomain can't wake it without the secret.
  • OAuth per-client — each AI client must be authorized via on-device approval before accessing tools.
  • Audit trail — every tool invocation is logged locally with arguments, response, and duration.

Building

Android

./gradlew assembleDebug

Requires Android SDK (API 35) and JDK 17+.

Relay

cd relay
cargo build --release

Status

Active development. The core flow works end-to-end: Claude can connect, wake the phone, authorize via OAuth, and call MCP tools. See docs/design/ for detailed design documents.

License

Licensed under the Apache License, Version 2.0. See LICENSE for details.