Records Feature record

FDR-042

Chatto Neighbors

Experimental Last reviewed 2026-10-27 Source file

Overview

Chatto Neighbors is a public directory of Chatto servers that one server advertises. An administrator maintains the directory. A Neighbor is a recommendation, not a trust or reciprocal relationship.

Behavior

  • An administrator can create, read, update, and delete Neighbors in Server Configuration.
  • The administration form accepts a server hostname or URL. The client sends only the canonical HTTP or HTTPS origin for storage.
  • Each Neighbor contains one canonical HTTP or HTTPS server origin. A server can advertise at most 100 Neighbors.
  • A Neighbor origin cannot match the server's canonical webserver.url origin or an exact webserver.allowed_origins alias.
  • The directory has no ordering contract.
  • Any caller can list the advertised origins through the public discovery API.
  • Each server discovers its Neighborhood in the background. The Neighborhood contains each direct Neighbor whose public profile loads. It also contains servers that a mutually advertising Neighbor recommends when that recommendation is also mutual, to at most two mutual hops.
  • Any caller can list the cached Neighborhood through the public discovery API. The call does not contact other servers. Each result has the server origin, public name, version, description, logo, and banner. It also tells whether the called server advertises the result directly and which other Neighborhood servers mutually recommend it.
  • The server refreshes the Neighborhood when the cached result is one hour old. After a failed remote request, it refreshes when the cached result is ten minutes old. A Neighbor change starts a refresh within about fifteen seconds. One pass permits at most 150 directory requests and 120 profile requests, with six active requests and a ten-second timeout for each request.
  • Neighborhood discovery rejects redirects and servers on loopback, private, and link-local network addresses. The called server fetches, re-encodes, and serves logos and banners through its remote image proxy (ADR-128), so the browser does not contact the remote hosts. A logo or banner URL can use another public HTTP or HTTPS host than the advertised origin. The ListNeighborhoodServers response gives each image as a signed, server-relative path on the called server.
  • The Add Server action in the Server Gutter opens /chat/servers. This is the only Server Directory surface. Back returns to the previous page. Static hosting and Desktop open this directory directly instead of a separate welcome screen. A server-hosted frontend retains its required origin registration and its normal local sign-in or chat landing page.
  • The directory shows registered, explicitly discovered, and recommended servers in one grid without section headings or introductory text. This includes signed-out servers and the origin server. Saved cards use existing registration and store data. Recommendations exclude all registered servers, so each server appears once. A Connect by address action in the pane header opens the direct lookup in a modal. Close or Back dismisses it without changing the server grid. The lookup shows immediately for an empty catalogue. An empty catalogue shows a welcome heading and an explanation of independent communities above the address form, without a separate welcome step. A successful address lookup remembers the server as a known server on this device. A modal lookup also registers a compatible server with sign-in support and opens its signed-out view, without a separate Join action. Back returns to the directory with the modal closed. An already registered server opens with its existing session. Servers that cannot be joined remain in the directory with their existing fallback action. First-run lookup opens the directory instead of a preview. Known servers do not create a registration, session, live connection, or sidebar entry. Join remains the action for first-run results and recommendations, with compatibility and sign-in checks. Duplicate origins update the existing record instead of adding another card. The welcome uses an open layout without panels and links to the Chatto website at https://chatto.run. The link opens in a new tab without referrer data. The website receives the user's IP address only when they open it. An empty standalone catalogue does not contact a default third-party directory.
  • The directory and Neighbors administration share the server profile card. Each card reserves a fixed area for its description and scrolls longer text. Shared scroll fades indicate text beyond the visible edges. A 1200:630 banner sits above the logo, name, and hostname. The Server Directory uses two equal columns in narrow panes so mobile users can see more servers at once. Narrow cards use smaller logos, less padding, and smaller description text, with the logo above the name and hostname. Wide directory panes and the Neighbors administration grid use fixed 18rem cards. Extra space adds columns instead of stretching these cards. A darker footer shows Added by you or Recommended by with the first source name and a count of extra sources. Selecting the recommendation line opens all sources and their hostnames in a dialog, using cached data only. Back or Close dismisses the dialog. Every directory card has a centred status footer. Registered servers show Joined when authenticated and Needs login otherwise. Selecting a directory card opens or joins the server. Cards expose native link or button keyboard behavior. Clickability is optional; Neighbors administration retains its separate edit controls.
  • The Server Directory loads the cached Neighborhood of each registered or explicitly discovered server. These servers see the user's IP address when the directory loads. The address form explains that lookup adds the server and loads its recommendations. The client remembers public profile fields and source origins in device storage, never credentials. It does not query servers merely because they appear in a Neighborhood response. Their cached images still come from the source server. Discovery does not crawl recursively.
  • The client removes duplicate canonical origins. Registered servers come first, followed by explicitly added servers, then recommendations. Order within each set stays stable; the page has no separate groups or headings. A direct Neighbor of a registered server names that registered server as a source.
  • The Server Directory shows its results as server profile cards in a grid. A card without a banner shows a gradient that the server name selects.
  • The Neighbor administration page reads each advertised server's public name, description, logo, and banner from the current server's cached Neighborhood. It contacts no advertised server. It keeps an advertised server visible so that an administrator can review or remove it. After a Neighbor change, it shows the profile as loading and reads the cache again every three seconds for up to one minute.
  • A public profile card accepts a logo or banner only from one origin. For a cached profile, this is the server that supplied the cached copy. For a direct server-address lookup, this is the server at that address. The client loads the image without credentials or referrer data, rejects redirects, and accepts only responses that declare a supported raster image media type and contain at most 5 MiB. It uses normal browser caching. If the fetch fails with a network or CORS error, it retries once without using the cached response. This lets older servers replace cached responses that lack CORS headers without forcing a download on every visit.
  • The Server Directory sends one request to each registered server, with at most six active requests and a ten-second timeout for each request. A registered server that does not provide a Neighborhood contributes no results and does not count as a failure.
  • Joining a server adds it to the gutter without a session and opens its signed-out view. Back returns to the directory. The server view offers sign-in (FDR-023), including the inline Desktop password form (FDR-034). Joining does not submit credentials or open a sign-in window. Before it adds a recommended server, the client loads the server's current public data. The user starts this request with the join action. If the current version is not compatible or sign-in is not available, the client stops the join and shows the current action for that server.
  • A registered server appears first in the shared grid. Its action opens the server, also when the client has no session for it. A direct address lookup for a registered server also offers the open action instead of joining again.
  • An unregistered server has a join action only when its discovered version is compatible with the client. When the version is incompatible or unknown, the client opens the server origin in a new tab. The server can then provide its own compatible client.
  • A web handoff at /chat/<hostname> opens the saved server with that hostname on this device. Production links accept a hostname without a port. For a new hostname, the person must select Add Server before the client requests public server data. A successful check adds the server to the switcher and opens its normal signed-out view. A failed request keeps the hostname and offers a retry. Both saved and new server links keep the query string when navigating within the web app. Discovery receives only the server origin.
  • A user can enter a server address directly when the wanted server is not in the directory.
  • Neighbor administration does not contact a Neighbor, on the server or in the browser. Background Neighborhood discovery reads public data from Neighbors and their mutual recommendations. It does not test compatibility, ownership, or consent.
  • server.manage-neighbors controls administrative access. The permission is independently grantable. An effective server.manage allow includes it through explicit permission metadata.
  • Each administrative mutation writes a durable EVT fact. A resource revision prevents stale changes to the same Neighbor. Aggregate optimistic concurrency control preserves canonical-origin uniqueness across replicas.

