Skip to content

docs(nips): add NIP-LE leader election draft#1063

Closed
wpfleger96 wants to merge 1 commit into
mainfrom
alia/nip-le-draft
Closed

docs(nips): add NIP-LE leader election draft#1063
wpfleger96 wants to merge 1 commit into
mainfrom
alia/nip-le-draft

Conversation

@wpfleger96

Copy link
Copy Markdown
Collaborator

Adds docs/nips/NIP-LE.md documenting the leader-election / shared-identity multi-instance model.

When multiple Buzz instances run under one shared agent key, the relay fans every mention to all of them and each responds. NIP-LE defines a client-side, local-filesystem convention that elects exactly one prompter per agent identity.

Three normative sections:

  • The invariant — N subscribers, one prompter; non-leaders render the conversation but suppress the prompt path and the 👀 pre-dispatch reaction. Fail-safe: no lock means every instance leads (solo-dev byte-unchanged).
  • The lock contract — local file at ~/.buzz/leader-locks/<agent-pubkey-hex>.lock, not a Nostr event and no wire format. instance_id must be per-window-unique (the bundle identifier collides across same-class windows). Acquire/steal is flock-guarded. Marked (provisional — finalized against Phase 2 implementation).
  • Claim/steal semantics — explicit sticky window ownership; hard-steal reuses NIP-AO cancel_turn (kind 24200) rather than redefining a cancel mechanism.

References NIP-OA, NIP-RS, and NIP-AO without amending any of them. Doc-only; defines no Nostr event kind or tag.

Draft to be reconciled against Phase 1/2 code before merge.

Documents the shared-identity multi-instance leader-election convention:
the one-prompter invariant, the local-filesystem lock contract, and
claim/hard-steal semantics. Lock is local-only and defines no wire format,
so this touches no relay protocol. References NIP-OA, NIP-RS, and NIP-AO
without amending them.

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
@wpfleger96 wpfleger96 marked this pull request as draft June 15, 2026 22:34
@wpfleger96

Copy link
Copy Markdown
Collaborator Author

superseded by #1062

@wpfleger96 wpfleger96 closed this Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant