8000 feat(circles): people on other servers in your circles, over ActivityPub by adeelahmad · Pull Request #667 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(circles): people on other servers in your circles, over ActivityPub - #667

Merged
adeelahmad merged 1 commit into
mainfrom
claude/project-thread-97gkhw
Oct 19, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/project-thread-97gkhw

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: circles held only people on the same Lens, so family members running their own Lens, or on another ActivityPub server, couldn't be in them.

After: once an admin turns on Settings → Security and access → Circles elsewhere (federation.enabled, off by default) and a person makes themselves findable under Profile → Circles, they get a handle like adeel@lens.example. Circles can then hold people elsewhere by their handle. Sharing with such a circle sends each of them a signed ActivityPub Create of a Note (never the item itself, its links or anything in a vault), and what they send lands in the timeline as share.received, accepted only when signed by the key Lens kept, dated within five minutes, from the signing actor, and from someone in one of your circles.

How: domain/federation.py does WebFinger lookups through the existing net guard, HTTP Signatures (rsa-sha256) with per-person keys sealed with the server secret, and a retrying delivery queue; api/federation.py serves WebFinger, the actor, an empty outbox and the inbox, all 404 while off or for anyone not findable. Inbound text is stripped of HTML and marked as outside text.

Motivation and Context

The distributed half of the agent family network the thread asked for (ActivityPub direction); the fifth of the saved circles PRs after #626, #649, #653, #661 and #664.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests.
  • My change requires documentation updates, and I have updated docs/ accordingly.
  • Users need more than the title to understand it, so I wrote it in changelog.d/circles-elsewhere.md.

Done questions (AGENTS.md)

  • Goal: family on other servers join circles and shares travel both ways; merged on green CI.
  • Agents: API (/api/v1/circles/elsewhere, remote, add_remote, remove_remote), MCP circles_elsewhere and save_circle.
  • Zero setup: off by default; turning it on needs only the HTTPS domain or tunnel Lens already supports.
  • Fewest clicks: one admin toggle, one findable toggle, type a handle and press Enter.
  • Configurable: federation.enabled and federation.url in Settings with defaults; not in the wizard.
  • Light: no new service or dependency; a small queue in the existing worker.
  • Private and secure: off by default, opt-in per person, nothing discoverable, signed and dated inbox only from circle members, outbound through the net guard, keys sealed; threat model gains the federation entry point and P-FEDERATION.
  • Cost: no model call.
  • User decides: an admin turns it on and each person chooses to be findable; defaults unchanged.
  • Upgrades: n/a, new tables are created on first use and nothing existing changes shape.
  • Honest: docs label it built and list what only works on the same Lens under Refine later.
  • Tests (tests/api/test_federation.py, circles-ui.test.tsx), docs (docs/federation.md) and the generated client (make openapi) updated.
  • Open standards: ActivityPub, WebFinger, HTTP Signatures.
  • Reported in the project thread; refine later items in docs/federation.md.
  • Reuse: existing net guard, secret sealing, circles, timeline and untrusted-text wrapping.

Generated by Claude Code

Off until an admin turns on federation and a person makes themselves
findable (a handle, a key pair, WebFinger and an actor). Circles take
people elsewhere by handle; shares with them go as signed Create Notes
from a queue with back-off, undo sends a Delete. The inbox takes a Note
only signed with the key kept for someone in one of the person's
circles, recent and with a matching digest, as share.received.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012v8sNShSVTXxoPDab62A1L
@adeelahmad
adeelahmad merged commit 9a03fdd into main Oct 19, 2026
12 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-97gkhw branch October 19, 2026 05:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0