Design Decisions

1. A Neighbor is an individual resource

Decision: Each Neighbor has a stable ID, a canonical origin, and an opaque revision. The administrative API provides list, get, create, update, and delete operations.

Why: Individual operations match administrator intent and do not replace unrelated directory state.

Tradeoff: The server maintains resource IDs and revisions in addition to origins.

2. Direct recommendations remain unilateral

Decision: The Server Directory shows a direct recommendation from a registered server without reciprocal confirmation. Neighborhood discovery expands that remote server only when it observes that both public directories advertise each other.

Why: Direct recommendations keep the directory useful for old servers and for servers that do not advertise their recommenders back. Observed mutuality prevents one unilateral recommendation from amplifying the recursive crawl.

Tradeoff: A direct result can remain one-sided. Two matching public responses are not durable consent or an authenticated relationship. The observation can change between requests.

3. The server stays passive and the client loads public profiles

Status: Superseded by ADR-106, Design Decision 14, and Design Decision 16. The server now contacts Neighbors for background Neighborhood discovery. The Server Directory and the Neighbor administration page read the cached result. Neighbor administration writes remain passive.

Decision: The server validates and stores canonical origins. It does not request discovery data, images, or health information from a Neighbor. The client requests public discovery data directly from advertised origins when it displays the Neighbor administration page. The Server Directory makes these requests only after the user gives consent or when the device has saved consent.

