// :session-core — pure reducers/state machines (SessionEngine, ReconnectMachine,
// PingScheduler, GateTracker, AwayDigest, UnreadLedger, KeyByteMap, TitleSanitizer,
// SessionEvent). Consumes TermTransport by interface only; runs entirely under
// runTest virtual time. Depends only on :wire-protocol.

plugins {
    alias(libs.plugins.kotlin.jvm)
    alias(libs.plugins.kotlin.serialization)
    alias(libs.plugins.kover)
}

kotlin {
    jvmToolchain(17)
}

dependencies {
    api(project(":wire-protocol"))
    implementation(libs.kotlinx.coroutines.core)

    // Fakes (FakeConnectionPinger, ...) + TestScope/virtual-time, exposed as `api` by
    // :test-support, so reducers can be driven under runTest without inventing a clock seam.
    testImplementation(project(":test-support"))
    testImplementation(libs.bundles.unit.test)
    testRuntimeOnly(libs.junit.platform.launcher)
}

tasks.test {
    useJUnitPlatform()
}

// A36 acceptance gate: >=80% line coverage on this pure module (plan §7).
kover {
    reports {
        verify {
            rule {
                minBound(80)
            }
        }
    }
}
