// Package policy maps an event kind to the storage rule the relay applies to // it. Musiquay's protocol vocabulary is the source of truth for its own kinds; // every other kind follows NIP-01. package pipeline import ( "git.smesh.lol/musiquay/pkg/protocol" ) // countedInReplaceableRange reports whether a kind is a Musiquay *counted* // kind that happens to sit inside NIP-01's parameterized-replaceable range. // // 32218 (delivery receipt), 32219 (host aggregate) and 32220 (publisher // rollup) are 30000-39999, so `kind.IsParameterizedReplaceable` claims them. // They are not addressable documents: each is one record of many, and with no // `d` tag the range rule treats them all as d="" and keeps only the newest - // the second receipt from a host would silently delete the first. The protocol // says so itself in `protocol.RegularInReplaceableRange`. func countedInReplaceableRange(k uint16) (ok bool) { return protocol.IsRegular(k) && protocol.InReplaceableRange(k) }