After this the app can create rooms on the current profile -- behind
MarmotProfile.DEFAULT_FOR_NEW_ROOMS, which stays legacy until the rollout flips
it -- and every path keyed on the `h` tag reads the room through its address.
docs/marmot-v2.md, Phase 4.
The room's id is a key. A room built around a threshold key is keyed on the id
derived from that key -- the one it signs as and every chronicle is verified
against -- and every member can compute it unaided. v2's routing component
says of `nostr_group_id` the opposite: random, never derived from any public
key, because a derivable address lets a relay link a group's traffic to the
identity behind it, which here is the key that authors the group's published
entries. Both are right about their own value, so they are two values now. A
new MarmotRouting table (schema 21 -> 22) maps an address to its room; a
current-profile room this app creates mints a random one, and every other
room -- legacy, or made by another client -- has a row whose address is its
own id, or no row at all and is addressed by its own id, which every reader
falls back to. The inbound ingest, the reindex, the negentropy answer for a
`#h` filter, the chat list's sync request and the live subscriptions all
resolve or emit addresses; LocalChatRoom carries its routings as a relation so
the subscription planner needs no query; the outbound commit, application and
Welcome templates are stamped with the room's address rather than its id.
A joiner keys a room on the group's `nostr_group_id`, which for a
current-profile room would be the address, and the creator, the joiner's own
DKG session and every chronicle know the room by its derived id. The
components carry no field for it, so it rides in the group profile's
description as one line -- `Room id: <hex>` -- the way the derivation path
already does, and MlsGroup.roomId() reads it back first. It is a claim by the
creator, exactly as the legacy `nostr_group_id` was, and is trusted no further.
MarmotGroupFactory is now the one place a group is minted. The three sites --
a direct message, the convenient room, and the derived room MarmotGroupCreation
builds -- say what the room is, and the factory decides the profile: a legacy
group is the 0xF2EE extension as before; a current-profile group is quartz's
own CurrentProfileGroupFactory with the admin policy, routing, profile and the
creator's proof-bearing leaf, and no 0xF2EE at all, because RFC 9420 requires
every member to support every GroupContext extension and an MDK leaf does not
advertise it. Creating a direct-message room reads the identity from the chat
repository, which now takes it, so the creator's leaf can carry its proof.
A peer's KeyPackage is picked by the room's profile rather than by age: a
current-profile room takes the newest current-profile package or none, since
the legacy package is deliberately the newest a peer publishes. A leaf on the
wrong profile is refused a step before the library refuses it, with a reason
the member can act on -- their package is from an older profile -- shown on
the confirmation screen and in the room's line rather than as "try again".
Tests: MarmotGroupFactoryJvmTest pins both profiles' shapes, the address
minted apart from the room id, the room id riding in the description, the
read-only creator refused on the current profile, and which leaves fit which
groups; MarmotGroupCreationJvmTest adds a current-profile room keeping its
derived id with a routing row, a legacy room unchanged, and a kind:445 under
the address filed in the room; MarmotRoomIdentityTest the description line;
LiveSubscriptionPlanTest the addresses watched. Full JVM suite: 1,166 pass.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>