|
| 1 | +# Agent Session Context — ARCHIVE |
| 2 | +# Older handover entries rotated out of session_context.md. Not read by default. |
| 3 | +# Consult only if you need historical detail on a specific past change. |
| 4 | + |
| 5 | +## 2026-05-21 — Fixed Chirpy Assistant invalid model name and enhanced failure fallback suggestions |
| 6 | +- Fixed a 404/Unknown inference error by updating `GeminiNanoDocAssistant.kt`'s `MODEL_NAME` from `"gemini-3.1-flash-lite"` to the correct Firebase AI Logic preview name `"gemini-3.1-flash-lite-preview"`. |
| 7 | +- Overhauled multi-turn hybrid chat seeding: eliminated the redundant background `chat.sendMessage` call on the first turn; if the first turn is answered on-device, the session caches the Q&A locally and seeds the subsequent cloud-chat session via `startChat(history = ...)`. |
| 8 | +- Expanded the hybrid model's `looksLikeNoAnswer` heuristics to better detect on-device failure and fall back to the grounded cloud model. |
| 9 | +- Programmed a smart UI fallback: on inference error (offline, rate limit, model not found), Chirpy displays local keyword search results as recommended page chips. |
| 10 | +- Verified 100% compliance with Spotless, Detekt, and unit tests (`:feature:docs:allTests` and `:androidApp:testGoogleDebugUnitTest`). |
| 11 | + |
| 12 | +## 2026-05-20 — Decoupled and Isolated Flatpak manifest generation logic to build-logic/flatpak |
| 13 | +- Isolated the optimized `GenerateFlatpakSourcesTask` from monolithic `build-logic/convention` into its own specialized, lightweight `:flatpak` subproject under `build-logic`. |
| 14 | +- Created `:flatpak` configuration and registered the formal plugin ID `"meshtastic.flatpak"` implemented by `FlatpakConventionPlugin` inside the default package namespace. |
| 15 | +- Implemented modern, configuration-cache-safe lazy provider directory evaluation for the default Gradle user home cache. |
| 16 | +- Cleaned up `:convention` by removing the redundant class and registration imports from `RootConventionPlugin.kt`. |
| 17 | +- Applied the new plugin in the root `build.gradle.kts` using `id("meshtastic.flatpak")`. |
| 18 | +- Verified 100% compliant spotless and detekt formatting checks. |
| 19 | +- Pushed branch `fix/flatpak-snapshot-resolution`; updated PR #5542's description. |
| 20 | + |
| 21 | +## 2026-05-20 — Extracted GenerateFlatpakSourcesTask to precompiled build-logic convention plugin |
| 22 | +- Extracted the entire task logic, data classes, and extension helpers from loose script files to a precompiled Kotlin class: `build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/GenerateFlatpakSourcesTask.kt`. |
| 23 | +- Registered the task directly within `RootConventionPlugin.kt` and removed the legacy `gradle/flatpak.gradle.kts` script block from the root `build.gradle.kts`. |
| 24 | +- Resolved an implicit Gradle non-serializable property capture inside the lazy property mappings for full Configuration Cache compliance. |
| 25 | +- Validated with `./gradlew clean` and `./gradlew spotlessCheck detekt` (100% green). |
| 26 | + |
| 27 | +## 2026-05-20 — Optimized GenerateFlatpakSourcesTask for performance and correctness |
| 28 | +- Implemented single-pass Maven metadata XML pre-indexing (O(1) lookups) and deferred SHA-256 calculation (digests only on deduplicated, finalized resources). |
| 29 | +- Refactored loose maps into strongly-typed data classes (`SnapshotVersion`, `SnapshotMetadata`, `FlatpakSourceCandidate`). |
| 30 | +- Verified output is character-for-character identical to the original unoptimized `flatpak-sources.json`. |
| 31 | +- Passed `./gradlew spotlessCheck detekt`. |
| 32 | + |
| 33 | +## 2026-05-20 — Implemented dynamic Gradle cache SNAPSHOT metadata resolution for Flatpak offline builds |
| 34 | +- Overhauled `GenerateFlatpakSourcesTask` to identify `-SNAPSHOT` dependencies, parse local cached `maven-metadata.xml` in `resources-2.1`, and map them to remote timestamped snapshot URLs while preserving non-timestamped filenames as `dest-filename`. |
| 35 | +- Created a pure JDK XML parser for the `<snapshotVersions>` block. |
| 36 | +- Verified snapshot deps (e.g. `org.meshtastic:takpacket-sdk-jvm:0.2.4-SNAPSHOT`) map correctly. Passed spotless/detekt. |
| 37 | + |
| 38 | +## 2026-05-20 — Resolved Flatpak jitpack.io dependency download 404s in sandboxed offline builds |
| 39 | +- Modified the task to detect `com.github.` groups (JitPack-hosted) and resolve `primaryUrl` from `https://jitpack.io` with high-availability fallback lists. |
| 40 | +- Verified a valid 10MB `flatpak-sources.json` with correct JitPack URLs. Passed spotless/detekt. |
| 41 | + |
| 42 | +## 2026-05-20 — Replaced standalone translations landing page with dynamic global header language switcher dropdown |
| 43 | +- Deleted `docs/en/translations.md`; updated `docs/README.md`. |
| 44 | +- Re-engineered `docs/_includes/language_switcher.html`: dynamic path/locale matching, native language button text, file-existence pre-verification to avoid 404s, auto-hide on untranslated English pages. |
| 45 | +- Adjusted CSS in `docs/_includes/head_custom.html` (`right: 0; left: auto;`) to prevent dropdown overflow. |
| 46 | +- Verified live in browser. Passed docs bundle + spotless/detekt. |
| 47 | + |
| 48 | +## 2026-05-20 — Fixed Jekyll documentation site left navigation nesting and sub-page visibility |
| 49 | +- Cleaned up dynamic default scope parent settings in `docs/_config.yml`. |
| 50 | +- Added explicit `parent:` front-matter to 17 user-guide and 9 developer-guide English markdown files. |
| 51 | +- Verified docs bundle compilation (672 pages), spotless/detekt, and `assembleDebug`. |
| 52 | + |
| 53 | +## 2026-05-20 — Completely overhauled, simplified, and pushed Flatpak offline source automation |
| 54 | +- Retired the third-party `flatpak-gradle-generator` plugin (~150 lines of boilerplate). |
| 55 | +- Implemented native JVM Gradle task `GenerateFlatpakSourcesTask` in `gradle/flatpak.gradle.kts` walking the post-compilation Gradle cache to emit a sorted, deduplicated `flatpak-sources.json` in <3s. |
| 56 | +- Integrated high-availability mirror URLs (Google, Gradle Plugin Portal, GCP Maven Central, Aliyun). |
| 57 | +- Updated CI `release.yml` and `reusable-check.yml`. Passed spotless/detekt. Pushed `fix/flatpak-sources-automation`; updated PR #5533. |
| 58 | + |
| 59 | +## 2026-05-20 — Rebased Flatpak Optimization Branch onto upstream/main |
| 60 | +- Rebased `fix/flatpak-sources-automation` onto latest `origin/main`, preserving the unique conflict-bypass override and skipping squash-merged commits. |
| 61 | +- Updated submodules. Re-ran spotless/detekt. Verified `:combineFlatpakSources` produces 2,339 unique resources. |
| 62 | + |
| 63 | +## 2026-05-20 — Overhauled and Bulletproofed Flatpak Source Generation |
| 64 | +- Streamlined `build-logic/convention/build.gradle.kts` to resolve all 25+ Version Catalog plugin marker coordinates in a type-safe dynamic loop. |
| 65 | +- Replaced hardcoded Kotlin compiler version with `KotlinVersion.CURRENT.toString()`. |
| 66 | +- Implemented root `:combineFlatpakSources` (JVM-native JSON), deduplicating 2222 entries and injecting Google/Aliyun `mirror-urls`. |
| 67 | +- Verified spotless/detekt and fully offline builds (`--offline`). |
| 68 | + |
| 69 | +## 2026-05-20 — Refactored and polished Flatpak dependency manifests to modern Gradle standards |
| 70 | +- Centralized version definitions to the `libs.versions` catalog; documented every override with `// why:` comments; streamlined `core:database` to capture only `kspKotlinJvmProcessorClasspath`; used type-safe `setOf` for `includeConfigurations`. |
| 71 | +- Verified spotless/detekt and offline UberJar packaging. |
| 72 | + |
| 73 | +## 2026-05-20 — Fixed Jekyll documentation site build and deployment in CI |
| 74 | +- Added `docs/index.html` redirect (`/` → `/en/`). |
| 75 | +- Updated `docs-deploy.yml` and `docs-release.yml` to compile Jekyll with `--baseurl` and Ruby 4.0.4, assembling versioned + root sites with Dokka HTML. |
| 76 | +- Verified docs bundle tasks and redirect output. |
| 77 | + |
| 78 | +## 2026-05-20 — Optimized slow Flatpak CI jobs |
| 79 | +- Restrained `flatpakGradleGenerator` to the `runtimeClasspath` configuration in desktopApp and build-logic:convention only. |
| 80 | +- Updated `release.yml`/`reusable-check.yml` to invoke targeted tasks instead of root+all-subprojects. |
| 81 | +- Removed the plugin from root and other subprojects (`core:ble/common/database/model/navigation/proto`, `feature:messaging`), deleting unused `flatpakKmpAndroidMeta`. |
| 82 | +- Runtime dropped 46s → 12s; spotless/detekt green. |
| 83 | + |
| 84 | +## 2026-05-12 — Implemented Apple alignment for docs feature (FR-038) |
| 85 | +- Branch: `feat/20260507-161858-app-docs-markdown`. Implemented 4 alignment items vs `meshtastic-apple`: |
| 86 | + 1. Per-page TOC icons via `DocPageIconResolver.kt` mapping `iconId` to `MeshtasticIcons`. |
| 87 | + 2. New `docs/user/signal-meter.md` (RSSI vs SNR). |
| 88 | + 3. New `docs/user/units-and-locale.md` (metric/imperial via `MetricFormatter`). |
| 89 | + 4. New `.github/workflows/docs-staleness.yml` (advisory PR comments). |
| 90 | +- Added `iconId: String?` to `DocPage`/`KeywordIndexEntry`; updated `DocBundleLoader` (24 pages + 2 new) and `DocsBrowserScreen`. |
| 91 | +- Marked T061-T085, T200-T206 complete. Skipped Apple-only features. Verified spotless/detekt/assembleDebug/compileKotlinJvm. |
| 92 | + |
| 93 | +## 2026-05-11 — Migrated feature/intro UI to commonMain |
| 94 | +- Moved intro onboarding composables + nav graph from `androidMain` to `commonMain`, adding shared `IntroPermissions`/`IntroSettingsNavigator` interfaces and a common `introGraph`. |
| 95 | +- Refactored `AppIntroductionScreen` into a thin Android host providing permission/settings adapters via composition locals; added Android adapters and JVM no-op stubs. |
| 96 | +- Verified `:feature:intro:compileKotlinJvm` + `:feature:intro:compileAndroidMain`. |
| 97 | + |
| 98 | +## 2026-05-11 — Added Esp32OtaUpdateHandler common tests |
| 99 | +- Created `Esp32OtaUpdateHandlerTest.kt`; covered WiFi OTA success, progress reporting, connection-drop, hash rejection, verification timeout, cancellation. (No Gradle run per instruction.) |
| 100 | + |
| 101 | +## 2026-05-11 — Added profile import/export round-trip coverage |
| 102 | +- Created `ProfileRoundTripTest.kt`; covered `exportProfile()`→`importProfile()` round trips via real use cases with an in-memory `FileService`. Representative/empty/partial `DeviceProfile` cases. (No Gradle run per instruction.) |
| 103 | + |
| 104 | +## 2026-05-11 — Added DirectRadioControllerImpl common tests |
| 105 | +- Created `DirectRadioControllerImplTest.kt`; covered flow delegation, send message/shared contact, remote config request, location stop, device address updates. |
| 106 | +- Note: `:core:service:allTests` blocked by pre-existing compile failures in `core/network` (`MQTTRepositoryImpl` unresolved `KEEPALIVE_SECONDS`) and downstream `core/data`. |
| 107 | + |
| 108 | +## 2026-05-11 — Added DatabaseManager withDb retry host test |
| 109 | +- Created `DatabaseManagerWithDbRetryTest.kt`; covered the concurrent `withDb()` retry path (pause in-flight query, switch DB, close old pool, assert retry succeeds). |
| 110 | +- Verified with `:core:database:testAndroidHostTest`. |
| 111 | + |
| 112 | +## 2026-05-11 — Expanded MQTT repository coverage |
| 113 | +- Extended `MQTTRepositoryImplTest.kt` with topic construction, JSON/protobuf decoding, reconnect/subscription retry, connection-state coverage. |
| 114 | +- Added internal `MqttClientSession`/`MqttClientSetup` hook + `updateConnectionState()`. Verified `:core:network:allTests`. |
| 115 | + |
| 116 | +## 2026-05-11 — Added RadioConfigViewModel MQTT probe tests |
| 117 | +- Extended `RadioConfigViewModelTest.kt` with MQTT probe success, timeout, thrown-exception-to-Other, clear/reset. Verified `:feature:settings:jvmTest`. |
| 118 | + |
| 119 | +## 2026-05-11 — Added MeshRouterImpl accessor routing tests |
| 120 | +- Created `MeshRouterImplTest.kt`; covered lazy routing access for send/request/admin, traceroute handler, service-action passthrough. Verified `:core:data:allTests`. |
| 121 | + |
| 122 | +## 2026-05-11 — Added SettingsViewModel saveDataCsv coverage |
| 123 | +- Extended `SettingsViewModelTest.kt` with filtered-CSV export test (Fake repos + Mokkery `FileService.write()` capture, real `ExportDataUseCase`). Verified `:feature:settings:jvmTest`. |
| 124 | + |
| 125 | +## 2026-05-11 — Added CompassViewModel accuracy edge-case tests |
| 126 | +- Extended `CompassViewModelTest.kt` with PDOP-only, HDOP+VDOP, HDOP-only, precision-bits fallback, missing-accuracy, zero/small-distance angular error. |
| 127 | +- Note: `:feature:node:allTests` still fails on pre-existing `MetricsViewModelTest` Turbine timeout; new tests pass. |
| 128 | + |
| 129 | +## 2026-05-11 — Added Node domain model tests |
| 130 | +- Created `NodeTest.kt`; covered `isOnline`, `distance`, `bearing`, `colors`, `createFallback`, `getRelayNode`, `isUnknownUser`, `validPosition`, `hasPKC`, `mismatchKey`. |
| 131 | +- Blockers: `:core:model:allTests` fails on pre-existing `DataPacketTest` iOS compile errors; direct run hits a class-version mismatch in `core:common`. |
| 132 | + |
| 133 | +## 2026-05-11 — Added HeartbeatSender transport tests |
| 134 | +- Created `HeartbeatSenderTest.kt`; covered encoded payloads, nonce sequencing, interval scheduling, cancellation, zero-interval, restart (coroutine virtual time). Verified `:core:network:allTests`. |
| 135 | + |
| 136 | +## 2026-05-11 — Added BaseMapViewModel waypoint expiration tests |
| 137 | +- Extended `BaseMapViewModelTest.kt` with future, boundary (`expire == now`), never-expiring (`expire == 0`), mixed filtering. Verified `:feature:map:allTests`. |
| 138 | + |
| 139 | +## 2026-05-03 — Switched Gradle GC to G1GC |
| 140 | +- Replaced `-XX:+UseZGC` with `-XX:+UseG1GC` in `gradle.properties`; added `-XX:+ParallelRefProcEnabled`. Verified with Gradle sync. |
| 141 | + |
| 142 | +## 2026-05-02 — CI cost-control PR review fixes |
| 143 | +- Applied PR feedback: encoding fixes in sort-strings.py, NUL-delimited staged-files loop in ai-guardrail.sh, install instructions, strings.xml typo, AGENTS.md command order, narrowed .aiexclude/.gitattributes patterns, allTests added to SKILL.md. |
| 144 | + |
| 145 | +## 2026-04-XX — Token Mitigation (Phase 1-3) |
| 146 | +- `.copilotignore` and `.aiexclude` updated with stricter ignore rules. |
| 147 | +- `AGENTS.md` modularized to ~3KB base; detailed rules moved to `.skills/`. |
| 148 | +- `scripts/ai-guardrail.sh` added to prevent binary/log leaks. |
| 149 | +- CI Cost Control skill added at `.skills/ci-cost-control/SKILL.md`. |
0 commit comments