Why: Passive storage keeps writes deterministic and avoids remote effects inside the configuration operation.

Tradeoff: Opening the Neighbor administration page sends browser requests to advertised servers. The Server Directory sends them after consent. It omits an offline or invalid server. The administration page shows that server without a public profile so that an administrator can remove it.

4. Permission inclusion is explicit

Decision: server.manage explicitly includes server.manage-neighbors. Permission punctuation has no authority semantics.

Why: Existing server managers retain access, while an operator can delegate only Neighbor management.

Tradeoff: A narrow deny cannot remove Neighbor management from an effective server.manage allow.

5. Compatibility follows the server release boundary

Decision: A new client treats Unimplemented from an older server as an empty Neighbor directory. Public discovery returns only canonical origins and does not expose a feature flag.

Why: The bundled client owns minimum server versions. Method-level capability flags would duplicate that policy.

Tradeoff: A client that supports several server releases must handle the missing method explicitly.

6. Joined servers remain visible

Decision: The Server Directory does not remove an advertised origin when that server is already in the device-local server catalogue. It marks the server as joined and offers an action that opens the server.

Why: The complete directory shows the recommendation network without making entries disappear after a user joins them.

Tradeoff: The directory includes entries that do not offer a new server to join.

7. Deduplication preserves recommendation sources

Decision: One server appears once in the Server Directory. The result also identifies each source server whose recommendation is shown.

Why: A user can see where a recommendation comes from without seeing duplicate server cards.

Tradeoff: A source name can come from the device-local catalogue or from a cached Neighborhood profile. A cached name can be up to one hour old.

8. Recommendations contain no operator-written text

Decision: A Neighbor contains no operator-written text. Current APIs, projections, snapshots, and clients use only the Neighbor origin, ID, and revision. Legacy testimonial facts remain decodable for EVT replay. Their text has no projected effect, but each fact advances the Neighbor revision.

Why: Public operator-written text creates an abuse and moderation surface that is not necessary for server discovery.

Tradeoff: An operator cannot publish an explanation with a recommendation. Historical text remains in EVT, backups, and old snapshot generations until their normal retention policies remove it.

9. A server cannot advertise itself

Decision: Create and update operations reject an origin that identifies the server. This set includes the canonical webserver.url origin and each exact non-wildcard webserver.allowed_origins entry.

Why: A self-reference does not recommend another server. Reverse-proxy aliases must not make the same server appear as a separate Neighbor.

Tradeoff: A configuration change can make an existing Neighbor identify the server. Chatto keeps that historical Neighbor so an administrator can remove it or change it to an external origin.

10. Incompatible servers use their own client

Decision: The Server Directory does not add an unregistered server when the discovered version is below the client's minimum supported version or is unknown. It opens the canonical server origin in a new tab. Registered servers keep their open action.

Why: The remote server can provide a client that matches its release. The current client must not start a server registration flow that it cannot support.

Tradeoff: A server with a missing or non-standard version cannot use the direct join flow, even when it might work with the client.

11. Recursive discovery has a per-pass budget

Decision: Neighborhood discovery lists direct recommendations and follows at most two verified mutual hops. One pass permits at most 150 directory requests and 120 profile requests, with six active requests and a ten-second timeout for each request. It reads at most 100 origins from one remote directory.

