Kgothatso NgakoandClaude Opus 5 a68cad06a4 feat(marmot): read both Marmot profiles (v2 Phase 1)
After this the app can be a member of a current-profile group and can invite a
current-profile peer -- an Amethyst 1.15.2 user -- into one of its own legacy
rooms. Nothing it sends changes. docs/marmot-v2.md, Phase 1.

Seventeen sites read `currentMarmotData()`, which is the legacy 0xF2EE
extension and is null on a current-profile group: ten for the room id, and the
Welcome path threw MarmotMissingNostrGroupDataExtension on that null, so a v2
Welcome was not a room the app could not read but an exception it could not get
past. The others read the admins -- SubgroupManager's "only an admin can make a
subgroup" and processGroupMembershipChanges' adminAt stamp both saw no admins at
all on a v2 group -- the relays, the name and the retention. MlsGroupProfile.kt
writes the fallback once per field (current profile first, 0xF2EE second) and
the sites read roomId(), roomName(), roomDescription(), roomRelays(),
retentionSeconds() and the library's currentAdminIdentities(). The retention
one is the bug the library's own outbound processor had: read only 0xF2EE and
disappearing messages simply did not disappear in v2 groups.

A current-profile kind:30443 frames its KeyPackage in an MLSMessage, and the
invite decoded whatever the ingest stored as a bare KeyPackage, taking the
frame's version and wire-format words for the package's own. The ingest now
validates with KeyPackageUtils.isCryptographicallyValid -- the check a
conformant peer runs on ours, covering tags, signature, lifetime and on the
current profile the identity proof; nothing checked any of it before -- and
stores the package bare, so MlsGroup.proposeAdd and every other consumer of the
row read the same bytes whichever way it was published.

The inbound author check decodes the canonical payload strictly first
(MarmotAppEvent: six members, no sig, an id that rehashes) and falls back to
Event.fromJsonOrNull only for the legacy rumor shape every build before Phase 2
sends. The fallback would accept the canonical shape too, but by defaulting the
signature rather than checking anything.

A Welcome is matched to this device's bundle by the KeyPackageRef the Welcome
itself names, in RFC 9420 order, before the `e` tag is consulted: the tag is
what the inviter thinks it used, and MDK stamps the id of a cached copy, so a
peer who rotated while an inviter kept inviting from cache was unjoinable by
the tag alone. WelcomeBundleMatch is pure and scans the handful of bundle rows
rather than adding a column. The exception the tag-only path threw when the tag
was missing has no caller left and goes.

Tests: MarmotKeyPackageIngestJvmTest runs both published shapes through the
sync funnel, invites a current-profile package into a legacy room and sees the
member in the tree, and refuses a tampered package; WelcomeBundleMatchJvmTest
picks the addressed bundle in either candidate order, none when none is ours,
and survives an unreadable row; MarmotAppPayloadTest pins that the legacy rumor
and its canonical form share an id, that the strict decoder refuses a sig
member and a forged id, and that the fallback reads both. The KeyPackage test
fixture's lifetime drops from 90 days to the app's own 30 because 1.15.2 caps
it at 84 and the ingest now checks. Full JVM suite: 1,140 tests pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-13 22:15:13 +02:00
2026-09-09 17:04:09 +02:00
2026-03-24 04:47:19 +02:00
2026-03-23 01:41:39 +02:00
2026-03-23 01:41:39 +02:00
2026-03-23 01:41:39 +02:00

This is a Kotlin Multiplatform project targeting Android, iOS, Desktop (JVM).

  • /composeApp is for code that will be shared across your Compose Multiplatform applications. It contains several subfolders:

    • commonMain is for code that’s common for all targets.
    • Other folders are for Kotlin code that will be compiled for only the platform indicated in the folder name. For example, if you want to use Apple’s CoreCrypto for the iOS part of your Kotlin app, the iosMain folder would be the right place for such calls. Similarly, if you want to edit the Desktop (JVM) specific part, the jvmMain folder is the appropriate location.
  • /iosApp contains iOS applications. Even if you’re sharing your UI with Compose Multiplatform, you need this entry point for your iOS app. This is also where you should add SwiftUI code for your project.

Build and Run Android Application

To build and run the development version of the Android app, use the run configuration from the run widget in your IDE’s toolbar or build it directly from the terminal:

  • on macOS/Linux
    ./gradlew :composeApp:assembleDebug
    
  • on Windows
    .\gradlew.bat :composeApp:assembleDebug
    

Build and Run Desktop (JVM) Application

To build and run the development version of the desktop app, use the run configuration from the run widget in your IDE’s toolbar or run it directly from the terminal:

  • on macOS/Linux
    ./gradlew :composeApp:run
    
  • on Windows
    .\gradlew.bat :composeApp:run
    

Build and Run iOS Application

To build and run the development version of the iOS app, use the run configuration from the run widget in your IDE’s toolbar or open the /iosApp directory in Xcode and run it from there.


Learn more about Kotlin Multiplatform…

Languages
Kotlin 99.9%