fix(marmot): a received kind:1210 or kind:1009 is not a bubble

docs/marmot-v2.md, Phase 7, the line the phase's commit missed: "a received
kind:1210 or kind:1009 gets no bubble". Both are kinds the current profile
defines as not-chat. A 1210 is a group system row -- member added, member
left -- and the profile is explicit that one arriving over the wire is one
member's assertion rather than a fact; this device derives its own from the
commit it applied (`TYPE_MEMBER_ADDED` and its siblings, written by
`processGroupMembershipChanges`), so the received one adds nothing it can
trust. A 1009 is an in-place edit, which the app does not apply. Until now
either fell off the end of `applyInnerEvent`'s `when` into `unsupported()`,
which is the raw-JSON bubble, so a White Noise member leaving a room would
have put their client's system row into the transcript as a block of JSON
under the caption this device wrote for the same fact.

Both kinds now return null: no line. The bubble stays for every other
unknown kind, which is narrower than the plan's "neither does any other
unknown kind". Two reasons. The `TextNoteEvent` arm reaches `unsupported()`
deliberately -- a kind:1 the room did not sign is a member's own note
travelling through the room and has always rendered as this -- and the
bubble is the only trace an unrecognised payload leaves; retiring it would
make the next new kind a silent drop, which is the failure mode the chronicle
note complains about from the other side. The Phase 9 table records the
narrowing.

`MarmotSystemRowJvmTest` holds both: the two kinds make no row, and kind
31337 is still the bubble.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Kgothatso NgakoandClaude Opus 5 committed 2026-09-13 23:59:18 +02:00
1 parent daac3962fa
commit 437fd3e18b
2 files changed
+68

No files matched your search

@@ -16,6 +16,7 @@ import to.curare.compose.managers.GroupKeyStateManager
import to.curare.compose.managers.SubgroupManager
import to.curare.compose.extensions.toHex
import com.vitorpamplona.quartz.marmot.GroupEventResult
import com.vitorpamplona.quartz.marmot.foundation.appEvents.MarmotAppEvent
import com.vitorpamplona.quartz.marmot.mip03GroupMessages.GroupEvent
import com.vitorpamplona.quartz.nip01Core.core.Event
import com.vitorpamplona.quartz.nip01Core.core.HexKey
@@ -1695,6 +1696,15 @@ data class ChatMessage(
)
}
// v2's two non-chat kinds. A kind:1210 that arrives is one member's
// assertion about what the group's state became, and this device
// derives that for itself from the commit it applied (see
// [TYPE_MEMBER_ADDED]); a kind:1009 is an edit the app does not
// apply. Neither is a line, and neither is a raw-JSON bubble from
// a White Noise member. Every other unknown kind keeps the bubble,
// which is the only trace an unrecognised payload leaves.
MarmotAppEvent.KIND_SYSTEM, MarmotAppEvent.KIND_EDIT -> null
else -> unsupported()
}
}