Archived agent identities leave orphaned repos/projects that only a DB admin can remove
Archived agent identities leave orphaned repos/projects that only a DB admin can remove
Summary
Every time an agent is (re-)added in Buzz Desktop, a new keypair is generated and the previous identity is orphaned. Any NIP-34 repo announcement (kind 30617) or NIP-MP project (kind 30621) that the old identity published outlives it: the signing key is destroyed with the identity, and deletion is author-scoped, so no in-product path can remove those entries — not the workspace owner, not another agent, not the Desktop Projects panel. The Projects list accumulates duplicate and dead rows.
We hit this on a self-hosted workspace, and the only way we could clean it up was deleting the events directly from the relay's database by hand. That works if you self-host; it is not available to anyone else.
Impact
On our workspace, 5 of 7 Projects entries were signed by an identity that had been archived. One of them was a stale duplicate of a live repo — same display name, same bound channel, no clone URL, so nobody could even clone it. Two more had no repo binding at all. The remaining orphans point at real repositories that are still in use, but they can no longer be edited, rebound, or removed by anyone.
This is a one-way ratchet: every agent re-add adds more rows that no product surface can remove. On a hosted relay, they would be permanent.
Steps to reproduce
- In Buzz Desktop, have an agent announce a repo:
buzz repos create --id demo-repo --name "Demo" --channel <UUID>. - Remove and re-add that agent in the Agents panel (this generates a new keypair; the old identity is orphaned).
- Archive the old identity.
- Open the Projects panel and try to delete the
demo-repoentry.
Expected
The workspace owner can remove a project/repo entry published by an identity they own — through the Projects panel or a CLI command — without touching the database.
Actual
Every in-product path fails. Confirmed on our workspace:
| Attempt | Result |
|---|---|
| Desktop Projects panel, as workspace owner | Entry could not be removed (reported by the workspace owner) |
buzz repos delete |
Subcommand does not exist (buzz repos has only create, get, list, bind, protect) |
buzz messages delete --event <repo-announcement-id> |
event <id> has no h-tag — cannot determine channel |
buzz projects delete <slug> |
Only handles kind 30621, and only for the current identity |
Re-announcing under a live identity with the same d-tag |
Does not replace the old entry. Addressable events are keyed by (kind, pubkey, d-tag), so a different pubkey produces a second entry and the orphan remains |
Hand-signed NIP-09 kind 5 delete from another identity, POSTed to /events |
Rejected by design — NIP-09 honors only the original author's signature |
Manual DELETE against the relay database |
Worked. This was the only thing that worked. |
The archived identity's private key is genuinely unrecoverable: it is not in the OS keychain (the buzz-desktop entry holds keys only for currently configured agents), not in agents/managed-agents.json (the entry is deleted along with the agent), and not in the agent logs. So "just sign a NIP-09 delete as the original author" is not an option once the identity is gone.
Why the DB workaround isn't a fix
- It requires shell/DB access to the relay. Anyone on a hosted or shared relay has no recourse at all.
- It bypasses the event log entirely — no tombstone, no audit trail, and any client that cached the event keeps showing it.
- It is trivially easy to delete the wrong row; the operator is hand-matching event IDs with no safety net.
Suggested fixes
Any one of these would close the hole; the first two are the most valuable.
- Owner-level tombstone. Let the workspace owner/admin publish a moderation tombstone over a repo/project entry authored by any identity in their workspace, and have the Projects panel expose it as a normal "Remove project" action. The relay already has a moderation event family (kinds
9040–9044), so this fits the existing model and keeps an audit trail — unlike a raw DB delete. - Don't orphan identities on re-add. Reuse the existing keypair when an agent is re-added under the same name/slug, or offer an explicit "rotate identity" flow that carries ownership of published events across the rotation (NIP-IA already has a
replaced_byrotation pointer — honor it for authorship of addressable events). - Transfer on archive. When an identity is archived, prompt to reassign or tombstone the repos/projects it authored, instead of silently stranding them.
- Stopgap: add
buzz repos delete <id>so at least an author can retract their own announcement. This does not fix the orphan case, but today even a live agent cannot delete an entry it published itself.
Environment
- macOS 26.x
- Buzz Desktop with a self-hosted relay
buzzCLI installed at~/.local/bin/buzz(no--versionflag available, so the exact build cannot be reported)- Observed 2026-08-03
One boundary in the proposed fixes seems important: NIP-IA explicitly defines archival as relay-scoped visibility, not event deletion or authorship transfer. I would avoid making replaced-by let a new key rewrite the old key's 30617:<pubkey>:<d> or 30621:<pubkey>:<d> coordinates; that would turn a rotation hint into signature authority over historical records.
The smallest safe split looks like this:
- Author retraction: add
buzz repos delete <id>for a still-live author key, using the same author-signed, head-aware tombstone shape thatprojects deletealready uses. - Workspace suppression: add a relay-signed moderation action that hides one exact repo/project coordinate from that community's projections without deleting the original event or changing its author. Authorization should come from the tenant-fenced workspace-owner capability (or another explicit capability), not an agent name, slug, or newly created replacement key.
- Rotation linkage: keep
replaced-byas verified display/linkage evidence. The new key publishes its own coordinate; clients may show the relationship, but no authorship power transfers implicitly.
For the suppression record, I would bind the exact coordinate, the observed head event id/timestamp, community id, actor, authority path, reason, and decision time. Make it idempotent and reversible with another audited moderation decision. A concurrent newer head should cause a conflict/retry rather than silently suppressing a version the moderator never saw.
The negative cases seem load-bearing:
- re-adding an agent with the same name or slug does not grant control of the old coordinate;
- a
replaced-bypointer alone cannot authorize edit or deletion; - an owner/admin from another community cannot suppress the record;
- a stale-head suppression cannot hide a newer replacement event accidentally;
- suppressing the projection preserves the original event and signature for audit.
Buzz already has tenant-fenced moderation authorization and audited decisions, but the current DeleteMessage capability is channel/message-specific. Would maintainers prefer a separate repo/project suppression action and target type at that seam, leaving NIP-09 authorship and NIP-IA archival semantics unchanged?
Follow-up observation from a current affected workspace:
buzz projects delete bcos
→ project "bcos" not found
The Desktop UI still renders the stale project card, but the current relay query has no addressable NIP-MP project head for that slug. As a result, the supported deletion command cannot construct or publish a tombstone; neither listing nor lookup reaches the visible card.
This is a distinct failure mode from a reachable entry authored by an archived identity: the client projection can outlive—or become disconnected from—the relay record required by the normal control surface. We did not modify the relay database.
No private repository, workspace, host, account, or event identifier is included here.