AutographProvider
Provides tracker to the composition via LocalTracker and wires application lifecycle events (foreground/background) into the tracker's session bookkeeping.
Pass autocapture to also report taps app-wide without instrumenting every element with trackClick — opt-in, since observing every tap is a meaningfully different privacy posture than explicit instrumentation. See AutocaptureConfig.
Pass scopeStack only in a hybrid app — one where part of the UI is Compose and part is native (UIKit/SwiftUI, or the Android View system) — and the native side runs its own capture pipeline. Both sides must then read and write the same stack: TrackedScreen and AutographScope push their frames into it here, and the native pipeline resolves a tap's screen and scope by reading it. Left null, this provider owns a private stack, which is correct for a Compose-only app but would leave the two sides attributing events against separate, half-empty contexts. Owning the stack outside the composition is also what lets it outlive a recomposition while still being replaceable on logout — scope it to the same lifetime as tracker.
Whatever content declares into that stack — every TrackedScreen and AutographScope — is ambient only while the composition's LocalLifecycleOwner is RESUMED: a ViewPager2 page moved off display, an Activity paused behind a prompt, or a Compose UIViewController after viewDidDisappear takes its declarations out of ScopeStack.current() and a resume brings them back, with nothing recomposed. Events resolved from an origin (autograph's own captures) are not gated by their own surface's demotion — a tap on a page peeking beside the current one still reads that page's declarations — though a demoted sibling composition on the same stack is off them exactly as it is ambiently; see ScopeStack.current(origin).