Skip to content

feat(locallibrary): read records from HappyView instead of data servers - #258

Draft
botandbang wants to merge 18 commits into
mainfrom
bnb/locallibrary-happyview
Draft

botandbang wants to merge 18 commits into
mainfrom
bnb/locallibrary-happyview

Conversation

@botandbang

Copy link
Copy Markdown
Contributor

Builds on #256.

What and why

locallibrary read records straight from each account's data server: the read before publishing settings, a DJ profile or a set; settings import; and the bug report space's version. Its handle resolution also fell back to public.api.bsky.app. It now reads HappyView, and handles resolve through DNS and .well-known only.

Added:

  • computer.localnetwork.directory.requestIndex, a procedure the website answers with inter-service auth from the caller's PDS. It has HappyView re-read the caller's own dj.set, dj.profile and locallibrary.settings, at most every ten minutes per account (a Backfills class the set picker now shares). locallibrary's permission set grants the call
  • atmosphere/directory.rs: reads through getRecords, with LOCALLIBRARY_HAPPYVIEW_URL and LOCALLIBRARY_WEBSITE_URL overrides. The first plan for an account calls requestIndex and remembers it in atmosphere.json

Changed:

  • Publishing swaps on the CID HappyView has; a mismatch says to run it again once the directory has caught up
  • dj/set.lua keeps a set's createdAt, sources and address as written, and comparisons only count the fields the lexicon defines, so an unchanged set reads as unchanged
  • Importing settings the directory doesn't have yet says so

It also corrects the README's figure for the follow gate, which was measured at 0.6 ms before the gate joined press kits to their projects.

Removed: --pds, the legacy plays publish record read, and the public AppView handle fallback.

How it was tested

  • The mock PDS also stands in for HappyView and the website; new integration tests cover the re-read, a write the directory hasn't caught up with, and someone else's settings it lacks, plus Hegel properties for the read and requestIndex outcomes
  • cargo nextest, clippy, cargo coverage and the Hegel coverage run; apps/web pnpm verify, pnpm test:integration and pnpm test:coverage
  • Windows clippy only runs in CI

Checklist

  • Tests cover the change
  • For the website: Storybook stories cover any new UI states
  • For locallibrary: apps/locallibrary/CHANGELOG.md has a line under Unreleased, if people using it will notice
  • The READMEs, docs/ and --help still say what the code does (apps/locallibrary/docs/rpc/ too, for a sidecar change)

…d of PDSes

HappyView now indexes community.lexicon.calendar.event, keeping only events by accounts that manage one of the root's projects, and re-reads managers' events once per record script version. The announce form, the changed-in-another-app marker, and the reads before a save or delete come from HappyView instead of the manager's PDS. The edit form carries the CIDs of the show and event it shows, and a save only lands on those: one that HappyView no longer serves is refused before anything is written, and the event and then the show are written with swapRecord on them, so a change made elsewhere asks the manager to reload. A new show stays one applyWrites, a delete removes the event and then the show, and saves and deletes wait for the event to be served too.
HappyView only learns of records from Jetstream or a per-account backfill, so locallibrary records written before HappyView indexed their collections were missing from it. The new computer.localnetwork.directory.requestIndex procedure, answered with inter-service auth, re-reads the caller's own dj.set, dj.profile and locallibrary.settings at most every ten minutes per account, through a Backfills class the set picker now shares. locallibrary's permission set grants the call. dj/set.lua also keeps a set's createdAt, sources and address as written, so a read before a write sees the record as published.
Publish plans, settings import and the bug report space's version now come from Local Network's directory instead of each account's data server, and writes swap on the CID the directory has. The first plan for an account asks the website to have the directory re-read it. --pds and the legacy plays publish record read are gone, and handles no longer fall back to Bluesky's AppView for resolution.
…bug report space from HappyView

HappyView now indexes app.bsky.graph.verification (the root's only), app.bsky.actor.profile (display names of verified accounts and project managers), app.bsky.graph.follow (follows by press kit owners whose kit lets the people they follow in) and app.userinput.space (the configured space only), each behind a record gate, with their lexicons checked in. Verifications, the display-name check, the press kit "following" audience and the bug report's space version read through IndexedRepo instead of PDSes. Verification grants swap on HappyView's CID and wait for it to serve the write. New verifications are limited to project managers, the only accounts besides verified ones whose display names HappyView keeps.
…vents

# Conflicts:
#	apps/web/README.md
#	apps/web/src/lib/server/forms/project.ts
#	apps/web/src/routes/projects/[slug]/+page.server.ts
…cords

# Conflicts:
#	apps/web/src/lib/server/services/epk.ts
# Conflicts:
#	apps/web/src/lib/server/services/projects.ts
…ky-records

# Conflicts:
#	apps/web/README.md
#	apps/web/src/lib/server/happyview/bundle.test.ts
#	apps/web/src/lib/server/happyview/refresh.ts
#	apps/web/src/lib/server/services/sets.test.ts
#	apps/web/tests/integration/flows.test.ts
…ppyview

# Conflicts:
#	apps/web/README.md
#	apps/web/src/lib/server/app.ts
#	apps/web/tests/integration/flows.test.ts
…ky-records

# Conflicts:
#	apps/web/README.md
#	apps/web/src/lib/server/app.ts
#	apps/web/src/lib/server/happyview/indexed.ts
#	apps/web/src/lib/server/services/epk.test.ts
#	apps/web/src/lib/server/services/epk.ts
…ppyview

# Conflicts:
#	apps/locallibrary/tests/it/main.rs
#	apps/web/README.md
#	apps/web/src/lib/server/services/projects.ts
#	apps/web/tests/integration/flows.test.ts
#	crates/locallibrary/src/atmosphere/repo/tests.rs
@github-actions github-actions Bot added documentation Improvements or additions to documentation web The Local Network website (apps/web) locallibrary locallibrary and the loclib-* crates lexicons The computer.localnetwork.* lexicons web: directory Directory search, the show matcher, genres and places web: projects Project profiles, claims, and the DJ stats and sets on them web: epk Press kits and who can see them web: staff Admin, moderation and the audit log web: server Spaces, sync, HappyView, the database and the server around them web: ui Shared components, design tokens, layout and the static pages locallibrary: cli The locallibrary command line labels Oct 26, 2026
@github-actions github-actions Bot added locallibrary: sidecar The JSON-RPC sidecar and the api module it serves locallibrary: core The core crate, the data model and rekordbox's formats locallibrary: publishing The Atmosphere account, and the sets and profile published to it tests Tests, fixtures and test harnesses labels Oct 26, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation lexicons The computer.localnetwork.* lexicons locallibrary: cli The locallibrary command line locallibrary: core The core crate, the data model and rekordbox's formats locallibrary: publishing The Atmosphere account, and the sets and profile published to it locallibrary: sidecar The JSON-RPC sidecar and the api module it serves locallibrary locallibrary and the loclib-* crates tests Tests, fixtures and test harnesses web: directory Directory search, the show matcher, genres and places web: epk Press kits and who can see them web: projects Project profiles, claims, and the DJ stats and sets on them web: server Spaces, sync, HappyView, the database and the server around them web: staff Admin, moderation and the audit log web: ui Shared components, design tokens, layout and the static pages web The Local Network website (apps/web)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants