## Summary
Follow-up to #9912. Specification only: closes four gaps in NIP-SL and
the NIP-FI "Deferred actions" section.
**NIP-SL**
- A send-later status (`kind:30361`) is the relay's record of how a
scheduled send ended: `sent`, `failed`, `missed` or `cancelled`. It is
how the author's client learns the outcome, since the relay posts the
message while the client may be offline. The relay signs each status
with its NIP-11 `self` key, which NIP-11 makes optional. A relay now
serves the `send_later` descriptor only with a `self` key and keeps that
key while a status signed with it is readable. A client treats the
descriptor as absent when `self` is missing or malformed, and reads the
NIP-11 document again, once per key, when a status is signed with
another key. Without this, a relay with no `self` or a rotated one makes
clients reject these statuses, and a failed send whose text is still
retained reads as pending.
- An agent admitted through its owner could schedule past the time bound
of the NIP-OA `auth` tag that proved the owner, by leaving the tag off
the message. The `created_at` conditions of that tag now hold at `T`,
and an `auth` tag on the message names the stored owner.
- Deleting an instruction covers the instruction's copy of the message,
so the wording no longer reads as covering the posted event.
**NIP-FI**
- An admission's time is read no later than its deny-set check, and the
connection's lifetime counts from that time. Otherwise an admission that
checked the deny set just before a disconnect committed could be stamped
after `recorded_at` and stay unfenced.
### Related issue
Follow-up to #9912.
### Testing
Documentation only. `git diff --check` passes and the section links in
NIP-SL resolve. To review: read the diff; each change is one or two
sentences.
---------
Signed-off-by: Kalvin Chau <kalvin@block.xyz>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>
## Summary
Adds NIP-SL (Send Later) and a "Deferred actions" section to NIP-FI.
This change is specification only: the relay, schema and clients are
untouched.
**NIP-SL**
- An author signs an ordinary message dated for its release time `T` and
submits it inside a private, author-signed instruction (`kind:30360`).
The relay stores the message as an ordinary event between `T` and `T +
release_window`, so the timestamp rule and the signer rule stay as they
are.
- The relay reports how the send ended in an author-only status
(`kind:30361`) signed with its NIP-11 `self` key: `sent`, `failed`,
`missed` or `cancelled`.
- Edit, change the time, send now and cancel are replacements of the
instruction under a generation compare-and-swap. Release and cancel are
one conditional change, so a confirmed cancel is never followed by a
post.
- NIP-11 discovery through `supported_extensions` (`buzz-send-later`)
and a `send_later` descriptor that carries the limits. Recommended
limits: 120 days ahead, 100 pending per author per community, a 900
second release window, 7 days of text retention for failed or missed
sends, 30 days of status retention.
- The document also specifies the acceptance checks with their `OK`
messages, the events that end a send early (ban, disconnect, channel
deletion, operator withdrawal), retention, read access and the complete
read a client derives state from.
**NIP-FI**
- A relay that stores actions it executes without a live session writes
a disconnect record for each disconnect command and cancels the pending
actions whose admission the record fences, in one atomic change, before
it closes a connection or answers `200`. The record carries the
command's scope, and each action stores the issuer, owner and verified
`iat` of its admitting assertion, so a `revoke_through` cutoff applies
to pending actions as it does to sessions.
- A command answered `503`, or not answered, is retried with a freshly
signed command. The deny set is unchanged.
- A relay accepts no deferred action while a process that answers
disconnect commands for the same storage does not apply the section.
**Design choices worth a reviewer's eye**
- Both kinds are readable only by the author. The owner of an agent
cannot read the agent's instructions or statuses. A pending message is
stored in the clear, as a posted one is.
- Each send stores the owner verified at acceptance, and release uses
it, because there is no request at release to take an owner from.
- A relay keeps at most `max_pending` ended instructions per author, so
the instruction read fits in one request. Past that bound, the text of a
failed send or the record of an author's own cancel can be deleted
before its retention period ends.
- A disconnect covers the target key and every agent key it owns.
Nothing else in NIP-FI ends an accepted send, and release does not
evaluate issuer policy again.
- A released message carries `created_at` `T` and can arrive up to
`release_window` later. A reader whose read state is a `created_at`
frontier displays it and counts it as read; the document states this
limitation and what read state removes it.
- Channels, threads and DMs of the listed kinds are in scope. Forum
posts and recurring sends are left for later work.
**Follow-up**
- Relay implementation, including registration of kinds 30360 and 30361
in the kind registry and removal of the unused placeholder kinds 40006
and 40007 from ingest.
- Client implementation.
### Related issue
The "Deferred actions" section builds on the disconnect contract of
#9860 (retry with a freshly signed command) and #9917 (`revoke_through`
and "Deny scope"), both on main.
### Testing
Documentation only. `git diff --check` passes, every section link in
NIP-SL resolves to a heading, the link to "Deferred actions" in NIP-FI
resolves, and kinds 30360 and 30361 are unused in
`crates/buzz-core/src/kind.rs`. To review: read `docs/nips/NIP-SL.md`
top to bottom, then the "Deferred actions" section of
`docs/nips/NIP-FI.md`.
---------
Signed-off-by: Kalvin Chau <kalvin@block.xyz>
Co-authored-by: Claude Fable 5.2 <noreply@anthropic.com>