Skip to content

NAP-5: explicit feed origin (relay vs outbox) - #44

Merged
dskvr merged 1 commit into
nap-5-feed-topicsfrom
nap-5-feed-source
Jun 16, 2026
Merged

NAP-5: explicit feed origin (relay vs outbox)#44
dskvr merged 1 commit into
nap-5-feed-topicsfrom
nap-5-feed-source

Conversation

@dskvr

@dskvr dskvr commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Stacked on #36 (nap-5-feed-topics); base is nap-5-feed-topics so the diff is just these changes.

1. Explicit feed origin

feed:open could express a relay set (relays?) but not an author-routed (outbox) feed. Adds an origin discriminated union:

type FeedOrigin =
  | { type: "relay";  relays: string[] }
  | { type: "outbox"; authors?: string[]; strategy?: "outbox" | "inbox" | "auto" };

Origin names a routing method, not an interface. relay = query these relays; outbox = resolve each author's relays from their published relay list. The spec does not require or name a fetch interface (no NAP-RELAY/NAP-OUTBOX imposed) — named NAPs are voluntary per runtime. A consumer fulfills the method through whatever relay access it has, and MAY fall back or ignore when it can't. Origin is a field, not a topic — new methods (search, dvm) extend the union without forking. Requires reduced to NAP-INC.

2. Origin-only sourcing

The legacy relays field is removed — sourcing is expressed solely through origin (a relay-pinned feed is origin: { type: "relay", relays }). One field, no precedence rules.

3. Runtime owns fetch policy

limit is clarified as advisory: the runtime owns fetch policy (page size, pagination, cost bounds) and MAY ignore a producer-supplied limit. This matches the spec's existing non-goal of not defining how a feed fetches/paginates.

Terminology (producer/consumer) is unchanged — consistent with NAP-1–4; a glossary entry defining the pair is added to README.md separately. Registry row unchanged. Status draft.

@dskvr
dskvr force-pushed the nap-5-feed-source branch 3 times, most recently from 55d20a9 to 42118cf Compare June 16, 2026 12:31
… policy

Add an `origin` field to feed:open — a discriminated union whose `type` selects
the routing *method*: `relay` (query these relays) or `outbox` (resolve each
author's relays from their published relay list). A relay feed and an outbox
feed become one request differing only by `origin.type`; new methods never fork
the contract.

Origin names a method, not an interface — the spec no longer requires or names
NAP-RELAY/NAP-OUTBOX, since named NAPs are voluntary per runtime. The legacy
`relays` field is removed; sourcing is expressed solely through `origin`.

Clarify that `limit` is advisory: the runtime owns fetch policy (page size,
pagination, cost bounds) and MAY ignore a producer-supplied `limit`. Producer/
consumer requirements, examples, and security considerations updated to match.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dskvr
dskvr force-pushed the nap-5-feed-source branch from 42118cf to 70c54a0 Compare June 16, 2026 12:41
@dskvr
dskvr merged commit b9e8532 into nap-5-feed-topics Jun 16, 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