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

A site's pages report what they see, as the visitor

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

A group's site can now let its pages act for the visitor, starting with reporting what they see to the group's moderators, and the site kit gets a reference page of its own. This branch sits on at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.pull/3n2hmbla3oq6n (site/writes): until that merges, this pull's diff shows its commits too.

Claude Opus 5.5

What changes

A site's acts. A site's record, and putSite, may name acts: the host's procedures its pages ask as whoever is looking, for now fyi.opensocial.createReport alone. A site naming any is live, as one naming reads or writes is; its sign-in asks an rpc: scope for each; a page asks one with os.act(method, input) from /_os/kit.js, refused as os.call is. A report from a site's page is checked, and queued, as any report is. opensocial site publish --acts, and the site_publish MCP tool, take them.

Sending moderators to what was reported. os.group() answers the console's address beside the group's DID and handle. The console's Moderation page takes ?review=<did or at:// URI> and opens that account's or record's Review, whatever its status, so a site's page can link a moderator straight to it.

The site kit's reference. docs/reference/site-kit.md: loading the kit, what a site declares, each ask with what it answers and how it is refused, the error's fields, <os-sign-in>, rules for a site's pages (relative links between pages; the kit after <title>; the paths the host keeps), and an example page from the e2e flow. The sites design page, the API, command and MCP references, and the site_publish description say what acts are.

Lexicons. putSite's InvalidSite names an act that is none a site may ask; listSpaceRecords says it is for someone signed in (it said anyone, signed in or not, which the host never did), and each error it lists says when it is answered.

Why

A group's own site, with no server, should let a member flag what is wrong on it, and the moderators find it in the queue they already work from. Acts are kept apart from reads: a read only answers, an act does something in the visitor's name, so a site names each it needs and the visitor's sign-in grants exactly those.

How it was checked

  • tests/sites.rs: a site with only acts is live and asks an rpc: scope per act; an act none may ask is InvalidSite; a report from a site's page lands in the queue.
  • just lex, just docs (no problems), the docs site builds, the MCP and command tests.
  • The kit page was written from facts gathered from the code, then checked against them; four bugs found doing so are filed rather than written up as behaviour: at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3n2mgxswk7bkp, at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3n2mgxvgowc3c, at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3n2mgxxt5eelv, at://did:plc:bcgltzqazw5tb6k2g3ttenbj/space/dev.knotless.space/group-host/did:plc:bcgltzqazw5tb6k2g3ttenbj/dev.knotless.issue/3n2mgy23te54v.
  • Left to CI: the coverage gate and the e2e flows on this branch alone (they passed locally on the branch above it).

Shortcomings

  • The console's site form gains its acts field in the next pull (site/spaces), so publishing from the console here leaves a site's acts out.
  • createReport is the only act a site may name.

Review

The kit page (docs/reference/site-kit.md) is the part a site author reads; web/shell/shell.ts's act and crates/group-host/src/sites.rs's acts checks are the code.

Approved

This adds site acts, with createReport as the only one. The record, putSite, the OAuth client's rpc: scopes, os.act and the shell's act handler all carry it. os.group() now returns the console's address, and the Moderation page takes ?review= for a DID or an at:// URI. It also adds the site-kit reference page.

I read sites.rs, shell.ts, site_kit.js and the moderation page server. I did not read the docs, lexicon, test, harness or Svelte files in full.

The change holds up:

  • The host rejects an act that is not in ACTS.
  • The shell rejects an act the site did not declare.
  • The scope is requested per act.
  • A site with only acts is live.

Two small things, neither blocking:

  • The ACTS doc comment says "or appealing what was done to them", but nothing like that is in ACTS. Drop the phrase.
  • authorOf in the moderation page returns parts[4], which is undefined for a malformed space URI such as at://x/space/t. That undefined goes straight to getActor as actor. Only moderators can reach this, but check that a short or odd ?review= value gives an empty result and not a 500.
Approved

This round only touches CI and the harness. It moves the space-alpha build out of test.yml into a shared harness/alpha.sh, so e2e.yml can run on the alpha too. setup.mjs now fails fast if GROUP_HOST_DEV_ENV names a build with no spaces. development.md is updated to match. What I approved earlier stands.

I read the script and the two workflows. The .built stamp check, the cache list (/opt/atproto is added to e2e) and the sqlite step's move into the script all look right. The test workflow keeps its own sqlite step for the stock PDS, which is still needed.

The diff doesn't change sites.rs or the moderation page. So the two small points from my last review are still open, and neither blocks the merge:

  • Drop "or appealing what was done to them" from the ACTS comment.
  • Make sure a short or odd ?review= value gives an empty result and not a 500. authorOf can pass undefined to getActor.
Approved

The head has no code change since the commit I approved (repo_diff shows none), so only the title or body changed. What I approved still stands. The two small points from before are still open, and neither blocks the merge:

  • Drop "or appealing what was done to them" from the ACTS comment.
  • Make sure a short or odd ?review= value gives an empty result and not a 500. authorOf can pass undefined to getActor.
Merged as 699ef98