KERIA patches: the applicant's agent notifies itself about its own outgoing /matou/registration/* exn — immediate-notify only when the recipient is local #1885

Closed
opened 2026-09-25 16:02:25 +00:00 by ben · 2 comments
Owner

KERIA's POST /identifiers/<name>/exchanges (keria/peer/exchanging.py:157) runs the sender's own exn through Exchanger.processEvent. So idss_patches._processEvent's immediate notification fires on the applicant's agent for its own /matou/registration/apply. This was seen live on whakatohea-demo (2026-09-25, the phone's agent held both /exn/matou/registration/apply and /exn/ipex/apply) and in every patched local run (scratchpad regtest/).

It is harmless today. But an applicant later promoted to steward would see their own old registration as an incoming one.

Fix: in _processEvent, notify only when the recipient is local to this agent, serder.ked.get("rp") in self.hby.habs (or skip when serder.pre is one of this agent's habs). First confirm the app always sets rp on the /matou/registration/* routes. Add a pytest: the sender's agent gets no immediate notification, and the recipient's still does. The /pending path needs no guard, because an outgoing exn signed by a local AID always verifies.

🤖 Generated with Claude Code

KERIA's `POST /identifiers/<name>/exchanges` (`keria/peer/exchanging.py:157`) runs the sender's own exn through `Exchanger.processEvent`. So `idss_patches._processEvent`'s immediate notification fires on the **applicant's** agent for its own `/matou/registration/apply`. This was seen live on whakatohea-demo (2026-09-25, the phone's agent held both `/exn/matou/registration/apply` and `/exn/ipex/apply`) and in every patched local run (scratchpad `regtest/`). It is harmless today. But an applicant later promoted to steward would see their own old registration as an incoming one. Fix: in `_processEvent`, notify only when the recipient is local to this agent, `serder.ked.get("rp") in self.hby.habs` (or skip when `serder.pre` is one of this agent's habs). First confirm the app always sets `rp` on the `/matou/registration/*` routes. Add a pytest: the sender's agent gets no immediate notification, and the recipient's still does. The `/pending` path needs no guard, because an outgoing exn signed by a local AID always verifies. 🤖 Generated with [Claude Code](https://claude.com/claude-code)

swarm-claim host=bens-mac-04 run=32820
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=bens-mac-04 run=32820 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1885 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1885,
  "status": "success",
  "commits": [
    "1acdd2eb362d0c854bb66bd474c16e39f5d050fa"
  ],
  "changed_files": [
    "STATUS.md",
    "internal/clan/keriapatches/idss_patches.py",
    "internal/clan/keriapatches/test_idss_patches.py"
  ],
  "tests": [
    {
      "command": "pytest internal/clan/keriapatches -q (real keria 0.4.0/keripy 1.2.13)",
      "exit_code": 0
    },
    {
      "command": "go test ./internal/clan/ -run TestRenderKeri",
      "exit_code": 0
    }
  ],
  "criteria": {
    "_processEvent notifies only when recipient local (rp in self.hby.habs)": "internal/clan/keriapatches/idss_patches.py _processEvent guard",
    "confirmed rp always set on /matou/registration/* routes": "probe: keripy exchange(recipient=…) writes ked['rp']; KERIA door 404s an exn to an unknown recipient",
    "pytest: sender's agent gets no immediate notification, recipient's still does": "test_sender_agent_does_not_notify_itself_for_its_own_outgoing_exn (14 passed, red without guard)",
    "/pending path needs no guard": "unchanged; outgoing exn signed by a local AID verifies at once and never escrows"
  },
  "summary": "Guarded idss_patches _processEvent so the immediate registration notification fires only on the recipient's agent, not the sender's own.",
  "blockers": []
}
**close-report** for #1885 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1885, "status": "success", "commits": [ "1acdd2eb362d0c854bb66bd474c16e39f5d050fa" ], "changed_files": [ "STATUS.md", "internal/clan/keriapatches/idss_patches.py", "internal/clan/keriapatches/test_idss_patches.py" ], "tests": [ { "command": "pytest internal/clan/keriapatches -q (real keria 0.4.0/keripy 1.2.13)", "exit_code": 0 }, { "command": "go test ./internal/clan/ -run TestRenderKeri", "exit_code": 0 } ], "criteria": { "_processEvent notifies only when recipient local (rp in self.hby.habs)": "internal/clan/keriapatches/idss_patches.py _processEvent guard", "confirmed rp always set on /matou/registration/* routes": "probe: keripy exchange(recipient=…) writes ked['rp']; KERIA door 404s an exn to an unknown recipient", "pytest: sender's agent gets no immediate notification, recipient's still does": "test_sender_agent_does_not_notify_itself_for_its_own_outgoing_exn (14 passed, red without guard)", "/pending path needs no guard": "unchanged; outgoing exn signed by a local AID verifies at once and never escrows" }, "summary": "Guarded idss_patches _processEvent so the immediate registration notification fires only on the recipient's agent, not the sender's own.", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#1885
No description provided.