-keep class ai.revrag.embed.android.** { *; }
-keep class ai.revrag.embed.core.** { *; }
-keepclassmembers class ai.revrag.embed.** { *; }

# Shaded Ktor — bundled inside the AAR under a relocated package so consumers'
# Ktor versions cannot conflict with ours. R8 must keep the relocated classes
# AND their ServiceLoader entries (Ktor uses ServiceLoader for plugin discovery).
-keep class ai.revrag.shaded.ktor.** { *; }
-keepclassmembers class ai.revrag.shaded.ktor.** { *; }
-keepattributes RuntimeVisibleAnnotations, RuntimeInvisibleAnnotations, Signature, InnerClasses, EnclosingMethod

# Shaded Ktor references JVM-only debug/JMX classes that don't exist on Android.
# Ktor handles their absence gracefully at runtime via try/catch — silence R8.
-dontwarn java.lang.management.**
-dontwarn javax.management.**
-dontwarn org.slf4j.impl.**
# Ktor's CIO engine + tests reference Java NIO selectors not available on all
# Android API levels — also handled gracefully at runtime.
-dontwarn ai.revrag.shaded.ktor.network.selector.**
-dontwarn ai.revrag.shaded.ktor.utils.io.jvm.javaio.**

# ─── Compose semantics substrate (P0.5 / P0.6) ────────────────────────────────
# Action Intelligence reads the host's Compose semantics tree through typed API
# (ComposeSemanticsAccess), plus ONE guarded reflective fallback:
# AndroidComposeView.semanticsOwner via getDeclaredField.
#
# Reflection reaches names, and R8 rewrites names. Compose's own shipped
# proguard.txt keeps nothing here, so without these rules the fallback silently
# resolves to nothing in every minified release build — i.e. every production
# host — and the feature no-ops with no error. ViewRootForTest is also
# test-infrastructure API and a prime candidate for stripping.
-keep class androidx.compose.ui.platform.AndroidComposeView { *; }
-keep interface androidx.compose.ui.platform.ViewRootForTest { *; }
-keep class androidx.compose.ui.semantics.** { *; }

# ─── Pager detection (scroll container selection) ─────────────────────────────
# AndroidScrollerFactory.isPager identifies ViewPager/ViewPager2 BY CLASS NAME
# (they are not on this SDK's classpath and must not become dependencies just
# to be excluded from discovery scrolling). R8 renames classes it doesn't keep;
# a renamed pager passes the check, gets driven with scrollBy, and translates
# its canvas instead of paging — release-only visible corruption. -keepnames
# only pins the names (no shrinking impact), and R8 ignores rules for classes
# the host doesn't have.
-keepnames class androidx.viewpager2.widget.ViewPager2
-keepnames class androidx.viewpager.widget.ViewPager
