~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

Scaffold the host: workspace, console shell, lexicons and checks

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/group-host:scaffold

What changes

The workspace. Four crates, as knotless lays its own out: crates/atproto for the primitives (empty yet), crates/group-host for the server, crates/group-host-mcp for the MCP server (empty yet), and crates/opensocial for the client and the opensocial command. The host reads its config from the environment (docs/reference/config.md), answers GET /xrpc/_health, refuses every other method as MethodNotImplemented (501), and stops gracefully on SIGTERM.

The console. A SvelteKit app in web/ with knotless's structure: atoms, molecules, organisms and templates, tokens in tokens.css, types made from the lexicons by @atproto/lex, and XRPC asked of the host through #lib/data.ts and the server hook. One page so far, the groups on the host, which shows its empty state until listGroups is answered. Components are plain on purpose.

The lexicons. The prototype's core alone: the fyi.opensocial.* methods and records its packages/group-host serves, the two upstream methods it answers (com.atproto.managedspace.checkUserAccess, com.atproto.moderation.createReport), and the schemas they reference. Nothing of the sites module: the inbox lists only invites, and the permission sets name only core methods. @atproto/lex is the space alpha's build, as opensocial's, since the schemas use its space type and space-ref format.

The checks. check (fmt and clippy), test (every test under a 100% gate of lines and functions), web (layers, svelte-check, build) and lexicons (goat's lint and knotless's harness/lexicons.mjs). The prototype's schemas came with 152 findings; all of ours are fixed here rather than kept. Procedures that answered nothing now say so; strings people write have lengths; arrays hold small objects that can grow (roleRef, audience, scopeRef, collectionRef, accountRef, languageRef, topicRef in fyi.opensocial.defs); fields named type and id are spaceType, kind and clientId; provisionGroup's client_* fields are camelCase; group tokens' sessions and activity have views instead of unknown. The check holds fyi.opensocial.* to the guide and lets off only what the space alpha brings and goat (now 0.2.8) does not know yet: space-ref and permissions over a space. Upstream schemas copied for references are others' and only checked to grow.

The docs. AGENTS.md for agents, and docs/design/README.md with the order the rest of the host comes over in: atproto primitives, accounts and repos, groups and spaces, membership and roles, signing in, the console, moderation and moving, then MCP and the command.

Why

To build a group host that does what the opensocial.fyi prototype's core does, in Rust and Svelte with knotless's practices from the first commit: coverage held at 100%, the console's layers and tokens, lexicons checked, work landed by pull. The prototype is what we learned from, not a spec: each part takes the shape that is right here, and its pull says what changed.

How it was checked

Locally: cargo llvm-cov at 100% of lines and functions, clippy with warnings denied, harness/layers.mjs, harness/lexicons.mjs, and npm run check and npm run build in web/. This is the first run of the workflows on the runner.

Shortcomings

No method is answered yet beyond _health. The schemas are fixed to the guide but otherwise the prototype's; a part's pull reshapes them further where building it shows they should be.

Approved

This sets up the Cargo workspace, a host that answers _health and returns 501 MethodNotImplemented for every other method, and the SvelteKit console shell. It also adds the lexicons, the checks and the docs. All four workflows (check, test, web, lexicons) pass at the head commit.

I read the Rust crates, the web data layer and hooks, and the test workflow, and found nothing that must change. The host's config parsing, its graceful shutdown, and the way the console forwards XRPC calls and the session cookie only to GROUP_HOST all look right.

One thing to remember for later. web/src/routes/+page.ts turns any listGroups failure into an empty list. That fits the scaffold, as its comment says. Once the host answers listGroups, only a "method not implemented" reply should count as empty, so real errors show up on the page.

I did not read these files:

  • AGENTS.md at the base branch: it does not exist there, and the pull adds it.
  • The 100-odd lexicon JSON files, Cargo.lock, web/package-lock.json and the docs. The lexicons, the layer checks and the lexicons workflow cover them, and that workflow passed.
Merged as 7bfa7c3