Why: Recursive discovery can find servers beyond a direct recommendation, but one malicious or cyclic directory must not start unbounded work. Fixed limits make the maximum request effect testable.

Tradeoff: A pass can stop before it explores every recommendation. Result order reflects discovery order and the budget, not quality.

Status: Superseded by Design Decision 14 and ADR-106. The Server Directory contacts only registered servers, so it no longer asks for consent. A saved consent value from an older client has no effect.

Decision: The Server Directory does not contact advertised servers until the user selects Discover servers. Before that action, the client explains that each contacted server can see the user's IP address and technical connection details. The client saves consent in device-local storage. Direct server lookup remains available without Server Directory consent because the user supplies its server address in an explicit action. The Neighbor administration page does not use this prompt because administrators add the remote origins and open the page to inspect and manage them.

Why: Opening a page must not expose the user's network information to a set of remote systems without a clear choice. Device-local consent avoids a repeated prompt after the user understands and enables discovery. The administrator workflow already makes the remote systems and the purpose of the connections clear.

Tradeoff: A user must take one extra action before first use on each device or browser profile. Clearing local data makes the client ask again. An administrator does not get a separate connection prompt on the management page.

13. Public profile images use a restricted source

Decision: A public profile card accepts an image only from one expected origin: the server that supplied the cached copy, or the server at the address of a direct lookup. The request sends no credentials or referrer data, does not follow redirects, and accepts a limited set of declared raster image media types. It rejects an image response after its body exceeds 5 MiB.

Why: A profile must not make the client contact an unrelated image host or send reusable user credentials. Rejecting redirects prevents hidden network hops. The media-type and size limits bound untrusted image handling.

Tradeoff: Images on a content delivery network, redirected images, and SVG images do not display. A remote image response must permit the browser's cross-origin request.

14. The server discovers and caches the Neighborhood

Decision: Each server runs Neighborhood discovery in the background with the mutual-hop rules and fixed request limits. It stores the latest result in MEMORY_CACHE and image copies in ASSET_CACHE. The public ListNeighborhoodServers RPC returns only the cached result. The Server Directory merges the cached results of all registered servers and does not ask for consent. See ADR-106.

Why: A registered server already knows the user's IP address. When it contacts other servers, those servers do not see the user's address. A client can then show the Neighborhood without a consent step. One cached pass also replaces a separate crawl for each user visit.

Tradeoff: The server makes outbound requests and cannot reach servers on private network addresses. Results can be up to one hour old.

15. Discovery accepts profile images from other hosts

Decision: Neighborhood discovery accepts a logo or banner URL on any public HTTP or HTTPS host. A relative URL resolves against the advertised origin. ListNeighborhoodServers returns each cached copy as a server-relative path. The Server Directory resolves the path against the registered server that it called.

Why: A server builds its image URLs from its configured webserver.url. That host often differs from the origin that a Neighbor advertises, for example when a reverse proxy serves an alias. Discovery runs on the server, so the image host does not see the user's network address. A server-relative path always names the origin that the client called, also when the server does not configure that origin.

Tradeoff: A remote profile can make the server request an image from an unrelated public host. The request limits, private-address rejection, redirect rejection, and media-type and size limits of discovery still apply.

16. Neighbor administration uses the cached Neighborhood

Decision: The Neighbor administration page reads public profiles from the current server's cached Neighborhood. It does not request profiles or images from advertised servers. After a Neighbor change, it polls the cache for a short time until discovery adds the new profile.

Why: An administrator's network address must not reach the advertised servers, as for other users of the Server Directory. The cached Neighborhood already has each direct Neighbor whose public profile loads.

Tradeoff: A new or changed Neighbor shows its profile only after the next discovery pass, which usually starts within about fifteen seconds. A profile can be up to one hour old.

Permissions

  • server.manage-neighbors permits Neighbor administration.
  • An effective server.manage allow includes server.manage-neighbors.

Non-goals

  • Authenticated reciprocal requests, approval, rejection, or revocation
  • Server-to-server authentication or trust
  • Unbounded recursive Neighbor discovery
  • Directory ranking or sorting
  • Remote-server moderation or blocking
  • Server-side compatibility checks

Records that name this record

Esc