feat(calendar): NIP-52 compliance — effective end, reference facets, educational attributes, Typesense routing #25
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/calendar-nip52-end-and-attributes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
NIP-52 compliance for the calendar content type, found while aligning the relay with the updated edufeed calendar wiki ("Calendar events in edufeed", 2026-11-03) and edufeed-app v0.14. Reviewed in seven passes incl. four independent adversarial reviews; every finding has a test.
End semantics: docs and the Bolt index store the NIP-52 effective end (end-less 31923 = instantaneous, end-less or legacy inclusive-end 31922 = one day). Before,
#end_aftersilently dropped every one-day and instantaneous event (10 of 123 upcoming all-day events on prod).end_afteris strict becauseendis exclusive.Reference tags:
#a,#p,#e,#r,#l,#Lwere mapped to fields the calendar schema never declared — verified on prod: "RSVPs for event X", "calendars listing X", "events with participant Y" all returned 0. All are facets on every calendar kind now;#status,#fb,#currencytoo.Educational attributes (NIP-52-Edufeed):
registrationRequired,price+currency,eventAttendanceMode, namedparticipants (searchable),Ddays as facets, read with exactly the rules of edufeed-app'scalendar-attributes.js. Alllocationtags searchable.Routing: pure time ranges and calendar searches go to Typesense (BoltDB's planner silently dropped tag clauses beyond two; the chunk-rerank detour stripped the window before the lexical fetch and re-matched attributes raw — it is gone, calendar is
chunked: false). Bolt serves geohash-prefix only; geohash + search post-filters a full page. NIP-45 COUNT follows every split so it agrees with REQ.Validation: deprecated
nameaccepted, unparseable/signed-plusstart/endandend < startrejected, RSVPamust reference a 31922/31923 coordinate, first occurrence judged like every reader.Deploy: Init adds the schema fields; run a NIP-86
reindexafterwards so existing docs getendand the new facets and the Bolt index drops itsend = 0entries.go.modpins nostrlib PR #34's head; re-pin to the merge commit after it lands.calendar_typesense_test.gocovers every documented query shape against a live Typesense (TS_TEST_HOST/TS_TEST_APIKEY).🤖 Generated with Claude Code
The chunk-rerank route that serves a free-text search plus a time window (calendarRerankQuery → inCalendarWindow) still read the RAW `end`, failed every end bound for an end-less event and used an inclusive end_after, so "mathematik, ongoing or upcoming" dropped every one-day and instantaneous event that the same REQ without a search term returned. The window now uses nip52.EffectiveEnd and the same bounds as the Typesense and Bolt paths (strict end_after). A geohash query with a search term went to Bolt, which ignores `search` — the relay answered a wider question than asked. It now runs the Typesense search without `#g` and post-filters the page by geohash prefix; calendarCount follows, so COUNT and REQ agree on that shape too. Validation: an RSVP's required `a` may be any `a` tag referencing a 31922/31923 coordinate, not only the first; `title` (or deprecated `name`) must be non-empty for events and calendars. The stale content_registry comment ("calendar events are not chunked") is corrected; CLAUDE.md describes the three routes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>A 31923 start/end is digits with an optional minus; strconv.ParseInt also took a leading '+', which the MCP and the app do not parse, so such an event indexed here showed no usable time downstream. Concept ids are trimmed like the app does. CLAUDE.md now gives the real NIP-50 form for the concept facets (`educationalLevelId:<uri>`; `educationalLevel🆔…` parses as field `educationalLevel` and is dropped as unknown). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>