* Add google/foss product flavors (#461)
Introduce a `distribution` flavor dimension on `:app` with two flavors:
- `google` — the unchanged shipping build (Firebase/FCM/Crashlytics).
- `foss` — compiles with zero firebase-*/google-services/Play-Services
dependencies; google-services.json is not required to assemble it.
The google-services and firebase-crashlytics Gradle plugins are now applied
conditionally (skipped for a foss-only build, detected by requested task name),
and the Firebase deps are scoped to `googleImplementation`. The three runtime
seams get flavor-specific Koin bindings via a new `distributionModule`:
CrashReporter, AnonymousAuthClient/FcmTokenProvider/DeviceAuthTokenProvider, and
RenewalAuthProvider. The foss flavor binds NoOp/stub placeholders — real impls
land in #462-#464; #461 only needs both flavors to assemble.
Two direct FirebaseAuth call sites in shared `:app`/debug code
(IntegrationSetupViewModel, AddIntegrationDestination, TestCommandProvider) are
moved behind the seams so `main`/`debug`/`foss` compile Firebase-free.
The shared `:work` module keeps its Firebase types for now; only the FCM
`FcmReceiver` manifest entry moves to the google-flavor manifest so it is absent
from the foss build's merged manifest.
CI/task renames: assembleDebug -> assembleGoogle/FossDebug, testDebugUnitTest ->
testGoogleDebugUnitTest, release builds the google flavor only (dual-flavor
release is #465). Kover excludes the foss debug + flavored release test tasks.
Part of #460. Fixes#461.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Load flavor distributionModule in integration test harness
PR #461 moved CrashReporter, AnonymousAuthClient, FcmTokenProvider,
DeviceAuthTokenProvider, and RenewalAuthProvider out of the base appModule
into per-flavor distributionModule. RouseApplication registers both, but the
integration-test Koin bootstrap (AppIntegrationTestHarness.bootKoin) only
loaded appModule, so those five definitions were missing and every
com.rousecontext.app.integration.* test failed with NoDefinitionFoundException.
Add distributionModule (google variant on the integrationTest classpath) to
the startKoin module list, between appModule and the test overrides so any
harness fake still wins. Mirrors RouseApplication's base + distribution
composition.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* Fix stale variant-task references missed in the flavor rename (#461)
- docs/self-hosting.md: :app:compileDebugKotlin -> :app:compileGoogleDebugKotlin
- app/build.gradle.kts comment: testDebugUnitTest -> testGoogleDebugUnitTest
Flagged by reviewer on PR #466.
---------
Co-authored-by: Jason Monk <monkopedia@gmail.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Three changes to reduce per-turn and per-agent-launch context cost:
1. New `.claude/agent-preamble.md` — single source for agent-launch
boilerplate (don't touch .claude, use opus, branch/PR conventions,
relay deploy method, device targeting). Agent prompts can now
reference it instead of repeating ~15-20 lines per launch.
2. Trim `.claude/CLAUDE.md` from 73 to 51 lines — drop Architecture
and Module Boundaries sections that now live (and are kept current)
in `docs/design/overall.md` and `docs/design/android-app.md`. Keep
build commands, workflow pointers, code style, signing keystore
warning, domain.
3. New `docs/agent-quickstart.md` — distilled commands and paths
agents reach for repeatedly: module->path map, build/test recipes,
gh CLI patterns, adb-via-ssh patterns, gcloud relay ssh, common
file locations, common gotchas. Pre-loading saves grep-then-discover
cycles.
Net: ~22 lines off the per-turn auto-load (CLAUDE.md), ~15-20 lines
saved per agent launch (boilerplate consolidation), and the quickstart
removes a class of repeated discovery work.
Two gates to prevent reintroduction of the malformed-JSON bug class
that shipped in #417 (Outreach error helpers used a """{...}""" template
with raw exception text, producing unparseable bodies).
(A) Harness-level JSON parse assertion. Introduces shared
`McpToolTestHarness` (in `integrations/src/test/.../testing/`) that
wraps the duplicated mockk(Server) + addTool capture pattern previously
copy-pasted across `OutreachMcpProviderTest`, `UsageMcpProviderTest`,
`NotificationMcpToolExecutionTest`, and `NotificationMcpProviderToolsTest`.
Every `callTool(...)` invocation runs the result body through
`Json.parseToJsonElement`; parse failures throw with the offending tool
name and body content. Per-call `expectJsonBody = false` opt-out for
tools whose contract is plain text (currently only one test uses it,
referencing #427 which tracks the underlying core MCP DSL gap the
harness surfaced).
Regression test `McpToolTestHarnessTest` constructs fake tools that
return non-JSON bodies and asserts the harness throws with the tool
name + body in the message, plus a passing-case to lock down the
expectJsonBody opt-out.
(B) CI grep check. New `scripts/check-no-manual-json.sh` greps
`*/src/main/*.kt` for `"""\{` and fails the build on hits unless the
line carries a `// allow-manual-json: <reason>` marker, or matches the
explicit `AuditDetailScreen.kt` allowlist (Compose preview fixtures).
Wired into `.github/workflows/android-ci.yml` next to the existing
`check-zombie-screens.sh` step. Verified manually that the script
fires on a synthetic `"""{"x":"$bar"}"""` and clears once the marker
is added.
Documents the convention in new `docs/agent-quickstart.md`.
Co-authored-by: Claude Opus 4 (1M context) <noreply@anthropic.com>