Подкасты в FRID: публичное обнаружение podcast_dht — подписанные карточки, tombstone и поиск (MR-F3) #3

Merged
ab merged 9 commits from sanapach/frid:podcasts/discovery into main 2026-11-20 13:51:54 +00:00
9 Commits
Author SHA1 Message Date
sanapachandClaude Opus 5.5 9c82f6d916 Withhold persisted podcast cards until the first share sync
CI / check (pull_request) Successful in 3m37s
After a restart, PodcastDht::maintenance republished every locally active
card as soon as its first bootstrap found peers, before the client could
reconcile with sync_shares, so a share revoked on another trusted device
while this one was offline was re-sent from the stale cache. Own cards are
now neither republished nor served to FindValue until the first
sync_shares of the process (or an explicit publish of that podcast);
tombstones are still sent. The first sync_shares re-sends unchanged cards.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-20 01:03:47 +02:00
sanapachandClaude Opus 5.5 912527a671 Document podcast replica eviction and contact verification
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 18:50:22 +02:00
sanapachandClaude Opus 5.5 c0def74115 Evict podcast replicas fairly and trust only verified contacts
Replicas no longer hand capacity to whoever stored first: a key holds at
most one FindValue response worth of records (128, 32 tombstones), so
every admitted record is served, and a full key or cache admits a
newcomer by evicting a random record from its younger half. In-place
card-to-tombstone conversions count against the tombstone budget.

Contacts returned by peers are only lookup and bootstrap candidates
until they answer; replica responsibility counts verified contacts that
are not backed off, and contacts that keep failing are dropped. Refused
store batches fall back to the next closest nodes once. Each lookup
response may add at most 64 new owners.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 18:50:22 +02:00
sanapachandClaude Opus 5.5 71e3f1fa0a Reconcile podcast store and discovery
Cross-reference the SQLite podcast store and the podcast_dht overlay in
PODCASTS.md, ARCHITECTURE.md and the furumi-library README, and test that
the store's merged subscription and share registers build the share state
and cards PodcastDht::sync_shares publishes, including after a feed move
and after unsubscribing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 18:32:40 +02:00
sanapachandClaude Opus 5.5 5a4d418d2b Document podcast discovery wire protocol and replica limits
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 18:32:40 +02:00
sanapachandClaude Opus 5.5 81ccd924d0 Harden podcast discovery against sybil and hijack records
Replicas now accept records only from their publisher, keep one payload
per (podcast, publisher), store placements only for keys they are close
to, and admit records within per-key, per-tombstone, per-publisher and
total budgets without ever evicting existing records. Tombstones cannot
claim text keys without their owner's card. Search offers only the feed
URL the podcast id hashes from and reports moved-feed URLs as claims;
publisher counts no longer rank. sync_shares handles each podcast on its
own, always revokes, and holds back cards with privacy warnings. Lookups
and inbound requests per peer are bounded, persisted contacts are capped,
and the podcast_dht capability is opt-in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 18:32:40 +02:00
sanapachandClaude Opus 5.5 fef155d6ef Document public podcast discovery
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 18:32:40 +02:00
sanapachandClaude Opus 5.5 2fcb5f1822 Test podcast discovery across three loopback nodes
A publishes, an unrelated peer C finds the card by text and id while A's
trusted device B is offline, a never-shared podcast stays invisible, a
tombstone hides the card, and forged, tampered, replayed, malformed,
oversized and wrong-version requests are rejected. A peer without the
overlay never joins its routing table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 18:32:40 +02:00
sanapachandClaude Opus 5.5 d27155b257 Add signed public podcast discovery overlay
New music_dht::podcast_dht: a schema-independent Kademlia overlay on
furumi-fd/podcast-dht/1 (version 1) with its own SQLite cache. Devices
publish signed public podcast cards only where effective_share holds,
retract them with signed tombstones of the next revision, and search by
normalized title/author tokens or podcast id. Records are verified on
every receive and cache read. Adds typed federated search hits, the
advisory feed_url_privacy_warning helper, the podcast_dht capability and
MusicDhtError::PodcastPublication.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 18:32:40 +02:00