Clean up feeds spec

This commit is contained in:
Jon Staab 2024-05-17 08:45:08 -07:00
parent a9455fd4ff
commit 9217b33aa2

40
xx.md
View File

@ -44,7 +44,7 @@ If included in the `relative` list, `since` and `until` values MUST be interpret
`seconds before now`. Negative numbers MUST be interpreted as `seconds after now`.
```json
["created_at", {"since": 1715293673, "until": 86400, "relative": ["since"]}]
["created_at", {"since": 1715293673, "until": 86400, "relative": ["until"]}]
```
## DVM
@ -52,7 +52,7 @@ If included in the `relative` list, `since` and `until` values MUST be interpret
A `dvm` feed includes one or more objects describing a DVM request. Each object MUST
have a request `kind`, and MAY have a list of request `tags`, `relays` to send the
request to, and a list of `mappings` mapping response tags to feeds. If omitted,
applications SHOULD provide a resonable set of default `mappings`.
applications SHOULD provide a reasonable set of default `mappings`.
```json
[
@ -67,17 +67,25 @@ applications SHOULD provide a resonable set of default `mappings`.
## ID
A `id` feed
A `id` feed includes one or more ids of events to fetch.
```json
["id", "b1ee83587c4ebab697719fd5bad22319741134e49933b0528b8cca426cafd59e"]
```
## Kind
A `kind` feed
A `kind` feed includes one or more kinds of events to fetch.
```json
["kind", 1, 30023]
```
## List
A `dvm` feed includes one or more objects defining one or more `addresses` and a set of
`mappings` for how to translate list tags into feeds. If omitted,
applications SHOULD provide a resonable set of default `mappings`.
A `list` feed includes one or more objects defining one or more `addresses` and optional
`mappings` for how to translate list tags into feeds. If omitted, applications SHOULD
provide a reasonable set of default `mappings`.
```json
[
@ -94,7 +102,7 @@ applications SHOULD provide a resonable set of default `mappings`.
A `wot` feed includes one or more objects with optional `min` and `max` properties. These
MUST be between 0 and 1 (inclusive) so that the interpeting application can scale the filter
to their own web of trust's score range. If empty, `min` MUST be interpreted as `0`, and
`max` as 1.
`max` as `1`.
```json
["wot", {"min": 0.3}]
@ -143,7 +151,7 @@ as standard tag filters.
## Union
A `union` feed includes two or more feeds. An event may match any feed to match the parent feed.
A `union` feed includes zero or more feeds. An event may match any feed to match the parent feed.
Example:
@ -157,7 +165,7 @@ Example:
## Intersection
An `intersection` feed includes two or more feeds. An event must match all given feeds to
An `intersection` feed includes zero or more feeds. An event must match all given feeds to
match the parent feed.
Example:
@ -172,7 +180,7 @@ Example:
## Difference
A `difference` feed includes a base feed to fetch, and one or more feeds used to exclude
A `difference` feed MAY include a base feed to fetch, and zero or more feeds used to exclude
events from the base feed.
Example:
@ -194,8 +202,8 @@ Example:
## Symmetric Difference
A `symmetric_difference` feed includes two or more feeds. An event must match only one feed to match
the parent feed.
A `symmetric_difference` feed includes zero or more feeds. An event must match only one feed to match
the base feed.
Example:
@ -221,6 +229,12 @@ Example:
]
```
# Implementation notes
If a `union`, `difference`, `intersection`, or `symmetric_difference` feed has no entries, it should
be treated as an empty feed. Likewise with other feed types that have no arguments; for example
`["authors"]` should be interprete the same way as a `{"authors": []}` filter.
# Feed Event
A `kind:31890` event defines a feed in an addressable way. The `content` SHOULD be a human-