rouse-context/.github/workflows
Jason Monk 0aa93f6ba8 Fix #136: Eliminate production runBlocking via reactive preferences
Replace the six synchronous DataStore reads that required runBlocking on
the main/Koin thread with suspending APIs and a live-snapshot holder.
This removes a long-standing violation of the project's coroutine rules
("test and main() only") and fixes the detail-screen staleness that
came from one-shot preference reads.

Changes:

- IntegrationStateStore, NotificationSettingsProvider, and
  IntegrationSettingsStore now expose suspend reads and
  Flow-returning observers; synchronous getters are gone.
- New PreferencesSnapshotHolder aggregates every UI-facing preference
  into a single StateFlow, collected WhileSubscribed via appScope.
  Compose and ViewModels read from .snapshot.value / observeX flows
  instead of blocking DataStore.
- IntegrationProviderRegistry caches enabled IDs in a StateFlow
  launched eagerly in appScope, preserving its synchronous
  ProviderRegistry contract for FCM and foreground-service callers.
- OutreachIntegration mirrors the DIRECT_LAUNCH toggle into a StateFlow
  so the canLaunchDirectly tool-call predicate stays non-suspending.
- DeviceRegistrationStatus starts false and transitions asynchronously
  once the cert store has been read.
- New OAuthHostnameProvider resolves the metadata hostname lazily in
  a suspend context; the McpSession starts with the "localhost"
  fallback that the Host header will override in real traffic.
- PerCallObserver.onToolCallRecorded is now suspend so
  PerToolCallNotifier can await NotificationSettingsProvider.settings().
- CI guardrail grep added to .github/workflows/ci.yml (lint job) that
  fails on any new production runBlocking. Commented KDoc references
  and the synchronous-API bridge in TlsAcceptor.kt (InputStream.read /
  OutputStream.write, non-suspending by java.io contract) are
  explicitly excluded.

Tests:

- New PreferencesSnapshotHolderTest exercises the snapshot flow.
- Existing store tests rewrap assertions in runBlocking (allowed in
  tests per project rules).
- MockK call sites for suspend methods migrated from every/verify
  to coEvery/coVerify as required.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 20:56:38 -04:00
..
android-ci.yml Add zombie-screen detector to CI and reviewer agent 2026-04-12 16:36:03 -04:00
ci.yml Fix #136: Eliminate production runBlocking via reactive preferences 2026-04-14 20:56:38 -04:00
relay-cert-renew.yml Use REPO_PAT for writing cert to GitHub Secrets 2026-04-05 12:19:02 -04:00
relay-ci.yml Add Android CI and Relay CI workflows 2026-04-05 19:46:36 -04:00
relay-deploy.yml Fix deploy: SCP to /tmp first, sudo move to /opt 2026-04-05 17:44:10 -04:00