Files
ngit-grasp/src/nostr/policy
DanConwayDev 07fe32b704 feat(sync): retain identity for accepted root authors
GRASP-03 must retain the profile and NIP-65 relay list needed by clients that
use the GRASP relay as their only read source. The ordinary related-event policy
correctly rejects those untagged replaceable events, so discovery needs a narrow
admission rule rather than a persistence-policy bypass.

Maintain a shared derived set of authors owning roots in Full repositories and
admit only kind 0 or kind 10002 from that set. Query both kinds in each bounded
author batch, select only the NIP-01-preferred event per author and kind, and run
them through ordinary write policy, persistence and broadcast. Re-read accepted
relay lists from the local database before deriving inbox ownership, so a signed
but rejected response cannot steer outbound connections. StateOnly roots remain
inert and identity events cannot self-qualify an author.

Rebuild inbox ownership from retained accepted relay lists on startup before any
network refresh, then refresh that state remotely on the normal cadence. This
keeps established conversation coverage independent of an index source.

The accepted-root inventory remains authoritative and reconstructs removals on
restart. This deliberately excludes response-author fanout, recursive scopes,
general identity history, a rejected-identity cache and another deletion graph.

Validation:
- nix develop -c cargo check --lib
- nix develop -c cargo test --lib identity_cannot_make_its_own_author_relevant
- nix develop -c cargo test --lib state_only_root_becomes_an_inbox_source_after_promotion
- nix develop -c cargo test --lib identity_selection_keeps_latest_profile_and_relay_list_per_author
- nix develop -c cargo test --test sync root_author_inbox_reuses_existing_root_sync_pipeline -- --nocapture
2026-08-12 10:34:07 +00:00
..