Skip to content

Commit 65320ab

Browse files
jamesarichclaude
andauthored
build: drop compiler flags and opt-ins made redundant by Kotlin 2.4 (#5786)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 parent 47134f4 commit 65320ab

11 files changed

Lines changed: 14 additions & 28 deletions

File tree

.agent_memory/session_context.archive.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Agent Session Context — ARCHIVE
22
# Older handover entries rotated out of session_context.md. Not read by default.
33
# Consult only if you need historical detail on a specific past change.
4+
## 2026-05-21 — Upgraded Chirpy to a fully-personalized Live Diagnostic Node & Mesh Assistant
5+
- Integrated `NodeRepository` into `GeminiNanoDocAssistant.kt` and the Google AI Koin dependency injection module (`GoogleAiModule.kt`).
6+
- Developed a dynamic live-state prompt formatting block within `buildPrompt(...)` that queries current hardware model, firmware version, connection status, GPS capability, channel utilization, airtime, battery level/voltage, user profile long/short names, and total registered mesh peer counts & active online peers directly from `NodeRepository`'s reactive flows.
7+
- Injected this live radio diagnostics context dynamically as a system instruction metadata block on every user query. This empowers the on-device model to answer real-time, personalized diagnostic questions (e.g. "what is my battery level?", "how many active nodes are on my mesh right now?") with 100% on-device offline accuracy.
8+
- Tuned context retrieval constraints for the modern `nano-v4-full` (Gemini Nano v4) model: expanded the total context budget `MAX_CONTEXT_CHARS` from 8,000 to **32,000 characters** (up to ~12K tokens out of the model's native 32K window), and scaled `MAX_PAGE_CHARS` to **16,000 characters** and `MAX_SNIPPET_CHARS` to **8,000 characters** to supply vastly richer, more detailed, and complete documentation fragments.
9+
410

511
## 2026-05-21 — Activated full on-device token streaming and polished Chirpy's personality instructions
612
- Upgraded the on-device inference flow inside `GeminiNanoDocAssistant.kt` to use Firebase AI SDK's reactive `generateContentStream(prompt)` instead of the blocking `generateContent` invocation.

.agent_memory/session_context.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@
66
# the oldest entries to `session_context.archive.md` (not read by default). The
77
# "Golden Context" block at the bottom is stable across sessions; keep it here.
88

9+
## 2026-06-12 — Kotlin 2.4 flag/opt-in cleanup (PR #5786)
10+
- Kotlin 2.4.0 toolchain landed on main via Renovate #5760 (kotlin 2.4.0, mokkery 3.4.1, koin-plugin 1.0.1) + kable 0.43.1 (#5750).
11+
- PR #5786 (branch claude/modest-carson-f0c5c6) removes what 2.4 made redundant: build-logic SHARED_COMPILER_ARGS drops `-opt-in=kotlin.uuid.ExperimentalUuidApi` (Uuid.random/parse stable; only generateV4/V7 still experimental, unused), `-opt-in=kotlin.time.ExperimentalTime` (Clock/Instant stable since 2.3, no still-experimental time API used), `-Xcontext-parameters` (stable), `-Xannotation-default-target=param-property` (compiler reported redundant, ~34 warnings/build); ComposeCompilerConfiguration drops deprecated `ComposeFeatureFlag.OptimizeNonSkippingGroups` (default behavior, flag removed in Kotlin 2.6). Also stripped per-file @OptIn(ExperimentalUuidApi) from 7 files.
12+
- Verified twice with full baseline + kmpSmokeCompile (1706 tasks, 2756 tests, 0 failures); no warnings referencing removed flags, no new annotation-target warnings.
13+
- Remaining 2.4 adoption candidates (not in this PR): explicit backing fields for the ~96 `_state`/`asStateFlow` pairs (wait for IDE 2026.1.4 support), `@IntroducedAt` for meshtastic-sdk binary compat, Swift export alpha for the iOS goal. Also still TODO: drop kotlin<2.4 renovate holds in MQTTastic + protobufs.
14+
915
## 2026-06-12 — Fixed flaky NodeTest.isOnline_usesStrictThresholdBoundary (wall-clock race)
1016
- PR #5779 (targeting main): the test read the clock twice — `onlineTimeThreshold()` once for its expected value, then again inside the `isOnline` getter; a one-second wall-clock tick between reads turned the strict-boundary assertion into `N+1 > N+1` = false. Seen failing on loaded CI in #5760's shard-core (jvm + androidHostTest).
1117
- Fix: internal `Node.isOnline(threshold: Int)` overload; the public `isOnline` property delegates to it. Test pins one threshold for both construction and check, keeping the strict `>` boundary assertion (no slop widening).
@@ -30,11 +36,6 @@
3036
- Made teardown resilient with `if (::manager.isInitialized) manager.close()` so setup/early failures do not cascade into teardown crashes.
3137
- Verified with `:core:database:jvmTest --tests "org.meshtastic.core.database.DatabaseManagerWithDbRetryTest*"` and repeated it 5 consecutive runs without failures; `:core:database:detekt` also passed.
3238

33-
## 2026-05-21 — Upgraded Chirpy to a fully-personalized Live Diagnostic Node & Mesh Assistant
34-
- Integrated `NodeRepository` into `GeminiNanoDocAssistant.kt` and the Google AI Koin dependency injection module (`GoogleAiModule.kt`).
35-
- Developed a dynamic live-state prompt formatting block within `buildPrompt(...)` that queries current hardware model, firmware version, connection status, GPS capability, channel utilization, airtime, battery level/voltage, user profile long/short names, and total registered mesh peer counts & active online peers directly from `NodeRepository`'s reactive flows.
36-
- Injected this live radio diagnostics context dynamically as a system instruction metadata block on every user query. This empowers the on-device model to answer real-time, personalized diagnostic questions (e.g. "what is my battery level?", "how many active nodes are on my mesh right now?") with 100% on-device offline accuracy.
37-
- Tuned context retrieval constraints for the modern `nano-v4-full` (Gemini Nano v4) model: expanded the total context budget `MAX_CONTEXT_CHARS` from 8,000 to **32,000 characters** (up to ~12K tokens out of the model's native 32K window), and scaled `MAX_PAGE_CHARS` to **16,000 characters** and `MAX_SNIPPET_CHARS` to **8,000 characters** to supply vastly richer, more detailed, and complete documentation fragments.
3839

3940
## Golden Context (stable across sessions)
4041
- Always check `.skills/compose-ui/strings-index.txt` before reading `strings.xml`.

build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/ComposeCompilerConfiguration.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import org.gradle.api.Project
2020
import org.gradle.api.provider.Provider
2121
import org.gradle.kotlin.dsl.configure
2222
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeCompilerGradlePluginExtension
23-
import org.jetbrains.kotlin.compose.compiler.gradle.ComposeFeatureFlag
2423

2524
internal fun Project.configureComposeCompiler() {
2625
extensions.configure<ComposeCompilerGradlePluginExtension> {
@@ -40,6 +39,5 @@ internal fun Project.configureComposeCompiler() {
4039
.relativeToRootProject("compose-reports")
4140
.let(reportsDestination::set)
4241
stabilityConfigurationFiles.add(isolated.rootProject.projectDirectory.file("compose_compiler_config.conf"))
43-
featureFlags.add(ComposeFeatureFlag.OptimizeNonSkippingGroups)
4442
}
4543
}

build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/KotlinAndroid.kt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,7 @@ private val PUBLISHED_MODULES = setOf("api", "model", "proto")
228228
/** Compiler args shared across all Kotlin targets (JVM, Android, iOS, etc.). */
229229
private val SHARED_COMPILER_ARGS =
230230
listOf(
231-
"-opt-in=kotlin.uuid.ExperimentalUuidApi",
232-
"-opt-in=kotlin.time.ExperimentalTime",
233231
"-Xexpect-actual-classes",
234-
"-Xcontext-parameters",
235-
"-Xannotation-default-target=param-property",
236232
"-Xskip-prerelease-check",
237233
"-Xbackend-threads=0",
238234
)

core/datastore/src/commonTest/kotlin/org/meshtastic/core/datastore/RecentAddressesDataSourceTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,8 @@ import kotlin.test.Test
3939
import kotlin.test.assertEquals
4040
import kotlin.test.assertFalse
4141
import kotlin.test.assertTrue
42-
import kotlin.uuid.ExperimentalUuidApi
4342
import kotlin.uuid.Uuid
4443

45-
@OptIn(ExperimentalUuidApi::class)
4644
class RecentAddressesDataSourceTest {
4745
private lateinit var tmpDir: Path
4846
private lateinit var dataSource: RecentAddressesDataSource

core/prefs/src/commonTest/kotlin/org/meshtastic/core/prefs/filter/FilterPrefsTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,8 @@ import kotlin.test.Test
3232
import kotlin.test.assertEquals
3333
import kotlin.test.assertFalse
3434
import kotlin.test.assertTrue
35-
import kotlin.uuid.ExperimentalUuidApi
3635
import kotlin.uuid.Uuid
3736

38-
@OptIn(ExperimentalUuidApi::class)
3937
class FilterPrefsTest {
4038
private lateinit var tmpDir: Path
4139

core/prefs/src/commonTest/kotlin/org/meshtastic/core/prefs/notification/NotificationPrefsTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@ import kotlin.test.BeforeTest
3131
import kotlin.test.Test
3232
import kotlin.test.assertFalse
3333
import kotlin.test.assertTrue
34-
import kotlin.uuid.ExperimentalUuidApi
3534
import kotlin.uuid.Uuid
3635

37-
@OptIn(ExperimentalUuidApi::class)
3836
class NotificationPrefsTest {
3937
private lateinit var tmpDir: Path
4038

core/prefs/src/commonTest/kotlin/org/meshtastic/core/prefs/tak/TakPrefsTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,8 @@ import kotlin.test.BeforeTest
3131
import kotlin.test.Test
3232
import kotlin.test.assertFalse
3333
import kotlin.test.assertTrue
34-
import kotlin.uuid.ExperimentalUuidApi
3534
import kotlin.uuid.Uuid
3635

37-
@OptIn(ExperimentalUuidApi::class)
3836
class TakPrefsTest {
3937
private lateinit var tmpDir: Path
4038

core/prefs/src/commonTest/kotlin/org/meshtastic/core/prefs/ui/NodeListLayoutPrefsTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,8 @@ import kotlin.test.Test
3232
import kotlin.test.assertEquals
3333
import kotlin.test.assertFalse
3434
import kotlin.test.assertTrue
35-
import kotlin.uuid.ExperimentalUuidApi
3635
import kotlin.uuid.Uuid
3736

38-
@OptIn(ExperimentalUuidApi::class)
3937
class NodeListLayoutPrefsTest {
4038
private lateinit var tmpDir: Path
4139
private lateinit var dataStore: DataStore<Preferences>

feature/connections/src/commonMain/kotlin/org/meshtastic/feature/connections/ui/ConnectionsScreen.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ import org.meshtastic.feature.settings.navigation.ConfigRoute
8181
import org.meshtastic.feature.settings.navigation.getNavRouteFrom
8282
import org.meshtastic.feature.settings.radio.RadioConfigViewModel
8383
import org.meshtastic.feature.settings.radio.component.PacketResponseStateDialog
84-
import kotlin.uuid.ExperimentalUuidApi
8584

8685
/**
8786
* Fixed minimum height for the "connected device" card at the top of the Connections screen. Shared across the three UI
@@ -91,7 +90,7 @@ import kotlin.uuid.ExperimentalUuidApi
9190
private val CardMinHeight = 100.dp
9291

9392
/** Composable screen for managing device connections (BLE, TCP, USB). It displays connection status. */
94-
@OptIn(ExperimentalMaterial3Api::class, ExperimentalUuidApi::class)
93+
@OptIn(ExperimentalMaterial3Api::class)
9594
@Suppress("CyclomaticComplexMethod", "LongMethod", "MagicNumber", "ModifierMissing", "ComposableParamOrder")
9695
@Composable
9796
fun ConnectionsScreen(

0 commit comments

Comments
 (0)