Files
amethyst/commons
Claude fa5e14e605 fix(marmot): mint a rotated KeyPackage the way the first one was minted
MIP-00 replaces a KeyPackage as soon as a Welcome consumes it, so rotation
is not a rare path — it runs right after the first group we are ever
invited to. It went through the legacy generator, so from that moment on
the only KeyPackage on relays for us was a MIP-era one with no account
identity proof. A current-profile peer refuses that outright ("member
KeyPackage identity or profile is invalid") and keeps inviting from
whatever stale copy it still has cached, so an account went silently
uninvitable one join after it was set up.

Rotation and first publication now share one mint path, so a replacement
cannot land on a different profile than the KeyPackage it replaces.

Harness, two tests that were reporting our bugs as theirs and one that
was reporting the reverse:

  - Test 16 asked `wn keys publish` to rotate. That verb is the
    idempotent retry of the durable stable-slot replacement — with
    nothing pending it republishes the same event id, so there is no
    rotation to observe. `wn keys rotate` is the one that mints.

  - Test 13 swallowed `wn keys check`'s output, so "no prior KP for A"
    read as a missing fixture when it was MDK refusing what we had
    published. The raw answer goes to the log now and the message says
    what actually happened.

  - Test 09 polled `reactions.by_emoji`, which belongs to the
    materialized timeline; `wn messages list` reads the raw app-event
    log, where a reaction is its own kind:7 entry with an "e" tag naming
    the anchor. The reaction had been arriving and being stored
    correctly the whole time.

The MDK 0.9.20 interop harness is now green, 17 of 17, twice in a row
from a clean state.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016kCuA6tc4JQzHPCDd39GHq
2026-09-09 08:50:12 +00:00
..